edje_embryo: add function to know swallow has object

Summary:
Using edc script, there is no way to know evas object is set on swallow part or not.
So, to know that, some elm widget send signal and save some information to edc variables when object is set on swallow part.
I think it is helpful to make better edc script.

@feature

Reviewers: herb, cedric, raster, id213sin, jpeg

Reviewed By: jpeg

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4176
This commit is contained in:
Jinyong Park 2016-08-01 14:56:00 +09:00 committed by Jean-Philippe Andre
parent 88a684e800
commit 471a328ea0
2 changed files with 27 additions and 0 deletions

View File

@ -329,3 +329,4 @@ enum Anim_Param
native set_tween_state_anim (part_id, state1[], Float:state1_val, state2[], Float:state2_val, Anim_Param:p, Float:tween, ...);
native set_state_anim (part_id, state[], Float:state1_val, Anim_Param:p, Float:tween, ...);
native swallow_has_content (part_id);

View File

@ -4391,6 +4391,30 @@ _edje_embryo_fn_physics_get_rotation(Embryo_Program *ep, Embryo_Cell *params)
#endif
/* swallow_has_content(part_id) */
static Embryo_Cell
_edje_embryo_fn_swallow_has_content(Embryo_Program *ep, Embryo_Cell *params)
{
Edje *ed;
int part_id = 0;
Edje_Real_Part *rp;
CHKPARAM(1);
ed = embryo_program_data_get(ep);
part_id = params[1];
if (part_id < 0) return 0;
rp = ed->table_parts[part_id % ed->table_parts_size];
if ((!rp) ||
(!rp->part) ||
(rp->part->type != EDJE_PART_TYPE_SWALLOW) ||
(!rp->typedata.swallow) ||
(!rp->typedata.swallow->swallowed_object))
return 0;
return 1;
}
void
_edje_embryo_script_init(Edje_Part_Collection *edc)
{
@ -4516,6 +4540,8 @@ _edje_embryo_script_init(Edje_Part_Collection *edc)
embryo_program_native_call_add(ep, "physics_set_rotation", _edje_embryo_fn_physics_set_rotation);
embryo_program_native_call_add(ep, "physics_get_rotation", _edje_embryo_fn_physics_get_rotation);
#endif
embryo_program_native_call_add(ep, "swallow_has_content", _edje_embryo_fn_swallow_has_content);
}
void