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

/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 0; tab-width: 2 -*- */
/* GXmlListChildren.vala
 *
 * Copyright (C) 2015  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 <libxml/tree.h>
#include <gee.h>
#include <glib-object.h>
#include <glib.h>
#include <string.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_XLIST_CHILDREN_0_PROPERTY,
	GXML_XLIST_CHILDREN_SIZE_PROPERTY,
	GXML_XLIST_CHILDREN_READ_ONLY_PROPERTY,
	GXML_XLIST_CHILDREN_LENGTH_PROPERTY,
	GXML_XLIST_CHILDREN_NUM_PROPERTIES
};
static GParamSpec* gxml_xlist_children_properties[GXML_XLIST_CHILDREN_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
enum  {
	GXML_XLIST_CHILDREN_ITERATOR_0_PROPERTY,
	GXML_XLIST_CHILDREN_ITERATOR_READ_ONLY_PROPERTY,
	GXML_XLIST_CHILDREN_ITERATOR_VALID_PROPERTY,
	GXML_XLIST_CHILDREN_ITERATOR_NUM_PROPERTIES
};
static GParamSpec* gxml_xlist_children_iterator_properties[GXML_XLIST_CHILDREN_ITERATOR_NUM_PROPERTIES];
#define _xmlFreeNode0(var) ((var == NULL) ? NULL : (var = (xmlFreeNode (var), NULL)))

struct _GXmlXListChildrenPrivate {
	GXmlXDocument* _doc;
	xmlNode* _node;
};

struct _GXmlXListChildrenIteratorPrivate {
	GXmlXDocument* _doc;
	xmlNode* _node;
	xmlNode* _current;
	gint i;
};

static gint GXmlXListChildren_private_offset;
static gpointer gxml_xlist_children_parent_class = NULL;
static gint GXmlXListChildrenIterator_private_offset;
static gpointer gxml_xlist_children_iterator_parent_class = NULL;
static GeeTraversableIface * gxml_xlist_children_iterator_gee_traversable_parent_iface = NULL;
static GeeIteratorIface * gxml_xlist_children_iterator_gee_iterator_parent_iface = NULL;
static GeeBidirIteratorIface * gxml_xlist_children_iterator_gee_bidir_iterator_parent_iface = NULL;
static GeeListIteratorIface * gxml_xlist_children_iterator_gee_list_iterator_parent_iface = NULL;
static GeeBidirListIteratorIface * gxml_xlist_children_iterator_gee_bidir_list_iterator_parent_iface = NULL;
static GXmlDomNodeListIface * gxml_xlist_children_gxml_dom_node_list_parent_iface = NULL;
static GXmlDomHTMLCollectionIface * gxml_xlist_children_gxml_dom_html_collection_parent_iface = NULL;

static GeeBidirListIterator* gxml_xlist_children_real_bidir_list_iterator (GeeAbstractBidirList* base);
static GXmlDomNode* gxml_xlist_children_real_get (GeeAbstractList* base,
                                           gint index);
static gint gxml_xlist_children_real_index_of (GeeAbstractList* base,
                                        GXmlDomNode* item);
static void gxml_xlist_children_real_insert (GeeAbstractList* base,
                                      gint index,
                                      GXmlDomNode* item);
VALA_EXTERN void gxml_xnode_release_node (GXmlXNode* self);
static GeeListIterator* gxml_xlist_children_real_list_iterator (GeeAbstractList* base);
static GXmlDomNode* gxml_xlist_children_real_remove_at (GeeAbstractList* base,
                                                 gint index);
VALA_EXTERN void gxml_xnode_take_node (GXmlXNode* self);
static void gxml_xlist_children_real_set (GeeAbstractList* base,
                                   gint index,
                                   GXmlDomNode* item);
static GeeList* gxml_xlist_children_real_slice (GeeAbstractList* base,
                                         gint start,
                                         gint stop);
static gboolean gxml_xlist_children_real_add (GeeAbstractCollection* base,
                                       GXmlDomNode* item);
static void gxml_xlist_children_real_clear (GeeAbstractCollection* base);
static gboolean gxml_xlist_children_real_contains (GeeAbstractCollection* base,
                                            GXmlDomNode* item);
static GeeIterator* gxml_xlist_children_real_iterator (GeeAbstractCollection* base);
static gboolean gxml_xlist_children_real_remove (GeeAbstractCollection* base,
                                          GXmlDomNode* item);
static GXmlDomNode* gxml_xlist_children_real_item (GXmlDomNodeList* base,
                                            gint index);
static GXmlDomElement* gxml_xlist_children_real_get_element (GXmlDomHTMLCollection* base,
                                                      gint index);
static void gxml_xlist_children_iterator_real_insert (GeeBidirListIterator* base,
                                               GXmlDomNode* item);
static void gxml_xlist_children_iterator_real_add (GeeListIterator* base,
                                            GXmlDomNode* item);
static gint gxml_xlist_children_iterator_real_index (GeeListIterator* base);
static void gxml_xlist_children_iterator_real_set (GeeListIterator* base,
                                            GXmlDomNode* item);
static GXmlDomNode* gxml_xlist_children_iterator_real_get (GeeIterator* base);
static gboolean gxml_xlist_children_iterator_real_has_next (GeeIterator* base);
static gboolean gxml_xlist_children_iterator_real_next (GeeIterator* base);
static void gxml_xlist_children_iterator_real_remove (GeeIterator* base);
static gboolean gxml_xlist_children_iterator_real_foreach (GeeTraversable* base,
                                                    GeeForallFunc f,
                                                    gpointer f_target);
static gboolean gxml_xlist_children_iterator_real_first (GeeBidirIterator* base);
static gboolean gxml_xlist_children_iterator_real_has_previous (GeeBidirIterator* base);
static gboolean gxml_xlist_children_iterator_real_last (GeeBidirIterator* base);
static gboolean gxml_xlist_children_iterator_real_previous (GeeBidirIterator* base);
static void gxml_xlist_children_iterator_finalize (GObject * obj);
static GType gxml_xlist_children_iterator_get_type_once (void);
static void _vala_gxml_xlist_children_iterator_get_property (GObject * object,
                                                      guint property_id,
                                                      GValue * value,
                                                      GParamSpec * pspec);
static void gxml_xlist_children_finalize (GObject * obj);
static GType gxml_xlist_children_get_type_once (void);
static void _vala_gxml_xlist_children_get_property (GObject * object,
                                             guint property_id,
                                             GValue * value,
                                             GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
gxml_xlist_children_get_instance_private (GXmlXListChildren* self)
{
	return G_STRUCT_MEMBER_P (self, GXmlXListChildren_private_offset);
}

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

GXmlXListChildren*
gxml_xlist_children_construct (GType object_type,
                               GXmlXDocument* doc,
                               xmlNode* node)
{
	GXmlXListChildren * self = NULL;
	GXmlXDocument* _tmp0_;
	g_return_val_if_fail (doc != NULL, NULL);
	self = (GXmlXListChildren*) gee_abstract_bidir_list_construct (object_type, GXML_TYPE_DOM_NODE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref);
	self->priv->_node = node;
	_tmp0_ = _g_object_ref0 (doc);
	_g_object_unref0 (self->priv->_doc);
	self->priv->_doc = _tmp0_;
	return self;
}

GXmlXListChildren*
gxml_xlist_children_new (GXmlXDocument* doc,
                         xmlNode* node)
{
	return gxml_xlist_children_construct (GXML_TYPE_XLIST_CHILDREN, doc, node);
}

static GeeBidirListIterator*
gxml_xlist_children_real_bidir_list_iterator (GeeAbstractBidirList* base)
{
	GXmlXListChildren * self;
	GXmlXDocument* _tmp0_;
	xmlNode* _tmp1_;
	GXmlXListChildrenIterator* _tmp2_;
	GeeBidirListIterator* result;
	self = (GXmlXListChildren*) base;
	_tmp0_ = self->priv->_doc;
	_tmp1_ = self->priv->_node;
	_tmp2_ = gxml_xlist_children_iterator_new (_tmp0_, _tmp1_);
	result = (GeeBidirListIterator*) _tmp2_;
	return result;
}

static GXmlDomNode*
gxml_xlist_children_real_get (GeeAbstractList* base,
                              gint index)
{
	GXmlXListChildren * self;
	GXmlDomNode* nullnode = NULL;
	xmlNode* _tmp0_;
	xmlNode* n = NULL;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	gint i = 0;
	GXmlDomNode* result;
	self = (GXmlXListChildren*) base;
	nullnode = NULL;
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = nullnode;
		return result;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->children;
	n = _tmp2_;
	i = 0;
	while (TRUE) {
		xmlNode* _tmp3_;
		gint _tmp7_;
		xmlNode* _tmp8_;
		xmlNode* _tmp9_;
		_tmp3_ = n;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		if (i == index) {
			GXmlXDocument* _tmp4_;
			xmlNode* _tmp5_;
			GXmlDomNode* _tmp6_;
			_tmp4_ = self->priv->_doc;
			_tmp5_ = n;
			_tmp6_ = gxml_xnode_to_gnode (_tmp4_, _tmp5_, FALSE);
			result = _tmp6_;
			_g_object_unref0 (nullnode);
			return result;
		}
		_tmp7_ = i;
		i = _tmp7_ + 1;
		_tmp8_ = n;
		_tmp9_ = _tmp8_->next;
		n = _tmp9_;
	}
	result = nullnode;
	return result;
}

static gint
gxml_xlist_children_real_index_of (GeeAbstractList* base,
                                   GXmlDomNode* item)
{
	GXmlXListChildren * self;
	xmlNode* _tmp0_;
	xmlNode* n = NULL;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	gint i = 0;
	gint result;
	self = (GXmlXListChildren*) base;
	g_return_val_if_fail (item != NULL, -1);
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = -1;
		return result;
	}
	if (!GXML_IS_XNODE (item)) {
		result = -1;
		return result;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->children;
	n = _tmp2_;
	i = 0;
	while (TRUE) {
		xmlNode* _tmp3_;
		xmlNode* _tmp4_;
		xmlNode* _tmp5_;
		xmlNode* _tmp6_;
		xmlNode* _tmp7_;
		gint _tmp8_;
		_tmp3_ = n;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = n;
		_tmp5_ = gxml_xnode_get_internal_node (G_TYPE_CHECK_INSTANCE_CAST (item, GXML_TYPE_XNODE, GXmlXNode));
		if (_tmp4_ == _tmp5_) {
			result = i;
			return result;
		}
		_tmp6_ = n;
		_tmp7_ = _tmp6_->next;
		n = _tmp7_;
		_tmp8_ = i;
		i = _tmp8_ + 1;
	}
	result = -1;
	return result;
}

/**
   * Insert @item before @index
   */
static void
gxml_xlist_children_real_insert (GeeAbstractList* base,
                                 gint index,
                                 GXmlDomNode* item)
{
	GXmlXListChildren * self;
	GXmlDomNode* n = NULL;
	gpointer _tmp0_;
	GXmlDomNode* _tmp1_;
	GXmlDomNode* _tmp2_;
	xmlNode* _tmp3_;
	xmlNode* _tmp4_;
	self = (GXmlXListChildren*) base;
	g_return_if_fail (item != NULL);
	_tmp0_ = gee_abstract_list_get ((GeeAbstractList*) self, index);
	n = (GXmlDomNode*) _tmp0_;
	_tmp1_ = n;
	if (_tmp1_ == NULL) {
		_g_object_unref0 (n);
		return;
	}
	gxml_xnode_release_node (G_TYPE_CHECK_INSTANCE_CAST (item, GXML_TYPE_XNODE, GXmlXNode));
	_tmp2_ = n;
	_tmp3_ = gxml_xnode_get_internal_node (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, GXML_TYPE_XNODE, GXmlXNode));
	_tmp4_ = gxml_xnode_get_internal_node (G_TYPE_CHECK_INSTANCE_CAST (item, GXML_TYPE_XNODE, GXmlXNode));
	xmlAddPrevSibling (_tmp3_, _tmp4_);
	_g_object_unref0 (n);
}

static GeeListIterator*
gxml_xlist_children_real_list_iterator (GeeAbstractList* base)
{
	GXmlXListChildren * self;
	GXmlXDocument* _tmp0_;
	xmlNode* _tmp1_;
	GXmlXListChildrenIterator* _tmp2_;
	GeeListIterator* result;
	self = (GXmlXListChildren*) base;
	_tmp0_ = self->priv->_doc;
	_tmp1_ = self->priv->_node;
	_tmp2_ = gxml_xlist_children_iterator_new (_tmp0_, _tmp1_);
	result = (GeeListIterator*) _tmp2_;
	return result;
}

/**
   * Removes a node at @index. This method never returns a valid pointer.
   */
static GXmlDomNode*
gxml_xlist_children_real_remove_at (GeeAbstractList* base,
                                    gint index)
{
	GXmlXListChildren * self;
	GXmlDomNode* nullnode = NULL;
	gboolean _tmp0_ = FALSE;
	gint _tmp1_;
	gint _tmp2_;
	GXmlDomNode* n = NULL;
	gpointer _tmp3_;
	GXmlDomNode* _tmp4_;
	xmlNode* np = NULL;
	GXmlDomNode* _tmp5_;
	xmlNode* _tmp6_;
	xmlNode* _tmp7_;
	GXmlDomNode* _tmp8_;
	GXmlDomNode* result;
	self = (GXmlXListChildren*) base;
	nullnode = NULL;
	_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) self);
	_tmp2_ = _tmp1_;
	if (index > _tmp2_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = index < 0;
	}
	if (_tmp0_) {
		result = nullnode;
		return result;
	}
	_tmp3_ = gee_abstract_list_get ((GeeAbstractList*) self, index);
	n = (GXmlDomNode*) _tmp3_;
	_tmp4_ = n;
	if (_tmp4_ == NULL) {
		result = nullnode;
		_g_object_unref0 (n);
		return result;
	}
	_tmp5_ = n;
	_tmp6_ = gxml_xnode_get_internal_node (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GXML_TYPE_XNODE, GXmlXNode));
	np = _tmp6_;
	_tmp7_ = np;
	xmlUnlinkNode (_tmp7_);
	_tmp8_ = n;
	gxml_xnode_take_node (G_TYPE_CHECK_INSTANCE_CAST (_tmp8_, GXML_TYPE_XNODE, GXmlXNode));
	result = n;
	_g_object_unref0 (nullnode);
	return result;
}

/**
   * This method is ignored by default.
   */
static void
gxml_xlist_children_real_set (GeeAbstractList* base,
                              gint index,
                              GXmlDomNode* item)
{
	GXmlXListChildren * self;
	self = (GXmlXListChildren*) base;
	g_return_if_fail (item != NULL);
}

static GeeList*
gxml_xlist_children_real_slice (GeeAbstractList* base,
                                gint start,
                                gint stop)
{
	GXmlXListChildren * self;
	GeeArrayList* l = NULL;
	GeeArrayList* _tmp0_;
	xmlNode* _tmp1_;
	xmlNode* n = NULL;
	xmlNode* _tmp2_;
	xmlNode* _tmp3_;
	gint i = 0;
	GeeList* result;
	self = (GXmlXListChildren*) base;
	_tmp0_ = gee_array_list_new (GXML_TYPE_DOM_NODE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	l = _tmp0_;
	_tmp1_ = self->priv->_node;
	if (_tmp1_ == NULL) {
		result = (GeeList*) l;
		return result;
	}
	_tmp2_ = self->priv->_node;
	_tmp3_ = _tmp2_->children;
	n = _tmp3_;
	i = 0;
	while (TRUE) {
		xmlNode* _tmp4_;
		gboolean _tmp5_ = FALSE;
		xmlNode* _tmp11_;
		xmlNode* _tmp12_;
		gint _tmp13_;
		_tmp4_ = n;
		if (!(_tmp4_ != NULL)) {
			break;
		}
		if (i >= start) {
			_tmp5_ = i <= stop;
		} else {
			_tmp5_ = FALSE;
		}
		if (_tmp5_) {
			GeeArrayList* _tmp6_;
			GXmlXDocument* _tmp7_;
			xmlNode* _tmp8_;
			GXmlDomNode* _tmp9_;
			GXmlDomNode* _tmp10_;
			_tmp6_ = l;
			_tmp7_ = self->priv->_doc;
			_tmp8_ = n;
			_tmp9_ = gxml_xnode_to_gnode (_tmp7_, _tmp8_, FALSE);
			_tmp10_ = _tmp9_;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, _tmp10_);
			_g_object_unref0 (_tmp10_);
		}
		_tmp11_ = n;
		_tmp12_ = _tmp11_->next;
		n = _tmp12_;
		_tmp13_ = i;
		i = _tmp13_ + 1;
	}
	result = (GeeList*) l;
	return result;
}

static gboolean
gxml_xlist_children_real_add (GeeAbstractCollection* base,
                              GXmlDomNode* item)
{
	GXmlXListChildren * self;
	xmlNode* _tmp0_;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	xmlNode* _tmp3_;
	gboolean result;
	self = (GXmlXListChildren*) base;
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	gxml_xnode_release_node (G_TYPE_CHECK_INSTANCE_CAST (item, GXML_TYPE_XNODE, GXmlXNode));
	_tmp1_ = self->priv->_node;
	_tmp2_ = gxml_xnode_get_internal_node (G_TYPE_CHECK_INSTANCE_CAST (item, GXML_TYPE_XNODE, GXmlXNode));
	_tmp3_ = xmlAddChild (_tmp1_, _tmp2_);
	result = _tmp3_ != NULL;
	return result;
}

static void
gxml_xlist_children_real_clear (GeeAbstractCollection* base)
{
	GXmlXListChildren * self;
	xmlNode* _tmp0_;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	self = (GXmlXListChildren*) base;
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->children;
	xmlFreeNodeList (_tmp2_);
}

static gboolean
gxml_xlist_children_real_contains (GeeAbstractCollection* base,
                                   GXmlDomNode* item)
{
	GXmlXListChildren * self;
	xmlNode* _tmp0_;
	xmlNode* n = NULL;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	gboolean result;
	self = (GXmlXListChildren*) base;
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	if (!GXML_IS_XNODE (item)) {
		result = FALSE;
		return result;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->children;
	n = _tmp2_;
	while (TRUE) {
		xmlNode* _tmp3_;
		xmlNode* _tmp4_;
		xmlNode* _tmp5_;
		xmlNode* _tmp6_;
		xmlNode* _tmp7_;
		_tmp3_ = n;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = n;
		_tmp5_ = gxml_xnode_get_internal_node (G_TYPE_CHECK_INSTANCE_CAST (item, GXML_TYPE_XNODE, GXmlXNode));
		if (_tmp4_ == _tmp5_) {
			result = TRUE;
			return result;
		}
		_tmp6_ = n;
		_tmp7_ = _tmp6_->next;
		n = _tmp7_;
	}
	result = FALSE;
	return result;
}

static GeeIterator*
gxml_xlist_children_real_iterator (GeeAbstractCollection* base)
{
	GXmlXListChildren * self;
	GXmlXDocument* _tmp0_;
	xmlNode* _tmp1_;
	GXmlXListChildrenIterator* _tmp2_;
	GeeIterator* result;
	self = (GXmlXListChildren*) base;
	_tmp0_ = self->priv->_doc;
	_tmp1_ = self->priv->_node;
	_tmp2_ = gxml_xlist_children_iterator_new (_tmp0_, _tmp1_);
	result = (GeeIterator*) _tmp2_;
	return result;
}

static gboolean
gxml_xlist_children_real_remove (GeeAbstractCollection* base,
                                 GXmlDomNode* item)
{
	GXmlXListChildren * self;
	xmlNode* _tmp0_;
	xmlNode* n = NULL;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	gboolean result;
	self = (GXmlXListChildren*) base;
	g_return_val_if_fail (item != NULL, FALSE);
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	if (!GXML_IS_XNODE (item)) {
		result = FALSE;
		return result;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->children;
	n = _tmp2_;
	while (TRUE) {
		xmlNode* _tmp3_;
		xmlNode* _tmp4_;
		xmlNode* _tmp5_;
		xmlNode* _tmp7_;
		xmlNode* _tmp8_;
		_tmp3_ = n;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = n;
		_tmp5_ = gxml_xnode_get_internal_node (G_TYPE_CHECK_INSTANCE_CAST (item, GXML_TYPE_XNODE, GXmlXNode));
		if (_tmp4_ == _tmp5_) {
			xmlNode* _tmp6_;
			_tmp6_ = n;
			xmlUnlinkNode (_tmp6_);
			gxml_xnode_take_node (G_TYPE_CHECK_INSTANCE_CAST (item, GXML_TYPE_XNODE, GXmlXNode));
			result = TRUE;
			return result;
		}
		_tmp7_ = n;
		_tmp8_ = _tmp7_->next;
		n = _tmp8_;
	}
	result = FALSE;
	return result;
}

static gint
gxml_xlist_children_real_get_size (GeeAbstractCollection* base)
{
	gint result;
	GXmlXListChildren* self;
	xmlNode* _tmp0_;
	gint i = 0;
	xmlNode* n = NULL;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	self = (GXmlXListChildren*) base;
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = -1;
		return result;
	}
	i = 0;
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->children;
	n = _tmp2_;
	while (TRUE) {
		xmlNode* _tmp3_;
		gint _tmp4_;
		xmlNode* _tmp5_;
		xmlNode* _tmp6_;
		_tmp3_ = n;
		if (!(_tmp3_ != NULL)) {
			break;
		}
		_tmp4_ = i;
		i = _tmp4_ + 1;
		_tmp5_ = n;
		_tmp6_ = _tmp5_->next;
		n = _tmp6_;
	}
	result = i;
	return result;
}

static gboolean
gxml_xlist_children_real_get_read_only (GeeAbstractCollection* base)
{
	gboolean result;
	GXmlXListChildren* self;
	self = (GXmlXListChildren*) base;
	result = FALSE;
	return result;
}

static GXmlDomNode*
gxml_xlist_children_real_item (GXmlDomNodeList* base,
                               gint index)
{
	GXmlXListChildren * self;
	gpointer _tmp0_;
	GXmlDomNode* result;
	self = (GXmlXListChildren*) base;
	_tmp0_ = gee_abstract_list_get ((GeeAbstractList*) self, index);
	result = G_TYPE_CHECK_INSTANCE_CAST ((GXmlDomNode*) _tmp0_, GXML_TYPE_DOM_NODE, GXmlDomNode);
	return result;
}

static gint
gxml_xlist_children_real_get_length (GXmlDomNodeList* base)
{
	gint result;
	GXmlXListChildren* self;
	gint _tmp0_;
	gint _tmp1_;
	self = (GXmlXListChildren*) base;
	_tmp0_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) self);
	_tmp1_ = _tmp0_;
	result = _tmp1_;
	return result;
}

static GXmlDomElement*
gxml_xlist_children_real_get_element (GXmlDomHTMLCollection* base,
                                      gint index)
{
	GXmlXListChildren * self;
	gboolean _tmp0_ = FALSE;
	gint _tmp1_;
	gint _tmp2_;
	GXmlDomNode* e = NULL;
	gpointer _tmp3_;
	GXmlDomNode* _tmp4_;
	GXmlDomNode* _tmp5_;
	GXmlDomElement* _tmp6_;
	GXmlDomElement* result;
	self = (GXmlXListChildren*) base;
	_tmp1_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) self);
	_tmp2_ = _tmp1_;
	if (index > _tmp2_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = index < 0;
	}
	if (_tmp0_) {
		result = NULL;
		return result;
	}
	_tmp3_ = gee_abstract_list_get ((GeeAbstractList*) self, index);
	e = (GXmlDomNode*) _tmp3_;
	_tmp4_ = e;
	if (!GXML_IS_DOM_NODE (_tmp4_)) {
		result = NULL;
		_g_object_unref0 (e);
		return result;
	}
	_tmp5_ = e;
	_tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp5_, GXML_TYPE_DOM_ELEMENT, GXmlDomElement));
	result = _tmp6_;
	_g_object_unref0 (e);
	return result;
}

static inline gpointer
gxml_xlist_children_iterator_get_instance_private (GXmlXListChildrenIterator* self)
{
	return G_STRUCT_MEMBER_P (self, GXmlXListChildrenIterator_private_offset);
}

GXmlXListChildrenIterator*
gxml_xlist_children_iterator_construct (GType object_type,
                                        GXmlXDocument* doc,
                                        xmlNode* node)
{
	GXmlXListChildrenIterator * self = NULL;
	xmlNode* _tmp0_;
	xmlNode* _tmp1_;
	GXmlXDocument* _tmp2_;
	g_return_val_if_fail (doc != NULL, NULL);
	self = (GXmlXListChildrenIterator*) g_object_new (object_type, NULL);
	self->priv->_node = node;
	_tmp0_ = self->priv->_node;
	_tmp1_ = _tmp0_->children;
	self->priv->_current = _tmp1_;
	_tmp2_ = _g_object_ref0 (doc);
	_g_object_unref0 (self->priv->_doc);
	self->priv->_doc = _tmp2_;
	return self;
}

GXmlXListChildrenIterator*
gxml_xlist_children_iterator_new (GXmlXDocument* doc,
                                  xmlNode* node)
{
	return gxml_xlist_children_iterator_construct (GXML_XLIST_CHILDREN_TYPE_ITERATOR, doc, node);
}

/**
     * This method is ignored by default.
     */
static void
gxml_xlist_children_iterator_real_insert (GeeBidirListIterator* base,
                                          GXmlDomNode* item)
{
	GXmlXListChildrenIterator * self;
	self = (GXmlXListChildrenIterator*) base;
	g_return_if_fail (item != NULL);
}

/**
     * This method is ignored by default.
     */
static void
gxml_xlist_children_iterator_real_add (GeeListIterator* base,
                                       GXmlDomNode* item)
{
	GXmlXListChildrenIterator * self;
	self = (GXmlXListChildrenIterator*) base;
	g_return_if_fail (item != NULL);
}

static gint
gxml_xlist_children_iterator_real_index (GeeListIterator* base)
{
	GXmlXListChildrenIterator * self;
	gint result;
	self = (GXmlXListChildrenIterator*) base;
	result = self->priv->i;
	return result;
}

/**
     * This method is ignored by default.
     */
static void
gxml_xlist_children_iterator_real_set (GeeListIterator* base,
                                       GXmlDomNode* item)
{
	GXmlXListChildrenIterator * self;
	self = (GXmlXListChildrenIterator*) base;
	g_return_if_fail (item != NULL);
}

static GXmlDomNode*
gxml_xlist_children_iterator_real_get (GeeIterator* base)
{
	GXmlXListChildrenIterator * self;
	GXmlXDocument* _tmp0_;
	xmlNode* _tmp1_;
	GXmlDomNode* _tmp2_;
	GXmlDomNode* result;
	self = (GXmlXListChildrenIterator*) base;
	_tmp0_ = self->priv->_doc;
	_tmp1_ = self->priv->_node;
	_tmp2_ = gxml_xnode_to_gnode (_tmp0_, _tmp1_, FALSE);
	result = _tmp2_;
	return result;
}

static gboolean
gxml_xlist_children_iterator_real_has_next (GeeIterator* base)
{
	GXmlXListChildrenIterator * self;
	xmlNode* _tmp0_;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	xmlNode* _tmp3_;
	xmlNode* _tmp6_;
	xmlNode* _tmp7_;
	xmlNode* _tmp8_;
	gboolean result;
	self = (GXmlXListChildrenIterator*) base;
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->children;
	if (_tmp2_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp3_ = self->priv->_current;
	if (_tmp3_ != NULL) {
		xmlNode* _tmp4_;
		xmlNode* _tmp5_;
		_tmp4_ = self->priv->_current;
		_tmp5_ = _tmp4_->next;
		if (_tmp5_ != NULL) {
			result = TRUE;
			return result;
		}
	}
	_tmp6_ = self->priv->_node;
	_tmp7_ = _tmp6_->children;
	_tmp8_ = _tmp7_->next;
	result = _tmp8_ != NULL;
	return result;
}

static gboolean
gxml_xlist_children_iterator_real_next (GeeIterator* base)
{
	GXmlXListChildrenIterator * self;
	xmlNode* _tmp0_;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	xmlNode* _tmp5_;
	xmlNode* _tmp6_;
	xmlNode* _tmp7_;
	xmlNode* _tmp8_;
	gboolean result;
	self = (GXmlXListChildrenIterator*) base;
	if (!gee_iterator_has_next ((GeeIterator*) self)) {
		result = FALSE;
		return result;
	}
	_tmp0_ = self->priv->_node;
	_tmp1_ = _tmp0_->children;
	if (_tmp1_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp2_ = self->priv->_current;
	if (_tmp2_ == NULL) {
		xmlNode* _tmp3_;
		xmlNode* _tmp4_;
		_tmp3_ = self->priv->_node;
		_tmp4_ = _tmp3_->children;
		self->priv->_current = _tmp4_;
	}
	_tmp5_ = self->priv->_current;
	_tmp6_ = _tmp5_->next;
	if (_tmp6_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp7_ = self->priv->_current;
	_tmp8_ = _tmp7_->next;
	self->priv->_current = _tmp8_;
	result = TRUE;
	return result;
}

static void
gxml_xlist_children_iterator_real_remove (GeeIterator* base)
{
	GXmlXListChildrenIterator * self;
	xmlNode* _tmp0_;
	xmlNode* n = NULL;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	xmlNode* _tmp3_;
	xmlNode* _tmp4_;
	xmlNode* _tmp5_;
	self = (GXmlXListChildrenIterator*) base;
	_tmp0_ = self->priv->_current;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->_current;
	n = _tmp1_;
	_tmp2_ = self->priv->_current;
	_tmp3_ = _tmp2_->prev;
	self->priv->_current = _tmp3_;
	_tmp4_ = n;
	xmlUnlinkNode (_tmp4_);
	_tmp5_ = n;
	_xmlFreeNode0 (_tmp5_);
}

static gboolean
gxml_xlist_children_iterator_real_get_read_only (GeeIterator* base)
{
	gboolean result;
	GXmlXListChildrenIterator* self;
	self = (GXmlXListChildrenIterator*) base;
	result = FALSE;
	return result;
}

static gboolean
gxml_xlist_children_iterator_real_get_valid (GeeIterator* base)
{
	gboolean result;
	GXmlXListChildrenIterator* self;
	xmlNode* _tmp0_;
	self = (GXmlXListChildrenIterator*) base;
	_tmp0_ = self->priv->_current;
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
gxml_xlist_children_iterator_real_foreach (GeeTraversable* base,
                                           GeeForallFunc f,
                                           gpointer f_target)
{
	GXmlXListChildrenIterator * self;
	gboolean result;
	self = (GXmlXListChildrenIterator*) base;
	while (TRUE) {
		gpointer _tmp0_;
		if (!gee_iterator_has_next ((GeeIterator*) self)) {
			break;
		}
		gee_iterator_next ((GeeIterator*) self);
		_tmp0_ = gee_iterator_get ((GeeIterator*) self);
		if (!f ((GXmlDomNode*) _tmp0_, f_target)) {
			result = FALSE;
			return result;
		}
	}
	result = TRUE;
	return result;
}

static gboolean
gxml_xlist_children_iterator_real_first (GeeBidirIterator* base)
{
	GXmlXListChildrenIterator * self;
	xmlNode* _tmp0_;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	xmlNode* _tmp3_;
	xmlNode* _tmp4_;
	xmlNode* _tmp5_;
	gboolean result;
	self = (GXmlXListChildrenIterator*) base;
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->children;
	if (_tmp2_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp3_ = self->priv->_node;
	_tmp4_ = _tmp3_->children;
	self->priv->_current = _tmp4_;
	_tmp5_ = self->priv->_current;
	result = _tmp5_ != NULL;
	return result;
}

static gboolean
gxml_xlist_children_iterator_real_has_previous (GeeBidirIterator* base)
{
	GXmlXListChildrenIterator * self;
	xmlNode* _tmp0_;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	xmlNode* _tmp3_;
	xmlNode* _tmp4_;
	xmlNode* _tmp5_;
	gboolean result;
	self = (GXmlXListChildrenIterator*) base;
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->children;
	if (_tmp2_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp3_ = self->priv->_current;
	if (_tmp3_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp4_ = self->priv->_current;
	_tmp5_ = _tmp4_->prev;
	if (_tmp5_ == NULL) {
		result = FALSE;
		return result;
	}
	result = TRUE;
	return result;
}

static gboolean
gxml_xlist_children_iterator_real_last (GeeBidirIterator* base)
{
	GXmlXListChildrenIterator * self;
	xmlNode* _tmp0_;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	xmlNode* _tmp3_;
	xmlNode* _tmp4_;
	gboolean result;
	self = (GXmlXListChildrenIterator*) base;
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->children;
	if (_tmp2_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp3_ = self->priv->_node;
	_tmp4_ = _tmp3_->children;
	self->priv->_current = _tmp4_;
	while (TRUE) {
		xmlNode* _tmp5_;
		xmlNode* _tmp6_;
		xmlNode* _tmp7_;
		xmlNode* _tmp8_;
		_tmp5_ = self->priv->_current;
		_tmp6_ = _tmp5_->next;
		if (!(_tmp6_ != NULL)) {
			break;
		}
		_tmp7_ = self->priv->_current;
		_tmp8_ = _tmp7_->next;
		self->priv->_current = _tmp8_;
	}
	result = TRUE;
	return result;
}

static gboolean
gxml_xlist_children_iterator_real_previous (GeeBidirIterator* base)
{
	GXmlXListChildrenIterator * self;
	xmlNode* _tmp0_;
	xmlNode* _tmp1_;
	xmlNode* _tmp2_;
	xmlNode* _tmp3_;
	gboolean result;
	self = (GXmlXListChildrenIterator*) base;
	_tmp0_ = self->priv->_node;
	if (_tmp0_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp1_ = self->priv->_node;
	_tmp2_ = _tmp1_->children;
	if (_tmp2_ == NULL) {
		result = FALSE;
		return result;
	}
	_tmp3_ = self->priv->_current;
	if (_tmp3_ == NULL) {
		xmlNode* _tmp4_;
		xmlNode* _tmp5_;
		_tmp4_ = self->priv->_node;
		_tmp5_ = _tmp4_->children;
		self->priv->_current = _tmp5_;
		result = TRUE;
		return result;
	}
	while (TRUE) {
		xmlNode* _tmp6_;
		xmlNode* _tmp7_;
		xmlNode* _tmp8_;
		xmlNode* _tmp9_;
		_tmp6_ = self->priv->_current;
		_tmp7_ = _tmp6_->prev;
		if (!(_tmp7_ != NULL)) {
			break;
		}
		_tmp8_ = self->priv->_current;
		_tmp9_ = _tmp8_->prev;
		self->priv->_current = _tmp9_;
	}
	result = TRUE;
	return result;
}

static void
gxml_xlist_children_iterator_class_init (GXmlXListChildrenIteratorClass * klass,
                                         gpointer klass_data)
{
	gxml_xlist_children_iterator_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GXmlXListChildrenIterator_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_xlist_children_iterator_get_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_xlist_children_iterator_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XLIST_CHILDREN_ITERATOR_READ_ONLY_PROPERTY, gxml_xlist_children_iterator_properties[GXML_XLIST_CHILDREN_ITERATOR_READ_ONLY_PROPERTY] = g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XLIST_CHILDREN_ITERATOR_VALID_PROPERTY, gxml_xlist_children_iterator_properties[GXML_XLIST_CHILDREN_ITERATOR_VALID_PROPERTY] = g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static GType
gxml_xlist_children_iterator_gee_traversable_get_g_type (GXmlXListChildrenIterator* self)
{
	return (GType) GXML_TYPE_DOM_NODE;
}

static GBoxedCopyFunc
gxml_xlist_children_iterator_gee_traversable_get_g_dup_func (GXmlXListChildrenIterator* self)
{
	return (GBoxedCopyFunc) g_object_ref;
}

static GDestroyNotify
gxml_xlist_children_iterator_gee_traversable_get_g_destroy_func (GXmlXListChildrenIterator* self)
{
	return (GDestroyNotify) g_object_unref;
}

static void
gxml_xlist_children_iterator_gee_traversable_interface_init (GeeTraversableIface * iface,
                                                             gpointer iface_data)
{
	gxml_xlist_children_iterator_gee_traversable_parent_iface = g_type_interface_peek_parent (iface);
	iface->foreach = (gboolean (*) (GeeTraversable*, GeeForallFunc, gpointer)) gxml_xlist_children_iterator_real_foreach;
	iface->get_g_type = (GType (*) (GeeTraversable *)) gxml_xlist_children_iterator_gee_traversable_get_g_type;
	iface->get_g_dup_func = (GBoxedCopyFunc (*) (GeeTraversable *)) gxml_xlist_children_iterator_gee_traversable_get_g_dup_func;
	iface->get_g_destroy_func = (GDestroyNotify (*) (GeeTraversable *)) gxml_xlist_children_iterator_gee_traversable_get_g_destroy_func;
}

static void
gxml_xlist_children_iterator_gee_iterator_interface_init (GeeIteratorIface * iface,
                                                          gpointer iface_data)
{
	gxml_xlist_children_iterator_gee_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->get = (gpointer (*) (GeeIterator*)) gxml_xlist_children_iterator_real_get;
	iface->has_next = (gboolean (*) (GeeIterator*)) gxml_xlist_children_iterator_real_has_next;
	iface->next = (gboolean (*) (GeeIterator*)) gxml_xlist_children_iterator_real_next;
	iface->remove = (void (*) (GeeIterator*)) gxml_xlist_children_iterator_real_remove;
	iface->get_read_only = gxml_xlist_children_iterator_real_get_read_only;
	iface->get_valid = gxml_xlist_children_iterator_real_get_valid;
}

static GType
gxml_xlist_children_iterator_gee_bidir_iterator_get_g_type (GXmlXListChildrenIterator* self)
{
	return (GType) GXML_TYPE_DOM_NODE;
}

static GBoxedCopyFunc
gxml_xlist_children_iterator_gee_bidir_iterator_get_g_dup_func (GXmlXListChildrenIterator* self)
{
	return (GBoxedCopyFunc) g_object_ref;
}

static GDestroyNotify
gxml_xlist_children_iterator_gee_bidir_iterator_get_g_destroy_func (GXmlXListChildrenIterator* self)
{
	return (GDestroyNotify) g_object_unref;
}

static void
gxml_xlist_children_iterator_gee_bidir_iterator_interface_init (GeeBidirIteratorIface * iface,
                                                                gpointer iface_data)
{
	gxml_xlist_children_iterator_gee_bidir_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->first = (gboolean (*) (GeeBidirIterator*)) gxml_xlist_children_iterator_real_first;
	iface->has_previous = (gboolean (*) (GeeBidirIterator*)) gxml_xlist_children_iterator_real_has_previous;
	iface->last = (gboolean (*) (GeeBidirIterator*)) gxml_xlist_children_iterator_real_last;
	iface->previous = (gboolean (*) (GeeBidirIterator*)) gxml_xlist_children_iterator_real_previous;
	iface->get_g_type = (GType (*) (GeeBidirIterator *)) gxml_xlist_children_iterator_gee_bidir_iterator_get_g_type;
	iface->get_g_dup_func = (GBoxedCopyFunc (*) (GeeBidirIterator *)) gxml_xlist_children_iterator_gee_bidir_iterator_get_g_dup_func;
	iface->get_g_destroy_func = (GDestroyNotify (*) (GeeBidirIterator *)) gxml_xlist_children_iterator_gee_bidir_iterator_get_g_destroy_func;
}

static void
gxml_xlist_children_iterator_gee_list_iterator_interface_init (GeeListIteratorIface * iface,
                                                               gpointer iface_data)
{
	gxml_xlist_children_iterator_gee_list_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->add = (void (*) (GeeListIterator*, gconstpointer)) gxml_xlist_children_iterator_real_add;
	iface->index = (gint (*) (GeeListIterator*)) gxml_xlist_children_iterator_real_index;
	iface->set = (void (*) (GeeListIterator*, gconstpointer)) gxml_xlist_children_iterator_real_set;
}

static GType
gxml_xlist_children_iterator_gee_bidir_list_iterator_get_g_type (GXmlXListChildrenIterator* self)
{
	return (GType) GXML_TYPE_DOM_NODE;
}

static GBoxedCopyFunc
gxml_xlist_children_iterator_gee_bidir_list_iterator_get_g_dup_func (GXmlXListChildrenIterator* self)
{
	return (GBoxedCopyFunc) g_object_ref;
}

static GDestroyNotify
gxml_xlist_children_iterator_gee_bidir_list_iterator_get_g_destroy_func (GXmlXListChildrenIterator* self)
{
	return (GDestroyNotify) g_object_unref;
}

static void
gxml_xlist_children_iterator_gee_bidir_list_iterator_interface_init (GeeBidirListIteratorIface * iface,
                                                                     gpointer iface_data)
{
	gxml_xlist_children_iterator_gee_bidir_list_iterator_parent_iface = g_type_interface_peek_parent (iface);
	iface->insert = (void (*) (GeeBidirListIterator*, gconstpointer)) gxml_xlist_children_iterator_real_insert;
	iface->get_g_type = (GType (*) (GeeBidirListIterator *)) gxml_xlist_children_iterator_gee_bidir_list_iterator_get_g_type;
	iface->get_g_dup_func = (GBoxedCopyFunc (*) (GeeBidirListIterator *)) gxml_xlist_children_iterator_gee_bidir_list_iterator_get_g_dup_func;
	iface->get_g_destroy_func = (GDestroyNotify (*) (GeeBidirListIterator *)) gxml_xlist_children_iterator_gee_bidir_list_iterator_get_g_destroy_func;
}

static void
gxml_xlist_children_iterator_instance_init (GXmlXListChildrenIterator * self,
                                            gpointer klass)
{
	self->priv = gxml_xlist_children_iterator_get_instance_private (self);
	self->priv->i = 0;
}

static void
gxml_xlist_children_iterator_finalize (GObject * obj)
{
	GXmlXListChildrenIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_XLIST_CHILDREN_TYPE_ITERATOR, GXmlXListChildrenIterator);
	_g_object_unref0 (self->priv->_doc);
	G_OBJECT_CLASS (gxml_xlist_children_iterator_parent_class)->finalize (obj);
}

static GType
gxml_xlist_children_iterator_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlXListChildrenIteratorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_xlist_children_iterator_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlXListChildrenIterator), 0, (GInstanceInitFunc) gxml_xlist_children_iterator_instance_init, NULL };
	static const GInterfaceInfo gee_traversable_info = { (GInterfaceInitFunc) gxml_xlist_children_iterator_gee_traversable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gee_iterator_info = { (GInterfaceInitFunc) gxml_xlist_children_iterator_gee_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gee_bidir_iterator_info = { (GInterfaceInitFunc) gxml_xlist_children_iterator_gee_bidir_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gee_list_iterator_info = { (GInterfaceInitFunc) gxml_xlist_children_iterator_gee_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gee_bidir_list_iterator_info = { (GInterfaceInitFunc) gxml_xlist_children_iterator_gee_bidir_list_iterator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gxml_xlist_children_iterator_type_id;
	gxml_xlist_children_iterator_type_id = g_type_register_static (G_TYPE_OBJECT, "GXmlXListChildrenIterator", &g_define_type_info, 0);
	g_type_add_interface_static (gxml_xlist_children_iterator_type_id, GEE_TYPE_TRAVERSABLE, &gee_traversable_info);
	g_type_add_interface_static (gxml_xlist_children_iterator_type_id, GEE_TYPE_ITERATOR, &gee_iterator_info);
	g_type_add_interface_static (gxml_xlist_children_iterator_type_id, GEE_TYPE_BIDIR_ITERATOR, &gee_bidir_iterator_info);
	g_type_add_interface_static (gxml_xlist_children_iterator_type_id, GEE_TYPE_LIST_ITERATOR, &gee_list_iterator_info);
	g_type_add_interface_static (gxml_xlist_children_iterator_type_id, GEE_TYPE_BIDIR_LIST_ITERATOR, &gee_bidir_list_iterator_info);
	GXmlXListChildrenIterator_private_offset = g_type_add_instance_private (gxml_xlist_children_iterator_type_id, sizeof (GXmlXListChildrenIteratorPrivate));
	return gxml_xlist_children_iterator_type_id;
}

GType
gxml_xlist_children_iterator_get_type (void)
{
	static volatile gsize gxml_xlist_children_iterator_type_id__once = 0;
	if (g_once_init_enter (&gxml_xlist_children_iterator_type_id__once)) {
		GType gxml_xlist_children_iterator_type_id;
		gxml_xlist_children_iterator_type_id = gxml_xlist_children_iterator_get_type_once ();
		g_once_init_leave (&gxml_xlist_children_iterator_type_id__once, gxml_xlist_children_iterator_type_id);
	}
	return gxml_xlist_children_iterator_type_id__once;
}

static void
_vala_gxml_xlist_children_iterator_get_property (GObject * object,
                                                 guint property_id,
                                                 GValue * value,
                                                 GParamSpec * pspec)
{
	GXmlXListChildrenIterator * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_XLIST_CHILDREN_TYPE_ITERATOR, GXmlXListChildrenIterator);
	switch (property_id) {
		case GXML_XLIST_CHILDREN_ITERATOR_READ_ONLY_PROPERTY:
		g_value_set_boolean (value, gee_iterator_get_read_only ((GeeIterator*) self));
		break;
		case GXML_XLIST_CHILDREN_ITERATOR_VALID_PROPERTY:
		g_value_set_boolean (value, gee_iterator_get_valid ((GeeIterator*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
gxml_xlist_children_class_init (GXmlXListChildrenClass * klass,
                                gpointer klass_data)
{
	gxml_xlist_children_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &GXmlXListChildren_private_offset);
	((GeeAbstractBidirListClass *) klass)->bidir_list_iterator = (GeeBidirListIterator* (*) (GeeAbstractBidirList*)) gxml_xlist_children_real_bidir_list_iterator;
	((GeeAbstractListClass *) klass)->get = (gpointer (*) (GeeAbstractList*, gint)) gxml_xlist_children_real_get;
	((GeeAbstractListClass *) klass)->index_of = (gint (*) (GeeAbstractList*, gconstpointer)) gxml_xlist_children_real_index_of;
	((GeeAbstractListClass *) klass)->insert = (void (*) (GeeAbstractList*, gint, gconstpointer)) gxml_xlist_children_real_insert;
	((GeeAbstractListClass *) klass)->list_iterator = (GeeListIterator* (*) (GeeAbstractList*)) gxml_xlist_children_real_list_iterator;
	((GeeAbstractListClass *) klass)->remove_at = (gpointer (*) (GeeAbstractList*, gint)) gxml_xlist_children_real_remove_at;
	((GeeAbstractListClass *) klass)->set = (void (*) (GeeAbstractList*, gint, gconstpointer)) gxml_xlist_children_real_set;
	((GeeAbstractListClass *) klass)->slice = (GeeList* (*) (GeeAbstractList*, gint, gint)) gxml_xlist_children_real_slice;
	((GeeAbstractCollectionClass *) klass)->add = (gboolean (*) (GeeAbstractCollection*, gconstpointer)) gxml_xlist_children_real_add;
	((GeeAbstractCollectionClass *) klass)->clear = (void (*) (GeeAbstractCollection*)) gxml_xlist_children_real_clear;
	((GeeAbstractCollectionClass *) klass)->contains = (gboolean (*) (GeeAbstractCollection*, gconstpointer)) gxml_xlist_children_real_contains;
	((GeeAbstractCollectionClass *) klass)->iterator = (GeeIterator* (*) (GeeAbstractCollection*)) gxml_xlist_children_real_iterator;
	((GeeAbstractCollectionClass *) klass)->remove = (gboolean (*) (GeeAbstractCollection*, gconstpointer)) gxml_xlist_children_real_remove;
	GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_size = (gint (*) (GeeAbstractCollection*)) gxml_xlist_children_real_get_size;
	GEE_ABSTRACT_COLLECTION_CLASS (klass)->get_read_only = (gboolean (*) (GeeAbstractCollection*)) gxml_xlist_children_real_get_read_only;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_xlist_children_get_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_xlist_children_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XLIST_CHILDREN_SIZE_PROPERTY, gxml_xlist_children_properties[GXML_XLIST_CHILDREN_SIZE_PROPERTY] = g_param_spec_int ("size", "size", "size", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XLIST_CHILDREN_READ_ONLY_PROPERTY, gxml_xlist_children_properties[GXML_XLIST_CHILDREN_READ_ONLY_PROPERTY] = g_param_spec_boolean ("read-only", "read-only", "read-only", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_XLIST_CHILDREN_LENGTH_PROPERTY, gxml_xlist_children_properties[GXML_XLIST_CHILDREN_LENGTH_PROPERTY] = g_param_spec_int ("length", "length", "length", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gxml_xlist_children_gxml_dom_node_list_interface_init (GXmlDomNodeListIface * iface,
                                                       gpointer iface_data)
{
	gxml_xlist_children_gxml_dom_node_list_parent_iface = g_type_interface_peek_parent (iface);
	iface->item = (GXmlDomNode* (*) (GXmlDomNodeList*, gint)) gxml_xlist_children_real_item;
	iface->get_length = gxml_xlist_children_real_get_length;
}

static void
gxml_xlist_children_gxml_dom_html_collection_interface_init (GXmlDomHTMLCollectionIface * iface,
                                                             gpointer iface_data)
{
	gxml_xlist_children_gxml_dom_html_collection_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_element = (GXmlDomElement* (*) (GXmlDomHTMLCollection*, gint)) gxml_xlist_children_real_get_element;
}

static void
gxml_xlist_children_instance_init (GXmlXListChildren * self,
                                   gpointer klass)
{
	self->priv = gxml_xlist_children_get_instance_private (self);
}

static void
gxml_xlist_children_finalize (GObject * obj)
{
	GXmlXListChildren * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_XLIST_CHILDREN, GXmlXListChildren);
	_g_object_unref0 (self->priv->_doc);
	G_OBJECT_CLASS (gxml_xlist_children_parent_class)->finalize (obj);
}

/**
 * A {@link Gee.AbstractBidirList} implementation to access {@link Xml.Node} collection
 */
static GType
gxml_xlist_children_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (GXmlXListChildrenClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_xlist_children_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlXListChildren), 0, (GInstanceInitFunc) gxml_xlist_children_instance_init, NULL };
	static const GInterfaceInfo gxml_dom_node_list_info = { (GInterfaceInitFunc) gxml_xlist_children_gxml_dom_node_list_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	static const GInterfaceInfo gxml_dom_html_collection_info = { (GInterfaceInitFunc) gxml_xlist_children_gxml_dom_html_collection_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType gxml_xlist_children_type_id;
	gxml_xlist_children_type_id = g_type_register_static (GEE_TYPE_ABSTRACT_BIDIR_LIST, "GXmlXListChildren", &g_define_type_info, 0);
	g_type_add_interface_static (gxml_xlist_children_type_id, GXML_TYPE_DOM_NODE_LIST, &gxml_dom_node_list_info);
	g_type_add_interface_static (gxml_xlist_children_type_id, GXML_TYPE_DOM_HTML_COLLECTION, &gxml_dom_html_collection_info);
	GXmlXListChildren_private_offset = g_type_add_instance_private (gxml_xlist_children_type_id, sizeof (GXmlXListChildrenPrivate));
	return gxml_xlist_children_type_id;
}

GType
gxml_xlist_children_get_type (void)
{
	static volatile gsize gxml_xlist_children_type_id__once = 0;
	if (g_once_init_enter (&gxml_xlist_children_type_id__once)) {
		GType gxml_xlist_children_type_id;
		gxml_xlist_children_type_id = gxml_xlist_children_get_type_once ();
		g_once_init_leave (&gxml_xlist_children_type_id__once, gxml_xlist_children_type_id);
	}
	return gxml_xlist_children_type_id__once;
}

static void
_vala_gxml_xlist_children_get_property (GObject * object,
                                        guint property_id,
                                        GValue * value,
                                        GParamSpec * pspec)
{
	GXmlXListChildren * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_XLIST_CHILDREN, GXmlXListChildren);
	switch (property_id) {
		case GXML_XLIST_CHILDREN_SIZE_PROPERTY:
		g_value_set_int (value, gee_abstract_collection_get_size ((GeeAbstractCollection*) self));
		break;
		case GXML_XLIST_CHILDREN_READ_ONLY_PROPERTY:
		g_value_set_boolean (value, gee_abstract_collection_get_read_only ((GeeAbstractCollection*) self));
		break;
		case GXML_XLIST_CHILDREN_LENGTH_PROPERTY:
		g_value_set_int (value, gxml_dom_node_list_get_length ((GXmlDomNodeList*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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;
}

