Add pre_post_swap_callback_set to Wayland Interface for Ecore_Evas.
authorChris Michael <devilhorns@comcast.net>
Thu, 6 Jun 2013 03:30:40 +0000 (04:30 +0100)
committerChris Michael <devilhorns@comcast.net>
Thu, 6 Jun 2013 03:42:57 +0000 (04:42 +0100)
Signed-off-by: Chris Michael <devilhorns@comcast.net>
src/lib/ecore_evas/ecore_evas_wayland.h
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c

index 35d4fdd..00367ef 100644 (file)
@@ -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
index 172b8f3..aa83cb0 100644 (file)
@@ -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;
 }