From: devilhorns Date: Fri, 10 Feb 2012 09:16:29 +0000 (+0000) Subject: Ecore_Evas: Add functions for setting wayland mouse pointer (used from X-Git-Tag: 2.0_alpha~68^2~89 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c65f3c7520ad6acfc56ae9924cba126f1e607c84;p=framework%2Fuifw%2Fecore.git Ecore_Evas: Add functions for setting wayland mouse pointer (used from elm wayland clients). git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@67816 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h index 8d9abc4..e49b7a1 100644 --- a/src/lib/ecore_evas/Ecore_Evas.h +++ b/src/lib/ecore_evas/Ecore_Evas.h @@ -697,6 +697,7 @@ EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, int x, in EAPI Ecore_Evas *ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, int frame); EAPI void ecore_evas_wayland_resize(Ecore_Evas *ee, int location); EAPI void ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source); +EAPI void ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y); /** * @brief Create a new @c Ecore_Evas canvas bound to the Evas diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index 2b04488..bbbf6b8 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -2714,6 +2714,29 @@ ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source) #endif } } + +EAPI void +ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y) +{ + if (!ee) return; + if (!ee->engine.wl.surface) return; + + if (!strcmp(ee->driver, "wayland_shm")) + { +#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM + _ecore_evas_wayland_shm_pointer_set(ee, hot_x, hot_y); +// _ecore_evas_wayland_shm_drag_start(ee, drag_ee, source); +#endif + } + else if (!strcmp(ee->driver, "wayland_egl")) + { +#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL + _ecore_evas_wayland_egl_pointer_set(ee, hot_x, hot_y); +// _ecore_evas_wayland_egl_drag_start(ee, drag_ee, source); +#endif + } +} + #else EAPI void ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__) @@ -2726,4 +2749,10 @@ ecore_evas_wayland_drag_start(Ecore_Evas *ee __UNUSED__, Ecore_Evas *drag_ee __U { } + +EAPI void +ecore_evas_wayland_pointer_set(Ecore_Evas *ee __UNUSED__, int hot_x __UNUSED__, int hot_y __UNUSED__) +{ + +} #endif diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h index 9a88a7a..f99f745 100644 --- a/src/lib/ecore_evas/ecore_evas_private.h +++ b/src/lib/ecore_evas/ecore_evas_private.h @@ -406,11 +406,13 @@ int _ecore_evas_ews_shutdown(void); #ifdef BUILD_ECORE_EVAS_WAYLAND_SHM void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location); void _ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source); +void _ecore_evas_wayland_shm_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y); #endif #ifdef BUILD_ECORE_EVAS_WAYLAND_EGL void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location); void _ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source); +void _ecore_evas_wayland_egl_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y); #endif void _ecore_evas_fps_debug_init(void); diff --git a/src/lib/ecore_evas/ecore_evas_wayland_egl.c b/src/lib/ecore_evas/ecore_evas_wayland_egl.c index 7bd565e..36f437a 100644 --- a/src/lib/ecore_evas/ecore_evas_wayland_egl.c +++ b/src/lib/ecore_evas/ecore_evas_wayland_egl.c @@ -1042,6 +1042,17 @@ _ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *so ecore_wl_drag_start(source, ee->engine.wl.surface, drag_ee->engine.wl.buffer); } +void +_ecore_evas_wayland_egl_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y) +{ + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + if ((!ee) || (!ee->engine.wl.surface)) return; + wl_input_device_attach(ecore_wl_input_device_get(), + ecore_wl_input_timestamp_get(), + ee->engine.wl.buffer, hot_x, hot_y); +} + #else EAPI Ecore_Evas * ecore_evas_wayland_egl_new(const char *disp_name __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, int frame __UNUSED__) diff --git a/src/lib/ecore_evas/ecore_evas_wayland_shm.c b/src/lib/ecore_evas/ecore_evas_wayland_shm.c index f905011..8877942 100644 --- a/src/lib/ecore_evas/ecore_evas_wayland_shm.c +++ b/src/lib/ecore_evas/ecore_evas_wayland_shm.c @@ -1170,6 +1170,17 @@ _ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *so ecore_wl_drag_start(source, ee->engine.wl.surface, drag_ee->engine.wl.buffer); } +void +_ecore_evas_wayland_shm_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y) +{ + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + if ((!ee) || (!ee->engine.wl.surface)) return; + wl_input_device_attach(ecore_wl_input_device_get(), + ecore_wl_input_timestamp_get(), + ee->engine.wl.buffer, hot_x, hot_y); +} + #else EAPI Ecore_Evas * ecore_evas_wayland_shm_new(const char *disp_name __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, int frame __UNUSED__)