summaryrefslogtreecommitdiff
path: root/src/bin/e_bg.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-02-04 23:59:22 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-02-05 18:35:49 +0900
commitbe1b11ca28dbaeaaab4fd8f308ec31029d104397 (patch)
treebc9f589311c7cfbad59b05ae25339712c61f250c /src/bin/e_bg.c
parent26a7ba3a58d573121b1dfbbca9f72988ecd8a891 (diff)
e - video bgs - allow selection of video files for wallpapers
this allows video files to be played for wapapers - they loop and run indefinitely. it is a special video object that shares the same source across all outputs, so if you have the same video set, on 2 screens (or desktops) then it's only decoded once and uses proxies to ducplicate. this works in the pager too (it uses proxies). this is for amusement and fun and ... because we can. :)
Diffstat (limited to 'src/bin/e_bg.c')
-rw-r--r--src/bin/e_bg.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/bin/e_bg.c b/src/bin/e_bg.c
index 8775e76..4f47255 100644
--- a/src/bin/e_bg.c
+++ b/src/bin/e_bg.c
@@ -196,6 +196,8 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
196 const char *trans = ""; 196 const char *trans = "";
197 E_Desk *desk; 197 E_Desk *desk;
198 198
199 printf("UP %p trans %i\n", zone, transition);
200
199 if (transition == E_BG_TRANSITION_START) trans = e_config->transition_start; 201 if (transition == E_BG_TRANSITION_START) trans = e_config->transition_start;
200 else if (transition == E_BG_TRANSITION_DESK) 202 else if (transition == E_BG_TRANSITION_DESK)
201 trans = e_config->transition_desk; 203 trans = e_config->transition_desk;
@@ -211,10 +213,15 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
211 213
212 if (zone->bg_object) 214 if (zone->bg_object)
213 { 215 {
214 const char *pfile = ""; 216 const char *pfile = NULL;
215 217
216 edje_object_file_get(zone->bg_object, &pfile, NULL); 218 edje_object_file_get(zone->bg_object, &pfile, NULL);
217 if (!e_util_strcmp(pfile, bgfile)) goto end; 219 if (!pfile) e_icon_file_get(zone->bg_object, &pfile, NULL);
220 if (!pfile) pfile = e_video_file_get(zone->bg_object);
221 if (pfile)
222 {
223 if (!e_util_strcmp(pfile, bgfile)) goto end;
224 }
218 } 225 }
219 226
220 if (transition == E_BG_TRANSITION_NONE) 227 if (transition == E_BG_TRANSITION_NONE)
@@ -252,12 +259,20 @@ e_bg_zone_update(E_Zone *zone, E_Bg_Transition transition)
252 if (edje_object_data_get(o, "noanimation")) 259 if (edje_object_data_get(o, "noanimation"))
253 edje_object_animation_set(o, EINA_FALSE); 260 edje_object_animation_set(o, EINA_FALSE);
254 } 261 }
255 else 262 else if ((eina_str_has_extension(bgfile, ".gif")) ||
263 (eina_str_has_extension(bgfile, ".png")) ||
264 (eina_str_has_extension(bgfile, ".jpg")) ||
265 (eina_str_has_extension(bgfile, ".jpeg")) ||
266 (eina_str_has_extension(bgfile, ".bmp")))
256 { 267 {
257 o = e_icon_add(e_comp->evas); 268 o = e_icon_add(e_comp->evas);
258 e_icon_file_key_set(o, bgfile, NULL); 269 e_icon_file_key_set(o, bgfile, NULL);
259 e_icon_fill_inside_set(o, 0); 270 e_icon_fill_inside_set(o, 0);
260 } 271 }
272 else
273 {
274 o = e_video_add(e_comp->evas, bgfile, EINA_FALSE);
275 }
261 evas_object_data_set(o, "e_zone", zone); 276 evas_object_data_set(o, "e_zone", zone);
262 evas_object_repeat_events_set(o, 1); 277 evas_object_repeat_events_set(o, 1);
263 zone->bg_object = o; 278 zone->bg_object = o;