summaryrefslogtreecommitdiff
path: root/src/bin/e_bg.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2011-08-11 10:39:37 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-08-11 10:39:37 +0000
commit28d60493194c5f7aa9df6b57a8277d619b471d44 (patch)
treea9bd9a22d2ad72aec44b49ed82a1624b94737fbe /src/bin/e_bg.c
parentaea6b1e70ba3cd1aa62de35e74941224021cd595 (diff)
... allow non edj files as wallpapers... if u try. :)
SVN revision: 62340
Diffstat (limited to 'src/bin/e_bg.c')
-rw-r--r--src/bin/e_bg.c89
1 files changed, 59 insertions, 30 deletions
diff --git a/src/bin/e_bg.c b/src/bin/e_bg.c
index 8e96eae..197560d 100644
--- a/src/bin/e_bg.c
+++ b/src/bin/e_bg.c
@@ -118,7 +118,8 @@ e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y)
118 EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg) 118 EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cfbg)
119 { 119 {
120 int spec; 120 int spec;
121 121 const char *ext;
122
122 if (!cfbg) continue; 123 if (!cfbg) continue;
123 spec = 0; 124 spec = 0;
124 if (cfbg->container == container_num) spec++; 125 if (cfbg->container == container_num) spec++;
@@ -142,19 +143,28 @@ e_bg_config_get(int container_num, int zone_num, int desk_x, int desk_y)
142 if (bf) bgfile = bf; 143 if (bf) bgfile = bf;
143 } 144 }
144 } 145 }
145 entries = edje_file_collection_list(bgfile); 146 ext = strrchr(bgfile, '.');
146 if (entries) 147 if ((ext) && (!strcasecmp(ext, ".edj")))
147 { 148 {
148 EINA_LIST_FOREACH(entries, ll, entry) 149 entries = edje_file_collection_list(bgfile);
149 { 150 if (entries)
150 if (!strcmp(entry, "e/desktop/background")) 151 {
151 { 152 EINA_LIST_FOREACH(entries, ll, entry)
152 bg = cfbg; 153 {
153 current_spec = spec; 154 if (!strcmp(entry, "e/desktop/background"))
154 } 155 {
155 } 156 bg = cfbg;
156 edje_file_collection_list_free(entries); 157 current_spec = spec;
157 } 158 }
159 }
160 edje_file_collection_list_free(entries);
161 }
162 }
163 else
164 {
165 bg = cfbg;
166 current_spec = spec;
167 }
158 } 168 }
159 } 169 }
160 return bg; 170 return bg;
@@ -188,6 +198,8 @@ e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y)
188 } 198 }
189 else 199 else
190 { 200 {
201 const char *ext;
202
191 bgfile = e_config->desktop_default_background; 203 bgfile = e_config->desktop_default_background;
192 if (bgfile) 204 if (bgfile)
193 { 205 {
@@ -199,19 +211,24 @@ e_bg_file_get(int container_num, int zone_num, int desk_x, int desk_y)
199 if (bf) bgfile = bf; 211 if (bf) bgfile = bf;
200 } 212 }
201 } 213 }
202 entries = edje_file_collection_list(bgfile); 214 ext = strrchr(bgfile, '.');
203 if (entries) 215 if ((ext) && (!strcasecmp(ext, ".edj")))
204 { 216 {
205 EINA_LIST_FOREACH(entries, l, entry) 217 entries = edje_file_collection_list(bgfile);
206 { 218 if (entries)
207 if (!strcmp(entry, "e/desktop/background")) 219 {
208 { 220 EINA_LIST_FOREACH(entries, l, entry)
209 ok = 1; 221 {
210 break; 222 if (!strcmp(entry, "e/desktop/background"))
211 } 223 {
212 } 224 ok = 1;
213 edje_file_collection_list_free(entries); 225 break;
214 } 226 }
227 }
228 edje_file_collection_list_free(entries);
229 }
230 }
231 else ok = 1;
215 if (!ok) 232 if (!ok)
216 bgfile = e_theme_edje_file_get("base/theme/background", 233 bgfile = e_theme_edje_file_get("base/theme/background",
217 "e/desktop/background"); 234 "e/desktop/background");
@@ -226,6 +243,7 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
226 Evas_Object *o; 243 Evas_Object *o;
227 const char *bgfile = ""; 244 const char *bgfile = "";
228 const char *trans = ""; 245 const char *trans = "";
246 const char *ext;
229 E_Desk *desk; 247 E_Desk *desk;
230 248
231 if (transition == E_BG_TRANSITION_START) trans = e_config->transition_start; 249 if (transition == E_BG_TRANSITION_START) trans = e_config->transition_start;
@@ -283,10 +301,21 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
283 evas_object_clip_set(o, zone->bg_clip_object); 301 evas_object_clip_set(o, zone->bg_clip_object);
284 evas_object_show(o); 302 evas_object_show(o);
285 } 303 }
286 o = edje_object_add(zone->container->bg_evas); 304 ext = strrchr(bgfile, '.');
305 if ((ext) && (!strcasecmp(ext, ".edj")))
306 {
307 o = edje_object_add(zone->container->bg_evas);
308 evas_object_data_set(o, "e_zone", zone);
309 edje_object_file_set(o, bgfile, "e/desktop/background");
310 }
311 else
312 {
313 o = e_icon_add(zone->container->bg_evas);
314 evas_object_data_set(o, "e_zone", zone);
315 e_icon_file_key_set(o, bgfile, NULL);
316 e_icon_fill_inside_set(o, 0);
317 }
287 zone->bg_object = o; 318 zone->bg_object = o;
288 evas_object_data_set(o, "e_zone", zone);
289 edje_object_file_set(o, bgfile, "e/desktop/background");
290 if (transition == E_BG_TRANSITION_NONE) 319 if (transition == E_BG_TRANSITION_NONE)
291 { 320 {
292 evas_object_move(o, zone->x, zone->y); 321 evas_object_move(o, zone->x, zone->y);