From 2257453fe4e70052e14dad8f7f7b04ce034c1ac5 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 17 Mar 2010 01:08:39 +0000 Subject: [PATCH] example of how to work around heirachy to go back up the tree - but wont work for going bck down. i.e. - focus. SVN revision: 47302 --- legacy/elementary/src/lib/elm_widget.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/legacy/elementary/src/lib/elm_widget.c b/legacy/elementary/src/lib/elm_widget.c index 78d6e9ffa0..6f5b1d3866 100644 --- a/legacy/elementary/src/lib/elm_widget.c +++ b/legacy/elementary/src/lib/elm_widget.c @@ -345,9 +345,26 @@ elm_widget_focused_object_get(const Evas_Object *obj) EAPI Evas_Object * elm_widget_top_get(const Evas_Object *obj) { +#if 1 // strict way API_ENTRY return NULL; if (sd->parent_obj) return elm_widget_top_get(sd->parent_obj); return (Evas_Object *)obj; +#else // loose way + Smart_Data *sd = evas_object_smart_data_get(obj); + Evas_Object *par; + + if (!obj) return NULL; + if ((sd) && (!strcmp(evas_object_type_get(obj), SMART_NAME))) + { + if ((sd->type) && (!strcmp(sd->type, "win"))) + return (Evas_Object *)obj; + if (sd->parent_obj) + return elm_widget_top_get(sd->parent_obj); + } + par = evas_object_smart_parent_get(obj); + if (!par) return (Evas_Object *)obj; + return elm_widget_top_get(par); +#endif } EAPI int