devilhorns pushed a commit to branch master.
commit 6e54a050d8213ad807e7ca59ea970df635a47bdf
Author: Chris Michael <[email protected]>
Date: Thu Jun 6 04:30:40 2013 +0100
Add pre_post_swap_callback_set to Wayland Interface for Ecore_Evas.
Signed-off-by: Chris Michael <[email protected]>
---
src/lib/ecore_evas/ecore_evas_wayland.h | 1 +
.../engines/wayland/ecore_evas_wayland_common.c | 28 ++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/src/lib/ecore_evas/ecore_evas_wayland.h
b/src/lib/ecore_evas/ecore_evas_wayland.h
index 35d4fdd..00367ef 100644
--- a/src/lib/ecore_evas/ecore_evas_wayland.h
+++ b/src/lib/ecore_evas/ecore_evas_wayland.h
@@ -12,6 +12,7 @@ struct _Ecore_Evas_Interface_Wayland
void (*pointer_set)(Ecore_Evas *ee, int hot_x, int hot_y);
void (*type_set)(Ecore_Evas *ee, int type);
Ecore_Wl_Window* (*window_get)(const Ecore_Evas *ee);
+ void (*pre_post_swap_callback_set)(const Ecore_Evas *ee, void *data, void
(*pre_cb) (void *data, Evas *e), void (*post_cb) (void *data, Evas *e));
};
#endif
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 172b8f3..aa83cb0 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
@@ -3,6 +3,9 @@
#endif
#include "ecore_evas_wayland_private.h"
+#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
+# include <Evas_Engine_Wayland_Egl.h>
+#endif
#define _smart_frame_type "ecore_evas_wl_frame"
@@ -1334,6 +1337,26 @@ _ecore_evas_wayland_window_get(const Ecore_Evas *ee)
return wdata->win;
}
+
+#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
+static void
+_ecore_evas_wayland_pre_post_swap_callback_set(const Ecore_Evas *ee, void
*data, void (*pre_cb) (void *data, Evas *e), void (*post_cb) (void *data, Evas
*e))
+{
+ Evas_Engine_Info_Wayland_Egl *einfo;
+
+ if (!(!strcmp(ee->driver, "wayland_egl"))) return;
+
+ if ((einfo = (Evas_Engine_Info_Wayland_Egl
*)evas_engine_info_get(ee->evas)))
+ {
+ einfo->callback.pre_swap = pre_cb;
+ einfo->callback.post_swap = post_cb;
+ einfo->callback.data = data;
+ if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
+ ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
+ }
+}
+#endif
+
static void
_ecore_evas_wayland_pointer_set(Ecore_Evas *ee EINA_UNUSED, int hot_x
EINA_UNUSED, int hot_y EINA_UNUSED)
{
@@ -1357,5 +1380,10 @@ _ecore_evas_wl_interface_new(void)
iface->type_set = _ecore_evas_wayland_type_set;
iface->window_get = _ecore_evas_wayland_window_get;
+#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
+ iface->pre_post_swap_callback_set =
+ _ecore_evas_wayland_pre_post_swap_callback_set;
+#endif
+
return iface;
}
--
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j