summaryrefslogtreecommitdiff
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
parentc68f71239c0595708c4d9145bf52b75e27321104 (diff)
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.
-rw-r--r--src/lib/elementary/elm_win.c17
-rw-r--r--src/lib/evas/canvas/efl_pointer_event.eo9
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
1625 return EINA_TRUE; 1625 return EINA_TRUE;
1626} 1626}
1627 1627
1628static Eina_Bool
1629_evas_event_pointer_cb(void *data, const Eo_Event *ev)
1630{
1631 Eo *win = data;
1632 Eo *evt = ev->info;
1633
1634 eo_event_callback_call(win, EFL_GFX_EVENT_POINTER, evt);
1635 return EO_CALLBACK_CONTINUE;
1636}
1637
1638EO_CALLBACKS_ARRAY_DEFINE(_elm_win_evas_forward_callbacks,
1639 { EVAS_CANVAS_EVENT_POINTER, _evas_event_pointer_cb })
1640
1628static void 1641static void
1629_deferred_ecore_evas_free(void *data) 1642_deferred_ecore_evas_free(void *data)
1630{ 1643{
@@ -1972,6 +1985,8 @@ _elm_win_evas_object_smart_del(Eo *obj, Elm_Win_Data *sd)
1972 EVAS_CALLBACK_CHANGED_SIZE_HINTS, 1985 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1973 _elm_win_on_resize_obj_changed_size_hints, 1986 _elm_win_on_resize_obj_changed_size_hints,
1974 obj); 1987 obj);
1988 eo_event_callback_array_del(sd->evas, _elm_win_evas_forward_callbacks(), obj);
1989
1975 evas_object_del(sd->box); 1990 evas_object_del(sd->box);
1976 evas_object_del(sd->edje); 1991 evas_object_del(sd->edje);
1977 1992
@@ -4028,6 +4043,8 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_
4028 if (_elm_config->atspi_mode) 4043 if (_elm_config->atspi_mode)
4029 elm_interface_atspi_window_created_signal_emit(obj); 4044 elm_interface_atspi_window_created_signal_emit(obj);
4030 4045
4046 eo_event_callback_array_add(sd->evas, _elm_win_evas_forward_callbacks(), obj);
4047
4031 evas_object_show(sd->edje); 4048 evas_object_show(sd->edje);
4032 4049
4033 if (type == ELM_WIN_FAKE) 4050 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)
49 y: int; 49 y: int;
50 } 50 }
51 } 51 }
52 /*
53 @property input_state {
54 [[Carries information about keyboard modifiers and locks
55 at the moment of this event (eg. Ctrl, Alt or Caps Lock, Num Lock).]]
56 values {
57 modifiers: Efl.Input.State*; [[Can be $null (no info about state).]]
58 }
59 }
60 */
61 @property device { 52 @property device {
62 [[Pointing device that originated this event.]] 53 [[Pointing device that originated this event.]]
63 values { 54 values {