[glide] Add an index property to slides



commit d98781d159508aee69d6ae52c880f873257075bc
Author: Robert Carr <racarr Valentine localdomain>
Date:   Thu Apr 29 02:59:05 2010 -0400

    Add an index property to slides

 src/glide-slide-priv.h |    2 ++
 src/glide-slide.c      |   31 ++++++++++++++++++++++++++++++-
 src/glide-slide.h      |    3 +++
 3 files changed, 35 insertions(+), 1 deletions(-)
---
diff --git a/src/glide-slide-priv.h b/src/glide-slide-priv.h
index a1d4666..9a1bf8c 100644
--- a/src/glide-slide-priv.h
+++ b/src/glide-slide-priv.h
@@ -39,6 +39,8 @@ struct _GlideSlidePrivate
   ClutterActor *contents_group;
   
   ClutterColor color;
+  
+  guint index;
 };
 
 G_END_DECLS
diff --git a/src/glide-slide.c b/src/glide-slide.c
index fc126be..75c2f6b 100644
--- a/src/glide-slide.c
+++ b/src/glide-slide.c
@@ -42,7 +42,8 @@ enum {
   PROP_DOCUMENT,
   PROP_BACKGROUND,
   PROP_ANIMATION,
-  PROP_COLOR
+  PROP_COLOR,
+  PROP_INDEX
 };
 
 static const ClutterColor default_slide_color = { 0xff, 0xff, 0xff, 0xff };
@@ -69,6 +70,9 @@ glide_slide_get_property (GObject *object,
     case PROP_COLOR:
       clutter_value_set_color (value, &slide->priv->color);
       break;
+    case PROP_INDEX:
+      g_value_set_uint (value, slide->priv->index);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -98,6 +102,9 @@ glide_slide_set_property (GObject *object,
     case PROP_COLOR:
       glide_slide_set_color (slide, clutter_value_get_color (value));
       break;
+    case PROP_INDEX:
+      glide_slide_set_index (slide, g_value_get_uint (value));
+      break;
     default: 
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -606,6 +613,14 @@ glide_slide_class_init (GlideSlideClass *klass)
 							     G_PARAM_CONSTRUCT |
 							     G_PARAM_READWRITE | 
 							     G_PARAM_STATIC_STRINGS));
+  
+  g_object_class_install_property (object_class,
+				   PROP_INDEX,
+				   g_param_spec_uint ("index",
+						      "Index",
+						      "The index of the slide",
+						      0, G_MAXUINT, G_MAXUINT,
+						      G_PARAM_READWRITE));
 							     
   
   g_type_class_add_private (object_class, sizeof(GlideSlidePrivate));
@@ -813,3 +828,17 @@ glide_slide_resize (GlideSlide *slide, gfloat width, gfloat height)
 	}
     }
 }
+
+
+guint 
+glide_slide_get_index (GlideSlide *slide)
+{
+  return slide->priv->index;
+}
+
+void
+glide_slide_set_index (GlideSlide *slide, guint index)
+{
+  slide->priv->index = index;
+  g_object_notify (G_OBJECT (slide), "index");
+}
diff --git a/src/glide-slide.h b/src/glide-slide.h
index db66d39..507a228 100644
--- a/src/glide-slide.h
+++ b/src/glide-slide.h
@@ -71,6 +71,9 @@ void glide_slide_get_color (GlideSlide *slide, ClutterColor *color);
 
 void glide_slide_resize (GlideSlide *slide, gfloat width, gfloat height);
 
+guint glide_slide_get_index (GlideSlide *slide);
+void glide_slide_set_index (GlideSlide *slide, guint index);
+
 
 G_END_DECLS
 



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