jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=471a328ea0e5607f25391496b76aafedeb34a79f

commit 471a328ea0e5607f25391496b76aafedeb34a79f
Author: Jinyong Park <j4939.p...@samsung.com>
Date:   Mon Aug 1 14:56:00 2016 +0900

    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
---
 data/edje/include/edje.inc |  1 +
 src/lib/edje/edje_embryo.c | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/data/edje/include/edje.inc b/data/edje/include/edje.inc
index 4107344..7807383 100644
--- a/data/edje/include/edje.inc
+++ b/data/edje/include/edje.inc
@@ -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);
diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c
index 1b899d7..d019f76 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)
 
 #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

-- 


Reply via email to