summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-02-03 12:10:31 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-02-14 09:20:45 +0100
commita136ab2e00f4bf3c9da323dd577f3e18b3d7e4e7 (patch)
tree92fcb24291389244c4a09fa48af6e89c5e1951ea /src/lib/evas
parent28b7ea6f0cc8c45674aca2db27361c9064bd53d1 (diff)
efl/gesture: remove gesture_touch::multi_touch
this is redundant now that touch_count exists ref T8554 Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es> Differential Revision: https://phab.enlightenment.org/D11274
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_private.h2
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer.c6
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.c4
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.c4
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.c2
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.c4
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.c2
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_touch.c10
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_touch.eo6
9 files changed, 15 insertions, 25 deletions
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_private.h b/src/lib/evas/gesture/efl_canvas_gesture_private.h
index 59255fb39e..e7627d336d 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_private.h
+++ b/src/lib/evas/gesture/efl_canvas_gesture_private.h
@@ -14,6 +14,7 @@
14const Efl_Event_Description * _efl_gesture_type_get(const Eo *obj); 14const Efl_Event_Description * _efl_gesture_type_get(const Eo *obj);
15int _direction_get(Evas_Coord xx1, Evas_Coord xx2); 15int _direction_get(Evas_Coord xx1, Evas_Coord xx2);
16Eina_Value *_recognizer_config_get(const Eo *obj, const char *name); 16Eina_Value *_recognizer_config_get(const Eo *obj, const char *name);
17Eina_Bool _event_multi_touch_get(const Efl_Canvas_Gesture_Touch *event);
17 18
18typedef struct _Efl_Canvas_Gesture_Manager_Data Efl_Canvas_Gesture_Manager_Data; 19typedef struct _Efl_Canvas_Gesture_Manager_Data Efl_Canvas_Gesture_Manager_Data;
19typedef struct _Efl_Canvas_Gesture_Recognizer_Data Efl_Canvas_Gesture_Recognizer_Data; 20typedef struct _Efl_Canvas_Gesture_Recognizer_Data Efl_Canvas_Gesture_Recognizer_Data;
@@ -37,7 +38,6 @@ typedef struct _Efl_Canvas_Gesture_Touch_Data
37 Eina_Array *touch_points; 38 Eina_Array *touch_points;
38 Efl_Gesture_Touch_Point_Data *cur_touch; 39 Efl_Gesture_Touch_Point_Data *cur_touch;
39 Efl_Gesture_Touch_Point_Data *prev_touch; 40 Efl_Gesture_Touch_Point_Data *prev_touch;
40 Eina_Bool multi_touch;
41 Eo *target; 41 Eo *target;
42 int touch_down; 42 int touch_down;
43} Efl_Canvas_Gesture_Touch_Data; 43} Efl_Canvas_Gesture_Touch_Data;
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c
index 8369295596..a59f624dd6 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer.c
@@ -40,4 +40,10 @@ _direction_get(Evas_Coord xx1, Evas_Coord xx2)
40 return 0; 40 return 0;
41} 41}
42 42
43Eina_Bool
44_event_multi_touch_get(const Efl_Canvas_Gesture_Touch *event)
45{
46 return efl_gesture_touch_points_count_get(event) > 1;
47}
48
43#include "efl_canvas_gesture_recognizer.eo.c" 49#include "efl_canvas_gesture_recognizer.eo.c"
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.c b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.c
index e1a7b7fff3..810c9aa8e8 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_double_tap.c
@@ -100,7 +100,7 @@ _efl_canvas_gesture_recognizer_double_tap_efl_canvas_gesture_recognizer_recogniz
100 result = EFL_GESTURE_RECOGNIZER_RESULT_IGNORE; 100 result = EFL_GESTURE_RECOGNIZER_RESULT_IGNORE;
101 101
102 if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE && 102 if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
103 !efl_gesture_touch_multi_touch_get(event)) 103 !_event_multi_touch_get(event))
104 { 104 {
105 dist = efl_gesture_touch_distance(event, 0); 105 dist = efl_gesture_touch_distance(event, 0);
106 length = fabs(dist.x) + fabs(dist.y); 106 length = fabs(dist.x) + fabs(dist.y);
@@ -125,7 +125,7 @@ _efl_canvas_gesture_recognizer_double_tap_efl_canvas_gesture_recognizer_recogniz
125 case EFL_GESTURE_TOUCH_STATE_END: 125 case EFL_GESTURE_TOUCH_STATE_END:
126 { 126 {
127 if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE && 127 if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
128 !efl_gesture_touch_multi_touch_get(event)) 128 !_event_multi_touch_get(event))
129 { 129 {
130 if (efl_gesture_touch_prev_data_get(event)) 130 if (efl_gesture_touch_prev_data_get(event))
131 { 131 {
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.c b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.c
index 83be3ea696..8a84d901f2 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_long_tap.c
@@ -89,7 +89,7 @@ _efl_canvas_gesture_recognizer_long_tap_efl_canvas_gesture_recognizer_recognize(
89 dist = efl_gesture_touch_distance(event, 0); 89 dist = efl_gesture_touch_distance(event, 0);
90 length = fabs(dist.x) + fabs(dist.y); 90 length = fabs(dist.x) + fabs(dist.y);
91 91
92 if ((efl_gesture_touch_multi_touch_get(event)) || (length > pd->finger_size)) 92 if ((_event_multi_touch_get(event)) || (length > pd->finger_size))
93 { 93 {
94 if (pd->timeout) 94 if (pd->timeout)
95 { 95 {
@@ -116,7 +116,7 @@ _efl_canvas_gesture_recognizer_long_tap_efl_canvas_gesture_recognizer_recognize(
116 } 116 }
117 117
118 if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE && 118 if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
119 !efl_gesture_touch_multi_touch_get(event)) 119 !_event_multi_touch_get(event))
120 { 120 {
121 dist = efl_gesture_touch_distance(event, 0); 121 dist = efl_gesture_touch_distance(event, 0);
122 length = fabs(dist.x) + fabs(dist.y); 122 length = fabs(dist.x) + fabs(dist.y);
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.c b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.c
index e0b2c342cd..fa126450f5 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_tap.c
@@ -77,7 +77,7 @@ new_tap:
77 ecore_timer_del(pd->timeout); 77 ecore_timer_del(pd->timeout);
78 pd->timeout = NULL; 78 pd->timeout = NULL;
79 } 79 }
80 if (efl_gesture_touch_multi_touch_get(event)) return EFL_GESTURE_RECOGNIZER_RESULT_IGNORE; 80 if (_event_multi_touch_get(event)) return EFL_GESTURE_RECOGNIZER_RESULT_IGNORE;
81 if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE) 81 if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE)
82 { 82 {
83 dist = efl_gesture_touch_distance(event, 0); 83 dist = efl_gesture_touch_distance(event, 0);
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.c b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.c
index 3dbd61b760..142ae8d33f 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_triple_tap.c
@@ -99,7 +99,7 @@ _efl_canvas_gesture_recognizer_triple_tap_efl_canvas_gesture_recognizer_recogniz
99 result = EFL_GESTURE_RECOGNIZER_RESULT_IGNORE; 99 result = EFL_GESTURE_RECOGNIZER_RESULT_IGNORE;
100 100
101 if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE && 101 if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
102 !efl_gesture_touch_multi_touch_get(event)) 102 !_event_multi_touch_get(event))
103 { 103 {
104 dist = efl_gesture_touch_distance(event, 0); 104 dist = efl_gesture_touch_distance(event, 0);
105 length = fabs(dist.x) + fabs(dist.y); 105 length = fabs(dist.x) + fabs(dist.y);
@@ -124,7 +124,7 @@ _efl_canvas_gesture_recognizer_triple_tap_efl_canvas_gesture_recognizer_recogniz
124 case EFL_GESTURE_TOUCH_STATE_END: 124 case EFL_GESTURE_TOUCH_STATE_END:
125 { 125 {
126 if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE && 126 if (efl_gesture_state_get(gesture) != EFL_GESTURE_STATE_NONE &&
127 !efl_gesture_touch_multi_touch_get(event)) 127 !_event_multi_touch_get(event))
128 { 128 {
129 if (efl_gesture_touch_prev_data_get(event)) 129 if (efl_gesture_touch_prev_data_get(event))
130 { 130 {
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.c b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.c
index c33b4d7602..b91811c7d3 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_recognizer_zoom.c
@@ -201,7 +201,7 @@ _efl_canvas_gesture_recognizer_zoom_efl_canvas_gesture_recognizer_recognize(Eo *
201 if (!pd->zoom_st.cur.timestamp) /* Now scan touched-devices list 201 if (!pd->zoom_st.cur.timestamp) /* Now scan touched-devices list
202 * and find other finger */ 202 * and find other finger */
203 { 203 {
204 if (!efl_gesture_touch_multi_touch_get(event)) 204 if (!_event_multi_touch_get(event))
205 return EFL_GESTURE_RECOGNIZER_RESULT_IGNORE; 205 return EFL_GESTURE_RECOGNIZER_RESULT_IGNORE;
206 206
207 const Efl_Gesture_Touch_Point_Data *p1 = efl_gesture_touch_data_get(event, 0); 207 const Efl_Gesture_Touch_Point_Data *p1 = efl_gesture_touch_data_get(event, 0);
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_touch.c b/src/lib/evas/gesture/efl_canvas_gesture_touch.c
index f6a1f71265..84573a21b2 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_touch.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_touch.c
@@ -58,16 +58,12 @@ _efl_canvas_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_T
58 { 58 {
59 if ((!point) || (!point->cur.pressed)) 59 if ((!point) || (!point->cur.pressed))
60 pd->touch_down++; 60 pd->touch_down++;
61 if (pd->touch_down >= 2)
62 pd->multi_touch = EINA_TRUE;
63 } 61 }
64 else if ((action == EFL_POINTER_ACTION_UP) || 62 else if ((action == EFL_POINTER_ACTION_UP) ||
65 (action == EFL_POINTER_ACTION_CANCEL)) 63 (action == EFL_POINTER_ACTION_CANCEL))
66 { 64 {
67 if (point && point->cur.pressed) 65 if (point && point->cur.pressed)
68 pd->touch_down--; 66 pd->touch_down--;
69 if (pd->multi_touch && pd->touch_down == 1)
70 pd->multi_touch = EINA_FALSE;
71 } 67 }
72 68
73 if (pd->touch_down < 0) goto finished_touch; 69 if (pd->touch_down < 0) goto finished_touch;
@@ -122,12 +118,6 @@ finished_touch:
122 _touch_points_reset(pd); 118 _touch_points_reset(pd);
123} 119}
124 120
125EOLIAN static Eina_Bool
126_efl_canvas_gesture_touch_multi_touch_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd)
127{
128 return pd->multi_touch;
129}
130
131EOLIAN static unsigned int 121EOLIAN static unsigned int
132_efl_canvas_gesture_touch_touch_points_count_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd) 122_efl_canvas_gesture_touch_touch_points_count_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd)
133{ 123{
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_touch.eo b/src/lib/evas/gesture/efl_canvas_gesture_touch.eo
index ed9949ea17..9b6471294e 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_touch.eo
+++ b/src/lib/evas/gesture/efl_canvas_gesture_touch.eo
@@ -54,12 +54,6 @@ class @beta Efl.Canvas.Gesture_Touch extends Efl.Object
54 time: uint; [[The timestamp.]] 54 time: uint; [[The timestamp.]]
55 } 55 }
56 } 56 }
57 @property multi_touch {
58 [[This property tells if the event is multi touch.]]
59 get {
60 return: bool; [[returns $true if its a multi touch]]
61 }
62 }
63 @property touch_points_count { 57 @property touch_points_count {
64 [[This provides the number of touch points active.]] 58 [[This provides the number of touch points active.]]
65 get { 59 get {