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

/* delegate.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_DELEGATE_0_PROPERTY,
	VALADOC_API_DELEGATE_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY,
	VALADOC_API_DELEGATE_RETURN_TYPE_PROPERTY,
	VALADOC_API_DELEGATE_NODE_TYPE_PROPERTY,
	VALADOC_API_DELEGATE_IS_STATIC_PROPERTY,
	VALADOC_API_DELEGATE_NUM_PROPERTIES
};
static GParamSpec* valadoc_api_delegate_properties[VALADOC_API_DELEGATE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _valadoc_api_signature_builder_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_api_signature_builder_unref (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))

struct _ValadocApiDelegatePrivate {
	gchar* cname;
	gchar* _implicit_array_length_cparameter_name;
	ValadocApiTypeReference* _return_type;
	gboolean _is_static;
};


static gpointer valadoc_api_delegate_parent_class = NULL;
static ValadocApiCallableIface * valadoc_api_delegate_valadoc_api_callable_parent_iface = NULL;

#define VALADOC_API_DELEGATE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALADOC_API_TYPE_DELEGATE, ValadocApiDelegatePrivate))
static void valadoc_api_delegate_set_is_static (ValadocApiDelegate* self, gboolean value);
static void valadoc_api_delegate_real_accept (ValadocApiNode* base, ValadocApiVisitor* visitor);
static ValadocContentInline* valadoc_api_delegate_real_build_signature (ValadocApiItem* base);
static void valadoc_api_delegate_finalize (GObject * obj);
G_GNUC_INTERNAL const gchar* valadoc_api_callable_get_implicit_array_length_cparameter_name (ValadocApiCallable* self);
static void _vala_valadoc_api_delegate_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
G_GNUC_INTERNAL void valadoc_api_callable_set_implicit_array_length_cparameter_name (ValadocApiCallable* self, const gchar* value);
static void _vala_valadoc_api_delegate_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


ValadocApiDelegate* valadoc_api_delegate_construct (GType object_type, ValadocApiNode* parent, ValadocApiSourceFile* file, const gchar* name, ValadocApiSymbolAccessibility accessibility, ValadocApiSourceComment* comment, const gchar* cname, gboolean is_static, void* data) {
	ValadocApiDelegate * self = NULL;
	ValadocApiNode* _tmp0_;
	ValadocApiSourceFile* _tmp1_;
	const gchar* _tmp2_;
	ValadocApiSymbolAccessibility _tmp3_;
	ValadocApiSourceComment* _tmp4_;
	void* _tmp5_;
	gboolean _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (file != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = parent;
	_tmp1_ = file;
	_tmp2_ = name;
	_tmp3_ = accessibility;
	_tmp4_ = comment;
	_tmp5_ = data;
	self = (ValadocApiDelegate*) valadoc_api_typesymbol_construct (object_type, _tmp0_, _tmp1_, _tmp2_, _tmp3_, _tmp4_, NULL, NULL, NULL, NULL, FALSE, _tmp5_);
	_tmp6_ = is_static;
	valadoc_api_delegate_set_is_static (self, _tmp6_);
	_tmp7_ = cname;
	_tmp8_ = g_strdup (_tmp7_);
	_g_free0 (self->priv->cname);
	self->priv->cname = _tmp8_;
	return self;
}


ValadocApiDelegate* valadoc_api_delegate_new (ValadocApiNode* parent, ValadocApiSourceFile* file, const gchar* name, ValadocApiSymbolAccessibility accessibility, ValadocApiSourceComment* comment, const gchar* cname, gboolean is_static, void* data) {
	return valadoc_api_delegate_construct (VALADOC_API_TYPE_DELEGATE, parent, file, name, accessibility, comment, cname, is_static, data);
}


/**
 * Returns the name of this delegate as it is used in C.
 */
gchar* valadoc_api_delegate_get_cname (ValadocApiDelegate* 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;
}


/**
 * {@inheritDoc}
 */
static void valadoc_api_delegate_real_accept (ValadocApiNode* base, ValadocApiVisitor* visitor) {
	ValadocApiDelegate * self;
	ValadocApiVisitor* _tmp0_;
	self = (ValadocApiDelegate*) base;
	g_return_if_fail (visitor != NULL);
	_tmp0_ = visitor;
	valadoc_api_visitor_visit_delegate (_tmp0_, self);
}


/**
 * {@inheritDoc}
 */
static gpointer _vala_iterable_ref0 (gpointer self) {
	return self ? vala_iterable_ref (self) : NULL;
}


static ValadocContentInline* valadoc_api_delegate_real_build_signature (ValadocApiItem* base) {
	ValadocApiDelegate * 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_;
	ValadocApiTypeReference* _tmp12_;
	ValadocApiTypeReference* _tmp13_;
	ValadocContentInline* _tmp14_;
	ValadocContentInline* _tmp15_;
	ValadocApiSignatureBuilder* _tmp16_;
	ValadocApiSignatureBuilder* _tmp17_;
	ValadocApiSignatureBuilder* _tmp18_;
	ValadocApiSignatureBuilder* _tmp19_;
	ValadocApiSignatureBuilder* _tmp20_;
	ValaList* type_parameters = NULL;
	ValaList* _tmp21_;
	ValaList* _tmp22_;
	gint _tmp23_;
	gint _tmp24_;
	ValadocApiSignatureBuilder* _tmp52_;
	ValadocApiSignatureBuilder* _tmp53_;
	ValadocApiSignatureBuilder* _tmp54_;
	gboolean first = FALSE;
	ValadocApiSignatureBuilder* _tmp76_;
	ValadocApiSignatureBuilder* _tmp77_;
	ValadocApiSignatureBuilder* _tmp78_;
	ValaList* exceptions = NULL;
	ValadocApiNodeType* _tmp79_;
	ValadocApiNodeType* _tmp80_;
	gint _tmp80__length1;
	ValaList* _tmp81_;
	ValaList* _tmp82_;
	ValaList* _tmp83_;
	gint _tmp84_;
	gint _tmp85_;
	ValadocApiSignatureBuilder* _tmp108_;
	ValadocContentRun* _tmp109_;
	self = (ValadocApiDelegate*) 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_, "delegate", TRUE);
	_tmp10_ = _tmp9_;
	_valadoc_api_signature_builder_unref0 (_tmp10_);
	_tmp11_ = signature;
	_tmp12_ = valadoc_api_callable_get_return_type ((ValadocApiCallable*) self);
	_tmp13_ = _tmp12_;
	_tmp14_ = valadoc_api_item_get_signature ((ValadocApiItem*) _tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = valadoc_api_signature_builder_append_content (_tmp11_, _tmp15_, TRUE);
	_tmp17_ = _tmp16_;
	_valadoc_api_signature_builder_unref0 (_tmp17_);
	_tmp18_ = signature;
	_tmp19_ = valadoc_api_signature_builder_append_symbol (_tmp18_, (ValadocApiNode*) self, TRUE);
	_tmp20_ = _tmp19_;
	_valadoc_api_signature_builder_unref0 (_tmp20_);
	_tmp21_ = valadoc_api_node_get_children_by_type ((ValadocApiNode*) self, VALADOC_API_NODE_TYPE_TYPE_PARAMETER, TRUE);
	type_parameters = _tmp21_;
	_tmp22_ = type_parameters;
	_tmp23_ = vala_collection_get_size ((ValaCollection*) _tmp22_);
	_tmp24_ = _tmp23_;
	if (_tmp24_ > 0) {
		ValadocApiSignatureBuilder* _tmp25_;
		ValadocApiSignatureBuilder* _tmp26_;
		ValadocApiSignatureBuilder* _tmp27_;
		gboolean first = FALSE;
		ValadocApiSignatureBuilder* _tmp49_;
		ValadocApiSignatureBuilder* _tmp50_;
		ValadocApiSignatureBuilder* _tmp51_;
		_tmp25_ = signature;
		_tmp26_ = valadoc_api_signature_builder_append (_tmp25_, "<", FALSE);
		_tmp27_ = _tmp26_;
		_valadoc_api_signature_builder_unref0 (_tmp27_);
		first = TRUE;
		{
			ValaList* _param_list = NULL;
			ValaList* _tmp28_;
			ValaList* _tmp29_;
			gint _param_size = 0;
			ValaList* _tmp30_;
			gint _tmp31_;
			gint _tmp32_;
			gint _param_index = 0;
			_tmp28_ = type_parameters;
			_tmp29_ = _vala_iterable_ref0 (_tmp28_);
			_param_list = _tmp29_;
			_tmp30_ = _param_list;
			_tmp31_ = vala_collection_get_size ((ValaCollection*) _tmp30_);
			_tmp32_ = _tmp31_;
			_param_size = _tmp32_;
			_param_index = -1;
			while (TRUE) {
				gint _tmp33_;
				gint _tmp34_;
				gint _tmp35_;
				ValadocApiItem* param = NULL;
				ValaList* _tmp36_;
				gint _tmp37_;
				gpointer _tmp38_;
				gboolean _tmp39_;
				ValadocApiSignatureBuilder* _tmp43_;
				ValadocApiItem* _tmp44_;
				ValadocContentInline* _tmp45_;
				ValadocContentInline* _tmp46_;
				ValadocApiSignatureBuilder* _tmp47_;
				ValadocApiSignatureBuilder* _tmp48_;
				_tmp33_ = _param_index;
				_param_index = _tmp33_ + 1;
				_tmp34_ = _param_index;
				_tmp35_ = _param_size;
				if (!(_tmp34_ < _tmp35_)) {
					break;
				}
				_tmp36_ = _param_list;
				_tmp37_ = _param_index;
				_tmp38_ = vala_list_get (_tmp36_, _tmp37_);
				param = (ValadocApiItem*) ((ValadocApiNode*) _tmp38_);
				_tmp39_ = first;
				if (!_tmp39_) {
					ValadocApiSignatureBuilder* _tmp40_;
					ValadocApiSignatureBuilder* _tmp41_;
					ValadocApiSignatureBuilder* _tmp42_;
					_tmp40_ = signature;
					_tmp41_ = valadoc_api_signature_builder_append (_tmp40_, ",", FALSE);
					_tmp42_ = _tmp41_;
					_valadoc_api_signature_builder_unref0 (_tmp42_);
				}
				_tmp43_ = signature;
				_tmp44_ = param;
				_tmp45_ = valadoc_api_item_get_signature (_tmp44_);
				_tmp46_ = _tmp45_;
				_tmp47_ = valadoc_api_signature_builder_append_content (_tmp43_, _tmp46_, FALSE);
				_tmp48_ = _tmp47_;
				_valadoc_api_signature_builder_unref0 (_tmp48_);
				first = FALSE;
				_g_object_unref0 (param);
			}
			_vala_iterable_unref0 (_param_list);
		}
		_tmp49_ = signature;
		_tmp50_ = valadoc_api_signature_builder_append (_tmp49_, ">", FALSE);
		_tmp51_ = _tmp50_;
		_valadoc_api_signature_builder_unref0 (_tmp51_);
	}
	_tmp52_ = signature;
	_tmp53_ = valadoc_api_signature_builder_append (_tmp52_, "(", TRUE);
	_tmp54_ = _tmp53_;
	_valadoc_api_signature_builder_unref0 (_tmp54_);
	first = TRUE;
	{
		ValaList* _param_list = NULL;
		ValaList* _tmp55_;
		gint _param_size = 0;
		ValaList* _tmp56_;
		gint _tmp57_;
		gint _tmp58_;
		gint _param_index = 0;
		_tmp55_ = valadoc_api_node_get_children_by_type ((ValadocApiNode*) self, VALADOC_API_NODE_TYPE_FORMAL_PARAMETER, FALSE);
		_param_list = _tmp55_;
		_tmp56_ = _param_list;
		_tmp57_ = vala_collection_get_size ((ValaCollection*) _tmp56_);
		_tmp58_ = _tmp57_;
		_param_size = _tmp58_;
		_param_index = -1;
		while (TRUE) {
			gint _tmp59_;
			gint _tmp60_;
			gint _tmp61_;
			ValadocApiNode* param = NULL;
			ValaList* _tmp62_;
			gint _tmp63_;
			gpointer _tmp64_;
			gboolean _tmp65_;
			ValadocApiSignatureBuilder* _tmp69_;
			ValadocApiNode* _tmp70_;
			ValadocContentInline* _tmp71_;
			ValadocContentInline* _tmp72_;
			gboolean _tmp73_;
			ValadocApiSignatureBuilder* _tmp74_;
			ValadocApiSignatureBuilder* _tmp75_;
			_tmp59_ = _param_index;
			_param_index = _tmp59_ + 1;
			_tmp60_ = _param_index;
			_tmp61_ = _param_size;
			if (!(_tmp60_ < _tmp61_)) {
				break;
			}
			_tmp62_ = _param_list;
			_tmp63_ = _param_index;
			_tmp64_ = vala_list_get (_tmp62_, _tmp63_);
			param = (ValadocApiNode*) _tmp64_;
			_tmp65_ = first;
			if (!_tmp65_) {
				ValadocApiSignatureBuilder* _tmp66_;
				ValadocApiSignatureBuilder* _tmp67_;
				ValadocApiSignatureBuilder* _tmp68_;
				_tmp66_ = signature;
				_tmp67_ = valadoc_api_signature_builder_append (_tmp66_, ",", FALSE);
				_tmp68_ = _tmp67_;
				_valadoc_api_signature_builder_unref0 (_tmp68_);
			}
			_tmp69_ = signature;
			_tmp70_ = param;
			_tmp71_ = valadoc_api_item_get_signature ((ValadocApiItem*) _tmp70_);
			_tmp72_ = _tmp71_;
			_tmp73_ = first;
			_tmp74_ = valadoc_api_signature_builder_append_content (_tmp69_, _tmp72_, !_tmp73_);
			_tmp75_ = _tmp74_;
			_valadoc_api_signature_builder_unref0 (_tmp75_);
			first = FALSE;
			_g_object_unref0 (param);
		}
		_vala_iterable_unref0 (_param_list);
	}
	_tmp76_ = signature;
	_tmp77_ = valadoc_api_signature_builder_append (_tmp76_, ")", FALSE);
	_tmp78_ = _tmp77_;
	_valadoc_api_signature_builder_unref0 (_tmp78_);
	_tmp79_ = g_new0 (ValadocApiNodeType, 2);
	_tmp79_[0] = VALADOC_API_NODE_TYPE_ERROR_DOMAIN;
	_tmp79_[1] = VALADOC_API_NODE_TYPE_CLASS;
	_tmp80_ = _tmp79_;
	_tmp80__length1 = 2;
	_tmp81_ = valadoc_api_node_get_children_by_types ((ValadocApiNode*) self, _tmp80_, 2, TRUE);
	_tmp82_ = _tmp81_;
	_tmp80_ = (g_free (_tmp80_), NULL);
	exceptions = _tmp82_;
	_tmp83_ = exceptions;
	_tmp84_ = vala_collection_get_size ((ValaCollection*) _tmp83_);
	_tmp85_ = _tmp84_;
	if (_tmp85_ > 0) {
		ValadocApiSignatureBuilder* _tmp86_;
		ValadocApiSignatureBuilder* _tmp87_;
		ValadocApiSignatureBuilder* _tmp88_;
		_tmp86_ = signature;
		_tmp87_ = valadoc_api_signature_builder_append_keyword (_tmp86_, "throws", TRUE);
		_tmp88_ = _tmp87_;
		_valadoc_api_signature_builder_unref0 (_tmp88_);
		first = TRUE;
		{
			ValaList* _param_list = NULL;
			ValaList* _tmp89_;
			ValaList* _tmp90_;
			gint _param_size = 0;
			ValaList* _tmp91_;
			gint _tmp92_;
			gint _tmp93_;
			gint _param_index = 0;
			_tmp89_ = exceptions;
			_tmp90_ = _vala_iterable_ref0 (_tmp89_);
			_param_list = _tmp90_;
			_tmp91_ = _param_list;
			_tmp92_ = vala_collection_get_size ((ValaCollection*) _tmp91_);
			_tmp93_ = _tmp92_;
			_param_size = _tmp93_;
			_param_index = -1;
			while (TRUE) {
				gint _tmp94_;
				gint _tmp95_;
				gint _tmp96_;
				ValadocApiNode* param = NULL;
				ValaList* _tmp97_;
				gint _tmp98_;
				gpointer _tmp99_;
				gboolean _tmp100_;
				ValadocApiSignatureBuilder* _tmp104_;
				ValadocApiNode* _tmp105_;
				ValadocApiSignatureBuilder* _tmp106_;
				ValadocApiSignatureBuilder* _tmp107_;
				_tmp94_ = _param_index;
				_param_index = _tmp94_ + 1;
				_tmp95_ = _param_index;
				_tmp96_ = _param_size;
				if (!(_tmp95_ < _tmp96_)) {
					break;
				}
				_tmp97_ = _param_list;
				_tmp98_ = _param_index;
				_tmp99_ = vala_list_get (_tmp97_, _tmp98_);
				param = (ValadocApiNode*) _tmp99_;
				_tmp100_ = first;
				if (!_tmp100_) {
					ValadocApiSignatureBuilder* _tmp101_;
					ValadocApiSignatureBuilder* _tmp102_;
					ValadocApiSignatureBuilder* _tmp103_;
					_tmp101_ = signature;
					_tmp102_ = valadoc_api_signature_builder_append (_tmp101_, ",", FALSE);
					_tmp103_ = _tmp102_;
					_valadoc_api_signature_builder_unref0 (_tmp103_);
				}
				_tmp104_ = signature;
				_tmp105_ = param;
				_tmp106_ = valadoc_api_signature_builder_append_type (_tmp104_, _tmp105_, TRUE);
				_tmp107_ = _tmp106_;
				_valadoc_api_signature_builder_unref0 (_tmp107_);
				first = FALSE;
				_g_object_unref0 (param);
			}
			_vala_iterable_unref0 (_param_list);
		}
	}
	_tmp108_ = signature;
	_tmp109_ = valadoc_api_signature_builder_get (_tmp108_);
	result = (ValadocContentInline*) _tmp109_;
	_vala_iterable_unref0 (exceptions);
	_vala_iterable_unref0 (type_parameters);
	_valadoc_api_signature_builder_unref0 (signature);
	return result;
}


static const gchar* valadoc_api_delegate_real_get_implicit_array_length_cparameter_name (ValadocApiCallable* base) {
	const gchar* result;
	ValadocApiDelegate* self;
	const gchar* _tmp0_;
	self = (ValadocApiDelegate*) base;
	_tmp0_ = self->priv->_implicit_array_length_cparameter_name;
	result = _tmp0_;
	return result;
}


static void valadoc_api_delegate_real_set_implicit_array_length_cparameter_name (ValadocApiCallable* base, const gchar* value) {
	ValadocApiDelegate* self;
	self = (ValadocApiDelegate*) base;
	if (g_strcmp0 (value, valadoc_api_delegate_real_get_implicit_array_length_cparameter_name (base)) != 0) {
		const gchar* _tmp0_;
		gchar* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = g_strdup (_tmp0_);
		_g_free0 (self->priv->_implicit_array_length_cparameter_name);
		self->priv->_implicit_array_length_cparameter_name = _tmp1_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_delegate_properties[VALADOC_API_DELEGATE_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY]);
	}
}


static ValadocApiTypeReference* valadoc_api_delegate_real_get_return_type (ValadocApiCallable* base) {
	ValadocApiTypeReference* result;
	ValadocApiDelegate* self;
	ValadocApiTypeReference* _tmp0_;
	self = (ValadocApiDelegate*) base;
	_tmp0_ = self->priv->_return_type;
	result = _tmp0_;
	return result;
}


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


static void valadoc_api_delegate_real_set_return_type (ValadocApiCallable* base, ValadocApiTypeReference* value) {
	ValadocApiDelegate* self;
	self = (ValadocApiDelegate*) base;
	if (valadoc_api_delegate_real_get_return_type (base) != value) {
		ValadocApiTypeReference* _tmp0_;
		ValadocApiTypeReference* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_g_object_unref0 (self->priv->_return_type);
		self->priv->_return_type = _tmp1_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_delegate_properties[VALADOC_API_DELEGATE_RETURN_TYPE_PROPERTY]);
	}
}


static ValadocApiNodeType valadoc_api_delegate_real_get_node_type (ValadocApiNode* base) {
	ValadocApiNodeType result;
	ValadocApiDelegate* self;
	self = (ValadocApiDelegate*) base;
	result = VALADOC_API_NODE_TYPE_DELEGATE;
	return result;
}


gboolean valadoc_api_delegate_get_is_static (ValadocApiDelegate* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_is_static;
	result = _tmp0_;
	return result;
}


static void valadoc_api_delegate_set_is_static (ValadocApiDelegate* self, gboolean value) {
	g_return_if_fail (self != NULL);
	if (valadoc_api_delegate_get_is_static (self) != value) {
		gboolean _tmp0_;
		_tmp0_ = value;
		self->priv->_is_static = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_delegate_properties[VALADOC_API_DELEGATE_IS_STATIC_PROPERTY]);
	}
}


static void valadoc_api_delegate_class_init (ValadocApiDelegateClass * klass) {
	valadoc_api_delegate_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ValadocApiDelegatePrivate));
	((ValadocApiNodeClass *) klass)->accept = (void (*) (ValadocApiNode *, ValadocApiVisitor*)) valadoc_api_delegate_real_accept;
	((ValadocApiItemClass *) klass)->build_signature = (ValadocContentInline* (*) (ValadocApiItem *)) valadoc_api_delegate_real_build_signature;
	VALADOC_API_NODE_CLASS (klass)->get_node_type = valadoc_api_delegate_real_get_node_type;
	G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_api_delegate_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_api_delegate_set_property;
	G_OBJECT_CLASS (klass)->finalize = valadoc_api_delegate_finalize;
	/**
	 * {@inheritDoc}
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_DELEGATE_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY, valadoc_api_delegate_properties[VALADOC_API_DELEGATE_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY] = g_param_spec_string ("implicit-array-length-cparameter-name", "implicit-array-length-cparameter-name", "implicit-array-length-cparameter-name", NULL, 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_DELEGATE_RETURN_TYPE_PROPERTY, valadoc_api_delegate_properties[VALADOC_API_DELEGATE_RETURN_TYPE_PROPERTY] = g_param_spec_object ("return-type", "return-type", "return-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_DELEGATE_NODE_TYPE_PROPERTY, valadoc_api_delegate_properties[VALADOC_API_DELEGATE_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));
	/**
	 * Specifies whether this delegate is static
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_DELEGATE_IS_STATIC_PROPERTY, valadoc_api_delegate_properties[VALADOC_API_DELEGATE_IS_STATIC_PROPERTY] = g_param_spec_boolean ("is-static", "is-static", "is-static", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void valadoc_api_delegate_valadoc_api_callable_interface_init (ValadocApiCallableIface * iface) {
	valadoc_api_delegate_valadoc_api_callable_parent_iface = g_type_interface_peek_parent (iface);
	iface->get_implicit_array_length_cparameter_name = valadoc_api_delegate_real_get_implicit_array_length_cparameter_name;
	iface->set_implicit_array_length_cparameter_name = valadoc_api_delegate_real_set_implicit_array_length_cparameter_name;
	iface->get_return_type = valadoc_api_delegate_real_get_return_type;
	iface->set_return_type = valadoc_api_delegate_real_set_return_type;
}


static void valadoc_api_delegate_instance_init (ValadocApiDelegate * self) {
	self->priv = VALADOC_API_DELEGATE_GET_PRIVATE (self);
}


static void valadoc_api_delegate_finalize (GObject * obj) {
	ValadocApiDelegate * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_API_TYPE_DELEGATE, ValadocApiDelegate);
	_g_free0 (self->priv->cname);
	_g_free0 (self->priv->_implicit_array_length_cparameter_name);
	_g_object_unref0 (self->priv->_return_type);
	G_OBJECT_CLASS (valadoc_api_delegate_parent_class)->finalize (obj);
}


/**
 * Represents a Delegate.
 */
GType valadoc_api_delegate_get_type (void) {
	static volatile gsize valadoc_api_delegate_type_id__volatile = 0;
	if (g_once_init_enter (&valadoc_api_delegate_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ValadocApiDelegateClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_api_delegate_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocApiDelegate), 0, (GInstanceInitFunc) valadoc_api_delegate_instance_init, NULL };
		static const GInterfaceInfo valadoc_api_callable_info = { (GInterfaceInitFunc) valadoc_api_delegate_valadoc_api_callable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType valadoc_api_delegate_type_id;
		valadoc_api_delegate_type_id = g_type_register_static (VALADOC_API_TYPE_TYPESYMBOL, "ValadocApiDelegate", &g_define_type_info, 0);
		g_type_add_interface_static (valadoc_api_delegate_type_id, VALADOC_API_TYPE_CALLABLE, &valadoc_api_callable_info);
		g_once_init_leave (&valadoc_api_delegate_type_id__volatile, valadoc_api_delegate_type_id);
	}
	return valadoc_api_delegate_type_id__volatile;
}


static void _vala_valadoc_api_delegate_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ValadocApiDelegate * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_DELEGATE, ValadocApiDelegate);
	switch (property_id) {
		case VALADOC_API_DELEGATE_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY:
		g_value_set_string (value, valadoc_api_callable_get_implicit_array_length_cparameter_name ((ValadocApiCallable*) self));
		break;
		case VALADOC_API_DELEGATE_RETURN_TYPE_PROPERTY:
		g_value_set_object (value, valadoc_api_callable_get_return_type ((ValadocApiCallable*) self));
		break;
		case VALADOC_API_DELEGATE_NODE_TYPE_PROPERTY:
		g_value_set_enum (value, valadoc_api_node_get_node_type ((ValadocApiNode*) self));
		break;
		case VALADOC_API_DELEGATE_IS_STATIC_PROPERTY:
		g_value_set_boolean (value, valadoc_api_delegate_get_is_static (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_valadoc_api_delegate_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ValadocApiDelegate * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_DELEGATE, ValadocApiDelegate);
	switch (property_id) {
		case VALADOC_API_DELEGATE_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY:
		valadoc_api_callable_set_implicit_array_length_cparameter_name ((ValadocApiCallable*) self, g_value_get_string (value));
		break;
		case VALADOC_API_DELEGATE_RETURN_TYPE_PROPERTY:
		valadoc_api_callable_set_return_type ((ValadocApiCallable*) self, g_value_get_object (value));
		break;
		case VALADOC_API_DELEGATE_IS_STATIC_PROPERTY:
		valadoc_api_delegate_set_is_static (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



