[glide] Add a selected theme property to theme chooser



commit 07246f03084e7e0ff904e347f38a7596b1729e38
Author: Robert Carr <racarr Valentine localdomain>
Date:   Tue May 25 15:48:03 2010 -0400

    Add a selected theme property to theme chooser

 libglide/glide-theme-chooser-priv.h |    2 ++
 libglide/glide-theme-chooser.c      |   19 ++++++++++++++++++-
 libglide/glide-theme-chooser.h      |    2 ++
 libglide/glide-theme.c              |    1 +
 4 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/libglide/glide-theme-chooser-priv.h b/libglide/glide-theme-chooser-priv.h
index c7b1164..6a27a04 100644
--- a/libglide/glide-theme-chooser-priv.h
+++ b/libglide/glide-theme-chooser-priv.h
@@ -29,6 +29,8 @@ struct _GlideThemeChooserPrivate
   GList *themes;
   
   GtkWidget *preview;
+  
+  GlideTheme *theme;
 };
 
 G_END_DECLS
diff --git a/libglide/glide-theme-chooser.c b/libglide/glide-theme-chooser.c
index 1ecb4b6..7f10ee6 100644
--- a/libglide/glide-theme-chooser.c
+++ b/libglide/glide-theme-chooser.c
@@ -39,6 +39,7 @@ G_DEFINE_TYPE(GlideThemeChooser, glide_theme_chooser, GTK_TYPE_WINDOW);
 
 enum {
   PROP_0,
+  PROP_THEME
 };
 
 enum {
@@ -63,8 +64,12 @@ glide_theme_chooser_get_property (GObject *object,
 			      GValue *value,
 			      GParamSpec *pspec)
 {
+  GlideThemeChooser *chooser = (GlideThemeChooser *)object;
   switch (prop_id)
     {
+    case PROP_THEME:
+      g_value_set_object (value, chooser->priv->theme);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -230,6 +235,14 @@ glide_theme_chooser_class_init (GlideThemeChooserClass *klass)
   object_class->finalize = glide_theme_chooser_finalize;
   object_class->get_property = glide_theme_chooser_get_property;
   object_class->set_property = glide_theme_chooser_set_property;
+
+  g_object_class_install_property (object_class,
+				   PROP_THEME,
+				   g_param_spec_object ("theme",
+							"Theme",
+							"The selected theme",
+							GLIDE_TYPE_THEME,
+							G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
   
   theme_chooser_signals[RESPONSE] = 
     g_signal_new ("response",
@@ -249,4 +262,8 @@ glide_theme_chooser_new ()
   return (GtkWidget *)g_object_new (GLIDE_TYPE_THEME_CHOOSER, NULL);
 }
 
-
+GlideTheme *
+glide_theme_chooser_get_theme (GlideThemeChooser *chooser)
+{
+  return chooser->priv->theme;
+}
diff --git a/libglide/glide-theme-chooser.h b/libglide/glide-theme-chooser.h
index 4473e0a..e50cb28 100644
--- a/libglide/glide-theme-chooser.h
+++ b/libglide/glide-theme-chooser.h
@@ -53,6 +53,8 @@ struct _GlideThemeChooserClass
 GType glide_theme_chooser_get_type (void) G_GNUC_CONST;
 GtkWidget *glide_theme_chooser_new (void);
 
+GlideTheme *glide_theme_chooser_get_theme (GlideThemeChooser *chooser);
+
 G_END_DECLS
 
 #endif
diff --git a/libglide/glide-theme.c b/libglide/glide-theme.c
index c00e8d6..9d98f68 100644
--- a/libglide/glide-theme.c
+++ b/libglide/glide-theme.c
@@ -405,3 +405,4 @@ glide_theme_preview (GlideTheme *theme, cairo_t *cr, gint width, gint height)
   glide_theme_preview_background (theme, cr, width, height);
   glide_theme_preview_text (theme, cr, width, height);
 }
+



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