Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/lib


Modified Files:
        edje_cache.c edje_load.c edje_smart.c 


Log Message:


1. fixed some inefficient edje loading - moved checks to the cache code where
it sould be
2. fixed edje handling of delete of objects so we don't lose clip info if we
move a swallowed object out
3. fix up norender stuff for evas a bit
4. pants.

5. coogee beach (sydney) in summer right now is beatiful - KICK ASS!

===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_cache.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- edje_cache.c        3 Jul 2006 06:15:05 -0000       1.8
+++ edje_cache.c        22 Jan 2007 12:44:57 -0000      1.9
@@ -124,7 +124,7 @@
 _edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, 
Edje_Part_Collection **edc_ret)
 {
    Edje_File *edf;
-   Evas_List *l;
+   Evas_List *l, *hist;
    Edje_Part_Collection *edc;
 
    edf = evas_hash_find(_edje_file_hash, file);
@@ -183,6 +183,72 @@
        if (!edc)
          {
             *error_ret = EDJE_LOAD_ERROR_UNKNOWN_COLLECTION;
+         }
+       else
+         {
+            for (l = edc->parts; l; l = l->next)
+              {
+                 Edje_Part *ep, *ep2;
+                 
+                 /* Register any color classes in this parts descriptions. */
+                 ep = l->data;
+                 hist = NULL;
+                 hist = evas_list_append(hist, ep);
+                 ep2 = ep;
+                 while (ep2->dragable.confine_id >= 0)
+                   {
+                      ep2 = evas_list_nth(edc->parts, 
ep2->dragable.confine_id);
+                      if (evas_list_find(hist, ep2))
+                        {
+                           printf("EDJE ERROR: confine_to loops. invalidating 
loop.\n");
+                           ep2->dragable.confine_id = -1;
+                           break;
+                        }
+                      hist = evas_list_append(hist, ep2);
+                   }
+                 evas_list_free(hist);
+                 hist = NULL;
+                 hist = evas_list_append(hist, ep);
+                 ep2 = ep;
+                 while (ep2->dragable.events_id >= 0)
+                   {
+                      Edje_Part* prev;
+                      
+                      prev = ep2;
+                      
+                      ep2 = evas_list_nth(edc->parts, ep2->dragable.events_id);
+                      if (!ep2->dragable.x && !ep2->dragable.y)
+                        {
+                           prev->dragable.events_id = -1;
+                           break;
+                        }
+                      
+                      if (evas_list_find(hist, ep2))
+                        {
+                           printf("EDJE ERROR: events_to loops. invalidating 
loop.\n");
+                           ep2->dragable.events_id = -1;
+                           break;
+                        }
+                      hist = evas_list_append(hist, ep2);
+                   }
+                 evas_list_free(hist);
+                 hist = NULL;
+                 hist = evas_list_append(hist, ep);
+                 ep2 = ep;
+                 while (ep2->clip_to_id >= 0)
+                   {
+                      ep2 = evas_list_nth(edc->parts, ep2->clip_to_id);
+                      if (evas_list_find(hist, ep2))
+                        {
+                           printf("EDJE ERROR: clip_to loops. invalidating 
loop.\n");
+                           ep2->clip_to_id = -1;
+                           break;
+                        }
+                      hist = evas_list_append(hist, ep2);
+                   }
+                 evas_list_free(hist);
+                 hist = NULL;
+              }
          }
      }
    if (edc_ret) *edc_ret = edc;
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_load.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -3 -r1.94 -r1.95
--- edje_load.c 9 Oct 2006 15:00:45 -0000       1.94
+++ edje_load.c 22 Jan 2007 12:44:57 -0000      1.95
@@ -55,12 +55,12 @@
        Evas_List *l;
        int errors = 0;
 
-       /* check for invalid loops */
+       /* colorclass stuff */
        for (l = ed->collection->parts; (l && ! errors); l = l->next)
          {
             Edje_Part *ep;
             Evas_List *hist = NULL;
-
+            
             /* Register any color classes in this parts descriptions. */
             ep = l->data;
             if ((ep->default_desc) && (ep->default_desc->color_class)) 
@@ -72,63 +72,6 @@
                  desc = hist->data;
                  if (desc->color_class) _edje_color_class_member_add(ed, 
desc->color_class);
               }
-            hist = NULL;
-            hist = evas_list_append(hist, ep);
-            while (ep->dragable.confine_id >= 0)
-              {
-                 ep = evas_list_nth(ed->collection->parts,
-                                    ep->dragable.confine_id);
-                 if (evas_list_find(hist, ep))
-                   {
-                      printf("EDJE ERROR: confine_to loops. invalidating 
loop.\n");
-                      ep->dragable.confine_id = -1;
-                      break;
-                   }
-                 hist = evas_list_append(hist, ep);
-              }
-            evas_list_free(hist);
-            hist = NULL;
-            hist = evas_list_append(hist, ep);
-            while (ep->dragable.events_id >= 0)
-              {
-                 Edje_Part* prev;
-
-                 prev = ep;
-
-                 ep = evas_list_nth(ed->collection->parts,
-                                    ep->dragable.events_id);
-                 
-                 if (!ep->dragable.x && !ep->dragable.y)
-                   {
-                      prev->dragable.events_id = -1;
-                      break;
-                   }
-
-                 if (evas_list_find(hist, ep))
-                   {
-                      printf("EDJE ERROR: events_to loops. invalidating 
loop.\n");
-                      ep->dragable.events_id = -1;
-                      break;
-                   }
-                 hist = evas_list_append(hist, ep);
-              }
-            evas_list_free(hist);
-            hist = NULL;
-            hist = evas_list_append(hist, ep);
-            while (ep->clip_to_id >= 0)
-              {
-                 ep = evas_list_nth(ed->collection->parts,
-                                    ep->clip_to_id);
-                 if (evas_list_find(hist, ep))
-                   {
-                      printf("EDJE ERROR: clip_to loops. invalidating 
loop.\n");
-                      ep->clip_to_id = -1;
-                      break;
-                   }
-                 hist = evas_list_append(hist, ep);
-              }
-            evas_list_free(hist);
-            hist = NULL;
          }
        /* build real parts */
        for (n = 0, l = ed->collection->parts; l; l = l->next, n++)
@@ -222,6 +165,7 @@
          }
        if (n > 0)
          {
+            /* FIXME: keeping a table AND a list is just bad - nuke list */
             ed->table_parts = malloc(sizeof(Edje_Real_Part *) * n);
             ed->table_parts_size = n;
             /* FIXME: check malloc return */
@@ -285,6 +229,7 @@
        n = evas_list_count(ed->collection->programs);
        if (n > 0)
          {
+            /* FIXME: keeping a table AND a list is just bad - nuke list */
             ed->table_programs = malloc(sizeof(Edje_Program *) * n);
             ed->table_programs_size = n;
             /* FIXME: check malloc return */
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_smart.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- edje_smart.c        7 Jan 2006 08:54:30 -0000       1.27
+++ edje_smart.c        22 Jan 2007 12:44:57 -0000      1.28
@@ -56,6 +56,19 @@
    evas_object_smart_data_set(obj, ed);
    ed->obj = obj;
    _edje_edjes = evas_list_append(_edje_edjes, obj);
+/*   
+     {
+       Evas_List *l;
+       
+       printf("--- EDJE DUMP [%i]\n", evas_list_count(_edje_edjes));
+       for (l = _edje_edjes; l; l = l->next)
+         {
+            ed = _edje_fetch(l->data);
+            printf("EDJE: %80s | %80s\n", ed->path, ed->part);
+         }
+       printf("--- EDJE DUMP [%i]\n", evas_list_count(_edje_edjes));
+     }
+ */
 }
 
 static void
@@ -71,6 +84,7 @@
    _edje_edjes = evas_list_remove(_edje_edjes, obj);
    evas_object_smart_data_set(obj, NULL);
    _edje_unref(ed);
+   _edje_file_del(ed);
 }
 
 static void 



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to