aboutsummaryrefslogtreecommitdiff
path: root/externals/gridflow/bundled/Base/GemEvent.h
blob: a7ce1f4823966f7a3e9c09f0381d26442ade681b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/*-----------------------------------------------------------------
LOG
    GEM - Graphics Environment for Multimedia

    get keyboard/mouse/tablet callbacks

    Copyright (c) 1997-1999 Mark Danks. mark@danks.org
    Copyright (c) Günther Geiger. geiger@epy.co.at
    Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::für::umläute. IEM. zmoelnig@iem.kug.ac.at
    For information on usage and redistribution, and for a DISCLAIMER OF ALL
    WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.

-----------------------------------------------------------------*/

#ifndef INCLUDE_GEMEVENT_H_
#define INCLUDE_GEMEVENT_H_

#include "Base/GemExportDef.h"
//#include "Base/CPPExtern.h"

//////////////////////////////////////////////////////////////////
//
// Mouse motion callback
//
//////////////////////////////////////////////////////////////////
typedef void (*MOTION_CB)(int, int, void *);
//////////
// Set a mouse motion callback
GEM_EXTERN extern void setMotionCallback(MOTION_CB callback, void *data);

//////////
// Remove a mouse motion callback
GEM_EXTERN extern void removeMotionCallback(MOTION_CB callback, void *data);


//////////////////////////////////////////////////////////////////
//
// Mouse button callback
//
//////////////////////////////////////////////////////////////////
typedef void (*BUTTON_CB)(int, int, int, int, void *);
//////////
// Set a button callback
// which == 0 == left
// which == 1 == middle
// which == 2 == right
GEM_EXTERN extern void setButtonCallback(BUTTON_CB callback, void *data);

//////////
// Remove a button callback
GEM_EXTERN extern void removeButtonCallback(BUTTON_CB callback, void *data);


//////////////////////////////////////////////////////////////////
//
// Mouse wheel callback
//
//////////////////////////////////////////////////////////////////
typedef void (*WHEEL_CB)(int, int, void *);
//////////
// Set a wheel callback
GEM_EXTERN extern void setWheelCallback(WHEEL_CB callback, void *data);

//////////
// Remove a wheel callback
GEM_EXTERN extern void removeWheelCallback(WHEEL_CB callback, void *data);


//////////////////////////////////////////////////////////////////
//
// Tablet motion callback
//
//////////////////////////////////////////////////////////////////
typedef void (*TABMOTION_CB)(int, int, float, void *);
//////////
// Set a tablet motion callback
GEM_EXTERN extern void setTabletMotionCallback(TABMOTION_CB callback, void *data);

//////////
// Remove a tablet motion callback
GEM_EXTERN extern void removeTabletMotionCallback(TABMOTION_CB callback, void *data);


//////////////////////////////////////////////////////////////////
//
// Tablet rotation callback
//
//////////////////////////////////////////////////////////////////
typedef void (*TABROTATION_CB)(int, int, int, void *);
//////////
// Set a tablet rotation callback
GEM_EXTERN extern void setTabletRotationCallback(TABROTATION_CB callback, void *data);

//////////
// Remove a tablet rotation callback
GEM_EXTERN extern void removeTabletRotationCallback(TABROTATION_CB callback, void *data);


//////////////////////////////////////////////////////////////////
//
// Tablet button callback
//
//////////////////////////////////////////////////////////////////
typedef void (*TABBUTTON_CB)(int, int, int, int, void *);
//////////
// Set a tablet button callback
// which == 0 == left
// which == 1 == middle
// which == 2 == right
GEM_EXTERN extern void setTabletButtonCallback(TABBUTTON_CB callback, void *data);

//////////
// Remove a tablet button callback
GEM_EXTERN extern void removeTabletButtonCallback(TABBUTTON_CB callback, void *data);

//////////////////////////////////////////////////////////////////
//
// Keyboard callback
//
//////////////////////////////////////////////////////////////////
typedef void (*KEYBOARD_CB)(char *,int, int, void *);
//////////
// Set a keyboard callback
GEM_EXTERN extern void setKeyboardCallback(KEYBOARD_CB callback, void *data);

//////////
// Remove a keyboard callback
GEM_EXTERN extern void removeKeyboardCallback(KEYBOARD_CB callback, void *data);

//////////////////////////////////////////////////////////////////
//
// Resize callback
//
//////////////////////////////////////////////////////////////////
typedef void (*RESIZE_CB)(int, int, void *);
//////////
// Set a resize callback
GEM_EXTERN extern void setResizeCallback(RESIZE_CB callback, void *data);

//////////
// Remove a resize callback
GEM_EXTERN extern void removeResizeCallback(RESIZE_CB callback, void *data);

//////////
// Trigger an event
GEM_EXTERN extern void triggerMotionEvent(int x, int y);
GEM_EXTERN extern void triggerButtonEvent(int which, int state, int x, int y);
GEM_EXTERN extern void triggerWheelEvent(int axis, int value);
GEM_EXTERN extern void triggerTabletMotionEvent(int x, int y, float pressure);
GEM_EXTERN extern void triggerTabletRotationEvent(int az, int alt, int twist);
GEM_EXTERN extern void triggerTabletButtonEvent(int which, int state, int x, int y);
GEM_EXTERN extern void triggerKeyboardEvent(char *string, int value, int state);
GEM_EXTERN extern void triggerResizeEvent(int xSize, int ySize);

#endif  // for header file