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