discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e9572a653742f0e613905e47767ae116297928d3
commit e9572a653742f0e613905e47767ae116297928d3 Author: Mike Blumenkrantz <zm...@osg.samsung.com> Date: Thu Oct 19 12:57:28 2017 -0400 efl_wl: add function for returning the evas object for an extracted surface @feature --- src/lib/efl_wl/Efl_Wl.h | 11 +++++++++++ src/lib/efl_wl/efl_wl.c | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h index d4385d2a59..cf3de2112e 100644 --- a/src/lib/efl_wl/Efl_Wl.h +++ b/src/lib/efl_wl/Efl_Wl.h @@ -143,6 +143,17 @@ EAPI void *efl_wl_global_add(Evas_Object *obj, const void *interface, uint32_t v * @since 1.21 */ EAPI Eina_Bool efl_wl_surface_extract(Evas_Object *surface); + +/** + * Get the Evas_Object for an extracted wl_surface resource created by an efl_wl object + * + * @note Passing anything other than a valid wl_surface resource from an efl_wl object will guarantee a crash. + * + * @param surface_resource The wl_resource for a wl_surface + * @return The Evas_Object of the surface, NULL on failure + * @since 1.21 + */ +EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource); #endif #endif diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index 9eec04e916..7e76d2a765 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -5561,3 +5561,15 @@ efl_wl_surface_extract(Evas_Object *surface) evas_object_smart_member_del(surface); return EINA_TRUE; } + +Evas_Object * +efl_wl_extracted_surface_object_find(void *surface_resource) +{ + Comp_Surface *cs = wl_resource_get_user_data(surface_resource); + + EINA_SAFETY_ON_NULL_RETURN_VAL(cs, NULL); + EINA_SAFETY_ON_TRUE_RETURN_VAL(!cs->extracted, NULL); + EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, NULL); + + return cs->obj; +} --