I changed the patch to reflect Gustavo's comments.I left the part table lookup to keep the compile time check (besides most embryo wrapper functions do something similar). Would it be ok to add a GROUP:"name" construct to edc?
-- Santiago Aguiar Edantech
? edje_part_swallow.patch Index: data/include/edje.inc =================================================================== RCS file: /var/cvs/e/e17/libs/edje/data/include/edje.inc,v retrieving revision 1.23 diff -n -u -r1.23 edje.inc --- data/include/edje.inc 11 Aug 2007 13:20:33 -0000 1.23 +++ data/include/edje.inc 26 Mar 2008 13:06:43 -0000 @@ -108,6 +108,7 @@ native stop_programs_on (part_id); native set_min_size (Float:w, Float:h); native set_max_size (Float:w, Float:h); +native part_swallow (part_id, str[]); enum Msg_Type { Index: src/lib/edje_embryo.c =================================================================== RCS file: /var/cvs/e/e17/libs/edje/src/lib/edje_embryo.c,v retrieving revision 1.59 diff -n -u -r1.59 edje_embryo.c --- src/lib/edje_embryo.c 6 Mar 2008 17:52:58 -0000 1.59 +++ src/lib/edje_embryo.c 26 Mar 2008 13:06:47 -0000 @@ -174,6 +174,7 @@ * set_clip(part_id, clip_part_id) * get_clip(part_id) * + * part_swallow(part_id, group_name) * * ADD/DEL CUSTOM OBJECTS UNDER SOLE EMBRYO SCRIPT CONTROL * @@ -2129,6 +2130,42 @@ return 0; } +/* part_swallow(part_id, group_name) */ +static Embryo_Cell +_edje_embryo_fn_part_swallow(Embryo_Program *ep, Embryo_Cell *params) +{ + int part_id = 0; + char* group_name = 0; + Edje *ed; + Edje_Real_Part *rp; + Evas_Object *new_obj; + + CHKPARAM(2); + + part_id = params[1]; + if (part_id < 0) return 0; + + GETSTR(group_name, params[2]); + if (!group_name) return 0; + + ed = embryo_program_data_get(ep); + + rp = ed->table_parts[part_id % ed->table_parts_size]; + if (!rp) return 0; + + new_obj = edje_object_add(ed->evas); + if (!new_obj) return 0; + + if (!edje_object_file_set(new_obj, ed->file->path, group_name)) + { + evas_object_del(new_obj); + return 0; + } + edje_object_part_swallow(ed->obj, rp->part->name, new_obj); + + return 0; +} + void _edje_embryo_script_init(Edje *ed) { @@ -2203,6 +2240,8 @@ embryo_program_native_call_add(ep, "set_state_val", _edje_embryo_fn_set_state_val); embryo_program_native_call_add(ep, "get_state_val", _edje_embryo_fn_get_state_val); + embryo_program_native_call_add(ep, "part_swallow", _edje_embryo_fn_part_swallow); + // embryo_program_vm_push(ed->collection->script); // _edje_embryo_globals_init(ed); }
------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel