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

/* interface.vala
 *
 * Copyright (C) 2008-2011  Florian Brosch
 *
 * 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
 *
 * Author:
 * 	Florian Brosch <flo.brosch@gmail.com>
 */

#include <glib.h>
#include <glib-object.h>
#include "valadoc.h"
#include <stdlib.h>
#include <string.h>
#include <valagee.h>

enum  {
	VALADOC_API_INTERFACE_0_PROPERTY,
	VALADOC_API_INTERFACE_BASE_TYPE_PROPERTY,
	VALADOC_API_INTERFACE_NODE_TYPE_PROPERTY,
	VALADOC_API_INTERFACE_NUM_PROPERTIES
};
static GParamSpec* valadoc_api_interface_properties[VALADOC_API_INTERFACE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _valadoc_api_signature_builder_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_api_signature_builder_unref (var), NULL)))

struct _ValadocApiInterfacePrivate {
	gchar* interface_macro_name;
	gchar* dbus_name;
	gchar* cname;
	ValaArrayList* interfaces;
	ValaCollection* _full_implemented_interfaces;
	ValadocApiTypeReference* _base_type;
	ValaSet* _known_related_interfaces;
	ValaSet* _known_implementations;
};


static gpointer valadoc_api_interface_parent_class = NULL;

#define VALADOC_API_INTERFACE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALADOC_API_TYPE_INTERFACE, ValadocApiInterfacePrivate))
static void valadoc_api_interface_real_accept (ValadocApiNode* base, ValadocApiVisitor* visitor);
static ValadocContentInline* valadoc_api_interface_real_build_signature (ValadocApiItem* base);
static void valadoc_api_interface_finalize (GObject * obj);
static void _vala_valadoc_api_interface_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_valadoc_api_interface_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


ValadocApiInterface* valadoc_api_interface_construct (GType object_type, ValadocApiNode* parent, ValadocApiSourceFile* file, const gchar* name, ValadocApiSymbolAccessibility accessibility, ValadocApiSourceComment* comment, const gchar* cname, const gchar* type_macro_name, const gchar* is_type_macro_name, const gchar* type_cast_macro_name, const gchar* type_function_name, const gchar* interface_macro_name, const gchar* dbus_name, void* data) {
	ValadocApiInterface * self = NULL;
	ValadocApiNode* _tmp0_;
	ValadocApiSourceFile* _tmp1_;
	const gchar* _tmp2_;
	ValadocApiSymbolAccessibility _tmp3_;
	ValadocApiSourceComment* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	void* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	gchar* _tmp13_;
	const gchar* _tmp14_;
	gchar* _tmp15_;
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (file != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	g_return_val_if_fail (interface_macro_name != NULL, NULL);
	_tmp0_ = parent;
	_tmp1_ = file;
	_tmp2_ = name;
	_tmp3_ = accessibility;
	_tmp4_ = comment;
	_tmp5_ = type_macro_name;
	_tmp6_ = is_type_macro_name;
	_tmp7_ = type_cast_macro_name;
	_tmp8_ = type_function_name;
	_tmp9_ = data;
	self = (ValadocApiInterface*) valadoc_api_typesymbol_construct (object_type, _tmp0_, _tmp1_, _tmp2_, _tmp3_, _tmp4_, _tmp5_, _tmp6_, _tmp7_, _tmp8_, FALSE, _tmp9_);
	_tmp10_ = interface_macro_name;
	_tmp11_ = g_strdup (_tmp10_);
	_g_free0 (self->priv->interface_macro_name);
	self->priv->interface_macro_name = _tmp11_;
	_tmp12_ = dbus_name;
	_tmp13_ = g_strdup (_tmp12_);
	_g_free0 (self->priv->dbus_name);
	self->priv->dbus_name = _tmp13_;
	_tmp14_ = cname;
	_tmp15_ = g_strdup (_tmp14_);
	_g_free0 (self->priv->cname);
	self->priv->cname = _tmp15_;
	return self;
}


ValadocApiInterface* valadoc_api_interface_new (ValadocApiNode* parent, ValadocApiSourceFile* file, const gchar* name, ValadocApiSymbolAccessibility accessibility, ValadocApiSourceComment* comment, const gchar* cname, const gchar* type_macro_name, const gchar* is_type_macro_name, const gchar* type_cast_macro_name, const gchar* type_function_name, const gchar* interface_macro_name, const gchar* dbus_name, void* data) {
	return valadoc_api_interface_construct (VALADOC_API_TYPE_INTERFACE, parent, file, name, accessibility, comment, cname, type_macro_name, is_type_macro_name, type_cast_macro_name, type_function_name, interface_macro_name, dbus_name, data);
}


/**
 * Add a newpreconditioned interface to the list
 */
void valadoc_api_interface_add_interface (ValadocApiInterface* self, ValadocApiTypeReference* iface) {
	ValaArrayList* _tmp0_;
	ValadocApiTypeReference* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (iface != NULL);
	_tmp0_ = self->priv->interfaces;
	_tmp1_ = iface;
	vala_collection_add ((ValaCollection*) _tmp0_, _tmp1_);
}


/**
 * Returns a list of newly preconditioned interfaces
 */
static gpointer _vala_iterable_ref0 (gpointer self) {
	return self ? vala_iterable_ref (self) : NULL;
}


ValaCollection* valadoc_api_interface_get_implemented_interface_list (ValadocApiInterface* self) {
	ValaCollection* result = NULL;
	ValaArrayList* _tmp0_;
	ValaCollection* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->interfaces;
	_tmp1_ = _vala_iterable_ref0 ((ValaCollection*) _tmp0_);
	result = _tmp1_;
	return result;
}


/**
 * Returns a list of all preconditioned interfaces
 */
ValaCollection* valadoc_api_interface_get_full_implemented_interface_list (ValadocApiInterface* self) {
	ValaCollection* result = NULL;
	ValaCollection* _tmp0_;
	ValaCollection* _tmp12_;
	ValaCollection* _tmp13_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_full_implemented_interfaces;
	if (_tmp0_ == NULL) {
		GEqualFunc _tmp1_;
		ValaArrayList* _tmp2_;
		ValaCollection* _tmp3_;
		ValaArrayList* _tmp4_;
		ValadocApiTypeReference* _tmp5_;
		_tmp1_ = g_direct_equal;
		_tmp2_ = vala_array_list_new (VALADOC_API_TYPE_TYPEREFERENCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
		_vala_iterable_unref0 (self->priv->_full_implemented_interfaces);
		self->priv->_full_implemented_interfaces = (ValaCollection*) _tmp2_;
		_tmp3_ = self->priv->_full_implemented_interfaces;
		_tmp4_ = self->priv->interfaces;
		vala_collection_add_all (_tmp3_, (ValaCollection*) _tmp4_);
		_tmp5_ = self->priv->_base_type;
		if (_tmp5_ != NULL) {
			ValaCollection* _tmp6_;
			ValadocApiTypeReference* _tmp7_;
			ValadocApiItem* _tmp8_;
			ValadocApiItem* _tmp9_;
			ValaCollection* _tmp10_;
			ValaCollection* _tmp11_;
			_tmp6_ = self->priv->_full_implemented_interfaces;
			_tmp7_ = self->priv->_base_type;
			_tmp8_ = valadoc_api_typereference_get_data_type (_tmp7_);
			_tmp9_ = _tmp8_;
			_tmp10_ = valadoc_api_class_get_full_implemented_interface_list (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, VALADOC_API_TYPE_CLASS, ValadocApiClass));
			_tmp11_ = _tmp10_;
			vala_collection_add_all (_tmp6_, _tmp11_);
			_vala_iterable_unref0 (_tmp11_);
		}
	}
	_tmp12_ = self->priv->_full_implemented_interfaces;
	_tmp13_ = _vala_iterable_ref0 (_tmp12_);
	result = _tmp13_;
	return result;
}


/**
 * Returns the name of this interface as it is used in C.
 */
gchar* valadoc_api_interface_get_cname (ValadocApiInterface* self) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->cname;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}


/**
 * Returns the dbus-name.
 */
gchar* valadoc_api_interface_get_dbus_name (ValadocApiInterface* self) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->dbus_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}


/**
 * Gets the name of the GType macro which returns the interface struct.
 */
gchar* valadoc_api_interface_get_interface_macro_name (ValadocApiInterface* self) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->interface_macro_name;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}


/**
 * {@inheritDoc}
 */
static void valadoc_api_interface_real_accept (ValadocApiNode* base, ValadocApiVisitor* visitor) {
	ValadocApiInterface * self;
	ValadocApiVisitor* _tmp0_;
	self = (ValadocApiInterface*) base;
	g_return_if_fail (visitor != NULL);
	_tmp0_ = visitor;
	valadoc_api_visitor_visit_interface (_tmp0_, self);
}


/**
 * Returns a list of all known implementations of this interface
 */
ValaCollection* valadoc_api_interface_get_known_implementations (ValadocApiInterface* self) {
	ValaCollection* result = NULL;
	ValaSet* _tmp0_;
	ValaCollection* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_known_implementations;
	_tmp1_ = _vala_iterable_ref0 ((ValaCollection*) _tmp0_);
	result = _tmp1_;
	return result;
}


/**
 * Returns a list of all known related (sub-)interfaces
 */
ValaCollection* valadoc_api_interface_get_known_related_interfaces (ValadocApiInterface* self) {
	ValaCollection* result = NULL;
	ValaSet* _tmp0_;
	ValaCollection* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_known_related_interfaces;
	_tmp1_ = _vala_iterable_ref0 ((ValaCollection*) _tmp0_);
	result = _tmp1_;
	return result;
}


void valadoc_api_interface_register_related_interface (ValadocApiInterface* self, ValadocApiInterface* iface) {
	ValaSet* _tmp0_;
	ValadocApiInterface* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (iface != NULL);
	_tmp0_ = self->priv->_known_related_interfaces;
	_tmp1_ = iface;
	vala_collection_add ((ValaCollection*) _tmp0_, _tmp1_);
}


void valadoc_api_interface_register_implementation (ValadocApiInterface* self, ValadocApiClass* cl) {
	ValaSet* _tmp0_;
	ValadocApiClass* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (cl != NULL);
	_tmp0_ = self->priv->_known_implementations;
	_tmp1_ = cl;
	vala_collection_add ((ValaCollection*) _tmp0_, _tmp1_);
}


/**
 * {@inheritDoc}
 */
static ValadocContentInline* valadoc_api_interface_real_build_signature (ValadocApiItem* base) {
	ValadocApiInterface * self;
	ValadocContentInline* result = NULL;
	ValadocApiSignatureBuilder* signature = NULL;
	ValadocApiSignatureBuilder* _tmp0_;
	ValadocApiSignatureBuilder* _tmp1_;
	ValadocApiSymbolAccessibility _tmp2_;
	ValadocApiSymbolAccessibility _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	ValadocApiSignatureBuilder* _tmp6_;
	ValadocApiSignatureBuilder* _tmp7_;
	ValadocApiSignatureBuilder* _tmp8_;
	ValadocApiSignatureBuilder* _tmp9_;
	ValadocApiSignatureBuilder* _tmp10_;
	ValadocApiSignatureBuilder* _tmp11_;
	ValadocApiSignatureBuilder* _tmp12_;
	ValadocApiSignatureBuilder* _tmp13_;
	ValaList* type_parameters = NULL;
	ValaList* _tmp14_;
	ValaList* _tmp15_;
	gint _tmp16_;
	gint _tmp17_;
	gboolean first = FALSE;
	ValadocApiTypeReference* _tmp45_;
	ValaArrayList* _tmp55_;
	gint _tmp56_;
	gint _tmp57_;
	ValadocApiSignatureBuilder* _tmp83_;
	ValadocContentRun* _tmp84_;
	self = (ValadocApiInterface*) base;
	_tmp0_ = valadoc_api_signature_builder_new ();
	signature = _tmp0_;
	_tmp1_ = signature;
	_tmp2_ = valadoc_api_symbol_get_accessibility ((ValadocApiSymbol*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = valadoc_api_symbol_accessibility_to_string (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = valadoc_api_signature_builder_append_keyword (_tmp1_, _tmp5_, TRUE);
	_tmp7_ = _tmp6_;
	_valadoc_api_signature_builder_unref0 (_tmp7_);
	_g_free0 (_tmp5_);
	_tmp8_ = signature;
	_tmp9_ = valadoc_api_signature_builder_append_keyword (_tmp8_, "interface", TRUE);
	_tmp10_ = _tmp9_;
	_valadoc_api_signature_builder_unref0 (_tmp10_);
	_tmp11_ = signature;
	_tmp12_ = valadoc_api_signature_builder_append_symbol (_tmp11_, (ValadocApiNode*) self, TRUE);
	_tmp13_ = _tmp12_;
	_valadoc_api_signature_builder_unref0 (_tmp13_);
	_tmp14_ = valadoc_api_node_get_children_by_type ((ValadocApiNode*) self, VALADOC_API_NODE_TYPE_TYPE_PARAMETER, FALSE);
	type_parameters = _tmp14_;
	_tmp15_ = type_parameters;
	_tmp16_ = vala_collection_get_size ((ValaCollection*) _tmp15_);
	_tmp17_ = _tmp16_;
	if (_tmp17_ > 0) {
		ValadocApiSignatureBuilder* _tmp18_;
		ValadocApiSignatureBuilder* _tmp19_;
		ValadocApiSignatureBuilder* _tmp20_;
		gboolean first = FALSE;
		ValadocApiSignatureBuilder* _tmp42_;
		ValadocApiSignatureBuilder* _tmp43_;
		ValadocApiSignatureBuilder* _tmp44_;
		_tmp18_ = signature;
		_tmp19_ = valadoc_api_signature_builder_append (_tmp18_, "<", FALSE);
		_tmp20_ = _tmp19_;
		_valadoc_api_signature_builder_unref0 (_tmp20_);
		first = TRUE;
		{
			ValaList* _param_list = NULL;
			ValaList* _tmp21_;
			ValaList* _tmp22_;
			gint _param_size = 0;
			ValaList* _tmp23_;
			gint _tmp24_;
			gint _tmp25_;
			gint _param_index = 0;
			_tmp21_ = type_parameters;
			_tmp22_ = _vala_iterable_ref0 (_tmp21_);
			_param_list = _tmp22_;
			_tmp23_ = _param_list;
			_tmp24_ = vala_collection_get_size ((ValaCollection*) _tmp23_);
			_tmp25_ = _tmp24_;
			_param_size = _tmp25_;
			_param_index = -1;
			while (TRUE) {
				gint _tmp26_;
				gint _tmp27_;
				gint _tmp28_;
				ValadocApiItem* param = NULL;
				ValaList* _tmp29_;
				gint _tmp30_;
				gpointer _tmp31_;
				gboolean _tmp32_;
				ValadocApiSignatureBuilder* _tmp36_;
				ValadocApiItem* _tmp37_;
				ValadocContentInline* _tmp38_;
				ValadocContentInline* _tmp39_;
				ValadocApiSignatureBuilder* _tmp40_;
				ValadocApiSignatureBuilder* _tmp41_;
				_tmp26_ = _param_index;
				_param_index = _tmp26_ + 1;
				_tmp27_ = _param_index;
				_tmp28_ = _param_size;
				if (!(_tmp27_ < _tmp28_)) {
					break;
				}
				_tmp29_ = _param_list;
				_tmp30_ = _param_index;
				_tmp31_ = vala_list_get (_tmp29_, _tmp30_);
				param = (ValadocApiItem*) ((ValadocApiNode*) _tmp31_);
				_tmp32_ = first;
				if (!_tmp32_) {
					ValadocApiSignatureBuilder* _tmp33_;
					ValadocApiSignatureBuilder* _tmp34_;
					ValadocApiSignatureBuilder* _tmp35_;
					_tmp33_ = signature;
					_tmp34_ = valadoc_api_signature_builder_append (_tmp33_, ",", FALSE);
					_tmp35_ = _tmp34_;
					_valadoc_api_signature_builder_unref0 (_tmp35_);
				}
				_tmp36_ = signature;
				_tmp37_ = param;
				_tmp38_ = valadoc_api_item_get_signature (_tmp37_);
				_tmp39_ = _tmp38_;
				_tmp40_ = valadoc_api_signature_builder_append_content (_tmp36_, _tmp39_, FALSE);
				_tmp41_ = _tmp40_;
				_valadoc_api_signature_builder_unref0 (_tmp41_);
				first = FALSE;
				_g_object_unref0 (param);
			}
			_vala_iterable_unref0 (_param_list);
		}
		_tmp42_ = signature;
		_tmp43_ = valadoc_api_signature_builder_append (_tmp42_, ">", FALSE);
		_tmp44_ = _tmp43_;
		_valadoc_api_signature_builder_unref0 (_tmp44_);
	}
	first = TRUE;
	_tmp45_ = self->priv->_base_type;
	if (_tmp45_ != NULL) {
		ValadocApiSignatureBuilder* _tmp46_;
		ValadocApiSignatureBuilder* _tmp47_;
		ValadocApiSignatureBuilder* _tmp48_;
		ValadocApiSignatureBuilder* _tmp49_;
		ValadocApiTypeReference* _tmp50_;
		ValadocContentInline* _tmp51_;
		ValadocContentInline* _tmp52_;
		ValadocApiSignatureBuilder* _tmp53_;
		ValadocApiSignatureBuilder* _tmp54_;
		_tmp46_ = signature;
		_tmp47_ = valadoc_api_signature_builder_append (_tmp46_, ":", TRUE);
		_tmp48_ = _tmp47_;
		_valadoc_api_signature_builder_unref0 (_tmp48_);
		_tmp49_ = signature;
		_tmp50_ = self->priv->_base_type;
		_tmp51_ = valadoc_api_item_get_signature ((ValadocApiItem*) _tmp50_);
		_tmp52_ = _tmp51_;
		_tmp53_ = valadoc_api_signature_builder_append_content (_tmp49_, _tmp52_, TRUE);
		_tmp54_ = _tmp53_;
		_valadoc_api_signature_builder_unref0 (_tmp54_);
		first = FALSE;
	}
	_tmp55_ = self->priv->interfaces;
	_tmp56_ = vala_collection_get_size ((ValaCollection*) _tmp55_);
	_tmp57_ = _tmp56_;
	if (_tmp57_ > 0) {
		gboolean _tmp58_;
		_tmp58_ = first;
		if (_tmp58_) {
			ValadocApiSignatureBuilder* _tmp59_;
			ValadocApiSignatureBuilder* _tmp60_;
			ValadocApiSignatureBuilder* _tmp61_;
			_tmp59_ = signature;
			_tmp60_ = valadoc_api_signature_builder_append (_tmp59_, ":", TRUE);
			_tmp61_ = _tmp60_;
			_valadoc_api_signature_builder_unref0 (_tmp61_);
		}
		{
			ValaArrayList* _implemented_interface_list = NULL;
			ValaArrayList* _tmp62_;
			ValaArrayList* _tmp63_;
			gint _implemented_interface_size = 0;
			ValaArrayList* _tmp64_;
			gint _tmp65_;
			gint _tmp66_;
			gint _implemented_interface_index = 0;
			_tmp62_ = self->priv->interfaces;
			_tmp63_ = _vala_iterable_ref0 (_tmp62_);
			_implemented_interface_list = _tmp63_;
			_tmp64_ = _implemented_interface_list;
			_tmp65_ = vala_collection_get_size ((ValaCollection*) _tmp64_);
			_tmp66_ = _tmp65_;
			_implemented_interface_size = _tmp66_;
			_implemented_interface_index = -1;
			while (TRUE) {
				gint _tmp67_;
				gint _tmp68_;
				gint _tmp69_;
				ValadocApiItem* implemented_interface = NULL;
				ValaArrayList* _tmp70_;
				gint _tmp71_;
				gpointer _tmp72_;
				gboolean _tmp73_;
				ValadocApiSignatureBuilder* _tmp77_;
				ValadocApiItem* _tmp78_;
				ValadocContentInline* _tmp79_;
				ValadocContentInline* _tmp80_;
				ValadocApiSignatureBuilder* _tmp81_;
				ValadocApiSignatureBuilder* _tmp82_;
				_tmp67_ = _implemented_interface_index;
				_implemented_interface_index = _tmp67_ + 1;
				_tmp68_ = _implemented_interface_index;
				_tmp69_ = _implemented_interface_size;
				if (!(_tmp68_ < _tmp69_)) {
					break;
				}
				_tmp70_ = _implemented_interface_list;
				_tmp71_ = _implemented_interface_index;
				_tmp72_ = vala_list_get ((ValaList*) _tmp70_, _tmp71_);
				implemented_interface = (ValadocApiItem*) ((ValadocApiTypeReference*) _tmp72_);
				_tmp73_ = first;
				if (!_tmp73_) {
					ValadocApiSignatureBuilder* _tmp74_;
					ValadocApiSignatureBuilder* _tmp75_;
					ValadocApiSignatureBuilder* _tmp76_;
					_tmp74_ = signature;
					_tmp75_ = valadoc_api_signature_builder_append (_tmp74_, ",", FALSE);
					_tmp76_ = _tmp75_;
					_valadoc_api_signature_builder_unref0 (_tmp76_);
				}
				_tmp77_ = signature;
				_tmp78_ = implemented_interface;
				_tmp79_ = valadoc_api_item_get_signature (_tmp78_);
				_tmp80_ = _tmp79_;
				_tmp81_ = valadoc_api_signature_builder_append_content (_tmp77_, _tmp80_, TRUE);
				_tmp82_ = _tmp81_;
				_valadoc_api_signature_builder_unref0 (_tmp82_);
				first = FALSE;
				_g_object_unref0 (implemented_interface);
			}
			_vala_iterable_unref0 (_implemented_interface_list);
		}
	}
	_tmp83_ = signature;
	_tmp84_ = valadoc_api_signature_builder_get (_tmp83_);
	result = (ValadocContentInline*) _tmp84_;
	_vala_iterable_unref0 (type_parameters);
	_valadoc_api_signature_builder_unref0 (signature);
	return result;
}


ValadocApiTypeReference* valadoc_api_interface_get_base_type (ValadocApiInterface* self) {
	ValadocApiTypeReference* result;
	ValadocApiTypeReference* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_base_type;
	result = _tmp0_;
	return result;
}


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


void valadoc_api_interface_set_base_type (ValadocApiInterface* self, ValadocApiTypeReference* value) {
	g_return_if_fail (self != NULL);
	if (valadoc_api_interface_get_base_type (self) != value) {
		ValadocApiTypeReference* _tmp0_;
		ValadocApiTypeReference* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_g_object_unref0 (self->priv->_base_type);
		self->priv->_base_type = _tmp1_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_interface_properties[VALADOC_API_INTERFACE_BASE_TYPE_PROPERTY]);
	}
}


static ValadocApiNodeType valadoc_api_interface_real_get_node_type (ValadocApiNode* base) {
	ValadocApiNodeType result;
	ValadocApiInterface* self;
	self = (ValadocApiInterface*) base;
	result = VALADOC_API_NODE_TYPE_INTERFACE;
	return result;
}


static void valadoc_api_interface_class_init (ValadocApiInterfaceClass * klass) {
	valadoc_api_interface_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ValadocApiInterfacePrivate));
	((ValadocApiNodeClass *) klass)->accept = (void (*) (ValadocApiNode *, ValadocApiVisitor*)) valadoc_api_interface_real_accept;
	((ValadocApiItemClass *) klass)->build_signature = (ValadocContentInline* (*) (ValadocApiItem *)) valadoc_api_interface_real_build_signature;
	VALADOC_API_NODE_CLASS (klass)->get_node_type = valadoc_api_interface_real_get_node_type;
	G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_api_interface_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_api_interface_set_property;
	G_OBJECT_CLASS (klass)->finalize = valadoc_api_interface_finalize;
	/**
	 * A preconditioned class or null
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_INTERFACE_BASE_TYPE_PROPERTY, valadoc_api_interface_properties[VALADOC_API_INTERFACE_BASE_TYPE_PROPERTY] = g_param_spec_object ("base-type", "base-type", "base-type", VALADOC_API_TYPE_TYPEREFERENCE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	 * {@inheritDoc}
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_INTERFACE_NODE_TYPE_PROPERTY, valadoc_api_interface_properties[VALADOC_API_INTERFACE_NODE_TYPE_PROPERTY] = g_param_spec_enum ("node-type", "node-type", "node-type", VALADOC_API_TYPE_NODE_TYPE, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void valadoc_api_interface_instance_init (ValadocApiInterface * self) {
	GEqualFunc _tmp0_;
	ValaArrayList* _tmp1_;
	GHashFunc _tmp2_;
	GEqualFunc _tmp3_;
	ValaHashSet* _tmp4_;
	GHashFunc _tmp5_;
	GEqualFunc _tmp6_;
	ValaHashSet* _tmp7_;
	self->priv = VALADOC_API_INTERFACE_GET_PRIVATE (self);
	_tmp0_ = g_direct_equal;
	_tmp1_ = vala_array_list_new (VALADOC_API_TYPE_TYPEREFERENCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
	self->priv->interfaces = _tmp1_;
	self->priv->_full_implemented_interfaces = NULL;
	_tmp2_ = g_direct_hash;
	_tmp3_ = g_direct_equal;
	_tmp4_ = vala_hash_set_new (VALADOC_API_TYPE_INTERFACE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp2_, _tmp3_);
	self->priv->_known_related_interfaces = (ValaSet*) _tmp4_;
	_tmp5_ = g_direct_hash;
	_tmp6_ = g_direct_equal;
	_tmp7_ = vala_hash_set_new (VALADOC_API_TYPE_CLASS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp5_, _tmp6_);
	self->priv->_known_implementations = (ValaSet*) _tmp7_;
}


static void valadoc_api_interface_finalize (GObject * obj) {
	ValadocApiInterface * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_API_TYPE_INTERFACE, ValadocApiInterface);
	_g_free0 (self->priv->interface_macro_name);
	_g_free0 (self->priv->dbus_name);
	_g_free0 (self->priv->cname);
	_vala_iterable_unref0 (self->priv->interfaces);
	_vala_iterable_unref0 (self->priv->_full_implemented_interfaces);
	_g_object_unref0 (self->priv->_base_type);
	_vala_iterable_unref0 (self->priv->_known_related_interfaces);
	_vala_iterable_unref0 (self->priv->_known_implementations);
	G_OBJECT_CLASS (valadoc_api_interface_parent_class)->finalize (obj);
}


/**
 * Represents a interface declaration in the source code.
 */
GType valadoc_api_interface_get_type (void) {
	static volatile gsize valadoc_api_interface_type_id__volatile = 0;
	if (g_once_init_enter (&valadoc_api_interface_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ValadocApiInterfaceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_api_interface_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocApiInterface), 0, (GInstanceInitFunc) valadoc_api_interface_instance_init, NULL };
		GType valadoc_api_interface_type_id;
		valadoc_api_interface_type_id = g_type_register_static (VALADOC_API_TYPE_TYPESYMBOL, "ValadocApiInterface", &g_define_type_info, 0);
		g_once_init_leave (&valadoc_api_interface_type_id__volatile, valadoc_api_interface_type_id);
	}
	return valadoc_api_interface_type_id__volatile;
}


static void _vala_valadoc_api_interface_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ValadocApiInterface * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_INTERFACE, ValadocApiInterface);
	switch (property_id) {
		case VALADOC_API_INTERFACE_BASE_TYPE_PROPERTY:
		g_value_set_object (value, valadoc_api_interface_get_base_type (self));
		break;
		case VALADOC_API_INTERFACE_NODE_TYPE_PROPERTY:
		g_value_set_enum (value, valadoc_api_node_get_node_type ((ValadocApiNode*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_valadoc_api_interface_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ValadocApiInterface * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_INTERFACE, ValadocApiInterface);
	switch (property_id) {
		case VALADOC_API_INTERFACE_BASE_TYPE_PROPERTY:
		valadoc_api_interface_set_base_type (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



