summaryrefslogtreecommitdiff
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
parent55cfc974559d6688f6fcc5b242015252659a0b7f (diff)
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
1698 devices = _ecore_wl2_devices_get(input, window->id); 1698 devices = _ecore_wl2_devices_get(input, window->id);
1699 return devices ? devices->seat_dev : NULL; 1699 return devices ? devices->seat_dev : NULL;
1700} 1700}
1701
1702EAPI void
1703ecore_wl2_input_pointer_set(Ecore_Wl2_Input *input, struct wl_surface *surface, int hot_x, int hot_y)
1704{
1705 EINA_SAFETY_ON_NULL_RETURN(input);
1706
1707 input->cursor.surface = surface;
1708 input->cursor.hot_x = hot_x;
1709 input->cursor.hot_y = hot_y;
1710
1711 _ecore_wl2_input_cursor_update(input);
1712}
1713
1714EAPI void
1715ecore_wl2_input_cursor_from_name_set(Ecore_Wl2_Input *input, const char *cursor)
1716{
1717 EINA_SAFETY_ON_NULL_RETURN(input);
1718 _ecore_wl2_input_cursor_set(input, cursor);
1719}
1720
1721EAPI Eina_Bool
1722ecore_wl2_input_pointer_xy_get(const Ecore_Wl2_Input *input, int *x, int *y)
1723{
1724 EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE);
1725
1726 if (x) *x = 0;
1727 if (y) *y = 0;
1728 if (!input->wl.pointer) return EINA_FALSE;
1729 if (x) *x = input->pointer.sx;
1730 if (y) *y = input->pointer.sy;
1731 return EINA_TRUE;
1732}