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