From 0ac2cad77de382c04bf3bb0e913f43f7db1975c5 Mon Sep 17 00:00:00 2001 From: devilhorns Date: Mon, 16 Jan 2012 19:11:17 +0000 Subject: [PATCH] Ecore_Evas (wayland): Add/Fix more dnd code. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@67248 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore_evas/Ecore_Evas.h | 1 + src/lib/ecore_evas/ecore_evas.c | 38 +++++++++++++++++++++++++++-- src/lib/ecore_evas/ecore_evas_private.h | 2 ++ src/lib/ecore_evas/ecore_evas_wayland_egl.c | 10 ++++++++ src/lib/ecore_evas/ecore_evas_wayland_shm.c | 12 ++++++++- 5 files changed, 60 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h index 1c5d922..498a985 100644 --- a/src/lib/ecore_evas/Ecore_Evas.h +++ b/src/lib/ecore_evas/Ecore_Evas.h @@ -696,6 +696,7 @@ EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee) EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, int x, int y, int w, int h, int frame); 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); /** * @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 2850997..0a6ae88 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -2682,9 +2682,37 @@ ecore_evas_wayland_resize(Ecore_Evas *ee, int location) { if (!ee) return; if (!strcmp(ee->driver, "wayland_shm")) - _ecore_evas_wayland_shm_resize(ee, location); + { +#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM + _ecore_evas_wayland_shm_resize(ee, location); +#endif + } + else if (!strcmp(ee->driver, "wayland_egl")) + { +#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL + _ecore_evas_wayland_egl_resize(ee, location); +#endif + } +} + +EAPI void +ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source) +{ + if ((!ee) || (!source)) return; + if (!ee->engine.wl.surface) return; + + if (!strcmp(ee->driver, "wayland_shm")) + { +#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM + _ecore_evas_wayland_shm_drag_start(ee, drag_ee, source); +#endif + } else if (!strcmp(ee->driver, "wayland_egl")) - _ecore_evas_wayland_egl_resize(ee, location); + { +#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL + _ecore_evas_wayland_egl_drag_start(ee, drag_ee, source); +#endif + } } #else EAPI void @@ -2692,4 +2720,10 @@ ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__) { } + +EAPI void +ecore_evas_wayland_drag_start(Ecore_Evas *ee __UNUSED__, Ecore_Evas *drag_ee __UNUSED__, void *source __UNUSED__) +{ + +} #endif diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h index 76cf4a7..9a88a7a 100644 --- a/src/lib/ecore_evas/ecore_evas_private.h +++ b/src/lib/ecore_evas/ecore_evas_private.h @@ -405,10 +405,12 @@ 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); #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); #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 b8fec09..72e8555 100644 --- a/src/lib/ecore_evas/ecore_evas_wayland_egl.c +++ b/src/lib/ecore_evas/ecore_evas_wayland_egl.c @@ -1112,6 +1112,16 @@ _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location) _ecore_evas_wl_btn_timestamp, location); } +void +_ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source) +{ + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + if ((!ee) || (!ee->engine.wl.surface)) return; + if ((!source) || (!drag_ee)) return; + ecore_wl_drag_start(source, ee->engine.wl.surface, drag_ee->engine.wl.buffer); +} + #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 97adc8c..e3b15c8 100644 --- a/src/lib/ecore_evas/ecore_evas_wayland_shm.c +++ b/src/lib/ecore_evas/ecore_evas_wayland_shm.c @@ -2,7 +2,7 @@ # include "config.h" #endif -#define LOGFNS 1 +//#define LOGFNS 1 #ifdef LOGFNS # include @@ -1238,6 +1238,16 @@ _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location) _ecore_evas_wl_btn_timestamp, location); } +void +_ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source) +{ + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + if ((!ee) || (!ee->engine.wl.surface)) return; + if ((!source) || (!drag_ee)) return; + ecore_wl_drag_start(source, ee->engine.wl.surface, drag_ee->engine.wl.buffer); +} + #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__) -- 2.7.4