summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_x/xlib
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2012-10-04 05:56:59 +0000
committerCedric BAIL <cedric.bail@free.fr>2012-10-04 05:56:59 +0000
commit3d8678ab862476b8451944a61af3459ca34ed5a2 (patch)
tree3e73e239fc8da65a971a36500db59b71d317fd45 /legacy/ecore/src/lib/ecore_x/xlib
parent67fa000e0936c2988329590a5bb3ad82e1ceff54 (diff)
ecore: add ecore_x_input_raw_select and friends.
SVN revision: 77404
Diffstat (limited to 'legacy/ecore/src/lib/ecore_x/xlib')
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c8
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c55
2 files changed, 63 insertions, 0 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c
index 294747b..7cb777d 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c
@@ -144,6 +144,10 @@ EAPI int ECORE_X_LOCK_NUM = 0;
144EAPI int ECORE_X_LOCK_CAPS = 0; 144EAPI int ECORE_X_LOCK_CAPS = 0;
145EAPI int ECORE_X_LOCK_SHIFT = 0; 145EAPI int ECORE_X_LOCK_SHIFT = 0;
146 146
147EAPI int ECORE_X_RAW_BUTTON_PRESS = 0;
148EAPI int ECORE_X_RAW_BUTTON_RELEASE = 0;
149EAPI int ECORE_X_RAW_MOTION = 0;
150
147#ifdef LOGRT 151#ifdef LOGRT
148static double t0 = 0.0; 152static double t0 = 0.0;
149static Status (*_logrt_real_reply)(Display *disp, 153static Status (*_logrt_real_reply)(Display *disp,
@@ -612,6 +616,10 @@ ecore_x_init(const char *name)
612 ECORE_X_EVENT_XKB_NEWKBD_NOTIFY = ecore_event_type_new(); 616 ECORE_X_EVENT_XKB_NEWKBD_NOTIFY = ecore_event_type_new();
613 617
614 ECORE_X_EVENT_GENERIC = ecore_event_type_new(); 618 ECORE_X_EVENT_GENERIC = ecore_event_type_new();
619
620 ECORE_X_RAW_BUTTON_PRESS = ecore_event_type_new();
621 ECORE_X_RAW_BUTTON_RELEASE = ecore_event_type_new();
622 ECORE_X_RAW_MOTION = ecore_event_type_new();
615 } 623 }
616 624
617 _ecore_x_modifiers_get(); 625 _ecore_x_modifiers_get();
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c
index fbfbd43..b27870c 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c
@@ -68,9 +68,30 @@ _ecore_x_input_handler(XEvent *xevent)
68{ 68{
69#ifdef ECORE_XI2 69#ifdef ECORE_XI2
70 XIDeviceEvent *evd = (XIDeviceEvent *)(xevent->xcookie.data); 70 XIDeviceEvent *evd = (XIDeviceEvent *)(xevent->xcookie.data);
71 /* XIRawEvent *evr = (XIRawEvent *)(xevent->xcookie.data); */
71 int devid = evd->deviceid; 72 int devid = evd->deviceid;
72 int i; 73 int i;
73 74
75 /* No filter for this events */
76 switch (xevent->xcookie.evtype)
77 {
78#ifdef XI_RawButtonPress
79 case XI_RawButtonPress:
80 ecore_event_add(ECORE_X_RAW_BUTTON_PRESS, NULL, NULL, NULL);
81 break;
82#endif
83#ifdef XI_RawButtonRelease
84 case XI_RawButtonRelease:
85 ecore_event_add(ECORE_X_RAW_BUTTON_RELEASE, NULL, NULL, NULL);
86 break;
87#endif
88#ifdef XI_RawMotion
89 case XI_RawMotion:
90 ecore_event_add(ECORE_X_RAW_MOTION, NULL, NULL, NULL);
91 break;
92#endif
93 }
94
74 if (_ecore_x_xi2_devs) 95 if (_ecore_x_xi2_devs)
75 { 96 {
76 for (i = 0; i < _ecore_x_xi2_num; i++) 97 for (i = 0; i < _ecore_x_xi2_num; i++)
@@ -281,3 +302,37 @@ ecore_x_input_multi_select(Ecore_X_Window win)
281#endif /* ifdef ECORE_XI2 */ 302#endif /* ifdef ECORE_XI2 */
282} 303}
283 304
305EAPI Eina_Bool
306ecore_x_input_raw_select(Ecore_X_Window win)
307{
308#ifdef ECORE_XI2
309 XIEventMask emask;
310 int i;
311 Eina_Bool find = EINA_FALSE;
312 unsigned char mask[4] = { 0 };
313
314 if (!_ecore_x_xi2_devs)
315 return EINA_FALSE;
316
317 LOGFN(__FILE__, __LINE__, __FUNCTION__);
318 emask.deviceid = XIAllMasterDevices;
319 emask.mask_len = sizeof(mask);
320 emask.mask = mask;
321#ifdef XI_RawButtonPress
322 XISetMask(emask.mask, XI_RawButtonPress);
323#endif
324#ifdef XI_RawButtonRelease
325 XISetMask(emask.mask, XI_RawButtonRelease);
326#endif
327#ifdef XI_RawMotion
328 XISetMask(emask.mask, XI_RawMotion);
329#endif
330
331 XISelectEvents(_ecore_x_disp, win, &emask, 1);
332
333 return EINA_TRUE;
334#else
335 return EINA_FALSE;
336#endif
337}
338