1 /* vim: set sw=4 ts=4 et: */
3 * This file is part of Live Wallpaper (livewp)
5 * Copyright (C) 2010 Vlad Vasiliev
6 * Copyright (C) 2010 Tanya Makova
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.
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.
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
24 /*******************************************************************************/
25 #include "livewp-scene.h"
28 destroy_scene(AWallpaperPlugin *desktop_plugin)
32 if (desktop_plugin->priv->scene){
33 GSList * tmp = desktop_plugin->priv->scene->actors;
35 destroy_actor(tmp->data);
36 tmp = g_slist_next(tmp);
40 desktop_plugin->priv->scene->actors = NULL;
41 if (desktop_plugin->priv->scene){
42 g_free(desktop_plugin->priv->scene);
43 desktop_plugin->priv->scene = NULL;
46 if (desktop_plugin->priv->pipeline){
47 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);
48 gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
49 desktop_plugin->priv->pipeline = NULL;
51 if (desktop_plugin->priv->podpid > 1){
52 fprintf(stderr, "rrrrrrr\n");
53 kill (desktop_plugin->priv->podpid, SIGTERM);
55 if (wait(&status) == desktop_plugin->priv->podpid)
58 desktop_plugin->priv->podpid = -1;
59 desktop_plugin->priv->running = FALSE;
62 /*******************************************************************************/
64 reload_scene(AWallpaperPlugin *desktop_plugin)
66 fprintf(stderr,"Reload scene %s\n", desktop_plugin->priv->theme);
67 destroy_scene(desktop_plugin);
68 fill_priv(desktop_plugin->priv);
69 init_scene_theme(desktop_plugin);
71 /*******************************************************************************/
73 init_scene_Accel(AWallpaperPlugin *desktop_plugin)
78 gint now = time(NULL);
80 gint sizes1[4] = {57, 76, 43, 50},
83 /* fprintf(stderr, "init scene accel\n"); */
84 scene = g_new0(Scene, 1);
86 desktop_plugin->priv->scene = scene;
88 actor = init_object(desktop_plugin, "background", "bg.png",
92 scene->actors = g_slist_append(scene->actors, actor);
94 child = g_ptr_array_sized_new(16);
98 str = g_strdup_printf("tape%i.png", n+1);
99 actor = init_object(desktop_plugin, "tape", str,
100 fast_rnd(800), fast_rnd(480), 2+fast_rnd(6), 800, sizes1[n],
101 TRUE, TRUE, 100, 255,
103 scene->actors = g_slist_append(scene->actors, actor);
104 g_ptr_array_add(child, actor);
108 actor = init_object(desktop_plugin, "tape", "",
110 FALSE, FALSE, 100, 255,
111 (gpointer)&change_tape, NULL, child);
112 actor->time_start_animation = now;
113 actor->duration_animation = G_MAXINT;
114 scene->actors = g_slist_append(scene->actors, actor);
116 run_long_timeout(desktop_plugin);
118 /*******************************************************************************/
120 parsestring(char *line, char **argv)
122 while (*line != '\0') {
123 while (*line == ' ' || *line == '\n')
124 *line++ = '\0'; /* replace white spaces with 0 */
125 *argv++ = line; /* save the argument position */
126 while (*line != '\0' && *line != ' ' &&
128 line++; /* skip the argument until ... */
130 *argv = '\0'; /* mark the end of argument list */
135 sync_handler(GstBus *bus, GstMessage *message, AWallpaperPlugin *desktop_plugin){
137 if (!desktop_plugin->priv->visible)
138 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PAUSED);
139 if (GST_MESSAGE_TYPE(message) != GST_MESSAGE_ELEMENT){
140 return (GST_BUS_PASS);
142 if (!gst_structure_has_name(message->structure, "prepare-xwindow-id")){
143 return (GST_BUS_PASS);
145 return (GST_BUS_DROP);
149 /*******************************************************************************/
151 bus_call (GstBus *bus, GstMessage *msg, AWallpaperPlugin *desktop_plugin)
153 switch (GST_MESSAGE_TYPE (msg))
155 case GST_MESSAGE_EOS:
156 if (desktop_plugin->priv->rich_animation){
158 GstClockTime nach = (GstClockTime)(0 * GST_MSECOND);
159 if (!gst_element_seek(desktop_plugin->priv->pipeline, 1.0, GST_FORMAT_TIME,
160 (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), GST_SEEK_TYPE_SET,
161 nach, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
162 fprintf(stderr,"ERROR in seek\n");
164 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
167 if (desktop_plugin->priv->pipeline){
168 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);
169 gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
173 case GST_MESSAGE_ERROR: break;
179 /*******************************************************************************/
181 init_scene_External(AWallpaperPlugin *desktop_plugin){
183 char* child_argv[2048];
184 char *run_string = NULL;
185 gchar *exec_path = NULL,
190 if (!desktop_plugin->priv->visible)
193 fprintf(stderr,"init_scene_external 111\n");
194 exec_path = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "exec_path"));
195 window_id = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_id"));
196 view = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "view"));
197 fprintf(stderr,"init_scene_external 222\n");
201 strwin = g_strdup_printf(" %s %i", window_id, GDK_WINDOW_XID(desktop_plugin->priv->window->window));
206 strview = g_strdup_printf(" %s %i", view, desktop_plugin->priv->view);
210 run_string = g_strdup_printf("%s%s%s", exec_path, strwin, strview);
211 fprintf(stderr, "runs string = %s\n", run_string);
212 parsestring(run_string, child_argv);
214 desktop_plugin->priv->running = TRUE;
215 desktop_plugin->priv->podpid = fork();
216 if (desktop_plugin->priv->podpid == 0){
217 execvp(child_argv[0], child_argv);
218 fprintf(stderr,"Problem with new podprocess");
222 /*******************************************************************************/
224 cb_timeout0(AWallpaperPlugin *desktop_plugin) {
226 if (!desktop_plugin || !desktop_plugin->priv->pipeline)
228 if (desktop_plugin->priv->theme_int_parametr1 == 0){
229 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
230 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
231 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
232 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
233 fprintf(stderr,"Error in seek:\n");
237 if (gst_element_get_state (desktop_plugin->priv->pipeline, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE)
240 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
241 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
242 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
243 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
244 fprintf(stderr,"Error in seek:\n");
248 /*******************************************************************************/
250 init_scene_Video(AWallpaperPlugin *desktop_plugin)
253 GstElement *videosink;
254 gchar *file_plus_uri;
257 /* fprintf(stderr, "init scene Video \n"); */
258 desktop_plugin->priv->pipeline = gst_pipeline_new("gst-player");
259 bin = gst_element_factory_make ("playbin2", "bin");
260 videosink = gst_element_factory_make ("ximagesink", "videosink");
261 g_object_set (G_OBJECT (bin), "video-sink", videosink, NULL);
262 gst_bin_add (GST_BIN (desktop_plugin->priv->pipeline), bin);
266 bus = gst_pipeline_get_bus (GST_PIPELINE (desktop_plugin->priv->pipeline));
267 gst_bus_add_watch(bus, (GstBusFunc)bus_call, desktop_plugin);
268 gst_object_unref (bus);
270 file_plus_uri = g_strdup_printf("file://%s",desktop_plugin->priv->theme_string_parametr1);
271 g_object_set (G_OBJECT (bin), "uri", file_plus_uri, NULL );
272 g_object_set (G_OBJECT (videosink), "force-aspect-ratio", TRUE, NULL );
274 if (GST_IS_X_OVERLAY (videosink))
275 gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GDK_DRAWABLE_XID(desktop_plugin->priv->window->window));
277 if (desktop_plugin->priv->visible){
278 g_timeout_add(50, (GSourceFunc)cb_timeout0, desktop_plugin);
279 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
282 //gst_element_get_state(deskddtop_plugin->priv->pipeline, NULL, NULL, 100 * GST_MSECOND);
285 /*******************************************************************************/
287 init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
292 gint now = time(NULL);
295 if (desktop_plugin->priv->rich_animation){
303 /* fprintf(stderr, "init scene2 \n"); */
304 scene = g_new0(Scene, 1);
305 //scene.daytime = get_daytime();
306 scene->actors = NULL;
307 desktop_plugin->priv->scene = scene;
309 actor = init_object(desktop_plugin, "background", "bg.png",
311 TRUE, TRUE, 100, 255,
313 scene->actors = g_slist_append(scene->actors, actor);
315 actor = init_object(desktop_plugin, "symbols", "symbols.png",
317 TRUE, TRUE, 100, 255,
319 scene->actors = g_slist_append(scene->actors, actor);
321 child = g_ptr_array_sized_new(4);
322 actor = init_object(desktop_plugin, "layer1", "layer1_2.png",
324 TRUE, TRUE, 100, 255,
326 //actor->time_start_animation = now;
327 //actor->duration_animation = G_MAXINT;
328 scene->actors = g_slist_append(scene->actors, actor);
329 g_ptr_array_add(child, actor);
331 actor = init_object(desktop_plugin, "layer1", "layer1_1.png",
333 TRUE, TRUE, 100, 255,
335 //actor->time_start_animation = now;
336 //actor->duration_animation = G_MAXINT;
337 scene->actors = g_slist_append(scene->actors, actor);
338 g_ptr_array_add(child, actor);
340 actor = init_object(desktop_plugin, "layer2", "layer2_2.png",
342 TRUE, TRUE, 100, 255,
344 //actor->time_start_animation = now;
345 //actor->duration_animation = G_MAXINT;
346 scene->actors = g_slist_append(scene->actors, actor);
347 g_ptr_array_add(child, actor);
349 actor = init_object(desktop_plugin, "layer2", "layer2_1.png",
351 TRUE, TRUE, 100, 255,
353 //actor->time_start_animation = now;
354 //actor->duration_animation = G_MAXINT;
355 scene->actors = g_slist_append(scene->actors, actor);
356 g_ptr_array_add(child, actor);
358 actor = init_object(desktop_plugin, "layers", "",
360 FALSE, FALSE, 100, 255,
361 (gpointer)&change_layer, NULL, child);
362 actor->time_start_animation = now;
363 actor->duration_animation = G_MAXINT;
364 scene->actors = g_slist_append(scene->actors, actor);
366 run_long_timeout(desktop_plugin);
369 /*******************************************************************************/
370 /* Init Modern Scene */
372 init_scene_Modern(AWallpaperPlugin *desktop_plugin)
376 gint now = time(NULL);
381 /* fprintf(stderr, "init scene \n"); */
382 scene = g_new0(Scene, 1);
383 scene->daytime = get_daytime();
384 scene->actors = NULL;
385 scene->wind_orientation = -1;
386 scene->wind_angle = 0.3;
387 /* init value for random */
388 scene->seed = time(NULL);
389 scene->notification = TRUE;
390 desktop_plugin->priv->scene = scene;
391 actor = init_object(desktop_plugin, "sky", "sky0.png",
393 TRUE , TRUE, 100, 255,
394 (gpointer)&change_static_actor, NULL, NULL);
395 scene->actors = g_slist_append(scene->actors, actor);
396 change_static_actor(actor, desktop_plugin);
398 actor = init_object(desktop_plugin, "sun", "sun.png",
400 FALSE, FALSE, 100, 255,
401 (gpointer)&change_sun, NULL, NULL);
402 actor->time_start_animation = now;
403 actor->duration_animation = G_MAXINT;
404 change_sun(actor, desktop_plugin);
405 scene->actors = g_slist_append(scene->actors, actor);
407 //actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
408 // TRUE, 100, 255, NULL, NULL);
409 //scene.actors = g_slist_append(scene.actors, actor);
411 actor = init_object(desktop_plugin, "cloud1", "cloud1.png",
412 0, fast_rnd(300)-97, 7, 150, 97,
413 FALSE, FALSE, 100, 255,
414 (gpointer)&change_cloud, NULL, NULL);
415 actor->time_start_animation = now + fast_rnd(20);
416 actor->duration_animation = 3*60;
417 scene->actors = g_slist_append(scene->actors, actor);
419 actor = init_object(desktop_plugin, "cloud2", "cloud2.png",
420 0, fast_rnd(300)-75, 7, 188, 75,
421 FALSE, FALSE, 100, 255,
422 (gpointer)&change_cloud, NULL, NULL);
423 actor->time_start_animation = now + fast_rnd(40)+10;
424 actor->duration_animation = 3*60;
425 scene->actors = g_slist_append(scene->actors, actor);
427 actor = init_object(desktop_plugin, "cloud4", "cloud4.png",
428 0, fast_rnd(300)-75, 7, 150, 75,
429 FALSE, FALSE, 100, 255,
430 (gpointer)&change_cloud, NULL, NULL);
431 actor->time_start_animation = now + fast_rnd(60) + 20;
432 actor->duration_animation = 5*60;
433 scene->actors = g_slist_append(scene->actors, actor);
436 actor = init_object(desktop_plugin, "town", "town0.png",
438 TRUE, TRUE, 100, 255,
439 (gpointer)&change_static_actor, NULL, NULL);
440 change_static_actor(actor, desktop_plugin);
441 scene->actors = g_slist_append(scene->actors, actor);
443 actor = init_object(desktop_plugin, "stend", "stend0.png",
444 452, 166, 9, 300, 305,
445 TRUE, TRUE, 100, 255,
446 (gpointer)&change_static_actor, NULL, NULL);
447 change_static_actor(actor, desktop_plugin);
448 scene->actors = g_slist_append(scene->actors, actor);
451 child = g_ptr_array_sized_new(4);
452 actor = init_object(desktop_plugin, "call", "call.png",
454 FALSE, TRUE, 100, 255,
456 scene->actors = g_slist_append(scene->actors, actor);
457 g_ptr_array_add(child, actor);
459 actor = init_object(desktop_plugin, "chat", "chat.png",
461 FALSE, TRUE, 100, 255,
463 scene->actors = g_slist_append(scene->actors, actor);
464 g_ptr_array_add(child, actor);
466 actor = init_object(desktop_plugin, "mail", "mail.png",
468 FALSE, TRUE, 100, 255,
470 scene->actors = g_slist_append(scene->actors, actor);
471 g_ptr_array_add(child, actor);
473 actor = init_object(desktop_plugin, "sms", "sms.png",
475 FALSE, TRUE, 100, 255,
477 scene->actors = g_slist_append(scene->actors, actor);
478 g_ptr_array_add(child, actor);
480 actor = init_object(desktop_plugin, "billboard_text", "",
481 470, 174, 9, 300, 108,
482 FALSE, FALSE, 100, 255,
483 (gpointer)&change_billboard, NULL, child);
484 create_hildon_actor_text(actor, desktop_plugin);
485 //actor->time_start_animation = time(NULL) + 20;
486 change_billboard(actor, desktop_plugin);
487 scene->actors = g_slist_append(scene->actors, actor);
489 actor = init_object(desktop_plugin, "tram", "tram.png",
490 -300, 225, 10, 350, 210,
491 FALSE, FALSE, 100, 255,
492 (gpointer)&change_tram, NULL, NULL);
493 actor->time_start_animation = time(NULL) + fast_rnd(10);
494 actor->duration_animation = 60;
495 scene->actors = g_slist_append(scene->actors, actor);
497 actor = init_object(desktop_plugin, "border", "border0.png",
498 0, 480-79, 11, 800, 79,
499 TRUE, TRUE, 100, 255,
500 (gpointer)&change_static_actor_with_corner, NULL, NULL);
501 change_static_actor_with_corner(actor, desktop_plugin);
502 scene->actors = g_slist_append(scene->actors, actor);
504 actor = init_object(desktop_plugin, "moon", "moon1.png",
506 FALSE, FALSE, 100, 255,
507 (gpointer)&change_moon, NULL, NULL);
508 change_moon(actor, desktop_plugin);
509 scene->actors = g_slist_append(scene->actors, actor);
511 actor = init_object(desktop_plugin, "wind", "",
513 FALSE, FALSE, 100, 255,
514 (gpointer)&change_wind, NULL, NULL);
515 change_wind(actor, desktop_plugin);
516 scene->actors = g_slist_append(scene->actors, actor);
518 /* windows in 4-th house */
558 for (i=0; i<13; i++){
559 actor = init_object(desktop_plugin, "window1", "window1.png",
560 winds[i][0], winds[i][1], 8, 8, 10,
561 FALSE, FALSE, 100, 255,
562 (gpointer)&change_window1, NULL, NULL);
563 //change_window1(actor, desktop_plugin);
564 actor->time_start_animation = now + fast_rnd(30);
565 scene->actors = g_slist_append(scene->actors, actor);
569 /* windows in 1-th house */
595 actor = init_object(desktop_plugin, "window2", "window2.png",
596 winds[i][0], winds[i][1], 8, 8, 10,
597 FALSE, FALSE, 100, 255,
598 (gpointer)&change_window1, NULL, NULL);
599 //change_window1(actor, desktop_plugin);
600 actor->time_start_animation = now + fast_rnd(30);
601 scene->actors = g_slist_append(scene->actors, actor);
605 /* windows in 3-th house */
637 for (i=0; i<10; i++){
638 actor = init_object(desktop_plugin, "window3", "window3.png",
639 winds[i][0], winds[i][1], 8, 8, 10,
640 FALSE, FALSE, 100, 255,
641 (gpointer)&change_window1, NULL, NULL);
642 //change_window1(actor, desktop_plugin);
643 actor->time_start_animation = now + fast_rnd(30);
644 scene->actors = g_slist_append(scene->actors, actor);
648 /* windows in 5-th house */
672 actor = init_object(desktop_plugin, "window4", "window4.png",
673 winds[i][0], winds[i][1], 8, 8, 10,
674 FALSE, FALSE, 100, 255,
675 (gpointer)&change_window1, NULL, NULL);
676 //change_window1(actor, desktop_plugin);
677 actor->time_start_animation = now + fast_rnd(30);
678 scene->actors = g_slist_append(scene->actors, actor);
682 /* windows in 6-th house */
703 actor = init_object(desktop_plugin, "window5", "window5.png",
704 winds[i][0], winds[i][1], 8, 8, 10,
705 FALSE, FALSE, 100, 255,
706 (gpointer)&change_window1, NULL, NULL);
707 //change_window1(actor, desktop_plugin);
708 actor->time_start_animation = now + fast_rnd(30);
709 scene->actors = g_slist_append(scene->actors, actor);
712 run_long_timeout(desktop_plugin);
715 anim = g_new0(Animation, 1);
718 anim->func_change = &change_tram;
719 anim->func_time = NULL;
720 anim->timestart = time(NULL);
723 scene.dynamic_actors = g_slist_append(scene.dynamic_actors, anim);
726 /*******************************************************************************/
727 /* Init Berlin Scene */
729 init_scene_Berlin(AWallpaperPlugin *desktop_plugin)
731 Actor *actor, *actor1, *actor2;
733 gint now = time(NULL);
736 GPtrArray *child = NULL;
738 scene = g_new0(Scene, 1);
739 scene->daytime = get_daytime();
740 scene->actors = NULL;
741 scene->wind_orientation = -1;
742 scene->wind_angle = 0.3;
743 /* init value for random */
744 scene->seed = time(NULL);
745 desktop_plugin->priv->scene = scene;
747 actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480,
748 TRUE, TRUE, 100, 255,
749 (gpointer)&change_static_actor, NULL, NULL);
750 change_static_actor(actor, desktop_plugin);
751 scene->actors = g_slist_append(scene->actors, actor);
754 actor = init_object(desktop_plugin, "sun", "sun.png", 0, 0, 6, 88, 88,
755 FALSE, FALSE, 100, 255,
756 (gpointer)&change_sun, NULL, NULL);
757 actor->time_start_animation = time(NULL);
758 actor->duration_animation = G_MAXINT;
759 change_sun(actor, desktop_plugin);
760 scene->actors = g_slist_append(scene->actors, actor);
763 actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
764 TRUE, 100, 255, NULL, NULL);
765 scene.actors = g_slist_append(scene.actors, actor);
768 actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60,
769 FALSE, FALSE, 100, 255,
770 (gpointer)&change_moon, NULL, NULL);
771 change_moon(actor, desktop_plugin);
772 scene->actors = g_slist_append(scene->actors, actor);
774 actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97,
775 FALSE, FALSE, 100, 255,
776 (gpointer)&change_cloud, NULL, NULL);
777 actor->time_start_animation = now + fast_rnd(30) + 10;
778 actor->duration_animation = 3*60;
779 scene->actors = g_slist_append(scene->actors, actor);
781 actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75,
782 FALSE, FALSE, 100, 255,
783 (gpointer)&change_cloud, NULL, NULL);
784 actor->time_start_animation = now + fast_rnd(10);
785 actor->duration_animation = 3*60;
786 scene->actors = g_slist_append(scene->actors, actor);
788 actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75,
789 FALSE, FALSE, 100, 255,
790 (gpointer)&change_cloud, NULL, NULL);
791 actor->time_start_animation = now + fast_rnd(60) + 20;
792 actor->duration_animation = 5*60;
793 scene->actors = g_slist_append(scene->actors, actor);
796 actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 8, 160, 50,
797 FALSE, FALSE, 100, 255,
798 (gpointer)&change_plane2, NULL, NULL);
799 actor->time_start_animation = now + fast_rnd(40) + 20;
800 actor->duration_animation = 60;
801 scene->actors = g_slist_append(scene->actors, actor);
803 actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116,
804 FALSE, FALSE, 100, 255,
805 (gpointer)&change_plane1, NULL, NULL);
806 actor->time_start_animation = now + fast_rnd(20);
807 actor->duration_animation = 30;
808 scene->actors = g_slist_append(scene->actors, actor);
810 actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480,
811 TRUE, TRUE, 100, 255,
812 (gpointer)&change_static_actor_with_corner, NULL, NULL);
813 change_static_actor_with_corner(actor, desktop_plugin);
814 scene->actors = g_slist_append(scene->actors, actor);
816 actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0,
817 FALSE, FALSE, 100, 255,
818 (gpointer)&change_wind, NULL, NULL);
819 change_wind(actor, desktop_plugin);
820 scene->actors = g_slist_append(scene->actors, actor);
822 actor1 = init_object(desktop_plugin, "signal_red", "red.png",
823 486, 425, 10, 18, 38,
824 FALSE, TRUE, 100, 255, NULL, NULL, NULL);
825 //actor->time_start_animation = now + fast_rnd(30) + 10;
826 scene->actors = g_slist_append(scene->actors, actor1);
828 actor2 = init_object(desktop_plugin, "signal_green", "green.png",
829 486, 425, 10, 18, 38,
830 TRUE, TRUE, 100, 255, NULL, NULL, NULL);
831 //actor->time_start_animation = now + fast_rnd(30) + 10;
832 scene->actors = g_slist_append(scene->actors, actor2);
833 child = g_ptr_array_sized_new(2);
834 g_ptr_array_add(child, actor1);
835 g_ptr_array_add(child, actor2);
836 actor = init_object(desktop_plugin, "signal", "",
837 486, 425, 10, 18, 38,
838 FALSE, FALSE, 100, 255,
839 (gpointer)&change_signal, NULL, child);
840 actor->time_start_animation = now + fast_rnd(30) + 10;
841 scene->actors = g_slist_append(scene->actors, actor);
882 for (i=0; i<13; i++){
883 actor = init_object(desktop_plugin, "window", "window.png",
884 winds[i][0], winds[i][1], 10, 8, 9,
885 FALSE, TRUE, 100, 255,
886 (gpointer)&change_window1, NULL, NULL);
887 //change_window1(actor, desktop_plugin);
888 actor->time_start_animation = now + fast_rnd(30);
889 scene->actors = g_slist_append(scene->actors, actor);
893 run_long_timeout(desktop_plugin);
896 /*******************************************************************************/
898 init_scene_theme(AWallpaperPlugin *desktop_plugin)
901 void (*func)(gpointer);
902 func = g_hash_table_lookup(desktop_plugin->priv->hash_scene_func, desktop_plugin->priv->theme);
904 (*func)(desktop_plugin);
907 fprintf(stderr, "Init_scene_theme\n");
908 void (*func)(gpointer);
909 func = desktop_plugin->priv->scene_func;
911 fprintf(stderr, "Success init_scene_theme\n");
912 (*func)(desktop_plugin);