summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-10-21 10:34:57 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-10-29 16:08:41 +0100
commit3ad0cf6c4606c5e0c94910003bdba39f681e6895 (patch)
tree74fdca4fe86d70dbf00e02ca76a5e0938cc58232
parent5ab30b1e01195b73293fdc18bf3eed5b41c5db68 (diff)
downloadefl-3ad0cf6c4606c5e0c94910003bdba39f681e6895.tar.gz
tests/elm: add util functions for clicking objects/parts with event flags
this is useful for synthesizing e.g., double click events Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D10510
-rw-r--r--src/tests/elementary/suite_helpers.c31
-rw-r--r--src/tests/elementary/suite_helpers.h3
2 files changed, 29 insertions, 5 deletions
diff --git a/src/tests/elementary/suite_helpers.c b/src/tests/elementary/suite_helpers.c
index 8aebdcb3f0..9753d25bd8 100644
--- a/src/tests/elementary/suite_helpers.c
+++ b/src/tests/elementary/suite_helpers.c
@@ -430,23 +430,29 @@ attempt_to_find_the_right_point_for_mouse_positioning(Eo *obj, int dir)
}
static void
-click_object_internal(Eo *obj, int dir)
+click_object_internal(Eo *obj, int dir, int flags)
{
Evas *e = evas_object_evas_get(obj);
Eina_Position2D pos = attempt_to_find_the_right_point_for_mouse_positioning(obj, dir);
evas_event_feed_mouse_move(e, pos.x, pos.y, 0, NULL);
- evas_event_feed_mouse_down(e, 1, 0, 0, NULL);
+ evas_event_feed_mouse_down(e, 1, flags, 0, NULL);
evas_event_feed_mouse_up(e, 1, 0, 0, NULL);
}
void
click_object(Eo *obj)
{
- click_object_internal(obj, NONE);
+ click_object_internal(obj, NONE, 0);
}
void
-click_part(Eo *obj, const char *part)
+click_object_flags(Eo *obj, int flags)
+{
+ click_object_internal(obj, NONE, flags);
+}
+
+void
+click_part_flags(Eo *obj, const char *part, int flags)
{
Efl_Part *part_obj = efl_ref(efl_part(obj, part));
Eo *content;
@@ -466,13 +472,19 @@ click_part(Eo *obj, const char *part)
else if (strstr(part, "bottom"))
dir |= BOTTOM;
}
- click_object_internal(content, dir);
+ click_object_internal(content, dir, flags);
if (efl_isa(content, EFL_LAYOUT_SIGNAL_INTERFACE))
edje_object_message_signal_process(content);
edje_object_message_signal_process(obj);
efl_unref(part_obj);
}
+void
+click_part(Eo *obj, const char *part)
+{
+ click_part_flags(obj, part, 0);
+}
+
static void
wheel_object_internal(Eo *obj, int dir, Eina_Bool horiz, Eina_Bool down)
{
@@ -547,6 +559,15 @@ click_object_at(Eo *obj, int x, int y)
}
void
+click_object_at_flags(Eo *obj, int x, int y, int flags)
+{
+ Evas *e = evas_object_evas_get(obj);
+ evas_event_feed_mouse_move(e, x, y, 0, NULL);
+ evas_event_feed_mouse_down(e, 1, flags, 0, NULL);
+ evas_event_feed_mouse_up(e, 1, 0, 0, NULL);
+}
+
+void
wheel_object_at(Eo *obj, int x, int y, Eina_Bool horiz, Eina_Bool down)
{
Evas *e = evas_object_evas_get(obj);
diff --git a/src/tests/elementary/suite_helpers.h b/src/tests/elementary/suite_helpers.h
index 928dda9637..e3b1758e37 100644
--- a/src/tests/elementary/suite_helpers.h
+++ b/src/tests/elementary/suite_helpers.h
@@ -12,8 +12,11 @@ void fail_on_errors_setup(void);
void get_me_to_those_events(Eo *obj);
void click_object(Eo *obj);
+void click_object_flags(Eo *obj, int flags);
void click_part(Eo *obj, const char *part);
+void click_part_flags(Eo *obj, const char *part, int flags);
void click_object_at(Eo *obj, int x, int y);
+void click_object_at_flags(Eo *obj, int x, int y, int flags);
void wheel_object(Eo *obj, Eina_Bool horiz, Eina_Bool down);
void wheel_part(Eo *obj, const char *part, Eina_Bool horiz, Eina_Bool down);
void wheel_object_at(Eo *obj, int x, int y, Eina_Bool horiz, Eina_Bool down);