edje: add edje_object_box_part_insert_after()

Summary:
In evas and elm box, function for inserting child object after
referenced one is available, but edje doesn't have it.
This adds edje_object_box_part_insert_after() API.

@feature

Reviewers: raster, jpeg, cedric

Reviewed By: jpeg

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3733

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Jee-Yong Um 2016-03-28 11:24:02 -07:00 committed by Cedric BAIL
parent 2ae6307c72
commit aa92044422
3 changed files with 73 additions and 5 deletions

View File

@ -1030,7 +1030,8 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File)
Adds child to the box indicated by part, in the position given by
pos.
See also @.part_box_append(), @.part_box_prepend() and @.part_box_insert_before()]]
See also @.part_box_append(), @.part_box_prepend(),
@.part_box_insert_before() and @.part_box_insert_after()]]
return: bool; [[$true: Successfully added.
$false: An error occurred.]]
@ -1097,7 +1098,8 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File)
Prepends child to the box indicated by part.
See also @.part_box_append(), @.part_box_insert_before() and @.part_box_insert_at()]]
See also @.part_box_append(), @.part_box_insert_before(),
@.part_box_insert_after and @.part_box_insert_at()]]
return: bool; [[$true: Successfully added.
$false: An error occurred.]]
@ -1594,7 +1596,25 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File)
Inserts child in the box given by part, in the position marked by
reference.
See also @.part_box_append(), @.part_box_prepend() and @.part_box_insert_at()]]
See also @.part_box_append(), @.part_box_prepend(),
@.part_box_insert_after() and @.part_box_insert_at()]]
return: bool; [[$true: Successfully added.
$false: An error occurred.]]
params {
@in part: const(char)*; [[The part name]]
@in child: Evas.Object *; [[The object to insert]]
@in reference: const(Evas.Object)*; [[The object to be used as reference]]
}
}
part_box_insert_after {
[[Adds an object to the box.
Inserts child in the box given by part, in the position marked by
reference.
See also @.part_box_append(), @.part_box_prepend(),
@.part_box_insert_before() and @.part_box_insert_at()]]
return: bool; [[$true: Successfully added.
$false: An error occurred.]]
@ -1680,8 +1700,8 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File)
Appends child to the box indicated by part.
See also @.part_box_prepend(), @.part_box_insert_before()
and @.part_box_insert_at()]]
See also @.part_box_prepend(), @.part_box_insert_before(),
@.part_box_insert_after() and @.part_box_insert_at()]]
return: bool; [[$true: Successfully added.
$false: An error occurred.]]

View File

@ -2428,6 +2428,7 @@ Edje_Part_Description_Text *_edje_real_part_text_text_source_description_get(Edj
Eina_Bool _edje_real_part_box_append(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj);
Eina_Bool _edje_real_part_box_prepend(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj);
Eina_Bool _edje_real_part_box_insert_before(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj, const Evas_Object *ref);
Eina_Bool _edje_real_part_box_insert_after(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj, const Evas_Object *ref);
Eina_Bool _edje_real_part_box_insert_at(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj, unsigned int pos);
Evas_Object *_edje_real_part_box_remove(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj);
Evas_Object *_edje_real_part_box_remove_at(Edje *ed, Edje_Real_Part *rp, unsigned int pos);

View File

@ -4757,6 +4757,34 @@ _edje_object_part_box_insert_before(Eo *obj EINA_UNUSED, Edje *ed, const char *p
return ret;
}
EOLIAN Eina_Bool
_edje_object_part_box_insert_after(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Evas_Object *child, const Evas_Object *reference)
{
Eina_Bool ret;
Edje_Real_Part *rp;
ret = EINA_FALSE;
if ((!ed) || (!part)) return ret;
rp = _edje_real_part_recursive_get(&ed, part);
if (!rp) return ret;
if (rp->part->type != EDJE_PART_TYPE_BOX) return ret;
if (_edje_real_part_box_insert_after(ed, rp, child, reference))
{
Edje_User_Defined *eud;
eud = _edje_user_definition_new(EDJE_USER_BOX_PACK, part, ed);
if (!eud) return ret;
eud->u.box.child = child;
evas_object_event_callback_add(child, EVAS_CALLBACK_DEL, _edje_user_def_del_cb, eud);
ret = EINA_TRUE;
}
return ret;
}
EOLIAN Eina_Bool
_edje_object_part_box_insert_at(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Evas_Object *child, unsigned int pos)
{
@ -5016,6 +5044,25 @@ _edje_real_part_box_insert_before(Edje *ed, Edje_Real_Part *rp, Evas_Object *chi
return EINA_TRUE;
}
Eina_Bool
_edje_real_part_box_insert_after(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj, const Evas_Object *ref)
{
Evas_Object_Box_Option *opt;
opt = evas_object_box_insert_after(rp->object, child_obj, ref);
if (!opt) return EINA_FALSE;
if (!_edje_box_layout_add_child(rp, child_obj))
{
evas_object_box_remove(rp->object, child_obj);
return EINA_FALSE;
}
_edje_child_add(ed, rp, child_obj);
return EINA_TRUE;
}
Eina_Bool
_edje_real_part_box_insert_at(Edje *ed, Edje_Real_Part *rp, Evas_Object *child_obj, unsigned int pos)
{