From 296d233f64327d87d318093b2504b58834c5bc85 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Wed, 4 May 2016 11:03:15 -0400 Subject: [PATCH] ecore-drm2: Add API functions to get and set pointer position Signed-off-by: Chris Michael --- src/lib/ecore_drm2/Ecore_Drm2.h | 24 ++++++++++++++++++++++++ src/lib/ecore_drm2/ecore_drm2_device.c | 19 +++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index f1ce291651..f4bbad2d08 100644 --- a/src/lib/ecore_drm2/Ecore_Drm2.h +++ b/src/lib/ecore_drm2/Ecore_Drm2.h @@ -174,6 +174,30 @@ EAPI int ecore_drm2_device_clock_id_get(Ecore_Drm2_Device *device); */ EAPI void ecore_drm2_device_cursor_size_get(Ecore_Drm2_Device *device, int *width, int *height); +/** + * Get the current pointer position + * + * @param device + * @param x + * @param y + * + * @ingroup Ecore_Drm2_Device_Group + * @since 1.18 + */ +EAPI void ecore_drm2_device_pointer_xy_get(Ecore_Drm2_Device *device, int *x, int *y); + +/** + * Warp the pointer position to given coordinates + * + * @param dev + * @param x + * @param y + * + * @ingroup Ecore_Drm2_Device_Group + * @since 1.18 + */ +EAPI void ecore_drm2_device_pointer_warp(Ecore_Drm2_Device *device, int x, int y); + /** * @defgroup Ecore_Drm2_Output_Group Drm output functions * diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c index b47028bdf4..f352b30795 100644 --- a/src/lib/ecore_drm2/ecore_drm2_device.c +++ b/src/lib/ecore_drm2/ecore_drm2_device.c @@ -182,3 +182,22 @@ ecore_drm2_device_cursor_size_get(Ecore_Drm2_Device *device, int *width, int *he if (ret == 0) *height = caps; } } + +EAPI void +ecore_drm2_device_pointer_xy_get(Ecore_Drm2_Device *device, int *x, int *y) +{ + if (x) *x = 0; + if (y) *y = 0; + + EINA_SAFETY_ON_NULL_RETURN(device); + + elput_input_pointer_xy_get(device->em, NULL, x, y); +} + +EAPI void +ecore_drm2_device_pointer_warp(Ecore_Drm2_Device *device, int x, int y) +{ + EINA_SAFETY_ON_NULL_RETURN(device); + + elput_input_pointer_xy_set(device->em, NULL, x, y); +}