1
/* valaccodeparameter.c generated by valac, the Vala compiler
2
* generated from valaccodeparameter.vala, do not modify */
4
/* valaccodeparameter.vala
6
* Copyright (C) 2006-2008 JĆ¼rg Billeter
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.
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.
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
23
* JĆ¼rg Billeter <j@bitron.ch>
27
#include <glib-object.h>
32
#define VALA_TYPE_CCODE_NODE (vala_ccode_node_get_type ())
33
#define VALA_CCODE_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_NODE, ValaCCodeNode))
34
#define VALA_CCODE_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_NODE, ValaCCodeNodeClass))
35
#define VALA_IS_CCODE_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_NODE))
36
#define VALA_IS_CCODE_NODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_NODE))
37
#define VALA_CCODE_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_NODE, ValaCCodeNodeClass))
39
typedef struct _ValaCCodeNode ValaCCodeNode;
40
typedef struct _ValaCCodeNodeClass ValaCCodeNodeClass;
41
typedef struct _ValaCCodeNodePrivate ValaCCodeNodePrivate;
43
#define VALA_TYPE_CCODE_WRITER (vala_ccode_writer_get_type ())
44
#define VALA_CCODE_WRITER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_WRITER, ValaCCodeWriter))
45
#define VALA_CCODE_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_WRITER, ValaCCodeWriterClass))
46
#define VALA_IS_CCODE_WRITER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_WRITER))
47
#define VALA_IS_CCODE_WRITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_WRITER))
48
#define VALA_CCODE_WRITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_WRITER, ValaCCodeWriterClass))
50
typedef struct _ValaCCodeWriter ValaCCodeWriter;
51
typedef struct _ValaCCodeWriterClass ValaCCodeWriterClass;
53
#define VALA_TYPE_CCODE_PARAMETER (vala_ccode_parameter_get_type ())
54
#define VALA_CCODE_PARAMETER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_PARAMETER, ValaCCodeParameter))
55
#define VALA_CCODE_PARAMETER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_PARAMETER, ValaCCodeParameterClass))
56
#define VALA_IS_CCODE_PARAMETER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_PARAMETER))
57
#define VALA_IS_CCODE_PARAMETER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_PARAMETER))
58
#define VALA_CCODE_PARAMETER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_PARAMETER, ValaCCodeParameterClass))
60
typedef struct _ValaCCodeParameter ValaCCodeParameter;
61
typedef struct _ValaCCodeParameterClass ValaCCodeParameterClass;
62
typedef struct _ValaCCodeParameterPrivate ValaCCodeParameterPrivate;
63
#define _g_free0(var) (var = (g_free (var), NULL))
65
struct _ValaCCodeNode {
66
GTypeInstance parent_instance;
67
volatile int ref_count;
68
ValaCCodeNodePrivate * priv;
71
struct _ValaCCodeNodeClass {
72
GTypeClass parent_class;
73
void (*finalize) (ValaCCodeNode *self);
74
void (*write) (ValaCCodeNode* self, ValaCCodeWriter* writer);
75
void (*write_declaration) (ValaCCodeNode* self, ValaCCodeWriter* writer);
76
void (*write_combined) (ValaCCodeNode* self, ValaCCodeWriter* writer);
79
struct _ValaCCodeParameter {
80
ValaCCodeNode parent_instance;
81
ValaCCodeParameterPrivate * priv;
84
struct _ValaCCodeParameterClass {
85
ValaCCodeNodeClass parent_class;
88
struct _ValaCCodeParameterPrivate {
95
static gpointer vala_ccode_parameter_parent_class = NULL;
97
gpointer vala_ccode_node_ref (gpointer instance);
98
void vala_ccode_node_unref (gpointer instance);
99
GParamSpec* vala_param_spec_ccode_node (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
100
void vala_value_set_ccode_node (GValue* value, gpointer v_object);
101
void vala_value_take_ccode_node (GValue* value, gpointer v_object);
102
gpointer vala_value_get_ccode_node (const GValue* value);
103
GType vala_ccode_node_get_type (void) G_GNUC_CONST;
104
gpointer vala_ccode_writer_ref (gpointer instance);
105
void vala_ccode_writer_unref (gpointer instance);
106
GParamSpec* vala_param_spec_ccode_writer (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
107
void vala_value_set_ccode_writer (GValue* value, gpointer v_object);
108
void vala_value_take_ccode_writer (GValue* value, gpointer v_object);
109
gpointer vala_value_get_ccode_writer (const GValue* value);
110
GType vala_ccode_writer_get_type (void) G_GNUC_CONST;
111
GType vala_ccode_parameter_get_type (void) G_GNUC_CONST;
112
#define VALA_CCODE_PARAMETER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALA_TYPE_CCODE_PARAMETER, ValaCCodeParameterPrivate))
114
VALA_CCODE_PARAMETER_DUMMY_PROPERTY
116
ValaCCodeParameter* vala_ccode_parameter_new (const gchar* n, const gchar* type);
117
ValaCCodeParameter* vala_ccode_parameter_construct (GType object_type, const gchar* n, const gchar* type);
118
ValaCCodeNode* vala_ccode_node_construct (GType object_type);
119
void vala_ccode_parameter_set_name (ValaCCodeParameter* self, const gchar* value);
120
void vala_ccode_parameter_set_type_name (ValaCCodeParameter* self, const gchar* value);
121
ValaCCodeParameter* vala_ccode_parameter_new_with_ellipsis (void);
122
ValaCCodeParameter* vala_ccode_parameter_construct_with_ellipsis (GType object_type);
123
void vala_ccode_parameter_set_ellipsis (ValaCCodeParameter* self, gboolean value);
124
static void vala_ccode_parameter_real_write (ValaCCodeNode* base, ValaCCodeWriter* writer);
125
gboolean vala_ccode_parameter_get_ellipsis (ValaCCodeParameter* self);
126
void vala_ccode_writer_write_string (ValaCCodeWriter* self, const gchar* s);
127
const gchar* vala_ccode_parameter_get_type_name (ValaCCodeParameter* self);
128
const gchar* vala_ccode_parameter_get_name (ValaCCodeParameter* self);
129
static void vala_ccode_parameter_finalize (ValaCCodeNode* obj);
132
ValaCCodeParameter* vala_ccode_parameter_construct (GType object_type, const gchar* n, const gchar* type) {
133
ValaCCodeParameter* self = NULL;
136
g_return_val_if_fail (n != NULL, NULL);
137
g_return_val_if_fail (type != NULL, NULL);
138
self = (ValaCCodeParameter*) vala_ccode_node_construct (object_type);
140
vala_ccode_parameter_set_name (self, _tmp0_);
142
vala_ccode_parameter_set_type_name (self, _tmp1_);
147
ValaCCodeParameter* vala_ccode_parameter_new (const gchar* n, const gchar* type) {
148
return vala_ccode_parameter_construct (VALA_TYPE_CCODE_PARAMETER, n, type);
152
ValaCCodeParameter* vala_ccode_parameter_construct_with_ellipsis (GType object_type) {
153
ValaCCodeParameter* self = NULL;
154
self = (ValaCCodeParameter*) vala_ccode_node_construct (object_type);
155
vala_ccode_parameter_set_ellipsis (self, TRUE);
160
ValaCCodeParameter* vala_ccode_parameter_new_with_ellipsis (void) {
161
return vala_ccode_parameter_construct_with_ellipsis (VALA_TYPE_CCODE_PARAMETER);
165
static void vala_ccode_parameter_real_write (ValaCCodeNode* base, ValaCCodeWriter* writer) {
166
ValaCCodeParameter * self;
168
self = (ValaCCodeParameter*) base;
169
g_return_if_fail (writer != NULL);
170
_tmp0_ = self->priv->_ellipsis;
172
ValaCCodeWriter* _tmp1_;
174
ValaCCodeWriter* _tmp3_;
175
ValaCCodeWriter* _tmp4_;
178
_tmp2_ = self->priv->_type_name;
179
vala_ccode_writer_write_string (_tmp1_, _tmp2_);
181
vala_ccode_writer_write_string (_tmp3_, " ");
183
_tmp5_ = self->priv->_name;
184
vala_ccode_writer_write_string (_tmp4_, _tmp5_);
186
ValaCCodeWriter* _tmp6_;
188
vala_ccode_writer_write_string (_tmp6_, "...");
193
const gchar* vala_ccode_parameter_get_name (ValaCCodeParameter* self) {
196
g_return_val_if_fail (self != NULL, NULL);
197
_tmp0_ = self->priv->_name;
203
void vala_ccode_parameter_set_name (ValaCCodeParameter* self, const gchar* value) {
206
g_return_if_fail (self != NULL);
208
_tmp1_ = g_strdup (_tmp0_);
209
_g_free0 (self->priv->_name);
210
self->priv->_name = _tmp1_;
214
const gchar* vala_ccode_parameter_get_type_name (ValaCCodeParameter* self) {
217
g_return_val_if_fail (self != NULL, NULL);
218
_tmp0_ = self->priv->_type_name;
224
void vala_ccode_parameter_set_type_name (ValaCCodeParameter* self, const gchar* value) {
227
g_return_if_fail (self != NULL);
229
_tmp1_ = g_strdup (_tmp0_);
230
_g_free0 (self->priv->_type_name);
231
self->priv->_type_name = _tmp1_;
235
gboolean vala_ccode_parameter_get_ellipsis (ValaCCodeParameter* self) {
238
g_return_val_if_fail (self != NULL, FALSE);
239
_tmp0_ = self->priv->_ellipsis;
245
void vala_ccode_parameter_set_ellipsis (ValaCCodeParameter* self, gboolean value) {
247
g_return_if_fail (self != NULL);
249
self->priv->_ellipsis = _tmp0_;
253
static void vala_ccode_parameter_class_init (ValaCCodeParameterClass * klass) {
254
vala_ccode_parameter_parent_class = g_type_class_peek_parent (klass);
255
VALA_CCODE_NODE_CLASS (klass)->finalize = vala_ccode_parameter_finalize;
256
g_type_class_add_private (klass, sizeof (ValaCCodeParameterPrivate));
257
VALA_CCODE_NODE_CLASS (klass)->write = vala_ccode_parameter_real_write;
261
static void vala_ccode_parameter_instance_init (ValaCCodeParameter * self) {
262
self->priv = VALA_CCODE_PARAMETER_GET_PRIVATE (self);
266
static void vala_ccode_parameter_finalize (ValaCCodeNode* obj) {
267
ValaCCodeParameter * self;
268
self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_CCODE_PARAMETER, ValaCCodeParameter);
269
_g_free0 (self->priv->_name);
270
_g_free0 (self->priv->_type_name);
271
VALA_CCODE_NODE_CLASS (vala_ccode_parameter_parent_class)->finalize (obj);
276
* Represents a formal parameter in a C method signature.
278
GType vala_ccode_parameter_get_type (void) {
279
static volatile gsize vala_ccode_parameter_type_id__volatile = 0;
280
if (g_once_init_enter (&vala_ccode_parameter_type_id__volatile)) {
281
static const GTypeInfo g_define_type_info = { sizeof (ValaCCodeParameterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_ccode_parameter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaCCodeParameter), 0, (GInstanceInitFunc) vala_ccode_parameter_instance_init, NULL };
282
GType vala_ccode_parameter_type_id;
283
vala_ccode_parameter_type_id = g_type_register_static (VALA_TYPE_CCODE_NODE, "ValaCCodeParameter", &g_define_type_info, 0);
284
g_once_init_leave (&vala_ccode_parameter_type_id__volatile, vala_ccode_parameter_type_id);
286
return vala_ccode_parameter_type_id__volatile;