1 /**************************************************************************
5 Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
7 Contact: Boram Park <boram1288.park@samsung.com>
8 Sangjin LEE <lsj119@samsung.com>
10 Permission is hereby granted, free of charge, to any person obtaining a
11 copy of this software and associated documentation files (the
12 "Software"), to deal in the Software without restriction, including
13 without limitation the rights to use, copy, modify, merge, publish,
14 distribute, sub license, and/or sell copies of the Software, and to
15 permit persons to whom the Software is furnished to do so, subject to
16 the following conditions:
18 The above copyright notice and this permission notice (including the
19 next paragraph) shall be included in all copies or substantial portions
22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
25 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
26 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
27 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
28 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 **************************************************************************/
39 #include <sys/types.h>
40 #include <sys/fcntl.h>
51 #include <X11/Xatom.h>
53 #include <windowstr.h>
55 #include <X11/extensions/XI.h>
56 #include <X11/extensions/XInput.h>
57 #include <X11/Xlibint.h>
58 #include <X11/extensions/XIproto.h>
59 #include <X11/extensions/XI2proto.h>
61 #include "xdbg_types.h"
62 #include "xdbg_evlog_xinput.h"
63 #include "xdbg_evlog.h"
66 _getMode(CARD8 mode, char *reply, int *len)
73 case XIGrabModeSync: buf = "XIGrabModeSync"; break;
74 case XIGrabModeAsync: buf = "XIGrabModeAsync"; break;
75 case XIGrabModeTouch: buf = "XIGrabModeTouch"; break;
76 default: buf = dbuf; snprintf (dbuf, 10, "%d", mode); break;
85 _EvlogRequestXinput (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
87 xReq *req = evinfo->req.ptr;
93 xGrabDeviceReq *stuff = (xGrabDeviceReq *)req;
94 REPLY (": XID(0x%lx) device_ID(%d)",
98 if (detail_level >= EVLOG_PRINT_DETAIL)
100 REPLY (" this_dev_mode");
102 reply = _getMode(stuff->this_device_mode, reply, len);
105 REPLY (" other_dev_mode");
107 reply = _getMode(stuff->other_devices_mode, reply, len);
110 REPLY (" time(%lums) evt_cnt(%d) owner_events(%s)",
113 stuff->ownerEvents ? "YES" : "NO");
121 xUngrabDeviceReq *stuff = (xUngrabDeviceReq *)req;
122 REPLY (": device_ID(%d)",
125 if (detail_level >= EVLOG_PRINT_DETAIL)
127 REPLY (" time(%lums)",
134 case X_GrabDeviceKey:
136 xGrabDeviceKeyReq *stuff = (xGrabDeviceKeyReq *)req;
137 REPLY (": XID(0x%lx)",
140 if (detail_level >= EVLOG_PRINT_DETAIL)
142 REPLY (" evt_cnt(%d) modifiers(%d) mod_dev(%d) grab_dev(%d) key(%d)",
145 stuff->modifier_device,
146 stuff->grabbed_device,
150 REPLY ("%67s this_dev_mode",
154 reply = _getMode(stuff->this_device_mode, reply, len);
157 REPLY (" other_dev_mode");
159 reply = _getMode(stuff->other_devices_mode, reply, len);
162 REPLY (" owner_events(%s)",
163 stuff->ownerEvents ? "YES" : "NO");
169 case X_UngrabDeviceKey:
171 xUngrabDeviceKeyReq *stuff = (xUngrabDeviceKeyReq *)req;
172 REPLY (": XID(0x%lx)",
175 if (detail_level >= EVLOG_PRINT_DETAIL)
177 REPLY (" modifiers(%d) mod_dev(%d) grab_dev(%d) key(%d)",
179 stuff->modifier_device,
180 stuff->grabbed_device,
187 case X_GrabDeviceButton:
189 xGrabDeviceButtonReq *stuff = (xGrabDeviceButtonReq *)req;
190 REPLY (": XID(0x%lx))",
193 if (detail_level >= EVLOG_PRINT_DETAIL)
195 REPLY (" grab_dev(%d) mod_dev(%d) evt_cnt(%d) modifiers(%d) button(%d)",
196 stuff->grabbed_device,
197 stuff->modifier_device,
203 REPLY ("%67s this_dev_mode",
206 reply = _getMode(stuff->this_device_mode, reply, len);
209 REPLY (" other_dev_mode");
211 reply = _getMode(stuff->other_devices_mode, reply, len);
214 REPLY (" owner_events(%s)",
215 stuff->ownerEvents ? "YES" : "NO");
221 case X_UngrabDeviceButton:
223 xUngrabDeviceButtonReq *stuff = (xUngrabDeviceButtonReq *)req;
224 REPLY (": XID(0x%lx)",
227 if (detail_level >= EVLOG_PRINT_DETAIL)
229 REPLY (" modifiers(%d) modDev(%d) grabDev(%d) button(%d)",
231 stuff->modifier_device,
232 stuff->grabbed_device,
239 case X_AllowDeviceEvents:
241 xAllowDeviceEventsReq *stuff = (xAllowDeviceEventsReq *)req;
242 REPLY (": device_ID(%d)",
245 if (detail_level >= EVLOG_PRINT_DETAIL)
247 REPLY (" time(%lums) mode(%d)",
255 case X_GetDeviceFocus:
257 xGetDeviceFocusReq *stuff = (xGetDeviceFocusReq *)req;
258 REPLY (": devID(%d)",
264 case X_SetDeviceFocus:
266 xSetDeviceFocusReq *stuff = (xSetDeviceFocusReq *)req;
267 REPLY (": XID(0x%lx) dev_ID(%d)",
271 if (detail_level >= EVLOG_PRINT_DETAIL)
273 REPLY (" time(%lums) revertTo(%d)",
281 case X_XIQueryPointer:
283 xXIQueryPointerReq *stuff = (xXIQueryPointerReq *)req;
284 REPLY (": XID(0x%x) devID(%d)",
291 case X_XIWarpPointer:
293 xXIWarpPointerReq *stuff = (xXIWarpPointerReq *)req;
294 REPLY (": srcWIN(0x%x) dstWin(0x%x) src(%d,%d %dx%d) dst(%d,%d) device_ID(%d)",
308 case X_XIChangeCursor:
310 xXIChangeCursorReq *stuff = (xXIChangeCursorReq *)req;
311 REPLY (": XID(0x%x) Cursor(0x%x) devID(%d)",
319 case X_XIChangeHierarchy:
321 xXIChangeHierarchyReq *stuff = (xXIChangeHierarchyReq *)req;
322 REPLY (": numChange(%d)",
328 case X_XISetClientPointer:
330 xXISetClientPointerReq *stuff = (xXISetClientPointerReq *)req;
331 REPLY (": XID(0x%x) device_ID(%d)",
338 case X_XIGetClientPointer:
340 xXIGetClientPointerReq *stuff = (xXIGetClientPointerReq *)req;
341 REPLY (": XID(0x%x)",
347 case X_XISelectEvents:
349 xXISelectEventsReq *stuff = (xXISelectEventsReq *)req;
350 REPLY (": XID(0x%x)",
353 if (detail_level >= EVLOG_PRINT_DETAIL)
355 REPLY (" num_masks(%d)",
362 case X_XIQueryVersion:
364 xXIQueryVersionReq *stuff = (xXIQueryVersionReq *)req;
365 REPLY (": major_vesion(%d) minor_vesion(%d)",
366 stuff->major_version,
367 stuff->minor_version);
372 case X_XIQueryDevice:
374 xXIQueryDeviceReq *stuff = (xXIQueryDeviceReq *)req;
375 REPLY (": device_ID(%d)",
383 xXISetFocusReq *stuff = (xXISetFocusReq *)req;
384 REPLY (": XID(0x%x) device_ID(%d)",
388 if (detail_level >= EVLOG_PRINT_DETAIL)
390 REPLY (" time(%ums)",
399 xXIGetFocusReq *stuff = (xXIGetFocusReq *)req;
400 REPLY (": devID(%d)",
408 xXIGrabDeviceReq *stuff = (xXIGrabDeviceReq *)req;
409 REPLY (": XID(0x%x) Cursor(0x%x) device_ID(%d)",
414 if (detail_level >= EVLOG_PRINT_DETAIL)
417 REPLY ("%67s grab_mode",
420 reply = _getMode(stuff->grab_mode, reply, len);
423 REPLY (" paired_device_mode");
425 reply = _getMode(stuff->paired_device_mode, reply, len);
428 REPLY (" time(%ums) owner_events(%s)",
430 stuff->owner_events ? "YES" : "NO");
436 case X_XIUngrabDevice:
438 xXIUngrabDeviceReq *stuff = (xXIUngrabDeviceReq *)req;
439 REPLY (": devID(%d)",
442 if (detail_level >= EVLOG_PRINT_DETAIL)
444 REPLY (" time(%ums)",
451 case X_XIAllowEvents:
453 xXIAllowEventsReq *stuff = (xXIAllowEventsReq *)req;
454 REPLY (": devID(%d)",
457 if (detail_level >= EVLOG_PRINT_DETAIL)
459 REPLY (" time(%ums) mode(%d)",
467 case X_XIPassiveGrabDevice:
469 xXIPassiveGrabDeviceReq *stuff = (xXIPassiveGrabDeviceReq *)req;
470 REPLY (": XID(0x%x) Cursor(0x%x) device_ID(%d)",
475 if (detail_level >= EVLOG_PRINT_DETAIL)
480 switch(stuff->grab_type)
482 case XIGrabtypeButton: type = "XIGrabtypeButton"; break;
483 case XIGrabtypeKeycode: type = "XIGrabtypeKeycode"; break;
484 case XIGrabtypeEnter: type = "XIGrabtypeEnter"; break;
485 case XIGrabtypeFocusIn: type = "XIGrabtypeFocusIn"; break;
486 case XIGrabtypeTouchBegin: type = "XIGrabtypeTouchBegin"; break;
487 default: type = dtype; snprintf (dtype, 10, "%d", stuff->grab_type); break;
490 REPLY (" time(%ums) detail(%d) grab_type(%s)",
498 REPLY (" grab_mode");
500 reply = _getMode(stuff->grab_mode, reply, len);
503 REPLY (" paired_device_mode");
505 reply = _getMode(stuff->paired_device_mode, reply, len);
508 REPLY (" num_modifier(%d) owner_events(%s)",
509 stuff->num_modifiers,
510 stuff->owner_events ? "YES" : "NO");
517 case X_XIPassiveUngrabDevice:
519 xXIPassiveUngrabDeviceReq *stuff = (xXIPassiveUngrabDeviceReq *)req;
520 REPLY (": XID(0x%x) device_ID(%d)",
524 if (detail_level >= EVLOG_PRINT_DETAIL)
529 switch(stuff->grab_type)
531 case XIGrabtypeButton: type = "XIGrabtypeButton"; break;
532 case XIGrabtypeKeycode: type = "XIGrabtypeKeycode"; break;
533 case XIGrabtypeEnter: type = "XIGrabtypeEnter"; break;
534 case XIGrabtypeFocusIn: type = "XIGrabtypeFocusIn"; break;
535 case XIGrabtypeTouchBegin: type = "XIGrabtypeTouchBegin"; break;
536 default: type = dtype; snprintf (dtype, 10, "%d", stuff->grab_type); break;
539 REPLY (" detail(%d) grab_type(%s) num_modifiers(%d)",
542 stuff->num_modifiers);
548 case X_XIListProperties:
550 xXIListPropertiesReq *stuff = (xXIListPropertiesReq *)req;
551 REPLY (": devID(%d)",
557 case X_XIChangeProperty:
559 xXIChangePropertyReq *stuff = (xXIChangePropertyReq *)req;
560 REPLY (": devID(%d)",
564 reply = xDbgGetAtom(stuff->property, evinfo, reply, len);
566 reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
568 if (detail_level >= EVLOG_PRINT_DETAIL)
575 case XIPropModeReplace: mode = "XIPropModeReplace"; break;
576 case XIPropModePrepend: mode = "XIPropModePrepend"; break;
577 case XIPropModeAppend: mode = "XIPropModeAppend"; break;
578 default: mode = dmode; snprintf (dmode, 10, "%d", stuff->mode); break;
581 REPLY (" mode(%s) format(%d) num_items(%d)",
590 case X_XIDeleteProperty:
592 xXIDeletePropertyReq *stuff = (xXIDeletePropertyReq *)req;
593 REPLY (": devID(%d)",
597 reply = xDbgGetAtom(stuff->property, evinfo, reply, len);
602 case X_XIGetProperty:
604 xXIGetPropertyReq *stuff = (xXIGetPropertyReq *)req;
605 REPLY (": devID(%d)",
609 reply = xDbgGetAtom(stuff->property, evinfo, reply, len);
611 reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
613 if (detail_level >= EVLOG_PRINT_DETAIL)
615 REPLY (" delete(%s) offset(%u) length(%u)",
616 stuff->delete ? "YES" : "NO",
624 case X_XIGetSelectedEvents:
626 xXIGetSelectedEventsReq *stuff = (xXIGetSelectedEventsReq *)req;
627 REPLY (": XID(0x%x)",
641 _EvlogEventXinput (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
643 xEvent *evt = evinfo->evt.ptr;
645 switch ((evt->u.u.type & 0x7F) - first_base)
647 case XI_DeviceValuator:
649 deviceValuator *stuff = (deviceValuator *) evt;
650 REPLY (": device_ID(%d) numValuator(%d) fstnumValuator(%d)",
652 stuff->num_valuators,
653 stuff->first_valuator);
655 if (detail_level >= EVLOG_PRINT_DETAIL)
659 REPLY (" sequence_num(%d) device_state(0x%x)\n",
660 stuff->sequenceNumber,
661 stuff->device_state);
664 for (i = 0 ; i < stuff->num_valuators ; i++)
666 REPLY (" valuator%d(%ld)",
668 *(&stuff->valuator0 + i));
675 case XI_DeviceKeyPress:
677 XDeviceKeyPressedEvent *stuff = (XDeviceKeyPressedEvent *) evt;
678 REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
688 if (detail_level >= EVLOG_PRINT_DETAIL)
691 REPLY ("%67s time(%lums) state(%d) key_code(%d) same_screen(%s) device_state(%d) first_axis(%d)",
696 stuff->same_screen ? "YES" : "NO",
704 case XI_DeviceKeyRelease:
706 XDeviceKeyReleasedEvent *stuff = (XDeviceKeyReleasedEvent *) evt;
707 REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
717 if (detail_level >= EVLOG_PRINT_DETAIL)
720 REPLY ("%67s time(%lums) state(%d) key_code(%d) same_screen(%s) device_state(%d) first_axis(%d)",
725 stuff->same_screen ? "YES" : "NO",
733 case XI_DeviceButtonPress:
735 XDeviceButtonPressedEvent *stuff = (XDeviceButtonPressedEvent *) evt;
736 REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
746 if (detail_level >= EVLOG_PRINT_DETAIL)
749 REPLY ("%67s time(%lums) state(%d) button(%d) same_screen(%s) device_state(%d) first_axis(%d)",
754 stuff->same_screen ? "YES" : "NO",
762 case XI_DeviceButtonRelease:
764 XDeviceButtonReleasedEvent *stuff = (XDeviceButtonReleasedEvent *) evt;
765 REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
775 if (detail_level >= EVLOG_PRINT_DETAIL)
778 REPLY ("%67s time(%lums) state(%d) button(%d) same_screen(%s) device_state(%d) first_axis(%d)",
783 stuff->same_screen ? "YES" : "NO",
791 case XI_DeviceMotionNotify:
793 XDeviceMotionEvent *stuff = (XDeviceMotionEvent *) evt;
794 REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
804 if (detail_level >= EVLOG_PRINT_DETAIL)
807 REPLY ("%67s time(%lums) state(%d) is_hint(%d) same_screen(%s) device_state(%d) first_axis(%d)",
812 stuff->same_screen ? "YES" : "NO",
820 case XI_DeviceFocusIn:
822 XDeviceFocusInEvent *stuff = (XDeviceFocusInEvent *) evt;
823 REPLY (": XID(0x%lx) Window(0x%lx)",
827 if (detail_level >= EVLOG_PRINT_DETAIL)
829 const char *mode, *detail;
830 char dmode[10], ddetail[10];
834 case NotifyNormal: mode = "NotifyNormal"; break;
835 case NotifyGrab: mode = "NotifyGrab"; break;
836 case NotifyUngrab: mode = "NotifyUngrab"; break;
837 case NotifyWhileGrabbed: mode = "NotifyWhileGrabbed"; break;
838 default: mode = dmode; snprintf (dmode, 10, "%d", stuff->mode); break;
841 switch(stuff->detail)
843 case NotifyAncestor: detail = "NotifyAncestor"; break;
844 case NotifyVirtual: detail = "NotifyVirtual"; break;
845 case NotifyInferior: detail = "NotifyInferior"; break;
846 case NotifyNonlinear: detail = "NotifyNonlinear"; break;
847 case NotifyNonlinearVirtual: detail = "NotifyNonlinearVirtual"; break;
848 case NotifyPointer: detail = "NotifyPointer"; break;
849 case NotifyPointerRoot: detail = "NotifyPointerRoot"; break;
850 case NotifyDetailNone: detail = "NotifyDetailNone"; break;
851 default: detail = ddetail; snprintf (ddetail, 10, "%d", stuff->detail); break;
854 REPLY (" mode(%s) detail(%s) time(%lums)",
863 case XI_DeviceFocusOut:
865 XDeviceFocusOutEvent *stuff = (XDeviceFocusOutEvent *) evt;
866 REPLY (": XID(0x%lx) Window(0x%lx)",
870 if (detail_level >= EVLOG_PRINT_DETAIL)
872 const char *mode, *detail;
873 char dmode[10], ddetail[10];
877 case NotifyNormal: mode = "NotifyNormal"; break;
878 case NotifyGrab: mode = "NotifyGrab"; break;
879 case NotifyUngrab: mode = "NotifyUngrab"; break;
880 case NotifyWhileGrabbed: mode = "NotifyWhileGrabbed"; break;
881 default: mode = dmode; snprintf (dmode, 10, "%d", stuff->mode); break;
884 switch(stuff->detail)
886 case NotifyAncestor: detail = "NotifyAncestor"; break;
887 case NotifyVirtual: detail = "NotifyVirtual"; break;
888 case NotifyInferior: detail = "NotifyInferior"; break;
889 case NotifyNonlinear: detail = "NotifyNonlinear"; break;
890 case NotifyNonlinearVirtual: detail = "NotifyNonlinearVirtual"; break;
891 case NotifyPointer: detail = "NotifyPointer"; break;
892 case NotifyPointerRoot: detail = "NotifyPointerRoot"; break;
893 case NotifyDetailNone: detail = "NotifyDetailNone"; break;
894 default: detail = ddetail; snprintf (ddetail, 10, "%d", stuff->detail); break;
897 REPLY (" mode(%s) detail(%s) time(%lums)",
908 XProximityInEvent *stuff = (XProximityInEvent *) evt;
909 REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
919 if (detail_level >= EVLOG_PRINT_DETAIL)
922 REPLY ("%67s time(%lums) state(%d) same_screen(%s) device_state(%d) first_axis(%d)",
926 stuff->same_screen ? "YES" : "NO",
934 case XI_ProximityOut:
936 XProximityOutEvent *stuff = (XProximityOutEvent *) evt;
937 REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
947 if (detail_level >= EVLOG_PRINT_DETAIL)
950 REPLY ("%67s time(%lums) state(%d) same_screen(%s) device_state(%d) first_axis(%d)",
954 stuff->same_screen ? "YES" : "NO",
962 case XI_DeviceStateNotify:
964 XDeviceStateNotifyEvent *stuff = (XDeviceStateNotifyEvent *) evt;
965 REPLY (": XID(0x%lx) Window(0x%lx)",
969 if (detail_level >= EVLOG_PRINT_DETAIL)
971 REPLY (" time(%lums) num_classes(%d)",
979 case XI_DeviceMappingNotify:
981 XDeviceMappingEvent *stuff = (XDeviceMappingEvent *) evt;
982 REPLY (": XID(0x%lx) Window(0x%lx)",
986 if (detail_level >= EVLOG_PRINT_DETAIL)
991 switch(stuff->request)
993 case MappingModifier: request = "MappingModifier"; break;
994 case MappingKeyboard: request = "MappingKeyboard"; break;
995 case MappingPointer: request = "MappingPointer"; break;
996 default: request = drequest; snprintf (drequest, 10, "%d", stuff->request); break;
999 REPLY (" time(%lums) request(%s) first_keycode(%d) count(%d)",
1002 stuff->first_keycode,
1009 case XI_ChangeDeviceNotify:
1011 XChangeDeviceNotifyEvent *stuff = (XChangeDeviceNotifyEvent *) evt;
1012 REPLY (": XID(0x%lx) Window(0x%lx)",
1016 if (detail_level >= EVLOG_PRINT_DETAIL)
1018 const char *request;
1021 switch(stuff->request)
1023 case NewPointer: request = "NewPointer"; break;
1024 case NewKeyboard: request = "NewKeyboard"; break;
1025 default: request = drequest; snprintf (drequest, 10, "%d", stuff->request); break;
1028 REPLY (" time(%lums) request(%s)",
1036 case XI_DeviceKeystateNotify:
1038 deviceKeyStateNotify *stuff = (deviceKeyStateNotify *) evt;
1039 REPLY (": deviceid(%d)",
1042 if (detail_level >= EVLOG_PRINT_DETAIL)
1044 REPLY (" sequence_num(%d)",
1045 stuff->sequenceNumber);
1051 case XI_DeviceButtonstateNotify:
1053 deviceButtonStateNotify *stuff = (deviceButtonStateNotify *) evt;
1054 REPLY (": deviceid(%d)",
1057 if (detail_level >= EVLOG_PRINT_DETAIL)
1059 REPLY (" sequence_num(%d)",
1060 stuff->sequenceNumber);
1066 case XI_DevicePresenceNotify:
1068 devicePresenceNotify *stuff = (devicePresenceNotify *) evt;
1069 REPLY (": deviceid(%d)",
1072 if (detail_level >= EVLOG_PRINT_DETAIL)
1074 REPLY (" time(%lums) device_change(%d) control(%d) sequence_num(%d)",
1078 stuff->sequenceNumber);
1084 case XI_DevicePropertyNotify:
1086 devicePropertyNotify *stuff = (devicePropertyNotify *) evt;
1087 REPLY (": deviceid(%d)",
1091 reply = xDbgGetAtom(stuff->atom, evinfo, reply, len);
1093 if (detail_level >= EVLOG_PRINT_DETAIL)
1095 REPLY (" time(%lums) state(%d) sequence_num(%d)",
1098 stuff->sequenceNumber);
1112 _EvlogReplyXinput (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
1114 xGenericReply *rep = evinfo->rep.ptr;
1116 switch (evinfo->rep.reqData)
1118 case X_ListInputDevices:
1120 if (evinfo->rep.isStart)
1122 xListInputDevicesReply *stuff = (xListInputDevicesReply *) rep;
1123 REPLY (": nDevices(%d)",
1136 if (evinfo->rep.isStart)
1138 xGrabDeviceReply *stuff = (xGrabDeviceReply *) rep;
1139 REPLY (": status(%d)",
1150 case X_GetDeviceFocus:
1152 if (evinfo->rep.isStart)
1154 xGetDeviceFocusReply *stuff = (xGetDeviceFocusReply *) rep;
1155 REPLY (": XID(0x%lx) Time(0x%lx)",
1167 case X_XIQueryVersion:
1169 if (evinfo->rep.isStart)
1171 xXIQueryVersionReply *stuff = (xXIQueryVersionReply *) rep;
1172 REPLY (": majorVersion(%d) minorVersion(%d)",
1173 stuff->major_version,
1174 stuff->minor_version);
1184 case X_XIQueryDevice:
1186 if (evinfo->rep.isStart)
1188 xXIQueryDeviceReply *stuff = (xXIQueryDeviceReply *) rep;
1189 REPLY (": numDevices(%d)",
1190 stuff->num_devices);
1200 case X_XIGetSelectedEvents:
1202 if (evinfo->rep.isStart)
1204 xXIGetSelectedEventsReply *stuff = (xXIGetSelectedEventsReply *) rep;
1205 REPLY (": numMasks(%d)",
1216 case X_XIQueryPointer:
1218 if (evinfo->rep.isStart)
1220 xXIQueryPointerReply *stuff = (xXIQueryPointerReply *) rep;
1221 REPLY (": XID(0x%x) Child(0x%x) root(%d,%d) win(%d,%d)",
1237 case X_XIGetClientPointer:
1239 if (evinfo->rep.isStart)
1241 xXIGetClientPointerReply *stuff = (xXIGetClientPointerReply *) rep;
1242 REPLY (": Set(%s) deviceid(%d)",
1243 (stuff->set) ? "true":"false",
1256 if (evinfo->rep.isStart)
1258 xXIGetFocusReply *stuff = (xXIGetFocusReply *) rep;
1259 REPLY (": XID(0x%x)",
1270 case X_XIGrabDevice:
1272 if (evinfo->rep.isStart)
1274 xXIGrabDeviceReply *stuff = (xXIGrabDeviceReply *) rep;
1275 REPLY (": status(%d)",
1286 case X_XIPassiveGrabDevice:
1288 if (evinfo->rep.isStart)
1290 xXIPassiveGrabDeviceReply *stuff = (xXIPassiveGrabDeviceReply *) rep;
1291 REPLY (": numModifiers(%d)",
1292 stuff->num_modifiers);
1302 case X_XIListProperties:
1304 if (evinfo->rep.isStart)
1306 xXIListPropertiesReply *stuff = (xXIListPropertiesReply *) rep;
1307 REPLY (": numProperties(%d)",
1308 stuff->num_properties);
1312 Atom *stuff = (Atom *)rep;
1315 REPLY ("Properties(");
1316 for (i = 0 ; i < evinfo->rep.size / sizeof(Atom) ; i ++)
1318 reply = xDbgGetAtom(stuff[i], evinfo, reply, len);
1319 if(i != evinfo->rep.size / sizeof(Atom) - 1)
1328 case X_XIGetProperty:
1330 if (evinfo->rep.isStart)
1332 xXIGetPropertyReply *stuff = (xXIGetPropertyReply *) rep;
1335 xDbgGetAtom(stuff->type, evinfo, reply, len);
1337 REPLY (" numItems(%d) format(%d)",
1357 xDbgEvlogXinputGetBase (ExtensionInfo *extinfo)
1360 RETURN_IF_FAIL (extinfo != NULL);
1362 extinfo->req_func = _EvlogRequestXinput;
1363 extinfo->evt_func = _EvlogEventXinput;
1364 extinfo->rep_func = _EvlogReplyXinput;
1366 ExtensionEntry *xext = CheckExtension (INAME);
1367 RETURN_IF_FAIL (xext != NULL);
1368 RETURN_IF_FAIL (extinfo != NULL);
1370 extinfo->opcode = xext->base;
1371 extinfo->evt_base = xext->eventBase;
1372 extinfo->err_base = xext->errorBase;
1373 extinfo->req_func = _EvlogRequestXinput;
1374 extinfo->evt_func = _EvlogEventXinput;
1375 extinfo->rep_func = _EvlogReplyXinput;