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/gesture.h>
55 #include <X11/extensions/gestureproto.h>
58 #include "xdbg_types.h"
59 #include "xdbg_evlog_gesture.h"
60 #include "xdbg_evlog.h"
63 _EvlogRequestGesture(EvlogInfo *evinfo, char *reply, int *len)
65 xReq *req = evinfo->req.ptr;
69 case X_GestureSelectEvents:
71 xGestureSelectEventsReq *stuff = (xGestureSelectEventsReq *)req;
72 REPLY (": XID(0x%lx)",
78 case X_GestureGetSelectedEvents:
80 xGestureGetSelectedEventsReq *stuff = (xGestureGetSelectedEventsReq *)req;
81 REPLY (": XID(0x%lx)",
87 case X_GestureGrabEvent:
89 xGestureGrabEventReq *stuff = (xGestureGrabEventReq *)req;
90 REPLY (": XID(0x%lx) EventType(0x%lx), Num_finger(%d)",
98 case X_GestureUngrabEvent:
100 xGestureUngrabEventReq *stuff = (xGestureUngrabEventReq *)req;
101 REPLY (": XID(0x%lx) EventType(0x%lx), Num_finger(%d)",
117 _EvlogEventGesture (EvlogInfo *evinfo, int first_base, char *reply, int *len)
119 xEvent *evt = evinfo->evt.ptr;
121 switch ((evt->u.u.type & 0x7F) - first_base)
123 case GestureNotifyFlick:
125 xGestureNotifyFlickEvent *stuff = (xGestureNotifyFlickEvent *) evt;
126 REPLY (": XID(0x%lx) Direction(%d) Distance(%d) Duration(%ldms) Angle(0x%lx)",
136 case GestureNotifyPan:
138 xGestureNotifyPanEvent *stuff = (xGestureNotifyPanEvent *) evt;
139 REPLY (": XID(0x%lx) Direction(%d) Distance(%d) Duration(%ldms) coord(%d,%d)",
150 case GestureNotifyPinchRotation:
152 xGestureNotifyPinchRotationEvent *stuff = (xGestureNotifyPinchRotationEvent *) evt;
153 REPLY (": XID(0x%lx) Distance(%d) Coord(%d,%d) Zoom(0x%lx) Angle(0x%lx)",
164 case GestureNotifyTap:
166 xGestureNotifyTapEvent *stuff = (xGestureNotifyTapEvent *) evt;
167 REPLY (": XID(0x%lx) Coord(%d,%d) tapRepeat(%d) Interval(%ldms)",
177 case GestureNotifyTapNHold:
179 xGestureNotifyTapNHoldEvent *stuff = (xGestureNotifyTapNHoldEvent *) evt;
180 REPLY (": XID(0x%lx) Coord(%d,%d) Interval(%ldms) Holdtime(%ldms)",
190 case GestureNotifyHold:
192 xGestureNotifyHoldEvent *stuff = (xGestureNotifyHoldEvent *) evt;
193 REPLY (": XID(0x%lx) Coord(%d,%d) Holdtime(%ldms)",
202 case GestureNotifyGroup:
204 xGestureNotifyGroupEvent *stuff = (xGestureNotifyGroupEvent *) evt;
205 REPLY (": XID(0x%lx) groupID(%d) groupNum(%d)",
221 _EvlogReplyGesture (EvlogInfo *evinfo, char *reply, int *len)
224 xGenericReply *rep = evinfo->rep.ptr;
226 switch (evinfo->rep.reqData)
237 xDbgEvlogGestureGetBase (ExtensionInfo *extinfo)
240 RETURN_IF_FAIL (extinfo != NULL);
242 extinfo->req_func = _EvlogRequestGesture;
243 extinfo->evt_func = _EvlogEventGesture;
244 extinfo->rep_func = _EvlogReplyGesture;
246 ExtensionEntry *xext = CheckExtension (GESTURE_EXT_NAME);
247 RETURN_IF_FAIL (xext != NULL);
248 RETURN_IF_FAIL (extinfo != NULL);
250 extinfo->opcode = xext->base;
251 extinfo->evt_base = xext->eventBase;
252 extinfo->err_base = xext->errorBase;
253 extinfo->req_func = _EvlogRequestGesture;
254 extinfo->evt_func = _EvlogEventGesture;
255 extinfo->rep_func = _EvlogReplyGesture;