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