[glide] Start registering animations



commit 911766fabe9e653fd1511e165f243d67c233571e
Author: Robert Carr <racarr Valentine localdomain>
Date:   Tue Apr 27 01:31:16 2010 -0400

    Start registering animations

 src/glide-animation-manager.c |    2 +-
 src/glide-animation-manager.h |    4 +++-
 src/glide-window.c            |   31 ++++++++++++++++---------------
 src/main.c                    |    4 ++++
 4 files changed, 24 insertions(+), 17 deletions(-)
---
diff --git a/src/glide-animation-manager.c b/src/glide-animation-manager.c
index dd0e819..852ffa5 100644
--- a/src/glide-animation-manager.c
+++ b/src/glide-animation-manager.c
@@ -37,7 +37,7 @@ glide_animation_manager_register_animation (GlideAnimationCallback callback, con
 }
 
 const GList *
-glide_animation_manager_list_animations ()
+glide_animation_manager_get_animations ()
 {
   return animations;
 }
diff --git a/src/glide-animation-manager.h b/src/glide-animation-manager.h
index cfc95f4..14551bb 100644
--- a/src/glide-animation-manager.h
+++ b/src/glide-animation-manager.h
@@ -43,11 +43,13 @@ struct _GlideAnimationInfo {
 };
 
 void glide_animation_manager_register_animation (GlideAnimationCallback callback, const gchar *name);
-const GList *glide_animation_manager_list_animations ();
+const GList *glide_animation_manager_get_animations ();
 const GlideAnimation *glide_animation_manager_get_animation (const gchar *animation);
 
 ClutterTimeline * glide_animation_manager_do_animation (GlideAnimationInfo *info, ClutterActor *a, ClutterActor *b);
 
+void glide_animation_manager_register_animations();
+
 #define GLIDE_TYPE_ANIMATION_INFO (glide_animation_info_get_type())
 
 GType glide_animation_info_get_type (void) G_GNUC_CONST;
diff --git a/src/glide-window.c b/src/glide-window.c
index 5112c03..f08e672 100644
--- a/src/glide-window.c
+++ b/src/glide-window.c
@@ -41,6 +41,8 @@
 #include "glide-pdf-exporter.h"
 //#include "glide-png-exporter.h"
 
+#include "glide-animation-manager.h"
+
 #define GLIDE_WINDOW_UI_OBJECT(w, obj) (gtk_builder_get_object (w->priv->builder, obj))
 
 
@@ -1272,23 +1274,22 @@ glide_window_setup_combobox (GlideWindow *w)
   GtkListStore *store = gtk_list_store_new (1, G_TYPE_STRING);
   GtkCellRenderer *renderer;
   GtkTreeIter iter;
-  
+  const GList *animations, *a;
+
+
   gtk_list_store_append (store, &iter);
   gtk_list_store_set (store, &iter, 0, "None", -1);
-  gtk_list_store_append (store, &iter);
-  gtk_list_store_set (store, &iter, 0, "Fade", -1);
-  gtk_list_store_append (store, &iter);
-  gtk_list_store_set (store, &iter, 0, "Zoom", -1);
-  gtk_list_store_append (store, &iter);
-  gtk_list_store_set (store, &iter, 0, "Drop", -1);
-  gtk_list_store_append (store, &iter);
-  gtk_list_store_set (store, &iter, 0, "Pivot", -1);
-  gtk_list_store_append (store, &iter);
-  gtk_list_store_set (store, &iter, 0, "Slide", -1);
-  gtk_list_store_append (store, &iter);
-  gtk_list_store_set (store, &iter, 0, "Zoom Contents", -1);
-  gtk_list_store_append (store, &iter);
-  gtk_list_store_set (store, &iter, 0, "Doorway", -1);
+  
+  animations = glide_animation_manager_get_animations ();
+  for (a = animations; a; a = a->next)
+    {
+      GlideAnimation *animation = (GlideAnimation *)a->data;
+      gtk_list_store_append (store, &iter);
+      gtk_list_store_set (store, &iter, 0, animation->name,
+			  -1);
+    }
+  
+
   
   gtk_combo_box_set_model (c, GTK_TREE_MODEL (store));
   g_object_unref (store);
diff --git a/src/main.c b/src/main.c
index c9795f9..8899dd3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -32,6 +32,7 @@
 #include <glib/gi18n.h>
 
 #include "glide-window.h"
+#include "glide-animation-manager.h"
 #include "glide-debug.h"
 
 guint glide_debug_flags = 0;
@@ -136,6 +137,9 @@ main (int argc, char *argv[])
 	}
   
   GLIDE_NOTE (MISC, "Starting Glide");
+
+  glide_animation_manager_register_animations ();
+
   window = glide_window_new ();
   if (argc >= 2)
     glide_window_open_document (GLIDE_WINDOW (window), argv[1]);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]