forked from enlightenment/efl
ecore_input: Pass all events through direct cb first
Since the direct input event callback returns true if the event has been processed, we can easily support legacy and progressively implement full support for eo input events.
This commit is contained in:
parent
5aa00004a5
commit
21bc2f89f5
|
@ -4289,61 +4289,61 @@ ecore_evas_psl1ght_new(const char* name, int w, int h)
|
|||
*/
|
||||
|
||||
static Eina_Bool
|
||||
_direct_key_down_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Key *ev EINA_UNUSED)
|
||||
_direct_key_down_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Key *info EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_direct_key_up_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Key *ev EINA_UNUSED)
|
||||
_direct_key_up_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Key *info EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_direct_mouse_down_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Button *ev EINA_UNUSED)
|
||||
_direct_mouse_down_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Button *info EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_direct_mouse_up_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Button *ev EINA_UNUSED)
|
||||
_direct_mouse_up_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Button *info EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_direct_mouse_cancel_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Button *ev EINA_UNUSED)
|
||||
_direct_mouse_cancel_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Button *info EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_direct_mouse_move_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Move *ev EINA_UNUSED)
|
||||
_direct_mouse_move_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Move *info EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_direct_mouse_wheel_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Wheel *ev EINA_UNUSED)
|
||||
_direct_mouse_wheel_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_Wheel *info EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_direct_mouse_in_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_IO *ev EINA_UNUSED)
|
||||
_direct_mouse_in_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_IO *info EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_direct_mouse_out_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_IO *ev EINA_UNUSED)
|
||||
_direct_mouse_out_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Mouse_IO *info EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_direct_axis_update_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Axis_Update *ev EINA_UNUSED)
|
||||
_direct_axis_update_cb(Ecore_Evas *ee EINA_UNUSED, const Ecore_Event_Axis_Update *info EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
|
|
@ -412,6 +412,10 @@ _ecore_event_evas_key(Ecore_Event_Key *e, Ecore_Event_Press press)
|
|||
if (!lookup) return ECORE_CALLBACK_PASS_ON;
|
||||
ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
|
||||
if (press == ECORE_DOWN)
|
||||
{
|
||||
if (!lookup->direct ||
|
||||
!lookup->direct(lookup->window, ECORE_EVENT_KEY_DOWN, e))
|
||||
{
|
||||
evas_event_feed_key_down_with_keycode(lookup->evas,
|
||||
e->keyname,
|
||||
e->key,
|
||||
|
@ -420,7 +424,13 @@ _ecore_event_evas_key(Ecore_Event_Key *e, Ecore_Event_Press press)
|
|||
e->timestamp,
|
||||
e->data,
|
||||
e->keycode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!lookup->direct ||
|
||||
!lookup->direct(lookup->window, ECORE_EVENT_KEY_DOWN, e))
|
||||
{
|
||||
evas_event_feed_key_up_with_keycode(lookup->evas,
|
||||
e->keyname,
|
||||
e->key,
|
||||
|
@ -429,6 +439,9 @@ _ecore_event_evas_key(Ecore_Event_Key *e, Ecore_Event_Press press)
|
|||
e->timestamp,
|
||||
e->data,
|
||||
e->keycode);
|
||||
}
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
|
@ -443,7 +456,11 @@ _ecore_event_evas_mouse_button_cancel(Ecore_Event_Mouse_Button *e)
|
|||
if (!lookup) return ECORE_CALLBACK_PASS_ON;
|
||||
|
||||
INF("ButtonEvent cancel, device(%d), button(%d)", e->multi.device, e->buttons);
|
||||
if (!lookup->direct ||
|
||||
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_BUTTON_CANCEL, e))
|
||||
{
|
||||
evas_event_feed_mouse_cancel(lookup->evas, e->timestamp, NULL);
|
||||
}
|
||||
|
||||
//the number of last event is small, simple check is ok.
|
||||
EINA_LIST_FOREACH(_last_events, l, eel)
|
||||
|
@ -507,15 +524,30 @@ _ecore_event_evas_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press pr
|
|||
{
|
||||
ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
|
||||
if (press == ECORE_DOWN)
|
||||
{
|
||||
if (!lookup->direct ||
|
||||
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_BUTTON_DOWN, e))
|
||||
{
|
||||
evas_event_feed_mouse_down(lookup->evas, e->buttons, flags,
|
||||
e->timestamp, NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!lookup->direct ||
|
||||
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_BUTTON_UP, e))
|
||||
{
|
||||
evas_event_feed_mouse_up(lookup->evas, e->buttons, flags,
|
||||
e->timestamp, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (press == ECORE_DOWN)
|
||||
{
|
||||
if (!lookup->direct ||
|
||||
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_BUTTON_DOWN, e))
|
||||
{
|
||||
if (lookup->down_multi)
|
||||
lookup->down_multi(lookup->window, e->multi.device,
|
||||
|
@ -532,7 +564,11 @@ _ecore_event_evas_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press pr
|
|||
e->multi.x, e->multi.y, flags,
|
||||
e->timestamp, NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!lookup->direct ||
|
||||
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_BUTTON_UP, e))
|
||||
{
|
||||
if (lookup->up_multi)
|
||||
lookup->up_multi(lookup->window, e->multi.device,
|
||||
|
@ -550,6 +586,7 @@ _ecore_event_evas_mouse_button(Ecore_Event_Mouse_Button *e, Ecore_Event_Press pr
|
|||
e->timestamp, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
|
@ -622,10 +659,18 @@ _ecore_event_evas_mouse_io(Ecore_Event_Mouse_IO *e, Ecore_Event_IO io)
|
|||
switch (io)
|
||||
{
|
||||
case ECORE_IN:
|
||||
if (!lookup->direct ||
|
||||
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_IN, e))
|
||||
{
|
||||
evas_event_feed_mouse_in(lookup->evas, e->timestamp, NULL);
|
||||
}
|
||||
break;
|
||||
case ECORE_OUT:
|
||||
if (!lookup->direct ||
|
||||
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_OUT, e))
|
||||
{
|
||||
evas_event_feed_mouse_out(lookup->evas, e->timestamp, NULL);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -657,7 +702,12 @@ ecore_event_evas_mouse_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void
|
|||
lookup = _ecore_event_window_match(e->event_window);
|
||||
if (!lookup) return ECORE_CALLBACK_PASS_ON;
|
||||
ecore_event_evas_modifier_lock_update(lookup->evas, e->modifiers);
|
||||
if (!lookup->direct ||
|
||||
!lookup->direct(lookup->window, ECORE_EVENT_MOUSE_WHEEL, e))
|
||||
{
|
||||
evas_event_feed_mouse_wheel(lookup->evas, e->direction, e->z, e->timestamp, NULL);
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
|
@ -682,9 +732,14 @@ ecore_event_evas_axis_update(void *data EINA_UNUSED, int type EINA_UNUSED, void
|
|||
e = event;
|
||||
lookup = _ecore_event_window_match(e->event_window);
|
||||
if (!lookup) return ECORE_CALLBACK_PASS_ON;
|
||||
if (!lookup->direct ||
|
||||
!lookup->direct(lookup->window, ECORE_EVENT_AXIS_UPDATE, e))
|
||||
{
|
||||
evas_event_feed_axis_update(lookup->evas, e->timestamp, e->device,
|
||||
e->toolid, e->naxis,
|
||||
(Evas_Axis *)e->axis, NULL);
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue