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

/* typereference.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 <valagee.h>
#include <stdlib.h>
#include <string.h>

enum  {
	VALADOC_API_TYPEREFERENCE_0_PROPERTY,
	VALADOC_API_TYPEREFERENCE_DATA_TYPE_PROPERTY,
	VALADOC_API_TYPEREFERENCE_PASS_OWNERSHIP_PROPERTY,
	VALADOC_API_TYPEREFERENCE_IS_OWNED_PROPERTY,
	VALADOC_API_TYPEREFERENCE_IS_WEAK_PROPERTY,
	VALADOC_API_TYPEREFERENCE_IS_UNOWNED_PROPERTY,
	VALADOC_API_TYPEREFERENCE_IS_DYNAMIC_PROPERTY,
	VALADOC_API_TYPEREFERENCE_IS_NULLABLE_PROPERTY,
	VALADOC_API_TYPEREFERENCE_NUM_PROPERTIES
};
static GParamSpec* valadoc_api_typereference_properties[VALADOC_API_TYPEREFERENCE_NUM_PROPERTIES];
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
#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)))

struct _ValadocApiTypeReferencePrivate {
	ValaArrayList* type_arguments;
	gchar* dbus_type_signature;
	ValadocApiOwnership ownership;
	ValadocApiItem* _data_type;
	gboolean _pass_ownership;
	gboolean _is_dynamic;
	gboolean _is_nullable;
};


static gpointer valadoc_api_typereference_parent_class = NULL;

#define VALADOC_API_TYPEREFERENCE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALADOC_API_TYPE_TYPEREFERENCE, ValadocApiTypeReferencePrivate))
static void valadoc_api_typereference_set_pass_ownership (ValadocApiTypeReference* self, gboolean value);
static void valadoc_api_typereference_set_is_nullable (ValadocApiTypeReference* self, gboolean value);
static void valadoc_api_typereference_set_is_dynamic (ValadocApiTypeReference* self, gboolean value);
static ValadocContentInline* valadoc_api_typereference_real_build_signature (ValadocApiItem* base);
static void valadoc_api_typereference_finalize (GObject * obj);
static void _vala_valadoc_api_typereference_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_valadoc_api_typereference_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);


ValadocApiTypeReference* valadoc_api_typereference_construct (GType object_type, ValadocApiItem* parent, ValadocApiOwnership ownership, gboolean pass_ownership, gboolean is_dynamic, gboolean is_nullable, const gchar* dbus_type_signature, void* data) {
	ValadocApiTypeReference * self = NULL;
	void* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	ValadocApiOwnership _tmp6_;
	ValadocApiItem* _tmp7_;
	g_return_val_if_fail (parent != NULL, NULL);
	_tmp0_ = data;
	self = (ValadocApiTypeReference*) valadoc_api_item_construct (object_type, _tmp0_);
	_tmp1_ = dbus_type_signature;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (self->priv->dbus_type_signature);
	self->priv->dbus_type_signature = _tmp2_;
	_tmp3_ = pass_ownership;
	valadoc_api_typereference_set_pass_ownership (self, _tmp3_);
	_tmp4_ = is_nullable;
	valadoc_api_typereference_set_is_nullable (self, _tmp4_);
	_tmp5_ = is_dynamic;
	valadoc_api_typereference_set_is_dynamic (self, _tmp5_);
	_tmp6_ = ownership;
	self->priv->ownership = _tmp6_;
	_tmp7_ = parent;
	valadoc_api_item_set_parent ((ValadocApiItem*) self, _tmp7_);
	return self;
}


ValadocApiTypeReference* valadoc_api_typereference_new (ValadocApiItem* parent, ValadocApiOwnership ownership, gboolean pass_ownership, gboolean is_dynamic, gboolean is_nullable, const gchar* dbus_type_signature, void* data) {
	return valadoc_api_typereference_construct (VALADOC_API_TYPE_TYPEREFERENCE, parent, ownership, pass_ownership, is_dynamic, is_nullable, dbus_type_signature, data);
}


/**
 * Returns a copy of the list of generic type arguments.
 *
 * @return type argument list
 */
static gpointer _vala_iterable_ref0 (gpointer self) {
	return self ? vala_iterable_ref (self) : NULL;
}


ValaCollection* valadoc_api_typereference_get_type_arguments (ValadocApiTypeReference* self) {
	ValaCollection* result = NULL;
	ValaArrayList* _tmp0_;
	ValaCollection* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->type_arguments;
	_tmp1_ = _vala_iterable_ref0 ((ValaCollection*) _tmp0_);
	result = _tmp1_;
	return result;
}


void valadoc_api_typereference_add_type_argument (ValadocApiTypeReference* self, ValadocApiTypeReference* type_ref) {
	ValaArrayList* _tmp0_;
	ValadocApiTypeReference* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (type_ref != NULL);
	_tmp0_ = self->priv->type_arguments;
	_tmp1_ = type_ref;
	vala_collection_add ((ValaCollection*) _tmp0_, _tmp1_);
}


gchar* valadoc_api_typereference_get_dbus_type_signature (ValadocApiTypeReference* self) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->dbus_type_signature;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}


/**
 * {@inheritDoc}
 */
static ValadocContentInline* valadoc_api_typereference_real_build_signature (ValadocApiItem* base) {
	ValadocApiTypeReference * self;
	ValadocContentInline* result = NULL;
	ValadocApiSignatureBuilder* signature = NULL;
	ValadocApiSignatureBuilder* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	ValadocApiItem* _tmp20_;
	ValaArrayList* _tmp35_;
	gint _tmp36_;
	gint _tmp37_;
	gboolean _tmp65_;
	ValadocApiSignatureBuilder* _tmp69_;
	ValadocContentRun* _tmp70_;
	self = (ValadocApiTypeReference*) base;
	_tmp0_ = valadoc_api_signature_builder_new ();
	signature = _tmp0_;
	_tmp1_ = self->priv->_is_dynamic;
	if (_tmp1_) {
		ValadocApiSignatureBuilder* _tmp2_;
		ValadocApiSignatureBuilder* _tmp3_;
		ValadocApiSignatureBuilder* _tmp4_;
		_tmp2_ = signature;
		_tmp3_ = valadoc_api_signature_builder_append_keyword (_tmp2_, "dynamic", TRUE);
		_tmp4_ = _tmp3_;
		_valadoc_api_signature_builder_unref0 (_tmp4_);
	}
	_tmp5_ = valadoc_api_typereference_get_is_weak (self);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		ValadocApiSignatureBuilder* _tmp7_;
		ValadocApiSignatureBuilder* _tmp8_;
		ValadocApiSignatureBuilder* _tmp9_;
		_tmp7_ = signature;
		_tmp8_ = valadoc_api_signature_builder_append_keyword (_tmp7_, "weak", TRUE);
		_tmp9_ = _tmp8_;
		_valadoc_api_signature_builder_unref0 (_tmp9_);
	} else {
		gboolean _tmp10_;
		gboolean _tmp11_;
		_tmp10_ = valadoc_api_typereference_get_is_owned (self);
		_tmp11_ = _tmp10_;
		if (_tmp11_) {
			ValadocApiSignatureBuilder* _tmp12_;
			ValadocApiSignatureBuilder* _tmp13_;
			ValadocApiSignatureBuilder* _tmp14_;
			_tmp12_ = signature;
			_tmp13_ = valadoc_api_signature_builder_append_keyword (_tmp12_, "owned", TRUE);
			_tmp14_ = _tmp13_;
			_valadoc_api_signature_builder_unref0 (_tmp14_);
		} else {
			gboolean _tmp15_;
			gboolean _tmp16_;
			_tmp15_ = valadoc_api_typereference_get_is_unowned (self);
			_tmp16_ = _tmp15_;
			if (_tmp16_) {
				ValadocApiSignatureBuilder* _tmp17_;
				ValadocApiSignatureBuilder* _tmp18_;
				ValadocApiSignatureBuilder* _tmp19_;
				_tmp17_ = signature;
				_tmp18_ = valadoc_api_signature_builder_append_keyword (_tmp17_, "unowned", TRUE);
				_tmp19_ = _tmp18_;
				_valadoc_api_signature_builder_unref0 (_tmp19_);
			}
		}
	}
	_tmp20_ = self->priv->_data_type;
	if (_tmp20_ == NULL) {
		ValadocApiSignatureBuilder* _tmp21_;
		ValadocApiSignatureBuilder* _tmp22_;
		ValadocApiSignatureBuilder* _tmp23_;
		_tmp21_ = signature;
		_tmp22_ = valadoc_api_signature_builder_append_keyword (_tmp21_, "void", TRUE);
		_tmp23_ = _tmp22_;
		_valadoc_api_signature_builder_unref0 (_tmp23_);
	} else {
		ValadocApiItem* _tmp24_;
		_tmp24_ = self->priv->_data_type;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, VALADOC_API_TYPE_SYMBOL)) {
			ValadocApiSignatureBuilder* _tmp25_;
			ValadocApiItem* _tmp26_;
			ValadocApiSignatureBuilder* _tmp27_;
			ValadocApiSignatureBuilder* _tmp28_;
			_tmp25_ = signature;
			_tmp26_ = self->priv->_data_type;
			_tmp27_ = valadoc_api_signature_builder_append_type (_tmp25_, (ValadocApiNode*) G_TYPE_CHECK_INSTANCE_CAST (_tmp26_, VALADOC_API_TYPE_SYMBOL, ValadocApiSymbol), TRUE);
			_tmp28_ = _tmp27_;
			_valadoc_api_signature_builder_unref0 (_tmp28_);
		} else {
			ValadocApiSignatureBuilder* _tmp29_;
			ValadocApiItem* _tmp30_;
			ValadocContentInline* _tmp31_;
			ValadocContentInline* _tmp32_;
			ValadocApiSignatureBuilder* _tmp33_;
			ValadocApiSignatureBuilder* _tmp34_;
			_tmp29_ = signature;
			_tmp30_ = self->priv->_data_type;
			_tmp31_ = valadoc_api_item_get_signature (_tmp30_);
			_tmp32_ = _tmp31_;
			_tmp33_ = valadoc_api_signature_builder_append_content (_tmp29_, _tmp32_, TRUE);
			_tmp34_ = _tmp33_;
			_valadoc_api_signature_builder_unref0 (_tmp34_);
		}
	}
	_tmp35_ = self->priv->type_arguments;
	_tmp36_ = vala_collection_get_size ((ValaCollection*) _tmp35_);
	_tmp37_ = _tmp36_;
	if (_tmp37_ > 0) {
		ValadocApiSignatureBuilder* _tmp38_;
		ValadocApiSignatureBuilder* _tmp39_;
		ValadocApiSignatureBuilder* _tmp40_;
		gboolean first = FALSE;
		ValadocApiSignatureBuilder* _tmp62_;
		ValadocApiSignatureBuilder* _tmp63_;
		ValadocApiSignatureBuilder* _tmp64_;
		_tmp38_ = signature;
		_tmp39_ = valadoc_api_signature_builder_append (_tmp38_, "<", FALSE);
		_tmp40_ = _tmp39_;
		_valadoc_api_signature_builder_unref0 (_tmp40_);
		first = TRUE;
		{
			ValaArrayList* _param_list = NULL;
			ValaArrayList* _tmp41_;
			ValaArrayList* _tmp42_;
			gint _param_size = 0;
			ValaArrayList* _tmp43_;
			gint _tmp44_;
			gint _tmp45_;
			gint _param_index = 0;
			_tmp41_ = self->priv->type_arguments;
			_tmp42_ = _vala_iterable_ref0 (_tmp41_);
			_param_list = _tmp42_;
			_tmp43_ = _param_list;
			_tmp44_ = vala_collection_get_size ((ValaCollection*) _tmp43_);
			_tmp45_ = _tmp44_;
			_param_size = _tmp45_;
			_param_index = -1;
			while (TRUE) {
				gint _tmp46_;
				gint _tmp47_;
				gint _tmp48_;
				ValadocApiItem* param = NULL;
				ValaArrayList* _tmp49_;
				gint _tmp50_;
				gpointer _tmp51_;
				gboolean _tmp52_;
				ValadocApiSignatureBuilder* _tmp56_;
				ValadocApiItem* _tmp57_;
				ValadocContentInline* _tmp58_;
				ValadocContentInline* _tmp59_;
				ValadocApiSignatureBuilder* _tmp60_;
				ValadocApiSignatureBuilder* _tmp61_;
				_tmp46_ = _param_index;
				_param_index = _tmp46_ + 1;
				_tmp47_ = _param_index;
				_tmp48_ = _param_size;
				if (!(_tmp47_ < _tmp48_)) {
					break;
				}
				_tmp49_ = _param_list;
				_tmp50_ = _param_index;
				_tmp51_ = vala_list_get ((ValaList*) _tmp49_, _tmp50_);
				param = (ValadocApiItem*) ((ValadocApiTypeReference*) _tmp51_);
				_tmp52_ = first;
				if (!_tmp52_) {
					ValadocApiSignatureBuilder* _tmp53_;
					ValadocApiSignatureBuilder* _tmp54_;
					ValadocApiSignatureBuilder* _tmp55_;
					_tmp53_ = signature;
					_tmp54_ = valadoc_api_signature_builder_append (_tmp53_, ",", FALSE);
					_tmp55_ = _tmp54_;
					_valadoc_api_signature_builder_unref0 (_tmp55_);
				}
				_tmp56_ = signature;
				_tmp57_ = param;
				_tmp58_ = valadoc_api_item_get_signature (_tmp57_);
				_tmp59_ = _tmp58_;
				_tmp60_ = valadoc_api_signature_builder_append_content (_tmp56_, _tmp59_, FALSE);
				_tmp61_ = _tmp60_;
				_valadoc_api_signature_builder_unref0 (_tmp61_);
				first = FALSE;
				_g_object_unref0 (param);
			}
			_vala_iterable_unref0 (_param_list);
		}
		_tmp62_ = signature;
		_tmp63_ = valadoc_api_signature_builder_append (_tmp62_, ">", FALSE);
		_tmp64_ = _tmp63_;
		_valadoc_api_signature_builder_unref0 (_tmp64_);
	}
	_tmp65_ = self->priv->_is_nullable;
	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_ = valadoc_api_signature_builder_get (_tmp69_);
	result = (ValadocContentInline*) _tmp70_;
	_valadoc_api_signature_builder_unref0 (signature);
	return result;
}


ValadocApiItem* valadoc_api_typereference_get_data_type (ValadocApiTypeReference* self) {
	ValadocApiItem* result;
	ValadocApiItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_data_type;
	result = _tmp0_;
	return result;
}


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


void valadoc_api_typereference_set_data_type (ValadocApiTypeReference* self, ValadocApiItem* value) {
	g_return_if_fail (self != NULL);
	if (valadoc_api_typereference_get_data_type (self) != value) {
		ValadocApiItem* _tmp0_;
		ValadocApiItem* _tmp1_;
		_tmp0_ = value;
		_tmp1_ = _g_object_ref0 (_tmp0_);
		_g_object_unref0 (self->priv->_data_type);
		self->priv->_data_type = _tmp1_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_typereference_properties[VALADOC_API_TYPEREFERENCE_DATA_TYPE_PROPERTY]);
	}
}


gboolean valadoc_api_typereference_get_pass_ownership (ValadocApiTypeReference* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_pass_ownership;
	result = _tmp0_;
	return result;
}


static void valadoc_api_typereference_set_pass_ownership (ValadocApiTypeReference* self, gboolean value) {
	g_return_if_fail (self != NULL);
	if (valadoc_api_typereference_get_pass_ownership (self) != value) {
		gboolean _tmp0_;
		_tmp0_ = value;
		self->priv->_pass_ownership = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_typereference_properties[VALADOC_API_TYPEREFERENCE_PASS_OWNERSHIP_PROPERTY]);
	}
}


gboolean valadoc_api_typereference_get_is_owned (ValadocApiTypeReference* self) {
	gboolean result;
	ValadocApiOwnership _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->ownership;
	result = _tmp0_ == VALADOC_API_OWNERSHIP_OWNED;
	return result;
}


gboolean valadoc_api_typereference_get_is_weak (ValadocApiTypeReference* self) {
	gboolean result;
	ValadocApiOwnership _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->ownership;
	result = _tmp0_ == VALADOC_API_OWNERSHIP_WEAK;
	return result;
}


gboolean valadoc_api_typereference_get_is_unowned (ValadocApiTypeReference* self) {
	gboolean result;
	ValadocApiOwnership _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->ownership;
	result = _tmp0_ == VALADOC_API_OWNERSHIP_UNOWNED;
	return result;
}


gboolean valadoc_api_typereference_get_is_dynamic (ValadocApiTypeReference* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_is_dynamic;
	result = _tmp0_;
	return result;
}


static void valadoc_api_typereference_set_is_dynamic (ValadocApiTypeReference* self, gboolean value) {
	g_return_if_fail (self != NULL);
	if (valadoc_api_typereference_get_is_dynamic (self) != value) {
		gboolean _tmp0_;
		_tmp0_ = value;
		self->priv->_is_dynamic = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_typereference_properties[VALADOC_API_TYPEREFERENCE_IS_DYNAMIC_PROPERTY]);
	}
}


gboolean valadoc_api_typereference_get_is_nullable (ValadocApiTypeReference* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_is_nullable;
	result = _tmp0_;
	return result;
}


static void valadoc_api_typereference_set_is_nullable (ValadocApiTypeReference* self, gboolean value) {
	g_return_if_fail (self != NULL);
	if (valadoc_api_typereference_get_is_nullable (self) != value) {
		gboolean _tmp0_;
		_tmp0_ = value;
		self->priv->_is_nullable = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_typereference_properties[VALADOC_API_TYPEREFERENCE_IS_NULLABLE_PROPERTY]);
	}
}


static void valadoc_api_typereference_class_init (ValadocApiTypeReferenceClass * klass) {
	valadoc_api_typereference_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ValadocApiTypeReferencePrivate));
	((ValadocApiItemClass *) klass)->build_signature = (ValadocContentInline* (*) (ValadocApiItem *)) valadoc_api_typereference_real_build_signature;
	G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_api_typereference_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_api_typereference_set_property;
	G_OBJECT_CLASS (klass)->finalize = valadoc_api_typereference_finalize;
	/**
	 * The referred data type.
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_TYPEREFERENCE_DATA_TYPE_PROPERTY, valadoc_api_typereference_properties[VALADOC_API_TYPEREFERENCE_DATA_TYPE_PROPERTY] = g_param_spec_object ("data-type", "data-type", "data-type", VALADOC_API_TYPE_ITEM, 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), VALADOC_API_TYPEREFERENCE_PASS_OWNERSHIP_PROPERTY, valadoc_api_typereference_properties[VALADOC_API_TYPEREFERENCE_PASS_OWNERSHIP_PROPERTY] = g_param_spec_boolean ("pass-ownership", "pass-ownership", "pass-ownership", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	 * Specifies that the expression is owned.
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_TYPEREFERENCE_IS_OWNED_PROPERTY, valadoc_api_typereference_properties[VALADOC_API_TYPEREFERENCE_IS_OWNED_PROPERTY] = g_param_spec_boolean ("is-owned", "is-owned", "is-owned", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	 * Specifies that the expression is weak.
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_TYPEREFERENCE_IS_WEAK_PROPERTY, valadoc_api_typereference_properties[VALADOC_API_TYPEREFERENCE_IS_WEAK_PROPERTY] = g_param_spec_boolean ("is-weak", "is-weak", "is-weak", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	 * Specifies that the expression is unwoned.
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_TYPEREFERENCE_IS_UNOWNED_PROPERTY, valadoc_api_typereference_properties[VALADOC_API_TYPEREFERENCE_IS_UNOWNED_PROPERTY] = g_param_spec_boolean ("is-unowned", "is-unowned", "is-unowned", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	 * Specifies that the expression is dynamic.
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_TYPEREFERENCE_IS_DYNAMIC_PROPERTY, valadoc_api_typereference_properties[VALADOC_API_TYPEREFERENCE_IS_DYNAMIC_PROPERTY] = g_param_spec_boolean ("is-dynamic", "is-dynamic", "is-dynamic", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	/**
	 * Specifies that the expression may be null.
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_TYPEREFERENCE_IS_NULLABLE_PROPERTY, valadoc_api_typereference_properties[VALADOC_API_TYPEREFERENCE_IS_NULLABLE_PROPERTY] = g_param_spec_boolean ("is-nullable", "is-nullable", "is-nullable", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void valadoc_api_typereference_instance_init (ValadocApiTypeReference * self) {
	GEqualFunc _tmp0_;
	ValaArrayList* _tmp1_;
	self->priv = VALADOC_API_TYPEREFERENCE_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->type_arguments = _tmp1_;
}


static void valadoc_api_typereference_finalize (GObject * obj) {
	ValadocApiTypeReference * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_API_TYPE_TYPEREFERENCE, ValadocApiTypeReference);
	_vala_iterable_unref0 (self->priv->type_arguments);
	_g_free0 (self->priv->dbus_type_signature);
	_g_object_unref0 (self->priv->_data_type);
	G_OBJECT_CLASS (valadoc_api_typereference_parent_class)->finalize (obj);
}


/**
 * A reference to a data type.
 */
GType valadoc_api_typereference_get_type (void) {
	static volatile gsize valadoc_api_typereference_type_id__volatile = 0;
	if (g_once_init_enter (&valadoc_api_typereference_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ValadocApiTypeReferenceClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_api_typereference_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocApiTypeReference), 0, (GInstanceInitFunc) valadoc_api_typereference_instance_init, NULL };
		GType valadoc_api_typereference_type_id;
		valadoc_api_typereference_type_id = g_type_register_static (VALADOC_API_TYPE_ITEM, "ValadocApiTypeReference", &g_define_type_info, 0);
		g_once_init_leave (&valadoc_api_typereference_type_id__volatile, valadoc_api_typereference_type_id);
	}
	return valadoc_api_typereference_type_id__volatile;
}


static void _vala_valadoc_api_typereference_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ValadocApiTypeReference * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_TYPEREFERENCE, ValadocApiTypeReference);
	switch (property_id) {
		case VALADOC_API_TYPEREFERENCE_DATA_TYPE_PROPERTY:
		g_value_set_object (value, valadoc_api_typereference_get_data_type (self));
		break;
		case VALADOC_API_TYPEREFERENCE_PASS_OWNERSHIP_PROPERTY:
		g_value_set_boolean (value, valadoc_api_typereference_get_pass_ownership (self));
		break;
		case VALADOC_API_TYPEREFERENCE_IS_OWNED_PROPERTY:
		g_value_set_boolean (value, valadoc_api_typereference_get_is_owned (self));
		break;
		case VALADOC_API_TYPEREFERENCE_IS_WEAK_PROPERTY:
		g_value_set_boolean (value, valadoc_api_typereference_get_is_weak (self));
		break;
		case VALADOC_API_TYPEREFERENCE_IS_UNOWNED_PROPERTY:
		g_value_set_boolean (value, valadoc_api_typereference_get_is_unowned (self));
		break;
		case VALADOC_API_TYPEREFERENCE_IS_DYNAMIC_PROPERTY:
		g_value_set_boolean (value, valadoc_api_typereference_get_is_dynamic (self));
		break;
		case VALADOC_API_TYPEREFERENCE_IS_NULLABLE_PROPERTY:
		g_value_set_boolean (value, valadoc_api_typereference_get_is_nullable (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_valadoc_api_typereference_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ValadocApiTypeReference * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_TYPEREFERENCE, ValadocApiTypeReference);
	switch (property_id) {
		case VALADOC_API_TYPEREFERENCE_DATA_TYPE_PROPERTY:
		valadoc_api_typereference_set_data_type (self, g_value_get_object (value));
		break;
		case VALADOC_API_TYPEREFERENCE_PASS_OWNERSHIP_PROPERTY:
		valadoc_api_typereference_set_pass_ownership (self, g_value_get_boolean (value));
		break;
		case VALADOC_API_TYPEREFERENCE_IS_DYNAMIC_PROPERTY:
		valadoc_api_typereference_set_is_dynamic (self, g_value_get_boolean (value));
		break;
		case VALADOC_API_TYPEREFERENCE_IS_NULLABLE_PROPERTY:
		valadoc_api_typereference_set_is_nullable (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}



