aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_input.c')
-rw-r--r--legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_input.c269
1 files changed, 138 insertions, 131 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_input.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_input.c
index 83a51ff558..c0338c22a5 100644
--- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_input.c
+++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_input.c
@@ -27,8 +27,8 @@ static Eina_Bool _input_avail = EINA_FALSE;
/* external variables */
int _ecore_xcb_event_input = 0;
-void
-_ecore_xcb_input_init(void)
+void
+_ecore_xcb_input_init(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -37,8 +37,8 @@ _ecore_xcb_input_init(void)
#endif
}
-void
-_ecore_xcb_input_finalize(void)
+void
+_ecore_xcb_input_finalize(void)
{
#ifdef ECORE_XCB_XINPUT
xcb_input_get_extension_version_cookie_t cookie;
@@ -49,38 +49,38 @@ _ecore_xcb_input_finalize(void)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
#ifdef ECORE_XCB_XINPUT
- cookie =
+ cookie =
xcb_input_get_extension_version_unchecked(_ecore_xcb_conn, 127, buff);
- reply =
+ reply =
xcb_input_get_extension_version_reply(_ecore_xcb_conn, cookie, NULL);
- if (reply)
+ if (reply)
{
_input_avail = EINA_TRUE;
free(reply);
}
- if (_input_avail)
+ if (_input_avail)
{
const xcb_query_extension_reply_t *ext_reply;
ext_reply = xcb_get_extension_data(_ecore_xcb_conn, &xcb_input_id);
- if (ext_reply)
+ if (ext_reply)
_ecore_xcb_event_input = ext_reply->first_event;
}
#endif
}
-void
-_ecore_xcb_input_shutdown(void)
+void
+_ecore_xcb_input_shutdown(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
}
-void
+void
#ifdef ECORE_XCB_XINPUT
-_ecore_xcb_input_handle_event(xcb_generic_event_t *event)
+_ecore_xcb_input_handle_event(xcb_generic_event_t *event)
#else
-_ecore_xcb_input_handle_event(xcb_generic_event_t *event __UNUSED__)
+_ecore_xcb_input_handle_event(xcb_generic_event_t * event __UNUSED__)
#endif
{
#ifdef ECORE_XCB_XINPUT
@@ -94,120 +94,126 @@ _ecore_xcb_input_handle_event(xcb_generic_event_t *event __UNUSED__)
* xcb-input lib to test with */
#ifdef ECORE_XCB_XINPUT
ev = (xcb_ge_event_t *)event;
- switch (ev->event_type)
+ switch (ev->event_type)
{
- case XCB_INPUT_DEVICE_MOTION_NOTIFY:
- {
- xcb_input_device_motion_notify_event_t *de;
- unsigned int child_win = 0;
-
- de = (xcb_input_device_motion_notify_event_t *)ev->pad1;
- child_win = (de->child ? de->child : de->event);
- _ecore_xcb_event_mouse_move(de->time, de->state, de->event_x,
- de->event_y, de->root_x, de->root_y,
- de->event, child_win, de->root,
- de->same_screen, de->device_id,
- 1, 1, 1.0, 0.0,
- de->event_x, de->event_y,
- de->root_x, de->root_y);
- }
- break;
- case XCB_INPUT_DEVICE_BUTTON_PRESS:
- {
- xcb_input_device_button_press_event_t *de;
- unsigned int child_win = 0;
-
- de = (xcb_input_device_button_press_event_t *)ev->pad1;
- child_win = (de->child ? de->child : de->event);
- _ecore_xcb_event_mouse_button(ECORE_EVENT_MOUSE_BUTTON_DOWN,
- de->time, de->state, de->detail,
- de->event_x, de->event_y,
- de->root_x, de->root_y, de->event,
- child_win, de->root,
- de->same_screen, de->device_id,
- 1, 1, 1.0, 0.0,
- de->event_x, de->event_y,
- de->root_x, de->root_y);
- }
- break;
- case XCB_INPUT_DEVICE_BUTTON_RELEASE:
- {
- xcb_input_device_button_release_event_t *de;
- unsigned int child_win = 0;
-
- de = (xcb_input_device_button_release_event_t *)ev->pad1;
- child_win = (de->child ? de->child : de->event);
- _ecore_xcb_event_mouse_button(ECORE_EVENT_MOUSE_BUTTON_UP,
- de->time, de->state, de->detail,
- de->event_x, de->event_y,
- de->root_x, de->root_y, de->event,
- child_win, de->root,
- de->same_screen, de->device_id,
- 1, 1, 1.0, 0.0,
- de->event_x, de->event_y,
- de->root_x, de->root_y);
- }
- break;
+ case XCB_INPUT_DEVICE_MOTION_NOTIFY:
+ {
+ xcb_input_device_motion_notify_event_t *de;
+ unsigned int child_win = 0;
+
+ de = (xcb_input_device_motion_notify_event_t *)ev->pad1;
+ child_win = (de->child ? de->child : de->event);
+ _ecore_xcb_event_mouse_move(de->time, de->state, de->event_x,
+ de->event_y, de->root_x, de->root_y,
+ de->event, child_win, de->root,
+ de->same_screen, de->device_id,
+ 1, 1, 1.0, 0.0,
+ de->event_x, de->event_y,
+ de->root_x, de->root_y);
+ }
+ break;
+
+ case XCB_INPUT_DEVICE_BUTTON_PRESS:
+ {
+ xcb_input_device_button_press_event_t *de;
+ unsigned int child_win = 0;
+
+ de = (xcb_input_device_button_press_event_t *)ev->pad1;
+ child_win = (de->child ? de->child : de->event);
+ _ecore_xcb_event_mouse_button(ECORE_EVENT_MOUSE_BUTTON_DOWN,
+ de->time, de->state, de->detail,
+ de->event_x, de->event_y,
+ de->root_x, de->root_y, de->event,
+ child_win, de->root,
+ de->same_screen, de->device_id,
+ 1, 1, 1.0, 0.0,
+ de->event_x, de->event_y,
+ de->root_x, de->root_y);
+ }
+ break;
+
+ case XCB_INPUT_DEVICE_BUTTON_RELEASE:
+ {
+ xcb_input_device_button_release_event_t *de;
+ unsigned int child_win = 0;
+
+ de = (xcb_input_device_button_release_event_t *)ev->pad1;
+ child_win = (de->child ? de->child : de->event);
+ _ecore_xcb_event_mouse_button(ECORE_EVENT_MOUSE_BUTTON_UP,
+ de->time, de->state, de->detail,
+ de->event_x, de->event_y,
+ de->root_x, de->root_y, de->event,
+ child_win, de->root,
+ de->same_screen, de->device_id,
+ 1, 1, 1.0, 0.0,
+ de->event_x, de->event_y,
+ de->root_x, de->root_y);
+ }
+ break;
+
case XCB_INPUT_DEVICE_TOUCH_UPDATE:
- {
- xcb_input_device_motion_notify_event_t *de;
- unsigned int child_win = 0;
-
- de = (xcb_input_device_motion_notify_event_t *)ev->pad1;
- child_win = (de->child ? de->child : de->event);
- _ecore_xcb_event_mouse_move(de->time, de->state, de->event_x,
- de->event_y, de->root_x, de->root_y,
- de->event, child_win, de->root,
- de->same_screen, de->device_id,
- 1, 1, 1.0, 0.0,
- de->event_x, de->event_y,
- de->root_x, de->root_y);
- }
- break;
+ {
+ xcb_input_device_motion_notify_event_t *de;
+ unsigned int child_win = 0;
+
+ de = (xcb_input_device_motion_notify_event_t *)ev->pad1;
+ child_win = (de->child ? de->child : de->event);
+ _ecore_xcb_event_mouse_move(de->time, de->state, de->event_x,
+ de->event_y, de->root_x, de->root_y,
+ de->event, child_win, de->root,
+ de->same_screen, de->device_id,
+ 1, 1, 1.0, 0.0,
+ de->event_x, de->event_y,
+ de->root_x, de->root_y);
+ }
+ break;
+
case XCB_INPUT_DEVICE_TOUCH_BEGIN:
- {
- xcb_input_device_button_press_event_t *de;
- unsigned int child_win = 0;
-
- de = (xcb_input_device_button_press_event_t *)ev->pad1;
- child_win = (de->child ? de->child : de->event);
- _ecore_xcb_event_mouse_button(ECORE_EVENT_MOUSE_BUTTON_DOWN,
- de->time, de->state, de->detail,
- de->event_x, de->event_y,
- de->root_x, de->root_y, de->event,
- child_win, de->root,
- de->same_screen, de->device_id,
- 1, 1, 1.0, 0.0,
- de->event_x, de->event_y,
- de->root_x, de->root_y);
- }
- break;
+ {
+ xcb_input_device_button_press_event_t *de;
+ unsigned int child_win = 0;
+
+ de = (xcb_input_device_button_press_event_t *)ev->pad1;
+ child_win = (de->child ? de->child : de->event);
+ _ecore_xcb_event_mouse_button(ECORE_EVENT_MOUSE_BUTTON_DOWN,
+ de->time, de->state, de->detail,
+ de->event_x, de->event_y,
+ de->root_x, de->root_y, de->event,
+ child_win, de->root,
+ de->same_screen, de->device_id,
+ 1, 1, 1.0, 0.0,
+ de->event_x, de->event_y,
+ de->root_x, de->root_y);
+ }
+ break;
+
case XCB_INPUT_DEVICE_TOUCH_END:
- {
- xcb_input_device_button_release_event_t *de;
- unsigned int child_win = 0;
-
- de = (xcb_input_device_button_release_event_t *)ev->pad1;
- child_win = (de->child ? de->child : de->event);
- _ecore_xcb_event_mouse_button(ECORE_EVENT_MOUSE_BUTTON_UP,
- de->time, de->state, de->detail,
- de->event_x, de->event_y,
- de->root_x, de->root_y, de->event,
- child_win, de->root,
- de->same_screen, de->device_id,
- 1, 1, 1.0, 0.0,
- de->event_x, de->event_y,
- de->root_x, de->root_y);
- }
- break;
+ {
+ xcb_input_device_button_release_event_t *de;
+ unsigned int child_win = 0;
+
+ de = (xcb_input_device_button_release_event_t *)ev->pad1;
+ child_win = (de->child ? de->child : de->event);
+ _ecore_xcb_event_mouse_button(ECORE_EVENT_MOUSE_BUTTON_UP,
+ de->time, de->state, de->detail,
+ de->event_x, de->event_y,
+ de->root_x, de->root_y, de->event,
+ child_win, de->root,
+ de->same_screen, de->device_id,
+ 1, 1, 1.0, 0.0,
+ de->event_x, de->event_y,
+ de->root_x, de->root_y);
+ }
+ break;
+
default:
break;
}
#endif
}
-EAPI Eina_Bool
-ecore_x_input_multi_select(Ecore_X_Window win)
+EAPI Eina_Bool
+ecore_x_input_multi_select(Ecore_X_Window win)
{
Eina_Bool find = EINA_FALSE;
#ifdef ECORE_XCB_XINPUT
@@ -226,33 +232,33 @@ ecore_x_input_multi_select(Ecore_X_Window win)
* when we can */
#ifdef ECORE_XCB_XINPUT
dcookie = xcb_input_list_input_devices_unchecked(_ecore_xcb_conn);
- dreply =
+ dreply =
xcb_input_list_input_devices_reply(_ecore_xcb_conn, dcookie, NULL);
if (!dreply) return EINA_FALSE;
diter = xcb_input_list_input_devices_devices_iterator(dreply);
- while (diter.rem)
+ while (diter.rem)
{
xcb_input_device_info_t *dev;
- const xcb_input_event_class_t iclass[] =
- {
- XCB_INPUT_DEVICE_BUTTON_PRESS,
- XCB_INPUT_DEVICE_BUTTON_RELEASE,
- XCB_INPUT_DEVICE_MOTION_NOTIFY,
- XCB_INPUT_DEVICE_TOUCH_BEGIN,
- XCB_INPUT_DEVICE_TOUCH_END,
- XCB_INPUT_DEVICE_TOUCH_UPDATE
- };
+ const xcb_input_event_class_t iclass[] =
+ {
+ XCB_INPUT_DEVICE_BUTTON_PRESS,
+ XCB_INPUT_DEVICE_BUTTON_RELEASE,
+ XCB_INPUT_DEVICE_MOTION_NOTIFY,
+ XCB_INPUT_DEVICE_TOUCH_BEGIN,
+ XCB_INPUT_DEVICE_TOUCH_END,
+ XCB_INPUT_DEVICE_TOUCH_UPDATE
+ };
dev = diter.data;
- if (dev->device_use == XCB_INPUT_DEVICE_USE_IS_X_EXTENSION_DEVICE)
+ if (dev->device_use == XCB_INPUT_DEVICE_USE_IS_X_EXTENSION_DEVICE)
{
DBG("Device %d", dev->device_id);
DBG("\tType: %d", dev->device_type);
DBG("\tNum Classes: %d", dev->num_class_info);
DBG("\tUse: %d", dev->device_use);
- xcb_input_select_extension_event(_ecore_xcb_conn, win,
+ xcb_input_select_extension_event(_ecore_xcb_conn, win,
sizeof(iclass) / sizeof(xcb_input_event_class_t),
iclass);
find = EINA_TRUE;
@@ -265,3 +271,4 @@ ecore_x_input_multi_select(Ecore_X_Window win)
return find;
win = 0;
}
+