Author: abrander
Date: 2010-04-02 21:21:18 +0200 (Fri, 02 Apr 2010)
New Revision: 3317
Modified:
trunk/librawstudio/rs-filter-param.c
trunk/librawstudio/rs-filter-param.h
Log:
Added rs_filter_param_set_integer() and rs_filter_param_get_integer().
Modified: trunk/librawstudio/rs-filter-param.c
===================================================================
--- trunk/librawstudio/rs-filter-param.c 2010-04-02 18:46:05 UTC (rev
3316)
+++ trunk/librawstudio/rs-filter-param.c 2010-04-02 19:21:18 UTC (rev
3317)
@@ -224,6 +224,39 @@
}
/**
+ * Set a integer property
+ * @param filter_param A RSFilterParam
+ * @param name The name of the property
+ * @param value A value to store
+ */
+void
+rs_filter_param_set_integer(RSFilterParam *filter_param, const gchar *name,
const gint value)
+{
+ GValue *val = new_value(G_TYPE_INT);
+ g_value_set_int(val, value);
+
+ rs_filter_param_set_gvalue(filter_param, name, val);
+}
+
+/**
+ * Get a integer property
+ * @param filter_param A RSFilterParam
+ * @param name The name of the property
+ * @param value A pointer to a gint where the value will be stored
+ * @return TRUE if the property was found, FALSE otherwise
+ */
+gboolean
+rs_filter_param_get_integer(const RSFilterParam *filter_param, const gchar
*name, gint *value)
+{
+ GValue *val = rs_filter_param_get_gvalue(filter_param, name);
+
+ if (val && G_VALUE_HOLDS_INT(val))
+ *value = g_value_get_int(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-04-02 18:46:05 UTC (rev
3316)
+++ trunk/librawstudio/rs-filter-param.h 2010-04-02 19:21:18 UTC (rev
3317)
@@ -94,6 +94,24 @@
gboolean rs_filter_param_get_boolean(const RSFilterParam *filter_param, const
gchar *name, gboolean *value);
/**
+ * Set a integer property
+ * @param filter_param A RSFilterParam
+ * @param name The name of the property
+ * @param value A value to store
+ */
+void
+rs_filter_param_set_integer(RSFilterParam *filter_param, const gchar *name,
const gint value);
+
+/**
+ * Get a integer property
+ * @param filter_param A RSFilterParam
+ * @param name The name of the property
+ * @param value A pointer to a gint where the value will be stored
+ * @return TRUE if the property was found, FALSE otherwise
+ */
+gboolean rs_filter_param_get_integer(const RSFilterParam *filter_param, const
gchar *name, gint *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