aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/elementary/test_gesture_framework.c
diff options
context:
space:
mode:
authorsmohanty <smohantty@gmail.com>2017-09-21 09:37:40 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-10-19 10:33:12 +0900
commit023d9a403c761dc2b76bd46c61fcfe4f553b96f1 (patch)
tree11f85e7350d96d2d75f9577b97f9ec5dda428548 /src/bin/elementary/test_gesture_framework.c
parentevas/gesture: Added long_tap gesture to gesture framework (diff)
downloadefl-023d9a403c761dc2b76bd46c61fcfe4f553b96f1.tar.gz
elementary_test: Added test case for log_tap gesture
Diffstat (limited to 'src/bin/elementary/test_gesture_framework.c')
-rw-r--r--src/bin/elementary/test_gesture_framework.c56
1 files changed, 56 insertions, 0 deletions
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);