added event box for play/stop rich animation
authorVlad Vasiliev <vlad@toshiba2.oblgaz>
Mon, 12 Apr 2010 06:41:23 +0000 (09:41 +0300)
committerVlad Vasiliev <vlad@toshiba2.oblgaz>
Mon, 12 Apr 2010 06:41:23 +0000 (09:41 +0300)
applet/src/livewp-home-widget.c

index 9b549bc..84abca7 100644 (file)
@@ -963,27 +963,44 @@ desktop_plugin_visible_notify (GObject    *object,
    /*   fprintf (stderr, "is-on-current-desktop changed. visible: %u", visible); */
 }
 
+gboolean
+rich_animation_press(GtkWidget *widget, GdkEvent *event,
+                                            gpointer user_data){
+    fprintf(stderr,"gggggggggggggggggggg\n");
+}    
 static void
 animation_wallpaper_plugin_init (AWallpaperPlugin *desktop_plugin)
 {
     GtkWidget *label;
-
+    GtkWidget *rich_animation;
     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;
+    /* 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_show (rich_animation);
+        g_signal_connect(rich_animation, "button-press-event", G_CALLBACK(rich_animation_press), desktop_plugin);
+    }
+/*
     label = gtk_label_new (""); 
     gtk_widget_set_size_request(label, 95, 30);
     gtk_widget_show (label);
+    gtk_container_add (GTK_CONTAINER (desktop_plugin), label);
+*/
     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);
     g_signal_connect (desktop_plugin, "notify::is-on-current-desktop",
                      G_CALLBACK (desktop_plugin_visible_notify), desktop_plugin);
 
-    gtk_container_add (GTK_CONTAINER (desktop_plugin), label);
+    gtk_container_add (GTK_CONTAINER (desktop_plugin), rich_animation);
     init_applet_position();
     fprintf(stderr, "!!!theme = %s\n", priv->theme);
     if (!strcmp(priv->theme,"Modern"))