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>
54 #include <X11/extensions/XI2proto.h>
56 #include "xdbg_types.h"
57 #include "xdbg_evlog_core.h"
59 char * xDbgEvlogRequestCore (xReq *req, char *reply, int *len)
63 switch (stuff->reqType)
67 xCreateWindowReq *stuff = (xCreateWindowReq *)req;
69 REPLY (": Window(0x%lx) Parent(0x%lx) size(%dx%d) boaderWid(%d) coordinate(%d,%d)",
81 case X_ChangeWindowAttributes:
83 xChangeWindowAttributesReq *stuff = (xChangeWindowAttributesReq *)req;
84 REPLY (": XID(0x%lx)",
92 xChangeSaveSetReq *stuff = (xChangeSaveSetReq *)req;
93 REPLY (": XID(0x%lx)",
99 case X_ReparentWindow:
101 xReparentWindowReq *stuff = (xReparentWindowReq *)req;
102 REPLY (": Window(0x%lx) Parent(0x%lx) coord(%d,%d)",
111 case X_ConfigureWindow:
113 xConfigureWindowReq *stuff = (xConfigureWindowReq *)req;
114 REPLY (": XID(0x%lx)",
120 case X_CirculateWindow:
122 xCirculateWindowReq *stuff = (xCirculateWindowReq *)req;
123 REPLY (": XID(0x%lx)",
129 case X_ChangeProperty:
131 xChangePropertyReq *stuff = (xChangePropertyReq *)req;
132 REPLY (": XID(0x%lx) Property(0x%lx) Type(0x%lx)",
140 case X_DeleteProperty:
142 xDeletePropertyReq *stuff = (xDeletePropertyReq *)req;
143 REPLY (": XID(0x%lx) Property(0x%lx)",
150 case X_SetSelectionOwner:
152 xSetSelectionOwnerReq *stuff = (xSetSelectionOwnerReq *)req;
153 REPLY (": XID(0x%lx) Selection(0x%lx)",
160 case X_ConvertSelection:
162 xConvertSelectionReq *stuff = (xConvertSelectionReq *)req;
163 REPLY (": XID(0x%lx) Selection(0x%lx) Target(0x%lx) Property(0x%lx)",
174 xSendEventReq *stuff = (xSendEventReq *)req;
175 REPLY (": XID(0x%lx)",
183 xGrabPointerReq *stuff = (xGrabPointerReq *)req;
184 REPLY (": XID(0x%lx) ConfineTo(0x%lx) Cursor(0x%lx)",
194 xGrabButtonReq *stuff = (xGrabButtonReq *)req;
195 REPLY (": XID(0x%lx) ConfineTo(0x%lx) Cursor(0x%lx)",
205 xUngrabButtonReq *stuff = (xUngrabButtonReq *)req;
206 REPLY (": XID(0x%lx)",
212 case X_ChangeActivePointerGrab:
214 xChangeActivePointerGrabReq *stuff = (xChangeActivePointerGrabReq *)req;
215 REPLY (": Cursor(0x%lx)",
223 xGrabKeyboardReq *stuff = (xGrabKeyboardReq *)req;
224 REPLY (": XID(0x%lx)",
232 xGrabKeyReq *stuff = (xGrabKeyReq *)req;
233 REPLY (": XID(0x%lx)",
241 xUngrabKeyReq *stuff = (xUngrabKeyReq *)req;
242 REPLY (": XID(0x%lx)",
248 case X_SetInputFocus:
250 xSetInputFocusReq *stuff = (xSetInputFocusReq *)req;
251 REPLY (": XID(0x%lx)",
259 xCreatePixmapReq *stuff = (xCreatePixmapReq *)req;
260 REPLY (": Pixmap(0x%lx) Drawable(0x%lx) size(%dx%d)",
271 xClearAreaReq *stuff = (xClearAreaReq *)req;
272 REPLY (": XID(0x%lx) area(%d,%d %dx%d)",
284 xCopyAreaReq *stuff = (xCopyAreaReq *)req;
285 REPLY (": srcXID(0x%lx) dstXID(0x%lx) gc(0x%lx) size(%dx%d) src(%d,%d) dst(%d,%d)",
301 xCopyPlaneReq *stuff = (xCopyPlaneReq *)req;
302 REPLY (": srcXID(0x%lx) dstXID(0x%lx) gc(0x%lx) size(%dx%d) src(%d,%d) dst(%d,%d)",
318 xPolyPointReq *stuff = (xPolyPointReq *)req;
319 REPLY (": XID(0x%lx) gc(0x%lx)",
328 xPolyLineReq *stuff = (xPolyLineReq *)req;
329 REPLY (": XID(0x%lx gc(0x%lx)",
338 xPolySegmentReq *stuff = (xPolySegmentReq *)req;
339 REPLY (": XID(0x%lx) gc(0x%lx)",
346 case X_PolyRectangle:
348 xPolyRectangleReq *stuff = (xPolyRectangleReq *)req;
349 REPLY (": XID(0x%lx) gc(0x%lx)",
358 xPolyArcReq *stuff = (xPolyArcReq *)req;
359 REPLY (": XID(0x%lx) gc(0x%lx)",
368 xFillPolyReq *stuff = (xFillPolyReq *)req;
369 REPLY (": XID(0x%lx) gc(0x%lx)",
376 case X_PolyFillRectangle:
378 xPolyFillRectangleReq *stuff = (xPolyFillRectangleReq *)req;
379 REPLY (": XID(0x%lx) gc(0x%lx)",
388 xPolyFillArcReq *stuff = (xPolyFillArcReq *)req;
389 REPLY (": XID(0x%lx) gc(0x%lx)",
398 xPutImageReq *stuff = (xPutImageReq *)req;
399 REPLY (": XID(0x%lx) gc(0x%lx) size(%dx%d) dst(%d,%d)",
411 xGetImageReq *stuff = (xGetImageReq *)req;
412 REPLY (": XID(0x%lx) size(%dx%d) dst(%d,%d)",
424 xPolyText8Req *stuff = (xPolyText8Req *)req;
425 REPLY (": XID(0x%lx) gc(0x%lx) coord(%d,%d)",
436 xPolyText16Req *stuff = (xPolyText16Req *)req;
437 REPLY (": XID(0x%lx) gc(0x%lx) coord(%d,%d)",
448 xImageText8Req *stuff = (xImageText8Req *)req;
449 REPLY (": XID(0x%lx) gc(0x%lx) coord(%d,%d)",
460 xImageText16Req *stuff = (xImageText16Req *)req;
461 REPLY (": XID(0x%lx) gc(0x%lx) coord(%d,%d)",
470 case X_ChangeKeyboardMapping:
472 xChangeKeyboardMappingReq *stuff = (xChangeKeyboardMappingReq *)req;
473 REPLY (": Key(%d) FstKey(%d) KeySyms(%d)",
476 stuff->keySymsPerKeyCode);
481 case X_GetKeyboardMapping:
483 xGetKeyboardMappingReq *stuff = (xGetKeyboardMappingReq *)req;
484 REPLY (": FstKey(%d) Count(%d)",
491 case X_ChangePointerControl:
493 xChangePointerControlReq *stuff = (xChangePointerControlReq *)req;
494 REPLY (": accelNum(%d) accelDenum(%d) threshold(%d)",
502 case X_SetPointerMapping:
504 xSetPointerMappingReq *stuff = (xSetPointerMappingReq *)req;
511 case X_SetModifierMapping:
513 xSetModifierMappingReq *stuff =(xSetModifierMappingReq *)req;
514 REPLY (": NumkeyPerModifier(%d)",
515 stuff->numKeyPerModifier);
520 case X_DestroyWindow:
521 case X_DestroySubwindows:
523 case X_MapSubwindows:
525 case X_UnmapSubwindows:
528 case X_UngrabPointer:
529 case X_UngrabKeyboard:
533 xResourceReq *stuff = (xResourceReq *)req;
534 REPLY (": XID(0x%lx)",
548 char * xDbgEvlogEventCore (xEvent *evt, char *reply, int *len)
550 switch (evt->u.u.type & 0x7F)
558 REPLY (": Root(0x%lx %d,%d) Event(0x%lx %d,%d) Child(0x%lx)",
559 evt->u.keyButtonPointer.root,
560 evt->u.keyButtonPointer.rootX,
561 evt->u.keyButtonPointer.rootY,
562 evt->u.keyButtonPointer.event,
563 evt->u.keyButtonPointer.eventX,
564 evt->u.keyButtonPointer.eventY,
565 evt->u.keyButtonPointer.child);
573 REPLY (": Root(0x%lx %d,%d) Event(0x%lx %d,%d) Child(0x%lx)",
574 evt->u.enterLeave.root,
575 evt->u.enterLeave.rootX,
576 evt->u.enterLeave.rootY,
577 evt->u.enterLeave.event,
578 evt->u.enterLeave.eventX,
579 evt->u.enterLeave.eventY,
580 evt->u.enterLeave.child);
589 REPLY (": XID(0x%lx)",
590 evt->u.focus.window);
597 REPLY (": XID(0x%lx) size(%dx%d) coord(%d,%d)",
598 evt->u.expose.window,
600 evt->u.expose.height,
609 REPLY (": XID(0x%lx) size(%dx%d) coord(%d,%d)",
610 evt->u.graphicsExposure.drawable,
611 evt->u.graphicsExposure.width,
612 evt->u.graphicsExposure.height,
613 evt->u.graphicsExposure.x,
614 evt->u.graphicsExposure.y);
621 REPLY (": XID(0x%lx)",
622 evt->u.noExposure.drawable);
628 case VisibilityNotify:
630 REPLY (": XID(0x%lx)",
631 evt->u.visibility.window);
638 REPLY (": Window(0x%lx) Parent(0x%lx) size(%dx%d) coord(%d,%d) borderWidth(%d)",
639 evt->u.createNotify.window,
640 evt->u.createNotify.parent,
641 evt->u.createNotify.width,
642 evt->u.createNotify.height,
643 evt->u.createNotify.x,
644 evt->u.createNotify.y,
645 evt->u.createNotify.borderWidth);
652 REPLY (": Window(0x%lx) Event(0x%lx)",
653 evt->u.destroyNotify.window,
654 evt->u.destroyNotify.event);
661 REPLY (": Window(0x%lx) Event(0x%lx)",
662 evt->u.unmapNotify.window,
663 evt->u.unmapNotify.event);
670 REPLY (": Window(0x%lx) Event(0x%lx)",
671 evt->u.mapNotify.window,
672 evt->u.mapNotify.event);
679 REPLY (": Window(0x%lx) Parent(0x%lx)",
680 evt->u.mapRequest.window,
681 evt->u.mapRequest.parent);
688 REPLY (": Window(0x%lx) Event(0x%lx) parent(0x%lx) coord(%d,%d)",
689 evt->u.reparent.window,
690 evt->u.reparent.event,
691 evt->u.reparent.parent,
698 case ConfigureNotify:
700 REPLY (": Window(0x%lx) Event(0x%lx) aboveSibling(0x%lx) size(%dx%d) coord(%d,%d) borderWidth(%d)",
701 evt->u.configureNotify.window,
702 evt->u.configureNotify.event,
703 evt->u.configureNotify.aboveSibling,
704 evt->u.configureNotify.width,
705 evt->u.configureNotify.height,
706 evt->u.configureNotify.x,
707 evt->u.configureNotify.y,
708 evt->u.configureNotify.borderWidth);
713 case ConfigureRequest:
715 REPLY (": Window(0x%lx) Parent(0x%lx) Sibling(0x%lx) size(%dx%d) coord(%d,%d) borderWidth(%d)",
716 evt->u.configureRequest.window,
717 evt->u.configureRequest.parent,
718 evt->u.configureRequest.sibling,
719 evt->u.configureRequest.width,
720 evt->u.configureRequest.height,
721 evt->u.configureRequest.x,
722 evt->u.configureRequest.y,
723 evt->u.configureRequest.borderWidth);
730 REPLY (": Window(0x%lx) Event(0x%lx) coord(%d,%d)",
731 evt->u.gravity.window,
732 evt->u.gravity.event,
741 REPLY (": Window(0x%lx) size(%dx%d)",
742 evt->u.resizeRequest.window,
743 evt->u.resizeRequest.width,
744 evt->u.resizeRequest.height);
749 case CirculateNotify:
750 case CirculateRequest:
752 REPLY (": Window(0x%lx) Event(0x%lx) parent(0x%lx)",
753 evt->u.circulate.window,
754 evt->u.circulate.event,
755 evt->u.circulate.parent);
762 REPLY (": Window(0x%lx) atom(0x%lx)",
763 evt->u.property.window,
764 evt->u.property.atom);
771 REPLY (": Window(0x%lx) atom(0x%lx)",
772 evt->u.selectionClear.window,
773 evt->u.selectionClear.atom);
778 case SelectionRequest:
780 REPLY (": Owner(0x%lx) Requestor(0x%lx) Selcection(0x%lx) Target(0x%lx) Property(0x%lx)",
781 evt->u.selectionRequest.owner,
782 evt->u.selectionRequest.requestor,
783 evt->u.selectionRequest.selection,
784 evt->u.selectionRequest.target,
785 evt->u.selectionRequest.property);
790 case SelectionNotify:
792 REPLY (": Requestor(0x%lx) Selcection(0x%lx) Target(0x%lx) Property(0x%lx)",
793 evt->u.selectionNotify.requestor,
794 evt->u.selectionNotify.selection,
795 evt->u.selectionNotify.target,
796 evt->u.selectionNotify.property);
803 REPLY (": XID(0x%lx) Colormap(0x%lx)",
804 evt->u.colormap.window,
805 evt->u.colormap.colormap);
812 REPLY (": XID(0x%lx) Atom(0x%lx)",
813 evt->u.clientMessage.window,
814 evt->u.clientMessage.u.b.type);