forked from enlightenment/efl
Add pre_post_swap_callback_set to Wayland Interface for Ecore_Evas.
Signed-off-by: Chris Michael <devilhorns@comcast.net>
This commit is contained in:
parent
97a425b52d
commit
6e54a050d8
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue