jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=023d9a403c761dc2b76bd46c61fcfe4f553b96f1
commit 023d9a403c761dc2b76bd46c61fcfe4f553b96f1 Author: smohanty <[email protected]> Date: Thu Sep 21 09:37:40 2017 +0900 elementary_test: Added test case for log_tap gesture --- src/bin/elementary/test_gesture_framework.c | 56 +++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/bin/elementary/test_gesture_framework.c b/src/bin/elementary/test_gesture_framework.c index e09bfa1bed..58e3a51eed 100644 --- a/src/bin/elementary/test_gesture_framework.c +++ b/src/bin/elementary/test_gesture_framework.c @@ -204,6 +204,38 @@ finger_tap_abort(void *data , Efl_Gesture *tap EINA_UNUSED) } static void +finger_long_tap_start(void *data , Efl_Gesture *tap) +{ + Eina_Vector2 pos = efl_gesture_long_tap_position_get(tap); + + _color_and_icon_set(data, LONG_TAP_NAME, 1, MAX_TAP, START_COLOR); + printf("Long Tap Gesture started x,y=<%f,%f> \n", pos.x, pos.y); +} + +static void +finger_long_tap_update(void *data , Efl_Gesture *tap EINA_UNUSED) +{ + _color_and_icon_set(data, LONG_TAP_NAME, 1, MAX_TAP, UPDATE_COLOR); + printf("Long Tap Gesture updated\n"); +} + +static void +finger_long_tap_end(void *data , Efl_Gesture *tap) +{ + Eina_Vector2 pos = efl_gesture_long_tap_position_get(tap); + + _color_and_icon_set(data, LONG_TAP_NAME, 1, MAX_TAP, END_COLOR); + printf("Long Tap Gesture ended x,y=<%f,%f> \n",pos.x, pos.y); +} + +static void +finger_long_tap_abort(void *data , Efl_Gesture *tap EINA_UNUSED) +{ + _color_and_icon_set(data, LONG_TAP_NAME, 1, MAX_TAP, ABORT_COLOR); + printf("Long Tap Aborted\n"); +} + +static void tap_gesture_cb(void *data , const Efl_Event *ev) { Efl_Gesture *g = ev->info; @@ -226,6 +258,29 @@ tap_gesture_cb(void *data , const Efl_Event *ev) } } +static void +long_tap_gesture_cb(void *data , const Efl_Event *ev) +{ + Efl_Gesture *g = ev->info; + switch(efl_gesture_state_get(g)) + { + case EFL_GESTURE_STARTED: + finger_long_tap_start(data, g); + break; + case EFL_GESTURE_UPDATED: + finger_long_tap_update(data, g); + break; + case EFL_GESTURE_CANCELED: + finger_long_tap_abort(data, g); + break; + case EFL_GESTURE_FINISHED: + finger_long_tap_end(data, g); + break; + default: + break; + } +} + /* END - Callbacks for gestures */ static Evas_Object * @@ -411,6 +466,7 @@ test_gesture_framework(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, // LISTEN FOR TAP GESTURE efl_event_callback_add(r, EFL_EVENT_GESTURE_TAP, tap_gesture_cb, infra); + efl_event_callback_add(r, EFL_EVENT_GESTURE_LONG_TAP, long_tap_gesture_cb, infra); /* Update color state 20 times a second */ infra->colortimer = ecore_timer_add(0.05, _icon_color_set_cb, infra->icons); --
