]> git.sesse.net Git - rdpsrv/blob - Xserver/include/extensions/XIproto.h
31adf53f008204f41e6eb0ed1fef7106b6ce3b9a
[rdpsrv] / Xserver / include / extensions / XIproto.h
1 /* $XConsortium: XIproto.h /main/26 1996/03/20 15:30:59 mor $ */
2
3 /************************************************************
4
5 Copyright (c) 1989  X Consortium
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
20 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24 Except as contained in this notice, the name of the X Consortium shall not be
25 used in advertising or otherwise to promote the sale, use or other dealings
26 in this Software without prior written authorization from the X Consortium.
27
28 Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, California.
29
30                         All Rights Reserved
31
32 Permission to use, copy, modify, and distribute this software and its
33 documentation for any purpose and without fee is hereby granted,
34 provided that the above copyright notice appear in all copies and that
35 both that copyright notice and this permission notice appear in
36 supporting documentation, and that the name of Hewlett-Packard not be
37 used in advertising or publicity pertaining to distribution of the
38 software without specific, written prior permission.
39
40 HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
41 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
42 HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
43 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
44 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
45 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
46 SOFTWARE.
47
48 ********************************************************/
49
50 #ifndef _XIPROTO_H
51 #define _XIPROTO_H
52
53 #include <X11/Xproto.h>
54 #include <X11/X.h>
55
56 /* make sure types have right sizes for protocol structures. */
57 #define Window CARD32
58 #define Time CARD32
59 #define KeyCode CARD8
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         15
76 #define IERRORS         5
77
78 #define CLIENT_REQ              1
79
80 typedef struct  _XExtEventInfo
81     {
82     Mask        mask;
83     BYTE        type;
84     BYTE        word;
85     } XExtEventInfo;
86
87 typedef unsigned char *Pointer;
88
89 struct tmask
90     {
91     Mask        mask;
92     Pointer     dev;
93     };
94
95 /*********************************************************
96  *
97  * Event constants used by library.
98  *
99  */
100
101 #define XI_DeviceValuator               0
102 #define XI_DeviceKeyPress               1
103 #define XI_DeviceKeyRelease             2
104 #define XI_DeviceButtonPress            3
105 #define XI_DeviceButtonRelease          4
106 #define XI_DeviceMotionNotify           5
107 #define XI_DeviceFocusIn                6
108 #define XI_DeviceFocusOut               7
109 #define XI_ProximityIn                  8
110 #define XI_ProximityOut                 9
111 #define XI_DeviceStateNotify            10
112 #define XI_DeviceMappingNotify          11
113 #define XI_ChangeDeviceNotify           12
114 #define XI_DeviceKeystateNotify         13
115 #define XI_DeviceButtonstateNotify      14
116
117 /*********************************************************
118  *
119  * Protocol request constants
120  *
121  */
122
123 #define X_GetExtensionVersion           1
124 #define X_ListInputDevices              2
125 #define X_OpenDevice                    3
126 #define X_CloseDevice                   4
127 #define X_SetDeviceMode                 5
128 #define X_SelectExtensionEvent          6
129 #define X_GetSelectedExtensionEvents    7
130 #define X_ChangeDeviceDontPropagateList 8
131 #define X_GetDeviceDontPropagateList    9
132 #define X_GetDeviceMotionEvents         10
133 #define X_ChangeKeyboardDevice          11
134 #define X_ChangePointerDevice           12
135 #define X_GrabDevice                    13
136 #define X_UngrabDevice                  14
137 #define X_GrabDeviceKey                 15
138 #define X_UngrabDeviceKey               16
139 #define X_GrabDeviceButton              17
140 #define X_UngrabDeviceButton            18
141 #define X_AllowDeviceEvents             19
142 #define X_GetDeviceFocus                20
143 #define X_SetDeviceFocus                21
144 #define X_GetFeedbackControl            22
145 #define X_ChangeFeedbackControl         23
146 #define X_GetDeviceKeyMapping           24
147 #define X_ChangeDeviceKeyMapping        25
148 #define X_GetDeviceModifierMapping      26
149 #define X_SetDeviceModifierMapping      27
150 #define X_GetDeviceButtonMapping        28
151 #define X_SetDeviceButtonMapping        29
152 #define X_QueryDeviceState              30
153 #define X_SendExtensionEvent            31
154 #define X_DeviceBell                    32
155 #define X_SetDeviceValuators            33
156 #define X_GetDeviceControl              34
157 #define X_ChangeDeviceControl           35
158
159 /*********************************************************
160  *
161  * Protocol request and reply structures.
162  *
163  * GetExtensionVersion.
164  *
165  */
166
167 typedef struct {
168     CARD8       reqType;       /* input extension major code   */
169     CARD8       ReqType;       /* always X_GetExtensionVersion */
170     CARD16      length B16;
171     CARD16      nbytes B16;
172     CARD8       pad1, pad2;
173 } xGetExtensionVersionReq;
174
175 typedef struct {
176     CARD8       repType;        /* X_Reply                      */
177     CARD8       RepType;        /* always X_GetExtensionVersion */
178     CARD16      sequenceNumber B16;
179     CARD32      length B32;
180     CARD16      major_version B16;
181     CARD16      minor_version B16;
182     BOOL        present;
183     CARD8       pad1, pad2, pad3;
184     CARD32      pad01 B32;
185     CARD32      pad02 B32;
186     CARD32      pad03 B32;
187     CARD32      pad04 B32;
188 } xGetExtensionVersionReply;
189
190 /*********************************************************
191  *
192  * ListInputDevices.
193  *
194  */
195
196 typedef struct {
197     CARD8       reqType;        /* input extension major code   */
198     CARD8       ReqType;        /* always X_ListInputDevices    */
199     CARD16      length B16;
200 } xListInputDevicesReq;
201
202 typedef struct {
203     CARD8       repType;        /* X_Reply                      */
204     CARD8       RepType;        /* always X_ListInputDevices    */
205     CARD16      sequenceNumber B16;
206     CARD32      length B32;
207     CARD8       ndevices;
208     CARD8       pad1, pad2, pad3;
209     CARD32      pad01 B32;
210     CARD32      pad02 B32;
211     CARD32      pad03 B32;
212     CARD32      pad04 B32;
213     CARD32      pad05 B32;
214 } xListInputDevicesReply;
215
216 typedef struct _xDeviceInfo *xDeviceInfoPtr;
217
218 typedef struct _xAnyClassinfo *xAnyClassPtr;
219
220 typedef struct _xAnyClassinfo {
221     CARD8       class;
222     CARD8       length;
223     } xAnyClassInfo;
224
225 typedef struct _xDeviceInfo {
226     CARD32      type B32;
227     CARD8       id;
228     CARD8       num_classes;
229     CARD8       use;
230     CARD8       pad1;
231     } xDeviceInfo;
232
233 typedef struct _xKeyInfo *xKeyInfoPtr;
234
235 typedef struct _xKeyInfo {
236     CARD8       class;
237     CARD8       length;
238     KeyCode     min_keycode; 
239     KeyCode     max_keycode; 
240     CARD16      num_keys B16;
241     CARD8       pad1,pad2;
242     } xKeyInfo;
243
244 typedef struct _xButtonInfo *xButtonInfoPtr;
245
246 typedef struct _xButtonInfo {
247     CARD8       class;
248     CARD8       length;
249     CARD16      num_buttons B16;
250     } xButtonInfo;
251
252 typedef struct _xValuatorInfo *xValuatorInfoPtr;
253
254 typedef struct _xValuatorInfo {
255     CARD8       class;
256     CARD8       length;
257     CARD8       num_axes;
258     CARD8       mode;
259     CARD32      motion_buffer_size B32;
260     } xValuatorInfo;
261
262 typedef struct _xAxisInfo *xAxisInfoPtr;
263
264 typedef struct _xAxisInfo {
265     CARD32      resolution B32;
266     CARD32      min_value B32;
267     CARD32      max_value B32;
268     } xAxisInfo;
269
270 /*********************************************************
271  *
272  * OpenDevice.
273  *
274  */
275
276 typedef struct {
277     CARD8       reqType;        /* input extension major code   */
278     CARD8       ReqType;        /* always X_OpenDevice          */
279     CARD16      length B16;
280     CARD8       deviceid;
281     BYTE        pad1, pad2, pad3;
282 } xOpenDeviceReq;
283
284 typedef struct {
285     CARD8       repType;        /* X_Reply                      */
286     CARD8       RepType;        /* always X_OpenDevice          */
287     CARD16      sequenceNumber B16;
288     CARD32      length B32;
289     CARD8       num_classes;
290     BYTE        pad1, pad2, pad3;
291     CARD32      pad00 B32;
292     CARD32      pad01 B32;
293     CARD32      pad02 B32;
294     CARD32      pad03 B32;
295     CARD32      pad04 B32;
296     } xOpenDeviceReply;
297
298 typedef struct {
299     CARD8       class;
300     CARD8       event_type_base;
301     } xInputClassInfo;
302
303 /*********************************************************
304  *
305  * CloseDevice.
306  *
307  */
308
309 typedef struct {
310     CARD8       reqType;        /* input extension major code   */
311     CARD8       ReqType;        /* always X_CloseDevice         */
312     CARD16      length B16;
313     CARD8       deviceid;
314     BYTE        pad1, pad2, pad3;
315 } xCloseDeviceReq;
316
317 /*********************************************************
318  *
319  * SetDeviceMode.
320  *
321  */
322
323 typedef struct {
324     CARD8       reqType;        /* input extension major code   */
325     CARD8       ReqType;        /* always X_SetDeviceMode       */
326     CARD16      length B16;
327     CARD8       deviceid;
328     CARD8       mode;
329     BYTE        pad1, pad2;
330 } xSetDeviceModeReq;
331
332 typedef struct {
333     CARD8       repType;        /* X_Reply                      */
334     CARD8       RepType;        /* always X_SetDeviceMode       */
335     CARD16      sequenceNumber B16;
336     CARD32      length B32;
337     CARD8       status;
338     BYTE        pad1, pad2, pad3;
339     CARD32      pad01 B32;
340     CARD32      pad02 B32;
341     CARD32      pad03 B32;
342     CARD32      pad04 B32;
343     CARD32      pad05 B32;
344 } xSetDeviceModeReply;
345
346 /*********************************************************
347  *
348  * SelectExtensionEvent.
349  *
350  */
351
352 typedef struct {
353     CARD8       reqType;        /* input extension major code   */
354     CARD8       ReqType;        /* always X_SelectExtensionEvent */
355     CARD16      length B16;
356     Window      window B32;
357     CARD16      count B16;
358     CARD16      pad00 B16;
359 } xSelectExtensionEventReq;
360
361 /*********************************************************
362  *
363  * GetSelectedExtensionEvent.
364  *
365  */
366
367 typedef struct {
368     CARD8       reqType;        /* input extension major code   */
369     CARD8       ReqType;        /* X_GetSelectedExtensionEvents */
370     CARD16      length B16;
371     Window      window B32;
372 } xGetSelectedExtensionEventsReq;
373
374 typedef struct {
375     CARD8       repType;        /* X_Reply                      */
376     CARD8       RepType;        /* GetSelectedExtensionEvents   */
377     CARD16      sequenceNumber B16;
378     CARD32      length B32;
379     CARD16      this_client_count B16;
380     CARD16      all_clients_count B16;
381     CARD32      pad01 B32;
382     CARD32      pad02 B32;
383     CARD32      pad03 B32;
384     CARD32      pad04 B32;
385     CARD32      pad05 B32;
386 } xGetSelectedExtensionEventsReply;
387
388 /*********************************************************
389  *
390  * ChangeDeviceDontPropagateList.
391  *
392  */
393
394 typedef struct {
395     CARD8       reqType;        /* input extension major code   */
396     CARD8       ReqType;        /* X_ChangeDeviceDontPropagateList */
397     CARD16      length B16;
398     Window      window B32;
399     CARD16      count B16;
400     CARD8       mode;
401     BYTE        pad;
402 } xChangeDeviceDontPropagateListReq;
403
404 /*********************************************************
405  *
406  * GetDeviceDontPropagateList.
407  *
408  */
409
410 typedef struct {
411     CARD8       reqType;        /* input extension major code   */
412     CARD8       ReqType;        /* X_GetDeviceDontPropagateList */
413     CARD16      length B16;
414     Window      window B32;
415 } xGetDeviceDontPropagateListReq;
416
417 typedef struct {
418     CARD8       repType;        /* X_Reply                      */
419     CARD8       RepType;        /* GetDeviceDontPropagateList   */
420     CARD16      sequenceNumber B16;
421     CARD32      length B32;
422     CARD16      count B16;
423     CARD16      pad00 B16;
424     CARD32      pad01 B32;
425     CARD32      pad02 B32;
426     CARD32      pad03 B32;
427     CARD32      pad04 B32;
428     CARD32      pad05 B32;
429     } xGetDeviceDontPropagateListReply;
430
431 /*********************************************************
432  *
433  * GetDeviceMotionEvents.
434  *
435  */
436
437 typedef struct {
438     CARD8       reqType;        /* input extension major code   */
439     CARD8       ReqType;        /* always X_GetDeviceMotionEvents*/
440     CARD16      length B16;
441     Time        start B32;
442     Time        stop B32;
443     CARD8       deviceid;
444     BYTE        pad1, pad2, pad3;
445 } xGetDeviceMotionEventsReq;
446
447 typedef struct {
448     CARD8       repType;        /* X_Reply */
449     CARD8       RepType;        /* always X_GetDeviceMotionEvents  */
450     CARD16      sequenceNumber B16;
451     CARD32      length B32;
452     CARD32      nEvents B32;
453     CARD8       axes;
454     CARD8       mode;
455     BYTE        pad1, pad2;
456     CARD32      pad01 B32;
457     CARD32      pad02 B32;
458     CARD32      pad03 B32;
459     CARD32      pad04 B32;
460 } xGetDeviceMotionEventsReply;
461
462 /*********************************************************
463  *
464  * ChangeKeyboardDevice.
465  *
466  */
467
468 typedef struct {
469     CARD8       reqType;        /* input extension major code   */
470     CARD8       ReqType;        /* X_ChangeKeyboardDevice       */
471     CARD16      length B16;
472     CARD8       deviceid;
473     BYTE        pad1, pad2, pad3;
474 } xChangeKeyboardDeviceReq;
475
476 typedef struct {
477     CARD8       repType;        /* X_Reply                      */
478     CARD8       RepType;        /* always X_ChangeKeyboardDevice*/
479     CARD16      sequenceNumber B16;
480     CARD32      length B32;  /* 0 */
481     CARD8       status;
482     BYTE        pad1, pad2, pad3;
483     CARD32      pad01 B32;
484     CARD32      pad02 B32;
485     CARD32      pad03 B32;
486     CARD32      pad04 B32;
487     CARD32      pad05 B32;
488     } xChangeKeyboardDeviceReply;
489
490 /*********************************************************
491  *
492  * ChangePointerDevice.
493  *
494  */
495
496 typedef struct {
497     CARD8       reqType;        /* input extension major code   */
498     CARD8       ReqType;        /* X_ChangePointerDevice        */
499     CARD16      length B16;
500     CARD8       xaxis;
501     CARD8       yaxis;
502     CARD8       deviceid;
503     BYTE        pad1;
504 } xChangePointerDeviceReq;
505
506 typedef struct {
507     CARD8       repType;        /* X_Reply                      */
508     CARD8       RepType;        /* always X_ChangePointerDevice */
509     CARD16      sequenceNumber B16;
510     CARD32      length B32;  /* 0 */
511     CARD8       status;
512     BYTE        pad1, pad2, pad3;
513     CARD32      pad01 B32;
514     CARD32      pad02 B32;
515     CARD32      pad03 B32;
516     CARD32      pad04 B32;
517     CARD32      pad05 B32;
518     } xChangePointerDeviceReply;
519
520 /*********************************************************
521  *
522  * GrabDevice.
523  *
524  */
525
526 typedef struct {
527     CARD8       reqType;        /* input extension major code   */
528     CARD8       ReqType;        /* always X_GrabDevice */
529     CARD16      length B16;
530     Window      grabWindow B32;
531     Time        time B32;
532     CARD16      event_count B16;
533     CARD8       this_device_mode;
534     CARD8       other_devices_mode;
535     BOOL        ownerEvents;
536     CARD8       deviceid;
537     CARD16      pad01 B16;
538 } xGrabDeviceReq;
539
540 typedef struct {
541     CARD8       repType;        /* X_Reply                      */
542     CARD8       RepType;        /* always X_GrabDevice          */
543     CARD16      sequenceNumber B16;
544     CARD32      length B32;  /* 0 */
545     CARD8       status;
546     BYTE        pad1, pad2, pad3;
547     CARD32      pad01 B32;
548     CARD32      pad02 B32;
549     CARD32      pad03 B32;
550     CARD32      pad04 B32;
551     CARD32      pad05 B32;
552     } xGrabDeviceReply;
553
554 /*********************************************************
555  *
556  * UngrabDevice.
557  *
558  */
559
560 typedef struct {
561     CARD8       reqType;        /* input extension major code   */
562     CARD8       ReqType;        /* always X_UnGrabDevice        */
563     CARD16      length B16;
564     Time        time B32;
565     CARD8       deviceid;
566     BYTE        pad1, pad2, pad3;
567 } xUngrabDeviceReq;
568
569 /*********************************************************
570  *
571  * GrabDeviceKey.
572  *
573  */
574
575 typedef struct {
576     CARD8       reqType;        /* input extension major code   */
577     CARD8       ReqType;        /* always X_GrabDeviceKey       */
578     CARD16      length B16;
579     Window      grabWindow B32;
580     CARD16      event_count B16;
581     CARD16      modifiers B16;
582     CARD8       modifier_device;
583     CARD8       grabbed_device;
584     CARD8       key;
585     BYTE        this_device_mode;  
586     BYTE        other_devices_mode;  
587     BOOL        ownerEvents;
588     BYTE        pad1, pad2;
589 } xGrabDeviceKeyReq;
590
591 /*********************************************************
592  *
593  * UngrabDeviceKey.
594  *
595  */
596
597 typedef struct {
598     CARD8       reqType;        /* input extension major code   */
599     CARD8       ReqType;        /* always X_UngrabDeviceKey     */
600     CARD16      length B16;
601     Window      grabWindow B32;
602     CARD16      modifiers B16;
603     CARD8       modifier_device;
604     CARD8       key;
605     CARD8       grabbed_device;
606     BYTE        pad1, pad2, pad3;
607 } xUngrabDeviceKeyReq;
608
609 /*********************************************************
610  *
611  * GrabDeviceButton.
612  *
613  */
614
615 typedef struct {
616     CARD8       reqType;        /* input extension major code   */
617     CARD8       ReqType;        /* always X_GrabDeviceButton    */
618     CARD16      length B16;
619     Window      grabWindow B32;
620     CARD8       grabbed_device;
621     CARD8       modifier_device;
622     CARD16      event_count B16;
623     CARD16      modifiers B16;
624     BYTE        this_device_mode;  
625     BYTE        other_devices_mode;  
626     CARD8       button;
627     BOOL        ownerEvents;
628     BYTE        pad1, pad2;
629 } xGrabDeviceButtonReq;
630
631 /*********************************************************
632  *
633  * UngrabDeviceButton.
634  *
635  */
636
637 typedef struct {
638     CARD8       reqType;        /* input extension major code   */
639     CARD8       ReqType;        /* always X_UngrabDeviceButton  */
640     CARD16      length B16;
641     Window      grabWindow B32;
642     CARD16      modifiers B16;
643     CARD8       modifier_device;
644     CARD8       button;
645     CARD8       grabbed_device;
646     BYTE        pad1, pad2, pad3;
647 } xUngrabDeviceButtonReq;
648
649 /*********************************************************
650  *
651  * AllowDeviceEvents.
652  *
653  */
654
655 typedef struct {
656     CARD8       reqType;        /* input extension major code   */
657     CARD8       ReqType;        /* always X_AllowDeviceEvents   */
658     CARD16      length B16;
659     Time        time B32;
660     CARD8       mode;
661     CARD8       deviceid;
662     BYTE        pad1, pad2;
663 } xAllowDeviceEventsReq;
664
665 /*********************************************************
666  *
667  * GetDeviceFocus.
668  *
669  */
670
671 typedef struct {
672     CARD8       reqType;        /* input extension major code   */
673     CARD8       ReqType;        /* always X_GetDeviceFocus      */
674     CARD16      length B16;
675     CARD8       deviceid;
676     BYTE        pad1, pad2, pad3;
677 } xGetDeviceFocusReq;
678
679 typedef struct {
680     CARD8       repType;        /* X_Reply                      */
681     CARD8       RepType;        /* always X_GetDeviceFocus      */
682     CARD16      sequenceNumber B16;
683     CARD32      length B32;
684     CARD32      focus B32;
685     Time        time B32;
686     CARD8       revertTo;
687     BYTE        pad1, pad2, pad3;
688     CARD32      pad01 B32;
689     CARD32      pad02 B32;
690     CARD32      pad03 B32;
691     } xGetDeviceFocusReply;
692
693 /*********************************************************
694  *
695  * SetDeviceFocus.
696  *
697  */
698
699 typedef struct {
700     CARD8       reqType;        /* input extension major code   */
701     CARD8       ReqType;        /* always X_SetDeviceFocus      */
702     CARD16      length B16;
703     Window      focus B32;
704     Time        time B32;
705     CARD8       revertTo;
706     CARD8       device;
707     CARD16      pad01 B16;
708 } xSetDeviceFocusReq;
709
710 /*********************************************************
711  *
712  * GetFeedbackControl.
713  *
714  */
715
716 typedef struct {
717     CARD8       reqType;        /* input extension major code   */
718     CARD8       ReqType;        /* X_GetFeedbackControl         */
719     CARD16      length B16;
720     CARD8       deviceid;
721     BYTE        pad1, pad2, pad3;
722 } xGetFeedbackControlReq;
723
724 typedef struct {
725     CARD8       repType;        /* X_Reply                      */
726     CARD8       RepType;        /* always X_GetFeedbackControl  */
727     CARD16      sequenceNumber B16;
728     CARD32      length B32;
729     CARD16      num_feedbacks B16;
730     CARD16      pad01 B16;
731     CARD32      pad02 B32;
732     CARD32      pad03 B32;
733     CARD32      pad04 B32;
734     CARD32      pad05 B32;
735     CARD32      pad06 B32;
736 } xGetFeedbackControlReply;
737
738 typedef struct {
739     CARD8       class;          /* feedback class               */
740     CARD8       id;             /* feedback id                  */
741     CARD16      length B16;     /* feedback length              */
742 } xFeedbackState;
743
744 typedef struct {
745     CARD8   class;
746     CARD8   id;
747     CARD16  length B16;
748     CARD16  pitch B16;
749     CARD16  duration B16;
750     CARD32  led_mask B32;
751     CARD32  led_values B32;
752     BOOL    global_auto_repeat;
753     CARD8   click;
754     CARD8   percent;
755     BYTE    pad;
756     BYTE    auto_repeats[32];
757 } xKbdFeedbackState;
758
759 typedef struct {
760     CARD8   class;
761     CARD8   id;
762     CARD16  length B16;
763     CARD8   pad1,pad2;
764     CARD16  accelNum B16;
765     CARD16  accelDenom B16;
766     CARD16  threshold B16;
767 } xPtrFeedbackState;
768
769 typedef struct {
770     CARD8       class;          /* feedback class id            */
771     CARD8       id;
772     CARD16      length B16;     /* feedback length              */
773     CARD32      resolution B32;
774     INT32       min_value B32;
775     INT32       max_value B32;
776 } xIntegerFeedbackState;
777
778 typedef struct {
779     CARD8       class;          /* feedback class id            */
780     CARD8       id;
781     CARD16      length B16;     /* feedback length              */
782     CARD16      max_symbols B16;
783     CARD16      num_syms_supported B16;
784 } xStringFeedbackState;
785
786 typedef struct {
787     CARD8       class;          /* feedback class id            */
788     CARD8       id;
789     CARD16      length B16;     /* feedback length              */
790     CARD8       percent;
791     BYTE        pad1, pad2, pad3;
792     CARD16      pitch B16;
793     CARD16      duration B16;
794 } xBellFeedbackState;
795
796 typedef struct {
797     CARD8       class;          /* feedback class id            */
798     CARD8       id;
799     CARD16      length B16;     /* feedback length              */
800     CARD32      led_mask B32;
801     CARD32      led_values B32;
802 } xLedFeedbackState;
803
804 /*********************************************************
805  *
806  * ChangeFeedbackControl.
807  *
808  */
809
810 typedef struct {
811     CARD8       reqType;        /* input extension major code   */
812     CARD8       ReqType;        /* X_ChangeFeedbackControl      */
813     CARD16      length B16;
814     CARD32      mask B32;
815     CARD8       deviceid;
816     CARD8       feedbackid;
817     BYTE        pad1, pad2;
818 } xChangeFeedbackControlReq;
819
820 typedef struct {
821     CARD8       class;          /* feedback class id            */
822     CARD8       id;             /* feedback id                  */
823     CARD16      length B16;     /* feedback length              */
824 } xFeedbackCtl;
825
826 typedef struct {
827     CARD8       class;          /* feedback class id            */
828     CARD8       id;             /* feedback length              */
829     CARD16      length B16;     /* feedback length              */
830     KeyCode     key; 
831     CARD8       auto_repeat_mode;
832     INT8        click;
833     INT8        percent;
834     INT16       pitch B16;
835     INT16       duration B16;
836     CARD32      led_mask B32;
837     CARD32      led_values B32;
838 } xKbdFeedbackCtl;
839
840 typedef struct {
841     CARD8       class;          /* feedback class id            */
842     CARD8       id;             /* feedback id                  */
843     CARD16      length B16;     /* feedback length              */
844     CARD8       pad1,pad2;
845     INT16       num B16;
846     INT16       denom B16;
847     INT16       thresh B16;
848 } xPtrFeedbackCtl;
849
850 typedef struct {
851     CARD8       class;          /* feedback class id            */
852     CARD8       id;             /* feedback id                  */
853     CARD16      length B16;     /* feedback length              */
854     INT32       int_to_display B32;
855 } xIntegerFeedbackCtl;
856
857 typedef struct {
858     CARD8       class;          /* feedback class id            */
859     CARD8       id;             /* feedback id                  */
860     CARD16      length B16;     /* feedback length              */
861     CARD8       pad1,pad2;
862     CARD16      num_keysyms B16;
863 } xStringFeedbackCtl;
864
865 typedef struct {
866     CARD8       class;          /* feedback class id            */
867     CARD8       id;             /* feedback id                  */
868     CARD16      length B16;     /* feedback length              */
869     INT8        percent;
870     BYTE        pad1, pad2, pad3;
871     INT16       pitch B16;
872     INT16       duration B16;
873 } xBellFeedbackCtl;
874
875 typedef struct {
876     CARD8       class;          /* feedback class id            */
877     CARD8       id;             /* feedback id                  */
878     CARD16      length B16;     /* feedback length              */
879     CARD32      led_mask B32;
880     CARD32      led_values B32;
881 } xLedFeedbackCtl;
882
883 /*********************************************************
884  *
885  * GetDeviceKeyMapping.
886  *
887  */
888
889 typedef struct {
890     CARD8       reqType;        /* input extension major code   */
891     CARD8       ReqType;        /* always X_GetDeviceKeyMapping */
892     CARD16      length B16;
893     CARD8       deviceid;
894     KeyCode     firstKeyCode; 
895     CARD8       count;
896     BYTE        pad1;
897 } xGetDeviceKeyMappingReq;
898
899 typedef struct {
900     CARD8       repType;        /* X_Reply                      */
901     CARD8       RepType;        /* always X_GetDeviceKeyMapping */
902     CARD16      sequenceNumber B16;
903     CARD32      length B32;
904     CARD8       keySymsPerKeyCode;
905     CARD8       pad0;
906     CARD16      pad1 B16;
907     CARD32      pad2 B32;
908     CARD32      pad3 B32;
909     CARD32      pad4 B32;
910     CARD32      pad5 B32;
911     CARD32      pad6 B32;
912 } xGetDeviceKeyMappingReply;
913
914 /*********************************************************
915  *
916  * ChangeDeviceKeyMapping.
917  *
918  */
919
920 typedef struct {
921     CARD8       reqType;        /* input extension major code   */
922     CARD8       ReqType;        /* always X_ChangeDeviceKeyMapping */
923     CARD16      length B16;
924     CARD8       deviceid;
925     KeyCode     firstKeyCode;
926     CARD8       keySymsPerKeyCode;
927     CARD8       keyCodes;
928 } xChangeDeviceKeyMappingReq;
929
930 /*********************************************************
931  *
932  * GetDeviceModifierMapping.
933  *
934  */
935
936 typedef struct {
937     CARD8       reqType;        /* input extension major code   */
938     CARD8       ReqType;        /* always X_GetDeviceModifierMapping */
939     CARD16      length B16;
940     CARD8       deviceid;
941     BYTE        pad1, pad2, pad3;
942 } xGetDeviceModifierMappingReq;
943
944 typedef struct {
945     CARD8       repType;        /* X_Reply */
946     CARD8       RepType;        /* always X_GetDeviceModifierMapping */
947     CARD16      sequenceNumber B16;
948     CARD32      length B32;
949     CARD8       numKeyPerModifier;
950     CARD8       pad0;
951     CARD16      pad1 B16;
952     CARD32      pad2 B32;
953     CARD32      pad3 B32;
954     CARD32      pad4 B32;
955     CARD32      pad5 B32;
956     CARD32      pad6 B32;
957 } xGetDeviceModifierMappingReply;
958
959 /*********************************************************
960  *
961  * SetDeviceModifierMapping.
962  *
963  */
964
965 typedef struct {
966     CARD8       reqType;        /* input extension major code   */
967     CARD8       ReqType;        /* always X_SetDeviceModifierMapping */
968     CARD16      length B16;
969     CARD8       deviceid;
970     CARD8       numKeyPerModifier;
971     CARD16      pad1 B16;
972 } xSetDeviceModifierMappingReq;
973
974 typedef struct {
975     CARD8       repType;        /* X_Reply */
976     CARD8       RepType;        /* always X_SetDeviceModifierMapping */
977     CARD16      sequenceNumber B16;
978     CARD32      length B32;
979     CARD8       success;
980     CARD8       pad0;
981     CARD16      pad1 B16;
982     CARD32      pad2 B32;
983     CARD32      pad3 B32;
984     CARD32      pad4 B32;
985     CARD32      pad5 B32;
986     CARD32      pad6 B32;
987 } xSetDeviceModifierMappingReply;
988
989 /*********************************************************
990  *
991  * GetDeviceButtonMapping.
992  *
993  */
994
995 typedef struct {
996     CARD8       reqType;        /* input extension major code   */
997     CARD8       ReqType;        /* X_GetDeviceButtonMapping     */
998     CARD16      length B16;
999     CARD8       deviceid;
1000     BYTE        pad1, pad2, pad3;
1001 } xGetDeviceButtonMappingReq;
1002
1003 typedef struct {
1004     CARD8       repType;        /* X_Reply */
1005     CARD8       RepType;        /* always X_GetDeviceButtonMapping */
1006     CARD16      sequenceNumber B16;
1007     CARD32      length B32;
1008     CARD8       nElts;
1009     BYTE        pad1, pad2, pad3;
1010     CARD32      pad01 B32;
1011     CARD32      pad02 B32;
1012     CARD32      pad03 B32;
1013     CARD32      pad04 B32;
1014     CARD32      pad05 B32;
1015 } xGetDeviceButtonMappingReply;
1016
1017 /*********************************************************
1018  *
1019  * SetDeviceButtonMapping.
1020  *
1021  */
1022
1023 typedef struct {
1024     CARD8       reqType;        /* input extension major code   */
1025     CARD8       ReqType;        /* X_SetDeviceButtonMapping     */
1026     CARD16      length B16;
1027     CARD8       deviceid;
1028     CARD8       map_length;
1029     BYTE        pad1, pad2;
1030 } xSetDeviceButtonMappingReq;
1031
1032 typedef struct {
1033     CARD8       repType;                /* X_Reply */
1034     CARD8       RepType;                /* always X_SetDeviceButtonMapping */
1035     CARD16      sequenceNumber B16;
1036     CARD32      length B32;
1037     CARD8       status;
1038     BYTE        pad0;
1039     CARD16      pad1 B16;
1040     CARD32      pad2 B32;
1041     CARD32      pad3 B32;
1042     CARD32      pad4 B32;
1043     CARD32      pad5 B32;
1044     CARD32      pad6 B32;
1045 } xSetDeviceButtonMappingReply;
1046
1047 /*********************************************************
1048  *
1049  * QueryDeviceState.
1050  *
1051  */
1052
1053 typedef struct {
1054     CARD8       reqType;
1055     CARD8       ReqType;        /* always X_QueryDeviceState */
1056     CARD16      length B16;
1057     CARD8       deviceid;
1058     BYTE        pad1, pad2, pad3;
1059 } xQueryDeviceStateReq;
1060
1061 typedef struct {
1062     CARD8       repType;                /* X_Reply */
1063     CARD8       RepType;                /* always X_QueryDeviceState    */
1064     CARD16      sequenceNumber B16;
1065     CARD32      length B32;
1066     CARD8       num_classes;
1067     BYTE        pad0;
1068     CARD16      pad1 B16;
1069     CARD32      pad2 B32;
1070     CARD32      pad3 B32;
1071     CARD32      pad4 B32;
1072     CARD32      pad5 B32;
1073     CARD32      pad6 B32;
1074 } xQueryDeviceStateReply;
1075
1076 typedef struct {
1077     CARD8       class;
1078     CARD8       length;
1079     CARD8       num_keys;
1080     BYTE        pad1;
1081     CARD8       keys[32];
1082 } xKeyState;
1083
1084 typedef struct {
1085     CARD8       class;
1086     CARD8       length;
1087     CARD8       num_buttons;
1088     BYTE        pad1;
1089     CARD8       buttons[32];
1090 } xButtonState;
1091
1092 typedef struct {
1093     CARD8       class;
1094     CARD8       length;
1095     CARD8       num_valuators;
1096     CARD8       mode;
1097 } xValuatorState;
1098
1099 /*********************************************************
1100  *
1101  * SendExtensionEvent.
1102  * THIS REQUEST MUST BE KEPT A MULTIPLE OF 8 BYTES IN LENGTH!
1103  * MORE EVENTS MAY FOLLOW AND THEY MUST BE QUAD-ALIGNED!
1104  *
1105  */
1106
1107 typedef struct {
1108     CARD8       reqType;
1109     CARD8       ReqType;        /* always X_SendExtensionEvent */
1110     CARD16      length B16;
1111     Window      destination B32;
1112     CARD8       deviceid;
1113     BOOL        propagate;
1114     CARD16      count B16;
1115     CARD8       num_events;
1116     BYTE        pad1,pad2,pad3;
1117 } xSendExtensionEventReq;
1118
1119 /*********************************************************
1120  *
1121  * DeviceBell.
1122  *
1123  */
1124
1125 typedef struct {
1126     CARD8       reqType;
1127     CARD8       ReqType;        /* always X_DeviceBell */
1128     CARD16      length B16;
1129     CARD8       deviceid;
1130     CARD8       feedbackid;
1131     CARD8       feedbackclass;
1132     INT8        percent;
1133 } xDeviceBellReq;
1134
1135 /*********************************************************
1136  *
1137  * SetDeviceValuators.
1138  *
1139  */
1140
1141 typedef struct {
1142     CARD8       reqType;        /* input extension major code   */
1143     CARD8       ReqType;        /* always X_SetDeviceValuators  */
1144     CARD16      length B16;
1145     CARD8       deviceid;
1146     CARD8       first_valuator;
1147     CARD8       num_valuators;
1148     BYTE        pad1;
1149 } xSetDeviceValuatorsReq;
1150
1151 typedef struct {
1152     CARD8       repType;        /* X_Reply                      */
1153     CARD8       RepType;        /* always X_SetDeviceValuators  */
1154     CARD16      sequenceNumber B16;
1155     CARD32      length B32;
1156     CARD8       status;
1157     BYTE        pad1, pad2, pad3;
1158     CARD32      pad01 B32;
1159     CARD32      pad02 B32;
1160     CARD32      pad03 B32;
1161     CARD32      pad04 B32;
1162     CARD32      pad05 B32;
1163 } xSetDeviceValuatorsReply;
1164
1165 /*********************************************************
1166  *
1167  * GetDeviceControl.
1168  *
1169  */
1170
1171 typedef struct {
1172     CARD8       reqType;        /* input extension major code   */
1173     CARD8       ReqType;        /* always X_GetDeviceControl    */
1174     CARD16      length B16;
1175     CARD16      control B16;
1176     CARD8       deviceid;
1177     BYTE        pad2;
1178 } xGetDeviceControlReq;
1179
1180 typedef struct {
1181     CARD8       repType;        /* X_Reply                      */
1182     CARD8       RepType;        /* always X_GetDeviceControl    */
1183     CARD16      sequenceNumber B16;
1184     CARD32      length B32;
1185     CARD8       status;
1186     BYTE        pad1, pad2, pad3;
1187     CARD32      pad01 B32;
1188     CARD32      pad02 B32;
1189     CARD32      pad03 B32;
1190     CARD32      pad04 B32;
1191     CARD32      pad05 B32;
1192 } xGetDeviceControlReply;
1193
1194 typedef struct {
1195     CARD16      control B16;    /* control type                 */
1196     CARD16      length B16;     /* control length               */
1197 } xDeviceState;
1198
1199 typedef struct {
1200     CARD16      control B16;            /* control type                 */
1201     CARD16      length B16;             /* control length               */
1202     CARD32      num_valuators B32;      /* number of valuators          */
1203 } xDeviceResolutionState;
1204
1205 /*********************************************************
1206  *
1207  * ChangeDeviceControl.
1208  *
1209  */
1210
1211 typedef struct {
1212     CARD8       reqType;        /* input extension major code   */
1213     CARD8       ReqType;        /* always X_ChangeDeviceControl */
1214     CARD16      length B16;
1215     CARD16      control B16;
1216     CARD8       deviceid;
1217     BYTE        pad0;
1218 } xChangeDeviceControlReq;
1219
1220 typedef struct {
1221     CARD8       repType;        /* X_Reply                      */
1222     CARD8       RepType;        /* always X_ChangeDeviceControl */
1223     CARD16      sequenceNumber B16;
1224     CARD32      length B32;
1225     CARD8       status;
1226     BYTE        pad1, pad2, pad3;
1227     CARD32      pad01 B32;
1228     CARD32      pad02 B32;
1229     CARD32      pad03 B32;
1230     CARD32      pad04 B32;
1231     CARD32      pad05 B32;
1232 } xChangeDeviceControlReply;
1233
1234 typedef struct {
1235     CARD16      control B16;    /* control type                 */
1236     CARD16      length B16;     /* control length               */
1237 } xDeviceCtl;
1238
1239 typedef struct {
1240     CARD16      control B16;            /* control type                 */
1241     CARD16      length B16;             /* control length               */
1242     CARD8       first_valuator;         /* first valuator to change     */
1243     CARD8       num_valuators;          /* number of valuators to change*/
1244     CARD8       pad1,pad2;
1245 } xDeviceResolutionCtl;
1246
1247 /**********************************************************
1248  *
1249  * Input extension events.
1250  *
1251  * DeviceValuator
1252  *
1253  */
1254
1255 typedef struct
1256     {
1257     BYTE        type;
1258     CARD8       deviceid;
1259     CARD16      sequenceNumber B16;
1260     KeyButMask  device_state B16;
1261     CARD8       num_valuators;
1262     CARD8       first_valuator;
1263     INT32       valuator0 B32;
1264     INT32       valuator1 B32;
1265     INT32       valuator2 B32;
1266     INT32       valuator3 B32;
1267     INT32       valuator4 B32;
1268     INT32       valuator5 B32;
1269     }  deviceValuator;
1270
1271 /**********************************************************
1272  *
1273  * DeviceKeyButtonPointer.
1274  *
1275  * Used for: DeviceKeyPress, DeviceKeyRelease,
1276  *           DeviceButtonPress, DeviceButtonRelease,
1277  *           ProximityIn, ProximityOut
1278  *           DeviceMotionNotify,
1279  * 
1280  */
1281
1282 typedef struct
1283     {
1284     BYTE        type;
1285     BYTE        detail;
1286     CARD16      sequenceNumber B16;
1287     Time        time B32;
1288     Window      root B32;
1289     Window      event B32;
1290     Window      child B32;
1291     INT16       root_x B16;
1292     INT16       root_y B16;
1293     INT16       event_x B16;
1294     INT16       event_y B16;
1295     KeyButMask  state B16;
1296     BOOL        same_screen;
1297     CARD8       deviceid;
1298     }  deviceKeyButtonPointer;
1299
1300 /**********************************************************
1301  *
1302  * DeviceFocus.
1303  *
1304  */
1305
1306 typedef struct
1307     {
1308     BYTE        type;
1309     BYTE        detail;
1310     CARD16      sequenceNumber B16;
1311     Time        time B32;
1312     Window      window B32;
1313     BYTE        mode;
1314     CARD8       deviceid;
1315     BYTE        pad1, pad2;
1316     CARD32      pad00 B32;
1317     CARD32      pad01 B32;
1318     CARD32      pad02 B32;
1319     CARD32      pad03 B32;
1320     }  deviceFocus;
1321
1322 /**********************************************************
1323  *
1324  * DeviceStateNotify.
1325  *
1326  * Note that the two high-order bits in the classes_reported
1327  * field are the proximity state (InProximity or OutOfProximity),
1328  * and the device mode (Absolute or Relative), respectively.
1329  *
1330  */
1331
1332 typedef struct
1333     {
1334     BYTE        type;
1335     BYTE        deviceid;
1336     CARD16      sequenceNumber B16;
1337     Time        time B32;
1338     CARD8       num_keys;
1339     CARD8       num_buttons;
1340     CARD8       num_valuators;
1341     CARD8       classes_reported;
1342     CARD8       buttons[4];
1343     CARD8       keys[4];
1344     INT32       valuator0 B32;
1345     INT32       valuator1 B32;
1346     INT32       valuator2 B32;
1347     }  deviceStateNotify;
1348
1349 /**********************************************************
1350  *
1351  * DeviceKeyStateNotify.
1352  *
1353  */
1354
1355 typedef struct
1356     {
1357     BYTE        type;
1358     BYTE        deviceid;
1359     CARD16      sequenceNumber B16;
1360     CARD8       keys[28];
1361     }  deviceKeyStateNotify;
1362
1363 /**********************************************************
1364  *
1365  * DeviceButtonStateNotify.
1366  *
1367  */
1368
1369 typedef struct
1370     {
1371     BYTE        type;
1372     BYTE        deviceid;
1373     CARD16      sequenceNumber B16;
1374     CARD8       buttons[28];
1375     }  deviceButtonStateNotify;
1376
1377 /**********************************************************
1378  *
1379  * DeviceMappingNotify.
1380  * Fields must be kept in sync with core mappingnotify event.
1381  *
1382  */
1383
1384 typedef struct
1385     {
1386     BYTE        type;
1387     BYTE        deviceid;
1388     CARD16      sequenceNumber B16;
1389     CARD8       request;
1390     KeyCode     firstKeyCode;
1391     CARD8       count;
1392     BYTE        pad1;
1393     Time        time B32;
1394     CARD32      pad00 B32;
1395     CARD32      pad01 B32;
1396     CARD32      pad02 B32;
1397     CARD32      pad03 B32;
1398     CARD32      pad04 B32;
1399     }  deviceMappingNotify;
1400
1401 /**********************************************************
1402  *
1403  * ChangeDeviceNotify.
1404  *
1405  */
1406
1407 typedef struct
1408     {
1409     BYTE        type;
1410     BYTE        deviceid;
1411     CARD16      sequenceNumber B16;
1412     Time        time B32;
1413     CARD8       request;
1414     BYTE        pad1, pad2, pad3;
1415     CARD32      pad00 B32;
1416     CARD32      pad01 B32;
1417     CARD32      pad02 B32;
1418     CARD32      pad03 B32;
1419     CARD32      pad04 B32;
1420     }  changeDeviceNotify;
1421
1422 #undef Window
1423 #undef Time
1424 #undef KeyCode
1425
1426 #endif