ecore: add ecore_x_input_raw_select and friends.

SVN revision: 77404
This commit is contained in:
Cedric BAIL 2012-10-04 05:56:59 +00:00
parent 67fa000e09
commit 3d8678ab86
6 changed files with 92 additions and 9 deletions

View File

@ -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_*.

View File

@ -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:

View File

@ -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);

View File

@ -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();
}
}

View File

@ -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();

View File

@ -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
}