From 7030bb1c3f98fe36bedfa3b2d36159195bfbd85d Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 27 Feb 2019 14:01:05 -0500 Subject: [PATCH] efl_ui_widget: make interest_region_mode legacy summary_: interest_region_mode makes it possible, that interest_region_get either returns WIDGET or ITEM coordinates. However, efl-api does not have items. That means, this can be legacy. ref T7553 Depends on D8026 Reviewers: woohyun, cedric, Jaehyun_Cho, zmike, segfaultxavi Reviewed By: segfaultxavi Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T7553 Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D8027 --- src/lib/elementary/efl_ui.eot | 7 ------- src/lib/elementary/efl_ui_widget.c | 12 ------------ src/lib/elementary/efl_ui_widget.eo | 20 -------------------- src/lib/elementary/elm_general.h | 9 ++++++--- src/lib/elementary/elm_main.c | 14 ++++++++++++-- src/lib/elementary/elm_widget_gengrid.h | 2 ++ 6 files changed, 20 insertions(+), 44 deletions(-) diff --git a/src/lib/elementary/efl_ui.eot b/src/lib/elementary/efl_ui.eot index ce17980..ea61daf 100644 --- a/src/lib/elementary/efl_ui.eot +++ b/src/lib/elementary/efl_ui.eot @@ -23,13 +23,6 @@ enum Efl.Ui.Focus.Direction last = 6 [[ last direction ]] } -enum Efl.Ui.Interest_Region_Mode -{ - [[Focus region show mode.]] - widget, [[As a widget.]] - item, [[As an item.]] -} - enum Efl.Ui.Focus.Move_Policy { [[Focus Movement Policy. diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index be62f19..58c68ad 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -3682,18 +3682,6 @@ _efl_ui_widget_focus_highlight_geometry_get(const Eo *obj, Elm_Widget_Smart_Data return r; } -EOLIAN static void -_efl_ui_widget_interest_region_mode_set(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd, Elm_Focus_Region_Show_Mode mode) -{ - _pd->focus_region_show_mode = mode; -} - -EOLIAN static Elm_Focus_Region_Show_Mode -_efl_ui_widget_interest_region_mode_get(const Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd) -{ - return _pd->focus_region_show_mode; -} - EAPI void elm_widget_activate(Evas_Object *obj, Efl_Ui_Activate act) { diff --git a/src/lib/elementary/efl_ui_widget.eo b/src/lib/elementary/efl_ui_widget.eo index c0eebb7..61de06e 100644 --- a/src/lib/elementary/efl_ui_widget.eo +++ b/src/lib/elementary/efl_ui_widget.eo @@ -431,8 +431,6 @@ abstract @beta Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Obje i.e. X,Y start from 0,0 to indicate the top-left corner of the widget. W,H must be greater or equal to 1 for this region to be taken into account, otherwise it is ignored. - - See also @.interest_region_mode ]] get { legacy: elm_widget_focus_region_get; @@ -443,24 +441,6 @@ abstract @beta Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Obje will be ignored, and no action will be taken.]] } } - @property interest_region_mode { - [[Defines how @.interest_region should be calculated. - - It is up to the implementation of @.interest_region.get to take this - value into account (or ignore it). - ]] - get { - legacy: elm_widget_focus_region_show_mode_get; - } - set { - legacy: elm_widget_focus_region_show_mode_set; - } - values { - mode: Efl.Ui.Interest_Region_Mode; - [[Whether to show a specific item or the widget as a whole.]] - } - } - /* Focus highlight (visual focus rectangle) properties */ @property focus_highlight_geometry @protected { [[The rectangle region to be highlighted on focus. diff --git a/src/lib/elementary/elm_general.h b/src/lib/elementary/elm_general.h index 74a86b8..a48b7f3 100644 --- a/src/lib/elementary/elm_general.h +++ b/src/lib/elementary/elm_general.h @@ -50,9 +50,12 @@ typedef enum } Elm_Object_Layer; /** How the focus region should be calculated (not related to input focus). */ -typedef Efl_Ui_Interest_Region_Mode Elm_Focus_Region_Show_Mode; -#define ELM_FOCUS_REGION_SHOW_WIDGET EFL_UI_INTEREST_REGION_MODE_WIDGET -#define ELM_FOCUS_REGION_SHOW_ITEM EFL_UI_INTEREST_REGION_MODE_ITEM +typedef enum +{ + ELM_FOCUS_REGION_SHOW_WIDGET = 0, /**< As a widget. */ + ELM_FOCUS_REGION_SHOW_ITEM /**< As an item. */ +} Elm_Focus_Region_Show_Mode; + /**************************************************************************/ EAPI extern int ELM_ECORE_EVENT_ETHUMB_CONNECT; diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c index 26fd5d5..97be660 100644 --- a/src/lib/elementary/elm_main.c +++ b/src/lib/elementary/elm_main.c @@ -27,6 +27,7 @@ //we need those for legacy compatible code #include "elm_genlist.eo.h" #include "elm_gengrid.eo.h" +#include "elm_widget_gengrid.h" #define SEMI_BROKEN_QUICKLAUNCH 1 @@ -2021,7 +2022,11 @@ elm_object_focused_item_get(const Evas_Object *obj) EAPI void elm_object_focus_region_show_mode_set(Evas_Object *obj, Elm_Focus_Region_Show_Mode mode) { - elm_widget_focus_region_show_mode_set(obj, mode); + if (efl_isa(obj, ELM_GENGRID_CLASS)) + { + Elm_Gengrid_Data *pd = efl_data_scope_get(obj, ELM_GENGRID_CLASS); + pd->mode = mode; + } } EAPI Evas_Object * @@ -2058,7 +2063,12 @@ _elm_object_accessibility_currently_highlighted_get(void) EAPI Elm_Focus_Region_Show_Mode elm_object_focus_region_show_mode_get(const Evas_Object *obj) { - return elm_widget_focus_region_show_mode_get(obj); + if (efl_isa(obj, ELM_GENGRID_CLASS)) + { + Elm_Gengrid_Data *pd = efl_data_scope_get(obj, ELM_GENGRID_CLASS); + return pd->mode; + } + return ELM_FOCUS_REGION_SHOW_WIDGET; } static void diff --git a/src/lib/elementary/elm_widget_gengrid.h b/src/lib/elementary/elm_widget_gengrid.h index a5ce9e8..bfe146a 100644 --- a/src/lib/elementary/elm_widget_gengrid.h +++ b/src/lib/elementary/elm_widget_gengrid.h @@ -97,6 +97,8 @@ struct _Elm_Gengrid_Data Elm_Gengrid_Reorder_Type type; /**< Reorder type */ Eina_Bool running : 1; /**< animation is happening */ } reorder; + Elm_Focus_Region_Show_Mode mode; /**< the mode which describes which rectangle should be returned in the interest region getter*/ + //TIZEN_ONLY(20190130) : Apply circle gengrid struct { -- 2.7.4