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);
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 bgfile = g_strdup_printf("/home/user/.backgrounds/background-%i.png", desktop_plugin->priv->view);
89 actor = init_object(desktop_plugin, "original", bgfile,
93 scene->actors = g_slist_append(scene->actors, actor);
95 child = g_ptr_array_sized_new(16);
99 str = g_strdup_printf("tape%i.png", n+1);
100 actor = init_object(desktop_plugin, "tape", str,
101 fast_rnd(800), fast_rnd(480), 2+fast_rnd(6), 800, sizes1[n],
102 TRUE, TRUE, 100, 255,
104 scene->actors = g_slist_append(scene->actors, actor);
105 g_ptr_array_add(child, actor);
109 actor = init_object(desktop_plugin, "tape", "",
111 FALSE, FALSE, 100, 255,
112 (gpointer)&change_tape, NULL, child);
113 actor->time_start_animation = now;
114 actor->duration_animation = G_MAXINT;
115 scene->actors = g_slist_append(scene->actors, actor);
117 run_long_timeout(desktop_plugin);
119 /*******************************************************************************/
121 parsestring(char *line, char **argv)
123 while (*line != '\0') {
124 while (*line == ' ' || *line == '\n')
125 *line++ = '\0'; /* replace white spaces with 0 */
126 *argv++ = line; /* save the argument position */
127 while (*line != '\0' && *line != ' ' &&
129 line++; /* skip the argument until ... */
131 *argv = '\0'; /* mark the end of argument list */
136 sync_handler(GstBus *bus, GstMessage *message, AWallpaperPlugin *desktop_plugin){
138 if (!desktop_plugin->priv->visible)
139 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PAUSED);
140 if (GST_MESSAGE_TYPE(message) != GST_MESSAGE_ELEMENT){
141 return (GST_BUS_PASS);
143 if (!gst_structure_has_name(message->structure, "prepare-xwindow-id")){
144 return (GST_BUS_PASS);
146 return (GST_BUS_DROP);
150 /*******************************************************************************/
152 bus_call (GstBus *bus, GstMessage *msg, AWallpaperPlugin *desktop_plugin)
154 switch (GST_MESSAGE_TYPE (msg))
156 case GST_MESSAGE_EOS:
157 if (desktop_plugin->priv->rich_animation){
159 GstClockTime nach = (GstClockTime)(0 * GST_MSECOND);
160 if (!gst_element_seek(desktop_plugin->priv->pipeline, 1.0, GST_FORMAT_TIME,
161 (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), GST_SEEK_TYPE_SET,
162 nach, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
163 fprintf(stderr,"ERROR in seek\n");
165 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
168 if (desktop_plugin->priv->pipeline){
169 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);
170 gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
174 case GST_MESSAGE_ERROR: break;
180 /*******************************************************************************/
182 init_scene_External(AWallpaperPlugin *desktop_plugin){
184 char* child_argv[2048];
185 char *run_string = NULL;
186 gchar *exec_path = NULL,
191 if (!desktop_plugin->priv->visible)
194 fprintf(stderr,"init_scene_external 111\n");
195 exec_path = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "exec_path"));
196 window_id = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_id"));
197 view = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "view"));
198 fprintf(stderr,"init_scene_external 222\n");
202 strwin = g_strdup_printf(" %s %i", window_id, (gint)GDK_WINDOW_XID(desktop_plugin->priv->window->window));
207 strview = g_strdup_printf(" %s %i", view, desktop_plugin->priv->view);
211 run_string = g_strdup_printf("%s%s%s", exec_path, strwin, strview);
212 fprintf(stderr, "runs string = %s\n", run_string);
213 parsestring(run_string, child_argv);
215 desktop_plugin->priv->running = TRUE;
216 desktop_plugin->priv->podpid = fork();
217 if (desktop_plugin->priv->podpid == 0){
218 execvp(child_argv[0], child_argv);
219 fprintf(stderr,"Problem with new podprocess");
223 /*******************************************************************************/
225 cb_timeout0(AWallpaperPlugin *desktop_plugin) {
227 if (!desktop_plugin || !desktop_plugin->priv->pipeline)
229 if (desktop_plugin->priv->theme_int_parametr1 == 0){
230 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
231 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
232 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
233 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
234 fprintf(stderr,"Error in seek:\n");
238 if (gst_element_get_state (desktop_plugin->priv->pipeline, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE)
241 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
242 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
243 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
244 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
245 fprintf(stderr,"Error in seek:\n");
249 /*******************************************************************************/
251 init_scene_Video(AWallpaperPlugin *desktop_plugin)
254 GstElement *videosink;
255 gchar *file_plus_uri;
258 /* fprintf(stderr, "init scene Video \n"); */
259 desktop_plugin->priv->pipeline = gst_pipeline_new("gst-player");
260 bin = gst_element_factory_make ("playbin2", "bin");
261 videosink = gst_element_factory_make ("ximagesink", "videosink");
262 g_object_set (G_OBJECT (bin), "video-sink", videosink, NULL);
263 gst_bin_add (GST_BIN (desktop_plugin->priv->pipeline), bin);
267 bus = gst_pipeline_get_bus (GST_PIPELINE (desktop_plugin->priv->pipeline));
268 gst_bus_add_watch(bus, (GstBusFunc)bus_call, desktop_plugin);
269 gst_object_unref (bus);
271 file_plus_uri = g_strdup_printf("file://%s",desktop_plugin->priv->theme_string_parametr1);
272 g_object_set (G_OBJECT (bin), "uri", file_plus_uri, NULL );
274 if (!desktop_plugin->priv->theme_bool_parametr1)
275 g_object_set (G_OBJECT (bin), "mute", TRUE, NULL );
276 g_object_set (G_OBJECT (videosink), "force-aspect-ratio", TRUE, NULL );
278 if (GST_IS_X_OVERLAY (videosink))
279 gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GDK_DRAWABLE_XID(desktop_plugin->priv->window->window));
281 if (desktop_plugin->priv->visible){
282 g_timeout_add(50, (GSourceFunc)cb_timeout0, desktop_plugin);
283 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
286 //gst_element_get_state(deskddtop_plugin->priv->pipeline, NULL, NULL, 100 * GST_MSECOND);
289 /*******************************************************************************/
291 init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
296 gint now = time(NULL);
299 if (desktop_plugin->priv->rich_animation){
307 /* fprintf(stderr, "init scene2 \n"); */
308 scene = g_new0(Scene, 1);
309 //scene.daytime = get_daytime();
310 scene->actors = NULL;
311 desktop_plugin->priv->scene = scene;
313 actor = init_object(desktop_plugin, "background", "bg.png",
315 TRUE, TRUE, 100, 255,
317 scene->actors = g_slist_append(scene->actors, actor);
319 actor = init_object(desktop_plugin, "symbols", "symbols.png",
321 TRUE, TRUE, 100, 255,
323 scene->actors = g_slist_append(scene->actors, actor);
325 child = g_ptr_array_sized_new(4);
326 actor = init_object(desktop_plugin, "layer1", "layer1_2.png",
328 TRUE, TRUE, 100, 255,
330 //actor->time_start_animation = now;
331 //actor->duration_animation = G_MAXINT;
332 scene->actors = g_slist_append(scene->actors, actor);
333 g_ptr_array_add(child, actor);
335 actor = init_object(desktop_plugin, "layer1", "layer1_1.png",
337 TRUE, TRUE, 100, 255,
339 //actor->time_start_animation = now;
340 //actor->duration_animation = G_MAXINT;
341 scene->actors = g_slist_append(scene->actors, actor);
342 g_ptr_array_add(child, actor);
344 actor = init_object(desktop_plugin, "layer2", "layer2_2.png",
346 TRUE, TRUE, 100, 255,
348 //actor->time_start_animation = now;
349 //actor->duration_animation = G_MAXINT;
350 scene->actors = g_slist_append(scene->actors, actor);
351 g_ptr_array_add(child, actor);
353 actor = init_object(desktop_plugin, "layer2", "layer2_1.png",
355 TRUE, TRUE, 100, 255,
357 //actor->time_start_animation = now;
358 //actor->duration_animation = G_MAXINT;
359 scene->actors = g_slist_append(scene->actors, actor);
360 g_ptr_array_add(child, actor);
362 actor = init_object(desktop_plugin, "layers", "",
364 FALSE, FALSE, 100, 255,
365 (gpointer)&change_layer, NULL, child);
366 actor->time_start_animation = now;
367 actor->duration_animation = G_MAXINT;
368 scene->actors = g_slist_append(scene->actors, actor);
370 run_long_timeout(desktop_plugin);
373 /*******************************************************************************/
374 /* Init Modern Scene */
376 init_scene_Modern(AWallpaperPlugin *desktop_plugin)
380 gint now = time(NULL);
385 /* fprintf(stderr, "init scene \n"); */
386 scene = g_new0(Scene, 1);
387 scene->daytime = get_daytime();
388 scene->actors = NULL;
389 scene->wind_orientation = -1;
390 scene->wind_angle = 0.3;
391 /* init value for random */
392 scene->seed = time(NULL);
393 scene->notification = TRUE;
394 desktop_plugin->priv->scene = scene;
395 actor = init_object(desktop_plugin, "sky", "sky0.png",
397 TRUE , TRUE, 100, 255,
398 (gpointer)&change_static_actor, NULL, NULL);
399 scene->actors = g_slist_append(scene->actors, actor);
400 change_static_actor(actor, desktop_plugin);
402 actor = init_object(desktop_plugin, "sun", "sun.png",
404 FALSE, FALSE, 100, 255,
405 (gpointer)&change_sun, NULL, NULL);
406 actor->time_start_animation = now;
407 actor->duration_animation = G_MAXINT;
408 change_sun(actor, desktop_plugin);
409 scene->actors = g_slist_append(scene->actors, actor);
411 //actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
412 // TRUE, 100, 255, NULL, NULL);
413 //scene.actors = g_slist_append(scene.actors, actor);
415 actor = init_object(desktop_plugin, "cloud1", "cloud1.png",
416 0, fast_rnd(300)-97, 7, 150, 97,
417 FALSE, FALSE, 100, 255,
418 (gpointer)&change_cloud, NULL, NULL);
419 actor->time_start_animation = now + fast_rnd(20);
420 actor->duration_animation = 3*60;
421 scene->actors = g_slist_append(scene->actors, actor);
423 actor = init_object(desktop_plugin, "cloud2", "cloud2.png",
424 0, fast_rnd(300)-75, 7, 188, 75,
425 FALSE, FALSE, 100, 255,
426 (gpointer)&change_cloud, NULL, NULL);
427 actor->time_start_animation = now + fast_rnd(40)+10;
428 actor->duration_animation = 3*60;
429 scene->actors = g_slist_append(scene->actors, actor);
431 actor = init_object(desktop_plugin, "cloud4", "cloud4.png",
432 0, fast_rnd(300)-75, 7, 150, 75,
433 FALSE, FALSE, 100, 255,
434 (gpointer)&change_cloud, NULL, NULL);
435 actor->time_start_animation = now + fast_rnd(60) + 20;
436 actor->duration_animation = 5*60;
437 scene->actors = g_slist_append(scene->actors, actor);
440 actor = init_object(desktop_plugin, "town", "town0.png",
442 TRUE, TRUE, 100, 255,
443 (gpointer)&change_static_actor, NULL, NULL);
444 change_static_actor(actor, desktop_plugin);
445 scene->actors = g_slist_append(scene->actors, actor);
447 actor = init_object(desktop_plugin, "stend", "stend0.png",
448 452, 166, 9, 300, 305,
449 TRUE, TRUE, 100, 255,
450 (gpointer)&change_static_actor, NULL, NULL);
451 change_static_actor(actor, desktop_plugin);
452 scene->actors = g_slist_append(scene->actors, actor);
455 child = g_ptr_array_sized_new(4);
456 actor = init_object(desktop_plugin, "call", "call.png",
458 FALSE, TRUE, 100, 255,
460 scene->actors = g_slist_append(scene->actors, actor);
461 g_ptr_array_add(child, actor);
463 actor = init_object(desktop_plugin, "chat", "chat.png",
465 FALSE, TRUE, 100, 255,
467 scene->actors = g_slist_append(scene->actors, actor);
468 g_ptr_array_add(child, actor);
470 actor = init_object(desktop_plugin, "mail", "mail.png",
472 FALSE, TRUE, 100, 255,
474 scene->actors = g_slist_append(scene->actors, actor);
475 g_ptr_array_add(child, actor);
477 actor = init_object(desktop_plugin, "sms", "sms.png",
479 FALSE, TRUE, 100, 255,
481 scene->actors = g_slist_append(scene->actors, actor);
482 g_ptr_array_add(child, actor);
484 actor = init_object(desktop_plugin, "billboard_text", "",
485 470, 174, 9, 300, 108,
486 FALSE, FALSE, 100, 255,
487 (gpointer)&change_billboard, NULL, child);
488 create_hildon_actor_text(actor, desktop_plugin);
489 //actor->time_start_animation = time(NULL) + 20;
490 change_billboard(actor, desktop_plugin);
491 scene->actors = g_slist_append(scene->actors, actor);
493 actor = init_object(desktop_plugin, "tram", "tram.png",
494 -300, 225, 10, 350, 210,
495 FALSE, FALSE, 100, 255,
496 (gpointer)&change_tram, NULL, NULL);
497 actor->time_start_animation = time(NULL) + fast_rnd(10);
498 actor->duration_animation = 60;
499 scene->actors = g_slist_append(scene->actors, actor);
501 actor = init_object(desktop_plugin, "border", "border0.png",
502 0, 480-79, 11, 800, 79,
503 TRUE, TRUE, 100, 255,
504 (gpointer)&change_static_actor_with_corner, NULL, NULL);
505 change_static_actor_with_corner(actor, desktop_plugin);
506 scene->actors = g_slist_append(scene->actors, actor);
508 actor = init_object(desktop_plugin, "moon", "moon1.png",
510 FALSE, FALSE, 100, 255,
511 (gpointer)&change_moon, NULL, NULL);
512 change_moon(actor, desktop_plugin);
513 scene->actors = g_slist_append(scene->actors, actor);
515 actor = init_object(desktop_plugin, "wind", "",
517 FALSE, FALSE, 100, 255,
518 (gpointer)&change_wind, NULL, NULL);
519 change_wind(actor, desktop_plugin);
520 scene->actors = g_slist_append(scene->actors, actor);
522 /* windows in 4-th house */
562 for (i=0; i<13; i++){
563 actor = init_object(desktop_plugin, "window1", "window1.png",
564 winds[i][0], winds[i][1], 8, 8, 10,
565 FALSE, FALSE, 100, 255,
566 (gpointer)&change_window1, NULL, NULL);
567 //change_window1(actor, desktop_plugin);
568 actor->time_start_animation = now + fast_rnd(30);
569 scene->actors = g_slist_append(scene->actors, actor);
573 /* windows in 1-th house */
599 actor = init_object(desktop_plugin, "window2", "window2.png",
600 winds[i][0], winds[i][1], 8, 8, 10,
601 FALSE, FALSE, 100, 255,
602 (gpointer)&change_window1, NULL, NULL);
603 //change_window1(actor, desktop_plugin);
604 actor->time_start_animation = now + fast_rnd(30);
605 scene->actors = g_slist_append(scene->actors, actor);
609 /* windows in 3-th house */
641 for (i=0; i<10; i++){
642 actor = init_object(desktop_plugin, "window3", "window3.png",
643 winds[i][0], winds[i][1], 8, 8, 10,
644 FALSE, FALSE, 100, 255,
645 (gpointer)&change_window1, NULL, NULL);
646 //change_window1(actor, desktop_plugin);
647 actor->time_start_animation = now + fast_rnd(30);
648 scene->actors = g_slist_append(scene->actors, actor);
652 /* windows in 5-th house */
676 actor = init_object(desktop_plugin, "window4", "window4.png",
677 winds[i][0], winds[i][1], 8, 8, 10,
678 FALSE, FALSE, 100, 255,
679 (gpointer)&change_window1, NULL, NULL);
680 //change_window1(actor, desktop_plugin);
681 actor->time_start_animation = now + fast_rnd(30);
682 scene->actors = g_slist_append(scene->actors, actor);
686 /* windows in 6-th house */
707 actor = init_object(desktop_plugin, "window5", "window5.png",
708 winds[i][0], winds[i][1], 8, 8, 10,
709 FALSE, FALSE, 100, 255,
710 (gpointer)&change_window1, NULL, NULL);
711 //change_window1(actor, desktop_plugin);
712 actor->time_start_animation = now + fast_rnd(30);
713 scene->actors = g_slist_append(scene->actors, actor);
716 run_long_timeout(desktop_plugin);
719 anim = g_new0(Animation, 1);
722 anim->func_change = &change_tram;
723 anim->func_time = NULL;
724 anim->timestart = time(NULL);
727 scene.dynamic_actors = g_slist_append(scene.dynamic_actors, anim);
730 /*******************************************************************************/
731 /* Init Berlin Scene */
733 init_scene_Berlin(AWallpaperPlugin *desktop_plugin)
735 Actor *actor, *actor1, *actor2;
737 gint now = time(NULL);
740 GPtrArray *child = NULL;
742 scene = g_new0(Scene, 1);
743 scene->daytime = get_daytime();
744 scene->actors = NULL;
745 scene->wind_orientation = -1;
746 scene->wind_angle = 0.3;
747 /* init value for random */
748 scene->seed = time(NULL);
749 desktop_plugin->priv->scene = scene;
751 actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480,
752 TRUE, TRUE, 100, 255,
753 (gpointer)&change_static_actor, NULL, NULL);
754 change_static_actor(actor, desktop_plugin);
755 scene->actors = g_slist_append(scene->actors, actor);
758 actor = init_object(desktop_plugin, "sun", "sun.png", 0, 0, 6, 88, 88,
759 FALSE, FALSE, 100, 255,
760 (gpointer)&change_sun, NULL, NULL);
761 actor->time_start_animation = time(NULL);
762 actor->duration_animation = G_MAXINT;
763 change_sun(actor, desktop_plugin);
764 scene->actors = g_slist_append(scene->actors, actor);
767 actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
768 TRUE, 100, 255, NULL, NULL);
769 scene.actors = g_slist_append(scene.actors, actor);
772 actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60,
773 FALSE, FALSE, 100, 255,
774 (gpointer)&change_moon, NULL, NULL);
775 change_moon(actor, desktop_plugin);
776 scene->actors = g_slist_append(scene->actors, actor);
778 actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97,
779 FALSE, FALSE, 100, 255,
780 (gpointer)&change_cloud, NULL, NULL);
781 actor->time_start_animation = now + fast_rnd(30) + 10;
782 actor->duration_animation = 3*60;
783 scene->actors = g_slist_append(scene->actors, actor);
785 actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75,
786 FALSE, FALSE, 100, 255,
787 (gpointer)&change_cloud, NULL, NULL);
788 actor->time_start_animation = now + fast_rnd(10);
789 actor->duration_animation = 3*60;
790 scene->actors = g_slist_append(scene->actors, actor);
792 actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75,
793 FALSE, FALSE, 100, 255,
794 (gpointer)&change_cloud, NULL, NULL);
795 actor->time_start_animation = now + fast_rnd(60) + 20;
796 actor->duration_animation = 5*60;
797 scene->actors = g_slist_append(scene->actors, actor);
800 actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 8, 160, 50,
801 FALSE, FALSE, 100, 255,
802 (gpointer)&change_plane2, NULL, NULL);
803 actor->time_start_animation = now + fast_rnd(40) + 20;
804 actor->duration_animation = 60;
805 scene->actors = g_slist_append(scene->actors, actor);
807 actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116,
808 FALSE, FALSE, 100, 255,
809 (gpointer)&change_plane1, NULL, NULL);
810 actor->time_start_animation = now + fast_rnd(20);
811 actor->duration_animation = 30;
812 scene->actors = g_slist_append(scene->actors, actor);
814 actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480,
815 TRUE, TRUE, 100, 255,
816 (gpointer)&change_static_actor_with_corner, NULL, NULL);
817 change_static_actor_with_corner(actor, desktop_plugin);
818 scene->actors = g_slist_append(scene->actors, actor);
820 actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0,
821 FALSE, FALSE, 100, 255,
822 (gpointer)&change_wind, NULL, NULL);
823 change_wind(actor, desktop_plugin);
824 scene->actors = g_slist_append(scene->actors, actor);
826 actor1 = init_object(desktop_plugin, "signal_red", "red.png",
827 486, 425, 10, 18, 38,
828 FALSE, TRUE, 100, 255, NULL, NULL, NULL);
829 //actor->time_start_animation = now + fast_rnd(30) + 10;
830 scene->actors = g_slist_append(scene->actors, actor1);
832 actor2 = init_object(desktop_plugin, "signal_green", "green.png",
833 486, 425, 10, 18, 38,
834 TRUE, TRUE, 100, 255, NULL, NULL, NULL);
835 //actor->time_start_animation = now + fast_rnd(30) + 10;
836 scene->actors = g_slist_append(scene->actors, actor2);
837 child = g_ptr_array_sized_new(2);
838 g_ptr_array_add(child, actor1);
839 g_ptr_array_add(child, actor2);
840 actor = init_object(desktop_plugin, "signal", "",
841 486, 425, 10, 18, 38,
842 FALSE, FALSE, 100, 255,
843 (gpointer)&change_signal, NULL, child);
844 actor->time_start_animation = now + fast_rnd(30) + 10;
845 scene->actors = g_slist_append(scene->actors, actor);
886 for (i=0; i<13; i++){
887 actor = init_object(desktop_plugin, "window", "window.png",
888 winds[i][0], winds[i][1], 10, 8, 9,
889 FALSE, TRUE, 100, 255,
890 (gpointer)&change_window1, NULL, NULL);
891 //change_window1(actor, desktop_plugin);
892 actor->time_start_animation = now + fast_rnd(30);
893 scene->actors = g_slist_append(scene->actors, actor);
897 run_long_timeout(desktop_plugin);
900 /*******************************************************************************/
902 init_scene_theme(AWallpaperPlugin *desktop_plugin)
905 void (*func)(gpointer);
906 func = g_hash_table_lookup(desktop_plugin->priv->hash_scene_func, desktop_plugin->priv->theme);
908 (*func)(desktop_plugin);
911 fprintf(stderr, "Init_scene_theme\n");
912 void (*func)(gpointer);
913 func = desktop_plugin->priv->scene_func;
915 fprintf(stderr, "Success init_scene_theme\n");
916 (*func)(desktop_plugin);