|
From: <enl...@li...> - 2006-02-16 09:27:46
|
Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_shelf.c e_shelf.h
Log Message:
more work on shelfy bits
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_shelf.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- e_shelf.c 16 Feb 2006 06:32:54 -0000 1.5
+++ e_shelf.c 16 Feb 2006 09:27:37 -0000 1.6
@@ -85,6 +85,7 @@
cf_es->popup, cf_es->layer);
if (es)
{
+ es->cfg = cf_es;
e_shelf_move_resize(es, cf_escf2->x, cf_escf2->y,
cf_escf2->w, cf_escf2->h);
e_shelf_orient(es, cf_escf2->orient);
@@ -250,9 +251,66 @@
{
E_OBJECT_CHECK(es);
E_OBJECT_TYPE_CHECK(es, E_GADMAN_SHELF_TYPE);
- /* FIXME: find or create saved shelf node and then modify and queue a
- * save
- */
+ if (es->cfg)
+ {
+ Evas_List *l;
+ E_Config_Shelf_Config *cf_escf = NULL;
+
+ for (l = es->cfg->configs; l; l = l->next)
+ {
+ cf_escf = l->data;
+ if ((cf_escf->res.w == es->zone->w) &&
+ (cf_escf->res.h == es->zone->h))
+ break;
+ cf_escf = NULL;
+ }
+ if (!cf_escf)
+ {
+ cf_escf = E_NEW(E_Config_Shelf_Config, 1);
+ if (cf_escf)
+ {
+ cf_escf->res.w = es->zone->w;
+ cf_escf->res.h = es->zone->h;
+ es->cfg->configs = evas_list_append(es->cfg->configs, cf_escf);
+ }
+ }
+ if (cf_escf)
+ {
+ cf_escf->x = es->x;
+ cf_escf->y = es->y;
+ cf_escf->w = es->w;
+ cf_escf->h = es->h;
+ cf_escf->orient = es->gadcon->orient;
+ if (cf_escf->style) evas_stringshare_del(cf_escf->style);
+ cf_escf->style = evas_stringshare_add(es->style);
+ }
+ }
+ else
+ {
+ E_Config_Shelf *cf_es;
+ E_Config_Shelf_Config *cf_escf = NULL;
+
+ cf_es = E_NEW(E_Config_Shelf, 1);
+ cf_es->name = evas_stringshare_add(es->name);
+ cf_es->container = es->zone->container->num;
+ cf_es->zone = es->zone->num;
+ if (es->popup) cf_es->popup = 1;
+ cf_es->layer = es->layer;
+ e_config->shelves = evas_list_append(e_config->shelves, cf_es);
+ es->cfg = cf_es;
+
+ cf_escf = E_NEW(E_Config_Shelf_Config, 1);
+ cf_escf->res.w = es->zone->w;
+ cf_escf->res.h = es->zone->h;
+ cf_escf->x = es->x;
+ cf_escf->y = es->y;
+ cf_escf->w = es->w;
+ cf_escf->h = es->h;
+ cf_escf->orient = es->gadcon->orient;
+ cf_escf->style = evas_stringshare_add(es->style);
+ cf_es->configs = evas_list_append(cf_es->configs, cf_escf);
+ }
+ e_config_save_queue();
}
EAPI void
@@ -260,9 +318,21 @@
{
E_OBJECT_CHECK(es);
E_OBJECT_TYPE_CHECK(es, E_GADMAN_SHELF_TYPE);
- /* FIXME: find or create saved shelf node and then delete and queue a
- * save
- */
+ if (es->cfg)
+ {
+ e_config->shelves = evas_list_remove(e_config->shelves, es->cfg);
+ evas_stringshare_del(es->cfg->name);
+ while (es->cfg->configs)
+ {
+ E_Config_Shelf_Config *cf_escf;
+
+ cf_escf = es->cfg->configs->data;
+ if (cf_escf->style) evas_stringshare_del(cf_escf->style);
+ free(cf_escf);
+ es->cfg->configs = evas_list_remove_list(es->cfg->configs, es->cfg->configs);
+ }
+ free(es->cfg);
+ }
}
EAPI void
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_shelf.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_shelf.h 16 Feb 2006 06:32:54 -0000 1.4
+++ e_shelf.h 16 Feb 2006 09:27:37 -0000 1.5
@@ -24,9 +24,7 @@
E_Gadcon *gadcon;
char *name;
char *style;
- /* FIXME: we need a more powerful sizing/placement policy rather than just
- * x,y, width & height
- */
+ E_Config_Shelf *cfg;
};
EAPI int e_shelf_init(void);
|