Preparing for global right corner
authorVlad Vasiliev <vlad@toshiba2.oblgaz>
Tue, 13 Apr 2010 16:13:32 +0000 (19:13 +0300)
committerVlad Vasiliev <vlad@toshiba2.oblgaz>
Tue, 13 Apr 2010 16:13:32 +0000 (19:13 +0300)
applet/src/livewp-common.h
applet/src/livewp-home-widget.c

index fbdf532..474cd25 100644 (file)
@@ -52,6 +52,8 @@ struct _Animation_WallpaperPrivate
     gchar *theme;
     gboolean visible;
     gboolean rich_animation;
+    GtkWidget *main_widget;
+    GtkWidget *right_corner;
     AWallpaperPlugin *desktop_plugin;
 };
 
index 3ca54e6..cf66df4 100644 (file)
@@ -1119,11 +1119,9 @@ rich_animation_press(GtkWidget *widget, GdkEvent *event,
 static void
 animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
 {
-    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);
@@ -1132,14 +1130,15 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
     /* Load config */
     read_config(priv);
     priv->desktop_plugin = desktop_plugin;
-    widget = gtk_fixed_new();
+    desktop_plugin->priv->main_widget = gtk_fixed_new();
 
-    gtk_widget_set_size_request(widget, 100, 32);
+    gtk_widget_set_size_request(desktop_plugin->priv->main_widget, 100, 32);
+    desktop_plugin->priv->right_corner = NULL;
     snprintf(buffer, sizeof(buffer) - 1, "%s/%s/%s", THEME_PATH, desktop_plugin->priv->theme, "town0_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);
+    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);
     }
     /* Create rich animation event */
     rich_animation = gtk_event_box_new();
@@ -1149,7 +1148,7 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
         gtk_widget_set_size_request(rich_animation, 100, 32);
         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);
+        gtk_fixed_put(GTK_FIXED(desktop_plugin->priv->main_widget), rich_animation, 0, 0);
     }
 /*
     GtkWidget *label = gtk_label_new ("ddddddddddddd"); 
@@ -1161,8 +1160,8 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
     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_widget_show (widget);
-    gtk_container_add (GTK_CONTAINER (desktop_plugin), widget);
+    gtk_widget_show (desktop_plugin->priv->main_widget);
+    gtk_container_add (GTK_CONTAINER (desktop_plugin), desktop_plugin->priv->main_widget);
     init_applet_position();