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