From: Andrea Zagli Date: Sun, 7 Feb 2016 16:59:56 +0000 (+0100) Subject: Missing xml parsing from parent ZakFormElement. X-Git-Tag: v0.1.0~3^2~15 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=943502e11bb089ddaa31674bba99867f936d4d21;p=libzakcgi Missing xml parsing from parent ZakFormElement. --- diff --git a/src/formelement.c b/src/formelement.c index 2f0e21d..f2f07fb 100644 --- a/src/formelement.c +++ b/src/formelement.c @@ -50,6 +50,8 @@ static void zak_cgi_form_element_get_property (GObject *object, static void zak_cgi_form_element_dispose (GObject *gobject); static void zak_cgi_form_element_finalize (GObject *gobject); +static void zak_cgi_form_element_xml_parsing (ZakFormElement *element, xmlNode *xmlnode); + #define ZAK_CGI_FORM_ELEMENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_CGI_TYPE_FORM_ELEMENT, ZakCgiFormElementPrivate)) typedef struct _ZakCgiFormElementPrivate ZakCgiFormElementPrivate; @@ -72,6 +74,8 @@ zak_cgi_form_element_class_init (ZakCgiFormElementClass *class) object_class->dispose = zak_cgi_form_element_dispose; object_class->finalize = zak_cgi_form_element_finalize; + class->xml_parsing = zak_cgi_form_element_xml_parsing; + g_type_class_add_private (object_class, sizeof (ZakCgiFormElementPrivate)); class->construct = zak_cgi_form_element_construct; @@ -303,3 +307,9 @@ zak_cgi_form_element_finalize (GObject *gobject) GObjectClass *parent_class = g_type_class_peek_parent (G_OBJECT_GET_CLASS (gobject)); parent_class->finalize (gobject); } + +static void +zak_cgi_form_element_xml_parsing (ZakFormElement *element, xmlNode *xmlnode) +{ + ZAK_FORM_ELEMENT_GET_CLASS (element)->xml_parsing (element, xmlnode); +} diff --git a/src/formelement.h b/src/formelement.h index 6c1efd7..804021c 100644 --- a/src/formelement.h +++ b/src/formelement.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 Andrea Zagli + * Copyright (C) 2015-2016 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -40,6 +40,8 @@ struct _ZakCgiFormElementClass void (*construct) (ZakCgiFormElement *element, const gchar *id, GHashTable *ht_attrs); GHashTable *(*get_ht_attrs) (ZakCgiFormElement *element); + void (*xml_parsing) (ZakFormElement *element, xmlNode *xmlnode); + gchar *(*render) (ZakCgiFormElement *element); }; diff --git a/src/formelementcheck.c b/src/formelementcheck.c index c436de2..e44ef33 100644 --- a/src/formelementcheck.c +++ b/src/formelementcheck.c @@ -135,6 +135,8 @@ zak_cgi_form_element_check_xml_parsing (ZakFormElement *element, xmlNodePtr xmln id = NULL; + ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_check_parent_class)->xml_parsing (element, xmlnode); + ht_attrs = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_replace (ht_attrs, "type", "checkbox"); diff --git a/src/formelementemail.c b/src/formelementemail.c index 9982f08..7916e11 100644 --- a/src/formelementemail.c +++ b/src/formelementemail.c @@ -133,6 +133,8 @@ zak_cgi_form_element_email_xml_parsing (ZakFormElement *element, xmlNodePtr xmln id = NULL; + ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_email_parent_class)->xml_parsing (element, xmlnode); + ht_attrs = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_replace (ht_attrs, "type", "email"); diff --git a/src/formelementhidden.c b/src/formelementhidden.c index 1d048cc..ab7a11d 100644 --- a/src/formelementhidden.c +++ b/src/formelementhidden.c @@ -134,6 +134,8 @@ zak_cgi_form_element_hidden_xml_parsing (ZakFormElement *element, xmlNodePtr xml id = NULL; + ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_hidden_parent_class)->xml_parsing (element, xmlnode); + ht_attrs = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_replace (ht_attrs, "type", "hidden"); diff --git a/src/formelementpassword.c b/src/formelementpassword.c index 3fc82d9..989676f 100644 --- a/src/formelementpassword.c +++ b/src/formelementpassword.c @@ -133,6 +133,8 @@ zak_cgi_form_element_password_xml_parsing (ZakFormElement *element, xmlNodePtr x id = NULL; + ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_password_parent_class)->xml_parsing (element, xmlnode); + ht_attrs = g_hash_table_new (g_str_hash, g_str_equal); g_hash_table_replace (ht_attrs, "type", "password"); diff --git a/src/formelementselect.c b/src/formelementselect.c index 48683ed..aeda57d 100644 --- a/src/formelementselect.c +++ b/src/formelementselect.c @@ -159,6 +159,8 @@ zak_cgi_form_element_select_xml_parsing (ZakFormElement *element, xmlNodePtr xml id = NULL; + ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_select_parent_class)->xml_parsing (element, xmlnode); + ht_attrs = g_hash_table_new (g_str_hash, g_str_equal); cur = xmlnode->children; diff --git a/src/formelementstring.c b/src/formelementstring.c index 64afea2..632a5ff 100644 --- a/src/formelementstring.c +++ b/src/formelementstring.c @@ -124,6 +124,8 @@ zak_cgi_form_element_string_xml_parsing (ZakFormElement *element, xmlNodePtr xml ret = FALSE; + ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_string_parent_class)->xml_parsing (element, xmlnode); + cur = xmlnode->children; while (cur != NULL) { diff --git a/src/formelementsubmit.c b/src/formelementsubmit.c index 27d1508..61c0815 100644 --- a/src/formelementsubmit.c +++ b/src/formelementsubmit.c @@ -128,6 +128,8 @@ zak_cgi_form_element_submit_xml_parsing (ZakFormElement *element, xmlNodePtr xml id = NULL; + ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_submit_parent_class)->xml_parsing (element, xmlnode); + ht_attrs = g_hash_table_new (g_str_hash, g_str_equal); cur = xmlnode->children; diff --git a/src/formelementtext.c b/src/formelementtext.c index 1eedb40..aa7b003 100644 --- a/src/formelementtext.c +++ b/src/formelementtext.c @@ -128,6 +128,8 @@ zak_cgi_form_element_text_xml_parsing (ZakFormElement *element, xmlNodePtr xmlno id = NULL; + ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_text_parent_class)->xml_parsing (element, xmlnode); + ht_attrs = g_hash_table_new (g_str_hash, g_str_equal); cur = xmlnode->children; diff --git a/src/formelementtextarea.c b/src/formelementtextarea.c index 695f129..05bb645 100644 --- a/src/formelementtextarea.c +++ b/src/formelementtextarea.c @@ -128,6 +128,8 @@ zak_cgi_form_element_text_area_xml_parsing (ZakFormElement *element, xmlNodePtr id = NULL; + ZAK_CGI_FORM_ELEMENT_CLASS (zak_cgi_form_element_text_area_parent_class)->xml_parsing (element, xmlnode); + ht_attrs = g_hash_table_new (g_str_hash, g_str_equal); cur = xmlnode->children;