static void zak_form_element_array_get_xml (ZakFormElement *element, xmlNode *xnode, const gchar *version);
-#define ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_ELEMENT_ARRAY, ZakFormElementArrayPrivate))
-
typedef struct _ZakFormElementArrayPrivate ZakFormElementArrayPrivate;
struct _ZakFormElementArrayPrivate
{
GPtrArray *ar_elements;
};
-G_DEFINE_TYPE (ZakFormElementArray, zak_form_element_array, ZAK_FORM_TYPE_ELEMENT)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakFormElementArray, zak_form_element_array, ZAK_FORM_TYPE_ELEMENT)
static void
zak_form_element_array_class_init (ZakFormElementArrayClass *klass)
elem_class->is_valid = zak_form_element_array_is_valid;
elem_class->get_xml = zak_form_element_array_get_xml;
- g_type_class_add_private (object_class, sizeof (ZakFormElementArrayPrivate));
-
/**
* ZakFormElementArray::element-add:
* @element:
static void
zak_form_element_array_init (ZakFormElementArray *zak_form_element_array)
{
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (zak_form_element_array);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (zak_form_element_array);
priv->handler_name = NULL;
priv->ar_elements = g_ptr_array_new ();
ZakFormElementConstructorFunc element_constructor;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (ZAK_FORM_ELEMENT_ARRAY (element));
cur = xmlnode->children;
while (cur != NULL)
zak_form_element_array_add_element (ZakFormElement *element, ZakFormElement *element_to_add)
{
ZakFormElementArrayClass *klass = ZAK_FORM_ELEMENT_ARRAY_GET_CLASS (element);
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (ZAK_FORM_ELEMENT_ARRAY (element));
g_ptr_array_add (priv->ar_elements, element_to_add);
GPtrArray
*zak_form_element_array_get_elements (ZakFormElement *element)
{
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (ZAK_FORM_ELEMENT_ARRAY (element));
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (ZAK_FORM_ELEMENT_ARRAY (element));
return priv->ar_elements;
}
guint i;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (ZAK_FORM_ELEMENT_ARRAY (element));
ret = NULL;
for (i = 0; i < priv->ar_elements->len; i++)
GParamSpec *pspec)
{
ZakFormElementArray *zak_form_element_array = (ZakFormElementArray *)object;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (zak_form_element_array);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (zak_form_element_array);
switch (property_id)
{
GParamSpec *pspec)
{
ZakFormElementArray *zak_form_element_array = (ZakFormElementArray *)object;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (zak_form_element_array);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (zak_form_element_array);
switch (property_id)
{
zak_form_element_array_dispose (GObject *gobject)
{
ZakFormElementArray *zak_form_element_array = (ZakFormElementArray *)gobject;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (zak_form_element_array);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (zak_form_element_array);
zak_form_element_array_finalize (GObject *gobject)
{
ZakFormElementArray *zak_form_element_array = (ZakFormElementArray *)gobject;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (zak_form_element_array);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (zak_form_element_array);
GString *str;
guint i;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (element);
str = g_string_new ("{");
ZakFormElement *form_element;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (element);
splitted = g_strsplit (g_value_get_string (value), "},{", -1);
{
guint i;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (ZAK_FORM_ELEMENT_ARRAY (element));
for (i = 0; i < priv->ar_elements->len; i++)
{
gboolean ret;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (ZAK_FORM_ELEMENT_ARRAY (element));
ret = FALSE;
{
guint i;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (ZAK_FORM_ELEMENT_ARRAY (element));
for (i = 0; i < priv->ar_elements->len; i++)
{
static gboolean
zak_form_element_array_get_visible (ZakFormElement *element)
{
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (ZAK_FORM_ELEMENT_ARRAY (element));
ZakFormElement *form_element = (ZakFormElement *)g_ptr_array_index (priv->ar_elements, 0);
{
guint i;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (ZAK_FORM_ELEMENT_ARRAY (element));
for (i = 0; i < priv->ar_elements->len; i++)
{
static gboolean
zak_form_element_array_get_editable (ZakFormElement *element)
{
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (ZAK_FORM_ELEMENT_ARRAY (element));
ZakFormElement *form_element = (ZakFormElement *)g_ptr_array_index (priv->ar_elements, 0);
{
guint i;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (ZAK_FORM_ELEMENT_ARRAY (element));
for (i = 0; i < priv->ar_elements->len; i++)
{
gboolean ret;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (ZAK_FORM_ELEMENT_ARRAY (element));
ret = TRUE;
xmlNode *cur;
- ZakFormElementArrayPrivate *priv = ZAK_FORM_ELEMENT_ARRAY_GET_PRIVATE (element);
+ ZakFormElementArrayPrivate *priv = zak_form_element_array_get_instance_private (ZAK_FORM_ELEMENT_ARRAY (element));
xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_element_array");
/* Other members, including private data. */
};
-#define ZAK_FORM_ELEMENT_FILTER_LUC_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_ELEMENT_FILTER_LUC, ZakFormElementFilterLucPrivate))
-
typedef struct _ZakFormElementFilterLucPrivate ZakFormElementFilterLucPrivate;
struct _ZakFormElementFilterLucPrivate
{
guint type;
};
-G_DEFINE_TYPE (ZakFormElementFilterLuc, zak_form_element_filter_luc, ZAK_FORM_TYPE_ELEMENT_FILTER)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakFormElementFilterLuc, zak_form_element_filter_luc, ZAK_FORM_TYPE_ELEMENT_FILTER)
static void
zak_form_element_filter_luc_class_init (ZakFormElementFilterLucClass *class)
parent_class->xml_parsing = zak_form_element_filter_luc_xml_parsing;
parent_class->filter = zak_form_element_filter_luc_filter;
parent_class->get_xml = zak_form_element_filter_luc_get_xml;
-
- g_type_class_add_private (object_class, sizeof (ZakFormElementFilterLucPrivate));
}
static void
zak_form_element_filter_luc_init (ZakFormElementFilterLuc *zak_form_element)
{
- ZakFormElementFilterLucPrivate *priv = ZAK_FORM_ELEMENT_FILTER_LUC_GET_PRIVATE (zak_form_element);
+ ZakFormElementFilterLucPrivate *priv = zak_form_element_filter_luc_get_instance_private (zak_form_element);
}
/**
{
gchar *content;
- ZakFormElementFilterLucPrivate *priv = ZAK_FORM_ELEMENT_FILTER_LUC_GET_PRIVATE (filter);
+ ZakFormElementFilterLucPrivate *priv = zak_form_element_filter_luc_get_instance_private (ZAK_FORM_ELEMENT_FILTER_LUC (filter));
content = (gchar *)xmlNodeGetContent (xnode);
if (g_strcmp0 (content, "lower") == 0)
GParamSpec *pspec)
{
ZakFormElementFilterLuc *zak_form_element = (ZakFormElementFilterLuc *)object;
- ZakFormElementFilterLucPrivate *priv = ZAK_FORM_ELEMENT_FILTER_LUC_GET_PRIVATE (zak_form_element);
+ ZakFormElementFilterLucPrivate *priv = zak_form_element_filter_luc_get_instance_private (zak_form_element);
switch (property_id)
{
GParamSpec *pspec)
{
ZakFormElementFilterLuc *zak_form_element = (ZakFormElementFilterLuc *)object;
- ZakFormElementFilterLucPrivate *priv = ZAK_FORM_ELEMENT_FILTER_LUC_GET_PRIVATE (zak_form_element);
+ ZakFormElementFilterLucPrivate *priv = zak_form_element_filter_luc_get_instance_private (zak_form_element);
switch (property_id)
{
zak_form_element_filter_luc_dispose (GObject *gobject)
{
ZakFormElementFilterLuc *zak_form_element = (ZakFormElementFilterLuc *)gobject;
- ZakFormElementFilterLucPrivate *priv = ZAK_FORM_ELEMENT_FILTER_LUC_GET_PRIVATE (zak_form_element);
+ ZakFormElementFilterLucPrivate *priv = zak_form_element_filter_luc_get_instance_private (zak_form_element);
zak_form_element_filter_luc_finalize (GObject *gobject)
{
ZakFormElementFilterLuc *zak_form_element = (ZakFormElementFilterLuc *)gobject;
- ZakFormElementFilterLucPrivate *priv = ZAK_FORM_ELEMENT_FILTER_LUC_GET_PRIVATE (zak_form_element);
+ ZakFormElementFilterLucPrivate *priv = zak_form_element_filter_luc_get_instance_private (zak_form_element);
GString *str;
ZakFormElementFilterLuc *zak_form_element = ZAK_FORM_ELEMENT_FILTER_LUC (filter_luc);
- ZakFormElementFilterLucPrivate *priv = ZAK_FORM_ELEMENT_FILTER_LUC_GET_PRIVATE (zak_form_element);
+ ZakFormElementFilterLucPrivate *priv = zak_form_element_filter_luc_get_instance_private (zak_form_element);
g_return_val_if_fail (value != NULL, g_strdup (""));
zak_form_element_filter_luc_get_xml (ZakFormElementFilter *filter, xmlNode *xnode, const gchar *version)
{
ZakFormElementFilterLuc *zak_form_element = ZAK_FORM_ELEMENT_FILTER_LUC (filter);
- ZakFormElementFilterLucPrivate *priv = ZAK_FORM_ELEMENT_FILTER_LUC_GET_PRIVATE (zak_form_element);
+ ZakFormElementFilterLucPrivate *priv = zak_form_element_filter_luc_get_instance_private (zak_form_element);
xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_element_filter_luc");
/* Other members, including private data. */
};
-#define ZAK_FORM_ELEMENT_FILTER_TRIM_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_ELEMENT_FILTER_TRIM, ZakFormElementFilterTrimPrivate))
-
typedef struct _ZakFormElementFilterTrimPrivate ZakFormElementFilterTrimPrivate;
struct _ZakFormElementFilterTrimPrivate
{
gpointer nothing;
};
-G_DEFINE_TYPE (ZakFormElementFilterTrim, zak_form_element_filter_trim, ZAK_FORM_TYPE_ELEMENT_FILTER)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakFormElementFilterTrim, zak_form_element_filter_trim, ZAK_FORM_TYPE_ELEMENT_FILTER)
static void
zak_form_element_filter_trim_class_init (ZakFormElementFilterTrimClass *class)
parent_class->xml_parsing = zak_form_element_filter_trim_xml_parsing;
parent_class->filter = zak_form_element_filter_trim_filter;
parent_class->get_xml = zak_form_element_filter_trim_get_xml;
-
- g_type_class_add_private (object_class, sizeof (ZakFormElementFilterTrimPrivate));
}
static void
zak_form_element_filter_trim_init (ZakFormElementFilterTrim *zak_form_element)
{
- ZakFormElementFilterTrimPrivate *priv = ZAK_FORM_ELEMENT_FILTER_TRIM_GET_PRIVATE (zak_form_element);
+ ZakFormElementFilterTrimPrivate *priv = zak_form_element_filter_trim_get_instance_private (zak_form_element);
}
/**
GParamSpec *pspec)
{
ZakFormElementFilterTrim *zak_form_element = (ZakFormElementFilterTrim *)object;
- ZakFormElementFilterTrimPrivate *priv = ZAK_FORM_ELEMENT_FILTER_TRIM_GET_PRIVATE (zak_form_element);
+ ZakFormElementFilterTrimPrivate *priv = zak_form_element_filter_trim_get_instance_private (zak_form_element);
switch (property_id)
{
GParamSpec *pspec)
{
ZakFormElementFilterTrim *zak_form_element = (ZakFormElementFilterTrim *)object;
- ZakFormElementFilterTrimPrivate *priv = ZAK_FORM_ELEMENT_FILTER_TRIM_GET_PRIVATE (zak_form_element);
+ ZakFormElementFilterTrimPrivate *priv = zak_form_element_filter_trim_get_instance_private (zak_form_element);
switch (property_id)
{
zak_form_element_filter_trim_dispose (GObject *gobject)
{
ZakFormElementFilterTrim *zak_form_element = (ZakFormElementFilterTrim *)gobject;
- ZakFormElementFilterTrimPrivate *priv = ZAK_FORM_ELEMENT_FILTER_TRIM_GET_PRIVATE (zak_form_element);
+ ZakFormElementFilterTrimPrivate *priv = zak_form_element_filter_trim_get_instance_private (zak_form_element);
zak_form_element_filter_trim_finalize (GObject *gobject)
{
ZakFormElementFilterTrim *zak_form_element = (ZakFormElementFilterTrim *)gobject;
- ZakFormElementFilterTrimPrivate *priv = ZAK_FORM_ELEMENT_FILTER_TRIM_GET_PRIVATE (zak_form_element);
+ ZakFormElementFilterTrimPrivate *priv = zak_form_element_filter_trim_get_instance_private (zak_form_element);
zak_form_element_filter_trim_get_xml (ZakFormElementFilter *filter, xmlNode *xnode, const gchar *version)
{
ZakFormElementFilterTrim *zak_form_element = ZAK_FORM_ELEMENT_FILTER_TRIM (filter);
- ZakFormElementFilterTrimPrivate *priv = ZAK_FORM_ELEMENT_FILTER_TRIM_GET_PRIVATE (zak_form_element);
+ ZakFormElementFilterTrimPrivate *priv = zak_form_element_filter_trim_get_instance_private (zak_form_element);
xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_element_filter_trim");
}
/* Other members, including private data. */
};
-#define ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_ELEMENT_VALIDATOR_DATE, ZakFormElementValidatorDatePrivate))
-
typedef struct _ZakFormElementValidatorDatePrivate ZakFormElementValidatorDatePrivate;
struct _ZakFormElementValidatorDatePrivate
{
gchar *format;
};
-G_DEFINE_TYPE (ZakFormElementValidatorDate, zak_form_element_validator_date, ZAK_FORM_TYPE_ELEMENT_VALIDATOR)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakFormElementValidatorDate, zak_form_element_validator_date, ZAK_FORM_TYPE_ELEMENT_VALIDATOR)
static void
zak_form_element_validator_date_class_init (ZakFormElementValidatorDateClass *class)
parent_class->xml_parsing = zak_form_element_validator_date_xml_parsing;
parent_class->validate = zak_form_element_validator_date_validate;
parent_class->get_xml = zak_form_element_validator_date_get_xml;
-
- g_type_class_add_private (object_class, sizeof (ZakFormElementValidatorDatePrivate));
}
static void
zak_form_element_validator_date_init (ZakFormElementValidatorDate *zak_form_element)
{
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (zak_form_element);
priv->compare_type = ZAK_FORM_COMPARE_TYPE_NONE;
priv->compare_value = NULL;
void
zak_form_element_validator_date_set_compare_type (ZakFormElementValidatorDate *validator, ZakFormCompareType type)
{
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (validator);
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (validator);
priv->compare_type = type;
}
ZakFormCompareType
zak_form_element_validator_date_get_compare_type (ZakFormElementValidatorDate *validator)
{
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (validator);
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (validator);
return priv->compare_type;
}
void
zak_form_element_validator_date_set_compare_value (ZakFormElementValidatorDate *validator, const gchar *value)
{
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (validator);
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (validator);
if (priv->compare_value != NULL)
{
{
gchar *ret;
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (validator);
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (validator);
if (priv->compare_value == NULL)
{
void
zak_form_element_validator_date_set_format (ZakFormElementValidatorDate *validator, const gchar *format)
{
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (validator);
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (validator);
if (priv->format != NULL)
{
gchar
*zak_form_element_validator_date_get_format (ZakFormElementValidatorDate *validator)
{
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (validator);
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (validator);
return g_strdup (priv->format);
}
{
gchar *prop;
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (ZAK_FORM_ELEMENT_VALIDATOR_DATE (validator));
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_DATE (validator));
prop = (gchar *)xmlGetProp (xnode, (const xmlChar *)"type_comp");
zak_form_element_validator_date_set_compare_type (ZAK_FORM_ELEMENT_VALIDATOR_DATE (validator), zak_form_get_compare_type_from_string (prop));
GParamSpec *pspec)
{
ZakFormElementValidatorDate *zak_form_element = (ZakFormElementValidatorDate *)object;
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (zak_form_element);
switch (property_id)
{
GParamSpec *pspec)
{
ZakFormElementValidatorDate *zak_form_element = (ZakFormElementValidatorDate *)object;
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (zak_form_element);
switch (property_id)
{
zak_form_element_validator_date_dispose (GObject *gobject)
{
ZakFormElementValidatorDate *zak_form_element = (ZakFormElementValidatorDate *)gobject;
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (zak_form_element);
zak_form_element_validator_date_finalize (GObject *gobject)
{
ZakFormElementValidatorDate *zak_form_element = (ZakFormElementValidatorDate *)gobject;
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (zak_form_element);
g_free (priv->format);
gint comp;
gchar *msg;
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (validator_date);
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_DATE (validator_date));
g_return_val_if_fail (value != NULL, FALSE);
zak_form_element_validator_date_get_xml (ZakFormElementValidator *validator, xmlNode *xnode, const gchar *version)
{
ZakFormElementValidatorDate *validator_date = ZAK_FORM_ELEMENT_VALIDATOR_DATE (validator);
- ZakFormElementValidatorDatePrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_DATE_GET_PRIVATE (validator_date);
+ ZakFormElementValidatorDatePrivate *priv = zak_form_element_validator_date_get_instance_private (validator_date);
xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_element_validator_date");
/* Other members, including private data. */
};
-#define ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_ELEMENT_VALIDATOR_IS_NUMBER, ZakFormElementValidatorIsNumberPrivate))
-
typedef struct _ZakFormElementValidatorIsNumberPrivate ZakFormElementValidatorIsNumberPrivate;
struct _ZakFormElementValidatorIsNumberPrivate
{
gboolean plusminus;
};
-G_DEFINE_TYPE (ZakFormElementValidatorIsNumber, zak_form_element_validator_is_number, ZAK_FORM_TYPE_ELEMENT_VALIDATOR)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakFormElementValidatorIsNumber, zak_form_element_validator_is_number, ZAK_FORM_TYPE_ELEMENT_VALIDATOR)
static void
zak_form_element_validator_is_number_class_init (ZakFormElementValidatorIsNumberClass *class)
parent_class->xml_parsing = zak_form_element_validator_is_number_xml_parsing;
parent_class->validate = zak_form_element_validator_is_number_validate;
parent_class->get_xml = zak_form_element_validator_is_number_get_xml;
-
- g_type_class_add_private (object_class, sizeof (ZakFormElementValidatorIsNumberPrivate));
}
static void
zak_form_element_validator_is_number_init (ZakFormElementValidatorIsNumber *zak_form_element)
{
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (zak_form_element);
priv->decimals_separator = ',';
priv->thousands_separator = '.';
void
zak_form_element_validator_is_number_set_decimals_separator (ZakFormElementValidatorIsNumber *validator, gchar decimals_separator)
{
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
priv->decimals_separator = decimals_separator;
}
gchar
zak_form_element_validator_is_number_get_decimals_separator (ZakFormElementValidatorIsNumber *validator)
{
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
return priv->decimals_separator;
}
void
zak_form_element_validator_is_number_set_thousands_separator (ZakFormElementValidatorIsNumber *validator, gchar thousands_separator)
{
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
priv->thousands_separator = thousands_separator;
}
gchar
zak_form_element_validator_is_number_get_thousands_separator (ZakFormElementValidatorIsNumber *validator)
{
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
return priv->thousands_separator;
}
void
zak_form_element_validator_is_number_set_plusminus (ZakFormElementValidatorIsNumber *validator, gboolean plusminus)
{
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
priv->plusminus = plusminus;
}
gboolean
zak_form_element_validator_is_number_get_plusminus (ZakFormElementValidatorIsNumber *validator)
{
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
return priv->plusminus;
}
{
gchar *prop;
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator));
prop = (gchar *)xmlGetProp (xnode, (const xmlChar *)"thousands_separator");
if (prop != NULL)
GParamSpec *pspec)
{
ZakFormElementValidatorIsNumber *zak_form_element = (ZakFormElementValidatorIsNumber *)object;
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (zak_form_element);
switch (property_id)
{
GParamSpec *pspec)
{
ZakFormElementValidatorIsNumber *zak_form_element = (ZakFormElementValidatorIsNumber *)object;
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (zak_form_element);
switch (property_id)
{
zak_form_element_validator_is_number_dispose (GObject *gobject)
{
ZakFormElementValidatorIsNumber *zak_form_element = (ZakFormElementValidatorIsNumber *)gobject;
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (zak_form_element);
zak_form_element_validator_is_number_finalize (GObject *gobject)
{
ZakFormElementValidatorIsNumber *zak_form_element = (ZakFormElementValidatorIsNumber *)gobject;
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (zak_form_element);
GObjectClass *parent_class = g_type_class_peek_parent (G_OBJECT_GET_CLASS (gobject));
parent_class->finalize (gobject);
ZakFormElementValidatorRegex *validator;
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (validator_is_number);
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator_is_number));
g_return_val_if_fail (value != NULL, FALSE);
zak_form_element_validator_is_number_get_xml (ZakFormElementValidator *validator, xmlNode *xnode, const gchar *version)
{
ZakFormElementValidatorIsNumber *validator_isnumber = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER (validator);
- ZakFormElementValidatorIsNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_IS_NUMBER_GET_PRIVATE (validator_isnumber);
+ ZakFormElementValidatorIsNumberPrivate *priv = zak_form_element_validator_is_number_get_instance_private (validator_isnumber);
xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_element_validator_isnumber");
/* Other members, including private data. */
};
-#define ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_ELEMENT_VALIDATOR_NOTEMPTY, ZakFormElementValidatorNotemptyPrivate))
-
typedef struct _ZakFormElementValidatorNotemptyPrivate ZakFormElementValidatorNotemptyPrivate;
struct _ZakFormElementValidatorNotemptyPrivate
{
gchar *as_empty_string;
};
-G_DEFINE_TYPE (ZakFormElementValidatorNotempty, zak_form_element_validator_notempty, ZAK_FORM_TYPE_ELEMENT_VALIDATOR)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakFormElementValidatorNotempty, zak_form_element_validator_notempty, ZAK_FORM_TYPE_ELEMENT_VALIDATOR)
static void
zak_form_element_validator_notempty_class_init (ZakFormElementValidatorNotemptyClass *class)
parent_class->validate = zak_form_element_validator_notempty_validate;
parent_class->get_xml = zak_form_element_validator_notempty_get_xml;
- g_type_class_add_private (object_class, sizeof (ZakFormElementValidatorNotemptyPrivate));
-
g_object_class_install_property (object_class, PROP_AS_EMPTY_STRING,
g_param_spec_string ("as-empty-string",
"As empty string",
static void
zak_form_element_validator_notempty_init (ZakFormElementValidatorNotempty *zak_form_element)
{
- ZakFormElementValidatorNotemptyPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorNotemptyPrivate *priv = zak_form_element_validator_notempty_get_instance_private (zak_form_element);
}
/**
static gboolean
zak_form_element_validator_notempty_xml_parsing (ZakFormElementValidator *validator, xmlNode *xnode)
{
- ZakFormElementValidatorNotemptyPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY_GET_PRIVATE (validator);
+ ZakFormElementValidatorNotemptyPrivate *priv = zak_form_element_validator_notempty_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY (validator));
if (priv->as_empty_string != NULL)
{
void
zak_form_element_validator_notempty_set_as_empty_string (ZakFormElementValidatorNotempty *validator, const gchar *as_empty_string)
{
- ZakFormElementValidatorNotemptyPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY_GET_PRIVATE (validator);
+ ZakFormElementValidatorNotemptyPrivate *priv = zak_form_element_validator_notempty_get_instance_private (validator);
if (priv->as_empty_string != NULL)
{
gchar
*zak_form_element_validator_notempty_get_as_empty_string (ZakFormElementValidatorNotempty *validator)
{
- ZakFormElementValidatorNotemptyPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY_GET_PRIVATE (validator);
+ ZakFormElementValidatorNotemptyPrivate *priv = zak_form_element_validator_notempty_get_instance_private (validator);
return g_strdup (priv->as_empty_string);
}
GParamSpec *pspec)
{
ZakFormElementValidatorNotempty *validator = (ZakFormElementValidatorNotempty *)object;
- ZakFormElementValidatorNotemptyPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY_GET_PRIVATE (validator);
+ ZakFormElementValidatorNotemptyPrivate *priv = zak_form_element_validator_notempty_get_instance_private (validator);
switch (property_id)
{
GParamSpec *pspec)
{
ZakFormElementValidatorNotempty *validator = (ZakFormElementValidatorNotempty *)object;
- ZakFormElementValidatorNotemptyPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY_GET_PRIVATE (validator);
+ ZakFormElementValidatorNotemptyPrivate *priv = zak_form_element_validator_notempty_get_instance_private (validator);
switch (property_id)
{
zak_form_element_validator_notempty_dispose (GObject *gobject)
{
ZakFormElementValidatorNotempty *validator = (ZakFormElementValidatorNotempty *)gobject;
- ZakFormElementValidatorNotemptyPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY_GET_PRIVATE (validator);
+ ZakFormElementValidatorNotemptyPrivate *priv = zak_form_element_validator_notempty_get_instance_private (validator);
zak_form_element_validator_notempty_finalize (GObject *gobject)
{
ZakFormElementValidatorNotempty *validator = (ZakFormElementValidatorNotempty *)gobject;
- ZakFormElementValidatorNotemptyPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY_GET_PRIVATE (validator);
+ ZakFormElementValidatorNotemptyPrivate *priv = zak_form_element_validator_notempty_get_instance_private (validator);
{
gboolean ret;
- ZakFormElementValidatorNotemptyPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY_GET_PRIVATE (validator);
+ ZakFormElementValidatorNotemptyPrivate *priv = zak_form_element_validator_notempty_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY (validator));
g_return_val_if_fail (value != NULL, FALSE);
zak_form_element_validator_notempty_get_xml (ZakFormElementValidator *validator, xmlNode *xnode, const gchar *version)
{
ZakFormElementValidatorNotempty *validator_notempty = ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY (validator);
- ZakFormElementValidatorNotemptyPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NOTEMPTY_GET_PRIVATE (validator_notempty);
+ ZakFormElementValidatorNotemptyPrivate *priv = zak_form_element_validator_notempty_get_instance_private (validator_notempty);
xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_element_validator_notempty");
/* Other members, including private data. */
};
-#define ZAK_FORM_ELEMENT_VALIDATOR_NUMBER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_ELEMENT_VALIDATOR_NUMBER, ZakFormElementValidatorNumberPrivate))
-
typedef struct _ZakFormElementValidatorNumberPrivate ZakFormElementValidatorNumberPrivate;
struct _ZakFormElementValidatorNumberPrivate
{
gdouble compare_value;
};
-G_DEFINE_TYPE (ZakFormElementValidatorNumber, zak_form_element_validator_number, ZAK_FORM_TYPE_ELEMENT_VALIDATOR)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakFormElementValidatorNumber, zak_form_element_validator_number, ZAK_FORM_TYPE_ELEMENT_VALIDATOR)
static void
zak_form_element_validator_number_class_init (ZakFormElementValidatorNumberClass *class)
parent_class->xml_parsing = zak_form_element_validator_number_xml_parsing;
parent_class->validate = zak_form_element_validator_number_validate;
parent_class->get_xml = zak_form_element_validator_number_get_xml;
-
- g_type_class_add_private (object_class, sizeof (ZakFormElementValidatorNumberPrivate));
}
static void
zak_form_element_validator_number_init (ZakFormElementValidatorNumber *zak_form_element)
{
- ZakFormElementValidatorNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NUMBER_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorNumberPrivate *priv = zak_form_element_validator_number_get_instance_private (zak_form_element);
priv->compare_type = ZAK_FORM_COMPARE_TYPE_NONE;
priv->compare_value = 0.0;
void
zak_form_element_validator_number_set_compare_type (ZakFormElementValidatorNumber *validator, ZakFormCompareType type)
{
- ZakFormElementValidatorNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NUMBER_GET_PRIVATE (validator);
+ ZakFormElementValidatorNumberPrivate *priv = zak_form_element_validator_number_get_instance_private (validator);
priv->compare_type = type;
}
ZakFormCompareType
zak_form_element_validator_number_get_compare_type (ZakFormElementValidatorNumber *validator)
{
- ZakFormElementValidatorNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NUMBER_GET_PRIVATE (validator);
+ ZakFormElementValidatorNumberPrivate *priv = zak_form_element_validator_number_get_instance_private (validator);
return priv->compare_type;
}
void
zak_form_element_validator_number_set_compare_value (ZakFormElementValidatorNumber *validator, const gchar *value)
{
- ZakFormElementValidatorNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NUMBER_GET_PRIVATE (validator);
+ ZakFormElementValidatorNumberPrivate *priv = zak_form_element_validator_number_get_instance_private (validator);
if (value != NULL)
{
{
gchar *ret;
- ZakFormElementValidatorNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NUMBER_GET_PRIVATE (validator);
+ ZakFormElementValidatorNumberPrivate *priv = zak_form_element_validator_number_get_instance_private (validator);
ret = g_strdup_printf ("%f", priv->compare_value);
{
gchar *prop;
- ZakFormElementValidatorNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NUMBER_GET_PRIVATE (ZAK_FORM_ELEMENT_VALIDATOR_NUMBER (validator));
+ ZakFormElementValidatorNumberPrivate *priv = zak_form_element_validator_number_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_NUMBER (validator));
prop = (gchar *)xmlGetProp (xnode, (const xmlChar *)"type_comp");
zak_form_element_validator_number_set_compare_type (ZAK_FORM_ELEMENT_VALIDATOR_NUMBER (validator), zak_form_get_compare_type_from_string (prop));
GParamSpec *pspec)
{
ZakFormElementValidatorNumber *zak_form_element = (ZakFormElementValidatorNumber *)object;
- ZakFormElementValidatorNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NUMBER_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorNumberPrivate *priv = zak_form_element_validator_number_get_instance_private (zak_form_element);
switch (property_id)
{
GParamSpec *pspec)
{
ZakFormElementValidatorNumber *zak_form_element = (ZakFormElementValidatorNumber *)object;
- ZakFormElementValidatorNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NUMBER_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorNumberPrivate *priv = zak_form_element_validator_number_get_instance_private (zak_form_element);
switch (property_id)
{
zak_form_element_validator_number_dispose (GObject *gobject)
{
ZakFormElementValidatorNumber *zak_form_element = (ZakFormElementValidatorNumber *)gobject;
- ZakFormElementValidatorNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NUMBER_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorNumberPrivate *priv = zak_form_element_validator_number_get_instance_private (zak_form_element);
zak_form_element_validator_number_finalize (GObject *gobject)
{
ZakFormElementValidatorNumber *zak_form_element = (ZakFormElementValidatorNumber *)gobject;
- ZakFormElementValidatorNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NUMBER_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorNumberPrivate *priv = zak_form_element_validator_number_get_instance_private (zak_form_element);
GObjectClass *parent_class = g_type_class_peek_parent (G_OBJECT_GET_CLASS (gobject));
parent_class->finalize (gobject);
gchar *msg;
- ZakFormElementValidatorNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NUMBER_GET_PRIVATE (validator_number);
+ ZakFormElementValidatorNumberPrivate *priv = zak_form_element_validator_number_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_NUMBER (validator_number));
g_return_val_if_fail (value != NULL, FALSE);
zak_form_element_validator_number_get_xml (ZakFormElementValidator *validator, xmlNode *xnode, const gchar *version)
{
ZakFormElementValidatorNumber *validator_number = ZAK_FORM_ELEMENT_VALIDATOR_NUMBER (validator);
- ZakFormElementValidatorNumberPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_NUMBER_GET_PRIVATE (validator_number);
+ ZakFormElementValidatorNumberPrivate *priv = zak_form_element_validator_number_get_instance_private (validator_number);
xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_element_validator_number");
/* Other members, including private data. */
};
-#define ZAK_FORM_ELEMENT_VALIDATOR_REGEX_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_ELEMENT_VALIDATOR_REGEX, ZakFormElementValidatorRegexPrivate))
-
typedef struct _ZakFormElementValidatorRegexPrivate ZakFormElementValidatorRegexPrivate;
struct _ZakFormElementValidatorRegexPrivate
{
gchar *regex;
};
-G_DEFINE_TYPE (ZakFormElementValidatorRegex, zak_form_element_validator_regex, ZAK_FORM_TYPE_ELEMENT_VALIDATOR)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakFormElementValidatorRegex, zak_form_element_validator_regex, ZAK_FORM_TYPE_ELEMENT_VALIDATOR)
static void
zak_form_element_validator_regex_class_init (ZakFormElementValidatorRegexClass *class)
parent_class->validate = zak_form_element_validator_regex_validate;
parent_class->get_xml = zak_form_element_validator_regex_get_xml;
- g_type_class_add_private (object_class, sizeof (ZakFormElementValidatorRegexPrivate));
-
g_object_class_install_property (object_class, PROP_REGEX,
g_param_spec_string ("regex",
"Regex",
static void
zak_form_element_validator_regex_init (ZakFormElementValidatorRegex *zak_form_element)
{
- ZakFormElementValidatorRegexPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_REGEX_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorRegexPrivate *priv = zak_form_element_validator_regex_get_instance_private (zak_form_element);
priv->regex = NULL;
}
zak_form_element_validator_regex = ZAK_FORM_ELEMENT_VALIDATOR_REGEX (g_object_new (zak_form_element_validator_regex_get_type (), NULL));
- ZakFormElementValidatorRegexPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_REGEX_GET_PRIVATE (zak_form_element_validator_regex);
+ ZakFormElementValidatorRegexPrivate *priv = zak_form_element_validator_regex_get_instance_private (zak_form_element_validator_regex);
return zak_form_element_validator_regex;
}
void
zak_form_element_validator_regex_set_regex (ZakFormElementValidatorRegex *validator, const gchar *regex)
{
- ZakFormElementValidatorRegexPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_REGEX_GET_PRIVATE (validator);
+ ZakFormElementValidatorRegexPrivate *priv = zak_form_element_validator_regex_get_instance_private (validator);
if (priv->regex != NULL)
{
gchar
*zak_form_element_validator_regex_get_regex (ZakFormElementValidatorRegex *validator)
{
- ZakFormElementValidatorRegexPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_REGEX_GET_PRIVATE (validator);
+ ZakFormElementValidatorRegexPrivate *priv = zak_form_element_validator_regex_get_instance_private (validator);
return g_strdup (priv->regex);
}
GParamSpec *pspec)
{
ZakFormElementValidatorRegex *zak_form_element = (ZakFormElementValidatorRegex *)object;
- ZakFormElementValidatorRegexPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_REGEX_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorRegexPrivate *priv = zak_form_element_validator_regex_get_instance_private (zak_form_element);
switch (property_id)
{
GParamSpec *pspec)
{
ZakFormElementValidatorRegex *zak_form_element = (ZakFormElementValidatorRegex *)object;
- ZakFormElementValidatorRegexPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_REGEX_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorRegexPrivate *priv = zak_form_element_validator_regex_get_instance_private (zak_form_element);
switch (property_id)
{
zak_form_element_validator_regex_dispose (GObject *gobject)
{
ZakFormElementValidatorRegex *zak_form_element = (ZakFormElementValidatorRegex *)gobject;
- ZakFormElementValidatorRegexPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_REGEX_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorRegexPrivate *priv = zak_form_element_validator_regex_get_instance_private (zak_form_element);
zak_form_element_validator_regex_finalize (GObject *gobject)
{
ZakFormElementValidatorRegex *zak_form_element = (ZakFormElementValidatorRegex *)gobject;
- ZakFormElementValidatorRegexPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_REGEX_GET_PRIVATE (zak_form_element);
+ ZakFormElementValidatorRegexPrivate *priv = zak_form_element_validator_regex_get_instance_private (zak_form_element);
g_return_val_if_fail (value != NULL, FALSE);
- ZakFormElementValidatorRegexPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_REGEX_GET_PRIVATE (validator_regex);
+ ZakFormElementValidatorRegexPrivate *priv = zak_form_element_validator_regex_get_instance_private (ZAK_FORM_ELEMENT_VALIDATOR_REGEX (validator_regex));
if (priv->regex == NULL)
{
zak_form_element_validator_regex_get_xml (ZakFormElementValidator *validator, xmlNode *xnode, const gchar *version)
{
ZakFormElementValidatorRegex *validator_regex = ZAK_FORM_ELEMENT_VALIDATOR_REGEX (validator);
- ZakFormElementValidatorRegexPrivate *priv = ZAK_FORM_ELEMENT_VALIDATOR_REGEX_GET_PRIVATE (validator_regex);
+ ZakFormElementValidatorRegexPrivate *priv = zak_form_element_validator_regex_get_instance_private (validator_regex);
xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_element_validator_regex");
/* Other members, including private data. */
};
-#define ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_VALIDATOR_COMPARE, ZakFormValidatorComparePrivate))
-
typedef struct _ZakFormValidatorComparePrivate ZakFormValidatorComparePrivate;
struct _ZakFormValidatorComparePrivate
{
ZakFormElement *v2;
};
-G_DEFINE_TYPE (ZakFormValidatorCompare, zak_form_validator_compare, ZAK_FORM_TYPE_VALIDATOR)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakFormValidatorCompare, zak_form_validator_compare, ZAK_FORM_TYPE_VALIDATOR)
static void
zak_form_validator_compare_class_init (ZakFormValidatorCompareClass *class)
parent_class->xml_parsing = zak_form_validator_compare_xml_parsing;
parent_class->validate = zak_form_validator_compare_validate;
parent_class->get_xml = zak_form_validator_compare_get_xml;
-
- g_type_class_add_private (object_class, sizeof (ZakFormValidatorComparePrivate));
}
static void
zak_form_validator_compare_init (ZakFormValidatorCompare *validator)
{
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (validator);
priv->v1 = NULL;
priv->v2 = NULL;
{
gchar *prop;
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (ZAK_FORM_VALIDATOR_COMPARE (validator));
prop = (gchar *)xmlGetProp (xnode, (const xmlChar *)"type_comp");
zak_form_validator_compare_set_compare_type ((ZakFormValidatorCompare *)validator, prop);
void
zak_form_validator_compare_set_compare_type (ZakFormValidatorCompare *validator, const gchar *type)
{
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (validator);
priv->type = zak_form_get_compare_type_from_string (type);
}
const gchar
*zak_form_validator_compare_get_compare_type (ZakFormValidatorCompare *validator)
{
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (validator);
zak_form_get_compare_type_stringify (priv->type);
}
void
zak_form_validator_compare_set_element1 (ZakFormValidatorCompare *validator, ZakFormForm *form, const gchar *element1)
{
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (validator);
priv->v1 = zak_form_form_get_element_by_id (form, element1);
if (!ZAK_FORM_IS_ELEMENT (priv->v1))
const gchar
*zak_form_validator_compare_get_element1 (ZakFormValidatorCompare *validator)
{
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (validator);
if (ZAK_FORM_IS_ELEMENT (priv->v1))
{
void
zak_form_validator_compare_set_element2 (ZakFormValidatorCompare *validator, ZakFormForm *form, const gchar *element2)
{
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (validator);
priv->v2 = zak_form_form_get_element_by_id (form, element2);
if (!ZAK_FORM_IS_ELEMENT (priv->v2))
const gchar
*zak_form_validator_compare_get_element2 (ZakFormValidatorCompare *validator)
{
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (validator);
if (ZAK_FORM_IS_ELEMENT (priv->v2))
{
GParamSpec *pspec)
{
ZakFormValidatorCompare *validator = (ZakFormValidatorCompare *)object;
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (validator);
switch (property_id)
{
GParamSpec *pspec)
{
ZakFormValidatorCompare *validator = (ZakFormValidatorCompare *)object;
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (validator);
switch (property_id)
{
zak_form_validator_compare_dispose (GObject *gobject)
{
ZakFormValidatorCompare *validator = (ZakFormValidatorCompare *)gobject;
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (validator);
zak_form_validator_compare_finalize (GObject *gobject)
{
ZakFormValidatorCompare *validator = (ZakFormValidatorCompare *)gobject;
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (validator);
gint comp;
gchar *msg;
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (ZAK_FORM_VALIDATOR_COMPARE (validator));
ret = FALSE;
zak_form_validator_compare_get_xml (ZakFormValidator *validator, xmlNode *xnode, const gchar *version)
{
ZakFormValidatorCompare *validator_compare = ZAK_FORM_VALIDATOR_COMPARE (validator);
- ZakFormValidatorComparePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_GET_PRIVATE (validator_compare);
+ ZakFormValidatorComparePrivate *priv = zak_form_validator_compare_get_instance_private (validator_compare);
xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_validator_compare");
/* Other members, including private data. */
};
-#define ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_VALIDATOR_COMPARE_DATE, ZakFormValidatorCompareDatePrivate))
-
typedef struct _ZakFormValidatorCompareDatePrivate ZakFormValidatorCompareDatePrivate;
struct _ZakFormValidatorCompareDatePrivate
{
gchar *format2;
};
-G_DEFINE_TYPE (ZakFormValidatorCompareDate, zak_form_validator_compare_date, ZAK_FORM_TYPE_VALIDATOR)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakFormValidatorCompareDate, zak_form_validator_compare_date, ZAK_FORM_TYPE_VALIDATOR)
static void
zak_form_validator_compare_date_class_init (ZakFormValidatorCompareDateClass *class)
parent_class->xml_parsing = zak_form_validator_compare_date_xml_parsing;
parent_class->validate = zak_form_validator_compare_date_validate;
parent_class->get_xml = zak_form_validator_compare_date_get_xml;
-
- g_type_class_add_private (object_class, sizeof (ZakFormValidatorCompareDatePrivate));
}
static void
zak_form_validator_compare_date_init (ZakFormValidatorCompareDate *validator)
{
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
priv->v1 = NULL;
priv->v2 = NULL;
gchar *prop;
gchar *prop2;
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (ZAK_FORM_VALIDATOR_COMPARE_DATE (validator));
prop = (gchar *)xmlGetProp (xnode, (const xmlChar *)"type_comp");
zak_form_validator_compare_date_set_compare_type ((ZakFormValidatorCompareDate *)validator, prop);
void
zak_form_validator_compare_date_set_compare_type (ZakFormValidatorCompareDate *validator, const gchar *type)
{
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
priv->type = zak_form_get_compare_type_from_string (type);
}
const gchar
*zak_form_validator_compare_date_get_compare_type (ZakFormValidatorCompareDate *validator)
{
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
zak_form_get_compare_type_stringify (priv->type);
}
void
zak_form_validator_compare_date_set_element1 (ZakFormValidatorCompareDate *validator, ZakFormForm *form, const gchar *element1, const gchar *format1)
{
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
priv->v1 = zak_form_form_get_element_by_id (form, element1);
if (!ZAK_FORM_IS_ELEMENT (priv->v1))
const gchar
*zak_form_validator_compare_date_get_element1 (ZakFormValidatorCompareDate *validator)
{
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
if (ZAK_FORM_IS_ELEMENT (priv->v2))
{
const gchar
*zak_form_validator_compare_date_get_element1_format (ZakFormValidatorCompareDate *validator)
{
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
return g_strdup (priv->format1);
}
void
zak_form_validator_compare_date_set_element2 (ZakFormValidatorCompareDate *validator, ZakFormForm *form, const gchar *element2, const gchar *format2)
{
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
priv->v2 = zak_form_form_get_element_by_id (form, element2);
if (!ZAK_FORM_IS_ELEMENT (priv->v2))
const gchar
*zak_form_validator_compare_date_get_element2 (ZakFormValidatorCompareDate *validator)
{
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
if (ZAK_FORM_IS_ELEMENT (priv->v2))
{
const gchar
*zak_form_validator_compare_date_get_element2_format (ZakFormValidatorCompareDate *validator)
{
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
return g_strdup (priv->format2);
}
GParamSpec *pspec)
{
ZakFormValidatorCompareDate *validator = (ZakFormValidatorCompareDate *)object;
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
switch (property_id)
{
GParamSpec *pspec)
{
ZakFormValidatorCompareDate *validator = (ZakFormValidatorCompareDate *)object;
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
switch (property_id)
{
zak_form_validator_compare_date_dispose (GObject *gobject)
{
ZakFormValidatorCompareDate *validator = (ZakFormValidatorCompareDate *)gobject;
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
zak_form_validator_compare_date_finalize (GObject *gobject)
{
ZakFormValidatorCompareDate *validator = (ZakFormValidatorCompareDate *)gobject;
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator);
gint comp;
gchar *msg;
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (ZAK_FORM_VALIDATOR_COMPARE_DATE (validator));
ret = FALSE;
zak_form_validator_compare_date_get_xml (ZakFormValidator *validator, xmlNode *xnode, const gchar *version)
{
ZakFormValidatorCompareDate *validator_compare_date = ZAK_FORM_VALIDATOR_COMPARE_DATE (validator);
- ZakFormValidatorCompareDatePrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_DATE_GET_PRIVATE (validator_compare_date);
+ ZakFormValidatorCompareDatePrivate *priv = zak_form_validator_compare_date_get_instance_private (validator_compare_date);
xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_validator_compare_date");
/* Other members, including private data. */
};
-#define ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_VALIDATOR_COMPARE_NUMBER, ZakFormValidatorCompareNumberPrivate))
-
typedef struct _ZakFormValidatorCompareNumberPrivate ZakFormValidatorCompareNumberPrivate;
struct _ZakFormValidatorCompareNumberPrivate
{
ZakFormElement *v2;
};
-G_DEFINE_TYPE (ZakFormValidatorCompareNumber, zak_form_validator_compare_number, ZAK_FORM_TYPE_VALIDATOR)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakFormValidatorCompareNumber, zak_form_validator_compare_number, ZAK_FORM_TYPE_VALIDATOR)
static void
zak_form_validator_compare_number_class_init (ZakFormValidatorCompareNumberClass *class)
parent_class->xml_parsing = zak_form_validator_compare_number_xml_parsing;
parent_class->validate = zak_form_validator_compare_number_validate;
parent_class->get_xml = zak_form_validator_compare_number_get_xml;
-
- g_type_class_add_private (object_class, sizeof (ZakFormValidatorCompareNumberPrivate));
}
static void
zak_form_validator_compare_number_init (ZakFormValidatorCompareNumber *validator)
{
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (validator);
priv->v1 = NULL;
priv->v2 = NULL;
{
gchar *prop;
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (ZAK_FORM_VALIDATOR_COMPARE_NUMBER (validator));
prop = (gchar *)xmlGetProp (xnode, (const xmlChar *)"type_comp");
zak_form_validator_compare_number_set_compare_type ((ZakFormValidatorCompareNumber *)validator, prop);
void
zak_form_validator_compare_number_set_compare_type (ZakFormValidatorCompareNumber *validator, const gchar *type)
{
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (validator);
priv->type = zak_form_get_compare_type_from_string (type);
}
const gchar
*zak_form_validator_compare_number_get_compare_type (ZakFormValidatorCompareNumber *validator)
{
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (validator);
zak_form_get_compare_type_stringify (priv->type);
}
void
zak_form_validator_compare_number_set_element1 (ZakFormValidatorCompareNumber *validator, ZakFormForm *form, const gchar *element1)
{
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (validator);
priv->v1 = zak_form_form_get_element_by_id (form, element1);
if (!ZAK_FORM_IS_ELEMENT (priv->v1))
const gchar
*zak_form_validator_compare_number_get_element1 (ZakFormValidatorCompareNumber *validator)
{
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (validator);
if (ZAK_FORM_IS_ELEMENT (priv->v2))
{
void
zak_form_validator_compare_number_set_element2 (ZakFormValidatorCompareNumber *validator, ZakFormForm *form, const gchar *element2)
{
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (validator);
priv->v2 = zak_form_form_get_element_by_id (form, element2);
if (!ZAK_FORM_IS_ELEMENT (priv->v2))
const gchar
*zak_form_validator_compare_number_get_element2 (ZakFormValidatorCompareNumber *validator)
{
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (validator);
if (ZAK_FORM_IS_ELEMENT (priv->v2))
{
GParamSpec *pspec)
{
ZakFormValidatorCompareNumber *validator = (ZakFormValidatorCompareNumber *)object;
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (validator);
switch (property_id)
{
GParamSpec *pspec)
{
ZakFormValidatorCompareNumber *validator = (ZakFormValidatorCompareNumber *)object;
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (validator);
switch (property_id)
{
zak_form_validator_compare_number_dispose (GObject *gobject)
{
ZakFormValidatorCompareNumber *validator = (ZakFormValidatorCompareNumber *)gobject;
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (validator);
zak_form_validator_compare_number_finalize (GObject *gobject)
{
ZakFormValidatorCompareNumber *validator = (ZakFormValidatorCompareNumber *)gobject;
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (validator);
gint comp;
gchar *msg;
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (ZAK_FORM_VALIDATOR_COMPARE_NUMBER (validator));
ret = FALSE;
zak_form_validator_compare_number_get_xml (ZakFormValidator *validator, xmlNode *xnode, const gchar *version)
{
ZakFormValidatorCompareNumber *validator_compare_number = ZAK_FORM_VALIDATOR_COMPARE_NUMBER (validator);
- ZakFormValidatorCompareNumberPrivate *priv = ZAK_FORM_VALIDATOR_COMPARE_NUMBER_GET_PRIVATE (validator_compare_number);
+ ZakFormValidatorCompareNumberPrivate *priv = zak_form_validator_compare_number_get_instance_private (validator_compare_number);
xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_validator_compare_number");
/* Other members, including private data. */
};
-#define ZAK_FORM_VALIDATOR_COMPOSITE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_TYPE_VALIDATOR_COMPOSITE, ZakFormValidatorCompositePrivate))
-
typedef struct _ZakFormValidatorCompositePrivate ZakFormValidatorCompositePrivate;
struct _ZakFormValidatorCompositePrivate
{
GNode *tree;
};
-G_DEFINE_TYPE (ZakFormValidatorComposite, zak_form_validator_composite, ZAK_FORM_TYPE_VALIDATOR)
+G_DEFINE_TYPE_WITH_PRIVATE (ZakFormValidatorComposite, zak_form_validator_composite, ZAK_FORM_TYPE_VALIDATOR)
typedef enum
{
parent_class->xml_parsing = zak_form_validator_composite_xml_parsing;
parent_class->validate = zak_form_validator_composite_validate;
-
- g_type_class_add_private (object_class, sizeof (ZakFormValidatorCompositePrivate));
}
static void
zak_form_validator_composite_init (ZakFormValidatorComposite *validator)
{
- ZakFormValidatorCompositePrivate *priv = ZAK_FORM_VALIDATOR_COMPOSITE_GET_PRIVATE (validator);
+ ZakFormValidatorCompositePrivate *priv = zak_form_validator_composite_get_instance_private (validator);
priv->tree = NULL;
}
{
xmlNode *cur;
- ZakFormValidatorCompositePrivate *priv = ZAK_FORM_VALIDATOR_COMPOSITE_GET_PRIVATE (validator);
+ ZakFormValidatorCompositePrivate *priv = zak_form_validator_composite_get_instance_private (ZAK_FORM_VALIDATOR_COMPOSITE (validator));
cur = xnode->children;
while (cur)
zak_form_validator_composite_xml_parsing (ZakFormValidator *validator, xmlNode *xnode, gpointer form)
{
- ZakFormValidatorCompositePrivate *priv = ZAK_FORM_VALIDATOR_COMPOSITE_GET_PRIVATE (validator);
+ ZakFormValidatorCompositePrivate *priv = zak_form_validator_composite_get_instance_private (ZAK_FORM_VALIDATOR_COMPOSITE (validator));
_zak_form_validator_composite_xml_parsing (validator, xnode, (ZakFormForm *)form, NULL);
GParamSpec *pspec)
{
ZakFormValidatorComposite *validator = (ZakFormValidatorComposite *)object;
- ZakFormValidatorCompositePrivate *priv = ZAK_FORM_VALIDATOR_COMPOSITE_GET_PRIVATE (validator);
+ ZakFormValidatorCompositePrivate *priv = zak_form_validator_composite_get_instance_private (validator);
switch (property_id)
{
GParamSpec *pspec)
{
ZakFormValidatorComposite *validator = (ZakFormValidatorComposite *)object;
- ZakFormValidatorCompositePrivate *priv = ZAK_FORM_VALIDATOR_COMPOSITE_GET_PRIVATE (validator);
+ ZakFormValidatorCompositePrivate *priv = zak_form_validator_composite_get_instance_private (validator);
switch (property_id)
{
zak_form_validator_composite_dispose (GObject *gobject)
{
ZakFormValidatorComposite *validator = (ZakFormValidatorComposite *)gobject;
- ZakFormValidatorCompositePrivate *priv = ZAK_FORM_VALIDATOR_COMPOSITE_GET_PRIVATE (validator);
+ ZakFormValidatorCompositePrivate *priv = zak_form_validator_composite_get_instance_private (validator);
zak_form_validator_composite_finalize (GObject *gobject)
{
ZakFormValidatorComposite *validator = (ZakFormValidatorComposite *)gobject;
- ZakFormValidatorCompositePrivate *priv = ZAK_FORM_VALIDATOR_COMPOSITE_GET_PRIVATE (validator);
+ ZakFormValidatorCompositePrivate *priv = zak_form_validator_composite_get_instance_private (validator);
{
gboolean ret;
- ZakFormValidatorCompositePrivate *priv = ZAK_FORM_VALIDATOR_COMPOSITE_GET_PRIVATE (validator);
+ ZakFormValidatorCompositePrivate *priv = zak_form_validator_composite_get_instance_private (ZAK_FORM_VALIDATOR_COMPOSITE (validator));
if (priv->tree != NULL)
{