edje: improve use of aliases

SVN revision: 72732
This commit is contained in:
Michael BOUCHAUD 2012-06-23 18:39:08 +00:00
parent de03851203
commit 1f2939fef0
4 changed files with 44 additions and 9 deletions

View File

@ -26,3 +26,4 @@ Jérôme Pinot <ngc891@gmail.com>
Rajeev Ranjan (Rajeev) <rajeev.r@samsung.com> <rajeev.jnnce@gmail.com> Rajeev Ranjan (Rajeev) <rajeev.r@samsung.com> <rajeev.jnnce@gmail.com>
ChunEon Park (Hermet) <hermet@hermet.pe.kr> ChunEon Park (Hermet) <hermet@hermet.pe.kr>
Kim Shinwoo <kimcinoo.efl@gmail.com> Kim Shinwoo <kimcinoo.efl@gmail.com>
Michael Bouchaud (yoz) <michael.bouchaud@gmail.com>

View File

@ -496,3 +496,8 @@
embryo_cc. this still like before requires embryo and edje to share embryo_cc. this still like before requires embryo and edje to share
the same install prefix for edje_cc to work. 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

View File

@ -2291,21 +2291,46 @@ st_collections_group_inherit(void)
if (pc2->data) if (pc2->data)
{ {
char *key; char *key, *data;
memset(&fdata, 0, sizeof(Edje_List_Foreach_Data)); memset(&fdata, 0, sizeof(Edje_List_Foreach_Data));
eina_hash_foreach(pc2->data, eina_hash_foreach(pc2->data,
_edje_data_item_list_foreach, &fdata); _edje_data_item_list_foreach, &fdata);
if (!pc->data) if (!pc->data) pc->data = eina_hash_string_small_new(free);
pc->data = eina_hash_string_small_new(free);
EINA_LIST_FREE(fdata.list, key) EINA_LIST_FREE(fdata.list, key)
{ {
es = mem_alloc(SZ(Edje_String)); data = eina_hash_find(pc2->data, key);
es = (Edje_String *)eina_hash_find(pc2->data, key); eina_hash_direct_add(pc->data, key, data);
eina_hash_direct_add(pc->data, key, es); }
}
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)
{
aliased = eina_hash_find(pc2->aliased, key);
eina_hash_direct_add(pc->aliased, key, aliased);
} }
} }

View File

@ -2144,11 +2144,15 @@ data_process_lookups(void)
} }
else 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) for (i = 0; i < part->pc->parts_count; ++i)
{ {
ep = part->pc->parts[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); handle_slave_lookup(part_slave_lookups, part->dest, ep->id);
*(part->dest) = ep->id; *(part->dest) = ep->id;