From: Duna Oh Date: Wed, 6 Apr 2016 09:51:23 +0000 (+0900) Subject: events: handle Ecore_Device X-Git-Tag: accepted/tizen/common/20160407.132146^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ed1bc2ad83f02ea0e5759c630f670ba0745f498;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-gesture.git events: handle Ecore_Device Signed-off-by: Duna Oh Change-Id: Ia11d6c8eeec1cf1efaa8c3b49f8d45ae38aedd57 --- diff --git a/src/e_mod_gesture_events.c b/src/e_mod_gesture_events.c index fe73bf3..72231e5 100644 --- a/src/e_mod_gesture_events.c +++ b/src/e_mod_gesture_events.c @@ -25,10 +25,16 @@ _e_gesture_swipe_cancel(void) } static Eina_Bool -_e_gesture_is_touch_device(const char *identifier) +_e_gesture_is_touch_device(Ecore_Device *dev) { Eina_List *l; char *data; + const char *identifier; + + EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE); + + identifier = ecore_device_identifier_get(dev); + if (!identifier) return EINA_FALSE; EINA_LIST_FOREACH(gesture->touch_devices, l, data) { @@ -82,7 +88,7 @@ _e_gesture_process_device_add(void *event) { Ecore_Event_Device_Info *ev = event; - if (ev->caps & EVDEV_SEAT_TOUCH) + if (ev->clas == ECORE_DEVICE_CLASS_TOUCH) { gesture->touch_devices = eina_list_append(gesture->touch_devices, ev->identifier); GTINF("%s(%s) device is touch device: add list\n", ev->name, ev->identifier); @@ -97,7 +103,7 @@ _e_gesture_process_device_del(void *event) Eina_List *l, *l_next; char *data; - if (ev->caps & EVDEV_SEAT_TOUCH) + if (ev->clas == ECORE_DEVICE_CLASS_TOUCH) { EINA_LIST_FOREACH_SAFE(gesture->touch_devices, l, l_next, data) { @@ -278,7 +284,7 @@ _e_gesture_process_mouse_button_down(void *event) { return EINA_TRUE; } - if (_e_gesture_is_touch_device(ev->dev_name) == EINA_FALSE) + if (_e_gesture_is_touch_device(ev->dev) == EINA_FALSE) { return EINA_TRUE; } @@ -321,7 +327,7 @@ _e_gesture_process_mouse_button_up(void *event) { return EINA_TRUE; } - if (_e_gesture_is_touch_device(ev->dev_name) == EINA_FALSE) + if (_e_gesture_is_touch_device(ev->dev) == EINA_FALSE) { return EINA_TRUE; } @@ -349,7 +355,7 @@ _e_gesture_process_mouse_move(void *event) { return EINA_TRUE; } - if (_e_gesture_is_touch_device(ev->dev_name) == EINA_FALSE) + if (_e_gesture_is_touch_device(ev->dev) == EINA_FALSE) { return EINA_TRUE; }