Author: abrander
Date: 2010-02-13 01:40:28 +0100 (Sat, 13 Feb 2010)
New Revision: 3194

Modified:
   trunk/librawstudio/rs-filter-param.c
   trunk/librawstudio/rs-filter-param.h
Log:
Added rs_filter_param_set_boolean() and rs_filter_param_get_boolean().

Modified: trunk/librawstudio/rs-filter-param.c
===================================================================
--- trunk/librawstudio/rs-filter-param.c        2010-02-13 00:39:19 UTC (rev 
3193)
+++ trunk/librawstudio/rs-filter-param.c        2010-02-13 00:40:28 UTC (rev 
3194)
@@ -191,6 +191,39 @@
 }
 
 /**
+ * Set a boolean property
+ * @param filter_param A RSFilterParam
+ * @param name The name of the property
+ * @param value A value to store
+ */
+void
+rs_filter_param_set_boolean(RSFilterParam *filter_param, const gchar *name, 
const gboolean value)
+{
+       GValue *val = new_value(G_TYPE_BOOLEAN);
+       g_value_set_boolean(val, value);
+
+       rs_filter_param_set_gvalue(filter_param, name, val);
+}
+
+/**
+ * Get a gboolean property
+ * @param filter_param A RSFilterParam
+ * @param name The name of the property
+ * @param value A pointer to a gboolean where the value will be stored
+ * @return TRUE if the property was found, FALSE otherwise
+ */
+gboolean
+rs_filter_param_get_boolean(const RSFilterParam *filter_param, const gchar 
*name, gboolean *value)
+{
+       GValue *val = rs_filter_param_get_gvalue(filter_param, name);
+
+       if (val && G_VALUE_HOLDS_BOOLEAN(val))
+               *value = g_value_get_boolean(val);
+
+       return (val != NULL);
+}
+
+/**
  * Set a float property
  * @param filter_param A RSFilterParam
  * @param name The name of the property

Modified: trunk/librawstudio/rs-filter-param.h
===================================================================
--- trunk/librawstudio/rs-filter-param.h        2010-02-13 00:39:19 UTC (rev 
3193)
+++ trunk/librawstudio/rs-filter-param.h        2010-02-13 00:40:28 UTC (rev 
3194)
@@ -76,6 +76,24 @@
 gboolean rs_filter_param_get_string(const RSFilterParam *filter_param, const 
gchar *name, const gchar ** const str);
 
 /**
+ * Set a boolean property
+ * @param filter_param A RSFilterParam
+ * @param name The name of the property
+ * @param value A value to store
+ */
+void
+rs_filter_param_set_boolean(RSFilterParam *filter_param, const gchar *name, 
const gboolean value);
+
+/**
+ * Get a gboolean property
+ * @param filter_param A RSFilterParam
+ * @param name The name of the property
+ * @param value A pointer to a gboolean where the value will be stored
+ * @return TRUE if the property was found, FALSE otherwise
+ */
+gboolean rs_filter_param_get_boolean(const RSFilterParam *filter_param, const 
gchar *name, gboolean *value);
+
+/**
  * Set a float property
  * @param filter_param A RSFilterParam
  * @param name The name of the property


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to