summaryrefslogtreecommitdiff
path: root/src/bin/e_bg.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-06-30 10:43:21 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-06-30 10:43:21 +0000
commit22534090d3ba9c78b605a2e428406f648bb92f28 (patch)
treebb5af35b56defa78ae36f3844890854eb8e129fd /src/bin/e_bg.c
parentc4f7be5822fad6b81097df9d63d5fb2c1614d649 (diff)
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. SVN revision: 15575
Diffstat (limited to 'src/bin/e_bg.c')
-rw-r--r--src/bin/e_bg.c90
1 files changed, 83 insertions, 7 deletions
diff --git a/src/bin/e_bg.c b/src/bin/e_bg.c
index a14a913..c849a59 100644
--- a/src/bin/e_bg.c
+++ b/src/bin/e_bg.c
@@ -13,6 +13,8 @@ void
13e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition) 13e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
14{ 14{
15 Evas_Object *o; 15 Evas_Object *o;
16 Evas_List *l;
17 int ok;
16 18
17 if (transition == E_BG_TRANSITION_START) 19 if (transition == E_BG_TRANSITION_START)
18 { 20 {
@@ -65,14 +67,32 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
65 evas_object_data_set(o, "e_zone", zone); 67 evas_object_data_set(o, "e_zone", zone);
66 evas_object_move(o, zone->x, zone->y); 68 evas_object_move(o, zone->x, zone->y);
67 evas_object_resize(o, zone->w, zone->h); 69 evas_object_resize(o, zone->w, zone->h);
68 70
69 /* FIXME: check config and look for a special bg for the current desk */ 71 ok = 0;
70 if (!edje_object_file_set(o, 72 for (l = e_config->desktop_backgrounds; l; l = l->next)
71 e_config->desktop_default_background, 73 {
72 "desktop/background")) 74 E_Config_Desktop_Background *cfbg;
75 E_Desk *desk;
76
77 cfbg = l->data;
78 if ((cfbg->container >= 0) &&
79 (zone->container->num != cfbg->container)) continue;
80 if ((cfbg->zone >= 0) &&
81 (zone->num != cfbg->zone)) continue;
82 if ((!cfbg->desk) || (strlen(cfbg->desk) == 0)) continue;
83 desk = e_desk_current_get(zone);
84 if (!desk) continue;
85 if (strcmp(cfbg->desk, desk->name)) continue;
86 ok = edje_object_file_set(o, cfbg->file,
87 "desktop/background");
88 break;
89 }
90 if (!ok)
73 { 91 {
74 e_theme_edje_object_set(o, "base/theme/background", 92 if (!edje_object_file_set(o, e_config->desktop_default_background,
75 "desktop/background"); 93 "desktop/background"))
94 e_theme_edje_object_set(o, "base/theme/background",
95 "desktop/background");
76 } 96 }
77 evas_object_layer_set(o, -1); 97 evas_object_layer_set(o, -1);
78 evas_object_lower(o); 98 evas_object_lower(o);
@@ -103,6 +123,62 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
103 } 123 }
104} 124}
105 125
126void
127e_bg_add(int container, int zone, char *desk, char *file)
128{
129 E_Config_Desktop_Background *cfbg;
130
131 e_bg_del(container, zone, desk);
132 cfbg = E_NEW(E_Config_Desktop_Background, 1);
133 cfbg->container = container;
134 cfbg->zone = zone;
135 cfbg->desk = strdup(desk);
136 cfbg->file = strdup(file);
137 e_config->desktop_backgrounds = evas_list_append(e_config->desktop_backgrounds, cfbg);
138}
139
140void
141e_bg_del(int container, int zone, char *desk)
142{
143 Evas_List *l;
144
145 for (l = e_config->desktop_backgrounds; l; l = l->next)
146 {
147 E_Config_Desktop_Background *cfbg;
148
149 cfbg = l->data;
150 if ((cfbg->container == container) && (cfbg->zone == zone) &&
151 (!strcmp(cfbg->desk, desk)))
152 {
153 e_config->desktop_backgrounds = evas_list_remove_list(e_config->desktop_backgrounds, l);
154 IF_FREE(cfbg->desk);
155 IF_FREE(cfbg->file);
156 free(cfbg);
157 break;
158 }
159 }
160}
161
162void
163e_bg_update(void)
164{
165 Evas_List *l, *ll;
166 E_Manager *man;
167 E_Container *con;
168 E_Zone *zone;
169
170 for (l = e_manager_list(); l; l = l->next)
171 {
172 man = l->data;
173 for (ll = man->containers; ll; ll = ll->next)
174 {
175 con = ll->data;
176 zone = e_zone_current_get(con);
177 e_zone_bg_reconfigure(zone);
178 }
179 }
180}
181
106/* local subsystem functions */ 182/* local subsystem functions */
107 183
108static int 184static int