Merge branch 'master' of https://vcs.maemo.org/git/livewp
[livewp] / applet / src / livewp-home-widget.c
index 951a003..ec5c03c 100644 (file)
@@ -1046,6 +1046,9 @@ long_timeout (AWallpaperPlugin *desktop_plugin)
     time_t now;
     Actor *actor;
 
+    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){
         if(desktop_plugin->priv->short_timer != 0){
             g_source_remove(desktop_plugin->priv->short_timer);
@@ -1094,6 +1097,7 @@ desktop_plugin_visible_notify (GObject    *object,
 {
     gboolean visible;
     g_object_get (object, "is-on-current-desktop", &visible, NULL);
+    /* fprintf (stderr, "is-on-current-desktop changed. visible: %u", visible); */
     if (visible){
         desktop_plugin->priv->visible = TRUE;
         if (desktop_plugin->priv->long_timer == 0 )
@@ -1105,7 +1109,6 @@ desktop_plugin_visible_notify (GObject    *object,
             desktop_plugin->priv->long_timer = 0;
         }
     }
-   /*   fprintf (stderr, "is-on-current-desktop changed. visible: %u", visible); */
 }
 
 gboolean
@@ -1116,33 +1119,50 @@ rich_animation_press(GtkWidget *widget, GdkEvent *event,
 static void
 animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
 {
-    GtkWidget *label;
+    GtkWidget *widget;
     GtkWidget *rich_animation;
+    gchar           buffer[2048];
+
+    GtkWidget  *background_town = NULL;
+
     fprintf(stderr, "!!!!!!!plugin init \n");
     Animation_WallpaperPrivate *priv =  Animation_Wallpaper_HOME_PLUGIN_GET_PRIVATE (desktop_plugin);
     desktop_plugin->priv =  Animation_Wallpaper_HOME_PLUGIN_GET_PRIVATE (desktop_plugin);
+
     /* Load config */
     read_config(priv);
     priv->desktop_plugin = desktop_plugin;
+    widget = gtk_fixed_new();
+
+    gtk_widget_set_size_request(widget, 95, 50);
+    snprintf(buffer, sizeof(buffer) - 1, "%s/%s/%s", THEME_PATH, desktop_plugin->priv->theme, "town_right_corner.png");
+    background_town = gtk_image_new_from_file (buffer);
+    if (background_town){
+        gtk_fixed_put(GTK_FIXED(widget), background_town, 0, 0);
+        gtk_widget_show (background_town);
+    }
     /* Create rich animation event */
     rich_animation = gtk_event_box_new();
     if(rich_animation){
         gtk_widget_set_events(rich_animation, GDK_BUTTON_PRESS_MASK);
         gtk_event_box_set_visible_window(GTK_EVENT_BOX(rich_animation), FALSE);
-        gtk_widget_set_size_request(rich_animation, 95, 30);
+        gtk_widget_set_size_request(rich_animation, 95, 50);
         gtk_widget_show (rich_animation);
         g_signal_connect(rich_animation, "button-press-event", G_CALLBACK(rich_animation_press), desktop_plugin);
+        gtk_fixed_put(GTK_FIXED(widget), rich_animation, 0, 0);
     }
 /*
-    label = gtk_label_new (""); 
+    GtkWidget *label = gtk_label_new ("ddddddddddddd"); 
     gtk_widget_set_size_request(label, 95, 30);
     gtk_widget_show (label);
-    gtk_container_add (GTK_CONTAINER (desktop_plugin), label);
+//    gtk_container_add (GTK_CONTAINER (desktop_plugin), label);
+    gtk_fixed_put(GTK_FIXED(widget), label, 0, 0);
 */
     hd_home_plugin_item_set_settings (HD_HOME_PLUGIN_ITEM (desktop_plugin), TRUE);
     g_signal_connect (desktop_plugin, "show-settings",
                             G_CALLBACK (lw_settings), priv);
-    gtk_container_add (GTK_CONTAINER (desktop_plugin), rich_animation);
+    gtk_widget_show (widget);
+    gtk_container_add (GTK_CONTAINER (desktop_plugin), widget);
     init_applet_position();
 
     
@@ -1167,7 +1187,8 @@ lw_applet_finalize (GObject *object)
 {
      AWallpaperPlugin *desktop_plugin = Animation_Wallpaper_HOME_PLUGIN (object);
      Animation_WallpaperPrivate *priv = desktop_plugin->priv;
-
+     
+     fprintf(stderr,"finalaze %i\n", priv->long_timer);
      if (priv->long_timer){
         g_source_remove(priv->long_timer);
         priv->long_timer = 0;