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))
49 if (!XQueryTree(dpy, top, &dummy, &dummy, &children, &nchildren))
52 for (i=0; i<nchildren; i++) {
53 w = Window_With_Name(dpy, children[i], name);
57 if (children) XFree ((char *)children);
61 /*******************************************************************************/
64 destroy_scene(AWallpaperPlugin *desktop_plugin)
68 if (desktop_plugin->priv->scene){
69 GSList * tmp = desktop_plugin->priv->scene->actors;
71 destroy_actor(tmp->data);
72 tmp = g_slist_next(tmp);
76 desktop_plugin->priv->scene->actors = NULL;
77 if (desktop_plugin->priv->scene){
78 g_free(desktop_plugin->priv->scene);
79 desktop_plugin->priv->scene = NULL;
82 if (desktop_plugin->priv->pipeline){
83 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);
84 gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
85 desktop_plugin->priv->pipeline = NULL;
87 if (desktop_plugin->priv->podpid > 1){
88 kill (desktop_plugin->priv->podpid, SIGTERM);
90 if (wait(&status) == desktop_plugin->priv->podpid)
93 desktop_plugin->priv->podpid = -1;
94 desktop_plugin->priv->running = FALSE;
97 /*******************************************************************************/
99 reload_scene(AWallpaperPlugin *desktop_plugin)
101 fprintf(stderr,"Reload scene %s\n", desktop_plugin->priv->theme);
102 destroy_scene(desktop_plugin);
103 fill_priv(desktop_plugin->priv);
104 init_scene_theme(desktop_plugin);
106 /*******************************************************************************/
108 init_scene_Accel(AWallpaperPlugin *desktop_plugin)
113 gint now = time(NULL);
115 gchar *bgfile = NULL;
116 gint sizes1[4] = {57, 76, 43, 50},
119 /* fprintf(stderr, "init scene accel\n"); */
120 scene = g_new0(Scene, 1);
121 scene->actors = NULL;
122 desktop_plugin->priv->scene = scene;
124 bgfile = g_strdup_printf("/home/user/.backgrounds/background-%i.png", desktop_plugin->priv->view);
125 actor = init_object(desktop_plugin, "original", bgfile,
127 TRUE, TRUE, 100, 255,
129 scene->actors = g_slist_append(scene->actors, actor);
131 child = g_ptr_array_sized_new(16);
133 for (j= 0; j<4; j++){
135 str = g_strdup_printf("tape%i.png", n+1);
136 actor = init_object(desktop_plugin, "tape", str,
137 fast_rnd(800), fast_rnd(480), 2+fast_rnd(6), 800, sizes1[n],
138 TRUE, TRUE, 100, 255,
140 scene->actors = g_slist_append(scene->actors, actor);
141 g_ptr_array_add(child, actor);
145 actor = init_object(desktop_plugin, "tape", "",
147 FALSE, FALSE, 100, 255,
148 (gpointer)&change_tape, NULL, child);
149 actor->time_start_animation = now;
150 actor->duration_animation = G_MAXINT;
151 scene->actors = g_slist_append(scene->actors, actor);
153 run_long_timeout(desktop_plugin);
155 /*******************************************************************************/
157 parsestring(char *line, char **argv)
159 while (*line != '\0') {
160 while (*line == ' ' || *line == '\n')
161 *line++ = '\0'; /* replace white spaces with 0 */
162 *argv++ = line; /* save the argument position */
163 while (*line != '\0' && *line != ' ' &&
165 line++; /* skip the argument until ... */
167 *argv = '\0'; /* mark the end of argument list */
172 sync_handler(GstBus *bus, GstMessage *message, AWallpaperPlugin *desktop_plugin){
174 if (!desktop_plugin->priv->visible)
175 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PAUSED);
176 if (GST_MESSAGE_TYPE(message) != GST_MESSAGE_ELEMENT){
177 return (GST_BUS_PASS);
179 if (!gst_structure_has_name(message->structure, "prepare-xwindow-id")){
180 return (GST_BUS_PASS);
182 return (GST_BUS_DROP);
186 /*******************************************************************************/
188 bus_call (GstBus *bus, GstMessage *msg, AWallpaperPlugin *desktop_plugin)
190 switch (GST_MESSAGE_TYPE (msg))
192 case GST_MESSAGE_EOS:
193 if (desktop_plugin->priv->rich_animation){
195 GstClockTime nach = (GstClockTime)(0 * GST_MSECOND);
196 if (!gst_element_seek(desktop_plugin->priv->pipeline, 1.0, GST_FORMAT_TIME,
197 (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), GST_SEEK_TYPE_SET,
198 nach, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
199 fprintf(stderr,"ERROR in seek\n");
201 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
204 if (desktop_plugin->priv->pipeline){
205 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);
206 gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
210 case GST_MESSAGE_ERROR: break;
216 /*******************************************************************************/
218 init_scene_External(AWallpaperPlugin *desktop_plugin){
220 char* child_argv[2048];
221 char *run_string = NULL;
222 gchar *exec_path = NULL,
229 if (!desktop_plugin->priv->visible)
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 window_name = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_name"));
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");
261 id_xwindow = Window_With_Name(GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window),
262 RootWindow( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window), XDefaultScreen( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window))),
264 set_live_bg (GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window), id_xwindow, desktop_plugin->priv->view);
267 /*******************************************************************************/
269 cb_timeout0(AWallpaperPlugin *desktop_plugin) {
271 if (!desktop_plugin || !desktop_plugin->priv->pipeline)
273 if (desktop_plugin->priv->theme_int_parametr1 == 0){
274 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
275 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
276 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
277 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
278 fprintf(stderr,"Error in seek:\n");
282 if (gst_element_get_state (desktop_plugin->priv->pipeline, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE)
285 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
286 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
287 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
288 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
289 fprintf(stderr,"Error in seek:\n");
293 /*******************************************************************************/
295 init_scene_Video(AWallpaperPlugin *desktop_plugin)
298 GstElement *videosink;
299 gchar *file_plus_uri;
302 /* fprintf(stderr, "init scene Video \n"); */
303 desktop_plugin->priv->pipeline = gst_pipeline_new("gst-player");
304 bin = gst_element_factory_make ("playbin2", "bin");
305 videosink = gst_element_factory_make ("ximagesink", "videosink");
306 g_object_set (G_OBJECT (bin), "video-sink", videosink, NULL);
307 gst_bin_add (GST_BIN (desktop_plugin->priv->pipeline), bin);
311 bus = gst_pipeline_get_bus (GST_PIPELINE (desktop_plugin->priv->pipeline));
312 gst_bus_add_watch(bus, (GstBusFunc)bus_call, desktop_plugin);
313 gst_object_unref (bus);
315 file_plus_uri = g_strdup_printf("file://%s",desktop_plugin->priv->theme_string_parametr1);
316 g_object_set (G_OBJECT (bin), "uri", file_plus_uri, NULL );
318 /* Doesn't work in real device. Hardware volume buttons can to change volume for mutted track */
320 if (!desktop_plugin->priv->theme_bool_parametr1)
321 g_object_set (G_OBJECT (bin), "mute", TRUE, NULL );
323 g_object_set (G_OBJECT (videosink), "force-aspect-ratio", TRUE, NULL );
325 if (GST_IS_X_OVERLAY (videosink))
326 gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GDK_DRAWABLE_XID(desktop_plugin->priv->window->window));
328 if (desktop_plugin->priv->visible){
329 g_timeout_add(50, (GSourceFunc)cb_timeout0, desktop_plugin);
330 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
333 //gst_element_get_state(deskddtop_plugin->priv->pipeline, NULL, NULL, 100 * GST_MSECOND);
336 /*******************************************************************************/
338 init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
343 gint now = time(NULL);
346 if (desktop_plugin->priv->rich_animation){
354 /* fprintf(stderr, "init scene2 \n"); */
355 scene = g_new0(Scene, 1);
356 //scene.daytime = get_daytime();
357 scene->actors = NULL;
358 desktop_plugin->priv->scene = scene;
360 actor = init_object(desktop_plugin, "background", "bg.png",
362 TRUE, TRUE, 100, 255,
364 scene->actors = g_slist_append(scene->actors, actor);
366 actor = init_object(desktop_plugin, "symbols", "symbols.png",
368 TRUE, TRUE, 100, 255,
370 scene->actors = g_slist_append(scene->actors, actor);
372 child = g_ptr_array_sized_new(4);
373 actor = init_object(desktop_plugin, "layer1", "layer1_2.png",
375 TRUE, TRUE, 100, 255,
377 //actor->time_start_animation = now;
378 //actor->duration_animation = G_MAXINT;
379 scene->actors = g_slist_append(scene->actors, actor);
380 g_ptr_array_add(child, actor);
382 actor = init_object(desktop_plugin, "layer1", "layer1_1.png",
384 TRUE, TRUE, 100, 255,
386 //actor->time_start_animation = now;
387 //actor->duration_animation = G_MAXINT;
388 scene->actors = g_slist_append(scene->actors, actor);
389 g_ptr_array_add(child, actor);
391 actor = init_object(desktop_plugin, "layer2", "layer2_2.png",
393 TRUE, TRUE, 100, 255,
395 //actor->time_start_animation = now;
396 //actor->duration_animation = G_MAXINT;
397 scene->actors = g_slist_append(scene->actors, actor);
398 g_ptr_array_add(child, actor);
400 actor = init_object(desktop_plugin, "layer2", "layer2_1.png",
402 TRUE, TRUE, 100, 255,
404 //actor->time_start_animation = now;
405 //actor->duration_animation = G_MAXINT;
406 scene->actors = g_slist_append(scene->actors, actor);
407 g_ptr_array_add(child, actor);
409 actor = init_object(desktop_plugin, "layers", "",
411 FALSE, FALSE, 100, 255,
412 (gpointer)&change_layer, NULL, child);
413 actor->time_start_animation = now;
414 actor->duration_animation = G_MAXINT;
415 scene->actors = g_slist_append(scene->actors, actor);
417 run_long_timeout(desktop_plugin);
420 /*******************************************************************************/
421 /* Init Modern Scene */
423 init_scene_Modern(AWallpaperPlugin *desktop_plugin)
427 gint now = time(NULL);
432 /* fprintf(stderr, "init scene \n"); */
433 scene = g_new0(Scene, 1);
434 scene->daytime = get_daytime();
435 scene->actors = NULL;
436 scene->wind_orientation = -1;
437 scene->wind_angle = 0.3;
438 /* init value for random */
439 scene->seed = time(NULL);
440 scene->notification = TRUE;
441 desktop_plugin->priv->scene = scene;
442 actor = init_object(desktop_plugin, "sky", "sky0.png",
444 TRUE , TRUE, 100, 255,
445 (gpointer)&change_static_actor, NULL, NULL);
446 scene->actors = g_slist_append(scene->actors, actor);
447 change_static_actor(actor, desktop_plugin);
449 actor = init_object(desktop_plugin, "sun", "sun.png",
451 FALSE, FALSE, 100, 255,
452 (gpointer)&change_sun, NULL, NULL);
453 actor->time_start_animation = now;
454 actor->duration_animation = G_MAXINT;
455 change_sun(actor, desktop_plugin);
456 scene->actors = g_slist_append(scene->actors, actor);
458 //actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
459 // TRUE, 100, 255, NULL, NULL);
460 //scene.actors = g_slist_append(scene.actors, actor);
462 actor = init_object(desktop_plugin, "cloud1", "cloud1.png",
463 0, fast_rnd(300)-97, 7, 150, 97,
464 FALSE, FALSE, 100, 255,
465 (gpointer)&change_cloud, NULL, NULL);
466 actor->time_start_animation = now + fast_rnd(20);
467 actor->duration_animation = 3*60;
468 scene->actors = g_slist_append(scene->actors, actor);
470 actor = init_object(desktop_plugin, "cloud2", "cloud2.png",
471 0, fast_rnd(300)-75, 7, 188, 75,
472 FALSE, FALSE, 100, 255,
473 (gpointer)&change_cloud, NULL, NULL);
474 actor->time_start_animation = now + fast_rnd(40)+10;
475 actor->duration_animation = 3*60;
476 scene->actors = g_slist_append(scene->actors, actor);
478 actor = init_object(desktop_plugin, "cloud4", "cloud4.png",
479 0, fast_rnd(300)-75, 7, 150, 75,
480 FALSE, FALSE, 100, 255,
481 (gpointer)&change_cloud, NULL, NULL);
482 actor->time_start_animation = now + fast_rnd(60) + 20;
483 actor->duration_animation = 5*60;
484 scene->actors = g_slist_append(scene->actors, actor);
487 actor = init_object(desktop_plugin, "town", "town0.png",
489 TRUE, TRUE, 100, 255,
490 (gpointer)&change_static_actor, NULL, NULL);
491 change_static_actor(actor, desktop_plugin);
492 scene->actors = g_slist_append(scene->actors, actor);
494 actor = init_object(desktop_plugin, "stend", "stend0.png",
495 452, 166, 9, 300, 305,
496 TRUE, TRUE, 100, 255,
497 (gpointer)&change_static_actor, NULL, NULL);
498 change_static_actor(actor, desktop_plugin);
499 scene->actors = g_slist_append(scene->actors, actor);
502 child = g_ptr_array_sized_new(4);
503 actor = init_object(desktop_plugin, "call", "call.png",
505 FALSE, TRUE, 100, 255,
507 scene->actors = g_slist_append(scene->actors, actor);
508 g_ptr_array_add(child, actor);
510 actor = init_object(desktop_plugin, "chat", "chat.png",
512 FALSE, TRUE, 100, 255,
514 scene->actors = g_slist_append(scene->actors, actor);
515 g_ptr_array_add(child, actor);
517 actor = init_object(desktop_plugin, "mail", "mail.png",
519 FALSE, TRUE, 100, 255,
521 scene->actors = g_slist_append(scene->actors, actor);
522 g_ptr_array_add(child, actor);
524 actor = init_object(desktop_plugin, "sms", "sms.png",
526 FALSE, TRUE, 100, 255,
528 scene->actors = g_slist_append(scene->actors, actor);
529 g_ptr_array_add(child, actor);
531 actor = init_object(desktop_plugin, "billboard_text", "",
532 470, 174, 9, 300, 108,
533 FALSE, FALSE, 100, 255,
534 (gpointer)&change_billboard, NULL, child);
535 create_hildon_actor_text(actor, desktop_plugin);
536 //actor->time_start_animation = time(NULL) + 20;
537 change_billboard(actor, desktop_plugin);
538 scene->actors = g_slist_append(scene->actors, actor);
540 actor = init_object(desktop_plugin, "tram", "tram.png",
541 -300, 225, 10, 350, 210,
542 FALSE, FALSE, 100, 255,
543 (gpointer)&change_tram, NULL, NULL);
544 actor->time_start_animation = time(NULL) + fast_rnd(10);
545 actor->duration_animation = 60;
546 scene->actors = g_slist_append(scene->actors, actor);
548 actor = init_object(desktop_plugin, "border", "border0.png",
549 0, 480-79, 11, 800, 79,
550 TRUE, TRUE, 100, 255,
551 (gpointer)&change_static_actor_with_corner, NULL, NULL);
552 change_static_actor_with_corner(actor, desktop_plugin);
553 scene->actors = g_slist_append(scene->actors, actor);
555 actor = init_object(desktop_plugin, "moon", "moon1.png",
557 FALSE, FALSE, 100, 255,
558 (gpointer)&change_moon, NULL, NULL);
559 change_moon(actor, desktop_plugin);
560 scene->actors = g_slist_append(scene->actors, actor);
562 actor = init_object(desktop_plugin, "wind", "",
564 FALSE, FALSE, 100, 255,
565 (gpointer)&change_wind, NULL, NULL);
566 change_wind(actor, desktop_plugin);
567 scene->actors = g_slist_append(scene->actors, actor);
569 /* windows in 4-th house */
609 for (i=0; i<13; i++){
610 actor = init_object(desktop_plugin, "window1", "window1.png",
611 winds[i][0], winds[i][1], 8, 8, 10,
612 FALSE, FALSE, 100, 255,
613 (gpointer)&change_window1, NULL, NULL);
614 //change_window1(actor, desktop_plugin);
615 actor->time_start_animation = now + fast_rnd(30);
616 scene->actors = g_slist_append(scene->actors, actor);
620 /* windows in 1-th house */
646 actor = init_object(desktop_plugin, "window2", "window2.png",
647 winds[i][0], winds[i][1], 8, 8, 10,
648 FALSE, FALSE, 100, 255,
649 (gpointer)&change_window1, NULL, NULL);
650 //change_window1(actor, desktop_plugin);
651 actor->time_start_animation = now + fast_rnd(30);
652 scene->actors = g_slist_append(scene->actors, actor);
656 /* windows in 3-th house */
688 for (i=0; i<10; i++){
689 actor = init_object(desktop_plugin, "window3", "window3.png",
690 winds[i][0], winds[i][1], 8, 8, 10,
691 FALSE, FALSE, 100, 255,
692 (gpointer)&change_window1, NULL, NULL);
693 //change_window1(actor, desktop_plugin);
694 actor->time_start_animation = now + fast_rnd(30);
695 scene->actors = g_slist_append(scene->actors, actor);
699 /* windows in 5-th house */
723 actor = init_object(desktop_plugin, "window4", "window4.png",
724 winds[i][0], winds[i][1], 8, 8, 10,
725 FALSE, FALSE, 100, 255,
726 (gpointer)&change_window1, NULL, NULL);
727 //change_window1(actor, desktop_plugin);
728 actor->time_start_animation = now + fast_rnd(30);
729 scene->actors = g_slist_append(scene->actors, actor);
733 /* windows in 6-th house */
754 actor = init_object(desktop_plugin, "window5", "window5.png",
755 winds[i][0], winds[i][1], 8, 8, 10,
756 FALSE, FALSE, 100, 255,
757 (gpointer)&change_window1, NULL, NULL);
758 //change_window1(actor, desktop_plugin);
759 actor->time_start_animation = now + fast_rnd(30);
760 scene->actors = g_slist_append(scene->actors, actor);
763 run_long_timeout(desktop_plugin);
766 anim = g_new0(Animation, 1);
769 anim->func_change = &change_tram;
770 anim->func_time = NULL;
771 anim->timestart = time(NULL);
774 scene.dynamic_actors = g_slist_append(scene.dynamic_actors, anim);
777 /*******************************************************************************/
778 /* Init Berlin Scene */
780 init_scene_Berlin(AWallpaperPlugin *desktop_plugin)
782 Actor *actor, *actor1, *actor2;
784 gint now = time(NULL);
787 GPtrArray *child = NULL;
789 scene = g_new0(Scene, 1);
790 scene->daytime = get_daytime();
791 scene->actors = NULL;
792 scene->wind_orientation = -1;
793 scene->wind_angle = 0.3;
794 /* init value for random */
795 scene->seed = time(NULL);
796 desktop_plugin->priv->scene = scene;
798 actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480,
799 TRUE, TRUE, 100, 255,
800 (gpointer)&change_static_actor, NULL, NULL);
801 change_static_actor(actor, desktop_plugin);
802 scene->actors = g_slist_append(scene->actors, actor);
805 actor = init_object(desktop_plugin, "sun", "sun.png", 0, 0, 6, 88, 88,
806 FALSE, FALSE, 100, 255,
807 (gpointer)&change_sun, NULL, NULL);
808 actor->time_start_animation = time(NULL);
809 actor->duration_animation = G_MAXINT;
810 change_sun(actor, desktop_plugin);
811 scene->actors = g_slist_append(scene->actors, actor);
814 actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
815 TRUE, 100, 255, NULL, NULL);
816 scene.actors = g_slist_append(scene.actors, actor);
819 actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60,
820 FALSE, FALSE, 100, 255,
821 (gpointer)&change_moon, NULL, NULL);
822 change_moon(actor, desktop_plugin);
823 scene->actors = g_slist_append(scene->actors, actor);
825 actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97,
826 FALSE, FALSE, 100, 255,
827 (gpointer)&change_cloud, NULL, NULL);
828 actor->time_start_animation = now + fast_rnd(30) + 10;
829 actor->duration_animation = 3*60;
830 scene->actors = g_slist_append(scene->actors, actor);
832 actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75,
833 FALSE, FALSE, 100, 255,
834 (gpointer)&change_cloud, NULL, NULL);
835 actor->time_start_animation = now + fast_rnd(10);
836 actor->duration_animation = 3*60;
837 scene->actors = g_slist_append(scene->actors, actor);
839 actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75,
840 FALSE, FALSE, 100, 255,
841 (gpointer)&change_cloud, NULL, NULL);
842 actor->time_start_animation = now + fast_rnd(60) + 20;
843 actor->duration_animation = 5*60;
844 scene->actors = g_slist_append(scene->actors, actor);
847 actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 8, 160, 50,
848 FALSE, FALSE, 100, 255,
849 (gpointer)&change_plane2, NULL, NULL);
850 actor->time_start_animation = now + fast_rnd(40) + 20;
851 actor->duration_animation = 60;
852 scene->actors = g_slist_append(scene->actors, actor);
854 actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116,
855 FALSE, FALSE, 100, 255,
856 (gpointer)&change_plane1, NULL, NULL);
857 actor->time_start_animation = now + fast_rnd(20);
858 actor->duration_animation = 30;
859 scene->actors = g_slist_append(scene->actors, actor);
861 actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480,
862 TRUE, TRUE, 100, 255,
863 (gpointer)&change_static_actor_with_corner, NULL, NULL);
864 change_static_actor_with_corner(actor, desktop_plugin);
865 scene->actors = g_slist_append(scene->actors, actor);
867 actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0,
868 FALSE, FALSE, 100, 255,
869 (gpointer)&change_wind, NULL, NULL);
870 change_wind(actor, desktop_plugin);
871 scene->actors = g_slist_append(scene->actors, actor);
873 actor1 = init_object(desktop_plugin, "signal_red", "red.png",
874 486, 425, 10, 18, 38,
875 FALSE, TRUE, 100, 255, NULL, NULL, NULL);
876 //actor->time_start_animation = now + fast_rnd(30) + 10;
877 scene->actors = g_slist_append(scene->actors, actor1);
879 actor2 = init_object(desktop_plugin, "signal_green", "green.png",
880 486, 425, 10, 18, 38,
881 TRUE, TRUE, 100, 255, NULL, NULL, NULL);
882 //actor->time_start_animation = now + fast_rnd(30) + 10;
883 scene->actors = g_slist_append(scene->actors, actor2);
884 child = g_ptr_array_sized_new(2);
885 g_ptr_array_add(child, actor1);
886 g_ptr_array_add(child, actor2);
887 actor = init_object(desktop_plugin, "signal", "",
888 486, 425, 10, 18, 38,
889 FALSE, FALSE, 100, 255,
890 (gpointer)&change_signal, NULL, child);
891 actor->time_start_animation = now + fast_rnd(30) + 10;
892 scene->actors = g_slist_append(scene->actors, actor);
933 for (i=0; i<13; i++){
934 actor = init_object(desktop_plugin, "window", "window.png",
935 winds[i][0], winds[i][1], 10, 8, 9,
936 FALSE, TRUE, 100, 255,
937 (gpointer)&change_window1, NULL, NULL);
938 //change_window1(actor, desktop_plugin);
939 actor->time_start_animation = now + fast_rnd(30);
940 scene->actors = g_slist_append(scene->actors, actor);
944 run_long_timeout(desktop_plugin);
947 /*******************************************************************************/
949 init_scene_theme(AWallpaperPlugin *desktop_plugin)
952 void (*func)(gpointer);
953 func = g_hash_table_lookup(desktop_plugin->priv->hash_scene_func, desktop_plugin->priv->theme);
955 (*func)(desktop_plugin);
958 fprintf(stderr, "Init_scene_theme\n");
959 void (*func)(gpointer);
960 func = desktop_plugin->priv->scene_func;
962 fprintf(stderr, "Success init_scene_theme\n");
963 (*func)(desktop_plugin);