jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7ba0ab5182aaff4d90d9ccabe00a33933fc475df
commit 7ba0ab5182aaff4d90d9ccabe00a33933fc475df Author: Jean-Philippe Andre <jp.an...@samsung.com> Date: Wed Aug 2 20:46:16 2017 +0900 layout: Implement freeze and thaw from interface This implements part of the interface Efl.Canvas.Layout_Calc --- src/lib/elementary/elm_layout.c | 20 +++++++++++++++----- src/lib/elementary/elm_layout.eo | 28 ++++------------------------ src/lib/elementary/elm_layout_legacy.h | 26 ++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 29 deletions(-) diff --git a/src/lib/elementary/elm_layout.c b/src/lib/elementary/elm_layout.c index 0d7f5eeb28..1dabb1f356 100644 --- a/src/lib/elementary/elm_layout.c +++ b/src/lib/elementary/elm_layout.c @@ -1703,10 +1703,9 @@ _elm_layout_sizing_restricted_eval(Eo *obj, Elm_Layout_Smart_Data *sd, Eina_Bool } EOLIAN static int -_elm_layout_freeze(Eo *obj, Elm_Layout_Smart_Data *_pd EINA_UNUSED) +_elm_layout_efl_canvas_layout_calc_calc_freeze(Eo *obj, Elm_Layout_Smart_Data *sd) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 1); - ELM_LAYOUT_DATA_GET(obj, sd); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 0); if ((sd->frozen)++ != 0) return sd->frozen; @@ -1716,10 +1715,9 @@ _elm_layout_freeze(Eo *obj, Elm_Layout_Smart_Data *_pd EINA_UNUSED) } EOLIAN static int -_elm_layout_thaw(Eo *obj, Elm_Layout_Smart_Data *_pd EINA_UNUSED) +_elm_layout_efl_canvas_layout_calc_calc_thaw(Eo *obj, Elm_Layout_Smart_Data *sd) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 0); - ELM_LAYOUT_DATA_GET(obj, sd); if (--(sd->frozen) != 0) return sd->frozen; @@ -2390,6 +2388,18 @@ elm_layout_part_cursor_unset(Elm_Layout *obj, const char *part) return efl_ui_cursor_set(efl_part(obj, part), NULL); } +EAPI int +elm_layout_freeze(Evas_Object *obj) +{ + return efl_canvas_layout_calc_freeze(obj); +} + +EAPI int +elm_layout_thaw(Evas_Object *obj) +{ + return efl_canvas_layout_calc_thaw(obj); +} + /* End of legacy only */ diff --git a/src/lib/elementary/elm_layout.eo b/src/lib/elementary/elm_layout.eo index 66e8699f57..8d82f96a1a 100644 --- a/src/lib/elementary/elm_layout.eo +++ b/src/lib/elementary/elm_layout.eo @@ -18,7 +18,8 @@ struct Elm.Layout_Part_Alias_Description } class Elm.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File, - Efl.Ui.View, Efl.Ui.Model.Connect, Efl.Ui.Model.Factory.Connect) + Efl.Ui.View, Efl.Ui.Model.Connect, Efl.Ui.Model.Factory.Connect, + Efl.Canvas.Layout_Calc) { [[Elementary layout class]] legacy_prefix: elm_layout; @@ -61,16 +62,6 @@ class Elm.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File, settings loaded \@ref elm_layout_file_set.]] } } - freeze { - [[Freezes the Elementary layout object. - - This function puts all changes on hold. Successive freezes will - nest, requiring an equal number of thaws. - - See also @.thaw. - ]] - return: int; [[The frozen state or 0 on error.]] - } theme_enable { [[Enable theme]] legacy: null; @@ -178,19 +169,6 @@ class Elm.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File, when the signal was emitted.]] } } - thaw { - [[Thaws the Elementary object. - - This function thaws the given Edje object and the Elementary - sizing calc. - - Note: If sucessives freezes were done, an equal number of - thaws will be required. - - See also @.freeze. - ]] - return: int; [[The frozen state or 0 if the object is not frozen or on error.]] - } signal_emit { [[Send a (Edje) signal to a given layout widget's underlying Edje object. @@ -212,6 +190,8 @@ class Elm.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File, Efl.File.file { get; set; } Efl.File.mmap { get; set; } Efl.Canvas.Group.group_calculate; + Efl.Canvas.Layout_Calc.calc_freeze; + Efl.Canvas.Layout_Calc.calc_thaw; Elm.Widget.focus_direction; Elm.Widget.sub_object_add; Elm.Widget.theme_apply; diff --git a/src/lib/elementary/elm_layout_legacy.h b/src/lib/elementary/elm_layout_legacy.h index d619dd54de..0769014eaf 100644 --- a/src/lib/elementary/elm_layout_legacy.h +++ b/src/lib/elementary/elm_layout_legacy.h @@ -128,6 +128,32 @@ EAPI Eina_Bool elm_layout_mmap_set(Eo *obj, const Eina_File *file, const char *g EAPI void elm_layout_mmap_get(Eo *obj, const Eina_File **file, const char **group); /** + * @brief Freezes the Elementary layout object. + * + * This function puts all changes on hold. Successive freezes will nest, + * requiring an equal number of thaws. + * + * See also @ref elm_layout_thaw. + * + * @return The frozen state or 0 on error. + */ +EAPI int elm_layout_freeze(Evas_Object *obj); + +/** + * @brief Thaws the Elementary object. + * + * This function thaws the given Edje object and the Elementary sizing calc. + * + * @note If sucessives freezes were done, an equal number of thaws will be + * required. + * + * See also @ref elm_layout_freeze. + * + * @return The frozen state or 0 if the object is not frozen or on error. + */ +EAPI int elm_layout_thaw(Evas_Object *obj); + +/** * @brief Append child to layout box part. * * Once the object is appended, it will become child of the layout. Its --