added id view in priv
authortanya <tanyshk@gmail.com>
Thu, 15 Jul 2010 13:22:27 +0000 (16:22 +0300)
committertanya <tanyshk@gmail.com>
Thu, 15 Jul 2010 13:22:27 +0000 (16:22 +0300)
applet/src/livewp-common.h
applet/src/livewp-home-widget.c
applet/src/livewp-home-widget.h

index 8465d24..0b0acf6 100644 (file)
@@ -87,6 +87,7 @@ struct _Animation_WallpaperPrivate
     Scene *scene;
     GHashTable * hash_scene_func;
     GKeyFile *config_file;
+    gint view;
 };
 
 struct _AWallpaperPlugin
index 1d41de4..5050041 100644 (file)
@@ -41,15 +41,24 @@ HD_DEFINE_PLUGIN_MODULE (AWallpaperPlugin, animation_wallpaper_plugin, HD_TYPE_H
 static void
 lw_applet_realize (GtkWidget *widget)
 {
-      GdkScreen *screen;
+    GdkScreen *screen;
+    AWallpaperPlugin *desktop_plugin = widget;
 
-  fprintf(stderr,"ddddddddddddd %s\n", hd_plugin_item_get_plugin_id (HD_PLUGIN_ITEM (widget)));
-      screen = gtk_widget_get_screen (widget);
-      gtk_widget_set_colormap (widget,
+    fprintf(stderr,"ddddddddddddd %s\n", hd_plugin_item_get_plugin_id (HD_PLUGIN_ITEM (widget)));
+    gchar * strid = g_strdup(hd_plugin_item_get_plugin_id (HD_PLUGIN_ITEM (widget)));
+    gint id = strid[strlen(strid)-1] - '0';
+    desktop_plugin->priv->view = id + 1;
+    
+    init_scene_theme(desktop_plugin);
+        
+    desktop_plugin->priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
+
+    screen = gtk_widget_get_screen (widget);
+    gtk_widget_set_colormap (widget,
                                 gdk_screen_get_rgba_colormap (screen));
-      gtk_widget_set_app_paintable (widget,
+    gtk_widget_set_app_paintable (widget,
                                 TRUE);
-      GTK_WIDGET_CLASS (animation_wallpaper_plugin_parent_class)->realize (widget);
+    GTK_WIDGET_CLASS (animation_wallpaper_plugin_parent_class)->realize (widget);
 }
 
 
@@ -502,9 +511,9 @@ animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
     else if (!strcmp(priv->theme, "Matrix"))
         init_scene_Matrix(desktop_plugin);
 #endif
-    init_scene_theme(desktop_plugin);
+//    init_scene_theme(desktop_plugin);
         
-    priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
+//    priv->long_timer = g_timeout_add(LONG_TIMER, (GtkFunction)long_timeout, desktop_plugin);
     /* TODO Move scene to priv */
     //scene.timer_type = LONG_TIMER_TYPE;
     g_signal_connect (desktop_plugin, "notify::is-on-current-desktop",
index 49b5215..cbcbc9f 100644 (file)
@@ -76,4 +76,5 @@ void get_sun_screen_pos(double alt, double azm, gint * x, gint * y);
 void show_settings(GtkWidget *widget, Animation_WallpaperPrivate *priv);
 void livewp_initialize_dbus(Animation_WallpaperPrivate *priv);
 void livewp_deinitialize_dbus(Animation_WallpaperPrivate *priv);
+static gboolean long_timeout (AWallpaperPlugin *desktop_plugin);
 #endif