summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-01-13 15:10:09 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-02-05 10:08:58 +0100
commitec4ff09d97937107a85a4a3aa2c78c52b33ef0b3 (patch)
treec860a1fb7cf2a9fd52cc216add2ed0cd70e3c54d
parentce3d569cfd0d4d9d928df86858b51ce005e6756d (diff)
downloadefl-ec4ff09d97937107a85a4a3aa2c78c52b33ef0b3.tar.gz
tests/elm: add util functions for doing multi-touch events
Differential Revision: https://phab.enlightenment.org/D11089
-rw-r--r--src/tests/elementary/suite_helpers.c43
-rw-r--r--src/tests/elementary/suite_helpers.h4
2 files changed, 47 insertions, 0 deletions
diff --git a/src/tests/elementary/suite_helpers.c b/src/tests/elementary/suite_helpers.c
index 0f9d80bfbf..647c5b2aee 100644
--- a/src/tests/elementary/suite_helpers.c
+++ b/src/tests/elementary/suite_helpers.c
@@ -626,6 +626,40 @@ click_object_at(Eo *obj, int x, int y)
}
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)
{
Evas *e = evas_object_evas_get(obj);
@@ -634,6 +668,15 @@ press_object_at(Eo *obj, int x, int y)
}
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)
{
Evas *e = evas_object_evas_get(obj);
diff --git a/src/tests/elementary/suite_helpers.h b/src/tests/elementary/suite_helpers.h
index b48c06c924..2dce6c4439 100644
--- a/src/tests/elementary/suite_helpers.h
+++ b/src/tests/elementary/suite_helpers.h
@@ -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);