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 gtk_widget_destroy(desktop_plugin->priv->window);
105 if (desktop_plugin->priv->one_in_all_view && desktop_plugin->priv->view >1)
107 create_xwindow(desktop_plugin->priv);
108 init_scene_theme(desktop_plugin);
110 /*******************************************************************************/
112 init_scene_Accel(AWallpaperPlugin *desktop_plugin)
117 gint now = time(NULL);
119 gchar *bgfile = NULL;
120 gint sizes1[4] = {57, 76, 43, 50},
123 /* fprintf(stderr, "init scene accel\n"); */
124 scene = g_new0(Scene, 1);
125 scene->actors = NULL;
126 desktop_plugin->priv->scene = scene;
128 bgfile = g_strdup_printf("/home/user/.backgrounds/background-%i.png", desktop_plugin->priv->view);
129 actor = init_object(desktop_plugin, "original", bgfile,
131 TRUE, TRUE, 100, 255,
133 scene->actors = g_slist_append(scene->actors, actor);
135 child = g_ptr_array_sized_new(16);
137 for (j= 0; j<4; j++){
139 str = g_strdup_printf("tape%i.png", n+1);
140 actor = init_object(desktop_plugin, "tape", str,
141 fast_rnd(800), fast_rnd(480), 2+fast_rnd(6), 800, sizes1[n],
142 TRUE, TRUE, 100, 255,
144 scene->actors = g_slist_append(scene->actors, actor);
145 g_ptr_array_add(child, actor);
149 actor = init_object(desktop_plugin, "tape", "",
151 FALSE, FALSE, 100, 255,
152 (gpointer)&change_tape, NULL, child);
153 actor->time_start_animation = now;
154 actor->duration_animation = G_MAXINT;
155 scene->actors = g_slist_append(scene->actors, actor);
157 run_long_timeout(desktop_plugin);
159 /*******************************************************************************/
161 parsestring(char *line, char **argv)
163 while (*line != '\0') {
164 while (*line == ' ' || *line == '\n')
165 *line++ = '\0'; /* replace white spaces with 0 */
166 *argv++ = line; /* save the argument position */
167 while (*line != '\0' && *line != ' ' &&
169 line++; /* skip the argument until ... */
171 *argv = '\0'; /* mark the end of argument list */
176 sync_handler(GstBus *bus, GstMessage *message, AWallpaperPlugin *desktop_plugin){
178 if (!desktop_plugin->priv->visible)
179 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PAUSED);
180 if (GST_MESSAGE_TYPE(message) != GST_MESSAGE_ELEMENT){
181 return (GST_BUS_PASS);
183 if (!gst_structure_has_name(message->structure, "prepare-xwindow-id")){
184 return (GST_BUS_PASS);
186 return (GST_BUS_DROP);
190 /*******************************************************************************/
192 bus_call (GstBus *bus, GstMessage *msg, AWallpaperPlugin *desktop_plugin)
194 switch (GST_MESSAGE_TYPE (msg))
196 case GST_MESSAGE_EOS:
197 if (desktop_plugin->priv->rich_animation){
199 GstClockTime nach = (GstClockTime)(0 * GST_MSECOND);
200 if (!gst_element_seek(desktop_plugin->priv->pipeline, 1.0, GST_FORMAT_TIME,
201 (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), GST_SEEK_TYPE_SET,
202 nach, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
203 fprintf(stderr,"ERROR in seek\n");
205 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
208 if (desktop_plugin->priv->pipeline){
209 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);
210 gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));
214 case GST_MESSAGE_ERROR: break;
220 /*******************************************************************************/
222 init_scene_External(AWallpaperPlugin *desktop_plugin){
224 char* child_argv[2048];
225 char *run_string = NULL;
226 gchar *exec_path = NULL,
234 if (!desktop_plugin->priv->visible)
237 exec_path = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "exec_path"));
238 window_id = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_id"));
239 view = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "view"));
240 window_name = g_strdup(g_hash_table_lookup(desktop_plugin->priv->hash_theme, "window_name"));
244 strwin = g_strdup_printf(" %s %i", window_id, (gint)GDK_WINDOW_XID(desktop_plugin->priv->window->window));
249 strview = g_strdup_printf(" %s %i", view, desktop_plugin->priv->view);
253 run_string = g_strdup_printf("%s%s%s", exec_path, strwin, strview);
254 fprintf(stderr, "runs string = %s\n", run_string);
255 parsestring(run_string, child_argv);
257 desktop_plugin->priv->running = TRUE;
258 desktop_plugin->priv->podpid = fork();
259 if (desktop_plugin->priv->podpid == 0){
260 execvp(child_argv[0], child_argv);
261 fprintf(stderr,"Problem with new podprocess");
265 /* Do 10 trying to search of window */
266 for (i=0; i<10; i++){
268 id_xwindow = Window_With_Name(GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window),
269 RootWindow( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window), XDefaultScreen( GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window))),
271 fprintf(stderr,"name %s %i %i\n", window_name, id_xwindow, i);
273 if (desktop_plugin->priv->one_in_all_view)
274 set_live_bg (GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window),
277 set_live_bg (GDK_WINDOW_XDISPLAY (desktop_plugin->priv->window->window),
278 id_xwindow, desktop_plugin->priv->view);
279 /* gtk_widget_destroy(desktop_plugin->priv->window); */
285 /*******************************************************************************/
287 cb_timeout0(AWallpaperPlugin *desktop_plugin) {
289 if (!desktop_plugin || !desktop_plugin->priv->pipeline)
291 if (desktop_plugin->priv->theme_int_parametr1 == 0){
292 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
293 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
294 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
295 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
296 fprintf(stderr,"Error in seek:\n");
300 if (gst_element_get_state (desktop_plugin->priv->pipeline, NULL, NULL, -1) == GST_STATE_CHANGE_FAILURE)
303 if (!gst_element_seek((GstElement *)GST_PIPELINE (desktop_plugin->priv->pipeline), 1.0, GST_FORMAT_TIME,
304 GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET,
305 desktop_plugin->priv->theme_int_parametr1 * GST_SECOND,
306 GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
307 fprintf(stderr,"Error in seek:\n");
311 /*******************************************************************************/
313 init_scene_Video(AWallpaperPlugin *desktop_plugin)
316 GstElement *videosink;
317 gchar *file_plus_uri;
320 /* fprintf(stderr, "init scene Video \n"); */
321 desktop_plugin->priv->pipeline = gst_pipeline_new("gst-player");
322 bin = gst_element_factory_make ("playbin2", "bin");
323 videosink = gst_element_factory_make ("ximagesink", "videosink");
324 g_object_set (G_OBJECT (bin), "video-sink", videosink, NULL);
325 gst_bin_add (GST_BIN (desktop_plugin->priv->pipeline), bin);
329 bus = gst_pipeline_get_bus (GST_PIPELINE (desktop_plugin->priv->pipeline));
330 gst_bus_add_watch(bus, (GstBusFunc)bus_call, desktop_plugin);
331 gst_object_unref (bus);
333 file_plus_uri = g_strdup_printf("file://%s",desktop_plugin->priv->theme_string_parametr1);
334 g_object_set (G_OBJECT (bin), "uri", file_plus_uri, NULL );
336 /* Doesn't work in real device. Hardware volume buttons can to change volume for mutted track */
338 if (!desktop_plugin->priv->theme_bool_parametr1)
339 g_object_set (G_OBJECT (bin), "mute", TRUE, NULL );
341 g_object_set (G_OBJECT (videosink), "force-aspect-ratio", TRUE, NULL );
343 if (GST_IS_X_OVERLAY (videosink))
344 gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), GDK_DRAWABLE_XID(desktop_plugin->priv->window->window));
346 if (desktop_plugin->priv->visible){
347 g_timeout_add(50, (GSourceFunc)cb_timeout0, desktop_plugin);
348 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
351 //gst_element_get_state(deskddtop_plugin->priv->pipeline, NULL, NULL, 100 * GST_MSECOND);
354 /*******************************************************************************/
356 init_scene_Matrix(AWallpaperPlugin *desktop_plugin)
361 gint now = time(NULL);
364 if (desktop_plugin->priv->rich_animation){
372 /* fprintf(stderr, "init scene2 \n"); */
373 scene = g_new0(Scene, 1);
374 //scene.daytime = get_daytime();
375 scene->actors = NULL;
376 desktop_plugin->priv->scene = scene;
378 actor = init_object(desktop_plugin, "background", "bg.png",
380 TRUE, TRUE, 100, 255,
382 scene->actors = g_slist_append(scene->actors, actor);
384 actor = init_object(desktop_plugin, "symbols", "symbols.png",
386 TRUE, TRUE, 100, 255,
388 scene->actors = g_slist_append(scene->actors, actor);
390 child = g_ptr_array_sized_new(4);
391 actor = init_object(desktop_plugin, "layer1", "layer1_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, "layer1", "layer1_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, "layer2", "layer2_2.png",
411 TRUE, TRUE, 100, 255,
413 //actor->time_start_animation = now;
414 //actor->duration_animation = G_MAXINT;
415 scene->actors = g_slist_append(scene->actors, actor);
416 g_ptr_array_add(child, actor);
418 actor = init_object(desktop_plugin, "layer2", "layer2_1.png",
420 TRUE, TRUE, 100, 255,
422 //actor->time_start_animation = now;
423 //actor->duration_animation = G_MAXINT;
424 scene->actors = g_slist_append(scene->actors, actor);
425 g_ptr_array_add(child, actor);
427 actor = init_object(desktop_plugin, "layers", "",
429 FALSE, FALSE, 100, 255,
430 (gpointer)&change_layer, NULL, child);
431 actor->time_start_animation = now;
432 actor->duration_animation = G_MAXINT;
433 scene->actors = g_slist_append(scene->actors, actor);
435 run_long_timeout(desktop_plugin);
438 /*******************************************************************************/
439 /* Init Modern Scene */
441 init_scene_Modern(AWallpaperPlugin *desktop_plugin)
445 gint now = time(NULL);
450 /* fprintf(stderr, "init scene \n"); */
451 scene = g_new0(Scene, 1);
452 scene->daytime = get_daytime();
453 scene->actors = NULL;
454 scene->wind_orientation = -1;
455 scene->wind_angle = 0.3;
456 /* init value for random */
457 scene->seed = time(NULL);
458 scene->notification = TRUE;
459 desktop_plugin->priv->scene = scene;
460 actor = init_object(desktop_plugin, "sky", "sky0.png",
462 TRUE , TRUE, 100, 255,
463 (gpointer)&change_static_actor, NULL, NULL);
464 scene->actors = g_slist_append(scene->actors, actor);
465 change_static_actor(actor, desktop_plugin);
467 actor = init_object(desktop_plugin, "sun", "sun.png",
469 FALSE, FALSE, 100, 255,
470 (gpointer)&change_sun, NULL, NULL);
471 actor->time_start_animation = now;
472 actor->duration_animation = G_MAXINT;
473 change_sun(actor, desktop_plugin);
474 scene->actors = g_slist_append(scene->actors, actor);
476 //actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
477 // TRUE, 100, 255, NULL, NULL);
478 //scene.actors = g_slist_append(scene.actors, actor);
480 actor = init_object(desktop_plugin, "cloud1", "cloud1.png",
481 0, fast_rnd(300)-97, 7, 150, 97,
482 FALSE, FALSE, 100, 255,
483 (gpointer)&change_cloud, NULL, NULL);
484 actor->time_start_animation = now + fast_rnd(20);
485 actor->duration_animation = 3*60;
486 scene->actors = g_slist_append(scene->actors, actor);
488 actor = init_object(desktop_plugin, "cloud2", "cloud2.png",
489 0, fast_rnd(300)-75, 7, 188, 75,
490 FALSE, FALSE, 100, 255,
491 (gpointer)&change_cloud, NULL, NULL);
492 actor->time_start_animation = now + fast_rnd(40)+10;
493 actor->duration_animation = 3*60;
494 scene->actors = g_slist_append(scene->actors, actor);
496 actor = init_object(desktop_plugin, "cloud4", "cloud4.png",
497 0, fast_rnd(300)-75, 7, 150, 75,
498 FALSE, FALSE, 100, 255,
499 (gpointer)&change_cloud, NULL, NULL);
500 actor->time_start_animation = now + fast_rnd(60) + 20;
501 actor->duration_animation = 5*60;
502 scene->actors = g_slist_append(scene->actors, actor);
505 actor = init_object(desktop_plugin, "town", "town0.png",
507 TRUE, TRUE, 100, 255,
508 (gpointer)&change_static_actor, NULL, NULL);
509 change_static_actor(actor, desktop_plugin);
510 scene->actors = g_slist_append(scene->actors, actor);
512 actor = init_object(desktop_plugin, "stend", "stend0.png",
513 452, 166, 9, 300, 305,
514 TRUE, TRUE, 100, 255,
515 (gpointer)&change_static_actor, NULL, NULL);
516 change_static_actor(actor, desktop_plugin);
517 scene->actors = g_slist_append(scene->actors, actor);
520 child = g_ptr_array_sized_new(4);
521 actor = init_object(desktop_plugin, "call", "call.png",
523 FALSE, TRUE, 100, 255,
525 scene->actors = g_slist_append(scene->actors, actor);
526 g_ptr_array_add(child, actor);
528 actor = init_object(desktop_plugin, "chat", "chat.png",
530 FALSE, TRUE, 100, 255,
532 scene->actors = g_slist_append(scene->actors, actor);
533 g_ptr_array_add(child, actor);
535 actor = init_object(desktop_plugin, "mail", "mail.png",
537 FALSE, TRUE, 100, 255,
539 scene->actors = g_slist_append(scene->actors, actor);
540 g_ptr_array_add(child, actor);
542 actor = init_object(desktop_plugin, "sms", "sms.png",
544 FALSE, TRUE, 100, 255,
546 scene->actors = g_slist_append(scene->actors, actor);
547 g_ptr_array_add(child, actor);
549 actor = init_object(desktop_plugin, "billboard_text", "",
550 470, 174, 9, 300, 108,
551 FALSE, FALSE, 100, 255,
552 (gpointer)&change_billboard, NULL, child);
553 create_hildon_actor_text(actor, desktop_plugin);
554 //actor->time_start_animation = time(NULL) + 20;
555 change_billboard(actor, desktop_plugin);
556 scene->actors = g_slist_append(scene->actors, actor);
558 actor = init_object(desktop_plugin, "tram", "tram.png",
559 -300, 225, 10, 350, 210,
560 FALSE, FALSE, 100, 255,
561 (gpointer)&change_tram, NULL, NULL);
562 actor->time_start_animation = time(NULL) + fast_rnd(10);
563 actor->duration_animation = 60;
564 scene->actors = g_slist_append(scene->actors, actor);
566 actor = init_object(desktop_plugin, "border", "border0.png",
567 0, 480-79, 11, 800, 79,
568 TRUE, TRUE, 100, 255,
569 (gpointer)&change_static_actor_with_corner, NULL, NULL);
570 change_static_actor_with_corner(actor, desktop_plugin);
571 scene->actors = g_slist_append(scene->actors, actor);
573 actor = init_object(desktop_plugin, "moon", "moon1.png",
575 FALSE, FALSE, 100, 255,
576 (gpointer)&change_moon, NULL, NULL);
577 change_moon(actor, desktop_plugin);
578 scene->actors = g_slist_append(scene->actors, actor);
580 actor = init_object(desktop_plugin, "wind", "",
582 FALSE, FALSE, 100, 255,
583 (gpointer)&change_wind, NULL, NULL);
584 change_wind(actor, desktop_plugin);
585 scene->actors = g_slist_append(scene->actors, actor);
587 /* windows in 4-th house */
627 for (i=0; i<13; i++){
628 actor = init_object(desktop_plugin, "window1", "window1.png",
629 winds[i][0], winds[i][1], 8, 8, 10,
630 FALSE, FALSE, 100, 255,
631 (gpointer)&change_window1, NULL, NULL);
632 //change_window1(actor, desktop_plugin);
633 actor->time_start_animation = now + fast_rnd(30);
634 scene->actors = g_slist_append(scene->actors, actor);
638 /* windows in 1-th house */
664 actor = init_object(desktop_plugin, "window2", "window2.png",
665 winds[i][0], winds[i][1], 8, 8, 10,
666 FALSE, FALSE, 100, 255,
667 (gpointer)&change_window1, NULL, NULL);
668 //change_window1(actor, desktop_plugin);
669 actor->time_start_animation = now + fast_rnd(30);
670 scene->actors = g_slist_append(scene->actors, actor);
674 /* windows in 3-th house */
706 for (i=0; i<10; i++){
707 actor = init_object(desktop_plugin, "window3", "window3.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);
717 /* windows in 5-th house */
741 actor = init_object(desktop_plugin, "window4", "window4.png",
742 winds[i][0], winds[i][1], 8, 8, 10,
743 FALSE, FALSE, 100, 255,
744 (gpointer)&change_window1, NULL, NULL);
745 //change_window1(actor, desktop_plugin);
746 actor->time_start_animation = now + fast_rnd(30);
747 scene->actors = g_slist_append(scene->actors, actor);
751 /* windows in 6-th house */
772 actor = init_object(desktop_plugin, "window5", "window5.png",
773 winds[i][0], winds[i][1], 8, 8, 10,
774 FALSE, FALSE, 100, 255,
775 (gpointer)&change_window1, NULL, NULL);
776 //change_window1(actor, desktop_plugin);
777 actor->time_start_animation = now + fast_rnd(30);
778 scene->actors = g_slist_append(scene->actors, actor);
781 run_long_timeout(desktop_plugin);
784 anim = g_new0(Animation, 1);
787 anim->func_change = &change_tram;
788 anim->func_time = NULL;
789 anim->timestart = time(NULL);
792 scene.dynamic_actors = g_slist_append(scene.dynamic_actors, anim);
795 /*******************************************************************************/
796 /* Init Berlin Scene */
798 init_scene_Berlin(AWallpaperPlugin *desktop_plugin)
800 Actor *actor, *actor1, *actor2;
802 gint now = time(NULL);
805 GPtrArray *child = NULL;
807 scene = g_new0(Scene, 1);
808 scene->daytime = get_daytime();
809 scene->actors = NULL;
810 scene->wind_orientation = -1;
811 scene->wind_angle = 0.3;
812 /* init value for random */
813 scene->seed = time(NULL);
814 desktop_plugin->priv->scene = scene;
816 actor = init_object(desktop_plugin, "sky", "sky.png", 0, 0, 5, 800, 480,
817 TRUE, TRUE, 100, 255,
818 (gpointer)&change_static_actor, NULL, NULL);
819 change_static_actor(actor, desktop_plugin);
820 scene->actors = g_slist_append(scene->actors, actor);
823 actor = init_object(desktop_plugin, "sun", "sun.png", 0, 0, 6, 88, 88,
824 FALSE, FALSE, 100, 255,
825 (gpointer)&change_sun, NULL, NULL);
826 actor->time_start_animation = time(NULL);
827 actor->duration_animation = G_MAXINT;
828 change_sun(actor, desktop_plugin);
829 scene->actors = g_slist_append(scene->actors, actor);
832 actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 11, 50, 50,
833 TRUE, 100, 255, NULL, NULL);
834 scene.actors = g_slist_append(scene.actors, actor);
837 actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 15, 6, 60, 60,
838 FALSE, FALSE, 100, 255,
839 (gpointer)&change_moon, NULL, NULL);
840 change_moon(actor, desktop_plugin);
841 scene->actors = g_slist_append(scene->actors, actor);
843 actor = init_object(desktop_plugin, "cloud1", "cloud1.png", 0, fast_rnd(300)-97, 7, 150, 97,
844 FALSE, FALSE, 100, 255,
845 (gpointer)&change_cloud, NULL, NULL);
846 actor->time_start_animation = now + fast_rnd(30) + 10;
847 actor->duration_animation = 3*60;
848 scene->actors = g_slist_append(scene->actors, actor);
850 actor = init_object(desktop_plugin, "cloud2", "cloud2.png", 0, fast_rnd(300)-75, 7, 188, 75,
851 FALSE, FALSE, 100, 255,
852 (gpointer)&change_cloud, NULL, NULL);
853 actor->time_start_animation = now + fast_rnd(10);
854 actor->duration_animation = 3*60;
855 scene->actors = g_slist_append(scene->actors, actor);
857 actor = init_object(desktop_plugin, "cloud4", "cloud4.png", 0, fast_rnd(300)-75, 7, 150, 75,
858 FALSE, FALSE, 100, 255,
859 (gpointer)&change_cloud, NULL, NULL);
860 actor->time_start_animation = now + fast_rnd(60) + 20;
861 actor->duration_animation = 5*60;
862 scene->actors = g_slist_append(scene->actors, actor);
865 actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 8, 160, 50,
866 FALSE, FALSE, 100, 255,
867 (gpointer)&change_plane2, NULL, NULL);
868 actor->time_start_animation = now + fast_rnd(40) + 20;
869 actor->duration_animation = 60;
870 scene->actors = g_slist_append(scene->actors, actor);
872 actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 9, 300, 116,
873 FALSE, FALSE, 100, 255,
874 (gpointer)&change_plane1, NULL, NULL);
875 actor->time_start_animation = now + fast_rnd(20);
876 actor->duration_animation = 30;
877 scene->actors = g_slist_append(scene->actors, actor);
879 actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480,
880 TRUE, TRUE, 100, 255,
881 (gpointer)&change_static_actor_with_corner, NULL, NULL);
882 change_static_actor_with_corner(actor, desktop_plugin);
883 scene->actors = g_slist_append(scene->actors, actor);
885 actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0,
886 FALSE, FALSE, 100, 255,
887 (gpointer)&change_wind, NULL, NULL);
888 change_wind(actor, desktop_plugin);
889 scene->actors = g_slist_append(scene->actors, actor);
891 actor1 = init_object(desktop_plugin, "signal_red", "red.png",
892 486, 425, 10, 18, 38,
893 FALSE, TRUE, 100, 255, NULL, NULL, NULL);
894 //actor->time_start_animation = now + fast_rnd(30) + 10;
895 scene->actors = g_slist_append(scene->actors, actor1);
897 actor2 = init_object(desktop_plugin, "signal_green", "green.png",
898 486, 425, 10, 18, 38,
899 TRUE, TRUE, 100, 255, NULL, NULL, NULL);
900 //actor->time_start_animation = now + fast_rnd(30) + 10;
901 scene->actors = g_slist_append(scene->actors, actor2);
902 child = g_ptr_array_sized_new(2);
903 g_ptr_array_add(child, actor1);
904 g_ptr_array_add(child, actor2);
905 actor = init_object(desktop_plugin, "signal", "",
906 486, 425, 10, 18, 38,
907 FALSE, FALSE, 100, 255,
908 (gpointer)&change_signal, NULL, child);
909 actor->time_start_animation = now + fast_rnd(30) + 10;
910 scene->actors = g_slist_append(scene->actors, actor);
951 for (i=0; i<13; i++){
952 actor = init_object(desktop_plugin, "window", "window.png",
953 winds[i][0], winds[i][1], 10, 8, 9,
954 FALSE, TRUE, 100, 255,
955 (gpointer)&change_window1, NULL, NULL);
956 //change_window1(actor, desktop_plugin);
957 actor->time_start_animation = now + fast_rnd(30);
958 scene->actors = g_slist_append(scene->actors, actor);
962 run_long_timeout(desktop_plugin);
965 /*******************************************************************************/
967 init_scene_theme(AWallpaperPlugin *desktop_plugin)
970 void (*func)(gpointer);
971 func = g_hash_table_lookup(desktop_plugin->priv->hash_scene_func, desktop_plugin->priv->theme);
973 (*func)(desktop_plugin);
976 fprintf(stderr, "Init_scene_theme\n");
977 void (*func)(gpointer);
978 func = desktop_plugin->priv->scene_func;
980 fprintf(stderr, "Success init_scene_theme\n");
981 (*func)(desktop_plugin);