aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/efl_wl
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-01-03 18:22:32 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-01-03 18:46:54 -0500
commitcca561e94e0fffe4002bee67ab15e3f0179be707 (patch)
treedadb20ad017c605958a98e7d5de8925623110bcd /src/lib/efl_wl
parentecore_con: we should just stop using ecore_main_loop_get. (diff)
downloadefl-cca561e94e0fffe4002bee67ab15e3f0179be707.tar.gz
efl-wl: add function to get the parent of an extracted surface
@feature
Diffstat (limited to 'src/lib/efl_wl')
-rw-r--r--src/lib/efl_wl/Efl_Wl.h11
-rw-r--r--src/lib/efl_wl/efl_wl.c20
2 files changed, 31 insertions, 0 deletions
diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h
index a2da869637..c6af024105 100644
--- a/src/lib/efl_wl/Efl_Wl.h
+++ b/src/lib/efl_wl/Efl_Wl.h
@@ -156,6 +156,17 @@ EAPI Eina_Bool efl_wl_surface_extract(Evas_Object *surface);
* @since 1.21
*/
EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource);
+
+/**
+ * Get the Evas_Object for an extracted surface's parent
+ *
+ * @note Passing anything other than a valid, extracted surface guarantees a crash.
+ *
+ * @param surface The extracted surface for a wl_surface
+ * @return The Evas_Object of the parent surface, NULL on failure or if there is no parent
+ * @since 1.21
+ */
+EAPI Evas_Object *efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface);
#endif
#endif
diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c
index 4a71abc26e..0943dbe3f8 100644
--- a/src/lib/efl_wl/efl_wl.c
+++ b/src/lib/efl_wl/efl_wl.c
@@ -5585,3 +5585,23 @@ efl_wl_extracted_surface_object_find(void *surface_resource)
return cs->obj;
}
+
+Evas_Object *
+efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface)
+{
+ Comp_Surface *cs;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
+ if (!eina_streq(evas_object_type_get(surface), "comp_surface")) abort();
+
+ cs = evas_object_smart_data_get(surface);
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(!cs->extracted, NULL);
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, NULL);
+
+ if (cs->parent)
+ {
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(!cs->parent->extracted, NULL);
+ return cs->parent->obj;
+ }
+ return NULL;
+}