aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-08-03 18:22:29 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-08-04 11:52:17 +0900
commit4c8f87974c675497cce9e461cd064bac1d9f08c0 (patch)
tree2a257a13c7ca381042d155c5fa64c54a0ca38918
parentedje: Move size_min/max and data to an interface (diff)
downloadefl-4c8f87974c675497cce9e461cd064bac1d9f08c0.tar.gz
layout: Implement data_get from edje
This also implements size_min and size_max get. Ref https://phab.enlightenment.org/T5315
-rw-r--r--src/lib/elementary/elm_layout.c28
-rw-r--r--src/lib/elementary/elm_layout.eo20
-rw-r--r--src/lib/elementary/elm_layout_legacy.h15
3 files changed, 45 insertions, 18 deletions
diff --git a/src/lib/elementary/elm_layout.c b/src/lib/elementary/elm_layout.c
index 500dabd8ad..0a78126c4c 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 99920ee7be..d2b5e3ab6e 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 e26a6be06b..5f0df2bc48 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.
*