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