Enlightenment CVS committal

Author  : raster
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_bg.c e_bg.h e_config.c e_config.h e_container.h 
        e_ipc_handlers.h e_ipc_handlers_list.h 


Log Message:


and now u can set different bg's for different desktops.. and it "just works"
(tm) currently defautt transition is a sinusiodal crossfade - it can be a bit
sluggish on big screens or slow machines. need to be able to configure that.

===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_bg.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_bg.c      29 Jun 2005 14:28:45 -0000      1.1
+++ e_bg.c      30 Jun 2005 10:43:21 -0000      1.2
@@ -13,6 +13,8 @@
 e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
 {
    Evas_Object *o;
+   Evas_List *l;
+   int ok;
 
    if (transition == E_BG_TRANSITION_START)
      {
@@ -65,14 +67,32 @@
    evas_object_data_set(o, "e_zone", zone);
    evas_object_move(o, zone->x, zone->y);
    evas_object_resize(o, zone->w, zone->h);
-   
-   /* FIXME: check config and look for a special bg for the current desk */
-   if (!edje_object_file_set(o,
-                            e_config->desktop_default_background,
-                            "desktop/background"))
+
+   ok = 0;
+   for (l = e_config->desktop_backgrounds; l; l = l->next)
      {
-       e_theme_edje_object_set(o, "base/theme/background",
-                               "desktop/background");
+       E_Config_Desktop_Background *cfbg;
+       E_Desk *desk;
+       
+       cfbg = l->data;
+       if ((cfbg->container >= 0) &&
+           (zone->container->num != cfbg->container)) continue;
+       if ((cfbg->zone >= 0) &&
+           (zone->num != cfbg->zone)) continue;
+       if ((!cfbg->desk) || (strlen(cfbg->desk) == 0)) continue;
+       desk = e_desk_current_get(zone);
+       if (!desk) continue;
+       if (strcmp(cfbg->desk, desk->name)) continue;
+       ok = edje_object_file_set(o, cfbg->file,
+                                 "desktop/background");
+       break;
+     }
+   if (!ok)
+     {
+       if (!edje_object_file_set(o, e_config->desktop_default_background,
+                                 "desktop/background"))
+         e_theme_edje_object_set(o, "base/theme/background",
+                                 "desktop/background");
      }
    evas_object_layer_set(o, -1);
    evas_object_lower(o);
@@ -103,6 +123,62 @@
      }
 }
 
+void
+e_bg_add(int container, int zone, char *desk, char *file)
+{
+   E_Config_Desktop_Background *cfbg;
+   
+   e_bg_del(container, zone, desk);
+   cfbg = E_NEW(E_Config_Desktop_Background, 1);
+   cfbg->container = container;
+   cfbg->zone = zone;
+   cfbg->desk = strdup(desk);
+   cfbg->file = strdup(file);
+   e_config->desktop_backgrounds = 
evas_list_append(e_config->desktop_backgrounds, cfbg);
+}
+
+void
+e_bg_del(int container, int zone, char *desk)
+{
+   Evas_List *l;
+   
+   for (l = e_config->desktop_backgrounds; l; l = l->next)
+     {
+       E_Config_Desktop_Background *cfbg;
+       
+       cfbg = l->data;
+       if ((cfbg->container == container) && (cfbg->zone == zone) &&
+           (!strcmp(cfbg->desk, desk)))
+         {
+            e_config->desktop_backgrounds = 
evas_list_remove_list(e_config->desktop_backgrounds, l);
+            IF_FREE(cfbg->desk);
+            IF_FREE(cfbg->file);
+            free(cfbg);
+            break;
+         }
+     }
+}
+
+void
+e_bg_update(void)
+{
+   Evas_List *l, *ll;
+   E_Manager *man;
+   E_Container *con;
+   E_Zone *zone;
+   
+   for (l = e_manager_list(); l; l = l->next)
+     {
+       man = l->data;
+       for (ll = man->containers; ll; ll = ll->next)
+         {
+            con = ll->data;
+            zone = e_zone_current_get(con);
+            e_zone_bg_reconfigure(zone);
+         }
+     }
+}
+
 /* local subsystem functions */
 
 static int
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_bg.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- e_bg.h      29 Jun 2005 14:28:45 -0000      1.1
+++ e_bg.h      30 Jun 2005 10:43:21 -0000      1.2
@@ -21,7 +21,10 @@
 #ifndef E_BG_H
 #define E_BG_H
 
-void e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition);
+EAPI void e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition);
+EAPI void e_bg_add(int container, int zone, char *desk, char *file);
+EAPI void e_bg_del(int container, int zone, char *desk);
+EAPI void e_bg_update(void);
     
 #endif
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -3 -r1.69 -r1.70
--- e_config.c  30 Jun 2005 03:25:20 -0000      1.69
+++ e_config.c  30 Jun 2005 10:43:21 -0000      1.70
@@ -32,11 +32,22 @@
 static E_Config_DD *_e_config_bindings_mouse_edd = NULL;
 static E_Config_DD *_e_config_bindings_key_edd = NULL;
 static E_Config_DD *_e_config_path_append_edd = NULL;
+static E_Config_DD *_e_config_desktop_bg_edd = NULL;
 
 /* externally accessible functions */
 int
 e_config_init(void)
 {
+   _e_config_desktop_bg_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Background", 
E_Config_Desktop_Background);
+#undef T
+#undef D
+#define T E_Config_Desktop_Background
+#define D _e_config_desktop_bg_edd
+   E_CONFIG_VAL(D, T, container, INT);
+   E_CONFIG_VAL(D, T, zone, INT);
+   E_CONFIG_VAL(D, T, desk, STR);
+   E_CONFIG_VAL(D, T, file, STR);
+   
    _e_config_path_append_edd = E_CONFIG_DD_NEW("E_Path_Dir", E_Path_Dir);
 #undef T
 #undef D
@@ -111,6 +122,7 @@
    E_CONFIG_VAL(D, T, config_version, INT); /**/
    E_CONFIG_VAL(D, T, show_splash, INT); /**/
    E_CONFIG_VAL(D, T, desktop_default_background, STR); /**/
+   E_CONFIG_LIST(D, T, desktop_backgrounds, _e_config_desktop_bg_edd);
    E_CONFIG_VAL(D, T, menus_scroll_speed, DOUBLE); /**/
    E_CONFIG_VAL(D, T, menus_fast_mouse_move_threshhold, DOUBLE); /**/
    E_CONFIG_VAL(D, T, menus_click_drag_timeout, DOUBLE); /**/
@@ -836,6 +848,11 @@
    E_CONFIG_DD_FREE(_e_config_module_edd);
    E_CONFIG_DD_FREE(_e_config_font_default_edd);
    E_CONFIG_DD_FREE(_e_config_font_fallback_edd);
+   E_CONFIG_DD_FREE(_e_config_theme_edd);
+   E_CONFIG_DD_FREE(_e_config_bindings_mouse_edd);
+   E_CONFIG_DD_FREE(_e_config_bindings_key_edd);
+   E_CONFIG_DD_FREE(_e_config_path_append_edd);
+   E_CONFIG_DD_FREE(_e_config_desktop_bg_edd);
    return 1;
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- e_config.h  29 Jun 2005 14:28:46 -0000      1.35
+++ e_config.h  30 Jun 2005 10:43:21 -0000      1.36
@@ -31,12 +31,13 @@
 
 #define E_CONFIG_LIMIT(v, min, max) {if (v > max) v = max; else if (v < min) v 
= min;}
 
-typedef struct _E_Config                E_Config;
-typedef struct _E_Config_Module         E_Config_Module;
-typedef struct _E_Config_Theme          E_Config_Theme;
-typedef struct _E_Config_Binding_Mouse  E_Config_Binding_Mouse;
-typedef struct _E_Config_Binding_Key    E_Config_Binding_Key;
-typedef Eet_Data_Descriptor             E_Config_DD;
+typedef struct _E_Config                    E_Config;
+typedef struct _E_Config_Module             E_Config_Module;
+typedef struct _E_Config_Theme              E_Config_Theme;
+typedef struct _E_Config_Binding_Mouse      E_Config_Binding_Mouse;
+typedef struct _E_Config_Binding_Key        E_Config_Binding_Key;
+typedef struct _E_Config_Desktop_Background E_Config_Desktop_Background;
+typedef Eet_Data_Descriptor                 E_Config_DD;
 
 #else
 #ifndef E_CONFIG_H
@@ -57,6 +58,7 @@
    int         config_version;
    int         show_splash;
    char       *desktop_default_background;
+   Evas_List  *desktop_backgrounds;
    double      menus_scroll_speed;
    double      menus_fast_mouse_move_threshhold;
    double      menus_click_drag_timeout;
@@ -169,6 +171,14 @@
    unsigned char  any_mod;
 };
 
+struct _E_Config_Desktop_Background
+{
+   int            container;
+   int            zone;
+   char          *desk;
+   char          *file;
+};
+
 EAPI int e_config_init(void);
 EAPI int e_config_shutdown(void);
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_container.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- e_container.h       18 Jun 2005 13:03:00 -0000      1.25
+++ e_container.h       30 Jun 2005 10:43:21 -0000      1.26
@@ -50,8 +50,8 @@
    Evas_List           *zones;
 
    struct {
-       Ecore_X_Window win;
-       Evas_List *clients;
+      Ecore_X_Window win;
+      Evas_List *clients;
    } layers[7];
 };
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- e_ipc_handlers.h    30 Jun 2005 03:25:20 -0000      1.44
+++ e_ipc_handlers.h    30 Jun 2005 10:43:21 -0000      1.45
@@ -709,20 +709,9 @@
    REQ_STRING(params[0], HDL);
 #elif (TYPE == E_WM_IN)
    STRING(s, HDL);
-   Evas_List *l, *ll;
-   E_Manager *man;
-   E_Container *con;
-   E_Zone *zone;
    E_FREE(e_config->desktop_default_background);
    e_config->desktop_default_background = strdup(s);
-   for (l = e_manager_list(); l; l = l->next) {
-      man = l->data;
-      for (ll = man->containers; ll; ll = ll->next) {  
-        con = ll->data;
-        zone = e_zone_current_get(con);
-        e_zone_bg_reconfigure(zone);
-      }
-   }
+   e_bg_update();
    SAVE;
    END_STRING(s);
 #elif (TYPE == E_REMOTE_IN)
@@ -2853,6 +2842,72 @@
 #undef HDL
 
 /****************************************************************************/
+#define HDL E_IPC_OP_DESKTOP_BG_ADD
+#if (TYPE == E_REMOTE_OPTIONS)
+   OP("-desktop-bg-add", 4, "Add a desktop bg definition. OPT1 = container no. 
OPT2 = zone no. OPT3 = desktop name OPT4 = bg file path", 0, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+   REQ_3INT_3STRING_START(HDL);
+   REQ_3INT_3STRING_END(atoi(params[0]), atoi(params[1]), 0, params[2], 
params[3], "", HDL);
+#elif (TYPE == E_WM_IN)
+   INT3_STRING3(v, HDL);
+   e_bg_add(v->val1, v->val2, v->str1, v->str2);
+   e_bg_update();
+   SAVE;
+   END_INT3_STRING3(v);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_DESKTOP_BG_DEL
+#if (TYPE == E_REMOTE_OPTIONS)
+   OP("-desktop-bg-del", 3, "Delete a desktop bg definition. OPT1 = container 
no. OPT2 = zone no. OPT3 = desktop name", 0, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+   REQ_3INT_3STRING_START(HDL);
+   REQ_3INT_3STRING_END(atoi(params[0]), atoi(params[1]), 0, params[2], "", 
"", HDL);
+#elif (TYPE == E_WM_IN)
+   INT3_STRING3(v, HDL);
+   e_bg_del(v->val1, v->val2, v->str1);
+   e_bg_update();
+   SAVE;
+   END_INT3_STRING3(v);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_DESKTOP_BG_LIST
+#if (TYPE == E_REMOTE_OPTIONS)
+   OP("-desktop-bg-list", 0, "List all current desktop bg definitions", 1, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+   REQ_NULL(HDL);
+#elif (TYPE == E_WM_IN)
+   SEND_INT3_STRING3_LIST(e_config->desktop_backgrounds, 
E_Config_Desktop_Background, cfbg, v, HDL);
+   v->val1 = cfbg->container;
+   v->val2 = cfbg->zone;
+   v->val3 = 0;
+   v->str1 = cfbg->desk;
+   v->str2 = cfbg->file;
+   v->str3 = "";
+   END_SEND_INT3_STRING3_LIST(v, E_IPC_OP_DESKTOP_BG_LIST_REPLY);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_DESKTOP_BG_LIST_REPLY
+#if (TYPE == E_REMOTE_OPTIONS)
+#elif (TYPE == E_REMOTE_OUT)
+#elif (TYPE == E_WM_IN)
+#elif (TYPE == E_REMOTE_IN)
+   INT3_STRING3_LIST(v, HDL);
+   printf("REPLY: BG CONTAINER=%i ZONE=%i DESK=\"%s\" FILE=\"%s\"\n",
+         v->val1, v->val2, v->str1, v->str2);
+   END_INT3_STRING3_LIST(v);
+#endif
+#undef HDL
+
+/****************************************************************************/
 
 #if 0
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers_list.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- e_ipc_handlers_list.h       30 Jun 2005 03:25:20 -0000      1.5
+++ e_ipc_handlers_list.h       30 Jun 2005 10:43:21 -0000      1.6
@@ -111,4 +111,7 @@
 #define E_IPC_OP_GADGET_RESIST_SET 111
 #define E_IPC_OP_GADGET_RESIST_GET 112
 #define E_IPC_OP_GADGET_RESIST_GET_REPLY 113
-
+#define E_IPC_OP_DESKTOP_BG_ADD 114
+#define E_IPC_OP_DESKTOP_BG_DEL 115
+#define E_IPC_OP_DESKTOP_BG_LIST 116
+#define E_IPC_OP_DESKTOP_BG_LIST_REPLY 117




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to