static void zak_form_gtk_form_element_set_editable (ZakFormGtkFormElement *element, gboolean visible);
static void zak_form_gtk_form_element_xml_parsing (ZakFormElement *element, xmlNode *xmlnode);
+static void zak_form_gtk_form_element_get_xml (ZakFormGtkFormElement *element, xmlNode *xroot, const gchar *version);
#define ZAK_FORM_GTK_FORM_ELEMENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_GTK_TYPE_FORM_ELEMENT, ZakFormGtkFormElementPrivate))
parent_class->set_visible = zak_form_gtk_form_element_set_visible;
parent_class->get_editable = zak_form_gtk_form_element_get_editable;
parent_class->set_editable = zak_form_gtk_form_element_set_editable;
+ parent_class->get_xml = zak_form_gtk_form_element_get_xml;
g_type_class_add_private (object_class, sizeof (ZakFormGtkFormElementPrivate));
cur = cur->next;
}
}
+
+static void
+zak_form_gtk_form_element_get_xml (ZakFormGtkFormElement *element, xmlNode *xroot, const gchar *version)
+{
+ xmlNode *xnode;
+
+ ZakFormGtkFormElementPrivate *priv = ZAK_FORM_GTK_FORM_ELEMENT_GET_PRIVATE ((ZakFormGtkFormElement *)element);
+
+ xnode = xmlNewNode (NULL, (const xmlChar *)"widget");
+ xmlNodeSetContent (xnode, (xmlChar *)zak_form_gtk_form_element_get_widget_name (element));
+ xmlAddChild (xroot, xnode);
+
+ xnode = xmlNewNode (NULL, (const xmlChar *)"label");
+ xmlNodeSetContent (xnode, (xmlChar *)zak_form_gtk_form_element_get_label_name (element));
+ xmlAddChild (xroot, xnode);
+
+ if (ZAK_FORM_GTK_FORM_ELEMENT_GET_CLASS (element)->get_xml!= NULL)
+ {
+ ZAK_FORM_GTK_FORM_ELEMENT_GET_CLASS (element)->get_xml (element, version, xroot);
+ }
+}
ZakFormElementClass parent_class;
void (*xml_parsing) (ZakFormElement *element, xmlNode *xmlnode);
+
+ void (*get_xml) (ZakFormElement *element, xmlNode *xroot, const gchar *version);
};
/*
- * Copyright (C) 2015-2017 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2020 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
static GValue *zak_form_gtk_form_element_check_get_value (ZakFormGtkFormElementCheck *element);
static gboolean zak_form_gtk_form_element_check_set_value (ZakFormGtkFormElementCheck *element, GValue *value);
+static void zak_form_gtk_form_element_check_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode);
+
#define ZAK_FORM_GTK_FORM_ELEMENT_CHECK_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_GTK_TYPE_FORM_ELEMENT_CHECK, ZakFormGtkFormElementCheckPrivate))
typedef struct _ZakFormGtkFormElementCheckPrivate ZakFormGtkFormElementCheckPrivate;
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ZakFormElementClass *elem_class = ZAK_FORM_ELEMENT_CLASS (klass);
+ ZakFormGtkFormElementClass *gtk_elem_class = ZAK_FORM_GTK_FORM_ELEMENT_CLASS (klass);
object_class->set_property = zak_form_gtk_form_element_check_set_property;
object_class->get_property = zak_form_gtk_form_element_check_get_property;
elem_class->xml_parsing = zak_form_gtk_form_element_check_xml_parsing;
+ gtk_elem_class->get_xml = zak_form_gtk_form_element_check_get_xml;
+
g_type_class_add_private (object_class, sizeof (ZakFormGtkFormElementCheckPrivate));
}
return TRUE;
}
+
+static void
+zak_form_gtk_form_element_check_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode)
+{
+ xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_gtk_form_element_check");
+}
/*
- * Copyright (C) 2016-2017 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2016-2020 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
static GValue *zak_form_gtk_form_element_combo_get_value (ZakFormGtkFormElementCombo *element);
static gboolean zak_form_gtk_form_element_combo_set_value (ZakFormGtkFormElementCombo *element, GValue *value);
+static void zak_form_gtk_form_element_combo_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode);
+
#define ZAK_FORM_GTK_FORM_ELEMENT_COMBO_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_GTK_TYPE_FORM_ELEMENT_COMBO, ZakFormGtkFormElementComboPrivate))
typedef struct _ZakFormGtkFormElementComboPrivate ZakFormGtkFormElementComboPrivate;
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ZakFormElementClass *elem_class = ZAK_FORM_ELEMENT_CLASS (klass);
+ ZakFormGtkFormElementClass *gtk_elem_class = ZAK_FORM_GTK_FORM_ELEMENT_CLASS (klass);
object_class->set_property = zak_form_gtk_form_element_combo_set_property;
object_class->get_property = zak_form_gtk_form_element_combo_get_property;
elem_class->xml_parsing = zak_form_gtk_form_element_combo_xml_parsing;
+ gtk_elem_class->get_xml = zak_form_gtk_form_element_combo_get_xml;
+
g_type_class_add_private (object_class, sizeof (ZakFormGtkFormElementComboPrivate));
g_object_class_install_property (object_class, PROP_COLUMN_FIELD,
return TRUE;
}
+
+static void
+zak_form_gtk_form_element_combo_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode)
+{
+ xmlNode *xnode_cur;
+
+ xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_gtk_form_element_combo");
+
+ xnode_cur = xmlNewNode (NULL, (const xmlChar *)"column-field");
+ xmlNodeSetContent (xnode_cur, (xmlChar *)g_strdup_printf ("%d", zak_form_gtk_form_element_combo_get_column_field (element)));
+ xmlAddChild (xnode, xnode_cur);
+}
/*
- * Copyright (C) 2015-2017 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2020 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
static GValue *zak_form_gtk_form_element_entry_get_value (ZakFormGtkFormElementEntry *element);
static gboolean zak_form_gtk_form_element_entry_set_value (ZakFormGtkFormElementEntry *element, GValue *value);
+static void zak_form_gtk_form_element_entry_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode);
+
#define ZAK_FORM_GTK_FORM_ELEMENT_ENTRY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_GTK_TYPE_FORM_ELEMENT_ENTRY, ZakFormGtkFormElementEntryPrivate))
typedef struct _ZakFormGtkFormElementEntryPrivate ZakFormGtkFormElementEntryPrivate;
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ZakFormElementClass *elem_class = ZAK_FORM_ELEMENT_CLASS (klass);
+ ZakFormGtkFormElementClass *gtk_elem_class = ZAK_FORM_ELEMENT_CLASS (klass);
object_class->set_property = zak_form_gtk_form_element_entry_set_property;
object_class->get_property = zak_form_gtk_form_element_entry_get_property;
elem_class->xml_parsing = zak_form_gtk_form_element_entry_xml_parsing;
+ gtk_elem_class->get_xml = zak_form_gtk_form_element_entry_get_xml;
+
g_type_class_add_private (object_class, sizeof (ZakFormGtkFormElementEntryPrivate));
}
return TRUE;
}
+
+static void
+zak_form_gtk_form_element_entry_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode)
+{
+ xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_gtk_form_element_entry");
+}
static GValue *zak_form_gtk_form_element_label_get_value (ZakFormGtkFormElementLabel *element);
static gboolean zak_form_gtk_form_element_label_set_value (ZakFormGtkFormElementLabel *element, GValue *value);
+static void zak_form_gtk_form_element_label_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode);
+
#define ZAK_FORM_GTK_FORM_ELEMENT_LABEL_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_GTK_TYPE_FORM_ELEMENT_LABEL, ZakFormGtkFormElementLabelPrivate))
typedef struct _ZakFormGtkFormElementLabelPrivate ZakFormGtkFormElementLabelPrivate;
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ZakFormElementClass *elem_class = ZAK_FORM_ELEMENT_CLASS (klass);
+ ZakFormGtkFormElementClass *gtk_elem_class = ZAK_FORM_GTK_FORM_ELEMENT_CLASS (klass);
object_class->set_property = zak_form_gtk_form_element_label_set_property;
object_class->get_property = zak_form_gtk_form_element_label_get_property;
elem_class->xml_parsing = zak_form_gtk_form_element_label_xml_parsing;
+ gtk_elem_class->get_xml = zak_form_gtk_form_element_label_get_xml;
+
g_type_class_add_private (object_class, sizeof (ZakFormGtkFormElementLabelPrivate));
}
return TRUE;
}
+
+static void
+zak_form_gtk_form_element_label_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode)
+{
+ xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_gtk_form_element_label");
+}
/*
- * Copyright (C) 2015-2017 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2020 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
static GValue *zak_form_gtk_form_element_radio_get_value (ZakFormGtkFormElementRadio *element);
static gboolean zak_form_gtk_form_element_radio_set_value (ZakFormGtkFormElementRadio *element, GValue *value);
+static void zak_form_gtk_form_element_radio_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode);
+
#define ZAK_FORM_GTK_FORM_ELEMENT_RADIO_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_GTK_TYPE_FORM_ELEMENT_RADIO, ZakFormGtkFormElementRadioPrivate))
typedef struct _ZakFormGtkFormElementRadioPrivate ZakFormGtkFormElementRadioPrivate;
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ZakFormElementClass *elem_class = ZAK_FORM_ELEMENT_CLASS (klass);
+ ZakFormGtkFormElementClass *gtk_elem_class = ZAK_FORM_GTK_FORM_ELEMENT_CLASS (klass);
object_class->set_property = zak_form_gtk_form_element_radio_set_property;
object_class->get_property = zak_form_gtk_form_element_radio_get_property;
elem_class->xml_parsing = zak_form_gtk_form_element_radio_xml_parsing;
+ gtk_elem_class->get_xml = zak_form_gtk_form_element_radio_get_xml;
+
g_type_class_add_private (object_class, sizeof (ZakFormGtkFormElementRadioPrivate));
g_object_class_install_property (object_class, PROP_RETURN_VALUE,
return TRUE;
}
+
+static void
+zak_form_gtk_form_element_radio_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode)
+{
+ xmlNode *xnode_cur;
+
+ xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_gtk_form_element_radio");
+
+ xnode_cur = xmlNewNode (NULL, (const xmlChar *)"return-value");
+ xmlNodeSetContent (xnode_cur, (xmlChar *)zak_form_gtk_form_element_radio_get_return_value (element));
+ xmlAddChild (xnode, xnode_cur);
+}
/*
- * Copyright (C) 2015-2017 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2020 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
static GValue *zak_form_gtk_form_element_spin_get_value (ZakFormGtkFormElementSpin *element);
static gboolean zak_form_gtk_form_element_spin_set_value (ZakFormGtkFormElementSpin *element, GValue *value);
+static void zak_form_gtk_form_element_spin_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode);
+
#define ZAK_FORM_GTK_FORM_ELEMENT_SPIN_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_GTK_TYPE_FORM_ELEMENT_SPIN, ZakFormGtkFormElementSpinPrivate))
typedef struct _ZakFormGtkFormElementSpinPrivate ZakFormGtkFormElementSpinPrivate;
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ZakFormElementClass *elem_class = ZAK_FORM_ELEMENT_CLASS (klass);
+ ZakFormGtkFormElementClass *gtk_elem_class = ZAK_FORM_GTK_FORM_ELEMENT_CLASS (klass);
object_class->set_property = zak_form_gtk_form_element_spin_set_property;
object_class->get_property = zak_form_gtk_form_element_spin_get_property;
elem_class->xml_parsing = zak_form_gtk_form_element_spin_xml_parsing;
+ gtk_elem_class->get_xml = zak_form_gtk_form_element_spin_get_xml;
+
g_type_class_add_private (object_class, sizeof (ZakFormGtkFormElementSpinPrivate));
}
return TRUE;
}
+
+static void
+zak_form_gtk_form_element_spin_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode)
+{
+ xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_gtk_form_element_spin");
+}
/*
- * Copyright (C) 2015-2017 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2015-2020 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
static GValue *zak_form_gtk_form_element_textview_get_value (ZakFormGtkFormElementTextview *element);
static gboolean zak_form_gtk_form_element_textview_set_value (ZakFormGtkFormElementTextview *element, GValue *value);
+static void zak_form_gtk_form_element_textview_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode);
+
#define ZAK_FORM_GTK_FORM_ELEMENT_TEXTVIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_FORM_GTK_TYPE_FORM_ELEMENT_TEXTVIEW, ZakFormGtkFormElementTextviewPrivate))
typedef struct _ZakFormGtkFormElementTextviewPrivate ZakFormGtkFormElementTextviewPrivate;
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ZakFormElementClass *elem_class = ZAK_FORM_ELEMENT_CLASS (klass);
+ ZakFormGtkFormElementClass *gtk_elem_class = ZAK_FORM_GTK_FORM_ELEMENT_CLASS (klass);
object_class->set_property = zak_form_gtk_form_element_textview_set_property;
object_class->get_property = zak_form_gtk_form_element_textview_get_property;
elem_class->xml_parsing = zak_form_gtk_form_element_textview_xml_parsing;
+ gtk_elem_class->get_xml = zak_form_gtk_form_element_textview_get_xml;
+
g_type_class_add_private (object_class, sizeof (ZakFormGtkFormElementTextviewPrivate));
}
return TRUE;
}
+
+static void
+zak_form_gtk_form_element_textview_get_xml (ZakFormGtkFormElement *element, const gchar *version, xmlNode *xnode)
+{
+ xmlSetProp (xnode, (const xmlChar *)"type", (const xmlChar *)"zak_form_gtk_form_element_textview");
+}