bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3838112294d91efd121eade232e071eb3325d9e1
commit 3838112294d91efd121eade232e071eb3325d9e1 Author: Marcel Hollerbach <m...@marcel-hollerbach.de> Date: Wed Nov 27 11:45:46 2019 +0100 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. --- src/lib/evas/canvas/evas_callbacks.c | 16 +++++++++++++--- src/lib/evas/canvas/evas_main.c | 1 - src/lib/evas/gesture/efl_canvas_gesture_manager.c | 9 ++++++--- src/lib/evas/gesture/efl_canvas_gesture_touch.c | 9 ++------- src/lib/evas/gesture/efl_canvas_gesture_touch.eo | 5 ++++- src/lib/evas/include/evas_private.h | 4 ++-- 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 d9aac154f8..d19ce686da 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 type == EVAS_CALLBACK_MULTI_DOWN || type == EVAS_CALLBACK_MOUSE_UP || type == EVAS_CALLBACK_MULTI_UP) - _efl_canvas_gesture_manager_filter_event(e->gmd, eo_obj, event_info); + _efl_canvas_gesture_manager_filter_event(e->gesture_manager, eo_obj, event_info); if (obj->is_smart) _evas_object_smart_callback_call_internal(eo_obj, efl_event_desc); @@ -817,12 +817,17 @@ void evas_object_callbacks_event_catcher_add(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, const Efl_Callback_Array_Item *array) { Evas_Callback_Type type = EVAS_CALLBACK_LAST; + void *gd = NULL; int i; for (i = 0; array[i].desc != NULL; i++) { if (obj->layer && obj->layer->evas && obj->layer->evas->gesture_manager) - _efl_canvas_gesture_manager_callback_add_hook(obj->layer->evas->gmd, obj->object, array[i].desc); + { + if (!gd) gd = _efl_canvas_gesture_manager_private_data_get(obj->layer->evas->gesture_manager); + + _efl_canvas_gesture_manager_callback_add_hook(gd, obj->object, array[i].desc); + } if (array[i].desc == EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK) { @@ -850,6 +855,7 @@ evas_object_callbacks_event_catcher_add(Eo *eo_obj EINA_UNUSED, Evas_Object_Prot void evas_object_callbacks_event_catcher_del(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, const Efl_Callback_Array_Item *array) { + void *gd = NULL; int i; if (!obj->layer || @@ -859,7 +865,11 @@ evas_object_callbacks_event_catcher_del(Eo *eo_obj EINA_UNUSED, Evas_Object_Prot for (i = 0; array[i].desc != NULL; i++) { if (obj->layer->evas->gesture_manager) - _efl_canvas_gesture_manager_callback_del_hook(obj->layer->evas->gmd, obj->object, array[i].desc); + { + if (!gd) gd = _efl_canvas_gesture_manager_private_data_get(obj->layer->evas->gesture_manager); + + _efl_canvas_gesture_manager_callback_del_hook(gd, obj->object, array[i].desc); + } if (array[i].desc == EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK) { diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c index 86a7881473..6d4c07c95e 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) eina_clist_init(&e->calc_done); efl_wref_add(efl_add(EFL_CANVAS_GESTURE_MANAGER_CLASS, eo_obj), &e->gesture_manager); - e->gmd = efl_data_scope_get(e->gesture_manager, EFL_CANVAS_GESTURE_MANAGER_CLASS); #define EVAS_ARRAY_SET(E, Array) \ 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 d5103186e1..2d821b5770 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_ } void -_efl_canvas_gesture_manager_filter_event(void *data, Eo *target, void *event) +_efl_canvas_gesture_manager_filter_event(Eo *obj, Eo *target, void *event) { - Efl_Canvas_Gesture_Manager_Data *pd = data; Eina_List *l, *gesture_context; + Efl_Canvas_Gesture_Manager_Data *pd; const Efl_Event_Description *gesture_type; Efl_Canvas_Gesture_Recognizer *recognizer; Efl_Canvas_Gesture *gesture; Efl_Canvas_Gesture_Recognizer_Result recog_result; Efl_Canvas_Gesture_Recognizer_Result recog_state; Efl_Canvas_Gesture_Touch *touch_event; + Efl_Input_Pointer_Data *pointer_data = efl_data_scope_get(event, EFL_INPUT_POINTER_CLASS); + pd = efl_data_scope_get(obj, MY_CLASS); gesture_context = eina_hash_find(pd->m_gesture_contex, &target); if (gesture_context) { @@ -178,7 +180,8 @@ _efl_canvas_gesture_manager_filter_event(void *data, Eo *target, void *event) eina_hash_add(pd->m_object_events, &gesture_type, touch_event); } - efl_gesture_touch_point_record(touch_event, event); + efl_gesture_touch_point_record(touch_event, pointer_data->touch_id, pointer_data->cur, + pointer_data->timestamp, pointer_data->action); //This is for handling the case that mouse event pairs dont match. //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 05acb536f4..25ff597df3 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 } EOLIAN static void -_efl_canvas_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd, void *event) +_efl_canvas_gesture_touch_point_record(Eo *obj EINA_UNUSED, Efl_Canvas_Gesture_Touch_Data *pd, + int id, Eina_Vector2 pos, unsigned int timestamp, Efl_Pointer_Action action) { - Efl_Input_Pointer_Data *pointer_data = efl_data_scope_get(event, EFL_INPUT_POINTER_CLASS); - int id = pointer_data->touch_id; - int timestamp = pointer_data->timestamp; - Efl_Pointer_Action action = pointer_data->action; - Eina_Vector2 pos = pointer_data->cur; - Pointer_Data *point = eina_hash_find(pd->touch_points, &id); Eina_Position2D _pos = { pos.x, pos.y }; diff --git a/src/lib/evas/gesture/efl_canvas_gesture_touch.eo b/src/lib/evas/gesture/efl_canvas_gesture_touch.eo index 7c59969d0a..4d274eb096 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 point_record { [[Touch point record method]] params { - @in event : void_ptr; [[The EFL_INPUT_POINTER_CLASS pointer ]] + @in tool : int; [[The finger id ]] + @in pos : Eina.Vector2; [[Position of the event]] + @in timestamp : uint; [[The timestamp of the event]] + @in action : Efl.Pointer.Action; [[action of the event]] } } /* 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 391d816f96..1f514d205c 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 int smart_calc_count; Eo *gesture_manager; - void *gmd; Eo *pending_default_focus_obj; Eina_Hash *focused_objects; //Key - seat; value - the focused object 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); void evas_object_pixels_get_force(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj); // Gesture Manager -void _efl_canvas_gesture_manager_filter_event(void *data, Eo *target, void *event); +void *_efl_canvas_gesture_manager_private_data_get(Eo *obj); +void _efl_canvas_gesture_manager_filter_event(Eo *gesture_manager, Eo *target, void *event); void _efl_canvas_gesture_manager_callback_del_hook(void *data, Eo *target, const Efl_Event_Description *type); void _efl_canvas_gesture_manager_callback_add_hook(void *data, Eo *target, const Efl_Event_Description *type); --