Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_int_border_border.c e_int_config_shelf.c 
        e_int_shelf_config.c e_shelf.c 


Log Message:


NOW we can add/del shelves... still not done.

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_border_border.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- e_int_border_border.c       23 Apr 2006 06:56:22 -0000      1.11
+++ e_int_border_border.c       30 Apr 2006 09:31:31 -0000      1.12
@@ -4,7 +4,6 @@
 #include "e.h"
 
 /* PROTOTYPES - same all the time */
-typedef struct _CFBorder CFBorder;
 
 static void *_create_data(E_Config_Dialog *cfd);
 static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
@@ -17,13 +16,6 @@
    E_Border *border;
    char *bordername;
    int remember_border;
-   Evas_List *cfblist;
-};
-
-struct _CFBorder
-{
-   E_Config_Dialog_Data     *cfdata;
-   const char *bordername;
 };
 
 /* a nice easy setup function that does the dirty work */
@@ -81,11 +73,6 @@
    /* Free the cfdata */
    cfdata->border->border_border_dialog = NULL;
    E_FREE(cfdata->bordername);
-   while (cfdata->cfblist)
-     {
-       E_FREE(cfdata->cfblist->data);
-       cfdata->cfblist = evas_list_remove_list(cfdata->cfblist, 
cfdata->cfblist);
-     }
    free(cfdata);
 }
 
@@ -146,7 +133,6 @@
    Evas_Coord wmw, wmh;
    Evas_List *borders, *l;
    int sel, n;
-   CFBorder *cfb;
    
    o = e_widget_list_add(evas, 0, 0);
    
@@ -155,10 +141,6 @@
    sel = 0;
    borders = e_theme_border_list();
 
-   cfb = E_NEW(CFBorder, 1);
-   cfb->cfdata = cfdata;
-   cfb->bordername = "borderless";
-   cfdata->cfblist = evas_list_append(cfdata->cfblist, cfb);
    orect = evas_object_rectangle_add(evas);
    evas_object_color_set(orect, 0, 0, 0, 128);
    e_widget_ilist_append(oi, orect, "borderless", NULL, NULL, "borderless");
@@ -167,15 +149,10 @@
      {
        char buf[4096];
        
-       cfb = E_NEW(CFBorder, 1);
-       cfb->cfdata = cfdata;
-       cfb->bordername = l->data;
-       cfdata->cfblist = evas_list_append(cfdata->cfblist, cfb);
        ob = e_livethumb_add(evas);
        e_livethumb_vsize_set(ob, 160, 96);
        oj = edje_object_add(e_livethumb_evas_get(ob));
-        snprintf(buf, sizeof(buf), "widgets/border/%s/border",
-                (char *)l->data);
+        snprintf(buf, sizeof(buf), "widgets/border/%s/border", (char 
*)l->data);
        e_theme_edje_object_set(oj, "base/theme/borders", buf);
        e_livethumb_thumb_set(ob, oj);
        orect = evas_object_rectangle_add(e_livethumb_evas_get(ob));
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_shelf.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_int_config_shelf.c        30 Apr 2006 03:43:47 -0000      1.1
+++ e_int_config_shelf.c        30 Apr 2006 09:31:31 -0000      1.2
@@ -7,7 +7,8 @@
 
 struct _E_Config_Dialog_Data 
 {
-   int dummy;
+   E_Config_Dialog *cfd;
+   Evas_Object *ilist;
 };
 
 EAPI E_Config_Dialog *
@@ -40,6 +41,7 @@
    E_Config_Dialog_Data *cfdata;
    
    cfdata = E_NEW(E_Config_Dialog_Data, 1);
+   cfdata->cfd = cfd;
    _fill_data(cfdata);
    return cfdata;
 }
@@ -56,11 +58,148 @@
    return 1;
 }
 
+static void
+_cb_list(void *data)
+{
+   E_Config_Dialog_Data *cfdata;
+   
+   cfdata = data;
+}
+
+static void
+_ilist_fill(E_Config_Dialog_Data *cfdata)
+{
+   Evas_List *l;
+   E_Shelf *es;
+   char buf[256];
+   const char *label;
+   Evas_Object *ob;
+   int n;
+   Evas_Coord wmw, wmh;
+   
+   n = e_widget_ilist_selected_get(cfdata->ilist);
+   e_widget_ilist_clear(cfdata->ilist);
+   for (l = e_shelf_list(); l; l = l->next)
+     {
+       es = l->data;
+       
+       label = es->name;
+       if (!label) label = "";
+       snprintf(buf, sizeof(buf), "%s #%i", label, es->id);
+       
+       /* FIXME: proper icon */
+       ob = edje_object_add(evas_object_evas_get(cfdata->ilist));
+       e_util_edje_icon_set(ob, "enlightenment/e");
+       
+       e_widget_ilist_append(cfdata->ilist, ob, buf, _cb_list, cfdata, NULL);
+     }
+   e_widget_min_size_get(cfdata->ilist, &wmw, &wmh);
+   e_widget_min_size_set(cfdata->ilist, wmw, 250);
+   e_widget_ilist_go(cfdata->ilist);
+   e_widget_ilist_selected_set(cfdata->ilist, n);
+}
+
+static void
+_cb_add(void *data, void *data2)
+{
+   E_Config_Dialog_Data *cfdata;
+   Evas_List *shelves;
+   
+   cfdata = data;
+   while ((shelves = e_shelf_list()))
+     {
+       E_Shelf *es;
+       
+       es = shelves->data;
+       e_object_del(E_OBJECT(es));
+     }
+   ////
+     {
+       E_Config_Shelf *cfg;
+       E_Shelf *es;
+       
+       cfg = E_NEW(E_Config_Shelf, 1);
+       cfg->name = evas_stringshare_add("shelf");
+       cfg->container = cfdata->cfd->con->num;
+       cfg->zone = cfdata->cfd->dia->win->border->zone->num;
+       cfg->popup = 1;
+       cfg->layer = 200;
+       cfg->orient = E_GADCON_ORIENT_CORNER_BR;
+       cfg->fit_along = 1;
+       cfg->fit_size = 0;
+       cfg->style = evas_stringshare_add("default");
+       cfg->size = 40;
+       e_config->shelves = evas_list_append(e_config->shelves, cfg);
+     }
+   e_shelf_config_init();
+   e_config_save_queue();
+   
+   _ilist_fill(cfdata);
+}
+
+static void
+_cb_del(void *data, void *data2)
+{
+   E_Config_Dialog_Data *cfdata;
+   E_Shelf *es;
+   E_Config_Shelf *cfg;
+   
+   cfdata = data;
+   es = evas_list_nth(e_shelf_list(), 
e_widget_ilist_selected_get(cfdata->ilist));
+   if (!es) return;
+   cfg = es->cfg;
+   e_object_del(E_OBJECT(es));
+   
+   e_config->shelves = evas_list_remove(e_config->shelves, cfg);
+   if (cfg->name) evas_stringshare_del(cfg->name);
+   if (cfg->style) evas_stringshare_del(cfg->style);
+   E_FREE(cfg);
+   
+   e_config_save_queue();
+   
+   _ilist_fill(cfdata);
+}
+
+static void
+_cb_config(void *data, void *data2)
+{
+   E_Config_Dialog_Data *cfdata;
+   E_Shelf *es;
+   
+   cfdata = data;
+   es = evas_list_nth(e_shelf_list(), 
e_widget_ilist_selected_get(cfdata->ilist));
+   if (!es) return;
+   e_int_shelf_config(es);
+}
+
 static Evas_Object *
 _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data 
*cfdata) 
 {
-   Evas_Object *o;
+   Evas_Object *o, *of, *oi, *ob, *ol;
+   
+   o = e_widget_list_add(evas, 0, 1);
+   
+   of = e_widget_framelist_add(evas, _("Configured Shelves"), 0);
+   oi = e_widget_ilist_add(evas, 80, 60, NULL);
+   e_widget_ilist_selector_set(oi, 1);
+   cfdata->ilist = oi;
+
+   _ilist_fill(cfdata);
    
-   o = e_widget_list_add(evas, 0, 0);
+   e_widget_framelist_object_append(of, oi);
+   e_widget_list_object_append(o, of, 1, 1, 0.5);
+   
+   ol = e_widget_table_add(evas, 0);
+   
+   ob = e_widget_button_add(evas, _("Add"), "widget/add", _cb_add, cfdata, 
NULL);
+   e_widget_table_object_append(ol, ob, 0, 0, 1, 1,  1, 1, 1, 0);
+   ob = e_widget_button_add(evas, _("Delete"), "widget/del", _cb_del, cfdata, 
NULL);
+   e_widget_table_object_append(ol, ob, 0, 1, 1, 1,  1, 1, 1, 0);
+   ob = e_widget_button_add(evas, _("Configure..."), "widget/config", 
_cb_config, cfdata, NULL);
+   e_widget_table_object_append(ol, ob, 0, 2, 1, 1,  1, 1, 1, 0);
+   
+   e_widget_list_object_append(o, ol, 1, 1, 0.0);
+   
+
    return o;
 }
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_shelf_config.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_int_shelf_config.c        30 Apr 2006 04:31:42 -0000      1.4
+++ e_int_shelf_config.c        30 Apr 2006 09:31:31 -0000      1.5
@@ -4,8 +4,6 @@
 #include "e.h"
 
 /* PROTOTYPES - same all the time */
-typedef struct _CFStyle CFStyle;
-
 static void *_create_data(E_Config_Dialog *cfd);
 static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
 static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data 
*cfdata);
@@ -22,13 +20,6 @@
    int fit_size;
    int size;
    int layering;
-   Evas_List *cfslist;
-};
-
-struct _CFStyle
-{
-   E_Config_Dialog_Data *cfdata;
-   const char *style;
 };
 
 /* a nice easy setup function that does the dirty work */
@@ -102,11 +93,6 @@
    /* Free the cfdata */
    cfdata->es->config_dialog = NULL;
    if (cfdata->style) free(cfdata->style);
-   while (cfdata->cfslist)
-     {
-       E_FREE(cfdata->cfslist->data);
-       cfdata->cfslist = evas_list_remove_list(cfdata->cfslist, 
cfdata->cfslist);
-     }
    free(cfdata);
 }
 
@@ -169,7 +155,6 @@
    Evas_Coord wmw, wmh;
    Evas_List *styles, *l;
    int sel, n;
-   CFStyle *cfs;
    
    /* FIXME: this is just raw config now - it needs UI improvments */
    o = e_widget_list_add(evas, 0, 1);
@@ -236,15 +221,10 @@
      {
        char buf[4096];
        
-       cfs = E_NEW(CFStyle, 1);
-       cfs->cfdata = cfdata;
-       cfs->style = "default";
-       cfdata->cfslist = evas_list_append(cfdata->cfslist, cfs);
        ob = e_livethumb_add(evas);
        e_livethumb_vsize_set(ob, 256, 40);
        oj = edje_object_add(e_livethumb_evas_get(ob));
-       snprintf(buf, sizeof(buf), "shelf/%s/base",
-                (char *)l->data);
+       snprintf(buf, sizeof(buf), "shelf/%s/base", (char *)l->data);
        e_theme_edje_object_set(oj, "base/theme/shelf", buf);
        e_livethumb_thumb_set(ob, oj);
        e_widget_ilist_append(oi, ob, (char *)l->data, NULL, NULL, l->data);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_shelf.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- e_shelf.c   23 Apr 2006 13:20:57 -0000      1.17
+++ e_shelf.c   30 Apr 2006 09:31:31 -0000      1.18
@@ -128,7 +128,7 @@
      }
    if (id < 0)
      {
-       es->id = shelf_id;
+       es->id = evas_list_count(shelves);
        shelf_id++;
      }
    else




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to