From 4c8f87974c675497cce9e461cd064bac1d9f08c0 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Thu, 3 Aug 2017 18:22:29 +0900 Subject: [PATCH] layout: Implement data_get from edje This also implements size_min and size_max get. Ref T5315 --- src/lib/elementary/elm_layout.c | 28 +++++++++++++++++++++++++--- src/lib/elementary/elm_layout.eo | 20 +++++--------------- src/lib/elementary/elm_layout_legacy.h | 15 +++++++++++++++ 3 files changed, 45 insertions(+), 18 deletions(-) diff --git a/src/lib/elementary/elm_layout.c b/src/lib/elementary/elm_layout.c index 500dabd..0a78126 100644 --- a/src/lib/elementary/elm_layout.c +++ b/src/lib/elementary/elm_layout.c @@ -1616,12 +1616,28 @@ elm_layout_edje_get(const Eo *obj) return wd->resize_obj; } -EOLIAN static const char* -_elm_layout_data_get(const Eo *obj, Elm_Layout_Smart_Data *_pd EINA_UNUSED, const char *key) +EOLIAN static const char * +_elm_layout_efl_canvas_layout_group_group_data_get(Eo *obj, Elm_Layout_Smart_Data *_pd EINA_UNUSED, const char *key) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); - return edje_object_data_get(wd->resize_obj, key); + return efl_canvas_layout_group_data_get(wd->resize_obj, key); +} + +EOLIAN static void +_elm_layout_efl_canvas_layout_group_group_size_min_get(Eo *obj, Elm_Layout_Smart_Data *_pd EINA_UNUSED, int *w, int *h) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + + efl_canvas_layout_group_size_min_get(wd->resize_obj, w, h); +} + +EOLIAN static void +_elm_layout_efl_canvas_layout_group_group_size_max_get(Eo *obj, Elm_Layout_Smart_Data *_pd EINA_UNUSED, int *w, int *h) +{ + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + + efl_canvas_layout_group_size_max_get(wd->resize_obj, w, h); } /* layout's sizing evaluation is deferred. evaluation requests are @@ -2444,6 +2460,12 @@ elm_layout_signal_emit(Elm_Layout *obj, const char *emission, const char *source efl_canvas_layout_signal_emit(obj, emission, source); } +EAPI const char * +elm_layout_data_get(const Evas_Object *obj, const char *key) +{ + return efl_canvas_layout_group_data_get(obj, key); +} + /* End of legacy only */ diff --git a/src/lib/elementary/elm_layout.eo b/src/lib/elementary/elm_layout.eo index 99920ee..d2b5e3a 100644 --- a/src/lib/elementary/elm_layout.eo +++ b/src/lib/elementary/elm_layout.eo @@ -2,7 +2,8 @@ import edje_types; class Elm.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File, Efl.Ui.View, Efl.Ui.Model.Connect, Efl.Ui.Model.Factory.Connect, - Efl.Canvas.Layout_Calc, Efl.Canvas.Layout_Signal) + Efl.Canvas.Layout_Calc, Efl.Canvas.Layout_Signal, + Efl.Canvas.Layout_Group) { [[Elementary layout class]] legacy_prefix: elm_layout; @@ -70,20 +71,6 @@ class Elm.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File, @in height: bool; [[Restrict minimum size ot the current height.]] } } - data_get @const { - [[Get the edje data from the given layout. - - This function fetches data specified inside the edje theme of - this layout. This function return NULL if data is not found. - - In EDC this comes from a data block within the group block that - $obj was loaded from. - ]] - return: string; [[The edje data string.]] - params { - @in key: string; [[The data key.]] - } - } } implements { class.constructor; @@ -98,6 +85,9 @@ class Elm.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File, Efl.Canvas.Layout_Signal.signal_emit; //Efl.Canvas.Layout_Signal.message_send; //Efl.Canvas.Layout_Signal.signal_process; + Efl.Canvas.Layout_Group.group_data { get; } + Efl.Canvas.Layout_Group.group_size_min { get; } + Efl.Canvas.Layout_Group.group_size_max { get; } 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 e26a6be..5f0df2b 100644 --- a/src/lib/elementary/elm_layout_legacy.h +++ b/src/lib/elementary/elm_layout_legacy.h @@ -41,6 +41,21 @@ typedef struct _Elm_Layout_Part_Alias_Description Elm_Layout_Part_Alias_Descript EAPI Evas_Object *elm_layout_add(Evas_Object *parent); /** + * @brief Get the edje data from the given layout. + * + * This function fetches data specified inside the edje theme of this layout. + * This function return NULL if data is not found. + * + * In EDC this comes from a data block within the group block that @c obj was + * loaded from. + * + * @param[in] key The data key. + * + * @return The edje data string. + */ +EAPI const char *elm_layout_data_get(const Evas_Object *obj, const char *key); + +/** * @brief Add a callback for a (Edje) signal emitted by a layout widget's * underlying Edje object. * -- 2.7.4