1 /* tagletthrows.c generated by valac, the Vala compiler
2 * generated from tagletthrows.vala, do not modify */
3
4 /* tagletthrows.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 <glib-object.h>
32 #include <valagee.h>
33
34 enum {
35 VALADOC_TAGLETS_THROWS_0_PROPERTY,
36 VALADOC_TAGLETS_THROWS_ERROR_DOMAIN_NAME_PROPERTY,
37 VALADOC_TAGLETS_THROWS_ERROR_DOMAIN_PROPERTY,
38 VALADOC_TAGLETS_THROWS_NUM_PROPERTIES
39 };
40 static GParamSpec* valadoc_taglets_throws_properties[VALADOC_TAGLETS_THROWS_NUM_PROPERTIES];
41 #define _g_free0(var) (var = (g_free (var), NULL))
42 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
43 #define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
44
45 struct _ValadocTagletsThrowsPrivate {
46 gchar* _error_domain_name;
47 ValadocApiNode* _error_domain;
48 };
49
50 static gint ValadocTagletsThrows_private_offset;
51 static gpointer valadoc_taglets_throws_parent_class = NULL;
52 static ValadocContentTagletIface * valadoc_taglets_throws_valadoc_content_taglet_parent_iface = NULL;
53 static ValadocContentBlockIface * valadoc_taglets_throws_valadoc_content_block_parent_iface = NULL;
54
55 static void valadoc_taglets_throws_set_error_domain_name (ValadocTagletsThrows* self,
56 const gchar* value);
57 static void valadoc_taglets_throws_set_error_domain (ValadocTagletsThrows* self,
58 ValadocApiNode* value);
59 static ValadocRule* valadoc_taglets_throws_real_get_parser_rule (ValadocContentTaglet* base,
60 ValadocRule* run_rule);
61 static void __lambda130_ (ValadocTagletsThrows* self,
62 ValadocToken* token,
63 GError** error);
64 static void ___lambda130__valadoc_token_type_action (ValadocToken* token,
65 gpointer self,
66 GError** error);
67 static void valadoc_taglets_throws_real_check (ValadocContentContentElement* base,
68 ValadocApiTree* api_root,
69 ValadocApiNode* container,
70 const gchar* file_path,
71 ValadocErrorReporter* reporter,
72 ValadocSettings* settings);
73 static void valadoc_taglets_throws_real_accept (ValadocContentContentElement* base,
74 ValadocContentContentVisitor* visitor);
75 static ValaList* valadoc_taglets_throws_real_get_inheritable_documentation (ValadocContentTaglet* base);
76 static gboolean valadoc_taglets_throws_real_inheritable (ValadocContentTaglet* base,
77 ValadocContentTaglet* taglet);
78 static ValadocContentContentElement* valadoc_taglets_throws_real_copy (ValadocContentContentElement* base,
79 ValadocContentContentElement* new_parent);
80 G_GNUC_INTERNAL void valadoc_content_content_element_set_parent (ValadocContentContentElement* self,
81 ValadocContentContentElement* value);
82 G_GNUC_INTERNAL ValadocContentBlockContent* valadoc_content_block_content_construct (GType object_type);
83 static void valadoc_taglets_throws_finalize (GObject * obj);
84 static GType valadoc_taglets_throws_get_type_once (void);
85 static void _vala_valadoc_taglets_throws_get_property (GObject * object,
86 guint property_id,
87 GValue * value,
88 GParamSpec * pspec);
89 static void _vala_valadoc_taglets_throws_set_property (GObject * object,
90 guint property_id,
91 const GValue * value,
92 GParamSpec * pspec);
93 static void _vala_array_destroy (gpointer array,
94 gint array_length,
95 GDestroyNotify destroy_func);
96 static void _vala_array_free (gpointer array,
97 gint array_length,
98 GDestroyNotify destroy_func);
99
100 static inline gpointer
valadoc_taglets_throws_get_instance_private(ValadocTagletsThrows * self)101 valadoc_taglets_throws_get_instance_private (ValadocTagletsThrows* self)
102 {
103 return G_STRUCT_MEMBER_P (self, ValadocTagletsThrows_private_offset);
104 }
105
106 const gchar*
valadoc_taglets_throws_get_error_domain_name(ValadocTagletsThrows * self)107 valadoc_taglets_throws_get_error_domain_name (ValadocTagletsThrows* self)
108 {
109 const gchar* result;
110 const gchar* _tmp0_;
111 g_return_val_if_fail (self != NULL, NULL);
112 _tmp0_ = self->priv->_error_domain_name;
113 result = _tmp0_;
114 return result;
115 }
116
117 static void
valadoc_taglets_throws_set_error_domain_name(ValadocTagletsThrows * self,const gchar * value)118 valadoc_taglets_throws_set_error_domain_name (ValadocTagletsThrows* self,
119 const gchar* value)
120 {
121 gchar* old_value;
122 g_return_if_fail (self != NULL);
123 old_value = valadoc_taglets_throws_get_error_domain_name (self);
124 if (g_strcmp0 (value, old_value) != 0) {
125 gchar* _tmp0_;
126 _tmp0_ = g_strdup (value);
127 _g_free0 (self->priv->_error_domain_name);
128 self->priv->_error_domain_name = _tmp0_;
129 g_object_notify_by_pspec ((GObject *) self, valadoc_taglets_throws_properties[VALADOC_TAGLETS_THROWS_ERROR_DOMAIN_NAME_PROPERTY]);
130 }
131 }
132
133 ValadocApiNode*
valadoc_taglets_throws_get_error_domain(ValadocTagletsThrows * self)134 valadoc_taglets_throws_get_error_domain (ValadocTagletsThrows* self)
135 {
136 ValadocApiNode* result;
137 ValadocApiNode* _tmp0_;
138 g_return_val_if_fail (self != NULL, NULL);
139 _tmp0_ = self->priv->_error_domain;
140 result = _tmp0_;
141 return result;
142 }
143
144 static gpointer
_g_object_ref0(gpointer self)145 _g_object_ref0 (gpointer self)
146 {
147 return self ? g_object_ref (self) : NULL;
148 }
149
150 static void
valadoc_taglets_throws_set_error_domain(ValadocTagletsThrows * self,ValadocApiNode * value)151 valadoc_taglets_throws_set_error_domain (ValadocTagletsThrows* self,
152 ValadocApiNode* value)
153 {
154 ValadocApiNode* old_value;
155 g_return_if_fail (self != NULL);
156 old_value = valadoc_taglets_throws_get_error_domain (self);
157 if (old_value != value) {
158 ValadocApiNode* _tmp0_;
159 _tmp0_ = _g_object_ref0 (value);
160 _g_object_unref0 (self->priv->_error_domain);
161 self->priv->_error_domain = _tmp0_;
162 g_object_notify_by_pspec ((GObject *) self, valadoc_taglets_throws_properties[VALADOC_TAGLETS_THROWS_ERROR_DOMAIN_PROPERTY]);
163 }
164 }
165
166 static void
__lambda130_(ValadocTagletsThrows * self,ValadocToken * token,GError ** error)167 __lambda130_ (ValadocTagletsThrows* self,
168 ValadocToken* token,
169 GError** error)
170 {
171 const gchar* _tmp0_;
172 g_return_if_fail (token != NULL);
173 _tmp0_ = valadoc_token_to_string (token);
174 valadoc_taglets_throws_set_error_domain_name (self, _tmp0_);
175 }
176
177 static void
___lambda130__valadoc_token_type_action(ValadocToken * token,gpointer self,GError ** error)178 ___lambda130__valadoc_token_type_action (ValadocToken* token,
179 gpointer self,
180 GError** error)
181 {
182 __lambda130_ ((ValadocTagletsThrows*) self, token, error);
183 }
184
185 static ValadocRule*
valadoc_taglets_throws_real_get_parser_rule(ValadocContentTaglet * base,ValadocRule * run_rule)186 valadoc_taglets_throws_real_get_parser_rule (ValadocContentTaglet* base,
187 ValadocRule* run_rule)
188 {
189 ValadocTagletsThrows * self;
190 ValadocTokenType* _tmp0_;
191 GObject* _tmp1_;
192 GObject** _tmp2_;
193 GObject** _tmp3_;
194 gint _tmp3__length1;
195 ValadocRule* _tmp4_;
196 GObject** _tmp5_;
197 GObject** _tmp6_;
198 gint _tmp6__length1;
199 ValadocRule* _tmp7_;
200 ValadocTokenType* _tmp8_;
201 ValadocTokenType* _tmp9_;
202 ValadocTokenType* _tmp10_;
203 GObject* _tmp11_;
204 GObject** _tmp12_;
205 GObject** _tmp13_;
206 gint _tmp13__length1;
207 ValadocRule* _tmp14_;
208 ValadocRule* _tmp15_;
209 ValadocRule* result = NULL;
210 self = (ValadocTagletsThrows*) base;
211 g_return_val_if_fail (run_rule != NULL, NULL);
212 _tmp0_ = valadoc_token_type_SPACE;
213 _tmp1_ = _g_object_ref0 ((GObject*) _tmp0_);
214 _tmp2_ = g_new0 (GObject*, 1 + 1);
215 _tmp2_[0] = _tmp1_;
216 _tmp3_ = _tmp2_;
217 _tmp3__length1 = 1;
218 _tmp4_ = valadoc_rule_many (_tmp3_, (gint) 1);
219 _tmp5_ = g_new0 (GObject*, 1 + 1);
220 _tmp5_[0] = (GObject*) _tmp4_;
221 _tmp6_ = _tmp5_;
222 _tmp6__length1 = 1;
223 _tmp7_ = valadoc_rule_option (_tmp6_, (gint) 1);
224 _tmp8_ = valadoc_token_type_any_word ();
225 _tmp9_ = _tmp8_;
226 _tmp10_ = valadoc_token_type_action (_tmp9_, ___lambda130__valadoc_token_type_action, self);
227 _tmp11_ = _g_object_ref0 ((GObject*) run_rule);
228 _tmp12_ = g_new0 (GObject*, 3 + 1);
229 _tmp12_[0] = (GObject*) _tmp7_;
230 _tmp12_[1] = (GObject*) _tmp10_;
231 _tmp12_[2] = _tmp11_;
232 _tmp13_ = _tmp12_;
233 _tmp13__length1 = 3;
234 _tmp14_ = valadoc_rule_seq (_tmp13_, (gint) 3);
235 _tmp15_ = _tmp14_;
236 _tmp13_ = (_vala_array_free (_tmp13_, _tmp13__length1, (GDestroyNotify) g_object_unref), NULL);
237 _g_object_unref0 (_tmp9_);
238 _tmp6_ = (_vala_array_free (_tmp6_, _tmp6__length1, (GDestroyNotify) g_object_unref), NULL);
239 _tmp3_ = (_vala_array_free (_tmp3_, _tmp3__length1, (GDestroyNotify) g_object_unref), NULL);
240 result = _tmp15_;
241 return result;
242 }
243
244 static gpointer
_vala_iterable_ref0(gpointer self)245 _vala_iterable_ref0 (gpointer self)
246 {
247 return self ? vala_iterable_ref (self) : NULL;
248 }
249
250 static void
valadoc_taglets_throws_real_check(ValadocContentContentElement * base,ValadocApiTree * api_root,ValadocApiNode * container,const gchar * file_path,ValadocErrorReporter * reporter,ValadocSettings * settings)251 valadoc_taglets_throws_real_check (ValadocContentContentElement* base,
252 ValadocApiTree* api_root,
253 ValadocApiNode* container,
254 const gchar* file_path,
255 ValadocErrorReporter* reporter,
256 ValadocSettings* settings)
257 {
258 ValadocTagletsThrows * self;
259 gboolean _tmp0_ = FALSE;
260 const gchar* _tmp5_;
261 ValadocApiNode* _tmp6_;
262 ValadocApiNode* _tmp7_;
263 ValadocApiNode* _tmp8_;
264 ValaList* exceptions = NULL;
265 ValadocApiNodeType* _tmp14_;
266 ValadocApiNodeType* _tmp15_;
267 gint _tmp15__length1;
268 ValaList* _tmp16_;
269 ValaList* _tmp17_;
270 ValadocApiItem* _tmp18_ = NULL;
271 ValadocApiNode* _tmp19_;
272 ValadocApiItem* expected_error_domain = NULL;
273 ValadocApiItem* _tmp24_;
274 gboolean report_warning = FALSE;
275 self = (ValadocTagletsThrows*) base;
276 g_return_if_fail (api_root != NULL);
277 g_return_if_fail (container != NULL);
278 g_return_if_fail (file_path != NULL);
279 g_return_if_fail (reporter != NULL);
280 g_return_if_fail (settings != NULL);
281 if (VALADOC_API_IS_METHOD (container) == FALSE) {
282 _tmp0_ = VALADOC_API_IS_DELEGATE (container) == FALSE;
283 } else {
284 _tmp0_ = FALSE;
285 }
286 if (_tmp0_) {
287 gchar* _tmp1_;
288 gchar* _tmp2_;
289 gchar* _tmp3_;
290 gchar* _tmp4_;
291 _tmp1_ = valadoc_api_node_get_full_name (container);
292 _tmp2_ = _tmp1_;
293 _tmp3_ = g_strdup_printf ("%s: %s: @throws", file_path, _tmp2_);
294 _tmp4_ = _tmp3_;
295 valadoc_error_reporter_simple_warning (reporter, _tmp4_, "@throws used outside method/delegate context");
296 _g_free0 (_tmp4_);
297 _g_free0 (_tmp2_);
298 VALADOC_CONTENT_CONTENT_ELEMENT_CLASS (valadoc_taglets_throws_parent_class)->check ((ValadocContentContentElement*) G_TYPE_CHECK_INSTANCE_CAST (self, VALADOC_CONTENT_TYPE_BLOCK_CONTENT, ValadocContentBlockContent), api_root, container, file_path, reporter, settings);
299 return;
300 }
301 _tmp5_ = self->priv->_error_domain_name;
302 _tmp6_ = valadoc_api_tree_search_symbol_str (api_root, container, _tmp5_);
303 _tmp7_ = _tmp6_;
304 valadoc_taglets_throws_set_error_domain (self, _tmp7_);
305 _g_object_unref0 (_tmp7_);
306 _tmp8_ = self->priv->_error_domain;
307 if (_tmp8_ == NULL) {
308 gchar* _tmp9_;
309 gchar* _tmp10_;
310 gchar* _tmp11_;
311 gchar* _tmp12_;
312 const gchar* _tmp13_;
313 _tmp9_ = valadoc_api_node_get_full_name (container);
314 _tmp10_ = _tmp9_;
315 _tmp11_ = g_strdup_printf ("%s: %s: @throws", file_path, _tmp10_);
316 _tmp12_ = _tmp11_;
317 _tmp13_ = self->priv->_error_domain_name;
318 valadoc_error_reporter_simple_error (reporter, _tmp12_, "`%s' does not exist", _tmp13_);
319 _g_free0 (_tmp12_);
320 _g_free0 (_tmp10_);
321 VALADOC_CONTENT_CONTENT_ELEMENT_CLASS (valadoc_taglets_throws_parent_class)->check ((ValadocContentContentElement*) G_TYPE_CHECK_INSTANCE_CAST (self, VALADOC_CONTENT_TYPE_BLOCK_CONTENT, ValadocContentBlockContent), api_root, container, file_path, reporter, settings);
322 return;
323 }
324 _tmp14_ = g_new0 (ValadocApiNodeType, 2);
325 _tmp14_[0] = VALADOC_API_NODE_TYPE_ERROR_DOMAIN;
326 _tmp14_[1] = VALADOC_API_NODE_TYPE_CLASS;
327 _tmp15_ = _tmp14_;
328 _tmp15__length1 = 2;
329 _tmp16_ = valadoc_api_node_get_children_by_types (container, _tmp15_, (gint) 2, FALSE);
330 _tmp17_ = _tmp16_;
331 _tmp15_ = (g_free (_tmp15_), NULL);
332 exceptions = _tmp17_;
333 _tmp19_ = self->priv->_error_domain;
334 if (VALADOC_API_IS_ERROR_CODE (_tmp19_)) {
335 ValadocApiNode* _tmp20_;
336 ValadocApiItem* _tmp21_;
337 ValadocApiItem* _tmp22_;
338 _tmp20_ = self->priv->_error_domain;
339 _tmp21_ = valadoc_api_item_get_parent ((ValadocApiItem*) _tmp20_);
340 _tmp22_ = _tmp21_;
341 _tmp18_ = _tmp22_;
342 } else {
343 ValadocApiNode* _tmp23_;
344 _tmp23_ = self->priv->_error_domain;
345 _tmp18_ = (ValadocApiItem*) _tmp23_;
346 }
347 _tmp24_ = _g_object_ref0 (_tmp18_);
348 expected_error_domain = _tmp24_;
349 report_warning = TRUE;
350 {
351 ValaList* _exception_list = NULL;
352 ValaList* _tmp25_;
353 ValaList* _tmp26_;
354 gint _exception_size = 0;
355 ValaList* _tmp27_;
356 gint _tmp28_;
357 gint _tmp29_;
358 gint _exception_index = 0;
359 _tmp25_ = exceptions;
360 _tmp26_ = _vala_iterable_ref0 (_tmp25_);
361 _exception_list = _tmp26_;
362 _tmp27_ = _exception_list;
363 _tmp28_ = vala_collection_get_size ((ValaCollection*) _tmp27_);
364 _tmp29_ = _tmp28_;
365 _exception_size = _tmp29_;
366 _exception_index = -1;
367 while (TRUE) {
368 gint _tmp30_;
369 gint _tmp31_;
370 ValadocApiNode* exception = NULL;
371 ValaList* _tmp32_;
372 gpointer _tmp33_;
373 gboolean _tmp34_ = FALSE;
374 ValadocApiNode* _tmp35_;
375 ValadocApiItem* _tmp36_;
376 _exception_index = _exception_index + 1;
377 _tmp30_ = _exception_index;
378 _tmp31_ = _exception_size;
379 if (!(_tmp30_ < _tmp31_)) {
380 break;
381 }
382 _tmp32_ = _exception_list;
383 _tmp33_ = vala_list_get (_tmp32_, _exception_index);
384 exception = (ValadocApiNode*) _tmp33_;
385 _tmp35_ = exception;
386 _tmp36_ = expected_error_domain;
387 if (G_TYPE_CHECK_INSTANCE_CAST (_tmp35_, VALADOC_API_TYPE_ITEM, ValadocApiItem) == _tmp36_) {
388 _tmp34_ = TRUE;
389 } else {
390 gboolean _tmp37_ = FALSE;
391 ValadocApiNode* _tmp38_;
392 _tmp38_ = exception;
393 if (VALADOC_API_IS_CLASS (_tmp38_)) {
394 ValadocApiItem* _tmp39_;
395 _tmp39_ = expected_error_domain;
396 _tmp37_ = VALADOC_API_IS_ERROR_DOMAIN (_tmp39_);
397 } else {
398 _tmp37_ = FALSE;
399 }
400 _tmp34_ = _tmp37_;
401 }
402 if (_tmp34_) {
403 report_warning = FALSE;
404 _g_object_unref0 (exception);
405 break;
406 }
407 _g_object_unref0 (exception);
408 }
409 _vala_iterable_unref0 (_exception_list);
410 }
411 if (report_warning) {
412 gchar* _tmp40_;
413 gchar* _tmp41_;
414 gchar* _tmp42_;
415 gchar* _tmp43_;
416 const gchar* _tmp44_;
417 _tmp40_ = valadoc_api_node_get_full_name (container);
418 _tmp41_ = _tmp40_;
419 _tmp42_ = g_strdup_printf ("%s: %s: @throws", file_path, _tmp41_);
420 _tmp43_ = _tmp42_;
421 _tmp44_ = self->priv->_error_domain_name;
422 valadoc_error_reporter_simple_warning (reporter, _tmp43_, "`%s' does not exist in exception list", _tmp44_);
423 _g_free0 (_tmp43_);
424 _g_free0 (_tmp41_);
425 }
426 VALADOC_CONTENT_CONTENT_ELEMENT_CLASS (valadoc_taglets_throws_parent_class)->check ((ValadocContentContentElement*) G_TYPE_CHECK_INSTANCE_CAST (self, VALADOC_CONTENT_TYPE_BLOCK_CONTENT, ValadocContentBlockContent), api_root, container, file_path, reporter, settings);
427 _g_object_unref0 (expected_error_domain);
428 _vala_iterable_unref0 (exceptions);
429 }
430
431 static void
valadoc_taglets_throws_real_accept(ValadocContentContentElement * base,ValadocContentContentVisitor * visitor)432 valadoc_taglets_throws_real_accept (ValadocContentContentElement* base,
433 ValadocContentContentVisitor* visitor)
434 {
435 ValadocTagletsThrows * self;
436 self = (ValadocTagletsThrows*) base;
437 g_return_if_fail (visitor != NULL);
438 valadoc_content_content_visitor_visit_taglet (visitor, (ValadocContentTaglet*) self);
439 }
440
441 static ValaList*
valadoc_taglets_throws_real_get_inheritable_documentation(ValadocContentTaglet * base)442 valadoc_taglets_throws_real_get_inheritable_documentation (ValadocContentTaglet* base)
443 {
444 ValadocTagletsThrows * self;
445 ValaList* _tmp0_;
446 ValaList* _tmp1_;
447 ValaList* _tmp2_;
448 ValaList* result = NULL;
449 self = (ValadocTagletsThrows*) base;
450 _tmp0_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) self);
451 _tmp1_ = _tmp0_;
452 _tmp2_ = _vala_iterable_ref0 (_tmp1_);
453 result = _tmp2_;
454 return result;
455 }
456
457 static gboolean
valadoc_taglets_throws_real_inheritable(ValadocContentTaglet * base,ValadocContentTaglet * taglet)458 valadoc_taglets_throws_real_inheritable (ValadocContentTaglet* base,
459 ValadocContentTaglet* taglet)
460 {
461 ValadocTagletsThrows * self;
462 ValadocTagletsThrows* t = NULL;
463 ValadocTagletsThrows* _tmp0_;
464 gboolean _tmp1_ = FALSE;
465 ValadocApiNode* _tmp2_;
466 ValadocTagletsThrows* _tmp3_;
467 ValadocApiNode* _tmp4_;
468 gboolean result = FALSE;
469 self = (ValadocTagletsThrows*) base;
470 g_return_val_if_fail (taglet != NULL, FALSE);
471 if (VALADOC_TAGLETS_IS_THROWS (taglet) == FALSE) {
472 result = FALSE;
473 return result;
474 }
475 _tmp0_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (taglet, VALADOC_TAGLETS_TYPE_THROWS, ValadocTagletsThrows));
476 t = _tmp0_;
477 _tmp2_ = self->priv->_error_domain;
478 _tmp3_ = t;
479 _tmp4_ = _tmp3_->priv->_error_domain;
480 if (_tmp2_ == _tmp4_) {
481 _tmp1_ = TRUE;
482 } else {
483 const gchar* _tmp5_;
484 ValadocTagletsThrows* _tmp6_;
485 const gchar* _tmp7_;
486 _tmp5_ = self->priv->_error_domain_name;
487 _tmp6_ = t;
488 _tmp7_ = _tmp6_->priv->_error_domain_name;
489 _tmp1_ = g_strcmp0 (_tmp5_, _tmp7_) == 0;
490 }
491 result = _tmp1_;
492 _g_object_unref0 (t);
493 return result;
494 }
495
496 static ValadocContentContentElement*
valadoc_taglets_throws_real_copy(ValadocContentContentElement * base,ValadocContentContentElement * new_parent)497 valadoc_taglets_throws_real_copy (ValadocContentContentElement* base,
498 ValadocContentContentElement* new_parent)
499 {
500 ValadocTagletsThrows * self;
501 ValadocTagletsThrows* tr = NULL;
502 ValadocTagletsThrows* _tmp0_;
503 ValadocTagletsThrows* _tmp1_;
504 ValadocTagletsThrows* _tmp2_;
505 const gchar* _tmp3_;
506 ValadocTagletsThrows* _tmp4_;
507 ValadocApiNode* _tmp5_;
508 ValadocContentContentElement* result = NULL;
509 self = (ValadocTagletsThrows*) base;
510 _tmp0_ = valadoc_taglets_throws_new ();
511 tr = _tmp0_;
512 _tmp1_ = tr;
513 valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp1_, new_parent);
514 _tmp2_ = tr;
515 _tmp3_ = self->priv->_error_domain_name;
516 valadoc_taglets_throws_set_error_domain_name (_tmp2_, _tmp3_);
517 _tmp4_ = tr;
518 _tmp5_ = self->priv->_error_domain;
519 valadoc_taglets_throws_set_error_domain (_tmp4_, _tmp5_);
520 {
521 ValaList* _element_list = NULL;
522 ValaList* _tmp6_;
523 ValaList* _tmp7_;
524 ValaList* _tmp8_;
525 gint _element_size = 0;
526 ValaList* _tmp9_;
527 gint _tmp10_;
528 gint _tmp11_;
529 gint _element_index = 0;
530 _tmp6_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) self);
531 _tmp7_ = _tmp6_;
532 _tmp8_ = _vala_iterable_ref0 (_tmp7_);
533 _element_list = _tmp8_;
534 _tmp9_ = _element_list;
535 _tmp10_ = vala_collection_get_size ((ValaCollection*) _tmp9_);
536 _tmp11_ = _tmp10_;
537 _element_size = _tmp11_;
538 _element_index = -1;
539 while (TRUE) {
540 gint _tmp12_;
541 gint _tmp13_;
542 ValadocContentBlock* element = NULL;
543 ValaList* _tmp14_;
544 gpointer _tmp15_;
545 ValadocContentBlock* copy = NULL;
546 ValadocContentBlock* _tmp16_;
547 ValadocTagletsThrows* _tmp17_;
548 ValadocContentContentElement* _tmp18_;
549 ValadocContentBlock* _tmp19_;
550 ValadocTagletsThrows* _tmp20_;
551 ValaList* _tmp21_;
552 ValaList* _tmp22_;
553 ValadocContentBlock* _tmp23_;
554 _element_index = _element_index + 1;
555 _tmp12_ = _element_index;
556 _tmp13_ = _element_size;
557 if (!(_tmp12_ < _tmp13_)) {
558 break;
559 }
560 _tmp14_ = _element_list;
561 _tmp15_ = vala_list_get (_tmp14_, _element_index);
562 element = (ValadocContentBlock*) _tmp15_;
563 _tmp16_ = element;
564 _tmp17_ = tr;
565 _tmp18_ = valadoc_content_content_element_copy ((ValadocContentContentElement*) _tmp16_, (ValadocContentContentElement*) _tmp17_);
566 _tmp19_ = VALADOC_CONTENT_IS_BLOCK (_tmp18_) ? ((ValadocContentBlock*) _tmp18_) : NULL;
567 if (_tmp19_ == NULL) {
568 _g_object_unref0 (_tmp18_);
569 }
570 copy = _tmp19_;
571 _tmp20_ = tr;
572 _tmp21_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp20_);
573 _tmp22_ = _tmp21_;
574 _tmp23_ = copy;
575 vala_collection_add ((ValaCollection*) _tmp22_, _tmp23_);
576 _g_object_unref0 (copy);
577 _g_object_unref0 (element);
578 }
579 _vala_iterable_unref0 (_element_list);
580 }
581 result = (ValadocContentContentElement*) tr;
582 return result;
583 }
584
585 ValadocTagletsThrows*
valadoc_taglets_throws_construct(GType object_type)586 valadoc_taglets_throws_construct (GType object_type)
587 {
588 ValadocTagletsThrows * self = NULL;
589 self = (ValadocTagletsThrows*) valadoc_content_block_content_construct (object_type);
590 return self;
591 }
592
593 ValadocTagletsThrows*
valadoc_taglets_throws_new(void)594 valadoc_taglets_throws_new (void)
595 {
596 return valadoc_taglets_throws_construct (VALADOC_TAGLETS_TYPE_THROWS);
597 }
598
599 static void
valadoc_taglets_throws_class_init(ValadocTagletsThrowsClass * klass,gpointer klass_data)600 valadoc_taglets_throws_class_init (ValadocTagletsThrowsClass * klass,
601 gpointer klass_data)
602 {
603 valadoc_taglets_throws_parent_class = g_type_class_peek_parent (klass);
604 g_type_class_adjust_private_offset (klass, &ValadocTagletsThrows_private_offset);
605 ((ValadocContentContentElementClass *) klass)->check = (void (*) (ValadocContentContentElement*, ValadocApiTree*, ValadocApiNode*, const gchar*, ValadocErrorReporter*, ValadocSettings*)) valadoc_taglets_throws_real_check;
606 ((ValadocContentContentElementClass *) klass)->accept = (void (*) (ValadocContentContentElement*, ValadocContentContentVisitor*)) valadoc_taglets_throws_real_accept;
607 ((ValadocContentContentElementClass *) klass)->copy = (ValadocContentContentElement* (*) (ValadocContentContentElement*, ValadocContentContentElement*)) valadoc_taglets_throws_real_copy;
608 G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_taglets_throws_get_property;
609 G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_taglets_throws_set_property;
610 G_OBJECT_CLASS (klass)->finalize = valadoc_taglets_throws_finalize;
611 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_TAGLETS_THROWS_ERROR_DOMAIN_NAME_PROPERTY, valadoc_taglets_throws_properties[VALADOC_TAGLETS_THROWS_ERROR_DOMAIN_NAME_PROPERTY] = g_param_spec_string ("error-domain-name", "error-domain-name", "error-domain-name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
612 /**
613 * Thrown Error domain or Error code
614 */
615 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_TAGLETS_THROWS_ERROR_DOMAIN_PROPERTY, valadoc_taglets_throws_properties[VALADOC_TAGLETS_THROWS_ERROR_DOMAIN_PROPERTY] = g_param_spec_object ("error-domain", "error-domain", "error-domain", VALADOC_API_TYPE_NODE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
616 }
617
618 static void
valadoc_taglets_throws_valadoc_content_taglet_interface_init(ValadocContentTagletIface * iface,gpointer iface_data)619 valadoc_taglets_throws_valadoc_content_taglet_interface_init (ValadocContentTagletIface * iface,
620 gpointer iface_data)
621 {
622 valadoc_taglets_throws_valadoc_content_taglet_parent_iface = g_type_interface_peek_parent (iface);
623 iface->get_parser_rule = (ValadocRule* (*) (ValadocContentTaglet*, ValadocRule*)) valadoc_taglets_throws_real_get_parser_rule;
624 iface->get_inheritable_documentation = (ValaList* (*) (ValadocContentTaglet*)) valadoc_taglets_throws_real_get_inheritable_documentation;
625 iface->inheritable = (gboolean (*) (ValadocContentTaglet*, ValadocContentTaglet*)) valadoc_taglets_throws_real_inheritable;
626 }
627
628 static void
valadoc_taglets_throws_valadoc_content_block_interface_init(ValadocContentBlockIface * iface,gpointer iface_data)629 valadoc_taglets_throws_valadoc_content_block_interface_init (ValadocContentBlockIface * iface,
630 gpointer iface_data)
631 {
632 valadoc_taglets_throws_valadoc_content_block_parent_iface = g_type_interface_peek_parent (iface);
633 }
634
635 static void
valadoc_taglets_throws_instance_init(ValadocTagletsThrows * self,gpointer klass)636 valadoc_taglets_throws_instance_init (ValadocTagletsThrows * self,
637 gpointer klass)
638 {
639 self->priv = valadoc_taglets_throws_get_instance_private (self);
640 }
641
642 static void
valadoc_taglets_throws_finalize(GObject * obj)643 valadoc_taglets_throws_finalize (GObject * obj)
644 {
645 ValadocTagletsThrows * self;
646 self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_TAGLETS_TYPE_THROWS, ValadocTagletsThrows);
647 _g_free0 (self->priv->_error_domain_name);
648 _g_object_unref0 (self->priv->_error_domain);
649 G_OBJECT_CLASS (valadoc_taglets_throws_parent_class)->finalize (obj);
650 }
651
652 static GType
valadoc_taglets_throws_get_type_once(void)653 valadoc_taglets_throws_get_type_once (void)
654 {
655 static const GTypeInfo g_define_type_info = { sizeof (ValadocTagletsThrowsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_taglets_throws_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocTagletsThrows), 0, (GInstanceInitFunc) valadoc_taglets_throws_instance_init, NULL };
656 static const GInterfaceInfo valadoc_content_taglet_info = { (GInterfaceInitFunc) valadoc_taglets_throws_valadoc_content_taglet_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
657 static const GInterfaceInfo valadoc_content_block_info = { (GInterfaceInitFunc) valadoc_taglets_throws_valadoc_content_block_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
658 GType valadoc_taglets_throws_type_id;
659 valadoc_taglets_throws_type_id = g_type_register_static (VALADOC_CONTENT_TYPE_BLOCK_CONTENT, "ValadocTagletsThrows", &g_define_type_info, 0);
660 g_type_add_interface_static (valadoc_taglets_throws_type_id, VALADOC_CONTENT_TYPE_TAGLET, &valadoc_content_taglet_info);
661 g_type_add_interface_static (valadoc_taglets_throws_type_id, VALADOC_CONTENT_TYPE_BLOCK, &valadoc_content_block_info);
662 ValadocTagletsThrows_private_offset = g_type_add_instance_private (valadoc_taglets_throws_type_id, sizeof (ValadocTagletsThrowsPrivate));
663 return valadoc_taglets_throws_type_id;
664 }
665
666 GType
valadoc_taglets_throws_get_type(void)667 valadoc_taglets_throws_get_type (void)
668 {
669 static volatile gsize valadoc_taglets_throws_type_id__volatile = 0;
670 if (g_once_init_enter (&valadoc_taglets_throws_type_id__volatile)) {
671 GType valadoc_taglets_throws_type_id;
672 valadoc_taglets_throws_type_id = valadoc_taglets_throws_get_type_once ();
673 g_once_init_leave (&valadoc_taglets_throws_type_id__volatile, valadoc_taglets_throws_type_id);
674 }
675 return valadoc_taglets_throws_type_id__volatile;
676 }
677
678 static void
_vala_valadoc_taglets_throws_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)679 _vala_valadoc_taglets_throws_get_property (GObject * object,
680 guint property_id,
681 GValue * value,
682 GParamSpec * pspec)
683 {
684 ValadocTagletsThrows * self;
685 self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_TAGLETS_TYPE_THROWS, ValadocTagletsThrows);
686 switch (property_id) {
687 case VALADOC_TAGLETS_THROWS_ERROR_DOMAIN_NAME_PROPERTY:
688 g_value_set_string (value, valadoc_taglets_throws_get_error_domain_name (self));
689 break;
690 case VALADOC_TAGLETS_THROWS_ERROR_DOMAIN_PROPERTY:
691 g_value_set_object (value, valadoc_taglets_throws_get_error_domain (self));
692 break;
693 default:
694 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
695 break;
696 }
697 }
698
699 static void
_vala_valadoc_taglets_throws_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)700 _vala_valadoc_taglets_throws_set_property (GObject * object,
701 guint property_id,
702 const GValue * value,
703 GParamSpec * pspec)
704 {
705 ValadocTagletsThrows * self;
706 self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_TAGLETS_TYPE_THROWS, ValadocTagletsThrows);
707 switch (property_id) {
708 case VALADOC_TAGLETS_THROWS_ERROR_DOMAIN_NAME_PROPERTY:
709 valadoc_taglets_throws_set_error_domain_name (self, g_value_get_string (value));
710 break;
711 case VALADOC_TAGLETS_THROWS_ERROR_DOMAIN_PROPERTY:
712 valadoc_taglets_throws_set_error_domain (self, g_value_get_object (value));
713 break;
714 default:
715 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
716 break;
717 }
718 }
719
720 static void
_vala_array_destroy(gpointer array,gint array_length,GDestroyNotify destroy_func)721 _vala_array_destroy (gpointer array,
722 gint array_length,
723 GDestroyNotify destroy_func)
724 {
725 if ((array != NULL) && (destroy_func != NULL)) {
726 gint i;
727 for (i = 0; i < array_length; i = i + 1) {
728 if (((gpointer*) array)[i] != NULL) {
729 destroy_func (((gpointer*) array)[i]);
730 }
731 }
732 }
733 }
734
735 static void
_vala_array_free(gpointer array,gint array_length,GDestroyNotify destroy_func)736 _vala_array_free (gpointer array,
737 gint array_length,
738 GDestroyNotify destroy_func)
739 {
740 _vala_array_destroy (array, array_length, destroy_func);
741 g_free (array);
742 }
743
744