1 /* valafieldprototype.c generated by valac, the Vala compiler
2  * generated from valafieldprototype.vala, do not modify */
3 
4 /* valafieldprototype.vala
5  *
6  * Copyright (C) 2008  Jürg Billeter
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12 
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17 
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
21  *
22  * Author:
23  * 	Jürg Billeter <j@bitron.ch>
24  */
25 
26 #include "vala.h"
27 #include <stdlib.h>
28 #include <string.h>
29 #include <glib.h>
30 
31 static gpointer vala_field_prototype_parent_class = NULL;
32 
33 static ValaDataType* vala_field_prototype_real_copy (ValaDataType* base);
34 static gchar* vala_field_prototype_real_to_qualified_string (ValaDataType* base,
35                                                       ValaScope* scope);
36 static GType vala_field_prototype_get_type_once (void);
37 
38 ValaField*
vala_field_prototype_get_field_symbol(ValaFieldPrototype * self)39 vala_field_prototype_get_field_symbol (ValaFieldPrototype* self)
40 {
41 	ValaField* result;
42 	ValaSymbol* _tmp0_;
43 	ValaSymbol* _tmp1_;
44 	g_return_val_if_fail (self != NULL, NULL);
45 	_tmp0_ = vala_data_type_get_symbol ((ValaDataType*) self);
46 	_tmp1_ = _tmp0_;
47 	result = G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_FIELD, ValaField);
48 	return result;
49 }
50 
51 ValaFieldPrototype*
vala_field_prototype_construct(GType object_type,ValaField * field_symbol)52 vala_field_prototype_construct (GType object_type,
53                                 ValaField* field_symbol)
54 {
55 	ValaFieldPrototype* self = NULL;
56 	g_return_val_if_fail (field_symbol != NULL, NULL);
57 	self = (ValaFieldPrototype*) vala_data_type_construct_with_symbol (object_type, (ValaSymbol*) field_symbol);
58 	return self;
59 }
60 
61 ValaFieldPrototype*
vala_field_prototype_new(ValaField * field_symbol)62 vala_field_prototype_new (ValaField* field_symbol)
63 {
64 	return vala_field_prototype_construct (VALA_TYPE_FIELD_PROTOTYPE, field_symbol);
65 }
66 
67 static ValaDataType*
vala_field_prototype_real_copy(ValaDataType * base)68 vala_field_prototype_real_copy (ValaDataType* base)
69 {
70 	ValaFieldPrototype * self;
71 	ValaFieldPrototype* _result_ = NULL;
72 	ValaField* _tmp0_;
73 	ValaField* _tmp1_;
74 	ValaFieldPrototype* _tmp2_;
75 	ValaDataType* result = NULL;
76 	self = (ValaFieldPrototype*) base;
77 	_tmp0_ = vala_field_prototype_get_field_symbol (self);
78 	_tmp1_ = _tmp0_;
79 	_tmp2_ = vala_field_prototype_new (_tmp1_);
80 	_result_ = _tmp2_;
81 	result = (ValaDataType*) _result_;
82 	return result;
83 }
84 
85 static gchar*
vala_field_prototype_real_to_qualified_string(ValaDataType * base,ValaScope * scope)86 vala_field_prototype_real_to_qualified_string (ValaDataType* base,
87                                                ValaScope* scope)
88 {
89 	ValaFieldPrototype * self;
90 	ValaField* _tmp0_;
91 	ValaField* _tmp1_;
92 	gchar* _tmp2_;
93 	gchar* result = NULL;
94 	self = (ValaFieldPrototype*) base;
95 	_tmp0_ = vala_field_prototype_get_field_symbol (self);
96 	_tmp1_ = _tmp0_;
97 	_tmp2_ = vala_symbol_get_full_name ((ValaSymbol*) _tmp1_);
98 	result = _tmp2_;
99 	return result;
100 }
101 
102 static void
vala_field_prototype_class_init(ValaFieldPrototypeClass * klass,gpointer klass_data)103 vala_field_prototype_class_init (ValaFieldPrototypeClass * klass,
104                                  gpointer klass_data)
105 {
106 	vala_field_prototype_parent_class = g_type_class_peek_parent (klass);
107 	((ValaDataTypeClass *) klass)->copy = (ValaDataType* (*) (ValaDataType*)) vala_field_prototype_real_copy;
108 	((ValaDataTypeClass *) klass)->to_qualified_string = (gchar* (*) (ValaDataType*, ValaScope*)) vala_field_prototype_real_to_qualified_string;
109 }
110 
111 static void
vala_field_prototype_instance_init(ValaFieldPrototype * self,gpointer klass)112 vala_field_prototype_instance_init (ValaFieldPrototype * self,
113                                     gpointer klass)
114 {
115 }
116 
117 /**
118  * A reference to an instance field without a specific instance.
119  */
120 static GType
vala_field_prototype_get_type_once(void)121 vala_field_prototype_get_type_once (void)
122 {
123 	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 };
124 	GType vala_field_prototype_type_id;
125 	vala_field_prototype_type_id = g_type_register_static (VALA_TYPE_DATA_TYPE, "ValaFieldPrototype", &g_define_type_info, 0);
126 	return vala_field_prototype_type_id;
127 }
128 
129 GType
vala_field_prototype_get_type(void)130 vala_field_prototype_get_type (void)
131 {
132 	static volatile gsize vala_field_prototype_type_id__volatile = 0;
133 	if (g_once_init_enter (&vala_field_prototype_type_id__volatile)) {
134 		GType vala_field_prototype_type_id;
135 		vala_field_prototype_type_id = vala_field_prototype_get_type_once ();
136 		g_once_init_leave (&vala_field_prototype_type_id__volatile, vala_field_prototype_type_id);
137 	}
138 	return vala_field_prototype_type_id__volatile;
139 }
140 
141