From 32bb1237c69c517c50eb6564cf47901a4bb84532 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Tue, 6 Oct 2015 10:14:06 -0400 Subject: [PATCH] ecore-wl2: Add API function to return the wl_surface of a subsurface Signed-off-by: Chris Michael --- src/lib/ecore_wl2/Ecore_Wl2.h | 13 ++++++++++++- src/lib/ecore_wl2/ecore_wl2_subsurf.c | 8 ++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index 73ff8b000e..fe49269131 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -593,12 +593,23 @@ EAPI Ecore_Wl2_Subsurface *ecore_wl2_subsurface_new(Ecore_Wl2_Window *window); /** * Destroy the given subsurface, as well as the surface associated with it. * - * @param ess the subsurface + * @param subsurface the subsurface * * @ingroup Ecore_Wl2_Subsurface_Group */ EAPI void ecore_wl2_subsurface_del(Ecore_Wl2_Subsurface *subsurface); +/** + * Get the wl_surface for this subsurface + * + * @param subsurface the subsurface + * + * @return the wl_surface associated with this subsurface, or NULL on failure + * + * @ingroup Ecore_Wl2_Subsurface_Group + */ +EAPI struct wl_surface *ecore_wl2_subsurface_surface_get(Ecore_Wl2_Subsurface *subsurface); + /* # ifdef __cplusplus */ /* } */ /* # endif */ diff --git a/src/lib/ecore_wl2/ecore_wl2_subsurf.c b/src/lib/ecore_wl2/ecore_wl2_subsurf.c index ac8d1830bf..eab1ec630c 100644 --- a/src/lib/ecore_wl2/ecore_wl2_subsurf.c +++ b/src/lib/ecore_wl2/ecore_wl2_subsurf.c @@ -77,3 +77,11 @@ ecore_wl2_subsurface_del(Ecore_Wl2_Subsurface *subsurface) _ecore_wl2_subsurf_free(subsurface); } + +EAPI struct wl_surface * +ecore_wl2_subsurface_surface_get(Ecore_Wl2_Subsurface *subsurface) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(subsurface, NULL); + + return subsurface->wl.surface; +}