1 /* class.c generated by valac, the Vala compiler
2 * generated from class.vala, do not modify */
3
4 /* class.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 <valagee.h>
28 #include <glib-object.h>
29 #include <stdlib.h>
30 #include <string.h>
31 #include <glib.h>
32 #include <vala.h>
33 #include <valacodegen.h>
34
35 enum {
36 VALADOC_API_CLASS_0_PROPERTY,
37 VALADOC_API_CLASS_BASE_TYPE_PROPERTY,
38 VALADOC_API_CLASS_IS_ABSTRACT_PROPERTY,
39 VALADOC_API_CLASS_IS_SEALED_PROPERTY,
40 VALADOC_API_CLASS_IS_FUNDAMENTAL_PROPERTY,
41 VALADOC_API_CLASS_IS_COMPACT_PROPERTY,
42 VALADOC_API_CLASS_NODE_TYPE_PROPERTY,
43 VALADOC_API_CLASS_NUM_PROPERTIES
44 };
45 static GParamSpec* valadoc_api_class_properties[VALADOC_API_CLASS_NUM_PROPERTIES];
46 #define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
47 #define _g_free0(var) (var = (g_free (var), NULL))
48 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
49 #define _valadoc_api_signature_builder_unref0(var) ((var == NULL) ? NULL : (var = (valadoc_api_signature_builder_unref (var), NULL)))
50
51 struct _ValadocApiClassPrivate {
52 ValaArrayList* interfaces;
53 gchar* dbus_name;
54 gchar* take_value_function_cname;
55 gchar* get_value_function_cname;
56 gchar* set_value_function_cname;
57 gchar* unref_function_name;
58 gchar* ref_function_name;
59 gchar* free_function_name;
60 gchar* finalize_function_name;
61 gchar* param_spec_function_name;
62 gchar* type_id;
63 gchar* is_class_type_macro_name;
64 gchar* class_type_macro_name;
65 gchar* class_macro_name;
66 gchar* private_cname;
67 gchar* cname;
68 ValadocApiTypeReference* _base_type;
69 ValaCollection* _full_implemented_interfaces;
70 gboolean _is_abstract;
71 gboolean _is_sealed;
72 gboolean _is_fundamental;
73 ValaSet* _known_derived_interfaces;
74 ValaSet* _known_child_classes;
75 };
76
77 static gint ValadocApiClass_private_offset;
78 static gpointer valadoc_api_class_parent_class = NULL;
79
80 static gchar* _valadoc_api_class_get_private_cname (ValadocApiClass* self,
81 ValaClass* element);
82 static void valadoc_api_class_set_is_fundamental (ValadocApiClass* self,
83 gboolean value);
84 static void valadoc_api_class_set_is_abstract (ValadocApiClass* self,
85 gboolean value);
86 static void valadoc_api_class_set_is_sealed (ValadocApiClass* self,
87 gboolean value);
88 static void valadoc_api_class_real_accept (ValadocApiNode* base,
89 ValadocApiVisitor* visitor);
90 static ValadocContentInline* valadoc_api_class_real_build_signature (ValadocApiItem* base);
91 static void valadoc_api_class_finalize (GObject * obj);
92 static GType valadoc_api_class_get_type_once (void);
93 static void _vala_valadoc_api_class_get_property (GObject * object,
94 guint property_id,
95 GValue * value,
96 GParamSpec * pspec);
97 static void _vala_valadoc_api_class_set_property (GObject * object,
98 guint property_id,
99 const GValue * value,
100 GParamSpec * pspec);
101
102 static inline gpointer
valadoc_api_class_get_instance_private(ValadocApiClass * self)103 valadoc_api_class_get_instance_private (ValadocApiClass* self)
104 {
105 return G_STRUCT_MEMBER_P (self, ValadocApiClass_private_offset);
106 }
107
108 ValadocApiClass*
valadoc_api_class_construct(GType object_type,ValadocApiNode * parent,ValadocApiSourceFile * file,const gchar * name,ValaSymbolAccessibility accessibility,ValadocApiSourceComment * comment,ValaClass * data)109 valadoc_api_class_construct (GType object_type,
110 ValadocApiNode* parent,
111 ValadocApiSourceFile* file,
112 const gchar* name,
113 ValaSymbolAccessibility accessibility,
114 ValadocApiSourceComment* comment,
115 ValaClass* data)
116 {
117 ValadocApiClass * self = NULL;
118 gboolean _tmp0_ = FALSE;
119 ValaClass* _tmp1_;
120 ValaClass* _tmp2_;
121 gboolean is_basic_type = FALSE;
122 GEqualFunc _tmp5_;
123 ValaArrayList* _tmp6_;
124 gboolean _tmp7_;
125 gboolean _tmp8_;
126 gchar* _tmp13_;
127 gchar* _tmp14_;
128 gchar* _tmp15_;
129 gchar* _tmp16_;
130 gchar* _tmp17_;
131 gchar* _tmp18_;
132 gchar* _tmp19_ = NULL;
133 gchar* _tmp23_;
134 gchar* _tmp24_ = NULL;
135 gboolean _tmp25_;
136 gboolean _tmp26_;
137 gchar* _tmp28_;
138 gchar* _tmp29_;
139 gchar* _tmp30_;
140 gchar* _tmp31_;
141 gboolean _tmp32_;
142 gboolean _tmp33_;
143 gboolean _tmp34_;
144 gboolean _tmp35_;
145 g_return_val_if_fail (parent != NULL, NULL);
146 g_return_val_if_fail (file != NULL, NULL);
147 g_return_val_if_fail (name != NULL, NULL);
148 g_return_val_if_fail (data != NULL, NULL);
149 _tmp1_ = vala_class_get_base_class (data);
150 _tmp2_ = _tmp1_;
151 if (_tmp2_ == NULL) {
152 const gchar* _tmp3_;
153 const gchar* _tmp4_;
154 _tmp3_ = vala_symbol_get_name ((ValaSymbol*) data);
155 _tmp4_ = _tmp3_;
156 _tmp0_ = g_strcmp0 (_tmp4_, "string") == 0;
157 } else {
158 _tmp0_ = FALSE;
159 }
160 is_basic_type = _tmp0_;
161 self = (ValadocApiClass*) valadoc_api_typesymbol_construct (object_type, parent, file, name, accessibility, comment, is_basic_type, (ValaTypeSymbol*) data);
162 _tmp5_ = g_direct_equal;
163 _tmp6_ = vala_array_list_new (VALADOC_API_TYPE_TYPEREFERENCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp5_);
164 _vala_iterable_unref0 (self->priv->interfaces);
165 self->priv->interfaces = _tmp6_;
166 _tmp7_ = vala_class_get_is_compact (data);
167 _tmp8_ = _tmp7_;
168 if (!_tmp8_) {
169 gchar* _tmp9_;
170 gchar* _tmp10_;
171 gchar* _tmp11_;
172 gchar* _tmp12_;
173 _tmp9_ = vala_get_ccode_class_type_check_function (data);
174 _g_free0 (self->priv->is_class_type_macro_name);
175 self->priv->is_class_type_macro_name = _tmp9_;
176 _tmp10_ = vala_get_ccode_class_type_function (data);
177 _g_free0 (self->priv->class_type_macro_name);
178 self->priv->class_type_macro_name = _tmp10_;
179 _tmp11_ = vala_get_ccode_type_get_function ((ValaObjectTypeSymbol*) data);
180 _g_free0 (self->priv->class_macro_name);
181 self->priv->class_macro_name = _tmp11_;
182 _tmp12_ = _valadoc_api_class_get_private_cname (self, data);
183 _g_free0 (self->priv->private_cname);
184 self->priv->private_cname = _tmp12_;
185 }
186 _tmp13_ = vala_gd_bus_module_get_dbus_name ((ValaTypeSymbol*) data);
187 _g_free0 (self->priv->dbus_name);
188 self->priv->dbus_name = _tmp13_;
189 _tmp14_ = vala_get_ccode_type_id ((ValaCodeNode*) data);
190 _g_free0 (self->priv->type_id);
191 self->priv->type_id = _tmp14_;
192 _tmp15_ = vala_get_ccode_name ((ValaCodeNode*) data);
193 _g_free0 (self->priv->cname);
194 self->priv->cname = _tmp15_;
195 _tmp16_ = vala_get_ccode_param_spec_function ((ValaCodeNode*) data);
196 _g_free0 (self->priv->param_spec_function_name);
197 self->priv->param_spec_function_name = _tmp16_;
198 _tmp17_ = vala_get_ccode_unref_function ((ValaObjectTypeSymbol*) data);
199 _g_free0 (self->priv->unref_function_name);
200 self->priv->unref_function_name = _tmp17_;
201 _tmp18_ = vala_get_ccode_ref_function ((ValaTypeSymbol*) data);
202 _g_free0 (self->priv->ref_function_name);
203 self->priv->ref_function_name = _tmp18_;
204 if (vala_class_is_fundamental (data)) {
205 gchar* _tmp20_;
206 gchar* _tmp21_;
207 gchar* _tmp22_;
208 _tmp20_ = vala_get_ccode_lower_case_prefix ((ValaSymbol*) data);
209 _tmp21_ = _tmp20_;
210 _tmp22_ = g_strdup_printf ("%sfinalize", _tmp21_);
211 _g_free0 (_tmp19_);
212 _tmp19_ = _tmp22_;
213 _g_free0 (_tmp21_);
214 } else {
215 _g_free0 (_tmp19_);
216 _tmp19_ = NULL;
217 }
218 _tmp23_ = g_strdup (_tmp19_);
219 _g_free0 (self->priv->finalize_function_name);
220 self->priv->finalize_function_name = _tmp23_;
221 _tmp25_ = vala_class_get_is_compact (data);
222 _tmp26_ = _tmp25_;
223 if (_tmp26_) {
224 gchar* _tmp27_;
225 _tmp27_ = vala_get_ccode_free_function ((ValaTypeSymbol*) data);
226 _g_free0 (_tmp24_);
227 _tmp24_ = _tmp27_;
228 } else {
229 _g_free0 (_tmp24_);
230 _tmp24_ = NULL;
231 }
232 _tmp28_ = g_strdup (_tmp24_);
233 _g_free0 (self->priv->free_function_name);
234 self->priv->free_function_name = _tmp28_;
235 _tmp29_ = vala_get_ccode_take_value_function ((ValaCodeNode*) data);
236 _g_free0 (self->priv->take_value_function_cname);
237 self->priv->take_value_function_cname = _tmp29_;
238 _tmp30_ = vala_get_ccode_get_value_function ((ValaCodeNode*) data);
239 _g_free0 (self->priv->get_value_function_cname);
240 self->priv->get_value_function_cname = _tmp30_;
241 _tmp31_ = vala_get_ccode_set_value_function ((ValaCodeNode*) data);
242 _g_free0 (self->priv->set_value_function_cname);
243 self->priv->set_value_function_cname = _tmp31_;
244 valadoc_api_class_set_is_fundamental (self, vala_class_is_fundamental (data));
245 _tmp32_ = vala_class_get_is_abstract (data);
246 _tmp33_ = _tmp32_;
247 valadoc_api_class_set_is_abstract (self, _tmp33_);
248 _tmp34_ = vala_class_get_is_sealed (data);
249 _tmp35_ = _tmp34_;
250 valadoc_api_class_set_is_sealed (self, _tmp35_);
251 _g_free0 (_tmp24_);
252 _g_free0 (_tmp19_);
253 return self;
254 }
255
256 ValadocApiClass*
valadoc_api_class_new(ValadocApiNode * parent,ValadocApiSourceFile * file,const gchar * name,ValaSymbolAccessibility accessibility,ValadocApiSourceComment * comment,ValaClass * data)257 valadoc_api_class_new (ValadocApiNode* parent,
258 ValadocApiSourceFile* file,
259 const gchar* name,
260 ValaSymbolAccessibility accessibility,
261 ValadocApiSourceComment* comment,
262 ValaClass* data)
263 {
264 return valadoc_api_class_construct (VALADOC_API_TYPE_CLASS, parent, file, name, accessibility, comment, data);
265 }
266
267 static gchar*
_valadoc_api_class_get_private_cname(ValadocApiClass * self,ValaClass * element)268 _valadoc_api_class_get_private_cname (ValadocApiClass* self,
269 ValaClass* element)
270 {
271 gboolean _tmp0_;
272 gboolean _tmp1_;
273 gchar* cname = NULL;
274 gchar* _tmp2_;
275 gchar* _tmp3_ = NULL;
276 const gchar* _tmp4_;
277 gchar* result = NULL;
278 g_return_val_if_fail (self != NULL, NULL);
279 g_return_val_if_fail (element != NULL, NULL);
280 _tmp0_ = vala_class_get_is_compact (element);
281 _tmp1_ = _tmp0_;
282 if (_tmp1_) {
283 result = NULL;
284 return result;
285 }
286 _tmp2_ = vala_get_ccode_name ((ValaCodeNode*) element);
287 cname = _tmp2_;
288 _tmp4_ = cname;
289 if (_tmp4_ != NULL) {
290 const gchar* _tmp5_;
291 gchar* _tmp6_;
292 _tmp5_ = cname;
293 _tmp6_ = g_strconcat (_tmp5_, "Private", NULL);
294 _g_free0 (_tmp3_);
295 _tmp3_ = _tmp6_;
296 } else {
297 _g_free0 (_tmp3_);
298 _tmp3_ = NULL;
299 }
300 result = _tmp3_;
301 _g_free0 (cname);
302 return result;
303 }
304
305 ValadocApiTypeReference*
valadoc_api_class_get_base_type(ValadocApiClass * self)306 valadoc_api_class_get_base_type (ValadocApiClass* self)
307 {
308 ValadocApiTypeReference* result;
309 ValadocApiTypeReference* _tmp0_;
310 g_return_val_if_fail (self != NULL, NULL);
311 _tmp0_ = self->priv->_base_type;
312 result = _tmp0_;
313 return result;
314 }
315
316 static gpointer
_g_object_ref0(gpointer self)317 _g_object_ref0 (gpointer self)
318 {
319 return self ? g_object_ref (self) : NULL;
320 }
321
322 void
valadoc_api_class_set_base_type(ValadocApiClass * self,ValadocApiTypeReference * value)323 valadoc_api_class_set_base_type (ValadocApiClass* self,
324 ValadocApiTypeReference* value)
325 {
326 ValadocApiTypeReference* old_value;
327 g_return_if_fail (self != NULL);
328 old_value = valadoc_api_class_get_base_type (self);
329 if (old_value != value) {
330 ValadocApiTypeReference* _tmp0_;
331 _tmp0_ = _g_object_ref0 (value);
332 _g_object_unref0 (self->priv->_base_type);
333 self->priv->_base_type = _tmp0_;
334 g_object_notify_by_pspec ((GObject *) self, valadoc_api_class_properties[VALADOC_API_CLASS_BASE_TYPE_PROPERTY]);
335 }
336 }
337
338 /**
339 * Returns the name of this class as it is used in C.
340 */
341 gchar*
valadoc_api_class_get_cname(ValadocApiClass * self)342 valadoc_api_class_get_cname (ValadocApiClass* self)
343 {
344 const gchar* _tmp0_;
345 gchar* _tmp1_;
346 gchar* result = NULL;
347 g_return_val_if_fail (self != NULL, NULL);
348 _tmp0_ = self->priv->cname;
349 _tmp1_ = g_strdup (_tmp0_);
350 result = _tmp1_;
351 return result;
352 }
353
354 /**
355 * Returns the name of this class' private data structure as it is used in C.
356 */
357 gchar*
valadoc_api_class_get_private_cname(ValadocApiClass * self)358 valadoc_api_class_get_private_cname (ValadocApiClass* self)
359 {
360 const gchar* _tmp0_;
361 gchar* _tmp1_;
362 gchar* result = NULL;
363 g_return_val_if_fail (self != NULL, NULL);
364 _tmp0_ = self->priv->private_cname;
365 _tmp1_ = g_strdup (_tmp0_);
366 result = _tmp1_;
367 return result;
368 }
369
370 /**
371 * Returns the C symbol representing the runtime type id for this data type.
372 */
373 gchar*
valadoc_api_class_get_type_id(ValadocApiClass * self)374 valadoc_api_class_get_type_id (ValadocApiClass* self)
375 {
376 const gchar* _tmp0_;
377 gchar* _tmp1_;
378 gchar* result = NULL;
379 g_return_val_if_fail (self != NULL, NULL);
380 _tmp0_ = self->priv->type_id;
381 _tmp1_ = g_strdup (_tmp0_);
382 result = _tmp1_;
383 return result;
384 }
385
386 /**
387 * Returns the C function name that increments the reference count of
388 * instances of this data type.
389 *
390 * @return the name of the C function or null if this data type does not
391 * support reference counting
392 */
393 gchar*
valadoc_api_class_get_ref_function_cname(ValadocApiClass * self)394 valadoc_api_class_get_ref_function_cname (ValadocApiClass* self)
395 {
396 const gchar* _tmp0_;
397 gchar* _tmp1_;
398 gchar* result = NULL;
399 g_return_val_if_fail (self != NULL, NULL);
400 _tmp0_ = self->priv->ref_function_name;
401 _tmp1_ = g_strdup (_tmp0_);
402 result = _tmp1_;
403 return result;
404 }
405
406 /**
407 * Returns the C function name that decrements the reference count of
408 * instances of this data type.
409 *
410 * @return the name of the C function or null if this data type does not
411 * support reference counting
412 */
413 gchar*
valadoc_api_class_get_unref_function_cname(ValadocApiClass * self)414 valadoc_api_class_get_unref_function_cname (ValadocApiClass* self)
415 {
416 const gchar* _tmp0_;
417 gchar* _tmp1_;
418 gchar* result = NULL;
419 g_return_val_if_fail (self != NULL, NULL);
420 _tmp0_ = self->priv->unref_function_name;
421 _tmp1_ = g_strdup (_tmp0_);
422 result = _tmp1_;
423 return result;
424 }
425
426 /**
427 * Returns the C function name that frees the
428 * instances of this data type.
429 *
430 * @return the name of the C function or null
431 */
432 gchar*
valadoc_api_class_get_free_function_name(ValadocApiClass * self)433 valadoc_api_class_get_free_function_name (ValadocApiClass* self)
434 {
435 const gchar* _tmp0_;
436 gchar* _tmp1_;
437 gchar* result = NULL;
438 g_return_val_if_fail (self != NULL, NULL);
439 _tmp0_ = self->priv->free_function_name;
440 _tmp1_ = g_strdup (_tmp0_);
441 result = _tmp1_;
442 return result;
443 }
444
445 /**
446 * Returns the C function name that finalizes the
447 * instances of this data type.
448 *
449 * @return the name of the C function or null
450 */
451 gchar*
valadoc_api_class_get_finalize_function_name(ValadocApiClass * self)452 valadoc_api_class_get_finalize_function_name (ValadocApiClass* self)
453 {
454 const gchar* _tmp0_;
455 gchar* _tmp1_;
456 gchar* result = NULL;
457 g_return_val_if_fail (self != NULL, NULL);
458 _tmp0_ = self->priv->finalize_function_name;
459 _tmp1_ = g_strdup (_tmp0_);
460 result = _tmp1_;
461 return result;
462 }
463
464 /**
465 * Returns the cname of the GValue parameter spec function.
466 */
467 gchar*
valadoc_api_class_get_param_spec_function_cname(ValadocApiClass * self)468 valadoc_api_class_get_param_spec_function_cname (ValadocApiClass* self)
469 {
470 const gchar* _tmp0_;
471 gchar* _tmp1_;
472 gchar* result = NULL;
473 g_return_val_if_fail (self != NULL, NULL);
474 _tmp0_ = self->priv->param_spec_function_name;
475 _tmp1_ = g_strdup (_tmp0_);
476 result = _tmp1_;
477 return result;
478 }
479
480 /**
481 * Returns the cname of the GValue setter function.
482 */
483 gchar*
valadoc_api_class_get_set_value_function_cname(ValadocApiClass * self)484 valadoc_api_class_get_set_value_function_cname (ValadocApiClass* self)
485 {
486 const gchar* _tmp0_;
487 gchar* _tmp1_;
488 gchar* result = NULL;
489 g_return_val_if_fail (self != NULL, NULL);
490 _tmp0_ = self->priv->set_value_function_cname;
491 _tmp1_ = g_strdup (_tmp0_);
492 result = _tmp1_;
493 return result;
494 }
495
496 /**
497 * Returns the cname of the GValue getter function.
498 */
499 gchar*
valadoc_api_class_get_get_value_function_cname(ValadocApiClass * self)500 valadoc_api_class_get_get_value_function_cname (ValadocApiClass* self)
501 {
502 const gchar* _tmp0_;
503 gchar* _tmp1_;
504 gchar* result = NULL;
505 g_return_val_if_fail (self != NULL, NULL);
506 _tmp0_ = self->priv->get_value_function_cname;
507 _tmp1_ = g_strdup (_tmp0_);
508 result = _tmp1_;
509 return result;
510 }
511
512 /**
513 * Returns the cname of the GValue taker function.
514 */
515 gchar*
valadoc_api_class_get_take_value_function_cname(ValadocApiClass * self)516 valadoc_api_class_get_take_value_function_cname (ValadocApiClass* self)
517 {
518 const gchar* _tmp0_;
519 gchar* _tmp1_;
520 gchar* result = NULL;
521 g_return_val_if_fail (self != NULL, NULL);
522 _tmp0_ = self->priv->take_value_function_cname;
523 _tmp1_ = g_strdup (_tmp0_);
524 result = _tmp1_;
525 return result;
526 }
527
528 /**
529 * Returns the dbus-name.
530 */
531 gchar*
valadoc_api_class_get_dbus_name(ValadocApiClass * self)532 valadoc_api_class_get_dbus_name (ValadocApiClass* self)
533 {
534 const gchar* _tmp0_;
535 gchar* _tmp1_;
536 gchar* result = NULL;
537 g_return_val_if_fail (self != NULL, NULL);
538 _tmp0_ = self->priv->dbus_name;
539 _tmp1_ = g_strdup (_tmp0_);
540 result = _tmp1_;
541 return result;
542 }
543
544 /**
545 * Gets the name of the GType macro which returns the class struct.
546 */
547 gchar*
valadoc_api_class_get_class_macro_name(ValadocApiClass * self)548 valadoc_api_class_get_class_macro_name (ValadocApiClass* self)
549 {
550 const gchar* _tmp0_;
551 gchar* _tmp1_;
552 gchar* result = NULL;
553 g_return_val_if_fail (self != NULL, NULL);
554 _tmp0_ = self->priv->class_macro_name;
555 _tmp1_ = g_strdup (_tmp0_);
556 result = _tmp1_;
557 return result;
558 }
559
560 /**
561 * Gets the name of the GType macro which returns the type of the class.
562 */
563 gchar*
valadoc_api_class_get_class_type_macro_name(ValadocApiClass * self)564 valadoc_api_class_get_class_type_macro_name (ValadocApiClass* self)
565 {
566 const gchar* _tmp0_;
567 gchar* _tmp1_;
568 gchar* result = NULL;
569 g_return_val_if_fail (self != NULL, NULL);
570 _tmp0_ = self->priv->class_type_macro_name;
571 _tmp1_ = g_strdup (_tmp0_);
572 result = _tmp1_;
573 return result;
574 }
575
576 /**
577 * Gets the name of the GType macro which returns whether a class instance is of a given type.
578 */
579 gchar*
valadoc_api_class_get_is_class_type_macro_name(ValadocApiClass * self)580 valadoc_api_class_get_is_class_type_macro_name (ValadocApiClass* self)
581 {
582 const gchar* _tmp0_;
583 gchar* _tmp1_;
584 gchar* result = NULL;
585 g_return_val_if_fail (self != NULL, NULL);
586 _tmp0_ = self->priv->is_class_type_macro_name;
587 _tmp1_ = g_strdup (_tmp0_);
588 result = _tmp1_;
589 return result;
590 }
591
592 /**
593 * Returns a list of all newly implemented interfaces.
594 *
595 * @see get_full_implemented_interface_list
596 */
597 static gpointer
_vala_iterable_ref0(gpointer self)598 _vala_iterable_ref0 (gpointer self)
599 {
600 return self ? vala_iterable_ref (self) : NULL;
601 }
602
603 ValaCollection*
valadoc_api_class_get_implemented_interface_list(ValadocApiClass * self)604 valadoc_api_class_get_implemented_interface_list (ValadocApiClass* self)
605 {
606 ValaArrayList* _tmp0_;
607 ValaCollection* _tmp1_;
608 ValaCollection* result = NULL;
609 g_return_val_if_fail (self != NULL, NULL);
610 _tmp0_ = self->priv->interfaces;
611 _tmp1_ = _vala_iterable_ref0 ((ValaCollection*) _tmp0_);
612 result = _tmp1_;
613 return result;
614 }
615
616 /**
617 * Returns a list of all implemented interfaces.
618 *
619 * @see get_implemented_interface_list
620 */
621 ValaCollection*
valadoc_api_class_get_full_implemented_interface_list(ValadocApiClass * self)622 valadoc_api_class_get_full_implemented_interface_list (ValadocApiClass* self)
623 {
624 ValaCollection* _tmp0_;
625 ValaCollection* _tmp12_;
626 ValaCollection* _tmp13_;
627 ValaCollection* result = NULL;
628 g_return_val_if_fail (self != NULL, NULL);
629 _tmp0_ = self->priv->_full_implemented_interfaces;
630 if (_tmp0_ == NULL) {
631 GEqualFunc _tmp1_;
632 ValaArrayList* _tmp2_;
633 ValaCollection* _tmp3_;
634 ValaArrayList* _tmp4_;
635 ValadocApiTypeReference* _tmp5_;
636 _tmp1_ = g_direct_equal;
637 _tmp2_ = vala_array_list_new (VALADOC_API_TYPE_TYPEREFERENCE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp1_);
638 _vala_iterable_unref0 (self->priv->_full_implemented_interfaces);
639 self->priv->_full_implemented_interfaces = (ValaCollection*) _tmp2_;
640 _tmp3_ = self->priv->_full_implemented_interfaces;
641 _tmp4_ = self->priv->interfaces;
642 vala_collection_add_all (_tmp3_, (ValaCollection*) _tmp4_);
643 _tmp5_ = self->priv->_base_type;
644 if (_tmp5_ != NULL) {
645 ValaCollection* _tmp6_;
646 ValadocApiTypeReference* _tmp7_;
647 ValadocApiItem* _tmp8_;
648 ValadocApiItem* _tmp9_;
649 ValaCollection* _tmp10_;
650 ValaCollection* _tmp11_;
651 _tmp6_ = self->priv->_full_implemented_interfaces;
652 _tmp7_ = self->priv->_base_type;
653 _tmp8_ = valadoc_api_typereference_get_data_type (_tmp7_);
654 _tmp9_ = _tmp8_;
655 _tmp10_ = valadoc_api_class_get_full_implemented_interface_list (G_TYPE_CHECK_INSTANCE_CAST (_tmp9_, VALADOC_API_TYPE_CLASS, ValadocApiClass));
656 _tmp11_ = _tmp10_;
657 vala_collection_add_all (_tmp6_, _tmp11_);
658 _vala_iterable_unref0 (_tmp11_);
659 }
660 }
661 _tmp12_ = self->priv->_full_implemented_interfaces;
662 _tmp13_ = _vala_iterable_ref0 (_tmp12_);
663 result = _tmp13_;
664 return result;
665 }
666
667 void
valadoc_api_class_add_interface(ValadocApiClass * self,ValadocApiTypeReference * iface)668 valadoc_api_class_add_interface (ValadocApiClass* self,
669 ValadocApiTypeReference* iface)
670 {
671 ValaArrayList* _tmp0_;
672 g_return_if_fail (self != NULL);
673 g_return_if_fail (iface != NULL);
674 _tmp0_ = self->priv->interfaces;
675 vala_collection_add ((ValaCollection*) _tmp0_, iface);
676 }
677
678 gboolean
valadoc_api_class_get_is_abstract(ValadocApiClass * self)679 valadoc_api_class_get_is_abstract (ValadocApiClass* self)
680 {
681 gboolean result;
682 g_return_val_if_fail (self != NULL, FALSE);
683 result = self->priv->_is_abstract;
684 return result;
685 }
686
687 static void
valadoc_api_class_set_is_abstract(ValadocApiClass * self,gboolean value)688 valadoc_api_class_set_is_abstract (ValadocApiClass* self,
689 gboolean value)
690 {
691 gboolean old_value;
692 g_return_if_fail (self != NULL);
693 old_value = valadoc_api_class_get_is_abstract (self);
694 if (old_value != value) {
695 self->priv->_is_abstract = value;
696 g_object_notify_by_pspec ((GObject *) self, valadoc_api_class_properties[VALADOC_API_CLASS_IS_ABSTRACT_PROPERTY]);
697 }
698 }
699
700 gboolean
valadoc_api_class_get_is_sealed(ValadocApiClass * self)701 valadoc_api_class_get_is_sealed (ValadocApiClass* self)
702 {
703 gboolean result;
704 g_return_val_if_fail (self != NULL, FALSE);
705 result = self->priv->_is_sealed;
706 return result;
707 }
708
709 static void
valadoc_api_class_set_is_sealed(ValadocApiClass * self,gboolean value)710 valadoc_api_class_set_is_sealed (ValadocApiClass* self,
711 gboolean value)
712 {
713 gboolean old_value;
714 g_return_if_fail (self != NULL);
715 old_value = valadoc_api_class_get_is_sealed (self);
716 if (old_value != value) {
717 self->priv->_is_sealed = value;
718 g_object_notify_by_pspec ((GObject *) self, valadoc_api_class_properties[VALADOC_API_CLASS_IS_SEALED_PROPERTY]);
719 }
720 }
721
722 gboolean
valadoc_api_class_get_is_fundamental(ValadocApiClass * self)723 valadoc_api_class_get_is_fundamental (ValadocApiClass* self)
724 {
725 gboolean result;
726 g_return_val_if_fail (self != NULL, FALSE);
727 result = self->priv->_is_fundamental;
728 return result;
729 }
730
731 static void
valadoc_api_class_set_is_fundamental(ValadocApiClass * self,gboolean value)732 valadoc_api_class_set_is_fundamental (ValadocApiClass* self,
733 gboolean value)
734 {
735 gboolean old_value;
736 g_return_if_fail (self != NULL);
737 old_value = valadoc_api_class_get_is_fundamental (self);
738 if (old_value != value) {
739 self->priv->_is_fundamental = value;
740 g_object_notify_by_pspec ((GObject *) self, valadoc_api_class_properties[VALADOC_API_CLASS_IS_FUNDAMENTAL_PROPERTY]);
741 }
742 }
743
744 gboolean
valadoc_api_class_get_is_compact(ValadocApiClass * self)745 valadoc_api_class_get_is_compact (ValadocApiClass* self)
746 {
747 gboolean result;
748 ValaCodeNode* _tmp0_;
749 ValaCodeNode* _tmp1_;
750 gboolean _tmp2_;
751 gboolean _tmp3_;
752 g_return_val_if_fail (self != NULL, FALSE);
753 _tmp0_ = valadoc_api_item_get_data ((ValadocApiItem*) self);
754 _tmp1_ = _tmp0_;
755 _tmp2_ = vala_class_get_is_compact (G_TYPE_CHECK_INSTANCE_CAST (_tmp1_, VALA_TYPE_CLASS, ValaClass));
756 _tmp3_ = _tmp2_;
757 result = _tmp3_;
758 return result;
759 }
760
761 static ValadocApiNodeType
valadoc_api_class_real_get_node_type(ValadocApiNode * base)762 valadoc_api_class_real_get_node_type (ValadocApiNode* base)
763 {
764 ValadocApiNodeType result;
765 ValadocApiClass* self;
766 self = (ValadocApiClass*) base;
767 result = VALADOC_API_NODE_TYPE_CLASS;
768 return result;
769 }
770
771 /**
772 * {@inheritDoc}
773 */
774 static void
valadoc_api_class_real_accept(ValadocApiNode * base,ValadocApiVisitor * visitor)775 valadoc_api_class_real_accept (ValadocApiNode* base,
776 ValadocApiVisitor* visitor)
777 {
778 ValadocApiClass * self;
779 self = (ValadocApiClass*) base;
780 g_return_if_fail (visitor != NULL);
781 valadoc_api_visitor_visit_class (visitor, self);
782 }
783
784 /**
785 * Returns a list of all known classes based on this class
786 */
787 ValaCollection*
valadoc_api_class_get_known_child_classes(ValadocApiClass * self)788 valadoc_api_class_get_known_child_classes (ValadocApiClass* self)
789 {
790 ValaSet* _tmp0_;
791 ValaCollection* _tmp1_;
792 ValaCollection* result = NULL;
793 g_return_val_if_fail (self != NULL, NULL);
794 _tmp0_ = self->priv->_known_child_classes;
795 _tmp1_ = _vala_iterable_ref0 ((ValaCollection*) _tmp0_);
796 result = _tmp1_;
797 return result;
798 }
799
800 /**
801 * Returns a list of all known interfaces based on this class
802 */
803 ValaCollection*
valadoc_api_class_get_known_derived_interfaces(ValadocApiClass * self)804 valadoc_api_class_get_known_derived_interfaces (ValadocApiClass* self)
805 {
806 ValaSet* _tmp0_;
807 ValaCollection* _tmp1_;
808 ValaCollection* result = NULL;
809 g_return_val_if_fail (self != NULL, NULL);
810 _tmp0_ = self->priv->_known_derived_interfaces;
811 _tmp1_ = _vala_iterable_ref0 ((ValaCollection*) _tmp0_);
812 result = _tmp1_;
813 return result;
814 }
815
816 void
valadoc_api_class_register_derived_interface(ValadocApiClass * self,ValadocApiInterface * iface)817 valadoc_api_class_register_derived_interface (ValadocApiClass* self,
818 ValadocApiInterface* iface)
819 {
820 ValaSet* _tmp0_;
821 g_return_if_fail (self != NULL);
822 g_return_if_fail (iface != NULL);
823 _tmp0_ = self->priv->_known_derived_interfaces;
824 vala_collection_add ((ValaCollection*) _tmp0_, iface);
825 }
826
827 void
valadoc_api_class_register_child_class(ValadocApiClass * self,ValadocApiClass * cl)828 valadoc_api_class_register_child_class (ValadocApiClass* self,
829 ValadocApiClass* cl)
830 {
831 ValadocApiTypeReference* _tmp0_;
832 ValaSet* _tmp4_;
833 g_return_if_fail (self != NULL);
834 g_return_if_fail (cl != NULL);
835 _tmp0_ = self->priv->_base_type;
836 if (_tmp0_ != NULL) {
837 ValadocApiTypeReference* _tmp1_;
838 ValadocApiItem* _tmp2_;
839 ValadocApiItem* _tmp3_;
840 _tmp1_ = self->priv->_base_type;
841 _tmp2_ = valadoc_api_typereference_get_data_type (_tmp1_);
842 _tmp3_ = _tmp2_;
843 valadoc_api_class_register_child_class (G_TYPE_CHECK_INSTANCE_CAST (_tmp3_, VALADOC_API_TYPE_CLASS, ValadocApiClass), cl);
844 }
845 _tmp4_ = self->priv->_known_child_classes;
846 vala_collection_add ((ValaCollection*) _tmp4_, cl);
847 }
848
849 /**
850 * {@inheritDoc}
851 */
852 static ValadocContentInline*
valadoc_api_class_real_build_signature(ValadocApiItem * base)853 valadoc_api_class_real_build_signature (ValadocApiItem* base)
854 {
855 ValadocApiClass * self;
856 ValadocApiSignatureBuilder* signature = NULL;
857 ValadocApiSignatureBuilder* _tmp0_;
858 ValadocApiSignatureBuilder* _tmp1_;
859 ValaSymbolAccessibility _tmp2_;
860 ValaSymbolAccessibility _tmp3_;
861 const gchar* _tmp4_;
862 gboolean _tmp5_;
863 gboolean _tmp7_;
864 ValadocApiSignatureBuilder* _tmp9_;
865 ValadocApiSignatureBuilder* _tmp10_;
866 ValaList* type_parameters = NULL;
867 ValaList* _tmp11_;
868 ValaList* _tmp12_;
869 gint _tmp13_;
870 gint _tmp14_;
871 gboolean first = FALSE;
872 ValadocApiTypeReference* _tmp31_;
873 ValaArrayList* _tmp37_;
874 gint _tmp38_;
875 gint _tmp39_;
876 ValadocApiSignatureBuilder* _tmp55_;
877 ValadocContentRun* _tmp56_;
878 ValadocContentInline* result = NULL;
879 self = (ValadocApiClass*) base;
880 _tmp0_ = valadoc_api_signature_builder_new ();
881 signature = _tmp0_;
882 _tmp1_ = signature;
883 _tmp2_ = valadoc_api_symbol_get_accessibility ((ValadocApiSymbol*) self);
884 _tmp3_ = _tmp2_;
885 _tmp4_ = vala_symbol_accessibility_to_string (_tmp3_);
886 valadoc_api_signature_builder_append_keyword (_tmp1_, _tmp4_, TRUE);
887 _tmp5_ = self->priv->_is_abstract;
888 if (_tmp5_) {
889 ValadocApiSignatureBuilder* _tmp6_;
890 _tmp6_ = signature;
891 valadoc_api_signature_builder_append_keyword (_tmp6_, "abstract", TRUE);
892 }
893 _tmp7_ = self->priv->_is_sealed;
894 if (_tmp7_) {
895 ValadocApiSignatureBuilder* _tmp8_;
896 _tmp8_ = signature;
897 valadoc_api_signature_builder_append_keyword (_tmp8_, "sealed", TRUE);
898 }
899 _tmp9_ = signature;
900 valadoc_api_signature_builder_append_keyword (_tmp9_, "class", TRUE);
901 _tmp10_ = signature;
902 valadoc_api_signature_builder_append_symbol (_tmp10_, (ValadocApiNode*) self, TRUE);
903 _tmp11_ = valadoc_api_node_get_children_by_type ((ValadocApiNode*) self, VALADOC_API_NODE_TYPE_TYPE_PARAMETER, FALSE);
904 type_parameters = _tmp11_;
905 _tmp12_ = type_parameters;
906 _tmp13_ = vala_collection_get_size ((ValaCollection*) _tmp12_);
907 _tmp14_ = _tmp13_;
908 if (_tmp14_ > 0) {
909 ValadocApiSignatureBuilder* _tmp15_;
910 gboolean first = FALSE;
911 ValadocApiSignatureBuilder* _tmp30_;
912 _tmp15_ = signature;
913 valadoc_api_signature_builder_append (_tmp15_, "<", FALSE);
914 first = TRUE;
915 {
916 ValaList* _param_list = NULL;
917 ValaList* _tmp16_;
918 ValaList* _tmp17_;
919 gint _param_size = 0;
920 ValaList* _tmp18_;
921 gint _tmp19_;
922 gint _tmp20_;
923 gint _param_index = 0;
924 _tmp16_ = type_parameters;
925 _tmp17_ = _vala_iterable_ref0 (_tmp16_);
926 _param_list = _tmp17_;
927 _tmp18_ = _param_list;
928 _tmp19_ = vala_collection_get_size ((ValaCollection*) _tmp18_);
929 _tmp20_ = _tmp19_;
930 _param_size = _tmp20_;
931 _param_index = -1;
932 while (TRUE) {
933 gint _tmp21_;
934 gint _tmp22_;
935 ValadocApiItem* param = NULL;
936 ValaList* _tmp23_;
937 gpointer _tmp24_;
938 ValadocApiSignatureBuilder* _tmp26_;
939 ValadocApiItem* _tmp27_;
940 ValadocContentInline* _tmp28_;
941 ValadocContentInline* _tmp29_;
942 _param_index = _param_index + 1;
943 _tmp21_ = _param_index;
944 _tmp22_ = _param_size;
945 if (!(_tmp21_ < _tmp22_)) {
946 break;
947 }
948 _tmp23_ = _param_list;
949 _tmp24_ = vala_list_get (_tmp23_, _param_index);
950 param = (ValadocApiItem*) ((ValadocApiNode*) _tmp24_);
951 if (!first) {
952 ValadocApiSignatureBuilder* _tmp25_;
953 _tmp25_ = signature;
954 valadoc_api_signature_builder_append (_tmp25_, ",", FALSE);
955 }
956 _tmp26_ = signature;
957 _tmp27_ = param;
958 _tmp28_ = valadoc_api_item_get_signature (_tmp27_);
959 _tmp29_ = _tmp28_;
960 valadoc_api_signature_builder_append_content (_tmp26_, _tmp29_, FALSE);
961 first = FALSE;
962 _g_object_unref0 (param);
963 }
964 _vala_iterable_unref0 (_param_list);
965 }
966 _tmp30_ = signature;
967 valadoc_api_signature_builder_append (_tmp30_, ">", FALSE);
968 }
969 first = TRUE;
970 _tmp31_ = self->priv->_base_type;
971 if (_tmp31_ != NULL) {
972 ValadocApiSignatureBuilder* _tmp32_;
973 ValadocApiSignatureBuilder* _tmp33_;
974 ValadocApiTypeReference* _tmp34_;
975 ValadocContentInline* _tmp35_;
976 ValadocContentInline* _tmp36_;
977 _tmp32_ = signature;
978 valadoc_api_signature_builder_append (_tmp32_, ":", TRUE);
979 _tmp33_ = signature;
980 _tmp34_ = self->priv->_base_type;
981 _tmp35_ = valadoc_api_item_get_signature ((ValadocApiItem*) _tmp34_);
982 _tmp36_ = _tmp35_;
983 valadoc_api_signature_builder_append_content (_tmp33_, _tmp36_, TRUE);
984 first = FALSE;
985 }
986 _tmp37_ = self->priv->interfaces;
987 _tmp38_ = vala_collection_get_size ((ValaCollection*) _tmp37_);
988 _tmp39_ = _tmp38_;
989 if (_tmp39_ > 0) {
990 if (first) {
991 ValadocApiSignatureBuilder* _tmp40_;
992 _tmp40_ = signature;
993 valadoc_api_signature_builder_append (_tmp40_, ":", TRUE);
994 }
995 {
996 ValaArrayList* _implemented_interface_list = NULL;
997 ValaArrayList* _tmp41_;
998 ValaArrayList* _tmp42_;
999 gint _implemented_interface_size = 0;
1000 ValaArrayList* _tmp43_;
1001 gint _tmp44_;
1002 gint _tmp45_;
1003 gint _implemented_interface_index = 0;
1004 _tmp41_ = self->priv->interfaces;
1005 _tmp42_ = _vala_iterable_ref0 (_tmp41_);
1006 _implemented_interface_list = _tmp42_;
1007 _tmp43_ = _implemented_interface_list;
1008 _tmp44_ = vala_collection_get_size ((ValaCollection*) _tmp43_);
1009 _tmp45_ = _tmp44_;
1010 _implemented_interface_size = _tmp45_;
1011 _implemented_interface_index = -1;
1012 while (TRUE) {
1013 gint _tmp46_;
1014 gint _tmp47_;
1015 ValadocApiItem* implemented_interface = NULL;
1016 ValaArrayList* _tmp48_;
1017 gpointer _tmp49_;
1018 ValadocApiSignatureBuilder* _tmp51_;
1019 ValadocApiItem* _tmp52_;
1020 ValadocContentInline* _tmp53_;
1021 ValadocContentInline* _tmp54_;
1022 _implemented_interface_index = _implemented_interface_index + 1;
1023 _tmp46_ = _implemented_interface_index;
1024 _tmp47_ = _implemented_interface_size;
1025 if (!(_tmp46_ < _tmp47_)) {
1026 break;
1027 }
1028 _tmp48_ = _implemented_interface_list;
1029 _tmp49_ = vala_list_get ((ValaList*) _tmp48_, _implemented_interface_index);
1030 implemented_interface = (ValadocApiItem*) ((ValadocApiTypeReference*) _tmp49_);
1031 if (!first) {
1032 ValadocApiSignatureBuilder* _tmp50_;
1033 _tmp50_ = signature;
1034 valadoc_api_signature_builder_append (_tmp50_, ",", FALSE);
1035 }
1036 _tmp51_ = signature;
1037 _tmp52_ = implemented_interface;
1038 _tmp53_ = valadoc_api_item_get_signature (_tmp52_);
1039 _tmp54_ = _tmp53_;
1040 valadoc_api_signature_builder_append_content (_tmp51_, _tmp54_, TRUE);
1041 first = FALSE;
1042 _g_object_unref0 (implemented_interface);
1043 }
1044 _vala_iterable_unref0 (_implemented_interface_list);
1045 }
1046 }
1047 _tmp55_ = signature;
1048 _tmp56_ = valadoc_api_signature_builder_get (_tmp55_);
1049 result = (ValadocContentInline*) _tmp56_;
1050 _vala_iterable_unref0 (type_parameters);
1051 _valadoc_api_signature_builder_unref0 (signature);
1052 return result;
1053 }
1054
1055 static void
valadoc_api_class_class_init(ValadocApiClassClass * klass,gpointer klass_data)1056 valadoc_api_class_class_init (ValadocApiClassClass * klass,
1057 gpointer klass_data)
1058 {
1059 valadoc_api_class_parent_class = g_type_class_peek_parent (klass);
1060 g_type_class_adjust_private_offset (klass, &ValadocApiClass_private_offset);
1061 ((ValadocApiNodeClass *) klass)->accept = (void (*) (ValadocApiNode*, ValadocApiVisitor*)) valadoc_api_class_real_accept;
1062 ((ValadocApiItemClass *) klass)->build_signature = (ValadocContentInline* (*) (ValadocApiItem*)) valadoc_api_class_real_build_signature;
1063 VALADOC_API_NODE_CLASS (klass)->get_node_type = valadoc_api_class_real_get_node_type;
1064 G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_api_class_get_property;
1065 G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_api_class_set_property;
1066 G_OBJECT_CLASS (klass)->finalize = valadoc_api_class_finalize;
1067 /**
1068 * Specifies the base class.
1069 */
1070 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_CLASS_BASE_TYPE_PROPERTY, valadoc_api_class_properties[VALADOC_API_CLASS_BASE_TYPE_PROPERTY] = g_param_spec_object ("base-type", "base-type", "base-type", VALADOC_API_TYPE_TYPEREFERENCE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
1071 /**
1072 * Specifies whether this class is abstract.
1073 */
1074 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_CLASS_IS_ABSTRACT_PROPERTY, valadoc_api_class_properties[VALADOC_API_CLASS_IS_ABSTRACT_PROPERTY] = g_param_spec_boolean ("is-abstract", "is-abstract", "is-abstract", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
1075 /**
1076 * Specifies whether this class is sealed. Sealed classes may not be
1077 * sub-classed.
1078 */
1079 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_CLASS_IS_SEALED_PROPERTY, valadoc_api_class_properties[VALADOC_API_CLASS_IS_SEALED_PROPERTY] = g_param_spec_boolean ("is-sealed", "is-sealed", "is-sealed", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
1080 /**
1081 * Specifies whether this class is fundamental.
1082 */
1083 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_CLASS_IS_FUNDAMENTAL_PROPERTY, valadoc_api_class_properties[VALADOC_API_CLASS_IS_FUNDAMENTAL_PROPERTY] = g_param_spec_boolean ("is-fundamental", "is-fundamental", "is-fundamental", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
1084 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_CLASS_IS_COMPACT_PROPERTY, valadoc_api_class_properties[VALADOC_API_CLASS_IS_COMPACT_PROPERTY] = g_param_spec_boolean ("is-compact", "is-compact", "is-compact", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
1085 /**
1086 * {@inheritDoc}
1087 */
1088 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_API_CLASS_NODE_TYPE_PROPERTY, valadoc_api_class_properties[VALADOC_API_CLASS_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));
1089 }
1090
1091 static void
valadoc_api_class_instance_init(ValadocApiClass * self,gpointer klass)1092 valadoc_api_class_instance_init (ValadocApiClass * self,
1093 gpointer klass)
1094 {
1095 GHashFunc _tmp0_;
1096 GEqualFunc _tmp1_;
1097 ValaHashSet* _tmp2_;
1098 GHashFunc _tmp3_;
1099 GEqualFunc _tmp4_;
1100 ValaHashSet* _tmp5_;
1101 self->priv = valadoc_api_class_get_instance_private (self);
1102 self->priv->_full_implemented_interfaces = NULL;
1103 _tmp0_ = g_direct_hash;
1104 _tmp1_ = g_direct_equal;
1105 _tmp2_ = vala_hash_set_new (VALADOC_API_TYPE_INTERFACE, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_, _tmp1_);
1106 self->priv->_known_derived_interfaces = (ValaSet*) _tmp2_;
1107 _tmp3_ = g_direct_hash;
1108 _tmp4_ = g_direct_equal;
1109 _tmp5_ = vala_hash_set_new (VALADOC_API_TYPE_CLASS, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp3_, _tmp4_);
1110 self->priv->_known_child_classes = (ValaSet*) _tmp5_;
1111 }
1112
1113 static void
valadoc_api_class_finalize(GObject * obj)1114 valadoc_api_class_finalize (GObject * obj)
1115 {
1116 ValadocApiClass * self;
1117 self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_API_TYPE_CLASS, ValadocApiClass);
1118 _vala_iterable_unref0 (self->priv->interfaces);
1119 _g_free0 (self->priv->dbus_name);
1120 _g_free0 (self->priv->take_value_function_cname);
1121 _g_free0 (self->priv->get_value_function_cname);
1122 _g_free0 (self->priv->set_value_function_cname);
1123 _g_free0 (self->priv->unref_function_name);
1124 _g_free0 (self->priv->ref_function_name);
1125 _g_free0 (self->priv->free_function_name);
1126 _g_free0 (self->priv->finalize_function_name);
1127 _g_free0 (self->priv->param_spec_function_name);
1128 _g_free0 (self->priv->type_id);
1129 _g_free0 (self->priv->is_class_type_macro_name);
1130 _g_free0 (self->priv->class_type_macro_name);
1131 _g_free0 (self->priv->class_macro_name);
1132 _g_free0 (self->priv->private_cname);
1133 _g_free0 (self->priv->cname);
1134 _g_object_unref0 (self->priv->_base_type);
1135 _vala_iterable_unref0 (self->priv->_full_implemented_interfaces);
1136 _vala_iterable_unref0 (self->priv->_known_derived_interfaces);
1137 _vala_iterable_unref0 (self->priv->_known_child_classes);
1138 G_OBJECT_CLASS (valadoc_api_class_parent_class)->finalize (obj);
1139 }
1140
1141 /**
1142 * Represents a class declaration.
1143 */
1144 static GType
valadoc_api_class_get_type_once(void)1145 valadoc_api_class_get_type_once (void)
1146 {
1147 static const GTypeInfo g_define_type_info = { sizeof (ValadocApiClassClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_api_class_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocApiClass), 0, (GInstanceInitFunc) valadoc_api_class_instance_init, NULL };
1148 GType valadoc_api_class_type_id;
1149 valadoc_api_class_type_id = g_type_register_static (VALADOC_API_TYPE_TYPESYMBOL, "ValadocApiClass", &g_define_type_info, 0);
1150 ValadocApiClass_private_offset = g_type_add_instance_private (valadoc_api_class_type_id, sizeof (ValadocApiClassPrivate));
1151 return valadoc_api_class_type_id;
1152 }
1153
1154 GType
valadoc_api_class_get_type(void)1155 valadoc_api_class_get_type (void)
1156 {
1157 static volatile gsize valadoc_api_class_type_id__volatile = 0;
1158 if (g_once_init_enter (&valadoc_api_class_type_id__volatile)) {
1159 GType valadoc_api_class_type_id;
1160 valadoc_api_class_type_id = valadoc_api_class_get_type_once ();
1161 g_once_init_leave (&valadoc_api_class_type_id__volatile, valadoc_api_class_type_id);
1162 }
1163 return valadoc_api_class_type_id__volatile;
1164 }
1165
1166 static void
_vala_valadoc_api_class_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)1167 _vala_valadoc_api_class_get_property (GObject * object,
1168 guint property_id,
1169 GValue * value,
1170 GParamSpec * pspec)
1171 {
1172 ValadocApiClass * self;
1173 self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_CLASS, ValadocApiClass);
1174 switch (property_id) {
1175 case VALADOC_API_CLASS_BASE_TYPE_PROPERTY:
1176 g_value_set_object (value, valadoc_api_class_get_base_type (self));
1177 break;
1178 case VALADOC_API_CLASS_IS_ABSTRACT_PROPERTY:
1179 g_value_set_boolean (value, valadoc_api_class_get_is_abstract (self));
1180 break;
1181 case VALADOC_API_CLASS_IS_SEALED_PROPERTY:
1182 g_value_set_boolean (value, valadoc_api_class_get_is_sealed (self));
1183 break;
1184 case VALADOC_API_CLASS_IS_FUNDAMENTAL_PROPERTY:
1185 g_value_set_boolean (value, valadoc_api_class_get_is_fundamental (self));
1186 break;
1187 case VALADOC_API_CLASS_IS_COMPACT_PROPERTY:
1188 g_value_set_boolean (value, valadoc_api_class_get_is_compact (self));
1189 break;
1190 case VALADOC_API_CLASS_NODE_TYPE_PROPERTY:
1191 g_value_set_enum (value, valadoc_api_node_get_node_type ((ValadocApiNode*) self));
1192 break;
1193 default:
1194 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1195 break;
1196 }
1197 }
1198
1199 static void
_vala_valadoc_api_class_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)1200 _vala_valadoc_api_class_set_property (GObject * object,
1201 guint property_id,
1202 const GValue * value,
1203 GParamSpec * pspec)
1204 {
1205 ValadocApiClass * self;
1206 self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_API_TYPE_CLASS, ValadocApiClass);
1207 switch (property_id) {
1208 case VALADOC_API_CLASS_BASE_TYPE_PROPERTY:
1209 valadoc_api_class_set_base_type (self, g_value_get_object (value));
1210 break;
1211 case VALADOC_API_CLASS_IS_ABSTRACT_PROPERTY:
1212 valadoc_api_class_set_is_abstract (self, g_value_get_boolean (value));
1213 break;
1214 case VALADOC_API_CLASS_IS_SEALED_PROPERTY:
1215 valadoc_api_class_set_is_sealed (self, g_value_get_boolean (value));
1216 break;
1217 case VALADOC_API_CLASS_IS_FUNDAMENTAL_PROPERTY:
1218 valadoc_api_class_set_is_fundamental (self, g_value_get_boolean (value));
1219 break;
1220 default:
1221 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1222 break;
1223 }
1224 }
1225
1226