summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Antognolli <rafael.antognolli@intel.com>2013-05-03 15:43:31 -0300
committerRafael Antognolli <rafael.antognolli@intel.com>2013-05-03 16:45:33 -0300
commitf09e493bc2bb9fed67b2d6e2faa4f19142394191 (patch)
treebf3b142295382a422727c28b15940b27e7d0022e
parentf769128dcad91da002529ee9e2a27f82c828461d (diff)
evas/events: Add evas_event_input_mouse_move().
This function should be used internally by the input system (Ecore_Evas_Input) to feed Evas with move events. The x,y event info is relative to the base of the window/surface, instead of the 0,0 of the canvas. This case only happens for now under Wayland, where the 0,0 of the canvas is translated due to the window decorations that are drawn by the client.
-rw-r--r--ChangeLog4
-rw-r--r--src/lib/evas/Evas_Eo.h16
-rw-r--r--src/lib/evas/Evas_Legacy.h21
-rw-r--r--src/lib/evas/canvas/evas_events.c62
-rw-r--r--src/lib/evas/canvas/evas_main.c2
-rw-r--r--src/lib/evas/include/evas_private.h1
6 files changed, 89 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 57f9c1a156..515d66d73b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
12013-04-03 Rafael Antognolli
2
3 * Evas: Added evas_event_input_mouse_move() for internal use only.
4
12013-04-29 ChunEon Park (Hermet) 52013-04-29 ChunEon Park (Hermet)
2 6
3 * Evas: Added evas_object_image_source_clip_set()/get(). 7 * Evas: Added evas_object_image_source_clip_set()/get().
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index bacdbfea0d..e2a6965eed 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -185,6 +185,7 @@ enum
185 EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_UP, 185 EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_UP,
186 EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_CANCEL, 186 EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_CANCEL,
187 EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_WHEEL, 187 EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_WHEEL,
188 EVAS_CANVAS_SUB_ID_EVENT_INPUT_MOUSE_MOVE,
188 EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_MOVE, 189 EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_MOVE,
189 EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_IN, 190 EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_IN,
190 EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_OUT, 191 EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_OUT,
@@ -891,6 +892,21 @@ enum
891#define evas_canvas_event_feed_mouse_wheel(direction, z, timestamp, data) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_WHEEL), EO_TYPECHECK(int, direction), EO_TYPECHECK(int, z), EO_TYPECHECK(unsigned int, timestamp), EO_TYPECHECK(const void *, data) 892#define evas_canvas_event_feed_mouse_wheel(direction, z, timestamp, data) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_WHEEL), EO_TYPECHECK(int, direction), EO_TYPECHECK(int, z), EO_TYPECHECK(unsigned int, timestamp), EO_TYPECHECK(const void *, data)
892 893
893/** 894/**
895 * @def evas_canvas_event_input_mouse_move
896 * @since 1.8
897 *
898 * Mouse move event feed from input.
899 *
900 * @param[in] x
901 * @param[in] y
902 * @param[in] timestamp
903 * @param[in] data
904 *
905 * @see evas_event_input_mouse_move
906 */
907#define evas_canvas_event_input_mouse_move(x, y, timestamp, data) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_INPUT_MOUSE_MOVE), EO_TYPECHECK(int, x), EO_TYPECHECK(int, y), EO_TYPECHECK(unsigned int, timestamp), EO_TYPECHECK(const void *, data)
908
909/**
894 * @def evas_canvas_event_feed_mouse_move 910 * @def evas_canvas_event_feed_mouse_move
895 * @since 1.8 911 * @since 1.8
896 * 912 *
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 7c282bcb12..8e59c9c820 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -1105,6 +1105,27 @@ EAPI void evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags, un
1105EAPI void evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1); 1105EAPI void evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
1106 1106
1107/** 1107/**
1108 * Mouse move event feed from input.
1109 *
1110 * @param e The given canvas pointer.
1111 * @param x The horizontal position of the mouse pointer relative to the 0,0 of
1112 * the window/surface.
1113 * @param y The vertical position of the mouse pointer relative to the 0,0 of
1114 * the window/surface.
1115 * @param timestamp The timestamp of the mouse move event.
1116 * @param data The data for canvas.
1117 *
1118 * Similar to the evas_event_feed_mouse_move(), this function will inform Evas
1119 * about mouse move events which were received by the input system, relative to
1120 * the 0,0 of the window, not to the canvas 0,0. It will take care of doing any
1121 * special transformation like adding the framespace offset to the mouse event.
1122 *
1123 * @since 1.8
1124 * @see evas_event_feed_mouse_move
1125 */
1126EAPI void evas_event_input_mouse_move(Evas *e, int x, int y, unsigned int timestamp, const void *data) EINA_ARG_NONNULL(1);
1127
1128/**
1108 * Mouse move event feed. 1129 * Mouse move event feed.
1109 * 1130 *
1110 * @param e The given canvas pointer. 1131 * @param e The given canvas pointer.
diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c
index 7f71ddaf70..db70fa4e22 100644
--- a/src/lib/evas/canvas/evas_events.c
+++ b/src/lib/evas/canvas/evas_events.c
@@ -1487,24 +1487,9 @@ _canvas_event_feed_mouse_wheel(Eo *eo_e, void *_pd, va_list *list)
1487 _evas_unwalk(e); 1487 _evas_unwalk(e);
1488} 1488}
1489 1489
1490EAPI void 1490static void
1491evas_event_feed_mouse_move(Evas *eo_e, int x, int y, unsigned int timestamp, const void *data) 1491_canvas_event_feed_mouse_move_internal(Eo *eo_e, void *_pd, int x, int y, unsigned int timestamp, const void *data)
1492{
1493 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
1494 return;
1495 MAGIC_CHECK_END();
1496
1497 eo_do(eo_e, evas_canvas_event_feed_mouse_move(x, y, timestamp, data));
1498}
1499
1500void
1501_canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list)
1502{ 1492{
1503 int x = va_arg(*list, int);
1504 int y = va_arg(*list, int);
1505 unsigned int timestamp = va_arg(*list, unsigned int);
1506 const void *data = va_arg(*list, const void *);
1507
1508 Evas_Public_Data *e = _pd; 1493 Evas_Public_Data *e = _pd;
1509 Evas_Object *nogrep_obj = NULL; 1494 Evas_Object *nogrep_obj = NULL;
1510 int px, py; 1495 int px, py;
@@ -2010,6 +1995,49 @@ nogrep:
2010} 1995}
2011 1996
2012EAPI void 1997EAPI void
1998evas_event_input_mouse_move(Evas *eo_e, int x, int y, unsigned int timestamp, const void *data)
1999{
2000 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
2001 return;
2002 MAGIC_CHECK_END();
2003
2004 eo_do(eo_e, evas_canvas_event_input_mouse_move(x, y, timestamp, data));
2005}
2006
2007void
2008_canvas_event_input_mouse_move(Eo *eo_e, void *_pd, va_list *list)
2009{
2010 int x = va_arg(*list, int);
2011 int y = va_arg(*list, int);
2012 unsigned int timestamp = va_arg(*list, unsigned int);
2013 const void *data = va_arg(*list, const void *);
2014 Evas_Public_Data *e = _pd;
2015
2016 _canvas_event_feed_mouse_move_internal(eo_e, _pd, x - e->framespace.x, y - e->framespace.y, timestamp, data);
2017}
2018
2019EAPI void
2020evas_event_feed_mouse_move(Evas *eo_e, int x, int y, unsigned int timestamp, const void *data)
2021{
2022 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
2023 return;
2024 MAGIC_CHECK_END();
2025
2026 eo_do(eo_e, evas_canvas_event_feed_mouse_move(x, y, timestamp, data));
2027}
2028
2029void
2030_canvas_event_feed_mouse_move(Eo *eo_e, void *_pd, va_list *list)
2031{
2032 int x = va_arg(*list, int);
2033 int y = va_arg(*list, int);
2034 unsigned int timestamp = va_arg(*list, unsigned int);
2035 const void *data = va_arg(*list, const void *);
2036
2037 _canvas_event_feed_mouse_move_internal(eo_e, _pd, x, y, timestamp, data);
2038}
2039
2040EAPI void
2013evas_event_feed_mouse_in(Evas *eo_e, unsigned int timestamp, const void *data) 2041evas_event_feed_mouse_in(Evas *eo_e, unsigned int timestamp, const void *data)
2014{ 2042{
2015 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS); 2043 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index beebbb3926..4d7ab7a6a0 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -1038,6 +1038,7 @@ _class_constructor(Eo_Class *klass)
1038 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_UP), _canvas_event_feed_mouse_up), 1038 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_UP), _canvas_event_feed_mouse_up),
1039 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_CANCEL), _canvas_event_feed_mouse_cancel), 1039 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_CANCEL), _canvas_event_feed_mouse_cancel),
1040 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_WHEEL), _canvas_event_feed_mouse_wheel), 1040 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_WHEEL), _canvas_event_feed_mouse_wheel),
1041 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_INPUT_MOUSE_MOVE), _canvas_event_input_mouse_move),
1041 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_MOVE), _canvas_event_feed_mouse_move), 1042 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_MOVE), _canvas_event_feed_mouse_move),
1042 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_IN), _canvas_event_feed_mouse_in), 1043 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_IN), _canvas_event_feed_mouse_in),
1043 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_OUT), _canvas_event_feed_mouse_out), 1044 EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_OUT), _canvas_event_feed_mouse_out),
@@ -1138,6 +1139,7 @@ static const Eo_Op_Description op_desc[] = {
1138 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_UP, "Mouse up event feed."), 1139 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_UP, "Mouse up event feed."),
1139 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_CANCEL, "Mouse cancel event feed."), 1140 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_CANCEL, "Mouse cancel event feed."),
1140 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_WHEEL, "Mouse wheel event feed."), 1141 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_WHEEL, "Mouse wheel event feed."),
1142 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_EVENT_INPUT_MOUSE_MOVE, "Mouse move event fed from input (only Ecore_Evas_Input should use it)."),
1141 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_MOVE, "Mouse move event feed."), 1143 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_MOVE, "Mouse move event feed."),
1142 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_IN, "Mouse in event feed."), 1144 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_IN, "Mouse in event feed."),
1143 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_OUT, "Mouse out event feed."), 1145 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_EVENT_FEED_MOUSE_OUT, "Mouse out event feed."),
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 61818a4297..b1f6d56ef3 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1131,6 +1131,7 @@ void _canvas_event_feed_mouse_down(Eo *e, void *_pd, va_list *list);
1131void _canvas_event_feed_mouse_up(Eo *e, void *_pd, va_list *list); 1131void _canvas_event_feed_mouse_up(Eo *e, void *_pd, va_list *list);
1132void _canvas_event_feed_mouse_cancel(Eo *e, void *_pd, va_list *list); 1132void _canvas_event_feed_mouse_cancel(Eo *e, void *_pd, va_list *list);
1133void _canvas_event_feed_mouse_wheel(Eo *e, void *_pd, va_list *list); 1133void _canvas_event_feed_mouse_wheel(Eo *e, void *_pd, va_list *list);
1134void _canvas_event_input_mouse_move(Eo *e, void *_pd, va_list *list);
1134void _canvas_event_feed_mouse_move(Eo *e, void *_pd, va_list *list); 1135void _canvas_event_feed_mouse_move(Eo *e, void *_pd, va_list *list);
1135void _canvas_event_feed_mouse_in(Eo *e, void *_pd, va_list *list); 1136void _canvas_event_feed_mouse_in(Eo *e, void *_pd, va_list *list);
1136void _canvas_event_feed_mouse_out(Eo *e, void *_pd, va_list *list); 1137void _canvas_event_feed_mouse_out(Eo *e, void *_pd, va_list *list);