summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-01-13 15:10:09 -0500
committerMike Blumenkrantz <zmike@samsung.com>2020-01-23 15:24:54 -0500
commit50379c00ffb8404e3c2460a03e1d287f3b040df7 (patch)
tree83ce44e6df2d231471a0cbfd8d40048541d40846
parent59f4944df50271fd7ed882c35d20931371cdb57a (diff)
downloadefl-50379c00ffb8404e3c2460a03e1d287f3b040df7.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);