1 /* signal.c generated by valac, the Vala compiler
2  * generated from signal.vala, do not modify */
3 
4 /* signal.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_SIGNAL_0_PROPERTY,
37 	VALADOC_API_SIGNAL_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY,
38 	VALADOC_API_SIGNAL_RETURN_TYPE_PROPERTY,
39 	VALADOC_API_SIGNAL_IS_VIRTUAL_PROPERTY,
40 	VALADOC_API_SIGNAL_IS_DBUS_VISIBLE_PROPERTY,
41 	VALADOC_API_SIGNAL_NODE_TYPE_PROPERTY,
42 	VALADOC_API_SIGNAL_NUM_PROPERTIES
43 };
44 static GParamSpec* valadoc_api_signal_properties[VALADOC_API_SIGNAL_NUM_PROPERTIES];
45 #define _g_free0(var) (var = (g_free (var), NULL))
46 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
47 #define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
48 #define _valadoc_api_signature_builder_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_api_signature_builder_unref (var), NULL)))
49 
50 struct _ValadocApiSignalPrivate {
51 	gchar* default_impl_cname;
52 	gchar* dbus_name;
53 	gchar* cname;
54 	gchar* _implicit_array_length_cparameter_name;
55 	ValadocApiTypeReference* _return_type;
56 	gboolean _is_virtual;
57 	gboolean _is_dbus_visible;
58 };
59 
60 static gint ValadocApiSignal_private_offset;
61 static gpointer valadoc_api_signal_parent_class = NULL;
62 static ValadocApiCallableIface * valadoc_api_signal_valadoc_api_callable_parent_iface = NULL;
63 
64 static void valadoc_api_signal_set_is_dbus_visible (ValadocApiSignal* self,
65                                              gboolean value);
66 static void valadoc_api_signal_set_is_virtual (ValadocApiSignal* self,
67                                         gboolean value);
68 static ValadocContentInline* valadoc_api_signal_real_build_signature (ValadocApiItem* base);
69 static void valadoc_api_signal_real_accept (ValadocApiNode* base,
70                                      ValadocApiVisitor* visitor);
71 G_GNUC_INTERNAL const gchar* valadoc_api_callable_get_implicit_array_length_cparameter_name (ValadocApiCallable* self);
72 G_GNUC_INTERNAL void valadoc_api_callable_set_implicit_array_length_cparameter_name (ValadocApiCallable* self,
73                                                                      const gchar* value);
74 static void valadoc_api_signal_finalize (GObject * obj);
75 static GType valadoc_api_signal_get_type_once (void);
76 static void _vala_valadoc_api_signal_get_property (GObject * object,
77                                             guint property_id,
78                                             GValue * value,
79                                             GParamSpec * pspec);
80 static void _vala_valadoc_api_signal_set_property (GObject * object,
81                                             guint property_id,
82                                             const GValue * value,
83                                             GParamSpec * pspec);
84 
85 static inline gpointer
valadoc_api_signal_get_instance_private(ValadocApiSignal * self)86 valadoc_api_signal_get_instance_private (ValadocApiSignal* self)
87 {
88 	return G_STRUCT_MEMBER_P (self, ValadocApiSignal_private_offset);
89 }
90 
91 static const gchar*
valadoc_api_signal_real_get_implicit_array_length_cparameter_name(ValadocApiCallable * base)92 valadoc_api_signal_real_get_implicit_array_length_cparameter_name (ValadocApiCallable* base)
93 {
94 	const gchar* result;
95 	ValadocApiSignal* self;
96 	const gchar* _tmp0_;
97 	self = (ValadocApiSignal*) base;
98 	_tmp0_ = self->priv->_implicit_array_length_cparameter_name;
99 	result = _tmp0_;
100 	return result;
101 }
102 
103 static void
valadoc_api_signal_real_set_implicit_array_length_cparameter_name(ValadocApiCallable * base,const gchar * value)104 valadoc_api_signal_real_set_implicit_array_length_cparameter_name (ValadocApiCallable* base,
105                                                                    const gchar* value)
106 {
107 	ValadocApiSignal* self;
108 	gchar* old_value;
109 	self = (ValadocApiSignal*) base;
110 	old_value = valadoc_api_signal_real_get_implicit_array_length_cparameter_name (base);
111 	if (g_strcmp0 (value, old_value) != 0) {
112 		gchar* _tmp0_;
113 		_tmp0_ = g_strdup (value);
114 		_g_free0 (self->priv->_implicit_array_length_cparameter_name);
115 		self->priv->_implicit_array_length_cparameter_name = _tmp0_;
116 		g_object_notify_by_pspec ((GObject *) self, valadoc_api_signal_properties[VALADOC_API_SIGNAL_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY]);
117 	}
118 }
119 
120 ValadocApiSignal*
valadoc_api_signal_construct(GType object_type,ValadocApiNode * parent,ValadocApiSourceFile * file,const gchar * name,ValaSymbolAccessibility accessibility,ValadocApiSourceComment * comment,ValaSignal * data)121 valadoc_api_signal_construct (GType object_type,
122                               ValadocApiNode* parent,
123                               ValadocApiSourceFile* file,
124                               const gchar* name,
125                               ValaSymbolAccessibility accessibility,
126                               ValadocApiSourceComment* comment,
127                               ValaSignal* data)
128 {
129 	ValadocApiSignal * self = NULL;
130 	gchar* _tmp0_ = NULL;
131 	ValaMethod* _tmp1_;
132 	ValaMethod* _tmp2_;
133 	gchar* _tmp6_;
134 	gchar* _tmp7_;
135 	gchar* _tmp8_;
136 	gboolean _tmp9_;
137 	gboolean _tmp10_;
138 	g_return_val_if_fail (parent != NULL, NULL);
139 	g_return_val_if_fail (file != NULL, NULL);
140 	g_return_val_if_fail (name != NULL, NULL);
141 	g_return_val_if_fail (data != NULL, NULL);
142 	self = (ValadocApiSignal*) valadoc_api_symbol_construct (object_type, parent, file, name, accessibility, comment, (ValaSymbol*) data);
143 	_tmp1_ = vala_signal_get_default_handler (data);
144 	_tmp2_ = _tmp1_;
145 	if (_tmp2_ != NULL) {
146 		ValaMethod* _tmp3_;
147 		ValaMethod* _tmp4_;
148 		gchar* _tmp5_;
149 		_tmp3_ = vala_signal_get_default_handler (data);
150 		_tmp4_ = _tmp3_;
151 		_tmp5_ = vala_get_ccode_name ((ValaCodeNode*) _tmp4_);
152 		_g_free0 (_tmp0_);
153 		_tmp0_ = _tmp5_;
154 	} else {
155 		_g_free0 (_tmp0_);
156 		_tmp0_ = NULL;
157 	}
158 	_tmp6_ = g_strdup (_tmp0_);
159 	_g_free0 (self->priv->default_impl_cname);
160 	self->priv->default_impl_cname = _tmp6_;
161 	_tmp7_ = vala_gd_bus_module_get_dbus_name_for_member ((ValaSymbol*) data);
162 	_g_free0 (self->priv->dbus_name);
163 	self->priv->dbus_name = _tmp7_;
164 	_tmp8_ = vala_get_ccode_name ((ValaCodeNode*) data);
165 	_g_free0 (self->priv->cname);
166 	self->priv->cname = _tmp8_;
167 	valadoc_api_signal_set_is_dbus_visible (self, vala_gd_bus_module_is_dbus_visible ((ValaCodeNode*) data));
168 	_tmp9_ = vala_signal_get_is_virtual (data);
169 	_tmp10_ = _tmp9_;
170 	valadoc_api_signal_set_is_virtual (self, _tmp10_);
171 	_g_free0 (_tmp0_);
172 	return self;
173 }
174 
175 ValadocApiSignal*
valadoc_api_signal_new(ValadocApiNode * parent,ValadocApiSourceFile * file,const gchar * name,ValaSymbolAccessibility accessibility,ValadocApiSourceComment * comment,ValaSignal * data)176 valadoc_api_signal_new (ValadocApiNode* parent,
177                         ValadocApiSourceFile* file,
178                         const gchar* name,
179                         ValaSymbolAccessibility accessibility,
180                         ValadocApiSourceComment* comment,
181                         ValaSignal* data)
182 {
183 	return valadoc_api_signal_construct (VALADOC_API_TYPE_SIGNAL, parent, file, name, accessibility, comment, data);
184 }
185 
186 /**
187  * Returns the name of this signal as it is used in C.
188  */
189 gchar*
valadoc_api_signal_get_cname(ValadocApiSignal * self)190 valadoc_api_signal_get_cname (ValadocApiSignal* self)
191 {
192 	const gchar* _tmp0_;
193 	gchar* _tmp1_;
194 	gchar* result = NULL;
195 	g_return_val_if_fail (self != NULL, NULL);
196 	_tmp0_ = self->priv->cname;
197 	_tmp1_ = g_strdup (_tmp0_);
198 	result = _tmp1_;
199 	return result;
200 }
201 
202 gchar*
valadoc_api_signal_get_default_impl_cname(ValadocApiSignal * self)203 valadoc_api_signal_get_default_impl_cname (ValadocApiSignal* self)
204 {
205 	const gchar* _tmp0_;
206 	gchar* _tmp1_;
207 	gchar* result = NULL;
208 	g_return_val_if_fail (self != NULL, NULL);
209 	_tmp0_ = self->priv->default_impl_cname;
210 	_tmp1_ = g_strdup (_tmp0_);
211 	result = _tmp1_;
212 	return result;
213 }
214 
215 /**
216  * Returns the dbus-name.
217  */
218 gchar*
valadoc_api_signal_get_dbus_name(ValadocApiSignal * self)219 valadoc_api_signal_get_dbus_name (ValadocApiSignal* self)
220 {
221 	const gchar* _tmp0_;
222 	gchar* _tmp1_;
223 	gchar* result = NULL;
224 	g_return_val_if_fail (self != NULL, NULL);
225 	_tmp0_ = self->priv->dbus_name;
226 	_tmp1_ = g_strdup (_tmp0_);
227 	result = _tmp1_;
228 	return result;
229 }
230 
231 static ValadocApiTypeReference*
valadoc_api_signal_real_get_return_type(ValadocApiCallable * base)232 valadoc_api_signal_real_get_return_type (ValadocApiCallable* base)
233 {
234 	ValadocApiTypeReference* result;
235 	ValadocApiSignal* self;
236 	ValadocApiTypeReference* _tmp0_;
237 	self = (ValadocApiSignal*) base;
238 	_tmp0_ = self->priv->_return_type;
239 	result = _tmp0_;
240 	return result;
241 }
242 
243 static gpointer
_g_object_ref0(gpointer self)244 _g_object_ref0 (gpointer self)
245 {
246 	return self ? g_object_ref (self) : NULL;
247 }
248 
249 static void
valadoc_api_signal_real_set_return_type(ValadocApiCallable * base,ValadocApiTypeReference * value)250 valadoc_api_signal_real_set_return_type (ValadocApiCallable* base,
251                                          ValadocApiTypeReference* value)
252 {
253 	ValadocApiSignal* self;
254 	ValadocApiTypeReference* old_value;
255 	self = (ValadocApiSignal*) base;
256 	old_value = valadoc_api_signal_real_get_return_type (base);
257 	if (old_value != value) {
258 		ValadocApiTypeReference* _tmp0_;
259 		_tmp0_ = _g_object_ref0 (value);
260 		_g_object_unref0 (self->priv->_return_type);
261 		self->priv->_return_type = _tmp0_;
262 		g_object_notify_by_pspec ((GObject *) self, valadoc_api_signal_properties[VALADOC_API_SIGNAL_RETURN_TYPE_PROPERTY]);
263 	}
264 }
265 
266 gboolean
valadoc_api_signal_get_is_virtual(ValadocApiSignal * self)267 valadoc_api_signal_get_is_virtual (ValadocApiSignal* self)
268 {
269 	gboolean result;
270 	g_return_val_if_fail (self != NULL, FALSE);
271 	result = self->priv->_is_virtual;
272 	return result;
273 }
274 
275 static void
valadoc_api_signal_set_is_virtual(ValadocApiSignal * self,gboolean value)276 valadoc_api_signal_set_is_virtual (ValadocApiSignal* self,
277                                    gboolean value)
278 {
279 	gboolean old_value;
280 	g_return_if_fail (self != NULL);
281 	old_value = valadoc_api_signal_get_is_virtual (self);
282 	if (old_value != value) {
283 		self->priv->_is_virtual = value;
284 		g_object_notify_by_pspec ((GObject *) self, valadoc_api_signal_properties[VALADOC_API_SIGNAL_IS_VIRTUAL_PROPERTY]);
285 	}
286 }
287 
288 gboolean
valadoc_api_signal_get_is_dbus_visible(ValadocApiSignal * self)289 valadoc_api_signal_get_is_dbus_visible (ValadocApiSignal* self)
290 {
291 	gboolean result;
292 	g_return_val_if_fail (self != NULL, FALSE);
293 	result = self->priv->_is_dbus_visible;
294 	return result;
295 }
296 
297 static void
valadoc_api_signal_set_is_dbus_visible(ValadocApiSignal * self,gboolean value)298 valadoc_api_signal_set_is_dbus_visible (ValadocApiSignal* self,
299                                         gboolean value)
300 {
301 	gboolean old_value;
302 	g_return_if_fail (self != NULL);
303 	old_value = valadoc_api_signal_get_is_dbus_visible (self);
304 	if (old_value != value) {
305 		self->priv->_is_dbus_visible = value;
306 		g_object_notify_by_pspec ((GObject *) self, valadoc_api_signal_properties[VALADOC_API_SIGNAL_IS_DBUS_VISIBLE_PROPERTY]);
307 	}
308 }
309 
310 /**
311  * {@inheritDoc}
312  */
313 static ValadocContentInline*
valadoc_api_signal_real_build_signature(ValadocApiItem * base)314 valadoc_api_signal_real_build_signature (ValadocApiItem* base)
315 {
316 	ValadocApiSignal * self;
317 	ValadocApiSignatureBuilder* signature = NULL;
318 	ValadocApiSignatureBuilder* _tmp0_;
319 	ValadocApiSignatureBuilder* _tmp1_;
320 	ValaSymbolAccessibility _tmp2_;
321 	ValaSymbolAccessibility _tmp3_;
322 	const gchar* _tmp4_;
323 	gboolean _tmp5_;
324 	ValadocApiSignatureBuilder* _tmp7_;
325 	ValadocApiSignatureBuilder* _tmp8_;
326 	ValadocApiTypeReference* _tmp9_;
327 	ValadocApiTypeReference* _tmp10_;
328 	ValadocContentInline* _tmp11_;
329 	ValadocContentInline* _tmp12_;
330 	ValadocApiSignatureBuilder* _tmp13_;
331 	ValadocApiSignatureBuilder* _tmp14_;
332 	gboolean first = FALSE;
333 	ValadocApiSignatureBuilder* _tmp28_;
334 	ValadocApiSignatureBuilder* _tmp29_;
335 	ValadocContentRun* _tmp30_;
336 	ValadocContentInline* result = NULL;
337 	self = (ValadocApiSignal*) base;
338 	_tmp0_ = valadoc_api_signature_builder_new ();
339 	signature = _tmp0_;
340 	_tmp1_ = signature;
341 	_tmp2_ = valadoc_api_symbol_get_accessibility ((ValadocApiSymbol*) self);
342 	_tmp3_ = _tmp2_;
343 	_tmp4_ = vala_symbol_accessibility_to_string (_tmp3_);
344 	valadoc_api_signature_builder_append_keyword (_tmp1_, _tmp4_, TRUE);
345 	_tmp5_ = self->priv->_is_virtual;
346 	if (_tmp5_) {
347 		ValadocApiSignatureBuilder* _tmp6_;
348 		_tmp6_ = signature;
349 		valadoc_api_signature_builder_append_keyword (_tmp6_, "virtual", TRUE);
350 	}
351 	_tmp7_ = signature;
352 	valadoc_api_signature_builder_append_keyword (_tmp7_, "signal", TRUE);
353 	_tmp8_ = signature;
354 	_tmp9_ = valadoc_api_callable_get_return_type ((ValadocApiCallable*) self);
355 	_tmp10_ = _tmp9_;
356 	_tmp11_ = valadoc_api_item_get_signature ((ValadocApiItem*) _tmp10_);
357 	_tmp12_ = _tmp11_;
358 	valadoc_api_signature_builder_append_content (_tmp8_, _tmp12_, TRUE);
359 	_tmp13_ = signature;
360 	valadoc_api_signature_builder_append_symbol (_tmp13_, (ValadocApiNode*) self, TRUE);
361 	_tmp14_ = signature;
362 	valadoc_api_signature_builder_append (_tmp14_, "(", TRUE);
363 	first = TRUE;
364 	{
365 		ValaList* _param_list = NULL;
366 		ValaList* _tmp15_;
367 		gint _param_size = 0;
368 		ValaList* _tmp16_;
369 		gint _tmp17_;
370 		gint _tmp18_;
371 		gint _param_index = 0;
372 		_tmp15_ = valadoc_api_node_get_children_by_type ((ValadocApiNode*) self, VALADOC_API_NODE_TYPE_FORMAL_PARAMETER, FALSE);
373 		_param_list = _tmp15_;
374 		_tmp16_ = _param_list;
375 		_tmp17_ = vala_collection_get_size ((ValaCollection*) _tmp16_);
376 		_tmp18_ = _tmp17_;
377 		_param_size = _tmp18_;
378 		_param_index = -1;
379 		while (TRUE) {
380 			gint _tmp19_;
381 			gint _tmp20_;
382 			ValadocApiNode* param = NULL;
383 			ValaList* _tmp21_;
384 			gpointer _tmp22_;
385 			ValadocApiSignatureBuilder* _tmp24_;
386 			ValadocApiNode* _tmp25_;
387 			ValadocContentInline* _tmp26_;
388 			ValadocContentInline* _tmp27_;
389 			_param_index = _param_index + 1;
390 			_tmp19_ = _param_index;
391 			_tmp20_ = _param_size;
392 			if (!(_tmp19_ < _tmp20_)) {
393 				break;
394 			}
395 			_tmp21_ = _param_list;
396 			_tmp22_ = vala_list_get (_tmp21_, _param_index);
397 			param = (ValadocApiNode*) _tmp22_;
398 			if (!first) {
399 				ValadocApiSignatureBuilder* _tmp23_;
400 				_tmp23_ = signature;
401 				valadoc_api_signature_builder_append (_tmp23_, ",", FALSE);
402 			}
403 			_tmp24_ = signature;
404 			_tmp25_ = param;
405 			_tmp26_ = valadoc_api_item_get_signature ((ValadocApiItem*) _tmp25_);
406 			_tmp27_ = _tmp26_;
407 			valadoc_api_signature_builder_append_content (_tmp24_, _tmp27_, !first);
408 			first = FALSE;
409 			_g_object_unref0 (param);
410 		}
411 		_vala_iterable_unref0 (_param_list);
412 	}
413 	_tmp28_ = signature;
414 	valadoc_api_signature_builder_append (_tmp28_, ")", FALSE);
415 	_tmp29_ = signature;
416 	_tmp30_ = valadoc_api_signature_builder_get (_tmp29_);
417 	result = (ValadocContentInline*) _tmp30_;
418 	_valadoc_api_signature_builder_unref0 (signature);
419 	return result;
420 }
421 
422 static ValadocApiNodeType
valadoc_api_signal_real_get_node_type(ValadocApiNode * base)423 valadoc_api_signal_real_get_node_type (ValadocApiNode* base)
424 {
425 	ValadocApiNodeType result;
426 	ValadocApiSignal* self;
427 	self = (ValadocApiSignal*) base;
428 	result = VALADOC_API_NODE_TYPE_SIGNAL;
429 	return result;
430 }
431 
432 /**
433  * {@inheritDoc}
434  */
435 static void
valadoc_api_signal_real_accept(ValadocApiNode * base,ValadocApiVisitor * visitor)436 valadoc_api_signal_real_accept (ValadocApiNode* base,
437                                 ValadocApiVisitor* visitor)
438 {
439 	ValadocApiSignal * self;
440 	self = (ValadocApiSignal*) base;
441 	g_return_if_fail (visitor != NULL);
442 	valadoc_api_visitor_visit_signal (visitor, self);
443 }
444 
445 static void
valadoc_api_signal_class_init(ValadocApiSignalClass * klass,gpointer klass_data)446 valadoc_api_signal_class_init (ValadocApiSignalClass * klass,
447                                gpointer klass_data)
448 {
449 	valadoc_api_signal_parent_class = g_type_class_peek_parent (klass);
450 	g_type_class_adjust_private_offset (klass, &ValadocApiSignal_private_offset);
451 	((ValadocApiItemClass *) klass)->build_signature = (ValadocContentInline* (*) (ValadocApiItem*)) valadoc_api_signal_real_build_signature;
452 	((ValadocApiNodeClass *) klass)->accept = (void (*) (ValadocApiNode*, ValadocApiVisitor*)) valadoc_api_signal_real_accept;
453 	VALADOC_API_NODE_CLASS (klass)->get_node_type = valadoc_api_signal_real_get_node_type;
454 	G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_api_signal_get_property;
455 	G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_api_signal_set_property;
456 	G_OBJECT_CLASS (klass)->finalize = valadoc_api_signal_finalize;
457 	/**
458 	 * {@inheritDoc}
459 	 */
460 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_SIGNAL_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY, valadoc_api_signal_properties[VALADOC_API_SIGNAL_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));
461 	/**
462 	 * {@inheritDoc}
463 	 */
464 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_SIGNAL_RETURN_TYPE_PROPERTY, valadoc_api_signal_properties[VALADOC_API_SIGNAL_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));
465 	/**
466 	 * Specifies whether this signal is virtual
467 	 */
468 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_SIGNAL_IS_VIRTUAL_PROPERTY, valadoc_api_signal_properties[VALADOC_API_SIGNAL_IS_VIRTUAL_PROPERTY] = g_param_spec_boolean ("is-virtual", "is-virtual", "is-virtual", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
469 	/**
470 	 * Specifies whether this signal is visible for dbus
471 	 */
472 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_SIGNAL_IS_DBUS_VISIBLE_PROPERTY, valadoc_api_signal_properties[VALADOC_API_SIGNAL_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));
473 	/**
474 	 * {@inheritDoc}
475 	 */
476 	g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_SIGNAL_NODE_TYPE_PROPERTY, valadoc_api_signal_properties[VALADOC_API_SIGNAL_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));
477 }
478 
479 static void
valadoc_api_signal_valadoc_api_callable_interface_init(ValadocApiCallableIface * iface,gpointer iface_data)480 valadoc_api_signal_valadoc_api_callable_interface_init (ValadocApiCallableIface * iface,
481                                                         gpointer iface_data)
482 {
483 	valadoc_api_signal_valadoc_api_callable_parent_iface = g_type_interface_peek_parent (iface);
484 	iface->get_implicit_array_length_cparameter_name = valadoc_api_signal_real_get_implicit_array_length_cparameter_name;
485 	iface->set_implicit_array_length_cparameter_name = valadoc_api_signal_real_set_implicit_array_length_cparameter_name;
486 	iface->get_return_type = valadoc_api_signal_real_get_return_type;
487 	iface->set_return_type = valadoc_api_signal_real_set_return_type;
488 }
489 
490 static void
valadoc_api_signal_instance_init(ValadocApiSignal * self,gpointer klass)491 valadoc_api_signal_instance_init (ValadocApiSignal * self,
492                                   gpointer klass)
493 {
494 	self->priv = valadoc_api_signal_get_instance_private (self);
495 }
496 
497 static void
valadoc_api_signal_finalize(GObject * obj)498 valadoc_api_signal_finalize (GObject * obj)
499 {
500 	ValadocApiSignal * self;
501 	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_API_TYPE_SIGNAL, ValadocApiSignal);
502 	_g_free0 (self->priv->default_impl_cname);
503 	_g_free0 (self->priv->dbus_name);
504 	_g_free0 (self->priv->cname);
505 	_g_free0 (self->priv->_implicit_array_length_cparameter_name);
506 	_g_object_unref0 (self->priv->_return_type);
507 	G_OBJECT_CLASS (valadoc_api_signal_parent_class)->finalize (obj);
508 }
509 
510 /**
511  * Represents an signal.
512  */
513 static GType
valadoc_api_signal_get_type_once(void)514 valadoc_api_signal_get_type_once (void)
515 {
516 	static const GTypeInfo g_define_type_info = { sizeof (ValadocApiSignalClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_api_signal_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocApiSignal), 0, (GInstanceInitFunc) valadoc_api_signal_instance_init, NULL };
517 	static const GInterfaceInfo valadoc_api_callable_info = { (GInterfaceInitFunc) valadoc_api_signal_valadoc_api_callable_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
518 	GType valadoc_api_signal_type_id;
519 	valadoc_api_signal_type_id = g_type_register_static (VALADOC_API_TYPE_SYMBOL, "ValadocApiSignal", &g_define_type_info, 0);
520 	g_type_add_interface_static (valadoc_api_signal_type_id, VALADOC_API_TYPE_CALLABLE, &valadoc_api_callable_info);
521 	ValadocApiSignal_private_offset = g_type_add_instance_private (valadoc_api_signal_type_id, sizeof (ValadocApiSignalPrivate));
522 	return valadoc_api_signal_type_id;
523 }
524 
525 GType
valadoc_api_signal_get_type(void)526 valadoc_api_signal_get_type (void)
527 {
528 	static volatile gsize valadoc_api_signal_type_id__volatile = 0;
529 	if (g_once_init_enter (&valadoc_api_signal_type_id__volatile)) {
530 		GType valadoc_api_signal_type_id;
531 		valadoc_api_signal_type_id = valadoc_api_signal_get_type_once ();
532 		g_once_init_leave (&valadoc_api_signal_type_id__volatile, valadoc_api_signal_type_id);
533 	}
534 	return valadoc_api_signal_type_id__volatile;
535 }
536 
537 static void
_vala_valadoc_api_signal_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)538 _vala_valadoc_api_signal_get_property (GObject * object,
539                                        guint property_id,
540                                        GValue * value,
541                                        GParamSpec * pspec)
542 {
543 	ValadocApiSignal * self;
544 	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_SIGNAL, ValadocApiSignal);
545 	switch (property_id) {
546 		case VALADOC_API_SIGNAL_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY:
547 		g_value_set_string (value, valadoc_api_callable_get_implicit_array_length_cparameter_name ((ValadocApiCallable*) self));
548 		break;
549 		case VALADOC_API_SIGNAL_RETURN_TYPE_PROPERTY:
550 		g_value_set_object (value, valadoc_api_callable_get_return_type ((ValadocApiCallable*) self));
551 		break;
552 		case VALADOC_API_SIGNAL_IS_VIRTUAL_PROPERTY:
553 		g_value_set_boolean (value, valadoc_api_signal_get_is_virtual (self));
554 		break;
555 		case VALADOC_API_SIGNAL_IS_DBUS_VISIBLE_PROPERTY:
556 		g_value_set_boolean (value, valadoc_api_signal_get_is_dbus_visible (self));
557 		break;
558 		case VALADOC_API_SIGNAL_NODE_TYPE_PROPERTY:
559 		g_value_set_enum (value, valadoc_api_node_get_node_type ((ValadocApiNode*) self));
560 		break;
561 		default:
562 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
563 		break;
564 	}
565 }
566 
567 static void
_vala_valadoc_api_signal_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)568 _vala_valadoc_api_signal_set_property (GObject * object,
569                                        guint property_id,
570                                        const GValue * value,
571                                        GParamSpec * pspec)
572 {
573 	ValadocApiSignal * self;
574 	self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_SIGNAL, ValadocApiSignal);
575 	switch (property_id) {
576 		case VALADOC_API_SIGNAL_IMPLICIT_ARRAY_LENGTH_CPARAMETER_NAME_PROPERTY:
577 		valadoc_api_callable_set_implicit_array_length_cparameter_name ((ValadocApiCallable*) self, g_value_get_string (value));
578 		break;
579 		case VALADOC_API_SIGNAL_RETURN_TYPE_PROPERTY:
580 		valadoc_api_callable_set_return_type ((ValadocApiCallable*) self, g_value_get_object (value));
581 		break;
582 		case VALADOC_API_SIGNAL_IS_VIRTUAL_PROPERTY:
583 		valadoc_api_signal_set_is_virtual (self, g_value_get_boolean (value));
584 		break;
585 		case VALADOC_API_SIGNAL_IS_DBUS_VISIBLE_PROPERTY:
586 		valadoc_api_signal_set_is_dbus_visible (self, g_value_get_boolean (value));
587 		break;
588 		default:
589 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
590 		break;
591 	}
592 }
593 
594