# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.65)
-AC_INIT([libzakform], [0.1.0], [azagli@libero.it])
+AC_INIT([libzakform], [0.2.0], [azagli@libero.it])
AC_CONFIG_SRCDIR([src/libzakform.h])
AC_CONFIG_HEADER([config.h])
for (i = 0; i < priv->pa_filters->len; i++)
{
- gchar *value;
- gchar *val;
+ GValue *value;
+ GValue *val;
- value = zak_form_element_get_value (element);
+ value = zak_form_element_get_value_gvalue (element);
val = zak_form_element_filter_filter ((ZakFormElementFilter *)g_ptr_array_index (priv->pa_filters, i),
value);
- zak_form_element_set_value (element, val);
+ zak_form_element_set_value_gvalue (element, val);
}
}
return g_strdup (priv->id);
}
-gchar
-*zak_form_element_filter_filter (ZakFormElementFilter *self, const gchar *value)
+GValue
+*zak_form_element_filter_filter (ZakFormElementFilter *self, GValue *value)
{
- gchar *ret;
+ GValue *ret;
- g_return_val_if_fail (ZAK_FORM_IS_ELEMENT_FILTER (self), g_strdup (""));
+ g_return_val_if_fail (ZAK_FORM_IS_ELEMENT_FILTER (self), NULL);
if (zak_form_element_filter_get_enabled (self)
&& ZAK_FORM_ELEMENT_FILTER_GET_CLASS (self)->filter != NULL)
}
else
{
- ret = g_strdup (value);
+ ret = NULL;
}
return ret;
GObjectClass parent_cleass;
gboolean (*xml_parsing) (ZakFormElementFilter *filter, xmlNode *xnode);
- gchar *(*filter) (ZakFormElementFilter *self, const gchar *value);
+ GValue *(*filter) (ZakFormElementFilter *self, GValue *value);
void (*get_xml) (ZakFormElementFilter *self, xmlNode *xnode, const gchar *version);
};
gboolean zak_form_element_filter_xml_parsing (ZakFormElementFilter *filter, xmlNode *xnode);
-gchar *zak_form_element_filter_filter (ZakFormElementFilter *self, const gchar *value);
+GValue *zak_form_element_filter_filter (ZakFormElementFilter *self, GValue *value);
void zak_form_element_filter_set_id (ZakFormElementFilter *filter,
const gchar *id);
static void zak_form_element_filter_luc_finalize (GObject *gobject);
static gboolean zak_form_element_filter_luc_xml_parsing (ZakFormElementFilter *filter, xmlNode *xnode);
-static gchar *zak_form_element_filter_luc_filter (ZakFormElementFilter *filter_luc, const gchar *value);
+GValue *zak_form_element_filter_luc_filter (ZakFormElementFilter *filter_luc, GValue *value);
static void zak_form_element_filter_luc_get_xml (ZakFormElementFilter *filter, xmlNode *xnode, const gchar *version);
enum
parent_class->finalize (gobject);
}
-static gchar
+GValue
*zak_form_element_filter_luc_filter (ZakFormElementFilter *filter_luc,
- const gchar *value)
+ GValue *value)
{
- gchar *ret;
+ GValue *ret;
gchar *_value;
guint i;
guint l;
ZakFormElementFilterLuc *zak_form_element = ZAK_FORM_ELEMENT_FILTER_LUC (filter_luc);
ZakFormElementFilterLucPrivate *priv = zak_form_element_filter_luc_get_instance_private (zak_form_element);
- g_return_val_if_fail (value != NULL, g_strdup (""));
+ g_return_val_if_fail (value != NULL, NULL);
+ g_return_val_if_fail (G_VALUE_HOLDS_STRING (value), NULL);
- _value = g_strdup (value);
+ _value = g_strdup (g_value_get_string (value));
l = strlen (_value);
switch (priv->type)
break;
}
- ret = g_strdup (_value);
+ ret = zak_utils_gvalue_new_string (_value);
g_free (_value);
return ret;
#include <config.h>
#endif
+#include <libzakutils/libzakutils.h>
+
#include "formelementfilter.h"
#include "formelementfiltertrim.h"
static void zak_form_element_filter_trim_finalize (GObject *gobject);
static gboolean zak_form_element_filter_trim_xml_parsing (ZakFormElementFilter *filter, xmlNode *xnode);
-static gchar *zak_form_element_filter_trim_filter (ZakFormElementFilter *filter_trim, const gchar *value);
+GValue *zak_form_element_filter_trim_filter (ZakFormElementFilter *filter_trim, GValue *value);
static void zak_form_element_filter_trim_get_xml (ZakFormElementFilter *filter, xmlNode *xnode, const gchar *version);
struct _ZakFormElementFilterTrim
parent_class->finalize (gobject);
}
-static gchar
+GValue
*zak_form_element_filter_trim_filter (ZakFormElementFilter *filter_trim,
- const gchar *value)
+ GValue *value)
{
- gchar *ret;
+ GValue *ret;
gchar *_value;
- g_return_val_if_fail (value != NULL, g_strdup (""));
+ g_return_val_if_fail (value != NULL, NULL);
+ g_return_val_if_fail (G_VALUE_HOLDS_STRING (value), NULL);
- _value = g_strdup (value);
+ _value = g_strdup (g_value_get_string (value));
- ret = g_strdup (g_strstrip (_value));
+ ret = zak_utils_gvalue_new_string (g_strstrip (_value));
return ret;
}