1 /* run.c generated by valac, the Vala compiler
2 * generated from run.vala, do not modify */
3
4 /* run.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 <stdlib.h>
29 #include <string.h>
30 #include <glib.h>
31 #include <valagee.h>
32 #include <glib-object.h>
33
34 enum {
35 VALADOC_CONTENT_RUN_0_PROPERTY,
36 VALADOC_CONTENT_RUN_STYLE_PROPERTY,
37 VALADOC_CONTENT_RUN_NUM_PROPERTIES
38 };
39 static GParamSpec* valadoc_content_run_properties[VALADOC_CONTENT_RUN_NUM_PROPERTIES];
40 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
41 #define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
42 #define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
43 #define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
44 #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; }
45 #define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
46
47 struct _ValadocContentRunPrivate {
48 ValadocContentRunStyle _style;
49 };
50
51 static gint ValadocContentRun_private_offset;
52 static gpointer valadoc_content_run_parent_class = NULL;
53 static ValadocContentInlineIface * valadoc_content_run_valadoc_content_inline_parent_iface = NULL;
54
55 static ValadocContentRunStyle* _valadoc_content_run_style_dup (ValadocContentRunStyle* self);
56 G_GNUC_INTERNAL ValadocContentRun* valadoc_content_run_new (ValadocContentRunStyle style);
57 G_GNUC_INTERNAL ValadocContentRun* valadoc_content_run_construct (GType object_type,
58 ValadocContentRunStyle style);
59 G_GNUC_INTERNAL ValadocContentInlineContent* valadoc_content_inline_content_construct (GType object_type);
60 static void valadoc_content_run_real_check (ValadocContentContentElement* base,
61 ValadocApiTree* api_root,
62 ValadocApiNode* container,
63 const gchar* file_path,
64 ValadocErrorReporter* reporter,
65 ValadocSettings* settings);
66 static void valadoc_content_run_real_accept (ValadocContentContentElement* base,
67 ValadocContentContentVisitor* visitor);
68 static ValadocContentContentElement* valadoc_content_run_real_copy (ValadocContentContentElement* base,
69 ValadocContentContentElement* new_parent);
70 G_GNUC_INTERNAL void valadoc_content_content_element_set_parent (ValadocContentContentElement* self,
71 ValadocContentContentElement* value);
72 static void valadoc_content_run_finalize (GObject * obj);
73 static GType valadoc_content_run_get_type_once (void);
74 static void _vala_valadoc_content_run_get_property (GObject * object,
75 guint property_id,
76 GValue * value,
77 GParamSpec * pspec);
78 static void _vala_valadoc_content_run_set_property (GObject * object,
79 guint property_id,
80 const GValue * value,
81 GParamSpec * pspec);
82
83 static inline gpointer
valadoc_content_run_get_instance_private(ValadocContentRun * self)84 valadoc_content_run_get_instance_private (ValadocContentRun* self)
85 {
86 return G_STRUCT_MEMBER_P (self, ValadocContentRun_private_offset);
87 }
88
89 static ValadocContentRunStyle*
_valadoc_content_run_style_dup(ValadocContentRunStyle * self)90 _valadoc_content_run_style_dup (ValadocContentRunStyle* self)
91 {
92 ValadocContentRunStyle* dup;
93 dup = g_new0 (ValadocContentRunStyle, 1);
94 memcpy (dup, self, sizeof (ValadocContentRunStyle));
95 return dup;
96 }
97
98 static gpointer
__valadoc_content_run_style_dup0(gpointer self)99 __valadoc_content_run_style_dup0 (gpointer self)
100 {
101 return self ? _valadoc_content_run_style_dup (self) : NULL;
102 }
103
104 ValadocContentRunStyle*
valadoc_content_run_style_from_string(const gchar * str)105 valadoc_content_run_style_from_string (const gchar* str)
106 {
107 const gchar* _tmp0_;
108 GQuark _tmp2_ = 0U;
109 static GQuark _tmp1_label0 = 0;
110 static GQuark _tmp1_label1 = 0;
111 static GQuark _tmp1_label2 = 0;
112 static GQuark _tmp1_label3 = 0;
113 static GQuark _tmp1_label4 = 0;
114 static GQuark _tmp1_label5 = 0;
115 static GQuark _tmp1_label6 = 0;
116 static GQuark _tmp1_label7 = 0;
117 static GQuark _tmp1_label8 = 0;
118 static GQuark _tmp1_label9 = 0;
119 static GQuark _tmp1_label10 = 0;
120 static GQuark _tmp1_label11 = 0;
121 static GQuark _tmp1_label12 = 0;
122 static GQuark _tmp1_label13 = 0;
123 static GQuark _tmp1_label14 = 0;
124 static GQuark _tmp1_label15 = 0;
125 static GQuark _tmp1_label16 = 0;
126 static GQuark _tmp1_label17 = 0;
127 static GQuark _tmp1_label18 = 0;
128 ValadocContentRunStyle* result = NULL;
129 g_return_val_if_fail (str != NULL, NULL);
130 _tmp0_ = str;
131 _tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
132 if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("none")))) {
133 switch (0) {
134 default:
135 {
136 ValadocContentRunStyle _tmp3_;
137 ValadocContentRunStyle* _tmp4_;
138 _tmp3_ = VALADOC_CONTENT_RUN_STYLE_NONE;
139 _tmp4_ = __valadoc_content_run_style_dup0 (&_tmp3_);
140 result = _tmp4_;
141 return result;
142 }
143 }
144 } else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("bold")))) {
145 switch (0) {
146 default:
147 {
148 ValadocContentRunStyle _tmp5_;
149 ValadocContentRunStyle* _tmp6_;
150 _tmp5_ = VALADOC_CONTENT_RUN_STYLE_BOLD;
151 _tmp6_ = __valadoc_content_run_style_dup0 (&_tmp5_);
152 result = _tmp6_;
153 return result;
154 }
155 }
156 } else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("italic")))) {
157 switch (0) {
158 default:
159 {
160 ValadocContentRunStyle _tmp7_;
161 ValadocContentRunStyle* _tmp8_;
162 _tmp7_ = VALADOC_CONTENT_RUN_STYLE_ITALIC;
163 _tmp8_ = __valadoc_content_run_style_dup0 (&_tmp7_);
164 result = _tmp8_;
165 return result;
166 }
167 }
168 } else if (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("underlined")))) {
169 switch (0) {
170 default:
171 {
172 ValadocContentRunStyle _tmp9_;
173 ValadocContentRunStyle* _tmp10_;
174 _tmp9_ = VALADOC_CONTENT_RUN_STYLE_UNDERLINED;
175 _tmp10_ = __valadoc_content_run_style_dup0 (&_tmp9_);
176 result = _tmp10_;
177 return result;
178 }
179 }
180 } else if (_tmp2_ == ((0 != _tmp1_label4) ? _tmp1_label4 : (_tmp1_label4 = g_quark_from_static_string ("monospaced")))) {
181 switch (0) {
182 default:
183 {
184 ValadocContentRunStyle _tmp11_;
185 ValadocContentRunStyle* _tmp12_;
186 _tmp11_ = VALADOC_CONTENT_RUN_STYLE_MONOSPACED;
187 _tmp12_ = __valadoc_content_run_style_dup0 (&_tmp11_);
188 result = _tmp12_;
189 return result;
190 }
191 }
192 } else if (_tmp2_ == ((0 != _tmp1_label5) ? _tmp1_label5 : (_tmp1_label5 = g_quark_from_static_string ("stroke")))) {
193 switch (0) {
194 default:
195 {
196 ValadocContentRunStyle _tmp13_;
197 ValadocContentRunStyle* _tmp14_;
198 _tmp13_ = VALADOC_CONTENT_RUN_STYLE_STROKE;
199 _tmp14_ = __valadoc_content_run_style_dup0 (&_tmp13_);
200 result = _tmp14_;
201 return result;
202 }
203 }
204 } else if (_tmp2_ == ((0 != _tmp1_label6) ? _tmp1_label6 : (_tmp1_label6 = g_quark_from_static_string ("lang-escape")))) {
205 switch (0) {
206 default:
207 {
208 ValadocContentRunStyle _tmp15_;
209 ValadocContentRunStyle* _tmp16_;
210 _tmp15_ = VALADOC_CONTENT_RUN_STYLE_LANG_ESCAPE;
211 _tmp16_ = __valadoc_content_run_style_dup0 (&_tmp15_);
212 result = _tmp16_;
213 return result;
214 }
215 }
216 } else if (_tmp2_ == ((0 != _tmp1_label7) ? _tmp1_label7 : (_tmp1_label7 = g_quark_from_static_string ("lang-keyword")))) {
217 switch (0) {
218 default:
219 {
220 ValadocContentRunStyle _tmp17_;
221 ValadocContentRunStyle* _tmp18_;
222 _tmp17_ = VALADOC_CONTENT_RUN_STYLE_LANG_KEYWORD;
223 _tmp18_ = __valadoc_content_run_style_dup0 (&_tmp17_);
224 result = _tmp18_;
225 return result;
226 }
227 }
228 } else if (_tmp2_ == ((0 != _tmp1_label8) ? _tmp1_label8 : (_tmp1_label8 = g_quark_from_static_string ("lang-literal")))) {
229 switch (0) {
230 default:
231 {
232 ValadocContentRunStyle _tmp19_;
233 ValadocContentRunStyle* _tmp20_;
234 _tmp19_ = VALADOC_CONTENT_RUN_STYLE_LANG_LITERAL;
235 _tmp20_ = __valadoc_content_run_style_dup0 (&_tmp19_);
236 result = _tmp20_;
237 return result;
238 }
239 }
240 } else if (_tmp2_ == ((0 != _tmp1_label9) ? _tmp1_label9 : (_tmp1_label9 = g_quark_from_static_string ("lang-basic-type")))) {
241 switch (0) {
242 default:
243 {
244 ValadocContentRunStyle _tmp21_;
245 ValadocContentRunStyle* _tmp22_;
246 _tmp21_ = VALADOC_CONTENT_RUN_STYLE_LANG_BASIC_TYPE;
247 _tmp22_ = __valadoc_content_run_style_dup0 (&_tmp21_);
248 result = _tmp22_;
249 return result;
250 }
251 }
252 } else if (_tmp2_ == ((0 != _tmp1_label10) ? _tmp1_label10 : (_tmp1_label10 = g_quark_from_static_string ("lang-type")))) {
253 switch (0) {
254 default:
255 {
256 ValadocContentRunStyle _tmp23_;
257 ValadocContentRunStyle* _tmp24_;
258 _tmp23_ = VALADOC_CONTENT_RUN_STYLE_LANG_TYPE;
259 _tmp24_ = __valadoc_content_run_style_dup0 (&_tmp23_);
260 result = _tmp24_;
261 return result;
262 }
263 }
264 } else if (_tmp2_ == ((0 != _tmp1_label11) ? _tmp1_label11 : (_tmp1_label11 = g_quark_from_static_string ("lang-preprocessor")))) {
265 switch (0) {
266 default:
267 {
268 ValadocContentRunStyle _tmp25_;
269 ValadocContentRunStyle* _tmp26_;
270 _tmp25_ = VALADOC_CONTENT_RUN_STYLE_LANG_PREPROCESSOR;
271 _tmp26_ = __valadoc_content_run_style_dup0 (&_tmp25_);
272 result = _tmp26_;
273 return result;
274 }
275 }
276 } else if (_tmp2_ == ((0 != _tmp1_label12) ? _tmp1_label12 : (_tmp1_label12 = g_quark_from_static_string ("lang-comment")))) {
277 switch (0) {
278 default:
279 {
280 ValadocContentRunStyle _tmp27_;
281 ValadocContentRunStyle* _tmp28_;
282 _tmp27_ = VALADOC_CONTENT_RUN_STYLE_LANG_COMMENT;
283 _tmp28_ = __valadoc_content_run_style_dup0 (&_tmp27_);
284 result = _tmp28_;
285 return result;
286 }
287 }
288 } else if (_tmp2_ == ((0 != _tmp1_label13) ? _tmp1_label13 : (_tmp1_label13 = g_quark_from_static_string ("xml-escape")))) {
289 switch (0) {
290 default:
291 {
292 ValadocContentRunStyle _tmp29_;
293 ValadocContentRunStyle* _tmp30_;
294 _tmp29_ = VALADOC_CONTENT_RUN_STYLE_XML_ESCAPE;
295 _tmp30_ = __valadoc_content_run_style_dup0 (&_tmp29_);
296 result = _tmp30_;
297 return result;
298 }
299 }
300 } else if (_tmp2_ == ((0 != _tmp1_label14) ? _tmp1_label14 : (_tmp1_label14 = g_quark_from_static_string ("xml-element")))) {
301 switch (0) {
302 default:
303 {
304 ValadocContentRunStyle _tmp31_;
305 ValadocContentRunStyle* _tmp32_;
306 _tmp31_ = VALADOC_CONTENT_RUN_STYLE_XML_ELEMENT;
307 _tmp32_ = __valadoc_content_run_style_dup0 (&_tmp31_);
308 result = _tmp32_;
309 return result;
310 }
311 }
312 } else if (_tmp2_ == ((0 != _tmp1_label15) ? _tmp1_label15 : (_tmp1_label15 = g_quark_from_static_string ("xml-attribute")))) {
313 switch (0) {
314 default:
315 {
316 ValadocContentRunStyle _tmp33_;
317 ValadocContentRunStyle* _tmp34_;
318 _tmp33_ = VALADOC_CONTENT_RUN_STYLE_XML_ATTRIBUTE;
319 _tmp34_ = __valadoc_content_run_style_dup0 (&_tmp33_);
320 result = _tmp34_;
321 return result;
322 }
323 }
324 } else if (_tmp2_ == ((0 != _tmp1_label16) ? _tmp1_label16 : (_tmp1_label16 = g_quark_from_static_string ("xml-attribute-value")))) {
325 switch (0) {
326 default:
327 {
328 ValadocContentRunStyle _tmp35_;
329 ValadocContentRunStyle* _tmp36_;
330 _tmp35_ = VALADOC_CONTENT_RUN_STYLE_XML_ATTRIBUTE_VALUE;
331 _tmp36_ = __valadoc_content_run_style_dup0 (&_tmp35_);
332 result = _tmp36_;
333 return result;
334 }
335 }
336 } else if (_tmp2_ == ((0 != _tmp1_label17) ? _tmp1_label17 : (_tmp1_label17 = g_quark_from_static_string ("xml-comment")))) {
337 switch (0) {
338 default:
339 {
340 ValadocContentRunStyle _tmp37_;
341 ValadocContentRunStyle* _tmp38_;
342 _tmp37_ = VALADOC_CONTENT_RUN_STYLE_XML_COMMENT;
343 _tmp38_ = __valadoc_content_run_style_dup0 (&_tmp37_);
344 result = _tmp38_;
345 return result;
346 }
347 }
348 } else if (_tmp2_ == ((0 != _tmp1_label18) ? _tmp1_label18 : (_tmp1_label18 = g_quark_from_static_string ("xml-cdata")))) {
349 switch (0) {
350 default:
351 {
352 ValadocContentRunStyle _tmp39_;
353 ValadocContentRunStyle* _tmp40_;
354 _tmp39_ = VALADOC_CONTENT_RUN_STYLE_XML_CDATA;
355 _tmp40_ = __valadoc_content_run_style_dup0 (&_tmp39_);
356 result = _tmp40_;
357 return result;
358 }
359 }
360 }
361 result = NULL;
362 return result;
363 }
364
365 const gchar*
valadoc_content_run_style_to_string(ValadocContentRunStyle self)366 valadoc_content_run_style_to_string (ValadocContentRunStyle self)
367 {
368 const gchar* result = NULL;
369 switch (self) {
370 case VALADOC_CONTENT_RUN_STYLE_NONE:
371 {
372 result = "none";
373 return result;
374 }
375 case VALADOC_CONTENT_RUN_STYLE_BOLD:
376 {
377 result = "bold";
378 return result;
379 }
380 case VALADOC_CONTENT_RUN_STYLE_ITALIC:
381 {
382 result = "italic";
383 return result;
384 }
385 case VALADOC_CONTENT_RUN_STYLE_UNDERLINED:
386 {
387 result = "underlined";
388 return result;
389 }
390 case VALADOC_CONTENT_RUN_STYLE_MONOSPACED:
391 {
392 result = "monospaced";
393 return result;
394 }
395 case VALADOC_CONTENT_RUN_STYLE_STROKE:
396 {
397 result = "stroke";
398 return result;
399 }
400 case VALADOC_CONTENT_RUN_STYLE_LANG_ESCAPE:
401 {
402 result = "lang-escape";
403 return result;
404 }
405 case VALADOC_CONTENT_RUN_STYLE_LANG_KEYWORD:
406 {
407 result = "lang-keyword";
408 return result;
409 }
410 case VALADOC_CONTENT_RUN_STYLE_LANG_LITERAL:
411 {
412 result = "lang-literal";
413 return result;
414 }
415 case VALADOC_CONTENT_RUN_STYLE_LANG_BASIC_TYPE:
416 {
417 result = "lang-basic-type";
418 return result;
419 }
420 case VALADOC_CONTENT_RUN_STYLE_LANG_TYPE:
421 {
422 result = "lang-type";
423 return result;
424 }
425 case VALADOC_CONTENT_RUN_STYLE_LANG_PREPROCESSOR:
426 {
427 result = "lang-preprocessor";
428 return result;
429 }
430 case VALADOC_CONTENT_RUN_STYLE_LANG_COMMENT:
431 {
432 result = "lang-comment";
433 return result;
434 }
435 case VALADOC_CONTENT_RUN_STYLE_XML_ESCAPE:
436 {
437 result = "xml-escape";
438 return result;
439 }
440 case VALADOC_CONTENT_RUN_STYLE_XML_ELEMENT:
441 {
442 result = "xml-element";
443 return result;
444 }
445 case VALADOC_CONTENT_RUN_STYLE_XML_ATTRIBUTE:
446 {
447 result = "xml-attribute";
448 return result;
449 }
450 case VALADOC_CONTENT_RUN_STYLE_XML_ATTRIBUTE_VALUE:
451 {
452 result = "xml-attribute-value";
453 return result;
454 }
455 case VALADOC_CONTENT_RUN_STYLE_XML_COMMENT:
456 {
457 result = "xml-comment";
458 return result;
459 }
460 case VALADOC_CONTENT_RUN_STYLE_XML_CDATA:
461 {
462 result = "xml-cdata";
463 return result;
464 }
465 default:
466 break;
467 }
468 _vala_assert (TRUE, "true");
469 result = "";
470 return result;
471 }
472
473 static GType
valadoc_content_run_style_get_type_once(void)474 valadoc_content_run_style_get_type_once (void)
475 {
476 static const GEnumValue values[] = {{VALADOC_CONTENT_RUN_STYLE_NONE, "VALADOC_CONTENT_RUN_STYLE_NONE", "none"}, {VALADOC_CONTENT_RUN_STYLE_BOLD, "VALADOC_CONTENT_RUN_STYLE_BOLD", "bold"}, {VALADOC_CONTENT_RUN_STYLE_ITALIC, "VALADOC_CONTENT_RUN_STYLE_ITALIC", "italic"}, {VALADOC_CONTENT_RUN_STYLE_UNDERLINED, "VALADOC_CONTENT_RUN_STYLE_UNDERLINED", "underlined"}, {VALADOC_CONTENT_RUN_STYLE_MONOSPACED, "VALADOC_CONTENT_RUN_STYLE_MONOSPACED", "monospaced"}, {VALADOC_CONTENT_RUN_STYLE_STROKE, "VALADOC_CONTENT_RUN_STYLE_STROKE", "stroke"}, {VALADOC_CONTENT_RUN_STYLE_LANG_KEYWORD, "VALADOC_CONTENT_RUN_STYLE_LANG_KEYWORD", "lang-keyword"}, {VALADOC_CONTENT_RUN_STYLE_LANG_LITERAL, "VALADOC_CONTENT_RUN_STYLE_LANG_LITERAL", "lang-literal"}, {VALADOC_CONTENT_RUN_STYLE_LANG_BASIC_TYPE, "VALADOC_CONTENT_RUN_STYLE_LANG_BASIC_TYPE", "lang-basic-type"}, {VALADOC_CONTENT_RUN_STYLE_LANG_TYPE, "VALADOC_CONTENT_RUN_STYLE_LANG_TYPE", "lang-type"}, {VALADOC_CONTENT_RUN_STYLE_LANG_PREPROCESSOR, "VALADOC_CONTENT_RUN_STYLE_LANG_PREPROCESSOR", "lang-preprocessor"}, {VALADOC_CONTENT_RUN_STYLE_LANG_COMMENT, "VALADOC_CONTENT_RUN_STYLE_LANG_COMMENT", "lang-comment"}, {VALADOC_CONTENT_RUN_STYLE_LANG_ESCAPE, "VALADOC_CONTENT_RUN_STYLE_LANG_ESCAPE", "lang-escape"}, {VALADOC_CONTENT_RUN_STYLE_XML_ESCAPE, "VALADOC_CONTENT_RUN_STYLE_XML_ESCAPE", "xml-escape"}, {VALADOC_CONTENT_RUN_STYLE_XML_ELEMENT, "VALADOC_CONTENT_RUN_STYLE_XML_ELEMENT", "xml-element"}, {VALADOC_CONTENT_RUN_STYLE_XML_ATTRIBUTE, "VALADOC_CONTENT_RUN_STYLE_XML_ATTRIBUTE", "xml-attribute"}, {VALADOC_CONTENT_RUN_STYLE_XML_ATTRIBUTE_VALUE, "VALADOC_CONTENT_RUN_STYLE_XML_ATTRIBUTE_VALUE", "xml-attribute-value"}, {VALADOC_CONTENT_RUN_STYLE_XML_COMMENT, "VALADOC_CONTENT_RUN_STYLE_XML_COMMENT", "xml-comment"}, {VALADOC_CONTENT_RUN_STYLE_XML_CDATA, "VALADOC_CONTENT_RUN_STYLE_XML_CDATA", "xml-cdata"}, {0, NULL, NULL}};
477 GType valadoc_content_run_style_type_id;
478 valadoc_content_run_style_type_id = g_enum_register_static ("ValadocContentRunStyle", values);
479 return valadoc_content_run_style_type_id;
480 }
481
482 GType
valadoc_content_run_style_get_type(void)483 valadoc_content_run_style_get_type (void)
484 {
485 static volatile gsize valadoc_content_run_style_type_id__volatile = 0;
486 if (g_once_init_enter (&valadoc_content_run_style_type_id__volatile)) {
487 GType valadoc_content_run_style_type_id;
488 valadoc_content_run_style_type_id = valadoc_content_run_style_get_type_once ();
489 g_once_init_leave (&valadoc_content_run_style_type_id__volatile, valadoc_content_run_style_type_id);
490 }
491 return valadoc_content_run_style_type_id__volatile;
492 }
493
494 ValadocContentRunStyle
valadoc_content_run_get_style(ValadocContentRun * self)495 valadoc_content_run_get_style (ValadocContentRun* self)
496 {
497 ValadocContentRunStyle result;
498 ValadocContentRunStyle _tmp0_;
499 g_return_val_if_fail (self != NULL, 0);
500 _tmp0_ = self->priv->_style;
501 result = _tmp0_;
502 return result;
503 }
504
505 void
valadoc_content_run_set_style(ValadocContentRun * self,ValadocContentRunStyle value)506 valadoc_content_run_set_style (ValadocContentRun* self,
507 ValadocContentRunStyle value)
508 {
509 ValadocContentRunStyle old_value;
510 g_return_if_fail (self != NULL);
511 old_value = valadoc_content_run_get_style (self);
512 if (old_value != value) {
513 self->priv->_style = value;
514 g_object_notify_by_pspec ((GObject *) self, valadoc_content_run_properties[VALADOC_CONTENT_RUN_STYLE_PROPERTY]);
515 }
516 }
517
518 G_GNUC_INTERNAL ValadocContentRun*
valadoc_content_run_construct(GType object_type,ValadocContentRunStyle style)519 valadoc_content_run_construct (GType object_type,
520 ValadocContentRunStyle style)
521 {
522 ValadocContentRun * self = NULL;
523 self = (ValadocContentRun*) valadoc_content_inline_content_construct (object_type);
524 self->priv->_style = style;
525 return self;
526 }
527
528 G_GNUC_INTERNAL ValadocContentRun*
valadoc_content_run_new(ValadocContentRunStyle style)529 valadoc_content_run_new (ValadocContentRunStyle style)
530 {
531 return valadoc_content_run_construct (VALADOC_CONTENT_TYPE_RUN, style);
532 }
533
534 static void
valadoc_content_run_real_check(ValadocContentContentElement * base,ValadocApiTree * api_root,ValadocApiNode * container,const gchar * file_path,ValadocErrorReporter * reporter,ValadocSettings * settings)535 valadoc_content_run_real_check (ValadocContentContentElement* base,
536 ValadocApiTree* api_root,
537 ValadocApiNode* container,
538 const gchar* file_path,
539 ValadocErrorReporter* reporter,
540 ValadocSettings* settings)
541 {
542 ValadocContentRun * self;
543 self = (ValadocContentRun*) base;
544 g_return_if_fail (api_root != NULL);
545 g_return_if_fail (container != NULL);
546 g_return_if_fail (file_path != NULL);
547 g_return_if_fail (reporter != NULL);
548 g_return_if_fail (settings != NULL);
549 VALADOC_CONTENT_CONTENT_ELEMENT_CLASS (valadoc_content_run_parent_class)->check ((ValadocContentContentElement*) G_TYPE_CHECK_INSTANCE_CAST (self, VALADOC_CONTENT_TYPE_INLINE_CONTENT, ValadocContentInlineContent), api_root, container, file_path, reporter, settings);
550 }
551
552 static void
valadoc_content_run_real_accept(ValadocContentContentElement * base,ValadocContentContentVisitor * visitor)553 valadoc_content_run_real_accept (ValadocContentContentElement* base,
554 ValadocContentContentVisitor* visitor)
555 {
556 ValadocContentRun * self;
557 self = (ValadocContentRun*) base;
558 g_return_if_fail (visitor != NULL);
559 valadoc_content_content_visitor_visit_run (visitor, self);
560 }
561
562 static gpointer
_vala_iterable_ref0(gpointer self)563 _vala_iterable_ref0 (gpointer self)
564 {
565 return self ? vala_iterable_ref (self) : NULL;
566 }
567
568 static ValadocContentContentElement*
valadoc_content_run_real_copy(ValadocContentContentElement * base,ValadocContentContentElement * new_parent)569 valadoc_content_run_real_copy (ValadocContentContentElement* base,
570 ValadocContentContentElement* new_parent)
571 {
572 ValadocContentRun * self;
573 ValadocContentRun* run = NULL;
574 ValadocContentRunStyle _tmp0_;
575 ValadocContentRun* _tmp1_;
576 ValadocContentRun* _tmp2_;
577 ValadocContentContentElement* result = NULL;
578 self = (ValadocContentRun*) base;
579 _tmp0_ = self->priv->_style;
580 _tmp1_ = valadoc_content_run_new (_tmp0_);
581 run = _tmp1_;
582 _tmp2_ = run;
583 valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp2_, new_parent);
584 {
585 ValaList* _element_list = NULL;
586 ValaList* _tmp3_;
587 ValaList* _tmp4_;
588 ValaList* _tmp5_;
589 gint _element_size = 0;
590 ValaList* _tmp6_;
591 gint _tmp7_;
592 gint _tmp8_;
593 gint _element_index = 0;
594 _tmp3_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) self);
595 _tmp4_ = _tmp3_;
596 _tmp5_ = _vala_iterable_ref0 (_tmp4_);
597 _element_list = _tmp5_;
598 _tmp6_ = _element_list;
599 _tmp7_ = vala_collection_get_size ((ValaCollection*) _tmp6_);
600 _tmp8_ = _tmp7_;
601 _element_size = _tmp8_;
602 _element_index = -1;
603 while (TRUE) {
604 gint _tmp9_;
605 gint _tmp10_;
606 ValadocContentInline* element = NULL;
607 ValaList* _tmp11_;
608 gpointer _tmp12_;
609 ValadocContentInline* copy = NULL;
610 ValadocContentInline* _tmp13_;
611 ValadocContentRun* _tmp14_;
612 ValadocContentContentElement* _tmp15_;
613 ValadocContentInline* _tmp16_;
614 ValadocContentRun* _tmp17_;
615 ValaList* _tmp18_;
616 ValaList* _tmp19_;
617 ValadocContentInline* _tmp20_;
618 _element_index = _element_index + 1;
619 _tmp9_ = _element_index;
620 _tmp10_ = _element_size;
621 if (!(_tmp9_ < _tmp10_)) {
622 break;
623 }
624 _tmp11_ = _element_list;
625 _tmp12_ = vala_list_get (_tmp11_, _element_index);
626 element = (ValadocContentInline*) _tmp12_;
627 _tmp13_ = element;
628 _tmp14_ = run;
629 _tmp15_ = valadoc_content_content_element_copy ((ValadocContentContentElement*) _tmp13_, (ValadocContentContentElement*) _tmp14_);
630 _tmp16_ = VALADOC_CONTENT_IS_INLINE (_tmp15_) ? ((ValadocContentInline*) _tmp15_) : NULL;
631 if (_tmp16_ == NULL) {
632 _g_object_unref0 (_tmp15_);
633 }
634 copy = _tmp16_;
635 _tmp17_ = run;
636 _tmp18_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp17_);
637 _tmp19_ = _tmp18_;
638 _tmp20_ = copy;
639 vala_collection_add ((ValaCollection*) _tmp19_, _tmp20_);
640 _g_object_unref0 (copy);
641 _g_object_unref0 (element);
642 }
643 _vala_iterable_unref0 (_element_list);
644 }
645 result = (ValadocContentContentElement*) run;
646 return result;
647 }
648
649 static void
valadoc_content_run_class_init(ValadocContentRunClass * klass,gpointer klass_data)650 valadoc_content_run_class_init (ValadocContentRunClass * klass,
651 gpointer klass_data)
652 {
653 valadoc_content_run_parent_class = g_type_class_peek_parent (klass);
654 g_type_class_adjust_private_offset (klass, &ValadocContentRun_private_offset);
655 ((ValadocContentContentElementClass *) klass)->check = (void (*) (ValadocContentContentElement*, ValadocApiTree*, ValadocApiNode*, const gchar*, ValadocErrorReporter*, ValadocSettings*)) valadoc_content_run_real_check;
656 ((ValadocContentContentElementClass *) klass)->accept = (void (*) (ValadocContentContentElement*, ValadocContentContentVisitor*)) valadoc_content_run_real_accept;
657 ((ValadocContentContentElementClass *) klass)->copy = (ValadocContentContentElement* (*) (ValadocContentContentElement*, ValadocContentContentElement*)) valadoc_content_run_real_copy;
658 G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_content_run_get_property;
659 G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_content_run_set_property;
660 G_OBJECT_CLASS (klass)->finalize = valadoc_content_run_finalize;
661 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_CONTENT_RUN_STYLE_PROPERTY, valadoc_content_run_properties[VALADOC_CONTENT_RUN_STYLE_PROPERTY] = g_param_spec_enum ("style", "style", "style", VALADOC_CONTENT_RUN_TYPE_STYLE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
662 }
663
664 static void
valadoc_content_run_valadoc_content_inline_interface_init(ValadocContentInlineIface * iface,gpointer iface_data)665 valadoc_content_run_valadoc_content_inline_interface_init (ValadocContentInlineIface * iface,
666 gpointer iface_data)
667 {
668 valadoc_content_run_valadoc_content_inline_parent_iface = g_type_interface_peek_parent (iface);
669 }
670
671 static void
valadoc_content_run_instance_init(ValadocContentRun * self,gpointer klass)672 valadoc_content_run_instance_init (ValadocContentRun * self,
673 gpointer klass)
674 {
675 self->priv = valadoc_content_run_get_instance_private (self);
676 }
677
678 static void
valadoc_content_run_finalize(GObject * obj)679 valadoc_content_run_finalize (GObject * obj)
680 {
681 ValadocContentRun * self;
682 self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_CONTENT_TYPE_RUN, ValadocContentRun);
683 G_OBJECT_CLASS (valadoc_content_run_parent_class)->finalize (obj);
684 }
685
686 static GType
valadoc_content_run_get_type_once(void)687 valadoc_content_run_get_type_once (void)
688 {
689 static const GTypeInfo g_define_type_info = { sizeof (ValadocContentRunClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_content_run_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocContentRun), 0, (GInstanceInitFunc) valadoc_content_run_instance_init, NULL };
690 static const GInterfaceInfo valadoc_content_inline_info = { (GInterfaceInitFunc) valadoc_content_run_valadoc_content_inline_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
691 GType valadoc_content_run_type_id;
692 valadoc_content_run_type_id = g_type_register_static (VALADOC_CONTENT_TYPE_INLINE_CONTENT, "ValadocContentRun", &g_define_type_info, 0);
693 g_type_add_interface_static (valadoc_content_run_type_id, VALADOC_CONTENT_TYPE_INLINE, &valadoc_content_inline_info);
694 ValadocContentRun_private_offset = g_type_add_instance_private (valadoc_content_run_type_id, sizeof (ValadocContentRunPrivate));
695 return valadoc_content_run_type_id;
696 }
697
698 GType
valadoc_content_run_get_type(void)699 valadoc_content_run_get_type (void)
700 {
701 static volatile gsize valadoc_content_run_type_id__volatile = 0;
702 if (g_once_init_enter (&valadoc_content_run_type_id__volatile)) {
703 GType valadoc_content_run_type_id;
704 valadoc_content_run_type_id = valadoc_content_run_get_type_once ();
705 g_once_init_leave (&valadoc_content_run_type_id__volatile, valadoc_content_run_type_id);
706 }
707 return valadoc_content_run_type_id__volatile;
708 }
709
710 static void
_vala_valadoc_content_run_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)711 _vala_valadoc_content_run_get_property (GObject * object,
712 guint property_id,
713 GValue * value,
714 GParamSpec * pspec)
715 {
716 ValadocContentRun * self;
717 self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_CONTENT_TYPE_RUN, ValadocContentRun);
718 switch (property_id) {
719 case VALADOC_CONTENT_RUN_STYLE_PROPERTY:
720 g_value_set_enum (value, valadoc_content_run_get_style (self));
721 break;
722 default:
723 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
724 break;
725 }
726 }
727
728 static void
_vala_valadoc_content_run_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)729 _vala_valadoc_content_run_set_property (GObject * object,
730 guint property_id,
731 const GValue * value,
732 GParamSpec * pspec)
733 {
734 ValadocContentRun * self;
735 self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_CONTENT_TYPE_RUN, ValadocContentRun);
736 switch (property_id) {
737 case VALADOC_CONTENT_RUN_STYLE_PROPERTY:
738 valadoc_content_run_set_style (self, g_value_get_enum (value));
739 break;
740 default:
741 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
742 break;
743 }
744 }
745
746