tests/elm: add util functions for doing multi-touch events

Differential Revision: https://phab.enlightenment.org/D11089
This commit is contained in:
Mike Blumenkrantz 2020-01-13 15:10:09 -05:00 committed by Marcel Hollerbach
parent ce3d569cfd
commit ec4ff09d97
2 changed files with 47 additions and 0 deletions

View File

@ -625,6 +625,40 @@ click_object_at(Eo *obj, int x, int y)
evas_event_feed_mouse_up(e, 1, 0, ts++, NULL);
}
void
multi_click_object(Eo *obj, int ids)
{
Evas *e = evas_object_evas_get(obj);
Eina_Position2D pos = attempt_to_find_the_right_point_for_mouse_positioning(obj, NONE);
for (int i = 0; i < ids; i++)
evas_event_feed_multi_down(e, i, pos.x + i, pos.y + i, 1, 1, 1, 1, 0, pos.x + i, pos.y + i, 0, ts, NULL);
ts++;
for (int i = 0; i < ids; i++)
evas_event_feed_multi_up(e, i, pos.x + i, pos.y + i, 1, 1, 1, 1, 0, pos.x + i, pos.y + i, 0, ts, NULL);
}
void
multi_press_object(Eo *obj, int ids)
{
Evas *e = evas_object_evas_get(obj);
Eina_Position2D pos = attempt_to_find_the_right_point_for_mouse_positioning(obj, NONE);
for (int i = 0; i < ids; i++)
evas_event_feed_multi_down(e, i, pos.x + i, pos.y + i, 1, 1, 1, 1, 0, pos.x + i, pos.y + i, 0, ts, NULL);
ts++;
}
void
multi_click_object_at(Eo *obj, int x, int y, int ids)
{
Evas *e = evas_object_evas_get(obj);
for (int i = 0; i < ids; i++)
evas_event_feed_multi_down(e, i, x + i, y + i, 1, 1, 1, 1, 0, x + i, y + i, 0, ts, NULL);
ts++;
for (int i = 0; i < ids; i++)
evas_event_feed_multi_up(e, i, x + i, y + i, 1, 1, 1, 1, 0, x + i, y + i, 0, ts, NULL);
ts++;
}
void
press_object_at(Eo *obj, int x, int y)
{
@ -633,6 +667,15 @@ press_object_at(Eo *obj, int x, int y)
evas_event_feed_mouse_down(e, 1, 0, ts++, NULL);
}
void
multi_press_object_at(Eo *obj, int x, int y, int ids)
{
Evas *e = evas_object_evas_get(obj);
for (int i = 0; i < ids; i++)
evas_event_feed_multi_down(e, i, x + i, y + i, 1, 1, 1, 1, 0, x + i, y + i, 0, ts, NULL);
ts++;
}
void
click_object_at_flags(Eo *obj, int x, int y, int flags)
{

View File

@ -30,6 +30,10 @@ void press_part(Eo *obj, const char *part);
void press_part_flags(Eo *obj, const char *part, int flags);
void press_object_at(Eo *obj, int x, int y);
void press_object_at_flags(Eo *obj, int x, int y, int flags);
void multi_click_object(Eo *obj, int ids);
void multi_press_object(Eo *obj, int ids);
void multi_click_object_at(Eo *obj, int x, int y, int ids);
void multi_press_object_at(Eo *obj, int x, int y, int ids);
void drag_object(Eo *obj, int x, int y, int dx, int dy, Eina_Bool iterate);
int drag_object_around(Eo *obj, int cx, int cy, int radius, int degrees);
void wheel_object(Eo *obj, Eina_Bool horiz, Eina_Bool down);