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){
182 //fprintf(stderr,"init_scene_Xsnow\n");
183 char* child_argv[2048];
184 char *run_string = NULL;
185 gchar *exec_path = NULL,
187 if (!desktop_plugin->priv->visible)
190 exec_path = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "exec_path"));
191 window_id = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_id"));
195 run_string = g_strdup_printf("%s %s %d -view %i", exec_path, window_id,
196 GDK_WINDOW_XID(desktop_plugin->priv->window->window), desktop_plugin->priv->view);
198 run_string = g_strdup_printf("%s", exec_path);
200 fprintf(stderr, "runs string = %s\n", run_string);
201 parsestring(run_string, child_argv);
203 desktop_plugin->priv->running = TRUE;
204 desktop_plugin->priv->podpid = fork();
205 if (desktop_plugin->priv->podpid == 0){
206 execvp(child_argv[0], child_argv);
207 fprintf(stderr,"Problem with new podprocess");
211 /*******************************************************************************/
213 cb_timeout0(AWallpaperPlugin *desktop_plugin) {
215 if (!desktop_plugin || !desktop_plugin->priv->pipeline)
217 if (desktop_plugin->priv->theme_int_parametr1 == 0){
218 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
219 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
220 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
221 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
222 fprintf(stderr,"Error in seek:\n");
226 if (gst_element_get_state (desktop_plugin->priv->pipeline, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE)
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 /*******************************************************************************/
239 init_scene_Video(AWallpaperPlugin *desktop_plugin)
242 GstElement *videosink;
243 gchar *file_plus_uri;
246 /* fprintf(stderr, "init scene Video \n"); */
247 desktop_plugin->priv->pipeline = gst_pipeline_new("gst-player");
248 bin = gst_element_factory_make ("playbin2", "bin");
249 videosink = gst_element_factory_make ("ximagesink", "videosink");
250 g_object_set (G_OBJECT (bin), "video-sink", videosink, NULL);
251 gst_bin_add (GST_BIN (desktop_plugin->priv->pipeline), bin);
255 bus = gst_pipeline_get_bus (GST_PIPELINE (desktop_plugin->priv->pipeline));
256 gst_bus_add_watch(bus, (GstBusFunc)bus_call, desktop_plugin);
257 gst_object_unref (bus);
259 file_plus_uri = g_strdup_printf("file://%s",desktop_plugin->priv->theme_string_parametr1);
260 g_object_set (G_OBJECT (bin), "uri", file_plus_uri, NULL );
261 g_object_set (G_OBJECT (videosink), "force-aspect-ratio", TRUE, NULL );
263 if (GST_IS_X_OVERLAY (videosink))
264 gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GDK_DRAWABLE_XID(desktop_plugin->priv->window->window));
266 if (desktop_plugin->priv->visible){
267 g_timeout_add(50, (GSourceFunc)cb_timeout0, desktop_plugin);
268 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
271 //gst_element_get_state(deskddtop_plugin->priv->pipeline, NULL, NULL, 100 * GST_MSECOND);
274 /*******************************************************************************/
276 init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
281 gint now = time(NULL);
284 if (desktop_plugin->priv->rich_animation){
292 /* fprintf(stderr, "init scene2 \n"); */
293 scene = g_new0(Scene, 1);
294 //scene.daytime = get_daytime();
295 scene->actors = NULL;
296 desktop_plugin->priv->scene = scene;
298 actor = init_object(desktop_plugin, "background", "bg.png",
300 TRUE, TRUE, 100, 255,
302 scene->actors = g_slist_append(scene->actors, actor);
304 actor = init_object(desktop_plugin, "symbols", "symbols.png",
306 TRUE, TRUE, 100, 255,
308 scene->actors = g_slist_append(scene->actors, actor);
310 child = g_ptr_array_sized_new(4);
311 actor = init_object(desktop_plugin, "layer1", "layer1_2.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, "layer1", "layer1_1.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_2.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, "layer2", "layer2_1.png",
340 TRUE, TRUE, 100, 255,
342 //actor->time_start_animation = now;
343 //actor->duration_animation = G_MAXINT;
344 scene->actors = g_slist_append(scene->actors, actor);
345 g_ptr_array_add(child, actor);
347 actor = init_object(desktop_plugin, "layers", "",
349 FALSE, FALSE, 100, 255,
350 (gpointer)&change_layer, NULL, child);
351 actor->time_start_animation = now;
352 actor->duration_animation = G_MAXINT;
353 scene->actors = g_slist_append(scene->actors, actor);
355 run_long_timeout(desktop_plugin);
358 /*******************************************************************************/
359 /* Init Modern Scene */
361 init_scene_Modern(AWallpaperPlugin *desktop_plugin)
365 gint now = time(NULL);
370 /* fprintf(stderr, "init scene \n"); */
371 scene = g_new0(Scene, 1);
372 scene->daytime = get_daytime();
373 scene->actors = NULL;
374 scene->wind_orientation = -1;
375 scene->wind_angle = 0.3;
376 /* init value for random */
377 scene->seed = time(NULL);
378 scene->notification = TRUE;
379 desktop_plugin->priv->scene = scene;
380 actor = init_object(desktop_plugin, "sky", "sky0.png",
382 TRUE , TRUE, 100, 255,
383 (gpointer)&change_static_actor, NULL, NULL);
384 scene->actors = g_slist_append(scene->actors, actor);
385 change_static_actor(actor, desktop_plugin);
387 actor = init_object(desktop_plugin, "sun", "sun.png",
389 FALSE, FALSE, 100, 255,
390 (gpointer)&change_sun, NULL, NULL);
391 actor->time_start_animation = now;
392 actor->duration_animation = G_MAXINT;
393 change_sun(actor, desktop_plugin);
394 scene->actors = g_slist_append(scene->actors, actor);
396 //actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
397 // TRUE, 100, 255, NULL, NULL);
398 //scene.actors = g_slist_append(scene.actors, actor);
400 actor = init_object(desktop_plugin, "cloud1", "cloud1.png",
401 0, fast_rnd(300)-97, 7, 150, 97,
402 FALSE, FALSE, 100, 255,
403 (gpointer)&change_cloud, NULL, NULL);
404 actor->time_start_animation = now + fast_rnd(20);
405 actor->duration_animation = 3*60;
406 scene->actors = g_slist_append(scene->actors, actor);
408 actor = init_object(desktop_plugin, "cloud2", "cloud2.png",
409 0, fast_rnd(300)-75, 7, 188, 75,
410 FALSE, FALSE, 100, 255,
411 (gpointer)&change_cloud, NULL, NULL);
412 actor->time_start_animation = now + fast_rnd(40)+10;
413 actor->duration_animation = 3*60;
414 scene->actors = g_slist_append(scene->actors, actor);
416 actor = init_object(desktop_plugin, "cloud4", "cloud4.png",
417 0, fast_rnd(300)-75, 7, 150, 75,
418 FALSE, FALSE, 100, 255,
419 (gpointer)&change_cloud, NULL, NULL);
420 actor->time_start_animation = now + fast_rnd(60) + 20;
421 actor->duration_animation = 5*60;
422 scene->actors = g_slist_append(scene->actors, actor);
425 actor = init_object(desktop_plugin, "town", "town0.png",
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);
432 actor = init_object(desktop_plugin, "stend", "stend0.png",
433 452, 166, 9, 300, 305,
434 TRUE, TRUE, 100, 255,
435 (gpointer)&change_static_actor, NULL, NULL);
436 change_static_actor(actor, desktop_plugin);
437 scene->actors = g_slist_append(scene->actors, actor);
440 child = g_ptr_array_sized_new(4);
441 actor = init_object(desktop_plugin, "call", "call.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, "chat", "chat.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, "mail", "mail.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, "sms", "sms.png",
464 FALSE, TRUE, 100, 255,
466 scene->actors = g_slist_append(scene->actors, actor);
467 g_ptr_array_add(child, actor);
469 actor = init_object(desktop_plugin, "billboard_text", "",
470 470, 174, 9, 300, 108,
471 FALSE, FALSE, 100, 255,
472 (gpointer)&change_billboard, NULL, child);
473 create_hildon_actor_text(actor, desktop_plugin);
474 //actor->time_start_animation = time(NULL) + 20;
475 change_billboard(actor, desktop_plugin);
476 scene->actors = g_slist_append(scene->actors, actor);
478 actor = init_object(desktop_plugin, "tram", "tram.png",
479 -300, 225, 10, 350, 210,
480 FALSE, FALSE, 100, 255,
481 (gpointer)&change_tram, NULL, NULL);
482 actor->time_start_animation = time(NULL) + fast_rnd(10);
483 actor->duration_animation = 60;
484 scene->actors = g_slist_append(scene->actors, actor);
486 actor = init_object(desktop_plugin, "border", "border0.png",
487 0, 480-79, 11, 800, 79,
488 TRUE, TRUE, 100, 255,
489 (gpointer)&change_static_actor_with_corner, NULL, NULL);
490 change_static_actor_with_corner(actor, desktop_plugin);
491 scene->actors = g_slist_append(scene->actors, actor);
493 actor = init_object(desktop_plugin, "moon", "moon1.png",
495 FALSE, FALSE, 100, 255,
496 (gpointer)&change_moon, NULL, NULL);
497 change_moon(actor, desktop_plugin);
498 scene->actors = g_slist_append(scene->actors, actor);
500 actor = init_object(desktop_plugin, "wind", "",
502 FALSE, FALSE, 100, 255,
503 (gpointer)&change_wind, NULL, NULL);
504 change_wind(actor, desktop_plugin);
505 scene->actors = g_slist_append(scene->actors, actor);
507 /* windows in 4-th house */
547 for (i=0; i<13; i++){
548 actor = init_object(desktop_plugin, "window1", "window1.png",
549 winds[i][0], winds[i][1], 8, 8, 10,
550 FALSE, FALSE, 100, 255,
551 (gpointer)&change_window1, NULL, NULL);
552 //change_window1(actor, desktop_plugin);
553 actor->time_start_animation = now + fast_rnd(30);
554 scene->actors = g_slist_append(scene->actors, actor);
558 /* windows in 1-th house */
584 actor = init_object(desktop_plugin, "window2", "window2.png",
585 winds[i][0], winds[i][1], 8, 8, 10,
586 FALSE, FALSE, 100, 255,
587 (gpointer)&change_window1, NULL, NULL);
588 //change_window1(actor, desktop_plugin);
589 actor->time_start_animation = now + fast_rnd(30);
590 scene->actors = g_slist_append(scene->actors, actor);
594 /* windows in 3-th house */
626 for (i=0; i<10; i++){
627 actor = init_object(desktop_plugin, "window3", "window3.png",
628 winds[i][0], winds[i][1], 8, 8, 10,
629 FALSE, FALSE, 100, 255,
630 (gpointer)&change_window1, NULL, NULL);
631 //change_window1(actor, desktop_plugin);
632 actor->time_start_animation = now + fast_rnd(30);
633 scene->actors = g_slist_append(scene->actors, actor);
637 /* windows in 5-th house */
661 actor = init_object(desktop_plugin, "window4", "window4.png",
662 winds[i][0], winds[i][1], 8, 8, 10,
663 FALSE, FALSE, 100, 255,
664 (gpointer)&change_window1, NULL, NULL);
665 //change_window1(actor, desktop_plugin);
666 actor->time_start_animation = now + fast_rnd(30);
667 scene->actors = g_slist_append(scene->actors, actor);
671 /* windows in 6-th house */
692 actor = init_object(desktop_plugin, "window5", "window5.png",
693 winds[i][0], winds[i][1], 8, 8, 10,
694 FALSE, FALSE, 100, 255,
695 (gpointer)&change_window1, NULL, NULL);
696 //change_window1(actor, desktop_plugin);
697 actor->time_start_animation = now + fast_rnd(30);
698 scene->actors = g_slist_append(scene->actors, actor);
701 run_long_timeout(desktop_plugin);
704 anim = g_new0(Animation, 1);
707 anim->func_change = &change_tram;
708 anim->func_time = NULL;
709 anim->timestart = time(NULL);
712 scene.dynamic_actors = g_slist_append(scene.dynamic_actors, anim);
715 /*******************************************************************************/
716 /* Init Berlin Scene */
718 init_scene_Berlin(AWallpaperPlugin *desktop_plugin)
720 Actor *actor, *actor1, *actor2;
722 gint now = time(NULL);
725 GPtrArray *child = NULL;
727 scene = g_new0(Scene, 1);
728 scene->daytime = get_daytime();
729 scene->actors = NULL;
730 scene->wind_orientation = -1;
731 scene->wind_angle = 0.3;
732 /* init value for random */
733 scene->seed = time(NULL);
734 desktop_plugin->priv->scene = scene;
736 actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480,
737 TRUE, TRUE, 100, 255,
738 (gpointer)&change_static_actor, NULL, NULL);
739 change_static_actor(actor, desktop_plugin);
740 scene->actors = g_slist_append(scene->actors, actor);
743 actor = init_object(desktop_plugin, "sun", "sun.png", 0, 0, 6, 88, 88,
744 FALSE, FALSE, 100, 255,
745 (gpointer)&change_sun, NULL, NULL);
746 actor->time_start_animation = time(NULL);
747 actor->duration_animation = G_MAXINT;
748 change_sun(actor, desktop_plugin);
749 scene->actors = g_slist_append(scene->actors, actor);
752 actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
753 TRUE, 100, 255, NULL, NULL);
754 scene.actors = g_slist_append(scene.actors, actor);
757 actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60,
758 FALSE, FALSE, 100, 255,
759 (gpointer)&change_moon, NULL, NULL);
760 change_moon(actor, desktop_plugin);
761 scene->actors = g_slist_append(scene->actors, actor);
763 actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97,
764 FALSE, FALSE, 100, 255,
765 (gpointer)&change_cloud, NULL, NULL);
766 actor->time_start_animation = now + fast_rnd(30) + 10;
767 actor->duration_animation = 3*60;
768 scene->actors = g_slist_append(scene->actors, actor);
770 actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75,
771 FALSE, FALSE, 100, 255,
772 (gpointer)&change_cloud, NULL, NULL);
773 actor->time_start_animation = now + fast_rnd(10);
774 actor->duration_animation = 3*60;
775 scene->actors = g_slist_append(scene->actors, actor);
777 actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75,
778 FALSE, FALSE, 100, 255,
779 (gpointer)&change_cloud, NULL, NULL);
780 actor->time_start_animation = now + fast_rnd(60) + 20;
781 actor->duration_animation = 5*60;
782 scene->actors = g_slist_append(scene->actors, actor);
785 actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 8, 160, 50,
786 FALSE, FALSE, 100, 255,
787 (gpointer)&change_plane2, NULL, NULL);
788 actor->time_start_animation = now + fast_rnd(40) + 20;
789 actor->duration_animation = 60;
790 scene->actors = g_slist_append(scene->actors, actor);
792 actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116,
793 FALSE, FALSE, 100, 255,
794 (gpointer)&change_plane1, NULL, NULL);
795 actor->time_start_animation = now + fast_rnd(20);
796 actor->duration_animation = 30;
797 scene->actors = g_slist_append(scene->actors, actor);
799 actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480,
800 TRUE, TRUE, 100, 255,
801 (gpointer)&change_static_actor_with_corner, NULL, NULL);
802 change_static_actor_with_corner(actor, desktop_plugin);
803 scene->actors = g_slist_append(scene->actors, actor);
805 actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0,
806 FALSE, FALSE, 100, 255,
807 (gpointer)&change_wind, NULL, NULL);
808 change_wind(actor, desktop_plugin);
809 scene->actors = g_slist_append(scene->actors, actor);
811 actor1 = init_object(desktop_plugin, "signal_red", "red.png",
812 486, 425, 10, 18, 38,
813 FALSE, TRUE, 100, 255, NULL, NULL, NULL);
814 //actor->time_start_animation = now + fast_rnd(30) + 10;
815 scene->actors = g_slist_append(scene->actors, actor1);
817 actor2 = init_object(desktop_plugin, "signal_green", "green.png",
818 486, 425, 10, 18, 38,
819 TRUE, TRUE, 100, 255, NULL, NULL, NULL);
820 //actor->time_start_animation = now + fast_rnd(30) + 10;
821 scene->actors = g_slist_append(scene->actors, actor2);
822 child = g_ptr_array_sized_new(2);
823 g_ptr_array_add(child, actor1);
824 g_ptr_array_add(child, actor2);
825 actor = init_object(desktop_plugin, "signal", "",
826 486, 425, 10, 18, 38,
827 FALSE, FALSE, 100, 255,
828 (gpointer)&change_signal, NULL, child);
829 actor->time_start_animation = now + fast_rnd(30) + 10;
830 scene->actors = g_slist_append(scene->actors, actor);
871 for (i=0; i<13; i++){
872 actor = init_object(desktop_plugin, "window", "window.png",
873 winds[i][0], winds[i][1], 10, 8, 9,
874 FALSE, TRUE, 100, 255,
875 (gpointer)&change_window1, NULL, NULL);
876 //change_window1(actor, desktop_plugin);
877 actor->time_start_animation = now + fast_rnd(30);
878 scene->actors = g_slist_append(scene->actors, actor);
882 run_long_timeout(desktop_plugin);
885 /*******************************************************************************/
887 init_scene_theme(AWallpaperPlugin *desktop_plugin)
890 void (*func)(gpointer);
891 func = g_hash_table_lookup(desktop_plugin->priv->hash_scene_func, desktop_plugin->priv->theme);
893 (*func)(desktop_plugin);
896 fprintf(stderr, "Init_scene_theme\n");
897 void (*func)(gpointer);
898 func = desktop_plugin->priv->scene_func;
900 fprintf(stderr, "Success init_scene_theme\n");
901 (*func)(desktop_plugin);