diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-07 11:02:02 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-05-07 11:02:02 +1000 |
commit | 130774c208a2f331d6110b255676ad6cb8a1a414 (patch) | |
tree | a2300b86ffd5f3d47807e438ac961febe4637a40 | |
parent | 70d9a55c86f15b71ff8b53a61b8fb0e1723e0824 (diff) |
Add property event conversion.
-rw-r--r-- | include/X11/extensions/XInput2.h | 13 | ||||
-rw-r--r-- | src/XExtInt.c | 25 |
2 files changed, 38 insertions, 0 deletions
diff --git a/include/X11/extensions/XInput2.h b/include/X11/extensions/XInput2.h index 77dd57b..abef3f2 100644 --- a/include/X11/extensions/XInput2.h +++ b/include/X11/extensions/XInput2.h @@ -263,6 +263,19 @@ typedef struct { typedef XIEnterEvent XILeaveEvent; + +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; + Time time; + Atom property; + int what; +} XIPropertyEvent; + _XFUNCPROTOBEGIN extern Bool XIQueryDevicePointer( diff --git a/src/XExtInt.c b/src/XExtInt.c index fc018cd..1d12061 100644 --- a/src/XExtInt.c +++ b/src/XExtInt.c @@ -135,6 +135,8 @@ static int wireToRawEvent(xXIRawDeviceEvent *in, XIRawDeviceEvent *out); static int wireToEnterLeave(xXIEnterEvent *in, XIEnterEvent *out); +static int +wireToPropertyEvent(xXIPropertyEvent *in, XIPropertyEvent *out); static /* const */ XEvent emptyevent; @@ -847,6 +849,16 @@ XInputWireToEvent( break; } return ENQUEUE_EVENT; + case XI_PropertyEvent: + *re = *save; + if (!wireToPropertyEvent((xXIPropertyEvent*)event, + (XIPropertyEvent*)re)) + { + printf("XInputWireToEvent: CONVERSION FAILURE! evtype=%d\n", + ge->evtype); + break; + } + return ENQUEUE_EVENT; default: printf("XInputWireToEvent: Unknown generic event. type %d\n", ge->evtype); @@ -1059,3 +1071,16 @@ wireToEnterLeave(xXIEnterEvent *in, XIEnterEvent *out) return 1; } + +static int +wireToPropertyEvent(xXIPropertyEvent *in, XIPropertyEvent *out) +{ + out->type = in->type; + out->extension = in->extension; + out->evtype = in->evtype; + out->time = in->time; + out->property = in->property; + out->what = in->what; + + return 1; +} |