1
/* valaenumregisterfunction.c generated by valac, the Vala compiler
2
* generated from valaenumregisterfunction.vala, do not modify */
4
/* valaenumregisterfunction.vala
6
* Copyright (C) 2008 Jürg Billeter
7
* Copyright (C) 2010 Marc-Andre Lureau
9
* This library is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU Lesser General Public
11
* License as published by the Free Software Foundation; either
12
* version 2.1 of the License, or (at your option) any later version.
14
* This library is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
* Lesser General Public License for more details.
19
* You should have received a copy of the GNU Lesser General Public
20
* License along with this library; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24
* Jürg Billeter <j@bitron.ch>
28
#include <glib-object.h>
32
#include <valaccode.h>
35
#define VALA_TYPE_TYPEREGISTER_FUNCTION (vala_typeregister_function_get_type ())
36
#define VALA_TYPEREGISTER_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_TYPEREGISTER_FUNCTION, ValaTypeRegisterFunction))
37
#define VALA_TYPEREGISTER_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_TYPEREGISTER_FUNCTION, ValaTypeRegisterFunctionClass))
38
#define VALA_IS_TYPEREGISTER_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_TYPEREGISTER_FUNCTION))
39
#define VALA_IS_TYPEREGISTER_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_TYPEREGISTER_FUNCTION))
40
#define VALA_TYPEREGISTER_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_TYPEREGISTER_FUNCTION, ValaTypeRegisterFunctionClass))
42
typedef struct _ValaTypeRegisterFunction ValaTypeRegisterFunction;
43
typedef struct _ValaTypeRegisterFunctionClass ValaTypeRegisterFunctionClass;
44
typedef struct _ValaTypeRegisterFunctionPrivate ValaTypeRegisterFunctionPrivate;
46
#define VALA_TYPE_ENUM_REGISTER_FUNCTION (vala_enum_register_function_get_type ())
47
#define VALA_ENUM_REGISTER_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_ENUM_REGISTER_FUNCTION, ValaEnumRegisterFunction))
48
#define VALA_ENUM_REGISTER_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_ENUM_REGISTER_FUNCTION, ValaEnumRegisterFunctionClass))
49
#define VALA_IS_ENUM_REGISTER_FUNCTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_ENUM_REGISTER_FUNCTION))
50
#define VALA_IS_ENUM_REGISTER_FUNCTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_ENUM_REGISTER_FUNCTION))
51
#define VALA_ENUM_REGISTER_FUNCTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_ENUM_REGISTER_FUNCTION, ValaEnumRegisterFunctionClass))
53
typedef struct _ValaEnumRegisterFunction ValaEnumRegisterFunction;
54
typedef struct _ValaEnumRegisterFunctionClass ValaEnumRegisterFunctionClass;
55
typedef struct _ValaEnumRegisterFunctionPrivate ValaEnumRegisterFunctionPrivate;
57
struct _ValaTypeRegisterFunction {
58
GTypeInstance parent_instance;
59
volatile int ref_count;
60
ValaTypeRegisterFunctionPrivate * priv;
63
struct _ValaTypeRegisterFunctionClass {
64
GTypeClass parent_class;
65
void (*finalize) (ValaTypeRegisterFunction *self);
66
ValaTypeSymbol* (*get_type_declaration) (ValaTypeRegisterFunction* self);
67
gchar* (*get_type_struct_name) (ValaTypeRegisterFunction* self);
68
gchar* (*get_base_init_func_name) (ValaTypeRegisterFunction* self);
69
gchar* (*get_class_finalize_func_name) (ValaTypeRegisterFunction* self);
70
gchar* (*get_base_finalize_func_name) (ValaTypeRegisterFunction* self);
71
gchar* (*get_class_init_func_name) (ValaTypeRegisterFunction* self);
72
gchar* (*get_instance_struct_size) (ValaTypeRegisterFunction* self);
73
gchar* (*get_instance_init_func_name) (ValaTypeRegisterFunction* self);
74
gchar* (*get_parent_type_name) (ValaTypeRegisterFunction* self);
75
gchar* (*get_gtype_value_table_init_function_name) (ValaTypeRegisterFunction* self);
76
gchar* (*get_gtype_value_table_peek_pointer_function_name) (ValaTypeRegisterFunction* self);
77
gchar* (*get_gtype_value_table_free_function_name) (ValaTypeRegisterFunction* self);
78
gchar* (*get_gtype_value_table_copy_function_name) (ValaTypeRegisterFunction* self);
79
gchar* (*get_gtype_value_table_lcopy_value_function_name) (ValaTypeRegisterFunction* self);
80
gchar* (*get_gtype_value_table_collect_value_function_name) (ValaTypeRegisterFunction* self);
81
gchar* (*get_type_flags) (ValaTypeRegisterFunction* self);
82
ValaCCodeFragment* (*get_type_interface_init_declaration) (ValaTypeRegisterFunction* self);
83
void (*get_type_interface_init_statements) (ValaTypeRegisterFunction* self, ValaCCodeBlock* block, gboolean plugin);
84
ValaSymbolAccessibility (*get_accessibility) (ValaTypeRegisterFunction* self);
87
struct _ValaEnumRegisterFunction {
88
ValaTypeRegisterFunction parent_instance;
89
ValaEnumRegisterFunctionPrivate * priv;
92
struct _ValaEnumRegisterFunctionClass {
93
ValaTypeRegisterFunctionClass parent_class;
96
struct _ValaEnumRegisterFunctionPrivate {
97
ValaEnum* _enum_reference;
101
static gpointer vala_enum_register_function_parent_class = NULL;
103
gpointer vala_typeregister_function_ref (gpointer instance);
104
void vala_typeregister_function_unref (gpointer instance);
105
GParamSpec* vala_param_spec_typeregister_function (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
106
void vala_value_set_typeregister_function (GValue* value, gpointer v_object);
107
void vala_value_take_typeregister_function (GValue* value, gpointer v_object);
108
gpointer vala_value_get_typeregister_function (const GValue* value);
109
GType vala_typeregister_function_get_type (void) G_GNUC_CONST;
110
GType vala_enum_register_function_get_type (void) G_GNUC_CONST;
111
#define VALA_ENUM_REGISTER_FUNCTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALA_TYPE_ENUM_REGISTER_FUNCTION, ValaEnumRegisterFunctionPrivate))
113
VALA_ENUM_REGISTER_FUNCTION_DUMMY_PROPERTY
115
ValaEnumRegisterFunction* vala_enum_register_function_new (ValaEnum* en, ValaCodeContext* context);
116
ValaEnumRegisterFunction* vala_enum_register_function_construct (GType object_type, ValaEnum* en, ValaCodeContext* context);
117
ValaTypeRegisterFunction* vala_typeregister_function_construct (GType object_type);
118
void vala_enum_register_function_set_enum_reference (ValaEnumRegisterFunction* self, ValaEnum* value);
119
void vala_typeregister_function_set_context (ValaTypeRegisterFunction* self, ValaCodeContext* value);
120
static ValaTypeSymbol* vala_enum_register_function_real_get_type_declaration (ValaTypeRegisterFunction* base);
121
ValaEnum* vala_enum_register_function_get_enum_reference (ValaEnumRegisterFunction* self);
122
static ValaSymbolAccessibility vala_enum_register_function_real_get_accessibility (ValaTypeRegisterFunction* base);
123
static void vala_enum_register_function_finalize (ValaTypeRegisterFunction* obj);
127
* Creates a new C function to register the specified enum at runtime.
130
* @return newly created enum register function
132
ValaEnumRegisterFunction* vala_enum_register_function_construct (GType object_type, ValaEnum* en, ValaCodeContext* context) {
133
ValaEnumRegisterFunction* self = NULL;
135
ValaCodeContext* _tmp1_;
136
g_return_val_if_fail (en != NULL, NULL);
137
g_return_val_if_fail (context != NULL, NULL);
138
self = (ValaEnumRegisterFunction*) vala_typeregister_function_construct (object_type);
140
vala_enum_register_function_set_enum_reference (self, _tmp0_);
142
vala_typeregister_function_set_context ((ValaTypeRegisterFunction*) self, _tmp1_);
147
ValaEnumRegisterFunction* vala_enum_register_function_new (ValaEnum* en, ValaCodeContext* context) {
148
return vala_enum_register_function_construct (VALA_TYPE_ENUM_REGISTER_FUNCTION, en, context);
152
static gpointer _vala_code_node_ref0 (gpointer self) {
153
return self ? vala_code_node_ref (self) : NULL;
157
static ValaTypeSymbol* vala_enum_register_function_real_get_type_declaration (ValaTypeRegisterFunction* base) {
158
ValaEnumRegisterFunction * self;
159
ValaTypeSymbol* result = NULL;
161
ValaTypeSymbol* _tmp1_;
162
self = (ValaEnumRegisterFunction*) base;
163
_tmp0_ = self->priv->_enum_reference;
164
_tmp1_ = _vala_code_node_ref0 ((ValaTypeSymbol*) _tmp0_);
170
static ValaSymbolAccessibility vala_enum_register_function_real_get_accessibility (ValaTypeRegisterFunction* base) {
171
ValaEnumRegisterFunction * self;
172
ValaSymbolAccessibility result = 0;
174
ValaSymbolAccessibility _tmp1_;
175
ValaSymbolAccessibility _tmp2_;
176
self = (ValaEnumRegisterFunction*) base;
177
_tmp0_ = self->priv->_enum_reference;
178
_tmp1_ = vala_symbol_get_access ((ValaSymbol*) _tmp0_);
185
ValaEnum* vala_enum_register_function_get_enum_reference (ValaEnumRegisterFunction* self) {
188
g_return_val_if_fail (self != NULL, NULL);
189
_tmp0_ = self->priv->_enum_reference;
195
void vala_enum_register_function_set_enum_reference (ValaEnumRegisterFunction* self, ValaEnum* value) {
197
g_return_if_fail (self != NULL);
199
self->priv->_enum_reference = _tmp0_;
203
static void vala_enum_register_function_class_init (ValaEnumRegisterFunctionClass * klass) {
204
vala_enum_register_function_parent_class = g_type_class_peek_parent (klass);
205
VALA_TYPEREGISTER_FUNCTION_CLASS (klass)->finalize = vala_enum_register_function_finalize;
206
g_type_class_add_private (klass, sizeof (ValaEnumRegisterFunctionPrivate));
207
VALA_TYPEREGISTER_FUNCTION_CLASS (klass)->get_type_declaration = vala_enum_register_function_real_get_type_declaration;
208
VALA_TYPEREGISTER_FUNCTION_CLASS (klass)->get_accessibility = vala_enum_register_function_real_get_accessibility;
212
static void vala_enum_register_function_instance_init (ValaEnumRegisterFunction * self) {
213
self->priv = VALA_ENUM_REGISTER_FUNCTION_GET_PRIVATE (self);
217
static void vala_enum_register_function_finalize (ValaTypeRegisterFunction* obj) {
218
ValaEnumRegisterFunction * self;
219
self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_ENUM_REGISTER_FUNCTION, ValaEnumRegisterFunction);
220
VALA_TYPEREGISTER_FUNCTION_CLASS (vala_enum_register_function_parent_class)->finalize (obj);
225
* C function to register an enum at runtime.
227
GType vala_enum_register_function_get_type (void) {
228
static volatile gsize vala_enum_register_function_type_id__volatile = 0;
229
if (g_once_init_enter (&vala_enum_register_function_type_id__volatile)) {
230
static const GTypeInfo g_define_type_info = { sizeof (ValaEnumRegisterFunctionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_enum_register_function_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaEnumRegisterFunction), 0, (GInstanceInitFunc) vala_enum_register_function_instance_init, NULL };
231
GType vala_enum_register_function_type_id;
232
vala_enum_register_function_type_id = g_type_register_static (VALA_TYPE_TYPEREGISTER_FUNCTION, "ValaEnumRegisterFunction", &g_define_type_info, 0);
233
g_once_init_leave (&vala_enum_register_function_type_id__volatile, vala_enum_register_function_type_id);
235
return vala_enum_register_function_type_id__volatile;