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