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 sizes1[4] = {57, 76, 43, 50},
74 /* fprintf(stderr, "init scene accel\n"); */
75 scene = g_new0(Scene, 1);
77 desktop_plugin->priv->scene = scene;
79 actor = init_object(desktop_plugin, "background", "bg.png",
83 scene->actors = g_slist_append(scene->actors, actor);
85 child = g_ptr_array_sized_new(16);
89 str = g_strdup_printf("tape%i.png", n+1);
90 actor = init_object(desktop_plugin, "tape", str,
91 fast_rnd(800), fast_rnd(480), 2+fast_rnd(6), 800, sizes1[n],
94 scene->actors = g_slist_append(scene->actors, actor);
95 g_ptr_array_add(child, actor);
99 actor = init_object(desktop_plugin, "tape", "",
101 FALSE, FALSE, 100, 255,
102 (gpointer)&change_tape, NULL, child);
103 actor->time_start_animation = now;
104 actor->duration_animation = G_MAXINT;
105 scene->actors = g_slist_append(scene->actors, actor);
107 run_long_timeout(desktop_plugin);
109 /*******************************************************************************/
111 parsestring(char *line, char **argv)
113 while (*line != '\0') {
114 while (*line == ' ' || *line == '\n')
115 *line++ = '\0'; /* replace white spaces with 0 */
116 *argv++ = line; /* save the argument position */
117 while (*line != '\0' && *line != ' ' &&
119 line++; /* skip the argument until ... */
121 *argv = '\0'; /* mark the end of argument list */
126 sync_handler(GstBus *bus, GstMessage *message, AWallpaperPlugin *desktop_plugin){
128 if (!desktop_plugin->priv->visible)
129 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PAUSED);
130 if (GST_MESSAGE_TYPE(message) != GST_MESSAGE_ELEMENT){
131 return (GST_BUS_PASS);
133 if (!gst_structure_has_name(message->structure, "prepare-xwindow-id")){
134 return (GST_BUS_PASS);
136 return (GST_BUS_DROP);
140 /*******************************************************************************/
142 bus_call (GstBus *bus, GstMessage *msg, AWallpaperPlugin *desktop_plugin)
144 switch (GST_MESSAGE_TYPE (msg))
146 case GST_MESSAGE_EOS:
147 if (desktop_plugin->priv->rich_animation){
149 GstClockTime nach = (GstClockTime)(0 * GST_MSECOND);
150 if (!gst_element_seek(desktop_plugin->priv->pipeline, 1.0, GST_FORMAT_TIME,
151 (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), GST_SEEK_TYPE_SET,
152 nach, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
153 fprintf(stderr,"ERROR in seek\n");
155 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
158 if (desktop_plugin->priv->pipeline){
159 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);
160 gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
164 case GST_MESSAGE_ERROR: break;
170 /*******************************************************************************/
172 init_scene_External(AWallpaperPlugin *desktop_plugin){
173 //fprintf(stderr,"init_scene_Xsnow\n");
174 char* child_argv[2048];
175 char *run_string = NULL;
176 gchar *exec_path = NULL,
178 if (!desktop_plugin->priv->visible)
181 exec_path = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "exec_path"));
182 window_id = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_id"));
186 run_string = g_strdup_printf("%s %s %d", exec_path, window_id,
187 GDK_WINDOW_XID(desktop_plugin->priv->window->window));
189 run_string = g_strdup_printf("%s", exec_path);
191 fprintf(stderr, "runs string = %s\n", run_string);
192 parsestring(run_string, child_argv);
194 desktop_plugin->priv->running = TRUE;
195 desktop_plugin->priv->podpid = fork();
196 if (desktop_plugin->priv->podpid == 0){
197 execvp(child_argv[0], child_argv);
198 fprintf(stderr,"Problem with new podprocess");
202 /*******************************************************************************/
204 cb_timeout0(AWallpaperPlugin *desktop_plugin) {
206 if (!desktop_plugin || !desktop_plugin->priv->pipeline)
208 if (desktop_plugin->priv->theme_int_parametr1 == 0){
209 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
210 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
211 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
212 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
213 fprintf(stderr,"Error in seek:\n");
217 if (gst_element_get_state (desktop_plugin->priv->pipeline, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE)
220 if (!gst_element_seek((GstElement *)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");
228 /*******************************************************************************/
230 init_scene_Video(AWallpaperPlugin *desktop_plugin)
233 GstElement *videosink;
234 gchar *file_plus_uri;
237 /* fprintf(stderr, "init scene Video \n"); */
238 desktop_plugin->priv->pipeline = gst_pipeline_new("gst-player");
239 bin = gst_element_factory_make ("playbin2", "bin");
240 videosink = gst_element_factory_make ("ximagesink", "videosink");
241 g_object_set (G_OBJECT (bin), "video-sink", videosink, NULL);
242 gst_bin_add (GST_BIN (desktop_plugin->priv->pipeline), bin);
246 bus = gst_pipeline_get_bus (GST_PIPELINE (desktop_plugin->priv->pipeline));
247 gst_bus_add_watch(bus, (GstBusFunc)bus_call, desktop_plugin);
248 gst_object_unref (bus);
250 file_plus_uri = g_strdup_printf("file://%s",desktop_plugin->priv->theme_string_parametr1);
251 g_object_set (G_OBJECT (bin), "uri", file_plus_uri, NULL );
252 g_object_set (G_OBJECT (videosink), "force-aspect-ratio", TRUE, NULL );
254 if (GST_IS_X_OVERLAY (videosink))
255 gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GDK_DRAWABLE_XID(desktop_plugin->priv->window->window));
257 if (desktop_plugin->priv->visible){
258 g_timeout_add(50, (GSourceFunc)cb_timeout0, desktop_plugin);
259 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
262 //gst_element_get_state(deskddtop_plugin->priv->pipeline, NULL, NULL, 100 * GST_MSECOND);
265 /*******************************************************************************/
267 init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
272 gint now = time(NULL);
275 if (desktop_plugin->priv->rich_animation){
283 /* fprintf(stderr, "init scene2 \n"); */
284 scene = g_new0(Scene, 1);
285 //scene.daytime = get_daytime();
286 scene->actors = NULL;
287 desktop_plugin->priv->scene = scene;
289 actor = init_object(desktop_plugin, "background", "bg.png",
291 TRUE, TRUE, 100, 255,
293 scene->actors = g_slist_append(scene->actors, actor);
295 actor = init_object(desktop_plugin, "symbols", "symbols.png",
297 TRUE, TRUE, 100, 255,
299 scene->actors = g_slist_append(scene->actors, actor);
301 child = g_ptr_array_sized_new(4);
302 actor = init_object(desktop_plugin, "layer1", "layer1_2.png",
304 TRUE, TRUE, 100, 255,
306 //actor->time_start_animation = now;
307 //actor->duration_animation = G_MAXINT;
308 scene->actors = g_slist_append(scene->actors, actor);
309 g_ptr_array_add(child, actor);
311 actor = init_object(desktop_plugin, "layer1", "layer1_1.png",
313 TRUE, TRUE, 100, 255,
315 //actor->time_start_animation = now;
316 //actor->duration_animation = G_MAXINT;
317 scene->actors = g_slist_append(scene->actors, actor);
318 g_ptr_array_add(child, actor);
320 actor = init_object(desktop_plugin, "layer2", "layer2_2.png",
322 TRUE, TRUE, 100, 255,
324 //actor->time_start_animation = now;
325 //actor->duration_animation = G_MAXINT;
326 scene->actors = g_slist_append(scene->actors, actor);
327 g_ptr_array_add(child, actor);
329 actor = init_object(desktop_plugin, "layer2", "layer2_1.png",
331 TRUE, TRUE, 100, 255,
333 //actor->time_start_animation = now;
334 //actor->duration_animation = G_MAXINT;
335 scene->actors = g_slist_append(scene->actors, actor);
336 g_ptr_array_add(child, actor);
338 actor = init_object(desktop_plugin, "layers", "",
340 FALSE, FALSE, 100, 255,
341 (gpointer)&change_layer, NULL, child);
342 actor->time_start_animation = now;
343 actor->duration_animation = G_MAXINT;
344 scene->actors = g_slist_append(scene->actors, actor);
346 run_long_timeout(desktop_plugin);
349 /*******************************************************************************/
350 /* Init Modern Scene */
352 init_scene_Modern(AWallpaperPlugin *desktop_plugin)
356 gint now = time(NULL);
361 /* fprintf(stderr, "init scene \n"); */
362 scene = g_new0(Scene, 1);
363 scene->daytime = get_daytime();
364 scene->actors = NULL;
365 scene->wind_orientation = -1;
366 scene->wind_angle = 0.3;
367 /* init value for random */
368 scene->seed = time(NULL);
369 scene->notification = TRUE;
370 desktop_plugin->priv->scene = scene;
371 actor = init_object(desktop_plugin, "sky", "sky0.png",
373 TRUE , TRUE, 100, 255,
374 (gpointer)&change_static_actor, NULL, NULL);
375 scene->actors = g_slist_append(scene->actors, actor);
376 change_static_actor(actor, desktop_plugin);
378 actor = init_object(desktop_plugin, "sun", "sun.png",
380 FALSE, FALSE, 100, 255,
381 (gpointer)&change_sun, NULL, NULL);
382 actor->time_start_animation = now;
383 actor->duration_animation = G_MAXINT;
384 change_sun(actor, desktop_plugin);
385 scene->actors = g_slist_append(scene->actors, actor);
387 //actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
388 // TRUE, 100, 255, NULL, NULL);
389 //scene.actors = g_slist_append(scene.actors, actor);
391 actor = init_object(desktop_plugin, "cloud1", "cloud1.png",
392 0, fast_rnd(300)-97, 7, 150, 97,
393 FALSE, FALSE, 100, 255,
394 (gpointer)&change_cloud, NULL, NULL);
395 actor->time_start_animation = now + fast_rnd(20);
396 actor->duration_animation = 3*60;
397 scene->actors = g_slist_append(scene->actors, actor);
399 actor = init_object(desktop_plugin, "cloud2", "cloud2.png",
400 0, fast_rnd(300)-75, 7, 188, 75,
401 FALSE, FALSE, 100, 255,
402 (gpointer)&change_cloud, NULL, NULL);
403 actor->time_start_animation = now + fast_rnd(40)+10;
404 actor->duration_animation = 3*60;
405 scene->actors = g_slist_append(scene->actors, actor);
407 actor = init_object(desktop_plugin, "cloud4", "cloud4.png",
408 0, fast_rnd(300)-75, 7, 150, 75,
409 FALSE, FALSE, 100, 255,
410 (gpointer)&change_cloud, NULL, NULL);
411 actor->time_start_animation = now + fast_rnd(60) + 20;
412 actor->duration_animation = 5*60;
413 scene->actors = g_slist_append(scene->actors, actor);
416 actor = init_object(desktop_plugin, "town", "town0.png",
418 TRUE, TRUE, 100, 255,
419 (gpointer)&change_static_actor, NULL, NULL);
420 change_static_actor(actor, desktop_plugin);
421 scene->actors = g_slist_append(scene->actors, actor);
423 actor = init_object(desktop_plugin, "stend", "stend0.png",
424 452, 166, 9, 300, 305,
425 TRUE, TRUE, 100, 255,
426 (gpointer)&change_static_actor, NULL, NULL);
427 change_static_actor(actor, desktop_plugin);
428 scene->actors = g_slist_append(scene->actors, actor);
431 child = g_ptr_array_sized_new(4);
432 actor = init_object(desktop_plugin, "call", "call.png",
434 FALSE, TRUE, 100, 255,
436 scene->actors = g_slist_append(scene->actors, actor);
437 g_ptr_array_add(child, actor);
439 actor = init_object(desktop_plugin, "chat", "chat.png",
441 FALSE, TRUE, 100, 255,
443 scene->actors = g_slist_append(scene->actors, actor);
444 g_ptr_array_add(child, actor);
446 actor = init_object(desktop_plugin, "mail", "mail.png",
448 FALSE, TRUE, 100, 255,
450 scene->actors = g_slist_append(scene->actors, actor);
451 g_ptr_array_add(child, actor);
453 actor = init_object(desktop_plugin, "sms", "sms.png",
455 FALSE, TRUE, 100, 255,
457 scene->actors = g_slist_append(scene->actors, actor);
458 g_ptr_array_add(child, actor);
460 actor = init_object(desktop_plugin, "billboard_text", "",
461 470, 174, 9, 300, 108,
462 FALSE, FALSE, 100, 255,
463 (gpointer)&change_billboard, NULL, child);
464 create_hildon_actor_text(actor, desktop_plugin);
465 //actor->time_start_animation = time(NULL) + 20;
466 change_billboard(actor, desktop_plugin);
467 scene->actors = g_slist_append(scene->actors, actor);
469 actor = init_object(desktop_plugin, "tram", "tram.png",
470 -300, 225, 10, 350, 210,
471 FALSE, FALSE, 100, 255,
472 (gpointer)&change_tram, NULL, NULL);
473 actor->time_start_animation = time(NULL) + fast_rnd(10);
474 actor->duration_animation = 60;
475 scene->actors = g_slist_append(scene->actors, actor);
477 actor = init_object(desktop_plugin, "border", "border0.png",
478 0, 480-79, 11, 800, 79,
479 TRUE, TRUE, 100, 255,
480 (gpointer)&change_static_actor_with_corner, NULL, NULL);
481 change_static_actor_with_corner(actor, desktop_plugin);
482 scene->actors = g_slist_append(scene->actors, actor);
484 actor = init_object(desktop_plugin, "moon", "moon1.png",
486 FALSE, FALSE, 100, 255,
487 (gpointer)&change_moon, NULL, NULL);
488 change_moon(actor, desktop_plugin);
489 scene->actors = g_slist_append(scene->actors, actor);
491 actor = init_object(desktop_plugin, "wind", "",
493 FALSE, FALSE, 100, 255,
494 (gpointer)&change_wind, NULL, NULL);
495 change_wind(actor, desktop_plugin);
496 scene->actors = g_slist_append(scene->actors, actor);
498 /* windows in 4-th house */
538 for (i=0; i<13; i++){
539 actor = init_object(desktop_plugin, "window1", "window1.png",
540 winds[i][0], winds[i][1], 8, 8, 10,
541 FALSE, FALSE, 100, 255,
542 (gpointer)&change_window1, NULL, NULL);
543 //change_window1(actor, desktop_plugin);
544 actor->time_start_animation = now + fast_rnd(30);
545 scene->actors = g_slist_append(scene->actors, actor);
549 /* windows in 1-th house */
575 actor = init_object(desktop_plugin, "window2", "window2.png",
576 winds[i][0], winds[i][1], 8, 8, 10,
577 FALSE, FALSE, 100, 255,
578 (gpointer)&change_window1, NULL, NULL);
579 //change_window1(actor, desktop_plugin);
580 actor->time_start_animation = now + fast_rnd(30);
581 scene->actors = g_slist_append(scene->actors, actor);
585 /* windows in 3-th house */
617 for (i=0; i<10; i++){
618 actor = init_object(desktop_plugin, "window3", "window3.png",
619 winds[i][0], winds[i][1], 8, 8, 10,
620 FALSE, FALSE, 100, 255,
621 (gpointer)&change_window1, NULL, NULL);
622 //change_window1(actor, desktop_plugin);
623 actor->time_start_animation = now + fast_rnd(30);
624 scene->actors = g_slist_append(scene->actors, actor);
628 /* windows in 5-th house */
652 actor = init_object(desktop_plugin, "window4", "window4.png",
653 winds[i][0], winds[i][1], 8, 8, 10,
654 FALSE, FALSE, 100, 255,
655 (gpointer)&change_window1, NULL, NULL);
656 //change_window1(actor, desktop_plugin);
657 actor->time_start_animation = now + fast_rnd(30);
658 scene->actors = g_slist_append(scene->actors, actor);
662 /* windows in 6-th house */
683 actor = init_object(desktop_plugin, "window5", "window5.png",
684 winds[i][0], winds[i][1], 8, 8, 10,
685 FALSE, FALSE, 100, 255,
686 (gpointer)&change_window1, NULL, NULL);
687 //change_window1(actor, desktop_plugin);
688 actor->time_start_animation = now + fast_rnd(30);
689 scene->actors = g_slist_append(scene->actors, actor);
692 run_long_timeout(desktop_plugin);
695 anim = g_new0(Animation, 1);
698 anim->func_change = &change_tram;
699 anim->func_time = NULL;
700 anim->timestart = time(NULL);
703 scene.dynamic_actors = g_slist_append(scene.dynamic_actors, anim);
706 /*******************************************************************************/
707 /* Init Berlin Scene */
709 init_scene_Berlin(AWallpaperPlugin *desktop_plugin)
711 Actor *actor, *actor1, *actor2;
713 gint now = time(NULL);
716 GPtrArray *child = NULL;
718 scene = g_new0(Scene, 1);
719 scene->daytime = get_daytime();
720 scene->actors = NULL;
721 scene->wind_orientation = -1;
722 scene->wind_angle = 0.3;
723 /* init value for random */
724 scene->seed = time(NULL);
725 desktop_plugin->priv->scene = scene;
727 actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480,
728 TRUE, TRUE, 100, 255,
729 (gpointer)&change_static_actor, NULL, NULL);
730 change_static_actor(actor, desktop_plugin);
731 scene->actors = g_slist_append(scene->actors, actor);
734 actor = init_object(desktop_plugin, "sun", "sun.png", 0, 0, 6, 88, 88,
735 FALSE, FALSE, 100, 255,
736 (gpointer)&change_sun, NULL, NULL);
737 actor->time_start_animation = time(NULL);
738 actor->duration_animation = G_MAXINT;
739 change_sun(actor, desktop_plugin);
740 scene->actors = g_slist_append(scene->actors, actor);
743 actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
744 TRUE, 100, 255, NULL, NULL);
745 scene.actors = g_slist_append(scene.actors, actor);
748 actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60,
749 FALSE, FALSE, 100, 255,
750 (gpointer)&change_moon, NULL, NULL);
751 change_moon(actor, desktop_plugin);
752 scene->actors = g_slist_append(scene->actors, actor);
754 actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97,
755 FALSE, FALSE, 100, 255,
756 (gpointer)&change_cloud, NULL, NULL);
757 actor->time_start_animation = now + fast_rnd(30) + 10;
758 actor->duration_animation = 3*60;
759 scene->actors = g_slist_append(scene->actors, actor);
761 actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75,
762 FALSE, FALSE, 100, 255,
763 (gpointer)&change_cloud, NULL, NULL);
764 actor->time_start_animation = now + fast_rnd(10);
765 actor->duration_animation = 3*60;
766 scene->actors = g_slist_append(scene->actors, actor);
768 actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75,
769 FALSE, FALSE, 100, 255,
770 (gpointer)&change_cloud, NULL, NULL);
771 actor->time_start_animation = now + fast_rnd(60) + 20;
772 actor->duration_animation = 5*60;
773 scene->actors = g_slist_append(scene->actors, actor);
776 actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 8, 160, 50,
777 FALSE, FALSE, 100, 255,
778 (gpointer)&change_plane2, NULL, NULL);
779 actor->time_start_animation = now + fast_rnd(40) + 20;
780 actor->duration_animation = 60;
781 scene->actors = g_slist_append(scene->actors, actor);
783 actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116,
784 FALSE, FALSE, 100, 255,
785 (gpointer)&change_plane1, NULL, NULL);
786 actor->time_start_animation = now + fast_rnd(20);
787 actor->duration_animation = 30;
788 scene->actors = g_slist_append(scene->actors, actor);
790 actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480,
791 TRUE, TRUE, 100, 255,
792 (gpointer)&change_static_actor_with_corner, NULL, NULL);
793 change_static_actor_with_corner(actor, desktop_plugin);
794 scene->actors = g_slist_append(scene->actors, actor);
796 actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0,
797 FALSE, FALSE, 100, 255,
798 (gpointer)&change_wind, NULL, NULL);
799 change_wind(actor, desktop_plugin);
800 scene->actors = g_slist_append(scene->actors, actor);
802 actor1 = init_object(desktop_plugin, "signal_red", "red.png",
803 486, 425, 10, 18, 38,
804 FALSE, TRUE, 100, 255, NULL, NULL, NULL);
805 //actor->time_start_animation = now + fast_rnd(30) + 10;
806 scene->actors = g_slist_append(scene->actors, actor1);
808 actor2 = init_object(desktop_plugin, "signal_green", "green.png",
809 486, 425, 10, 18, 38,
810 TRUE, TRUE, 100, 255, NULL, NULL, NULL);
811 //actor->time_start_animation = now + fast_rnd(30) + 10;
812 scene->actors = g_slist_append(scene->actors, actor2);
813 child = g_ptr_array_sized_new(2);
814 g_ptr_array_add(child, actor1);
815 g_ptr_array_add(child, actor2);
816 actor = init_object(desktop_plugin, "signal", "",
817 486, 425, 10, 18, 38,
818 FALSE, FALSE, 100, 255,
819 (gpointer)&change_signal, NULL, child);
820 actor->time_start_animation = now + fast_rnd(30) + 10;
821 scene->actors = g_slist_append(scene->actors, actor);
862 for (i=0; i<13; i++){
863 actor = init_object(desktop_plugin, "window", "window.png",
864 winds[i][0], winds[i][1], 10, 8, 9,
865 FALSE, TRUE, 100, 255,
866 (gpointer)&change_window1, NULL, NULL);
867 //change_window1(actor, desktop_plugin);
868 actor->time_start_animation = now + fast_rnd(30);
869 scene->actors = g_slist_append(scene->actors, actor);
873 run_long_timeout(desktop_plugin);
876 /*******************************************************************************/
878 init_scene_theme(AWallpaperPlugin *desktop_plugin)
881 void (*func)(gpointer);
882 func = g_hash_table_lookup(desktop_plugin->priv->hash_scene_func, desktop_plugin->priv->theme);
884 (*func)(desktop_plugin);
887 fprintf(stderr, "Init_scene_theme\n");
888 void (*func)(gpointer);
889 func = desktop_plugin->priv->scene_func;
891 fprintf(stderr, "Success init_scene_theme\n");
892 (*func)(desktop_plugin);