From 1950fb6fde791edfa9396b97cc6a637e015c1363 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Mon, 30 May 2016 19:51:31 +0900 Subject: [PATCH] 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. --- src/lib/elementary/elm_win.c | 17 +++++++++++++++++ src/lib/evas/canvas/efl_pointer_event.eo | 9 --------- 2 files changed, 17 insertions(+), 9 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) diff --git a/src/lib/evas/canvas/efl_pointer_event.eo b/src/lib/evas/canvas/efl_pointer_event.eo index 96e923ef65..8e614d94cf 100644 --- a/src/lib/evas/canvas/efl_pointer_event.eo +++ b/src/lib/evas/canvas/efl_pointer_event.eo @@ -49,15 +49,6 @@ class Efl.Pointer.Event (Eo.Base, Efl.Event, Efl.Input.State) y: int; } } - /* - @property input_state { - [[Carries information about keyboard modifiers and locks - at the moment of this event (eg. Ctrl, Alt or Caps Lock, Num Lock).]] - values { - modifiers: Efl.Input.State*; [[Can be $null (no info about state).]] - } - } - */ @property device { [[Pointing device that originated this event.]] values {