EAPI struct wl_display *ecore_wl_display_get(void);
/**
+ * Retrieves the Compositor interface.
+ *
+ * This interface is used by clients to request the creation of surfaces and
+ * regions.
+ *
+ * @return The current wayland compositor interface
+ * @since 1.8
+ */
+
+/**
* Retrieves the size of the current screen.
*
* @param w where to return the width. May be NULL. Returns 0 on error.
return _ecore_wl_disp->wl.registry;
}
+struct wl_compositor *
+ecore_wl_compositor_get(void)
+{
+ if ((!_ecore_wl_disp) || (!_ecore_wl_disp->wl.display))
+ return NULL;
+
+ _ecore_wl_init_wait();
+
+ return _ecore_wl_disp->wl.compositor;
+}
+
+struct wl_subcompositor *
+ecore_wl_subcompositor_get(void)
+{
+ if ((!_ecore_wl_disp) || (!_ecore_wl_disp->wl.display))
+ return NULL;
+
+ _ecore_wl_init_wait();
+
+ return _ecore_wl_disp->wl.subcompositor;
+}
+
EAPI void
ecore_wl_screen_size_get(int *w, int *h)
{
struct wl_subsurface *subsurface;
struct wl_surface *surface;
Ecore_Wl_Subsurf *ess;
+ struct wl_subcompositor *subcomp;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return NULL;
if (!win->surface) return NULL;
- if (!_ecore_wl_disp->wl.subcompositor) return NULL;
- surface = wl_compositor_create_surface(_ecore_wl_disp->wl.compositor);
+ subcomp = ecore_wl_subcompositor_get();
+ if (!subcomp) return NULL;
+
+ surface = wl_compositor_create_surface(ecore_wl_compositor_get());
if (!surface)
return NULL;
subsurface = wl_subcompositor_get_subsurface
- (_ecore_wl_disp->wl.subcompositor, surface, win->surface);
+ (subcomp, surface, win->surface);
if (!subsurface)
{
wl_surface_destroy(surface);
EAPI void
ecore_wl_subsurf_opaque_region_set(Ecore_Wl_Subsurf *ess, int x, int y, int w, int h)
{
- Ecore_Wl_Window *parent;
struct wl_region *region = NULL;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if ((w > 0) && (h > 0))
{
- parent = ess->parent_win;
- region = wl_compositor_create_region(parent->display->wl.compositor);
+ region = wl_compositor_create_region(ecore_wl_compositor_get());
wl_region_add(region, x, y, w, h);
wl_surface_set_opaque_region(ess->surface, region);
wl_region_destroy(region);
{
if (!win) return NULL;
if (win->surface) return win->surface;
- win->surface = wl_compositor_create_surface(_ecore_wl_disp->wl.compositor);
+ win->surface = wl_compositor_create_surface(ecore_wl_compositor_get());
win->surface_id = wl_proxy_get_id((struct wl_proxy *)win->surface);
return win->surface;
}
struct wl_region *region = NULL;
region =
- wl_compositor_create_region(_ecore_wl_disp->wl.compositor);
+ wl_compositor_create_region(ecore_wl_compositor_get());
wl_region_add(region, x, y, w, h);
wl_surface_set_input_region(win->surface, region);
wl_region_destroy(region);
struct wl_region *region = NULL;
region =
- wl_compositor_create_region(_ecore_wl_disp->wl.compositor);
+ wl_compositor_create_region(ecore_wl_compositor_get());
switch (win->rotation)
{