Merge branch 'master' of https://vcs.maemo.org/git/livewp
authorVlad Vasiliev <vlad@toshiba2.oblgaz>
Tue, 13 Apr 2010 17:05:03 +0000 (20:05 +0300)
committerVlad Vasiliev <vlad@toshiba2.oblgaz>
Tue, 13 Apr 2010 17:05:03 +0000 (20:05 +0300)
applet/src/livewp-home-widget.c

index f08a4d2..aa3dbc8 100644 (file)
@@ -649,6 +649,24 @@ change_static_actor(Actor * actor, AWallpaperPlugin *desktop_plugin)
     change_hildon_actor(actor, desktop_plugin);
 }
 
+void 
+change_static_actor_with_corner(Actor * actor, AWallpaperPlugin *desktop_plugin)
+{
+    gchar *newfile;
+    gchar           buffer[2048];
+
+    if (desktop_plugin->priv->right_corner)
+        gtk_widget_destroy(desktop_plugin->priv->right_corner);
+    snprintf(buffer, sizeof(buffer) - 1, "%s/%s/town%i_right_corner.png", \
+                                  THEME_PATH, desktop_plugin->priv->theme, scene.daytime);
+    desktop_plugin->priv->right_corner = gtk_image_new_from_file (buffer);
+    if (desktop_plugin->priv->right_corner){
+        gtk_fixed_put(GTK_FIXED(desktop_plugin->priv->main_widget), desktop_plugin->priv->right_corner, 0, 0);
+        gtk_widget_show (desktop_plugin->priv->right_corner);
+    }
+    change_static_actor(actor, desktop_plugin);
+
+}
 
 
 /*
@@ -756,8 +774,8 @@ init_scene(AWallpaperPlugin *desktop_plugin)
   scene.actors = g_slist_append(scene.actors, actor);
 
   actor = init_object(desktop_plugin, "border", "border0.png", 0, 480-79, 10, 800, 79,
-                      TRUE, 100, 255, (gpointer)&change_static_actor, NULL);
-  change_static_actor(actor, desktop_plugin);
+                      TRUE, 100, 255, (gpointer)&change_static_actor_with_corner, NULL);
+  change_static_actor_with_corner(actor, desktop_plugin);
   scene.actors = g_slist_append(scene.actors, actor);
   
   actor = init_object(desktop_plugin, "moon", "moon1.png", 400, 20, 6, 60, 60, 
@@ -1046,8 +1064,8 @@ init_scene1(AWallpaperPlugin *desktop_plugin)
   scene.actors = g_slist_append(scene.actors, actor);
 
   actor = init_object(desktop_plugin, "town", "town.png", 0, 0, 10, 800, 480, 
-                      TRUE, 100, 255, (gpointer)&change_static_actor, NULL);
-  change_static_actor(actor, desktop_plugin);
+                      TRUE, 100, 255, (gpointer)&change_static_actor_with_corner, NULL);
+  change_static_actor_with_corner(actor, desktop_plugin);
   scene.actors = g_slist_append(scene.actors, actor);
 
   actor = init_object(desktop_plugin, "wind", "", 0, 0, 5, 0, 0, 
@@ -1188,7 +1206,7 @@ long_timeout (AWallpaperPlugin *desktop_plugin)
     time_t now;
     Actor *actor;
 
-    fprintf(stderr, "long_timeout %i\n", desktop_plugin->priv->long_timer);
+    /* fprintf(stderr, "long_timeout %i\n", desktop_plugin->priv->long_timer); */
     if (desktop_plugin->priv->long_timer == 0 )
         return FALSE;
     if (!desktop_plugin->priv->visible){
@@ -1196,6 +1214,7 @@ long_timeout (AWallpaperPlugin *desktop_plugin)
             g_source_remove(desktop_plugin->priv->short_timer);
             desktop_plugin->priv->short_timer = 0;
         }
+        desktop_plugin->priv->long_timer = 0;
         return FALSE;
     }
     //fprintf(stderr, "timer daytime=%d\n", daytime);