aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-05-17 16:02:53 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-05-19 12:41:17 -0400
commit2fe78782350af9da22765ef2494db4a640b87be0 (patch)
tree2564b02f5b2a1d9f257b89a67475f034df87c92c /src/lib/ecore_wl2/ecore_wl2_input.c
parentwayland: send focus in/out events when receiving/losing keyboard focus (diff)
downloadefl-2fe78782350af9da22765ef2494db4a640b87be0.tar.gz
wayland: move pointer-related functions to ecore_wl2_input namespace
windows do not have pointers or cursors under wayland, seats do. due to lack of multiseat support, most components simply use the "default" seat with these functions, but this should make the corresponding code more easily adaptable
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 324edb2faf..935f09cbe7 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -1698,3 +1698,35 @@ ecore_wl2_input_seat_device_get(const Ecore_Wl2_Input *input, const Ecore_Wl2_Wi
devices = _ecore_wl2_devices_get(input, window->id);
return devices ? devices->seat_dev : NULL;
}
+
+EAPI void
+ecore_wl2_input_pointer_set(Ecore_Wl2_Input *input, struct wl_surface *surface, int hot_x, int hot_y)
+{
+ EINA_SAFETY_ON_NULL_RETURN(input);
+
+ input->cursor.surface = surface;
+ input->cursor.hot_x = hot_x;
+ input->cursor.hot_y = hot_y;
+
+ _ecore_wl2_input_cursor_update(input);
+}
+
+EAPI void
+ecore_wl2_input_cursor_from_name_set(Ecore_Wl2_Input *input, const char *cursor)
+{
+ EINA_SAFETY_ON_NULL_RETURN(input);
+ _ecore_wl2_input_cursor_set(input, cursor);
+}
+
+EAPI Eina_Bool
+ecore_wl2_input_pointer_xy_get(const Ecore_Wl2_Input *input, int *x, int *y)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
+
+ if (x) *x = 0;
+ if (y) *y = 0;
+ if (!input->wl.pointer) return EINA_FALSE;
+ if (x) *x = input->pointer.sx;
+ if (y) *y = input->pointer.sy;
+ return EINA_TRUE;
+}