jpayne@69
|
1 /************************************************************
|
jpayne@69
|
2
|
jpayne@69
|
3 Copyright 1989, 1998 The Open Group
|
jpayne@69
|
4
|
jpayne@69
|
5 Permission to use, copy, modify, distribute, and sell this software and its
|
jpayne@69
|
6 documentation for any purpose is hereby granted without fee, provided that
|
jpayne@69
|
7 the above copyright notice appear in all copies and that both that
|
jpayne@69
|
8 copyright notice and this permission notice appear in supporting
|
jpayne@69
|
9 documentation.
|
jpayne@69
|
10
|
jpayne@69
|
11 The above copyright notice and this permission notice shall be included in
|
jpayne@69
|
12 all copies or substantial portions of the Software.
|
jpayne@69
|
13
|
jpayne@69
|
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
jpayne@69
|
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
jpayne@69
|
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
jpayne@69
|
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
jpayne@69
|
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
jpayne@69
|
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
jpayne@69
|
20
|
jpayne@69
|
21 Except as contained in this notice, the name of The Open Group shall not be
|
jpayne@69
|
22 used in advertising or otherwise to promote the sale, use or other dealings
|
jpayne@69
|
23 in this Software without prior written authorization from The Open Group.
|
jpayne@69
|
24
|
jpayne@69
|
25 Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
|
jpayne@69
|
26
|
jpayne@69
|
27 All Rights Reserved
|
jpayne@69
|
28
|
jpayne@69
|
29 Permission to use, copy, modify, and distribute this software and its
|
jpayne@69
|
30 documentation for any purpose and without fee is hereby granted,
|
jpayne@69
|
31 provided that the above copyright notice appear in all copies and that
|
jpayne@69
|
32 both that copyright notice and this permission notice appear in
|
jpayne@69
|
33 supporting documentation, and that the name of Hewlett-Packard not be
|
jpayne@69
|
34 used in advertising or publicity pertaining to distribution of the
|
jpayne@69
|
35 software without specific, written prior permission.
|
jpayne@69
|
36
|
jpayne@69
|
37 HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
jpayne@69
|
38 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
jpayne@69
|
39 HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
jpayne@69
|
40 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
jpayne@69
|
41 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
jpayne@69
|
42 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
jpayne@69
|
43 SOFTWARE.
|
jpayne@69
|
44
|
jpayne@69
|
45 ********************************************************/
|
jpayne@69
|
46
|
jpayne@69
|
47 /* Definitions used by the library and client */
|
jpayne@69
|
48
|
jpayne@69
|
49 #ifndef _XINPUT_H_
|
jpayne@69
|
50 #define _XINPUT_H_
|
jpayne@69
|
51
|
jpayne@69
|
52 #include <X11/Xlib.h>
|
jpayne@69
|
53 #include <X11/extensions/XI.h>
|
jpayne@69
|
54
|
jpayne@69
|
55 #define _deviceKeyPress 0
|
jpayne@69
|
56 #define _deviceKeyRelease 1
|
jpayne@69
|
57
|
jpayne@69
|
58 #define _deviceButtonPress 0
|
jpayne@69
|
59 #define _deviceButtonRelease 1
|
jpayne@69
|
60
|
jpayne@69
|
61 #define _deviceMotionNotify 0
|
jpayne@69
|
62
|
jpayne@69
|
63 #define _deviceFocusIn 0
|
jpayne@69
|
64 #define _deviceFocusOut 1
|
jpayne@69
|
65
|
jpayne@69
|
66 #define _proximityIn 0
|
jpayne@69
|
67 #define _proximityOut 1
|
jpayne@69
|
68
|
jpayne@69
|
69 #define _deviceStateNotify 0
|
jpayne@69
|
70 #define _deviceMappingNotify 1
|
jpayne@69
|
71 #define _changeDeviceNotify 2
|
jpayne@69
|
72 /* Space of 3 between is necessary! Reserved for DeviceKeyStateNotify,
|
jpayne@69
|
73 DeviceButtonStateNotify, DevicePresenceNotify (essentially unused). This
|
jpayne@69
|
74 code has to be in sync with FixExtensionEvents() in xserver/Xi/extinit.c */
|
jpayne@69
|
75 #define _propertyNotify 6
|
jpayne@69
|
76
|
jpayne@69
|
77 #define FindTypeAndClass(d,type,_class,classid,offset) \
|
jpayne@69
|
78 { int _i; XInputClassInfo *_ip; \
|
jpayne@69
|
79 type = 0; _class = 0; \
|
jpayne@69
|
80 for (_i=0, _ip= ((XDevice *) d)->classes; \
|
jpayne@69
|
81 _i< ((XDevice *) d)->num_classes; \
|
jpayne@69
|
82 _i++, _ip++) \
|
jpayne@69
|
83 if (_ip->input_class == classid) \
|
jpayne@69
|
84 {type = _ip->event_type_base + offset; \
|
jpayne@69
|
85 _class = ((XDevice *) d)->device_id << 8 | type;}}
|
jpayne@69
|
86
|
jpayne@69
|
87 #define DeviceKeyPress(d,type,_class) \
|
jpayne@69
|
88 FindTypeAndClass(d, type, _class, KeyClass, _deviceKeyPress)
|
jpayne@69
|
89
|
jpayne@69
|
90 #define DeviceKeyRelease(d,type,_class) \
|
jpayne@69
|
91 FindTypeAndClass(d, type, _class, KeyClass, _deviceKeyRelease)
|
jpayne@69
|
92
|
jpayne@69
|
93 #define DeviceButtonPress(d,type,_class) \
|
jpayne@69
|
94 FindTypeAndClass(d, type, _class, ButtonClass, _deviceButtonPress)
|
jpayne@69
|
95
|
jpayne@69
|
96 #define DeviceButtonRelease(d,type,_class) \
|
jpayne@69
|
97 FindTypeAndClass(d, type, _class, ButtonClass, _deviceButtonRelease)
|
jpayne@69
|
98
|
jpayne@69
|
99 #define DeviceMotionNotify(d,type,_class) \
|
jpayne@69
|
100 FindTypeAndClass(d, type, _class, ValuatorClass, _deviceMotionNotify)
|
jpayne@69
|
101
|
jpayne@69
|
102 #define DeviceFocusIn(d,type,_class) \
|
jpayne@69
|
103 FindTypeAndClass(d, type, _class, FocusClass, _deviceFocusIn)
|
jpayne@69
|
104
|
jpayne@69
|
105 #define DeviceFocusOut(d,type,_class) \
|
jpayne@69
|
106 FindTypeAndClass(d, type, _class, FocusClass, _deviceFocusOut)
|
jpayne@69
|
107
|
jpayne@69
|
108 #define ProximityIn(d,type,_class) \
|
jpayne@69
|
109 FindTypeAndClass(d, type, _class, ProximityClass, _proximityIn)
|
jpayne@69
|
110
|
jpayne@69
|
111 #define ProximityOut(d,type,_class) \
|
jpayne@69
|
112 FindTypeAndClass(d, type, _class, ProximityClass, _proximityOut)
|
jpayne@69
|
113
|
jpayne@69
|
114 #define DeviceStateNotify(d,type,_class) \
|
jpayne@69
|
115 FindTypeAndClass(d, type, _class, OtherClass, _deviceStateNotify)
|
jpayne@69
|
116
|
jpayne@69
|
117 #define DeviceMappingNotify(d,type,_class) \
|
jpayne@69
|
118 FindTypeAndClass(d, type, _class, OtherClass, _deviceMappingNotify)
|
jpayne@69
|
119
|
jpayne@69
|
120 #define ChangeDeviceNotify(d,type,_class) \
|
jpayne@69
|
121 FindTypeAndClass(d, type, _class, OtherClass, _changeDeviceNotify)
|
jpayne@69
|
122
|
jpayne@69
|
123 #define DevicePropertyNotify(d, type, _class) \
|
jpayne@69
|
124 FindTypeAndClass(d, type, _class, OtherClass, _propertyNotify)
|
jpayne@69
|
125
|
jpayne@69
|
126 #define DevicePointerMotionHint(d,type,_class) \
|
jpayne@69
|
127 { _class = ((XDevice *) d)->device_id << 8 | _devicePointerMotionHint;}
|
jpayne@69
|
128
|
jpayne@69
|
129 #define DeviceButton1Motion(d,type,_class) \
|
jpayne@69
|
130 { _class = ((XDevice *) d)->device_id << 8 | _deviceButton1Motion;}
|
jpayne@69
|
131
|
jpayne@69
|
132 #define DeviceButton2Motion(d,type,_class) \
|
jpayne@69
|
133 { _class = ((XDevice *) d)->device_id << 8 | _deviceButton2Motion;}
|
jpayne@69
|
134
|
jpayne@69
|
135 #define DeviceButton3Motion(d,type,_class) \
|
jpayne@69
|
136 { _class = ((XDevice *) d)->device_id << 8 | _deviceButton3Motion;}
|
jpayne@69
|
137
|
jpayne@69
|
138 #define DeviceButton4Motion(d,type, _class) \
|
jpayne@69
|
139 { _class = ((XDevice *) d)->device_id << 8 | _deviceButton4Motion;}
|
jpayne@69
|
140
|
jpayne@69
|
141 #define DeviceButton5Motion(d,type,_class) \
|
jpayne@69
|
142 { _class = ((XDevice *) d)->device_id << 8 | _deviceButton5Motion;}
|
jpayne@69
|
143
|
jpayne@69
|
144 #define DeviceButtonMotion(d,type, _class) \
|
jpayne@69
|
145 { _class = ((XDevice *) d)->device_id << 8 | _deviceButtonMotion;}
|
jpayne@69
|
146
|
jpayne@69
|
147 #define DeviceOwnerGrabButton(d,type,_class) \
|
jpayne@69
|
148 { _class = ((XDevice *) d)->device_id << 8 | _deviceOwnerGrabButton;}
|
jpayne@69
|
149
|
jpayne@69
|
150 #define DeviceButtonPressGrab(d,type,_class) \
|
jpayne@69
|
151 { _class = ((XDevice *) d)->device_id << 8 | _deviceButtonGrab;}
|
jpayne@69
|
152
|
jpayne@69
|
153 #define NoExtensionEvent(d,type,_class) \
|
jpayne@69
|
154 { _class = ((XDevice *) d)->device_id << 8 | _noExtensionEvent;}
|
jpayne@69
|
155
|
jpayne@69
|
156
|
jpayne@69
|
157 /* We need the declaration for DevicePresence. */
|
jpayne@69
|
158 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
159 extern "C" {
|
jpayne@69
|
160 #endif
|
jpayne@69
|
161 extern int _XiGetDevicePresenceNotifyEvent(Display *);
|
jpayne@69
|
162 extern void _xibaddevice( Display *dpy, int *error);
|
jpayne@69
|
163 extern void _xibadclass( Display *dpy, int *error);
|
jpayne@69
|
164 extern void _xibadevent( Display *dpy, int *error);
|
jpayne@69
|
165 extern void _xibadmode( Display *dpy, int *error);
|
jpayne@69
|
166 extern void _xidevicebusy( Display *dpy, int *error);
|
jpayne@69
|
167 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
168 }
|
jpayne@69
|
169 #endif
|
jpayne@69
|
170
|
jpayne@69
|
171 #define DevicePresence(dpy, type, _class) \
|
jpayne@69
|
172 { \
|
jpayne@69
|
173 type = _XiGetDevicePresenceNotifyEvent(dpy); \
|
jpayne@69
|
174 _class = (0x10000 | _devicePresence); \
|
jpayne@69
|
175 }
|
jpayne@69
|
176
|
jpayne@69
|
177 /* Errors */
|
jpayne@69
|
178 #define BadDevice(dpy,error) _xibaddevice(dpy, &error)
|
jpayne@69
|
179
|
jpayne@69
|
180 #define BadClass(dpy,error) _xibadclass(dpy, &error)
|
jpayne@69
|
181
|
jpayne@69
|
182 #define BadEvent(dpy,error) _xibadevent(dpy, &error)
|
jpayne@69
|
183
|
jpayne@69
|
184 #define BadMode(dpy,error) _xibadmode(dpy, &error)
|
jpayne@69
|
185
|
jpayne@69
|
186 #define DeviceBusy(dpy,error) _xidevicebusy(dpy, &error)
|
jpayne@69
|
187
|
jpayne@69
|
188 typedef struct _XAnyClassinfo *XAnyClassPtr;
|
jpayne@69
|
189
|
jpayne@69
|
190 /***************************************************************
|
jpayne@69
|
191 *
|
jpayne@69
|
192 * DeviceKey events. These events are sent by input devices that
|
jpayne@69
|
193 * support input class Keys.
|
jpayne@69
|
194 * The location of the X pointer is reported in the coordinate
|
jpayne@69
|
195 * fields of the x,y and x_root,y_root fields.
|
jpayne@69
|
196 *
|
jpayne@69
|
197 */
|
jpayne@69
|
198
|
jpayne@69
|
199 typedef struct
|
jpayne@69
|
200 {
|
jpayne@69
|
201 int type; /* of event */
|
jpayne@69
|
202 unsigned long serial; /* # of last request processed */
|
jpayne@69
|
203 Bool send_event; /* true if from SendEvent request */
|
jpayne@69
|
204 Display *display; /* Display the event was read from */
|
jpayne@69
|
205 Window window; /* "event" window reported relative to */
|
jpayne@69
|
206 XID deviceid;
|
jpayne@69
|
207 Window root; /* root window event occurred on */
|
jpayne@69
|
208 Window subwindow; /* child window */
|
jpayne@69
|
209 Time time; /* milliseconds */
|
jpayne@69
|
210 int x, y; /* x, y coordinates in event window */
|
jpayne@69
|
211 int x_root; /* coordinates relative to root */
|
jpayne@69
|
212 int y_root; /* coordinates relative to root */
|
jpayne@69
|
213 unsigned int state; /* key or button mask */
|
jpayne@69
|
214 unsigned int keycode; /* detail */
|
jpayne@69
|
215 Bool same_screen; /* same screen flag */
|
jpayne@69
|
216 unsigned int device_state; /* device key or button mask */
|
jpayne@69
|
217 unsigned char axes_count;
|
jpayne@69
|
218 unsigned char first_axis;
|
jpayne@69
|
219 int axis_data[6];
|
jpayne@69
|
220 } XDeviceKeyEvent;
|
jpayne@69
|
221
|
jpayne@69
|
222 typedef XDeviceKeyEvent XDeviceKeyPressedEvent;
|
jpayne@69
|
223 typedef XDeviceKeyEvent XDeviceKeyReleasedEvent;
|
jpayne@69
|
224
|
jpayne@69
|
225 /*******************************************************************
|
jpayne@69
|
226 *
|
jpayne@69
|
227 * DeviceButton events. These events are sent by extension devices
|
jpayne@69
|
228 * that support input class Buttons.
|
jpayne@69
|
229 *
|
jpayne@69
|
230 */
|
jpayne@69
|
231
|
jpayne@69
|
232 typedef struct {
|
jpayne@69
|
233 int type; /* of event */
|
jpayne@69
|
234 unsigned long serial; /* # of last request processed by server */
|
jpayne@69
|
235 Bool send_event; /* true if from a SendEvent request */
|
jpayne@69
|
236 Display *display; /* Display the event was read from */
|
jpayne@69
|
237 Window window; /* "event" window reported relative to */
|
jpayne@69
|
238 XID deviceid;
|
jpayne@69
|
239 Window root; /* root window that the event occurred on */
|
jpayne@69
|
240 Window subwindow; /* child window */
|
jpayne@69
|
241 Time time; /* milliseconds */
|
jpayne@69
|
242 int x, y; /* x, y coordinates in event window */
|
jpayne@69
|
243 int x_root; /* coordinates relative to root */
|
jpayne@69
|
244 int y_root; /* coordinates relative to root */
|
jpayne@69
|
245 unsigned int state; /* key or button mask */
|
jpayne@69
|
246 unsigned int button; /* detail */
|
jpayne@69
|
247 Bool same_screen; /* same screen flag */
|
jpayne@69
|
248 unsigned int device_state; /* device key or button mask */
|
jpayne@69
|
249 unsigned char axes_count;
|
jpayne@69
|
250 unsigned char first_axis;
|
jpayne@69
|
251 int axis_data[6];
|
jpayne@69
|
252 } XDeviceButtonEvent;
|
jpayne@69
|
253
|
jpayne@69
|
254 typedef XDeviceButtonEvent XDeviceButtonPressedEvent;
|
jpayne@69
|
255 typedef XDeviceButtonEvent XDeviceButtonReleasedEvent;
|
jpayne@69
|
256
|
jpayne@69
|
257 /*******************************************************************
|
jpayne@69
|
258 *
|
jpayne@69
|
259 * DeviceMotionNotify event. These events are sent by extension devices
|
jpayne@69
|
260 * that support input class Valuators.
|
jpayne@69
|
261 *
|
jpayne@69
|
262 */
|
jpayne@69
|
263
|
jpayne@69
|
264 typedef struct
|
jpayne@69
|
265 {
|
jpayne@69
|
266 int type; /* of event */
|
jpayne@69
|
267 unsigned long serial; /* # of last request processed by server */
|
jpayne@69
|
268 Bool send_event; /* true if from a SendEvent request */
|
jpayne@69
|
269 Display *display; /* Display the event was read from */
|
jpayne@69
|
270 Window window; /* "event" window reported relative to */
|
jpayne@69
|
271 XID deviceid;
|
jpayne@69
|
272 Window root; /* root window that the event occurred on */
|
jpayne@69
|
273 Window subwindow; /* child window */
|
jpayne@69
|
274 Time time; /* milliseconds */
|
jpayne@69
|
275 int x, y; /* x, y coordinates in event window */
|
jpayne@69
|
276 int x_root; /* coordinates relative to root */
|
jpayne@69
|
277 int y_root; /* coordinates relative to root */
|
jpayne@69
|
278 unsigned int state; /* key or button mask */
|
jpayne@69
|
279 char is_hint; /* detail */
|
jpayne@69
|
280 Bool same_screen; /* same screen flag */
|
jpayne@69
|
281 unsigned int device_state; /* device key or button mask */
|
jpayne@69
|
282 unsigned char axes_count;
|
jpayne@69
|
283 unsigned char first_axis;
|
jpayne@69
|
284 int axis_data[6];
|
jpayne@69
|
285 } XDeviceMotionEvent;
|
jpayne@69
|
286
|
jpayne@69
|
287 /*******************************************************************
|
jpayne@69
|
288 *
|
jpayne@69
|
289 * DeviceFocusChange events. These events are sent when the focus
|
jpayne@69
|
290 * of an extension device that can be focused is changed.
|
jpayne@69
|
291 *
|
jpayne@69
|
292 */
|
jpayne@69
|
293
|
jpayne@69
|
294 typedef struct
|
jpayne@69
|
295 {
|
jpayne@69
|
296 int type; /* of event */
|
jpayne@69
|
297 unsigned long serial; /* # of last request processed by server */
|
jpayne@69
|
298 Bool send_event; /* true if from a SendEvent request */
|
jpayne@69
|
299 Display *display; /* Display the event was read from */
|
jpayne@69
|
300 Window window; /* "event" window reported relative to */
|
jpayne@69
|
301 XID deviceid;
|
jpayne@69
|
302 int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
|
jpayne@69
|
303 int detail;
|
jpayne@69
|
304 /*
|
jpayne@69
|
305 * NotifyAncestor, NotifyVirtual, NotifyInferior,
|
jpayne@69
|
306 * NotifyNonLinear,NotifyNonLinearVirtual, NotifyPointer,
|
jpayne@69
|
307 * NotifyPointerRoot, NotifyDetailNone
|
jpayne@69
|
308 */
|
jpayne@69
|
309 Time time;
|
jpayne@69
|
310 } XDeviceFocusChangeEvent;
|
jpayne@69
|
311
|
jpayne@69
|
312 typedef XDeviceFocusChangeEvent XDeviceFocusInEvent;
|
jpayne@69
|
313 typedef XDeviceFocusChangeEvent XDeviceFocusOutEvent;
|
jpayne@69
|
314
|
jpayne@69
|
315 /*******************************************************************
|
jpayne@69
|
316 *
|
jpayne@69
|
317 * ProximityNotify events. These events are sent by those absolute
|
jpayne@69
|
318 * positioning devices that are capable of generating proximity information.
|
jpayne@69
|
319 *
|
jpayne@69
|
320 */
|
jpayne@69
|
321
|
jpayne@69
|
322 typedef struct
|
jpayne@69
|
323 {
|
jpayne@69
|
324 int type; /* ProximityIn or ProximityOut */
|
jpayne@69
|
325 unsigned long serial; /* # of last request processed by server */
|
jpayne@69
|
326 Bool send_event; /* true if this came from a SendEvent request */
|
jpayne@69
|
327 Display *display; /* Display the event was read from */
|
jpayne@69
|
328 Window window;
|
jpayne@69
|
329 XID deviceid;
|
jpayne@69
|
330 Window root;
|
jpayne@69
|
331 Window subwindow;
|
jpayne@69
|
332 Time time;
|
jpayne@69
|
333 int x, y;
|
jpayne@69
|
334 int x_root, y_root;
|
jpayne@69
|
335 unsigned int state;
|
jpayne@69
|
336 Bool same_screen;
|
jpayne@69
|
337 unsigned int device_state; /* device key or button mask */
|
jpayne@69
|
338 unsigned char axes_count;
|
jpayne@69
|
339 unsigned char first_axis;
|
jpayne@69
|
340 int axis_data[6];
|
jpayne@69
|
341 } XProximityNotifyEvent;
|
jpayne@69
|
342 typedef XProximityNotifyEvent XProximityInEvent;
|
jpayne@69
|
343 typedef XProximityNotifyEvent XProximityOutEvent;
|
jpayne@69
|
344
|
jpayne@69
|
345 /*******************************************************************
|
jpayne@69
|
346 *
|
jpayne@69
|
347 * DeviceStateNotify events are generated on EnterWindow and FocusIn
|
jpayne@69
|
348 * for those clients who have selected DeviceState.
|
jpayne@69
|
349 *
|
jpayne@69
|
350 */
|
jpayne@69
|
351
|
jpayne@69
|
352 typedef struct
|
jpayne@69
|
353 {
|
jpayne@69
|
354 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
355 unsigned char c_class;
|
jpayne@69
|
356 #else
|
jpayne@69
|
357 unsigned char class;
|
jpayne@69
|
358 #endif
|
jpayne@69
|
359 unsigned char length;
|
jpayne@69
|
360 } XInputClass;
|
jpayne@69
|
361
|
jpayne@69
|
362 typedef struct {
|
jpayne@69
|
363 int type;
|
jpayne@69
|
364 unsigned long serial; /* # of last request processed by server */
|
jpayne@69
|
365 Bool send_event; /* true if this came from a SendEvent request */
|
jpayne@69
|
366 Display *display; /* Display the event was read from */
|
jpayne@69
|
367 Window window;
|
jpayne@69
|
368 XID deviceid;
|
jpayne@69
|
369 Time time;
|
jpayne@69
|
370 int num_classes;
|
jpayne@69
|
371 char data[64];
|
jpayne@69
|
372 } XDeviceStateNotifyEvent;
|
jpayne@69
|
373
|
jpayne@69
|
374 typedef struct {
|
jpayne@69
|
375 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
376 unsigned char c_class;
|
jpayne@69
|
377 #else
|
jpayne@69
|
378 unsigned char class;
|
jpayne@69
|
379 #endif
|
jpayne@69
|
380 unsigned char length;
|
jpayne@69
|
381 unsigned char num_valuators;
|
jpayne@69
|
382 unsigned char mode;
|
jpayne@69
|
383 int valuators[6];
|
jpayne@69
|
384 } XValuatorStatus;
|
jpayne@69
|
385
|
jpayne@69
|
386 typedef struct {
|
jpayne@69
|
387 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
388 unsigned char c_class;
|
jpayne@69
|
389 #else
|
jpayne@69
|
390 unsigned char class;
|
jpayne@69
|
391 #endif
|
jpayne@69
|
392 unsigned char length;
|
jpayne@69
|
393 short num_keys;
|
jpayne@69
|
394 char keys[32];
|
jpayne@69
|
395 } XKeyStatus;
|
jpayne@69
|
396
|
jpayne@69
|
397 typedef struct {
|
jpayne@69
|
398 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
399 unsigned char c_class;
|
jpayne@69
|
400 #else
|
jpayne@69
|
401 unsigned char class;
|
jpayne@69
|
402 #endif
|
jpayne@69
|
403 unsigned char length;
|
jpayne@69
|
404 short num_buttons;
|
jpayne@69
|
405 char buttons[32];
|
jpayne@69
|
406 } XButtonStatus;
|
jpayne@69
|
407
|
jpayne@69
|
408 /*******************************************************************
|
jpayne@69
|
409 *
|
jpayne@69
|
410 * DeviceMappingNotify event. This event is sent when the key mapping,
|
jpayne@69
|
411 * modifier mapping, or button mapping of an extension device is changed.
|
jpayne@69
|
412 *
|
jpayne@69
|
413 */
|
jpayne@69
|
414
|
jpayne@69
|
415 typedef struct {
|
jpayne@69
|
416 int type;
|
jpayne@69
|
417 unsigned long serial; /* # of last request processed by server */
|
jpayne@69
|
418 Bool send_event; /* true if this came from a SendEvent request */
|
jpayne@69
|
419 Display *display; /* Display the event was read from */
|
jpayne@69
|
420 Window window; /* unused */
|
jpayne@69
|
421 XID deviceid;
|
jpayne@69
|
422 Time time;
|
jpayne@69
|
423 int request; /* one of MappingModifier, MappingKeyboard,
|
jpayne@69
|
424 MappingPointer */
|
jpayne@69
|
425 int first_keycode;/* first keycode */
|
jpayne@69
|
426 int count; /* defines range of change w. first_keycode*/
|
jpayne@69
|
427 } XDeviceMappingEvent;
|
jpayne@69
|
428
|
jpayne@69
|
429 /*******************************************************************
|
jpayne@69
|
430 *
|
jpayne@69
|
431 * ChangeDeviceNotify event. This event is sent when an
|
jpayne@69
|
432 * XChangeKeyboard or XChangePointer request is made.
|
jpayne@69
|
433 *
|
jpayne@69
|
434 */
|
jpayne@69
|
435
|
jpayne@69
|
436 typedef struct {
|
jpayne@69
|
437 int type;
|
jpayne@69
|
438 unsigned long serial; /* # of last request processed by server */
|
jpayne@69
|
439 Bool send_event; /* true if this came from a SendEvent request */
|
jpayne@69
|
440 Display *display; /* Display the event was read from */
|
jpayne@69
|
441 Window window; /* unused */
|
jpayne@69
|
442 XID deviceid;
|
jpayne@69
|
443 Time time;
|
jpayne@69
|
444 int request; /* NewPointer or NewKeyboard */
|
jpayne@69
|
445 } XChangeDeviceNotifyEvent;
|
jpayne@69
|
446
|
jpayne@69
|
447 /*******************************************************************
|
jpayne@69
|
448 *
|
jpayne@69
|
449 * DevicePresenceNotify event. This event is sent when the list of
|
jpayne@69
|
450 * input devices changes, in which case devchange will be false, and
|
jpayne@69
|
451 * no information about the change will be contained in the event;
|
jpayne@69
|
452 * the client should use XListInputDevices() to learn what has changed.
|
jpayne@69
|
453 *
|
jpayne@69
|
454 * If devchange is true, an attribute that the server believes is
|
jpayne@69
|
455 * important has changed on a device, and the client should use
|
jpayne@69
|
456 * XGetDeviceControl to examine the device. If control is non-zero,
|
jpayne@69
|
457 * then that control has changed meaningfully.
|
jpayne@69
|
458 */
|
jpayne@69
|
459
|
jpayne@69
|
460 typedef struct {
|
jpayne@69
|
461 int type;
|
jpayne@69
|
462 unsigned long serial; /* # of last request processed by server */
|
jpayne@69
|
463 Bool send_event; /* true if this came from a SendEvent request */
|
jpayne@69
|
464 Display *display; /* Display the event was read from */
|
jpayne@69
|
465 Window window; /* unused */
|
jpayne@69
|
466 Time time;
|
jpayne@69
|
467 Bool devchange;
|
jpayne@69
|
468 XID deviceid;
|
jpayne@69
|
469 XID control;
|
jpayne@69
|
470 } XDevicePresenceNotifyEvent;
|
jpayne@69
|
471
|
jpayne@69
|
472 /*
|
jpayne@69
|
473 * Notifies the client that a property on a device has changed value. The
|
jpayne@69
|
474 * client is expected to query the server for updated value of the property.
|
jpayne@69
|
475 */
|
jpayne@69
|
476 typedef struct {
|
jpayne@69
|
477 int type;
|
jpayne@69
|
478 unsigned long serial; /* # of last request processed by server */
|
jpayne@69
|
479 Bool send_event; /* true if this came from a SendEvent request */
|
jpayne@69
|
480 Display *display; /* Display the event was read from */
|
jpayne@69
|
481 Window window; /* unused */
|
jpayne@69
|
482 Time time;
|
jpayne@69
|
483 XID deviceid; /* id of the device that changed */
|
jpayne@69
|
484 Atom atom; /* the property that changed */
|
jpayne@69
|
485 int state; /* PropertyNewValue or PropertyDeleted */
|
jpayne@69
|
486 } XDevicePropertyNotifyEvent;
|
jpayne@69
|
487
|
jpayne@69
|
488
|
jpayne@69
|
489 /*******************************************************************
|
jpayne@69
|
490 *
|
jpayne@69
|
491 * Control structures for input devices that support input class
|
jpayne@69
|
492 * Feedback. These are used by the XGetFeedbackControl and
|
jpayne@69
|
493 * XChangeFeedbackControl functions.
|
jpayne@69
|
494 *
|
jpayne@69
|
495 */
|
jpayne@69
|
496
|
jpayne@69
|
497 typedef struct {
|
jpayne@69
|
498 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
499 XID c_class;
|
jpayne@69
|
500 #else
|
jpayne@69
|
501 XID class;
|
jpayne@69
|
502 #endif
|
jpayne@69
|
503 int length;
|
jpayne@69
|
504 XID id;
|
jpayne@69
|
505 } XFeedbackState;
|
jpayne@69
|
506
|
jpayne@69
|
507 typedef struct {
|
jpayne@69
|
508 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
509 XID c_class;
|
jpayne@69
|
510 #else
|
jpayne@69
|
511 XID class;
|
jpayne@69
|
512 #endif
|
jpayne@69
|
513 int length;
|
jpayne@69
|
514 XID id;
|
jpayne@69
|
515 int click;
|
jpayne@69
|
516 int percent;
|
jpayne@69
|
517 int pitch;
|
jpayne@69
|
518 int duration;
|
jpayne@69
|
519 int led_mask;
|
jpayne@69
|
520 int global_auto_repeat;
|
jpayne@69
|
521 char auto_repeats[32];
|
jpayne@69
|
522 } XKbdFeedbackState;
|
jpayne@69
|
523
|
jpayne@69
|
524 typedef struct {
|
jpayne@69
|
525 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
526 XID c_class;
|
jpayne@69
|
527 #else
|
jpayne@69
|
528 XID class;
|
jpayne@69
|
529 #endif
|
jpayne@69
|
530 int length;
|
jpayne@69
|
531 XID id;
|
jpayne@69
|
532 int accelNum;
|
jpayne@69
|
533 int accelDenom;
|
jpayne@69
|
534 int threshold;
|
jpayne@69
|
535 } XPtrFeedbackState;
|
jpayne@69
|
536
|
jpayne@69
|
537 typedef struct {
|
jpayne@69
|
538 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
539 XID c_class;
|
jpayne@69
|
540 #else
|
jpayne@69
|
541 XID class;
|
jpayne@69
|
542 #endif
|
jpayne@69
|
543 int length;
|
jpayne@69
|
544 XID id;
|
jpayne@69
|
545 int resolution;
|
jpayne@69
|
546 int minVal;
|
jpayne@69
|
547 int maxVal;
|
jpayne@69
|
548 } XIntegerFeedbackState;
|
jpayne@69
|
549
|
jpayne@69
|
550 typedef struct {
|
jpayne@69
|
551 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
552 XID c_class;
|
jpayne@69
|
553 #else
|
jpayne@69
|
554 XID class;
|
jpayne@69
|
555 #endif
|
jpayne@69
|
556 int length;
|
jpayne@69
|
557 XID id;
|
jpayne@69
|
558 int max_symbols;
|
jpayne@69
|
559 int num_syms_supported;
|
jpayne@69
|
560 KeySym *syms_supported;
|
jpayne@69
|
561 } XStringFeedbackState;
|
jpayne@69
|
562
|
jpayne@69
|
563 typedef struct {
|
jpayne@69
|
564 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
565 XID c_class;
|
jpayne@69
|
566 #else
|
jpayne@69
|
567 XID class;
|
jpayne@69
|
568 #endif
|
jpayne@69
|
569 int length;
|
jpayne@69
|
570 XID id;
|
jpayne@69
|
571 int percent;
|
jpayne@69
|
572 int pitch;
|
jpayne@69
|
573 int duration;
|
jpayne@69
|
574 } XBellFeedbackState;
|
jpayne@69
|
575
|
jpayne@69
|
576 typedef struct {
|
jpayne@69
|
577 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
578 XID c_class;
|
jpayne@69
|
579 #else
|
jpayne@69
|
580 XID class;
|
jpayne@69
|
581 #endif
|
jpayne@69
|
582 int length;
|
jpayne@69
|
583 XID id;
|
jpayne@69
|
584 int led_values;
|
jpayne@69
|
585 int led_mask;
|
jpayne@69
|
586 } XLedFeedbackState;
|
jpayne@69
|
587
|
jpayne@69
|
588 typedef struct {
|
jpayne@69
|
589 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
590 XID c_class;
|
jpayne@69
|
591 #else
|
jpayne@69
|
592 XID class;
|
jpayne@69
|
593 #endif
|
jpayne@69
|
594 int length;
|
jpayne@69
|
595 XID id;
|
jpayne@69
|
596 } XFeedbackControl;
|
jpayne@69
|
597
|
jpayne@69
|
598 typedef struct {
|
jpayne@69
|
599 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
600 XID c_class;
|
jpayne@69
|
601 #else
|
jpayne@69
|
602 XID class;
|
jpayne@69
|
603 #endif
|
jpayne@69
|
604 int length;
|
jpayne@69
|
605 XID id;
|
jpayne@69
|
606 int accelNum;
|
jpayne@69
|
607 int accelDenom;
|
jpayne@69
|
608 int threshold;
|
jpayne@69
|
609 } XPtrFeedbackControl;
|
jpayne@69
|
610
|
jpayne@69
|
611 typedef struct {
|
jpayne@69
|
612 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
613 XID c_class;
|
jpayne@69
|
614 #else
|
jpayne@69
|
615 XID class;
|
jpayne@69
|
616 #endif
|
jpayne@69
|
617 int length;
|
jpayne@69
|
618 XID id;
|
jpayne@69
|
619 int click;
|
jpayne@69
|
620 int percent;
|
jpayne@69
|
621 int pitch;
|
jpayne@69
|
622 int duration;
|
jpayne@69
|
623 int led_mask;
|
jpayne@69
|
624 int led_value;
|
jpayne@69
|
625 int key;
|
jpayne@69
|
626 int auto_repeat_mode;
|
jpayne@69
|
627 } XKbdFeedbackControl;
|
jpayne@69
|
628
|
jpayne@69
|
629 typedef struct {
|
jpayne@69
|
630 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
631 XID c_class;
|
jpayne@69
|
632 #else
|
jpayne@69
|
633 XID class;
|
jpayne@69
|
634 #endif
|
jpayne@69
|
635 int length;
|
jpayne@69
|
636 XID id;
|
jpayne@69
|
637 int num_keysyms;
|
jpayne@69
|
638 KeySym *syms_to_display;
|
jpayne@69
|
639 } XStringFeedbackControl;
|
jpayne@69
|
640
|
jpayne@69
|
641 typedef struct {
|
jpayne@69
|
642 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
643 XID c_class;
|
jpayne@69
|
644 #else
|
jpayne@69
|
645 XID class;
|
jpayne@69
|
646 #endif
|
jpayne@69
|
647 int length;
|
jpayne@69
|
648 XID id;
|
jpayne@69
|
649 int int_to_display;
|
jpayne@69
|
650 } XIntegerFeedbackControl;
|
jpayne@69
|
651
|
jpayne@69
|
652 typedef struct {
|
jpayne@69
|
653 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
654 XID c_class;
|
jpayne@69
|
655 #else
|
jpayne@69
|
656 XID class;
|
jpayne@69
|
657 #endif
|
jpayne@69
|
658 int length;
|
jpayne@69
|
659 XID id;
|
jpayne@69
|
660 int percent;
|
jpayne@69
|
661 int pitch;
|
jpayne@69
|
662 int duration;
|
jpayne@69
|
663 } XBellFeedbackControl;
|
jpayne@69
|
664
|
jpayne@69
|
665 typedef struct {
|
jpayne@69
|
666 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
667 XID c_class;
|
jpayne@69
|
668 #else
|
jpayne@69
|
669 XID class;
|
jpayne@69
|
670 #endif
|
jpayne@69
|
671 int length;
|
jpayne@69
|
672 XID id;
|
jpayne@69
|
673 int led_mask;
|
jpayne@69
|
674 int led_values;
|
jpayne@69
|
675 } XLedFeedbackControl;
|
jpayne@69
|
676
|
jpayne@69
|
677 /*******************************************************************
|
jpayne@69
|
678 *
|
jpayne@69
|
679 * Device control structures.
|
jpayne@69
|
680 *
|
jpayne@69
|
681 */
|
jpayne@69
|
682
|
jpayne@69
|
683 typedef struct {
|
jpayne@69
|
684 XID control;
|
jpayne@69
|
685 int length;
|
jpayne@69
|
686 } XDeviceControl;
|
jpayne@69
|
687
|
jpayne@69
|
688 typedef struct {
|
jpayne@69
|
689 XID control;
|
jpayne@69
|
690 int length;
|
jpayne@69
|
691 int first_valuator;
|
jpayne@69
|
692 int num_valuators;
|
jpayne@69
|
693 int *resolutions;
|
jpayne@69
|
694 } XDeviceResolutionControl;
|
jpayne@69
|
695
|
jpayne@69
|
696 typedef struct {
|
jpayne@69
|
697 XID control;
|
jpayne@69
|
698 int length;
|
jpayne@69
|
699 int num_valuators;
|
jpayne@69
|
700 int *resolutions;
|
jpayne@69
|
701 int *min_resolutions;
|
jpayne@69
|
702 int *max_resolutions;
|
jpayne@69
|
703 } XDeviceResolutionState;
|
jpayne@69
|
704
|
jpayne@69
|
705 typedef struct {
|
jpayne@69
|
706 XID control;
|
jpayne@69
|
707 int length;
|
jpayne@69
|
708 int min_x;
|
jpayne@69
|
709 int max_x;
|
jpayne@69
|
710 int min_y;
|
jpayne@69
|
711 int max_y;
|
jpayne@69
|
712 int flip_x;
|
jpayne@69
|
713 int flip_y;
|
jpayne@69
|
714 int rotation;
|
jpayne@69
|
715 int button_threshold;
|
jpayne@69
|
716 } XDeviceAbsCalibControl, XDeviceAbsCalibState;
|
jpayne@69
|
717
|
jpayne@69
|
718 typedef struct {
|
jpayne@69
|
719 XID control;
|
jpayne@69
|
720 int length;
|
jpayne@69
|
721 int offset_x;
|
jpayne@69
|
722 int offset_y;
|
jpayne@69
|
723 int width;
|
jpayne@69
|
724 int height;
|
jpayne@69
|
725 int screen;
|
jpayne@69
|
726 XID following;
|
jpayne@69
|
727 } XDeviceAbsAreaControl, XDeviceAbsAreaState;
|
jpayne@69
|
728
|
jpayne@69
|
729 typedef struct {
|
jpayne@69
|
730 XID control;
|
jpayne@69
|
731 int length;
|
jpayne@69
|
732 int status;
|
jpayne@69
|
733 } XDeviceCoreControl;
|
jpayne@69
|
734
|
jpayne@69
|
735 typedef struct {
|
jpayne@69
|
736 XID control;
|
jpayne@69
|
737 int length;
|
jpayne@69
|
738 int status;
|
jpayne@69
|
739 int iscore;
|
jpayne@69
|
740 } XDeviceCoreState;
|
jpayne@69
|
741
|
jpayne@69
|
742 typedef struct {
|
jpayne@69
|
743 XID control;
|
jpayne@69
|
744 int length;
|
jpayne@69
|
745 int enable;
|
jpayne@69
|
746 } XDeviceEnableControl, XDeviceEnableState;
|
jpayne@69
|
747
|
jpayne@69
|
748 /*******************************************************************
|
jpayne@69
|
749 *
|
jpayne@69
|
750 * An array of XDeviceList structures is returned by the
|
jpayne@69
|
751 * XListInputDevices function. Each entry contains information
|
jpayne@69
|
752 * about one input device. Among that information is an array of
|
jpayne@69
|
753 * pointers to structures that describe the characteristics of
|
jpayne@69
|
754 * the input device.
|
jpayne@69
|
755 *
|
jpayne@69
|
756 */
|
jpayne@69
|
757
|
jpayne@69
|
758 typedef struct _XAnyClassinfo {
|
jpayne@69
|
759 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
760 XID c_class;
|
jpayne@69
|
761 #else
|
jpayne@69
|
762 XID class;
|
jpayne@69
|
763 #endif
|
jpayne@69
|
764 int length;
|
jpayne@69
|
765 } XAnyClassInfo;
|
jpayne@69
|
766
|
jpayne@69
|
767 typedef struct _XDeviceInfo *XDeviceInfoPtr;
|
jpayne@69
|
768
|
jpayne@69
|
769 typedef struct _XDeviceInfo
|
jpayne@69
|
770 {
|
jpayne@69
|
771 XID id;
|
jpayne@69
|
772 Atom type;
|
jpayne@69
|
773 char *name;
|
jpayne@69
|
774 int num_classes;
|
jpayne@69
|
775 int use;
|
jpayne@69
|
776 XAnyClassPtr inputclassinfo;
|
jpayne@69
|
777 } XDeviceInfo;
|
jpayne@69
|
778
|
jpayne@69
|
779 typedef struct _XKeyInfo *XKeyInfoPtr;
|
jpayne@69
|
780
|
jpayne@69
|
781 typedef struct _XKeyInfo
|
jpayne@69
|
782 {
|
jpayne@69
|
783 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
784 XID c_class;
|
jpayne@69
|
785 #else
|
jpayne@69
|
786 XID class;
|
jpayne@69
|
787 #endif
|
jpayne@69
|
788 int length;
|
jpayne@69
|
789 unsigned short min_keycode;
|
jpayne@69
|
790 unsigned short max_keycode;
|
jpayne@69
|
791 unsigned short num_keys;
|
jpayne@69
|
792 } XKeyInfo;
|
jpayne@69
|
793
|
jpayne@69
|
794 typedef struct _XButtonInfo *XButtonInfoPtr;
|
jpayne@69
|
795
|
jpayne@69
|
796 typedef struct _XButtonInfo {
|
jpayne@69
|
797 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
798 XID c_class;
|
jpayne@69
|
799 #else
|
jpayne@69
|
800 XID class;
|
jpayne@69
|
801 #endif
|
jpayne@69
|
802 int length;
|
jpayne@69
|
803 short num_buttons;
|
jpayne@69
|
804 } XButtonInfo;
|
jpayne@69
|
805
|
jpayne@69
|
806 typedef struct _XAxisInfo *XAxisInfoPtr;
|
jpayne@69
|
807
|
jpayne@69
|
808 typedef struct _XAxisInfo {
|
jpayne@69
|
809 int resolution;
|
jpayne@69
|
810 int min_value;
|
jpayne@69
|
811 int max_value;
|
jpayne@69
|
812 } XAxisInfo;
|
jpayne@69
|
813
|
jpayne@69
|
814 typedef struct _XValuatorInfo *XValuatorInfoPtr;
|
jpayne@69
|
815
|
jpayne@69
|
816 typedef struct _XValuatorInfo
|
jpayne@69
|
817 {
|
jpayne@69
|
818 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
819 XID c_class;
|
jpayne@69
|
820 #else
|
jpayne@69
|
821 XID class;
|
jpayne@69
|
822 #endif
|
jpayne@69
|
823 int length;
|
jpayne@69
|
824 unsigned char num_axes;
|
jpayne@69
|
825 unsigned char mode;
|
jpayne@69
|
826 unsigned long motion_buffer;
|
jpayne@69
|
827 XAxisInfoPtr axes;
|
jpayne@69
|
828 } XValuatorInfo;
|
jpayne@69
|
829
|
jpayne@69
|
830 /*******************************************************************
|
jpayne@69
|
831 *
|
jpayne@69
|
832 * An XDevice structure is returned by the XOpenDevice function.
|
jpayne@69
|
833 * It contains an array of pointers to XInputClassInfo structures.
|
jpayne@69
|
834 * Each contains information about a class of input supported by the
|
jpayne@69
|
835 * device, including a pointer to an array of data for each type of event
|
jpayne@69
|
836 * the device reports.
|
jpayne@69
|
837 *
|
jpayne@69
|
838 */
|
jpayne@69
|
839
|
jpayne@69
|
840
|
jpayne@69
|
841 typedef struct {
|
jpayne@69
|
842 unsigned char input_class;
|
jpayne@69
|
843 unsigned char event_type_base;
|
jpayne@69
|
844 } XInputClassInfo;
|
jpayne@69
|
845
|
jpayne@69
|
846 typedef struct {
|
jpayne@69
|
847 XID device_id;
|
jpayne@69
|
848 int num_classes;
|
jpayne@69
|
849 XInputClassInfo *classes;
|
jpayne@69
|
850 } XDevice;
|
jpayne@69
|
851
|
jpayne@69
|
852
|
jpayne@69
|
853 /*******************************************************************
|
jpayne@69
|
854 *
|
jpayne@69
|
855 * The following structure is used to return information for the
|
jpayne@69
|
856 * XGetSelectedExtensionEvents function.
|
jpayne@69
|
857 *
|
jpayne@69
|
858 */
|
jpayne@69
|
859
|
jpayne@69
|
860 typedef struct {
|
jpayne@69
|
861 XEventClass event_type;
|
jpayne@69
|
862 XID device;
|
jpayne@69
|
863 } XEventList;
|
jpayne@69
|
864
|
jpayne@69
|
865 /*******************************************************************
|
jpayne@69
|
866 *
|
jpayne@69
|
867 * The following structure is used to return motion history data from
|
jpayne@69
|
868 * an input device that supports the input class Valuators.
|
jpayne@69
|
869 * This information is returned by the XGetDeviceMotionEvents function.
|
jpayne@69
|
870 *
|
jpayne@69
|
871 */
|
jpayne@69
|
872
|
jpayne@69
|
873 typedef struct {
|
jpayne@69
|
874 Time time;
|
jpayne@69
|
875 int *data;
|
jpayne@69
|
876 } XDeviceTimeCoord;
|
jpayne@69
|
877
|
jpayne@69
|
878
|
jpayne@69
|
879 /*******************************************************************
|
jpayne@69
|
880 *
|
jpayne@69
|
881 * Device state structure.
|
jpayne@69
|
882 * This is returned by the XQueryDeviceState request.
|
jpayne@69
|
883 *
|
jpayne@69
|
884 */
|
jpayne@69
|
885
|
jpayne@69
|
886 typedef struct {
|
jpayne@69
|
887 XID device_id;
|
jpayne@69
|
888 int num_classes;
|
jpayne@69
|
889 XInputClass *data;
|
jpayne@69
|
890 } XDeviceState;
|
jpayne@69
|
891
|
jpayne@69
|
892 /*******************************************************************
|
jpayne@69
|
893 *
|
jpayne@69
|
894 * Note that the mode field is a bitfield that reports the Proximity
|
jpayne@69
|
895 * status of the device as well as the mode. The mode field should
|
jpayne@69
|
896 * be OR'd with the mask DeviceMode and compared with the values
|
jpayne@69
|
897 * Absolute and Relative to determine the mode, and should be OR'd
|
jpayne@69
|
898 * with the mask ProximityState and compared with the values InProximity
|
jpayne@69
|
899 * and OutOfProximity to determine the proximity state.
|
jpayne@69
|
900 *
|
jpayne@69
|
901 */
|
jpayne@69
|
902
|
jpayne@69
|
903 typedef struct {
|
jpayne@69
|
904 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
905 unsigned char c_class;
|
jpayne@69
|
906 #else
|
jpayne@69
|
907 unsigned char class;
|
jpayne@69
|
908 #endif
|
jpayne@69
|
909 unsigned char length;
|
jpayne@69
|
910 unsigned char num_valuators;
|
jpayne@69
|
911 unsigned char mode;
|
jpayne@69
|
912 int *valuators;
|
jpayne@69
|
913 } XValuatorState;
|
jpayne@69
|
914
|
jpayne@69
|
915 typedef struct {
|
jpayne@69
|
916 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
917 unsigned char c_class;
|
jpayne@69
|
918 #else
|
jpayne@69
|
919 unsigned char class;
|
jpayne@69
|
920 #endif
|
jpayne@69
|
921 unsigned char length;
|
jpayne@69
|
922 short num_keys;
|
jpayne@69
|
923 char keys[32];
|
jpayne@69
|
924 } XKeyState;
|
jpayne@69
|
925
|
jpayne@69
|
926 typedef struct {
|
jpayne@69
|
927 #if defined(__cplusplus) || defined(c_plusplus)
|
jpayne@69
|
928 unsigned char c_class;
|
jpayne@69
|
929 #else
|
jpayne@69
|
930 unsigned char class;
|
jpayne@69
|
931 #endif
|
jpayne@69
|
932 unsigned char length;
|
jpayne@69
|
933 short num_buttons;
|
jpayne@69
|
934 char buttons[32];
|
jpayne@69
|
935 } XButtonState;
|
jpayne@69
|
936
|
jpayne@69
|
937
|
jpayne@69
|
938
|
jpayne@69
|
939 /*******************************************************************
|
jpayne@69
|
940 *
|
jpayne@69
|
941 * Function definitions.
|
jpayne@69
|
942 *
|
jpayne@69
|
943 */
|
jpayne@69
|
944
|
jpayne@69
|
945 _XFUNCPROTOBEGIN
|
jpayne@69
|
946
|
jpayne@69
|
947 extern int XChangeKeyboardDevice(
|
jpayne@69
|
948 Display* /* display */,
|
jpayne@69
|
949 XDevice* /* device */
|
jpayne@69
|
950 );
|
jpayne@69
|
951
|
jpayne@69
|
952 extern int XChangePointerDevice(
|
jpayne@69
|
953 Display* /* display */,
|
jpayne@69
|
954 XDevice* /* device */,
|
jpayne@69
|
955 int /* xaxis */,
|
jpayne@69
|
956 int /* yaxis */
|
jpayne@69
|
957 );
|
jpayne@69
|
958
|
jpayne@69
|
959 extern int XGrabDevice(
|
jpayne@69
|
960 Display* /* display */,
|
jpayne@69
|
961 XDevice* /* device */,
|
jpayne@69
|
962 Window /* grab_window */,
|
jpayne@69
|
963 Bool /* ownerEvents */,
|
jpayne@69
|
964 int /* event count */,
|
jpayne@69
|
965 XEventClass* /* event_list */,
|
jpayne@69
|
966 int /* this_device_mode */,
|
jpayne@69
|
967 int /* other_devices_mode */,
|
jpayne@69
|
968 Time /* time */
|
jpayne@69
|
969 );
|
jpayne@69
|
970
|
jpayne@69
|
971 extern int XUngrabDevice(
|
jpayne@69
|
972 Display* /* display */,
|
jpayne@69
|
973 XDevice* /* device */,
|
jpayne@69
|
974 Time /* time */
|
jpayne@69
|
975 );
|
jpayne@69
|
976
|
jpayne@69
|
977 extern int XGrabDeviceKey(
|
jpayne@69
|
978 Display* /* display */,
|
jpayne@69
|
979 XDevice* /* device */,
|
jpayne@69
|
980 unsigned int /* key */,
|
jpayne@69
|
981 unsigned int /* modifiers */,
|
jpayne@69
|
982 XDevice* /* modifier_device */,
|
jpayne@69
|
983 Window /* grab_window */,
|
jpayne@69
|
984 Bool /* owner_events */,
|
jpayne@69
|
985 unsigned int /* event_count */,
|
jpayne@69
|
986 XEventClass* /* event_list */,
|
jpayne@69
|
987 int /* this_device_mode */,
|
jpayne@69
|
988 int /* other_devices_mode */
|
jpayne@69
|
989 );
|
jpayne@69
|
990
|
jpayne@69
|
991 extern int XUngrabDeviceKey(
|
jpayne@69
|
992 Display* /* display */,
|
jpayne@69
|
993 XDevice* /* device */,
|
jpayne@69
|
994 unsigned int /* key */,
|
jpayne@69
|
995 unsigned int /* modifiers */,
|
jpayne@69
|
996 XDevice* /* modifier_dev */,
|
jpayne@69
|
997 Window /* grab_window */
|
jpayne@69
|
998 );
|
jpayne@69
|
999
|
jpayne@69
|
1000 extern int XGrabDeviceButton(
|
jpayne@69
|
1001 Display* /* display */,
|
jpayne@69
|
1002 XDevice* /* device */,
|
jpayne@69
|
1003 unsigned int /* button */,
|
jpayne@69
|
1004 unsigned int /* modifiers */,
|
jpayne@69
|
1005 XDevice* /* modifier_device */,
|
jpayne@69
|
1006 Window /* grab_window */,
|
jpayne@69
|
1007 Bool /* owner_events */,
|
jpayne@69
|
1008 unsigned int /* event_count */,
|
jpayne@69
|
1009 XEventClass* /* event_list */,
|
jpayne@69
|
1010 int /* this_device_mode */,
|
jpayne@69
|
1011 int /* other_devices_mode */
|
jpayne@69
|
1012 );
|
jpayne@69
|
1013
|
jpayne@69
|
1014 extern int XUngrabDeviceButton(
|
jpayne@69
|
1015 Display* /* display */,
|
jpayne@69
|
1016 XDevice* /* device */,
|
jpayne@69
|
1017 unsigned int /* button */,
|
jpayne@69
|
1018 unsigned int /* modifiers */,
|
jpayne@69
|
1019 XDevice* /* modifier_dev */,
|
jpayne@69
|
1020 Window /* grab_window */
|
jpayne@69
|
1021 );
|
jpayne@69
|
1022
|
jpayne@69
|
1023 extern int XAllowDeviceEvents(
|
jpayne@69
|
1024 Display* /* display */,
|
jpayne@69
|
1025 XDevice* /* device */,
|
jpayne@69
|
1026 int /* event_mode */,
|
jpayne@69
|
1027 Time /* time */
|
jpayne@69
|
1028 );
|
jpayne@69
|
1029
|
jpayne@69
|
1030 extern int XGetDeviceFocus(
|
jpayne@69
|
1031 Display* /* display */,
|
jpayne@69
|
1032 XDevice* /* device */,
|
jpayne@69
|
1033 Window* /* focus */,
|
jpayne@69
|
1034 int* /* revert_to */,
|
jpayne@69
|
1035 Time* /* time */
|
jpayne@69
|
1036 );
|
jpayne@69
|
1037
|
jpayne@69
|
1038 extern int XSetDeviceFocus(
|
jpayne@69
|
1039 Display* /* display */,
|
jpayne@69
|
1040 XDevice* /* device */,
|
jpayne@69
|
1041 Window /* focus */,
|
jpayne@69
|
1042 int /* revert_to */,
|
jpayne@69
|
1043 Time /* time */
|
jpayne@69
|
1044 );
|
jpayne@69
|
1045
|
jpayne@69
|
1046 extern XFeedbackState *XGetFeedbackControl(
|
jpayne@69
|
1047 Display* /* display */,
|
jpayne@69
|
1048 XDevice* /* device */,
|
jpayne@69
|
1049 int* /* num_feedbacks */
|
jpayne@69
|
1050 );
|
jpayne@69
|
1051
|
jpayne@69
|
1052 extern void XFreeFeedbackList(
|
jpayne@69
|
1053 XFeedbackState* /* list */
|
jpayne@69
|
1054 );
|
jpayne@69
|
1055
|
jpayne@69
|
1056 extern int XChangeFeedbackControl(
|
jpayne@69
|
1057 Display* /* display */,
|
jpayne@69
|
1058 XDevice* /* device */,
|
jpayne@69
|
1059 unsigned long /* mask */,
|
jpayne@69
|
1060 XFeedbackControl* /* f */
|
jpayne@69
|
1061 );
|
jpayne@69
|
1062
|
jpayne@69
|
1063 extern int XDeviceBell(
|
jpayne@69
|
1064 Display* /* display */,
|
jpayne@69
|
1065 XDevice* /* device */,
|
jpayne@69
|
1066 XID /* feedbackclass */,
|
jpayne@69
|
1067 XID /* feedbackid */,
|
jpayne@69
|
1068 int /* percent */
|
jpayne@69
|
1069 );
|
jpayne@69
|
1070
|
jpayne@69
|
1071 extern KeySym *XGetDeviceKeyMapping(
|
jpayne@69
|
1072 Display* /* display */,
|
jpayne@69
|
1073 XDevice* /* device */,
|
jpayne@69
|
1074 #if NeedWidePrototypes
|
jpayne@69
|
1075 unsigned int /* first */,
|
jpayne@69
|
1076 #else
|
jpayne@69
|
1077 KeyCode /* first */,
|
jpayne@69
|
1078 #endif
|
jpayne@69
|
1079 int /* keycount */,
|
jpayne@69
|
1080 int* /* syms_per_code */
|
jpayne@69
|
1081 );
|
jpayne@69
|
1082
|
jpayne@69
|
1083 extern int XChangeDeviceKeyMapping(
|
jpayne@69
|
1084 Display* /* display */,
|
jpayne@69
|
1085 XDevice* /* device */,
|
jpayne@69
|
1086 int /* first */,
|
jpayne@69
|
1087 int /* syms_per_code */,
|
jpayne@69
|
1088 KeySym* /* keysyms */,
|
jpayne@69
|
1089 int /* count */
|
jpayne@69
|
1090 );
|
jpayne@69
|
1091
|
jpayne@69
|
1092 extern XModifierKeymap *XGetDeviceModifierMapping(
|
jpayne@69
|
1093 Display* /* display */,
|
jpayne@69
|
1094 XDevice* /* device */
|
jpayne@69
|
1095 );
|
jpayne@69
|
1096
|
jpayne@69
|
1097 extern int XSetDeviceModifierMapping(
|
jpayne@69
|
1098 Display* /* display */,
|
jpayne@69
|
1099 XDevice* /* device */,
|
jpayne@69
|
1100 XModifierKeymap* /* modmap */
|
jpayne@69
|
1101 );
|
jpayne@69
|
1102
|
jpayne@69
|
1103 extern int XSetDeviceButtonMapping(
|
jpayne@69
|
1104 Display* /* display */,
|
jpayne@69
|
1105 XDevice* /* device */,
|
jpayne@69
|
1106 unsigned char* /* map[] */,
|
jpayne@69
|
1107 int /* nmap */
|
jpayne@69
|
1108 );
|
jpayne@69
|
1109
|
jpayne@69
|
1110 extern int XGetDeviceButtonMapping(
|
jpayne@69
|
1111 Display* /* display */,
|
jpayne@69
|
1112 XDevice* /* device */,
|
jpayne@69
|
1113 unsigned char* /* map[] */,
|
jpayne@69
|
1114 unsigned int /* nmap */
|
jpayne@69
|
1115 );
|
jpayne@69
|
1116
|
jpayne@69
|
1117 extern XDeviceState *XQueryDeviceState(
|
jpayne@69
|
1118 Display* /* display */,
|
jpayne@69
|
1119 XDevice* /* device */
|
jpayne@69
|
1120 );
|
jpayne@69
|
1121
|
jpayne@69
|
1122 extern void XFreeDeviceState(
|
jpayne@69
|
1123 XDeviceState* /* list */
|
jpayne@69
|
1124 );
|
jpayne@69
|
1125
|
jpayne@69
|
1126 extern XExtensionVersion *XGetExtensionVersion(
|
jpayne@69
|
1127 Display* /* display */,
|
jpayne@69
|
1128 _Xconst char* /* name */
|
jpayne@69
|
1129 );
|
jpayne@69
|
1130
|
jpayne@69
|
1131 extern XDeviceInfo *XListInputDevices(
|
jpayne@69
|
1132 Display* /* display */,
|
jpayne@69
|
1133 int* /* ndevices */
|
jpayne@69
|
1134 );
|
jpayne@69
|
1135
|
jpayne@69
|
1136 extern void XFreeDeviceList(
|
jpayne@69
|
1137 XDeviceInfo* /* list */
|
jpayne@69
|
1138 );
|
jpayne@69
|
1139
|
jpayne@69
|
1140 extern XDevice *XOpenDevice(
|
jpayne@69
|
1141 Display* /* display */,
|
jpayne@69
|
1142 XID /* id */
|
jpayne@69
|
1143 );
|
jpayne@69
|
1144
|
jpayne@69
|
1145 extern int XCloseDevice(
|
jpayne@69
|
1146 Display* /* display */,
|
jpayne@69
|
1147 XDevice* /* device */
|
jpayne@69
|
1148 );
|
jpayne@69
|
1149
|
jpayne@69
|
1150 extern int XSetDeviceMode(
|
jpayne@69
|
1151 Display* /* display */,
|
jpayne@69
|
1152 XDevice* /* device */,
|
jpayne@69
|
1153 int /* mode */
|
jpayne@69
|
1154 );
|
jpayne@69
|
1155
|
jpayne@69
|
1156 extern int XSetDeviceValuators(
|
jpayne@69
|
1157 Display* /* display */,
|
jpayne@69
|
1158 XDevice* /* device */,
|
jpayne@69
|
1159 int* /* valuators */,
|
jpayne@69
|
1160 int /* first_valuator */,
|
jpayne@69
|
1161 int /* num_valuators */
|
jpayne@69
|
1162 );
|
jpayne@69
|
1163
|
jpayne@69
|
1164 extern XDeviceControl *XGetDeviceControl(
|
jpayne@69
|
1165 Display* /* display */,
|
jpayne@69
|
1166 XDevice* /* device */,
|
jpayne@69
|
1167 int /* control */
|
jpayne@69
|
1168 );
|
jpayne@69
|
1169
|
jpayne@69
|
1170 extern int XChangeDeviceControl(
|
jpayne@69
|
1171 Display* /* display */,
|
jpayne@69
|
1172 XDevice* /* device */,
|
jpayne@69
|
1173 int /* control */,
|
jpayne@69
|
1174 XDeviceControl* /* d */
|
jpayne@69
|
1175 );
|
jpayne@69
|
1176
|
jpayne@69
|
1177 extern int XSelectExtensionEvent(
|
jpayne@69
|
1178 Display* /* display */,
|
jpayne@69
|
1179 Window /* w */,
|
jpayne@69
|
1180 XEventClass* /* event_list */,
|
jpayne@69
|
1181 int /* count */
|
jpayne@69
|
1182 );
|
jpayne@69
|
1183
|
jpayne@69
|
1184 extern int XGetSelectedExtensionEvents(
|
jpayne@69
|
1185 Display* /* display */,
|
jpayne@69
|
1186 Window /* w */,
|
jpayne@69
|
1187 int* /* this_client_count */,
|
jpayne@69
|
1188 XEventClass** /* this_client_list */,
|
jpayne@69
|
1189 int* /* all_clients_count */,
|
jpayne@69
|
1190 XEventClass** /* all_clients_list */
|
jpayne@69
|
1191 );
|
jpayne@69
|
1192
|
jpayne@69
|
1193 extern int XChangeDeviceDontPropagateList(
|
jpayne@69
|
1194 Display* /* display */,
|
jpayne@69
|
1195 Window /* window */,
|
jpayne@69
|
1196 int /* count */,
|
jpayne@69
|
1197 XEventClass* /* events */,
|
jpayne@69
|
1198 int /* mode */
|
jpayne@69
|
1199 );
|
jpayne@69
|
1200
|
jpayne@69
|
1201 extern XEventClass *XGetDeviceDontPropagateList(
|
jpayne@69
|
1202 Display* /* display */,
|
jpayne@69
|
1203 Window /* window */,
|
jpayne@69
|
1204 int* /* count */
|
jpayne@69
|
1205 );
|
jpayne@69
|
1206
|
jpayne@69
|
1207 extern Status XSendExtensionEvent(
|
jpayne@69
|
1208 Display* /* display */,
|
jpayne@69
|
1209 XDevice* /* device */,
|
jpayne@69
|
1210 Window /* dest */,
|
jpayne@69
|
1211 Bool /* prop */,
|
jpayne@69
|
1212 int /* count */,
|
jpayne@69
|
1213 XEventClass* /* list */,
|
jpayne@69
|
1214 XEvent* /* event */
|
jpayne@69
|
1215 );
|
jpayne@69
|
1216
|
jpayne@69
|
1217 extern XDeviceTimeCoord *XGetDeviceMotionEvents(
|
jpayne@69
|
1218 Display* /* display */,
|
jpayne@69
|
1219 XDevice* /* device */,
|
jpayne@69
|
1220 Time /* start */,
|
jpayne@69
|
1221 Time /* stop */,
|
jpayne@69
|
1222 int* /* nEvents */,
|
jpayne@69
|
1223 int* /* mode */,
|
jpayne@69
|
1224 int* /* axis_count */
|
jpayne@69
|
1225 );
|
jpayne@69
|
1226
|
jpayne@69
|
1227 extern void XFreeDeviceMotionEvents(
|
jpayne@69
|
1228 XDeviceTimeCoord* /* events */
|
jpayne@69
|
1229 );
|
jpayne@69
|
1230
|
jpayne@69
|
1231 extern void XFreeDeviceControl(
|
jpayne@69
|
1232 XDeviceControl* /* control */
|
jpayne@69
|
1233 );
|
jpayne@69
|
1234
|
jpayne@69
|
1235 extern Atom* XListDeviceProperties(
|
jpayne@69
|
1236 Display* /* dpy */,
|
jpayne@69
|
1237 XDevice* /* dev */,
|
jpayne@69
|
1238 int* /* nprops_return */
|
jpayne@69
|
1239 );
|
jpayne@69
|
1240
|
jpayne@69
|
1241 extern void XChangeDeviceProperty(
|
jpayne@69
|
1242 Display* /* dpy */,
|
jpayne@69
|
1243 XDevice* /* dev */,
|
jpayne@69
|
1244 Atom /* property */,
|
jpayne@69
|
1245 Atom /* type */,
|
jpayne@69
|
1246 int /* format */,
|
jpayne@69
|
1247 int /* mode */,
|
jpayne@69
|
1248 _Xconst unsigned char * /*data */,
|
jpayne@69
|
1249 int /* nelements */
|
jpayne@69
|
1250 );
|
jpayne@69
|
1251
|
jpayne@69
|
1252 extern void
|
jpayne@69
|
1253 XDeleteDeviceProperty(
|
jpayne@69
|
1254 Display* /* dpy */,
|
jpayne@69
|
1255 XDevice* /* dev */,
|
jpayne@69
|
1256 Atom /* property */
|
jpayne@69
|
1257 );
|
jpayne@69
|
1258
|
jpayne@69
|
1259 extern Status
|
jpayne@69
|
1260 XGetDeviceProperty(
|
jpayne@69
|
1261 Display* /* dpy*/,
|
jpayne@69
|
1262 XDevice* /* dev*/,
|
jpayne@69
|
1263 Atom /* property*/,
|
jpayne@69
|
1264 long /* offset*/,
|
jpayne@69
|
1265 long /* length*/,
|
jpayne@69
|
1266 Bool /* delete*/,
|
jpayne@69
|
1267 Atom /* req_type*/,
|
jpayne@69
|
1268 Atom* /* actual_type*/,
|
jpayne@69
|
1269 int* /* actual_format*/,
|
jpayne@69
|
1270 unsigned long* /* nitems*/,
|
jpayne@69
|
1271 unsigned long* /* bytes_after*/,
|
jpayne@69
|
1272 unsigned char** /* prop*/
|
jpayne@69
|
1273 );
|
jpayne@69
|
1274
|
jpayne@69
|
1275 _XFUNCPROTOEND
|
jpayne@69
|
1276
|
jpayne@69
|
1277 #endif /* _XINPUT_H_ */
|