From 43ef483801066ba103bf93de3eb01f7787e5150b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 4 Mar 2019 13:36:47 -0500 Subject: [PATCH] efl.ui.widget: remove widget_top property Summary: this can be mimicked with efl_provider_find as the top widget should always be efl.ui.win ref T7553 Depends on D8063 Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl_api Maniphest Tasks: T7553 Differential Revision: https://phab.enlightenment.org/D8064 --- src/lib/elementary/efl_ui_layout.c | 4 ++-- src/lib/elementary/efl_ui_widget.c | 18 +++++++++--------- src/lib/elementary/efl_ui_widget.eo | 27 --------------------------- src/lib/elementary/elm_widget.h | 2 +- 4 files changed, 12 insertions(+), 39 deletions(-) diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 3e9001679c..d4d2323096 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -2384,7 +2384,7 @@ _efl_ui_layout_base_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNU eo = efl_finalize(efl_super(obj, MY_CLASS)); efl_ui_widget_theme_apply(eo); - win = efl_ui_widget_top_get(obj); + win = elm_widget_top_get(obj); if (efl_isa(win, EFL_UI_WIN_CLASS)) efl_ui_layout_theme_rotation_apply(obj, efl_ui_win_rotation_get(win)); @@ -2578,7 +2578,7 @@ _efl_ui_layout_base_automatic_theme_rotation_set(Eo *obj, Efl_Ui_Layout_Data *pd if (pd->automatic_orientation_apply == automatic) return; pd->automatic_orientation_apply = automatic; - efl_ui_layout_theme_rotation_apply(obj, efl_ui_win_rotation_get(efl_ui_widget_top_get(obj))); + efl_ui_layout_theme_rotation_apply(obj, efl_ui_win_rotation_get(elm_widget_top_get(obj))); } EOLIAN static Eina_Bool diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index cddeb68c63..473be09b2c 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -1838,25 +1838,25 @@ elm_widget_highlight_get(const Eo *obj) return sd->highlighted; } -EOLIAN static Evas_Object* -_efl_ui_widget_widget_top_get(const Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED) +EAPI Eina_Bool +elm_widget_is(const Evas_Object *obj) +{ + return _elm_widget_is(obj); +} + +EAPI Eo * +elm_widget_top_get(const Eo *obj) { Efl_Ui_Widget *parent = elm_widget_parent_get(obj); if (parent) { if (!efl_isa(parent, EFL_UI_WIDGET_CLASS)) return NULL; - return efl_ui_widget_top_get(parent); + return elm_widget_top_get(parent); } /* XXX const */ return (Evas_Object *)obj; } -EAPI Eina_Bool -elm_widget_is(const Evas_Object *obj) -{ - return _elm_widget_is(obj); -} - EAPI Evas_Object * elm_widget_parent_widget_get(const Evas_Object *obj) { diff --git a/src/lib/elementary/efl_ui_widget.eo b/src/lib/elementary/efl_ui_widget.eo index 35e0495cd7..5547a0bc3a 100644 --- a/src/lib/elementary/efl_ui_widget.eo +++ b/src/lib/elementary/efl_ui_widget.eo @@ -208,8 +208,6 @@ abstract @beta Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Obje @Efl.Ui.Widget objects have a parent hierarchy that may differ slightly from their @Efl.Object or @Efl.Canvas.Object hierarchy. This is meant for internal handling. - - See also @.widget_top. ]] set { legacy: elm_widget_parent_set; /* internal in legacy */ @@ -221,31 +219,6 @@ abstract @beta Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Obje parent: Efl.Ui.Widget @nullable; [[Widget parent object]] } } - @property widget_top { - [[Root widget in the widget hierarchy. - - This returns the top widget, in terms of widget hierarchy. This is - usually a window (@Efl.Ui.Win). This function walks the list of - @.widget_parent. - - If this widget has no parent (in terms of widget hierarchy) this - will return $null. - - Note: This may not be a display manager window in case of nested - canvases. If a "real" window is required, then you might want to - verify that the returned object is a @Efl.Ui.Win_Inlined, and then - get @Efl.Ui.Win_Inlined.inlined_parent to find an object in the - master window. - - See also @.widget_parent. - ]] - get { - legacy: elm_widget_top_get; /* internal in legacy */ - } - values { - top: Efl.Ui.Widget; [[Top widget, usually a window.]] - } - } /* Accessibility */ @property access_info { diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h index 994fd39388..a2e4756ec6 100644 --- a/src/lib/elementary/elm_widget.h +++ b/src/lib/elementary/elm_widget.h @@ -603,7 +603,7 @@ EAPI Eina_Bool elm_widget_highlight_in_theme_get(const Evas_Object *obj); EAPI void elm_widget_access_highlight_in_theme_set(Evas_Object *obj, Eina_Bool highlight); EAPI Eina_Bool elm_widget_access_highlight_in_theme_get(const Evas_Object *obj); EAPI Eina_Bool elm_widget_highlight_get(const Evas_Object *obj); -EAPI Evas_Object *elm_widget_top_get(const Evas_Object *obj); +EAPI Eo *elm_widget_top_get(const Eo *obj); EAPI Eina_Bool elm_widget_is(const Evas_Object *obj); EAPI Evas_Object *elm_widget_parent_widget_get(const Evas_Object *obj); EAPI void elm_widget_event_callback_add(Evas_Object *obj, Elm_Event_Cb func, const void *data);