efl: Simplify pointer event names + add missing

No more difference between touch & mouse.
Add axis, cancel, in and out.
This commit is contained in:
Jean-Philippe Andre 2016-05-11 20:13:19 +09:00
parent c1be667a6c
commit ef843e8801
4 changed files with 30 additions and 28 deletions

View File

@ -4369,13 +4369,13 @@ _direct_mouse_updown(Ecore_Evas *ee, const Ecore_Event_Mouse_Button *info, Efl_P
static Eina_Bool
_direct_mouse_down_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Button *info)
{
return _direct_mouse_updown(ee, info, EFL_POINTER_ACTION_MOUSE_DOWN);
return _direct_mouse_updown(ee, info, EFL_POINTER_ACTION_DOWN);
}
static Eina_Bool
_direct_mouse_up_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Button *info)
{
return _direct_mouse_updown(ee, info, EFL_POINTER_ACTION_MOUSE_UP);
return _direct_mouse_updown(ee, info, EFL_POINTER_ACTION_UP);
}
static Eina_Bool
@ -4405,7 +4405,7 @@ _direct_mouse_move_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Move *info)
evt = efl_pointer_event_instance_get(EFL_POINTER_EVENT_CLASS, e, (void **) &ev);
if (!evt) return EINA_FALSE;
ev->action = EFL_POINTER_ACTION_MOUSE_MOVE;
ev->action = EFL_POINTER_ACTION_MOVE;
ev->timestamp = info->timestamp;
ev->finger = info->multi.device;
_pointer_position_set(ev, ee, info->x, info->y, info->multi.x, info->multi.y);
@ -4443,7 +4443,7 @@ _direct_mouse_wheel_cb(Ecore_Evas *ee, const Ecore_Event_Mouse_Wheel *info)
evt = efl_pointer_event_instance_get(EFL_POINTER_EVENT_CLASS, e, (void **) &ev);
if (!evt) return EINA_FALSE;
ev->action = EFL_POINTER_ACTION_MOUSE_WHEEL;
ev->action = EFL_POINTER_ACTION_WHEEL;
ev->timestamp = info->timestamp;
_pointer_position_set(ev, ee, info->x, info->y, info->x, info->y);
ev->wheel.z = info->z;

View File

@ -5,15 +5,17 @@ enum Efl.Pointer.Action
@since 1.18
]]
none, [[Not a valid event.]]
mouse_move, [[Mouse or equivalent pointer moved.]]
mouse_down, [[Mouse button pressed down.]]
mouse_up, [[Mouse button released.]]
mouse_wheel, [[Mouse wheel scroll, horizontally or vertically.]]
touch_move, [[Finger moved while touching surface.]]
touch_down, [[Finger touch made contact.]]
touch_up, [[Finger touch released.]]
hover, [[A hovering movement over a distance-sensitive touch screen.]]
none, [[Not a valid event.]]
move, [[Mouse or equivalent pointer moved.]]
down, [[Mouse button or equivalent pointer pressed down.
Always followed by up or cancel.]]
up, [[Mouse button or equivalent pointer released. See also cancel.]]
cancel, [[Special event happening after a down if the up counterpart
can not happen (eg. another window forcibly stole the focus).]]
in, [[Mouse or pointer entered the object.]]
out, [[Mouse or pointer exited the object.]]
wheel, [[Mouse wheel scroll, horizontally or vertically.]]
axis, [[Joystick event.]]
}
enum Efl.Pointer.Button_Flags

View File

@ -3054,7 +3054,7 @@ _evas_canvas_event_pointer_cb(void *data, const Eo_Event *event)
switch (ev->action)
{
case EFL_POINTER_ACTION_MOUSE_MOVE:
case EFL_POINTER_ACTION_MOVE:
if (ev->finger == 0)
{
_canvas_event_feed_mouse_move_internal(eo_e, e, ev->cur.x, ev->cur.y,
@ -3071,7 +3071,7 @@ _evas_canvas_event_pointer_cb(void *data, const Eo_Event *event)
ev->evas_done = EINA_TRUE;
break;
case EFL_POINTER_ACTION_MOUSE_DOWN:
case EFL_POINTER_ACTION_DOWN:
if (ev->finger == 0)
{
evas_event_feed_mouse_down(eo_e, ev->button, ev->button_flags, ev->timestamp, ev->data);
@ -3087,7 +3087,7 @@ _evas_canvas_event_pointer_cb(void *data, const Eo_Event *event)
ev->evas_done = EINA_TRUE;
break;
case EFL_POINTER_ACTION_MOUSE_UP:
case EFL_POINTER_ACTION_UP:
if (ev->finger == 0)
{
evas_event_feed_mouse_up(eo_e, ev->button, ev->button_flags, ev->timestamp, ev->data);
@ -3103,7 +3103,7 @@ _evas_canvas_event_pointer_cb(void *data, const Eo_Event *event)
ev->evas_done = EINA_TRUE;
break;
case EFL_POINTER_ACTION_MOUSE_WHEEL:
case EFL_POINTER_ACTION_WHEEL:
evas_event_feed_mouse_wheel(eo_e,
(ev->wheel.dir == EFL_ORIENT_HORIZONTAL) ? 1 : 0,
ev->wheel.z, ev->timestamp, ev->data);

View File

@ -31,7 +31,7 @@ efl_pointer_event_legacy_info_set(Efl_Pointer_Event *evt, const void *event_info
case EVAS_CALLBACK_MOUSE_DOWN:
{
const Evas_Event_Mouse_Down *e = event_info;
ev->action = EFL_POINTER_ACTION_MOUSE_DOWN;
ev->action = EFL_POINTER_ACTION_DOWN;
ev->button = e->button;
ev->cur.x = e->canvas.x;
ev->cur.y = e->canvas.y;
@ -49,7 +49,7 @@ efl_pointer_event_legacy_info_set(Efl_Pointer_Event *evt, const void *event_info
case EVAS_CALLBACK_MOUSE_UP:
{
const Evas_Event_Mouse_Up *e = event_info;
ev->action = EFL_POINTER_ACTION_MOUSE_UP;
ev->action = EFL_POINTER_ACTION_UP;
ev->button = e->button;
ev->cur.x = e->canvas.x;
ev->cur.y = e->canvas.y;
@ -67,7 +67,7 @@ efl_pointer_event_legacy_info_set(Efl_Pointer_Event *evt, const void *event_info
case EVAS_CALLBACK_MOUSE_MOVE:
{
const Evas_Event_Mouse_Move *e = event_info;
ev->action = EFL_POINTER_ACTION_MOUSE_MOVE;
ev->action = EFL_POINTER_ACTION_MOVE;
ev->pressed_buttons = e->buttons;
ev->cur.x = e->cur.canvas.x;
ev->cur.y = e->cur.canvas.y;
@ -88,7 +88,7 @@ efl_pointer_event_legacy_info_set(Efl_Pointer_Event *evt, const void *event_info
case EVAS_CALLBACK_MOUSE_WHEEL:
{
const Evas_Event_Mouse_Wheel *e = event_info;
ev->action = EFL_POINTER_ACTION_MOUSE_WHEEL;
ev->action = EFL_POINTER_ACTION_WHEEL;
ev->wheel.dir = (e->direction ? EFL_ORIENT_HORIZONTAL : EFL_ORIENT_VERTICAL);
ev->wheel.z = e->z;
ev->cur.x = e->canvas.x;
@ -105,7 +105,7 @@ efl_pointer_event_legacy_info_set(Efl_Pointer_Event *evt, const void *event_info
case EVAS_CALLBACK_MULTI_DOWN:
{
const Evas_Event_Multi_Down *e = event_info;
ev->action = EFL_POINTER_ACTION_MOUSE_DOWN; // TOUCH DOWN???
ev->action = EFL_POINTER_ACTION_DOWN;
ev->finger = e->device;
ev->radius = e->radius;
ev->radius_x = e->radius_x;
@ -127,7 +127,7 @@ efl_pointer_event_legacy_info_set(Efl_Pointer_Event *evt, const void *event_info
case EVAS_CALLBACK_MULTI_UP:
{
const Evas_Event_Multi_Up *e = event_info;
ev->action = EFL_POINTER_ACTION_MOUSE_UP;
ev->action = EFL_POINTER_ACTION_UP;
ev->finger = e->device;
ev->radius = e->radius;
ev->radius_x = e->radius_x;
@ -149,7 +149,7 @@ efl_pointer_event_legacy_info_set(Efl_Pointer_Event *evt, const void *event_info
case EVAS_CALLBACK_MULTI_MOVE:
{
const Evas_Event_Multi_Move *e = event_info;
ev->action = EFL_POINTER_ACTION_MOUSE_MOVE;
ev->action = EFL_POINTER_ACTION_MOVE;
ev->finger = e->device;
ev->radius = e->radius;
ev->radius_x = e->radius_x;
@ -183,7 +183,7 @@ efl_pointer_event_legacy_info_get(const Efl_Pointer_Event *evt, Evas_Callback_Ty
switch (ev->action)
{
case EFL_POINTER_ACTION_MOUSE_DOWN:
case EFL_POINTER_ACTION_DOWN:
if (!ev->finger || !multi)
{
Evas_Event_Mouse_Down *e = calloc(1, sizeof(*e));
@ -228,7 +228,7 @@ efl_pointer_event_legacy_info_get(const Efl_Pointer_Event *evt, Evas_Callback_Ty
}
break;
case EFL_POINTER_ACTION_MOUSE_UP:
case EFL_POINTER_ACTION_UP:
if (!ev->finger || !multi)
{
Evas_Event_Mouse_Up *e = calloc(1, sizeof(*e));
@ -274,7 +274,7 @@ efl_pointer_event_legacy_info_get(const Efl_Pointer_Event *evt, Evas_Callback_Ty
}
break;
case EFL_POINTER_ACTION_MOUSE_MOVE:
case EFL_POINTER_ACTION_MOVE:
if (!ev->finger || !multi)
{
Evas_Event_Mouse_Move *e = calloc(1, sizeof(*e));
@ -321,7 +321,7 @@ efl_pointer_event_legacy_info_get(const Efl_Pointer_Event *evt, Evas_Callback_Ty
}
break;
case EFL_POINTER_ACTION_MOUSE_WHEEL:
case EFL_POINTER_ACTION_WHEEL:
{
Evas_Event_Mouse_Wheel *e = calloc(1, sizeof(*e));
if (ptype) *ptype = EVAS_CALLBACK_MOUSE_WHEEL;