diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-11-13 11:29:06 +1030 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-11-13 11:29:06 +1030 |
commit | 14e6e7bad06a560ec943654b94e05d4293709f2c (patch) | |
tree | e8d6707ed2a4d6a4f47867c9318392c385697a96 | |
parent | 685a2dd32736956f5175afb9bc5773c829725fea (diff) |
Add DeviceClassesChangedEvent.
-rw-r--r-- | XI.h | 1 | ||||
-rw-r--r-- | XInput.h | 27 | ||||
-rw-r--r-- | XIproto.h | 29 |
3 files changed, 53 insertions, 4 deletions
@@ -319,6 +319,7 @@ SOFTWARE. /* GE masks */ #define XI_DeviceHierarchyChangedMask (1 << 0) +#define XI_DeviceClassesChangedMask (1 << 1) #define XI_RawDeviceEventMask (1 << 2) @@ -186,6 +186,8 @@ extern "C" { #define DeviceBusy(dpy,error) _xidevicebusy(dpy, &error) +typedef struct _XAnyClassinfo *XAnyClassPtr; + /*************************************************************** * * DeviceKey events. These events are sent by input devices that @@ -510,7 +512,26 @@ typedef struct { } XDeviceHierarchyChangedEvent; /* - * RawDeviceEvent. + * Notifies the client that the classes have been changed. This happens when + * the slave device that sends through the master changes. + */ +typedef struct { + int type; /* GenericEvent */ + 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 */ + int extension; /* XI extension offset */ + int evtype; /* XI_DeviceHierarchyChangedNotify */ + Time time; + XID deviceid; /* id of the device that changed */ + XID slaveid; /* id of the slave device that caused the + change */ + int num_classes; + XAnyClassPtr inputclassinfo; /* same as in XDeviceInfo */ +} XDeviceClassesChangedEvent; + +/* + * RawDeviceEvent. * Data as received directly from the device. */ typedef struct { @@ -522,7 +543,7 @@ typedef struct { int evtype; /* XI_RawDeviceEvent */ int event_type; /* MotionNotify, ButtonPress or ButtonRelease*/ - int deviceid; + XID deviceid; int buttons; int num_valuators; int first_valuator; @@ -799,8 +820,6 @@ typedef struct { * */ -typedef struct _XAnyClassinfo *XAnyClassPtr; - typedef struct _XAnyClassinfo { #if defined(__cplusplus) || defined(c_plusplus) XID c_class; @@ -120,6 +120,7 @@ struct tmask /* GE events */ #define XI_DeviceHierarchyChangedNotify 0 +#define XI_DeviceClassesChangedNotify 1 #define XI_RawDeviceEvent 2 @@ -2129,6 +2130,34 @@ typedef struct CARD32 pad5 B32; } deviceHierarchyChangedEvent; +/********************************************************* + * DeviceClassesChangedEvent + * + * Send whenever a master device changes classes (due to another slave device + * sending events). + * + * Event is followed by the same type of class list as used in the + * ListInputDevices request. + */ + +typedef struct + { + BYTE type; /* always GenericEvent */ + BYTE extension; /* XI extension offset */ + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD16 evtype B16; /* XI_DeviceClassesChangedNotify */ + CARD8 deviceid; /* id of master */ + CARD8 new_slave; /* id of new slave */ + CARD32 time B32; + CARD8 num_classes; + CARD8 pad0; + CARD16 pad1 B16; + CARD32 pad2 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + } deviceClassesChangedEvent; + #undef Window #undef Time |