1 /* method.c generated by valac, the Vala compiler
2  * generated from method.vala, do not modify */
3 
4 /* method.vala
5  *
6  * Copyright (C) 2008-2011  Florian Brosch
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  * 	Florian Brosch <flo.brosch@gmail.com>
24  */
25 
26 #include "valadoc.h"
27 #include <stdlib.h>
28 #include <string.h>
29 #include <glib.h>
30 #include <vala.h>
31 #include <valacodegen.h>
32 #include <valagee.h>
33 #include <glib-object.h>
34 
35 enum  {
36 	VALADOC_API_METHOD_0_PROPERTY,
37 	VALADOC_API_METHOD_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY,
38 	VALADOC_API_METHOD_BASE_METHOD_PROPERTY,
39 	VALADOC_API_METHOD_RETURN_TYPE_PROPERTY,
40 	VALADOC_API_METHOD_IS_YIELDS_PROPERTY,
41 	VALADOC_API_METHOD_IS_ABSTRACT_PROPERTY,
42 	VALADOC_API_METHOD_IS_VIRTUAL_PROPERTY,
43 	VALADOC_API_METHOD_IS_OVERRIDE_PROPERTY,
44 	VALADOC_API_METHOD_IS_STATIC_PROPERTY,
45 	VALADOC_API_METHOD_IS_CLASS_PROPERTY,
46 	VALADOC_API_METHOD_IS_CONSTRUCTOR_PROPERTY,
47 	VALADOC_API_METHOD_IS_INLINE_PROPERTY,
48 	VALADOC_API_METHOD_IS_DBUS_VISIBLE_PROPERTY,
49 	VALADOC_API_METHOD_NODE_TYPE_PROPERTY,
50 	VALADOC_API_METHOD_NUM_PROPERTIES
51 };
52 static GParamSpec* valadoc_api_method_properties[VALADOC_API_METHOD_NUM_PROPERTIES];
53 #define _g_free0(var) (var = (g_free (var), NULL))
54 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
55 #define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
56 #define _valadoc_api_signature_builder_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_api_signature_builder_unref (var), NULL)))
57 
58 struct _ValadocApiMethodPrivate {
59 	gchar* finish_function_cname;
60 	gchar* dbus_result_name;
61 	gchar* dbus_name;
62 	gchar* cname;
63 	gchar* _implicit_array_length_cparameter_name;
64 	ValadocApiMethod* _base_method;
65 	ValadocApiTypeReference* _return_type;
66 	gboolean _is_yields;
67 	gboolean _is_constructor;
68 	gboolean _is_dbus_visible;
69 };
70 
71 static gint ValadocApiMethod_private_offset;
72 static gpointer valadoc_api_method_parent_class = NULL;
73 static ValadocApiCallableIface * valadoc_api_method_valadoc_api_callable_parent_iface = NULL;
74 
75 static void valadoc_api_method_set_is_dbus_visible (ValadocApiMethod* self,
76                                              gboolean value);
77 static void valadoc_api_method_set_is_constructor (ValadocApiMethod* self,
78                                             gboolean value);
79 static void valadoc_api_method_set_is_yields (ValadocApiMethod* self,
80                                        gboolean value);
81 static ValadocContentInline* valadoc_api_method_real_build_signature (ValadocApiItem* base);
82 static void valadoc_api_method_real_accept (ValadocApiNode* base,
83                                      ValadocApiVisitor* visitor);
84 G_GNUC_INTERNAL const gchar* valadoc_api_callable_get_implicit_array_length_cparameter_name (ValadocApiCallable* self);
85 G_GNUC_INTERNAL void valadoc_api_callable_set_implicit_array_length_cparameter_name (ValadocApiCallable* self,
86                                                                      const gchar* value);
87 static void valadoc_api_method_finalize (GObject * obj);
88 static GType valadoc_api_method_get_type_once (void);
89 static void _vala_valadoc_api_method_get_property (GObject * object,
90                                             guint property_id,
91                                             GValue * value,
92                                             GParamSpec * pspec);
93 static void _vala_valadoc_api_method_set_property (GObject * object,
94                                             guint property_id,
95                                             const GValue * value,
96                                             GParamSpec * pspec);
97 
98 static inline gpointer
valadoc_api_method_get_instance_private(ValadocApiMethod * self)99 valadoc_api_method_get_instance_private (ValadocApiMethod* self)
100 {
101 	return G_STRUCT_MEMBER_P (self, ValadocApiMethod_private_offset);
102 }
103 
104 static const gchar*
valadoc_api_method_real_get_implicit_array_length_cparameter_name(ValadocApiCallable * base)105 valadoc_api_method_real_get_implicit_array_length_cparameter_name (ValadocApiCallable* base)
106 {
107 	const gchar* result;
108 	ValadocApiMethod* self;
109 	const gchar* _tmp0_;
110 	self = (ValadocApiMethod*) base;
111 	_tmp0_ = self->priv->_implicit_array_length_cparameter_name;
112 	result = _tmp0_;
113 	return result;
114 }
115 
116 static void
valadoc_api_method_real_set_implicit_array_length_cparameter_name(ValadocApiCallable * base,const gchar * value)117 valadoc_api_method_real_set_implicit_array_length_cparameter_name (ValadocApiCallable* base,
118                                                                    const gchar* value)
119 {
120 	ValadocApiMethod* self;
121 	gchar* old_value;
122 	self = (ValadocApiMethod*) base;
123 	old_value = valadoc_api_method_real_get_implicit_array_length_cparameter_name (base);
124 	if (g_strcmp0 (value, old_value) != 0) {
125 		gchar* _tmp0_;
126 		_tmp0_ = g_strdup (value);
127 		_g_free0 (self->priv->_implicit_array_length_cparameter_name);
128 		self->priv->_implicit_array_length_cparameter_name = _tmp0_;
129 		g_object_notify_by_pspec ((GObject *) self, valadoc_api_method_properties[VALADOC_API_METHOD_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY]);
130 	}
131 }
132 
133 ValadocApiMethod*
valadoc_api_method_construct(GType object_type,ValadocApiNode * parent,ValadocApiSourceFile * file,const gchar * name,ValaSymbolAccessibility accessibility,ValadocApiSourceComment * comment,ValaMethod * data)134 valadoc_api_method_construct (GType object_type,
135                               ValadocApiNode* parent,
136                               ValadocApiSourceFile* file,
137                               const gchar* name,
138                               ValaSymbolAccessibility accessibility,
139                               ValadocApiSourceComment* comment,
140                               ValaMethod* data)
141 {
142 	ValadocApiMethod * self = NULL;
143 	gchar* _tmp0_ = NULL;
144 	gboolean _tmp1_;
145 	gboolean _tmp2_;
146 	gchar* _tmp4_;
147 	gchar* _tmp5_;
148 	gchar* _tmp6_;
149 	gchar* _tmp7_;
150 	gboolean _tmp8_;
151 	gboolean _tmp9_;
152 	g_return_val_if_fail (parent != NULL, NULL);
153 	g_return_val_if_fail (file != NULL, NULL);
154 	g_return_val_if_fail (name != NULL, NULL);
155 	g_return_val_if_fail (data != NULL, NULL);
156 	self = (ValadocApiMethod*) valadoc_api_symbol_construct (object_type, parent, file, name, accessibility, comment, (ValaSymbol*) data);
157 	_tmp1_ = vala_method_get_coroutine (data);
158 	_tmp2_ = _tmp1_;
159 	if (_tmp2_) {
160 		gchar* _tmp3_;
161 		_tmp3_ = vala_get_ccode_finish_name (data);
162 		_g_free0 (_tmp0_);
163 		_tmp0_ = _tmp3_;
164 	} else {
165 		_g_free0 (_tmp0_);
166 		_tmp0_ = NULL;
167 	}
168 	_tmp4_ = g_strdup (_tmp0_);
169 	_g_free0 (self->priv->finish_function_cname);
170 	self->priv->finish_function_cname = _tmp4_;
171 	_tmp5_ = vala_gd_bus_module_dbus_result_name (data);
172 	_g_free0 (self->priv->dbus_result_name);
173 	self->priv->dbus_result_name = _tmp5_;
174 	_tmp6_ = vala_gd_bus_module_get_dbus_name_for_member ((ValaSymbol*) data);
175 	_g_free0 (self->priv->dbus_name);
176 	self->priv->dbus_name = _tmp6_;
177 	_tmp7_ = vala_get_ccode_name ((ValaCodeNode*) data);
178 	_g_free0 (self->priv->cname);
179 	self->priv->cname = _tmp7_;
180 	valadoc_api_method_set_is_dbus_visible (self, vala_gd_bus_module_is_dbus_visible ((ValaCodeNode*) data));
181 	valadoc_api_method_set_is_constructor (self, G_TYPE_CHECK_INSTANCE_TYPE (data, VALA_TYPE_CREATION_METHOD));
182 	_tmp8_ = vala_method_get_coroutine (data);
183 	_tmp9_ = _tmp8_;
184 	valadoc_api_method_set_is_yields (self, _tmp9_);
185 	_g_free0 (_tmp0_);
186 	return self;
187 }
188 
189 ValadocApiMethod*
valadoc_api_method_new(ValadocApiNode * parent,ValadocApiSourceFile * file,const gchar * name,ValaSymbolAccessibility accessibility,ValadocApiSourceComment * comment,ValaMethod * data)190 valadoc_api_method_new (ValadocApiNode* parent,
191                         ValadocApiSourceFile* file,
192                         const gchar* name,
193                         ValaSymbolAccessibility accessibility,
194                         ValadocApiSourceComment* comment,
195                         ValaMethod* data)
196 {
197 	return valadoc_api_method_construct (VALADOC_API_TYPE_METHOD, parent, file, name, accessibility, comment, data);
198 }
199 
200 /**
201  * Returns the name of this method as it is used in C.
202  */
203 gchar*
valadoc_api_method_get_cname(ValadocApiMethod * self)204 valadoc_api_method_get_cname (ValadocApiMethod* self)
205 {
206 	const gchar* _tmp0_;
207 	gchar* _tmp1_;
208 	gchar* result = NULL;
209 	g_return_val_if_fail (self != NULL, NULL);
210 	_tmp0_ = self->priv->cname;
211 	_tmp1_ = g_strdup (_tmp0_);
212 	result = _tmp1_;
213 	return result;
214 }
215 
216 /**
217  * Returns the name of the finish function as it is used in C.
218  */
219 gchar*
valadoc_api_method_get_finish_function_cname(ValadocApiMethod * self)220 valadoc_api_method_get_finish_function_cname (ValadocApiMethod* self)
221 {
222 	const gchar* _tmp0_;
223 	gchar* _tmp1_;
224 	gchar* result = NULL;
225 	g_return_val_if_fail (self != NULL, NULL);
226 	_tmp0_ = self->priv->finish_function_cname;
227 	_tmp1_ = g_strdup (_tmp0_);
228 	result = _tmp1_;
229 	return result;
230 }
231 
232 /**
233  * Returns the dbus-name.
234  */
235 gchar*
valadoc_api_method_get_dbus_name(ValadocApiMethod * self)236 valadoc_api_method_get_dbus_name (ValadocApiMethod* self)
237 {
238 	const gchar* _tmp0_;
239 	gchar* _tmp1_;
240 	gchar* result = NULL;
241 	g_return_val_if_fail (self != NULL, NULL);
242 	_tmp0_ = self->priv->dbus_name;
243 	_tmp1_ = g_strdup (_tmp0_);
244 	result = _tmp1_;
245 	return result;
246 }
247 
248 gchar*
valadoc_api_method_get_dbus_result_name(ValadocApiMethod * self)249 valadoc_api_method_get_dbus_result_name (ValadocApiMethod* self)
250 {
251 	const gchar* _tmp0_;
252 	gchar* _tmp1_;
253 	gchar* result = NULL;
254 	g_return_val_if_fail (self != NULL, NULL);
255 	_tmp0_ = self->priv->dbus_result_name;
256 	_tmp1_ = g_strdup (_tmp0_);
257 	result = _tmp1_;
258 	return result;
259 }
260 
261 ValadocApiMethod*
valadoc_api_method_get_base_method(ValadocApiMethod * self)262 valadoc_api_method_get_base_method (ValadocApiMethod* self)
263 {
264 	ValadocApiMethod* result;
265 	ValadocApiMethod* _tmp0_;
266 	g_return_val_if_fail (self != NULL, NULL);
267 	_tmp0_ = self->priv->_base_method;
268 	result = _tmp0_;
269 	return result;
270 }
271 
272 void
valadoc_api_method_set_base_method(ValadocApiMethod * self,ValadocApiMethod * value)273 valadoc_api_method_set_base_method (ValadocApiMethod* self,
274                                     ValadocApiMethod* value)
275 {
276 	ValadocApiMethod* old_value;
277 	g_return_if_fail (self != NULL);
278 	old_value = valadoc_api_method_get_base_method (self);
279 	if (old_value != value) {
280 		self->priv->_base_method = value;
281 		g_object_notify_by_pspec ((GObject *) self, valadoc_api_method_properties[VALADOC_API_METHOD_BASE_METHOD_PROPERTY]);
282 	}
283 }
284 
285 static ValadocApiTypeReference*
valadoc_api_method_real_get_return_type(ValadocApiCallable * base)286 valadoc_api_method_real_get_return_type (ValadocApiCallable* base)
287 {
288 	ValadocApiTypeReference* result;
289 	ValadocApiMethod* self;
290 	ValadocApiTypeReference* _tmp0_;
291 	self = (ValadocApiMethod*) base;
292 	_tmp0_ = self->priv->_return_type;
293 	result = _tmp0_;
294 	return result;
295 }
296 
297 static gpointer
_g_object_ref0(gpointer self)298 _g_object_ref0 (gpointer self)
299 {
300 	return self ? g_object_ref (self) : NULL;
301 }
302 
303 static void
valadoc_api_method_real_set_return_type(ValadocApiCallable * base,ValadocApiTypeReference * value)304 valadoc_api_method_real_set_return_type (ValadocApiCallable* base,
305                                          ValadocApiTypeReference* value)
306 {
307 	ValadocApiMethod* self;
308 	ValadocApiTypeReference* old_value;
309 	self = (ValadocApiMethod*) base;
310 	old_value = valadoc_api_method_real_get_return_type (base);
311 	if (old_value != value) {
312 		ValadocApiTypeReference* _tmp0_;
313 		_tmp0_ = _g_object_ref0 (value);
314 		_g_object_unref0 (self->priv->_return_type);
315 		self->priv->_return_type = _tmp0_;
316 		g_object_notify_by_pspec ((GObject *) self, valadoc_api_method_properties[VALADOC_API_METHOD_RETURN_TYPE_PROPERTY]);
317 	}
318 }
319 
320 gboolean
valadoc_api_method_get_is_yields(ValadocApiMethod * self)321 valadoc_api_method_get_is_yields (ValadocApiMethod* self)
322 {
323 	gboolean result;
324 	g_return_val_if_fail (self != NULL, FALSE);
325 	result = self->priv->_is_yields;
326 	return result;
327 }
328 
329 static void
valadoc_api_method_set_is_yields(ValadocApiMethod * self,gboolean value)330 valadoc_api_method_set_is_yields (ValadocApiMethod* self,
331                                   gboolean value)
332 {
333 	gboolean old_value;
334 	g_return_if_fail (self != NULL);
335 	old_value = valadoc_api_method_get_is_yields (self);
336 	if (old_value != value) {
337 		self->priv->_is_yields = value;
338 		g_object_notify_by_pspec ((GObject *) self, valadoc_api_method_properties[VALADOC_API_METHOD_IS_YIELDS_PROPERTY]);
339 	}
340 }
341 
342 gboolean
valadoc_api_method_get_is_abstract(ValadocApiMethod * self)343 valadoc_api_method_get_is_abstract (ValadocApiMethod* self)
344 {
345 	gboolean result;
346 	ValaCodeNode* _tmp0_;
347 	ValaCodeNode* _tmp1_;
348 	gboolean _tmp2_;
349 	gboolean _tmp3_;
350 	g_return_val_if_fail (self != NULL, FALSE);
351 	_tmp0_ = valadoc_api_item_get_data ((ValadocApiItem*) self);
352 	_tmp1_ = _tmp0_;
353 	_tmp2_ = vala_method_get_is_abstract (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_METHOD, ValaMethod));
354 	_tmp3_ = _tmp2_;
355 	result = _tmp3_;
356 	return result;
357 }
358 
359 gboolean
valadoc_api_method_get_is_virtual(ValadocApiMethod * self)360 valadoc_api_method_get_is_virtual (ValadocApiMethod* self)
361 {
362 	gboolean result;
363 	ValaCodeNode* _tmp0_;
364 	ValaCodeNode* _tmp1_;
365 	gboolean _tmp2_;
366 	gboolean _tmp3_;
367 	g_return_val_if_fail (self != NULL, FALSE);
368 	_tmp0_ = valadoc_api_item_get_data ((ValadocApiItem*) self);
369 	_tmp1_ = _tmp0_;
370 	_tmp2_ = vala_method_get_is_virtual (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_METHOD, ValaMethod));
371 	_tmp3_ = _tmp2_;
372 	result = _tmp3_;
373 	return result;
374 }
375 
376 gboolean
valadoc_api_method_get_is_override(ValadocApiMethod * self)377 valadoc_api_method_get_is_override (ValadocApiMethod* self)
378 {
379 	gboolean result;
380 	ValaCodeNode* _tmp0_;
381 	ValaCodeNode* _tmp1_;
382 	gboolean _tmp2_;
383 	gboolean _tmp3_;
384 	g_return_val_if_fail (self != NULL, FALSE);
385 	_tmp0_ = valadoc_api_item_get_data ((ValadocApiItem*) self);
386 	_tmp1_ = _tmp0_;
387 	_tmp2_ = vala_method_get_overrides (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_METHOD, ValaMethod));
388 	_tmp3_ = _tmp2_;
389 	result = _tmp3_;
390 	return result;
391 }
392 
393 gboolean
valadoc_api_method_get_is_static(ValadocApiMethod * self)394 valadoc_api_method_get_is_static (ValadocApiMethod* self)
395 {
396 	gboolean result;
397 	gboolean _tmp0_ = FALSE;
398 	gboolean _tmp1_ = FALSE;
399 	gboolean _tmp2_;
400 	g_return_val_if_fail (self != NULL, FALSE);
401 	_tmp2_ = self->priv->_is_constructor;
402 	if (!_tmp2_) {
403 		ValaCodeNode* _tmp3_;
404 		ValaCodeNode* _tmp4_;
405 		ValaMemberBinding _tmp5_;
406 		ValaMemberBinding _tmp6_;
407 		_tmp3_ = valadoc_api_item_get_data ((ValadocApiItem*) self);
408 		_tmp4_ = _tmp3_;
409 		_tmp5_ = vala_method_get_binding (G_TYPE_CHECK_INSTANCE_CAST (_tmp4_, VALA_TYPE_METHOD, ValaMethod));
410 		_tmp6_ = _tmp5_;
411 		_tmp1_ = _tmp6_ == VALA_MEMBER_BINDING_STATIC;
412 	} else {
413 		_tmp1_ = FALSE;
414 	}
415 	if (_tmp1_) {
416 		ValadocApiItem* _tmp7_;
417 		ValadocApiItem* _tmp8_;
418 		_tmp7_ = valadoc_api_item_get_parent ((ValadocApiItem*) self);
419 		_tmp8_ = _tmp7_;
420 		_tmp0_ = VALADOC_API_IS_NAMESPACE (_tmp8_) == FALSE;
421 	} else {
422 		_tmp0_ = FALSE;
423 	}
424 	result = _tmp0_;
425 	return result;
426 }
427 
428 gboolean
valadoc_api_method_get_is_class(ValadocApiMethod * self)429 valadoc_api_method_get_is_class (ValadocApiMethod* self)
430 {
431 	gboolean result;
432 	ValaCodeNode* _tmp0_;
433 	ValaCodeNode* _tmp1_;
434 	ValaMemberBinding _tmp2_;
435 	ValaMemberBinding _tmp3_;
436 	g_return_val_if_fail (self != NULL, FALSE);
437 	_tmp0_ = valadoc_api_item_get_data ((ValadocApiItem*) self);
438 	_tmp1_ = _tmp0_;
439 	_tmp2_ = vala_method_get_binding (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_METHOD, ValaMethod));
440 	_tmp3_ = _tmp2_;
441 	result = _tmp3_ == VALA_MEMBER_BINDING_CLASS;
442 	return result;
443 }
444 
445 gboolean
valadoc_api_method_get_is_constructor(ValadocApiMethod * self)446 valadoc_api_method_get_is_constructor (ValadocApiMethod* self)
447 {
448 	gboolean result;
449 	g_return_val_if_fail (self != NULL, FALSE);
450 	result = self->priv->_is_constructor;
451 	return result;
452 }
453 
454 static void
valadoc_api_method_set_is_constructor(ValadocApiMethod * self,gboolean value)455 valadoc_api_method_set_is_constructor (ValadocApiMethod* self,
456                                        gboolean value)
457 {
458 	gboolean old_value;
459 	g_return_if_fail (self != NULL);
460 	old_value = valadoc_api_method_get_is_constructor (self);
461 	if (old_value != value) {
462 		self->priv->_is_constructor = value;
463 		g_object_notify_by_pspec ((GObject *) self, valadoc_api_method_properties[VALADOC_API_METHOD_IS_CONSTRUCTOR_PROPERTY]);
464 	}
465 }
466 
467 gboolean
valadoc_api_method_get_is_inline(ValadocApiMethod * self)468 valadoc_api_method_get_is_inline (ValadocApiMethod* self)
469 {
470 	gboolean result;
471 	ValaCodeNode* _tmp0_;
472 	ValaCodeNode* _tmp1_;
473 	gboolean _tmp2_;
474 	gboolean _tmp3_;
475 	g_return_val_if_fail (self != NULL, FALSE);
476 	_tmp0_ = valadoc_api_item_get_data ((ValadocApiItem*) self);
477 	_tmp1_ = _tmp0_;
478 	_tmp2_ = vala_method_get_is_inline (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_METHOD, ValaMethod));
479 	_tmp3_ = _tmp2_;
480 	result = _tmp3_;
481 	return result;
482 }
483 
484 gboolean
valadoc_api_method_get_is_dbus_visible(ValadocApiMethod * self)485 valadoc_api_method_get_is_dbus_visible (ValadocApiMethod* self)
486 {
487 	gboolean result;
488 	g_return_val_if_fail (self != NULL, FALSE);
489 	result = self->priv->_is_dbus_visible;
490 	return result;
491 }
492 
493 static void
valadoc_api_method_set_is_dbus_visible(ValadocApiMethod * self,gboolean value)494 valadoc_api_method_set_is_dbus_visible (ValadocApiMethod* self,
495                                         gboolean value)
496 {
497 	gboolean old_value;
498 	g_return_if_fail (self != NULL);
499 	old_value = valadoc_api_method_get_is_dbus_visible (self);
500 	if (old_value != value) {
501 		self->priv->_is_dbus_visible = value;
502 		g_object_notify_by_pspec ((GObject *) self, valadoc_api_method_properties[VALADOC_API_METHOD_IS_DBUS_VISIBLE_PROPERTY]);
503 	}
504 }
505 
506 /**
507  * {@inheritDoc}
508  */
509 static gpointer
_vala_iterable_ref0(gpointer self)510 _vala_iterable_ref0 (gpointer self)
511 {
512 	return self ? vala_iterable_ref (self) : NULL;
513 }
514 
515 static ValadocContentInline*
valadoc_api_method_real_build_signature(ValadocApiItem * base)516 valadoc_api_method_real_build_signature (ValadocApiItem* base)
517 {
518 	ValadocApiMethod * self;
519 	ValadocApiSignatureBuilder* signature = NULL;
520 	ValadocApiSignatureBuilder* _tmp0_;
521 	ValadocApiSignatureBuilder* _tmp1_;
522 	ValaSymbolAccessibility _tmp2_;
523 	ValaSymbolAccessibility _tmp3_;
524 	const gchar* _tmp4_;
525 	gboolean _tmp5_;
526 	gboolean _tmp24_;
527 	gboolean _tmp26_;
528 	ValadocApiSignatureBuilder* _tmp32_;
529 	ValaList* type_parameters = NULL;
530 	ValaList* _tmp33_;
531 	ValaList* _tmp34_;
532 	gint _tmp35_;
533 	gint _tmp36_;
534 	ValadocApiSignatureBuilder* _tmp53_;
535 	gboolean first = FALSE;
536 	ValadocApiSignatureBuilder* _tmp67_;
537 	ValaList* exceptions = NULL;
538 	ValadocApiNodeType* _tmp68_;
539 	ValadocApiNodeType* _tmp69_;
540 	gint _tmp69__length1;
541 	ValaList* _tmp70_;
542 	ValaList* _tmp71_;
543 	ValaList* _tmp72_;
544 	gint _tmp73_;
545 	gint _tmp74_;
546 	ValadocApiSignatureBuilder* _tmp88_;
547 	ValadocContentRun* _tmp89_;
548 	ValadocContentInline* result = NULL;
549 	self = (ValadocApiMethod*) base;
550 	_tmp0_ = valadoc_api_signature_builder_new ();
551 	signature = _tmp0_;
552 	_tmp1_ = signature;
553 	_tmp2_ = valadoc_api_symbol_get_accessibility ((ValadocApiSymbol*) self);
554 	_tmp3_ = _tmp2_;
555 	_tmp4_ = vala_symbol_accessibility_to_string (_tmp3_);
556 	valadoc_api_signature_builder_append_keyword (_tmp1_, _tmp4_, TRUE);
557 	_tmp5_ = self->priv->_is_constructor;
558 	if (!_tmp5_) {
559 		gboolean _tmp6_;
560 		gboolean _tmp7_;
561 		gboolean _tmp21_;
562 		gboolean _tmp22_;
563 		_tmp6_ = valadoc_api_method_get_is_static (self);
564 		_tmp7_ = _tmp6_;
565 		if (_tmp7_) {
566 			ValadocApiSignatureBuilder* _tmp8_;
567 			_tmp8_ = signature;
568 			valadoc_api_signature_builder_append_keyword (_tmp8_, "static", TRUE);
569 		} else {
570 			gboolean _tmp9_;
571 			gboolean _tmp10_;
572 			_tmp9_ = valadoc_api_method_get_is_class (self);
573 			_tmp10_ = _tmp9_;
574 			if (_tmp10_) {
575 				ValadocApiSignatureBuilder* _tmp11_;
576 				_tmp11_ = signature;
577 				valadoc_api_signature_builder_append_keyword (_tmp11_, "class", TRUE);
578 			} else {
579 				gboolean _tmp12_;
580 				gboolean _tmp13_;
581 				_tmp12_ = valadoc_api_method_get_is_abstract (self);
582 				_tmp13_ = _tmp12_;
583 				if (_tmp13_) {
584 					ValadocApiSignatureBuilder* _tmp14_;
585 					_tmp14_ = signature;
586 					valadoc_api_signature_builder_append_keyword (_tmp14_, "abstract", TRUE);
587 				} else {
588 					gboolean _tmp15_;
589 					gboolean _tmp16_;
590 					_tmp15_ = valadoc_api_method_get_is_override (self);
591 					_tmp16_ = _tmp15_;
592 					if (_tmp16_) {
593 						ValadocApiSignatureBuilder* _tmp17_;
594 						_tmp17_ = signature;
595 						valadoc_api_signature_builder_append_keyword (_tmp17_, "override", TRUE);
596 					} else {
597 						gboolean _tmp18_;
598 						gboolean _tmp19_;
599 						_tmp18_ = valadoc_api_method_get_is_virtual (self);
600 						_tmp19_ = _tmp18_;
601 						if (_tmp19_) {
602 							ValadocApiSignatureBuilder* _tmp20_;
603 							_tmp20_ = signature;
604 							valadoc_api_signature_builder_append_keyword (_tmp20_, "virtual", TRUE);
605 						}
606 					}
607 				}
608 			}
609 		}
610 		_tmp21_ = valadoc_api_method_get_is_inline (self);
611 		_tmp22_ = _tmp21_;
612 		if (_tmp22_) {
613 			ValadocApiSignatureBuilder* _tmp23_;
614 			_tmp23_ = signature;
615 			valadoc_api_signature_builder_append_keyword (_tmp23_, "inline", TRUE);
616 		}
617 	}
618 	_tmp24_ = self->priv->_is_yields;
619 	if (_tmp24_) {
620 		ValadocApiSignatureBuilder* _tmp25_;
621 		_tmp25_ = signature;
622 		valadoc_api_signature_builder_append_keyword (_tmp25_, "async", TRUE);
623 	}
624 	_tmp26_ = self->priv->_is_constructor;
625 	if (!_tmp26_) {
626 		ValadocApiSignatureBuilder* _tmp27_;
627 		ValadocApiTypeReference* _tmp28_;
628 		ValadocApiTypeReference* _tmp29_;
629 		ValadocContentInline* _tmp30_;
630 		ValadocContentInline* _tmp31_;
631 		_tmp27_ = signature;
632 		_tmp28_ = valadoc_api_callable_get_return_type ((ValadocApiCallable*) self);
633 		_tmp29_ = _tmp28_;
634 		_tmp30_ = valadoc_api_item_get_signature ((ValadocApiItem*) _tmp29_);
635 		_tmp31_ = _tmp30_;
636 		valadoc_api_signature_builder_append_content (_tmp27_, _tmp31_, TRUE);
637 	}
638 	_tmp32_ = signature;
639 	valadoc_api_signature_builder_append_symbol (_tmp32_, (ValadocApiNode*) self, TRUE);
640 	_tmp33_ = valadoc_api_node_get_children_by_type ((ValadocApiNode*) self, VALADOC_API_NODE_TYPE_TYPE_PARAMETER, FALSE);
641 	type_parameters = _tmp33_;
642 	_tmp34_ = type_parameters;
643 	_tmp35_ = vala_collection_get_size ((ValaCollection*) _tmp34_);
644 	_tmp36_ = _tmp35_;
645 	if (_tmp36_ > 0) {
646 		ValadocApiSignatureBuilder* _tmp37_;
647 		gboolean first = FALSE;
648 		ValadocApiSignatureBuilder* _tmp52_;
649 		_tmp37_ = signature;
650 		valadoc_api_signature_builder_append (_tmp37_, "<", FALSE);
651 		first = TRUE;
652 		{
653 			ValaList* _param_list = NULL;
654 			ValaList* _tmp38_;
655 			ValaList* _tmp39_;
656 			gint _param_size = 0;
657 			ValaList* _tmp40_;
658 			gint _tmp41_;
659 			gint _tmp42_;
660 			gint _param_index = 0;
661 			_tmp38_ = type_parameters;
662 			_tmp39_ = _vala_iterable_ref0 (_tmp38_);
663 			_param_list = _tmp39_;
664 			_tmp40_ = _param_list;
665 			_tmp41_ = vala_collection_get_size ((ValaCollection*) _tmp40_);
666 			_tmp42_ = _tmp41_;
667 			_param_size = _tmp42_;
668 			_param_index = -1;
669 			while (TRUE) {
670 				gint _tmp43_;
671 				gint _tmp44_;
672 				ValadocApiItem* param = NULL;
673 				ValaList* _tmp45_;
674 				gpointer _tmp46_;
675 				ValadocApiSignatureBuilder* _tmp48_;
676 				ValadocApiItem* _tmp49_;
677 				ValadocContentInline* _tmp50_;
678 				ValadocContentInline* _tmp51_;
679 				_param_index = _param_index + 1;
680 				_tmp43_ = _param_index;
681 				_tmp44_ = _param_size;
682 				if (!(_tmp43_ < _tmp44_)) {
683 					break;
684 				}
685 				_tmp45_ = _param_list;
686 				_tmp46_ = vala_list_get (_tmp45_, _param_index);
687 				param = (ValadocApiItem*) ((ValadocApiNode*) _tmp46_);
688 				if (!first) {
689 					ValadocApiSignatureBuilder* _tmp47_;
690 					_tmp47_ = signature;
691 					valadoc_api_signature_builder_append (_tmp47_, ",", FALSE);
692 				}
693 				_tmp48_ = signature;
694 				_tmp49_ = param;
695 				_tmp50_ = valadoc_api_item_get_signature (_tmp49_);
696 				_tmp51_ = _tmp50_;
697 				valadoc_api_signature_builder_append_content (_tmp48_, _tmp51_, FALSE);
698 				first = FALSE;
699 				_g_object_unref0 (param);
700 			}
701 			_vala_iterable_unref0 (_param_list);
702 		}
703 		_tmp52_ = signature;
704 		valadoc_api_signature_builder_append (_tmp52_, ">", FALSE);
705 	}
706 	_tmp53_ = signature;
707 	valadoc_api_signature_builder_append (_tmp53_, "(", TRUE);
708 	first = TRUE;
709 	{
710 		ValaList* _param_list = NULL;
711 		ValaList* _tmp54_;
712 		gint _param_size = 0;
713 		ValaList* _tmp55_;
714 		gint _tmp56_;
715 		gint _tmp57_;
716 		gint _param_index = 0;
717 		_tmp54_ = valadoc_api_node_get_children_by_type ((ValadocApiNode*) self, VALADOC_API_NODE_TYPE_FORMAL_PARAMETER, FALSE);
718 		_param_list = _tmp54_;
719 		_tmp55_ = _param_list;
720 		_tmp56_ = vala_collection_get_size ((ValaCollection*) _tmp55_);
721 		_tmp57_ = _tmp56_;
722 		_param_size = _tmp57_;
723 		_param_index = -1;
724 		while (TRUE) {
725 			gint _tmp58_;
726 			gint _tmp59_;
727 			ValadocApiNode* param = NULL;
728 			ValaList* _tmp60_;
729 			gpointer _tmp61_;
730 			ValadocApiSignatureBuilder* _tmp63_;
731 			ValadocApiNode* _tmp64_;
732 			ValadocContentInline* _tmp65_;
733 			ValadocContentInline* _tmp66_;
734 			_param_index = _param_index + 1;
735 			_tmp58_ = _param_index;
736 			_tmp59_ = _param_size;
737 			if (!(_tmp58_ < _tmp59_)) {
738 				break;
739 			}
740 			_tmp60_ = _param_list;
741 			_tmp61_ = vala_list_get (_tmp60_, _param_index);
742 			param = (ValadocApiNode*) _tmp61_;
743 			if (!first) {
744 				ValadocApiSignatureBuilder* _tmp62_;
745 				_tmp62_ = signature;
746 				valadoc_api_signature_builder_append (_tmp62_, ",", FALSE);
747 			}
748 			_tmp63_ = signature;
749 			_tmp64_ = param;
750 			_tmp65_ = valadoc_api_item_get_signature ((ValadocApiItem*) _tmp64_);
751 			_tmp66_ = _tmp65_;
752 			valadoc_api_signature_builder_append_content (_tmp63_, _tmp66_, !first);
753 			first = FALSE;
754 			_g_object_unref0 (param);
755 		}
756 		_vala_iterable_unref0 (_param_list);
757 	}
758 	_tmp67_ = signature;
759 	valadoc_api_signature_builder_append (_tmp67_, ")", FALSE);
760 	_tmp68_ = g_new0 (ValadocApiNodeType, 2);
761 	_tmp68_[0] = VALADOC_API_NODE_TYPE_ERROR_DOMAIN;
762 	_tmp68_[1] = VALADOC_API_NODE_TYPE_CLASS;
763 	_tmp69_ = _tmp68_;
764 	_tmp69__length1 = 2;
765 	_tmp70_ = valadoc_api_node_get_children_by_types ((ValadocApiNode*) self, _tmp69_, (gint) 2, TRUE);
766 	_tmp71_ = _tmp70_;
767 	_tmp69_ = (g_free (_tmp69_), NULL);
768 	exceptions = _tmp71_;
769 	_tmp72_ = exceptions;
770 	_tmp73_ = vala_collection_get_size ((ValaCollection*) _tmp72_);
771 	_tmp74_ = _tmp73_;
772 	if (_tmp74_ > 0) {
773 		ValadocApiSignatureBuilder* _tmp75_;
774 		_tmp75_ = signature;
775 		valadoc_api_signature_builder_append_keyword (_tmp75_, "throws", TRUE);
776 		first = TRUE;
777 		{
778 			ValaList* _param_list = NULL;
779 			ValaList* _tmp76_;
780 			ValaList* _tmp77_;
781 			gint _param_size = 0;
782 			ValaList* _tmp78_;
783 			gint _tmp79_;
784 			gint _tmp80_;
785 			gint _param_index = 0;
786 			_tmp76_ = exceptions;
787 			_tmp77_ = _vala_iterable_ref0 (_tmp76_);
788 			_param_list = _tmp77_;
789 			_tmp78_ = _param_list;
790 			_tmp79_ = vala_collection_get_size ((ValaCollection*) _tmp78_);
791 			_tmp80_ = _tmp79_;
792 			_param_size = _tmp80_;
793 			_param_index = -1;
794 			while (TRUE) {
795 				gint _tmp81_;
796 				gint _tmp82_;
797 				ValadocApiNode* param = NULL;
798 				ValaList* _tmp83_;
799 				gpointer _tmp84_;
800 				ValadocApiSignatureBuilder* _tmp86_;
801 				ValadocApiNode* _tmp87_;
802 				_param_index = _param_index + 1;
803 				_tmp81_ = _param_index;
804 				_tmp82_ = _param_size;
805 				if (!(_tmp81_ < _tmp82_)) {
806 					break;
807 				}
808 				_tmp83_ = _param_list;
809 				_tmp84_ = vala_list_get (_tmp83_, _param_index);
810 				param = (ValadocApiNode*) _tmp84_;
811 				if (!first) {
812 					ValadocApiSignatureBuilder* _tmp85_;
813 					_tmp85_ = signature;
814 					valadoc_api_signature_builder_append (_tmp85_, ",", FALSE);
815 				}
816 				_tmp86_ = signature;
817 				_tmp87_ = param;
818 				valadoc_api_signature_builder_append_type (_tmp86_, _tmp87_, TRUE);
819 				first = FALSE;
820 				_g_object_unref0 (param);
821 			}
822 			_vala_iterable_unref0 (_param_list);
823 		}
824 	}
825 	_tmp88_ = signature;
826 	_tmp89_ = valadoc_api_signature_builder_get (_tmp88_);
827 	result = (ValadocContentInline*) _tmp89_;
828 	_vala_iterable_unref0 (exceptions);
829 	_vala_iterable_unref0 (type_parameters);
830 	_valadoc_api_signature_builder_unref0 (signature);
831 	return result;
832 }
833 
834 static ValadocApiNodeType
valadoc_api_method_real_get_node_type(ValadocApiNode * base)835 valadoc_api_method_real_get_node_type (ValadocApiNode* base)
836 {
837 	ValadocApiNodeType result;
838 	ValadocApiMethod* self;
839 	ValadocApiNodeType _tmp0_ = 0;
840 	gboolean _tmp1_;
841 	self = (ValadocApiMethod*) base;
842 	_tmp1_ = self->priv->_is_constructor;
843 	if (_tmp1_) {
844 		_tmp0_ = VALADOC_API_NODE_TYPE_CREATION_METHOD;
845 	} else {
846 		ValadocApiNodeType _tmp2_ = 0;
847 		gboolean _tmp3_;
848 		gboolean _tmp4_;
849 		_tmp3_ = valadoc_api_method_get_is_static (self);
850 		_tmp4_ = _tmp3_;
851 		if (_tmp4_) {
852 			_tmp2_ = VALADOC_API_NODE_TYPE_STATIC_METHOD;
853 		} else {
854 			_tmp2_ = VALADOC_API_NODE_TYPE_METHOD;
855 		}
856 		_tmp0_ = _tmp2_;
857 	}
858 	result = _tmp0_;
859 	return result;
860 }
861 
862 /**
863  * {@inheritDoc}
864  */
865 static void
valadoc_api_method_real_accept(ValadocApiNode * base,ValadocApiVisitor * visitor)866 valadoc_api_method_real_accept (ValadocApiNode* base,
867                                 ValadocApiVisitor* visitor)
868 {
869 	ValadocApiMethod * self;
870 	self = (ValadocApiMethod*) base;
871 	g_return_if_fail (visitor != NULL);
872 	valadoc_api_visitor_visit_method (visitor, self);
873 }
874 
875 static void
valadoc_api_method_class_init(ValadocApiMethodClass * klass,gpointer klass_data)876 valadoc_api_method_class_init (ValadocApiMethodClass * klass,
877                                gpointer klass_data)
878 {
879 	valadoc_api_method_parent_class = g_type_class_peek_parent (klass);
880 	g_type_class_adjust_private_offset (klass, &ValadocApiMethod_private_offset);
881 	((ValadocApiItemClass *) klass)->build_signature = (ValadocContentInline* (*) (ValadocApiItem*)) valadoc_api_method_real_build_signature;
882 	((ValadocApiNodeClass *) klass)->accept = (void (*) (ValadocApiNode*, ValadocApiVisitor*)) valadoc_api_method_real_accept;
883 	VALADOC_API_NODE_CLASS (klass)->get_node_type = valadoc_api_method_real_get_node_type;
884 	G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_api_method_get_property;
885 	G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_api_method_set_property;
886 	G_OBJECT_CLASS (klass)->finalize = valadoc_api_method_finalize;
887 	/**
888 	 * {@inheritDoc}
889 	 */
890 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_METHOD_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY, valadoc_api_method_properties[VALADOC_API_METHOD_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));
891 	/**
892 	 * Specifies the virtual or abstract method this method overrides.
893 	 */
894 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_METHOD_BASE_METHOD_PROPERTY, valadoc_api_method_properties[VALADOC_API_METHOD_BASE_METHOD_PROPERTY] = g_param_spec_object ("base-method", "base-method", "base-method", VALADOC_API_TYPE_METHOD, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
895 	/**
896 	 * {@inheritDoc}
897 	 */
898 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_METHOD_RETURN_TYPE_PROPERTY, valadoc_api_method_properties[VALADOC_API_METHOD_RETURN_TYPE_PROPERTY] = g_param_spec_object ("return-type", "return-type", "return-type", VALADOC_API_TYPE_TYPEREFERENCE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
899 	/**
900 	 * Specifies whether this method is asynchronous
901 	 */
902 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_METHOD_IS_YIELDS_PROPERTY, valadoc_api_method_properties[VALADOC_API_METHOD_IS_YIELDS_PROPERTY] = g_param_spec_boolean ("is-yields", "is-yields", "is-yields", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
903 	/**
904 	 * Specifies whether this method is abstract
905 	 */
906 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_METHOD_IS_ABSTRACT_PROPERTY, valadoc_api_method_properties[VALADOC_API_METHOD_IS_ABSTRACT_PROPERTY] = g_param_spec_boolean ("is-abstract", "is-abstract", "is-abstract", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
907 	/**
908 	 * Specifies whether this method is virtual
909 	 */
910 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_METHOD_IS_VIRTUAL_PROPERTY, valadoc_api_method_properties[VALADOC_API_METHOD_IS_VIRTUAL_PROPERTY] = g_param_spec_boolean ("is-virtual", "is-virtual", "is-virtual", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
911 	/**
912 	 * Specifies whether this method overrides another one
913 	 */
914 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_METHOD_IS_OVERRIDE_PROPERTY, valadoc_api_method_properties[VALADOC_API_METHOD_IS_OVERRIDE_PROPERTY] = g_param_spec_boolean ("is-override", "is-override", "is-override", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
915 	/**
916 	 * Specifies whether this method is static
917 	 */
918 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_METHOD_IS_STATIC_PROPERTY, valadoc_api_method_properties[VALADOC_API_METHOD_IS_STATIC_PROPERTY] = g_param_spec_boolean ("is-static", "is-static", "is-static", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
919 	/**
920 	 * Specifies whether this method is a class method
921 	 */
922 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_METHOD_IS_CLASS_PROPERTY, valadoc_api_method_properties[VALADOC_API_METHOD_IS_CLASS_PROPERTY] = g_param_spec_boolean ("is-class", "is-class", "is-class", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
923 	/**
924 	 * Specifies whether this method is a creation method
925 	 */
926 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_METHOD_IS_CONSTRUCTOR_PROPERTY, valadoc_api_method_properties[VALADOC_API_METHOD_IS_CONSTRUCTOR_PROPERTY] = g_param_spec_boolean ("is-constructor", "is-constructor", "is-constructor", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
927 	/**
928 	 * Specifies whether this method is inline
929 	 */
930 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_METHOD_IS_INLINE_PROPERTY, valadoc_api_method_properties[VALADOC_API_METHOD_IS_INLINE_PROPERTY] = g_param_spec_boolean ("is-inline", "is-inline", "is-inline", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
931 	/**
932 	 * Specifies whether this method is visible for dbus
933 	 */
934 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_METHOD_IS_DBUS_VISIBLE_PROPERTY, valadoc_api_method_properties[VALADOC_API_METHOD_IS_DBUS_VISIBLE_PROPERTY] = g_param_spec_boolean ("is-dbus-visible", "is-dbus-visible", "is-dbus-visible", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
935 	/**
936 	 * {@inheritDoc}
937 	 */
938 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_METHOD_NODE_TYPE_PROPERTY, valadoc_api_method_properties[VALADOC_API_METHOD_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));
939 }
940 
941 static void
valadoc_api_method_valadoc_api_callable_interface_init(ValadocApiCallableIface * iface,gpointer iface_data)942 valadoc_api_method_valadoc_api_callable_interface_init (ValadocApiCallableIface * iface,
943                                                         gpointer iface_data)
944 {
945 	valadoc_api_method_valadoc_api_callable_parent_iface = g_type_interface_peek_parent (iface);
946 	iface->get_implicit_array_length_cparameter_name = valadoc_api_method_real_get_implicit_array_length_cparameter_name;
947 	iface->set_implicit_array_length_cparameter_name = valadoc_api_method_real_set_implicit_array_length_cparameter_name;
948 	iface->get_return_type = valadoc_api_method_real_get_return_type;
949 	iface->set_return_type = valadoc_api_method_real_set_return_type;
950 }
951 
952 static void
valadoc_api_method_instance_init(ValadocApiMethod * self,gpointer klass)953 valadoc_api_method_instance_init (ValadocApiMethod * self,
954                                   gpointer klass)
955 {
956 	self->priv = valadoc_api_method_get_instance_private (self);
957 }
958 
959 static void
valadoc_api_method_finalize(GObject * obj)960 valadoc_api_method_finalize (GObject * obj)
961 {
962 	ValadocApiMethod * self;
963 	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_API_TYPE_METHOD, ValadocApiMethod);
964 	_g_free0 (self->priv->finish_function_cname);
965 	_g_free0 (self->priv->dbus_result_name);
966 	_g_free0 (self->priv->dbus_name);
967 	_g_free0 (self->priv->cname);
968 	_g_free0 (self->priv->_implicit_array_length_cparameter_name);
969 	_g_object_unref0 (self->priv->_return_type);
970 	G_OBJECT_CLASS (valadoc_api_method_parent_class)->finalize (obj);
971 }
972 
973 /**
974  * Represents a function or a method.
975  */
976 static GType
valadoc_api_method_get_type_once(void)977 valadoc_api_method_get_type_once (void)
978 {
979 	static const GTypeInfo g_define_type_info = { sizeof (ValadocApiMethodClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_api_method_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocApiMethod), 0, (GInstanceInitFunc) valadoc_api_method_instance_init, NULL };
980 	static const GInterfaceInfo valadoc_api_callable_info = { (GInterfaceInitFunc) valadoc_api_method_valadoc_api_callable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
981 	GType valadoc_api_method_type_id;
982 	valadoc_api_method_type_id = g_type_register_static (VALADOC_API_TYPE_SYMBOL, "ValadocApiMethod", &g_define_type_info, 0);
983 	g_type_add_interface_static (valadoc_api_method_type_id, VALADOC_API_TYPE_CALLABLE, &valadoc_api_callable_info);
984 	ValadocApiMethod_private_offset = g_type_add_instance_private (valadoc_api_method_type_id, sizeof (ValadocApiMethodPrivate));
985 	return valadoc_api_method_type_id;
986 }
987 
988 GType
valadoc_api_method_get_type(void)989 valadoc_api_method_get_type (void)
990 {
991 	static volatile gsize valadoc_api_method_type_id__volatile = 0;
992 	if (g_once_init_enter (&valadoc_api_method_type_id__volatile)) {
993 		GType valadoc_api_method_type_id;
994 		valadoc_api_method_type_id = valadoc_api_method_get_type_once ();
995 		g_once_init_leave (&valadoc_api_method_type_id__volatile, valadoc_api_method_type_id);
996 	}
997 	return valadoc_api_method_type_id__volatile;
998 }
999 
1000 static void
_vala_valadoc_api_method_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)1001 _vala_valadoc_api_method_get_property (GObject * object,
1002                                        guint property_id,
1003                                        GValue * value,
1004                                        GParamSpec * pspec)
1005 {
1006 	ValadocApiMethod * self;
1007 	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_METHOD, ValadocApiMethod);
1008 	switch (property_id) {
1009 		case VALADOC_API_METHOD_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY:
1010 		g_value_set_string (value, valadoc_api_callable_get_implicit_array_length_cparameter_name ((ValadocApiCallable*) self));
1011 		break;
1012 		case VALADOC_API_METHOD_BASE_METHOD_PROPERTY:
1013 		g_value_set_object (value, valadoc_api_method_get_base_method (self));
1014 		break;
1015 		case VALADOC_API_METHOD_RETURN_TYPE_PROPERTY:
1016 		g_value_set_object (value, valadoc_api_callable_get_return_type ((ValadocApiCallable*) self));
1017 		break;
1018 		case VALADOC_API_METHOD_IS_YIELDS_PROPERTY:
1019 		g_value_set_boolean (value, valadoc_api_method_get_is_yields (self));
1020 		break;
1021 		case VALADOC_API_METHOD_IS_ABSTRACT_PROPERTY:
1022 		g_value_set_boolean (value, valadoc_api_method_get_is_abstract (self));
1023 		break;
1024 		case VALADOC_API_METHOD_IS_VIRTUAL_PROPERTY:
1025 		g_value_set_boolean (value, valadoc_api_method_get_is_virtual (self));
1026 		break;
1027 		case VALADOC_API_METHOD_IS_OVERRIDE_PROPERTY:
1028 		g_value_set_boolean (value, valadoc_api_method_get_is_override (self));
1029 		break;
1030 		case VALADOC_API_METHOD_IS_STATIC_PROPERTY:
1031 		g_value_set_boolean (value, valadoc_api_method_get_is_static (self));
1032 		break;
1033 		case VALADOC_API_METHOD_IS_CLASS_PROPERTY:
1034 		g_value_set_boolean (value, valadoc_api_method_get_is_class (self));
1035 		break;
1036 		case VALADOC_API_METHOD_IS_CONSTRUCTOR_PROPERTY:
1037 		g_value_set_boolean (value, valadoc_api_method_get_is_constructor (self));
1038 		break;
1039 		case VALADOC_API_METHOD_IS_INLINE_PROPERTY:
1040 		g_value_set_boolean (value, valadoc_api_method_get_is_inline (self));
1041 		break;
1042 		case VALADOC_API_METHOD_IS_DBUS_VISIBLE_PROPERTY:
1043 		g_value_set_boolean (value, valadoc_api_method_get_is_dbus_visible (self));
1044 		break;
1045 		case VALADOC_API_METHOD_NODE_TYPE_PROPERTY:
1046 		g_value_set_enum (value, valadoc_api_node_get_node_type ((ValadocApiNode*) self));
1047 		break;
1048 		default:
1049 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1050 		break;
1051 	}
1052 }
1053 
1054 static void
_vala_valadoc_api_method_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)1055 _vala_valadoc_api_method_set_property (GObject * object,
1056                                        guint property_id,
1057                                        const GValue * value,
1058                                        GParamSpec * pspec)
1059 {
1060 	ValadocApiMethod * self;
1061 	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_METHOD, ValadocApiMethod);
1062 	switch (property_id) {
1063 		case VALADOC_API_METHOD_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY:
1064 		valadoc_api_callable_set_implicit_array_length_cparameter_name ((ValadocApiCallable*) self, g_value_get_string (value));
1065 		break;
1066 		case VALADOC_API_METHOD_BASE_METHOD_PROPERTY:
1067 		valadoc_api_method_set_base_method (self, g_value_get_object (value));
1068 		break;
1069 		case VALADOC_API_METHOD_RETURN_TYPE_PROPERTY:
1070 		valadoc_api_callable_set_return_type ((ValadocApiCallable*) self, g_value_get_object (value));
1071 		break;
1072 		case VALADOC_API_METHOD_IS_YIELDS_PROPERTY:
1073 		valadoc_api_method_set_is_yields (self, g_value_get_boolean (value));
1074 		break;
1075 		case VALADOC_API_METHOD_IS_CONSTRUCTOR_PROPERTY:
1076 		valadoc_api_method_set_is_constructor (self, g_value_get_boolean (value));
1077 		break;
1078 		case VALADOC_API_METHOD_IS_DBUS_VISIBLE_PROPERTY:
1079 		valadoc_api_method_set_is_dbus_visible (self, g_value_get_boolean (value));
1080 		break;
1081 		default:
1082 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1083 		break;
1084 	}
1085 }
1086 
1087