edje: improve use of aliases
authoryoz <yoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 23 Jun 2012 18:39:08 +0000 (18:39 +0000)
committeryoz <yoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 23 Jun 2012 18:39:08 +0000 (18:39 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@72732 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

AUTHORS
ChangeLog
src/bin/edje_cc_handlers.c
src/bin/edje_cc_out.c

diff --git a/AUTHORS b/AUTHORS
index 28d737a..5dc5a9f 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -26,3 +26,4 @@ Jérôme Pinot <ngc891@gmail.com>
 Rajeev Ranjan (Rajeev) <rajeev.r@samsung.com> <rajeev.jnnce@gmail.com>
 ChunEon Park (Hermet) <hermet@hermet.pe.kr>
 Kim Shinwoo <kimcinoo.efl@gmail.com>
+Michael Bouchaud (yoz) <michael.bouchaud@gmail.com>
index 340fb59..3e1d73e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
         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
index a4edcbb..cd0f564 100644 (file)
@@ -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);
           }
      }
 
index fa29725..f9533b5 100644 (file)
@@ -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;