Enlightenment CVS committal

Author  : morlenxus
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_config.c e_config.h e_desk.c e_int_shelf_config.c e_shelf.c 


Log Message:
This allows to have shelfs only on specified desktops. Someone might want to 
add a nice hide/show animation...

===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.266
retrieving revision 1.267
diff -u -3 -r1.266 -r1.267
--- e_config.c  18 Aug 2007 10:37:16 -0000      1.266
+++ e_config.c  4 Sep 2007 23:59:01 -0000       1.267
@@ -39,6 +39,7 @@
 static E_Config_DD *_e_config_gadcon_edd = NULL;
 static E_Config_DD *_e_config_gadcon_client_edd = NULL;
 static E_Config_DD *_e_config_shelf_edd = NULL;
+static E_Config_DD *_e_config_shelf_desk_edd = NULL;
 static E_Config_DD *_e_config_mime_icon_edd = NULL;
 
 EAPI int E_EVENT_CONFIG_ICON_THEME = 0;
@@ -108,6 +109,14 @@
    E_CONFIG_VAL(D, T, name, STR);
    E_CONFIG_VAL(D, T, id, STR);
    E_CONFIG_LIST(D, T, clients, _e_config_gadcon_client_edd);
+
+   _e_config_shelf_desk_edd = E_CONFIG_DD_NEW("E_Config_Shelf_Desk", 
E_Config_Shelf_Desk);
+#undef T
+#undef D
+#define T E_Config_Shelf_Desk
+#define D _e_config_shelf_desk_edd
+   E_CONFIG_VAL(D, T, x, INT);
+   E_CONFIG_VAL(D, T, y, INT);
    
    _e_config_shelf_edd = E_CONFIG_DD_NEW("E_Config_Shelf", E_Config_Shelf);
 #undef T
@@ -129,7 +138,9 @@
    E_CONFIG_VAL(D, T, autohide_show_action, INT);
    E_CONFIG_VAL(D, T, hide_timeout, FLOAT);
    E_CONFIG_VAL(D, T, hide_duration, FLOAT);
-   
+   E_CONFIG_VAL(D, T, desk_show_mode, INT);
+   E_CONFIG_LIST(D, T, desk_list, _e_config_shelf_desk_edd);
+
    _e_config_desktop_bg_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Background", 
E_Config_Desktop_Background);
 #undef T
 #undef D
@@ -1220,7 +1231,7 @@
      {
        E_Config_Shelf *cf_es;
        
-#define CFG_SHELF(_name, _con, _zone, _pop, _lay, _orient, _fita, _fits, 
_style, _size, _overlap, _autohide, _autohide_show_action, _hide_timeout, 
_hide_duration) \
+#define CFG_SHELF(_name, _con, _zone, _pop, _lay, _orient, _fita, _fits, 
_style, _size, _overlap, _autohide, _autohide_show_action, _hide_timeout, 
_hide_duration, _desk_show_mode, _desk_list) \
    cf_es = E_NEW(E_Config_Shelf, 1); \
    cf_es->name = evas_stringshare_add(_name); \
    cf_es->container = _con; \
@@ -1237,30 +1248,32 @@
    cf_es->autohide_show_action = _autohide_show_action; \
    cf_es->hide_timeout = _hide_timeout; \
    cf_es->hide_duration = _hide_duration; \
+   cf_es->desk_show_mode = _desk_show_mode; \
+   cf_es->desk_list = evas_list_append(cf_es->desk_list, cf_es); \
    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, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0, 0, NULL);
        CFG_SHELF("shelf", 0, 1,
                  1, 200, E_GADCON_ORIENT_BOTTOM,
-                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0, 0, NULL);
        CFG_SHELF("shelf", 0, 2,
                  1, 200, E_GADCON_ORIENT_BOTTOM,
-                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0, 0, NULL);
        CFG_SHELF("shelf", 0, 3,
                  1, 200, E_GADCON_ORIENT_BOTTOM,
-                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0, 0, NULL);
        /* 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, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0, 0, NULL);
        CFG_SHELF("shelf", 2, 0,
                  1, 200, E_GADCON_ORIENT_BOTTOM,
-                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0, 0, NULL);
        CFG_SHELF("shelf", 3, 0,
                  1, 200, E_GADCON_ORIENT_BOTTOM,
-                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0);
+                 1, 0, "default", 40, 0, 0, 0, 1.0, 1.0, 0, NULL);
      }
    IFCFGEND;
    
@@ -1633,6 +1646,7 @@
    E_CONFIG_DD_FREE(_e_config_gadcon_edd);
    E_CONFIG_DD_FREE(_e_config_gadcon_client_edd);
    E_CONFIG_DD_FREE(_e_config_shelf_edd);
+   E_CONFIG_DD_FREE(_e_config_shelf_desk_edd);
    return 1;
 }
 
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -3 -r1.161 -r1.162
--- e_config.h  11 Aug 2007 20:03:21 -0000      1.161
+++ e_config.h  4 Sep 2007 23:59:01 -0000       1.162
@@ -37,6 +37,7 @@
 typedef struct _E_Config_Gadcon             E_Config_Gadcon;
 typedef struct _E_Config_Gadcon_Client      E_Config_Gadcon_Client;
 typedef struct _E_Config_Shelf              E_Config_Shelf;
+typedef struct _E_Config_Shelf_Desk         E_Config_Shelf_Desk;
 typedef struct _E_Config_Mime_Icon          E_Config_Mime_Icon;
 
 typedef struct _E_Event_Config_Icon_Theme   E_Event_Config_Icon_Theme;
@@ -412,6 +413,13 @@
    int           autohide_show_action;
    float        hide_timeout;
    float        hide_duration;
+   int          desk_show_mode;
+   Evas_List    *desk_list;
+};
+
+struct _E_Config_Shelf_Desk
+{
+   int x, y;
 };
 
 struct _E_Config_Mime_Icon
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_desk.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -3 -r1.66 -r1.67
--- e_desk.c    25 Apr 2007 11:28:35 -0000      1.66
+++ e_desk.c    4 Sep 2007 23:59:01 -0000       1.67
@@ -200,6 +200,7 @@
    E_Border_List     *bl;
    E_Border          *bd;
    E_Event_Desk_Show *ev;
+   Evas_List *l;
    int                was_zone = 0;
    int                x, y, dx = 0, dy = 0;
 
@@ -275,6 +276,33 @@
    ev->desk = desk;
    e_object_ref(E_OBJECT(desk));
    ecore_event_add(E_EVENT_DESK_SHOW, ev, _e_border_event_desk_show_free, 
NULL);
+
+   for (l = e_shelf_list(); l; l = l->next)
+     {
+       Evas_List *ll;
+       E_Shelf *es;
+       int show_shelf=0;
+
+       es = l->data;
+       if (!es->cfg->desk_show_mode) continue;
+
+       for (ll = es->cfg->desk_list; ll; ll = ll->next)
+         {
+            E_Config_Shelf_Desk *sd;
+
+            sd = ll->data;
+            if (!sd) continue;
+            if ((desk->x == sd->x) && (desk->y == sd->y))
+              {
+                 show_shelf=1;
+                 break;
+              }
+         }
+       if (show_shelf)
+         e_shelf_show (es);
+       else
+         e_shelf_hide (es);
+     }
 }
 
 EAPI void
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_shelf_config.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -3 -r1.30 -r1.31
--- e_int_shelf_config.c        18 Jun 2007 11:29:02 -0000      1.30
+++ e_int_shelf_config.c        4 Sep 2007 23:59:01 -0000       1.31
@@ -39,6 +39,11 @@
    int autohiding_show_action;
    double hide_timeout;
    double hide_duration;
+
+   int desk_show_mode;
+   Evas_List *desk_list; 
+
+   Evas_Object *desk_sel_list;
 };
 
 /* a nice easy setup function that does the dirty work */
@@ -123,6 +128,8 @@
    cfdata->autohiding_show_action = cfdata->escfg->autohide_show_action;
    cfdata->hide_timeout = cfdata->escfg->hide_timeout;
    cfdata->hide_duration = cfdata->escfg->hide_duration;
+   cfdata->desk_show_mode = cfdata->escfg->desk_show_mode;
+   cfdata->desk_list = cfdata->escfg->desk_list;
    if (cfdata->size <= 24)
      cfdata->basic_size = 24;
    else if (cfdata->size <= 32)
@@ -147,6 +154,46 @@
      cfdata->layering = 2;
 }
 
+static void 
+_desk_sel_list_load(E_Config_Dialog_Data *cfdata) 
+{
+   Evas *evas;
+   int x, y;
+   
+   if (!cfdata->desk_sel_list) return;
+   evas = evas_object_evas_get(cfdata->desk_sel_list);
+   evas_event_freeze(evas);
+   edje_freeze();
+   e_widget_ilist_freeze(cfdata->desk_sel_list);
+   e_widget_ilist_clear(cfdata->desk_sel_list);
+
+   for (y = 0; y < e_config->zone_desks_y_count; y++)
+   for (x = 0; x < e_config->zone_desks_x_count; x++)
+     {
+       E_Desk *desk;
+       Evas_List *l = NULL;
+
+       desk = e_desk_at_xy_get(cfdata->es->zone, x, y);
+       e_widget_ilist_append(cfdata->desk_sel_list, NULL, desk->name, NULL, 
NULL, NULL);
+
+       for (l = cfdata->desk_list; l; l = l->next)
+           {
+              E_Config_Shelf_Desk *sd;
+
+              sd = l->data;
+              if (!sd) continue;
+              if ((sd->x != x) || (sd->y != y)) continue;
+
+              e_widget_ilist_multi_select(cfdata->desk_sel_list, 
e_widget_ilist_count(cfdata->desk_sel_list));
+              break;
+           }
+     }
+   e_widget_ilist_go(cfdata->desk_sel_list);
+   e_widget_ilist_thaw(cfdata->desk_sel_list);
+   edje_thaw();
+   evas_event_thaw(evas);
+}
+
 static void *
 _create_data(E_Config_Dialog *cfd)
 {
@@ -253,7 +300,7 @@
 _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) 
 {
    E_Zone *zone;
-   int id;
+   int id, idx, x, y;
    int restart = 0;
 
    /* Only change style is we need to */
@@ -354,6 +401,32 @@
    else if (!cfdata->escfg->autohide && cfdata->es->hidden)
      e_shelf_toggle(cfdata->es, 1);
    
+   cfdata->escfg->desk_show_mode = cfdata->desk_show_mode;
+   cfdata->escfg->desk_list = NULL;
+   if (cfdata->desk_show_mode)
+     {
+       Evas_List *l;
+       Evas_List *desk_list = NULL;
+       for (idx = 0, l = e_widget_ilist_items_get(cfdata->desk_sel_list); l; l 
= l->next, idx++)
+         {
+            E_Ilist_Item *item;
+            E_Desk *desk;
+            E_Config_Shelf_Desk *sd;
+
+            item = l->data;
+            if ((!item) || (!item->selected)) continue;
+
+            desk = e_desk_at_pos_get(cfdata->es->zone, idx);
+            if (!desk) continue;
+
+            sd = E_NEW(E_Config_Shelf_Desk, 1);
+            sd->x = desk->x;
+            sd->y = desk->y;
+            desk_list = evas_list_append(desk_list, sd);
+         }
+       cfdata->escfg->desk_list = desk_list;
+     }
+
    if (restart) 
      {
        zone = cfdata->es->zone;
@@ -371,8 +444,31 @@
        e_shelf_orient(cfdata->es, cfdata->escfg->orient);
        e_shelf_position_calc(cfdata->es);
        e_shelf_populate(cfdata->es);
-       e_shelf_show(cfdata->es);
      }
+   if (cfdata->escfg->desk_show_mode)
+     {
+       E_Desk *desk;
+       Evas_List *l;
+       int show_shelf=0;
+
+       desk = e_desk_current_get(cfdata->es->zone);
+       for (l = cfdata->escfg->desk_list; l; l = l->next)
+          {
+             E_Config_Shelf_Desk *sd;
+             sd = l->data;
+             if ((desk->x == sd->x) && (desk->y == sd->y))
+               {
+                 show_shelf=1;
+                 break;
+               }
+          }
+       if (show_shelf)
+         e_shelf_show(cfdata->es);
+       else  
+         e_shelf_hide(cfdata->es);
+     }
+   else
+     e_shelf_show(cfdata->es);
 
    e_config_save_queue();   
    cfdata->es->config_dialog = cfd;
@@ -561,6 +657,23 @@
    e_widget_framelist_object_append(of, ob);
    ob = e_widget_slider_add(evas, 1, 0, _("%.1f seconds"), 0.1, 2.0, 0.1, 0, 
&(cfdata->hide_duration), NULL, 60);
    e_widget_framelist_object_append(of, ob);
+   e_widget_list_object_append(o2, of, 1, 1, 0.5);
+
+   of = e_widget_framelist_add(evas, _("Desktop"), 0);
+   rg = e_widget_radio_group_new(&(cfdata->desk_show_mode));
+   ob = e_widget_radio_add(evas, _("Show on all Desktops"), 0, rg);
+   e_widget_framelist_object_append(of, ob);
+   ob = e_widget_radio_add(evas, _("Show on specified Desktops"), 1, rg);
+   e_widget_framelist_object_append(of, ob);
+
+   ob = e_widget_ilist_add(evas, 16, 16, NULL);
+   cfdata->desk_sel_list = ob;
+   e_widget_ilist_multi_select_set(ob, 1);
+   _desk_sel_list_load(cfdata);
+   e_widget_min_size_get(ob, &wmw, &wmh);
+   e_widget_min_size_set(ob, wmw, 64);
+   e_widget_framelist_object_append(of, ob);
+
    e_widget_list_object_append(o2, of, 1, 1, 0.5);
 
    e_widget_list_object_append(o, o2, 0, 0, 0.0);
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_shelf.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -3 -r1.69 -r1.70
--- e_shelf.c   16 Jul 2007 20:43:13 -0000      1.69
+++ e_shelf.c   4 Sep 2007 23:59:01 -0000       1.70
@@ -87,7 +87,28 @@
                  e_shelf_orient(es, cf_es->orient);
                  e_shelf_position_calc(es);
                  e_shelf_populate(es);
-                 e_shelf_show(es);
+
+                 if (cf_es->desk_show_mode)
+                   {
+                      E_Desk *desk;
+                      Evas_List *ll;
+
+                      desk = e_desk_current_get(zone);
+                      for (ll = cf_es->desk_list; ll; ll = ll->next)
+                        {
+                           E_Config_Shelf_Desk *sd;
+
+                           sd = ll->data;
+                           if ((desk->x == sd->x) && (desk->y == sd->y))
+                             {
+                                e_shelf_show(es);
+                                break;
+                             }
+                        }
+                   }
+                 else
+                   e_shelf_show(es);
+
                  e_shelf_toggle(es, 0);
               }
          }



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to