summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorsmohanty <smohantty@gmail.com>2017-09-19 17:17:39 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-10-19 10:33:12 +0900
commit28869a939508ce30d4102b81635a655eb2514eea (patch)
treeacacc104b4bd563654a5f26b753b0c81b71a543e /src/lib/evas
parent9da7a7f0d23f0240a1af721fd771667b9e0de3ba (diff)
evas/gesture: Integrated gesture framework to evas.
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/canvas/evas_callbacks.c15
-rw-r--r--src/lib/evas/canvas/evas_main.c7
-rw-r--r--src/lib/evas/include/evas_private.h7
3 files changed, 28 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/evas_callbacks.c b/src/lib/evas/canvas/evas_callbacks.c
index 184b500743..61e7ce8dcc 100644
--- a/src/lib/evas/canvas/evas_callbacks.c
+++ b/src/lib/evas/canvas/evas_callbacks.c
@@ -378,6 +378,15 @@ evas_object_event_callback_call(Evas_Object *eo_obj, Evas_Object_Protected_Data
378 378
379 _evas_walk(e); 379 _evas_walk(e);
380 380
381 // gesture hook
382 if ( type == EVAS_CALLBACK_MOUSE_MOVE ||
383 type == EVAS_CALLBACK_MULTI_MOVE ||
384 type == EVAS_CALLBACK_MOUSE_DOWN ||
385 type == EVAS_CALLBACK_MULTI_DOWN ||
386 type == EVAS_CALLBACK_MOUSE_UP ||
387 type == EVAS_CALLBACK_MULTI_UP)
388 _efl_gesture_manager_filter_event(e->gesture_manager, eo_obj, event_info);
389
381 if (!_evas_object_callback_has_by_type(obj, type)) 390 if (!_evas_object_callback_has_by_type(obj, type))
382 goto nothing_here; 391 goto nothing_here;
383 392
@@ -698,6 +707,9 @@ _check_event_catcher_add(void *data, const Efl_Event *event)
698 707
699 for (i = 0; array[i].desc != NULL; i++) 708 for (i = 0; array[i].desc != NULL; i++)
700 { 709 {
710 if (obj->layer->evas->gesture_manager)
711 _efl_gesture_manager_callback_add_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc);
712
701 if (array[i].desc == EFL_EVENT_ANIMATOR_TICK) 713 if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
702 { 714 {
703 if (obj->animator_ref++ > 0) break; 715 if (obj->animator_ref++ > 0) break;
@@ -722,6 +734,9 @@ _check_event_catcher_del(void *data, const Efl_Event *event)
722 734
723 for (i = 0; array[i].desc != NULL; i++) 735 for (i = 0; array[i].desc != NULL; i++)
724 { 736 {
737 if (obj->layer->evas->gesture_manager)
738 _efl_gesture_manager_callback_del_hook(obj->layer->evas->gesture_manager, obj->object, array[i].desc);
739
725 if (array[i].desc == EFL_EVENT_ANIMATOR_TICK) 740 if (array[i].desc == EFL_EVENT_ANIMATOR_TICK)
726 { 741 {
727 if ((--obj->animator_ref) > 0) break; 742 if ((--obj->animator_ref) > 0) break;
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index fb73145010..5a2ab02eb8 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -225,6 +225,8 @@ _evas_canvas_efl_object_constructor(Eo *eo_obj, Evas_Public_Data *e)
225 eina_clist_init(&e->calc_list); 225 eina_clist_init(&e->calc_list);
226 eina_clist_init(&e->calc_done); 226 eina_clist_init(&e->calc_done);
227 227
228 e->gesture_manager = efl_add(EFL_GESTURE_MANAGER_CLASS, eo_obj);
229
228#define EVAS_ARRAY_SET(E, Array) \ 230#define EVAS_ARRAY_SET(E, Array) \
229 eina_array_step_set(&E->Array, sizeof (E->Array), \ 231 eina_array_step_set(&E->Array, sizeof (E->Array), \
230 ((1024 * sizeof (void*)) - sizeof (E->Array)) / sizeof (void*)); 232 ((1024 * sizeof (void*)) - sizeof (E->Array)) / sizeof (void*));
@@ -295,6 +297,9 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
295 _evas_post_event_callback_free(eo_e); 297 _evas_post_event_callback_free(eo_e);
296 _evas_canvas_event_shutdown(eo_e, e); 298 _evas_canvas_event_shutdown(eo_e, e);
297 299
300 efl_del(e->gesture_manager);
301 e->gesture_manager = NULL;
302
298 del = EINA_TRUE; 303 del = EINA_TRUE;
299 e->walking_list++; 304 e->walking_list++;
300 e->cleanup = 1; 305 e->cleanup = 1;
@@ -1247,7 +1252,7 @@ _evas_pointer_data_remove(Evas_Public_Data *edata, Efl_Input_Device *pointer)
1247 Evas_Pointer_Seat *pseat; 1252 Evas_Pointer_Seat *pseat;
1248 Eo *seat; 1253 Eo *seat;
1249 1254
1250 seat = efl_input_device_seat_get(pointer); 1255 seat = efl_input_device_seat_get(pointer);
1251 EINA_INLIST_FOREACH(edata->seats, pseat) 1256 EINA_INLIST_FOREACH(edata->seats, pseat)
1252 { 1257 {
1253 if (pseat->seat != seat) continue; 1258 if (pseat->seat != seat) continue;
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index df01f94a3e..dbaf8a1bf6 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -934,6 +934,7 @@ struct _Evas_Public_Data
934 int in_smart_calc; 934 int in_smart_calc;
935 int smart_calc_count; 935 int smart_calc_count;
936 936
937 Eo *gesture_manager;
937 Eo *pending_default_focus_obj; 938 Eo *pending_default_focus_obj;
938 Eina_Hash *focused_objects; //Key - seat; value - the focused object 939 Eina_Hash *focused_objects; //Key - seat; value - the focused object
939 Eina_List *focused_by; //Which seat has the canvas focus 940 Eina_List *focused_by; //Which seat has the canvas focus
@@ -2015,6 +2016,12 @@ Eina_List *_evas_pointer_list_in_rect_get(Evas_Public_Data *edata,
2015 2016
2016void efl_canvas_output_info_get(Evas_Public_Data *e, Efl_Canvas_Output *output); 2017void efl_canvas_output_info_get(Evas_Public_Data *e, Efl_Canvas_Output *output);
2017 2018
2019// Gesture Manager
2020void _efl_gesture_manager_filter_event(Eo *gesture_manager, Eo *target, void *event);
2021void _efl_gesture_manager_callback_del_hook(Eo *gesture_manager, Eo *target, const Efl_Event_Description *type);
2022void _efl_gesture_manager_callback_add_hook(Eo *gesture_manager, Eo *target, const Efl_Event_Description *type);
2023
2024
2018extern Eina_Cow *evas_object_proxy_cow; 2025extern Eina_Cow *evas_object_proxy_cow;
2019extern Eina_Cow *evas_object_map_cow; 2026extern Eina_Cow *evas_object_map_cow;
2020extern Eina_Cow *evas_object_state_cow; 2027extern Eina_Cow *evas_object_state_cow;