soc.2008.themes: 8aa8a4e9: Added description to theme abstract clas...

ffdragon at soc.pidgin.im ffdragon at soc.pidgin.im
Wed Jun 11 14:37:04 EDT 2008


-----------------------------------------------------------------
Revision: 8aa8a4e9a91a49a2a3da305c0d02fa86a1b2581d
Ancestor: 6075bb449c4c3cb30d755ac7e8b39f7f6f08106f
Author: ffdragon at soc.pidgin.im
Date: 2008-06-11T18:32:12
Branch: im.pidgin.soc.2008.themes
URL: http://d.pidgin.im/viewmtn/revision/info/8aa8a4e9a91a49a2a3da305c0d02fa86a1b2581d

Modified files:
        libpurple/theme.c libpurple/theme.h

ChangeLog: 

Added description to theme abstract class

-------------- next part --------------
============================================================
--- libpurple/theme.c	dddecef690d1b6aa86685cd330a07b595aef32df
+++ libpurple/theme.c	86f74ef6e7962b22938c2135ecbabc78f1a411f4
@@ -32,6 +32,7 @@ typedef struct {
  *****************************************************************************/
 typedef struct {
 	gchar *name;
+	gchar *description;
 	gchar *author;
 	gchar *type;
 	gchar *dir;
@@ -46,6 +47,7 @@ typedef struct {
  * Enums
  *****************************************************************************/
 #define PROP_NAME_S "name"
+#define PROP_DESCRIPION_S "description"
 #define PROP_AUTHOR_S "author"
 #define PROP_TYPE_S "type"
 #define PROP_DIR_S "dir"
@@ -54,6 +56,7 @@ enum {
 enum {
 	PROP_ZERO = 0,
 	PROP_NAME,
+	PROP_DESCRIPION,
 	PROP_AUTHOR,
 	PROP_TYPE,
 	PROP_DIR,
@@ -75,6 +78,9 @@ purple_theme_get_property(GObject *obj, 
 		case PROP_NAME:
 			g_value_set_string(value, purple_theme_get_name(theme));
 			break;
+		case PROP_DESCRIPION:
+			g_value_set_string(value, purple_theme_get_description(theme));
+			break;
 		case PROP_AUTHOR:
 			g_value_set_string(value, purple_theme_get_author(theme));
 			break;
@@ -103,6 +109,9 @@ purple_theme_set_property(GObject *obj, 
 		case PROP_NAME:
 			purple_theme_set_name(theme, g_value_get_string(value));
 			break;
+		case PROP_DESCRIPION:
+			purple_theme_set_description(theme, g_value_get_string(value));
+			break;
 		case PROP_AUTHOR:
 			purple_theme_set_author(theme, g_value_get_string(value));
 			break;
@@ -136,6 +145,12 @@ purple_theme_class_init (PurpleThemeClas
 				    NULL,
 				    G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
 	g_object_class_install_property(obj_class, PROP_NAME, pspec);
+	/* DESCRIPION */
+	pspec = g_param_spec_string(PROP_DESCRIPION_S, "Description",
+				    "The description of the theme",
+				    NULL,
+				    G_PARAM_READWRITE | G_PARAM_CONSTRUCT);
+	g_object_class_install_property(obj_class, PROP_DESCRIPION, pspec);
 	/* AUTHOR */
 	pspec = g_param_spec_string(PROP_AUTHOR_S, "Author",
 				    "The author of the theme",
@@ -216,6 +231,30 @@ gchar *
 }
 
 gchar *
+purple_theme_get_description(PurpleTheme *theme)
+{
+	PurpleThemePrivate *priv = NULL;
+
+	g_return_val_if_fail(PURPLE_IS_THEME(theme), NULL);
+
+	priv = PURPLE_THEME_GET_PRIVATE(theme);
+	return priv->description;
+}
+
+void
+purple_theme_set_description(PurpleTheme *theme, const gchar *description)
+{
+	PurpleThemePrivate *priv = NULL;
+
+	g_return_if_fail(PURPLE_IS_THEME(theme));
+
+	priv = PURPLE_THEME_GET_PRIVATE(theme);
+
+	g_free(priv->description);
+	priv->description = g_strdup (description);
+}
+
+gchar *
 purple_theme_get_author(PurpleTheme *theme)
 {
 	PurpleThemePrivate *priv = NULL;
============================================================
--- libpurple/theme.h	c2c7ffff50d321eefdbcda6d013507a5490ecfed
+++ libpurple/theme.h	50f4ec1f82a4366fe7949f0959f251175e59aef9
@@ -1,5 +1,5 @@
 /**
- * @file purpletheme.h  Purple Theme Abstact Class API
+ * @file theme.h  Purple Theme Abstact Class API
  */
 
 /* purple
@@ -86,6 +86,23 @@ void purple_theme_set_name(PurpleTheme *
 void purple_theme_set_name(PurpleTheme *theme, const gchar *name);
 
 /**
+ * Returns the description of the PurpleTheme object
+ * 
+ * @param theme 	the purple theme
+ *
+ * @return A short description of the theme
+ */
+gchar *purple_theme_get_description(PurpleTheme *theme);
+
+/**
+ * Sets the description of the PurpleTheme object
+ * 
+ * @param theme 	the purple theme
+ * @param description	the description of the PurpleTheme object
+ */
+void purple_theme_set_description(PurpleTheme *theme, const gchar *description);
+
+/**
  * Returns the author of the PurpleTheme object
  * 
  * @param theme 	the purple theme


More information about the Commits mailing list