/* Text.c generated by valac 0.56.19, the Vala compiler
 * generated from Text.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
/*
 *
 * Copyright (C) 2016  Daniel Espinosa <esodan@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
 *
 * Authors:
 *      Daniel Espinosa <esodan@gmail.com>
 */

#include "gxml/gxml.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <glib-object.h>
#include "gxml.h"

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	GXML_CHARACTER_DATA_0_PROPERTY,
	GXML_CHARACTER_DATA_DATA_PROPERTY,
	GXML_CHARACTER_DATA_PREVIOUS_ELEMENT_SIBLING_PROPERTY,
	GXML_CHARACTER_DATA_NEXT_ELEMENT_SIBLING_PROPERTY,
	GXML_CHARACTER_DATA_NUM_PROPERTIES
};
static GParamSpec* gxml_character_data_properties[GXML_CHARACTER_DATA_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	GXML_TEXT_0_PROPERTY,
	GXML_TEXT_NUM_PROPERTIES
};
static GParamSpec* gxml_text_properties[GXML_TEXT_NUM_PROPERTIES];
enum  {
	GXML_PROCESSING_INSTRUCTION_0_PROPERTY,
	GXML_PROCESSING_INSTRUCTION_TARGET_PROPERTY,
	GXML_PROCESSING_INSTRUCTION_NUM_PROPERTIES
};
static GParamSpec* gxml_processing_instruction_properties[GXML_PROCESSING_INSTRUCTION_NUM_PROPERTIES];
enum  {
	GXML_COMMENT_0_PROPERTY,
	GXML_COMMENT_NUM_PROPERTIES
};
static GParamSpec* gxml_comment_properties[GXML_COMMENT_NUM_PROPERTIES];

static gpointer gxml_character_data_parent_class = NULL;
static GXmlDomNonDocumentTypeChildNodeIface * gxml_character_data_gxml_dom_non_document_type_child_node_parent_iface = NULL;
static GXmlDomChildNodeIface * gxml_character_data_gxml_dom_child_node_parent_iface = NULL;
static GXmlDomCharacterDataIface * gxml_character_data_gxml_dom_character_data_parent_iface = NULL;
static gpointer gxml_text_parent_class = NULL;
static GXmlDomTextIface * gxml_text_gxml_dom_text_parent_iface = NULL;
static gpointer gxml_processing_instruction_parent_class = NULL;
static GXmlDomProcessingInstructionIface * gxml_processing_instruction_gxml_dom_processing_instruction_parent_iface = NULL;
static gpointer gxml_comment_parent_class = NULL;
static GXmlDomCommentIface * gxml_comment_gxml_dom_comment_parent_iface = NULL;

static void gxml_character_data_real_remove (GXmlDomChildNode* base);
static GObject * gxml_character_data_constructor (GType type,
                                           guint n_construct_properties,
                                           GObjectConstructParam * construct_properties);
static GType gxml_character_data_get_type_once (void);
static void _vala_gxml_character_data_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static void _vala_gxml_character_data_set_property (GObject * object,
                                             guint property_id,
                                             const GValue * value,
                                             GParamSpec * pspec);
static GObject * gxml_text_constructor (GType type,
                                 guint n_construct_properties,
                                 GObjectConstructParam * construct_properties);
static GType gxml_text_get_type_once (void);
static GObject * gxml_processing_instruction_constructor (GType type,
                                                   guint n_construct_properties,
                                                   GObjectConstructParam * construct_properties);
static GType gxml_processing_instruction_get_type_once (void);
static void _vala_gxml_processing_instruction_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static GObject * gxml_comment_constructor (GType type,
                                    guint n_construct_properties,
                                    GObjectConstructParam * construct_properties);
static GType gxml_comment_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static gchar*
gxml_character_data_real_get_data (GXmlDomCharacterData* base)
{
	gchar* result;
	GXmlCharacterData* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (GXmlCharacterData*) base;
	_tmp0_ = ((GXmlNode*) self)->_node_value;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

static void
gxml_character_data_real_set_data (GXmlDomCharacterData* base,
                                   const gchar* value)
{
	GXmlCharacterData* self;
	gchar* _tmp0_;
	self = (GXmlCharacterData*) base;
	_tmp0_ = g_strdup (value);
	_g_free0 (((GXmlNode*) self)->_node_value);
	((GXmlNode*) self)->_node_value = _tmp0_;
	g_object_notify_by_pspec ((GObject *) self, gxml_character_data_properties[GXML_CHARACTER_DATA_DATA_PROPERTY]);
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static GXmlDomElement*
gxml_character_data_real_get_previous_element_sibling (GXmlDomNonDocumentTypeChildNode* base)
{
	GXmlDomElement* result;
	GXmlCharacterData* self;
	GXmlDomNode* _tmp0_;
	GXmlDomNode* _tmp1_;
	GXmlDomNode* _tmp2_;
	gboolean _tmp3_;
	self = (GXmlCharacterData*) base;
	_tmp0_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_ != NULL;
	_g_object_unref0 (_tmp2_);
	if (_tmp3_) {
		gint i = 0;
		GXmlDomNode* _tmp4_;
		GXmlDomNode* _tmp5_;
		GXmlDomNode* _tmp6_;
		GXmlDomNodeList* _tmp7_;
		GXmlDomNodeList* _tmp8_;
		GXmlDomNodeList* _tmp9_;
		gint _tmp10_;
		_tmp4_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		_tmp7_ = gxml_dom_node_get_child_nodes (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp10_ = gee_list_index_of ((GeeList*) _tmp9_, (GXmlDomNode*) self);
		_g_object_unref0 (_tmp9_);
		_g_object_unref0 (_tmp6_);
		i = _tmp10_;
		if (i == 0) {
			result = NULL;
			return result;
		}
		{
			gint j = 0;
			j = i;
			{
				gboolean _tmp11_ = FALSE;
				_tmp11_ = TRUE;
				while (TRUE) {
					GXmlDomNode* n = NULL;
					GXmlDomNode* _tmp13_;
					GXmlDomNode* _tmp14_;
					GXmlDomNode* _tmp15_;
					GXmlDomNodeList* _tmp16_;
					GXmlDomNodeList* _tmp17_;
					GXmlDomNodeList* _tmp18_;
					GXmlDomNode* _tmp19_;
					GXmlDomNode* _tmp20_;
					GXmlDomNode* _tmp21_;
					if (!_tmp11_) {
						gint _tmp12_;
						_tmp12_ = j;
						j = _tmp12_ - 1;
					}
					_tmp11_ = FALSE;
					if (!(j >= 1)) {
						break;
					}
					_tmp13_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) self);
					_tmp14_ = _tmp13_;
					_tmp15_ = _tmp14_;
					_tmp16_ = gxml_dom_node_get_child_nodes (_tmp15_);
					_tmp17_ = _tmp16_;
					_tmp18_ = _tmp17_;
					_tmp19_ = gxml_dom_node_list_item (_tmp18_, j - 1);
					_tmp20_ = _tmp19_;
					_g_object_unref0 (_tmp18_);
					_g_object_unref0 (_tmp15_);
					n = _tmp20_;
					_tmp21_ = n;
					if (GXML_IS_DOM_ELEMENT (_tmp21_)) {
						GXmlDomNode* _tmp22_;
						GXmlDomElement* _tmp23_;
						_tmp22_ = n;
						_tmp23_ = _g_object_ref0 (GXML_IS_DOM_ELEMENT (_tmp22_) ? ((GXmlDomElement*) _tmp22_) : NULL);
						result = _tmp23_;
						_g_object_unref0 (n);
						return result;
					}
					_g_object_unref0 (n);
				}
			}
		}
	}
	result = NULL;
	return result;
}

static GXmlDomElement*
gxml_character_data_real_get_next_element_sibling (GXmlDomNonDocumentTypeChildNode* base)
{
	GXmlDomElement* result;
	GXmlCharacterData* self;
	GXmlDomNode* _tmp0_;
	GXmlDomNode* _tmp1_;
	GXmlDomNode* _tmp2_;
	gboolean _tmp3_;
	self = (GXmlCharacterData*) base;
	_tmp0_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_ != NULL;
	_g_object_unref0 (_tmp2_);
	if (_tmp3_) {
		gint i = 0;
		GXmlDomNode* _tmp4_;
		GXmlDomNode* _tmp5_;
		GXmlDomNode* _tmp6_;
		GXmlDomNodeList* _tmp7_;
		GXmlDomNodeList* _tmp8_;
		GXmlDomNodeList* _tmp9_;
		gint _tmp10_;
		GXmlDomNode* _tmp11_;
		GXmlDomNode* _tmp12_;
		GXmlDomNode* _tmp13_;
		GXmlDomNodeList* _tmp14_;
		GXmlDomNodeList* _tmp15_;
		GXmlDomNodeList* _tmp16_;
		gint _tmp17_;
		gint _tmp18_;
		gboolean _tmp19_;
		_tmp4_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		_tmp7_ = gxml_dom_node_get_child_nodes (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp10_ = gee_list_index_of ((GeeList*) _tmp9_, (GXmlDomNode*) self);
		_g_object_unref0 (_tmp9_);
		_g_object_unref0 (_tmp6_);
		i = _tmp10_;
		_tmp11_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) self);
		_tmp12_ = _tmp11_;
		_tmp13_ = _tmp12_;
		_tmp14_ = gxml_dom_node_get_child_nodes (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = _tmp15_;
		_tmp17_ = gxml_dom_node_list_get_length (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = i == (_tmp18_ - 1);
		_g_object_unref0 (_tmp16_);
		_g_object_unref0 (_tmp13_);
		if (_tmp19_) {
			result = NULL;
			return result;
		}
		{
			gint j = 0;
			j = i;
			{
				gboolean _tmp20_ = FALSE;
				_tmp20_ = TRUE;
				while (TRUE) {
					GXmlDomNode* _tmp22_;
					GXmlDomNode* _tmp23_;
					GXmlDomNode* _tmp24_;
					GXmlDomNodeList* _tmp25_;
					GXmlDomNodeList* _tmp26_;
					GXmlDomNodeList* _tmp27_;
					gint _tmp28_;
					gint _tmp29_;
					gboolean _tmp30_;
					GXmlDomNode* n = NULL;
					GXmlDomNode* _tmp31_;
					GXmlDomNode* _tmp32_;
					GXmlDomNode* _tmp33_;
					GXmlDomNodeList* _tmp34_;
					GXmlDomNodeList* _tmp35_;
					GXmlDomNodeList* _tmp36_;
					GXmlDomNode* _tmp37_;
					GXmlDomNode* _tmp38_;
					GXmlDomNode* _tmp39_;
					if (!_tmp20_) {
						gint _tmp21_;
						_tmp21_ = j;
						j = _tmp21_ - 1;
					}
					_tmp20_ = FALSE;
					_tmp22_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) self);
					_tmp23_ = _tmp22_;
					_tmp24_ = _tmp23_;
					_tmp25_ = gxml_dom_node_get_child_nodes (_tmp24_);
					_tmp26_ = _tmp25_;
					_tmp27_ = _tmp26_;
					_tmp28_ = gxml_dom_node_list_get_length (_tmp27_);
					_tmp29_ = _tmp28_;
					_tmp30_ = !(j < (_tmp29_ - 1));
					_g_object_unref0 (_tmp27_);
					_g_object_unref0 (_tmp24_);
					if (_tmp30_) {
						break;
					}
					_tmp31_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) self);
					_tmp32_ = _tmp31_;
					_tmp33_ = _tmp32_;
					_tmp34_ = gxml_dom_node_get_child_nodes (_tmp33_);
					_tmp35_ = _tmp34_;
					_tmp36_ = _tmp35_;
					_tmp37_ = gxml_dom_node_list_item (_tmp36_, j + 1);
					_tmp38_ = _tmp37_;
					_g_object_unref0 (_tmp36_);
					_g_object_unref0 (_tmp33_);
					n = _tmp38_;
					_tmp39_ = n;
					if (GXML_IS_DOM_ELEMENT (_tmp39_)) {
						GXmlDomNode* _tmp40_;
						GXmlDomElement* _tmp41_;
						_tmp40_ = n;
						_tmp41_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp40_, GXML_TYPE_DOM_ELEMENT, GXmlDomElement));
						result = _tmp41_;
						_g_object_unref0 (n);
						return result;
					}
					_g_object_unref0 (n);
				}
			}
		}
	}
	result = NULL;
	return result;
}

static void
gxml_character_data_real_remove (GXmlDomChildNode* base)
{
	GXmlCharacterData * self;
	GXmlDomNode* _tmp0_;
	GXmlDomNode* _tmp1_;
	GXmlDomNode* _tmp2_;
	gboolean _tmp3_;
	self = (GXmlCharacterData*) base;
	_tmp0_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_ != NULL;
	_g_object_unref0 (_tmp2_);
	if (_tmp3_) {
		gint i = 0;
		GXmlDomNode* _tmp4_;
		GXmlDomNode* _tmp5_;
		GXmlDomNode* _tmp6_;
		GXmlDomNodeList* _tmp7_;
		GXmlDomNodeList* _tmp8_;
		GXmlDomNodeList* _tmp9_;
		gint _tmp10_;
		GXmlDomNode* _tmp11_;
		GXmlDomNode* _tmp12_;
		GXmlDomNode* _tmp13_;
		GXmlDomNodeList* _tmp14_;
		GXmlDomNodeList* _tmp15_;
		GXmlDomNodeList* _tmp16_;
		gpointer _tmp17_;
		GXmlDomNode* _tmp18_;
		_tmp4_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) self);
		_tmp5_ = _tmp4_;
		_tmp6_ = _tmp5_;
		_tmp7_ = gxml_dom_node_get_child_nodes (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = _tmp8_;
		_tmp10_ = gee_list_index_of ((GeeList*) _tmp9_, (GXmlDomNode*) self);
		_g_object_unref0 (_tmp9_);
		_g_object_unref0 (_tmp6_);
		i = _tmp10_;
		_tmp11_ = gxml_dom_node_get_parent_node ((GXmlDomNode*) self);
		_tmp12_ = _tmp11_;
		_tmp13_ = _tmp12_;
		_tmp14_ = gxml_dom_node_get_child_nodes (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = _tmp15_;
		_tmp17_ = gee_list_remove_at ((GeeList*) _tmp16_, i);
		_tmp18_ = (GXmlDomNode*) _tmp17_;
		_g_object_unref0 (_tmp18_);
		_g_object_unref0 (_tmp16_);
		_g_object_unref0 (_tmp13_);
	}
}

GXmlCharacterData*
gxml_character_data_construct (GType object_type)
{
	GXmlCharacterData * self = NULL;
	self = (GXmlCharacterData*) gxml_node_construct (object_type);
	return self;
}

GXmlCharacterData*
gxml_character_data_new (void)
{
	return gxml_character_data_construct (GXML_TYPE_CHARACTER_DATA);
}

static GObject *
gxml_character_data_constructor (GType type,
                                 guint n_construct_properties,
                                 GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GXmlCharacterData * self;
	gchar* _tmp0_;
	parent_class = G_OBJECT_CLASS (gxml_character_data_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_CHARACTER_DATA, GXmlCharacterData);
	_tmp0_ = g_strdup ("");
	_g_free0 (((GXmlNode*) self)->_node_value);
	((GXmlNode*) self)->_node_value = _tmp0_;
	return obj;
}

static void
gxml_character_data_class_init (GXmlCharacterDataClass * klass,
                                gpointer klass_data)
{
	gxml_character_data_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_character_data_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_character_data_set_property;
	G_OBJECT_CLASS (klass)->constructor = gxml_character_data_constructor;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_CHARACTER_DATA_DATA_PROPERTY, gxml_character_data_properties[GXML_CHARACTER_DATA_DATA_PROPERTY] = g_param_spec_string ("data", "data", "data", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_CHARACTER_DATA_PREVIOUS_ELEMENT_SIBLING_PROPERTY, gxml_character_data_properties[GXML_CHARACTER_DATA_PREVIOUS_ELEMENT_SIBLING_PROPERTY] = g_param_spec_object ("previous-element-sibling", "previous-element-sibling", "previous-element-sibling", GXML_TYPE_DOM_ELEMENT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_CHARACTER_DATA_NEXT_ELEMENT_SIBLING_PROPERTY, gxml_character_data_properties[GXML_CHARACTER_DATA_NEXT_ELEMENT_SIBLING_PROPERTY] = g_param_spec_object ("next-element-sibling", "next-element-sibling", "next-element-sibling", GXML_TYPE_DOM_ELEMENT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gxml_character_data_gxml_dom_non_document_type_child_node_interface_init (GXmlDomNonDocumentTypeChildNodeIface * iface,
                                                                          gpointer iface_data)
{
	gxml_character_data_gxml_dom_non_document_type_child_node_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_previous_element_sibling = gxml_character_data_real_get_previous_element_sibling;
	iface->get_next_element_sibling = gxml_character_data_real_get_next_element_sibling;
}

static void
gxml_character_data_gxml_dom_child_node_interface_init (GXmlDomChildNodeIface * iface,
                                                        gpointer iface_data)
{
	gxml_character_data_gxml_dom_child_node_parent_iface = g_type_interface_peek_parent (iface);
	iface->remove = (void (*) (GXmlDomChildNode*)) gxml_character_data_real_remove;
}

static void
gxml_character_data_gxml_dom_character_data_interface_init (GXmlDomCharacterDataIface * iface,
                                                            gpointer iface_data)
{
	gxml_character_data_gxml_dom_character_data_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_data = gxml_character_data_real_get_data;
	iface->set_data = gxml_character_data_real_set_data;
}

static void
gxml_character_data_instance_init (GXmlCharacterData * self,
                                   gpointer klass)
{
}

/**
 * A DOM4 implementation of {@link DomCharacterData}, for one step parsing.
 *
 * This object avoids pre and post XML parsing, by using a one step parsing
 * to translate text XML tree to an GObject based tree.
 */
static GType
gxml_character_data_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlCharacterDataClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_character_data_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlCharacterData), 0, (GInstanceInitFunc) gxml_character_data_instance_init, NULL };
	static const GInterfaceInfo gxml_dom_non_document_type_child_node_info = { (GInterfaceInitFunc) gxml_character_data_gxml_dom_non_document_type_child_node_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gxml_dom_child_node_info = { (GInterfaceInitFunc) gxml_character_data_gxml_dom_child_node_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gxml_dom_character_data_info = { (GInterfaceInitFunc) gxml_character_data_gxml_dom_character_data_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gxml_character_data_type_id;
	gxml_character_data_type_id = g_type_register_static (GXML_TYPE_NODE, "GXmlCharacterData", &g_define_type_info, 0);
	g_type_add_interface_static (gxml_character_data_type_id, GXML_TYPE_DOM_NON_DOCUMENT_TYPE_CHILD_NODE, &gxml_dom_non_document_type_child_node_info);
	g_type_add_interface_static (gxml_character_data_type_id, GXML_TYPE_DOM_CHILD_NODE, &gxml_dom_child_node_info);
	g_type_add_interface_static (gxml_character_data_type_id, GXML_TYPE_DOM_CHARACTER_DATA, &gxml_dom_character_data_info);
	return gxml_character_data_type_id;
}

GType
gxml_character_data_get_type (void)
{
	static volatile gsize gxml_character_data_type_id__once = 0;
	if (g_once_init_enter (&gxml_character_data_type_id__once)) {
		GType gxml_character_data_type_id;
		gxml_character_data_type_id = gxml_character_data_get_type_once ();
		g_once_init_leave (&gxml_character_data_type_id__once, gxml_character_data_type_id);
	}
	return gxml_character_data_type_id__once;
}

static void
_vala_gxml_character_data_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	GXmlCharacterData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_CHARACTER_DATA, GXmlCharacterData);
	switch (property_id) {
		case GXML_CHARACTER_DATA_DATA_PROPERTY:
		g_value_take_string (value, gxml_dom_character_data_get_data ((GXmlDomCharacterData*) self));
		break;
		case GXML_CHARACTER_DATA_PREVIOUS_ELEMENT_SIBLING_PROPERTY:
		g_value_take_object (value, gxml_dom_non_document_type_child_node_get_previous_element_sibling ((GXmlDomNonDocumentTypeChildNode*) self));
		break;
		case GXML_CHARACTER_DATA_NEXT_ELEMENT_SIBLING_PROPERTY:
		g_value_take_object (value, gxml_dom_non_document_type_child_node_get_next_element_sibling ((GXmlDomNonDocumentTypeChildNode*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gxml_character_data_set_property (GObject * object,
                                        guint property_id,
                                        const GValue * value,
                                        GParamSpec * pspec)
{
	GXmlCharacterData * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_CHARACTER_DATA, GXmlCharacterData);
	switch (property_id) {
		case GXML_CHARACTER_DATA_DATA_PROPERTY:
		gxml_dom_character_data_set_data ((GXmlDomCharacterData*) self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

GXmlText*
gxml_text_construct (GType object_type,
                     GXmlDomDocument* doc,
                     const gchar* data)
{
	GXmlText * self = NULL;
	GXmlDomDocument* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (doc != NULL, NULL);
	g_return_val_if_fail (data != NULL, NULL);
	self = (GXmlText*) gxml_character_data_construct (object_type);
	_tmp0_ = _g_object_ref0 (doc);
	_g_object_unref0 (((GXmlNode*) self)->_document);
	((GXmlNode*) self)->_document = _tmp0_;
	_tmp1_ = g_strdup (data);
	_g_free0 (((GXmlNode*) self)->_node_value);
	((GXmlNode*) self)->_node_value = _tmp1_;
	return self;
}

GXmlText*
gxml_text_new (GXmlDomDocument* doc,
               const gchar* data)
{
	return gxml_text_construct (GXML_TYPE_TEXT, doc, data);
}

static GObject *
gxml_text_constructor (GType type,
                       guint n_construct_properties,
                       GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GXmlText * self;
	gchar* _tmp0_;
	parent_class = G_OBJECT_CLASS (gxml_text_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_TEXT, GXmlText);
	((GXmlNode*) self)->_node_type = GXML_DOM_NODE_NODE_TYPE_TEXT_NODE;
	_tmp0_ = g_strdup ("#text");
	_g_free0 (((GXmlNode*) self)->_local_name);
	((GXmlNode*) self)->_local_name = _tmp0_;
	return obj;
}

static void
gxml_text_class_init (GXmlTextClass * klass,
                      gpointer klass_data)
{
	gxml_text_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = gxml_text_constructor;
}

static void
gxml_text_gxml_dom_text_interface_init (GXmlDomTextIface * iface,
                                        gpointer iface_data)
{
	gxml_text_gxml_dom_text_parent_iface = g_type_interface_peek_parent (iface);
}

static void
gxml_text_instance_init (GXmlText * self,
                         gpointer klass)
{
}

/**
 * A DOM4 implementation of {@link DomText}, for one step parsing.
 *
 * This object avoids pre and post XML parsing, by using a one step parsing
 * to translate text XML tree to an GObject based tree.
 */
static GType
gxml_text_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlTextClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_text_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlText), 0, (GInstanceInitFunc) gxml_text_instance_init, NULL };
	static const GInterfaceInfo gxml_dom_text_info = { (GInterfaceInitFunc) gxml_text_gxml_dom_text_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gxml_text_type_id;
	gxml_text_type_id = g_type_register_static (GXML_TYPE_CHARACTER_DATA, "GXmlText", &g_define_type_info, 0);
	g_type_add_interface_static (gxml_text_type_id, GXML_TYPE_DOM_TEXT, &gxml_dom_text_info);
	return gxml_text_type_id;
}

GType
gxml_text_get_type (void)
{
	static volatile gsize gxml_text_type_id__once = 0;
	if (g_once_init_enter (&gxml_text_type_id__once)) {
		GType gxml_text_type_id;
		gxml_text_type_id = gxml_text_get_type_once ();
		g_once_init_leave (&gxml_text_type_id__once, gxml_text_type_id);
	}
	return gxml_text_type_id__once;
}

static gchar*
gxml_processing_instruction_real_get_target (GXmlDomProcessingInstruction* base)
{
	gchar* result;
	GXmlProcessingInstruction* self;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	self = (GXmlProcessingInstruction*) base;
	_tmp0_ = ((GXmlNode*) self)->_local_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}

GXmlProcessingInstruction*
gxml_processing_instruction_construct (GType object_type,
                                       GXmlDomDocument* doc,
                                       const gchar* target,
                                       const gchar* data)
{
	GXmlProcessingInstruction * self = NULL;
	GXmlDomDocument* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_val_if_fail (doc != NULL, NULL);
	g_return_val_if_fail (target != NULL, NULL);
	g_return_val_if_fail (data != NULL, NULL);
	self = (GXmlProcessingInstruction*) gxml_character_data_construct (object_type);
	_tmp0_ = _g_object_ref0 (doc);
	_g_object_unref0 (((GXmlNode*) self)->_document);
	((GXmlNode*) self)->_document = _tmp0_;
	_tmp1_ = g_strdup (data);
	_g_free0 (((GXmlNode*) self)->_node_value);
	((GXmlNode*) self)->_node_value = _tmp1_;
	_tmp2_ = g_strdup (target);
	_g_free0 (((GXmlNode*) self)->_local_name);
	((GXmlNode*) self)->_local_name = _tmp2_;
	return self;
}

GXmlProcessingInstruction*
gxml_processing_instruction_new (GXmlDomDocument* doc,
                                 const gchar* target,
                                 const gchar* data)
{
	return gxml_processing_instruction_construct (GXML_TYPE_PROCESSING_INSTRUCTION, doc, target, data);
}

static GObject *
gxml_processing_instruction_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GXmlProcessingInstruction * self;
	parent_class = G_OBJECT_CLASS (gxml_processing_instruction_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_PROCESSING_INSTRUCTION, GXmlProcessingInstruction);
	((GXmlNode*) self)->_node_type = GXML_DOM_NODE_NODE_TYPE_PROCESSING_INSTRUCTION_NODE;
	return obj;
}

static void
gxml_processing_instruction_class_init (GXmlProcessingInstructionClass * klass,
                                        gpointer klass_data)
{
	gxml_processing_instruction_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_processing_instruction_get_property;
	G_OBJECT_CLASS (klass)->constructor = gxml_processing_instruction_constructor;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_PROCESSING_INSTRUCTION_TARGET_PROPERTY, gxml_processing_instruction_properties[GXML_PROCESSING_INSTRUCTION_TARGET_PROPERTY] = g_param_spec_string ("target", "target", "target", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gxml_processing_instruction_gxml_dom_processing_instruction_interface_init (GXmlDomProcessingInstructionIface * iface,
                                                                            gpointer iface_data)
{
	gxml_processing_instruction_gxml_dom_processing_instruction_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_target = gxml_processing_instruction_real_get_target;
}

static void
gxml_processing_instruction_instance_init (GXmlProcessingInstruction * self,
                                           gpointer klass)
{
}

/**
 * A DOM4 implementation of {@link DomProcessingInstruction}, for one step parsing.
 *
 * This object avoids pre and post XML parsing, by using a one step parsing
 * to translate text XML tree to an GObject based tree.
 */
static GType
gxml_processing_instruction_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlProcessingInstructionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_processing_instruction_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlProcessingInstruction), 0, (GInstanceInitFunc) gxml_processing_instruction_instance_init, NULL };
	static const GInterfaceInfo gxml_dom_processing_instruction_info = { (GInterfaceInitFunc) gxml_processing_instruction_gxml_dom_processing_instruction_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gxml_processing_instruction_type_id;
	gxml_processing_instruction_type_id = g_type_register_static (GXML_TYPE_CHARACTER_DATA, "GXmlProcessingInstruction", &g_define_type_info, 0);
	g_type_add_interface_static (gxml_processing_instruction_type_id, GXML_TYPE_DOM_PROCESSING_INSTRUCTION, &gxml_dom_processing_instruction_info);
	return gxml_processing_instruction_type_id;
}

GType
gxml_processing_instruction_get_type (void)
{
	static volatile gsize gxml_processing_instruction_type_id__once = 0;
	if (g_once_init_enter (&gxml_processing_instruction_type_id__once)) {
		GType gxml_processing_instruction_type_id;
		gxml_processing_instruction_type_id = gxml_processing_instruction_get_type_once ();
		g_once_init_leave (&gxml_processing_instruction_type_id__once, gxml_processing_instruction_type_id);
	}
	return gxml_processing_instruction_type_id__once;
}

static void
_vala_gxml_processing_instruction_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	GXmlProcessingInstruction * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_PROCESSING_INSTRUCTION, GXmlProcessingInstruction);
	switch (property_id) {
		case GXML_PROCESSING_INSTRUCTION_TARGET_PROPERTY:
		g_value_take_string (value, gxml_dom_processing_instruction_get_target ((GXmlDomProcessingInstruction*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

GXmlComment*
gxml_comment_construct (GType object_type,
                        GXmlDomDocument* doc,
                        const gchar* data)
{
	GXmlComment * self = NULL;
	GXmlDomDocument* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (doc != NULL, NULL);
	g_return_val_if_fail (data != NULL, NULL);
	self = (GXmlComment*) gxml_character_data_construct (object_type);
	_tmp0_ = _g_object_ref0 (doc);
	_g_object_unref0 (((GXmlNode*) self)->_document);
	((GXmlNode*) self)->_document = _tmp0_;
	_tmp1_ = g_strdup (data);
	_g_free0 (((GXmlNode*) self)->_node_value);
	((GXmlNode*) self)->_node_value = _tmp1_;
	return self;
}

GXmlComment*
gxml_comment_new (GXmlDomDocument* doc,
                  const gchar* data)
{
	return gxml_comment_construct (GXML_TYPE_COMMENT, doc, data);
}

static GObject *
gxml_comment_constructor (GType type,
                          guint n_construct_properties,
                          GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GXmlComment * self;
	gchar* _tmp0_;
	parent_class = G_OBJECT_CLASS (gxml_comment_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_COMMENT, GXmlComment);
	((GXmlNode*) self)->_node_type = GXML_DOM_NODE_NODE_TYPE_COMMENT_NODE;
	_tmp0_ = g_strdup ("#comment");
	_g_free0 (((GXmlNode*) self)->_local_name);
	((GXmlNode*) self)->_local_name = _tmp0_;
	return obj;
}

static void
gxml_comment_class_init (GXmlCommentClass * klass,
                         gpointer klass_data)
{
	gxml_comment_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->constructor = gxml_comment_constructor;
}

static void
gxml_comment_gxml_dom_comment_interface_init (GXmlDomCommentIface * iface,
                                              gpointer iface_data)
{
	gxml_comment_gxml_dom_comment_parent_iface = g_type_interface_peek_parent (iface);
}

static void
gxml_comment_instance_init (GXmlComment * self,
                            gpointer klass)
{
}

/**
 * A DOM4 implementation of {@link DomComment}, for one step parsing.
 *
 * This object avoids pre and post XML parsing, by using a one step parsing
 * to translate text XML tree to an GObject based tree.
 */
static GType
gxml_comment_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlCommentClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_comment_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlComment), 0, (GInstanceInitFunc) gxml_comment_instance_init, NULL };
	static const GInterfaceInfo gxml_dom_comment_info = { (GInterfaceInitFunc) gxml_comment_gxml_dom_comment_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gxml_comment_type_id;
	gxml_comment_type_id = g_type_register_static (GXML_TYPE_CHARACTER_DATA, "GXmlComment", &g_define_type_info, 0);
	g_type_add_interface_static (gxml_comment_type_id, GXML_TYPE_DOM_COMMENT, &gxml_dom_comment_info);
	return gxml_comment_type_id;
}

GType
gxml_comment_get_type (void)
{
	static volatile gsize gxml_comment_type_id__once = 0;
	if (g_once_init_enter (&gxml_comment_type_id__once)) {
		GType gxml_comment_type_id;
		gxml_comment_type_id = gxml_comment_get_type_once ();
		g_once_init_leave (&gxml_comment_type_id__once, gxml_comment_type_id);
	}
	return gxml_comment_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

