summaryrefslogtreecommitdiff
path: root/src/lib/evas/gesture
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-10-19 11:05:28 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-10-19 12:25:57 +0900
commit0a13e15c7d98a8dd41d1270c6acdeb3a0692f33d (patch)
tree2e59ed731e72ee7fc6c2f208889098d6547ae697 /src/lib/evas/gesture
parent20fad2e78ebfe479ffafdf9e7933f7121715f1d4 (diff)
evas/gesture: Fix up a couple of APIs, add some FIXME
Some things have clearly not been tested. Some APIs have not been modified after repeated review comments. C++ failed to build due to "long" being used as a namespace. Remaining issues: - The original finger_list API was broken by design. I didn't try to replace it yet. - Long tap is also broken by design: if no move happens the recognizer gets no event, and doesn't trigger anything when the timeout is reached. An API or event is lacking here. - Only 2 very basic gestures have been implemented. All the gestures from elm_gesture_layer need to be covered. None of the multi touch support has been really implemented, except for a single bool flag. - The configuration must be loaded from elm_config, passed on to the recognizers. - Some micro optimization may be required, especially if the input device is high frequency (eg. 1KHz gaming mouse).
Diffstat (limited to 'src/lib/evas/gesture')
-rw-r--r--src/lib/evas/gesture/efl_gesture.eo2
-rw-r--r--src/lib/evas/gesture/efl_gesture_long_tap.c15
-rw-r--r--src/lib/evas/gesture/efl_gesture_long_tap.eo19
-rw-r--r--src/lib/evas/gesture/efl_gesture_manager.c13
-rw-r--r--src/lib/evas/gesture/efl_gesture_manager.eo12
-rw-r--r--src/lib/evas/gesture/efl_gesture_private.h2
-rw-r--r--src/lib/evas/gesture/efl_gesture_recognizer.c6
-rw-r--r--src/lib/evas/gesture/efl_gesture_recognizer.eo23
-rw-r--r--src/lib/evas/gesture/efl_gesture_recognizer_long_tap.c167
-rw-r--r--src/lib/evas/gesture/efl_gesture_recognizer_long_tap.eo7
-rw-r--r--src/lib/evas/gesture/efl_gesture_recognizer_tap.c109
-rw-r--r--src/lib/evas/gesture/efl_gesture_recognizer_tap.eo8
-rw-r--r--src/lib/evas/gesture/efl_gesture_tap.c14
-rw-r--r--src/lib/evas/gesture/efl_gesture_tap.eo15
-rw-r--r--src/lib/evas/gesture/efl_gesture_touch.c123
-rw-r--r--src/lib/evas/gesture/efl_gesture_touch.eo38
-rw-r--r--src/lib/evas/gesture/efl_gesture_types.eot4
17 files changed, 230 insertions, 347 deletions
diff --git a/src/lib/evas/gesture/efl_gesture.eo b/src/lib/evas/gesture/efl_gesture.eo
index 2fb73c6..145e32a 100644
--- a/src/lib/evas/gesture/efl_gesture.eo
+++ b/src/lib/evas/gesture/efl_gesture.eo
@@ -32,4 +32,4 @@ abstract Efl.Gesture(Efl.Object)
32 } 32 }
33 } 33 }
34 } 34 }
35} \ No newline at end of file 35}
diff --git a/src/lib/evas/gesture/efl_gesture_long_tap.c b/src/lib/evas/gesture/efl_gesture_long_tap.c
index 64f39a4..9c1bd45 100644
--- a/src/lib/evas/gesture/efl_gesture_long_tap.c
+++ b/src/lib/evas/gesture/efl_gesture_long_tap.c
@@ -3,19 +3,6 @@
3#define MY_CLASS EFL_GESTURE_LONG_TAP_CLASS 3#define MY_CLASS EFL_GESTURE_LONG_TAP_CLASS
4 4
5 5
6EOLIAN static void
7_efl_gesture_long_tap_position_set(Eo *obj EINA_UNUSED, Efl_Gesture_Long_Tap_Data *pd,
8 Eina_Vector2 pos)
9{
10 pd->pos = pos;
11}
12
13EOLIAN static Eina_Vector2
14_efl_gesture_long_tap_position_get(Eo *obj EINA_UNUSED, Efl_Gesture_Long_Tap_Data *pd)
15{
16 return pd->pos;
17}
18
19EOLIAN static Efl_Object * 6EOLIAN static Efl_Object *
20_efl_gesture_long_tap_efl_object_constructor(Eo *obj, Efl_Gesture_Long_Tap_Data *pd EINA_UNUSED) 7_efl_gesture_long_tap_efl_object_constructor(Eo *obj, Efl_Gesture_Long_Tap_Data *pd EINA_UNUSED)
21{ 8{
@@ -37,4 +24,4 @@ _efl_gesture_long_tap_efl_object_destructor(Eo *obj, Efl_Gesture_Long_Tap_Data *
37 efl_destructor(efl_super(obj, MY_CLASS)); 24 efl_destructor(efl_super(obj, MY_CLASS));
38} 25}
39 26
40#include "efl_gesture_long_tap.eo.c" \ No newline at end of file 27#include "efl_gesture_long_tap.eo.c"
diff --git a/src/lib/evas/gesture/efl_gesture_long_tap.eo b/src/lib/evas/gesture/efl_gesture_long_tap.eo
index e575199..cb2f4a9 100644
--- a/src/lib/evas/gesture/efl_gesture_long_tap.eo
+++ b/src/lib/evas/gesture/efl_gesture_long_tap.eo
@@ -1,26 +1,13 @@
1import efl_gesture_types; 1import efl_gesture_types;
2 2
3class Efl.Gesture.Long.Tap(Efl.Gesture) 3class Efl.Gesture.Long_Tap (Efl.Gesture)
4{ 4{
5 methods {
6 @property position {
7 [[This property holds the type of the gesture.]]
8 set {
9 }
10 get {
11 }
12 values {
13 pos: Eina.Vector2;[[position of the mouse event]]
14 }
15 }
16 }
17 event_prefix: efl; 5 event_prefix: efl;
18 events { 6 events {
19 gesture_long_tap; [[Event for tap gesture]] 7 gesture,long_tap; [[Event for tap gesture]]
20 } 8 }
21
22 implements { 9 implements {
23 Efl.Object.constructor; 10 Efl.Object.constructor;
24 Efl.Object.destructor; 11 Efl.Object.destructor;
25 } 12 }
26} \ No newline at end of file 13}
diff --git a/src/lib/evas/gesture/efl_gesture_manager.c b/src/lib/evas/gesture/efl_gesture_manager.c
index 2b90db9..e8fbf55 100644
--- a/src/lib/evas/gesture/efl_gesture_manager.c
+++ b/src/lib/evas/gesture/efl_gesture_manager.c
@@ -107,7 +107,6 @@ _efl_gesture_manager_callback_add_hook(Eo *obj, Eo *target, const Efl_Event_Desc
107 // add it to the gesture context. 107 // add it to the gesture context.
108 eina_hash_list_append(pd->m_gesture_contex, &target, type); 108 eina_hash_list_append(pd->m_gesture_contex, &target, type);
109 } 109 }
110
111} 110}
112 111
113void 112void
@@ -142,19 +141,15 @@ _efl_gesture_manager_filter_event(Eo *obj, Eo *target, void *event)
142 { 141 {
143 // get the touch event for this particular widget 142 // get the touch event for this particular widget
144 touch_event = eina_hash_find(pd->m_object_events, &target); 143 touch_event = eina_hash_find(pd->m_object_events, &target);
145 if (touch_event) 144 if (!touch_event)
146 {
147 efl_gesture_touch_point_record(touch_event, pointer_data->tool, pointer_data->cur.x, pointer_data->cur.y,
148 pointer_data->timestamp, pointer_data->action);
149 }
150 else
151 { 145 {
152 touch_event = efl_add(EFL_GESTURE_TOUCH_CLASS, NULL); 146 touch_event = efl_add(EFL_GESTURE_TOUCH_CLASS, NULL);
153 efl_gesture_touch_point_record(touch_event, pointer_data->tool, pointer_data->cur.x, pointer_data->cur.y,
154 pointer_data->timestamp, pointer_data->action);
155 eina_hash_add(pd->m_object_events, &target, touch_event); 147 eina_hash_add(pd->m_object_events, &target, touch_event);
156 } 148 }
157 149
150 efl_gesture_touch_point_record(touch_event, pointer_data->tool, pointer_data->cur,
151 pointer_data->timestamp, pointer_data->action);
152
158 if (efl_gesture_touch_state_get(touch_event) == EFL_GESTURE_TOUCH_UNKNOWN) 153 if (efl_gesture_touch_state_get(touch_event) == EFL_GESTURE_TOUCH_UNKNOWN)
159 return; 154 return;
160 155
diff --git a/src/lib/evas/gesture/efl_gesture_manager.eo b/src/lib/evas/gesture/efl_gesture_manager.eo
index 2292480..1f0bed4 100644
--- a/src/lib/evas/gesture/efl_gesture_manager.eo
+++ b/src/lib/evas/gesture/efl_gesture_manager.eo
@@ -1,24 +1,22 @@
1import efl_gesture_types; 1import efl_gesture_types;
2 2
3class Efl.Gesture.Manager(Efl.Object) 3class Efl.Gesture.Manager (Efl.Object)
4{ 4{
5 methods { 5 methods {
6 recognizer_register { 6 recognizer_register {
7 [[This function is called to register a new Efl.Gesture.Recognizer]] 7 [[This function is called to register a new Efl.Gesture.Recognizer]]
8
9 params { 8 params {
10 @in recognizer: Efl.Gesture.Recognizer; [[The gesture recognizer object]] 9 @in recognizer: Efl.Gesture.Recognizer; [[The gesture recognizer object]]
11 } 10 }
12 return: ptr(const(Efl.Event.Description)); [[Returns the Efl.Event.Description type the recognizer supports]] 11 return: ptr(const(Efl.Event.Description)); [[Returns the Efl.Event.Description type the recognizer supports]]
13 } 12 }
14 recognizer_unregister { 13 recognizer_unregister {
15 [[This function is called to unregister a Efl.Gesture.Recognizer ]] 14 [[This function is called to unregister a Efl.Gesture.Recognizer]]
16
17 params { 15 params {
18 @in recognizer: Efl.Gesture.Recognizer; [[The gesture recognizer object]] 16 @in recognizer: Efl.Gesture.Recognizer; [[The gesture recognizer object]]
19 } 17 }
20 } 18 }
21 @property config{ 19 @property config {
22 [[This property holds the config value for the recognizer]] 20 [[This property holds the config value for the recognizer]]
23 set { 21 set {
24 } 22 }
@@ -28,7 +26,7 @@ class Efl.Gesture.Manager(Efl.Object)
28 name: string; [[propery name]] 26 name: string; [[propery name]]
29 } 27 }
30 values { 28 values {
31 value: ptr(any_value); [[value of the property]] 29 value: any_value_ptr; [[value of the property]]
32 } 30 }
33 } 31 }
34 } 32 }
@@ -36,4 +34,4 @@ class Efl.Gesture.Manager(Efl.Object)
36 Efl.Object.constructor; 34 Efl.Object.constructor;
37 Efl.Object.destructor; 35 Efl.Object.destructor;
38 } 36 }
39} \ No newline at end of file 37}
diff --git a/src/lib/evas/gesture/efl_gesture_private.h b/src/lib/evas/gesture/efl_gesture_private.h
index e00faf6..6a7d452 100644
--- a/src/lib/evas/gesture/efl_gesture_private.h
+++ b/src/lib/evas/gesture/efl_gesture_private.h
@@ -31,12 +31,10 @@ struct _Efl_Gesture_Data
31 31
32struct _Efl_Gesture_Tap_Data 32struct _Efl_Gesture_Tap_Data
33{ 33{
34 Eina_Vector2 pos;
35}; 34};
36 35
37struct _Efl_Gesture_Long_Tap_Data 36struct _Efl_Gesture_Long_Tap_Data
38{ 37{
39 Eina_Vector2 pos;
40 Ecore_Timer *timeout; 38 Ecore_Timer *timeout;
41 Eina_Bool is_timeout; 39 Eina_Bool is_timeout;
42}; 40};
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer.c b/src/lib/evas/gesture/efl_gesture_recognizer.c
index f25590a..684bfe0 100644
--- a/src/lib/evas/gesture/efl_gesture_recognizer.c
+++ b/src/lib/evas/gesture/efl_gesture_recognizer.c
@@ -2,21 +2,17 @@
2 2
3#define MY_CLASS EFL_GESTURE_RECOGNIZER_CLASS 3#define MY_CLASS EFL_GESTURE_RECOGNIZER_CLASS
4 4
5
6EOLIAN static Eina_Value * 5EOLIAN static Eina_Value *
7_efl_gesture_recognizer_config_get(Eo *obj EINA_UNUSED, Efl_Gesture_Recognizer_Data *pd, const char *name) 6_efl_gesture_recognizer_config_get(Eo *obj EINA_UNUSED, Efl_Gesture_Recognizer_Data *pd, const char *name)
8{ 7{
9 return efl_gesture_manager_config_get(pd->manager, name); 8 return efl_gesture_manager_config_get(pd->manager, name);
10} 9}
11 10
12
13EOLIAN static void 11EOLIAN static void
14_efl_gesture_recognizer_reset(Eo *obj EINA_UNUSED, Efl_Gesture_Recognizer_Data *pd EINA_UNUSED, 12_efl_gesture_recognizer_reset(Eo *obj EINA_UNUSED, Efl_Gesture_Recognizer_Data *pd EINA_UNUSED,
15 Efl_Gesture *gesture EINA_UNUSED) 13 Efl_Gesture *gesture EINA_UNUSED)
16{ 14{
17 15
18} 16}
19 17
20#include "efl_gesture_recognizer.eo.c" 18#include "efl_gesture_recognizer.eo.c"
21
22
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer.eo b/src/lib/evas/gesture/efl_gesture_recognizer.eo
index f1e340e..24001b4 100644
--- a/src/lib/evas/gesture/efl_gesture_recognizer.eo
+++ b/src/lib/evas/gesture/efl_gesture_recognizer.eo
@@ -1,35 +1,36 @@
1import efl_gesture_types; 1import efl_gesture_types;
2 2
3abstract Efl.Gesture.Recognizer(Efl.Object) 3abstract Efl.Gesture.Recognizer (Efl.Object)
4{ 4{
5 methods { 5 methods {
6 create @pure_virtual{ 6 create @pure_virtual {
7 [[This function is called to create a new Efl.Gesture object for the given target]] 7 [[This function is called to create a new Efl.Gesture object for the given target]]
8
9 params { 8 params {
10 @in target: Efl.Object; [[The target widget]] 9 @in target: Efl.Object; [[The target widget]]
11 } 10 }
12 return: Efl.Gesture; [[Returns the Efl.Gesture event object]] 11 return: Efl.Gesture; [[Returns the Efl.Gesture event object]]
13 } 12 }
14 recognize @pure_virtual{ 13 recognize @pure_virtual {
15 [[Handles the given event for the watched object, updating the state of the gesture object as required, and returns a suitable result for the current recognition step.]] 14 [[Handles the given event for the watched object.
16 15
16 Updates the state of the gesture object as required, and returns a
17 suitable result for the current recognition step.
18 ]]
17 params { 19 params {
18 @in gesture: Efl.Gesture; [[The gesture object]] 20 @in gesture: Efl.Gesture; [[The gesture object]]
19 @in watched: Efl.Object; [[The watched object]] 21 @in watched: Efl.Object; [[The watched object]]
20 @in event: Efl.Gesture.Touch; [[The pointer event]] 22 @in event: Efl.Gesture.Touch; [[The pointer event]]
21
22 } 23 }
23 return: Efl.Gesture.Recognizer.Result; [[Returns the Efl.Gesture event object]] 24 return: Efl.Gesture.Recognizer_Result; [[Returns the Efl.Gesture event object]]
24 } 25 }
26 /* FIXME: This function is not used? */
25 reset { 27 reset {
26 [[This function is called by the framework to reset a given gesture.]] 28 [[This function is called by the framework to reset a given gesture.]]
27
28 params { 29 params {
29 @in gesture: Efl.Gesture; [[The gesture object]] 30 @in gesture: Efl.Gesture; [[The gesture object]]
30 } 31 }
31 } 32 }
32 @property config{ 33 @property config {
33 [[This property holds the config value for the recognizer]] 34 [[This property holds the config value for the recognizer]]
34 get { 35 get {
35 } 36 }
@@ -37,8 +38,8 @@ abstract Efl.Gesture.Recognizer(Efl.Object)
37 name: string; [[propery name]] 38 name: string; [[propery name]]
38 } 39 }
39 values { 40 values {
40 value: ptr(any_value); [[value of the property]] 41 value: any_value_ptr; [[value of the property]]
41 } 42 }
42 } 43 }
43 } 44 }
44} \ No newline at end of file 45}
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer_long_tap.c b/src/lib/evas/gesture/efl_gesture_recognizer_long_tap.c
index 2ba7cd8..501538b 100644
--- a/src/lib/evas/gesture/efl_gesture_recognizer_long_tap.c
+++ b/src/lib/evas/gesture/efl_gesture_recognizer_long_tap.c
@@ -4,26 +4,8 @@
4 4
5#define LONG_TAP_TIME_OUT 0.2 5#define LONG_TAP_TIME_OUT 0.2
6 6
7typedef struct _Efl_Gesture_Recognizer_Long_Tap_Data
8{
9
10} Efl_Gesture_Recognizer_Long_Tap_Data;
11
12EOLIAN static Efl_Object *
13_efl_gesture_recognizer_long_tap_efl_object_constructor(Eo *obj, Efl_Gesture_Recognizer_Long_Tap_Data *pd EINA_UNUSED)
14{
15 obj = efl_constructor(efl_super(obj, MY_CLASS));
16 return obj;
17}
18
19EOLIAN static void
20_efl_gesture_recognizer_long_tap_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Gesture_Recognizer_Long_Tap_Data *pd EINA_UNUSED)
21{
22 efl_destructor(efl_super(obj, MY_CLASS));
23}
24
25EOLIAN static Efl_Gesture * 7EOLIAN static Efl_Gesture *
26_efl_gesture_recognizer_long_tap_efl_gesture_recognizer_create(Eo *obj, Efl_Gesture_Recognizer_Long_Tap_Data *pd EINA_UNUSED, 8_efl_gesture_recognizer_long_tap_efl_gesture_recognizer_create(Eo *obj, void *pd EINA_UNUSED,
27 Efl_Object *target EINA_UNUSED) 9 Efl_Object *target EINA_UNUSED)
28{ 10{
29 return efl_add(EFL_GESTURE_LONG_TAP_CLASS, obj); 11 return efl_add(EFL_GESTURE_LONG_TAP_CLASS, obj);
@@ -34,96 +16,95 @@ _long_tap_timeout_cb(void *data)
34{ 16{
35 Efl_Gesture_Long_Tap_Data *ltp = data; 17 Efl_Gesture_Long_Tap_Data *ltp = data;
36 18
19 /* FIXME: Needs to propagate this event back to evas! */
37 ltp->is_timeout = EINA_TRUE; 20 ltp->is_timeout = EINA_TRUE;
21
38 return ECORE_CALLBACK_RENEW; 22 return ECORE_CALLBACK_RENEW;
39} 23}
40 24
41EOLIAN static Efl_Gesture_Recognizer_Result 25EOLIAN static Efl_Gesture_Recognizer_Result
42_efl_gesture_recognizer_long_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_UNUSED, 26_efl_gesture_recognizer_long_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_UNUSED,
43 Efl_Gesture_Recognizer_Long_Tap_Data *pd EINA_UNUSED, 27 void *pd EINA_UNUSED,
44 Efl_Gesture *gesture, Efl_Object *watched EINA_UNUSED, 28 Efl_Gesture *gesture, Efl_Object *watched EINA_UNUSED,
45 Efl_Gesture_Touch *event) 29 Efl_Gesture_Touch *event)
46{ 30{
47 double dist_x, dist_y, length, x, y; 31 double length; // Manhattan distance
48 Eina_Vector2 pos; 32 Eina_Vector2 pos, dist;
49 Efl_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL; 33 Efl_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL;
50 Efl_Gesture_Long_Tap_Data *ltp = efl_data_scope_get(gesture, EFL_GESTURE_LONG_TAP_CLASS); 34 Efl_Gesture_Long_Tap_Data *ltp = efl_data_scope_get(gesture, EFL_GESTURE_LONG_TAP_CLASS);
51 35
52 switch (efl_gesture_touch_state_get(event)) 36 switch (efl_gesture_touch_state_get(event))
53 { 37 {
54 case EFL_GESTURE_TOUCH_BEGIN: 38 case EFL_GESTURE_TOUCH_BEGIN:
55 { 39 {
56 efl_gesture_touch_start_point(event, &x, &y); 40 pos = efl_gesture_touch_start_point_get(event);
57 eina_vector2_set(&pos, x, y); 41 efl_gesture_hotspot_set(gesture, pos);
58 efl_gesture_long_tap_position_set(gesture, pos); 42 if (ltp->timeout)
59 efl_gesture_hotspot_set(gesture, pos); 43 ecore_timer_del(ltp->timeout);
60 if (ltp->timeout) 44 ltp->timeout = ecore_timer_add(LONG_TAP_TIME_OUT,
61 ecore_timer_del(ltp->timeout); 45 _long_tap_timeout_cb, ltp);
62 ltp->timeout = ecore_timer_add(LONG_TAP_TIME_OUT, 46 result = EFL_GESTURE_MAYBE;
63 _long_tap_timeout_cb, ltp); 47 break;
64 result = EFL_GESTURE_MAYBE; 48 }
65 break; 49 case EFL_GESTURE_TOUCH_UPDATE:
66 } 50 {
67 case EFL_GESTURE_TOUCH_UPDATE: 51 if (!efl_gesture_touch_multi_touch_get(event))
68 { 52 {
69 if (!efl_gesture_touch_multi_touch_get(event)) 53 dist = efl_gesture_touch_distance(event, 0);
70 { 54 length = fabs(dist.x) + fabs(dist.y);
71 efl_gesture_touch_distance(event, 0, &dist_x, &dist_y); 55 if (length <= 50) // FIXME config!
72 length = abs(dist_x) + abs(dist_y); 56 {
73 if (length <= 50) 57 if (ltp->is_timeout)
74 { 58 {
75 if (ltp->is_timeout) 59 ltp->is_timeout = EINA_FALSE;
76 { 60 result = EFL_GESTURE_TRIGGER;
77 ltp->is_timeout = EINA_FALSE; 61 }
78 result = EFL_GESTURE_TRIGGER; 62 else
79 } 63 {
80 else 64 result = EFL_GESTURE_MAYBE;
81 { 65 }
82 result = EFL_GESTURE_MAYBE; 66 }
83 } 67 else
84 } 68 {
85 else 69 result = EFL_GESTURE_CANCEL;
86 { 70 }
87 result = EFL_GESTURE_CANCEL; 71 }
88 } 72 break;
89 } 73 }
90 break; 74 case EFL_GESTURE_TOUCH_END:
91 } 75 {
92 case EFL_GESTURE_TOUCH_END: 76 if (ltp->timeout)
93 { 77 ecore_timer_del(ltp->timeout);
94 if (ltp->timeout) 78 ltp->timeout = NULL;
95 ecore_timer_del(ltp->timeout); 79 if (efl_gesture_state_get(gesture) != EFL_GESTURE_NONE &&
96 ltp->timeout = NULL; 80 !efl_gesture_touch_multi_touch_get(event))
97 if (efl_gesture_state_get(gesture) != EFL_GESTURE_NONE && 81 {
98 !efl_gesture_touch_multi_touch_get(event)) 82 dist = efl_gesture_touch_distance(event, 0);
99 { 83 length = fabs(dist.x) + fabs(dist.y);
100 efl_gesture_touch_distance(event, 0, &dist_x, &dist_y); 84 if (length <= 50 && ltp->is_timeout) // FIXME config!
101 length = abs(dist_x) + abs(dist_y); 85 {
102 if (length <= 50 && ltp->is_timeout) 86 result = EFL_GESTURE_FINISH;
103 { 87 }
104 result = EFL_GESTURE_FINISH; 88 else
105 } 89 {
106 else 90 result = EFL_GESTURE_CANCEL;
107 { 91 }
108 result = EFL_GESTURE_CANCEL; 92 }
109 } 93 break;
110 } 94 }
111 break; 95 default:
112 } 96 break;
113 default: 97 }
114 break;
115 }
116 return result; 98 return result;
117} 99}
118 100
119EOLIAN static void 101EOLIAN static void
120_efl_gesture_recognizer_long_tap_efl_gesture_recognizer_reset(Eo *obj, 102_efl_gesture_recognizer_long_tap_efl_gesture_recognizer_reset(Eo *obj,
121 Efl_Gesture_Recognizer_Long_Tap_Data *pd EINA_UNUSED, 103 void *pd EINA_UNUSED,
122 Efl_Gesture *gesture) 104 Efl_Gesture *gesture)
123{ 105{
124 Efl_Gesture_Long_Tap_Data *ltp; 106 Efl_Gesture_Long_Tap_Data *ltp;
125 ltp = efl_data_scope_get(gesture, EFL_GESTURE_LONG_TAP_CLASS); 107 ltp = efl_data_scope_get(gesture, EFL_GESTURE_LONG_TAP_CLASS);
126 eina_vector2_set(&ltp->pos, 0, 0);
127 if (ltp->timeout) 108 if (ltp->timeout)
128 ecore_timer_del(ltp->timeout); 109 ecore_timer_del(ltp->timeout);
129 ltp->timeout = NULL; 110 ltp->timeout = NULL;
@@ -131,4 +112,4 @@ _efl_gesture_recognizer_long_tap_efl_gesture_recognizer_reset(Eo *obj,
131 efl_gesture_recognizer_reset(efl_super(obj, MY_CLASS), gesture); 112 efl_gesture_recognizer_reset(efl_super(obj, MY_CLASS), gesture);
132} 113}
133 114
134#include "efl_gesture_recognizer_long_tap.eo.c" \ No newline at end of file 115#include "efl_gesture_recognizer_long_tap.eo.c"
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer_long_tap.eo b/src/lib/evas/gesture/efl_gesture_recognizer_long_tap.eo
index b54a47b..8d619a1 100644
--- a/src/lib/evas/gesture/efl_gesture_recognizer_long_tap.eo
+++ b/src/lib/evas/gesture/efl_gesture_recognizer_long_tap.eo
@@ -1,10 +1,9 @@
1class Efl.Gesture.Recognizer.Long.Tap(Efl.Gesture.Recognizer) 1class Efl.Gesture.Recognizer_Long_Tap (Efl.Gesture.Recognizer)
2{ 2{
3 data: null;
3 implements { 4 implements {
4 Efl.Object.constructor;
5 Efl.Object.destructor;
6 Efl.Gesture.Recognizer.create; 5 Efl.Gesture.Recognizer.create;
7 Efl.Gesture.Recognizer.recognize; 6 Efl.Gesture.Recognizer.recognize;
8 Efl.Gesture.Recognizer.reset; 7 Efl.Gesture.Recognizer.reset;
9 } 8 }
10} \ No newline at end of file 9}
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer_tap.c b/src/lib/evas/gesture/efl_gesture_recognizer_tap.c
index 37456a9..7f8c2a8 100644
--- a/src/lib/evas/gesture/efl_gesture_recognizer_tap.c
+++ b/src/lib/evas/gesture/efl_gesture_recognizer_tap.c
@@ -2,26 +2,8 @@
2 2
3#define MY_CLASS EFL_GESTURE_RECOGNIZER_TAP_CLASS 3#define MY_CLASS EFL_GESTURE_RECOGNIZER_TAP_CLASS
4 4
5typedef struct _Efl_Gesture_Recognizer_Tap_Data
6{
7
8} Efl_Gesture_Recognizer_Tap_Data;
9
10EOLIAN static Efl_Object *
11_efl_gesture_recognizer_tap_efl_object_constructor(Eo *obj, Efl_Gesture_Recognizer_Tap_Data *pd EINA_UNUSED)
12{
13 obj = efl_constructor(efl_super(obj, MY_CLASS));
14 return obj;
15}
16
17EOLIAN static void
18_efl_gesture_recognizer_tap_efl_object_destructor(Eo *obj EINA_UNUSED, Efl_Gesture_Recognizer_Tap_Data *pd EINA_UNUSED)
19{
20 efl_destructor(efl_super(obj, MY_CLASS));
21}
22
23EOLIAN static Efl_Gesture * 5EOLIAN static Efl_Gesture *
24_efl_gesture_recognizer_tap_efl_gesture_recognizer_create(Eo *obj, Efl_Gesture_Recognizer_Tap_Data *pd EINA_UNUSED, 6_efl_gesture_recognizer_tap_efl_gesture_recognizer_create(Eo *obj, void *pd EINA_UNUSED,
25 Efl_Object *target EINA_UNUSED) 7 Efl_Object *target EINA_UNUSED)
26{ 8{
27 return efl_add(EFL_GESTURE_TAP_CLASS, obj); 9 return efl_add(EFL_GESTURE_TAP_CLASS, obj);
@@ -29,58 +11,45 @@ _efl_gesture_recognizer_tap_efl_gesture_recognizer_create(Eo *obj, Efl_Gesture_R
29 11
30EOLIAN static Efl_Gesture_Recognizer_Result 12EOLIAN static Efl_Gesture_Recognizer_Result
31_efl_gesture_recognizer_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_UNUSED, 13_efl_gesture_recognizer_tap_efl_gesture_recognizer_recognize(Eo *obj EINA_UNUSED,
32 Efl_Gesture_Recognizer_Tap_Data *pd EINA_UNUSED, 14 void *pd EINA_UNUSED,
33 Efl_Gesture *gesture, Efl_Object *watched EINA_UNUSED, 15 Efl_Gesture *gesture, Efl_Object *watched EINA_UNUSED,
34 Efl_Gesture_Touch *event EINA_UNUSED) 16 Efl_Gesture_Touch *event EINA_UNUSED)
35{ 17{
36 double dist_x, dist_y, length, x, y; 18 double length;
37 Eina_Vector2 pos; 19 Eina_Vector2 pos, dist;
38 Efl_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL; 20 Efl_Gesture_Recognizer_Result result = EFL_GESTURE_CANCEL;
39 21
40 switch (efl_gesture_touch_state_get(event)) 22 switch (efl_gesture_touch_state_get(event))
41 { 23 {
42 case EFL_GESTURE_TOUCH_BEGIN: 24 case EFL_GESTURE_TOUCH_BEGIN:
43 { 25 {
44 efl_gesture_touch_start_point(event, &x, &y); 26 pos = efl_gesture_touch_start_point_get(event);
45 eina_vector2_set(&pos, x, y); 27 efl_gesture_hotspot_set(gesture, pos);
46 efl_gesture_tap_position_set(gesture, pos); 28 result = EFL_GESTURE_TRIGGER;
47 efl_gesture_hotspot_set(gesture, pos); 29 break;
48 result = EFL_GESTURE_TRIGGER; 30 }
49 break; 31 case EFL_GESTURE_TOUCH_UPDATE:
50 } 32 case EFL_GESTURE_TOUCH_END:
51 case EFL_GESTURE_TOUCH_UPDATE: 33 {
52 case EFL_GESTURE_TOUCH_END: 34 if (efl_gesture_state_get(gesture) != EFL_GESTURE_NONE &&
53 { 35 !efl_gesture_touch_multi_touch_get(event))
54 if (efl_gesture_state_get(gesture) != EFL_GESTURE_NONE && 36 {
55 !efl_gesture_touch_multi_touch_get(event)) 37 dist = efl_gesture_touch_distance(event, 0);
56 { 38 length = fabs(dist.x) + fabs(dist.y);
57 efl_gesture_touch_distance(event, 0, &dist_x, &dist_y); 39 if (length <= 50) // FIXME config!
58 length = abs(dist_x) + abs(dist_y); 40 {
59 if (length <= 50) 41 if (efl_gesture_touch_state_get(event) == EFL_GESTURE_TOUCH_END)
60 { 42 result = EFL_GESTURE_FINISH;
61 if (efl_gesture_touch_state_get(event) == EFL_GESTURE_TOUCH_END) 43 else
62 result = EFL_GESTURE_FINISH; 44 result = EFL_GESTURE_TRIGGER;
63 else 45 }
64 result = EFL_GESTURE_TRIGGER; 46 }
65 } 47 break;
66 } 48 }
67 break; 49 default:
68 } 50 break;
69 default: 51 }
70 break;
71 }
72 return result; 52 return result;
73} 53}
74 54
75EOLIAN static void 55#include "efl_gesture_recognizer_tap.eo.c"
76_efl_gesture_recognizer_tap_efl_gesture_recognizer_reset(Eo *obj,
77 Efl_Gesture_Recognizer_Tap_Data *pd EINA_UNUSED,
78 Efl_Gesture *gesture)
79{
80 Efl_Gesture_Tap_Data *tap;
81 tap = efl_data_scope_get(gesture, EFL_GESTURE_TAP_CLASS);
82 eina_vector2_set(&tap->pos, 0, 0);
83 efl_gesture_recognizer_reset(efl_super(obj, MY_CLASS), gesture);
84}
85
86#include "efl_gesture_recognizer_tap.eo.c" \ No newline at end of file
diff --git a/src/lib/evas/gesture/efl_gesture_recognizer_tap.eo b/src/lib/evas/gesture/efl_gesture_recognizer_tap.eo
index 509b91d..f91964c 100644
--- a/src/lib/evas/gesture/efl_gesture_recognizer_tap.eo
+++ b/src/lib/evas/gesture/efl_gesture_recognizer_tap.eo
@@ -1,10 +1,8 @@
1class Efl.Gesture.Recognizer.Tap(Efl.Gesture.Recognizer) 1class Efl.Gesture.Recognizer_Tap (Efl.Gesture.Recognizer)
2{ 2{
3 data: null;
3 implements { 4 implements {
4 Efl.Object.constructor;
5 Efl.Object.destructor;
6 Efl.Gesture.Recognizer.create; 5 Efl.Gesture.Recognizer.create;
7 Efl.Gesture.Recognizer.recognize; 6 Efl.Gesture.Recognizer.recognize;
8 Efl.Gesture.Recognizer.reset;
9 } 7 }
10} \ No newline at end of file 8}
diff --git a/src/lib/evas/gesture/efl_gesture_tap.c b/src/lib/evas/gesture/efl_gesture_tap.c
index 50dbcf3..6b1a239 100644
--- a/src/lib/evas/gesture/efl_gesture_tap.c
+++ b/src/lib/evas/gesture/efl_gesture_tap.c
@@ -3,18 +3,6 @@
3#define MY_CLASS EFL_GESTURE_TAP_CLASS 3#define MY_CLASS EFL_GESTURE_TAP_CLASS
4 4
5 5
6EOLIAN static void
7_efl_gesture_tap_position_set(Eo *obj EINA_UNUSED, Efl_Gesture_Tap_Data *pd, Eina_Vector2 pos)
8{
9 pd->pos = pos;
10}
11
12EOLIAN static Eina_Vector2
13_efl_gesture_tap_position_get(Eo *obj EINA_UNUSED, Efl_Gesture_Tap_Data *pd)
14{
15 return pd->pos;
16}
17
18EOLIAN static Efl_Object * 6EOLIAN static Efl_Object *
19_efl_gesture_tap_efl_object_constructor(Eo *obj, Efl_Gesture_Tap_Data *pd EINA_UNUSED) 7_efl_gesture_tap_efl_object_constructor(Eo *obj, Efl_Gesture_Tap_Data *pd EINA_UNUSED)
20{ 8{
@@ -28,4 +16,4 @@ _efl_gesture_tap_efl_object_constructor(Eo *obj, Efl_Gesture_Tap_Data *pd EINA_U
28 return obj; 16 return obj;
29} 17}
30 18
31#include "efl_gesture_tap.eo.c" \ No newline at end of file 19#include "efl_gesture_tap.eo.c"
diff --git a/src/lib/evas/gesture/efl_gesture_tap.eo b/src/lib/evas/gesture/efl_gesture_tap.eo
index 6cbfd02..cdd51ee 100644
--- a/src/lib/evas/gesture/efl_gesture_tap.eo
+++ b/src/lib/evas/gesture/efl_gesture_tap.eo
@@ -2,24 +2,11 @@ import efl_gesture_types;
2 2
3class Efl.Gesture.Tap(Efl.Gesture) 3class Efl.Gesture.Tap(Efl.Gesture)
4{ 4{
5 methods {
6 @property position {
7 [[This property holds the type of the gesture.]]
8 set {
9 }
10 get {
11 }
12 values {
13 pos: Eina.Vector2;[[position of the mouse event]]
14 }
15 }
16 }
17 event_prefix: efl; 5 event_prefix: efl;
18 events { 6 events {
19 gesture,tap; [[Event for tap gesture]] 7 gesture,tap; [[Event for tap gesture]]
20 } 8 }
21
22 implements { 9 implements {
23 Efl.Object.constructor; 10 Efl.Object.constructor;
24 } 11 }
25} \ No newline at end of file 12}
diff --git a/src/lib/evas/gesture/efl_gesture_touch.c b/src/lib/evas/gesture/efl_gesture_touch.c
index 57c2705..0484d43 100644
--- a/src/lib/evas/gesture/efl_gesture_touch.c
+++ b/src/lib/evas/gesture/efl_gesture_touch.c
@@ -5,19 +5,18 @@
5typedef struct _Pointer_Data 5typedef struct _Pointer_Data
6{ 6{
7 struct 7 struct
8 { 8 {
9 double x; 9 Eina_Vector2 pos;
10 double y; 10 double timestamp;
11 double timestamp; 11 } start, prev, cur;
12 } start, prev, cur ;
13 Efl_Pointer_Action action; 12 Efl_Pointer_Action action;
14}Pointer_Data; 13} Pointer_Data;
15 14
16typedef struct _Efl_Gesture_Touch_Data 15typedef struct _Efl_Gesture_Touch_Data
17{ 16{
18 Efl_Gesture_Touch_State type; 17 Efl_Gesture_Touch_State state;
19 Eina_Hash *touch_points; 18 Eina_Hash *touch_points;
20 Eina_List *finger_list; 19 int touch_down;
21 Eina_Bool multi_touch; 20 Eina_Bool multi_touch;
22 Eo *target; 21 Eo *target;
23} Efl_Gesture_Touch_Data; 22} Efl_Gesture_Touch_Data;
@@ -32,12 +31,20 @@ static void _hash_free_cb(Pointer_Data *point)
32 free(point); 31 free(point);
33} 32}
34 33
34static inline void
35_touch_points_reset(Efl_Gesture_Touch_Data *pd)
36{
37 eina_hash_free(pd->touch_points);
38 pd->touch_points = eina_hash_int32_new(EINA_FREE_CB(_hash_free_cb));
39 pd->touch_down = 0;
40 pd->state = EFL_GESTURE_TOUCH_UNKNOWN;
41}
42
35EOLIAN static Efl_Object * 43EOLIAN static Efl_Object *
36_efl_gesture_touch_efl_object_constructor(Eo *obj, Efl_Gesture_Touch_Data *pd) 44_efl_gesture_touch_efl_object_constructor(Eo *obj, Efl_Gesture_Touch_Data *pd)
37{ 45{
38 obj = efl_constructor(efl_super(obj, MY_CLASS)); 46 obj = efl_constructor(efl_super(obj, MY_CLASS));
39 pd->touch_points = eina_hash_int32_new(EINA_FREE_CB(_hash_free_cb)); 47 _touch_points_reset(pd);
40
41 return obj; 48 return obj;
42} 49}
43 50
@@ -51,23 +58,28 @@ _efl_gesture_touch_efl_object_destructor(Eo *obj, Efl_Gesture_Touch_Data *pd)
51EOLIAN static Efl_Gesture_Touch_State 58EOLIAN static Efl_Gesture_Touch_State
52_efl_gesture_touch_state_get(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd) 59_efl_gesture_touch_state_get(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd)
53{ 60{
54 return pd->type; 61 return pd->state;
55} 62}
56 63
57EOLIAN static void 64EOLIAN static void
58_efl_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd, 65_efl_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd,
59 int id, double x, double y, double timestamp, Efl_Pointer_Action action) 66 int id, Eina_Vector2 pos, double timestamp, Efl_Pointer_Action action)
60{ 67{
61 Pointer_Data *point = eina_hash_find(pd->touch_points, &id); 68 Pointer_Data *point = eina_hash_find(pd->touch_points, &id);
69
70 if (action == EFL_POINTER_ACTION_DOWN)
71 pd->touch_down++;
72 else if ((action == EFL_POINTER_ACTION_UP) ||
73 (action == EFL_POINTER_ACTION_CANCEL))
74 pd->touch_down--;
75 EINA_SAFETY_ON_FALSE_GOTO(pd->touch_down >= 0, bad_fingers);
76
62 if (point) 77 if (point)
63 { 78 {
64 // the point already exists. update the cur and prev point 79 // the point already exists. update the cur and prev point
65 point->prev.x = point->cur.x; 80 point->prev = point->cur;
66 point->prev.y = point->cur.y; 81 point->cur.pos = pos;
67 point->prev.timestamp = point->cur.timestamp; 82 point->cur.timestamp = timestamp;
68 point->cur.x = x;
69 point->cur.y = y;
70 point->cur.timestamp = timestamp;
71 } 83 }
72 else 84 else
73 { 85 {
@@ -78,13 +90,13 @@ _efl_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd,
78 return; 90 return;
79 } 91 }
80 point = calloc(1, sizeof(Pointer_Data)); 92 point = calloc(1, sizeof(Pointer_Data));
81 point->start.x = point->prev.x = point->cur.x = x; 93 if (!point) return;
82 point->start.y = point->prev.y = point->cur.y = y; 94 point->start.pos = point->prev.pos = point->cur.pos = pos;
83 point->start.timestamp = point->prev.timestamp = point->cur.timestamp = timestamp; 95 point->start.timestamp = point->prev.timestamp = point->cur.timestamp = timestamp;
84 96
85 // add to the hash 97 // add to the hash
86 eina_hash_add(pd->touch_points, &id, point); 98 eina_hash_add(pd->touch_points, &id, point);
87 pd->finger_list = eina_list_append(pd->finger_list, &id); 99 // FIXME: finger_list was broken
88 if (id) 100 if (id)
89 pd->multi_touch = EINA_TRUE; 101 pd->multi_touch = EINA_TRUE;
90 } 102 }
@@ -92,17 +104,21 @@ _efl_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd,
92 104
93 if (!id && (action == EFL_POINTER_ACTION_DOWN)) 105 if (!id && (action == EFL_POINTER_ACTION_DOWN))
94 { 106 {
95 pd->type = EFL_GESTURE_TOUCH_BEGIN; 107 pd->state = EFL_GESTURE_TOUCH_BEGIN;
96 } 108 }
97 else if ((action == EFL_POINTER_ACTION_UP) && (eina_list_count(pd->finger_list) == 1)) 109 else if ((action == EFL_POINTER_ACTION_UP) && (pd->touch_down == 0))
98 { 110 {
99 pd->type = EFL_GESTURE_TOUCH_END; 111 pd->state = EFL_GESTURE_TOUCH_END;
100 } 112 }
101 else 113 else
102 { 114 {
103 pd->type = EFL_GESTURE_TOUCH_UPDATE; 115 pd->state = EFL_GESTURE_TOUCH_UPDATE;
104 } 116 }
117 return;
105 118
119bad_fingers:
120 ERR("Inconsistent touch events received!");
121 _touch_points_reset(pd);
106} 122}
107 123
108EOLIAN static Eina_Bool 124EOLIAN static Eina_Bool
@@ -111,56 +127,43 @@ _efl_gesture_touch_multi_touch_get(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *
111 return pd->multi_touch; 127 return pd->multi_touch;
112} 128}
113 129
114EOLIAN static void 130EOLIAN static Eina_Vector2
115_efl_gesture_touch_start_point(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd, double *x, double *y) 131_efl_gesture_touch_start_point_get(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd)
116{ 132{
117 int tool = 0; 133 int tool = 0;
118 Pointer_Data *point = eina_hash_find(pd->touch_points, &tool); 134 Pointer_Data *point = eina_hash_find(pd->touch_points, &tool);
135 Eina_Vector2 vec = { 0, 0 };
119 136
120 *x = 0; 137 if (!point)
121 *y = 0; 138 return vec;
122 139
123 if (point) 140 return point->start.pos;
124 {
125 *x = point->start.x;
126 *y = point->start.y;
127 }
128} 141}
129 142
130EOLIAN static void 143EOLIAN static Eina_Vector2
131_efl_gesture_touch_delta(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd, int tool, double *x, double *y) 144_efl_gesture_touch_delta(const Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd, int tool)
132{ 145{
133 Pointer_Data *point = eina_hash_find(pd->touch_points, &tool); 146 Pointer_Data *point = eina_hash_find(pd->touch_points, &tool);
147 Eina_Vector2 vec = { 0, 0 };
134 148
135 *x = 0; 149 if (!point)
136 *y = 0; 150 return vec;
137 151
138 if (point) 152 eina_vector2_subtract(&vec, &point->cur.pos, &point->prev.pos);
139 { 153 return vec;
140 *x = point->cur.x - point->prev.x;
141 *y = point->cur.y - point->prev.y;
142 }
143} 154}
144 155
145EOLIAN static void 156EOLIAN static Eina_Vector2
146_efl_gesture_touch_distance(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd, int tool, double *x, double *y) 157_efl_gesture_touch_distance(const Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd, int tool)
147{ 158{
148 Pointer_Data *point = eina_hash_find(pd->touch_points, &tool); 159 Pointer_Data *point = eina_hash_find(pd->touch_points, &tool);
160 Eina_Vector2 vec = { 0, 0 };
149 161
150 *x = 0; 162 if (!point)
151 *y = 0; 163 return vec;
152 164
153 if (point) 165 eina_vector2_subtract(&vec, &point->cur.pos, &point->start.pos);
154 { 166 return vec;
155 *x = point->cur.x - point->start.x;
156 *y = point->cur.y - point->start.y;
157 }
158}
159
160EOLIAN static const Eina_List *
161_efl_gesture_touch_finger_list_get(Eo *obj EINA_UNUSED, Efl_Gesture_Touch_Data *pd)
162{
163 return pd->finger_list;
164} 167}
165 168
166#include "efl_gesture_touch.eo.c" \ No newline at end of file 169#include "efl_gesture_touch.eo.c"
diff --git a/src/lib/evas/gesture/efl_gesture_touch.eo b/src/lib/evas/gesture/efl_gesture_touch.eo
index 9df3ed9..a124dfc 100644
--- a/src/lib/evas/gesture/efl_gesture_touch.eo
+++ b/src/lib/evas/gesture/efl_gesture_touch.eo
@@ -1,36 +1,39 @@
1import efl_gesture_types; 1import efl_gesture_types;
2import efl_input_types; 2import efl_input_types;
3 3
4/* FIXME: This class lacks a lot of useful helpers. */
5
4class Efl.Gesture.Touch(Efl.Object) 6class Efl.Gesture.Touch(Efl.Object)
5{ 7{
6 methods { 8 methods {
7 point_record { 9 point_record {
8 params { 10 params {
9 @in tool : int; [[The finger id ]] 11 @in tool : int; [[The finger id ]]
10 @in x : double; [[The x co-ordinate of the event]] 12 @in pos : Eina.Vector2; [[Position of the event]]
11 @in y : double; [[The y co-ordinate of the event]]
12 @in timestamp : double; [[The timestamp of the event]] 13 @in timestamp : double; [[The timestamp of the event]]
13 @in action : Efl.Pointer.Action; [[action of the event]] 14 @in action : Efl.Pointer.Action; [[action of the event]]
14 } 15 }
15 } 16 }
16 delta { 17 /* FIXME: This is most likely not useful (without timestamps). */
18 delta @const {
19 [[Compute the distance between the last two events]]
17 params { 20 params {
18 @in tool : int; [[The finger id ]] 21 @in tool : int; [[The finger id ]]
19 @out x : double; [[The x co-ordinate of the event]]
20 @out y : double; [[The y co-ordinate of the event]]
21 } 22 }
23 return: Eina.Vector2; [[The distance vector.]]
22 } 24 }
23 distance { 25 distance @const {
26 [[Compute the distance between the first touch and the last event.]]
24 params { 27 params {
25 @in tool : int; [[The finger id ]] 28 @in tool : int; [[The finger id ]]
26 @out x : double; [[The x co-ordinate of the event]]
27 @out y : double; [[The y co-ordinate of the event]]
28 } 29 }
30 return: Eina.Vector2; [[The distance vector.]]
29 } 31 }
30 start_point { 32 @property start_point {
31 params { 33 [[Returns the first touch point.]]
32 @out x : double; [[The x co-ordinate of the event]] 34 get {}
33 @out y : double; [[The y co-ordinate of the event]] 35 values {
36 pos: Eina.Vector2; [[The start position.]]
34 } 37 }
35 } 38 }
36 @property multi_touch { 39 @property multi_touch {
@@ -45,17 +48,10 @@ class Efl.Gesture.Touch(Efl.Object)
45 return : Efl.Gesture.Touch.State; [[touch event state]] 48 return : Efl.Gesture.Touch.State; [[touch event state]]
46 } 49 }
47 } 50 }
48 @property finger_list { 51 /* FIXME: finger_list was broken by design - TODO */
49 get {
50 [[Get the list of finger id .]]
51 }
52 values {
53 ret: const(list<int>); [[List of finger id]]
54 }
55 }
56 } 52 }
57 implements { 53 implements {
58 Efl.Object.constructor; 54 Efl.Object.constructor;
59 Efl.Object.destructor; 55 Efl.Object.destructor;
60 } 56 }
61} \ No newline at end of file 57}
diff --git a/src/lib/evas/gesture/efl_gesture_types.eot b/src/lib/evas/gesture/efl_gesture_types.eot
index 5a41938..0f771aa 100644
--- a/src/lib/evas/gesture/efl_gesture_types.eot
+++ b/src/lib/evas/gesture/efl_gesture_types.eot
@@ -19,7 +19,7 @@ enum Efl.Gesture.State
19 canceled, [[A gesture was canceled.]] 19 canceled, [[A gesture was canceled.]]
20} 20}
21 21
22enum Efl.Gesture.Recognizer.Result 22enum Efl.Gesture.Recognizer_Result
23{ 23{
24 [[ This enum type describes the state of a gesture recognizer. ]] 24 [[ This enum type describes the state of a gesture recognizer. ]]
25 legacy: efl_gesture; 25 legacy: efl_gesture;
@@ -30,4 +30,4 @@ enum Efl.Gesture.Recognizer.Result
30 finish = 0x0008, [[The gesture has been finished successfully.]] 30 finish = 0x0008, [[The gesture has been finished successfully.]]
31 cancel = 0x0010, [[The event made it clear that it is not a gesture. If the gesture recognizer was in Triggered state before, then the gesture is canceled.]] 31 cancel = 0x0010, [[The event made it clear that it is not a gesture. If the gesture recognizer was in Triggered state before, then the gesture is canceled.]]
32 result_mask = 0x00ff, 32 result_mask = 0x00ff,
33} \ No newline at end of file 33}