summaryrefslogtreecommitdiff
path: root/include/X11/extensions/XInput.h
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-08-13 12:03:29 +0930
committerPeter Hutterer <peter.hutterer@redhat.com>2008-08-13 12:03:29 +0930
commitbec02767629ed795582ba3f645299d7036093511 (patch)
tree03aa44ece5d32a18eef4b28ff610967adf2b0160 /include/X11/extensions/XInput.h
parentc5179577ddf0680dffb480d27db9036e9bd27716 (diff)
Backport device property code to XI 1.5.
Ditching generic events, using normal XI events instead.
Diffstat (limited to 'include/X11/extensions/XInput.h')
-rw-r--r--include/X11/extensions/XInput.h45
1 files changed, 25 insertions, 20 deletions
diff --git a/include/X11/extensions/XInput.h b/include/X11/extensions/XInput.h
index 2fd77e9..1007b24 100644
--- a/include/X11/extensions/XInput.h
+++ b/include/X11/extensions/XInput.h
@@ -70,9 +70,12 @@ SOFTWARE.
#define _deviceStateNotify 0
#define _deviceMappingNotify 1
#define _changeDeviceNotify 2
-/* Space of 4 between is necessary! */
-#define _deviceEnterNotify 6
-#define _deviceLeaveNotify 7
+/* Space of 3 between is necessary! Reserved for DeviceKeyStateNotify,
+ DeviceButtonStateNotify, DevicePresenceNotify (essentially unused). This
+ code has to be in sync with FixExtensionEvents() in xserver/Xi/extinit.c */
+#define _propertyNotify 6
+#define _deviceEnterNotify 7
+#define _deviceLeaveNotify 8
#define FindTypeAndClass(d,type,_class,classid,offset) \
{ int _i; XInputClassInfo *_ip; \
@@ -120,6 +123,9 @@ SOFTWARE.
#define ChangeDeviceNotify(d,type,_class) \
FindTypeAndClass(d, type, _class, OtherClass, _changeDeviceNotify)
+#define DevicePropertyNotify(d, type, _class) \
+ FindTypeAndClass(d, type, _class, OtherClass, _propertyNotify)
+
#define DevicePointerMotionHint(d,type,_class) \
{ _class = ((XDevice *) d)->device_id << 8 | _devicePointerMotionHint;}
@@ -467,6 +473,22 @@ typedef struct {
XID control;
} XDevicePresenceNotifyEvent;
+/*
+ * Notifies the client that a property on a device has changed value. The
+ * client is expected to query the server for updated value of the property.
+ */
+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 */
+ Time time;
+ XID deviceid; /* id of the device that changed */
+ Atom atom; /* the property that changed */
+ int state; /* PropertyNewValue or PropertyDeleted */
+} XDevicePropertyNotifyEvent;
+
typedef struct {
int type;
@@ -527,23 +549,6 @@ typedef struct {
XAnyClassPtr inputclassinfo; /* same as in XDeviceInfo */
} XDeviceClassesChangedEvent;
-/*
- * Notifies the client that a property on a device has changed value. The
- * client is expected to query the server for updated value of the property.
- */
-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 */
- Atom atom; /* the property that changed */
- int state; /* PropertyNewValue or PropertyDeleted */
-} XDevicePropertyNotifyEvent;
-
/*******************************************************************
*