layout: Implement data_get from edje

This also implements size_min and size_max get.

Ref T5315
This commit is contained in:
Jean-Philippe Andre 2017-08-03 18:22:29 +09:00
parent 240cc9e501
commit 4c8f87974c
3 changed files with 45 additions and 18 deletions

View File

@ -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 */

View File

@ -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;

View File

@ -40,6 +40,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.