diff options
Diffstat (limited to 'src/lib/edje/edje_embryo.c')
-rw-r--r-- | src/lib/edje/edje_embryo.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c index 1b899d71e9..d019f762f5 100644 --- a/src/lib/edje/edje_embryo.c +++ b/src/lib/edje/edje_embryo.c | |||
@@ -4391,6 +4391,30 @@ _edje_embryo_fn_physics_get_rotation(Embryo_Program *ep, Embryo_Cell *params) | |||
4391 | 4391 | ||
4392 | #endif | 4392 | #endif |
4393 | 4393 | ||
4394 | /* swallow_has_content(part_id) */ | ||
4395 | static Embryo_Cell | ||
4396 | _edje_embryo_fn_swallow_has_content(Embryo_Program *ep, Embryo_Cell *params) | ||
4397 | { | ||
4398 | Edje *ed; | ||
4399 | int part_id = 0; | ||
4400 | Edje_Real_Part *rp; | ||
4401 | |||
4402 | CHKPARAM(1); | ||
4403 | ed = embryo_program_data_get(ep); | ||
4404 | part_id = params[1]; | ||
4405 | if (part_id < 0) return 0; | ||
4406 | rp = ed->table_parts[part_id % ed->table_parts_size]; | ||
4407 | |||
4408 | if ((!rp) || | ||
4409 | (!rp->part) || | ||
4410 | (rp->part->type != EDJE_PART_TYPE_SWALLOW) || | ||
4411 | (!rp->typedata.swallow) || | ||
4412 | (!rp->typedata.swallow->swallowed_object)) | ||
4413 | return 0; | ||
4414 | |||
4415 | return 1; | ||
4416 | } | ||
4417 | |||
4394 | void | 4418 | void |
4395 | _edje_embryo_script_init(Edje_Part_Collection *edc) | 4419 | _edje_embryo_script_init(Edje_Part_Collection *edc) |
4396 | { | 4420 | { |
@@ -4516,6 +4540,8 @@ _edje_embryo_script_init(Edje_Part_Collection *edc) | |||
4516 | embryo_program_native_call_add(ep, "physics_set_rotation", _edje_embryo_fn_physics_set_rotation); | 4540 | embryo_program_native_call_add(ep, "physics_set_rotation", _edje_embryo_fn_physics_set_rotation); |
4517 | embryo_program_native_call_add(ep, "physics_get_rotation", _edje_embryo_fn_physics_get_rotation); | 4541 | embryo_program_native_call_add(ep, "physics_get_rotation", _edje_embryo_fn_physics_get_rotation); |
4518 | #endif | 4542 | #endif |
4543 | |||
4544 | embryo_program_native_call_add(ep, "swallow_has_content", _edje_embryo_fn_swallow_has_content); | ||
4519 | } | 4545 | } |
4520 | 4546 | ||
4521 | void | 4547 | void |