Merge branch 'master' of https://vcs.maemo.org/git/livewp
authorTanya <tanya@bookdmitri.oblgaz>
Sun, 11 Apr 2010 16:37:15 +0000 (19:37 +0300)
committerTanya <tanya@bookdmitri.oblgaz>
Sun, 11 Apr 2010 16:37:15 +0000 (19:37 +0300)
applet/data/theme/Berlin/plane3.png [new file with mode: 0644]
applet/src/livewp-common.h
applet/src/livewp-home-widget.c

diff --git a/applet/data/theme/Berlin/plane3.png b/applet/data/theme/Berlin/plane3.png
new file mode 100644 (file)
index 0000000..79f9ee7
Binary files /dev/null and b/applet/data/theme/Berlin/plane3.png differ
index b3b788e..2bb0b27 100644 (file)
@@ -31,7 +31,7 @@
 #include <glib/gi18n-lib.h>
 
 #define THEME_PATH "/usr/share/livewp/theme"
-#define SHORT_TIMER 100 /* 100 milisecond */
+#define SHORT_TIMER 50 /* 100 milisecond */
 //#define LONG_TIMER 10*60*1000 /* 10 minutes */
 #define LONG_TIMER  10*1000 /* 10 minutes */
 enum { SHORT_TIMER_TYPE, LONG_TIMER_TYPE };
index 5918eba..e25acb1 100644 (file)
@@ -326,7 +326,7 @@ change_tram(Actor * actor, AWallpaperPlugin *desktop_plugin)
 }
 
 void
-change_plane(Actor *actor, AWallpaperPlugin *desktop_plugin)
+change_plane1(Actor *actor, AWallpaperPlugin *desktop_plugin)
 {
     gint x0 = 620, y0 = 233, scale0 = 100,
          x1 = 79, y1 = -146, scale1 = 100, 
@@ -368,6 +368,48 @@ change_plane(Actor *actor, AWallpaperPlugin *desktop_plugin)
 }
 
 void
+change_plane2(Actor *actor, AWallpaperPlugin *desktop_plugin)
+{
+    gint x0 = -actor->width, y0 = 45, scale0 = 100,
+         x1 = 800, y1 = 20, scale1 = 100, 
+         x, y, scale;
+    struct timeval tvb;     
+    suseconds_t ms;
+    long sec;
+    double t;
+    gint daytime = get_daytime();
+
+    gettimeofday(&tvb, NULL);
+    
+    ms = tvb.tv_usec;
+    sec = tvb.tv_sec;
+//    fprintf(stderr, "1 %f - %d\n", sec+(double)ms/100000, now);
+   
+    if (!actor->visible){
+        actor->visible = TRUE;
+        if (daytime == TIME_NIGHT)
+            actor->filename = g_strdup("plane3.png");
+        else
+            actor->filename = g_strdup("plane3.png");
+        create_hildon_actor(actor, desktop_plugin);
+    }
+    t = (double)((double)sec+(double)ms/1000000 - actor->time_start_animation) / actor->duration_animation;
+    x = path_line(x0, x1, t);
+    y = path_line(y0, y1, t);
+    //scale = path_line(scale0, scale1, t);
+    //fprintf(stderr, "change tram t=%f x=%d y=%d scale=%d\n", t, x, y, scale);
+    actor_set_position_full(actor->widget, x, y, actor->z);
+    //hildon_animation_actor_set_scale(HILDON_ANIMATION_ACTOR(actor->widget), (double)scale/100, (double)scale/100);
+    if (t >= 1){
+        /* stop animation */
+        actor->visible = FALSE;
+        destroy_hildon_actor(actor);
+        actor->time_start_animation = sec + 5*60;
+    }
+
+}
+
+void
 create_hildon_actor(Actor *actor, AWallpaperPlugin *desktop_plugin) 
 {
   GtkWidget *ha = NULL;
@@ -590,13 +632,13 @@ init_scene1(AWallpaperPlugin *desktop_plugin)
   change_sun(actor, desktop_plugin);
   scene.actors = g_slist_append(scene.actors, actor);
 
-#if 0
-  actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 9, 50, 50, 
+
+  actor = init_object(desktop_plugin, "dot", "dot1.png", 0, 0, 10, 50, 50, 
                       TRUE, 100, 255, NULL, NULL);
   scene.actors = g_slist_append(scene.actors, actor);
-#endif
 
-  actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 8, 800, 480, 
+
+  actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 9, 800, 480, 
                       TRUE, 100, 255, (gpointer)&change_static_actor, NULL);
   change_static_actor(actor, desktop_plugin);
   scene.actors = g_slist_append(scene.actors, actor);
@@ -606,11 +648,17 @@ init_scene1(AWallpaperPlugin *desktop_plugin)
   change_moon(actor, desktop_plugin);
   scene.actors = g_slist_append(scene.actors, actor);
   
-  actor = init_object(desktop_plugin, "plane1", "tu154.png", 620, 233, 7, 379, 146, 
-                      FALSE, 100, 255, (gpointer)&change_plane, NULL);
-  actor->time_start_animation = time(NULL) + 10;
+  actor = init_object(desktop_plugin, "plane2", "plane3.png", 0, 45, 7, 160, 50, 
+                      FALSE, 100, 255, (gpointer)&change_plane2, NULL);
+  actor->time_start_animation = time(NULL) + 5;
   actor->duration_animation = 60;
   scene.actors = g_slist_append(scene.actors, actor);
+  
+  actor = init_object(desktop_plugin, "plane1", "tu154_small.png", 620, 233, 8, 300, 116, 
+                      FALSE, 100, 255, (gpointer)&change_plane1, NULL);
+  actor->time_start_animation = time(NULL) + 60;
+  actor->duration_animation = 30;
+  scene.actors = g_slist_append(scene.actors, actor);
 
 }
 
@@ -825,7 +873,7 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
     /* TODO Move scene to priv */
     scene.timer_type = LONG_TIMER_TYPE;
 
-    sleep(2);
+    //sleep(2);
 }
 
 static void