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

/* valafieldprototype.vala
 *
 * Copyright (C) 2008  Jürg Billeter
 *
 * 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:
 * 	Jürg Billeter <j@bitron.ch>
 */

#include "vala.h"
#include <stdlib.h>
#include <string.h>
#include <glib.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

static gpointer vala_field_prototype_parent_class = NULL;

static ValaDataType* vala_field_prototype_real_copy (ValaDataType* base);
static gchar* vala_field_prototype_real_to_qualified_string (ValaDataType* base,
                                                      ValaScope* scope);
static GType vala_field_prototype_get_type_once (void);

ValaField*
vala_field_prototype_get_field_symbol (ValaFieldPrototype* self)
{
	ValaField* result;
	ValaSymbol* _tmp0_;
	ValaSymbol* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = vala_data_type_get_symbol ((ValaDataType*) self);
	_tmp1_ = _tmp0_;
	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_FIELD, ValaField);
	return result;
}

ValaFieldPrototype*
vala_field_prototype_construct (GType object_type,
                                ValaField* field_symbol,
                                ValaSourceReference* source_reference)
{
	ValaFieldPrototype* self = NULL;
	g_return_val_if_fail (field_symbol != NULL, NULL);
	self = (ValaFieldPrototype*) vala_data_type_construct_with_symbol (object_type, (ValaSymbol*) field_symbol, source_reference);
	return self;
}

ValaFieldPrototype*
vala_field_prototype_new (ValaField* field_symbol,
                          ValaSourceReference* source_reference)
{
	return vala_field_prototype_construct (VALA_TYPE_FIELD_PROTOTYPE, field_symbol, source_reference);
}

static ValaDataType*
vala_field_prototype_real_copy (ValaDataType* base)
{
	ValaFieldPrototype * self;
	ValaFieldPrototype* _result_ = NULL;
	ValaField* _tmp0_;
	ValaField* _tmp1_;
	ValaSourceReference* _tmp2_;
	ValaSourceReference* _tmp3_;
	ValaFieldPrototype* _tmp4_;
	ValaDataType* result;
	self = (ValaFieldPrototype*) base;
	_tmp0_ = vala_field_prototype_get_field_symbol (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = vala_code_node_get_source_reference ((ValaCodeNode*) self);
	_tmp3_ = _tmp2_;
	_tmp4_ = vala_field_prototype_new (_tmp1_, _tmp3_);
	_result_ = _tmp4_;
	result = (ValaDataType*) _result_;
	return result;
}

static gchar*
vala_field_prototype_real_to_qualified_string (ValaDataType* base,
                                               ValaScope* scope)
{
	ValaFieldPrototype * self;
	ValaField* _tmp0_;
	ValaField* _tmp1_;
	gchar* _tmp2_;
	gchar* result;
	self = (ValaFieldPrototype*) base;
	_tmp0_ = vala_field_prototype_get_field_symbol (self);
	_tmp1_ = _tmp0_;
	_tmp2_ = vala_symbol_get_full_name ((ValaSymbol*) _tmp1_);
	result = _tmp2_;
	return result;
}

static void
vala_field_prototype_class_init (ValaFieldPrototypeClass * klass,
                                 gpointer klass_data)
{
	vala_field_prototype_parent_class = g_type_class_peek_parent (klass);
	((ValaDataTypeClass *) klass)->copy = (ValaDataType* (*) (ValaDataType*)) vala_field_prototype_real_copy;
	((ValaDataTypeClass *) klass)->to_qualified_string = (gchar* (*) (ValaDataType*, ValaScope*)) vala_field_prototype_real_to_qualified_string;
}

static void
vala_field_prototype_instance_init (ValaFieldPrototype * self,
                                    gpointer klass)
{
}

/**
 * A reference to an instance field without a specific instance.
 */
static GType
vala_field_prototype_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ValaFieldPrototypeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_field_prototype_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaFieldPrototype), 0, (GInstanceInitFunc) vala_field_prototype_instance_init, NULL };
	GType vala_field_prototype_type_id;
	vala_field_prototype_type_id = g_type_register_static (VALA_TYPE_DATA_TYPE, "ValaFieldPrototype", &g_define_type_info, 0);
	return vala_field_prototype_type_id;
}

GType
vala_field_prototype_get_type (void)
{
	static volatile gsize vala_field_prototype_type_id__once = 0;
	if (g_once_init_enter (&vala_field_prototype_type_id__once)) {
		GType vala_field_prototype_type_id;
		vala_field_prototype_type_id = vala_field_prototype_get_type_once ();
		g_once_init_leave (&vala_field_prototype_type_id__once, vala_field_prototype_type_id);
	}
	return vala_field_prototype_type_id__once;
}

