aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas
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 /src/lib/evas
parentevas events: Switch wheel event to the new type (diff)
downloadefl-405680e836eb47d7dd8f59a4761386e7a80d9244.tar.gz
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.
Diffstat (limited to 'src/lib/evas')
-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
3 files changed, 26 insertions, 25 deletions
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
}
EOLIAN static void
-_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)
+_efl_event_hold_efl_event_input_event_flags_set(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd, Efl_Event_Flags flags)
{
- // ignore
+ pd->event_flags = flags;
}
EOLIAN static Efl_Event_Flags
-_efl_event_hold_efl_event_input_event_flags_get(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd EINA_UNUSED)
+_efl_event_hold_efl_event_input_event_flags_get(Eo *obj EINA_UNUSED, Efl_Event_Hold_Data *pd)
{
- // ignore
- return 0;
+ return pd->event_flags;
}
EOLIAN 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,
}
static void
-_evas_event_source_hold_events(Evas_Object *eo_obj, Evas *eo_e EINA_UNUSED, void *ev,
- int event_id, Efl_Event_Hold *parent_he)
+_evas_event_source_hold_events(Evas_Object *eo_obj, int event_id, Efl_Event_Hold *evt)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
Evas_Object *eo_src = _evas_object_image_source_get(eo_obj);
Evas_Object_Protected_Data *src = efl_data_scope_get(eo_src, EFL_CANVAS_OBJECT_CLASS);
Evas_Object_Protected_Data *child;
- Efl_Event_Hold *he = NULL;
Evas_Object *eo_child;
Eina_List *l;
@@ -830,11 +828,10 @@ _evas_event_source_hold_events(Evas_Object *eo_obj, Evas *eo_e EINA_UNUSED, void
{
if (src->delete_me) return;
child = efl_data_scope_get(eo_child, EFL_CANVAS_OBJECT_CLASS);
- EV_CALL(eo_child, child, EVAS_CALLBACK_HOLD, ev, event_id, he, parent_he);
+ evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HOLD, NULL,
+ event_id, EFL_EVENT_HOLD, evt);
if (src->layer->evas->delete_me) break;
}
-
- EV_DEL(he);
}
static void
@@ -3131,9 +3128,9 @@ EAPI void
evas_event_feed_hold(Eo *eo_e, int hold, unsigned int timestamp, const void *data)
{
Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
- Efl_Event_Hold *he = NULL;
+ Efl_Event_Hold_Data *ev = NULL;
+ Efl_Event_Hold *evt;
Eina_List *l, *copy;
- Evas_Event_Hold ev;
Evas_Object *eo_obj;
int event_id = 0;
@@ -3141,14 +3138,16 @@ evas_event_feed_hold(Eo *eo_e, int hold, unsigned int timestamp, const void *dat
e->last_timestamp = timestamp;
_evas_object_event_new();
-
event_id = _evas_event_counter;
- ev.hold = hold;
- ev.data = (void *)data;
- ev.timestamp = timestamp;
- ev.event_flags = e->default_event_flags;
- ev.dev = _evas_device_top_get(eo_e);
- if (ev.dev) efl_ref(ev.dev);
+
+ evt = efl_event_instance_get(EFL_EVENT_HOLD_CLASS, eo_e, &ev);
+ if (!ev) return;
+
+ ev->hold = !!hold;
+ ev->data = (void *) data;
+ ev->timestamp = timestamp;
+ ev->event_flags = e->default_event_flags;
+ ev->device = efl_ref(_evas_device_top_get(eo_e));
_evas_walk(e);
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
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
if ( !evas_event_freezes_through(eo_obj, obj))
{
- EV_CALL(eo_obj, obj, EVAS_CALLBACK_HOLD, &ev, event_id, he, NULL);
+ evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HOLD, NULL,
+ event_id, EFL_EVENT_HOLD, evt);
if ((obj->proxy->is_proxy) && (obj->proxy->src_events))
- _evas_event_source_hold_events(eo_obj, eo_e, &ev, event_id, he);
+ _evas_event_source_hold_events(eo_obj, event_id, evt);
}
if (e->delete_me || e->is_frozen) break;
}
eina_list_free(copy);
_evas_post_event_callback_call(eo_e, e);
- if (ev.dev) efl_unref(ev.dev);
_evas_unwalk(e);
_evas_object_event_new();
- EV_DEL(he);
+ efl_unref(ev->device);
+ efl_del(evt);
}
void
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
ev->timestamp = e->timestamp;
ev->device = e->dev;
ev->hold = !!e->hold;
+ ev->event_flags = e->event_flags;
+ ev->data = e->data;
return EINA_TRUE;
}
@@ -559,7 +561,7 @@ efl_event_hold_legacy_info_fill(Efl_Event_Hold *evt, Evas_Event_Flags **pflags)
e->timestamp = ev->timestamp;
e->dev = ev->device;
e->hold = ev->hold;
- e->event_flags = 0; // FIXME?
+ e->event_flags = ev->event_flags;
if (pflags) *pflags = &e->event_flags;
ev->legacy = e;