summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaleb Keithley <kaleb@freedesktop.org>2003-11-14 15:54:35 +0000
committerKaleb Keithley <kaleb@freedesktop.org>2003-11-14 15:54:35 +0000
commit51468f1607f0b88576628c89e85d159afbb4628e (patch)
treea95a2b5ef4dafa8d720ddede307aecad3ac5e2f9
R6.6 is the Xorg base-lineXORG-MAINXORG-STABLE
-rw-r--r--XI.h268
-rw-r--r--XInput.h1209
-rw-r--r--XIproto.h1513
3 files changed, 2990 insertions, 0 deletions
diff --git a/XI.h b/XI.h
new file mode 100644
index 0000000..bb4cec1
--- /dev/null
+++ b/XI.h
@@ -0,0 +1,268 @@
+/* $Xorg: XI.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
+
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/* Definitions used by the server, library and client */
+
+#ifndef _XI_H_
+
+#define _XI_H_
+
+#define sz_xGetExtensionVersionReq 8
+#define sz_xGetExtensionVersionReply 32
+#define sz_xListInputDevicesReq 4
+#define sz_xListInputDevicesReply 32
+#define sz_xOpenDeviceReq 8
+#define sz_xOpenDeviceReply 32
+#define sz_xCloseDeviceReq 8
+#define sz_xSetDeviceModeReq 8
+#define sz_xSetDeviceModeReply 32
+#define sz_xSelectExtensionEventReq 12
+#define sz_xGetSelectedExtensionEventsReq 8
+#define sz_xGetSelectedExtensionEventsReply 32
+#define sz_xChangeDeviceDontPropagateListReq 12
+#define sz_xGetDeviceDontPropagateListReq 8
+#define sz_xGetDeviceDontPropagateListReply 32
+#define sz_xGetDeviceMotionEventsReq 16
+#define sz_xGetDeviceMotionEventsReply 32
+#define sz_xChangeKeyboardDeviceReq 8
+#define sz_xChangeKeyboardDeviceReply 32
+#define sz_xChangePointerDeviceReq 8
+#define sz_xChangePointerDeviceReply 32
+#define sz_xGrabDeviceReq 20
+#define sz_xGrabDeviceReply 32
+#define sz_xUngrabDeviceReq 12
+#define sz_xGrabDeviceKeyReq 20
+#define sz_xGrabDeviceKeyReply 32
+#define sz_xUngrabDeviceKeyReq 16
+#define sz_xGrabDeviceButtonReq 20
+#define sz_xGrabDeviceButtonReply 32
+#define sz_xUngrabDeviceButtonReq 16
+#define sz_xAllowDeviceEventsReq 12
+#define sz_xGetDeviceFocusReq 8
+#define sz_xGetDeviceFocusReply 32
+#define sz_xSetDeviceFocusReq 16
+#define sz_xGetFeedbackControlReq 8
+#define sz_xGetFeedbackControlReply 32
+#define sz_xChangeFeedbackControlReq 12
+#define sz_xGetDeviceKeyMappingReq 8
+#define sz_xGetDeviceKeyMappingReply 32
+#define sz_xChangeDeviceKeyMappingReq 8
+#define sz_xGetDeviceModifierMappingReq 8
+#define sz_xSetDeviceModifierMappingReq 8
+#define sz_xSetDeviceModifierMappingReply 32
+#define sz_xGetDeviceButtonMappingReq 8
+#define sz_xGetDeviceButtonMappingReply 32
+#define sz_xSetDeviceButtonMappingReq 8
+#define sz_xSetDeviceButtonMappingReply 32
+#define sz_xQueryDeviceStateReq 8
+#define sz_xQueryDeviceStateReply 32
+#define sz_xSendExtensionEventReq 16
+#define sz_xDeviceBellReq 8
+#define sz_xSetDeviceValuatorsReq 8
+#define sz_xSetDeviceValuatorsReply 32
+#define sz_xGetDeviceControlReq 8
+#define sz_xGetDeviceControlReply 32
+#define sz_xChangeDeviceControlReq 8
+#define sz_xChangeDeviceControlReply 32
+
+#define INAME "XInputExtension"
+
+#define XI_KEYBOARD "KEYBOARD"
+#define XI_MOUSE "MOUSE"
+#define XI_TABLET "TABLET"
+#define XI_TOUCHSCREEN "TOUCHSCREEN"
+#define XI_TOUCHPAD "TOUCHPAD"
+#define XI_BARCODE "BARCODE"
+#define XI_BUTTONBOX "BUTTONBOX"
+#define XI_KNOB_BOX "KNOB_BOX"
+#define XI_ONE_KNOB "ONE_KNOB"
+#define XI_NINE_KNOB "NINE_KNOB"
+#define XI_TRACKBALL "TRACKBALL"
+#define XI_QUADRATURE "QUADRATURE"
+#define XI_ID_MODULE "ID_MODULE"
+#define XI_SPACEBALL "SPACEBALL"
+#define XI_DATAGLOVE "DATAGLOVE"
+#define XI_EYETRACKER "EYETRACKER"
+#define XI_CURSORKEYS "CURSORKEYS"
+#define XI_FOOTMOUSE "FOOTMOUSE"
+
+#define Dont_Check 0
+#define XInput_Initial_Release 1
+#define XInput_Add_XDeviceBell 2
+#define XInput_Add_XSetDeviceValuators 3
+#define XInput_Add_XChangeDeviceControl 4
+
+#define XI_Absent 0
+#define XI_Present 1
+
+#define XI_Initial_Release_Major 1
+#define XI_Initial_Release_Minor 0
+
+#define XI_Add_XDeviceBell_Major 1
+#define XI_Add_XDeviceBell_Minor 1
+
+#define XI_Add_XSetDeviceValuators_Major 1
+#define XI_Add_XSetDeviceValuators_Minor 2
+
+#define XI_Add_XChangeDeviceControl_Major 1
+#define XI_Add_XChangeDeviceControl_Minor 3
+
+#define DEVICE_RESOLUTION 1
+
+#define NoSuchExtension 1
+
+#define COUNT 0
+#define CREATE 1
+
+#define NewPointer 0
+#define NewKeyboard 1
+
+#define XPOINTER 0
+#define XKEYBOARD 1
+
+#define UseXKeyboard 0xFF
+
+#define IsXPointer 0
+#define IsXKeyboard 1
+#define IsXExtensionDevice 2
+
+#define AsyncThisDevice 0
+#define SyncThisDevice 1
+#define ReplayThisDevice 2
+#define AsyncOtherDevices 3
+#define AsyncAll 4
+#define SyncAll 5
+
+#define FollowKeyboard 3
+#ifndef RevertToFollowKeyboard
+#define RevertToFollowKeyboard 3
+#endif
+
+#define DvAccelNum (1L << 0)
+#define DvAccelDenom (1L << 1)
+#define DvThreshold (1L << 2)
+
+#define DvKeyClickPercent (1L<<0)
+#define DvPercent (1L<<1)
+#define DvPitch (1L<<2)
+#define DvDuration (1L<<3)
+#define DvLed (1L<<4)
+#define DvLedMode (1L<<5)
+#define DvKey (1L<<6)
+#define DvAutoRepeatMode (1L<<7)
+
+#define DvString (1L << 0)
+
+#define DvInteger (1L << 0)
+
+#define DeviceMode (1L << 0)
+#define Relative 0
+#define Absolute 1
+
+#define ProximityState (1L << 1)
+#define InProximity (0L << 1)
+#define OutOfProximity (1L << 1)
+
+#define AddToList 0
+#define DeleteFromList 1
+
+#define KeyClass 0
+#define ButtonClass 1
+#define ValuatorClass 2
+#define FeedbackClass 3
+#define ProximityClass 4
+#define FocusClass 5
+#define OtherClass 6
+
+#define KbdFeedbackClass 0
+#define PtrFeedbackClass 1
+#define StringFeedbackClass 2
+#define IntegerFeedbackClass 3
+#define LedFeedbackClass 4
+#define BellFeedbackClass 5
+
+#define _devicePointerMotionHint 0
+#define _deviceButton1Motion 1
+#define _deviceButton2Motion 2
+#define _deviceButton3Motion 3
+#define _deviceButton4Motion 4
+#define _deviceButton5Motion 5
+#define _deviceButtonMotion 6
+#define _deviceButtonGrab 7
+#define _deviceOwnerGrabButton 8
+#define _noExtensionEvent 9
+
+#define XI_BadDevice 0
+#define XI_BadEvent 1
+#define XI_BadMode 2
+#define XI_DeviceBusy 3
+#define XI_BadClass 4
+
+/* Make XEventClass be a CARD32 for 64 bit servers. Don't affect client
+ * definition of XEventClass since that would be a library interface change.
+ * See the top of X.h for more _XSERVER64 magic.
+ */
+#ifdef _XSERVER64
+typedef CARD32 XEventClass;
+#else
+typedef unsigned long XEventClass;
+#endif
+
+/*******************************************************************
+ *
+ * Extension version structure.
+ *
+ */
+
+typedef struct {
+ int present;
+ short major_version;
+ short minor_version;
+} XExtensionVersion;
+
+#endif /* _XI_H_ */
diff --git a/XInput.h b/XInput.h
new file mode 100644
index 0000000..2470377
--- /dev/null
+++ b/XInput.h
@@ -0,0 +1,1209 @@
+/* $Xorg: XInput.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $ */
+
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/* Definitions used by the library and client */
+
+#ifndef _XINPUT_H_
+#define _XINPUT_H_
+
+#ifndef _XLIB_H_
+#include <X11/Xlib.h>
+#endif
+
+#ifndef _XI_H_
+#include "XI.h"
+#endif
+
+#define _deviceKeyPress 0
+#define _deviceKeyRelease 1
+
+#define _deviceButtonPress 0
+#define _deviceButtonRelease 1
+
+#define _deviceMotionNotify 0
+
+#define _deviceFocusIn 0
+#define _deviceFocusOut 1
+
+#define _proximityIn 0
+#define _proximityOut 1
+
+#define _deviceStateNotify 0
+#define _deviceMappingNotify 1
+#define _changeDeviceNotify 2
+
+#define FindTypeAndClass(d,type,_class,classid,offset) \
+ { int _i; XInputClassInfo *_ip; \
+ type = 0; _class = 0; \
+ for (_i=0, _ip= ((XDevice *) d)->classes; \
+ _i< ((XDevice *) d)->num_classes; \
+ _i++, _ip++) \
+ if (_ip->input_class == classid) \
+ {type = _ip->event_type_base + offset; \
+ _class = ((XDevice *) d)->device_id << 8 | type;}}
+
+#define DeviceKeyPress(d,type,_class) \
+ FindTypeAndClass(d, type, _class, KeyClass, _deviceKeyPress)
+
+#define DeviceKeyRelease(d,type,_class) \
+ FindTypeAndClass(d, type, _class, KeyClass, _deviceKeyRelease)
+
+#define DeviceButtonPress(d,type,_class) \
+ FindTypeAndClass(d, type, _class, ButtonClass, _deviceButtonPress)
+
+#define DeviceButtonRelease(d,type,_class) \
+ FindTypeAndClass(d, type, _class, ButtonClass, _deviceButtonRelease)
+
+#define DeviceMotionNotify(d,type,_class) \
+ FindTypeAndClass(d, type, _class, ValuatorClass, _deviceMotionNotify)
+
+#define DeviceFocusIn(d,type,_class) \
+ FindTypeAndClass(d, type, _class, FocusClass, _deviceFocusIn)
+
+#define DeviceFocusOut(d,type,_class) \
+ FindTypeAndClass(d, type, _class, FocusClass, _deviceFocusOut)
+
+#define ProximityIn(d,type,_class) \
+ FindTypeAndClass(d, type, _class, ProximityClass, _proximityIn)
+
+#define ProximityOut(d,type,_class) \
+ FindTypeAndClass(d, type, _class, ProximityClass, _proximityOut)
+
+#define DeviceStateNotify(d,type,_class) \
+ FindTypeAndClass(d, type, _class, OtherClass, _deviceStateNotify)
+
+#define DeviceMappingNotify(d,type,_class) \
+ FindTypeAndClass(d, type, _class, OtherClass, _deviceMappingNotify)
+
+#define ChangeDeviceNotify(d,type,_class) \
+ FindTypeAndClass(d, type, _class, OtherClass, _changeDeviceNotify)
+
+#define DevicePointerMotionHint(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _devicePointerMotionHint;}
+
+#define DeviceButton1Motion(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButton1Motion;}
+
+#define DeviceButton2Motion(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButton2Motion;}
+
+#define DeviceButton3Motion(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButton3Motion;}
+
+#define DeviceButton4Motion(d,type, _class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButton4Motion;}
+
+#define DeviceButton5Motion(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButton5Motion;}
+
+#define DeviceButtonMotion(d,type, _class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButtonMotion;}
+
+#define DeviceOwnerGrabButton(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceOwnerGrabButton;}
+
+#define DeviceButtonPressGrab(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _deviceButtonGrab;}
+
+#define NoExtensionEvent(d,type,_class) \
+ { _class = ((XDevice *) d)->device_id << 8 | _noExtensionEvent;}
+
+#define BadDevice(dpy,error) _xibaddevice(dpy, &error)
+
+#define BadClass(dpy,error) _xibadclass(dpy, &error)
+
+#define BadEvent(dpy,error) _xibadevent(dpy, &error)
+
+#define BadMode(dpy,error) _xibadmode(dpy, &error)
+
+#define DeviceBusy(dpy,error) _xidevicebusy(dpy, &error)
+
+/***************************************************************
+ *
+ * DeviceKey events. These events are sent by input devices that
+ * support input class Keys.
+ * The location of the X pointer is reported in the coordinate
+ * fields of the x,y and x_root,y_root fields.
+ *
+ */
+
+typedef struct
+ {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed */
+ Bool send_event; /* true if from SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* "event" window reported relative to */
+ XID deviceid;
+ Window root; /* root window event occured on */
+ Window subwindow; /* child window */
+ Time time; /* milliseconds */
+ int x, y; /* x, y coordinates in event window */
+ int x_root; /* coordinates relative to root */
+ int y_root; /* coordinates relative to root */
+ unsigned int state; /* key or button mask */
+ unsigned int keycode; /* detail */
+ Bool same_screen; /* same screen flag */
+ unsigned int device_state; /* device key or button mask */
+ unsigned char axes_count;
+ unsigned char first_axis;
+ int axis_data[6];
+ } XDeviceKeyEvent;
+
+typedef XDeviceKeyEvent XDeviceKeyPressedEvent;
+typedef XDeviceKeyEvent XDeviceKeyReleasedEvent;
+
+/*******************************************************************
+ *
+ * DeviceButton events. These events are sent by extension devices
+ * that support input class Buttons.
+ *
+ */
+
+typedef struct {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* "event" window reported relative to */
+ XID deviceid;
+ Window root; /* root window that the event occured on */
+ Window subwindow; /* child window */
+ Time time; /* milliseconds */
+ int x, y; /* x, y coordinates in event window */
+ int x_root; /* coordinates relative to root */
+ int y_root; /* coordinates relative to root */
+ unsigned int state; /* key or button mask */
+ unsigned int button; /* detail */
+ Bool same_screen; /* same screen flag */
+ unsigned int device_state; /* device key or button mask */
+ unsigned char axes_count;
+ unsigned char first_axis;
+ int axis_data[6];
+ } XDeviceButtonEvent;
+
+typedef XDeviceButtonEvent XDeviceButtonPressedEvent;
+typedef XDeviceButtonEvent XDeviceButtonReleasedEvent;
+
+/*******************************************************************
+ *
+ * DeviceMotionNotify event. These events are sent by extension devices
+ * that support input class Valuators.
+ *
+ */
+
+typedef struct
+ {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* "event" window reported relative to */
+ XID deviceid;
+ Window root; /* root window that the event occured on */
+ Window subwindow; /* child window */
+ Time time; /* milliseconds */
+ int x, y; /* x, y coordinates in event window */
+ int x_root; /* coordinates relative to root */
+ int y_root; /* coordinates relative to root */
+ unsigned int state; /* key or button mask */
+ char is_hint; /* detail */
+ Bool same_screen; /* same screen flag */
+ unsigned int device_state; /* device key or button mask */
+ unsigned char axes_count;
+ unsigned char first_axis;
+ int axis_data[6];
+ } XDeviceMotionEvent;
+
+/*******************************************************************
+ *
+ * DeviceFocusChange events. These events are sent when the focus
+ * of an extension device that can be focused is changed.
+ *
+ */
+
+typedef struct
+ {
+ int type; /* of event */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* "event" window reported relative to */
+ XID deviceid;
+ int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
+ int detail;
+ /*
+ * NotifyAncestor, NotifyVirtual, NotifyInferior,
+ * NotifyNonLinear,NotifyNonLinearVirtual, NotifyPointer,
+ * NotifyPointerRoot, NotifyDetailNone
+ */
+ Time time;
+ } XDeviceFocusChangeEvent;
+
+typedef XDeviceFocusChangeEvent XDeviceFocusInEvent;
+typedef XDeviceFocusChangeEvent XDeviceFocusOutEvent;
+
+/*******************************************************************
+ *
+ * ProximityNotify events. These events are sent by those absolute
+ * positioning devices that are capable of generating proximity information.
+ *
+ */
+
+typedef struct
+ {
+ int type; /* ProximityIn or ProximityOut */
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window;
+ XID deviceid;
+ Window root;
+ Window subwindow;
+ Time time;
+ int x, y;
+ int x_root, y_root;
+ unsigned int state;
+ Bool same_screen;
+ unsigned int device_state; /* device key or button mask */
+ unsigned char axes_count;
+ unsigned char first_axis;
+ int axis_data[6];
+ } XProximityNotifyEvent;
+typedef XProximityNotifyEvent XProximityInEvent;
+typedef XProximityNotifyEvent XProximityOutEvent;
+
+/*******************************************************************
+ *
+ * DeviceStateNotify events are generated on EnterWindow and FocusIn
+ * for those clients who have selected DeviceState.
+ *
+ */
+
+typedef struct
+ {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ } XInputClass;
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window;
+ XID deviceid;
+ Time time;
+ int num_classes;
+ char data[64];
+} XDeviceStateNotifyEvent;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ unsigned char num_valuators;
+ unsigned char mode;
+ int valuators[6];
+} XValuatorStatus;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ short num_keys;
+ char keys[32];
+} XKeyStatus;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ short num_buttons;
+ char buttons[32];
+} XButtonStatus;
+
+/*******************************************************************
+ *
+ * DeviceMappingNotify event. This event is sent when the key mapping,
+ * modifier mapping, or button mapping of an extension device is changed.
+ *
+ */
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* unused */
+ XID deviceid;
+ Time time;
+ int request; /* one of MappingModifier, MappingKeyboard,
+ MappingPointer */
+ int first_keycode;/* first keycode */
+ int count; /* defines range of change w. first_keycode*/
+} XDeviceMappingEvent;
+
+/*******************************************************************
+ *
+ * ChangeDeviceNotify event. This event is sent when an
+ * XChangeKeyboard or XChangePointer request is made.
+ *
+ */
+
+typedef struct {
+ int type;
+ unsigned long serial; /* # of last request processed by server */
+ Bool send_event; /* true if this came from a SendEvent request */
+ Display *display; /* Display the event was read from */
+ Window window; /* unused */
+ XID deviceid;
+ Time time;
+ int request; /* NewPointer or NewKeyboard */
+} XChangeDeviceNotifyEvent;
+
+/*******************************************************************
+ *
+ * Control structures for input devices that support input class
+ * Feedback. These are used by the XGetFeedbackControl and
+ * XChangeFeedbackControl functions.
+ *
+ */
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+} XFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int click;
+ int percent;
+ int pitch;
+ int duration;
+ int led_mask;
+ int global_auto_repeat;
+ char auto_repeats[32];
+} XKbdFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int accelNum;
+ int accelDenom;
+ int threshold;
+} XPtrFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int resolution;
+ int minVal;
+ int maxVal;
+} XIntegerFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int max_symbols;
+ int num_syms_supported;
+ KeySym *syms_supported;
+} XStringFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int percent;
+ int pitch;
+ int duration;
+} XBellFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int led_values;
+ int led_mask;
+} XLedFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+} XFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int accelNum;
+ int accelDenom;
+ int threshold;
+} XPtrFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int click;
+ int percent;
+ int pitch;
+ int duration;
+ int led_mask;
+ int led_value;
+ int key;
+ int auto_repeat_mode;
+} XKbdFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int num_keysyms;
+ KeySym *syms_to_display;
+} XStringFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int int_to_display;
+} XIntegerFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int percent;
+ int pitch;
+ int duration;
+} XBellFeedbackControl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ XID id;
+ int led_mask;
+ int led_values;
+} XLedFeedbackControl;
+
+/*******************************************************************
+ *
+ * Device control structures.
+ *
+ */
+
+typedef struct {
+ XID control;
+ int length;
+} XDeviceControl;
+
+typedef struct {
+ XID control;
+ int length;
+ int first_valuator;
+ int num_valuators;
+ int *resolutions;
+} XDeviceResolutionControl;
+
+typedef struct {
+ XID control;
+ int length;
+ int num_valuators;
+ int *resolutions;
+ int *min_resolutions;
+ int *max_resolutions;
+} XDeviceResolutionState;
+
+/*******************************************************************
+ *
+ * An array of XDeviceList structures is returned by the
+ * XListInputDevices function. Each entry contains information
+ * about one input device. Among that information is an array of
+ * pointers to structures that describe the characteristics of
+ * the input device.
+ *
+ */
+
+typedef struct _XAnyClassinfo *XAnyClassPtr;
+
+typedef struct _XAnyClassinfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ } XAnyClassInfo;
+
+typedef struct _XDeviceInfo *XDeviceInfoPtr;
+
+typedef struct _XDeviceInfo
+ {
+ XID id;
+ Atom type;
+ char *name;
+ int num_classes;
+ int use;
+ XAnyClassPtr inputclassinfo;
+ } XDeviceInfo;
+
+typedef struct _XKeyInfo *XKeyInfoPtr;
+
+typedef struct _XKeyInfo
+ {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ unsigned short min_keycode;
+ unsigned short max_keycode;
+ unsigned short num_keys;
+ } XKeyInfo;
+
+typedef struct _XButtonInfo *XButtonInfoPtr;
+
+typedef struct _XButtonInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ short num_buttons;
+ } XButtonInfo;
+
+typedef struct _XAxisInfo *XAxisInfoPtr;
+
+typedef struct _XAxisInfo {
+ int resolution;
+ int min_value;
+ int max_value;
+ } XAxisInfo;
+
+typedef struct _XValuatorInfo *XValuatorInfoPtr;
+
+typedef struct _XValuatorInfo
+ {
+#if defined(__cplusplus) || defined(c_plusplus)
+ XID c_class;
+#else
+ XID class;
+#endif
+ int length;
+ unsigned char num_axes;
+ unsigned char mode;
+ unsigned long motion_buffer;
+ XAxisInfoPtr axes;
+ } XValuatorInfo;
+
+
+/*******************************************************************
+ *
+ * An XDevice structure is returned by the XOpenDevice function.
+ * It contains an array of pointers to XInputClassInfo structures.
+ * Each contains information about a class of input supported by the
+ * device, including a pointer to an array of data for each type of event
+ * the device reports.
+ *
+ */
+
+
+typedef struct {
+ unsigned char input_class;
+ unsigned char event_type_base;
+} XInputClassInfo;
+
+typedef struct {
+ XID device_id;
+ int num_classes;
+ XInputClassInfo *classes;
+} XDevice;
+
+
+/*******************************************************************
+ *
+ * The following structure is used to return information for the
+ * XGetSelectedExtensionEvents function.
+ *
+ */
+
+typedef struct {
+ XEventClass event_type;
+ XID device;
+} XEventList;
+
+/*******************************************************************
+ *
+ * The following structure is used to return motion history data from
+ * an input device that supports the input class Valuators.
+ * This information is returned by the XGetDeviceMotionEvents function.
+ *
+ */
+
+typedef struct {
+ Time time;
+ int *data;
+} XDeviceTimeCoord;
+
+
+/*******************************************************************
+ *
+ * Device state structure.
+ * This is returned by the XQueryDeviceState request.
+ *
+ */
+
+typedef struct {
+ XID device_id;
+ int num_classes;
+ XInputClass *data;
+} XDeviceState;
+
+/*******************************************************************
+ *
+ * Note that the mode field is a bitfield that reports the Proximity
+ * status of the device as well as the mode. The mode field should
+ * be OR'd with the mask DeviceMode and compared with the values
+ * Absolute and Relative to determine the mode, and should be OR'd
+ * with the mask ProximityState and compared with the values InProximity
+ * and OutOfProximity to determine the proximity state.
+ *
+ */
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ unsigned char num_valuators;
+ unsigned char mode;
+ int *valuators;
+} XValuatorState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ short num_keys;
+ char keys[32];
+} XKeyState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ unsigned char c_class;
+#else
+ unsigned char class;
+#endif
+ unsigned char length;
+ short num_buttons;
+ char buttons[32];
+} XButtonState;
+
+/*******************************************************************
+ *
+ * Function definitions.
+ *
+ */
+
+_XFUNCPROTOBEGIN
+
+extern int XChangeKeyboardDevice(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */
+#endif
+);
+
+extern int XChangePointerDevice(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ int /* xaxis */,
+ int /* yaxis */
+#endif
+);
+
+extern int XGrabDevice(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ Window /* grab_window */,
+ Bool /* ownerEvents */,
+ int /* event count */,
+ XEventClass* /* event_list */,
+ int /* this_device_mode */,
+ int /* other_devices_mode */,
+ Time /* time */
+#endif
+);
+
+extern int XUngrabDevice(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ Time /* time */
+#endif
+);
+
+extern int XGrabDeviceKey(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned int /* key */,
+ unsigned int /* modifiers */,
+ XDevice* /* modifier_device */,
+ Window /* grab_window */,
+ Bool /* owner_events */,
+ unsigned int /* event_count */,
+ XEventClass* /* event_list */,
+ int /* this_device_mode */,
+ int /* other_devices_mode */
+#endif
+);
+
+extern int XUngrabDeviceKey(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned int /* key */,
+ unsigned int /* modifiers */,
+ XDevice* /* modifier_dev */,
+ Window /* grab_window */
+#endif
+);
+
+extern int XGrabDeviceButton(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned int /* button */,
+ unsigned int /* modifiers */,
+ XDevice* /* modifier_device */,
+ Window /* grab_window */,
+ Bool /* owner_events */,
+ unsigned int /* event_count */,
+ XEventClass* /* event_list */,
+ int /* this_device_mode */,
+ int /* other_devices_mode */
+#endif
+);
+
+extern int XUngrabDeviceButton(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned int /* button */,
+ unsigned int /* modifiers */,
+ XDevice* /* modifier_dev */,
+ Window /* grab_window */
+#endif
+);
+
+extern int XAllowDeviceEvents(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ int /* event_mode */,
+ Time /* time */
+#endif
+);
+
+extern int XGetDeviceFocus(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ Window* /* focus */,
+ int* /* revert_to */,
+ Time* /* time */
+#endif
+);
+
+extern int XSetDeviceFocus(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ Window /* focus */,
+ int /* revert_to */,
+ Time /* time */
+#endif
+);
+
+extern XFeedbackState *XGetFeedbackControl(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ int* /* num_feedbacks */
+#endif
+);
+
+extern void XFreeFeedbackList(
+#if NeedFunctionPrototypes
+ XFeedbackState* /* list */
+#endif
+);
+
+extern int XChangeFeedbackControl(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned long /* mask */,
+ XFeedbackControl* /* f */
+#endif
+);
+
+extern int XDeviceBell(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ XID /* feedbackclass */,
+ XID /* feedbackid */,
+ int /* percent */
+#endif
+);
+
+extern KeySym *XGetDeviceKeyMapping(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+#if NeedWidePrototypes
+ unsigned int /* first */,
+#else
+ KeyCode /* first */,
+#endif
+ int /* keycount */,
+ int* /* syms_per_code */
+#endif
+);
+
+extern int XChangeDeviceKeyMapping(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ int /* first */,
+ int /* syms_per_code */,
+ KeySym* /* keysyms */,
+ int /* count */
+#endif
+);
+
+extern XModifierKeymap *XGetDeviceModifierMapping(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */
+#endif
+);
+
+extern int XSetDeviceModifierMapping(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ XModifierKeymap* /* modmap */
+#endif
+);
+
+extern int XSetDeviceButtonMapping(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned char* /* map[] */,
+ int /* nmap */
+#endif
+);
+
+extern int XGetDeviceButtonMapping(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ unsigned char* /* map[] */,
+ unsigned int /* nmap */
+#endif
+);
+
+extern XDeviceState *XQueryDeviceState(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */
+#endif
+);
+
+extern void XFreeDeviceState(
+#if NeedFunctionPrototypes
+ XDeviceState* /* list */
+#endif
+);
+
+extern XExtensionVersion *XGetExtensionVersion(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ _Xconst char* /* name */
+#endif
+);
+
+extern XDeviceInfo *XListInputDevices(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ int* /* ndevices */
+#endif
+);
+
+extern void XFreeDeviceList(
+#if NeedFunctionPrototypes
+ XDeviceInfo* /* list */
+#endif
+);
+
+extern XDevice *XOpenDevice(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XID /* id */
+#endif
+);
+
+extern int XCloseDevice(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */
+#endif
+);
+
+extern int XSetDeviceMode(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ int /* mode */
+#endif
+);
+
+extern int XSetDeviceValuators(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ int* /* valuators */,
+ int /* first_valuator */,
+ int /* num_valuators */
+#endif
+);
+
+extern XDeviceControl *XGetDeviceControl(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ int /* control */
+#endif
+);
+
+extern int XChangeDeviceControl(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ int /* control */,
+ XDeviceControl* /* d */
+#endif
+);
+
+extern int XSelectExtensionEvent(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ Window /* w */,
+ XEventClass* /* event_list */,
+ int /* count */
+#endif
+);
+
+extern int XGetSelectedExtensionEvents(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ Window /* w */,
+ int* /* this_client_count */,
+ XEventClass** /* this_client_list */,
+ int* /* all_clients_count */,
+ XEventClass** /* all_clients_list */
+#endif
+);
+
+extern int XChangeDeviceDontPropagateList(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ Window /* window */,
+ int /* count */,
+ XEventClass* /* events */,
+ int /* mode */
+#endif
+);
+
+extern XEventClass *XGetDeviceDontPropagateList(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ Window /* window */,
+ int* /* count */
+#endif
+);
+
+extern Status XSendExtensionEvent(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ Window /* dest */,
+ Bool /* prop */,
+ int /* count */,
+ XEventClass* /* list */,
+ XEvent* /* event */
+#endif
+);
+
+extern XDeviceTimeCoord *XGetDeviceMotionEvents(
+#if NeedFunctionPrototypes
+ Display* /* display */,
+ XDevice* /* device */,
+ Time /* start */,
+ Time /* stop */,
+ int* /* nEvents */,
+ int* /* mode */,
+ int* /* axis_count */
+#endif
+);
+
+extern void XFreeDeviceMotionEvents(
+#if NeedFunctionPrototypes
+ XDeviceTimeCoord* /* events */
+#endif
+);
+
+extern void XFreeDeviceControl(
+#if NeedFunctionPrototypes
+ XDeviceControl* /* control */
+#endif
+);
+
+_XFUNCPROTOEND
+
+#endif /* _XINPUT_H_ */
diff --git a/XIproto.h b/XIproto.h
new file mode 100644
index 0000000..f13d990
--- /dev/null
+++ b/XIproto.h
@@ -0,0 +1,1513 @@
+/* $Xorg: XIproto.h,v 1.5 2001/02/09 02:03:24 xorgcvs Exp $ */
+
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+#ifndef _XIPROTO_H
+#define _XIPROTO_H
+
+#include <X11/Xproto.h>
+#include <X11/X.h>
+
+/* make sure types have right sizes for protocol structures. */
+#define Window CARD32
+#define Time CARD32
+#define KeyCode CARD8
+
+/*********************************************************
+ *
+ * number of events, errors, and extension name.
+ *
+ */
+
+#define MORE_EVENTS 0x80
+#define DEVICE_BITS 0x7F
+
+#define InputClassBits 0x3F /* bits in mode field for input classes */
+#define ModeBitsShift 6 /* amount to shift the remaining bits */
+
+#define numInputClasses 7
+
+#define IEVENTS 15
+#define IERRORS 5
+
+#define CLIENT_REQ 1
+
+typedef struct _XExtEventInfo
+ {
+ Mask mask;
+ BYTE type;
+ BYTE word;
+ } XExtEventInfo;
+
+typedef unsigned char *Pointer;
+
+struct tmask
+ {
+ Mask mask;
+ Pointer dev;
+ };
+
+/*********************************************************
+ *
+ * Event constants used by library.
+ *
+ */
+
+#define XI_DeviceValuator 0
+#define XI_DeviceKeyPress 1
+#define XI_DeviceKeyRelease 2
+#define XI_DeviceButtonPress 3
+#define XI_DeviceButtonRelease 4
+#define XI_DeviceMotionNotify 5
+#define XI_DeviceFocusIn 6
+#define XI_DeviceFocusOut 7
+#define XI_ProximityIn 8
+#define XI_ProximityOut 9
+#define XI_DeviceStateNotify 10
+#define XI_DeviceMappingNotify 11
+#define XI_ChangeDeviceNotify 12
+#define XI_DeviceKeystateNotify 13
+#define XI_DeviceButtonstateNotify 14
+
+/*********************************************************
+ *
+ * Protocol request constants
+ *
+ */
+
+#define X_GetExtensionVersion 1
+#define X_ListInputDevices 2
+#define X_OpenDevice 3
+#define X_CloseDevice 4
+#define X_SetDeviceMode 5
+#define X_SelectExtensionEvent 6
+#define X_GetSelectedExtensionEvents 7
+#define X_ChangeDeviceDontPropagateList 8
+#define X_GetDeviceDontPropagateList 9
+#define X_GetDeviceMotionEvents 10
+#define X_ChangeKeyboardDevice 11
+#define X_ChangePointerDevice 12
+#define X_GrabDevice 13
+#define X_UngrabDevice 14
+#define X_GrabDeviceKey 15
+#define X_UngrabDeviceKey 16
+#define X_GrabDeviceButton 17
+#define X_UngrabDeviceButton 18
+#define X_AllowDeviceEvents 19
+#define X_GetDeviceFocus 20
+#define X_SetDeviceFocus 21
+#define X_GetFeedbackControl 22
+#define X_ChangeFeedbackControl 23
+#define X_GetDeviceKeyMapping 24
+#define X_ChangeDeviceKeyMapping 25
+#define X_GetDeviceModifierMapping 26
+#define X_SetDeviceModifierMapping 27
+#define X_GetDeviceButtonMapping 28
+#define X_SetDeviceButtonMapping 29
+#define X_QueryDeviceState 30
+#define X_SendExtensionEvent 31
+#define X_DeviceBell 32
+#define X_SetDeviceValuators 33
+#define X_GetDeviceControl 34
+#define X_ChangeDeviceControl 35
+
+/*********************************************************
+ *
+ * Protocol request and reply structures.
+ *
+ * GetExtensionVersion.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetExtensionVersion */
+ CARD16 length B16;
+ CARD16 nbytes B16;
+ CARD8 pad1, pad2;
+} xGetExtensionVersionReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetExtensionVersion */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 major_version B16;
+ CARD16 minor_version B16;
+ BOOL present;
+ CARD8 pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+} xGetExtensionVersionReply;
+
+/*********************************************************
+ *
+ * ListInputDevices.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_ListInputDevices */
+ CARD16 length B16;
+} xListInputDevicesReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_ListInputDevices */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 ndevices;
+ CARD8 pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xListInputDevicesReply;
+
+typedef struct _xDeviceInfo *xDeviceInfoPtr;
+
+typedef struct _xAnyClassinfo *xAnyClassPtr;
+
+typedef struct _xAnyClassinfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ } xAnyClassInfo;
+
+typedef struct _xDeviceInfo {
+ CARD32 type B32;
+ CARD8 id;
+ CARD8 num_classes;
+ CARD8 use;
+ CARD8 pad1;
+ } xDeviceInfo;
+
+typedef struct _xKeyInfo *xKeyInfoPtr;
+
+typedef struct _xKeyInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ KeyCode min_keycode;
+ KeyCode max_keycode;
+ CARD16 num_keys B16;
+ CARD8 pad1,pad2;
+ } xKeyInfo;
+
+typedef struct _xButtonInfo *xButtonInfoPtr;
+
+typedef struct _xButtonInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD16 num_buttons B16;
+ } xButtonInfo;
+
+typedef struct _xValuatorInfo *xValuatorInfoPtr;
+
+typedef struct _xValuatorInfo {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD8 num_axes;
+ CARD8 mode;
+ CARD32 motion_buffer_size B32;
+ } xValuatorInfo;
+
+typedef struct _xAxisInfo *xAxisInfoPtr;
+
+typedef struct _xAxisInfo {
+ CARD32 resolution B32;
+ CARD32 min_value B32;
+ CARD32 max_value B32;
+ } xAxisInfo;
+
+/*********************************************************
+ *
+ * OpenDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_OpenDevice */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xOpenDeviceReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_OpenDevice */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 num_classes;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad00 B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ } xOpenDeviceReply;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 event_type_base;
+ } xInputClassInfo;
+
+/*********************************************************
+ *
+ * CloseDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_CloseDevice */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xCloseDeviceReq;
+
+/*********************************************************
+ *
+ * SetDeviceMode.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SetDeviceMode */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 mode;
+ BYTE pad1, pad2;
+} xSetDeviceModeReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_SetDeviceMode */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xSetDeviceModeReply;
+
+/*********************************************************
+ *
+ * SelectExtensionEvent.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SelectExtensionEvent */
+ CARD16 length B16;
+ Window window B32;
+ CARD16 count B16;
+ CARD16 pad00 B16;
+} xSelectExtensionEventReq;
+
+/*********************************************************
+ *
+ * GetSelectedExtensionEvent.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_GetSelectedExtensionEvents */
+ CARD16 length B16;
+ Window window B32;
+} xGetSelectedExtensionEventsReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* GetSelectedExtensionEvents */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 this_client_count B16;
+ CARD16 all_clients_count B16;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xGetSelectedExtensionEventsReply;
+
+/*********************************************************
+ *
+ * ChangeDeviceDontPropagateList.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_ChangeDeviceDontPropagateList */
+ CARD16 length B16;
+ Window window B32;
+ CARD16 count B16;
+ CARD8 mode;
+ BYTE pad;
+} xChangeDeviceDontPropagateListReq;
+
+/*********************************************************
+ *
+ * GetDeviceDontPropagateList.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_GetDeviceDontPropagateList */
+ CARD16 length B16;
+ Window window B32;
+} xGetDeviceDontPropagateListReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* GetDeviceDontPropagateList */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 count B16;
+ CARD16 pad00 B16;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ } xGetDeviceDontPropagateListReply;
+
+/*********************************************************
+ *
+ * GetDeviceMotionEvents.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceMotionEvents*/
+ CARD16 length B16;
+ Time start B32;
+ Time stop B32;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetDeviceMotionEventsReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceMotionEvents */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 nEvents B32;
+ CARD8 axes;
+ CARD8 mode;
+ BYTE pad1, pad2;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+} xGetDeviceMotionEventsReply;
+
+/*********************************************************
+ *
+ * ChangeKeyboardDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_ChangeKeyboardDevice */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xChangeKeyboardDeviceReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_ChangeKeyboardDevice*/
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ } xChangeKeyboardDeviceReply;
+
+/*********************************************************
+ *
+ * ChangePointerDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_ChangePointerDevice */
+ CARD16 length B16;
+ CARD8 xaxis;
+ CARD8 yaxis;
+ CARD8 deviceid;
+ BYTE pad1;
+} xChangePointerDeviceReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_ChangePointerDevice */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ } xChangePointerDeviceReply;
+
+/*********************************************************
+ *
+ * GrabDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GrabDevice */
+ CARD16 length B16;
+ Window grabWindow B32;
+ Time time B32;
+ CARD16 event_count B16;
+ CARD8 this_device_mode;
+ CARD8 other_devices_mode;
+ BOOL ownerEvents;
+ CARD8 deviceid;
+ CARD16 pad01 B16;
+} xGrabDeviceReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GrabDevice */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32; /* 0 */
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ } xGrabDeviceReply;
+
+/*********************************************************
+ *
+ * UngrabDevice.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_UnGrabDevice */
+ CARD16 length B16;
+ Time time B32;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xUngrabDeviceReq;
+
+/*********************************************************
+ *
+ * GrabDeviceKey.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GrabDeviceKey */
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 event_count B16;
+ CARD16 modifiers B16;
+ CARD8 modifier_device;
+ CARD8 grabbed_device;
+ CARD8 key;
+ BYTE this_device_mode;
+ BYTE other_devices_mode;
+ BOOL ownerEvents;
+ BYTE pad1, pad2;
+} xGrabDeviceKeyReq;
+
+/*********************************************************
+ *
+ * UngrabDeviceKey.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_UngrabDeviceKey */
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 modifiers B16;
+ CARD8 modifier_device;
+ CARD8 key;
+ CARD8 grabbed_device;
+ BYTE pad1, pad2, pad3;
+} xUngrabDeviceKeyReq;
+
+/*********************************************************
+ *
+ * GrabDeviceButton.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GrabDeviceButton */
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD8 grabbed_device;
+ CARD8 modifier_device;
+ CARD16 event_count B16;
+ CARD16 modifiers B16;
+ BYTE this_device_mode;
+ BYTE other_devices_mode;
+ CARD8 button;
+ BOOL ownerEvents;
+ BYTE pad1, pad2;
+} xGrabDeviceButtonReq;
+
+/*********************************************************
+ *
+ * UngrabDeviceButton.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_UngrabDeviceButton */
+ CARD16 length B16;
+ Window grabWindow B32;
+ CARD16 modifiers B16;
+ CARD8 modifier_device;
+ CARD8 button;
+ CARD8 grabbed_device;
+ BYTE pad1, pad2, pad3;
+} xUngrabDeviceButtonReq;
+
+/*********************************************************
+ *
+ * AllowDeviceEvents.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_AllowDeviceEvents */
+ CARD16 length B16;
+ Time time B32;
+ CARD8 mode;
+ CARD8 deviceid;
+ BYTE pad1, pad2;
+} xAllowDeviceEventsReq;
+
+/*********************************************************
+ *
+ * GetDeviceFocus.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceFocus */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetDeviceFocusReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceFocus */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD32 focus B32;
+ Time time B32;
+ CARD8 revertTo;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ } xGetDeviceFocusReply;
+
+/*********************************************************
+ *
+ * SetDeviceFocus.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SetDeviceFocus */
+ CARD16 length B16;
+ Window focus B32;
+ Time time B32;
+ CARD8 revertTo;
+ CARD8 device;
+ CARD16 pad01 B16;
+} xSetDeviceFocusReq;
+
+/*********************************************************
+ *
+ * GetFeedbackControl.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_GetFeedbackControl */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetFeedbackControlReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetFeedbackControl */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD16 num_feedbacks B16;
+ CARD16 pad01 B16;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+ CARD32 pad06 B32;
+} xGetFeedbackControlReply;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class */
+#else
+ CARD8 class; /* feedback class */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+} xFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 id;
+ CARD16 length B16;
+ CARD16 pitch B16;
+ CARD16 duration B16;
+ CARD32 led_mask B32;
+ CARD32 led_values B32;
+ BOOL global_auto_repeat;
+ CARD8 click;
+ CARD8 percent;
+ BYTE pad;
+ BYTE auto_repeats[32];
+} xKbdFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 id;
+ CARD16 length B16;
+ CARD8 pad1,pad2;
+ CARD16 accelNum B16;
+ CARD16 accelDenom B16;
+ CARD16 threshold B16;
+} xPtrFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id;
+ CARD16 length B16; /* feedback length */
+ CARD32 resolution B32;
+ INT32 min_value B32;
+ INT32 max_value B32;
+} xIntegerFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id;
+ CARD16 length B16; /* feedback length */
+ CARD16 max_symbols B16;
+ CARD16 num_syms_supported B16;
+} xStringFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id;
+ CARD16 length B16; /* feedback length */
+ CARD8 percent;
+ BYTE pad1, pad2, pad3;
+ CARD16 pitch B16;
+ CARD16 duration B16;
+} xBellFeedbackState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id;
+ CARD16 length B16; /* feedback length */
+ CARD32 led_mask B32;
+ CARD32 led_values B32;
+} xLedFeedbackState;
+
+/*********************************************************
+ *
+ * ChangeFeedbackControl.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_ChangeFeedbackControl */
+ CARD16 length B16;
+ CARD32 mask B32;
+ CARD8 deviceid;
+ CARD8 feedbackid;
+ BYTE pad1, pad2;
+} xChangeFeedbackControlReq;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+} xFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback length */
+ CARD16 length B16; /* feedback length */
+ KeyCode key;
+ CARD8 auto_repeat_mode;
+ INT8 click;
+ INT8 percent;
+ INT16 pitch B16;
+ INT16 duration B16;
+ CARD32 led_mask B32;
+ CARD32 led_values B32;
+} xKbdFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ CARD8 pad1,pad2;
+ INT16 num B16;
+ INT16 denom B16;
+ INT16 thresh B16;
+} xPtrFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ INT32 int_to_display B32;
+} xIntegerFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ CARD8 pad1,pad2;
+ CARD16 num_keysyms B16;
+} xStringFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ INT8 percent;
+ BYTE pad1, pad2, pad3;
+ INT16 pitch B16;
+ INT16 duration B16;
+} xBellFeedbackCtl;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class; /* feedback class id */
+#else
+ CARD8 class; /* feedback class id */
+#endif
+ CARD8 id; /* feedback id */
+ CARD16 length B16; /* feedback length */
+ CARD32 led_mask B32;
+ CARD32 led_values B32;
+} xLedFeedbackCtl;
+
+/*********************************************************
+ *
+ * GetDeviceKeyMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceKeyMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ KeyCode firstKeyCode;
+ CARD8 count;
+ BYTE pad1;
+} xGetDeviceKeyMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceKeyMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 keySymsPerKeyCode;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGetDeviceKeyMappingReply;
+
+/*********************************************************
+ *
+ * ChangeDeviceKeyMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_ChangeDeviceKeyMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ KeyCode firstKeyCode;
+ CARD8 keySymsPerKeyCode;
+ CARD8 keyCodes;
+} xChangeDeviceKeyMappingReq;
+
+/*********************************************************
+ *
+ * GetDeviceModifierMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceModifierMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetDeviceModifierMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceModifierMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 numKeyPerModifier;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xGetDeviceModifierMappingReply;
+
+/*********************************************************
+ *
+ * SetDeviceModifierMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SetDeviceModifierMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 numKeyPerModifier;
+ CARD16 pad1 B16;
+} xSetDeviceModifierMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_SetDeviceModifierMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 success;
+ CARD8 pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xSetDeviceModifierMappingReply;
+
+/*********************************************************
+ *
+ * GetDeviceButtonMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_GetDeviceButtonMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xGetDeviceButtonMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceButtonMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 nElts;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xGetDeviceButtonMappingReply;
+
+/*********************************************************
+ *
+ * SetDeviceButtonMapping.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* X_SetDeviceButtonMapping */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 map_length;
+ BYTE pad1, pad2;
+} xSetDeviceButtonMappingReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_SetDeviceButtonMapping */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xSetDeviceButtonMappingReply;
+
+/*********************************************************
+ *
+ * QueryDeviceState.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 ReqType; /* always X_QueryDeviceState */
+ CARD16 length B16;
+ CARD8 deviceid;
+ BYTE pad1, pad2, pad3;
+} xQueryDeviceStateReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_QueryDeviceState */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 num_classes;
+ BYTE pad0;
+ CARD16 pad1 B16;
+ CARD32 pad2 B32;
+ CARD32 pad3 B32;
+ CARD32 pad4 B32;
+ CARD32 pad5 B32;
+ CARD32 pad6 B32;
+} xQueryDeviceStateReply;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD8 num_keys;
+ BYTE pad1;
+ CARD8 keys[32];
+} xKeyState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD8 num_buttons;
+ BYTE pad1;
+ CARD8 buttons[32];
+} xButtonState;
+
+typedef struct {
+#if defined(__cplusplus) || defined(c_plusplus)
+ CARD8 c_class;
+#else
+ CARD8 class;
+#endif
+ CARD8 length;
+ CARD8 num_valuators;
+ CARD8 mode;
+} xValuatorState;
+
+/*********************************************************
+ *
+ * SendExtensionEvent.
+ * THIS REQUEST MUST BE KEPT A MULTIPLE OF 8 BYTES IN LENGTH!
+ * MORE EVENTS MAY FOLLOW AND THEY MUST BE QUAD-ALIGNED!
+ *
+ */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 ReqType; /* always X_SendExtensionEvent */
+ CARD16 length B16;
+ Window destination B32;
+ CARD8 deviceid;
+ BOOL propagate;
+ CARD16 count B16;
+ CARD8 num_events;
+ BYTE pad1,pad2,pad3;
+} xSendExtensionEventReq;
+
+/*********************************************************
+ *
+ * DeviceBell.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType;
+ CARD8 ReqType; /* always X_DeviceBell */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 feedbackid;
+ CARD8 feedbackclass;
+ INT8 percent;
+} xDeviceBellReq;
+
+/*********************************************************
+ *
+ * SetDeviceValuators.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_SetDeviceValuators */
+ CARD16 length B16;
+ CARD8 deviceid;
+ CARD8 first_valuator;
+ CARD8 num_valuators;
+ BYTE pad1;
+} xSetDeviceValuatorsReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_SetDeviceValuators */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xSetDeviceValuatorsReply;
+
+/*********************************************************
+ *
+ * GetDeviceControl.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_GetDeviceControl */
+ CARD16 length B16;
+ CARD16 control B16;
+ CARD8 deviceid;
+ BYTE pad2;
+} xGetDeviceControlReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_GetDeviceControl */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xGetDeviceControlReply;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+} xDeviceState;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+ CARD32 num_valuators B32; /* number of valuators */
+} xDeviceResolutionState;
+
+/*********************************************************
+ *
+ * ChangeDeviceControl.
+ *
+ */
+
+typedef struct {
+ CARD8 reqType; /* input extension major code */
+ CARD8 ReqType; /* always X_ChangeDeviceControl */
+ CARD16 length B16;
+ CARD16 control B16;
+ CARD8 deviceid;
+ BYTE pad0;
+} xChangeDeviceControlReq;
+
+typedef struct {
+ CARD8 repType; /* X_Reply */
+ CARD8 RepType; /* always X_ChangeDeviceControl */
+ CARD16 sequenceNumber B16;
+ CARD32 length B32;
+ CARD8 status;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ CARD32 pad05 B32;
+} xChangeDeviceControlReply;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+} xDeviceCtl;
+
+typedef struct {
+ CARD16 control B16; /* control type */
+ CARD16 length B16; /* control length */
+ CARD8 first_valuator; /* first valuator to change */
+ CARD8 num_valuators; /* number of valuators to change*/
+ CARD8 pad1,pad2;
+} xDeviceResolutionCtl;
+
+/**********************************************************
+ *
+ * Input extension events.
+ *
+ * DeviceValuator
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ CARD8 deviceid;
+ CARD16 sequenceNumber B16;
+ KeyButMask device_state B16;
+ CARD8 num_valuators;
+ CARD8 first_valuator;
+ INT32 valuator0 B32;
+ INT32 valuator1 B32;
+ INT32 valuator2 B32;
+ INT32 valuator3 B32;
+ INT32 valuator4 B32;
+ INT32 valuator5 B32;
+ } deviceValuator;
+
+/**********************************************************
+ *
+ * DeviceKeyButtonPointer.
+ *
+ * Used for: DeviceKeyPress, DeviceKeyRelease,
+ * DeviceButtonPress, DeviceButtonRelease,
+ * ProximityIn, ProximityOut
+ * DeviceMotionNotify,
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE detail;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ Window root B32;
+ Window event B32;
+ Window child B32;
+ INT16 root_x B16;
+ INT16 root_y B16;
+ INT16 event_x B16;
+ INT16 event_y B16;
+ KeyButMask state B16;
+ BOOL same_screen;
+ CARD8 deviceid;
+ } deviceKeyButtonPointer;
+
+/**********************************************************
+ *
+ * DeviceFocus.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE detail;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ Window window B32;
+ BYTE mode;
+ CARD8 deviceid;
+ BYTE pad1, pad2;
+ CARD32 pad00 B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ } deviceFocus;
+
+/**********************************************************
+ *
+ * DeviceStateNotify.
+ *
+ * Note that the two high-order bits in the classes_reported
+ * field are the proximity state (InProximity or OutOfProximity),
+ * and the device mode (Absolute or Relative), respectively.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 num_keys;
+ CARD8 num_buttons;
+ CARD8 num_valuators;
+ CARD8 classes_reported;
+ CARD8 buttons[4];
+ CARD8 keys[4];
+ INT32 valuator0 B32;
+ INT32 valuator1 B32;
+ INT32 valuator2 B32;
+ } deviceStateNotify;
+
+/**********************************************************
+ *
+ * DeviceKeyStateNotify.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ CARD8 keys[28];
+ } deviceKeyStateNotify;
+
+/**********************************************************
+ *
+ * DeviceButtonStateNotify.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ CARD8 buttons[28];
+ } deviceButtonStateNotify;
+
+/**********************************************************
+ *
+ * DeviceMappingNotify.
+ * Fields must be kept in sync with core mappingnotify event.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ CARD8 request;
+ KeyCode firstKeyCode;
+ CARD8 count;
+ BYTE pad1;
+ Time time B32;
+ CARD32 pad00 B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ } deviceMappingNotify;
+
+/**********************************************************
+ *
+ * ChangeDeviceNotify.
+ *
+ */
+
+typedef struct
+ {
+ BYTE type;
+ BYTE deviceid;
+ CARD16 sequenceNumber B16;
+ Time time B32;
+ CARD8 request;
+ BYTE pad1, pad2, pad3;
+ CARD32 pad00 B32;
+ CARD32 pad01 B32;
+ CARD32 pad02 B32;
+ CARD32 pad03 B32;
+ CARD32 pad04 B32;
+ } changeDeviceNotify;
+
+#undef Window
+#undef Time
+#undef KeyCode
+
+#endif