ecore_wl2: support a pointer warp
authorJengHyun Kang <jhyuni.kang@samsung.com>
Tue, 14 Nov 2017 01:54:23 +0000 (10:54 +0900)
committerJiyoun Park <jy0703.park@samsung.com>
Tue, 19 Dec 2017 07:30:03 +0000 (16:30 +0900)
Change-Id: I61cd86806c5441a2de3bd35385182e2d289fb965

src/lib/ecore_wl2/Ecore_Wl2.h
src/lib/ecore_wl2/ecore_wl2_window.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c

index 9248e7d..6cf68fa 100644 (file)
@@ -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);
 //
index d6a703d..b0c1bae 100644 (file)
@@ -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;
+}
+//
index 8099e00..ee2465c 100644 (file)
@@ -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,