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,
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));
204 strview = g_strdup_printf(" %s %i", view, desktop_plugin->priv->view);
206 run_string = g_strdup_printf("%s%s%s", exec_path, strwin, strview);
207 fprintf(stderr, "runs string = %s\n", run_string);
208 parsestring(run_string, child_argv);
210 desktop_plugin->priv->running = TRUE;
211 desktop_plugin->priv->podpid = fork();
212 if (desktop_plugin->priv->podpid == 0){
213 execvp(child_argv[0], child_argv);
214 fprintf(stderr,"Problem with new podprocess");
218 /*******************************************************************************/
220 cb_timeout0(AWallpaperPlugin *desktop_plugin) {
222 if (!desktop_plugin || !desktop_plugin->priv->pipeline)
224 if (desktop_plugin->priv->theme_int_parametr1 == 0){
225 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
226 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
227 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
228 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
229 fprintf(stderr,"Error in seek:\n");
233 if (gst_element_get_state (desktop_plugin->priv->pipeline, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE)
236 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
237 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
238 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
239 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
240 fprintf(stderr,"Error in seek:\n");
244 /*******************************************************************************/
246 init_scene_Video(AWallpaperPlugin *desktop_plugin)
249 GstElement *videosink;
250 gchar *file_plus_uri;
253 /* fprintf(stderr, "init scene Video \n"); */
254 desktop_plugin->priv->pipeline = gst_pipeline_new("gst-player");
255 bin = gst_element_factory_make ("playbin2", "bin");
256 videosink = gst_element_factory_make ("ximagesink", "videosink");
257 g_object_set (G_OBJECT (bin), "video-sink", videosink, NULL);
258 gst_bin_add (GST_BIN (desktop_plugin->priv->pipeline), bin);
262 bus = gst_pipeline_get_bus (GST_PIPELINE (desktop_plugin->priv->pipeline));
263 gst_bus_add_watch(bus, (GstBusFunc)bus_call, desktop_plugin);
264 gst_object_unref (bus);
266 file_plus_uri = g_strdup_printf("file://%s",desktop_plugin->priv->theme_string_parametr1);
267 g_object_set (G_OBJECT (bin), "uri", file_plus_uri, NULL );
268 g_object_set (G_OBJECT (videosink), "force-aspect-ratio", TRUE, NULL );
270 if (GST_IS_X_OVERLAY (videosink))
271 gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GDK_DRAWABLE_XID(desktop_plugin->priv->window->window));
273 if (desktop_plugin->priv->visible){
274 g_timeout_add(50, (GSourceFunc)cb_timeout0, desktop_plugin);
275 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
278 //gst_element_get_state(deskddtop_plugin->priv->pipeline, NULL, NULL, 100 * GST_MSECOND);
281 /*******************************************************************************/
283 init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
288 gint now = time(NULL);
291 if (desktop_plugin->priv->rich_animation){
299 /* fprintf(stderr, "init scene2 \n"); */
300 scene = g_new0(Scene, 1);
301 //scene.daytime = get_daytime();
302 scene->actors = NULL;
303 desktop_plugin->priv->scene = scene;
305 actor = init_object(desktop_plugin, "background", "bg.png",
307 TRUE, TRUE, 100, 255,
309 scene->actors = g_slist_append(scene->actors, actor);
311 actor = init_object(desktop_plugin, "symbols", "symbols.png",
313 TRUE, TRUE, 100, 255,
315 scene->actors = g_slist_append(scene->actors, actor);
317 child = g_ptr_array_sized_new(4);
318 actor = init_object(desktop_plugin, "layer1", "layer1_2.png",
320 TRUE, TRUE, 100, 255,
322 //actor->time_start_animation = now;
323 //actor->duration_animation = G_MAXINT;
324 scene->actors = g_slist_append(scene->actors, actor);
325 g_ptr_array_add(child, actor);
327 actor = init_object(desktop_plugin, "layer1", "layer1_1.png",
329 TRUE, TRUE, 100, 255,
331 //actor->time_start_animation = now;
332 //actor->duration_animation = G_MAXINT;
333 scene->actors = g_slist_append(scene->actors, actor);
334 g_ptr_array_add(child, actor);
336 actor = init_object(desktop_plugin, "layer2", "layer2_2.png",
338 TRUE, TRUE, 100, 255,
340 //actor->time_start_animation = now;
341 //actor->duration_animation = G_MAXINT;
342 scene->actors = g_slist_append(scene->actors, actor);
343 g_ptr_array_add(child, actor);
345 actor = init_object(desktop_plugin, "layer2", "layer2_1.png",
347 TRUE, TRUE, 100, 255,
349 //actor->time_start_animation = now;
350 //actor->duration_animation = G_MAXINT;
351 scene->actors = g_slist_append(scene->actors, actor);
352 g_ptr_array_add(child, actor);
354 actor = init_object(desktop_plugin, "layers", "",
356 FALSE, FALSE, 100, 255,
357 (gpointer)&change_layer, NULL, child);
358 actor->time_start_animation = now;
359 actor->duration_animation = G_MAXINT;
360 scene->actors = g_slist_append(scene->actors, actor);
362 run_long_timeout(desktop_plugin);
365 /*******************************************************************************/
366 /* Init Modern Scene */
368 init_scene_Modern(AWallpaperPlugin *desktop_plugin)
372 gint now = time(NULL);
377 /* fprintf(stderr, "init scene \n"); */
378 scene = g_new0(Scene, 1);
379 scene->daytime = get_daytime();
380 scene->actors = NULL;
381 scene->wind_orientation = -1;
382 scene->wind_angle = 0.3;
383 /* init value for random */
384 scene->seed = time(NULL);
385 scene->notification = TRUE;
386 desktop_plugin->priv->scene = scene;
387 actor = init_object(desktop_plugin, "sky", "sky0.png",
389 TRUE , TRUE, 100, 255,
390 (gpointer)&change_static_actor, NULL, NULL);
391 scene->actors = g_slist_append(scene->actors, actor);
392 change_static_actor(actor, desktop_plugin);
394 actor = init_object(desktop_plugin, "sun", "sun.png",
396 FALSE, FALSE, 100, 255,
397 (gpointer)&change_sun, NULL, NULL);
398 actor->time_start_animation = now;
399 actor->duration_animation = G_MAXINT;
400 change_sun(actor, desktop_plugin);
401 scene->actors = g_slist_append(scene->actors, actor);
403 //actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
404 // TRUE, 100, 255, NULL, NULL);
405 //scene.actors = g_slist_append(scene.actors, actor);
407 actor = init_object(desktop_plugin, "cloud1", "cloud1.png",
408 0, fast_rnd(300)-97, 7, 150, 97,
409 FALSE, FALSE, 100, 255,
410 (gpointer)&change_cloud, NULL, NULL);
411 actor->time_start_animation = now + fast_rnd(20);
412 actor->duration_animation = 3*60;
413 scene->actors = g_slist_append(scene->actors, actor);
415 actor = init_object(desktop_plugin, "cloud2", "cloud2.png",
416 0, fast_rnd(300)-75, 7, 188, 75,
417 FALSE, FALSE, 100, 255,
418 (gpointer)&change_cloud, NULL, NULL);
419 actor->time_start_animation = now + fast_rnd(40)+10;
420 actor->duration_animation = 3*60;
421 scene->actors = g_slist_append(scene->actors, actor);
423 actor = init_object(desktop_plugin, "cloud4", "cloud4.png",
424 0, fast_rnd(300)-75, 7, 150, 75,
425 FALSE, FALSE, 100, 255,
426 (gpointer)&change_cloud, NULL, NULL);
427 actor->time_start_animation = now + fast_rnd(60) + 20;
428 actor->duration_animation = 5*60;
429 scene->actors = g_slist_append(scene->actors, actor);
432 actor = init_object(desktop_plugin, "town", "town0.png",
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);
439 actor = init_object(desktop_plugin, "stend", "stend0.png",
440 452, 166, 9, 300, 305,
441 TRUE, TRUE, 100, 255,
442 (gpointer)&change_static_actor, NULL, NULL);
443 change_static_actor(actor, desktop_plugin);
444 scene->actors = g_slist_append(scene->actors, actor);
447 child = g_ptr_array_sized_new(4);
448 actor = init_object(desktop_plugin, "call", "call.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, "chat", "chat.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, "mail", "mail.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, "sms", "sms.png",
471 FALSE, TRUE, 100, 255,
473 scene->actors = g_slist_append(scene->actors, actor);
474 g_ptr_array_add(child, actor);
476 actor = init_object(desktop_plugin, "billboard_text", "",
477 470, 174, 9, 300, 108,
478 FALSE, FALSE, 100, 255,
479 (gpointer)&change_billboard, NULL, child);
480 create_hildon_actor_text(actor, desktop_plugin);
481 //actor->time_start_animation = time(NULL) + 20;
482 change_billboard(actor, desktop_plugin);
483 scene->actors = g_slist_append(scene->actors, actor);
485 actor = init_object(desktop_plugin, "tram", "tram.png",
486 -300, 225, 10, 350, 210,
487 FALSE, FALSE, 100, 255,
488 (gpointer)&change_tram, NULL, NULL);
489 actor->time_start_animation = time(NULL) + fast_rnd(10);
490 actor->duration_animation = 60;
491 scene->actors = g_slist_append(scene->actors, actor);
493 actor = init_object(desktop_plugin, "border", "border0.png",
494 0, 480-79, 11, 800, 79,
495 TRUE, TRUE, 100, 255,
496 (gpointer)&change_static_actor_with_corner, NULL, NULL);
497 change_static_actor_with_corner(actor, desktop_plugin);
498 scene->actors = g_slist_append(scene->actors, actor);
500 actor = init_object(desktop_plugin, "moon", "moon1.png",
502 FALSE, FALSE, 100, 255,
503 (gpointer)&change_moon, NULL, NULL);
504 change_moon(actor, desktop_plugin);
505 scene->actors = g_slist_append(scene->actors, actor);
507 actor = init_object(desktop_plugin, "wind", "",
509 FALSE, FALSE, 100, 255,
510 (gpointer)&change_wind, NULL, NULL);
511 change_wind(actor, desktop_plugin);
512 scene->actors = g_slist_append(scene->actors, actor);
514 /* windows in 4-th house */
554 for (i=0; i<13; i++){
555 actor = init_object(desktop_plugin, "window1", "window1.png",
556 winds[i][0], winds[i][1], 8, 8, 10,
557 FALSE, FALSE, 100, 255,
558 (gpointer)&change_window1, NULL, NULL);
559 //change_window1(actor, desktop_plugin);
560 actor->time_start_animation = now + fast_rnd(30);
561 scene->actors = g_slist_append(scene->actors, actor);
565 /* windows in 1-th house */
591 actor = init_object(desktop_plugin, "window2", "window2.png",
592 winds[i][0], winds[i][1], 8, 8, 10,
593 FALSE, FALSE, 100, 255,
594 (gpointer)&change_window1, NULL, NULL);
595 //change_window1(actor, desktop_plugin);
596 actor->time_start_animation = now + fast_rnd(30);
597 scene->actors = g_slist_append(scene->actors, actor);
601 /* windows in 3-th house */
633 for (i=0; i<10; i++){
634 actor = init_object(desktop_plugin, "window3", "window3.png",
635 winds[i][0], winds[i][1], 8, 8, 10,
636 FALSE, FALSE, 100, 255,
637 (gpointer)&change_window1, NULL, NULL);
638 //change_window1(actor, desktop_plugin);
639 actor->time_start_animation = now + fast_rnd(30);
640 scene->actors = g_slist_append(scene->actors, actor);
644 /* windows in 5-th house */
668 actor = init_object(desktop_plugin, "window4", "window4.png",
669 winds[i][0], winds[i][1], 8, 8, 10,
670 FALSE, FALSE, 100, 255,
671 (gpointer)&change_window1, NULL, NULL);
672 //change_window1(actor, desktop_plugin);
673 actor->time_start_animation = now + fast_rnd(30);
674 scene->actors = g_slist_append(scene->actors, actor);
678 /* windows in 6-th house */
699 actor = init_object(desktop_plugin, "window5", "window5.png",
700 winds[i][0], winds[i][1], 8, 8, 10,
701 FALSE, FALSE, 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);
708 run_long_timeout(desktop_plugin);
711 anim = g_new0(Animation, 1);
714 anim->func_change = &change_tram;
715 anim->func_time = NULL;
716 anim->timestart = time(NULL);
719 scene.dynamic_actors = g_slist_append(scene.dynamic_actors, anim);
722 /*******************************************************************************/
723 /* Init Berlin Scene */
725 init_scene_Berlin(AWallpaperPlugin *desktop_plugin)
727 Actor *actor, *actor1, *actor2;
729 gint now = time(NULL);
732 GPtrArray *child = NULL;
734 scene = g_new0(Scene, 1);
735 scene->daytime = get_daytime();
736 scene->actors = NULL;
737 scene->wind_orientation = -1;
738 scene->wind_angle = 0.3;
739 /* init value for random */
740 scene->seed = time(NULL);
741 desktop_plugin->priv->scene = scene;
743 actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480,
744 TRUE, TRUE, 100, 255,
745 (gpointer)&change_static_actor, NULL, NULL);
746 change_static_actor(actor, desktop_plugin);
747 scene->actors = g_slist_append(scene->actors, actor);
750 actor = init_object(desktop_plugin, "sun", "sun.png", 0, 0, 6, 88, 88,
751 FALSE, FALSE, 100, 255,
752 (gpointer)&change_sun, NULL, NULL);
753 actor->time_start_animation = time(NULL);
754 actor->duration_animation = G_MAXINT;
755 change_sun(actor, desktop_plugin);
756 scene->actors = g_slist_append(scene->actors, actor);
759 actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
760 TRUE, 100, 255, NULL, NULL);
761 scene.actors = g_slist_append(scene.actors, actor);
764 actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60,
765 FALSE, FALSE, 100, 255,
766 (gpointer)&change_moon, NULL, NULL);
767 change_moon(actor, desktop_plugin);
768 scene->actors = g_slist_append(scene->actors, actor);
770 actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97,
771 FALSE, FALSE, 100, 255,
772 (gpointer)&change_cloud, NULL, NULL);
773 actor->time_start_animation = now + fast_rnd(30) + 10;
774 actor->duration_animation = 3*60;
775 scene->actors = g_slist_append(scene->actors, actor);
777 actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75,
778 FALSE, FALSE, 100, 255,
779 (gpointer)&change_cloud, NULL, NULL);
780 actor->time_start_animation = now + fast_rnd(10);
781 actor->duration_animation = 3*60;
782 scene->actors = g_slist_append(scene->actors, actor);
784 actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75,
785 FALSE, FALSE, 100, 255,
786 (gpointer)&change_cloud, NULL, NULL);
787 actor->time_start_animation = now + fast_rnd(60) + 20;
788 actor->duration_animation = 5*60;
789 scene->actors = g_slist_append(scene->actors, actor);
792 actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 8, 160, 50,
793 FALSE, FALSE, 100, 255,
794 (gpointer)&change_plane2, NULL, NULL);
795 actor->time_start_animation = now + fast_rnd(40) + 20;
796 actor->duration_animation = 60;
797 scene->actors = g_slist_append(scene->actors, actor);
799 actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116,
800 FALSE, FALSE, 100, 255,
801 (gpointer)&change_plane1, NULL, NULL);
802 actor->time_start_animation = now + fast_rnd(20);
803 actor->duration_animation = 30;
804 scene->actors = g_slist_append(scene->actors, actor);
806 actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480,
807 TRUE, TRUE, 100, 255,
808 (gpointer)&change_static_actor_with_corner, NULL, NULL);
809 change_static_actor_with_corner(actor, desktop_plugin);
810 scene->actors = g_slist_append(scene->actors, actor);
812 actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0,
813 FALSE, FALSE, 100, 255,
814 (gpointer)&change_wind, NULL, NULL);
815 change_wind(actor, desktop_plugin);
816 scene->actors = g_slist_append(scene->actors, actor);
818 actor1 = init_object(desktop_plugin, "signal_red", "red.png",
819 486, 425, 10, 18, 38,
820 FALSE, TRUE, 100, 255, NULL, NULL, NULL);
821 //actor->time_start_animation = now + fast_rnd(30) + 10;
822 scene->actors = g_slist_append(scene->actors, actor1);
824 actor2 = init_object(desktop_plugin, "signal_green", "green.png",
825 486, 425, 10, 18, 38,
826 TRUE, TRUE, 100, 255, NULL, NULL, NULL);
827 //actor->time_start_animation = now + fast_rnd(30) + 10;
828 scene->actors = g_slist_append(scene->actors, actor2);
829 child = g_ptr_array_sized_new(2);
830 g_ptr_array_add(child, actor1);
831 g_ptr_array_add(child, actor2);
832 actor = init_object(desktop_plugin, "signal", "",
833 486, 425, 10, 18, 38,
834 FALSE, FALSE, 100, 255,
835 (gpointer)&change_signal, NULL, child);
836 actor->time_start_animation = now + fast_rnd(30) + 10;
837 scene->actors = g_slist_append(scene->actors, actor);
878 for (i=0; i<13; i++){
879 actor = init_object(desktop_plugin, "window", "window.png",
880 winds[i][0], winds[i][1], 10, 8, 9,
881 FALSE, TRUE, 100, 255,
882 (gpointer)&change_window1, NULL, NULL);
883 //change_window1(actor, desktop_plugin);
884 actor->time_start_animation = now + fast_rnd(30);
885 scene->actors = g_slist_append(scene->actors, actor);
889 run_long_timeout(desktop_plugin);
892 /*******************************************************************************/
894 init_scene_theme(AWallpaperPlugin *desktop_plugin)
897 void (*func)(gpointer);
898 func = g_hash_table_lookup(desktop_plugin->priv->hash_scene_func, desktop_plugin->priv->theme);
900 (*func)(desktop_plugin);
903 fprintf(stderr, "Init_scene_theme\n");
904 void (*func)(gpointer);
905 func = desktop_plugin->priv->scene_func;
907 fprintf(stderr, "Success init_scene_theme\n");
908 (*func)(desktop_plugin);