1 /* tablecell.c generated by valac, the Vala compiler
2 * generated from tablecell.vala, do not modify */
3
4 /* tablecell.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_TABLE_CELL_0_PROPERTY,
36 VALADOC_CONTENT_TABLE_CELL_HORIZONTAL_ALIGN_PROPERTY,
37 VALADOC_CONTENT_TABLE_CELL_VERTICAL_ALIGN_PROPERTY,
38 VALADOC_CONTENT_TABLE_CELL_STYLE_PROPERTY,
39 VALADOC_CONTENT_TABLE_CELL_COLSPAN_PROPERTY,
40 VALADOC_CONTENT_TABLE_CELL_ROWSPAN_PROPERTY,
41 VALADOC_CONTENT_TABLE_CELL_NUM_PROPERTIES
42 };
43 static GParamSpec* valadoc_content_table_cell_properties[VALADOC_CONTENT_TABLE_CELL_NUM_PROPERTIES];
44 #define _g_free0(var) (var = (g_free (var), NULL))
45 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
46 #define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))
47
48 struct _ValadocContentTableCellPrivate {
49 ValadocContentHorizontalAlign _horizontal_align;
50 ValadocContentVerticalAlign _vertical_align;
51 gchar* _style;
52 gint _colspan;
53 gint _rowspan;
54 };
55
56 static gint ValadocContentTableCell_private_offset;
57 static gpointer valadoc_content_table_cell_parent_class = NULL;
58 static ValadocContentStyleAttributesIface * valadoc_content_table_cell_valadoc_content_style_attributes_parent_iface = NULL;
59
60 G_GNUC_INTERNAL ValadocContentTableCell* valadoc_content_table_cell_new (void);
61 G_GNUC_INTERNAL ValadocContentTableCell* valadoc_content_table_cell_construct (GType object_type);
62 G_GNUC_INTERNAL ValadocContentInlineContent* valadoc_content_inline_content_construct (GType object_type);
63 static void valadoc_content_table_cell_real_check (ValadocContentContentElement* base,
64 ValadocApiTree* api_root,
65 ValadocApiNode* container,
66 const gchar* file_path,
67 ValadocErrorReporter* reporter,
68 ValadocSettings* settings);
69 static void valadoc_content_table_cell_real_accept (ValadocContentContentElement* base,
70 ValadocContentContentVisitor* visitor);
71 static gboolean valadoc_content_table_cell_real_is_empty (ValadocContentContentElement* base);
72 static ValadocContentContentElement* valadoc_content_table_cell_real_copy (ValadocContentContentElement* base,
73 ValadocContentContentElement* new_parent);
74 G_GNUC_INTERNAL void valadoc_content_content_element_set_parent (ValadocContentContentElement* self,
75 ValadocContentContentElement* value);
76 static void valadoc_content_table_cell_finalize (GObject * obj);
77 static GType valadoc_content_table_cell_get_type_once (void);
78 static void _vala_valadoc_content_table_cell_get_property (GObject * object,
79 guint property_id,
80 GValue * value,
81 GParamSpec * pspec);
82 static void _vala_valadoc_content_table_cell_set_property (GObject * object,
83 guint property_id,
84 const GValue * value,
85 GParamSpec * pspec);
86
87 static inline gpointer
valadoc_content_table_cell_get_instance_private(ValadocContentTableCell * self)88 valadoc_content_table_cell_get_instance_private (ValadocContentTableCell* self)
89 {
90 return G_STRUCT_MEMBER_P (self, ValadocContentTableCell_private_offset);
91 }
92
93 static ValadocContentHorizontalAlign
valadoc_content_table_cell_real_get_horizontal_align(ValadocContentStyleAttributes * base)94 valadoc_content_table_cell_real_get_horizontal_align (ValadocContentStyleAttributes* base)
95 {
96 ValadocContentHorizontalAlign result;
97 ValadocContentTableCell* self;
98 ValadocContentHorizontalAlign _tmp0_;
99 self = (ValadocContentTableCell*) base;
100 _tmp0_ = self->priv->_horizontal_align;
101 result = _tmp0_;
102 return result;
103 }
104
105 static void
valadoc_content_table_cell_real_set_horizontal_align(ValadocContentStyleAttributes * base,ValadocContentHorizontalAlign value)106 valadoc_content_table_cell_real_set_horizontal_align (ValadocContentStyleAttributes* base,
107 ValadocContentHorizontalAlign value)
108 {
109 ValadocContentTableCell* self;
110 ValadocContentHorizontalAlign old_value;
111 self = (ValadocContentTableCell*) base;
112 old_value = valadoc_content_table_cell_real_get_horizontal_align (base);
113 if (old_value != value) {
114 self->priv->_horizontal_align = value;
115 g_object_notify_by_pspec ((GObject *) self, valadoc_content_table_cell_properties[VALADOC_CONTENT_TABLE_CELL_HORIZONTAL_ALIGN_PROPERTY]);
116 }
117 }
118
119 static ValadocContentVerticalAlign
valadoc_content_table_cell_real_get_vertical_align(ValadocContentStyleAttributes * base)120 valadoc_content_table_cell_real_get_vertical_align (ValadocContentStyleAttributes* base)
121 {
122 ValadocContentVerticalAlign result;
123 ValadocContentTableCell* self;
124 ValadocContentVerticalAlign _tmp0_;
125 self = (ValadocContentTableCell*) base;
126 _tmp0_ = self->priv->_vertical_align;
127 result = _tmp0_;
128 return result;
129 }
130
131 static void
valadoc_content_table_cell_real_set_vertical_align(ValadocContentStyleAttributes * base,ValadocContentVerticalAlign value)132 valadoc_content_table_cell_real_set_vertical_align (ValadocContentStyleAttributes* base,
133 ValadocContentVerticalAlign value)
134 {
135 ValadocContentTableCell* self;
136 ValadocContentVerticalAlign old_value;
137 self = (ValadocContentTableCell*) base;
138 old_value = valadoc_content_table_cell_real_get_vertical_align (base);
139 if (old_value != value) {
140 self->priv->_vertical_align = value;
141 g_object_notify_by_pspec ((GObject *) self, valadoc_content_table_cell_properties[VALADOC_CONTENT_TABLE_CELL_VERTICAL_ALIGN_PROPERTY]);
142 }
143 }
144
145 static const gchar*
valadoc_content_table_cell_real_get_style(ValadocContentStyleAttributes * base)146 valadoc_content_table_cell_real_get_style (ValadocContentStyleAttributes* base)
147 {
148 const gchar* result;
149 ValadocContentTableCell* self;
150 const gchar* _tmp0_;
151 self = (ValadocContentTableCell*) base;
152 _tmp0_ = self->priv->_style;
153 result = _tmp0_;
154 return result;
155 }
156
157 static void
valadoc_content_table_cell_real_set_style(ValadocContentStyleAttributes * base,const gchar * value)158 valadoc_content_table_cell_real_set_style (ValadocContentStyleAttributes* base,
159 const gchar* value)
160 {
161 ValadocContentTableCell* self;
162 gchar* old_value;
163 self = (ValadocContentTableCell*) base;
164 old_value = valadoc_content_table_cell_real_get_style (base);
165 if (g_strcmp0 (value, old_value) != 0) {
166 gchar* _tmp0_;
167 _tmp0_ = g_strdup (value);
168 _g_free0 (self->priv->_style);
169 self->priv->_style = _tmp0_;
170 g_object_notify_by_pspec ((GObject *) self, valadoc_content_table_cell_properties[VALADOC_CONTENT_TABLE_CELL_STYLE_PROPERTY]);
171 }
172 }
173
174 gint
valadoc_content_table_cell_get_colspan(ValadocContentTableCell * self)175 valadoc_content_table_cell_get_colspan (ValadocContentTableCell* self)
176 {
177 gint result;
178 g_return_val_if_fail (self != NULL, 0);
179 result = self->priv->_colspan;
180 return result;
181 }
182
183 void
valadoc_content_table_cell_set_colspan(ValadocContentTableCell * self,gint value)184 valadoc_content_table_cell_set_colspan (ValadocContentTableCell* self,
185 gint value)
186 {
187 gint old_value;
188 g_return_if_fail (self != NULL);
189 old_value = valadoc_content_table_cell_get_colspan (self);
190 if (old_value != value) {
191 self->priv->_colspan = value;
192 g_object_notify_by_pspec ((GObject *) self, valadoc_content_table_cell_properties[VALADOC_CONTENT_TABLE_CELL_COLSPAN_PROPERTY]);
193 }
194 }
195
196 gint
valadoc_content_table_cell_get_rowspan(ValadocContentTableCell * self)197 valadoc_content_table_cell_get_rowspan (ValadocContentTableCell* self)
198 {
199 gint result;
200 g_return_val_if_fail (self != NULL, 0);
201 result = self->priv->_rowspan;
202 return result;
203 }
204
205 void
valadoc_content_table_cell_set_rowspan(ValadocContentTableCell * self,gint value)206 valadoc_content_table_cell_set_rowspan (ValadocContentTableCell* self,
207 gint value)
208 {
209 gint old_value;
210 g_return_if_fail (self != NULL);
211 old_value = valadoc_content_table_cell_get_rowspan (self);
212 if (old_value != value) {
213 self->priv->_rowspan = value;
214 g_object_notify_by_pspec ((GObject *) self, valadoc_content_table_cell_properties[VALADOC_CONTENT_TABLE_CELL_ROWSPAN_PROPERTY]);
215 }
216 }
217
218 G_GNUC_INTERNAL ValadocContentTableCell*
valadoc_content_table_cell_construct(GType object_type)219 valadoc_content_table_cell_construct (GType object_type)
220 {
221 ValadocContentTableCell * self = NULL;
222 self = (ValadocContentTableCell*) valadoc_content_inline_content_construct (object_type);
223 self->priv->_colspan = 1;
224 self->priv->_rowspan = 1;
225 return self;
226 }
227
228 G_GNUC_INTERNAL ValadocContentTableCell*
valadoc_content_table_cell_new(void)229 valadoc_content_table_cell_new (void)
230 {
231 return valadoc_content_table_cell_construct (VALADOC_CONTENT_TYPE_TABLE_CELL);
232 }
233
234 static void
valadoc_content_table_cell_real_check(ValadocContentContentElement * base,ValadocApiTree * api_root,ValadocApiNode * container,const gchar * file_path,ValadocErrorReporter * reporter,ValadocSettings * settings)235 valadoc_content_table_cell_real_check (ValadocContentContentElement* base,
236 ValadocApiTree* api_root,
237 ValadocApiNode* container,
238 const gchar* file_path,
239 ValadocErrorReporter* reporter,
240 ValadocSettings* settings)
241 {
242 ValadocContentTableCell * self;
243 self = (ValadocContentTableCell*) base;
244 g_return_if_fail (api_root != NULL);
245 g_return_if_fail (container != NULL);
246 g_return_if_fail (file_path != NULL);
247 g_return_if_fail (reporter != NULL);
248 g_return_if_fail (settings != NULL);
249 VALADOC_CONTENT_CONTENT_ELEMENT_CLASS (valadoc_content_table_cell_parent_class)->check ((ValadocContentContentElement*) G_TYPE_CHECK_INSTANCE_CAST (self, VALADOC_CONTENT_TYPE_INLINE_CONTENT, ValadocContentInlineContent), api_root, container, file_path, reporter, settings);
250 }
251
252 static void
valadoc_content_table_cell_real_accept(ValadocContentContentElement * base,ValadocContentContentVisitor * visitor)253 valadoc_content_table_cell_real_accept (ValadocContentContentElement* base,
254 ValadocContentContentVisitor* visitor)
255 {
256 ValadocContentTableCell * self;
257 self = (ValadocContentTableCell*) base;
258 g_return_if_fail (visitor != NULL);
259 valadoc_content_content_visitor_visit_table_cell (visitor, self);
260 }
261
262 static gboolean
valadoc_content_table_cell_real_is_empty(ValadocContentContentElement * base)263 valadoc_content_table_cell_real_is_empty (ValadocContentContentElement* base)
264 {
265 ValadocContentTableCell * self;
266 gboolean result = FALSE;
267 self = (ValadocContentTableCell*) base;
268 result = FALSE;
269 return result;
270 }
271
272 static gpointer
_vala_iterable_ref0(gpointer self)273 _vala_iterable_ref0 (gpointer self)
274 {
275 return self ? vala_iterable_ref (self) : NULL;
276 }
277
278 static ValadocContentContentElement*
valadoc_content_table_cell_real_copy(ValadocContentContentElement * base,ValadocContentContentElement * new_parent)279 valadoc_content_table_cell_real_copy (ValadocContentContentElement* base,
280 ValadocContentContentElement* new_parent)
281 {
282 ValadocContentTableCell * self;
283 ValadocContentTableCell* cell = NULL;
284 ValadocContentTableCell* _tmp0_;
285 ValadocContentTableCell* _tmp1_;
286 ValadocContentTableCell* _tmp2_;
287 ValadocContentHorizontalAlign _tmp3_;
288 ValadocContentHorizontalAlign _tmp4_;
289 ValadocContentTableCell* _tmp5_;
290 ValadocContentVerticalAlign _tmp6_;
291 ValadocContentVerticalAlign _tmp7_;
292 ValadocContentTableCell* _tmp8_;
293 gint _tmp9_;
294 ValadocContentTableCell* _tmp10_;
295 gint _tmp11_;
296 ValadocContentTableCell* _tmp12_;
297 const gchar* _tmp13_;
298 const gchar* _tmp14_;
299 ValadocContentContentElement* result = NULL;
300 self = (ValadocContentTableCell*) base;
301 _tmp0_ = valadoc_content_table_cell_new ();
302 cell = _tmp0_;
303 _tmp1_ = cell;
304 valadoc_content_content_element_set_parent ((ValadocContentContentElement*) _tmp1_, new_parent);
305 _tmp2_ = cell;
306 _tmp3_ = valadoc_content_style_attributes_get_horizontal_align ((ValadocContentStyleAttributes*) self);
307 _tmp4_ = _tmp3_;
308 valadoc_content_style_attributes_set_horizontal_align ((ValadocContentStyleAttributes*) _tmp2_, _tmp4_);
309 _tmp5_ = cell;
310 _tmp6_ = valadoc_content_style_attributes_get_vertical_align ((ValadocContentStyleAttributes*) self);
311 _tmp7_ = _tmp6_;
312 valadoc_content_style_attributes_set_vertical_align ((ValadocContentStyleAttributes*) _tmp5_, _tmp7_);
313 _tmp8_ = cell;
314 _tmp9_ = self->priv->_colspan;
315 valadoc_content_table_cell_set_colspan (_tmp8_, _tmp9_);
316 _tmp10_ = cell;
317 _tmp11_ = self->priv->_rowspan;
318 valadoc_content_table_cell_set_rowspan (_tmp10_, _tmp11_);
319 _tmp12_ = cell;
320 _tmp13_ = valadoc_content_style_attributes_get_style ((ValadocContentStyleAttributes*) self);
321 _tmp14_ = _tmp13_;
322 valadoc_content_style_attributes_set_style ((ValadocContentStyleAttributes*) _tmp12_, _tmp14_);
323 {
324 ValaList* _element_list = NULL;
325 ValaList* _tmp15_;
326 ValaList* _tmp16_;
327 ValaList* _tmp17_;
328 gint _element_size = 0;
329 ValaList* _tmp18_;
330 gint _tmp19_;
331 gint _tmp20_;
332 gint _element_index = 0;
333 _tmp15_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) self);
334 _tmp16_ = _tmp15_;
335 _tmp17_ = _vala_iterable_ref0 (_tmp16_);
336 _element_list = _tmp17_;
337 _tmp18_ = _element_list;
338 _tmp19_ = vala_collection_get_size ((ValaCollection*) _tmp18_);
339 _tmp20_ = _tmp19_;
340 _element_size = _tmp20_;
341 _element_index = -1;
342 while (TRUE) {
343 gint _tmp21_;
344 gint _tmp22_;
345 ValadocContentInline* element = NULL;
346 ValaList* _tmp23_;
347 gpointer _tmp24_;
348 ValadocContentInline* copy = NULL;
349 ValadocContentInline* _tmp25_;
350 ValadocContentTableCell* _tmp26_;
351 ValadocContentContentElement* _tmp27_;
352 ValadocContentInline* _tmp28_;
353 ValadocContentTableCell* _tmp29_;
354 ValaList* _tmp30_;
355 ValaList* _tmp31_;
356 ValadocContentInline* _tmp32_;
357 _element_index = _element_index + 1;
358 _tmp21_ = _element_index;
359 _tmp22_ = _element_size;
360 if (!(_tmp21_ < _tmp22_)) {
361 break;
362 }
363 _tmp23_ = _element_list;
364 _tmp24_ = vala_list_get (_tmp23_, _element_index);
365 element = (ValadocContentInline*) _tmp24_;
366 _tmp25_ = element;
367 _tmp26_ = cell;
368 _tmp27_ = valadoc_content_content_element_copy ((ValadocContentContentElement*) _tmp25_, (ValadocContentContentElement*) _tmp26_);
369 _tmp28_ = VALADOC_CONTENT_IS_INLINE (_tmp27_) ? ((ValadocContentInline*) _tmp27_) : NULL;
370 if (_tmp28_ == NULL) {
371 _g_object_unref0 (_tmp27_);
372 }
373 copy = _tmp28_;
374 _tmp29_ = cell;
375 _tmp30_ = valadoc_content_inline_content_get_content ((ValadocContentInlineContent*) _tmp29_);
376 _tmp31_ = _tmp30_;
377 _tmp32_ = copy;
378 vala_collection_add ((ValaCollection*) _tmp31_, _tmp32_);
379 _g_object_unref0 (copy);
380 _g_object_unref0 (element);
381 }
382 _vala_iterable_unref0 (_element_list);
383 }
384 result = (ValadocContentContentElement*) cell;
385 return result;
386 }
387
388 static void
valadoc_content_table_cell_class_init(ValadocContentTableCellClass * klass,gpointer klass_data)389 valadoc_content_table_cell_class_init (ValadocContentTableCellClass * klass,
390 gpointer klass_data)
391 {
392 valadoc_content_table_cell_parent_class = g_type_class_peek_parent (klass);
393 g_type_class_adjust_private_offset (klass, &ValadocContentTableCell_private_offset);
394 ((ValadocContentContentElementClass *) klass)->check = (void (*) (ValadocContentContentElement*, ValadocApiTree*, ValadocApiNode*, const gchar*, ValadocErrorReporter*, ValadocSettings*)) valadoc_content_table_cell_real_check;
395 ((ValadocContentContentElementClass *) klass)->accept = (void (*) (ValadocContentContentElement*, ValadocContentContentVisitor*)) valadoc_content_table_cell_real_accept;
396 ((ValadocContentContentElementClass *) klass)->is_empty = (gboolean (*) (ValadocContentContentElement*)) valadoc_content_table_cell_real_is_empty;
397 ((ValadocContentContentElementClass *) klass)->copy = (ValadocContentContentElement* (*) (ValadocContentContentElement*, ValadocContentContentElement*)) valadoc_content_table_cell_real_copy;
398 G_OBJECT_CLASS (klass)->get_property = _vala_valadoc_content_table_cell_get_property;
399 G_OBJECT_CLASS (klass)->set_property = _vala_valadoc_content_table_cell_set_property;
400 G_OBJECT_CLASS (klass)->finalize = valadoc_content_table_cell_finalize;
401 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_CONTENT_TABLE_CELL_HORIZONTAL_ALIGN_PROPERTY, valadoc_content_table_cell_properties[VALADOC_CONTENT_TABLE_CELL_HORIZONTAL_ALIGN_PROPERTY] = g_param_spec_enum ("horizontal-align", "horizontal-align", "horizontal-align", VALADOC_CONTENT_TYPE_HORIZONTAL_ALIGN, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
402 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_CONTENT_TABLE_CELL_VERTICAL_ALIGN_PROPERTY, valadoc_content_table_cell_properties[VALADOC_CONTENT_TABLE_CELL_VERTICAL_ALIGN_PROPERTY] = g_param_spec_enum ("vertical-align", "vertical-align", "vertical-align", VALADOC_CONTENT_TYPE_VERTICAL_ALIGN, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
403 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_CONTENT_TABLE_CELL_STYLE_PROPERTY, valadoc_content_table_cell_properties[VALADOC_CONTENT_TABLE_CELL_STYLE_PROPERTY] = g_param_spec_string ("style", "style", "style", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
404 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_CONTENT_TABLE_CELL_COLSPAN_PROPERTY, valadoc_content_table_cell_properties[VALADOC_CONTENT_TABLE_CELL_COLSPAN_PROPERTY] = g_param_spec_int ("colspan", "colspan", "colspan", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
405 g_object_class_install_property (G_OBJECT_CLASS (klass), VALADOC_CONTENT_TABLE_CELL_ROWSPAN_PROPERTY, valadoc_content_table_cell_properties[VALADOC_CONTENT_TABLE_CELL_ROWSPAN_PROPERTY] = g_param_spec_int ("rowspan", "rowspan", "rowspan", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
406 }
407
408 static void
valadoc_content_table_cell_valadoc_content_style_attributes_interface_init(ValadocContentStyleAttributesIface * iface,gpointer iface_data)409 valadoc_content_table_cell_valadoc_content_style_attributes_interface_init (ValadocContentStyleAttributesIface * iface,
410 gpointer iface_data)
411 {
412 valadoc_content_table_cell_valadoc_content_style_attributes_parent_iface = g_type_interface_peek_parent (iface);
413 iface->get_horizontal_align = valadoc_content_table_cell_real_get_horizontal_align;
414 iface->set_horizontal_align = valadoc_content_table_cell_real_set_horizontal_align;
415 iface->get_vertical_align = valadoc_content_table_cell_real_get_vertical_align;
416 iface->set_vertical_align = valadoc_content_table_cell_real_set_vertical_align;
417 iface->get_style = valadoc_content_table_cell_real_get_style;
418 iface->set_style = valadoc_content_table_cell_real_set_style;
419 }
420
421 static void
valadoc_content_table_cell_instance_init(ValadocContentTableCell * self,gpointer klass)422 valadoc_content_table_cell_instance_init (ValadocContentTableCell * self,
423 gpointer klass)
424 {
425 self->priv = valadoc_content_table_cell_get_instance_private (self);
426 }
427
428 static void
valadoc_content_table_cell_finalize(GObject * obj)429 valadoc_content_table_cell_finalize (GObject * obj)
430 {
431 ValadocContentTableCell * self;
432 self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALADOC_CONTENT_TYPE_TABLE_CELL, ValadocContentTableCell);
433 _g_free0 (self->priv->_style);
434 G_OBJECT_CLASS (valadoc_content_table_cell_parent_class)->finalize (obj);
435 }
436
437 static GType
valadoc_content_table_cell_get_type_once(void)438 valadoc_content_table_cell_get_type_once (void)
439 {
440 static const GTypeInfo g_define_type_info = { sizeof (ValadocContentTableCellClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_content_table_cell_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValadocContentTableCell), 0, (GInstanceInitFunc) valadoc_content_table_cell_instance_init, NULL };
441 static const GInterfaceInfo valadoc_content_style_attributes_info = { (GInterfaceInitFunc) valadoc_content_table_cell_valadoc_content_style_attributes_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
442 GType valadoc_content_table_cell_type_id;
443 valadoc_content_table_cell_type_id = g_type_register_static (VALADOC_CONTENT_TYPE_INLINE_CONTENT, "ValadocContentTableCell", &g_define_type_info, 0);
444 g_type_add_interface_static (valadoc_content_table_cell_type_id, VALADOC_CONTENT_TYPE_STYLE_ATTRIBUTES, &valadoc_content_style_attributes_info);
445 ValadocContentTableCell_private_offset = g_type_add_instance_private (valadoc_content_table_cell_type_id, sizeof (ValadocContentTableCellPrivate));
446 return valadoc_content_table_cell_type_id;
447 }
448
449 GType
valadoc_content_table_cell_get_type(void)450 valadoc_content_table_cell_get_type (void)
451 {
452 static volatile gsize valadoc_content_table_cell_type_id__volatile = 0;
453 if (g_once_init_enter (&valadoc_content_table_cell_type_id__volatile)) {
454 GType valadoc_content_table_cell_type_id;
455 valadoc_content_table_cell_type_id = valadoc_content_table_cell_get_type_once ();
456 g_once_init_leave (&valadoc_content_table_cell_type_id__volatile, valadoc_content_table_cell_type_id);
457 }
458 return valadoc_content_table_cell_type_id__volatile;
459 }
460
461 static void
_vala_valadoc_content_table_cell_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)462 _vala_valadoc_content_table_cell_get_property (GObject * object,
463 guint property_id,
464 GValue * value,
465 GParamSpec * pspec)
466 {
467 ValadocContentTableCell * self;
468 self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_CONTENT_TYPE_TABLE_CELL, ValadocContentTableCell);
469 switch (property_id) {
470 case VALADOC_CONTENT_TABLE_CELL_HORIZONTAL_ALIGN_PROPERTY:
471 g_value_set_enum (value, valadoc_content_style_attributes_get_horizontal_align ((ValadocContentStyleAttributes*) self));
472 break;
473 case VALADOC_CONTENT_TABLE_CELL_VERTICAL_ALIGN_PROPERTY:
474 g_value_set_enum (value, valadoc_content_style_attributes_get_vertical_align ((ValadocContentStyleAttributes*) self));
475 break;
476 case VALADOC_CONTENT_TABLE_CELL_STYLE_PROPERTY:
477 g_value_set_string (value, valadoc_content_style_attributes_get_style ((ValadocContentStyleAttributes*) self));
478 break;
479 case VALADOC_CONTENT_TABLE_CELL_COLSPAN_PROPERTY:
480 g_value_set_int (value, valadoc_content_table_cell_get_colspan (self));
481 break;
482 case VALADOC_CONTENT_TABLE_CELL_ROWSPAN_PROPERTY:
483 g_value_set_int (value, valadoc_content_table_cell_get_rowspan (self));
484 break;
485 default:
486 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
487 break;
488 }
489 }
490
491 static void
_vala_valadoc_content_table_cell_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)492 _vala_valadoc_content_table_cell_set_property (GObject * object,
493 guint property_id,
494 const GValue * value,
495 GParamSpec * pspec)
496 {
497 ValadocContentTableCell * self;
498 self = G_TYPE_CHECK_INSTANCE_CAST (object, VALADOC_CONTENT_TYPE_TABLE_CELL, ValadocContentTableCell);
499 switch (property_id) {
500 case VALADOC_CONTENT_TABLE_CELL_HORIZONTAL_ALIGN_PROPERTY:
501 valadoc_content_style_attributes_set_horizontal_align ((ValadocContentStyleAttributes*) self, g_value_get_enum (value));
502 break;
503 case VALADOC_CONTENT_TABLE_CELL_VERTICAL_ALIGN_PROPERTY:
504 valadoc_content_style_attributes_set_vertical_align ((ValadocContentStyleAttributes*) self, g_value_get_enum (value));
505 break;
506 case VALADOC_CONTENT_TABLE_CELL_STYLE_PROPERTY:
507 valadoc_content_style_attributes_set_style ((ValadocContentStyleAttributes*) self, g_value_get_string (value));
508 break;
509 case VALADOC_CONTENT_TABLE_CELL_COLSPAN_PROPERTY:
510 valadoc_content_table_cell_set_colspan (self, g_value_get_int (value));
511 break;
512 case VALADOC_CONTENT_TABLE_CELL_ROWSPAN_PROPERTY:
513 valadoc_content_table_cell_set_rowspan (self, g_value_get_int (value));
514 break;
515 default:
516 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
517 break;
518 }
519 }
520
521