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

/* parameter.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 "valadoc.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <vala.h>
#include <glib-object.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	VALADOC_API_PARAMETER_0_PROPERTY,
	VALADOC_API_PARAMETER_DEFAULT_VALUE_PROPERTY,
	VALADOC_API_PARAMETER_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY,
	VALADOC_API_PARAMETER_IMPLICIT_CLOSURE_CPARAMETER_NAME_PROPERTY,
	VALADOC_API_PARAMETER_IMPLICIT_DESTROY_CPARAMETER_NAME_PROPERTY,
	VALADOC_API_PARAMETER_IS_OUT_PROPERTY,
	VALADOC_API_PARAMETER_IS_REF_PROPERTY,
	VALADOC_API_PARAMETER_HAS_DEFAULT_VALUE_PROPERTY,
	VALADOC_API_PARAMETER_PARAMETER_TYPE_PROPERTY,
	VALADOC_API_PARAMETER_ELLIPSIS_PROPERTY,
	VALADOC_API_PARAMETER_NODE_TYPE_PROPERTY,
	VALADOC_API_PARAMETER_NUM_PROPERTIES
};
static GParamSpec* valadoc_api_parameter_properties[VALADOC_API_PARAMETER_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _valadoc_api_signature_builder_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_api_signature_builder_unref (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 _ValadocApiParameterPrivate {
	ValadocContentRun* _default_value;
	gchar* _implicit_array_length_cparameter_name;
	gchar* _implicit_closure_cparameter_name;
	gchar* _implicit_destroy_cparameter_name;
	ValaParameterDirection type;
	ValadocApiTypeReference* _parameter_type;
	gboolean _ellipsis;
};

static gint ValadocApiParameter_private_offset;
static gpointer valadoc_api_parameter_parent_class = NULL;

 G_GNUC_INTERNAL const gchar* valadoc_api_parameter_get_implicit_array_length_cparameter_name (ValadocApiParameter* self);
 G_GNUC_INTERNAL void valadoc_api_parameter_set_implicit_array_length_cparameter_name (ValadocApiParameter* self,
                                                                      const gchar* value);
 G_GNUC_INTERNAL const gchar* valadoc_api_parameter_get_implicit_closure_cparameter_name (ValadocApiParameter* self);
 G_GNUC_INTERNAL void valadoc_api_parameter_set_implicit_closure_cparameter_name (ValadocApiParameter* self,
                                                                 const gchar* value);
 G_GNUC_INTERNAL const gchar* valadoc_api_parameter_get_implicit_destroy_cparameter_name (ValadocApiParameter* self);
 G_GNUC_INTERNAL void valadoc_api_parameter_set_implicit_destroy_cparameter_name (ValadocApiParameter* self,
                                                                 const gchar* value);
static void valadoc_api_parameter_set_ellipsis (ValadocApiParameter* self,
                                         gboolean value);
static void valadoc_api_parameter_real_accept (ValadocApiNode* base,
                                        ValadocApiVisitor* visitor);
static ValadocContentInline* valadoc_api_parameter_real_build_signature (ValadocApiItem* base);
static void valadoc_api_parameter_finalize (GObject * obj);
static GType valadoc_api_parameter_get_type_once (void);
static void _vala_valadoc_api_parameter_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec);
static void _vala_valadoc_api_parameter_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec);

static inline gpointer
valadoc_api_parameter_get_instance_private (ValadocApiParameter* self)
{
	return G_STRUCT_MEMBER_P (self, ValadocApiParameter_private_offset);
}

ValadocContentRun*
valadoc_api_parameter_get_default_value (ValadocApiParameter* self)
{
	ValadocContentRun* result;
	ValadocContentRun* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_default_value;
	result = _tmp0_;
	return result;
}

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

void
valadoc_api_parameter_set_default_value (ValadocApiParameter* self,
                                         ValadocContentRun* value)
{
	ValadocContentRun* old_value;
	g_return_if_fail (self != NULL);
	old_value = valadoc_api_parameter_get_default_value (self);
	if (old_value != value) {
		ValadocContentRun* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_default_value);
		self->priv->_default_value = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_DEFAULT_VALUE_PROPERTY]);
	}
}

 G_GNUC_INTERNAL const gchar*
valadoc_api_parameter_get_implicit_array_length_cparameter_name (ValadocApiParameter* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_implicit_array_length_cparameter_name;
	result = _tmp0_;
	return result;
}

 G_GNUC_INTERNAL void
valadoc_api_parameter_set_implicit_array_length_cparameter_name (ValadocApiParameter* self,
                                                                 const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = valadoc_api_parameter_get_implicit_array_length_cparameter_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_implicit_array_length_cparameter_name);
		self->priv->_implicit_array_length_cparameter_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY]);
	}
}

 G_GNUC_INTERNAL const gchar*
valadoc_api_parameter_get_implicit_closure_cparameter_name (ValadocApiParameter* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_implicit_closure_cparameter_name;
	result = _tmp0_;
	return result;
}

 G_GNUC_INTERNAL void
valadoc_api_parameter_set_implicit_closure_cparameter_name (ValadocApiParameter* self,
                                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = valadoc_api_parameter_get_implicit_closure_cparameter_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_implicit_closure_cparameter_name);
		self->priv->_implicit_closure_cparameter_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_IMPLICIT_CLOSURE_CPARAMETER_NAME_PROPERTY]);
	}
}

 G_GNUC_INTERNAL const gchar*
valadoc_api_parameter_get_implicit_destroy_cparameter_name (ValadocApiParameter* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_implicit_destroy_cparameter_name;
	result = _tmp0_;
	return result;
}

 G_GNUC_INTERNAL void
valadoc_api_parameter_set_implicit_destroy_cparameter_name (ValadocApiParameter* self,
                                                            const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = valadoc_api_parameter_get_implicit_destroy_cparameter_name (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_implicit_destroy_cparameter_name);
		self->priv->_implicit_destroy_cparameter_name = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_IMPLICIT_DESTROY_CPARAMETER_NAME_PROPERTY]);
	}
}

ValadocApiParameter*
valadoc_api_parameter_construct (GType object_type,
                                 ValadocApiNode* parent,
                                 ValadocApiSourceFile* file,
                                 const gchar* name,
                                 ValaSymbolAccessibility accessibility,
                                 ValaParameterDirection type,
                                 gboolean ellipsis,
                                 ValaParameter* data)
{
	ValadocApiParameter * self = NULL;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (file != NULL, NULL);
	g_return_val_if_fail (data != NULL, NULL);
	self = (ValadocApiParameter*) valadoc_api_symbol_construct (object_type, parent, file, name, accessibility, NULL, (ValaSymbol*) data);
	if (name == NULL) {
		_tmp1_ = ellipsis;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		gboolean _tmp2_ = FALSE;
		if (name != NULL) {
			_tmp2_ = !ellipsis;
		} else {
			_tmp2_ = FALSE;
		}
		_tmp0_ = _tmp2_;
	}
	_vala_assert (_tmp0_, "(name == null && ellipsis) || (name != null && !ellipsis)");
	valadoc_api_parameter_set_ellipsis (self, ellipsis);
	self->priv->type = type;
	return self;
}

ValadocApiParameter*
valadoc_api_parameter_new (ValadocApiNode* parent,
                           ValadocApiSourceFile* file,
                           const gchar* name,
                           ValaSymbolAccessibility accessibility,
                           ValaParameterDirection type,
                           gboolean ellipsis,
                           ValaParameter* data)
{
	return valadoc_api_parameter_construct (VALADOC_API_TYPE_PARAMETER, parent, file, name, accessibility, type, ellipsis, data);
}

gboolean
valadoc_api_parameter_get_is_out (ValadocApiParameter* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->type == VALA_PARAMETER_DIRECTION_OUT;
	return result;
}

gboolean
valadoc_api_parameter_get_is_ref (ValadocApiParameter* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->type == VALA_PARAMETER_DIRECTION_REF;
	return result;
}

gboolean
valadoc_api_parameter_get_has_default_value (ValadocApiParameter* self)
{
	gboolean result;
	ValadocContentRun* _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_default_value;
	result = _tmp0_ != NULL;
	return result;
}

ValadocApiTypeReference*
valadoc_api_parameter_get_parameter_type (ValadocApiParameter* self)
{
	ValadocApiTypeReference* result;
	ValadocApiTypeReference* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_parameter_type;
	result = _tmp0_;
	return result;
}

void
valadoc_api_parameter_set_parameter_type (ValadocApiParameter* self,
                                          ValadocApiTypeReference* value)
{
	ValadocApiTypeReference* old_value;
	g_return_if_fail (self != NULL);
	old_value = valadoc_api_parameter_get_parameter_type (self);
	if (old_value != value) {
		ValadocApiTypeReference* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_parameter_type);
		self->priv->_parameter_type = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_PARAMETER_TYPE_PROPERTY]);
	}
}

gboolean
valadoc_api_parameter_get_ellipsis (ValadocApiParameter* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_ellipsis;
	return result;
}

static void
valadoc_api_parameter_set_ellipsis (ValadocApiParameter* self,
                                    gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = valadoc_api_parameter_get_ellipsis (self);
	if (old_value != value) {
		self->priv->_ellipsis = value;
		g_object_notify_by_pspec ((GObject *) self, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_ELLIPSIS_PROPERTY]);
	}
}

static ValadocApiNodeType
valadoc_api_parameter_real_get_node_type (ValadocApiNode* base)
{
	ValadocApiNodeType result;
	ValadocApiParameter* self;
	self = (ValadocApiParameter*) base;
	result = VALADOC_API_NODE_TYPE_FORMAL_PARAMETER;
	return result;
}

/**
 * {@inheritDoc}
 */
static void
valadoc_api_parameter_real_accept (ValadocApiNode* base,
                                   ValadocApiVisitor* visitor)
{
	ValadocApiParameter * self;
	self = (ValadocApiParameter*) base;
	g_return_if_fail (visitor != NULL);
	valadoc_api_visitor_visit_formal_parameter (visitor, self);
}

/**
 * {@inheritDoc}
 */
static ValadocContentInline*
valadoc_api_parameter_real_build_signature (ValadocApiItem* base)
{
	ValadocApiParameter * self;
	ValadocApiSignatureBuilder* signature = NULL;
	ValadocApiSignatureBuilder* _tmp0_;
	gboolean _tmp1_;
	ValadocApiSignatureBuilder* _tmp21_;
	ValadocContentRun* _tmp22_;
	ValadocContentInline* result;
	self = (ValadocApiParameter*) base;
	_tmp0_ = valadoc_api_signature_builder_new ();
	signature = _tmp0_;
	_tmp1_ = self->priv->_ellipsis;
	if (_tmp1_) {
		ValadocApiSignatureBuilder* _tmp2_;
		_tmp2_ = signature;
		valadoc_api_signature_builder_append (_tmp2_, "...", TRUE);
	} else {
		gboolean _tmp3_;
		gboolean _tmp4_;
		ValadocApiSignatureBuilder* _tmp9_;
		ValadocApiTypeReference* _tmp10_;
		ValadocContentInline* _tmp11_;
		ValadocContentInline* _tmp12_;
		ValadocApiSignatureBuilder* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		gboolean _tmp16_;
		gboolean _tmp17_;
		_tmp3_ = valadoc_api_parameter_get_is_out (self);
		_tmp4_ = _tmp3_;
		if (_tmp4_) {
			ValadocApiSignatureBuilder* _tmp5_;
			_tmp5_ = signature;
			valadoc_api_signature_builder_append_keyword (_tmp5_, "out", TRUE);
		} else {
			gboolean _tmp6_;
			gboolean _tmp7_;
			_tmp6_ = valadoc_api_parameter_get_is_ref (self);
			_tmp7_ = _tmp6_;
			if (_tmp7_) {
				ValadocApiSignatureBuilder* _tmp8_;
				_tmp8_ = signature;
				valadoc_api_signature_builder_append_keyword (_tmp8_, "ref", TRUE);
			}
		}
		_tmp9_ = signature;
		_tmp10_ = self->priv->_parameter_type;
		_tmp11_ = valadoc_api_item_get_signature ((ValadocApiItem*) _tmp10_);
		_tmp12_ = _tmp11_;
		valadoc_api_signature_builder_append_content (_tmp9_, _tmp12_, TRUE);
		_tmp13_ = signature;
		_tmp14_ = valadoc_api_node_get_name ((ValadocApiNode*) self);
		_tmp15_ = _tmp14_;
		valadoc_api_signature_builder_append (_tmp13_, _tmp15_, TRUE);
		_tmp16_ = valadoc_api_parameter_get_has_default_value (self);
		_tmp17_ = _tmp16_;
		if (_tmp17_) {
			ValadocApiSignatureBuilder* _tmp18_;
			ValadocApiSignatureBuilder* _tmp19_;
			ValadocContentRun* _tmp20_;
			_tmp18_ = signature;
			valadoc_api_signature_builder_append (_tmp18_, "=", TRUE);
			_tmp19_ = signature;
			_tmp20_ = self->priv->_default_value;
			valadoc_api_signature_builder_append_content (_tmp19_, (ValadocContentInline*) _tmp20_, TRUE);
		}
	}
	_tmp21_ = signature;
	_tmp22_ = valadoc_api_signature_builder_get (_tmp21_);
	result = (ValadocContentInline*) _tmp22_;
	_valadoc_api_signature_builder_unref0 (signature);
	return result;
}

static void
valadoc_api_parameter_class_init (ValadocApiParameterClass * klass,
                                  gpointer klass_data)
{
	valadoc_api_parameter_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ValadocApiParameter_private_offset);
	((ValadocApiNodeClass *) klass)->accept = (void (*) (ValadocApiNode*, ValadocApiVisitor*)) valadoc_api_parameter_real_accept;
	((ValadocApiItemClass *) klass)->build_signature = (ValadocContentInline* (*) (ValadocApiItem*)) valadoc_api_parameter_real_build_signature;
	VALADOC_API_NODE_CLASS (klass)->get_node_type = (ValadocApiNodeType (*) (ValadocApiNode*)) valadoc_api_parameter_real_get_node_type;
	G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_api_parameter_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_api_parameter_set_property;
	G_OBJECT_CLASS (klass)->finalize = valadoc_api_parameter_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_PARAMETER_DEFAULT_VALUE_PROPERTY, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_DEFAULT_VALUE_PROPERTY] = g_param_spec_object ("default-value", "default-value", "default-value", VALADOC_CONTENT_TYPE_RUN, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	 * Used to translate imported C-documentation
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_PARAMETER_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_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_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	 * Used to translate imported C-documentation
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_PARAMETER_IMPLICIT_CLOSURE_CPARAMETER_NAME_PROPERTY, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_IMPLICIT_CLOSURE_CPARAMETER_NAME_PROPERTY] = g_param_spec_string ("implicit-closure-cparameter-name", "implicit-closure-cparameter-name", "implicit-closure-cparameter-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	 * Used to translate imported C-documentation
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_PARAMETER_IMPLICIT_DESTROY_CPARAMETER_NAME_PROPERTY, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_IMPLICIT_DESTROY_CPARAMETER_NAME_PROPERTY] = g_param_spec_string ("implicit-destroy-cparameter-name", "implicit-destroy-cparameter-name", "implicit-destroy-cparameter-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	 * Specifies whether the parameter direction is out
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_PARAMETER_IS_OUT_PROPERTY, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_IS_OUT_PROPERTY] = g_param_spec_boolean ("is-out", "is-out", "is-out", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	 * Specifies whether the parameter direction is ref
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_PARAMETER_IS_REF_PROPERTY, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_IS_REF_PROPERTY] = g_param_spec_boolean ("is-ref", "is-ref", "is-ref", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	 * Specifies whether the parameter has a default value
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_PARAMETER_HAS_DEFAULT_VALUE_PROPERTY, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_HAS_DEFAULT_VALUE_PROPERTY] = g_param_spec_boolean ("has-default-value", "has-default-value", "has-default-value", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	 * The parameter type.
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_PARAMETER_PARAMETER_TYPE_PROPERTY, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_PARAMETER_TYPE_PROPERTY] = g_param_spec_object ("parameter-type", "parameter-type", "parameter-type", VALADOC_API_TYPE_TYPEREFERENCE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	/**
	 * Specifies whether the methods accepts a variable number of arguments
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_PARAMETER_ELLIPSIS_PROPERTY, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_ELLIPSIS_PROPERTY] = g_param_spec_boolean ("ellipsis", "ellipsis", "ellipsis", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	/**
	 * {@inheritDoc}
	 */
	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_PARAMETER_NODE_TYPE_PROPERTY, valadoc_api_parameter_properties[VALADOC_API_PARAMETER_NODE_TYPE_PROPERTY] = g_param_spec_enum ("node-type", "node-type", "node-type", VALADOC_API_TYPE_NODE_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
valadoc_api_parameter_instance_init (ValadocApiParameter * self,
                                     gpointer klass)
{
	self->priv = valadoc_api_parameter_get_instance_private (self);
}

static void
valadoc_api_parameter_finalize (GObject * obj)
{
	ValadocApiParameter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_API_TYPE_PARAMETER, ValadocApiParameter);
	_g_object_unref0 (self->priv->_default_value);
	_g_free0 (self->priv->_implicit_array_length_cparameter_name);
	_g_free0 (self->priv->_implicit_closure_cparameter_name);
	_g_free0 (self->priv->_implicit_destroy_cparameter_name);
	_g_object_unref0 (self->priv->_parameter_type);
	G_OBJECT_CLASS (valadoc_api_parameter_parent_class)->finalize (obj);
}

/**
 * Represents a parameter in method, signal and delegate signatures.
 */
static GType
valadoc_api_parameter_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ValadocApiParameterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_api_parameter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocApiParameter), 0, (GInstanceInitFunc) valadoc_api_parameter_instance_init, NULL };
	GType valadoc_api_parameter_type_id;
	valadoc_api_parameter_type_id = g_type_register_static (VALADOC_API_TYPE_SYMBOL, "ValadocApiParameter", &g_define_type_info, 0);
	ValadocApiParameter_private_offset = g_type_add_instance_private (valadoc_api_parameter_type_id, sizeof (ValadocApiParameterPrivate));
	return valadoc_api_parameter_type_id;
}

GType
valadoc_api_parameter_get_type (void)
{
	static volatile gsize valadoc_api_parameter_type_id__once = 0;
	if (g_once_init_enter (&valadoc_api_parameter_type_id__once)) {
		GType valadoc_api_parameter_type_id;
		valadoc_api_parameter_type_id = valadoc_api_parameter_get_type_once ();
		g_once_init_leave (&valadoc_api_parameter_type_id__once, valadoc_api_parameter_type_id);
	}
	return valadoc_api_parameter_type_id__once;
}

static void
_vala_valadoc_api_parameter_get_property (GObject * object,
                                          guint property_id,
                                          GValue * value,
                                          GParamSpec * pspec)
{
	ValadocApiParameter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_PARAMETER, ValadocApiParameter);
	switch (property_id) {
		case VALADOC_API_PARAMETER_DEFAULT_VALUE_PROPERTY:
		g_value_set_object (value, valadoc_api_parameter_get_default_value (self));
		break;
		case VALADOC_API_PARAMETER_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY:
		g_value_set_string (value, valadoc_api_parameter_get_implicit_array_length_cparameter_name (self));
		break;
		case VALADOC_API_PARAMETER_IMPLICIT_CLOSURE_CPARAMETER_NAME_PROPERTY:
		g_value_set_string (value, valadoc_api_parameter_get_implicit_closure_cparameter_name (self));
		break;
		case VALADOC_API_PARAMETER_IMPLICIT_DESTROY_CPARAMETER_NAME_PROPERTY:
		g_value_set_string (value, valadoc_api_parameter_get_implicit_destroy_cparameter_name (self));
		break;
		case VALADOC_API_PARAMETER_IS_OUT_PROPERTY:
		g_value_set_boolean (value, valadoc_api_parameter_get_is_out (self));
		break;
		case VALADOC_API_PARAMETER_IS_REF_PROPERTY:
		g_value_set_boolean (value, valadoc_api_parameter_get_is_ref (self));
		break;
		case VALADOC_API_PARAMETER_HAS_DEFAULT_VALUE_PROPERTY:
		g_value_set_boolean (value, valadoc_api_parameter_get_has_default_value (self));
		break;
		case VALADOC_API_PARAMETER_PARAMETER_TYPE_PROPERTY:
		g_value_set_object (value, valadoc_api_parameter_get_parameter_type (self));
		break;
		case VALADOC_API_PARAMETER_ELLIPSIS_PROPERTY:
		g_value_set_boolean (value, valadoc_api_parameter_get_ellipsis (self));
		break;
		case VALADOC_API_PARAMETER_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_parameter_set_property (GObject * object,
                                          guint property_id,
                                          const GValue * value,
                                          GParamSpec * pspec)
{
	ValadocApiParameter * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_PARAMETER, ValadocApiParameter);
	switch (property_id) {
		case VALADOC_API_PARAMETER_DEFAULT_VALUE_PROPERTY:
		valadoc_api_parameter_set_default_value (self, g_value_get_object (value));
		break;
		case VALADOC_API_PARAMETER_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY:
		valadoc_api_parameter_set_implicit_array_length_cparameter_name (self, g_value_get_string (value));
		break;
		case VALADOC_API_PARAMETER_IMPLICIT_CLOSURE_CPARAMETER_NAME_PROPERTY:
		valadoc_api_parameter_set_implicit_closure_cparameter_name (self, g_value_get_string (value));
		break;
		case VALADOC_API_PARAMETER_IMPLICIT_DESTROY_CPARAMETER_NAME_PROPERTY:
		valadoc_api_parameter_set_implicit_destroy_cparameter_name (self, g_value_get_string (value));
		break;
		case VALADOC_API_PARAMETER_PARAMETER_TYPE_PROPERTY:
		valadoc_api_parameter_set_parameter_type (self, g_value_get_object (value));
		break;
		case VALADOC_API_PARAMETER_ELLIPSIS_PROPERTY:
		valadoc_api_parameter_set_ellipsis (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

