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

/* TAttribute.vala
 *
 * Copyright (C) 2015-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 <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <gio/gio.h>
#include <libxml/xmlwriter.h>

#define GXML_TYPE_NODE (gxml_node_get_type ())
#define GXML_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NODE, GXmlNode))
#define GXML_IS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NODE))
#define GXML_NODE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_NODE, GXmlNodeIface))

typedef struct _GXmlNode GXmlNode;
typedef struct _GXmlNodeIface GXmlNodeIface;

#define GXML_TYPE_ELEMENT_LIST (gxml_element_list_get_type ())
#define GXML_ELEMENT_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_ELEMENT_LIST, GXmlElementList))
#define GXML_ELEMENT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_ELEMENT_LIST, GXmlElementListClass))
#define GXML_IS_ELEMENT_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_ELEMENT_LIST))
#define GXML_IS_ELEMENT_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_ELEMENT_LIST))
#define GXML_ELEMENT_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_ELEMENT_LIST, GXmlElementListClass))

typedef struct _GXmlElementList GXmlElementList;
typedef struct _GXmlElementListClass GXmlElementListClass;

#define GXML_TYPE_NAMESPACE (gxml_namespace_get_type ())
#define GXML_NAMESPACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_NAMESPACE, GXmlNamespace))
#define GXML_IS_NAMESPACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_NAMESPACE))
#define GXML_NAMESPACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_NAMESPACE, GXmlNamespaceIface))

typedef struct _GXmlNamespace GXmlNamespace;
typedef struct _GXmlNamespaceIface GXmlNamespaceIface;
typedef enum  {
	GXML_NODE_TYPE_INVALID = 0,
	GXML_NODE_TYPE_ELEMENT = 1,
	GXML_NODE_TYPE_ATTRIBUTE,
	GXML_NODE_TYPE_TEXT,
	GXML_NODE_TYPE_CDATA_SECTION,
	GXML_NODE_TYPE_ENTITY_REFERENCE,
	GXML_NODE_TYPE_ENTITY,
	GXML_NODE_TYPE_PROCESSING_INSTRUCTION,
	GXML_NODE_TYPE_COMMENT,
	GXML_NODE_TYPE_DOCUMENT,
	GXML_NODE_TYPE_DOCUMENT_TYPE,
	GXML_NODE_TYPE_DOCUMENT_FRAGMENT,
	GXML_NODE_TYPE_NOTATION
} GXmlNodeType;

#define GXML_TYPE_NODE_TYPE (gxml_node_type_get_type ())

#define GXML_TYPE_DOCUMENT (gxml_document_get_type ())
#define GXML_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_DOCUMENT, GXmlDocument))
#define GXML_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_DOCUMENT))
#define GXML_DOCUMENT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_DOCUMENT, GXmlDocumentIface))

typedef struct _GXmlDocument GXmlDocument;
typedef struct _GXmlDocumentIface GXmlDocumentIface;

#define GXML_TYPE_TNODE (gxml_tnode_get_type ())
#define GXML_TNODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_TNODE, GXmlTNode))
#define GXML_TNODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_TNODE, GXmlTNodeClass))
#define GXML_IS_TNODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_TNODE))
#define GXML_IS_TNODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_TNODE))
#define GXML_TNODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_TNODE, GXmlTNodeClass))

typedef struct _GXmlTNode GXmlTNode;
typedef struct _GXmlTNodeClass GXmlTNodeClass;
typedef struct _GXmlTNodePrivate GXmlTNodePrivate;

#define GXML_TYPE_ATTRIBUTE (gxml_attribute_get_type ())
#define GXML_ATTRIBUTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_ATTRIBUTE, GXmlAttribute))
#define GXML_IS_ATTRIBUTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_ATTRIBUTE))
#define GXML_ATTRIBUTE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GXML_TYPE_ATTRIBUTE, GXmlAttributeIface))

typedef struct _GXmlAttribute GXmlAttribute;
typedef struct _GXmlAttributeIface GXmlAttributeIface;

#define GXML_TYPE_TATTRIBUTE (gxml_tattribute_get_type ())
#define GXML_TATTRIBUTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_TATTRIBUTE, GXmlTAttribute))
#define GXML_TATTRIBUTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_TATTRIBUTE, GXmlTAttributeClass))
#define GXML_IS_TATTRIBUTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_TATTRIBUTE))
#define GXML_IS_TATTRIBUTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_TATTRIBUTE))
#define GXML_TATTRIBUTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_TATTRIBUTE, GXmlTAttributeClass))

typedef struct _GXmlTAttribute GXmlTAttribute;
typedef struct _GXmlTAttributeClass GXmlTAttributeClass;
typedef struct _GXmlTAttributePrivate GXmlTAttributePrivate;
enum  {
	GXML_TATTRIBUTE_0_PROPERTY,
	GXML_TATTRIBUTE_NAMESPACES_PROPERTY,
	GXML_TATTRIBUTE_NAMESPACE_PROPERTY,
	GXML_TATTRIBUTE_PREFIX_PROPERTY,
	GXML_TATTRIBUTE_NUM_PROPERTIES
};
static GParamSpec* gxml_tattribute_properties[GXML_TATTRIBUTE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define GXML_TYPE_TDOCUMENT (gxml_tdocument_get_type ())
#define GXML_TDOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GXML_TYPE_TDOCUMENT, GXmlTDocument))
#define GXML_TDOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GXML_TYPE_TDOCUMENT, GXmlTDocumentClass))
#define GXML_IS_TDOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GXML_TYPE_TDOCUMENT))
#define GXML_IS_TDOCUMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GXML_TYPE_TDOCUMENT))
#define GXML_TDOCUMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GXML_TYPE_TDOCUMENT, GXmlTDocumentClass))

typedef struct _GXmlTDocument GXmlTDocument;
typedef struct _GXmlTDocumentClass GXmlTDocumentClass;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);

struct _GXmlNamespaceIface {
	GTypeInterface parent_iface;
	gchar* (*get_uri) (GXmlNamespace* self);
	gchar* (*get_prefix) (GXmlNamespace* self);
};

struct _GXmlDocumentIface {
	GTypeInterface parent_iface;
	GXmlNode* (*create_element) (GXmlDocument* self, const gchar* name, GError** error);
	GXmlNode* (*create_text) (GXmlDocument* self, const gchar* text);
	GXmlNode* (*create_comment) (GXmlDocument* self, const gchar* text);
	GXmlNode* (*create_cdata) (GXmlDocument* self, const gchar* text);
	GXmlNode* (*create_pi) (GXmlDocument* self, const gchar* target, const gchar* data);
	gboolean (*save) (GXmlDocument* self, GCancellable* cancellable, GError** error);
	gboolean (*save_as) (GXmlDocument* self, GFile* f, GCancellable* cancellable, GError** error);
	gboolean (*get_indent) (GXmlDocument* self);
	void (*set_indent) (GXmlDocument* self, gboolean value);
	gboolean (*get_ns_top) (GXmlDocument* self);
	void (*set_ns_top) (GXmlDocument* self, gboolean value);
	gboolean (*get_prefix_default_ns) (GXmlDocument* self);
	void (*set_prefix_default_ns) (GXmlDocument* self, gboolean value);
	gboolean (*get_backup) (GXmlDocument* self);
	void (*set_backup) (GXmlDocument* self, gboolean value);
	GXmlNode* (*get_root) (GXmlDocument* self);
	GFile* (*get_file) (GXmlDocument* self);
	void (*set_file) (GXmlDocument* self, GFile* value);
};

struct _GXmlNodeIface {
	GTypeInterface parent_iface;
	GXmlNode* (*get) (GXmlNode* self, const gchar* key);
	GXmlElementList* (*get_elements_by_property_value) (GXmlNode* self, const gchar* property, const gchar* value);
	GXmlElementList* (*get_elements_by_name) (GXmlNode* self, const gchar* name);
	GXmlElementList* (*get_elements_by_name_ns) (GXmlNode* self, const gchar* name, const gchar* ns);
	gchar* (*to_string) (GXmlNode* self);
	gboolean (*set_namespace) (GXmlNode* self, const gchar* uri, const gchar* prefix);
	gchar* (*ns_prefix) (GXmlNode* self);
	gchar* (*ns_uri) (GXmlNode* self);
	GeeList* (*get_namespaces) (GXmlNode* self);
	GeeBidirList* (*get_children_nodes) (GXmlNode* self);
	GeeMap* (*get_attrs) (GXmlNode* self);
	gchar* (*get_name) (GXmlNode* self);
	gchar* (*get_value) (GXmlNode* self);
	void (*set_value) (GXmlNode* self, const gchar* value);
	GXmlNodeType (*get_type_node) (GXmlNode* self);
	GXmlDocument* (*get_document) (GXmlNode* self);
	GXmlNode* (*get_parent) (GXmlNode* self);
};

struct _GXmlTNode {
	GObject parent_instance;
	GXmlTNodePrivate * priv;
	gchar* _name;
	gchar* _value;
	GXmlDocument* _doc;
	GXmlNode* _parent;
	GXmlNodeType _node_type;
	xmlTextWriter* tw;
};

struct _GXmlTNodeClass {
	GObjectClass parent_class;
	gboolean (*set_namespace) (GXmlTNode* self, const gchar* uri, const gchar* prefix);
	gchar* (*to_string) (GXmlTNode* self);
	void (*set_parent) (GXmlTNode* self, GXmlNode* node);
	GeeMap* (*get_attrs) (GXmlTNode* self);
	GeeBidirList* (*get_children_nodes) (GXmlTNode* self);
	GXmlDocument* (*get_document) (GXmlTNode* self);
	gchar* (*get_name) (GXmlTNode* self);
	GeeList* (*get_namespaces) (GXmlTNode* self);
	GXmlNodeType (*get_type_node) (GXmlTNode* self);
	gchar* (*get_value) (GXmlTNode* self);
	void (*set_value) (GXmlTNode* self, const gchar* value);
	GXmlNode* (*get_parent) (GXmlTNode* self);
};

struct _GXmlAttributeIface {
	GTypeInterface parent_iface;
	GXmlNamespace* (*get_namespace) (GXmlAttribute* self);
	void (*set_namespace) (GXmlAttribute* self, GXmlNamespace* value);
	gchar* (*get_prefix) (GXmlAttribute* self);
};

struct _GXmlTAttribute {
	GXmlTNode parent_instance;
	GXmlTAttributePrivate * priv;
	GeeArrayList* _namespaces;
};

struct _GXmlTAttributeClass {
	GXmlTNodeClass parent_class;
};

static gpointer gxml_tattribute_parent_class = NULL;
static GXmlAttributeIface * gxml_tattribute_gxml_attribute_parent_iface = NULL;

GType gxml_element_list_get_type (void) G_GNUC_CONST;
GType gxml_namespace_get_type (void) G_GNUC_CONST;
GType gxml_node_type_get_type (void) G_GNUC_CONST;
GType gxml_document_get_type (void) G_GNUC_CONST;
GType gxml_node_get_type (void) G_GNUC_CONST;
GType gxml_tnode_get_type (void) G_GNUC_CONST;
GType gxml_attribute_get_type (void) G_GNUC_CONST;
GType gxml_tattribute_get_type (void) G_GNUC_CONST;
GXmlTAttribute* gxml_tattribute_new (GXmlDocument* d,
                                     const gchar* name,
                                     const gchar* value);
GXmlTAttribute* gxml_tattribute_construct (GType object_type,
                                           GXmlDocument* d,
                                           const gchar* name,
                                           const gchar* value);
GType gxml_tdocument_get_type (void) G_GNUC_CONST;
GXmlTNode* gxml_tnode_construct (GType object_type);
GeeList* gxml_tnode_get_namespaces (GXmlTNode* self);
GXmlNamespace* gxml_attribute_get_namespace (GXmlAttribute* self);
gchar* gxml_namespace_get_prefix (GXmlNamespace* self);
static GObject * gxml_tattribute_constructor (GType type,
                                       guint n_construct_properties,
                                       GObjectConstructParam * construct_properties);
static void gxml_tattribute_finalize (GObject * obj);
gchar* gxml_attribute_get_prefix (GXmlAttribute* self);
static void _vala_gxml_tattribute_get_property (GObject * object,
                                         guint property_id,
                                         GValue * value,
                                         GParamSpec * pspec);
void gxml_attribute_set_namespace (GXmlAttribute* self,
                                   GXmlNamespace* value);
static void _vala_gxml_tattribute_set_property (GObject * object,
                                         guint property_id,
                                         const GValue * value,
                                         GParamSpec * pspec);

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

GXmlTAttribute*
gxml_tattribute_construct (GType object_type,
                           GXmlDocument* d,
                           const gchar* name,
                           const gchar* value)
{
	GXmlTAttribute * self = NULL;
	GXmlDocument* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_val_if_fail (d != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (value != NULL, NULL);
	_vala_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (d, GXML_TYPE_TDOCUMENT), "d is TDocument", NULL);
	self = (GXmlTAttribute*) gxml_tnode_construct (object_type);
	_tmp0_ = _g_object_ref0 (d);
	_g_object_unref0 (((GXmlTNode*) self)->_doc);
	((GXmlTNode*) self)->_doc = _tmp0_;
	_tmp1_ = g_strdup (name);
	_g_free0 (((GXmlTNode*) self)->_name);
	((GXmlTNode*) self)->_name = _tmp1_;
	_tmp2_ = g_strdup (value);
	_g_free0 (((GXmlTNode*) self)->_value);
	((GXmlTNode*) self)->_value = _tmp2_;
	return self;
}

GXmlTAttribute*
gxml_tattribute_new (GXmlDocument* d,
                     const gchar* name,
                     const gchar* value)
{
	return gxml_tattribute_construct (GXML_TYPE_TATTRIBUTE, d, name, value);
}

static GeeList*
gxml_tattribute_real_get_namespaces (GXmlTNode* base)
{
	GeeList* result;
	GXmlTAttribute* self;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp2_;
	GObject* _tmp3_;
	GeeList* _tmp4_;
	self = (GXmlTAttribute*) base;
	_tmp0_ = self->_namespaces;
	if (_tmp0_ == NULL) {
		GeeArrayList* _tmp1_;
		_tmp1_ = gee_array_list_new (GXML_TYPE_NODE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
		_g_object_unref0 (self->_namespaces);
		self->_namespaces = _tmp1_;
	}
	_tmp2_ = self->_namespaces;
	_tmp3_ = g_object_ref ((GObject*) _tmp2_);
	_tmp4_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, GEE_TYPE_LIST) ? ((GeeList*) _tmp3_) : NULL);
	result = _tmp4_;
	return result;
}

static GXmlNamespace*
gxml_tattribute_real_get_namespace (GXmlAttribute* base)
{
	GXmlNamespace* result;
	GXmlTAttribute* self;
	GeeArrayList* _tmp0_;
	GeeArrayList* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	GeeList* _tmp5_;
	GeeList* _tmp6_;
	GeeList* _tmp7_;
	gpointer _tmp8_;
	GXmlNamespace* _tmp9_;
	GObject* _tmp10_;
	GXmlNamespace* _tmp11_;
	GXmlNamespace* _tmp12_;
	self = (GXmlTAttribute*) base;
	_tmp0_ = self->_namespaces;
	if (_tmp0_ == NULL) {
		GeeArrayList* _tmp1_;
		_tmp1_ = gee_array_list_new (GXML_TYPE_NODE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
		_g_object_unref0 (self->_namespaces);
		self->_namespaces = _tmp1_;
		result = NULL;
		return result;
	}
	_tmp2_ = self->_namespaces;
	_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp4_ == 0) {
		result = NULL;
		return result;
	}
	_tmp5_ = gxml_tnode_get_namespaces ((GXmlTNode*) self);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp8_ = gee_list_get (_tmp7_, 0);
	_tmp9_ = (GXmlNamespace*) _tmp8_;
	_tmp10_ = g_object_ref ((GObject*) _tmp9_);
	_tmp11_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, GXML_TYPE_NAMESPACE, GXmlNamespace));
	_tmp12_ = _tmp11_;
	_g_object_unref0 (_tmp9_);
	_g_object_unref0 (_tmp7_);
	result = _tmp12_;
	return result;
}

static void
gxml_tattribute_real_set_namespace (GXmlAttribute* base,
                                    GXmlNamespace* value)
{
	GXmlTAttribute* self;
	GeeList* _tmp0_;
	GeeList* _tmp1_;
	GeeList* _tmp2_;
	self = (GXmlTAttribute*) base;
	_tmp0_ = gxml_tnode_get_namespaces ((GXmlTNode*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	gee_collection_add ((GeeCollection*) _tmp2_, value);
	_g_object_unref0 (_tmp2_);
	g_object_notify_by_pspec ((GObject *) self, gxml_tattribute_properties[GXML_TATTRIBUTE_NAMESPACE_PROPERTY]);
}

static gchar*
gxml_tattribute_real_get_prefix (GXmlAttribute* base)
{
	gchar* result;
	GXmlTAttribute* self;
	GXmlNamespace* _tmp0_;
	GXmlNamespace* _tmp1_;
	GXmlNamespace* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	self = (GXmlTAttribute*) base;
	_tmp0_ = gxml_attribute_get_namespace ((GXmlAttribute*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = gxml_namespace_get_prefix (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	result = _tmp5_;
	return result;
}

static GObject *
gxml_tattribute_constructor (GType type,
                             guint n_construct_properties,
                             GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	GXmlTAttribute * self;
	parent_class = G_OBJECT_CLASS (gxml_tattribute_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_TATTRIBUTE, GXmlTAttribute);
	((GXmlTNode*) self)->_node_type = GXML_NODE_TYPE_ATTRIBUTE;
	return obj;
}

static void
gxml_tattribute_class_init (GXmlTAttributeClass * klass,
                            gpointer klass_data)
{
	gxml_tattribute_parent_class = g_type_class_peek_parent (klass);
	GXML_TNODE_CLASS (klass)->get_namespaces = gxml_tattribute_real_get_namespaces;
	G_OBJECT_CLASS (klass)->get_property = _vala_gxml_tattribute_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_gxml_tattribute_set_property;
	G_OBJECT_CLASS (klass)->constructor = gxml_tattribute_constructor;
	G_OBJECT_CLASS (klass)->finalize = gxml_tattribute_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_TATTRIBUTE_NAMESPACES_PROPERTY, gxml_tattribute_properties[GXML_TATTRIBUTE_NAMESPACES_PROPERTY] = g_param_spec_object ("namespaces", "namespaces", "namespaces", GEE_TYPE_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_TATTRIBUTE_NAMESPACE_PROPERTY, gxml_tattribute_properties[GXML_TATTRIBUTE_NAMESPACE_PROPERTY] = g_param_spec_object ("namespace", "namespace", "namespace", GXML_TYPE_NAMESPACE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), GXML_TATTRIBUTE_PREFIX_PROPERTY, gxml_tattribute_properties[GXML_TATTRIBUTE_PREFIX_PROPERTY] = g_param_spec_string ("prefix", "prefix", "prefix", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
gxml_tattribute_gxml_attribute_interface_init (GXmlAttributeIface * iface,
                                               gpointer iface_data)
{
	gxml_tattribute_gxml_attribute_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_namespace = gxml_tattribute_real_get_namespace;
	iface->set_namespace = gxml_tattribute_real_set_namespace;
	iface->get_prefix = gxml_tattribute_real_get_prefix;
}

static void
gxml_tattribute_instance_init (GXmlTAttribute * self,
                               gpointer klass)
{
}

static void
gxml_tattribute_finalize (GObject * obj)
{
	GXmlTAttribute * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GXML_TYPE_TATTRIBUTE, GXmlTAttribute);
	_g_object_unref0 (self->_namespaces);
	G_OBJECT_CLASS (gxml_tattribute_parent_class)->finalize (obj);
}

/**
 * DOM1 Class implemeting {@link GXml.Attribute} interface, not tied to libxml-2.0 library.
 */
GType
gxml_tattribute_get_type (void)
{
	static volatile gsize gxml_tattribute_type_id__volatile = 0;
	if (g_once_init_enter (&gxml_tattribute_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (GXmlTAttributeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gxml_tattribute_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GXmlTAttribute), 0, (GInstanceInitFunc) gxml_tattribute_instance_init, NULL };
		static const GInterfaceInfo gxml_attribute_info = { (GInterfaceInitFunc) gxml_tattribute_gxml_attribute_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType gxml_tattribute_type_id;
		gxml_tattribute_type_id = g_type_register_static (GXML_TYPE_TNODE, "GXmlTAttribute", &g_define_type_info, 0);
		g_type_add_interface_static (gxml_tattribute_type_id, GXML_TYPE_ATTRIBUTE, &gxml_attribute_info);
		g_once_init_leave (&gxml_tattribute_type_id__volatile, gxml_tattribute_type_id);
	}
	return gxml_tattribute_type_id__volatile;
}

static void
_vala_gxml_tattribute_get_property (GObject * object,
                                    guint property_id,
                                    GValue * value,
                                    GParamSpec * pspec)
{
	GXmlTAttribute * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_TATTRIBUTE, GXmlTAttribute);
	switch (property_id) {
		case GXML_TATTRIBUTE_NAMESPACES_PROPERTY:
		g_value_take_object (value, gxml_tnode_get_namespaces ((GXmlTNode*) self));
		break;
		case GXML_TATTRIBUTE_NAMESPACE_PROPERTY:
		g_value_take_object (value, gxml_attribute_get_namespace ((GXmlAttribute*) self));
		break;
		case GXML_TATTRIBUTE_PREFIX_PROPERTY:
		g_value_take_string (value, gxml_attribute_get_prefix ((GXmlAttribute*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_gxml_tattribute_set_property (GObject * object,
                                    guint property_id,
                                    const GValue * value,
                                    GParamSpec * pspec)
{
	GXmlTAttribute * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, GXML_TYPE_TATTRIBUTE, GXmlTAttribute);
	switch (property_id) {
		case GXML_TATTRIBUTE_NAMESPACE_PROPERTY:
		gxml_attribute_set_namespace ((GXmlAttribute*) self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

