From 3d8678ab862476b8451944a61af3459ca34ed5a2 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Thu, 4 Oct 2012 05:56:59 +0000 Subject: [PATCH] ecore: add ecore_x_input_raw_select and friends. SVN revision: 77404 --- legacy/ecore/ChangeLog | 4 ++ legacy/ecore/NEWS | 21 ++++--- legacy/ecore/src/lib/ecore_x/Ecore_X.h | 5 ++ .../src/lib/ecore_x/xcb/ecore_xcb_events.c | 8 +++ legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c | 8 +++ .../ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c | 55 +++++++++++++++++++ 6 files changed, 92 insertions(+), 9 deletions(-) diff --git a/legacy/ecore/ChangeLog b/legacy/ecore/ChangeLog index c4b16ca509..0277282c79 100644 --- a/legacy/ecore/ChangeLog +++ b/legacy/ecore/ChangeLog @@ -977,3 +977,7 @@ 2012-10-03 Daniel Wilmann * Fix memory allocation size in ecore_x xcb randr function + +2012-10-04 Cedric Bail + + * Add ecore_x_input_raw_select and ECORE_X_RAW_*. diff --git a/legacy/ecore/NEWS b/legacy/ecore/NEWS index efd4455306..34b08b0a78 100644 --- a/legacy/ecore/NEWS +++ b/legacy/ecore/NEWS @@ -7,15 +7,13 @@ Additions: * ecore_con: - Add Ecore_Con_Eet API to help using Eet_Data with Ecore_Con. * ecore_x: - - ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP - - ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN - - Fix ecore_x_randr to actually return outputs properly. - - Fix ecore_x_randr to actually return crtcs properly. - - Fix ecore_x_randr to actually return crtcs possible outputs properly. - - Fix ecore_x_randr to actually return crtcs outputs properly. + - ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP. + - ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN. + - ecore_x_input_raw_select. + - ECORE_X_RAW_MOTION, ECORE_X_RAW_BUTTON_PRESS and ECORE_X_RAW_BUTTON_RELEASE. * ecore_imf: - - Add ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN - - Add ECORE_IMF_PREEDIT_TYPE_SUB4~7 style + - ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN. + - ECORE_IMF_PREEDIT_TYPE_SUB4~7 style. Fixes: * ecore_con_url: @@ -23,9 +21,14 @@ Fixes: completion callback). * ecore_evas rotation handling on some driver implementations * ecore_file_escape_name() escape taba nd newline right. - * ecore_x_image_is_argb32_get() returns correctly given endianness. * ecore_imf ibus module potential segv fixed. * ecore_thread_feedback() memory allocation and corruption fixed. + * ecore_x: + - ecore_x_image_is_argb32_get() returns correctly given endianness. + - ecore_x_randr to actually return outputs properly. + - ecore_x_randr to actually return crtcs properly. + - ecore_x_randr to actually return crtcs possible outputs properly. + - ecore_x_randr to actually return crtcs outputs properly. Improvements: diff --git a/legacy/ecore/src/lib/ecore_x/Ecore_X.h b/legacy/ecore/src/lib/ecore_x/Ecore_X.h index aafe392136..b3cb89513a 100644 --- a/legacy/ecore/src/lib/ecore_x/Ecore_X.h +++ b/legacy/ecore/src/lib/ecore_x/Ecore_X.h @@ -1068,6 +1068,10 @@ EAPI extern int ECORE_X_LOCK_NUM; EAPI extern int ECORE_X_LOCK_CAPS; EAPI extern int ECORE_X_LOCK_SHIFT; +EAPI extern int ECORE_X_RAW_BUTTON_PRESS; /**< @since 1.8 */ +EAPI extern int ECORE_X_RAW_BUTTON_RELEASE; /**< @since 1.8 */ +EAPI extern int ECORE_X_RAW_MOTION; /**< @since 1.8 */ + typedef enum _Ecore_X_WM_Protocol { /** If enabled the window manager will be asked to send a @@ -2229,6 +2233,7 @@ EAPI Eina_Bool ecore_x_image_is_argb32_get(Ecore_X_Image *im); EAPI Eina_Bool ecore_x_image_to_argb_convert(void *src, int sbpp, int sbpl, Ecore_X_Colormap c, Ecore_X_Visual v, int x, int y, int w, int h, unsigned int *dst, int dbpl, int dx, int dy); EAPI Eina_Bool ecore_x_input_multi_select(Ecore_X_Window win); +EAPI Eina_Bool ecore_x_input_raw_select(Ecore_X_Window win); /**< @since 1.8 */ EAPI Eina_Bool ecore_x_vsync_animator_tick_source_set(Ecore_X_Window win); diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c index 9ccd52c3af..1763397a26 100644 --- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c +++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_events.c @@ -184,6 +184,10 @@ EAPI int ECORE_X_EVENT_XKB_STATE_NOTIFY = 0; EAPI int ECORE_X_EVENT_XKB_NEWKBD_NOTIFY = 0; EAPI int ECORE_X_EVENT_GENERIC = 0; +EAPI int ECORE_X_RAW_BUTTON_PRESS = 0; +EAPI int ECORE_X_RAW_BUTTON_RELEASE = 0; +EAPI int ECORE_X_RAW_MOTION = 0; + void _ecore_xcb_events_init(void) { @@ -248,6 +252,10 @@ _ecore_xcb_events_init(void) ECORE_X_EVENT_XKB_STATE_NOTIFY = ecore_event_type_new(); ECORE_X_EVENT_XKB_NEWKBD_NOTIFY = ecore_event_type_new(); ECORE_X_EVENT_GENERIC = ecore_event_type_new(); + + ECORE_X_RAW_BUTTON_PRESS = ecore_event_type_new(); + ECORE_X_RAW_BUTTON_RELEASE = ecore_event_type_new(); + ECORE_X_RAW_MOTION = ecore_event_type_new(); } } 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 294747b728..7cb777d0cd 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; EAPI int ECORE_X_LOCK_CAPS = 0; EAPI int ECORE_X_LOCK_SHIFT = 0; +EAPI int ECORE_X_RAW_BUTTON_PRESS = 0; +EAPI int ECORE_X_RAW_BUTTON_RELEASE = 0; +EAPI int ECORE_X_RAW_MOTION = 0; + #ifdef LOGRT static double t0 = 0.0; static Status (*_logrt_real_reply)(Display *disp, @@ -612,6 +616,10 @@ ecore_x_init(const char *name) ECORE_X_EVENT_XKB_NEWKBD_NOTIFY = ecore_event_type_new(); ECORE_X_EVENT_GENERIC = ecore_event_type_new(); + + ECORE_X_RAW_BUTTON_PRESS = ecore_event_type_new(); + ECORE_X_RAW_BUTTON_RELEASE = ecore_event_type_new(); + ECORE_X_RAW_MOTION = ecore_event_type_new(); } _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 fbfbd43583..b27870c674 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) { #ifdef ECORE_XI2 XIDeviceEvent *evd = (XIDeviceEvent *)(xevent->xcookie.data); + /* XIRawEvent *evr = (XIRawEvent *)(xevent->xcookie.data); */ int devid = evd->deviceid; int i; + /* No filter for this events */ + switch (xevent->xcookie.evtype) + { +#ifdef XI_RawButtonPress + case XI_RawButtonPress: + ecore_event_add(ECORE_X_RAW_BUTTON_PRESS, NULL, NULL, NULL); + break; +#endif +#ifdef XI_RawButtonRelease + case XI_RawButtonRelease: + ecore_event_add(ECORE_X_RAW_BUTTON_RELEASE, NULL, NULL, NULL); + break; +#endif +#ifdef XI_RawMotion + case XI_RawMotion: + ecore_event_add(ECORE_X_RAW_MOTION, NULL, NULL, NULL); + break; +#endif + } + if (_ecore_x_xi2_devs) { for (i = 0; i < _ecore_x_xi2_num; i++) @@ -281,3 +302,37 @@ ecore_x_input_multi_select(Ecore_X_Window win) #endif /* ifdef ECORE_XI2 */ } +EAPI Eina_Bool +ecore_x_input_raw_select(Ecore_X_Window win) +{ +#ifdef ECORE_XI2 + XIEventMask emask; + int i; + Eina_Bool find = EINA_FALSE; + unsigned char mask[4] = { 0 }; + + if (!_ecore_x_xi2_devs) + return EINA_FALSE; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + emask.deviceid = XIAllMasterDevices; + emask.mask_len = sizeof(mask); + emask.mask = mask; +#ifdef XI_RawButtonPress + XISetMask(emask.mask, XI_RawButtonPress); +#endif +#ifdef XI_RawButtonRelease + XISetMask(emask.mask, XI_RawButtonRelease); +#endif +#ifdef XI_RawMotion + XISetMask(emask.mask, XI_RawMotion); +#endif + + XISelectEvents(_ecore_x_disp, win, &emask, 1); + + return EINA_TRUE; +#else + return EINA_FALSE; +#endif +} +