Enlightenment CVS committal

Author  : urandom
Project : e17
Module  : proto

Dir     : e17/proto/edje_viewer/src/bin


Modified Files:
        edje_etk.c edje_etk.h etk_gui.c 


Log Message:
edje parts are created on demand. should load (7234.153e17 * inf) faster with 
those obnoxiously large theme files

===================================================================
RCS file: /cvs/e/e17/proto/edje_viewer/src/bin/edje_etk.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- edje_etk.c  17 Jan 2007 03:44:03 -0000      1.10
+++ edje_etk.c  20 Jan 2007 03:35:41 -0000      1.11
@@ -117,7 +117,7 @@
      }
 }
 
-void list_entries(const char *file, Etk_Tree *tree, Etk_Tree *output,
+void list_entries(const char *file, Etk_Tree *tree,
       Etk_Canvas *canvas)
 {
    Evas_List *entries;
@@ -139,17 +139,16 @@
          {
             char *name;
             Collection *co;
-            Demo_Edje *de;
 
             name = l->data;
             co = calloc(1, sizeof(Collection));
             collections = evas_list_append(collections, co);
             co->file = strdup(file);
             co->part = strdup(name);
+            co->de = NULL;
 
             row = etk_tree_row_append(tree, NULL, col1, name, NULL);
-            de = edje_part_create(output, canvas, file, name);
-            etk_tree_row_data_set(row, de);
+            etk_tree_row_data_set(row, co);
          }
        edje_file_collection_list_free(entries);
        edje_viewer_config_recent_set(file);
@@ -252,6 +251,15 @@
    edje_object_part_drag_page_set(o, "dragable", 0.2, 0.2);
    de->edje = o;
 
+/*   etk_canvas_object_add(canvas, de->image);*/
+/*   etk_canvas_object_add(canvas, de->top);*/
+/*   etk_canvas_object_add(canvas, de->bottom);*/
+/*   etk_canvas_object_add(canvas, de->left);*/
+/*   etk_canvas_object_add(canvas, de->right);*/
+/*   etk_canvas_object_add(canvas, de->title_clip);*/
+/*   etk_canvas_object_add(canvas, de->title);*/
+/*   etk_canvas_object_add(canvas, de->edje);*/
+
    return de;
 }
 
@@ -284,20 +292,11 @@
    evas_object_show(de->title);
    evas_object_show(de->edje);
 
-/*   etk_canvas_object_add(canvas, de->image);*/
-/*   etk_canvas_object_add(canvas, de->top);*/
-/*   etk_canvas_object_add(canvas, de->bottom);*/
-/*   etk_canvas_object_add(canvas, de->left);*/
-/*   etk_canvas_object_add(canvas, de->right);*/
-/*   etk_canvas_object_add(canvas, de->title_clip);*/
-/*   etk_canvas_object_add(canvas, de->title);*/
-/*   etk_canvas_object_add(canvas, de->edje);*/
-
    edje_part_resize(de);
    visible_elements = evas_list_append(visible_elements, de);
 }
 
-void edje_part_hide(Etk_Canvas *canvas, Demo_Edje *de)
+void edje_part_hide(Demo_Edje *de)
 {
    evas_object_hide(de->edje);
    evas_object_hide(de->left);
@@ -307,15 +306,6 @@
    evas_object_hide(de->image);
    evas_object_hide(de->title_clip);
    evas_object_hide(de->title);
-
-/*   etk_canvas_object_remove(canvas, de->image);*/
-/*   etk_canvas_object_remove(canvas, de->top);*/
-/*   etk_canvas_object_remove(canvas, de->bottom);*/
-/*   etk_canvas_object_remove(canvas, de->left);*/
-/*   etk_canvas_object_remove(canvas, de->right);*/
-/*   etk_canvas_object_remove(canvas, de->title_clip);*/
-/*   etk_canvas_object_remove(canvas, de->title);*/
-/*   etk_canvas_object_remove(canvas, de->edje);*/
 
    visible_elements = evas_list_remove(visible_elements, de);
 }
===================================================================
RCS file: /cvs/e/e17/proto/edje_viewer/src/bin/edje_etk.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- edje_etk.h  17 Jan 2007 03:44:03 -0000      1.7
+++ edje_etk.h  20 Jan 2007 03:35:41 -0000      1.8
@@ -1,18 +1,5 @@
-typedef struct _Collection Collection;
-
-struct _Collection
-{
-    char         header : 1;
-    char         clicked : 1;
-    Evas_Coord       maxw;
-    char        *file;
-    char        *part;
-    Evas_Object *text;
-    Evas_Object *bg;
-    Evas_List   *entries;
-};
-
 typedef struct _Demo_Edje Demo_Edje;
+typedef struct _Collection Collection;
 
 struct _Demo_Edje
 {
@@ -34,16 +21,29 @@
     char       *name;
 };
 
+struct _Collection
+{
+    char         header : 1;
+    char         clicked : 1;
+    Evas_Coord   maxw;
+    char        *file;
+    char        *part;
+    Evas_Object *text;
+    Evas_Object *bg;
+    Evas_List   *entries;
+
+    Demo_Edje   *de;
+};
+
 Evas_List *visible_elements_get(void);
 void bg_setup(Etk_Canvas *canvas);
 void canvas_resize_cb(Etk_Object *canvas, const char *property_name, 
        void *data);
-void list_entries(const char *file, Etk_Tree *tree, Etk_Tree *output, 
-       Etk_Canvas *canvas);
+void list_entries(const char *file, Etk_Tree *tree, Etk_Canvas *canvas);
 Demo_Edje *edje_part_create(Etk_Tree *output, Etk_Canvas *canvas,
        const char *file, char *name);
 void edje_part_show(Etk_Canvas *canvas, Demo_Edje *de);
-void edje_part_hide(Etk_Canvas *canvas, Demo_Edje *de);
+void edje_part_hide(Demo_Edje *de);
 void edje_part_resize(Demo_Edje *de);
 
 
===================================================================
RCS file: /cvs/e/e17/proto/edje_viewer/src/bin/etk_gui.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- etk_gui.c   17 Jan 2007 03:44:03 -0000      1.15
+++ etk_gui.c   20 Jan 2007 03:35:41 -0000      1.16
@@ -179,15 +179,13 @@
    etk_widget_show_all(gui->win);
 
    check = edje_viewer_config_open_last_get();
-   if (file) list_entries(file, ETK_TREE(gui->tree), ETK_TREE(gui->output),
-        ETK_CANVAS(gui->canvas));
+   if (file) list_entries(file, ETK_TREE(gui->tree), ETK_CANVAS(gui->canvas));
    else if (check)
      {
        file = edje_viewer_config_last_get();
        if (file)
          {
-            list_entries(file, ETK_TREE(gui->tree), ETK_TREE(gui->output),
-                  ETK_CANVAS(gui->canvas));
+            list_entries(file, ETK_TREE(gui->tree), ETK_CANVAS(gui->canvas));
             etk_window_title_set(ETK_WINDOW(gui->win), file);
          }
      }
@@ -352,8 +350,7 @@
    else if (!strcmp(label, "Open"))
      _gui_open_edje_file_cb(gui);
    else if (strstr(label, ".edj"))
-     list_entries(label, ETK_TREE(gui->tree), ETK_TREE(gui->output),
-          ETK_CANVAS(gui->canvas));
+     list_entries(label, ETK_TREE(gui->tree), ETK_CANVAS(gui->canvas));
 }
 
 static void _gui_open_last_clicked_cb(Etk_Object *obj, void *data)
@@ -531,8 +528,7 @@
    gui->path = strdup(dir);
    gui->path = strcat(gui->path, "/");
    gui->path = strcat(gui->path, file);
-   list_entries(gui->path, ETK_TREE(gui->tree), ETK_TREE(gui->output),
-        ETK_CANVAS(gui->canvas));
+   list_entries(gui->path, ETK_TREE(gui->tree), ETK_CANVAS(gui->canvas));
    etk_window_hide_on_delete(ETK_OBJECT(gui->fm_dialog), NULL);
    etk_window_title_set(ETK_WINDOW(gui->win), gui->path);
 }
@@ -549,20 +545,24 @@
 static void _gui_tree_checkbox_toggled_cb(Etk_Object *obj, Etk_Tree_Row *row,
       void *data)
 {
-   Demo_Edje *de;
+   Collection *co;
    Etk_Bool checked;
    Etk_Tree_Col *col;
    Gui *gui;
 
-   if (!(de = etk_tree_row_data_get(row))) return;
+   if (!(co = etk_tree_row_data_get(row))) return;
    if (!(col = ETK_TREE_COL(obj)) || !row) return;
    if (!(gui = data)) return;
 
+   if (!co->de)
+     co->de = edje_part_create(ETK_TREE(gui->output), 
+          ETK_CANVAS(gui->canvas), co->file, co->part);
+
    etk_tree_row_fields_get(row, col, &checked, NULL);
    if (checked)
-     edje_part_show(ETK_CANVAS(gui->canvas), de);
+     edje_part_show(ETK_CANVAS(gui->canvas), co->de);
    else
-     edje_part_hide(ETK_CANVAS(gui->canvas), de);
+     edje_part_hide(co->de);
 }
 
 static void _gui_send_clicked_cb(Etk_Object *obj, void *data)



-------------------------------------------------------------------------
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