Commit eba6befa authored by Juan Pablo Ugarte's avatar Juan Pablo Ugarte

Added new funtions to handle document level comments

glade_xml_doc_new_comment(), glade_xml_node_prev_with_comments (),
glade_xml_node_add_prev_sibling () and glade_xml_node_add_next_sibling ()
parent accd7067
......@@ -858,6 +858,13 @@ glade_xml_node_next_with_comments (GladeXmlNode * node_in)
return (GladeXmlNode *) node->next;
}
GladeXmlNode *
glade_xml_node_prev_with_comments (GladeXmlNode * node_in)
{
xmlNodePtr node = (xmlNodePtr) node_in;
return (GladeXmlNode *) node->prev;
}
const gchar *
glade_xml_node_get_name (GladeXmlNode * node_in)
......@@ -962,3 +969,21 @@ glade_xml_load_sym_from_node (GladeXmlNode * node_in,
}
return retval;
}
GladeXmlNode *
glade_xml_doc_new_comment (GladeXmlDoc *doc, const gchar *comment)
{
return (GladeXmlNode *) xmlNewDocComment ((xmlDocPtr) (doc), BAD_CAST (comment));
}
GladeXmlNode *
glade_xml_node_add_prev_sibling (GladeXmlNode *node, GladeXmlNode *new_node)
{
return (GladeXmlNode *) xmlAddPrevSibling ((xmlNodePtr) node, (xmlNodePtr) new_node);
}
GladeXmlNode *
glade_xml_node_add_next_sibling (GladeXmlNode *node, GladeXmlNode *new_node)
{
return (GladeXmlNode *) xmlAddNextSibling ((xmlNodePtr) node, (xmlNodePtr) new_node);
}
......@@ -234,8 +234,10 @@ void glade_xml_node_append_child (GladeXmlNode * node, GladeXmlNode *
void glade_xml_node_remove (GladeXmlNode *node_in);
gboolean glade_xml_node_is_comment (GladeXmlNode *node_in);
GladeXmlNode * glade_xml_node_next_with_comments (GladeXmlNode *node_in);
GladeXmlNode * glade_xml_node_prev_with_comments (GladeXmlNode * node_in);
GladeXmlNode * glade_xml_node_get_children_with_comments (GladeXmlNode *node);
GladeXmlNode * glade_xml_node_add_prev_sibling (GladeXmlNode *node, GladeXmlNode *new_node);
GladeXmlNode * glade_xml_node_add_next_sibling (GladeXmlNode *node, GladeXmlNode *new_node);
/* Document Operatons */
GladeXmlNode * glade_xml_doc_get_root (GladeXmlDoc *doc);
......@@ -243,6 +245,7 @@ GladeXmlDoc * glade_xml_doc_new (void);
void glade_xml_doc_set_root (GladeXmlDoc *doc, GladeXmlNode *node);
void glade_xml_doc_free (GladeXmlDoc *doc_in);
gint glade_xml_doc_save (GladeXmlDoc *doc_in, const gchar *full_path);
GladeXmlNode * glade_xml_doc_new_comment (GladeXmlDoc *doc, const gchar *comment);
/* Parse Context */
GladeXmlContext * glade_xml_context_new (GladeXmlDoc *doc, const gchar *name_space);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment