aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/elm_win.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-05-30 19:51:31 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-05-31 19:03:04 +0900
commit1950fb6fde791edfa9396b97cc6a637e015c1363 (patch)
tree24615d1a074e277117616ce6f22ff2f294250225 /src/lib/elementary/elm_win.c
parentEvas events: Add EO APIs for lock & modifiers (diff)
downloadefl-1950fb6fde791edfa9396b97cc6a637e015c1363.tar.gz
Elm win: Forward pointer events from evas to window
This will allow applications to listen to those events on the whole window. Necessary since they won't have access to Evas with EO APIs.
Diffstat (limited to 'src/lib/elementary/elm_win.c')
-rw-r--r--src/lib/elementary/elm_win.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_win.c b/src/lib/elementary/elm_win.c
index fc7e6bc650..622edc992b 100644
--- a/src/lib/elementary/elm_win.c
+++ b/src/lib/elementary/elm_win.c
@@ -1625,6 +1625,19 @@ _elm_win_elm_widget_event(Eo *obj, Elm_Win_Data *_pd EINA_UNUSED, Evas_Object *s
return EINA_TRUE;
}
+static Eina_Bool
+_evas_event_pointer_cb(void *data, const Eo_Event *ev)
+{
+ Eo *win = data;
+ Eo *evt = ev->info;
+
+ eo_event_callback_call(win, EFL_GFX_EVENT_POINTER, evt);
+ return EO_CALLBACK_CONTINUE;
+}
+
+EO_CALLBACKS_ARRAY_DEFINE(_elm_win_evas_forward_callbacks,
+ { EVAS_CANVAS_EVENT_POINTER, _evas_event_pointer_cb })
+
static void
_deferred_ecore_evas_free(void *data)
{
@@ -1972,6 +1985,8 @@ _elm_win_evas_object_smart_del(Eo *obj, Elm_Win_Data *sd)
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_elm_win_on_resize_obj_changed_size_hints,
obj);
+ eo_event_callback_array_del(sd->evas, _elm_win_evas_forward_callbacks(), obj);
+
evas_object_del(sd->box);
evas_object_del(sd->edje);
@@ -4028,6 +4043,8 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
if (_elm_config->atspi_mode)
elm_interface_atspi_window_created_signal_emit(obj);
+ eo_event_callback_array_add(sd->evas, _elm_win_evas_forward_callbacks(), obj);
+
evas_object_show(sd->edje);
if (type == ELM_WIN_FAKE)