summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-02-20 13:55:40 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-03 10:54:39 +0100
commit710c05ed5ae8d470c9efd2f15b059144672fc6ab (patch)
treed915f06f7b8ad3a0ef84563e735bae78c0f734f7
parent6d9f8416e7237134d0092ce740135de6c3df4ed6 (diff)
efl/gesture: deduplicate some code
also remove a misleading comment no functional changes Differential Revision: https://phab.enlightenment.org/D11395
-rw-r--r--src/lib/evas/gesture/efl_canvas_gesture_manager.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.c b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
index 7a50a687f1..a05794fd91 100644
--- a/src/lib/evas/gesture/efl_canvas_gesture_manager.c
+++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.c
@@ -247,6 +247,15 @@ _efl_canvas_gesture_manager_callback_del_hook(void *data, Eo *target, const Efl_
247} 247}
248 248
249static void 249static void
250_recognizer_cleanup_internal(Efl_Canvas_Gesture_Manager_Data *pd, const Efl_Canvas_Gesture_Recognizer *recognizer, const Eo *target, const Efl_Event_Description *type)
251{
252 _cleanup_cached_gestures(pd, target, type, recognizer);
253 eina_hash_del(pd->m_object_events, &recognizer, NULL);
254 //FIXME: delete it by object not list.
255 _cleanup_object(pd->m_gestures_to_delete);
256}
257
258static void
250_gesture_recognizer_process_internal(Efl_Canvas_Gesture_Manager_Data *pd, Efl_Canvas_Gesture_Recognizer *recognizer, 259_gesture_recognizer_process_internal(Efl_Canvas_Gesture_Manager_Data *pd, Efl_Canvas_Gesture_Recognizer *recognizer,
251 Eo *target, const Efl_Event_Description *gesture_type, void *event) 260 Eo *target, const Efl_Event_Description *gesture_type, void *event)
252{ 261{
@@ -325,12 +334,7 @@ post_event:
325 //If the current event recognizes the gesture continuously, dont delete gesture. 334 //If the current event recognizes the gesture continuously, dont delete gesture.
326 if (((recog_state == EFL_GESTURE_RECOGNIZER_RESULT_FINISH) || (recog_state == EFL_GESTURE_RECOGNIZER_RESULT_CANCEL)) && 335 if (((recog_state == EFL_GESTURE_RECOGNIZER_RESULT_FINISH) || (recog_state == EFL_GESTURE_RECOGNIZER_RESULT_CANCEL)) &&
327 !rd->continues) 336 !rd->continues)
328 { 337 _recognizer_cleanup_internal(pd, recognizer, target, gesture_type);
329 _cleanup_cached_gestures(pd, target, gesture_type, recognizer);
330 eina_hash_del(pd->m_object_events, &recognizer, NULL);
331 //FIXME: delete it by object not list.
332 _cleanup_object(pd->m_gestures_to_delete);
333 }
334} 338}
335 339
336void 340void
@@ -514,9 +518,7 @@ _efl_canvas_gesture_manager_recognizer_cleanup(Eo *obj EINA_UNUSED, Efl_Canvas_G
514 518
515 //Find the type of the recognizer 519 //Find the type of the recognizer
516 type = _gesture_recognizer_event_type_get(recognizer); 520 type = _gesture_recognizer_event_type_get(recognizer);
517 _cleanup_cached_gestures(pd, target, type, recognizer); 521 _recognizer_cleanup_internal(pd, recognizer, target, type);
518 eina_hash_del(pd->m_object_events, &recognizer, NULL);
519 _cleanup_object(pd->m_gestures_to_delete);
520} 522}
521 523
522#include "efl_canvas_gesture_manager.eo.c" 524#include "efl_canvas_gesture_manager.eo.c"