From 8592e677cb3565008694c668210db38e355a0094 Mon Sep 17 00:00:00 2001 From: JengHyun Kang Date: Tue, 14 Nov 2017 10:54:23 +0900 Subject: [PATCH] ecore_wl2: support a pointer warp Change-Id: I61cd86806c5441a2de3bd35385182e2d289fb965 --- src/lib/ecore_wl2/Ecore_Wl2.h | 5 +++++ src/lib/ecore_wl2/ecore_wl2_window.c | 20 ++++++++++++++++++++ .../engines/wayland/ecore_evas_wayland_common.c | 22 +++++++++++++++++++++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 9248e7d..6cf68fa 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -2283,9 +2283,14 @@ EAPI void ecore_wl2_window_surface_flush(Ecore_Wl2_Window *window); // TIZEN_ONLY(20171107): support a tizen_keyrouter interface EAPI void ecore_wl2_display_sync(Ecore_Wl2_Display *display); // + // TIZEN_ONLY(20171107): add ecore_wl2_window_input_get() EAPI EAPI Ecore_Wl2_Input *ecore_wl2_window_input_get(Ecore_Wl2_Window *win); // +// TIZEN_ONLY(20171114): support a pointer warp +EAPI Eina_Bool ecore_wl2_window_pointer_warp(Ecore_Wl2_Window *win, int x, int y); +// + //TIZEN_ONLY(20171108): add a new API to ecore_wl2_sync EAPI void ecore_wl2_sync(void); // diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c index d6a703d..b0c1bae 100644 --- a/src/lib/ecore_wl2/ecore_wl2_window.c +++ b/src/lib/ecore_wl2/ecore_wl2_window.c @@ -2744,3 +2744,23 @@ ecore_wl2_window_input_get(Ecore_Wl2_Window *win) return NULL; } // + +// TIZEN_ONLY(20171114): support a pointer warp +EAPI Eina_Bool +ecore_wl2_window_pointer_warp(Ecore_Wl2_Window *win, int x, int y) +{ + Ecore_Wl2_Display *ewd; + + /* FIXME: visible is not merged yet. */ + //if (!win || !win->surface || !win->visible) return EINA_FALSE; + if (!win || !win->surface) return EINA_FALSE; + + ewd = win->display; + if (!ewd || !ewd->wl.tz_input_device_manager) return EINA_FALSE; + + tizen_input_device_manager_pointer_warp(ewd->wl.tz_input_device_manager, + win->surface, wl_fixed_from_int(x), wl_fixed_from_int(y)); + + return EINA_TRUE; +} +// 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 8099e00..ee2465c 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 @@ -1637,6 +1637,24 @@ _ecore_evas_wl_common_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_C if (input) ecore_wl2_input_pointer_xy_get(input, x, y); } +// TIZEN_ONLY(20171114): support a pointer warp +static 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_wl2_window_pointer_warp(wdata->win, x, y); + return ret; +} +// + static void _ecore_evas_wl_common_wm_rot_preferred_rotation_set(Ecore_Evas *ee, int rot) { @@ -2825,7 +2843,9 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func = NULL, // func msg send _ecore_evas_wl_common_pointer_xy_get, - NULL, // pointer_warp + // TIZEN_ONLY(20171114): support a 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