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