From: Jean-Philippe Andre Date: Thu, 31 Aug 2017 06:57:53 +0000 (+0900) Subject: win: Move focus_highlight_enabled to widget (EO) X-Git-Tag: submit/sandbox/upgrade/efl120/20180319.053334~2826 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94632f8a44f5128ef6556aee7e0b3ff3fc2466af;p=platform%2Fupstream%2Fefl.git win: Move focus_highlight_enabled to widget (EO) This was actually declared in the internal legacy API in widget. Forwards the calls to the window. Ref T --- diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index a19456b..ddd7d61 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -6279,8 +6279,9 @@ _efl_ui_win_keygrab_unset(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, const char * } EOLIAN static void -_efl_ui_win_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool enabled) +_efl_ui_win_elm_widget_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Bool enabled) { + // Do not call efl_super() here. Only Win handles this property. enabled = !!enabled; if (sd->focus_highlight.enabled == enabled) return; @@ -6294,8 +6295,9 @@ _efl_ui_win_focus_highlight_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd } EOLIAN static Eina_Bool -_efl_ui_win_focus_highlight_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +_efl_ui_win_elm_widget_focus_highlight_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) { + // Do not call efl_super() here. Only Win handles this property. return sd->focus_highlight.enabled; } @@ -8178,6 +8180,17 @@ elm_win_focus_highlight_style_get(const Elm_Win *obj) return elm_widget_focus_highlight_style_get(obj); } +EAPI Eina_Bool +elm_win_focus_highlight_enabled_get(const Efl_Ui_Win *obj) +{ + return elm_widget_focus_highlight_enabled_get(obj); +} + +EAPI void +elm_win_focus_highlight_enabled_set(Efl_Ui_Win *obj, Eina_Bool enabled) +{ + elm_obj_widget_focus_highlight_enabled_set(obj, enabled); +} // deprecated diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index 83e095d..80253a5 100644 --- a/src/lib/elementary/efl_ui_win.eo +++ b/src/lib/elementary/efl_ui_win.eo @@ -268,27 +268,12 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window, constrain: bool; [[$true to restrict the window's maximum size.]] } } - @property focus_highlight_enabled { - set { - [[Set the enabled status for the focus highlight in a window. - - This function will enable or disable the focus highlight only - for the given window, regardless of the global setting for it. - ]] - } - get { - [[Get the enabled value of the focus highlight for this window.]] - } - values { - enabled: bool; [[The enabled value for the highlight.]] - } - } @property focus_highlight_animate { set { [[Set the animate status for the focus highlight for this window. This function will enable or disable the animation of focus - highlight only for the given window, regardless of the + highlight only for the given window, rof the global setting for it. ]] } @@ -885,6 +870,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window, Elm.Widget.theme_apply; Elm.Widget.focus { get; } Elm.Widget.focus_highlight_style { get; set; } + Elm.Widget.focus_highlight_enabled { get; set; } Elm.Widget.on_focus_update; Elm.Widget.widget_event; Elm.Widget.focus_manager_factory; diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c index 9e69af9..228abfb 100644 --- a/src/lib/elementary/elm_widget.c +++ b/src/lib/elementary/elm_widget.c @@ -190,16 +190,28 @@ _elm_widget_focus_highlight_object_get(const Evas_Object *obj) return NULL; } -EAPI Eina_Bool -elm_widget_focus_highlight_enabled_get(const Evas_Object *obj) +EOLIAN static Eina_Bool +_elm_widget_focus_highlight_enabled_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED) { + // Forward to closest parent Window const Evas_Object *win = elm_widget_top_get(obj); if (win && efl_isa(win, EFL_UI_WIN_CLASS)) return elm_win_focus_highlight_enabled_get(win); + return EINA_FALSE; } +EOLIAN static void +_elm_widget_focus_highlight_enabled_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, Eina_Bool enable) +{ + // Forward to closest parent Window + Evas_Object *win = elm_widget_top_get(obj); + + if (win && efl_isa(win, EFL_UI_WIN_CLASS)) + elm_win_focus_highlight_enabled_set(win, enable); +} + static Eina_Bool _tree_unfocusable(Eo *obj) { diff --git a/src/lib/elementary/elm_widget.eo b/src/lib/elementary/elm_widget.eo index b354c7c..6018146 100644 --- a/src/lib/elementary/elm_widget.eo +++ b/src/lib/elementary/elm_widget.eo @@ -530,6 +530,21 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible, style: string @nullable; [[The name of the focus highlight style.]] } } + @property focus_highlight_enabled { + set { + [[Set the enabled status for the focus highlight in a window. + + This function will enable or disable the focus highlight only + for the given window, regardless of the global setting for it. + ]] + } + get { + [[Get the enabled value of the focus highlight for this window.]] + } + values { + enabled: bool; [[The enabled value for the highlight.]] + } + } /* Old focus API. FIXME: Needs massive clean up! */ @property focus_order @beta { diff --git a/src/lib/elementary/elm_win_legacy.h b/src/lib/elementary/elm_win_legacy.h index 7f0e34c..48b0590 100644 --- a/src/lib/elementary/elm_win_legacy.h +++ b/src/lib/elementary/elm_win_legacy.h @@ -1178,3 +1178,24 @@ EAPI void elm_win_focus_highlight_style_set(Elm_Win *obj, const char *style); * @ingroup Efl_Ui_Win */ EAPI const char *elm_win_focus_highlight_style_get(const Elm_Win *obj); + +/** + * @brief Set the enabled status for the focus highlight in a window. + * + * This function will enable or disable the focus highlight only for the given + * window, regardless of the global setting for it. + * + * @param[in] enabled The enabled value for the highlight. + * + * @ingroup Efl_Ui_Win + */ +EAPI void elm_win_focus_highlight_enabled_set(Elm_Win *obj, Eina_Bool enabled); + +/** + * @brief Get the enabled value of the focus highlight for this window. + * + * @return The enabled value for the highlight. + * + * @ingroup Efl_Ui_Win + */ +EAPI Eina_Bool elm_win_focus_highlight_enabled_get(const Elm_Win *obj);