1 /* list.c generated by valac, the Vala compiler
2 * generated from list.vala, do not modify */
3
4 /* list.vala
5 *
6 * Copyright (C) 2008-2009 Didier Villevalois
7 * Copyright (C) 2008-2012 Florian Brosch
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 *
23 * Author:
24 * Didier 'Ptitjes Villevalois <ptitjes@free.fr>
25 */
26
27 #include "valadoc.h"
28 #include <valagee.h>
29 #include <glib-object.h>
30 #include <stdlib.h>
31 #include <string.h>
32 #include <glib.h>
33
34 enum {
35 VALADOC_CONTENT_LIST_0_PROPERTY,
36 VALADOC_CONTENT_LIST_BULLET_PROPERTY,
37 VALADOC_CONTENT_LIST_ITEMS_PROPERTY,
38 VALADOC_CONTENT_LIST_NUM_PROPERTIES
39 };
40 static GParamSpec* valadoc_content_list_properties[VALADOC_CONTENT_LIST_NUM_PROPERTIES];
41 #define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
42 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
43 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
44 #define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
45 #define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
46 #define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
47
48 struct _ValadocContentListPrivate {
49 ValadocContentListBullet _bullet;
50 ValaList* _items;
51 };
52
53 static gint ValadocContentList_private_offset;
54 static gpointer valadoc_content_list_parent_class = NULL;
55 static ValadocContentBlockIface * valadoc_content_list_valadoc_content_block_parent_iface = NULL;
56
57 static ValadocContentListBullet* _valadoc_content_list_bullet_dup (ValadocContentListBullet* self);
58 G_GNUC_INTERNAL ValadocContentList* valadoc_content_list_new (void);
59 G_GNUC_INTERNAL ValadocContentList* valadoc_content_list_construct (GType object_type);
60 static void valadoc_content_list_real_check (ValadocContentContentElement* base,
61 ValadocApiTree* api_root,
62 ValadocApiNode* container,
63 const gchar* file_path,
64 ValadocErrorReporter* reporter,
65 ValadocSettings* settings);
66 G_GNUC_INTERNAL void valadoc_content_content_element_set_parent (ValadocContentContentElement* self,
67 ValadocContentContentElement* value);
68 static void valadoc_content_list_real_accept (ValadocContentContentElement* base,
69 ValadocContentContentVisitor* visitor);
70 static void valadoc_content_list_real_accept_children (ValadocContentContentElement* base,
71 ValadocContentContentVisitor* visitor);
72 static gboolean valadoc_content_list_real_is_empty (ValadocContentContentElement* base);
73 static ValadocContentContentElement* valadoc_content_list_real_copy (ValadocContentContentElement* base,
74 ValadocContentContentElement* new_parent);
75 static void valadoc_content_list_finalize (GObject * obj);
76 static GType valadoc_content_list_get_type_once (void);
77 static void _vala_valadoc_content_list_get_property (GObject * object,
78 guint property_id,
79 GValue * value,
80 GParamSpec * pspec);
81 static void _vala_valadoc_content_list_set_property (GObject * object,
82 guint property_id,
83 const GValue * value,
84 GParamSpec * pspec);
85
86 static inline gpointer
valadoc_content_list_get_instance_private(ValadocContentList * self)87 valadoc_content_list_get_instance_private (ValadocContentList* self)
88 {
89 return G_STRUCT_MEMBER_P (self, ValadocContentList_private_offset);
90 }
91
92 static ValadocContentListBullet*
_valadoc_content_list_bullet_dup(ValadocContentListBullet * self)93 _valadoc_content_list_bullet_dup (ValadocContentListBullet* self)
94 {
95 ValadocContentListBullet* dup;
96 dup = g_new0 (ValadocContentListBullet, 1);
97 memcpy (dup, self, sizeof (ValadocContentListBullet));
98 return dup;
99 }
100
101 static gpointer
__valadoc_content_list_bullet_dup0(gpointer self)102 __valadoc_content_list_bullet_dup0 (gpointer self)
103 {
104 return self ? _valadoc_content_list_bullet_dup (self) : NULL;
105 }
106
107 ValadocContentListBullet*
valadoc_content_list_bullet_from_string(const gchar * str)108 valadoc_content_list_bullet_from_string (const gchar* str)
109 {
110 const gchar* _tmp0_;
111 GQuark _tmp2_ = 0U;
112 static GQuark _tmp1_label0 = 0;
113 static GQuark _tmp1_label1 = 0;
114 static GQuark _tmp1_label2 = 0;
115 static GQuark _tmp1_label3 = 0;
116 static GQuark _tmp1_label4 = 0;
117 static GQuark _tmp1_label5 = 0;
118 static GQuark _tmp1_label6 = 0;
119 static GQuark _tmp1_label7 = 0;
120 ValadocContentListBullet* result = NULL;
121 _tmp0_ = str;
122 _tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
123 if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("none")))) {
124 switch (0) {
125 default:
126 {
127 ValadocContentListBullet _tmp3_;
128 ValadocContentListBullet* _tmp4_;
129 _tmp3_ = VALADOC_CONTENT_LIST_BULLET_NONE;
130 _tmp4_ = __valadoc_content_list_bullet_dup0 (&_tmp3_);
131 result = _tmp4_;
132 return result;
133 }
134 }
135 } else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("unordered")))) {
136 switch (0) {
137 default:
138 {
139 ValadocContentListBullet _tmp5_;
140 ValadocContentListBullet* _tmp6_;
141 _tmp5_ = VALADOC_CONTENT_LIST_BULLET_UNORDERED;
142 _tmp6_ = __valadoc_content_list_bullet_dup0 (&_tmp5_);
143 result = _tmp6_;
144 return result;
145 }
146 }
147 } else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("ordered")))) {
148 switch (0) {
149 default:
150 {
151 ValadocContentListBullet _tmp7_;
152 ValadocContentListBullet* _tmp8_;
153 _tmp7_ = VALADOC_CONTENT_LIST_BULLET_ORDERED;
154 _tmp8_ = __valadoc_content_list_bullet_dup0 (&_tmp7_);
155 result = _tmp8_;
156 return result;
157 }
158 }
159 } else if (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("ordered-number")))) {
160 switch (0) {
161 default:
162 {
163 ValadocContentListBullet _tmp9_;
164 ValadocContentListBullet* _tmp10_;
165 _tmp9_ = VALADOC_CONTENT_LIST_BULLET_ORDERED_NUMBER;
166 _tmp10_ = __valadoc_content_list_bullet_dup0 (&_tmp9_);
167 result = _tmp10_;
168 return result;
169 }
170 }
171 } else if (_tmp2_ == ((0 != _tmp1_label4) ? _tmp1_label4 : (_tmp1_label4 = g_quark_from_static_string ("ordered-lower-case-alpa")))) {
172 switch (0) {
173 default:
174 {
175 ValadocContentListBullet _tmp11_;
176 ValadocContentListBullet* _tmp12_;
177 _tmp11_ = VALADOC_CONTENT_LIST_BULLET_ORDERED_LOWER_CASE_ALPHA;
178 _tmp12_ = __valadoc_content_list_bullet_dup0 (&_tmp11_);
179 result = _tmp12_;
180 return result;
181 }
182 }
183 } else if (_tmp2_ == ((0 != _tmp1_label5) ? _tmp1_label5 : (_tmp1_label5 = g_quark_from_static_string ("ordered-upper-case-alpha")))) {
184 switch (0) {
185 default:
186 {
187 ValadocContentListBullet _tmp13_;
188 ValadocContentListBullet* _tmp14_;
189 _tmp13_ = VALADOC_CONTENT_LIST_BULLET_ORDERED_UPPER_CASE_ALPHA;
190 _tmp14_ = __valadoc_content_list_bullet_dup0 (&_tmp13_);
191 result = _tmp14_;
192 return result;
193 }
194 }
195 } else if (_tmp2_ == ((0 != _tmp1_label6) ? _tmp1_label6 : (_tmp1_label6 = g_quark_from_static_string ("ordered-lower-case-roman")))) {
196 switch (0) {
197 default:
198 {
199 ValadocContentListBullet _tmp15_;
200 ValadocContentListBullet* _tmp16_;
201 _tmp15_ = VALADOC_CONTENT_LIST_BULLET_ORDERED_LOWER_CASE_ROMAN;
202 _tmp16_ = __valadoc_content_list_bullet_dup0 (&_tmp15_);
203 result = _tmp16_;
204 return result;
205 }
206 }
207 } else if (_tmp2_ == ((0 != _tmp1_label7) ? _tmp1_label7 : (_tmp1_label7 = g_quark_from_static_string ("ordered-upper-case-roman")))) {
208 switch (0) {
209 default:
210 {
211 ValadocContentListBullet _tmp17_;
212 ValadocContentListBullet* _tmp18_;
213 _tmp17_ = VALADOC_CONTENT_LIST_BULLET_ORDERED_UPPER_CASE_ROMAN;
214 _tmp18_ = __valadoc_content_list_bullet_dup0 (&_tmp17_);
215 result = _tmp18_;
216 return result;
217 }
218 }
219 }
220 result = NULL;
221 return result;
222 }
223
224 const gchar*
valadoc_content_list_bullet_to_string(ValadocContentListBullet self)225 valadoc_content_list_bullet_to_string (ValadocContentListBullet self)
226 {
227 const gchar* result = NULL;
228 switch (self) {
229 case VALADOC_CONTENT_LIST_BULLET_NONE:
230 {
231 result = "none";
232 return result;
233 }
234 case VALADOC_CONTENT_LIST_BULLET_UNORDERED:
235 {
236 result = "unordered";
237 return result;
238 }
239 case VALADOC_CONTENT_LIST_BULLET_ORDERED:
240 {
241 result = "ordered";
242 return result;
243 }
244 case VALADOC_CONTENT_LIST_BULLET_ORDERED_NUMBER:
245 {
246 result = "ordered-number";
247 return result;
248 }
249 case VALADOC_CONTENT_LIST_BULLET_ORDERED_LOWER_CASE_ALPHA:
250 {
251 result = "ordered-lower-case-alpa";
252 return result;
253 }
254 case VALADOC_CONTENT_LIST_BULLET_ORDERED_UPPER_CASE_ALPHA:
255 {
256 result = "ordered-upper-case-alpha";
257 return result;
258 }
259 case VALADOC_CONTENT_LIST_BULLET_ORDERED_LOWER_CASE_ROMAN:
260 {
261 result = "ordered-lower-case-roman";
262 return result;
263 }
264 case VALADOC_CONTENT_LIST_BULLET_ORDERED_UPPER_CASE_ROMAN:
265 {
266 result = "ordered-upper-case-roman";
267 return result;
268 }
269 default:
270 break;
271 }
272 _vala_assert (TRUE, "true");
273 result = "";
274 return result;
275 }
276
277 static GType
valadoc_content_list_bullet_get_type_once(void)278 valadoc_content_list_bullet_get_type_once (void)
279 {
280 static const GEnumValue values[] = {{VALADOC_CONTENT_LIST_BULLET_NONE, "VALADOC_CONTENT_LIST_BULLET_NONE", "none"}, {VALADOC_CONTENT_LIST_BULLET_UNORDERED, "VALADOC_CONTENT_LIST_BULLET_UNORDERED", "unordered"}, {VALADOC_CONTENT_LIST_BULLET_ORDERED, "VALADOC_CONTENT_LIST_BULLET_ORDERED", "ordered"}, {VALADOC_CONTENT_LIST_BULLET_ORDERED_NUMBER, "VALADOC_CONTENT_LIST_BULLET_ORDERED_NUMBER", "ordered-number"}, {VALADOC_CONTENT_LIST_BULLET_ORDERED_LOWER_CASE_ALPHA, "VALADOC_CONTENT_LIST_BULLET_ORDERED_LOWER_CASE_ALPHA", "ordered-lower-case-alpha"}, {VALADOC_CONTENT_LIST_BULLET_ORDERED_UPPER_CASE_ALPHA, "VALADOC_CONTENT_LIST_BULLET_ORDERED_UPPER_CASE_ALPHA", "ordered-upper-case-alpha"}, {VALADOC_CONTENT_LIST_BULLET_ORDERED_LOWER_CASE_ROMAN, "VALADOC_CONTENT_LIST_BULLET_ORDERED_LOWER_CASE_ROMAN", "ordered-lower-case-roman"}, {VALADOC_CONTENT_LIST_BULLET_ORDERED_UPPER_CASE_ROMAN, "VALADOC_CONTENT_LIST_BULLET_ORDERED_UPPER_CASE_ROMAN", "ordered-upper-case-roman"}, {0, NULL, NULL}};
281 GType valadoc_content_list_bullet_type_id;
282 valadoc_content_list_bullet_type_id = g_enum_register_static ("ValadocContentListBullet", values);
283 return valadoc_content_list_bullet_type_id;
284 }
285
286 GType
valadoc_content_list_bullet_get_type(void)287 valadoc_content_list_bullet_get_type (void)
288 {
289 static volatile gsize valadoc_content_list_bullet_type_id__volatile = 0;
290 if (g_once_init_enter (&valadoc_content_list_bullet_type_id__volatile)) {
291 GType valadoc_content_list_bullet_type_id;
292 valadoc_content_list_bullet_type_id = valadoc_content_list_bullet_get_type_once ();
293 g_once_init_leave (&valadoc_content_list_bullet_type_id__volatile, valadoc_content_list_bullet_type_id);
294 }
295 return valadoc_content_list_bullet_type_id__volatile;
296 }
297
298 ValadocContentListBullet
valadoc_content_list_get_bullet(ValadocContentList * self)299 valadoc_content_list_get_bullet (ValadocContentList* self)
300 {
301 ValadocContentListBullet result;
302 ValadocContentListBullet _tmp0_;
303 g_return_val_if_fail (self != NULL, 0);
304 _tmp0_ = self->priv->_bullet;
305 result = _tmp0_;
306 return result;
307 }
308
309 void
valadoc_content_list_set_bullet(ValadocContentList * self,ValadocContentListBullet value)310 valadoc_content_list_set_bullet (ValadocContentList* self,
311 ValadocContentListBullet value)
312 {
313 ValadocContentListBullet old_value;
314 g_return_if_fail (self != NULL);
315 old_value = valadoc_content_list_get_bullet (self);
316 if (old_value != value) {
317 self->priv->_bullet = value;
318 g_object_notify_by_pspec ((GObject *) self, valadoc_content_list_properties[VALADOC_CONTENT_LIST_BULLET_PROPERTY]);
319 }
320 }
321
322 ValaList*
valadoc_content_list_get_items(ValadocContentList * self)323 valadoc_content_list_get_items (ValadocContentList* self)
324 {
325 ValaList* result;
326 ValaList* _tmp0_;
327 g_return_val_if_fail (self != NULL, NULL);
328 _tmp0_ = self->priv->_items;
329 result = _tmp0_;
330 return result;
331 }
332
333 G_GNUC_INTERNAL ValadocContentList*
valadoc_content_list_construct(GType object_type)334 valadoc_content_list_construct (GType object_type)
335 {
336 ValadocContentList * self = NULL;
337 GEqualFunc _tmp0_;
338 ValaArrayList* _tmp1_;
339 self = (ValadocContentList*) valadoc_content_content_element_construct (object_type);
340 self->priv->_bullet = VALADOC_CONTENT_LIST_BULLET_NONE;
341 _tmp0_ = g_direct_equal;
342 _tmp1_ = vala_array_list_new (VALADOC_CONTENT_TYPE_LIST_ITEM, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, _tmp0_);
343 _vala_iterable_unref0 (self->priv->_items);
344 self->priv->_items = (ValaList*) _tmp1_;
345 return self;
346 }
347
348 G_GNUC_INTERNAL ValadocContentList*
valadoc_content_list_new(void)349 valadoc_content_list_new (void)
350 {
351 return valadoc_content_list_construct (VALADOC_CONTENT_TYPE_LIST);
352 }
353
354 static gpointer
_vala_iterable_ref0(gpointer self)355 _vala_iterable_ref0 (gpointer self)
356 {
357 return self ? vala_iterable_ref (self) : NULL;
358 }
359
360 static void
valadoc_content_list_real_check(ValadocContentContentElement * base,ValadocApiTree * api_root,ValadocApiNode * container,const gchar * file_path,ValadocErrorReporter * reporter,ValadocSettings * settings)361 valadoc_content_list_real_check (ValadocContentContentElement* base,
362 ValadocApiTree* api_root,
363 ValadocApiNode* container,
364 const gchar* file_path,
365 ValadocErrorReporter* reporter,
366 ValadocSettings* settings)
367 {
368 ValadocContentList * self;
369 self = (ValadocContentList*) base;
370 g_return_if_fail (api_root != NULL);
371 g_return_if_fail (container != NULL);
372 g_return_if_fail (file_path != NULL);
373 g_return_if_fail (reporter != NULL);
374 g_return_if_fail (settings != NULL);
375 {
376 ValaList* _element_list = NULL;
377 ValaList* _tmp0_;
378 ValaList* _tmp1_;
379 gint _element_size = 0;
380 ValaList* _tmp2_;
381 gint _tmp3_;
382 gint _tmp4_;
383 gint _element_index = 0;
384 _tmp0_ = self->priv->_items;
385 _tmp1_ = _vala_iterable_ref0 (_tmp0_);
386 _element_list = _tmp1_;
387 _tmp2_ = _element_list;
388 _tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
389 _tmp4_ = _tmp3_;
390 _element_size = _tmp4_;
391 _element_index = -1;
392 while (TRUE) {
393 gint _tmp5_;
394 gint _tmp6_;
395 ValadocContentListItem* element = NULL;
396 ValaList* _tmp7_;
397 gpointer _tmp8_;
398 ValadocContentListItem* _tmp9_;
399 ValadocContentListItem* _tmp10_;
400 _element_index = _element_index + 1;
401 _tmp5_ = _element_index;
402 _tmp6_ = _element_size;
403 if (!(_tmp5_ < _tmp6_)) {
404 break;
405 }
406 _tmp7_ = _element_list;
407 _tmp8_ = vala_list_get (_tmp7_, _element_index);
408 element = (ValadocContentListItem*) _tmp8_;
409 _tmp9_ = element;
410 valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp9_, (ValadocContentContentElement*) self);
411 _tmp10_ = element;
412 valadoc_content_content_element_check ((ValadocContentContentElement*) _tmp10_, api_root, container, file_path, reporter, settings);
413 _g_object_unref0 (element);
414 }
415 _vala_iterable_unref0 (_element_list);
416 }
417 }
418
419 static void
valadoc_content_list_real_accept(ValadocContentContentElement * base,ValadocContentContentVisitor * visitor)420 valadoc_content_list_real_accept (ValadocContentContentElement* base,
421 ValadocContentContentVisitor* visitor)
422 {
423 ValadocContentList * self;
424 self = (ValadocContentList*) base;
425 g_return_if_fail (visitor != NULL);
426 valadoc_content_content_visitor_visit_list (visitor, self);
427 }
428
429 static void
valadoc_content_list_real_accept_children(ValadocContentContentElement * base,ValadocContentContentVisitor * visitor)430 valadoc_content_list_real_accept_children (ValadocContentContentElement* base,
431 ValadocContentContentVisitor* visitor)
432 {
433 ValadocContentList * self;
434 self = (ValadocContentList*) base;
435 g_return_if_fail (visitor != NULL);
436 {
437 ValaList* _element_list = NULL;
438 ValaList* _tmp0_;
439 ValaList* _tmp1_;
440 gint _element_size = 0;
441 ValaList* _tmp2_;
442 gint _tmp3_;
443 gint _tmp4_;
444 gint _element_index = 0;
445 _tmp0_ = self->priv->_items;
446 _tmp1_ = _vala_iterable_ref0 (_tmp0_);
447 _element_list = _tmp1_;
448 _tmp2_ = _element_list;
449 _tmp3_ = vala_collection_get_size ((ValaCollection*) _tmp2_);
450 _tmp4_ = _tmp3_;
451 _element_size = _tmp4_;
452 _element_index = -1;
453 while (TRUE) {
454 gint _tmp5_;
455 gint _tmp6_;
456 ValadocContentListItem* element = NULL;
457 ValaList* _tmp7_;
458 gpointer _tmp8_;
459 ValadocContentListItem* _tmp9_;
460 _element_index = _element_index + 1;
461 _tmp5_ = _element_index;
462 _tmp6_ = _element_size;
463 if (!(_tmp5_ < _tmp6_)) {
464 break;
465 }
466 _tmp7_ = _element_list;
467 _tmp8_ = vala_list_get (_tmp7_, _element_index);
468 element = (ValadocContentListItem*) _tmp8_;
469 _tmp9_ = element;
470 valadoc_content_content_element_accept ((ValadocContentContentElement*) _tmp9_, visitor);
471 _g_object_unref0 (element);
472 }
473 _vala_iterable_unref0 (_element_list);
474 }
475 }
476
477 static gboolean
valadoc_content_list_real_is_empty(ValadocContentContentElement * base)478 valadoc_content_list_real_is_empty (ValadocContentContentElement* base)
479 {
480 ValadocContentList * self;
481 ValaList* _tmp0_;
482 gint _tmp1_;
483 gint _tmp2_;
484 gboolean result = FALSE;
485 self = (ValadocContentList*) base;
486 _tmp0_ = self->priv->_items;
487 _tmp1_ = vala_collection_get_size ((ValaCollection*) _tmp0_);
488 _tmp2_ = _tmp1_;
489 result = _tmp2_ == 0;
490 return result;
491 }
492
493 static ValadocContentContentElement*
valadoc_content_list_real_copy(ValadocContentContentElement * base,ValadocContentContentElement * new_parent)494 valadoc_content_list_real_copy (ValadocContentContentElement* base,
495 ValadocContentContentElement* new_parent)
496 {
497 ValadocContentList * self;
498 ValadocContentList* list = NULL;
499 ValadocContentList* _tmp0_;
500 ValadocContentList* _tmp1_;
501 ValadocContentList* _tmp2_;
502 ValadocContentListBullet _tmp3_;
503 ValadocContentContentElement* result = NULL;
504 self = (ValadocContentList*) base;
505 _tmp0_ = valadoc_content_list_new ();
506 list = _tmp0_;
507 _tmp1_ = list;
508 valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp1_, new_parent);
509 _tmp2_ = list;
510 _tmp3_ = self->priv->_bullet;
511 valadoc_content_list_set_bullet (_tmp2_, _tmp3_);
512 {
513 ValaList* _item_list = NULL;
514 ValaList* _tmp4_;
515 ValaList* _tmp5_;
516 ValaList* _tmp6_;
517 gint _item_size = 0;
518 ValaList* _tmp7_;
519 gint _tmp8_;
520 gint _tmp9_;
521 gint _item_index = 0;
522 _tmp4_ = valadoc_content_list_get_items (self);
523 _tmp5_ = _tmp4_;
524 _tmp6_ = _vala_iterable_ref0 (_tmp5_);
525 _item_list = _tmp6_;
526 _tmp7_ = _item_list;
527 _tmp8_ = vala_collection_get_size ((ValaCollection*) _tmp7_);
528 _tmp9_ = _tmp8_;
529 _item_size = _tmp9_;
530 _item_index = -1;
531 while (TRUE) {
532 gint _tmp10_;
533 gint _tmp11_;
534 ValadocContentListItem* item = NULL;
535 ValaList* _tmp12_;
536 gpointer _tmp13_;
537 ValadocContentListItem* copy = NULL;
538 ValadocContentListItem* _tmp14_;
539 ValadocContentList* _tmp15_;
540 ValadocContentContentElement* _tmp16_;
541 ValadocContentListItem* _tmp17_;
542 ValadocContentList* _tmp18_;
543 ValaList* _tmp19_;
544 ValaList* _tmp20_;
545 ValadocContentListItem* _tmp21_;
546 _item_index = _item_index + 1;
547 _tmp10_ = _item_index;
548 _tmp11_ = _item_size;
549 if (!(_tmp10_ < _tmp11_)) {
550 break;
551 }
552 _tmp12_ = _item_list;
553 _tmp13_ = vala_list_get (_tmp12_, _item_index);
554 item = (ValadocContentListItem*) _tmp13_;
555 _tmp14_ = item;
556 _tmp15_ = list;
557 _tmp16_ = valadoc_content_content_element_copy ((ValadocContentContentElement*) _tmp14_, (ValadocContentContentElement*) _tmp15_);
558 _tmp17_ = VALADOC_CONTENT_IS_LIST_ITEM (_tmp16_) ? ((ValadocContentListItem*) _tmp16_) : NULL;
559 if (_tmp17_ == NULL) {
560 _g_object_unref0 (_tmp16_);
561 }
562 copy = _tmp17_;
563 _tmp18_ = list;
564 _tmp19_ = valadoc_content_list_get_items (_tmp18_);
565 _tmp20_ = _tmp19_;
566 _tmp21_ = copy;
567 vala_collection_add ((ValaCollection*) _tmp20_, _tmp21_);
568 _g_object_unref0 (copy);
569 _g_object_unref0 (item);
570 }
571 _vala_iterable_unref0 (_item_list);
572 }
573 result = (ValadocContentContentElement*) list;
574 return result;
575 }
576
577 static void
valadoc_content_list_class_init(ValadocContentListClass * klass,gpointer klass_data)578 valadoc_content_list_class_init (ValadocContentListClass * klass,
579 gpointer klass_data)
580 {
581 valadoc_content_list_parent_class = g_type_class_peek_parent (klass);
582 g_type_class_adjust_private_offset (klass, &ValadocContentList_private_offset);
583 ((ValadocContentContentElementClass *) klass)->check = (void (*) (ValadocContentContentElement*, ValadocApiTree*, ValadocApiNode*, const gchar*, ValadocErrorReporter*, ValadocSettings*)) valadoc_content_list_real_check;
584 ((ValadocContentContentElementClass *) klass)->accept = (void (*) (ValadocContentContentElement*, ValadocContentContentVisitor*)) valadoc_content_list_real_accept;
585 ((ValadocContentContentElementClass *) klass)->accept_children = (void (*) (ValadocContentContentElement*, ValadocContentContentVisitor*)) valadoc_content_list_real_accept_children;
586 ((ValadocContentContentElementClass *) klass)->is_empty = (gboolean (*) (ValadocContentContentElement*)) valadoc_content_list_real_is_empty;
587 ((ValadocContentContentElementClass *) klass)->copy = (ValadocContentContentElement* (*) (ValadocContentContentElement*, ValadocContentContentElement*)) valadoc_content_list_real_copy;
588 G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_content_list_get_property;
589 G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_content_list_set_property;
590 G_OBJECT_CLASS (klass)->finalize = valadoc_content_list_finalize;
591 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_CONTENT_LIST_BULLET_PROPERTY, valadoc_content_list_properties[VALADOC_CONTENT_LIST_BULLET_PROPERTY] = g_param_spec_enum ("bullet", "bullet", "bullet", VALADOC_CONTENT_LIST_TYPE_BULLET, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
592 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_CONTENT_LIST_ITEMS_PROPERTY, valadoc_content_list_properties[VALADOC_CONTENT_LIST_ITEMS_PROPERTY] = vala_param_spec_iterable ("items", "items", "items", VALA_TYPE_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
593 }
594
595 static void
valadoc_content_list_valadoc_content_block_interface_init(ValadocContentBlockIface * iface,gpointer iface_data)596 valadoc_content_list_valadoc_content_block_interface_init (ValadocContentBlockIface * iface,
597 gpointer iface_data)
598 {
599 valadoc_content_list_valadoc_content_block_parent_iface = g_type_interface_peek_parent (iface);
600 }
601
602 static void
valadoc_content_list_instance_init(ValadocContentList * self,gpointer klass)603 valadoc_content_list_instance_init (ValadocContentList * self,
604 gpointer klass)
605 {
606 self->priv = valadoc_content_list_get_instance_private (self);
607 }
608
609 static void
valadoc_content_list_finalize(GObject * obj)610 valadoc_content_list_finalize (GObject * obj)
611 {
612 ValadocContentList * self;
613 self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_CONTENT_TYPE_LIST, ValadocContentList);
614 _vala_iterable_unref0 (self->priv->_items);
615 G_OBJECT_CLASS (valadoc_content_list_parent_class)->finalize (obj);
616 }
617
618 static GType
valadoc_content_list_get_type_once(void)619 valadoc_content_list_get_type_once (void)
620 {
621 static const GTypeInfo g_define_type_info = { sizeof (ValadocContentListClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_content_list_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocContentList), 0, (GInstanceInitFunc) valadoc_content_list_instance_init, NULL };
622 static const GInterfaceInfo valadoc_content_block_info = { (GInterfaceInitFunc) valadoc_content_list_valadoc_content_block_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
623 GType valadoc_content_list_type_id;
624 valadoc_content_list_type_id = g_type_register_static (VALADOC_CONTENT_TYPE_CONTENT_ELEMENT, "ValadocContentList", &g_define_type_info, 0);
625 g_type_add_interface_static (valadoc_content_list_type_id, VALADOC_CONTENT_TYPE_BLOCK, &valadoc_content_block_info);
626 ValadocContentList_private_offset = g_type_add_instance_private (valadoc_content_list_type_id, sizeof (ValadocContentListPrivate));
627 return valadoc_content_list_type_id;
628 }
629
630 GType
valadoc_content_list_get_type(void)631 valadoc_content_list_get_type (void)
632 {
633 static volatile gsize valadoc_content_list_type_id__volatile = 0;
634 if (g_once_init_enter (&valadoc_content_list_type_id__volatile)) {
635 GType valadoc_content_list_type_id;
636 valadoc_content_list_type_id = valadoc_content_list_get_type_once ();
637 g_once_init_leave (&valadoc_content_list_type_id__volatile, valadoc_content_list_type_id);
638 }
639 return valadoc_content_list_type_id__volatile;
640 }
641
642 static void
_vala_valadoc_content_list_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)643 _vala_valadoc_content_list_get_property (GObject * object,
644 guint property_id,
645 GValue * value,
646 GParamSpec * pspec)
647 {
648 ValadocContentList * self;
649 self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_CONTENT_TYPE_LIST, ValadocContentList);
650 switch (property_id) {
651 case VALADOC_CONTENT_LIST_BULLET_PROPERTY:
652 g_value_set_enum (value, valadoc_content_list_get_bullet (self));
653 break;
654 case VALADOC_CONTENT_LIST_ITEMS_PROPERTY:
655 vala_value_set_iterable (value, valadoc_content_list_get_items (self));
656 break;
657 default:
658 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
659 break;
660 }
661 }
662
663 static void
_vala_valadoc_content_list_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)664 _vala_valadoc_content_list_set_property (GObject * object,
665 guint property_id,
666 const GValue * value,
667 GParamSpec * pspec)
668 {
669 ValadocContentList * self;
670 self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_CONTENT_TYPE_LIST, ValadocContentList);
671 switch (property_id) {
672 case VALADOC_CONTENT_LIST_BULLET_PROPERTY:
673 valadoc_content_list_set_bullet (self, g_value_get_enum (value));
674 break;
675 default:
676 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
677 break;
678 }
679 }
680
681