[glide] Add stage-manager property to slide box



commit 4d818e3d95ed8bf39db56e6aa37074907ab1f3ee
Author: Robert Carr <racarr Valentine localdomain>
Date:   Thu Apr 29 02:28:53 2010 -0400

    Add stage-manager property to slide box

 src/glide-slide-box-priv.h |    2 +-
 src/glide-slide-box.c      |   72 ++++++++++++++++++++++++++++++++++++++++++-
 src/glide-slide-box.h      |    4 ++
 3 files changed, 75 insertions(+), 3 deletions(-)
---
diff --git a/src/glide-slide-box-priv.h b/src/glide-slide-box-priv.h
index 05d1219..8c6e04b 100644
--- a/src/glide-slide-box-priv.h
+++ b/src/glide-slide-box-priv.h
@@ -26,7 +26,7 @@ G_BEGIN_DECLS
 
 struct _GlideSlideBoxPrivate
 {
-  gpointer fill;
+  GlideStageManager *manager;
 };
 
 G_END_DECLS
diff --git a/src/glide-slide-box.c b/src/glide-slide-box.c
index 9319cfa..87edb37 100644
--- a/src/glide-slide-box.c
+++ b/src/glide-slide-box.c
@@ -23,6 +23,11 @@
 
 G_DEFINE_TYPE(GlideSlideBox, glide_slide_box, GTK_TYPE_VBOX);
 
+enum {
+  PROP_0,
+  PROP_STAGE_MANAGER
+};
+
 static void
 glide_slide_box_finalize (GObject *object)
 {
@@ -30,10 +35,46 @@ glide_slide_box_finalize (GObject *object)
 }
 
 static void
-glide_slide_box_init (GlideSlideBox *box)
+glide_slide_box_get_property (GObject *object,
+			      guint prop_id,
+			      GValue *value,
+			      GParamSpec *pspec)
 {
-  GdkColor white;
+  GlideSlideBox *box = GLIDE_SLIDE_BOX (object);
+  
+  switch (prop_id)
+    {
+    case PROP_STAGE_MANAGER:
+      g_value_set_object (value, box->priv->manager);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
 
+static void
+glide_slide_box_set_property (GObject *object,
+			      guint prop_id,
+			      const GValue *value,
+			      GParamSpec *pspec)
+{
+  GlideSlideBox *box = GLIDE_SLIDE_BOX (object);
+  
+  switch (prop_id)
+    {
+    case PROP_STAGE_MANAGER:
+      glide_slide_box_set_stage_manager (box, g_value_get_object (value));
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+glide_slide_box_init (GlideSlideBox *box)
+{
   box->priv = GLIDE_SLIDE_BOX_GET_PRIVATE (box);
 }
 
@@ -43,6 +84,17 @@ glide_slide_box_class_init (GlideSlideBoxClass *klass)
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
   object_class->finalize = glide_slide_box_finalize;
+  object_class->get_property = glide_slide_box_get_property;
+  object_class->set_property = glide_slide_box_set_property;
+  
+  g_object_class_install_property (object_class,
+				   PROP_STAGE_MANAGER,
+				   g_param_spec_object ("stage-manager",
+							"Stage manager",
+							"The stage manager containing slides the box should render.",
+							GLIDE_TYPE_STAGE_MANAGER,
+							G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
   g_type_class_add_private (object_class, sizeof(GlideSlideBoxPrivate));
 }
 
@@ -51,3 +103,19 @@ glide_slide_box_new ()
 {
   return (GtkWidget *)g_object_new (GLIDE_TYPE_SLIDE_BOX, NULL);
 }
+
+
+GlideStageManager *
+glide_slide_box_get_stage_manager (GlideSlideBox *box)
+{
+  return box->priv->manager;
+}
+
+void
+glide_slide_box_set_stage_manager (GlideSlideBox *box,
+				   GlideStageManager *manager)
+{
+  box->priv->manager = manager;
+  g_object_notify (G_OBJECT (box), "stage-manager");
+}
+
diff --git a/src/glide-slide-box.h b/src/glide-slide-box.h
index 766502b..43d11c0 100644
--- a/src/glide-slide-box.h
+++ b/src/glide-slide-box.h
@@ -20,6 +20,7 @@
 #define __GLIDE_SLIDE_BOX_H__
 
 #include <gtk/gtk.h>
+#include "glide-stage-manager.h"
 
 G_BEGIN_DECLS
 
@@ -52,6 +53,9 @@ struct _GlideSlideBoxClass
 GType glide_slide_box_get_type (void) G_GNUC_CONST;
 GtkWidget *glide_slide_box_new (void);
 
+GlideStageManager *glide_slide_box_get_stage_manager (GlideSlideBox *box);
+void glide_slide_box_set_stage_manager (GlideSlideBox *box, GlideStageManager *manager);
+
 G_END_DECLS
 
 #endif



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