summaryrefslogtreecommitdiff
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
parent0f7c5582a4873711e0e086a8c725ffe899e29bcf (diff)
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);
156 * @since 1.21 156 * @since 1.21
157 */ 157 */
158EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource); 158EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource);
159
160/**
161 * Get the Evas_Object for an extracted surface's parent
162 *
163 * @note Passing anything other than a valid, extracted surface guarantees a crash.
164 *
165 * @param surface The extracted surface for a wl_surface
166 * @return The Evas_Object of the parent surface, NULL on failure or if there is no parent
167 * @since 1.21
168 */
169EAPI Evas_Object *efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface);
159#endif 170#endif
160 171
161#endif 172#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)
5585 5585
5586 return cs->obj; 5586 return cs->obj;
5587} 5587}
5588
5589Evas_Object *
5590efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface)
5591{
5592 Comp_Surface *cs;
5593
5594 EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL);
5595 if (!eina_streq(evas_object_type_get(surface), "comp_surface")) abort();
5596
5597 cs = evas_object_smart_data_get(surface);
5598 EINA_SAFETY_ON_TRUE_RETURN_VAL(!cs->extracted, NULL);
5599 EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, NULL);
5600
5601 if (cs->parent)
5602 {
5603 EINA_SAFETY_ON_FALSE_RETURN_VAL(!cs->parent->extracted, NULL);
5604 return cs->parent->obj;
5605 }
5606 return NULL;
5607}