summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-11-27 11:45:46 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-11-27 15:54:57 +0100
commit3838112294d91efd121eade232e071eb3325d9e1 (patch)
treefe6820bbf584c3a1de53a72202db9cdc70f8fd41
parentffc3c4a7e7d960d885ba21074ab8ece0473b412e (diff)
Revert "gesture_manager: Changed function param to reduce internal function calls."
This has still open review comments, lets solve them, and *then* land it. This reverts commit 2f41f867ae992c58690e8fcad60672daa8744708.
-rw-r--r--src/lib/evas/canvas/evas_callbacks.c16
-rw-r--r--src/lib/evas/canvas/evas_main.c1
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_manager.c9
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_touch.c9
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_touch.eo5
-rw-r--r--src/lib/evas/include/evas_private.h4
6 files changed, 27 insertions, 17 deletions
diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c
index d9aac15..d19ce68 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -393,7 +393,7 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
393 type == EVAS_CALLBACK_MULTI_DOWN || 393 type == EVAS_CALLBACK_MULTI_DOWN ||
394 type == EVAS_CALLBACK_MOUSE_UP || 394 type == EVAS_CALLBACK_MOUSE_UP ||
395 type == EVAS_CALLBACK_MULTI_UP) 395 type == EVAS_CALLBACK_MULTI_UP)
396 _efl_canvas_gesture_manager_filter_event(e->gmd, eo_obj, event_info); 396 _efl_canvas_gesture_manager_filter_event(e->gesture_manager, eo_obj, event_info);
397 397
398 if (obj->is_smart) 398 if (obj->is_smart)
399 _evas_object_smart_callback_call_internal(eo_obj, efl_event_desc); 399 _evas_object_smart_callback_call_internal(eo_obj, efl_event_desc);
@@ -817,12 +817,17 @@ void
817evas_object_callbacks_event_catcher_add(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, const Efl_Callback_Array_Item *array) 817evas_object_callbacks_event_catcher_add(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, const Efl_Callback_Array_Item *array)
818{ 818{
819 Evas_Callback_Type type = EVAS_CALLBACK_LAST; 819 Evas_Callback_Type type = EVAS_CALLBACK_LAST;
820 void *gd = NULL;
820 int i; 821 int i;
821 822
822 for (i = 0; array[i].desc != NULL; i++) 823 for (i = 0; array[i].desc != NULL; i++)
823 { 824 {
824 if (obj->layer && obj->layer->evas && obj->layer->evas->gesture_manager) 825 if (obj->layer && obj->layer->evas && obj->layer->evas->gesture_manager)
825 _efl_canvas_gesture_manager_callback_add_hook(obj->layer->evas->gmd, obj->object, array[i].desc); 826 {
827 if (!gd) gd = _efl_canvas_gesture_manager_private_data_get(obj->layer->evas->gesture_manager);
828
829 _efl_canvas_gesture_manager_callback_add_hook(gd, obj->object, array[i].desc);
830 }
826 831
827 if (array[i].desc == EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK) 832 if (array[i].desc == EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK)
828 { 833 {
@@ -850,6 +855,7 @@ evas_object_callbacks_event_catcher_add(Eo *eo_obj EINA_UNUSED, Evas_Object_Prot
850void 855void
851evas_object_callbacks_event_catcher_del(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, const Efl_Callback_Array_Item *array) 856evas_object_callbacks_event_catcher_del(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, const Efl_Callback_Array_Item *array)
852{ 857{
858 void *gd = NULL;
853 int i; 859 int i;
854 860
855 if (!obj->layer || 861 if (!obj->layer ||
@@ -859,7 +865,11 @@ evas_object_callbacks_event_catcher_del(Eo *eo_obj EINA_UNUSED, Evas_Object_Prot
859 for (i = 0; array[i].desc != NULL; i++) 865 for (i = 0; array[i].desc != NULL; i++)
860 { 866 {
861 if (obj->layer->evas->gesture_manager) 867 if (obj->layer->evas->gesture_manager)
862 _efl_canvas_gesture_manager_callback_del_hook(obj->layer->evas->gmd, obj->object, array[i].desc); 868 {
869 if (!gd) gd = _efl_canvas_gesture_manager_private_data_get(obj->layer->evas->gesture_manager);
870
871 _efl_canvas_gesture_manager_callback_del_hook(gd, obj->object, array[i].desc);
872 }
863 873
864 if (array[i].desc == EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK) 874 if (array[i].desc == EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK)
865 { 875 {
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 86a7881..6d4c07c 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -312,7 +312,6 @@ _evas_canvas_efl_object_constructor(Eo *eo_obj, Evas_Public_Data *e)
312 eina_clist_init(&e->calc_done); 312 eina_clist_init(&e->calc_done);
313 313
314 efl_wref_add(efl_add(EFL_CANVAS_GESTURE_MANAGER_CLASS, eo_obj), &e->gesture_manager); 314 efl_wref_add(efl_add(EFL_CANVAS_GESTURE_MANAGER_CLASS, eo_obj), &e->gesture_manager);
315 e->gmd = efl_data_scope_get(e->gesture_manager, EFL_CANVAS_GESTURE_MANAGER_CLASS);
316 315
317#define EVAS_ARRAY_SET(E, Array) \ 316#define EVAS_ARRAY_SET(E, Array) \
318 eina_array_step_set(&E->Array, sizeof (E->Array), \ 317 eina_array_step_set(&E->Array, sizeof (E->Array), \
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.c b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
index d510318..2d821b5 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_manager.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
@@ -153,17 +153,19 @@ _efl_canvas_gesture_manager_callback_del_hook(void *data, Eo *target, const Efl_
153} 153}
154 154
155void 155void
156_efl_canvas_gesture_manager_filter_event(void *data, Eo *target, void *event) 156_efl_canvas_gesture_manager_filter_event(Eo *obj, Eo *target, void *event)
157{ 157{
158 Efl_Canvas_Gesture_Manager_Data *pd = data;
159 Eina_List *l, *gesture_context; 158 Eina_List *l, *gesture_context;
159 Efl_Canvas_Gesture_Manager_Data *pd;
160 const Efl_Event_Description *gesture_type; 160 const Efl_Event_Description *gesture_type;
161 Efl_Canvas_Gesture_Recognizer *recognizer; 161 Efl_Canvas_Gesture_Recognizer *recognizer;
162 Efl_Canvas_Gesture *gesture; 162 Efl_Canvas_Gesture *gesture;
163 Efl_Canvas_Gesture_Recognizer_Result recog_result; 163 Efl_Canvas_Gesture_Recognizer_Result recog_result;
164 Efl_Canvas_Gesture_Recognizer_Result recog_state; 164 Efl_Canvas_Gesture_Recognizer_Result recog_state;
165 Efl_Canvas_Gesture_Touch *touch_event; 165 Efl_Canvas_Gesture_Touch *touch_event;
166 Efl_Input_Pointer_Data *pointer_data = efl_data_scope_get(event, EFL_INPUT_POINTER_CLASS);
166 167
168 pd = efl_data_scope_get(obj, MY_CLASS);
167 gesture_context = eina_hash_find(pd->m_gesture_contex, &target); 169 gesture_context = eina_hash_find(pd->m_gesture_contex, &target);
168 if (gesture_context) 170 if (gesture_context)
169 { 171 {
@@ -178,7 +180,8 @@ _efl_canvas_gesture_manager_filter_event(void *data, Eo *target, void *event)
178 eina_hash_add(pd->m_object_events, &gesture_type, touch_event); 180 eina_hash_add(pd->m_object_events, &gesture_type, touch_event);
179 } 181 }
180 182
181 efl_gesture_touch_point_record(touch_event, event); 183 efl_gesture_touch_point_record(touch_event, pointer_data->touch_id, pointer_data->cur,
184 pointer_data->timestamp, pointer_data->action);
182 185
183 //This is for handling the case that mouse event pairs dont match. 186 //This is for handling the case that mouse event pairs dont match.
184 //Such as the case of canceling gesture recognition after a mouse down. 187 //Such as the case of canceling gesture recognition after a mouse down.
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_touch.c b/src/lib/evas/gesture/efl_canvas_gesture_touch.c
index 05acb53..25ff597 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_touch.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_touch.c
@@ -42,14 +42,9 @@ _efl_canvas_gesture_touch_state_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Gestur
42} 42}
43 43
44EOLIAN static void 44EOLIAN static void
45_efl_canvas_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd, void *event) 45_efl_canvas_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd,
46 int id, Eina_Vector2 pos, unsigned int timestamp, Efl_Pointer_Action action)
46{ 47{
47 Efl_Input_Pointer_Data *pointer_data = efl_data_scope_get(event, EFL_INPUT_POINTER_CLASS);
48 int id = pointer_data->touch_id;
49 int timestamp = pointer_data->timestamp;
50 Efl_Pointer_Action action = pointer_data->action;
51 Eina_Vector2 pos = pointer_data->cur;
52
53 Pointer_Data *point = eina_hash_find(pd->touch_points, &id); 48 Pointer_Data *point = eina_hash_find(pd->touch_points, &id);
54 Eina_Position2D _pos = { pos.x, pos.y }; 49 Eina_Position2D _pos = { pos.x, pos.y };
55 50
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_touch.eo b/src/lib/evas/gesture/efl_canvas_gesture_touch.eo
index 7c59969..4d274eb 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_touch.eo
+++ b/src/lib/evas/gesture/efl_canvas_gesture_touch.eo
@@ -15,7 +15,10 @@ class @beta Efl.Canvas.Gesture_Touch extends Efl.Object
15 point_record { 15 point_record {
16 [[Touch point record method]] 16 [[Touch point record method]]
17 params { 17 params {
18 @in event : void_ptr; [[The EFL_INPUT_POINTER_CLASS pointer ]] 18 @in tool : int; [[The finger id ]]
19 @in pos : Eina.Vector2; [[Position of the event]]
20 @in timestamp : uint; [[The timestamp of the event]]
21 @in action : Efl.Pointer.Action; [[action of the event]]
19 } 22 }
20 } 23 }
21 /* FIXME: This is most likely not useful (without timestamps). */ 24 /* FIXME: This is most likely not useful (without timestamps). */
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 391d816..1f514d2 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -879,7 +879,6 @@ struct _Evas_Public_Data
879 int smart_calc_count; 879 int smart_calc_count;
880 880
881 Eo *gesture_manager; 881 Eo *gesture_manager;
882 void *gmd;
883 Eo *pending_default_focus_obj; 882 Eo *pending_default_focus_obj;
884 Eina_Hash *focused_objects; //Key - seat; value - the focused object 883 Eina_Hash *focused_objects; //Key - seat; value - the focused object
885 Eina_List *focused_by; //Which seat has the canvas focus 884 Eina_List *focused_by; //Which seat has the canvas focus
@@ -1945,7 +1944,8 @@ void efl_canvas_output_info_get(Evas_Public_Data *e, Efl_Canvas_Output *output);
1945void evas_object_pixels_get_force(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); 1944void evas_object_pixels_get_force(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
1946 1945
1947// Gesture Manager 1946// Gesture Manager
1948void _efl_canvas_gesture_manager_filter_event(void *data, Eo *target, void *event); 1947void *_efl_canvas_gesture_manager_private_data_get(Eo *obj);
1948void _efl_canvas_gesture_manager_filter_event(Eo *gesture_manager, Eo *target, void *event);
1949void _efl_canvas_gesture_manager_callback_del_hook(void *data, Eo *target, const Efl_Event_Description *type); 1949void _efl_canvas_gesture_manager_callback_del_hook(void *data, Eo *target, const Efl_Event_Description *type);
1950void _efl_canvas_gesture_manager_callback_add_hook(void *data, Eo *target, const Efl_Event_Description *type); 1950void _efl_canvas_gesture_manager_callback_add_hook(void *data, Eo *target, const Efl_Event_Description *type);
1951 1951