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 kill (desktop_plugin->priv->podpid, SIGTERM);
54 if (wait(&status) == desktop_plugin->priv->podpid)
57 desktop_plugin->priv->podpid = -1;
58 desktop_plugin->priv->running = FALSE;
61 /*******************************************************************************/
63 reload_scene(AWallpaperPlugin *desktop_plugin)
65 fprintf(stderr,"Reload scene %s\n", desktop_plugin->priv->theme);
66 destroy_scene(desktop_plugin);
67 fill_priv(desktop_plugin->priv);
68 init_scene_theme(desktop_plugin);
70 /*******************************************************************************/
72 init_scene_Accel(AWallpaperPlugin *desktop_plugin)
77 gint now = time(NULL);
79 gint sizes1[4] = {57, 76, 43, 50},
82 /* fprintf(stderr, "init scene accel\n"); */
83 scene = g_new0(Scene, 1);
85 desktop_plugin->priv->scene = scene;
87 actor = init_object(desktop_plugin, "background", "bg.png",
91 scene->actors = g_slist_append(scene->actors, actor);
93 child = g_ptr_array_sized_new(16);
97 str = g_strdup_printf("tape%i.png", n+1);
98 actor = init_object(desktop_plugin, "tape", str,
99 fast_rnd(800), fast_rnd(480), 2+fast_rnd(6), 800, sizes1[n],
100 TRUE, TRUE, 100, 255,
102 scene->actors = g_slist_append(scene->actors, actor);
103 g_ptr_array_add(child, actor);
107 actor = init_object(desktop_plugin, "tape", "",
109 FALSE, FALSE, 100, 255,
110 (gpointer)&change_tape, NULL, child);
111 actor->time_start_animation = now;
112 actor->duration_animation = G_MAXINT;
113 scene->actors = g_slist_append(scene->actors, actor);
115 run_long_timeout(desktop_plugin);
117 /*******************************************************************************/
119 parsestring(char *line, char **argv)
121 while (*line != '\0') {
122 while (*line == ' ' || *line == '\n')
123 *line++ = '\0'; /* replace white spaces with 0 */
124 *argv++ = line; /* save the argument position */
125 while (*line != '\0' && *line != ' ' &&
127 line++; /* skip the argument until ... */
129 *argv = '\0'; /* mark the end of argument list */
134 sync_handler(GstBus *bus, GstMessage *message, AWallpaperPlugin *desktop_plugin){
136 if (!desktop_plugin->priv->visible)
137 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PAUSED);
138 if (GST_MESSAGE_TYPE(message) != GST_MESSAGE_ELEMENT){
139 return (GST_BUS_PASS);
141 if (!gst_structure_has_name(message->structure, "prepare-xwindow-id")){
142 return (GST_BUS_PASS);
144 return (GST_BUS_DROP);
148 /*******************************************************************************/
150 bus_call (GstBus *bus, GstMessage *msg, AWallpaperPlugin *desktop_plugin)
152 switch (GST_MESSAGE_TYPE (msg))
154 case GST_MESSAGE_EOS:
155 if (desktop_plugin->priv->rich_animation){
157 GstClockTime nach = (GstClockTime)(0 * GST_MSECOND);
158 if (!gst_element_seek(desktop_plugin->priv->pipeline, 1.0, GST_FORMAT_TIME,
159 (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), GST_SEEK_TYPE_SET,
160 nach, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
161 fprintf(stderr,"ERROR in seek\n");
163 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
166 if (desktop_plugin->priv->pipeline){
167 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);
168 gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
172 case GST_MESSAGE_ERROR: break;
178 /*******************************************************************************/
180 init_scene_External(AWallpaperPlugin *desktop_plugin){
182 char* child_argv[2048];
183 char *run_string = NULL;
184 gchar *exec_path = NULL,
189 if (!desktop_plugin->priv->visible)
192 fprintf(stderr,"init_scene_external 111\n");
193 exec_path = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "exec_path"));
194 window_id = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_id"));
195 view = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "view"));
196 fprintf(stderr,"init_scene_external 222\n");
200 strwin = g_strdup_printf(" %s %i", window_id, (gint)GDK_WINDOW_XID(desktop_plugin->priv->window->window));
205 strview = g_strdup_printf(" %s %i", view, desktop_plugin->priv->view);
209 run_string = g_strdup_printf("%s%s%s", exec_path, strwin, strview);
210 fprintf(stderr, "runs string = %s\n", run_string);
211 parsestring(run_string, child_argv);
213 desktop_plugin->priv->running = TRUE;
214 desktop_plugin->priv->podpid = fork();
215 if (desktop_plugin->priv->podpid == 0){
216 execvp(child_argv[0], child_argv);
217 fprintf(stderr,"Problem with new podprocess");
221 /*******************************************************************************/
223 cb_timeout0(AWallpaperPlugin *desktop_plugin) {
225 if (!desktop_plugin || !desktop_plugin->priv->pipeline)
227 if (desktop_plugin->priv->theme_int_parametr1 == 0){
228 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
229 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
230 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
231 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
232 fprintf(stderr,"Error in seek:\n");
236 if (gst_element_get_state (desktop_plugin->priv->pipeline, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE)
239 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
240 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
241 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
242 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
243 fprintf(stderr,"Error in seek:\n");
247 /*******************************************************************************/
249 init_scene_Video(AWallpaperPlugin *desktop_plugin)
252 GstElement *videosink;
253 gchar *file_plus_uri;
256 /* fprintf(stderr, "init scene Video \n"); */
257 desktop_plugin->priv->pipeline = gst_pipeline_new("gst-player");
258 bin = gst_element_factory_make ("playbin2", "bin");
259 videosink = gst_element_factory_make ("ximagesink", "videosink");
260 g_object_set (G_OBJECT (bin), "video-sink", videosink, NULL);
261 gst_bin_add (GST_BIN (desktop_plugin->priv->pipeline), bin);
265 bus = gst_pipeline_get_bus (GST_PIPELINE (desktop_plugin->priv->pipeline));
266 gst_bus_add_watch(bus, (GstBusFunc)bus_call, desktop_plugin);
267 gst_object_unref (bus);
269 file_plus_uri = g_strdup_printf("file://%s",desktop_plugin->priv->theme_string_parametr1);
270 g_object_set (G_OBJECT (bin), "uri", file_plus_uri, NULL );
271 g_object_set (G_OBJECT (videosink), "force-aspect-ratio", TRUE, NULL );
273 if (GST_IS_X_OVERLAY (videosink))
274 gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GDK_DRAWABLE_XID(desktop_plugin->priv->window->window));
276 if (desktop_plugin->priv->visible){
277 g_timeout_add(50, (GSourceFunc)cb_timeout0, desktop_plugin);
278 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
281 //gst_element_get_state(deskddtop_plugin->priv->pipeline, NULL, NULL, 100 * GST_MSECOND);
284 /*******************************************************************************/
286 init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
291 gint now = time(NULL);
294 if (desktop_plugin->priv->rich_animation){
302 /* fprintf(stderr, "init scene2 \n"); */
303 scene = g_new0(Scene, 1);
304 //scene.daytime = get_daytime();
305 scene->actors = NULL;
306 desktop_plugin->priv->scene = scene;
308 actor = init_object(desktop_plugin, "background", "bg.png",
310 TRUE, TRUE, 100, 255,
312 scene->actors = g_slist_append(scene->actors, actor);
314 actor = init_object(desktop_plugin, "symbols", "symbols.png",
316 TRUE, TRUE, 100, 255,
318 scene->actors = g_slist_append(scene->actors, actor);
320 child = g_ptr_array_sized_new(4);
321 actor = init_object(desktop_plugin, "layer1", "layer1_2.png",
323 TRUE, TRUE, 100, 255,
325 //actor->time_start_animation = now;
326 //actor->duration_animation = G_MAXINT;
327 scene->actors = g_slist_append(scene->actors, actor);
328 g_ptr_array_add(child, actor);
330 actor = init_object(desktop_plugin, "layer1", "layer1_1.png",
332 TRUE, TRUE, 100, 255,
334 //actor->time_start_animation = now;
335 //actor->duration_animation = G_MAXINT;
336 scene->actors = g_slist_append(scene->actors, actor);
337 g_ptr_array_add(child, actor);
339 actor = init_object(desktop_plugin, "layer2", "layer2_2.png",
341 TRUE, TRUE, 100, 255,
343 //actor->time_start_animation = now;
344 //actor->duration_animation = G_MAXINT;
345 scene->actors = g_slist_append(scene->actors, actor);
346 g_ptr_array_add(child, actor);
348 actor = init_object(desktop_plugin, "layer2", "layer2_1.png",
350 TRUE, TRUE, 100, 255,
352 //actor->time_start_animation = now;
353 //actor->duration_animation = G_MAXINT;
354 scene->actors = g_slist_append(scene->actors, actor);
355 g_ptr_array_add(child, actor);
357 actor = init_object(desktop_plugin, "layers", "",
359 FALSE, FALSE, 100, 255,
360 (gpointer)&change_layer, NULL, child);
361 actor->time_start_animation = now;
362 actor->duration_animation = G_MAXINT;
363 scene->actors = g_slist_append(scene->actors, actor);
365 run_long_timeout(desktop_plugin);
368 /*******************************************************************************/
369 /* Init Modern Scene */
371 init_scene_Modern(AWallpaperPlugin *desktop_plugin)
375 gint now = time(NULL);
380 /* fprintf(stderr, "init scene \n"); */
381 scene = g_new0(Scene, 1);
382 scene->daytime = get_daytime();
383 scene->actors = NULL;
384 scene->wind_orientation = -1;
385 scene->wind_angle = 0.3;
386 /* init value for random */
387 scene->seed = time(NULL);
388 scene->notification = TRUE;
389 desktop_plugin->priv->scene = scene;
390 actor = init_object(desktop_plugin, "sky", "sky0.png",
392 TRUE , TRUE, 100, 255,
393 (gpointer)&change_static_actor, NULL, NULL);
394 scene->actors = g_slist_append(scene->actors, actor);
395 change_static_actor(actor, desktop_plugin);
397 actor = init_object(desktop_plugin, "sun", "sun.png",
399 FALSE, FALSE, 100, 255,
400 (gpointer)&change_sun, NULL, NULL);
401 actor->time_start_animation = now;
402 actor->duration_animation = G_MAXINT;
403 change_sun(actor, desktop_plugin);
404 scene->actors = g_slist_append(scene->actors, actor);
406 //actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
407 // TRUE, 100, 255, NULL, NULL);
408 //scene.actors = g_slist_append(scene.actors, actor);
410 actor = init_object(desktop_plugin, "cloud1", "cloud1.png",
411 0, fast_rnd(300)-97, 7, 150, 97,
412 FALSE, FALSE, 100, 255,
413 (gpointer)&change_cloud, NULL, NULL);
414 actor->time_start_animation = now + fast_rnd(20);
415 actor->duration_animation = 3*60;
416 scene->actors = g_slist_append(scene->actors, actor);
418 actor = init_object(desktop_plugin, "cloud2", "cloud2.png",
419 0, fast_rnd(300)-75, 7, 188, 75,
420 FALSE, FALSE, 100, 255,
421 (gpointer)&change_cloud, NULL, NULL);
422 actor->time_start_animation = now + fast_rnd(40)+10;
423 actor->duration_animation = 3*60;
424 scene->actors = g_slist_append(scene->actors, actor);
426 actor = init_object(desktop_plugin, "cloud4", "cloud4.png",
427 0, fast_rnd(300)-75, 7, 150, 75,
428 FALSE, FALSE, 100, 255,
429 (gpointer)&change_cloud, NULL, NULL);
430 actor->time_start_animation = now + fast_rnd(60) + 20;
431 actor->duration_animation = 5*60;
432 scene->actors = g_slist_append(scene->actors, actor);
435 actor = init_object(desktop_plugin, "town", "town0.png",
437 TRUE, TRUE, 100, 255,
438 (gpointer)&change_static_actor, NULL, NULL);
439 change_static_actor(actor, desktop_plugin);
440 scene->actors = g_slist_append(scene->actors, actor);
442 actor = init_object(desktop_plugin, "stend", "stend0.png",
443 452, 166, 9, 300, 305,
444 TRUE, TRUE, 100, 255,
445 (gpointer)&change_static_actor, NULL, NULL);
446 change_static_actor(actor, desktop_plugin);
447 scene->actors = g_slist_append(scene->actors, actor);
450 child = g_ptr_array_sized_new(4);
451 actor = init_object(desktop_plugin, "call", "call.png",
453 FALSE, TRUE, 100, 255,
455 scene->actors = g_slist_append(scene->actors, actor);
456 g_ptr_array_add(child, actor);
458 actor = init_object(desktop_plugin, "chat", "chat.png",
460 FALSE, TRUE, 100, 255,
462 scene->actors = g_slist_append(scene->actors, actor);
463 g_ptr_array_add(child, actor);
465 actor = init_object(desktop_plugin, "mail", "mail.png",
467 FALSE, TRUE, 100, 255,
469 scene->actors = g_slist_append(scene->actors, actor);
470 g_ptr_array_add(child, actor);
472 actor = init_object(desktop_plugin, "sms", "sms.png",
474 FALSE, TRUE, 100, 255,
476 scene->actors = g_slist_append(scene->actors, actor);
477 g_ptr_array_add(child, actor);
479 actor = init_object(desktop_plugin, "billboard_text", "",
480 470, 174, 9, 300, 108,
481 FALSE, FALSE, 100, 255,
482 (gpointer)&change_billboard, NULL, child);
483 create_hildon_actor_text(actor, desktop_plugin);
484 //actor->time_start_animation = time(NULL) + 20;
485 change_billboard(actor, desktop_plugin);
486 scene->actors = g_slist_append(scene->actors, actor);
488 actor = init_object(desktop_plugin, "tram", "tram.png",
489 -300, 225, 10, 350, 210,
490 FALSE, FALSE, 100, 255,
491 (gpointer)&change_tram, NULL, NULL);
492 actor->time_start_animation = time(NULL) + fast_rnd(10);
493 actor->duration_animation = 60;
494 scene->actors = g_slist_append(scene->actors, actor);
496 actor = init_object(desktop_plugin, "border", "border0.png",
497 0, 480-79, 11, 800, 79,
498 TRUE, TRUE, 100, 255,
499 (gpointer)&change_static_actor_with_corner, NULL, NULL);
500 change_static_actor_with_corner(actor, desktop_plugin);
501 scene->actors = g_slist_append(scene->actors, actor);
503 actor = init_object(desktop_plugin, "moon", "moon1.png",
505 FALSE, FALSE, 100, 255,
506 (gpointer)&change_moon, NULL, NULL);
507 change_moon(actor, desktop_plugin);
508 scene->actors = g_slist_append(scene->actors, actor);
510 actor = init_object(desktop_plugin, "wind", "",
512 FALSE, FALSE, 100, 255,
513 (gpointer)&change_wind, NULL, NULL);
514 change_wind(actor, desktop_plugin);
515 scene->actors = g_slist_append(scene->actors, actor);
517 /* windows in 4-th house */
557 for (i=0; i<13; i++){
558 actor = init_object(desktop_plugin, "window1", "window1.png",
559 winds[i][0], winds[i][1], 8, 8, 10,
560 FALSE, FALSE, 100, 255,
561 (gpointer)&change_window1, NULL, NULL);
562 //change_window1(actor, desktop_plugin);
563 actor->time_start_animation = now + fast_rnd(30);
564 scene->actors = g_slist_append(scene->actors, actor);
568 /* windows in 1-th house */
594 actor = init_object(desktop_plugin, "window2", "window2.png",
595 winds[i][0], winds[i][1], 8, 8, 10,
596 FALSE, FALSE, 100, 255,
597 (gpointer)&change_window1, NULL, NULL);
598 //change_window1(actor, desktop_plugin);
599 actor->time_start_animation = now + fast_rnd(30);
600 scene->actors = g_slist_append(scene->actors, actor);
604 /* windows in 3-th house */
636 for (i=0; i<10; i++){
637 actor = init_object(desktop_plugin, "window3", "window3.png",
638 winds[i][0], winds[i][1], 8, 8, 10,
639 FALSE, FALSE, 100, 255,
640 (gpointer)&change_window1, NULL, NULL);
641 //change_window1(actor, desktop_plugin);
642 actor->time_start_animation = now + fast_rnd(30);
643 scene->actors = g_slist_append(scene->actors, actor);
647 /* windows in 5-th house */
671 actor = init_object(desktop_plugin, "window4", "window4.png",
672 winds[i][0], winds[i][1], 8, 8, 10,
673 FALSE, FALSE, 100, 255,
674 (gpointer)&change_window1, NULL, NULL);
675 //change_window1(actor, desktop_plugin);
676 actor->time_start_animation = now + fast_rnd(30);
677 scene->actors = g_slist_append(scene->actors, actor);
681 /* windows in 6-th house */
702 actor = init_object(desktop_plugin, "window5", "window5.png",
703 winds[i][0], winds[i][1], 8, 8, 10,
704 FALSE, FALSE, 100, 255,
705 (gpointer)&change_window1, NULL, NULL);
706 //change_window1(actor, desktop_plugin);
707 actor->time_start_animation = now + fast_rnd(30);
708 scene->actors = g_slist_append(scene->actors, actor);
711 run_long_timeout(desktop_plugin);
714 anim = g_new0(Animation, 1);
717 anim->func_change = &change_tram;
718 anim->func_time = NULL;
719 anim->timestart = time(NULL);
722 scene.dynamic_actors = g_slist_append(scene.dynamic_actors, anim);
725 /*******************************************************************************/
726 /* Init Berlin Scene */
728 init_scene_Berlin(AWallpaperPlugin *desktop_plugin)
730 Actor *actor, *actor1, *actor2;
732 gint now = time(NULL);
735 GPtrArray *child = NULL;
737 scene = g_new0(Scene, 1);
738 scene->daytime = get_daytime();
739 scene->actors = NULL;
740 scene->wind_orientation = -1;
741 scene->wind_angle = 0.3;
742 /* init value for random */
743 scene->seed = time(NULL);
744 desktop_plugin->priv->scene = scene;
746 actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480,
747 TRUE, TRUE, 100, 255,
748 (gpointer)&change_static_actor, NULL, NULL);
749 change_static_actor(actor, desktop_plugin);
750 scene->actors = g_slist_append(scene->actors, actor);
753 actor = init_object(desktop_plugin, "sun", "sun.png", 0, 0, 6, 88, 88,
754 FALSE, FALSE, 100, 255,
755 (gpointer)&change_sun, NULL, NULL);
756 actor->time_start_animation = time(NULL);
757 actor->duration_animation = G_MAXINT;
758 change_sun(actor, desktop_plugin);
759 scene->actors = g_slist_append(scene->actors, actor);
762 actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
763 TRUE, 100, 255, NULL, NULL);
764 scene.actors = g_slist_append(scene.actors, actor);
767 actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60,
768 FALSE, FALSE, 100, 255,
769 (gpointer)&change_moon, NULL, NULL);
770 change_moon(actor, desktop_plugin);
771 scene->actors = g_slist_append(scene->actors, actor);
773 actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97,
774 FALSE, FALSE, 100, 255,
775 (gpointer)&change_cloud, NULL, NULL);
776 actor->time_start_animation = now + fast_rnd(30) + 10;
777 actor->duration_animation = 3*60;
778 scene->actors = g_slist_append(scene->actors, actor);
780 actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75,
781 FALSE, FALSE, 100, 255,
782 (gpointer)&change_cloud, NULL, NULL);
783 actor->time_start_animation = now + fast_rnd(10);
784 actor->duration_animation = 3*60;
785 scene->actors = g_slist_append(scene->actors, actor);
787 actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75,
788 FALSE, FALSE, 100, 255,
789 (gpointer)&change_cloud, NULL, NULL);
790 actor->time_start_animation = now + fast_rnd(60) + 20;
791 actor->duration_animation = 5*60;
792 scene->actors = g_slist_append(scene->actors, actor);
795 actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 8, 160, 50,
796 FALSE, FALSE, 100, 255,
797 (gpointer)&change_plane2, NULL, NULL);
798 actor->time_start_animation = now + fast_rnd(40) + 20;
799 actor->duration_animation = 60;
800 scene->actors = g_slist_append(scene->actors, actor);
802 actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116,
803 FALSE, FALSE, 100, 255,
804 (gpointer)&change_plane1, NULL, NULL);
805 actor->time_start_animation = now + fast_rnd(20);
806 actor->duration_animation = 30;
807 scene->actors = g_slist_append(scene->actors, actor);
809 actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480,
810 TRUE, TRUE, 100, 255,
811 (gpointer)&change_static_actor_with_corner, NULL, NULL);
812 change_static_actor_with_corner(actor, desktop_plugin);
813 scene->actors = g_slist_append(scene->actors, actor);
815 actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0,
816 FALSE, FALSE, 100, 255,
817 (gpointer)&change_wind, NULL, NULL);
818 change_wind(actor, desktop_plugin);
819 scene->actors = g_slist_append(scene->actors, actor);
821 actor1 = init_object(desktop_plugin, "signal_red", "red.png",
822 486, 425, 10, 18, 38,
823 FALSE, TRUE, 100, 255, NULL, NULL, NULL);
824 //actor->time_start_animation = now + fast_rnd(30) + 10;
825 scene->actors = g_slist_append(scene->actors, actor1);
827 actor2 = init_object(desktop_plugin, "signal_green", "green.png",
828 486, 425, 10, 18, 38,
829 TRUE, TRUE, 100, 255, NULL, NULL, NULL);
830 //actor->time_start_animation = now + fast_rnd(30) + 10;
831 scene->actors = g_slist_append(scene->actors, actor2);
832 child = g_ptr_array_sized_new(2);
833 g_ptr_array_add(child, actor1);
834 g_ptr_array_add(child, actor2);
835 actor = init_object(desktop_plugin, "signal", "",
836 486, 425, 10, 18, 38,
837 FALSE, FALSE, 100, 255,
838 (gpointer)&change_signal, NULL, child);
839 actor->time_start_animation = now + fast_rnd(30) + 10;
840 scene->actors = g_slist_append(scene->actors, actor);
881 for (i=0; i<13; i++){
882 actor = init_object(desktop_plugin, "window", "window.png",
883 winds[i][0], winds[i][1], 10, 8, 9,
884 FALSE, TRUE, 100, 255,
885 (gpointer)&change_window1, NULL, NULL);
886 //change_window1(actor, desktop_plugin);
887 actor->time_start_animation = now + fast_rnd(30);
888 scene->actors = g_slist_append(scene->actors, actor);
892 run_long_timeout(desktop_plugin);
895 /*******************************************************************************/
897 init_scene_theme(AWallpaperPlugin *desktop_plugin)
900 void (*func)(gpointer);
901 func = g_hash_table_lookup(desktop_plugin->priv->hash_scene_func, desktop_plugin->priv->theme);
903 (*func)(desktop_plugin);
906 fprintf(stderr, "Init_scene_theme\n");
907 void (*func)(gpointer);
908 func = desktop_plugin->priv->scene_func;
910 fprintf(stderr, "Success init_scene_theme\n");
911 (*func)(desktop_plugin);