Merge branch 'devel/x11' into tizen
[platform/upstream/inputproto.git] / XIproto.h
1 /************************************************************
2
3 Copyright 1989, 1998  The Open Group
4
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
9 documentation.
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
24
25 Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
26
27                         All Rights Reserved
28
29 Permission to use, copy, modify, and distribute this software and its
30 documentation for any purpose and without fee is hereby granted,
31 provided that the above copyright notice appear in all copies and that
32 both that copyright notice and this permission notice appear in
33 supporting documentation, and that the name of Hewlett-Packard not be
34 used in advertising or publicity pertaining to distribution of the
35 software without specific, written prior permission.
36
37 HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
38 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
39 HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
40 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
41 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
42 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
43 SOFTWARE.
44
45 ********************************************************/
46
47 #ifndef _XIPROTO_H
48 #define _XIPROTO_H
49
50 #include <X11/Xproto.h>
51 #include <X11/X.h>
52
53 /* make sure types have right sizes for protocol structures. */
54 #define Window CARD32
55 #define Time CARD32
56 #define KeyCode CARD8
57 #define Mask CARD32
58 #define Atom CARD32
59 #define Cursor CARD32
60
61 /*********************************************************
62  *
63  * number of events, errors, and extension name.
64  *
65  */
66
67 #define MORE_EVENTS     0x80
68 #define DEVICE_BITS     0x7F
69
70 #define InputClassBits  0x3F    /* bits in mode field for input classes */
71 #define ModeBitsShift   6       /* amount to shift the remaining bits   */
72
73 #define numInputClasses 7
74
75 #define IEVENTS         17       /* does NOT include generic events */
76 #define IERRORS         5
77 #define IREQUESTS       39
78
79 #define CLIENT_REQ      1
80
81 typedef struct  _XExtEventInfo
82     {
83     Mask        mask;
84     BYTE        type;
85     BYTE        word;
86     } XExtEventInfo;
87
88 typedef unsigned char *Pointer;
89
90 struct tmask
91     {
92     Mask        mask;
93     Pointer     dev;
94     };
95
96 /*********************************************************
97  *
98  * Event constants used by library.
99  *
100  */
101
102 #define XI_DeviceValuator               0
103 #define XI_DeviceKeyPress               1
104 #define XI_DeviceKeyRelease             2
105 #define XI_DeviceButtonPress            3
106 #define XI_DeviceButtonRelease          4
107 #define XI_DeviceMotionNotify           5
108 #define XI_DeviceFocusIn                6
109 #define XI_DeviceFocusOut               7
110 #define XI_ProximityIn                  8
111 #define XI_ProximityOut                 9
112 #define XI_DeviceStateNotify            10
113 #define XI_DeviceMappingNotify          11
114 #define XI_ChangeDeviceNotify           12
115 #define XI_DeviceKeystateNotify         13
116 #define XI_DeviceButtonstateNotify      14
117 #define XI_DevicePresenceNotify         15
118 #define XI_DevicePropertyNotify         16
119
120 /*********************************************************
121  *
122  * Protocol request constants
123  *
124  */
125
126 #define X_GetExtensionVersion           1
127 #define X_ListInputDevices              2
128 #define X_OpenDevice                    3
129 #define X_CloseDevice                   4
130 #define X_SetDeviceMode                 5
131 #define X_SelectExtensionEvent          6
132 #define X_GetSelectedExtensionEvents    7
133 #define X_ChangeDeviceDontPropagateList 8
134 #define X_GetDeviceDontPropagateList    9
135 #define X_GetDeviceMotionEvents         10
136 #define X_ChangeKeyboardDevice          11
137 #define X_ChangePointerDevice           12
138 #define X_GrabDevice                    13
139 #define X_UngrabDevice                  14
140 #define X_GrabDeviceKey                 15
141 #define X_UngrabDeviceKey               16
142 #define X_GrabDeviceButton              17
143 #define X_UngrabDeviceButton            18
144 #define X_AllowDeviceEvents             19
145 #define X_GetDeviceFocus                20
146 #define X_SetDeviceFocus                21
147 #define X_GetFeedbackControl            22
148 #define X_ChangeFeedbackControl         23
149 #define X_GetDeviceKeyMapping           24
150 #define X_ChangeDeviceKeyMapping        25
151 #define X_GetDeviceModifierMapping      26
152 #define X_SetDeviceModifierMapping      27
153 #define X_GetDeviceButtonMapping        28
154 #define X_SetDeviceButtonMapping        29
155 #define X_QueryDeviceState              30
156 #define X_SendExtensionEvent            31
157 #define X_DeviceBell                    32
158 #define X_SetDeviceValuators            33
159 #define X_GetDeviceControl              34
160 #define X_ChangeDeviceControl           35
161 /* XI 1.5 */
162 #define X_ListDeviceProperties          36
163 #define X_ChangeDeviceProperty          37
164 #define X_DeleteDeviceProperty          38
165 #define X_GetDeviceProperty             39
166
167 /*********************************************************
168  *
169  * Protocol request and reply structures.
170  *
171  * GetExtensionVersion.
172  *
173  */
174
175 typedef struct {
176     CARD8       reqType;       /* input extension major code   */
177     CARD8       ReqType;       /* always X_GetExtensionVersion */
178     CARD16      length B16;
179     CARD16      nbytes B16;
180     CARD8       pad1, pad2;
181 } xGetExtensionVersionReq;
182
183 typedef struct {
184     CARD8       repType;        /* X_Reply                      */
185     CARD8       RepType;        /* always X_GetExtensionVersion */
186     CARD16      sequenceNumber B16;
187     CARD32      length B32;
188     CARD16      major_version B16;
189     CARD16      minor_version B16;
190     BOOL        present;
191     CARD8       pad1, pad2, pad3;
192     CARD32      pad01 B32;
193     CARD32      pad02 B32;
194     CARD32      pad03 B32;
195     CARD32      pad04 B32;
196 } xGetExtensionVersionReply;
197
198 /*********************************************************
199  *
200  * ListInputDevices.
201  *
202  */
203
204 typedef struct {
205     CARD8       reqType;        /* input extension major code   */
206     CARD8       ReqType;        /* always X_ListInputDevices    */
207     CARD16      length B16;
208 } xListInputDevicesReq;
209
210 typedef struct {
211     CARD8       repType;        /* X_Reply                      */
212     CARD8       RepType;        /* always X_ListInputDevices    */
213     CARD16      sequenceNumber B16;
214     CARD32      length B32;
215     CARD8       ndevices;
216     CARD8       pad1, pad2, pad3;
217     CARD32      pad01 B32;
218     CARD32      pad02 B32;
219     CARD32      pad03 B32;
220     CARD32      pad04 B32;
221     CARD32      pad05 B32;
222 } xListInputDevicesReply;
223
224 typedef struct _xDeviceInfo *xDeviceInfoPtr;
225
226 typedef struct _xAnyClassinfo *xAnyClassPtr;
227
228 typedef struct _xAnyClassinfo {
229 #if defined(__cplusplus) || defined(c_plusplus)
230     CARD8       c_class;
231 #else
232     CARD8       class;
233 #endif
234     CARD8       length;
235     } xAnyClassInfo;
236
237 typedef struct _xDeviceInfo {
238     CARD32      type B32;
239     CARD8       id;
240     CARD8       num_classes;
241     CARD8       use;      /* IsXPointer | IsXKeyboard | IsXExtension... */
242     CARD8       attached; /* id of master dev (if IsXExtension..) */
243     } xDeviceInfo;
244
245 typedef struct _xKeyInfo *xKeyInfoPtr;
246
247 typedef struct _xKeyInfo {
248 #if defined(__cplusplus) || defined(c_plusplus)
249     CARD8       c_class;
250 #else
251     CARD8       class;
252 #endif
253     CARD8       length;
254     KeyCode     min_keycode;
255     KeyCode     max_keycode;
256     CARD16      num_keys B16;
257     CARD8       pad1,pad2;
258     } xKeyInfo;
259
260 typedef struct _xButtonInfo *xButtonInfoPtr;
261
262 typedef struct _xButtonInfo {
263 #if defined(__cplusplus) || defined(c_plusplus)
264     CARD8       c_class;
265 #else
266     CARD8       class;
267 #endif
268     CARD8       length;
269     CARD16      num_buttons B16;
270     } xButtonInfo;
271
272 typedef struct _xValuatorInfo *xValuatorInfoPtr;
273
274 typedef struct _xValuatorInfo {
275 #if defined(__cplusplus) || defined(c_plusplus)
276     CARD8       c_class;
277 #else
278     CARD8       class;
279 #endif
280     CARD8       length;
281     CARD8       num_axes;
282     CARD8       mode;
283     CARD32      motion_buffer_size B32;
284     } xValuatorInfo;
285
286 typedef struct _xAxisInfo *xAxisInfoPtr;
287
288 typedef struct _xAxisInfo {
289     CARD32      resolution B32;
290     CARD32      min_value B32;
291     CARD32      max_value B32;
292     } xAxisInfo;
293
294 /*********************************************************
295  *
296  * OpenDevice.
297  *
298  */
299
300 typedef struct {
301     CARD8       reqType;        /* input extension major code   */
302     CARD8       ReqType;        /* always X_OpenDevice          */
303     CARD16      length B16;
304     CARD8       deviceid;
305     BYTE        pad1, pad2, pad3;
306 } xOpenDeviceReq;
307
308 typedef struct {
309     CARD8       repType;        /* X_Reply                      */
310     CARD8       RepType;        /* always X_OpenDevice          */
311     CARD16      sequenceNumber B16;
312     CARD32      length B32;
313     CARD8       num_classes;
314     BYTE        pad1, pad2, pad3;
315     CARD32      pad00 B32;
316     CARD32      pad01 B32;
317     CARD32      pad02 B32;
318     CARD32      pad03 B32;
319     CARD32      pad04 B32;
320     } xOpenDeviceReply;
321
322 typedef struct {
323 #if defined(__cplusplus) || defined(c_plusplus)
324     CARD8       c_class;
325 #else
326     CARD8       class;
327 #endif
328     CARD8       event_type_base;
329     } xInputClassInfo;
330
331 /*********************************************************
332  *
333  * CloseDevice.
334  *
335  */
336
337 typedef struct {
338     CARD8       reqType;        /* input extension major code   */
339     CARD8       ReqType;        /* always X_CloseDevice */
340     CARD16      length B16;
341     CARD8       deviceid;
342     BYTE        pad1, pad2, pad3;
343 } xCloseDeviceReq;
344
345 /*********************************************************
346  *
347  * SetDeviceMode.
348  *
349  */
350
351 typedef struct {
352     CARD8       reqType;        /* input extension major code   */
353     CARD8       ReqType;        /* always X_SetDeviceMode       */
354     CARD16      length B16;
355     CARD8       deviceid;
356     CARD8       mode;
357     BYTE        pad1, pad2;
358 } xSetDeviceModeReq;
359
360 typedef struct {
361     CARD8       repType;        /* X_Reply                      */
362     CARD8       RepType;        /* always X_SetDeviceMode       */
363     CARD16      sequenceNumber B16;
364     CARD32      length B32;
365     CARD8       status;
366     BYTE        pad1, pad2, pad3;
367     CARD32      pad01 B32;
368     CARD32      pad02 B32;
369     CARD32      pad03 B32;
370     CARD32      pad04 B32;
371     CARD32      pad05 B32;
372 } xSetDeviceModeReply;
373
374 /*********************************************************
375  *
376  * SelectExtensionEvent.
377  *
378  */
379
380 typedef struct {
381     CARD8       reqType;        /* input extension major code   */
382     CARD8       ReqType;        /* always X_SelectExtensionEvent */
383     CARD16      length B16;
384     Window      window B32;
385     CARD16      count B16;
386     CARD16      pad00 B16;
387 } xSelectExtensionEventReq;
388
389 /*********************************************************
390  *
391  * GetSelectedExtensionEvent.
392  *
393  */
394
395 typedef struct {
396     CARD8       reqType;        /* input extension major code   */
397     CARD8       ReqType;        /* X_GetSelectedExtensionEvents */
398     CARD16      length B16;
399     Window      window B32;
400 } xGetSelectedExtensionEventsReq;
401
402 typedef struct {
403     CARD8       repType;        /* X_Reply                      */
404     CARD8       RepType;        /* GetSelectedExtensionEvents   */
405     CARD16      sequenceNumber B16;
406     CARD32      length B32;
407     CARD16      this_client_count B16;
408     CARD16      all_clients_count B16;
409     CARD32      pad01 B32;
410     CARD32      pad02 B32;
411     CARD32      pad03 B32;
412     CARD32      pad04 B32;
413     CARD32      pad05 B32;
414 } xGetSelectedExtensionEventsReply;
415
416 /*********************************************************
417  *
418  * ChangeDeviceDontPropagateList.
419  *
420  */
421
422 typedef struct {
423     CARD8       reqType;        /* input extension major code   */
424     CARD8       ReqType;        /* X_ChangeDeviceDontPropagateList */
425     CARD16      length B16;
426     Window      window B32;
427     CARD16      count B16;
428     CARD8       mode;
429     BYTE        pad;
430 } xChangeDeviceDontPropagateListReq;
431
432 /*********************************************************
433  *
434  * GetDeviceDontPropagateList.
435  *
436  */
437
438 typedef struct {
439     CARD8       reqType;        /* input extension major code   */
440     CARD8       ReqType;        /* X_GetDeviceDontPropagateList */
441     CARD16      length B16;
442     Window      window B32;
443 } xGetDeviceDontPropagateListReq;
444
445 typedef struct {
446     CARD8       repType;        /* X_Reply                      */
447     CARD8       RepType;        /* GetDeviceDontPropagateList   */
448     CARD16      sequenceNumber B16;
449     CARD32      length B32;
450     CARD16      count B16;
451     CARD16      pad00 B16;
452     CARD32      pad01 B32;
453     CARD32      pad02 B32;
454     CARD32      pad03 B32;
455     CARD32      pad04 B32;
456     CARD32      pad05 B32;
457     } xGetDeviceDontPropagateListReply;
458
459 /*********************************************************
460  *
461  * GetDeviceMotionEvents.
462  *
463  */
464
465 typedef struct {
466     CARD8       reqType;        /* input extension major code   */
467     CARD8       ReqType;        /* always X_GetDeviceMotionEvents*/
468     CARD16      length B16;
469     Time        start B32;
470     Time        stop B32;
471     CARD8       deviceid;
472     BYTE        pad1, pad2, pad3;
473 } xGetDeviceMotionEventsReq;
474
475 typedef struct {
476     CARD8       repType;        /* X_Reply */
477     CARD8       RepType;        /* always X_GetDeviceMotionEvents  */
478     CARD16      sequenceNumber B16;
479     CARD32      length B32;
480     CARD32      nEvents B32;
481     CARD8       axes;
482     CARD8       mode;
483     BYTE        pad1, pad2;
484     CARD32      pad01 B32;
485     CARD32      pad02 B32;
486     CARD32      pad03 B32;
487     CARD32      pad04 B32;
488 } xGetDeviceMotionEventsReply;
489
490 /*********************************************************
491  *
492  * ChangeKeyboardDevice.
493  *
494  */
495
496 typedef struct {
497     CARD8       reqType;        /* input extension major code   */
498     CARD8       ReqType;        /* X_ChangeKeyboardDevice       */
499     CARD16      length B16;
500     CARD8       deviceid;
501     BYTE        pad1, pad2, pad3;
502 } xChangeKeyboardDeviceReq;
503
504 typedef struct {
505     CARD8       repType;        /* X_Reply                      */
506     CARD8       RepType;        /* always X_ChangeKeyboardDevice*/
507     CARD16      sequenceNumber B16;
508     CARD32      length B32;  /* 0 */
509     CARD8       status;
510     BYTE        pad1, pad2, pad3;
511     CARD32      pad01 B32;
512     CARD32      pad02 B32;
513     CARD32      pad03 B32;
514     CARD32      pad04 B32;
515     CARD32      pad05 B32;
516     } xChangeKeyboardDeviceReply;
517
518 /*********************************************************
519  *
520  * ChangePointerDevice.
521  *
522  */
523
524 typedef struct {
525     CARD8       reqType;        /* input extension major code   */
526     CARD8       ReqType;        /* X_ChangePointerDevice        */
527     CARD16      length B16;
528     CARD8       xaxis;
529     CARD8       yaxis;
530     CARD8       deviceid;
531     BYTE        pad1;
532 } xChangePointerDeviceReq;
533
534 typedef struct {
535     CARD8       repType;        /* X_Reply                      */
536     CARD8       RepType;        /* always X_ChangePointerDevice */
537     CARD16      sequenceNumber B16;
538     CARD32      length B32;  /* 0 */
539     CARD8       status;
540     BYTE        pad1, pad2, pad3;
541     CARD32      pad01 B32;
542     CARD32      pad02 B32;
543     CARD32      pad03 B32;
544     CARD32      pad04 B32;
545     CARD32      pad05 B32;
546     } xChangePointerDeviceReply;
547
548 /*********************************************************
549  *
550  * GrabDevice.
551  *
552  */
553
554 typedef struct {
555     CARD8       reqType;        /* input extension major code   */
556     CARD8       ReqType;        /* always X_GrabDevice */
557     CARD16      length B16;
558     Window      grabWindow B32;
559     Time        time B32;
560     CARD16      event_count B16;
561     CARD8       this_device_mode;
562     CARD8       other_devices_mode;
563     BOOL        ownerEvents;
564     CARD8       deviceid;
565     CARD16      pad01 B16;
566 } xGrabDeviceReq;
567
568 typedef struct {
569     CARD8       repType;        /* X_Reply                      */
570     CARD8       RepType;        /* always X_GrabDevice  */
571     CARD16      sequenceNumber B16;
572     CARD32      length B32;  /* 0 */
573     CARD8       status;
574     BYTE        pad1, pad2, pad3;
575     CARD32      pad01 B32;
576     CARD32      pad02 B32;
577     CARD32      pad03 B32;
578     CARD32      pad04 B32;
579     CARD32      pad05 B32;
580     } xGrabDeviceReply;
581
582 /*********************************************************
583  *
584  * UngrabDevice.
585  *
586  */
587
588 typedef struct {
589     CARD8       reqType;        /* input extension major code   */
590     CARD8       ReqType;        /* always X_UnGrabDevice        */
591     CARD16      length B16;
592     Time        time B32;
593     CARD8       deviceid;
594     BYTE        pad1, pad2, pad3;
595 } xUngrabDeviceReq;
596
597 /*********************************************************
598  *
599  * GrabDeviceKey.
600  *
601  */
602
603 typedef struct {
604     CARD8       reqType;        /* input extension major code   */
605     CARD8       ReqType;        /* always X_GrabDeviceKey       */
606     CARD16      length B16;
607     Window      grabWindow B32;
608     CARD16      event_count B16;
609     CARD16      modifiers B16;
610     CARD8       modifier_device;
611     CARD8       grabbed_device;
612     CARD8       key;
613     BYTE        this_device_mode;
614     BYTE        other_devices_mode;
615     BOOL        ownerEvents;
616     BYTE        pad1, pad2;
617 } xGrabDeviceKeyReq;
618
619 /*********************************************************
620  *
621  * UngrabDeviceKey.
622  *
623  */
624
625 typedef struct {
626     CARD8       reqType;        /* input extension major code   */
627     CARD8       ReqType;        /* always X_UngrabDeviceKey     */
628     CARD16      length B16;
629     Window      grabWindow B32;
630     CARD16      modifiers B16;
631     CARD8       modifier_device;
632     CARD8       key;
633     CARD8       grabbed_device;
634     BYTE        pad1, pad2, pad3;
635 } xUngrabDeviceKeyReq;
636
637 /*********************************************************
638  *
639  * GrabDeviceButton.
640  *
641  */
642
643 typedef struct {
644     CARD8       reqType;        /* input extension major code   */
645     CARD8       ReqType;        /* always X_GrabDeviceButton    */
646     CARD16      length B16;
647     Window      grabWindow B32;
648     CARD8       grabbed_device;
649     CARD8       modifier_device;
650     CARD16      event_count B16;
651     CARD16      modifiers B16;
652     BYTE        this_device_mode;
653     BYTE        other_devices_mode;
654     CARD8       button;
655     BOOL        ownerEvents;
656     BYTE        pad1, pad2;
657 } xGrabDeviceButtonReq;
658
659 /*********************************************************
660  *
661  * UngrabDeviceButton.
662  *
663  */
664
665 typedef struct {
666     CARD8       reqType;        /* input extension major code   */
667     CARD8       ReqType;        /* always X_UngrabDeviceButton  */
668     CARD16      length B16;
669     Window      grabWindow B32;
670     CARD16      modifiers B16;
671     CARD8       modifier_device;
672     CARD8       button;
673     CARD8       grabbed_device;
674     BYTE        pad1, pad2, pad3;
675 } xUngrabDeviceButtonReq;
676
677 /*********************************************************
678  *
679  * AllowDeviceEvents.
680  *
681  */
682
683 typedef struct {
684     CARD8       reqType;        /* input extension major code   */
685     CARD8       ReqType;        /* always X_AllowDeviceEvents   */
686     CARD16      length B16;
687     Time        time B32;
688     CARD8       mode;
689     CARD8       deviceid;
690     BYTE        pad1, pad2;
691 } xAllowDeviceEventsReq;
692
693 /*********************************************************
694  *
695  * GetDeviceFocus.
696  *
697  */
698
699 typedef struct {
700     CARD8       reqType;        /* input extension major code   */
701     CARD8       ReqType;        /* always X_GetDeviceFocus      */
702     CARD16      length B16;
703     CARD8       deviceid;
704     BYTE        pad1, pad2, pad3;
705 } xGetDeviceFocusReq;
706
707 typedef struct {
708     CARD8       repType;        /* X_Reply                      */
709     CARD8       RepType;        /* always X_GetDeviceFocus      */
710     CARD16      sequenceNumber B16;
711     CARD32      length B32;
712     CARD32      focus B32;
713     Time        time B32;
714     CARD8       revertTo;
715     BYTE        pad1, pad2, pad3;
716     CARD32      pad01 B32;
717     CARD32      pad02 B32;
718     CARD32      pad03 B32;
719     } xGetDeviceFocusReply;
720
721 /*********************************************************
722  *
723  * SetDeviceFocus.
724  *
725  */
726
727 typedef struct {
728     CARD8       reqType;        /* input extension major code   */
729     CARD8       ReqType;        /* always X_SetDeviceFocus      */
730     CARD16      length B16;
731     Window      focus B32;
732     Time        time B32;
733     CARD8       revertTo;
734     CARD8       device;
735     CARD16      pad01 B16;
736 } xSetDeviceFocusReq;
737
738 /*********************************************************
739  *
740  * GetFeedbackControl.
741  *
742  */
743
744 typedef struct {
745     CARD8       reqType;        /* input extension major code   */
746     CARD8       ReqType;        /* X_GetFeedbackControl */
747     CARD16      length B16;
748     CARD8       deviceid;
749     BYTE        pad1, pad2, pad3;
750 } xGetFeedbackControlReq;
751
752 typedef struct {
753     CARD8       repType;        /* X_Reply                      */
754     CARD8       RepType;        /* always X_GetFeedbackControl  */
755     CARD16      sequenceNumber B16;
756     CARD32      length B32;
757     CARD16      num_feedbacks B16;
758     CARD16      pad01 B16;
759     CARD32      pad02 B32;
760     CARD32      pad03 B32;
761     CARD32      pad04 B32;
762     CARD32      pad05 B32;
763     CARD32      pad06 B32;
764 } xGetFeedbackControlReply;
765
766 typedef struct {
767 #if defined(__cplusplus) || defined(c_plusplus)
768     CARD8       c_class;        /* feedback class               */
769 #else
770     CARD8       class;          /* feedback class               */
771 #endif
772     CARD8       id;             /* feedback id          */
773     CARD16      length B16;     /* feedback length              */
774 } xFeedbackState;
775
776 typedef struct {
777 #if defined(__cplusplus) || defined(c_plusplus)
778     CARD8   c_class;
779 #else
780     CARD8   class;
781 #endif
782     CARD8   id;
783     CARD16  length B16;
784     CARD16  pitch B16;
785     CARD16  duration B16;
786     CARD32  led_mask B32;
787     CARD32  led_values B32;
788     BOOL    global_auto_repeat;
789     CARD8   click;
790     CARD8   percent;
791     BYTE    pad;
792     BYTE    auto_repeats[32];
793 } xKbdFeedbackState;
794
795 typedef struct {
796 #if defined(__cplusplus) || defined(c_plusplus)
797     CARD8   c_class;
798 #else
799     CARD8   class;
800 #endif
801     CARD8   id;
802     CARD16  length B16;
803     CARD8   pad1,pad2;
804     CARD16  accelNum B16;
805     CARD16  accelDenom B16;
806     CARD16  threshold B16;
807 } xPtrFeedbackState;
808
809 typedef struct {
810 #if defined(__cplusplus) || defined(c_plusplus)
811     CARD8       c_class;        /* feedback class id            */
812 #else
813     CARD8       class;          /* feedback class id            */
814 #endif
815     CARD8       id;
816     CARD16      length B16;     /* feedback length              */
817     CARD32      resolution B32;
818     INT32       min_value B32;
819     INT32       max_value B32;
820 } xIntegerFeedbackState;
821
822 typedef struct {
823 #if defined(__cplusplus) || defined(c_plusplus)
824     CARD8       c_class;        /* feedback class id            */
825 #else
826     CARD8       class;          /* feedback class id            */
827 #endif
828     CARD8       id;
829     CARD16      length B16;     /* feedback length              */
830     CARD16      max_symbols B16;
831     CARD16      num_syms_supported B16;
832 } xStringFeedbackState;
833
834 typedef struct {
835 #if defined(__cplusplus) || defined(c_plusplus)
836     CARD8       c_class;        /* feedback class id            */
837 #else
838     CARD8       class;          /* feedback class id            */
839 #endif
840     CARD8       id;
841     CARD16      length B16;     /* feedback length              */
842     CARD8       percent;
843     BYTE        pad1, pad2, pad3;
844     CARD16      pitch B16;
845     CARD16      duration B16;
846 } xBellFeedbackState;
847
848 typedef struct {
849 #if defined(__cplusplus) || defined(c_plusplus)
850     CARD8       c_class;        /* feedback class id            */
851 #else
852     CARD8       class;          /* feedback class id            */
853 #endif
854     CARD8       id;
855     CARD16      length B16;     /* feedback length              */
856     CARD32      led_mask B32;
857     CARD32      led_values B32;
858 } xLedFeedbackState;
859
860 /*********************************************************
861  *
862  * ChangeFeedbackControl.
863  *
864  */
865
866 typedef struct {
867     CARD8       reqType;        /* input extension major code   */
868     CARD8       ReqType;        /* X_ChangeFeedbackControl      */
869     CARD16      length B16;
870     CARD32      mask B32;
871     CARD8       deviceid;
872     CARD8       feedbackid;
873     BYTE        pad1, pad2;
874 } xChangeFeedbackControlReq;
875
876 typedef struct {
877 #if defined(__cplusplus) || defined(c_plusplus)
878     CARD8       c_class;        /* feedback class id            */
879 #else
880     CARD8       class;          /* feedback class id            */
881 #endif
882     CARD8       id;             /* feedback id          */
883     CARD16      length B16;     /* feedback length              */
884 } xFeedbackCtl;
885
886 typedef struct {
887 #if defined(__cplusplus) || defined(c_plusplus)
888     CARD8       c_class;        /* feedback class id            */
889 #else
890     CARD8       class;          /* feedback class id            */
891 #endif
892     CARD8       id;             /* feedback length              */
893     CARD16      length B16;     /* feedback length              */
894     KeyCode     key;
895     CARD8       auto_repeat_mode;
896     INT8        click;
897     INT8        percent;
898     INT16       pitch B16;
899     INT16       duration B16;
900     CARD32      led_mask B32;
901     CARD32      led_values B32;
902 } xKbdFeedbackCtl;
903
904 typedef struct {
905 #if defined(__cplusplus) || defined(c_plusplus)
906     CARD8       c_class;        /* feedback class id            */
907 #else
908     CARD8       class;          /* feedback class id            */
909 #endif
910     CARD8       id;             /* feedback id          */
911     CARD16      length B16;     /* feedback length              */
912     CARD8       pad1,pad2;
913     INT16       num B16;
914     INT16       denom B16;
915     INT16       thresh B16;
916 } xPtrFeedbackCtl;
917
918 typedef struct {
919 #if defined(__cplusplus) || defined(c_plusplus)
920     CARD8       c_class;        /* feedback class id            */
921 #else
922     CARD8       class;          /* feedback class id            */
923 #endif
924     CARD8       id;             /* feedback id          */
925     CARD16      length B16;     /* feedback length              */
926     INT32       int_to_display B32;
927 } xIntegerFeedbackCtl;
928
929 typedef struct {
930 #if defined(__cplusplus) || defined(c_plusplus)
931     CARD8       c_class;        /* feedback class id            */
932 #else
933     CARD8       class;          /* feedback class id            */
934 #endif
935     CARD8       id;             /* feedback id          */
936     CARD16      length B16;     /* feedback length              */
937     CARD8       pad1,pad2;
938     CARD16      num_keysyms B16;
939 } xStringFeedbackCtl;
940
941 typedef struct {
942 #if defined(__cplusplus) || defined(c_plusplus)
943     CARD8       c_class;        /* feedback class id            */
944 #else
945     CARD8       class;          /* feedback class id            */
946 #endif
947     CARD8       id;             /* feedback id          */
948     CARD16      length B16;     /* feedback length              */
949     INT8        percent;
950     BYTE        pad1, pad2, pad3;
951     INT16       pitch B16;
952     INT16       duration B16;
953 } xBellFeedbackCtl;
954
955 typedef struct {
956 #if defined(__cplusplus) || defined(c_plusplus)
957     CARD8       c_class;        /* feedback class id            */
958 #else
959     CARD8       class;          /* feedback class id            */
960 #endif
961     CARD8       id;             /* feedback id          */
962     CARD16      length B16;     /* feedback length              */
963     CARD32      led_mask B32;
964     CARD32      led_values B32;
965 } xLedFeedbackCtl;
966
967 /*********************************************************
968  *
969  * GetDeviceKeyMapping.
970  *
971  */
972
973 typedef struct {
974     CARD8       reqType;        /* input extension major code   */
975     CARD8       ReqType;        /* always X_GetDeviceKeyMapping */
976     CARD16      length B16;
977     CARD8       deviceid;
978     KeyCode     firstKeyCode;
979     CARD8       count;
980     BYTE        pad1;
981 } xGetDeviceKeyMappingReq;
982
983 typedef struct {
984     CARD8       repType;        /* X_Reply                      */
985     CARD8       RepType;        /* always X_GetDeviceKeyMapping */
986     CARD16      sequenceNumber B16;
987     CARD32      length B32;
988     CARD8       keySymsPerKeyCode;
989     CARD8       pad0;
990     CARD16      pad1 B16;
991     CARD32      pad2 B32;
992     CARD32      pad3 B32;
993     CARD32      pad4 B32;
994     CARD32      pad5 B32;
995     CARD32      pad6 B32;
996 } xGetDeviceKeyMappingReply;
997
998 /*********************************************************
999  *
1000  * ChangeDeviceKeyMapping.
1001  *
1002  */
1003
1004 typedef struct {
1005     CARD8       reqType;        /* input extension major code   */
1006     CARD8       ReqType;        /* always X_ChangeDeviceKeyMapping */
1007     CARD16      length B16;
1008     CARD8       deviceid;
1009     KeyCode     firstKeyCode;
1010     CARD8       keySymsPerKeyCode;
1011     CARD8       keyCodes;
1012 } xChangeDeviceKeyMappingReq;
1013
1014 /*********************************************************
1015  *
1016  * GetDeviceModifierMapping.
1017  *
1018  */
1019
1020 typedef struct {
1021     CARD8       reqType;        /* input extension major code   */
1022     CARD8       ReqType;        /* always X_GetDeviceModifierMapping */
1023     CARD16      length B16;
1024     CARD8       deviceid;
1025     BYTE        pad1, pad2, pad3;
1026 } xGetDeviceModifierMappingReq;
1027
1028 typedef struct {
1029     CARD8       repType;        /* X_Reply */
1030     CARD8       RepType;        /* always X_GetDeviceModifierMapping */
1031     CARD16      sequenceNumber B16;
1032     CARD32      length B32;
1033     CARD8       numKeyPerModifier;
1034     CARD8       pad0;
1035     CARD16      pad1 B16;
1036     CARD32      pad2 B32;
1037     CARD32      pad3 B32;
1038     CARD32      pad4 B32;
1039     CARD32      pad5 B32;
1040     CARD32      pad6 B32;
1041 } xGetDeviceModifierMappingReply;
1042
1043 /*********************************************************
1044  *
1045  * SetDeviceModifierMapping.
1046  *
1047  */
1048
1049 typedef struct {
1050     CARD8       reqType;        /* input extension major code   */
1051     CARD8       ReqType;        /* always X_SetDeviceModifierMapping */
1052     CARD16      length B16;
1053     CARD8       deviceid;
1054     CARD8       numKeyPerModifier;
1055     CARD16      pad1 B16;
1056 } xSetDeviceModifierMappingReq;
1057
1058 typedef struct {
1059     CARD8       repType;        /* X_Reply */
1060     CARD8       RepType;        /* always X_SetDeviceModifierMapping */
1061     CARD16      sequenceNumber B16;
1062     CARD32      length B32;
1063     CARD8       success;
1064     CARD8       pad0;
1065     CARD16      pad1 B16;
1066     CARD32      pad2 B32;
1067     CARD32      pad3 B32;
1068     CARD32      pad4 B32;
1069     CARD32      pad5 B32;
1070     CARD32      pad6 B32;
1071 } xSetDeviceModifierMappingReply;
1072
1073 /*********************************************************
1074  *
1075  * GetDeviceButtonMapping.
1076  *
1077  */
1078
1079 typedef struct {
1080     CARD8       reqType;        /* input extension major code   */
1081     CARD8       ReqType;        /* X_GetDeviceButtonMapping     */
1082     CARD16      length B16;
1083     CARD8       deviceid;
1084     BYTE        pad1, pad2, pad3;
1085 } xGetDeviceButtonMappingReq;
1086
1087 typedef struct {
1088     CARD8       repType;        /* X_Reply */
1089     CARD8       RepType;        /* always X_GetDeviceButtonMapping */
1090     CARD16      sequenceNumber B16;
1091     CARD32      length B32;
1092     CARD8       nElts;
1093     BYTE        pad1, pad2, pad3;
1094     CARD32      pad01 B32;
1095     CARD32      pad02 B32;
1096     CARD32      pad03 B32;
1097     CARD32      pad04 B32;
1098     CARD32      pad05 B32;
1099 } xGetDeviceButtonMappingReply;
1100
1101 /*********************************************************
1102  *
1103  * SetDeviceButtonMapping.
1104  *
1105  */
1106
1107 typedef struct {
1108     CARD8       reqType;        /* input extension major code   */
1109     CARD8       ReqType;        /* X_SetDeviceButtonMapping     */
1110     CARD16      length B16;
1111     CARD8       deviceid;
1112     CARD8       map_length;
1113     BYTE        pad1, pad2;
1114 } xSetDeviceButtonMappingReq;
1115
1116 typedef struct {
1117     CARD8       repType;                /* X_Reply */
1118     CARD8       RepType;        /* always X_SetDeviceButtonMapping */
1119     CARD16      sequenceNumber B16;
1120     CARD32      length B32;
1121     CARD8       status;
1122     BYTE        pad0;
1123     CARD16      pad1 B16;
1124     CARD32      pad2 B32;
1125     CARD32      pad3 B32;
1126     CARD32      pad4 B32;
1127     CARD32      pad5 B32;
1128     CARD32      pad6 B32;
1129 } xSetDeviceButtonMappingReply;
1130
1131 /*********************************************************
1132  *
1133  * QueryDeviceState.
1134  *
1135  */
1136
1137 typedef struct {
1138     CARD8       reqType;
1139     CARD8       ReqType;        /* always X_QueryDeviceState */
1140     CARD16      length B16;
1141     CARD8       deviceid;
1142     BYTE        pad1, pad2, pad3;
1143 } xQueryDeviceStateReq;
1144
1145 typedef struct {
1146     CARD8       repType;                /* X_Reply */
1147     CARD8       RepType;        /* always X_QueryDeviceState    */
1148     CARD16      sequenceNumber B16;
1149     CARD32      length B32;
1150     CARD8       num_classes;
1151     BYTE        pad0;
1152     CARD16      pad1 B16;
1153     CARD32      pad2 B32;
1154     CARD32      pad3 B32;
1155     CARD32      pad4 B32;
1156     CARD32      pad5 B32;
1157     CARD32      pad6 B32;
1158 } xQueryDeviceStateReply;
1159
1160 typedef struct {
1161 #if defined(__cplusplus) || defined(c_plusplus)
1162     CARD8       c_class;
1163 #else
1164     CARD8       class;
1165 #endif
1166     CARD8       length;
1167     CARD8       num_keys;
1168     BYTE        pad1;
1169     CARD8       keys[32];
1170 } xKeyState;
1171
1172 typedef struct {
1173 #if defined(__cplusplus) || defined(c_plusplus)
1174     CARD8       c_class;
1175 #else
1176     CARD8       class;
1177 #endif
1178     CARD8       length;
1179     CARD8       num_buttons;
1180     BYTE        pad1;
1181     CARD8       buttons[32];
1182 } xButtonState;
1183
1184 typedef struct {
1185 #if defined(__cplusplus) || defined(c_plusplus)
1186     CARD8       c_class;
1187 #else
1188     CARD8       class;
1189 #endif
1190     CARD8       length;
1191     CARD8       num_valuators;
1192     CARD8       mode;
1193 } xValuatorState;
1194
1195 /*********************************************************
1196  *
1197  * SendExtensionEvent.
1198  * THIS REQUEST MUST BE KEPT A MULTIPLE OF 8 BYTES IN LENGTH!
1199  * MORE EVENTS MAY FOLLOW AND THEY MUST BE QUAD-ALIGNED!
1200  *
1201  */
1202
1203 typedef struct {
1204     CARD8       reqType;
1205     CARD8       ReqType;        /* always X_SendExtensionEvent */
1206     CARD16      length B16;
1207     Window      destination B32;
1208     CARD8       deviceid;
1209     BOOL        propagate;
1210     CARD16      count B16;
1211     CARD8       num_events;
1212     BYTE        pad1,pad2,pad3;
1213 } xSendExtensionEventReq;
1214
1215 /*********************************************************
1216  *
1217  * DeviceBell.
1218  *
1219  */
1220
1221 typedef struct {
1222     CARD8       reqType;
1223     CARD8       ReqType;        /* always X_DeviceBell */
1224     CARD16      length B16;
1225     CARD8       deviceid;
1226     CARD8       feedbackid;
1227     CARD8       feedbackclass;
1228     INT8        percent;
1229 } xDeviceBellReq;
1230
1231 /*********************************************************
1232  *
1233  * SetDeviceValuators.
1234  *
1235  */
1236
1237 typedef struct {
1238     CARD8       reqType;        /* input extension major code   */
1239     CARD8       ReqType;        /* always X_SetDeviceValuators  */
1240     CARD16      length B16;
1241     CARD8       deviceid;
1242     CARD8       first_valuator;
1243     CARD8       num_valuators;
1244     BYTE        pad1;
1245 } xSetDeviceValuatorsReq;
1246
1247 typedef struct {
1248     CARD8       repType;        /* X_Reply                      */
1249     CARD8       RepType;        /* always X_SetDeviceValuators  */
1250     CARD16      sequenceNumber B16;
1251     CARD32      length B32;
1252     CARD8       status;
1253     BYTE        pad1, pad2, pad3;
1254     CARD32      pad01 B32;
1255     CARD32      pad02 B32;
1256     CARD32      pad03 B32;
1257     CARD32      pad04 B32;
1258     CARD32      pad05 B32;
1259 } xSetDeviceValuatorsReply;
1260
1261 /*********************************************************
1262  *
1263  * GetDeviceControl.
1264  *
1265  */
1266
1267 typedef struct {
1268     CARD8       reqType;        /* input extension major code   */
1269     CARD8       ReqType;        /* always X_GetDeviceControl    */
1270     CARD16      length B16;
1271     CARD16      control B16;
1272     CARD8       deviceid;
1273     BYTE        pad2;
1274 } xGetDeviceControlReq;
1275
1276 typedef struct {
1277     CARD8       repType;        /* X_Reply                      */
1278     CARD8       RepType;        /* always X_GetDeviceControl    */
1279     CARD16      sequenceNumber B16;
1280     CARD32      length B32;
1281     CARD8       status;
1282     BYTE        pad1, pad2, pad3;
1283     CARD32      pad01 B32;
1284     CARD32      pad02 B32;
1285     CARD32      pad03 B32;
1286     CARD32      pad04 B32;
1287     CARD32      pad05 B32;
1288 } xGetDeviceControlReply;
1289
1290 typedef struct {
1291     CARD16      control B16;    /* control type         */
1292     CARD16      length B16;     /* control length               */
1293 } xDeviceState;
1294
1295 typedef struct {
1296     CARD16      control B16;            /* control type         */
1297     CARD16      length B16;             /* control length               */
1298     CARD32      num_valuators B32;      /* number of valuators          */
1299 } xDeviceResolutionState;
1300
1301 typedef struct {
1302      CARD16         control B16;
1303      CARD16         length B16;
1304      INT32          min_x B32;
1305      INT32          max_x B32;
1306      INT32          min_y B32;
1307      INT32          max_y B32;
1308      CARD32         flip_x B32;
1309      CARD32         flip_y B32;
1310      CARD32         rotation B32;
1311      CARD32         button_threshold B32;
1312 } xDeviceAbsCalibState;
1313
1314 typedef struct {
1315      CARD16         control B16;
1316      CARD16         length B16;
1317      CARD32         offset_x B32;
1318      CARD32         offset_y B32;
1319      CARD32         width B32;
1320      CARD32         height B32;
1321      CARD32         screen B32;
1322      CARD32         following B32;
1323 } xDeviceAbsAreaState;
1324
1325 typedef struct {
1326     CARD16      control B16;            /* control type                 */
1327     CARD16      length  B16;            /* control length               */
1328     CARD8       status;
1329     CARD8       iscore;
1330     CARD16      pad1 B16;
1331 } xDeviceCoreState;
1332
1333 typedef struct {
1334     CARD16      control B16;            /* control type                 */
1335     CARD16      length  B16;            /* control length               */
1336     CARD8       enable;
1337     CARD8       pad0;
1338     CARD16      pad1 B16;
1339 } xDeviceEnableState;
1340
1341 /*********************************************************
1342  *
1343  * ChangeDeviceControl.
1344  *
1345  */
1346
1347 typedef struct {
1348     CARD8       reqType;        /* input extension major code   */
1349     CARD8       ReqType;        /* always X_ChangeDeviceControl */
1350     CARD16      length B16;
1351     CARD16      control B16;
1352     CARD8       deviceid;
1353     BYTE        pad0;
1354 } xChangeDeviceControlReq;
1355
1356 typedef struct {
1357     CARD8       repType;        /* X_Reply                      */
1358     CARD8       RepType;        /* always X_ChangeDeviceControl */
1359     CARD16      sequenceNumber B16;
1360     CARD32      length B32;
1361     CARD8       status;
1362     BYTE        pad1, pad2, pad3;
1363     CARD32      pad01 B32;
1364     CARD32      pad02 B32;
1365     CARD32      pad03 B32;
1366     CARD32      pad04 B32;
1367     CARD32      pad05 B32;
1368 } xChangeDeviceControlReply;
1369
1370 typedef struct {
1371     CARD16      control B16;    /* control type         */
1372     CARD16      length B16;     /* control length               */
1373 } xDeviceCtl;
1374
1375 typedef struct {
1376     CARD16      control B16;            /* control type         */
1377     CARD16      length B16;             /* control length               */
1378     CARD8       first_valuator;         /* first valuator to change     */
1379     CARD8       num_valuators;          /* number of valuators to change*/
1380     CARD8       pad1,pad2;
1381 } xDeviceResolutionCtl;
1382
1383 typedef struct {
1384      CARD16         control B16;
1385      CARD16         length B16;
1386      INT32          min_x;
1387      INT32          max_x;
1388      INT32          min_y;
1389      INT32          max_y;
1390      CARD32         flip_x;
1391      CARD32         flip_y;
1392      CARD32         rotation;
1393      CARD32         button_threshold;
1394 } xDeviceAbsCalibCtl;
1395
1396 typedef struct {
1397      CARD16         control B16;
1398      CARD16         length B16;
1399      CARD32         offset_x;
1400      CARD32         offset_y;
1401      INT32          width;
1402      INT32          height;
1403      INT32          screen;
1404      CARD32         following;
1405 } xDeviceAbsAreaCtl;
1406
1407 typedef struct {
1408     CARD16          control B16;
1409     CARD16          length  B16;
1410     CARD8           status;
1411     CARD8           pad0;
1412     CARD16          pad1 B16;
1413 } xDeviceCoreCtl;
1414
1415 typedef struct {
1416     CARD16          control B16;
1417     CARD16          length  B16;
1418     CARD8           enable;
1419     CARD8           pad0;
1420     CARD16          pad1 B16;
1421 } xDeviceEnableCtl;
1422
1423 /* XI 1.5 */
1424
1425 /*********************************************************
1426  *
1427  * ListDeviceProperties.
1428  *
1429  */
1430
1431 typedef struct {
1432     CARD8       reqType;        /* input extension major opcode */
1433     CARD8       ReqType;        /* always X_ListDeviceProperties */
1434     CARD16      length B16;
1435     CARD8       deviceid;
1436     CARD8       pad0;
1437     CARD16      pad1 B16;
1438 } xListDevicePropertiesReq;
1439
1440 typedef struct {
1441     CARD8       repType;        /* X_Reply                       */
1442     CARD8       RepType;        /* always X_ListDeviceProperties */
1443     CARD16      sequenceNumber B16;
1444     CARD32      length B32;
1445     CARD16      nAtoms B16;
1446     CARD16      pad1 B16;
1447     CARD32      pad2 B32;
1448     CARD32      pad3 B32;
1449     CARD32      pad4 B32;
1450     CARD32      pad5 B32;
1451     CARD32      pad6 B32;
1452 } xListDevicePropertiesReply;
1453
1454 /*********************************************************
1455  *
1456  * ChangeDeviceProperty.
1457  *
1458  */
1459
1460 typedef struct {
1461     CARD8       reqType;        /* input extension major opcode */
1462     CARD8       ReqType;        /* always X_ChangeDeviceProperty */
1463     CARD16      length B16;
1464     Atom        property B32;
1465     Atom        type B32;
1466     CARD8       deviceid;
1467     CARD8       format;
1468     CARD8       mode;
1469     CARD8       pad;
1470     CARD32      nUnits B32;
1471 } xChangeDevicePropertyReq;
1472
1473 /*********************************************************
1474  *
1475  * DeleteDeviceProperty.
1476  *
1477  */
1478
1479 typedef struct {
1480     CARD8       reqType;        /* input extension major opcode */
1481     CARD8       ReqType;        /* always X_DeleteDeviceProperty */
1482     CARD16      length B16;
1483     Atom        property B32;
1484     CARD8       deviceid;
1485     CARD8       pad0;
1486     CARD16      pad1 B16;
1487 } xDeleteDevicePropertyReq;
1488
1489 /*********************************************************
1490  *
1491  * GetDeviceProperty.
1492  *
1493  */
1494
1495 typedef struct {
1496     CARD8       reqType;        /* input extension major opcode */
1497     CARD8       ReqType;        /* always X_GetDeviceProperty */
1498     CARD16      length B16;
1499     Atom        property B32;
1500     Atom        type B32;
1501     CARD32      longOffset B32;
1502     CARD32      longLength B32;
1503     CARD8       deviceid;
1504 #if defined(__cplusplus) || defined(c_plusplus)
1505     BOOL        c_delete;
1506 #else
1507     BOOL        delete;
1508 #endif
1509     CARD16      pad;
1510 } xGetDevicePropertyReq;
1511
1512 typedef struct {
1513     CARD8       repType;        /* X_Reply                        */
1514     CARD8       RepType;        /* always X_GetDeviceProperty   */
1515     CARD16      sequenceNumber B16;
1516     CARD32      length B32;
1517     Atom        propertyType B32;
1518     CARD32      bytesAfter B32;
1519     CARD32      nItems B32;
1520     CARD8       format;
1521     CARD8       deviceid;
1522     CARD16      pad1 B16;
1523     CARD32      pad2 B32;
1524     CARD32      pad3 B32;
1525 } xGetDevicePropertyReply;
1526
1527
1528 /**********************************************************
1529  *
1530  * Input extension events.
1531  *
1532  * DeviceValuator
1533  *
1534  */
1535
1536 typedef struct
1537     {
1538     BYTE        type;
1539     CARD8       deviceid;
1540     CARD16      sequenceNumber B16;
1541     KeyButMask  device_state B16;
1542     CARD8       num_valuators;
1543     CARD8       first_valuator;
1544     INT32       valuator0 B32;
1545     INT32       valuator1 B32;
1546     INT32       valuator2 B32;
1547     INT32       valuator3 B32;
1548     INT32       valuator4 B32;
1549     INT32       valuator5 B32;
1550     }  deviceValuator;
1551
1552 /**********************************************************
1553  *
1554  * DeviceKeyButtonPointer.
1555  *
1556  * Used for: DeviceKeyPress, DeviceKeyRelease,
1557  *           DeviceButtonPress, DeviceButtonRelease,
1558  *           ProximityIn, ProximityOut
1559  *           DeviceMotionNotify,
1560  *
1561  */
1562
1563 typedef struct
1564     {
1565     BYTE        type;
1566     BYTE        detail;
1567     CARD16      sequenceNumber B16;
1568     Time        time B32;
1569     Window      root B32;
1570     Window      event B32;
1571     Window      child B32;
1572     INT16       root_x B16;
1573     INT16       root_y B16;
1574     INT16       event_x B16;
1575     INT16       event_y B16;
1576     KeyButMask  state B16;
1577     BOOL        same_screen;
1578     CARD8       deviceid;
1579     }  deviceKeyButtonPointer;
1580
1581 /**********************************************************
1582  *
1583  * DeviceFocus.
1584  *
1585  */
1586
1587 typedef struct
1588     {
1589     BYTE        type;
1590     BYTE        detail;
1591     CARD16      sequenceNumber B16;
1592     Time        time B32;
1593     Window      window B32;
1594     BYTE        mode;
1595     CARD8       deviceid;
1596     BYTE        pad1, pad2;
1597     CARD32      pad00 B32;
1598     CARD32      pad01 B32;
1599     CARD32      pad02 B32;
1600     CARD32      pad03 B32;
1601     }  deviceFocus;
1602
1603 /**********************************************************
1604  *
1605  * DeviceStateNotify.
1606  *
1607  * Note that the two high-order bits in the classes_reported
1608  * field are the proximity state (InProximity or OutOfProximity),
1609  * and the device mode (Absolute or Relative), respectively.
1610  *
1611  */
1612
1613 typedef struct
1614     {
1615     BYTE        type;
1616     BYTE        deviceid;
1617     CARD16      sequenceNumber B16;
1618     Time        time B32;
1619     CARD8       num_keys;
1620     CARD8       num_buttons;
1621     CARD8       num_valuators;
1622     CARD8       classes_reported;
1623     CARD8       buttons[4];
1624     CARD8       keys[4];
1625     INT32       valuator0 B32;
1626     INT32       valuator1 B32;
1627     INT32       valuator2 B32;
1628     }  deviceStateNotify;
1629
1630 /**********************************************************
1631  *
1632  * DeviceKeyStateNotify.
1633  *
1634  */
1635
1636 typedef struct
1637     {
1638     BYTE        type;
1639     BYTE        deviceid;
1640     CARD16      sequenceNumber B16;
1641     CARD8       keys[28];
1642     }  deviceKeyStateNotify;
1643
1644 /**********************************************************
1645  *
1646  * DeviceButtonStateNotify.
1647  *
1648  */
1649
1650 typedef struct
1651     {
1652     BYTE        type;
1653     BYTE        deviceid;
1654     CARD16      sequenceNumber B16;
1655     CARD8       buttons[28];
1656     }  deviceButtonStateNotify;
1657
1658 /**********************************************************
1659  *
1660  * DeviceMappingNotify.
1661  * Fields must be kept in sync with core mappingnotify event.
1662  *
1663  */
1664
1665 typedef struct
1666     {
1667     BYTE        type;
1668     BYTE        deviceid;
1669     CARD16      sequenceNumber B16;
1670     CARD8       request;
1671     KeyCode     firstKeyCode;
1672     CARD8       count;
1673     BYTE        pad1;
1674     Time        time B32;
1675     CARD32      pad00 B32;
1676     CARD32      pad01 B32;
1677     CARD32      pad02 B32;
1678     CARD32      pad03 B32;
1679     CARD32      pad04 B32;
1680     }  deviceMappingNotify;
1681
1682 /**********************************************************
1683  *
1684  * ChangeDeviceNotify.
1685  *
1686  */
1687
1688 typedef struct
1689     {
1690     BYTE        type;
1691     BYTE        deviceid;
1692     CARD16      sequenceNumber B16;
1693     Time        time B32;
1694     CARD8       request;
1695     BYTE        pad1, pad2, pad3;
1696     CARD32      pad00 B32;
1697     CARD32      pad01 B32;
1698     CARD32      pad02 B32;
1699     CARD32      pad03 B32;
1700     CARD32      pad04 B32;
1701     }  changeDeviceNotify;
1702
1703 /**********************************************************
1704  *
1705  * devicePresenceNotify.
1706  *
1707  */
1708
1709 typedef struct
1710     {
1711     BYTE        type;
1712     BYTE        pad00;
1713     CARD16      sequenceNumber B16;
1714     Time        time B32;
1715     BYTE        devchange; /* Device{Added|Removed|Enabled|Disabled|ControlChanged} */
1716     BYTE        deviceid;
1717     CARD16      control B16;
1718     CARD32      pad02 B32;
1719     CARD32      pad03 B32;
1720     CARD32      pad04 B32;
1721     CARD32      pad05 B32;
1722     CARD32      pad06 B32;
1723     }  devicePresenceNotify;
1724
1725
1726 /*********************************************************
1727  * DevicePropertyNotifyEvent
1728  *
1729  * Sent whenever a device's property changes.
1730  *
1731  */
1732
1733 typedef struct
1734     {
1735     BYTE        type;
1736     BYTE        state;               /* NewValue or Deleted */
1737     CARD16      sequenceNumber B16;
1738     CARD32      time B32;
1739     Atom        atom B32;            /* affected property */
1740     CARD32      pad0 B32;
1741     CARD32      pad1 B32;
1742     CARD32      pad2 B32;
1743     CARD32      pad3 B32;
1744     CARD16      pad5 B16;
1745     CARD8       pad4;
1746     CARD8       deviceid;            /* id of device */
1747     } devicePropertyNotify;
1748
1749 #undef Window
1750 #undef Time
1751 #undef KeyCode
1752 #undef Mask
1753 #undef Atom
1754 #undef Cursor
1755
1756 #endif