1 /* contentelement.c generated by valac, the Vala compiler
2 * generated from contentelement.vala, do not modify */
3
4 /* contentelement.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
33 enum {
34 VALADOC_CONTENT_CONTENT_ELEMENT_0_PROPERTY,
35 VALADOC_CONTENT_CONTENT_ELEMENT_PARENT_PROPERTY,
36 VALADOC_CONTENT_CONTENT_ELEMENT_NUM_PROPERTIES
37 };
38 static GParamSpec* valadoc_content_content_element_properties[VALADOC_CONTENT_CONTENT_ELEMENT_NUM_PROPERTIES];
39 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
40
41 struct _ValadocContentContentElementPrivate {
42 ValadocContentContentElement* _parent;
43 };
44
45 static gint ValadocContentContentElement_private_offset;
46 static gpointer valadoc_content_content_element_parent_class = NULL;
47
48 G_GNUC_INTERNAL void valadoc_content_content_element_set_parent (ValadocContentContentElement* self,
49 ValadocContentContentElement* value);
50 static ValadocContentContentElement* valadoc_content_content_element_real_copy (ValadocContentContentElement* self,
51 ValadocContentContentElement* new_parent);
52 static void valadoc_content_content_element_real_configure (ValadocContentContentElement* self,
53 ValadocSettings* settings,
54 ValadocResourceLocator* locator);
55 static void valadoc_content_content_element_real_check (ValadocContentContentElement* self,
56 ValadocApiTree* api_root,
57 ValadocApiNode* container,
58 const gchar* file_path,
59 ValadocErrorReporter* reporter,
60 ValadocSettings* settings);
61 static void valadoc_content_content_element_real_accept (ValadocContentContentElement* self,
62 ValadocContentContentVisitor* visitor);
63 static gboolean valadoc_content_content_element_real_is_empty (ValadocContentContentElement* self);
64 static void valadoc_content_content_element_real_accept_children (ValadocContentContentElement* self,
65 ValadocContentContentVisitor* visitor);
66 static void valadoc_content_content_element_finalize (GObject * obj);
67 static GType valadoc_content_content_element_get_type_once (void);
68 static void _vala_valadoc_content_content_element_get_property (GObject * object,
69 guint property_id,
70 GValue * value,
71 GParamSpec * pspec);
72 static void _vala_valadoc_content_content_element_set_property (GObject * object,
73 guint property_id,
74 const GValue * value,
75 GParamSpec * pspec);
76
77 static inline gpointer
valadoc_content_content_element_get_instance_private(ValadocContentContentElement * self)78 valadoc_content_content_element_get_instance_private (ValadocContentContentElement* self)
79 {
80 return G_STRUCT_MEMBER_P (self, ValadocContentContentElement_private_offset);
81 }
82
83 ValadocContentContentElement*
valadoc_content_content_element_get_parent(ValadocContentContentElement * self)84 valadoc_content_content_element_get_parent (ValadocContentContentElement* self)
85 {
86 ValadocContentContentElement* result;
87 ValadocContentContentElement* _tmp0_;
88 g_return_val_if_fail (self != NULL, NULL);
89 _tmp0_ = self->priv->_parent;
90 result = _tmp0_;
91 return result;
92 }
93
94 static gpointer
_g_object_ref0(gpointer self)95 _g_object_ref0 (gpointer self)
96 {
97 return self ? g_object_ref (self) : NULL;
98 }
99
100 G_GNUC_INTERNAL void
valadoc_content_content_element_set_parent(ValadocContentContentElement * self,ValadocContentContentElement * value)101 valadoc_content_content_element_set_parent (ValadocContentContentElement* self,
102 ValadocContentContentElement* value)
103 {
104 ValadocContentContentElement* old_value;
105 g_return_if_fail (self != NULL);
106 old_value = valadoc_content_content_element_get_parent (self);
107 if (old_value != value) {
108 ValadocContentContentElement* _tmp0_;
109 _tmp0_ = _g_object_ref0 (value);
110 _g_object_unref0 (self->priv->_parent);
111 self->priv->_parent = _tmp0_;
112 g_object_notify_by_pspec ((GObject *) self, valadoc_content_content_element_properties[VALADOC_CONTENT_CONTENT_ELEMENT_PARENT_PROPERTY]);
113 }
114 }
115
116 static ValadocContentContentElement*
valadoc_content_content_element_real_copy(ValadocContentContentElement * self,ValadocContentContentElement * new_parent)117 valadoc_content_content_element_real_copy (ValadocContentContentElement* self,
118 ValadocContentContentElement* new_parent)
119 {
120 g_critical ("Type `%s' does not implement abstract method `valadoc_content_content_element_copy'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
121 return NULL;
122 }
123
124 ValadocContentContentElement*
valadoc_content_content_element_copy(ValadocContentContentElement * self,ValadocContentContentElement * new_parent)125 valadoc_content_content_element_copy (ValadocContentContentElement* self,
126 ValadocContentContentElement* new_parent)
127 {
128 g_return_val_if_fail (self != NULL, NULL);
129 return VALADOC_CONTENT_CONTENT_ELEMENT_GET_CLASS (self)->copy (self, new_parent);
130 }
131
132 static void
valadoc_content_content_element_real_configure(ValadocContentContentElement * self,ValadocSettings * settings,ValadocResourceLocator * locator)133 valadoc_content_content_element_real_configure (ValadocContentContentElement* self,
134 ValadocSettings* settings,
135 ValadocResourceLocator* locator)
136 {
137 g_return_if_fail (settings != NULL);
138 g_return_if_fail (locator != NULL);
139 }
140
141 void
valadoc_content_content_element_configure(ValadocContentContentElement * self,ValadocSettings * settings,ValadocResourceLocator * locator)142 valadoc_content_content_element_configure (ValadocContentContentElement* self,
143 ValadocSettings* settings,
144 ValadocResourceLocator* locator)
145 {
146 g_return_if_fail (self != NULL);
147 VALADOC_CONTENT_CONTENT_ELEMENT_GET_CLASS (self)->configure (self, settings, locator);
148 }
149
150 static void
valadoc_content_content_element_real_check(ValadocContentContentElement * self,ValadocApiTree * api_root,ValadocApiNode * container,const gchar * file_path,ValadocErrorReporter * reporter,ValadocSettings * settings)151 valadoc_content_content_element_real_check (ValadocContentContentElement* self,
152 ValadocApiTree* api_root,
153 ValadocApiNode* container,
154 const gchar* file_path,
155 ValadocErrorReporter* reporter,
156 ValadocSettings* settings)
157 {
158 g_critical ("Type `%s' does not implement abstract method `valadoc_content_content_element_check'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
159 return;
160 }
161
162 void
valadoc_content_content_element_check(ValadocContentContentElement * self,ValadocApiTree * api_root,ValadocApiNode * container,const gchar * file_path,ValadocErrorReporter * reporter,ValadocSettings * settings)163 valadoc_content_content_element_check (ValadocContentContentElement* self,
164 ValadocApiTree* api_root,
165 ValadocApiNode* container,
166 const gchar* file_path,
167 ValadocErrorReporter* reporter,
168 ValadocSettings* settings)
169 {
170 g_return_if_fail (self != NULL);
171 VALADOC_CONTENT_CONTENT_ELEMENT_GET_CLASS (self)->check (self, api_root, container, file_path, reporter, settings);
172 }
173
174 static void
valadoc_content_content_element_real_accept(ValadocContentContentElement * self,ValadocContentContentVisitor * visitor)175 valadoc_content_content_element_real_accept (ValadocContentContentElement* self,
176 ValadocContentContentVisitor* visitor)
177 {
178 g_critical ("Type `%s' does not implement abstract method `valadoc_content_content_element_accept'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
179 return;
180 }
181
182 void
valadoc_content_content_element_accept(ValadocContentContentElement * self,ValadocContentContentVisitor * visitor)183 valadoc_content_content_element_accept (ValadocContentContentElement* self,
184 ValadocContentContentVisitor* visitor)
185 {
186 g_return_if_fail (self != NULL);
187 VALADOC_CONTENT_CONTENT_ELEMENT_GET_CLASS (self)->accept (self, visitor);
188 }
189
190 static gboolean
valadoc_content_content_element_real_is_empty(ValadocContentContentElement * self)191 valadoc_content_content_element_real_is_empty (ValadocContentContentElement* self)
192 {
193 gboolean _tmp0_ = FALSE;
194 g_critical ("Type `%s' does not implement abstract method `valadoc_content_content_element_is_empty'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
195 return _tmp0_;
196 }
197
198 gboolean
valadoc_content_content_element_is_empty(ValadocContentContentElement * self)199 valadoc_content_content_element_is_empty (ValadocContentContentElement* self)
200 {
201 g_return_val_if_fail (self != NULL, FALSE);
202 return VALADOC_CONTENT_CONTENT_ELEMENT_GET_CLASS (self)->is_empty (self);
203 }
204
205 static void
valadoc_content_content_element_real_accept_children(ValadocContentContentElement * self,ValadocContentContentVisitor * visitor)206 valadoc_content_content_element_real_accept_children (ValadocContentContentElement* self,
207 ValadocContentContentVisitor* visitor)
208 {
209 g_return_if_fail (visitor != NULL);
210 }
211
212 void
valadoc_content_content_element_accept_children(ValadocContentContentElement * self,ValadocContentContentVisitor * visitor)213 valadoc_content_content_element_accept_children (ValadocContentContentElement* self,
214 ValadocContentContentVisitor* visitor)
215 {
216 g_return_if_fail (self != NULL);
217 VALADOC_CONTENT_CONTENT_ELEMENT_GET_CLASS (self)->accept_children (self, visitor);
218 }
219
220 ValadocContentContentElement*
valadoc_content_content_element_construct(GType object_type)221 valadoc_content_content_element_construct (GType object_type)
222 {
223 ValadocContentContentElement * self = NULL;
224 self = (ValadocContentContentElement*) g_object_new (object_type, NULL);
225 return self;
226 }
227
228 static void
valadoc_content_content_element_class_init(ValadocContentContentElementClass * klass,gpointer klass_data)229 valadoc_content_content_element_class_init (ValadocContentContentElementClass * klass,
230 gpointer klass_data)
231 {
232 valadoc_content_content_element_parent_class = g_type_class_peek_parent (klass);
233 g_type_class_adjust_private_offset (klass, &ValadocContentContentElement_private_offset);
234 ((ValadocContentContentElementClass *) klass)->copy = (ValadocContentContentElement* (*) (ValadocContentContentElement*, ValadocContentContentElement*)) valadoc_content_content_element_real_copy;
235 ((ValadocContentContentElementClass *) klass)->configure = (void (*) (ValadocContentContentElement*, ValadocSettings*, ValadocResourceLocator*)) valadoc_content_content_element_real_configure;
236 ((ValadocContentContentElementClass *) klass)->check = (void (*) (ValadocContentContentElement*, ValadocApiTree*, ValadocApiNode*, const gchar*, ValadocErrorReporter*, ValadocSettings*)) valadoc_content_content_element_real_check;
237 ((ValadocContentContentElementClass *) klass)->accept = (void (*) (ValadocContentContentElement*, ValadocContentContentVisitor*)) valadoc_content_content_element_real_accept;
238 ((ValadocContentContentElementClass *) klass)->is_empty = (gboolean (*) (ValadocContentContentElement*)) valadoc_content_content_element_real_is_empty;
239 ((ValadocContentContentElementClass *) klass)->accept_children = (void (*) (ValadocContentContentElement*, ValadocContentContentVisitor*)) valadoc_content_content_element_real_accept_children;
240 G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_content_content_element_get_property;
241 G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_content_content_element_set_property;
242 G_OBJECT_CLASS (klass)->finalize = valadoc_content_content_element_finalize;
243 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_CONTENT_CONTENT_ELEMENT_PARENT_PROPERTY, valadoc_content_content_element_properties[VALADOC_CONTENT_CONTENT_ELEMENT_PARENT_PROPERTY] = g_param_spec_object ("parent", "parent", "parent", VALADOC_CONTENT_TYPE_CONTENT_ELEMENT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
244 }
245
246 static void
valadoc_content_content_element_instance_init(ValadocContentContentElement * self,gpointer klass)247 valadoc_content_content_element_instance_init (ValadocContentContentElement * self,
248 gpointer klass)
249 {
250 self->priv = valadoc_content_content_element_get_instance_private (self);
251 }
252
253 static void
valadoc_content_content_element_finalize(GObject * obj)254 valadoc_content_content_element_finalize (GObject * obj)
255 {
256 ValadocContentContentElement * self;
257 self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_CONTENT_TYPE_CONTENT_ELEMENT, ValadocContentContentElement);
258 _g_object_unref0 (self->priv->_parent);
259 G_OBJECT_CLASS (valadoc_content_content_element_parent_class)->finalize (obj);
260 }
261
262 static GType
valadoc_content_content_element_get_type_once(void)263 valadoc_content_content_element_get_type_once (void)
264 {
265 static const GTypeInfo g_define_type_info = { sizeof (ValadocContentContentElementClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_content_content_element_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocContentContentElement), 0, (GInstanceInitFunc) valadoc_content_content_element_instance_init, NULL };
266 GType valadoc_content_content_element_type_id;
267 valadoc_content_content_element_type_id = g_type_register_static (G_TYPE_OBJECT, "ValadocContentContentElement", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
268 ValadocContentContentElement_private_offset = g_type_add_instance_private (valadoc_content_content_element_type_id, sizeof (ValadocContentContentElementPrivate));
269 return valadoc_content_content_element_type_id;
270 }
271
272 GType
valadoc_content_content_element_get_type(void)273 valadoc_content_content_element_get_type (void)
274 {
275 static volatile gsize valadoc_content_content_element_type_id__volatile = 0;
276 if (g_once_init_enter (&valadoc_content_content_element_type_id__volatile)) {
277 GType valadoc_content_content_element_type_id;
278 valadoc_content_content_element_type_id = valadoc_content_content_element_get_type_once ();
279 g_once_init_leave (&valadoc_content_content_element_type_id__volatile, valadoc_content_content_element_type_id);
280 }
281 return valadoc_content_content_element_type_id__volatile;
282 }
283
284 static void
_vala_valadoc_content_content_element_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)285 _vala_valadoc_content_content_element_get_property (GObject * object,
286 guint property_id,
287 GValue * value,
288 GParamSpec * pspec)
289 {
290 ValadocContentContentElement * self;
291 self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_CONTENT_TYPE_CONTENT_ELEMENT, ValadocContentContentElement);
292 switch (property_id) {
293 case VALADOC_CONTENT_CONTENT_ELEMENT_PARENT_PROPERTY:
294 g_value_set_object (value, valadoc_content_content_element_get_parent (self));
295 break;
296 default:
297 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
298 break;
299 }
300 }
301
302 static void
_vala_valadoc_content_content_element_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)303 _vala_valadoc_content_content_element_set_property (GObject * object,
304 guint property_id,
305 const GValue * value,
306 GParamSpec * pspec)
307 {
308 ValadocContentContentElement * self;
309 self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_CONTENT_TYPE_CONTENT_ELEMENT, ValadocContentContentElement);
310 switch (property_id) {
311 case VALADOC_CONTENT_CONTENT_ELEMENT_PARENT_PROPERTY:
312 valadoc_content_content_element_set_parent (self, g_value_get_object (value));
313 break;
314 default:
315 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
316 break;
317 }
318 }
319
320