tests/elm: add util functions for doing multi-touch events
authorMike Blumenkrantz <zmike@samsung.com>
Mon, 13 Jan 2020 20:10:09 +0000 (15:10 -0500)
committerJongmin Lee <jm105.lee@samsung.com>
Tue, 11 Feb 2020 21:58:35 +0000 (06:58 +0900)
Differential Revision: https://phab.enlightenment.org/D11089

src/tests/elementary/suite_helpers.c
src/tests/elementary/suite_helpers.h

index 0f9d80b..647c5b2 100644 (file)
@@ -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);
index b48c06c..2dce6c4 100644 (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);