devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2758d6fcbab4a5a6f96e4a51ed89396f40f76e5f
commit 2758d6fcbab4a5a6f96e4a51ed89396f40f76e5f Author: Chris Michael <cp.mich...@samsung.com> Date: Fri Sep 25 10:41:08 2015 -0400 ecore-wl2: Add event and structure for dnd motion events Signed-off-by: Chris Michael <cp.mich...@samsung.com> --- src/lib/ecore_wl2/Ecore_Wl2.h | 7 +++++++ src/lib/ecore_wl2/ecore_wl2.c | 2 ++ src/lib/ecore_wl2/ecore_wl2_dnd.c | 16 +++++++++++++++- src/lib/ecore_wl2/ecore_wl2_input.c | 2 +- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index ef6ccd1..3af9273 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -73,6 +73,12 @@ typedef struct _Ecore_Wl2_Event_Dnd_Leave unsigned int win, source; } Ecore_Wl2_Event_Dnd_Leave; +typedef struct _Ecore_Wl2_Event_Dnd_Motion +{ + unsigned int win, source, serial; + int x, y; +} Ecore_Wl2_Event_Dnd_Motion; + typedef enum _Ecore_Wl2_Window_Type { ECORE_WL2_WINDOW_TYPE_NONE, @@ -91,6 +97,7 @@ EAPI extern int ECORE_WL2_EVENT_FOCUS_IN; EAPI extern int ECORE_WL2_EVENT_FOCUS_OUT; EAPI extern int ECORE_WL2_EVENT_DND_ENTER; EAPI extern int ECORE_WL2_EVENT_DND_LEAVE; +EAPI extern int ECORE_WL2_EVENT_DND_MOTION; /** * @file diff --git a/src/lib/ecore_wl2/ecore_wl2.c b/src/lib/ecore_wl2/ecore_wl2.c index d291b39..9ab17de 100644 --- a/src/lib/ecore_wl2/ecore_wl2.c +++ b/src/lib/ecore_wl2/ecore_wl2.c @@ -17,6 +17,7 @@ EAPI int ECORE_WL2_EVENT_FOCUS_IN = 0; EAPI int ECORE_WL2_EVENT_FOCUS_OUT = 0; EAPI int ECORE_WL2_EVENT_DND_ENTER = 0; EAPI int ECORE_WL2_EVENT_DND_LEAVE = 0; +EAPI int ECORE_WL2_EVENT_DND_MOTION = 0; static void _cb_wl_log_print(const char *format, va_list args) @@ -65,6 +66,7 @@ ecore_wl2_init(void) ECORE_WL2_EVENT_FOCUS_OUT = ecore_event_type_new(); ECORE_WL2_EVENT_DND_ENTER = ecore_event_type_new(); ECORE_WL2_EVENT_DND_LEAVE = ecore_event_type_new(); + ECORE_WL2_EVENT_DND_MOTION = ecore_event_type_new(); } wl_log_set_handler_server(_cb_wl_log_print); diff --git a/src/lib/ecore_wl2/ecore_wl2_dnd.c b/src/lib/ecore_wl2/ecore_wl2_dnd.c index ac315d6..4909142 100644 --- a/src/lib/ecore_wl2/ecore_wl2_dnd.c +++ b/src/lib/ecore_wl2/ecore_wl2_dnd.c @@ -111,10 +111,24 @@ _ecore_wl2_dnd_leave(Ecore_Wl2_Input *input) void _ecore_wl2_dnd_motion(Ecore_Wl2_Input *input, int x, int y, unsigned int timestamp) { + Ecore_Wl2_Event_Dnd_Motion *ev; + input->pointer.sx = x; input->pointer.sy = y; - /* TODO: raise dnd motion event */ + ev = calloc(1, sizeof(Ecore_Wl2_Event_Dnd_Motion)); + if (!ev) return; + + if (input->focus.pointer) + ev->win = input->focus.pointer->id; + if (input->focus.keyboard) + ev->source = input->focus.keyboard->id; + + ev->x = x; + ev->y = y; + ev->serial = timestamp; + + ecore_event_add(ECORE_WL2_EVENT_DND_MOTION, ev, NULL, NULL); } void diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index 0807efe..fbac931 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -983,7 +983,7 @@ _data_cb_leave(void *data, struct wl_data_device *data_device EINA_UNUSED) } static void -_data_cb_motion(void *data, struct wl_data_device *data_device, unsigned int timestamp, wl_fixed_t x, wl_fixed_t y) +_data_cb_motion(void *data, struct wl_data_device *data_device EINA_UNUSED, unsigned int timestamp, wl_fixed_t x, wl_fixed_t y) { Ecore_Wl2_Input *input; --