From: Enlightenment S. <no-...@en...> - 2012-06-23 18:39:15
|
Log: edje: improve use of aliases Author: yoz Date: 2012-06-23 11:39:08 -0700 (Sat, 23 Jun 2012) New Revision: 72732 Trac: http://trac.enlightenment.org/e/changeset/72732 Modified: trunk/edje/AUTHORS trunk/edje/ChangeLog trunk/edje/src/bin/edje_cc_handlers.c trunk/edje/src/bin/edje_cc_out.c Modified: trunk/edje/AUTHORS =================================================================== --- trunk/edje/AUTHORS 2012-06-23 18:38:08 UTC (rev 72731) +++ trunk/edje/AUTHORS 2012-06-23 18:39:08 UTC (rev 72732) @@ -26,3 +26,4 @@ Rajeev Ranjan (Rajeev) <raj...@sa...> <raj...@gm...> ChunEon Park (Hermet) <he...@he...> Kim Shinwoo <kim...@gm...> +Michael Bouchaud (yoz) <mic...@gm...> Modified: trunk/edje/ChangeLog =================================================================== --- trunk/edje/ChangeLog 2012-06-23 18:38:08 UTC (rev 72731) +++ trunk/edje/ChangeLog 2012-06-23 18:39:08 UTC (rev 72732) @@ -496,3 +496,8 @@ embryo_cc. this still like before requires embryo and edje to share the same install prefix for edje_cc to work. +2012-06-12 Michael Bouchaud (yoz) + + * The aliases are now inherited from the targeted group + * Aliases can be usable with edje programs, if the part is in the + group Modified: trunk/edje/src/bin/edje_cc_handlers.c =================================================================== --- trunk/edje/src/bin/edje_cc_handlers.c 2012-06-23 18:38:08 UTC (rev 72731) +++ trunk/edje/src/bin/edje_cc_handlers.c 2012-06-23 18:39:08 UTC (rev 72732) @@ -2291,24 +2291,49 @@ if (pc2->data) { - char *key; + char *key, *data; memset(&fdata, 0, sizeof(Edje_List_Foreach_Data)); eina_hash_foreach(pc2->data, _edje_data_item_list_foreach, &fdata); - if (!pc->data) - pc->data = eina_hash_string_small_new(free); + if (!pc->data) pc->data = eina_hash_string_small_new(free); + EINA_LIST_FREE(fdata.list, key) + { + data = eina_hash_find(pc2->data, key); + eina_hash_direct_add(pc->data, key, data); + } + } + if (pc2->alias) + { + char *key, *alias; + memset(&fdata, 0, sizeof(Edje_List_Foreach_Data)); + eina_hash_foreach(pc2->alias, + _edje_data_item_list_foreach, &fdata); + if (!pc->alias) pc->alias = eina_hash_string_small_new(free); EINA_LIST_FREE(fdata.list, key) { - es = mem_alloc(SZ(Edje_String)); - es = (Edje_String *)eina_hash_find(pc2->data, key); - eina_hash_direct_add(pc->data, key, es); + alias = eina_hash_find(pc2->alias, key); + eina_hash_direct_add(pc->alias, key, alias); } } + if (pc2->aliased) + { + char *key, *aliased; + memset(&fdata, 0, sizeof(Edje_List_Foreach_Data)); + eina_hash_foreach(pc2->aliased, + _edje_data_item_list_foreach, &fdata); + if (!pc->aliased) pc->aliased = eina_hash_string_small_new(free); + EINA_LIST_FREE(fdata.list, key) + { + aliased = eina_hash_find(pc2->aliased, key); + eina_hash_direct_add(pc->aliased, key, aliased); + } + } + pc->prop.min.w = pc2->prop.min.w; pc->prop.min.h = pc2->prop.min.h; pc->prop.orientation = pc2->prop.orientation; Modified: trunk/edje/src/bin/edje_cc_out.c =================================================================== --- trunk/edje/src/bin/edje_cc_out.c 2012-06-23 18:38:08 UTC (rev 72731) +++ trunk/edje/src/bin/edje_cc_out.c 2012-06-23 18:39:08 UTC (rev 72732) @@ -2144,11 +2144,15 @@ } else { + char *aliased; + aliased = eina_hash_find(part->pc->aliased, part->name); + if (!aliased) + aliased = part->name; for (i = 0; i < part->pc->parts_count; ++i) { ep = part->pc->parts[i]; - if ((ep->name) && (!strcmp(ep->name, part->name))) + if ((ep->name) && (!strcmp(ep->name, aliased))) { handle_slave_lookup(part_slave_lookups, part->dest, ep->id); *(part->dest) = ep->id; |