if (priv->value != NULL)
{
-@@ -751,7 +755,7 @@ gchar
+@@ -848,7 +848,7 @@ gchar
- gchar *ret;
+ GValue *ret;
- priv = zak_form_element_get_instance_private (element);
+ priv = ZAK_FORM_ELEMENT_GET_PRIVATE (element);
- priv = zak_form_element_get_instance_private (element);
+ priv = ZAK_FORM_ELEMENT_GET_PRIVATE (element);
- return g_strdup (priv->default_value);
+ return priv->default_value;
}
@@ -822,7 +826,7 @@ zak_form_element_set_original_value (ZakFormElement *element, const gchar *value
- priv = zak_form_element_get_instance_private (element);
+ priv = ZAK_FORM_ELEMENT_GET_PRIVATE (element);
- return g_strdup (priv->original_value);
+ return priv->original_value;
}
@@ -882,7 +886,7 @@ zak_form_element_set_format (ZakFormElement *element, GHashTable *format)
{
- priv = zak_form_element_get_instance_private (element);
+ priv = ZAK_FORM_ELEMENT_GET_PRIVATE (element);
- zak_form_element_set_value (element, priv->default_value);
+ zak_form_element_set_value_gvalue (element, priv->default_value);
}
-@@ -1115,7 +1119,7 @@ zak_form_element_is_valid (ZakFormElement *element)
+@@ -1315,7 +1315,7 @@ zak_form_element_is_valid (ZakFormElement *element)
- ZakFormElementPrivate *priv;
+ ZakFormElementClass *klass = ZAK_FORM_ELEMENT_GET_CLASS (element);
- priv = zak_form_element_get_instance_private (element);
+ priv = ZAK_FORM_ELEMENT_GET_PRIVATE (element);
ret = TRUE;
-
+ ret_callback = FALSE;
@@ -1155,7 +1159,7 @@ zak_form_element_is_valid (ZakFormElement *element)
GPtrArray
*zak_form_element_get_messages (ZakFormElement *element)
index 6acafbd..8b658f1 100644
--- a/src/formelementfiltertrim.c
+++ b/src/formelementfiltertrim.c
-@@ -40,13 +40,6 @@ static void zak_form_element_filter_trim_finalize (GObject *gobject);
-
+@@ -41,13 +41,6 @@
+ 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);
-struct _ZakFormElementFilterTrim
index 65fb8db..27c2fbd 100644
--- a/src/formelementvalidator.c
+++ b/src/formelementvalidator.c
-@@ -46,13 +46,15 @@ static void zak_form_element_validator_get_property (GObject *object,
+@@ -47,14 +47,16 @@ static void zak_form_element_validator_get_property (GObject *object,
static void zak_form_element_validator_dispose (GObject *gobject);
static void zak_form_element_validator_finalize (GObject *gobject);
+
typedef struct
{
+ gchar *id;
gboolean enabled;
gchar *message;
} ZakFormElementValidatorPrivate;
static void
zak_form_element_validator_class_init (ZakFormElementValidatorClass *class)
-@@ -64,6 +66,8 @@ zak_form_element_validator_class_init (ZakFormElementValidatorClass *class)
+@@ -66,6 +66,8 @@ zak_form_element_validator_class_init (ZakFormElementValidatorClass *class)
object_class->dispose = zak_form_element_validator_dispose;
object_class->finalize = zak_form_element_validator_finalize;
+ g_type_class_add_private (object_class, sizeof (ZakFormElementValidatorPrivate));
+
- g_object_class_install_property (object_class, PROP_ENABLED,
- g_param_spec_boolean ("enabled",
- "Enabled",
-@@ -111,7 +115,7 @@ void
+ g_object_class_install_property (object_class, PROP_ID,
+ g_param_spec_string ("id",
+ "Id",
+@@ -195,7 +195,7 @@ void
zak_form_element_validator_set_message (ZakFormElementValidator *validator,
- const gchar *message)
+ const gchar *message)
{
- ZakFormElementValidatorPrivate *priv = zak_form_element_validator_get_instance_private (validator);
+ ZakFormElementValidatorPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_GET_PRIVATE (validator);
priv->message = g_strdup (message);
}
-@@ -125,7 +129,7 @@ zak_form_element_validator_set_message (ZakFormElementValidator *validator,
+@@ -209,7 +209,7 @@ zak_form_element_validator_set_message (ZakFormElementValidator *validator,
gchar
*zak_form_element_validator_get_message (ZakFormElementValidator *validator)
{
- ZakFormElementValidatorPrivate *priv = zak_form_element_validator_get_instance_private (validator);
+ ZakFormElementValidatorPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_GET_PRIVATE (validator);
- return g_strdup (priv->message);
+ return g_strdup (priv->message);
}
@@ -166,7 +170,7 @@ zak_form_element_validator_set_property (GObject *object,
- GParamSpec *pspec)
+ GParamSpec *pspec)
{
ZakFormElementValidator *zak_form_element_validator = (ZakFormElementValidator *)object;
- ZakFormElementValidatorPrivate *priv = zak_form_element_validator_get_instance_private (zak_form_element_validator);
switch (property_id)
{
@@ -191,7 +195,7 @@ zak_form_element_validator_get_property (GObject *object,
- GParamSpec *pspec)
+ GParamSpec *pspec)
{
ZakFormElementValidator *zak_form_element_validator = (ZakFormElementValidator *)object;
- ZakFormElementValidatorPrivate *priv = zak_form_element_validator_get_instance_private (zak_form_element_validator);
index df7d0f5..b938f75 100644
--- a/src/formelementvalidatordate.c
+++ b/src/formelementvalidatordate.c
-@@ -42,13 +42,6 @@ static void zak_form_element_validator_date_finalize (GObject *gobject);
-
+@@ -45,13 +45,6 @@
+ static gboolean zak_form_element_validator_date_xml_parsing (ZakFormElementValidator *validator, xmlNode *xnode);
static gboolean zak_form_element_validator_date_validate (ZakFormElementValidator *validator_date, const gchar *value);
-struct _ZakFormElementValidatorDate
index a3ef4e2..63f6131 100644
--- a/src/formelementvalidatornotempty.c
+++ b/src/formelementvalidatornotempty.c
-@@ -46,13 +46,6 @@ static void zak_form_element_validator_notempty_finalize (GObject *gobject);
-
+@@ -47,13 +47,6 @@
+ static gboolean zak_form_element_validator_notempty_xml_parsing (ZakFormElementValidator *validator, xmlNode *xnode);
static gboolean zak_form_element_validator_notempty_validate (ZakFormElementValidator *validator_notempty, const gchar *value);
-struct _ZakFormElementValidatorNotempty
index a0d5b2b..aa8658a 100644
--- a/src/formelementvalidatorregex.c
+++ b/src/formelementvalidatorregex.c
-@@ -46,13 +46,6 @@ static void zak_form_element_validator_regex_finalize (GObject *gobject);
-
+@@ -47,13 +47,6 @@
+ static gboolean zak_form_element_validator_regex_xml_parsing (ZakFormElementValidator *validator, xmlNode *xnode);
static gboolean zak_form_element_validator_regex_validate (ZakFormElementValidator *validator_regex, const gchar *value);
-struct _ZakFormElementValidatorRegex
index eba0131..6cc3f4e 100644
--- a/src/formvalidator.c
+++ b/src/formvalidator.c
-@@ -46,13 +46,15 @@ static void zak_form_validator_get_property (GObject *object,
+@@ -48,14 +48,16 @@ static void zak_form_validator_get_property (GObject *object,
static void zak_form_validator_dispose (GObject *gobject);
static void zak_form_validator_finalize (GObject *gobject);
+
typedef struct
{
+ gchar *id;
gboolean enabled;
gchar *message;
} ZakFormValidatorPrivate;
static void
zak_form_validator_class_init (ZakFormValidatorClass *class)
-@@ -64,6 +66,8 @@ zak_form_validator_class_init (ZakFormValidatorClass *class)
+@@ -67,6 +67,8 @@ zak_form_validator_class_init (ZakFormValidatorClass *class)
object_class->dispose = zak_form_validator_dispose;
object_class->finalize = zak_form_validator_finalize;
+ g_type_class_add_private (object_class, sizeof (ZakFormValidatorPrivate));
+
- g_object_class_install_property (object_class, PROP_ENABLED,
- g_param_spec_boolean ("enabled",
- "Enabled",
-@@ -82,7 +86,7 @@ zak_form_validator_class_init (ZakFormValidatorClass *class)
+ g_object_class_install_property (object_class, PROP_ID,
+ g_param_spec_string ("id",
+ "Id",
+@@ -92,7 +92,7 @@ zak_form_validator_class_init (ZakFormValidatorClass *class)
static void
zak_form_validator_init (ZakFormValidator *zak_form_validator)
{
+ ZakFormValidatorPrivate *priv = ZAK_FORM_VALIDATOR_GET_PRIVATE (zak_form_validator);
}
- gboolean
-@@ -111,7 +115,7 @@ void
+ /**
+@@ -206,7 +206,7 @@ void
zak_form_validator_set_message (ZakFormValidator *validator,
- const gchar *message)
+ const gchar *message)
{
- ZakFormValidatorPrivate *priv = zak_form_validator_get_instance_private (validator);
+ ZakFormValidatorPrivate *priv = ZAK_FORM_VALIDATOR_GET_PRIVATE (validator);
priv->message = g_strdup (message);
}
-@@ -125,7 +129,7 @@ zak_form_validator_set_message (ZakFormValidator *validator,
+@@ -220,7 +220,7 @@
gchar
*zak_form_validator_get_message (ZakFormValidator *validator)
{
- ZakFormValidatorPrivate *priv = zak_form_validator_get_instance_private (validator);
+ ZakFormValidatorPrivate *priv = ZAK_FORM_VALIDATOR_GET_PRIVATE (validator);
- return g_strdup (priv->message);
+ return g_strdup (priv->message);
}
@@ -166,7 +170,7 @@ zak_form_validator_set_property (GObject *object,
- GParamSpec *pspec)
+ GParamSpec *pspec)
{
ZakFormValidator *zak_form_validator = (ZakFormValidator *)object;
- ZakFormValidatorPrivate *priv = zak_form_validator_get_instance_private (zak_form_validator);
switch (property_id)
{
-@@ -191,7 +195,7 @@ zak_form_validator_get_property (GObject *object,
- GParamSpec *pspec)
+@@ -261,7 +261,7 @@ zak_form_validator_get_property (GObject *object,
+ GParamSpec *pspec)
{
ZakFormValidator *zak_form_validator = (ZakFormValidator *)object;
- ZakFormValidatorPrivate *priv = zak_form_validator_get_instance_private (zak_form_validator);
switch (property_id)
{
-@@ -213,7 +217,7 @@ static void
+@@ -316,7 +316,7 @@ static void
zak_form_validator_dispose (GObject *gobject)
{
ZakFormValidator *zak_form_validator = (ZakFormValidator *)gobject;
-@@ -225,7 +229,7 @@ static void
+@@ -328,7 +328,7 @@ static void
zak_form_validator_finalize (GObject *gobject)
{
ZakFormValidator *zak_form_validator = (ZakFormValidator *)gobject;
index 02fedf6..6d4eac2 100644
--- a/src/formvalidatorcompare.c
+++ b/src/formvalidatorcompare.c
-@@ -45,13 +45,6 @@ static void zak_form_validator_compare_finalize (GObject *gobject);
-
+@@ -47,13 +47,6 @@
+ static gboolean zak_form_validator_compare_xml_parsing (ZakFormValidator *validator, xmlNode *xnode, gpointer form);
static gboolean zak_form_validator_compare_validate (ZakFormValidator *validator_notempty);
-struct _ZakFormValidatorCompare
-
#define ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_VALIDATOR_COMPARE, ZakFormValidatorComparePrivate))
- enum
+ typedef struct _ZakFormValidatorComparePrivate ZakFormValidatorComparePrivate;
diff --git a/src/formvalidatorcompare.h b/src/formvalidatorcompare.h
index d4ab5ac..91b9180 100644
--- a/src/formvalidatorcompare.h
index 78e4360..2546163 100644
--- a/src/formvalidatorcomparedate.c
+++ b/src/formvalidatorcomparedate.c
-@@ -45,13 +45,6 @@ static void zak_form_validator_compare_date_finalize (GObject *gobject);
-
+@@ -47,13 +47,6 @@
+ static gboolean zak_form_validator_compare_date_xml_parsing (ZakFormValidator *validator, xmlNode *xnode, gpointer form);
static gboolean zak_form_validator_compare_date_validate (ZakFormValidator *validator_notempty);
-struct _ZakFormValidatorCompareDate
-
#define ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_VALIDATOR_COMPARE_DATE, ZakFormValidatorCompareDatePrivate))
- enum
+ typedef struct _ZakFormValidatorCompareDatePrivate ZakFormValidatorCompareDatePrivate;
diff --git a/src/formvalidatorcomparedate.h b/src/formvalidatorcomparedate.h
index ec11584..655680a 100644
--- a/src/formvalidatorcomparedate.h