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.
This commit is contained in:
Jean-Philippe Andre 2016-05-30 19:51:31 +09:00
parent c68f71239c
commit 1950fb6fde
2 changed files with 17 additions and 9 deletions

View File

@ -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)

View File

@ -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 {