summaryrefslogtreecommitdiff
path: root/src/XExtInt.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-03-08 21:16:54 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-03-11 14:49:07 +1000
commit2712dbc2609ad75674c77df04d42899844968e10 (patch)
tree821356954ab24c5c0007ccc12914f4d4cb0fa504 /src/XExtInt.c
parent30c2e3f9398f3d9cbae70150e4bb5cec6dfcc0a1 (diff)
Add support for XIHierarchyEvent.
Diffstat (limited to 'src/XExtInt.c')
-rw-r--r--src/XExtInt.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/XExtInt.c b/src/XExtInt.c
index 77575b3..22c054e 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -128,6 +128,8 @@ static int
wireToDeviceEvent(xXIDeviceEvent *in, XIDeviceEvent* out);
static int
wireToDeviceChangedEvent(xXIDeviceChangedEvent *in, XIDeviceChangedEvent* out);
+static int
+wireToHierarchyChangedEvent(xXIDeviceHierarchyEvent *in, XIDeviceHierarchyEvent* out);
static /* const */ XEvent emptyevent;
@@ -806,6 +808,15 @@ XInputWireToEvent(
break;
}
return ENQUEUE_EVENT;
+ case XI_HierarchyChanged:
+ *re = *save;
+ if (!wireToHierarchyChangedEvent(event, re))
+ {
+ printf("XInputWireToEvent: CONVERSION FAILURE! evtype=%d\n",
+ ge->evtype);
+ break;
+ }
+ return ENQUEUE_EVENT;
#if 0
case XI_HierarchyChangedNotify:
@@ -964,3 +975,31 @@ wireToDeviceChangedEvent(xXIDeviceChangedEvent *in, XIDeviceChangedEvent* out)
return 1;
}
+static int
+wireToHierarchyChangedEvent(xXIDeviceHierarchyEvent *in, XIDeviceHierarchyEvent* out)
+{
+ int i;
+ XIHierarchyInfo *info_out;
+ xXIHierarchyInfo *info_in;
+
+ out->info = Xmalloc(in->num_devices * sizeof(XIHierarchyInfo));
+ out->type = in->type;
+ out->extension = in->extension;
+ out->evtype = in->evtype;
+ out->time = in->time;
+ out->flags = in->flags;
+ out->num_devices = in->num_devices;
+
+ info_out = out->info;
+ info_in = (xXIHierarchyInfo*)&in[1];
+
+ for (i = 0; i < out->num_devices; i++, info_out++, info_in++)
+ {
+ info_out->deviceid = info_in->deviceid;
+ info_out->attachment = info_in->attachment;
+ info_out->use = info_in->use;
+ info_out->enabled = info_in->enabled;
+ }
+
+ return 1;
+}