edje: allow inheritance from an aliased group. 74/87274/4
authorCedric BAIL <cedric@osg.samsung.com>
Thu, 21 Jul 2016 18:17:30 +0000 (11:17 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 8 Sep 2016 00:15:59 +0000 (17:15 -0700)
Change-Id: I004227be5443dbf2e6e79bc9410b76be5d725c57

src/bin/edje/edje_cc_handlers.c

index 3756cb6..eb49c45 100644 (file)
@@ -3893,7 +3893,8 @@ st_collections_group_target_group(void)
 static 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 *ep, *ep2;
    Edje_List_Foreach_Data fdata;
@@ -3907,17 +3908,34 @@ st_collections_group_inherit(void)
 
    parent_name = parse_str(0);
 
-   EINA_LIST_FOREACH(edje_collections, l, pc2)
+   EINA_LIST_FOREACH(aliases, l, alias)
      {
-        if (!strcmp(parent_name, pc2->part))
-          break;
+        if (alias->group_alias &&
+            !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)
      {
         ERR("parse error %s:%i. There isn't a group with the name %s",
             file_in, line - 1, parent_name);
         exit(-1);
      }
+
    if (pc2 == pc)
      {
         ERR("parse error %s:%i. You are trying to inherit '%s' from itself. That's not possible."