next step for MPLAYER
[livewp] / applet / src / livewp-scene.c
1 /*vim: set sw=4 ts=4 et: */
2 /*
3  * This file is part of Live Wallpaper (livewp)
4  * 
5  * Copyright (C) 2010 Vlad Vasiliev
6  * Copyright (C) 2010 Tanya Makova
7  *       for the code
8  * 
9  * This software is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; either version 2.1 of
12  * the License, or (at your option) any later version.
13  * 
14  * This software is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  * 
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this software; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22  * 02110-1301 USA
23 */
24 /*******************************************************************************/
25 #include "livewp-scene.h" 
26
27 void 
28 destroy_scene(AWallpaperPlugin *desktop_plugin)
29 {
30     if (desktop_plugin->priv->scene){
31             GSList * tmp = desktop_plugin->priv->scene->actors;
32             while (tmp != NULL){
33                 destroy_actor(tmp->data);
34                 tmp = g_slist_next(tmp);
35             }
36             if (tmp)
37                 g_slist_free(tmp);
38             desktop_plugin->priv->scene->actors = NULL;
39             if (desktop_plugin->priv->scene){
40                 g_free(desktop_plugin->priv->scene);
41                 desktop_plugin->priv->scene = NULL;
42             }
43     }
44 }
45
46 void
47 reload_scene(AWallpaperPlugin *desktop_plugin)
48 {
49     fprintf(stderr,"Reload scene %s\n", desktop_plugin->priv->theme);  
50     destroy_scene(desktop_plugin);
51     init_scene_theme(desktop_plugin);
52 }
53
54 void  
55 parsestring(char *line, char **argv)
56 {
57    while (*line != '\0') {  
58           while (*line == ' ' || *line == '\n')
59                 *line++ = '\0';     /* replace white spaces with 0    */
60                  *argv++ = line;          /* save the argument position     */
61                  while (*line != '\0' && *line != ' ' && 
62                         *line != '\n') 
63                      line++;             /* skip the argument until ...    */
64    }
65                   *argv = '\0';                 /* mark the end of argument list  */
66 }
67
68 void
69 init_scene_Mplayer(AWallpaperPlugin *desktop_plugin)
70 {
71     fprintf(stderr,"init_scene_Mplayer\n");
72     char* child_argv[128];
73     char *run_string = NULL;
74
75     fprintf(stderr, "PARAMETR %s\n",  desktop_plugin->priv->theme_string_parametr1);
76     run_string = g_strdup_printf("/usr/bin/mplayer -vo x11 -wid %d %s\n", \
77                                  GDK_WINDOW_XID(desktop_plugin->priv->window->window), desktop_plugin->priv->theme_string_parametr1);
78     parsestring(run_string, child_argv);
79
80     desktop_plugin->priv->podpid = fork();
81     if (desktop_plugin->priv->podpid == 0){
82         execvp("/usr/bin/mplayer", child_argv);
83         fprintf(stderr,"Problem with new podprocess");
84     }
85     g_free(run_string);
86
87 }
88
89 void
90 init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
91 {
92   Actor *actor;
93   Scene *scene;
94   GPtrArray *child;
95   gint now = time(NULL);
96   gint y1, y2;
97
98   if (desktop_plugin->priv->rich_animation){
99       y1 = -480;
100       y2 = -480-480;
101   }else {
102       y1 = 0;
103       y2 = -480;
104   }
105
106   /* fprintf(stderr, "init scene2 \n"); */
107   scene = g_new0(Scene, 1);
108   //scene.daytime = get_daytime();
109   scene->actors = NULL;
110   desktop_plugin->priv->scene = scene;
111   
112   actor = init_object(desktop_plugin, "background", "bg.png", 
113                       0, 0, 5, 800, 480, 
114                       TRUE, TRUE, 100, 255, 
115                       NULL, NULL, NULL);
116   scene->actors = g_slist_append(scene->actors, actor);
117
118   actor = init_object(desktop_plugin, "symbols", "symbols.png", 
119                       0, 0, 10, 800, 480, 
120                       TRUE, TRUE, 100, 255, 
121                       NULL, NULL, NULL);
122   scene->actors = g_slist_append(scene->actors, actor);
123
124   child = g_ptr_array_sized_new(4);
125   actor = init_object(desktop_plugin, "layer1", "layer1_2.png", 
126                       0, y1, 6, 800, 960, 
127                       TRUE, TRUE, 100, 255, 
128                       NULL, NULL, NULL);
129   //actor->time_start_animation = now;
130   //actor->duration_animation = G_MAXINT;
131   scene->actors = g_slist_append(scene->actors, actor);
132   g_ptr_array_add(child, actor);
133
134   actor = init_object(desktop_plugin, "layer1", "layer1_1.png", 
135                       0, y2, 7, 800, 960, 
136                       TRUE, TRUE, 100, 255, 
137                       NULL, NULL, NULL);
138   //actor->time_start_animation = now;
139   //actor->duration_animation = G_MAXINT;
140   scene->actors = g_slist_append(scene->actors, actor);
141   g_ptr_array_add(child, actor);
142
143   actor = init_object(desktop_plugin, "layer2", "layer2_2.png", 
144                       0, y1, 8, 800, 960, 
145                       TRUE, TRUE, 100, 255, 
146                       NULL, NULL, NULL);
147   //actor->time_start_animation = now;
148   //actor->duration_animation = G_MAXINT;
149   scene->actors = g_slist_append(scene->actors, actor);
150   g_ptr_array_add(child, actor);
151
152   actor = init_object(desktop_plugin, "layer2", "layer2_1.png", 
153                       0, y2, 9, 800, 960, 
154                       TRUE, TRUE, 100, 255, 
155                       NULL, NULL, NULL);
156   //actor->time_start_animation = now;
157   //actor->duration_animation = G_MAXINT;
158   scene->actors = g_slist_append(scene->actors, actor);
159   g_ptr_array_add(child, actor);
160
161   actor = init_object(desktop_plugin, "layers", "", 
162                       0, y2, 9, 800, 960, 
163                       FALSE, FALSE, 100, 255, 
164                       (gpointer)&change_layer, NULL, child);
165   actor->time_start_animation = now;
166   actor->duration_animation = G_MAXINT;
167   scene->actors = g_slist_append(scene->actors, actor);
168
169   run_long_timeout(desktop_plugin);
170
171 }
172
173 /* Init Modern Scene */
174 void
175 init_scene_Modern(AWallpaperPlugin *desktop_plugin)
176 {
177   Actor *actor;
178   Scene *scene;
179   gint now = time(NULL);
180   gint i;
181   gint winds[13][2];
182   GPtrArray *child; 
183
184   /* fprintf(stderr, "init scene \n"); */
185   scene = g_new0(Scene, 1);
186   scene->daytime = get_daytime();
187   scene->actors = NULL;
188   scene->wind_orientation = -1;
189   scene->wind_angle = 0.3;
190   /* init value for random */
191   scene->seed = time(NULL);
192   scene->notification = TRUE;
193   desktop_plugin->priv->scene = scene;
194   actor = init_object(desktop_plugin, "sky", "sky0.png", 
195                       0, 0, 5, 800, 480, 
196                       TRUE , TRUE, 100, 255, 
197                       (gpointer)&change_static_actor, NULL, NULL);
198   scene->actors = g_slist_append(scene->actors, actor);
199   change_static_actor(actor, desktop_plugin);
200   
201   actor = init_object(desktop_plugin, "sun", "sun.png", 
202                       0, 0, 6, 88, 88, 
203                       FALSE, FALSE, 100, 255, 
204                       (gpointer)&change_sun, NULL, NULL);
205   actor->time_start_animation = now;
206   actor->duration_animation = G_MAXINT;
207   change_sun(actor, desktop_plugin);
208   scene->actors = g_slist_append(scene->actors, actor);
209
210   //actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50, 
211     //                  TRUE, 100, 255, NULL, NULL);
212   //scene.actors = g_slist_append(scene.actors, actor);
213   
214   actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 
215                       0, fast_rnd(300)-97, 7, 150, 97, 
216                       FALSE, FALSE, 100, 255, 
217                       (gpointer)&change_cloud, NULL, NULL);
218   actor->time_start_animation = now + fast_rnd(20);
219   actor->duration_animation = 3*60;
220   scene->actors = g_slist_append(scene->actors, actor);
221   
222   actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 
223                       0, fast_rnd(300)-75, 7, 188, 75, 
224                       FALSE, FALSE, 100, 255, 
225                       (gpointer)&change_cloud, NULL, NULL);
226   actor->time_start_animation = now + fast_rnd(40)+10;
227   actor->duration_animation = 3*60;
228   scene->actors = g_slist_append(scene->actors, actor);
229
230   actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 
231                       0, fast_rnd(300)-75, 7, 150, 75, 
232                       FALSE, FALSE, 100, 255, 
233                       (gpointer)&change_cloud, NULL, NULL);
234   actor->time_start_animation = now + fast_rnd(60) + 20;
235   actor->duration_animation = 5*60;
236   scene->actors = g_slist_append(scene->actors, actor);
237
238
239   actor = init_object(desktop_plugin, "town", "town0.png", 
240                       0, 0, 8, 800, 480, 
241                       TRUE, TRUE, 100, 255, 
242                       (gpointer)&change_static_actor, NULL, NULL);
243   change_static_actor(actor, desktop_plugin);
244   scene->actors = g_slist_append(scene->actors, actor);
245
246   actor = init_object(desktop_plugin, "stend", "stend0.png", 
247                       452, 166, 9, 300, 305, 
248                       TRUE, TRUE, 100, 255, 
249                       (gpointer)&change_static_actor, NULL, NULL);
250   change_static_actor(actor, desktop_plugin);
251   scene->actors = g_slist_append(scene->actors, actor);
252
253
254   child = g_ptr_array_sized_new(4);
255   actor = init_object(desktop_plugin, "call", "call.png", 
256                       480, 190, 9, 50, 58, 
257                       FALSE, TRUE, 100, 255, 
258                       NULL, NULL, NULL);
259   scene->actors = g_slist_append(scene->actors, actor);
260   g_ptr_array_add(child, actor);
261
262   actor = init_object(desktop_plugin, "chat", "chat.png", 
263                       540, 190, 9, 50, 58, 
264                       FALSE, TRUE, 100, 255, 
265                       NULL, NULL, NULL);
266   scene->actors = g_slist_append(scene->actors, actor);
267   g_ptr_array_add(child, actor);
268
269   actor = init_object(desktop_plugin, "mail", "mail.png", 
270                       600, 190, 9, 50, 58, 
271                       FALSE, TRUE, 100, 255, 
272                       NULL, NULL, NULL);
273   scene->actors = g_slist_append(scene->actors, actor);
274   g_ptr_array_add(child, actor);
275   
276   actor = init_object(desktop_plugin, "sms", "sms.png", 
277                       660, 190, 9, 50, 58, 
278                       FALSE, TRUE, 100, 255, 
279                       NULL, NULL, NULL);
280   scene->actors = g_slist_append(scene->actors, actor);
281   g_ptr_array_add(child, actor);
282
283   actor = init_object(desktop_plugin, "billboard_text", "",
284                       470, 174, 9, 300, 108,
285                       FALSE, FALSE, 100, 255,
286                       (gpointer)&change_billboard, NULL, child);
287   create_hildon_actor_text(actor, desktop_plugin);
288   //actor->time_start_animation = time(NULL) + 20;
289   change_billboard(actor, desktop_plugin);
290   scene->actors = g_slist_append(scene->actors, actor);
291
292   actor = init_object(desktop_plugin, "tram", "tram.png", 
293                       -300, 225, 10, 350, 210, 
294                       FALSE, FALSE, 100, 255, 
295                       (gpointer)&change_tram, NULL, NULL);
296   actor->time_start_animation = time(NULL) + fast_rnd(10); 
297   actor->duration_animation = 60;
298   scene->actors = g_slist_append(scene->actors, actor);
299
300   actor = init_object(desktop_plugin, "border", "border0.png", 
301                       0, 480-79, 11, 800, 79,
302                       TRUE, TRUE, 100, 255, 
303                       (gpointer)&change_static_actor_with_corner, NULL, NULL);
304   change_static_actor_with_corner(actor, desktop_plugin);
305   scene->actors = g_slist_append(scene->actors, actor);
306   
307   actor = init_object(desktop_plugin, "moon", "moon1.png", 
308                       400, 20, 6, 60, 60, 
309                       FALSE, FALSE, 100, 255, 
310                       (gpointer)&change_moon, NULL, NULL);
311   change_moon(actor, desktop_plugin);
312   scene->actors = g_slist_append(scene->actors, actor);
313
314   actor = init_object(desktop_plugin, "wind", "", 
315                       0, 0, 5, 0, 0, 
316                       FALSE, FALSE, 100, 255, 
317                       (gpointer)&change_wind, NULL, NULL);
318   change_wind(actor, desktop_plugin);
319   scene->actors = g_slist_append(scene->actors, actor);
320
321     /* windows in 4-th house  */
322
323     winds[0][0] = 482;
324     winds[0][1] = 180;
325
326     winds[1][0] = 495;
327     winds[1][1] = 179;
328
329     winds[2][0] = 482;
330     winds[2][1] = 191;
331
332     winds[3][0] = 495;
333     winds[3][1] = 190;
334     
335     winds[4][0] = 482;
336     winds[4][1] = 201;
337     
338     winds[5][0] = 495;
339     winds[5][1] = 210;
340     
341     winds[6][0] = 482;
342     winds[6][1] = 222;
343     
344     winds[7][0] = 495;
345     winds[7][1] = 221;
346     
347     winds[8][0] = 459;
348     winds[8][1] = 203;
349     
350     winds[9][0] = 495;
351     winds[9][1] = 241;
352     
353     winds[10][0] = 495;
354     winds[10][1] = 252;
355     
356     winds[11][0] = 482;
357     winds[11][1] = 273;
358     
359     winds[12][0] = 495;
360     winds[12][1] = 303;
361     for (i=0; i<13; i++){
362         actor = init_object(desktop_plugin, "window1", "window1.png", 
363                             winds[i][0], winds[i][1], 8, 8, 10, 
364                             FALSE, FALSE, 100, 255, 
365                             (gpointer)&change_window1, NULL, NULL);
366         //change_window1(actor, desktop_plugin);
367         actor->time_start_animation = now + fast_rnd(30);
368         scene->actors = g_slist_append(scene->actors, actor);
369
370     }
371     
372     /* windows in 1-th house  */
373     
374     winds[0][0] = 86;
375     winds[0][1] = 321;
376
377     winds[1][0] = 86;
378     winds[1][1] = 363;
379
380     winds[2][0] = 86;
381     winds[2][1] = 385;
382
383     winds[3][0] = 86;
384     winds[3][1] = 286;
385     
386     winds[4][0] = 94;
387     winds[4][1] = 232;
388     
389     winds[5][0] = 94;
390     winds[5][1] = 243;
391     
392     winds[6][0] = 94;
393     winds[6][1] = 265;
394     
395     winds[7][0] = 94;
396     winds[7][1] = 331;
397     for (i=0; i<8; i++){
398         actor = init_object(desktop_plugin, "window2", "window2.png", 
399                             winds[i][0], winds[i][1], 8, 8, 10, 
400                             FALSE, FALSE, 100, 255, 
401                             (gpointer)&change_window1, NULL, NULL);
402         //change_window1(actor, desktop_plugin);
403         actor->time_start_animation = now + fast_rnd(30);
404         scene->actors = g_slist_append(scene->actors, actor);
405
406     }
407     
408     /* windows in 3-th house  */
409     
410     winds[0][0] = 251;
411     winds[0][1] = 162;
412
413     winds[1][0] = 251;
414     winds[1][1] = 196;
415
416     winds[2][0] = 251;
417     winds[2][1] = 278;
418
419     winds[3][0] = 251;
420     winds[3][1] = 289;
421     
422     winds[4][0] = 313;
423     winds[4][1] = 173;
424     
425     winds[5][0] = 322;
426     winds[5][1] = 160;
427     
428     winds[6][0] = 303;
429     winds[6][1] = 217;
430     
431     winds[7][0] = 322;
432     winds[7][1] = 224;
433     
434     winds[8][0] = 323;
435     winds[8][1] = 217;
436     
437     winds[9][0] = 322;
438     winds[9][1] = 288;
439     
440     for (i=0; i<10; i++){
441         actor = init_object(desktop_plugin, "window3", "window3.png", 
442                             winds[i][0], winds[i][1], 8, 8, 10, 
443                             FALSE, FALSE, 100, 255, 
444                             (gpointer)&change_window1, NULL, NULL);
445         //change_window1(actor, desktop_plugin);
446         actor->time_start_animation = now + fast_rnd(30);
447         scene->actors = g_slist_append(scene->actors, actor);
448
449     }
450
451     /* windows in 5-th house  */
452     
453     winds[0][0] = 610;
454     winds[0][1] = 224;
455
456     winds[1][0] = 602;
457     winds[1][1] = 245;
458
459     winds[2][0] = 602;
460     winds[2][1] = 264;
461
462     winds[3][0] = 610;
463     winds[3][1] = 301;
464     
465     winds[4][0] = 610;
466     winds[4][1] = 320;
467     
468     winds[5][0] = 593;
469     winds[5][1] = 352;
470     
471     winds[6][0] = 610;
472     winds[6][1] = 368;
473     
474     for (i=0; i<7; i++){
475         actor = init_object(desktop_plugin, "window4", "window4.png", 
476                             winds[i][0], winds[i][1], 8, 8, 10, 
477                             FALSE, FALSE, 100, 255, 
478                             (gpointer)&change_window1, NULL, NULL);
479         //change_window1(actor, desktop_plugin);
480         actor->time_start_animation = now + fast_rnd(30);
481         scene->actors = g_slist_append(scene->actors, actor);
482
483     }
484
485     /* windows in 6-th house  */
486     
487     winds[0][0] = 717;
488     winds[0][1] = 283;
489
490     winds[1][0] = 698;
491     winds[1][1] = 293;
492
493     winds[2][0] = 717;
494     winds[2][1] = 315;
495
496     winds[3][0] = 717;
497     winds[3][1] = 323;
498     
499     winds[4][0] = 698;
500     winds[4][1] = 362;
501     
502     winds[5][0] = 698;
503     winds[5][1] = 400;
504     
505     for (i=0; i<6; i++){
506         actor = init_object(desktop_plugin, "window5", "window5.png", 
507                             winds[i][0], winds[i][1], 8, 8, 10, 
508                             FALSE, FALSE, 100, 255, 
509                             (gpointer)&change_window1, NULL, NULL);
510         //change_window1(actor, desktop_plugin);
511         actor->time_start_animation = now + fast_rnd(30);
512         scene->actors = g_slist_append(scene->actors, actor);
513
514     }
515     run_long_timeout(desktop_plugin);
516
517 #if 0    
518   anim = g_new0(Animation, 1);
519   anim->count = 1;
520   anim->actor = actor;
521   anim->func_change = &change_tram;
522   anim->func_time = NULL;
523   anim->timestart = time(NULL); 
524   anim->timeall = 10;
525   
526   scene.dynamic_actors = g_slist_append(scene.dynamic_actors, anim);
527 #endif  
528 }
529
530 /* Init Berlin Scene */
531 void
532 init_scene_Berlin(AWallpaperPlugin *desktop_plugin)
533 {
534   Actor *actor, *actor1, *actor2;
535   Scene *scene;
536   gint now = time(NULL);
537   gint i; 
538   gint winds[13][2];
539   GPtrArray *child = NULL;
540
541   scene = g_new0(Scene, 1);
542   scene->daytime = get_daytime();
543   scene->actors = NULL;
544   scene->wind_orientation = -1;
545   scene->wind_angle = 0.3;
546   /* init value for random */
547   scene->seed = time(NULL);
548   desktop_plugin->priv->scene = scene;
549   
550   actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480, 
551                       TRUE, TRUE, 100, 255, 
552                       (gpointer)&change_static_actor, NULL, NULL);
553   change_static_actor(actor, desktop_plugin);
554   scene->actors = g_slist_append(scene->actors, actor);
555
556   
557   actor = init_object(desktop_plugin, "sun", "sun.png", 0, 0, 6, 88, 88, 
558                       FALSE, FALSE, 100, 255, 
559                       (gpointer)&change_sun, NULL, NULL);
560   actor->time_start_animation = time(NULL);
561   actor->duration_animation = G_MAXINT;
562   change_sun(actor, desktop_plugin);
563   scene->actors = g_slist_append(scene->actors, actor);
564
565 #if 0
566   actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50, 
567                       TRUE, 100, 255, NULL, NULL);
568   scene.actors = g_slist_append(scene.actors, actor);
569 #endif
570
571   actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60, 
572                       FALSE, FALSE, 100, 255, 
573                       (gpointer)&change_moon, NULL, NULL);
574   change_moon(actor, desktop_plugin);
575   scene->actors = g_slist_append(scene->actors, actor);
576   
577   actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97, 
578                       FALSE, FALSE, 100, 255, 
579                       (gpointer)&change_cloud, NULL, NULL);
580   actor->time_start_animation = now + fast_rnd(30) + 10;
581   actor->duration_animation = 3*60;
582   scene->actors = g_slist_append(scene->actors, actor);
583   
584   actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75, 
585                       FALSE, FALSE, 100, 255, 
586                       (gpointer)&change_cloud, NULL, NULL);
587   actor->time_start_animation = now + fast_rnd(10);
588   actor->duration_animation = 3*60;
589   scene->actors = g_slist_append(scene->actors, actor);
590
591   actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75, 
592                       FALSE, FALSE, 100, 255, 
593                       (gpointer)&change_cloud, NULL, NULL);
594   actor->time_start_animation = now + fast_rnd(60) + 20;
595   actor->duration_animation = 5*60;
596   scene->actors = g_slist_append(scene->actors, actor);
597
598  
599   actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 8, 160, 50, 
600                       FALSE, FALSE, 100, 255, 
601                       (gpointer)&change_plane2, NULL, NULL);
602   actor->time_start_animation = now + fast_rnd(40) + 20;
603   actor->duration_animation = 60;
604   scene->actors = g_slist_append(scene->actors, actor);
605   
606   actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116, 
607                       FALSE, FALSE, 100, 255, 
608                       (gpointer)&change_plane1, NULL, NULL);
609   actor->time_start_animation = now + fast_rnd(20);
610   actor->duration_animation = 30;
611   scene->actors = g_slist_append(scene->actors, actor);
612
613   actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480, 
614                       TRUE, TRUE, 100, 255, 
615                       (gpointer)&change_static_actor_with_corner, NULL, NULL);
616   change_static_actor_with_corner(actor, desktop_plugin);
617   scene->actors = g_slist_append(scene->actors, actor);
618
619   actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0, 
620                       FALSE, FALSE, 100, 255, 
621                       (gpointer)&change_wind, NULL, NULL);
622   change_wind(actor, desktop_plugin);
623   scene->actors = g_slist_append(scene->actors, actor);
624
625   actor1 = init_object(desktop_plugin, "signal_red", "red.png", 
626                       486, 425, 10, 18, 38, 
627                       FALSE, TRUE, 100, 255, NULL, NULL, NULL);
628   //actor->time_start_animation = now + fast_rnd(30) + 10;  
629   scene->actors = g_slist_append(scene->actors, actor1);
630    
631   actor2 = init_object(desktop_plugin, "signal_green", "green.png", 
632                       486, 425, 10, 18, 38, 
633                       TRUE, TRUE, 100, 255, NULL, NULL, NULL);
634   //actor->time_start_animation = now + fast_rnd(30) + 10;  
635   scene->actors = g_slist_append(scene->actors, actor2);
636   child = g_ptr_array_sized_new(2);
637   g_ptr_array_add(child, actor1);
638   g_ptr_array_add(child, actor2);
639   actor = init_object(desktop_plugin, "signal", "",
640                       486, 425, 10, 18, 38,
641                       FALSE, FALSE, 100, 255, 
642                       (gpointer)&change_signal, NULL, child);
643   actor->time_start_animation = now + fast_rnd(30) + 10;
644   scene->actors = g_slist_append(scene->actors, actor);
645     
646     winds[0][0] = 389;
647     winds[0][1] = 305;
648
649     winds[1][0] = 373;
650     winds[1][1] = 306;
651
652     winds[2][0] = 355;
653     winds[2][1] = 306;
654
655     winds[3][0] = 356;
656     winds[3][1] = 288;
657     
658     winds[4][0] = 337;
659     winds[4][1] = 269;
660     
661     winds[5][0] = 372;
662     winds[5][1] = 268;
663   
664     winds[6][0] = 372;
665     winds[6][1] = 249;
666     
667     winds[7][0] = 388;
668     winds[7][1] = 249;
669     
670     winds[8][0] = 387;
671     winds[8][1] = 230;
672     
673     winds[9][0] = 372;
674     winds[9][1] = 211;
675     
676     winds[10][0] = 355;
677     winds[10][1] = 159;
678     
679     winds[11][0] = 335;
680     winds[11][1] = 158;
681     
682     winds[12][0] = 386;
683     winds[12][1] = 119;
684   
685     for (i=0; i<13; i++){
686         actor = init_object(desktop_plugin, "window", "window.png", 
687                             winds[i][0], winds[i][1], 10, 8, 9, 
688                             FALSE, TRUE, 100, 255, 
689                             (gpointer)&change_window1, NULL, NULL);
690         //change_window1(actor, desktop_plugin);
691         actor->time_start_animation = now + fast_rnd(30);
692         scene->actors = g_slist_append(scene->actors, actor);
693
694     }
695     
696     run_long_timeout(desktop_plugin);
697
698 }
699
700 void 
701 init_scene_theme(AWallpaperPlugin *desktop_plugin)
702 {
703     void (*func)(gpointer);
704     func = g_hash_table_lookup(desktop_plugin->priv->hash_scene_func, desktop_plugin->priv->theme);
705     if (func){
706         (*func)(desktop_plugin);
707     }
708 }