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)
30 if (desktop_plugin->priv->scene){
31 GSList * tmp = desktop_plugin->priv->scene->actors;
33 destroy_actor(tmp->data);
34 tmp = g_slist_next(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;
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 desktop_plugin->priv->pipeline = NULL;
49 if (desktop_plugin->priv->podpid > 1){
50 kill (desktop_plugin->priv->podpid, SIGTERM);
51 desktop_plugin->priv->podpid = -1;
54 /*******************************************************************************/
56 reload_scene(AWallpaperPlugin *desktop_plugin)
58 fprintf(stderr,"Reload scene %s\n", desktop_plugin->priv->theme);
59 destroy_scene(desktop_plugin);
60 init_scene_theme(desktop_plugin);
62 /*******************************************************************************/
64 init_scene_Accel(AWallpaperPlugin *desktop_plugin)
69 gint now = time(NULL);
71 gint sizes[4] = {170, 229, 130, 150},
72 sizes1[4] = {57, 76, 43, 50},
73 heights[4] = {0, 100, 200, 300},
76 fprintf(stderr, "init scene accel\n");
77 scene = g_new0(Scene, 1);
79 desktop_plugin->priv->scene = scene;
81 actor = init_object(desktop_plugin, "background", "bg.png",
85 scene->actors = g_slist_append(scene->actors, actor);
87 child = g_ptr_array_sized_new(16);
91 //for (i=0; i<3; i++){
92 str = g_strdup_printf("tape%i.png", n+1);
93 actor = init_object(desktop_plugin, "tape", str,
94 fast_rnd(800), fast_rnd(480), 2+fast_rnd(6), 800, sizes1[n],
97 scene->actors = g_slist_append(scene->actors, actor);
98 g_ptr_array_add(child, actor);
103 actor = init_object(desktop_plugin, "tape", "",
105 FALSE, FALSE, 100, 255,
106 (gpointer)&change_tape, NULL, child);
107 actor->time_start_animation = now;
108 actor->duration_animation = G_MAXINT;
109 scene->actors = g_slist_append(scene->actors, actor);
111 run_long_timeout(desktop_plugin);
113 /*******************************************************************************/
115 parsestring(char *line, char **argv)
117 while (*line != '\0') {
118 while (*line == ' ' || *line == '\n')
119 *line++ = '\0'; /* replace white spaces with 0 */
120 *argv++ = line; /* save the argument position */
121 while (*line != '\0' && *line != ' ' &&
123 line++; /* skip the argument until ... */
125 *argv = '\0'; /* mark the end of argument list */
130 sync_handler(GstBus *bus, GstMessage *message, AWallpaperPlugin *desktop_plugin){
132 if (!desktop_plugin->priv->visible)
133 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PAUSED);
134 if (GST_MESSAGE_TYPE(message) != GST_MESSAGE_ELEMENT){
135 return (GST_BUS_PASS);
137 if (!gst_structure_has_name(message->structure, "prepare-xwindow-id")){
138 return (GST_BUS_PASS);
140 return (GST_BUS_DROP);
144 /*******************************************************************************/
146 bus_call (GstBus *bus, GstMessage *msg, AWallpaperPlugin *desktop_plugin)
148 switch (GST_MESSAGE_TYPE (msg))
150 case GST_MESSAGE_EOS:
151 if (desktop_plugin->priv->rich_animation){
153 GstClockTime nach = (GstClockTime)(0 * GST_MSECOND);
154 if (!gst_element_seek(desktop_plugin->priv->pipeline, 1.0, GST_FORMAT_TIME,
155 (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), GST_SEEK_TYPE_SET,
156 nach, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
157 fprintf(stderr,"ERROR in seek\n");
159 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
162 if (desktop_plugin->priv->pipeline){
163 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);
164 gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
168 case GST_MESSAGE_ERROR: break;
174 /*******************************************************************************/
176 init_scene_Xsnow(AWallpaperPlugin *desktop_plugin){
177 fprintf(stderr,"init_scene_Xsnow\n");
178 char* child_argv[128];
179 char *run_string = NULL;
181 // fprintf(stderr, "PARAMETR %s\n", desktop_plugin->priv->theme_string_parametr1);
182 // run_string = g_strdup_printf("/usr/bin/mplayer -vo x11 -wid %d %s\n", \
183 GDK_WINDOW_XID(desktop_plugin->priv->window->window), desktop_plugin->priv->theme_string_parametr1);
184 if (!desktop_plugin->priv->visible)
186 run_string= g_strdup_printf("/usr/bin/xsnow");
187 parsestring(run_string, child_argv);
189 desktop_plugin->priv->running = TRUE;
190 desktop_plugin->priv->podpid = fork();
191 if (desktop_plugin->priv->podpid == 0){
192 execvp("/usr/bin/xsnow", child_argv);
193 fprintf(stderr,"Problem with new podprocess");
197 /*******************************************************************************/
198 gboolean cb_timeout0(AWallpaperPlugin *desktop_plugin) {
199 GstFormat fmt = GST_FORMAT_TIME;
202 gint len_seconds = 0;
204 if (!desktop_plugin || !desktop_plugin->priv->pipeline)
206 if (desktop_plugin->priv->theme_int_parametr1 == 0){
207 if (!gst_element_seek(GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
208 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
209 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
210 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
211 fprintf(stderr,"Error in seek:\n");
215 gst_element_query_position(desktop_plugin->priv->pipeline, &fmt, &len);
216 len_seconds = len / GST_SECOND;
219 if (len_seconds < desktop_plugin->priv->theme_int_parametr1){
220 if (!gst_element_seek(GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
221 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
222 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
223 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
224 fprintf(stderr,"Error in seek:\n");
229 /*******************************************************************************/
231 init_scene_Video(AWallpaperPlugin *desktop_plugin)
234 GstElement *videosink;
236 gchar *file_plus_uri;
239 /* fprintf(stderr, "init scene Video \n"); */
240 desktop_plugin->priv->pipeline = gst_pipeline_new("gst-player");
241 bin = gst_element_factory_make ("playbin2", "bin");
242 videosink = gst_element_factory_make ("ximagesink", "videosink");
243 g_object_set (G_OBJECT (bin), "video-sink", videosink, NULL);
244 gst_bin_add (GST_BIN (desktop_plugin->priv->pipeline), bin);
248 bus = gst_pipeline_get_bus (GST_PIPELINE (desktop_plugin->priv->pipeline));
249 gst_bus_add_watch(bus, bus_call, desktop_plugin);
250 gst_object_unref (bus);
252 file_plus_uri = g_strdup_printf("file://%s",desktop_plugin->priv->theme_string_parametr1);
253 g_object_set (G_OBJECT (bin), "uri", file_plus_uri, NULL );
254 g_object_set (G_OBJECT (videosink), "force-aspect-ratio", TRUE, NULL );
256 if (GST_IS_X_OVERLAY (videosink))
257 gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GDK_DRAWABLE_XID(desktop_plugin->priv->window->window));
259 if (desktop_plugin->priv->visible){
260 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
261 g_timeout_add(100, cb_timeout0, desktop_plugin);
264 //gst_element_get_state(deskddtop_plugin->priv->pipeline, NULL, NULL, 100 * GST_MSECOND);
267 /*******************************************************************************/
269 init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
274 gint now = time(NULL);
277 if (desktop_plugin->priv->rich_animation){
285 /* fprintf(stderr, "init scene2 \n"); */
286 scene = g_new0(Scene, 1);
287 //scene.daytime = get_daytime();
288 scene->actors = NULL;
289 desktop_plugin->priv->scene = scene;
291 actor = init_object(desktop_plugin, "background", "bg.png",
293 TRUE, TRUE, 100, 255,
295 scene->actors = g_slist_append(scene->actors, actor);
297 actor = init_object(desktop_plugin, "symbols", "symbols.png",
299 TRUE, TRUE, 100, 255,
301 scene->actors = g_slist_append(scene->actors, actor);
303 child = g_ptr_array_sized_new(4);
304 actor = init_object(desktop_plugin, "layer1", "layer1_2.png",
306 TRUE, TRUE, 100, 255,
308 //actor->time_start_animation = now;
309 //actor->duration_animation = G_MAXINT;
310 scene->actors = g_slist_append(scene->actors, actor);
311 g_ptr_array_add(child, actor);
313 actor = init_object(desktop_plugin, "layer1", "layer1_1.png",
315 TRUE, TRUE, 100, 255,
317 //actor->time_start_animation = now;
318 //actor->duration_animation = G_MAXINT;
319 scene->actors = g_slist_append(scene->actors, actor);
320 g_ptr_array_add(child, actor);
322 actor = init_object(desktop_plugin, "layer2", "layer2_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, "layer2", "layer2_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, "layers", "",
342 FALSE, FALSE, 100, 255,
343 (gpointer)&change_layer, NULL, child);
344 actor->time_start_animation = now;
345 actor->duration_animation = G_MAXINT;
346 scene->actors = g_slist_append(scene->actors, actor);
348 run_long_timeout(desktop_plugin);
351 /*******************************************************************************/
352 /* Init Modern Scene */
354 init_scene_Modern(AWallpaperPlugin *desktop_plugin)
358 gint now = time(NULL);
363 /* fprintf(stderr, "init scene \n"); */
364 scene = g_new0(Scene, 1);
365 scene->daytime = get_daytime();
366 scene->actors = NULL;
367 scene->wind_orientation = -1;
368 scene->wind_angle = 0.3;
369 /* init value for random */
370 scene->seed = time(NULL);
371 scene->notification = TRUE;
372 desktop_plugin->priv->scene = scene;
373 actor = init_object(desktop_plugin, "sky", "sky0.png",
375 TRUE , TRUE, 100, 255,
376 (gpointer)&change_static_actor, NULL, NULL);
377 scene->actors = g_slist_append(scene->actors, actor);
378 change_static_actor(actor, desktop_plugin);
380 actor = init_object(desktop_plugin, "sun", "sun.png",
382 FALSE, FALSE, 100, 255,
383 (gpointer)&change_sun, NULL, NULL);
384 actor->time_start_animation = now;
385 actor->duration_animation = G_MAXINT;
386 change_sun(actor, desktop_plugin);
387 scene->actors = g_slist_append(scene->actors, actor);
389 //actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
390 // TRUE, 100, 255, NULL, NULL);
391 //scene.actors = g_slist_append(scene.actors, actor);
393 actor = init_object(desktop_plugin, "cloud1", "cloud1.png",
394 0, fast_rnd(300)-97, 7, 150, 97,
395 FALSE, FALSE, 100, 255,
396 (gpointer)&change_cloud, NULL, NULL);
397 actor->time_start_animation = now + fast_rnd(20);
398 actor->duration_animation = 3*60;
399 scene->actors = g_slist_append(scene->actors, actor);
401 actor = init_object(desktop_plugin, "cloud2", "cloud2.png",
402 0, fast_rnd(300)-75, 7, 188, 75,
403 FALSE, FALSE, 100, 255,
404 (gpointer)&change_cloud, NULL, NULL);
405 actor->time_start_animation = now + fast_rnd(40)+10;
406 actor->duration_animation = 3*60;
407 scene->actors = g_slist_append(scene->actors, actor);
409 actor = init_object(desktop_plugin, "cloud4", "cloud4.png",
410 0, fast_rnd(300)-75, 7, 150, 75,
411 FALSE, FALSE, 100, 255,
412 (gpointer)&change_cloud, NULL, NULL);
413 actor->time_start_animation = now + fast_rnd(60) + 20;
414 actor->duration_animation = 5*60;
415 scene->actors = g_slist_append(scene->actors, actor);
418 actor = init_object(desktop_plugin, "town", "town0.png",
420 TRUE, TRUE, 100, 255,
421 (gpointer)&change_static_actor, NULL, NULL);
422 change_static_actor(actor, desktop_plugin);
423 scene->actors = g_slist_append(scene->actors, actor);
425 actor = init_object(desktop_plugin, "stend", "stend0.png",
426 452, 166, 9, 300, 305,
427 TRUE, TRUE, 100, 255,
428 (gpointer)&change_static_actor, NULL, NULL);
429 change_static_actor(actor, desktop_plugin);
430 scene->actors = g_slist_append(scene->actors, actor);
433 child = g_ptr_array_sized_new(4);
434 actor = init_object(desktop_plugin, "call", "call.png",
436 FALSE, TRUE, 100, 255,
438 scene->actors = g_slist_append(scene->actors, actor);
439 g_ptr_array_add(child, actor);
441 actor = init_object(desktop_plugin, "chat", "chat.png",
443 FALSE, TRUE, 100, 255,
445 scene->actors = g_slist_append(scene->actors, actor);
446 g_ptr_array_add(child, actor);
448 actor = init_object(desktop_plugin, "mail", "mail.png",
450 FALSE, TRUE, 100, 255,
452 scene->actors = g_slist_append(scene->actors, actor);
453 g_ptr_array_add(child, actor);
455 actor = init_object(desktop_plugin, "sms", "sms.png",
457 FALSE, TRUE, 100, 255,
459 scene->actors = g_slist_append(scene->actors, actor);
460 g_ptr_array_add(child, actor);
462 actor = init_object(desktop_plugin, "billboard_text", "",
463 470, 174, 9, 300, 108,
464 FALSE, FALSE, 100, 255,
465 (gpointer)&change_billboard, NULL, child);
466 create_hildon_actor_text(actor, desktop_plugin);
467 //actor->time_start_animation = time(NULL) + 20;
468 change_billboard(actor, desktop_plugin);
469 scene->actors = g_slist_append(scene->actors, actor);
471 actor = init_object(desktop_plugin, "tram", "tram.png",
472 -300, 225, 10, 350, 210,
473 FALSE, FALSE, 100, 255,
474 (gpointer)&change_tram, NULL, NULL);
475 actor->time_start_animation = time(NULL) + fast_rnd(10);
476 actor->duration_animation = 60;
477 scene->actors = g_slist_append(scene->actors, actor);
479 actor = init_object(desktop_plugin, "border", "border0.png",
480 0, 480-79, 11, 800, 79,
481 TRUE, TRUE, 100, 255,
482 (gpointer)&change_static_actor_with_corner, NULL, NULL);
483 change_static_actor_with_corner(actor, desktop_plugin);
484 scene->actors = g_slist_append(scene->actors, actor);
486 actor = init_object(desktop_plugin, "moon", "moon1.png",
488 FALSE, FALSE, 100, 255,
489 (gpointer)&change_moon, NULL, NULL);
490 change_moon(actor, desktop_plugin);
491 scene->actors = g_slist_append(scene->actors, actor);
493 actor = init_object(desktop_plugin, "wind", "",
495 FALSE, FALSE, 100, 255,
496 (gpointer)&change_wind, NULL, NULL);
497 change_wind(actor, desktop_plugin);
498 scene->actors = g_slist_append(scene->actors, actor);
500 /* windows in 4-th house */
540 for (i=0; i<13; i++){
541 actor = init_object(desktop_plugin, "window1", "window1.png",
542 winds[i][0], winds[i][1], 8, 8, 10,
543 FALSE, FALSE, 100, 255,
544 (gpointer)&change_window1, NULL, NULL);
545 //change_window1(actor, desktop_plugin);
546 actor->time_start_animation = now + fast_rnd(30);
547 scene->actors = g_slist_append(scene->actors, actor);
551 /* windows in 1-th house */
577 actor = init_object(desktop_plugin, "window2", "window2.png",
578 winds[i][0], winds[i][1], 8, 8, 10,
579 FALSE, FALSE, 100, 255,
580 (gpointer)&change_window1, NULL, NULL);
581 //change_window1(actor, desktop_plugin);
582 actor->time_start_animation = now + fast_rnd(30);
583 scene->actors = g_slist_append(scene->actors, actor);
587 /* windows in 3-th house */
619 for (i=0; i<10; i++){
620 actor = init_object(desktop_plugin, "window3", "window3.png",
621 winds[i][0], winds[i][1], 8, 8, 10,
622 FALSE, FALSE, 100, 255,
623 (gpointer)&change_window1, NULL, NULL);
624 //change_window1(actor, desktop_plugin);
625 actor->time_start_animation = now + fast_rnd(30);
626 scene->actors = g_slist_append(scene->actors, actor);
630 /* windows in 5-th house */
654 actor = init_object(desktop_plugin, "window4", "window4.png",
655 winds[i][0], winds[i][1], 8, 8, 10,
656 FALSE, FALSE, 100, 255,
657 (gpointer)&change_window1, NULL, NULL);
658 //change_window1(actor, desktop_plugin);
659 actor->time_start_animation = now + fast_rnd(30);
660 scene->actors = g_slist_append(scene->actors, actor);
664 /* windows in 6-th house */
685 actor = init_object(desktop_plugin, "window5", "window5.png",
686 winds[i][0], winds[i][1], 8, 8, 10,
687 FALSE, FALSE, 100, 255,
688 (gpointer)&change_window1, NULL, NULL);
689 //change_window1(actor, desktop_plugin);
690 actor->time_start_animation = now + fast_rnd(30);
691 scene->actors = g_slist_append(scene->actors, actor);
694 run_long_timeout(desktop_plugin);
697 anim = g_new0(Animation, 1);
700 anim->func_change = &change_tram;
701 anim->func_time = NULL;
702 anim->timestart = time(NULL);
705 scene.dynamic_actors = g_slist_append(scene.dynamic_actors, anim);
708 /*******************************************************************************/
709 /* Init Berlin Scene */
711 init_scene_Berlin(AWallpaperPlugin *desktop_plugin)
713 Actor *actor, *actor1, *actor2;
715 gint now = time(NULL);
718 GPtrArray *child = NULL;
720 scene = g_new0(Scene, 1);
721 scene->daytime = get_daytime();
722 scene->actors = NULL;
723 scene->wind_orientation = -1;
724 scene->wind_angle = 0.3;
725 /* init value for random */
726 scene->seed = time(NULL);
727 desktop_plugin->priv->scene = scene;
729 actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480,
730 TRUE, TRUE, 100, 255,
731 (gpointer)&change_static_actor, NULL, NULL);
732 change_static_actor(actor, desktop_plugin);
733 scene->actors = g_slist_append(scene->actors, actor);
736 actor = init_object(desktop_plugin, "sun", "sun.png", 0, 0, 6, 88, 88,
737 FALSE, FALSE, 100, 255,
738 (gpointer)&change_sun, NULL, NULL);
739 actor->time_start_animation = time(NULL);
740 actor->duration_animation = G_MAXINT;
741 change_sun(actor, desktop_plugin);
742 scene->actors = g_slist_append(scene->actors, actor);
745 actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
746 TRUE, 100, 255, NULL, NULL);
747 scene.actors = g_slist_append(scene.actors, actor);
750 actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60,
751 FALSE, FALSE, 100, 255,
752 (gpointer)&change_moon, NULL, NULL);
753 change_moon(actor, desktop_plugin);
754 scene->actors = g_slist_append(scene->actors, actor);
756 actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97,
757 FALSE, FALSE, 100, 255,
758 (gpointer)&change_cloud, NULL, NULL);
759 actor->time_start_animation = now + fast_rnd(30) + 10;
760 actor->duration_animation = 3*60;
761 scene->actors = g_slist_append(scene->actors, actor);
763 actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75,
764 FALSE, FALSE, 100, 255,
765 (gpointer)&change_cloud, NULL, NULL);
766 actor->time_start_animation = now + fast_rnd(10);
767 actor->duration_animation = 3*60;
768 scene->actors = g_slist_append(scene->actors, actor);
770 actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75,
771 FALSE, FALSE, 100, 255,
772 (gpointer)&change_cloud, NULL, NULL);
773 actor->time_start_animation = now + fast_rnd(60) + 20;
774 actor->duration_animation = 5*60;
775 scene->actors = g_slist_append(scene->actors, actor);
778 actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 8, 160, 50,
779 FALSE, FALSE, 100, 255,
780 (gpointer)&change_plane2, NULL, NULL);
781 actor->time_start_animation = now + fast_rnd(40) + 20;
782 actor->duration_animation = 60;
783 scene->actors = g_slist_append(scene->actors, actor);
785 actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116,
786 FALSE, FALSE, 100, 255,
787 (gpointer)&change_plane1, NULL, NULL);
788 actor->time_start_animation = now + fast_rnd(20);
789 actor->duration_animation = 30;
790 scene->actors = g_slist_append(scene->actors, actor);
792 actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480,
793 TRUE, TRUE, 100, 255,
794 (gpointer)&change_static_actor_with_corner, NULL, NULL);
795 change_static_actor_with_corner(actor, desktop_plugin);
796 scene->actors = g_slist_append(scene->actors, actor);
798 actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0,
799 FALSE, FALSE, 100, 255,
800 (gpointer)&change_wind, NULL, NULL);
801 change_wind(actor, desktop_plugin);
802 scene->actors = g_slist_append(scene->actors, actor);
804 actor1 = init_object(desktop_plugin, "signal_red", "red.png",
805 486, 425, 10, 18, 38,
806 FALSE, TRUE, 100, 255, NULL, NULL, NULL);
807 //actor->time_start_animation = now + fast_rnd(30) + 10;
808 scene->actors = g_slist_append(scene->actors, actor1);
810 actor2 = init_object(desktop_plugin, "signal_green", "green.png",
811 486, 425, 10, 18, 38,
812 TRUE, TRUE, 100, 255, NULL, NULL, NULL);
813 //actor->time_start_animation = now + fast_rnd(30) + 10;
814 scene->actors = g_slist_append(scene->actors, actor2);
815 child = g_ptr_array_sized_new(2);
816 g_ptr_array_add(child, actor1);
817 g_ptr_array_add(child, actor2);
818 actor = init_object(desktop_plugin, "signal", "",
819 486, 425, 10, 18, 38,
820 FALSE, FALSE, 100, 255,
821 (gpointer)&change_signal, NULL, child);
822 actor->time_start_animation = now + fast_rnd(30) + 10;
823 scene->actors = g_slist_append(scene->actors, actor);
864 for (i=0; i<13; i++){
865 actor = init_object(desktop_plugin, "window", "window.png",
866 winds[i][0], winds[i][1], 10, 8, 9,
867 FALSE, TRUE, 100, 255,
868 (gpointer)&change_window1, NULL, NULL);
869 //change_window1(actor, desktop_plugin);
870 actor->time_start_animation = now + fast_rnd(30);
871 scene->actors = g_slist_append(scene->actors, actor);
875 run_long_timeout(desktop_plugin);
878 /*******************************************************************************/
880 init_scene_theme(AWallpaperPlugin *desktop_plugin)
882 void (*func)(gpointer);
883 func = g_hash_table_lookup(desktop_plugin->priv->hash_scene_func, desktop_plugin->priv->theme);
885 (*func)(desktop_plugin);