Efl.Pack: Add content_at_remove

This will match Edje Box remove_at
This commit is contained in:
Jean-Philippe Andre 2016-04-22 11:17:03 +09:00
parent 24177057d0
commit 32b622f08d
3 changed files with 26 additions and 0 deletions

View File

@ -62,6 +62,16 @@ interface Efl.Pack_Linear (Efl.Pack)
subobj: Efl.Gfx.Base *;
}
}
content_at_remove {
[[Pop out item at specified $index.
Equivalent to unpack(content_at($index)).
]]
params {
index: int;
}
return: Efl.Gfx.Base*; [[The child item if it could be removed.]]
}
@property content_index {
[[Index of the child in this container, may be modified to move the $subobj.]]
set {

View File

@ -448,6 +448,21 @@ _efl_ui_box_efl_pack_linear_content_at_get(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNU
return _box_item(eina_list_nth(bd->children, index));
}
EOLIAN static Efl_Gfx_Base *
_efl_ui_box_efl_pack_linear_content_at_remove(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED,
int index)
{
Efl_Gfx_Base *content;
content = efl_pack_content_at_get(obj, index);
if (!content) return NULL;
if (!efl_pack_unpack(obj, content))
return NULL;
return content;
}
EOLIAN static int
_efl_ui_box_efl_pack_linear_content_index_get(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED,
Efl_Gfx_Base *subobj)

View File

@ -32,6 +32,7 @@ class Efl.Ui.Box (Elm.Widget, Efl.Pack_Linear, Efl.Pack_Layout)
Efl.Pack_Linear.pack_after;
Efl.Pack_Linear.pack_insert;
Efl.Pack_Linear.content_at.get;
Efl.Pack_Linear.content_at_remove;
Efl.Pack_Linear.content_index.get;
Efl.Pack_Linear.content_index.set;
Efl.Pack_Linear.direction.set;