ecore-wl2: Add API function to return pointer position
authorChris Michael <cp.michael@samsung.com>
Mon, 28 Sep 2015 16:07:39 +0000 (12:07 -0400)
committerChris Michael <cp.michael@samsung.com>
Thu, 3 Dec 2015 17:02:40 +0000 (12:02 -0500)
Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_wl2/Ecore_Wl2.h
src/lib/ecore_wl2/ecore_wl2_window.c

index 30ded28..b048535 100644 (file)
@@ -427,6 +427,9 @@ EAPI Eina_Bool ecore_wl2_window_iconified_get(Ecore_Wl2_Window *window);
 /* TODO: doxy */
 EAPI void ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified);
 
+/* TODO: doxy */
+EAPI void ecore_wl2_window_pointer_xy_get(Ecore_Wl2_Window *window, int *x, int *y);
+
 /* # ifdef __cplusplus */
 /* } */
 /* # endif */
index 6ed7991..40ce88c 100644 (file)
@@ -772,3 +772,17 @@ ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified)
 
    window->minimized = iconified;
 }
+
+EAPI void
+ecore_wl2_window_pointer_xy_get(Ecore_Wl2_Window *window, int *x, int *y)
+{
+   EINA_SAFETY_ON_NULL_RETURN(window);
+
+   if (x) *x = 0;
+   if (y) *y = 0;
+
+   if (!window->input) return;
+
+   if (x) *x = window->input->pointer.sx;
+   if (y) *y = window->input->pointer.sy;
+}