1 /* tagletdeprecated.c generated by valac, the Vala compiler
2  * generated from tagletdeprecated.vala, do not modify */
3 
4 /* tagletdeprecated.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_TAGLETS_DEPRECATED_0_PROPERTY,
36 	VALADOC_TAGLETS_DEPRECATED_NUM_PROPERTIES
37 };
38 static GParamSpec* valadoc_taglets_deprecated_properties[VALADOC_TAGLETS_DEPRECATED_NUM_PROPERTIES];
39 #define _g_free0(var) (var = (g_free (var), NULL))
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 
43 static gpointer valadoc_taglets_deprecated_parent_class = NULL;
44 static ValadocContentTagletIface * valadoc_taglets_deprecated_valadoc_content_taglet_parent_iface = NULL;
45 static ValadocContentBlockIface * valadoc_taglets_deprecated_valadoc_content_block_parent_iface = NULL;
46 
47 static ValadocRule* valadoc_taglets_deprecated_real_get_parser_rule (ValadocContentTaglet* base,
48                                                               ValadocRule* run_rule);
49 static void valadoc_taglets_deprecated_real_check (ValadocContentContentElement* base,
50                                             ValadocApiTree* api_root,
51                                             ValadocApiNode* container,
52                                             const gchar* file_path,
53                                             ValadocErrorReporter* reporter,
54                                             ValadocSettings* settings);
55 static void valadoc_taglets_deprecated_real_accept (ValadocContentContentElement* base,
56                                              ValadocContentContentVisitor* visitor);
57 static gboolean valadoc_taglets_deprecated_real_is_empty (ValadocContentContentElement* base);
58 static ValadocContentContentElement* valadoc_taglets_deprecated_real_copy (ValadocContentContentElement* base,
59                                                                     ValadocContentContentElement* new_parent);
60 G_GNUC_INTERNAL void valadoc_content_content_element_set_parent (ValadocContentContentElement* self,
61                                                  ValadocContentContentElement* value);
62 G_GNUC_INTERNAL ValadocContentBlockContent* valadoc_content_block_content_construct (GType object_type);
63 static GType valadoc_taglets_deprecated_get_type_once (void);
64 
65 static gpointer
_g_object_ref0(gpointer self)66 _g_object_ref0 (gpointer self)
67 {
68 	return self ? g_object_ref (self) : NULL;
69 }
70 
71 static ValadocRule*
valadoc_taglets_deprecated_real_get_parser_rule(ValadocContentTaglet * base,ValadocRule * run_rule)72 valadoc_taglets_deprecated_real_get_parser_rule (ValadocContentTaglet* base,
73                                                  ValadocRule* run_rule)
74 {
75 	ValadocTagletsDeprecated * self;
76 	ValadocRule* _tmp0_;
77 	ValadocRule* result = NULL;
78 	self = (ValadocTagletsDeprecated*) base;
79 	g_return_val_if_fail (run_rule != NULL, NULL);
80 	_tmp0_ = _g_object_ref0 (run_rule);
81 	result = _tmp0_;
82 	return result;
83 }
84 
85 static void
valadoc_taglets_deprecated_real_check(ValadocContentContentElement * base,ValadocApiTree * api_root,ValadocApiNode * container,const gchar * file_path,ValadocErrorReporter * reporter,ValadocSettings * settings)86 valadoc_taglets_deprecated_real_check (ValadocContentContentElement* base,
87                                        ValadocApiTree* api_root,
88                                        ValadocApiNode* container,
89                                        const gchar* file_path,
90                                        ValadocErrorReporter* reporter,
91                                        ValadocSettings* settings)
92 {
93 	ValadocTagletsDeprecated * self;
94 	gchar* _tmp0_;
95 	gchar* _tmp1_;
96 	gchar* _tmp2_;
97 	gchar* _tmp3_;
98 	self = (ValadocTagletsDeprecated*) base;
99 	g_return_if_fail (api_root != NULL);
100 	g_return_if_fail (container != NULL);
101 	g_return_if_fail (file_path != NULL);
102 	g_return_if_fail (reporter != NULL);
103 	g_return_if_fail (settings != NULL);
104 	VALADOC_CONTENT_CONTENT_ELEMENT_CLASS (valadoc_taglets_deprecated_parent_class)->check ((ValadocContentContentElement*) G_TYPE_CHECK_INSTANCE_CAST (self, VALADOC_CONTENT_TYPE_BLOCK_CONTENT, ValadocContentBlockContent), api_root, container, file_path, reporter, settings);
105 	_tmp0_ = valadoc_api_node_get_full_name (container);
106 	_tmp1_ = _tmp0_;
107 	_tmp2_ = g_strdup_printf ("%s: %s: @deprecated", file_path, _tmp1_);
108 	_tmp3_ = _tmp2_;
109 	valadoc_error_reporter_simple_warning (reporter, _tmp3_, "@deprecated is deprecated. Use [Version (deprecated = true)]");
110 	_g_free0 (_tmp3_);
111 	_g_free0 (_tmp1_);
112 }
113 
114 static void
valadoc_taglets_deprecated_real_accept(ValadocContentContentElement * base,ValadocContentContentVisitor * visitor)115 valadoc_taglets_deprecated_real_accept (ValadocContentContentElement* base,
116                                         ValadocContentContentVisitor* visitor)
117 {
118 	ValadocTagletsDeprecated * self;
119 	self = (ValadocTagletsDeprecated*) base;
120 	g_return_if_fail (visitor != NULL);
121 	valadoc_content_content_visitor_visit_taglet (visitor, (ValadocContentTaglet*) self);
122 }
123 
124 static gboolean
valadoc_taglets_deprecated_real_is_empty(ValadocContentContentElement * base)125 valadoc_taglets_deprecated_real_is_empty (ValadocContentContentElement* base)
126 {
127 	ValadocTagletsDeprecated * self;
128 	gboolean result = FALSE;
129 	self = (ValadocTagletsDeprecated*) base;
130 	result = FALSE;
131 	return result;
132 }
133 
134 static gpointer
_vala_iterable_ref0(gpointer self)135 _vala_iterable_ref0 (gpointer self)
136 {
137 	return self ? vala_iterable_ref (self) : NULL;
138 }
139 
140 static ValadocContentContentElement*
valadoc_taglets_deprecated_real_copy(ValadocContentContentElement * base,ValadocContentContentElement * new_parent)141 valadoc_taglets_deprecated_real_copy (ValadocContentContentElement* base,
142                                       ValadocContentContentElement* new_parent)
143 {
144 	ValadocTagletsDeprecated * self;
145 	ValadocTagletsDeprecated* deprecated = NULL;
146 	ValadocTagletsDeprecated* _tmp0_;
147 	ValadocTagletsDeprecated* _tmp1_;
148 	ValadocContentContentElement* result = NULL;
149 	self = (ValadocTagletsDeprecated*) base;
150 	_tmp0_ = valadoc_taglets_deprecated_new ();
151 	deprecated = _tmp0_;
152 	_tmp1_ = deprecated;
153 	valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp1_, new_parent);
154 	{
155 		ValaList* _element_list = NULL;
156 		ValaList* _tmp2_;
157 		ValaList* _tmp3_;
158 		ValaList* _tmp4_;
159 		gint _element_size = 0;
160 		ValaList* _tmp5_;
161 		gint _tmp6_;
162 		gint _tmp7_;
163 		gint _element_index = 0;
164 		_tmp2_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) self);
165 		_tmp3_ = _tmp2_;
166 		_tmp4_ = _vala_iterable_ref0 (_tmp3_);
167 		_element_list = _tmp4_;
168 		_tmp5_ = _element_list;
169 		_tmp6_ = vala_collection_get_size ((ValaCollection*) _tmp5_);
170 		_tmp7_ = _tmp6_;
171 		_element_size = _tmp7_;
172 		_element_index = -1;
173 		while (TRUE) {
174 			gint _tmp8_;
175 			gint _tmp9_;
176 			ValadocContentBlock* element = NULL;
177 			ValaList* _tmp10_;
178 			gpointer _tmp11_;
179 			ValadocContentBlock* copy = NULL;
180 			ValadocContentBlock* _tmp12_;
181 			ValadocTagletsDeprecated* _tmp13_;
182 			ValadocContentContentElement* _tmp14_;
183 			ValadocContentBlock* _tmp15_;
184 			ValadocTagletsDeprecated* _tmp16_;
185 			ValaList* _tmp17_;
186 			ValaList* _tmp18_;
187 			ValadocContentBlock* _tmp19_;
188 			_element_index = _element_index + 1;
189 			_tmp8_ = _element_index;
190 			_tmp9_ = _element_size;
191 			if (!(_tmp8_ < _tmp9_)) {
192 				break;
193 			}
194 			_tmp10_ = _element_list;
195 			_tmp11_ = vala_list_get (_tmp10_, _element_index);
196 			element = (ValadocContentBlock*) _tmp11_;
197 			_tmp12_ = element;
198 			_tmp13_ = deprecated;
199 			_tmp14_ = valadoc_content_content_element_copy ((ValadocContentContentElement*) _tmp12_, (ValadocContentContentElement*) _tmp13_);
200 			_tmp15_ = VALADOC_CONTENT_IS_BLOCK (_tmp14_) ? ((ValadocContentBlock*) _tmp14_) : NULL;
201 			if (_tmp15_ == NULL) {
202 				_g_object_unref0 (_tmp14_);
203 			}
204 			copy = _tmp15_;
205 			_tmp16_ = deprecated;
206 			_tmp17_ = valadoc_content_block_content_get_content ((ValadocContentBlockContent*) _tmp16_);
207 			_tmp18_ = _tmp17_;
208 			_tmp19_ = copy;
209 			vala_collection_add ((ValaCollection*) _tmp18_, _tmp19_);
210 			_g_object_unref0 (copy);
211 			_g_object_unref0 (element);
212 		}
213 		_vala_iterable_unref0 (_element_list);
214 	}
215 	result = (ValadocContentContentElement*) deprecated;
216 	return result;
217 }
218 
219 ValadocTagletsDeprecated*
valadoc_taglets_deprecated_construct(GType object_type)220 valadoc_taglets_deprecated_construct (GType object_type)
221 {
222 	ValadocTagletsDeprecated * self = NULL;
223 	self = (ValadocTagletsDeprecated*) valadoc_content_block_content_construct (object_type);
224 	return self;
225 }
226 
227 ValadocTagletsDeprecated*
valadoc_taglets_deprecated_new(void)228 valadoc_taglets_deprecated_new (void)
229 {
230 	return valadoc_taglets_deprecated_construct (VALADOC_TAGLETS_TYPE_DEPRECATED);
231 }
232 
233 static void
valadoc_taglets_deprecated_class_init(ValadocTagletsDeprecatedClass * klass,gpointer klass_data)234 valadoc_taglets_deprecated_class_init (ValadocTagletsDeprecatedClass * klass,
235                                        gpointer klass_data)
236 {
237 	valadoc_taglets_deprecated_parent_class = g_type_class_peek_parent (klass);
238 	((ValadocContentContentElementClass *) klass)->check = (void (*) (ValadocContentContentElement*, ValadocApiTree*, ValadocApiNode*, const gchar*, ValadocErrorReporter*, ValadocSettings*)) valadoc_taglets_deprecated_real_check;
239 	((ValadocContentContentElementClass *) klass)->accept = (void (*) (ValadocContentContentElement*, ValadocContentContentVisitor*)) valadoc_taglets_deprecated_real_accept;
240 	((ValadocContentContentElementClass *) klass)->is_empty = (gboolean (*) (ValadocContentContentElement*)) valadoc_taglets_deprecated_real_is_empty;
241 	((ValadocContentContentElementClass *) klass)->copy = (ValadocContentContentElement* (*) (ValadocContentContentElement*, ValadocContentContentElement*)) valadoc_taglets_deprecated_real_copy;
242 }
243 
244 static void
valadoc_taglets_deprecated_valadoc_content_taglet_interface_init(ValadocContentTagletIface * iface,gpointer iface_data)245 valadoc_taglets_deprecated_valadoc_content_taglet_interface_init (ValadocContentTagletIface * iface,
246                                                                   gpointer iface_data)
247 {
248 	valadoc_taglets_deprecated_valadoc_content_taglet_parent_iface = g_type_interface_peek_parent (iface);
249 	iface->get_parser_rule = (ValadocRule* (*) (ValadocContentTaglet*, ValadocRule*)) valadoc_taglets_deprecated_real_get_parser_rule;
250 }
251 
252 static void
valadoc_taglets_deprecated_valadoc_content_block_interface_init(ValadocContentBlockIface * iface,gpointer iface_data)253 valadoc_taglets_deprecated_valadoc_content_block_interface_init (ValadocContentBlockIface * iface,
254                                                                  gpointer iface_data)
255 {
256 	valadoc_taglets_deprecated_valadoc_content_block_parent_iface = g_type_interface_peek_parent (iface);
257 }
258 
259 static void
valadoc_taglets_deprecated_instance_init(ValadocTagletsDeprecated * self,gpointer klass)260 valadoc_taglets_deprecated_instance_init (ValadocTagletsDeprecated * self,
261                                           gpointer klass)
262 {
263 }
264 
265 static GType
valadoc_taglets_deprecated_get_type_once(void)266 valadoc_taglets_deprecated_get_type_once (void)
267 {
268 	static const GTypeInfo g_define_type_info = { sizeof (ValadocTagletsDeprecatedClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_taglets_deprecated_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocTagletsDeprecated), 0, (GInstanceInitFunc) valadoc_taglets_deprecated_instance_init, NULL };
269 	static const GInterfaceInfo valadoc_content_taglet_info = { (GInterfaceInitFunc) valadoc_taglets_deprecated_valadoc_content_taglet_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
270 	static const GInterfaceInfo valadoc_content_block_info = { (GInterfaceInitFunc) valadoc_taglets_deprecated_valadoc_content_block_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
271 	GType valadoc_taglets_deprecated_type_id;
272 	valadoc_taglets_deprecated_type_id = g_type_register_static (VALADOC_CONTENT_TYPE_BLOCK_CONTENT, "ValadocTagletsDeprecated", &g_define_type_info, 0);
273 	g_type_add_interface_static (valadoc_taglets_deprecated_type_id, VALADOC_CONTENT_TYPE_TAGLET, &valadoc_content_taglet_info);
274 	g_type_add_interface_static (valadoc_taglets_deprecated_type_id, VALADOC_CONTENT_TYPE_BLOCK, &valadoc_content_block_info);
275 	return valadoc_taglets_deprecated_type_id;
276 }
277 
278 GType
valadoc_taglets_deprecated_get_type(void)279 valadoc_taglets_deprecated_get_type (void)
280 {
281 	static volatile gsize valadoc_taglets_deprecated_type_id__volatile = 0;
282 	if (g_once_init_enter (&valadoc_taglets_deprecated_type_id__volatile)) {
283 		GType valadoc_taglets_deprecated_type_id;
284 		valadoc_taglets_deprecated_type_id = valadoc_taglets_deprecated_get_type_once ();
285 		g_once_init_leave (&valadoc_taglets_deprecated_type_id__volatile, valadoc_taglets_deprecated_type_id);
286 	}
287 	return valadoc_taglets_deprecated_type_id__volatile;
288 }
289 
290