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"
26 /* This code form X11-utils */
27 Window Window_With_Name( Display *dpy, Window top, char *name)
29 Window *children, dummy;
30 unsigned int nchildren;
35 XClassHint *class_hint;
36 class_hint = XAllocClassHint();
37 XGetClassHint(dpy, top, class_hint);
38 if (class_hint->res_name && name && !strcmp(class_hint->res_name, name)){
39 XFree(class_hint->res_class);
40 XFree(class_hint->res_name);
43 XFree(class_hint->res_class);
44 XFree(class_hint->res_name);
46 if (XFetchName(dpy, top, &window_name) && !strcmp(window_name, name))
48 if (!XQueryTree(dpy, top, &dummy, &dummy, &children, &nchildren))
51 for (i=0; i<nchildren; i++) {
52 w = Window_With_Name(dpy, children[i], name);
56 if (children) XFree ((char *)children);
60 /*******************************************************************************/
63 destroy_scene(AWallpaperPlugin *desktop_plugin)
67 if (desktop_plugin->priv->scene){
68 GSList * tmp = desktop_plugin->priv->scene->actors;
70 destroy_actor(tmp->data);
71 tmp = g_slist_next(tmp);
75 desktop_plugin->priv->scene->actors = NULL;
76 if (desktop_plugin->priv->scene){
77 g_free(desktop_plugin->priv->scene);
78 desktop_plugin->priv->scene = NULL;
81 if (desktop_plugin->priv->pipeline){
82 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);
83 gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
84 desktop_plugin->priv->pipeline = NULL;
86 if (desktop_plugin->priv->podpid > 1){
87 kill (desktop_plugin->priv->podpid, SIGTERM);
89 if (wait(&status) == desktop_plugin->priv->podpid)
92 desktop_plugin->priv->podpid = -1;
93 desktop_plugin->priv->running = FALSE;
96 /*******************************************************************************/
98 reload_scene(AWallpaperPlugin *desktop_plugin)
100 fprintf(stderr,"Reload scene %s\n", desktop_plugin->priv->theme);
101 destroy_scene(desktop_plugin);
102 fill_priv(desktop_plugin->priv);
103 init_scene_theme(desktop_plugin);
105 /*******************************************************************************/
107 init_scene_Accel(AWallpaperPlugin *desktop_plugin)
112 gint now = time(NULL);
114 gchar *bgfile = NULL;
115 gint sizes1[4] = {57, 76, 43, 50},
118 /* fprintf(stderr, "init scene accel\n"); */
119 scene = g_new0(Scene, 1);
120 scene->actors = NULL;
121 desktop_plugin->priv->scene = scene;
123 bgfile = g_strdup_printf("/home/user/.backgrounds/background-%i.png", desktop_plugin->priv->view);
124 actor = init_object(desktop_plugin, "original", bgfile,
126 TRUE, TRUE, 100, 255,
128 scene->actors = g_slist_append(scene->actors, actor);
130 child = g_ptr_array_sized_new(16);
132 for (j= 0; j<4; j++){
134 str = g_strdup_printf("tape%i.png", n+1);
135 actor = init_object(desktop_plugin, "tape", str,
136 fast_rnd(800), fast_rnd(480), 2+fast_rnd(6), 800, sizes1[n],
137 TRUE, TRUE, 100, 255,
139 scene->actors = g_slist_append(scene->actors, actor);
140 g_ptr_array_add(child, actor);
144 actor = init_object(desktop_plugin, "tape", "",
146 FALSE, FALSE, 100, 255,
147 (gpointer)&change_tape, NULL, child);
148 actor->time_start_animation = now;
149 actor->duration_animation = G_MAXINT;
150 scene->actors = g_slist_append(scene->actors, actor);
152 run_long_timeout(desktop_plugin);
154 /*******************************************************************************/
156 parsestring(char *line, char **argv)
158 while (*line != '\0') {
159 while (*line == ' ' || *line == '\n')
160 *line++ = '\0'; /* replace white spaces with 0 */
161 *argv++ = line; /* save the argument position */
162 while (*line != '\0' && *line != ' ' &&
164 line++; /* skip the argument until ... */
166 *argv = '\0'; /* mark the end of argument list */
171 sync_handler(GstBus *bus, GstMessage *message, AWallpaperPlugin *desktop_plugin){
173 if (!desktop_plugin->priv->visible)
174 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PAUSED);
175 if (GST_MESSAGE_TYPE(message) != GST_MESSAGE_ELEMENT){
176 return (GST_BUS_PASS);
178 if (!gst_structure_has_name(message->structure, "prepare-xwindow-id")){
179 return (GST_BUS_PASS);
181 return (GST_BUS_DROP);
185 /*******************************************************************************/
187 bus_call (GstBus *bus, GstMessage *msg, AWallpaperPlugin *desktop_plugin)
189 switch (GST_MESSAGE_TYPE (msg))
191 case GST_MESSAGE_EOS:
192 if (desktop_plugin->priv->rich_animation){
194 GstClockTime nach = (GstClockTime)(0 * GST_MSECOND);
195 if (!gst_element_seek(desktop_plugin->priv->pipeline, 1.0, GST_FORMAT_TIME,
196 (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), GST_SEEK_TYPE_SET,
197 nach, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
198 fprintf(stderr,"ERROR in seek\n");
200 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
203 if (desktop_plugin->priv->pipeline){
204 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);
205 gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
209 case GST_MESSAGE_ERROR: break;
215 /*******************************************************************************/
217 init_scene_External(AWallpaperPlugin *desktop_plugin){
219 char* child_argv[2048];
220 char *run_string = NULL;
221 gchar *exec_path = NULL,
228 if (!desktop_plugin->priv->visible)
231 fprintf(stderr,"init_scene_external 111\n");
232 exec_path = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "exec_path"));
233 window_id = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_id"));
234 view = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "view"));
235 fprintf(stderr,"init_scene_external 222\n");
239 strwin = g_strdup_printf(" %s %i", window_id, (gint)GDK_WINDOW_XID(desktop_plugin->priv->window->window));
244 strview = g_strdup_printf(" %s %i", view, desktop_plugin->priv->view);
248 run_string = g_strdup_printf("%s%s%s", exec_path, strwin, strview);
249 fprintf(stderr, "runs string = %s\n", run_string);
250 parsestring(run_string, child_argv);
252 desktop_plugin->priv->running = TRUE;
253 desktop_plugin->priv->podpid = fork();
254 if (desktop_plugin->priv->podpid == 0){
255 execvp(child_argv[0], child_argv);
256 fprintf(stderr,"Problem with new podprocess");
259 window_name = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_name"));
262 id_xwindow = Window_With_Name(GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window),
263 RootWindow( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window), XDefaultScreen( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window))),
265 set_live_bg (GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window), id_xwindow, desktop_plugin->priv->view);
268 /*******************************************************************************/
270 cb_timeout0(AWallpaperPlugin *desktop_plugin) {
272 if (!desktop_plugin || !desktop_plugin->priv->pipeline)
274 if (desktop_plugin->priv->theme_int_parametr1 == 0){
275 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
276 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
277 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
278 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
279 fprintf(stderr,"Error in seek:\n");
283 if (gst_element_get_state (desktop_plugin->priv->pipeline, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE)
286 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
287 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
288 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
289 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
290 fprintf(stderr,"Error in seek:\n");
294 /*******************************************************************************/
296 init_scene_Video(AWallpaperPlugin *desktop_plugin)
299 GstElement *videosink;
300 gchar *file_plus_uri;
303 /* fprintf(stderr, "init scene Video \n"); */
304 desktop_plugin->priv->pipeline = gst_pipeline_new("gst-player");
305 bin = gst_element_factory_make ("playbin2", "bin");
306 videosink = gst_element_factory_make ("ximagesink", "videosink");
307 g_object_set (G_OBJECT (bin), "video-sink", videosink, NULL);
308 gst_bin_add (GST_BIN (desktop_plugin->priv->pipeline), bin);
312 bus = gst_pipeline_get_bus (GST_PIPELINE (desktop_plugin->priv->pipeline));
313 gst_bus_add_watch(bus, (GstBusFunc)bus_call, desktop_plugin);
314 gst_object_unref (bus);
316 file_plus_uri = g_strdup_printf("file://%s",desktop_plugin->priv->theme_string_parametr1);
317 g_object_set (G_OBJECT (bin), "uri", file_plus_uri, NULL );
319 /* Doesn't work in real device. Hardware volume buttons can to change volume for mutted track */
321 if (!desktop_plugin->priv->theme_bool_parametr1)
322 g_object_set (G_OBJECT (bin), "mute", TRUE, NULL );
324 g_object_set (G_OBJECT (videosink), "force-aspect-ratio", TRUE, NULL );
326 if (GST_IS_X_OVERLAY (videosink))
327 gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GDK_DRAWABLE_XID(desktop_plugin->priv->window->window));
329 if (desktop_plugin->priv->visible){
330 g_timeout_add(50, (GSourceFunc)cb_timeout0, desktop_plugin);
331 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
334 //gst_element_get_state(deskddtop_plugin->priv->pipeline, NULL, NULL, 100 * GST_MSECOND);
337 /*******************************************************************************/
339 init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
344 gint now = time(NULL);
347 if (desktop_plugin->priv->rich_animation){
355 /* fprintf(stderr, "init scene2 \n"); */
356 scene = g_new0(Scene, 1);
357 //scene.daytime = get_daytime();
358 scene->actors = NULL;
359 desktop_plugin->priv->scene = scene;
361 actor = init_object(desktop_plugin, "background", "bg.png",
363 TRUE, TRUE, 100, 255,
365 scene->actors = g_slist_append(scene->actors, actor);
367 actor = init_object(desktop_plugin, "symbols", "symbols.png",
369 TRUE, TRUE, 100, 255,
371 scene->actors = g_slist_append(scene->actors, actor);
373 child = g_ptr_array_sized_new(4);
374 actor = init_object(desktop_plugin, "layer1", "layer1_2.png",
376 TRUE, TRUE, 100, 255,
378 //actor->time_start_animation = now;
379 //actor->duration_animation = G_MAXINT;
380 scene->actors = g_slist_append(scene->actors, actor);
381 g_ptr_array_add(child, actor);
383 actor = init_object(desktop_plugin, "layer1", "layer1_1.png",
385 TRUE, TRUE, 100, 255,
387 //actor->time_start_animation = now;
388 //actor->duration_animation = G_MAXINT;
389 scene->actors = g_slist_append(scene->actors, actor);
390 g_ptr_array_add(child, actor);
392 actor = init_object(desktop_plugin, "layer2", "layer2_2.png",
394 TRUE, TRUE, 100, 255,
396 //actor->time_start_animation = now;
397 //actor->duration_animation = G_MAXINT;
398 scene->actors = g_slist_append(scene->actors, actor);
399 g_ptr_array_add(child, actor);
401 actor = init_object(desktop_plugin, "layer2", "layer2_1.png",
403 TRUE, TRUE, 100, 255,
405 //actor->time_start_animation = now;
406 //actor->duration_animation = G_MAXINT;
407 scene->actors = g_slist_append(scene->actors, actor);
408 g_ptr_array_add(child, actor);
410 actor = init_object(desktop_plugin, "layers", "",
412 FALSE, FALSE, 100, 255,
413 (gpointer)&change_layer, NULL, child);
414 actor->time_start_animation = now;
415 actor->duration_animation = G_MAXINT;
416 scene->actors = g_slist_append(scene->actors, actor);
418 run_long_timeout(desktop_plugin);
421 /*******************************************************************************/
422 /* Init Modern Scene */
424 init_scene_Modern(AWallpaperPlugin *desktop_plugin)
428 gint now = time(NULL);
433 /* fprintf(stderr, "init scene \n"); */
434 scene = g_new0(Scene, 1);
435 scene->daytime = get_daytime();
436 scene->actors = NULL;
437 scene->wind_orientation = -1;
438 scene->wind_angle = 0.3;
439 /* init value for random */
440 scene->seed = time(NULL);
441 scene->notification = TRUE;
442 desktop_plugin->priv->scene = scene;
443 actor = init_object(desktop_plugin, "sky", "sky0.png",
445 TRUE , TRUE, 100, 255,
446 (gpointer)&change_static_actor, NULL, NULL);
447 scene->actors = g_slist_append(scene->actors, actor);
448 change_static_actor(actor, desktop_plugin);
450 actor = init_object(desktop_plugin, "sun", "sun.png",
452 FALSE, FALSE, 100, 255,
453 (gpointer)&change_sun, NULL, NULL);
454 actor->time_start_animation = now;
455 actor->duration_animation = G_MAXINT;
456 change_sun(actor, desktop_plugin);
457 scene->actors = g_slist_append(scene->actors, actor);
459 //actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
460 // TRUE, 100, 255, NULL, NULL);
461 //scene.actors = g_slist_append(scene.actors, actor);
463 actor = init_object(desktop_plugin, "cloud1", "cloud1.png",
464 0, fast_rnd(300)-97, 7, 150, 97,
465 FALSE, FALSE, 100, 255,
466 (gpointer)&change_cloud, NULL, NULL);
467 actor->time_start_animation = now + fast_rnd(20);
468 actor->duration_animation = 3*60;
469 scene->actors = g_slist_append(scene->actors, actor);
471 actor = init_object(desktop_plugin, "cloud2", "cloud2.png",
472 0, fast_rnd(300)-75, 7, 188, 75,
473 FALSE, FALSE, 100, 255,
474 (gpointer)&change_cloud, NULL, NULL);
475 actor->time_start_animation = now + fast_rnd(40)+10;
476 actor->duration_animation = 3*60;
477 scene->actors = g_slist_append(scene->actors, actor);
479 actor = init_object(desktop_plugin, "cloud4", "cloud4.png",
480 0, fast_rnd(300)-75, 7, 150, 75,
481 FALSE, FALSE, 100, 255,
482 (gpointer)&change_cloud, NULL, NULL);
483 actor->time_start_animation = now + fast_rnd(60) + 20;
484 actor->duration_animation = 5*60;
485 scene->actors = g_slist_append(scene->actors, actor);
488 actor = init_object(desktop_plugin, "town", "town0.png",
490 TRUE, TRUE, 100, 255,
491 (gpointer)&change_static_actor, NULL, NULL);
492 change_static_actor(actor, desktop_plugin);
493 scene->actors = g_slist_append(scene->actors, actor);
495 actor = init_object(desktop_plugin, "stend", "stend0.png",
496 452, 166, 9, 300, 305,
497 TRUE, TRUE, 100, 255,
498 (gpointer)&change_static_actor, NULL, NULL);
499 change_static_actor(actor, desktop_plugin);
500 scene->actors = g_slist_append(scene->actors, actor);
503 child = g_ptr_array_sized_new(4);
504 actor = init_object(desktop_plugin, "call", "call.png",
506 FALSE, TRUE, 100, 255,
508 scene->actors = g_slist_append(scene->actors, actor);
509 g_ptr_array_add(child, actor);
511 actor = init_object(desktop_plugin, "chat", "chat.png",
513 FALSE, TRUE, 100, 255,
515 scene->actors = g_slist_append(scene->actors, actor);
516 g_ptr_array_add(child, actor);
518 actor = init_object(desktop_plugin, "mail", "mail.png",
520 FALSE, TRUE, 100, 255,
522 scene->actors = g_slist_append(scene->actors, actor);
523 g_ptr_array_add(child, actor);
525 actor = init_object(desktop_plugin, "sms", "sms.png",
527 FALSE, TRUE, 100, 255,
529 scene->actors = g_slist_append(scene->actors, actor);
530 g_ptr_array_add(child, actor);
532 actor = init_object(desktop_plugin, "billboard_text", "",
533 470, 174, 9, 300, 108,
534 FALSE, FALSE, 100, 255,
535 (gpointer)&change_billboard, NULL, child);
536 create_hildon_actor_text(actor, desktop_plugin);
537 //actor->time_start_animation = time(NULL) + 20;
538 change_billboard(actor, desktop_plugin);
539 scene->actors = g_slist_append(scene->actors, actor);
541 actor = init_object(desktop_plugin, "tram", "tram.png",
542 -300, 225, 10, 350, 210,
543 FALSE, FALSE, 100, 255,
544 (gpointer)&change_tram, NULL, NULL);
545 actor->time_start_animation = time(NULL) + fast_rnd(10);
546 actor->duration_animation = 60;
547 scene->actors = g_slist_append(scene->actors, actor);
549 actor = init_object(desktop_plugin, "border", "border0.png",
550 0, 480-79, 11, 800, 79,
551 TRUE, TRUE, 100, 255,
552 (gpointer)&change_static_actor_with_corner, NULL, NULL);
553 change_static_actor_with_corner(actor, desktop_plugin);
554 scene->actors = g_slist_append(scene->actors, actor);
556 actor = init_object(desktop_plugin, "moon", "moon1.png",
558 FALSE, FALSE, 100, 255,
559 (gpointer)&change_moon, NULL, NULL);
560 change_moon(actor, desktop_plugin);
561 scene->actors = g_slist_append(scene->actors, actor);
563 actor = init_object(desktop_plugin, "wind", "",
565 FALSE, FALSE, 100, 255,
566 (gpointer)&change_wind, NULL, NULL);
567 change_wind(actor, desktop_plugin);
568 scene->actors = g_slist_append(scene->actors, actor);
570 /* windows in 4-th house */
610 for (i=0; i<13; i++){
611 actor = init_object(desktop_plugin, "window1", "window1.png",
612 winds[i][0], winds[i][1], 8, 8, 10,
613 FALSE, FALSE, 100, 255,
614 (gpointer)&change_window1, NULL, NULL);
615 //change_window1(actor, desktop_plugin);
616 actor->time_start_animation = now + fast_rnd(30);
617 scene->actors = g_slist_append(scene->actors, actor);
621 /* windows in 1-th house */
647 actor = init_object(desktop_plugin, "window2", "window2.png",
648 winds[i][0], winds[i][1], 8, 8, 10,
649 FALSE, FALSE, 100, 255,
650 (gpointer)&change_window1, NULL, NULL);
651 //change_window1(actor, desktop_plugin);
652 actor->time_start_animation = now + fast_rnd(30);
653 scene->actors = g_slist_append(scene->actors, actor);
657 /* windows in 3-th house */
689 for (i=0; i<10; i++){
690 actor = init_object(desktop_plugin, "window3", "window3.png",
691 winds[i][0], winds[i][1], 8, 8, 10,
692 FALSE, FALSE, 100, 255,
693 (gpointer)&change_window1, NULL, NULL);
694 //change_window1(actor, desktop_plugin);
695 actor->time_start_animation = now + fast_rnd(30);
696 scene->actors = g_slist_append(scene->actors, actor);
700 /* windows in 5-th house */
724 actor = init_object(desktop_plugin, "window4", "window4.png",
725 winds[i][0], winds[i][1], 8, 8, 10,
726 FALSE, FALSE, 100, 255,
727 (gpointer)&change_window1, NULL, NULL);
728 //change_window1(actor, desktop_plugin);
729 actor->time_start_animation = now + fast_rnd(30);
730 scene->actors = g_slist_append(scene->actors, actor);
734 /* windows in 6-th house */
755 actor = init_object(desktop_plugin, "window5", "window5.png",
756 winds[i][0], winds[i][1], 8, 8, 10,
757 FALSE, FALSE, 100, 255,
758 (gpointer)&change_window1, NULL, NULL);
759 //change_window1(actor, desktop_plugin);
760 actor->time_start_animation = now + fast_rnd(30);
761 scene->actors = g_slist_append(scene->actors, actor);
764 run_long_timeout(desktop_plugin);
767 anim = g_new0(Animation, 1);
770 anim->func_change = &change_tram;
771 anim->func_time = NULL;
772 anim->timestart = time(NULL);
775 scene.dynamic_actors = g_slist_append(scene.dynamic_actors, anim);
778 /*******************************************************************************/
779 /* Init Berlin Scene */
781 init_scene_Berlin(AWallpaperPlugin *desktop_plugin)
783 Actor *actor, *actor1, *actor2;
785 gint now = time(NULL);
788 GPtrArray *child = NULL;
790 scene = g_new0(Scene, 1);
791 scene->daytime = get_daytime();
792 scene->actors = NULL;
793 scene->wind_orientation = -1;
794 scene->wind_angle = 0.3;
795 /* init value for random */
796 scene->seed = time(NULL);
797 desktop_plugin->priv->scene = scene;
799 actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480,
800 TRUE, TRUE, 100, 255,
801 (gpointer)&change_static_actor, NULL, NULL);
802 change_static_actor(actor, desktop_plugin);
803 scene->actors = g_slist_append(scene->actors, actor);
806 actor = init_object(desktop_plugin, "sun", "sun.png", 0, 0, 6, 88, 88,
807 FALSE, FALSE, 100, 255,
808 (gpointer)&change_sun, NULL, NULL);
809 actor->time_start_animation = time(NULL);
810 actor->duration_animation = G_MAXINT;
811 change_sun(actor, desktop_plugin);
812 scene->actors = g_slist_append(scene->actors, actor);
815 actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
816 TRUE, 100, 255, NULL, NULL);
817 scene.actors = g_slist_append(scene.actors, actor);
820 actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60,
821 FALSE, FALSE, 100, 255,
822 (gpointer)&change_moon, NULL, NULL);
823 change_moon(actor, desktop_plugin);
824 scene->actors = g_slist_append(scene->actors, actor);
826 actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97,
827 FALSE, FALSE, 100, 255,
828 (gpointer)&change_cloud, NULL, NULL);
829 actor->time_start_animation = now + fast_rnd(30) + 10;
830 actor->duration_animation = 3*60;
831 scene->actors = g_slist_append(scene->actors, actor);
833 actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75,
834 FALSE, FALSE, 100, 255,
835 (gpointer)&change_cloud, NULL, NULL);
836 actor->time_start_animation = now + fast_rnd(10);
837 actor->duration_animation = 3*60;
838 scene->actors = g_slist_append(scene->actors, actor);
840 actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75,
841 FALSE, FALSE, 100, 255,
842 (gpointer)&change_cloud, NULL, NULL);
843 actor->time_start_animation = now + fast_rnd(60) + 20;
844 actor->duration_animation = 5*60;
845 scene->actors = g_slist_append(scene->actors, actor);
848 actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 8, 160, 50,
849 FALSE, FALSE, 100, 255,
850 (gpointer)&change_plane2, NULL, NULL);
851 actor->time_start_animation = now + fast_rnd(40) + 20;
852 actor->duration_animation = 60;
853 scene->actors = g_slist_append(scene->actors, actor);
855 actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116,
856 FALSE, FALSE, 100, 255,
857 (gpointer)&change_plane1, NULL, NULL);
858 actor->time_start_animation = now + fast_rnd(20);
859 actor->duration_animation = 30;
860 scene->actors = g_slist_append(scene->actors, actor);
862 actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480,
863 TRUE, TRUE, 100, 255,
864 (gpointer)&change_static_actor_with_corner, NULL, NULL);
865 change_static_actor_with_corner(actor, desktop_plugin);
866 scene->actors = g_slist_append(scene->actors, actor);
868 actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0,
869 FALSE, FALSE, 100, 255,
870 (gpointer)&change_wind, NULL, NULL);
871 change_wind(actor, desktop_plugin);
872 scene->actors = g_slist_append(scene->actors, actor);
874 actor1 = init_object(desktop_plugin, "signal_red", "red.png",
875 486, 425, 10, 18, 38,
876 FALSE, TRUE, 100, 255, NULL, NULL, NULL);
877 //actor->time_start_animation = now + fast_rnd(30) + 10;
878 scene->actors = g_slist_append(scene->actors, actor1);
880 actor2 = init_object(desktop_plugin, "signal_green", "green.png",
881 486, 425, 10, 18, 38,
882 TRUE, TRUE, 100, 255, NULL, NULL, NULL);
883 //actor->time_start_animation = now + fast_rnd(30) + 10;
884 scene->actors = g_slist_append(scene->actors, actor2);
885 child = g_ptr_array_sized_new(2);
886 g_ptr_array_add(child, actor1);
887 g_ptr_array_add(child, actor2);
888 actor = init_object(desktop_plugin, "signal", "",
889 486, 425, 10, 18, 38,
890 FALSE, FALSE, 100, 255,
891 (gpointer)&change_signal, NULL, child);
892 actor->time_start_animation = now + fast_rnd(30) + 10;
893 scene->actors = g_slist_append(scene->actors, actor);
934 for (i=0; i<13; i++){
935 actor = init_object(desktop_plugin, "window", "window.png",
936 winds[i][0], winds[i][1], 10, 8, 9,
937 FALSE, TRUE, 100, 255,
938 (gpointer)&change_window1, NULL, NULL);
939 //change_window1(actor, desktop_plugin);
940 actor->time_start_animation = now + fast_rnd(30);
941 scene->actors = g_slist_append(scene->actors, actor);
945 run_long_timeout(desktop_plugin);
948 /*******************************************************************************/
950 init_scene_theme(AWallpaperPlugin *desktop_plugin)
953 void (*func)(gpointer);
954 func = g_hash_table_lookup(desktop_plugin->priv->hash_scene_func, desktop_plugin->priv->theme);
956 (*func)(desktop_plugin);
959 fprintf(stderr, "Init_scene_theme\n");
960 void (*func)(gpointer);
961 func = desktop_plugin->priv->scene_func;
963 fprintf(stderr, "Success init_scene_theme\n");
964 (*func)(desktop_plugin);