Hello,
I thought that having the hability to automagically hide the shelves would be nice. Here are some patches for E and its defaut theme that enable a per-shelf auto-hide option.

Any comments / criticisms are welcome

Regards
Albin Tonnerre (Lutin)
--- e17/apps/e/data/themes/default_shelf.edc	2006-09-01 21:31:32.000000000 +0200
+++ a17/apps/enlightenment-0.17/data/themes/default_shelf.edc	2007-02-01 01:19:37.000000000 +0100
@@ -17,6 +17,7 @@
       part {
 	 name:          "base";
 	 mouse_events:  0;
+     clip_to:       "item_clip";
 	 description {
 	    state:    "default" 0.0;
 	    image {
@@ -184,9 +185,23 @@
 	 }
       }
       part {
+	 name:          "item_clip";
+	 type:          RECT;
+	 mouse_events:  0;
+	 description {
+	    state:    "default" 0.0;
+	    color: 255 255 255 255;
+	 }
+	 description {
+	    state:    "hidden" 0.0;
+	    color: 255 255 255 0;
+	 }
+      }
+      part {
 	 name:          "e.swallow.content";
 	 mouse_events:  0;
 	 type:          SWALLOW;
+     clip_to:       "item_clip";
 	 description {
 	    state:    "default" 0.0;
 	    rel1 {
@@ -323,6 +338,22 @@
    }
    programs {
       program {
+	 name:    "hide";
+	 signal:  "e,state,hidden";
+	 source:  "e";
+	 action:  STATE_SET "hidden" 0.0;
+     transition:    LINEAR 0.3;
+	 target:  "item_clip";
+      }
+      program {
+	 name:    "show";
+	 signal:  "e,state,visible";
+	 source:  "e";
+     transition:    LINEAR 0.3;
+	 action:  STATE_SET "default" 0.0;
+	 target:  "item_clip";
+      }
+      program {
 	 name:    "orient1";
 	 signal:  "e,state,orientation,top";
 	 source:  "e";
@@ -563,6 +594,7 @@
       part {
 	 name:          "base";
 	 mouse_events:  0;
+     clip_to:       "item_clip";
 	 description {
 	    state:    "default" 0.0;
 	    image {
@@ -730,9 +762,23 @@
 	 }
       }
       part {
+	 name:          "item_clip";
+	 type:          RECT;
+	 mouse_events:  0;
+	 description {
+	    state:    "default" 0.0;
+	    color: 255 255 255 255;
+	 }
+	 description {
+	    state:    "hidden" 0.0;
+	    color: 255 255 255 0;
+	 }
+      }
+      part {
 	 name:          "e.swallow.content";
 	 mouse_events:  0;
 	 type:          SWALLOW;
+     clip_to:       "item_clip";
 	 description {
 	    state:    "default" 0.0;
 	    rel1 {
@@ -869,6 +915,23 @@
    }
    programs {
       program {
+	 name:    "hide";
+	 signal:  "e,state,hidden";
+	 source:  "e";
+	 action:  STATE_SET "hidden" 0.0;
+     transition:    LINEAR 0.3;
+	 target:  "item_clip";
+      }
+      program {
+	 name:    "show";
+	 signal:  "e,state,visible";
+	 source:  "e";
+     transition:    LINEAR 0.3;
+	 action:  STATE_SET "default" 0.0;
+
+	 target:  "item_clip";
+      }
+      program {
 	 name:    "orient1";
 	 signal:  "e,state,orientation,top";
 	 source:  "e";
@@ -1097,14 +1160,46 @@
    }
    parts {
       part {
+	 name:          "item_clip";
+	 type:          RECT;
+	 mouse_events:  0;
+	 description {
+	    state:    "default" 0.0;
+	    color: 255 255 255 255;
+	 }
+	 description {
+	    state:    "hidden" 0.0;
+	    color: 255 255 255 0;
+	 }
+      }
+      part {
 	 name:          "e.swallow.content";
 	 mouse_events:  0;
 	 type:          SWALLOW;
+     clip_to:       "item_clip";
 	 description {
 	    state:    "default" 0.0;
 	 }
       }
    }
+   programs {
+      program {
+	 name:    "hide";
+	 signal:  "e,state,hidden";
+	 source:  "e";
+	 action:  STATE_SET "hidden" 0.0;
+     transition:    LINEAR 0.3;
+	 target:  "item_clip";
+      }
+      program {
+	 name:    "show";
+	 signal:  "e,state,visible";
+	 source:  "e";
+     transition:    LINEAR 0.3;
+	 action:  STATE_SET "default" 0.0;
+	 target:  "item_clip";
+      }
+   }
 }
 
 group {
--- e17/apps/e/src/bin/e_config.c	2007-01-08 00:45:35.000000000 +0100
+++ e17/apps/enlightenment-0.17/src/bin/e_config.c	2007-01-31 21:16:58.000000000 +0100
@@ -121,6 +121,7 @@
    E_CONFIG_VAL(D, T, style, STR);
    E_CONFIG_VAL(D, T, size, INT);
    E_CONFIG_VAL(D, T, overlap, INT);
+   E_CONFIG_VAL(D, T, autohide, INT);
    
    _e_config_desktop_bg_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Background", E_Config_Desktop_Background);
 #undef T
@@ -1119,7 +1120,7 @@
      {
 	E_Config_Shelf *cf_es;
 	
-#define CFG_SHELF(_name, _con, _zone, _pop, _lay, _orient, _fita, _fits, _style, _size, _overlap) \
+#define CFG_SHELF(_name, _con, _zone, _pop, _lay, _orient, _fita, _fits, _style, _size, _overlap, _autohide) \
    cf_es = E_NEW(E_Config_Shelf, 1); \
    cf_es->name = evas_stringshare_add(_name); \
    cf_es->container = _con; \
@@ -1132,30 +1133,31 @@
    cf_es->style = evas_stringshare_add(_style); \
    cf_es->size = _size; \
    cf_es->overlap = _overlap; \
+   cf_es->autohide = _autohide; \
    e_config->shelves = evas_list_append(e_config->shelves, cf_es)
 	/* shelves for 4 zones on head 0 by default */
 	CFG_SHELF("shelf", 0, 0,
 		  1, 200, E_GADCON_ORIENT_BOTTOM,
-		  1, 0, "default", 40, 0);
+		  1, 0, "default", 40, 0, 0);
 	CFG_SHELF("shelf", 0, 1,
 		  1, 200, E_GADCON_ORIENT_BOTTOM,
-		  1, 0, "default", 40, 0);
+		  1, 0, "default", 40, 0, 0);
 	CFG_SHELF("shelf", 0, 2,
 		  1, 200, E_GADCON_ORIENT_BOTTOM,
-		  1, 0, "default", 40, 0);
+		  1, 0, "default", 40, 0, 0);
 	CFG_SHELF("shelf", 0, 3,
 		  1, 200, E_GADCON_ORIENT_BOTTOM,
-		  1, 0, "default", 40, 0);
+		  1, 0, "default", 40, 0, 0);
 	/* shelves for heada 1, 2, and 3 by default */
 	CFG_SHELF("shelf", 1, 0,
 		  1, 200, E_GADCON_ORIENT_BOTTOM,
-		  1, 0, "default", 40, 0);
+		  1, 0, "default", 40, 0, 0);
 	CFG_SHELF("shelf", 2, 0,
 		  1, 200, E_GADCON_ORIENT_BOTTOM,
-		  1, 0, "default", 40, 0);
+		  1, 0, "default", 40, 0, 0);
 	CFG_SHELF("shelf", 3, 0,
 		  1, 200, E_GADCON_ORIENT_BOTTOM,
-		  1, 0, "default", 40, 0);
+		  1, 0, "default", 40, 0, 0);
      }
    IFCFGEND;
    
--- e17/apps/e/src/bin/e_config.h	2007-01-08 00:45:35.000000000 +0100
+++ e17/apps/enlightenment-0.17/src/bin/e_config.h	2007-01-31 20:22:19.000000000 +0100
@@ -371,6 +371,7 @@
    const char   *style;
    int           size;
    int           overlap;
+   int		 autohide;
 };
 
 struct _E_Config_Mime_Icon
--- e17/apps/e/src/bin/e_int_config_shelf.c	2006-12-14 16:40:19.000000000 +0100
+++ e17/apps/enlightenment-0.17/src/bin/e_int_config_shelf.c	2007-01-31 21:07:40.000000000 +0100
@@ -236,6 +236,7 @@
    cfg->style = evas_stringshare_add("default");
    cfg->size = 40;
    cfg->overlap = 0;
+   cfg->autohide = 0;
    e_config->shelves = evas_list_append(e_config->shelves, cfg);
    e_config_save_queue();
 
--- e17/apps/e/src/bin/e_int_shelf_config.c	2006-10-15 23:30:06.000000000 +0200
+++ e17/apps/enlightenment-0.17/src/bin/e_int_shelf_config.c	2007-01-31 23:53:18.000000000 +0100
@@ -35,6 +35,7 @@
    int size;
    int layering;
    int overlapping;
+   int autohiding;
 };
 
 /* a nice easy setup function that does the dirty work */
@@ -115,6 +116,7 @@
    cfdata->fit_size = cfdata->escfg->fit_size;
    cfdata->size = cfdata->escfg->size;
    cfdata->overlapping = cfdata->escfg->overlap;
+   cfdata->autohiding = cfdata->escfg->autohide;
    if (cfdata->size <= 24)
      cfdata->basic_size = 24;
    else if (cfdata->size <= 32)
@@ -335,6 +337,12 @@
      }
 
    cfdata->escfg->overlap = cfdata->overlapping;
+   cfdata->escfg->autohide = cfdata->autohiding;
+   if ( cfdata->escfg->autohide == 1 )
+   {
+      edje_object_signal_emit(cfdata->es->o_base, "e,state,hidden", "e");
+   }
+   else edje_object_signal_emit(cfdata->es->o_base, "e,state,visible", "e");
 
    if (restart) 
      {
@@ -446,6 +454,8 @@
    e_widget_framelist_object_append(of, ob);
    ob = e_widget_check_add(evas, _("Allow windows to overlap the shelf"), &(cfdata->overlapping));
    e_widget_framelist_object_append(of, ob);
+   ob = e_widget_check_add(evas, _("Auto-hide the shelf"), &(cfdata->autohiding));
+   e_widget_framelist_object_append(of, ob);
    e_widget_list_object_append(o2, of, 1, 1, 0.5);
    
    of = e_widget_frametable_add(evas, _("Layout"), 1);
--- e17/apps/e/src/bin/e_shelf.c	2006-12-28 15:13:15.000000000 +0100
+++ e17/apps/enlightenment-0.17/src/bin/e_shelf.c	2007-01-31 22:11:29.000000000 +0100
@@ -319,6 +319,7 @@
 	cf_es->fit_along = es->fit_along;
 	cf_es->fit_size = es->fit_size;
 	cf_es->overlap = 0;
+	cf_es->autohide = 0; 
 	es->cfg = cf_es;
      }
    e_config_save_queue();
@@ -967,6 +968,10 @@
    es = data;
    ev = event_info;
    edje_object_signal_emit(es->o_base, "e,state,focused", "e");
+   if (es->cfg->autohide ==1 )
+   {
+      edje_object_signal_emit(es->o_base, "e,state,visible", "e");
+   }
 }
 
 static void
@@ -977,6 +982,19 @@
    
    es = data;
    ev = event_info;
+   if (es->cfg->autohide ==1 )
+   {
+      int cx, cy;
+      evas_pointer_canvas_xy_get(es->evas, &cx, &cy);
+      int x = es->x;
+      int y = es->y;
+      int w = es->w;
+      int h = es->h;
+      if( cx <= x || cx >= x+w || cy <= y || cy >= y+h )
+      {
+	 edje_object_signal_emit(es->o_base, "e,state,hidden", "e");
+      }
+   }
    edje_object_signal_emit(es->o_base, "e,state,unfocused", "e");
 }
 
-------------------------------------------------------------------------
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-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to