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