From 23cf5e80f780c55dbaebc819292d0bc60fa86fcf Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 17 May 2017 16:02:53 -0400 Subject: [PATCH] elm_win: add elm_win_get() it's frequently useful to be able to return the window object from any object. this simplifies doing so for users @feature --- src/lib/elementary/efl_ui_win.c | 7 +++++++ src/lib/elementary/elm_win_legacy.h | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 37f46ff..3f9ca18 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -6880,6 +6880,13 @@ _efl_ui_win_move_resize_start(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Efl_Ui_W return _win_move_resize_start(sd, mode); } +EAPI Evas_Object * +elm_win_get(Evas_Object *obj) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); + return ecore_evas_data_get(ecore_evas_ecore_evas_get(evas_object_evas_get(obj)), "elm_win"); +} + /* windowing specific calls - shall we do this differently? */ EAPI Ecore_X_Window diff --git a/src/lib/elementary/elm_win_legacy.h b/src/lib/elementary/elm_win_legacy.h index a4c45ab..ebb4ff5 100644 --- a/src/lib/elementary/elm_win_legacy.h +++ b/src/lib/elementary/elm_win_legacy.h @@ -1088,3 +1088,11 @@ EAPI void elm_win_aspect_set(Elm_Win *obj, double aspect); * by height. */ EAPI double elm_win_aspect_get(const Elm_Win *obj); + +/** + * @brief Get the elm_win object from any child object + * + * @return The elm_win, or @c NULL on failure + * @since 1.20 + */ +EAPI Evas_Object *elm_win_get(Evas_Object *obj); -- 2.7.4