summaryrefslogtreecommitdiff
path: root/src/lib/evas/gesture
diff options
context:
space:
mode:
authorsmohanty <smohantty@gmail.com>2017-09-19 17:05:48 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-10-19 10:33:12 +0900
commit4b997e89e5609e07c4ea88516495db34abc39f7d (patch)
tree15e114899db8a5b907af9d67889f01dea2fb85ef /src/lib/evas/gesture
parent5af499b01b6448cd669d35330e6981e8a87ed43c (diff)
evas/gesture: added recognizer and tap recognizer implementation
Diffstat (limited to 'src/lib/evas/gesture')
-rw-r--r--src/lib/evas/gesture/efl_gesture_recognizer.c22
-rw-r--r--src/lib/evas/gesture/efl_gesture_recognizer_tap.c14
2 files changed, 30 insertions, 6 deletions
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer.c b/src/lib/evas/gesture/efl_gesture_recognizer.c
new file mode 100644
index 0000000..f25590a
--- /dev/null
+++ b/src/lib/evas/gesture/efl_gesture_recognizer.c
@@ -0,0 +1,22 @@
1#include "efl_gesture_private.h"
2
3#define MY_CLASS EFL_GESTURE_RECOGNIZER_CLASS
4
5
6EOLIAN static Eina_Value *
7_efl_gesture_recognizer_config_get(Eo *obj EINA_UNUSED, Efl_Gesture_Recognizer_Data *pd, const char *name)
8{
9 return efl_gesture_manager_config_get(pd->manager, name);
10}
11
12
13EOLIAN static void
14_efl_gesture_recognizer_reset(Eo *obj EINA_UNUSED, Efl_Gesture_Recognizer_Data *pd EINA_UNUSED,
15 Efl_Gesture *gesture EINA_UNUSED)
16{
17
18}
19
20#include "efl_gesture_recognizer.eo.c"
21
22
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer_tap.c b/src/lib/evas/gesture/efl_gesture_recognizer_tap.c
index e89106c..37456a9 100644
--- a/src/lib/evas/gesture/efl_gesture_recognizer_tap.c
+++ b/src/lib/evas/gesture/efl_gesture_recognizer_tap.c
@@ -21,10 +21,10 @@ _efl_gesture_recognizer_tap_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Gestu
21} 21}
22 22
23EOLIAN static Efl_Gesture * 23EOLIAN static Efl_Gesture *
24_efl_gesture_recognizer_tap_efl_gesture_recognizer_create(Eo *obj EINA_UNUSED, Efl_Gesture_Recognizer_Tap_Data *pd EINA_UNUSED, 24_efl_gesture_recognizer_tap_efl_gesture_recognizer_create(Eo *obj, Efl_Gesture_Recognizer_Tap_Data *pd EINA_UNUSED,
25 Efl_Object *target EINA_UNUSED) 25 Efl_Object *target EINA_UNUSED)
26{ 26{
27 return efl_add(EFL_GESTURE_TAP_CLASS, NULL); 27 return efl_add(EFL_GESTURE_TAP_CLASS, obj);
28} 28}
29 29
30EOLIAN static Efl_Gesture_Recognizer_Result 30EOLIAN static Efl_Gesture_Recognizer_Result
@@ -34,6 +34,7 @@ _efl_gesture_recognizer_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_UNUSED
34 Efl_Gesture_Touch *event EINA_UNUSED) 34 Efl_Gesture_Touch *event EINA_UNUSED)
35{ 35{
36 double dist_x, dist_y, length, x, y; 36 double dist_x, dist_y, length, x, y;
37 Eina_Vector2 pos;
37 Efl_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL; 38 Efl_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL;
38 39
39 switch (efl_gesture_touch_state_get(event)) 40 switch (efl_gesture_touch_state_get(event))
@@ -41,8 +42,9 @@ _efl_gesture_recognizer_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_UNUSED
41 case EFL_GESTURE_TOUCH_BEGIN: 42 case EFL_GESTURE_TOUCH_BEGIN:
42 { 43 {
43 efl_gesture_touch_start_point(event, &x, &y); 44 efl_gesture_touch_start_point(event, &x, &y);
44 efl_gesture_tap_position_set(gesture, EINA_POSITION2D(x, y)); 45 eina_vector2_set(&pos, x, y);
45 efl_gesture_hotspot_set(gesture, EINA_POSITION2D(x, y)); 46 efl_gesture_tap_position_set(gesture, pos);
47 efl_gesture_hotspot_set(gesture, pos);
46 result = EFL_GESTURE_TRIGGER; 48 result = EFL_GESTURE_TRIGGER;
47 break; 49 break;
48 } 50 }
@@ -77,7 +79,7 @@ _efl_gesture_recognizer_tap_efl_gesture_recognizer_reset(Eo *obj,
77{ 79{
78 Efl_Gesture_Tap_Data *tap; 80 Efl_Gesture_Tap_Data *tap;
79 tap = efl_data_scope_get(gesture, EFL_GESTURE_TAP_CLASS); 81 tap = efl_data_scope_get(gesture, EFL_GESTURE_TAP_CLASS);
80 tap->pos = EINA_POSITION2D(0, 0); 82 eina_vector2_set(&tap->pos, 0, 0);
81 efl_gesture_recognizer_reset(efl_super(obj, MY_CLASS), gesture); 83 efl_gesture_recognizer_reset(efl_super(obj, MY_CLASS), gesture);
82} 84}
83 85