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