bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ec4ff09d97937107a85a4a3aa2c78c52b33ef0b3

commit ec4ff09d97937107a85a4a3aa2c78c52b33ef0b3
Author: Mike Blumenkrantz <[email protected]>
Date:   Mon Jan 13 15:10:09 2020 -0500

    tests/elm: add util functions for doing multi-touch events
    
    Differential Revision: https://phab.enlightenment.org/D11089
---
 src/tests/elementary/suite_helpers.c | 43 ++++++++++++++++++++++++++++++++++++
 src/tests/elementary/suite_helpers.h |  4 ++++
 2 files changed, 47 insertions(+)

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
@@ -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)
 {
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);

-- 


Reply via email to