forked from enlightenment/enlightenment
add functions to create new compositor
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
5137277c93
commit
62471b5b5b
|
@ -6,6 +6,38 @@
|
|||
#define E_COMP_WL_PIXMAP_CHECK \
|
||||
if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return
|
||||
|
||||
/* local functions */
|
||||
static void
|
||||
_e_comp_wl_cb_del(E_Comp *comp)
|
||||
{
|
||||
E_Comp_Data *cdata;
|
||||
|
||||
/* get existing compositor data */
|
||||
if (!(cdata = comp->wl_comp_data)) return;
|
||||
|
||||
/* free allocated data structure */
|
||||
free(cdata);
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_e_comp_wl_compositor_create(void)
|
||||
{
|
||||
E_Comp *comp;
|
||||
|
||||
/* check for existing compositor. create if needed */
|
||||
if (!(comp = e_comp_get(NULL)))
|
||||
{
|
||||
comp = e_comp_new();
|
||||
comp->comp_type = E_PIXMAP_TYPE_WL;
|
||||
E_OBJECT_DEL_SET(comp, _e_comp_wl_cb_del);
|
||||
}
|
||||
|
||||
/* create new compositor data */
|
||||
cdata = E_NEW(E_Comp_Data, 1);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
/* public functions */
|
||||
EAPI Eina_Bool
|
||||
e_comp_wl_init(void)
|
||||
|
@ -15,7 +47,14 @@ e_comp_wl_init(void)
|
|||
ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_DRM))
|
||||
e_comp_gl_set(EINA_TRUE);
|
||||
|
||||
return EINA_FALSE;
|
||||
/* try to create a wayland compositor */
|
||||
if (!_e_comp_wl_compositor_create())
|
||||
{
|
||||
e_error_message_show(_("Enlightenment cannot create a Wayland Compositor!\n"));
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI struct wl_signal
|
||||
|
|
Loading…
Reference in New Issue