edje: allow inheritance from an aliased group.

This commit is contained in:
Cedric BAIL 2016-07-21 11:17:30 -07:00
parent 80f91290c0
commit f7af802f4f
1 changed files with 22 additions and 4 deletions

View File

@ -4572,7 +4572,8 @@ st_collections_group_target_group(void)
static void static void
st_collections_group_inherit(void) st_collections_group_inherit(void)
{ {
Edje_Part_Collection *pc, *pc2; Edje_Part_Collection_Directory_Entry *alias;
Edje_Part_Collection *pc, *pc2 = NULL;
Edje_Part_Collection_Parser *pcp, *pcp2; Edje_Part_Collection_Parser *pcp, *pcp2;
Edje_Part *ep, *ep2; Edje_Part *ep, *ep2;
Edje_List_Foreach_Data fdata; Edje_List_Foreach_Data fdata;
@ -4586,17 +4587,34 @@ st_collections_group_inherit(void)
parent_name = parse_str(0); parent_name = parse_str(0);
EINA_LIST_FOREACH(edje_collections, l, pc2) EINA_LIST_FOREACH(aliases, l, alias)
{ {
if (!strcmp(parent_name, pc2->part)) if (alias->group_alias &&
break; !strcmp(alias->entry, parent_name))
{
free(parent_name);
pc2 = eina_list_nth(edje_collections, alias->id);
parent_name = strdup(pc2->part);
break;
}
} }
if (!pc2)
{
EINA_LIST_FOREACH(edje_collections, l, pc2)
{
if (!strcmp(parent_name, pc2->part))
break;
}
}
if (!pc2) if (!pc2)
{ {
ERR("parse error %s:%i. There isn't a group with the name %s", ERR("parse error %s:%i. There isn't a group with the name %s",
file_in, line - 1, parent_name); file_in, line - 1, parent_name);
exit(-1); exit(-1);
} }
if (pc2 == pc) if (pc2 == pc)
{ {
ERR("parse error %s:%i. You are trying to inherit '%s' from itself. That's not possible." ERR("parse error %s:%i. You are trying to inherit '%s' from itself. That's not possible."