From 157a01d3e7dc0a0874052a15109b37968c9ad588 Mon Sep 17 00:00:00 2001 From: Brett Nash Date: Wed, 23 Jun 2010 08:51:58 +0000 Subject: [PATCH] Add elm_object_top_widget_get(): Useful for hoversels. Also useful for arguments about widget_top or top_widget. After all it's not a widget of type top, but rather the widget at the top. Your views? Opinions on a postcard plase. SVN revision: 49814 --- src/lib/Elementary.h.in | 1 + src/lib/elm_main.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 63c7b11..46ba6f1 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -265,6 +265,7 @@ extern "C" { EAPI Eina_Bool elm_object_widget_check(const Evas_Object *obj); EAPI Evas_Object *elm_object_parent_widget_get(const Evas_Object *obj); + EAPI Evas_Object *elm_object_top_widget_get(const Evas_Object *obj); EAPI const char *elm_object_widget_type_get(const Evas_Object *obj); EAPI double elm_scale_get(void); diff --git a/src/lib/elm_main.c b/src/lib/elm_main.c index 4729ce0..389dbba 100644 --- a/src/lib/elm_main.c +++ b/src/lib/elm_main.c @@ -1362,6 +1362,19 @@ elm_object_parent_widget_get(const Evas_Object *obj) } /** + * Get the top level parent of an Elementary widget. + * + * @param obj The object to query. + * @return The top level Elementary widget, or @c NULL if parent cannot be + * found. + */ +EAPI Evas_Object * +elm_object_top_widget_get(const Evas_Object *obj) +{ + return elm_widget_top_get(obj); +} + +/** * Get the string that represents this Elementary widget. * * @note Elementary is weird and exposes itself as a single -- 2.7.4