summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-08-17 19:11:53 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-08-26 10:18:00 +0900
commit405680e836eb47d7dd8f59a4761386e7a80d9244 (patch)
tree27049a6ec8801c5ce2fca6e5f5c1528bf67b3629
parent290413543da19c67c8458f61feb38beb0ae373d8 (diff)
evas events: Switch hold event to new eo type
Evas_Event_Hold is now barely used anywhere. This also adds support for event_flags to this type.
-rw-r--r--src/lib/efl/interfaces/efl_common_internal.h1
-rw-r--r--src/lib/evas/canvas/efl_event_hold.c9
-rw-r--r--src/lib/evas/canvas/evas_events.c38
-rw-r--r--src/lib/evas/canvas/evas_events_legacy.c4
4 files changed, 27 insertions, 25 deletions
diff --git a/src/lib/efl/interfaces/efl_common_internal.h b/src/lib/efl/interfaces/efl_common_internal.h
index fcae220924..b095b90eaf 100644
--- a/src/lib/efl/interfaces/efl_common_internal.h
+++ b/src/lib/efl/interfaces/efl_common_internal.h
@@ -95,6 +95,7 @@ struct _Efl_Event_Hold_Data
95{ 95{
96 Eo *eo; 96 Eo *eo;
97 double timestamp; 97 double timestamp;
98 Efl_Event_Flags event_flags;
98 Efl_Input_Device *device; 99 Efl_Input_Device *device;
99 void *data; 100 void *data;
100 void *legacy; /* DO NOT TOUCH THIS */ 101 void *legacy; /* DO NOT TOUCH THIS */
diff --git a/src/lib/evas/canvas/efl_event_hold.c b/src/lib/evas/canvas/efl_event_hold.c
index ff30336823..9e51da0e22 100644
--- a/src/lib/evas/canvas/efl_event_hold.c
+++ b/src/lib/evas/canvas/efl_event_hold.c
@@ -48,16 +48,15 @@ _efl_event_hold_efl_event_timestamp_set(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data
48} 48}
49 49
50EOLIAN static void 50EOLIAN static void
51_efl_event_hold_efl_event_input_event_flags_set(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd EINA_UNUSED, Efl_Event_Flags flags EINA_UNUSED) 51_efl_event_hold_efl_event_input_event_flags_set(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd, Efl_Event_Flags flags)
52{ 52{
53 // ignore 53 pd->event_flags = flags;
54} 54}
55 55
56EOLIAN static Efl_Event_Flags 56EOLIAN static Efl_Event_Flags
57_efl_event_hold_efl_event_input_event_flags_get(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd EINA_UNUSED) 57_efl_event_hold_efl_event_input_event_flags_get(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd)
58{ 58{
59 // ignore 59 return pd->event_flags;
60 return 0;
61} 60}
62 61
63EOLIAN static Eo * 62EOLIAN static Eo *
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index b3c584504a..acd2b2e161 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -813,14 +813,12 @@ _evas_event_source_mouse_up_events(Evas_Object *eo_obj, Evas *eo_e,
813} 813}
814 814
815static void 815static void
816_evas_event_source_hold_events(Evas_Object *eo_obj, Evas *eo_e EINA_UNUSED, void *ev, 816_evas_event_source_hold_events(Evas_Object *eo_obj, int event_id, Efl_Event_Hold *evt)
817 int event_id, Efl_Event_Hold *parent_he)
818{ 817{
819 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 818 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
820 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj); 819 Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
821 Evas_Object_Protected_Data *src = efl_data_scope_get(eo_src, EFL_CANVAS_OBJECT_CLASS); 820 Evas_Object_Protected_Data *src = efl_data_scope_get(eo_src, EFL_CANVAS_OBJECT_CLASS);
822 Evas_Object_Protected_Data *child; 821 Evas_Object_Protected_Data *child;
823 Efl_Event_Hold *he = NULL;
824 Evas_Object *eo_child; 822 Evas_Object *eo_child;
825 Eina_List *l; 823 Eina_List *l;
826 824
@@ -830,11 +828,10 @@ _evas_event_source_hold_events(Evas_Object *eo_obj, Evas *eo_e EINA_UNUSED, void
830 { 828 {
831 if (src->delete_me) return; 829 if (src->delete_me) return;
832 child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS); 830 child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS);
833 EV_CALL(eo_child, child, EVAS_CALLBACK_HOLD, ev, event_id, he, parent_he); 831 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HOLD, NULL,
832 event_id, EFL_EVENT_HOLD, evt);
834 if (src->layer->evas->delete_me) break; 833 if (src->layer->evas->delete_me) break;
835 } 834 }
836
837 EV_DEL(he);
838} 835}
839 836
840static void 837static void
@@ -3131,9 +3128,9 @@ EAPI void
3131evas_event_feed_hold(Eo *eo_e, int hold, unsigned int timestamp, const void *data) 3128evas_event_feed_hold(Eo *eo_e, int hold, unsigned int timestamp, const void *data)
3132{ 3129{
3133 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 3130 Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
3134 Efl_Event_Hold *he = NULL; 3131 Efl_Event_Hold_Data *ev = NULL;
3132 Efl_Event_Hold *evt;
3135 Eina_List *l, *copy; 3133 Eina_List *l, *copy;
3136 Evas_Event_Hold ev;
3137 Evas_Object *eo_obj; 3134 Evas_Object *eo_obj;
3138 int event_id = 0; 3135 int event_id = 0;
3139 3136
@@ -3141,14 +3138,16 @@ evas_event_feed_hold(Eo *eo_e, int hold, unsigned int timestamp, const void *dat
3141 e->last_timestamp = timestamp; 3138 e->last_timestamp = timestamp;
3142 3139
3143 _evas_object_event_new(); 3140 _evas_object_event_new();
3144
3145 event_id = _evas_event_counter; 3141 event_id = _evas_event_counter;
3146 ev.hold = hold; 3142
3147 ev.data = (void *)data; 3143 evt = efl_event_instance_get(EFL_EVENT_HOLD_CLASS, eo_e, &ev);
3148 ev.timestamp = timestamp; 3144 if (!ev) return;
3149 ev.event_flags = e->default_event_flags; 3145
3150 ev.dev = _evas_device_top_get(eo_e); 3146 ev->hold = !!hold;
3151 if (ev.dev) efl_ref(ev.dev); 3147 ev->data = (void *) data;
3148 ev->timestamp = timestamp;
3149 ev->event_flags = e->default_event_flags;
3150 ev->device = efl_ref(_evas_device_top_get(eo_e));
3152 3151
3153 _evas_walk(e); 3152 _evas_walk(e);
3154 copy = evas_event_list_copy(e->pointer.object.in); 3153 copy = evas_event_list_copy(e->pointer.object.in);
@@ -3157,19 +3156,20 @@ evas_event_feed_hold(Eo *eo_e, int hold, unsigned int timestamp, const void *dat
3157 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 3156 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
3158 if ( !evas_event_freezes_through(eo_obj, obj)) 3157 if ( !evas_event_freezes_through(eo_obj, obj))
3159 { 3158 {
3160 EV_CALL(eo_obj, obj, EVAS_CALLBACK_HOLD, &ev, event_id, he, NULL); 3159 evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HOLD, NULL,
3160 event_id, EFL_EVENT_HOLD, evt);
3161 if ((obj->proxy->is_proxy) && (obj->proxy->src_events)) 3161 if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
3162 _evas_event_source_hold_events(eo_obj, eo_e, &ev, event_id, he); 3162 _evas_event_source_hold_events(eo_obj, event_id, evt);
3163 } 3163 }
3164 if (e->delete_me || e->is_frozen) break; 3164 if (e->delete_me || e->is_frozen) break;
3165 } 3165 }
3166 eina_list_free(copy); 3166 eina_list_free(copy);
3167 _evas_post_event_callback_call(eo_e, e); 3167 _evas_post_event_callback_call(eo_e, e);
3168 if (ev.dev) efl_unref(ev.dev);
3169 _evas_unwalk(e); 3168 _evas_unwalk(e);
3170 _evas_object_event_new(); 3169 _evas_object_event_new();
3171 3170
3172 EV_DEL(he); 3171 efl_unref(ev->device);
3172 efl_del(evt);
3173} 3173}
3174 3174
3175void 3175void
diff --git a/src/lib/evas/canvas/evas_events_legacy.c b/src/lib/evas/canvas/evas_events_legacy.c
index ff9c01b178..a42ae643fb 100644
--- a/src/lib/evas/canvas/evas_events_legacy.c
+++ b/src/lib/evas/canvas/evas_events_legacy.c
@@ -543,6 +543,8 @@ efl_event_hold_legacy_info_set(Efl_Event_Hold *evt, const void *event_info, Evas
543 ev->timestamp = e->timestamp; 543 ev->timestamp = e->timestamp;
544 ev->device = e->dev; 544 ev->device = e->dev;
545 ev->hold = !!e->hold; 545 ev->hold = !!e->hold;
546 ev->event_flags = e->event_flags;
547 ev->data = e->data;
546 548
547 return EINA_TRUE; 549 return EINA_TRUE;
548} 550}
@@ -559,7 +561,7 @@ efl_event_hold_legacy_info_fill(Efl_Event_Hold *evt, Evas_Event_Flags **pflags)
559 e->timestamp = ev->timestamp; 561 e->timestamp = ev->timestamp;
560 e->dev = ev->device; 562 e->dev = ev->device;
561 e->hold = ev->hold; 563 e->hold = ev->hold;
562 e->event_flags = 0; // FIXME? 564 e->event_flags = ev->event_flags;
563 if (pflags) *pflags = &e->event_flags; 565 if (pflags) *pflags = &e->event_flags;
564 ev->legacy = e; 566 ev->legacy = e;
565 567