/* libxml-NodeChildNodeList.c generated by valac 0.28.1, the Vala compiler
 * generated from libxml-NodeChildNodeList.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 0; tab-width: 2 -*- */
/* NodeList.vala
 *
 * Copyright (C) 2011-2013  Richard Schwarting <aquarichy@gmail.com>
 * Copyright (C) 2013-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, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Authors:
 *      Richard Schwarting <aquarichy@gmail.com>
 *      Daniel Espinosa <esodan@gmail.com>
 */
/* /* TODO: warning: this list should NOT be edited :(*/
/*    we need a new, better live AttrNodeList :| * /*/
/* internal class AttrNodeList : GListNodeList {*/
/* 	internal AttrNodeList (xNode root, xDocument owner) {*/
/* 		base (root);*/
/* 		base.nodes = root.attributes.get_values ();*/
/* 	}*/
/* }*/

#include <glib.h>
#include <glib-object.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <libxml/tree.h>


#define GXML_TYPE_XNODE_LIST (gxml_xnode_list_get_type ())
#define GXML_XNODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XNODE_LIST, GXmlxNodeList))
#define GXML_IS_XNODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XNODE_LIST))
#define GXML_XNODE_LIST_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_XNODE_LIST, GXmlxNodeListIface))

typedef struct _GXmlxNodeList GXmlxNodeList;
typedef struct _GXmlxNodeListIface GXmlxNodeListIface;

#define GXML_TYPE_XNODE (gxml_xnode_get_type ())
#define GXML_XNODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XNODE, GXmlxNode))
#define GXML_XNODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_XNODE, GXmlxNodeClass))
#define GXML_IS_XNODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XNODE))
#define GXML_IS_XNODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_XNODE))
#define GXML_XNODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_XNODE, GXmlxNodeClass))

typedef struct _GXmlxNode GXmlxNode;
typedef struct _GXmlxNodeClass GXmlxNodeClass;

#define GXML_TYPE_CHILD_NODE_LIST (gxml_child_node_list_get_type ())
#define GXML_CHILD_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_CHILD_NODE_LIST, GXmlChildNodeList))
#define GXML_CHILD_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_CHILD_NODE_LIST, GXmlChildNodeListClass))
#define GXML_IS_CHILD_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_CHILD_NODE_LIST))
#define GXML_IS_CHILD_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_CHILD_NODE_LIST))
#define GXML_CHILD_NODE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_CHILD_NODE_LIST, GXmlChildNodeListClass))

typedef struct _GXmlChildNodeList GXmlChildNodeList;
typedef struct _GXmlChildNodeListClass GXmlChildNodeListClass;
typedef struct _GXmlChildNodeListPrivate GXmlChildNodeListPrivate;

#define GXML_TYPE_XDOCUMENT (gxml_xdocument_get_type ())
#define GXML_XDOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_XDOCUMENT, GXmlxDocument))
#define GXML_XDOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_XDOCUMENT, GXmlxDocumentClass))
#define GXML_IS_XDOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_XDOCUMENT))
#define GXML_IS_XDOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_XDOCUMENT))
#define GXML_XDOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_XDOCUMENT, GXmlxDocumentClass))

typedef struct _GXmlxDocument GXmlxDocument;
typedef struct _GXmlxDocumentClass GXmlxDocumentClass;

#define GXML_TYPE_NODE_CHILD_NODE_LIST (gxml_node_child_node_list_get_type ())
#define GXML_NODE_CHILD_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NODE_CHILD_NODE_LIST, GXmlNodeChildNodeList))
#define GXML_NODE_CHILD_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_NODE_CHILD_NODE_LIST, GXmlNodeChildNodeListClass))
#define GXML_IS_NODE_CHILD_NODE_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NODE_CHILD_NODE_LIST))
#define GXML_IS_NODE_CHILD_NODE_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_NODE_CHILD_NODE_LIST))
#define GXML_NODE_CHILD_NODE_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_NODE_CHILD_NODE_LIST, GXmlNodeChildNodeListClass))

typedef struct _GXmlNodeChildNodeList GXmlNodeChildNodeList;
typedef struct _GXmlNodeChildNodeListClass GXmlNodeChildNodeListClass;
typedef struct _GXmlNodeChildNodeListPrivate GXmlNodeChildNodeListPrivate;

struct _GXmlxNodeListIface {
	GTypeInterface parent_iface;
	GXmlxNode* (*item) (GXmlxNodeList* self, gulong idx);
	GXmlxNode* (*insert_before) (GXmlxNodeList* self, GXmlxNode* new_child, GXmlxNode* ref_child);
	GXmlxNode* (*replace_child) (GXmlxNodeList* self, GXmlxNode* new_child, GXmlxNode* old_child);
	GXmlxNode* (*remove_child) (GXmlxNodeList* self, GXmlxNode* old_child);
	GXmlxNode* (*append_child) (GXmlxNodeList* self, GXmlxNode* new_child);
	gchar* (*to_string) (GXmlxNodeList* self, gboolean in_line);
	GXmlxNode* (*first) (GXmlxNodeList* self);
	GXmlxNode* (*last) (GXmlxNodeList* self);
	GXmlxNode* (*get) (GXmlxNodeList* self, gint n);
	gulong (*get_length) (GXmlxNodeList* self);
	void (*set_length) (GXmlxNodeList* self, gulong value);
};

struct _GXmlChildNodeList {
	GeeAbstractBidirList parent_instance;
	GXmlChildNodeListPrivate * priv;
	GXmlxDocument* owner;
};

struct _GXmlChildNodeListClass {
	GeeAbstractBidirListClass parent_class;
	GXmlxNode* (*append_child) (GXmlChildNodeList* self, GXmlxNode* new_child);
	xmlNode* (*get_head) (GXmlChildNodeList* self);
	void (*set_head) (GXmlChildNodeList* self, xmlNode* value);
	xmlNode* (*get_parent_as_xmlnode) (GXmlChildNodeList* self);
};

struct _GXmlNodeChildNodeList {
	GXmlChildNodeList parent_instance;
	GXmlNodeChildNodeListPrivate * priv;
};

struct _GXmlNodeChildNodeListClass {
	GXmlChildNodeListClass parent_class;
};

struct _GXmlNodeChildNodeListPrivate {
	xmlNode* parent;
};


static gpointer gxml_node_child_node_list_parent_class = NULL;

GType gxml_xnode_get_type (void) G_GNUC_CONST;
GType gxml_xnode_list_get_type (void) G_GNUC_CONST;
GType gxml_child_node_list_get_type (void) G_GNUC_CONST;
GType gxml_xdocument_get_type (void) G_GNUC_CONST;
GType gxml_node_child_node_list_get_type (void) G_GNUC_CONST;
#define GXML_NODE_CHILD_NODE_LIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GXML_TYPE_NODE_CHILD_NODE_LIST, GXmlNodeChildNodeListPrivate))
enum  {
	GXML_NODE_CHILD_NODE_LIST_DUMMY_PROPERTY,
	GXML_NODE_CHILD_NODE_LIST_HEAD,
	GXML_NODE_CHILD_NODE_LIST_PARENT_AS_XMLNODE
};
GXmlNodeChildNodeList* gxml_node_child_node_list_new (xmlNode* parent, GXmlxDocument* owner);
GXmlNodeChildNodeList* gxml_node_child_node_list_construct (GType object_type, xmlNode* parent, GXmlxDocument* owner);
GXmlChildNodeList* gxml_child_node_list_construct (GType object_type);
static void gxml_node_child_node_list_finalize (GObject* obj);
xmlNode* gxml_child_node_list_get_head (GXmlChildNodeList* self);
xmlNode* gxml_child_node_list_get_parent_as_xmlnode (GXmlChildNodeList* self);
static void _vala_gxml_node_child_node_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
void gxml_child_node_list_set_head (GXmlChildNodeList* self, xmlNode* value);
static void _vala_gxml_node_child_node_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


GXmlNodeChildNodeList* gxml_node_child_node_list_construct (GType object_type, xmlNode* parent, GXmlxDocument* owner) {
	GXmlNodeChildNodeList * self = NULL;
	xmlNode* _tmp0_ = NULL;
	GXmlxDocument* _tmp1_ = NULL;
	g_return_val_if_fail (owner != NULL, NULL);
	self = (GXmlNodeChildNodeList*) gxml_child_node_list_construct (object_type);
	_tmp0_ = parent;
	self->priv->parent = _tmp0_;
	_tmp1_ = owner;
	((GXmlChildNodeList*) self)->owner = _tmp1_;
	return self;
}


GXmlNodeChildNodeList* gxml_node_child_node_list_new (xmlNode* parent, GXmlxDocument* owner) {
	return gxml_node_child_node_list_construct (GXML_TYPE_NODE_CHILD_NODE_LIST, parent, owner);
}


static xmlNode* gxml_node_child_node_list_real_get_head (GXmlChildNodeList* base) {
	xmlNode* result;
	GXmlNodeChildNodeList* self;
	xmlNode* _tmp0_ = NULL;
	xmlNode* _tmp1_ = NULL;
	self = (GXmlNodeChildNodeList*) base;
	_tmp0_ = self->priv->parent;
	_tmp1_ = _tmp0_->children;
	result = _tmp1_;
	return result;
}


static void gxml_node_child_node_list_real_set_head (GXmlChildNodeList* base, xmlNode* value) {
	GXmlNodeChildNodeList* self;
	xmlNode* _tmp0_ = NULL;
	xmlNode* _tmp1_ = NULL;
	self = (GXmlNodeChildNodeList*) base;
	_tmp0_ = self->priv->parent;
	_tmp1_ = value;
	_tmp0_->children = _tmp1_;
	g_object_notify ((GObject *) self, "head");
}


static xmlNode* gxml_node_child_node_list_real_get_parent_as_xmlnode (GXmlChildNodeList* base) {
	xmlNode* result;
	GXmlNodeChildNodeList* self;
	xmlNode* _tmp0_ = NULL;
	self = (GXmlNodeChildNodeList*) base;
	_tmp0_ = self->priv->parent;
	result = _tmp0_;
	return result;
}


static void gxml_node_child_node_list_class_init (GXmlNodeChildNodeListClass * klass) {
	gxml_node_child_node_list_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (GXmlNodeChildNodeListPrivate));
	GXML_CHILD_NODE_LIST_CLASS (klass)->get_head = gxml_node_child_node_list_real_get_head;
	GXML_CHILD_NODE_LIST_CLASS (klass)->set_head = gxml_node_child_node_list_real_set_head;
	GXML_CHILD_NODE_LIST_CLASS (klass)->get_parent_as_xmlnode = gxml_node_child_node_list_real_get_parent_as_xmlnode;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_node_child_node_list_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_node_child_node_list_set_property;
	G_OBJECT_CLASS (klass)->finalize = gxml_node_child_node_list_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_NODE_CHILD_NODE_LIST_HEAD, g_param_spec_pointer ("head", "head", "head", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_NODE_CHILD_NODE_LIST_PARENT_AS_XMLNODE, g_param_spec_pointer ("parent-as-xmlnode", "parent-as-xmlnode", "parent-as-xmlnode", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void gxml_node_child_node_list_instance_init (GXmlNodeChildNodeList * self) {
	self->priv = GXML_NODE_CHILD_NODE_LIST_GET_PRIVATE (self);
}


static void gxml_node_child_node_list_finalize (GObject* obj) {
	GXmlNodeChildNodeList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_NODE_CHILD_NODE_LIST, GXmlNodeChildNodeList);
	G_OBJECT_CLASS (gxml_node_child_node_list_parent_class)->finalize (obj);
}


GType gxml_node_child_node_list_get_type (void) {
	static volatile gsize gxml_node_child_node_list_type_id__volatile = 0;
	if (g_once_init_enter (&gxml_node_child_node_list_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GXmlNodeChildNodeListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_node_child_node_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlNodeChildNodeList), 0, (GInstanceInitFunc) gxml_node_child_node_list_instance_init, NULL };
		GType gxml_node_child_node_list_type_id;
		gxml_node_child_node_list_type_id = g_type_register_static (GXML_TYPE_CHILD_NODE_LIST, "GXmlNodeChildNodeList", &g_define_type_info, 0);
		g_once_init_leave (&gxml_node_child_node_list_type_id__volatile, gxml_node_child_node_list_type_id);
	}
	return gxml_node_child_node_list_type_id__volatile;
}


static void _vala_gxml_node_child_node_list_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	GXmlNodeChildNodeList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_NODE_CHILD_NODE_LIST, GXmlNodeChildNodeList);
	switch (property_id) {
		case GXML_NODE_CHILD_NODE_LIST_HEAD:
		g_value_set_pointer (value, gxml_child_node_list_get_head ((GXmlChildNodeList*) self));
		break;
		case GXML_NODE_CHILD_NODE_LIST_PARENT_AS_XMLNODE:
		g_value_set_pointer (value, gxml_child_node_list_get_parent_as_xmlnode ((GXmlChildNodeList*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_gxml_node_child_node_list_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	GXmlNodeChildNodeList * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_NODE_CHILD_NODE_LIST, GXmlNodeChildNodeList);
	switch (property_id) {
		case GXML_NODE_CHILD_NODE_LIST_HEAD:
		gxml_child_node_list_set_head ((GXmlChildNodeList*) self, g_value_get_pointer (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



