From 94ccc126542da683a293af9eedbc0cb15d74ff08 Mon Sep 17 00:00:00 2001 From: yoz Date: Sat, 23 Jun 2012 18:39:08 +0000 Subject: [PATCH] edje: improve use of aliases git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@72732 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- AUTHORS | 1 + ChangeLog | 5 +++++ src/bin/edje_cc_handlers.c | 37 +++++++++++++++++++++++++++++++------ src/bin/edje_cc_out.c | 6 +++++- 4 files changed, 42 insertions(+), 7 deletions(-) diff --git a/AUTHORS b/AUTHORS index 28d737a..5dc5a9f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -26,3 +26,4 @@ Jérôme Pinot Rajeev Ranjan (Rajeev) ChunEon Park (Hermet) Kim Shinwoo +Michael Bouchaud (yoz) diff --git a/ChangeLog b/ChangeLog index 340fb59..3e1d73e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/src/bin/edje_cc_handlers.c b/src/bin/edje_cc_handlers.c index a4edcbb..cd0f564 100644 --- a/src/bin/edje_cc_handlers.c +++ b/src/bin/edje_cc_handlers.c @@ -2291,21 +2291,46 @@ st_collections_group_inherit(void) 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) + { + 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) { - es = mem_alloc(SZ(Edje_String)); - es = (Edje_String *)eina_hash_find(pc2->data, key); - eina_hash_direct_add(pc->data, key, es); + aliased = eina_hash_find(pc2->aliased, key); + eina_hash_direct_add(pc->aliased, key, aliased); } } diff --git a/src/bin/edje_cc_out.c b/src/bin/edje_cc_out.c index fa29725..f9533b5 100644 --- a/src/bin/edje_cc_out.c +++ b/src/bin/edje_cc_out.c @@ -2144,11 +2144,15 @@ data_process_lookups(void) } 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; -- 2.7.4