From 923eacf4abd892a8262e8603cf2eb8523bdb2515 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Thu, 12 May 2016 17:53:38 +0900 Subject: [PATCH] ecore_evas, ecore_wayland : enable pointer warp Change-Id: I23b15cfc87ec50bbc01422e3a9a8e3c615f94a7c Signed-off-by: Sung-Jin Park --- src/lib/ecore_wayland/Ecore_Wayland.h | 1 + src/lib/ecore_wayland/ecore_wl_window.c | 14 ++++++++++++++ .../engines/wayland/ecore_evas_wayland_common.c | 16 ++++++++++++++++ .../ecore_evas/engines/wayland/ecore_evas_wayland_egl.c | 2 +- .../engines/wayland/ecore_evas_wayland_private.h | 1 + .../ecore_evas/engines/wayland/ecore_evas_wayland_shm.c | 2 +- 6 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h index b332084..42aae28 100644 --- a/src/lib/ecore_wayland/Ecore_Wayland.h +++ b/src/lib/ecore_wayland/Ecore_Wayland.h @@ -787,6 +787,7 @@ EAPI Ecore_Wl_Window *ecore_wl_window_find(unsigned int id); EAPI Ecore_Wl_Window_Type ecore_wl_window_type_get(Ecore_Wl_Window *win); EAPI void ecore_wl_window_type_set(Ecore_Wl_Window *win, Ecore_Wl_Window_Type type); EAPI void ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_surface *surface, int hot_x, int hot_y); +EAPI Eina_Bool ecore_wl_window_pointer_warp(Ecore_Wl_Window *win, int x, int y); EAPI void ecore_wl_window_cursor_from_name_set(Ecore_Wl_Window *win, const char *cursor_name); EAPI void ecore_wl_window_cursor_default_restore(Ecore_Wl_Window *win); EAPI void ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent); diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index 7da2e8b..f020531 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c @@ -935,6 +935,20 @@ ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_surface *surface, in ecore_wl_input_pointer_set(input, surface, hot_x, hot_y); } +EAPI Eina_Bool +ecore_wl_window_pointer_warp(Ecore_Wl_Window *win, int x, int y) +{ + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + if (!win || !win->surface || !win->visible) return EINA_FALSE; + if (!_ecore_wl_disp->wl.tz_input_device_manager) return EINA_FALSE; + + tizen_input_device_manager_pointer_warp(_ecore_wl_disp->wl.tz_input_device_manager, + win->surface, wl_fixed_from_int(x), wl_fixed_from_int(y)); + + return EINA_TRUE; +} + EAPI void ecore_wl_window_cursor_from_name_set(Ecore_Wl_Window *win, const char *cursor_name) { diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index e5cb765..b69c648 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -1138,6 +1138,22 @@ _ecore_evas_wl_common_pointer_xy_get(const Ecore_Evas *ee EINA_UNUSED, Evas_Coor ecore_wl_pointer_xy_get(x, y); } +Eina_Bool +_ecore_evas_wl_common_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y) +{ + Ecore_Evas_Engine_Wl_Data *wdata; + Eina_Bool ret; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + if ((!ee) || (!ee->visible)) return EINA_FALSE; + wdata = ee->engine.data; + if(!wdata) return EINA_FALSE; + + ret = ecore_wl_window_pointer_warp(wdata->win, x, y); + return ret; +} + void _ecore_evas_wl_common_wm_rot_preferred_rotation_set(Ecore_Evas *ee, int rot) { diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c index abe88b9..8f55bd9 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c @@ -102,7 +102,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func = NULL, // msg_send _ecore_evas_wl_common_pointer_xy_get, - NULL, // pointer warp + _ecore_evas_wl_common_pointer_warp, _ecore_evas_wl_common_wm_rot_preferred_rotation_set, _ecore_evas_wl_common_wm_rot_available_rotations_set, diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h index 29be2c0..6fedd00 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h @@ -102,6 +102,7 @@ Evas_Object * _ecore_evas_wl_common_frame_add(Evas *evas); void _ecore_evas_wl_common_frame_border_size_set(Evas_Object *obj, int fx, int fy, int fw, int fh); void _ecore_evas_wl_common_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y); +Eina_Bool _ecore_evas_wl_common_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y); void _ecore_evas_wl_common_wm_rot_preferred_rotation_set(Ecore_Evas *ee, int rot); void _ecore_evas_wl_common_wm_rot_available_rotations_set(Ecore_Evas *ee, const int *rots, unsigned int count); diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c index fbdd296..a344aaf 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c @@ -102,7 +102,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func = NULL, // func msg send _ecore_evas_wl_common_pointer_xy_get, - NULL, // pointer_warp + _ecore_evas_wl_common_pointer_warp, _ecore_evas_wl_common_wm_rot_preferred_rotation_set, _ecore_evas_wl_common_wm_rot_available_rotations_set, -- 2.7.4