1 /* styleattributes.c generated by valac, the Vala compiler
2  * generated from styleattributes.vala, do not modify */
3 
4 /* styleattributes.vala
5  *
6  * Copyright (C) 2008-2009 Florian Brosch, Didier Villevalois
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
21  *
22  * Author:
23  * 	Didier 'Ptitjes Villevalois <ptitjes@free.fr>
24  */
25 
26 #include "valadoc.h"
27 #include <stdlib.h>
28 #include <string.h>
29 #include <glib.h>
30 
31 static GType valadoc_content_style_attributes_get_type_once (void);
32 
33 ValadocContentHorizontalAlign
valadoc_content_horizontal_align_from_string(const gchar * str)34 valadoc_content_horizontal_align_from_string (const gchar* str)
35 {
36 	const gchar* _tmp0_;
37 	GQuark _tmp2_ = 0U;
38 	static GQuark _tmp1_label0 = 0;
39 	static GQuark _tmp1_label1 = 0;
40 	static GQuark _tmp1_label2 = 0;
41 	static GQuark _tmp1_label3 = 0;
42 	ValadocContentHorizontalAlign result = 0;
43 	g_return_val_if_fail (str != NULL, 0);
44 	_tmp0_ = str;
45 	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
46 	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("none")))) {
47 		switch (0) {
48 			default:
49 			{
50 				result = VALADOC_CONTENT_HORIZONTAL_ALIGN_NONE;
51 				return result;
52 			}
53 		}
54 	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("left")))) {
55 		switch (0) {
56 			default:
57 			{
58 				result = VALADOC_CONTENT_HORIZONTAL_ALIGN_LEFT;
59 				return result;
60 			}
61 		}
62 	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("right")))) {
63 		switch (0) {
64 			default:
65 			{
66 				result = VALADOC_CONTENT_HORIZONTAL_ALIGN_RIGHT;
67 				return result;
68 			}
69 		}
70 	} else if (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("center")))) {
71 		switch (0) {
72 			default:
73 			{
74 				result = VALADOC_CONTENT_HORIZONTAL_ALIGN_CENTER;
75 				return result;
76 			}
77 		}
78 	}
79 	g_assert_not_reached ();
80 }
81 
82 const gchar*
valadoc_content_horizontal_align_to_string(ValadocContentHorizontalAlign self)83 valadoc_content_horizontal_align_to_string (ValadocContentHorizontalAlign self)
84 {
85 	const gchar* result = NULL;
86 	switch (self) {
87 		case VALADOC_CONTENT_HORIZONTAL_ALIGN_NONE:
88 		{
89 			result = "none";
90 			return result;
91 		}
92 		case VALADOC_CONTENT_HORIZONTAL_ALIGN_LEFT:
93 		{
94 			result = "left";
95 			return result;
96 		}
97 		case VALADOC_CONTENT_HORIZONTAL_ALIGN_RIGHT:
98 		{
99 			result = "right";
100 			return result;
101 		}
102 		case VALADOC_CONTENT_HORIZONTAL_ALIGN_CENTER:
103 		{
104 			result = "center";
105 			return result;
106 		}
107 		default:
108 		break;
109 	}
110 	g_assert_not_reached ();
111 }
112 
113 static GType
valadoc_content_horizontal_align_get_type_once(void)114 valadoc_content_horizontal_align_get_type_once (void)
115 {
116 	static const GEnumValue values[] = {{VALADOC_CONTENT_HORIZONTAL_ALIGN_NONE, "VALADOC_CONTENT_HORIZONTAL_ALIGN_NONE", "none"}, {VALADOC_CONTENT_HORIZONTAL_ALIGN_LEFT, "VALADOC_CONTENT_HORIZONTAL_ALIGN_LEFT", "left"}, {VALADOC_CONTENT_HORIZONTAL_ALIGN_RIGHT, "VALADOC_CONTENT_HORIZONTAL_ALIGN_RIGHT", "right"}, {VALADOC_CONTENT_HORIZONTAL_ALIGN_CENTER, "VALADOC_CONTENT_HORIZONTAL_ALIGN_CENTER", "center"}, {0, NULL, NULL}};
117 	GType valadoc_content_horizontal_align_type_id;
118 	valadoc_content_horizontal_align_type_id = g_enum_register_static ("ValadocContentHorizontalAlign", values);
119 	return valadoc_content_horizontal_align_type_id;
120 }
121 
122 GType
valadoc_content_horizontal_align_get_type(void)123 valadoc_content_horizontal_align_get_type (void)
124 {
125 	static volatile gsize valadoc_content_horizontal_align_type_id__volatile = 0;
126 	if (g_once_init_enter (&valadoc_content_horizontal_align_type_id__volatile)) {
127 		GType valadoc_content_horizontal_align_type_id;
128 		valadoc_content_horizontal_align_type_id = valadoc_content_horizontal_align_get_type_once ();
129 		g_once_init_leave (&valadoc_content_horizontal_align_type_id__volatile, valadoc_content_horizontal_align_type_id);
130 	}
131 	return valadoc_content_horizontal_align_type_id__volatile;
132 }
133 
134 ValadocContentVerticalAlign
valadoc_content_vertical_align_from_string(const gchar * str)135 valadoc_content_vertical_align_from_string (const gchar* str)
136 {
137 	const gchar* _tmp0_;
138 	GQuark _tmp2_ = 0U;
139 	static GQuark _tmp1_label0 = 0;
140 	static GQuark _tmp1_label1 = 0;
141 	static GQuark _tmp1_label2 = 0;
142 	static GQuark _tmp1_label3 = 0;
143 	ValadocContentVerticalAlign result = 0;
144 	g_return_val_if_fail (str != NULL, 0);
145 	_tmp0_ = str;
146 	_tmp2_ = (NULL == _tmp0_) ? 0 : g_quark_from_string (_tmp0_);
147 	if (_tmp2_ == ((0 != _tmp1_label0) ? _tmp1_label0 : (_tmp1_label0 = g_quark_from_static_string ("none")))) {
148 		switch (0) {
149 			default:
150 			{
151 				result = VALADOC_CONTENT_VERTICAL_ALIGN_NONE;
152 				return result;
153 			}
154 		}
155 	} else if (_tmp2_ == ((0 != _tmp1_label1) ? _tmp1_label1 : (_tmp1_label1 = g_quark_from_static_string ("top")))) {
156 		switch (0) {
157 			default:
158 			{
159 				result = VALADOC_CONTENT_VERTICAL_ALIGN_TOP;
160 				return result;
161 			}
162 		}
163 	} else if (_tmp2_ == ((0 != _tmp1_label2) ? _tmp1_label2 : (_tmp1_label2 = g_quark_from_static_string ("middle")))) {
164 		switch (0) {
165 			default:
166 			{
167 				result = VALADOC_CONTENT_VERTICAL_ALIGN_MIDDLE;
168 				return result;
169 			}
170 		}
171 	} else if (_tmp2_ == ((0 != _tmp1_label3) ? _tmp1_label3 : (_tmp1_label3 = g_quark_from_static_string ("bottom")))) {
172 		switch (0) {
173 			default:
174 			{
175 				result = VALADOC_CONTENT_VERTICAL_ALIGN_BOTTOM;
176 				return result;
177 			}
178 		}
179 	}
180 	g_assert_not_reached ();
181 }
182 
183 const gchar*
valadoc_content_vertical_align_to_string(ValadocContentVerticalAlign self)184 valadoc_content_vertical_align_to_string (ValadocContentVerticalAlign self)
185 {
186 	const gchar* result = NULL;
187 	switch (self) {
188 		case VALADOC_CONTENT_VERTICAL_ALIGN_NONE:
189 		{
190 			result = "none";
191 			return result;
192 		}
193 		case VALADOC_CONTENT_VERTICAL_ALIGN_TOP:
194 		{
195 			result = "top";
196 			return result;
197 		}
198 		case VALADOC_CONTENT_VERTICAL_ALIGN_MIDDLE:
199 		{
200 			result = "middle";
201 			return result;
202 		}
203 		case VALADOC_CONTENT_VERTICAL_ALIGN_BOTTOM:
204 		{
205 			result = "bottom";
206 			return result;
207 		}
208 		default:
209 		break;
210 	}
211 	g_assert_not_reached ();
212 }
213 
214 static GType
valadoc_content_vertical_align_get_type_once(void)215 valadoc_content_vertical_align_get_type_once (void)
216 {
217 	static const GEnumValue values[] = {{VALADOC_CONTENT_VERTICAL_ALIGN_NONE, "VALADOC_CONTENT_VERTICAL_ALIGN_NONE", "none"}, {VALADOC_CONTENT_VERTICAL_ALIGN_TOP, "VALADOC_CONTENT_VERTICAL_ALIGN_TOP", "top"}, {VALADOC_CONTENT_VERTICAL_ALIGN_MIDDLE, "VALADOC_CONTENT_VERTICAL_ALIGN_MIDDLE", "middle"}, {VALADOC_CONTENT_VERTICAL_ALIGN_BOTTOM, "VALADOC_CONTENT_VERTICAL_ALIGN_BOTTOM", "bottom"}, {0, NULL, NULL}};
218 	GType valadoc_content_vertical_align_type_id;
219 	valadoc_content_vertical_align_type_id = g_enum_register_static ("ValadocContentVerticalAlign", values);
220 	return valadoc_content_vertical_align_type_id;
221 }
222 
223 GType
valadoc_content_vertical_align_get_type(void)224 valadoc_content_vertical_align_get_type (void)
225 {
226 	static volatile gsize valadoc_content_vertical_align_type_id__volatile = 0;
227 	if (g_once_init_enter (&valadoc_content_vertical_align_type_id__volatile)) {
228 		GType valadoc_content_vertical_align_type_id;
229 		valadoc_content_vertical_align_type_id = valadoc_content_vertical_align_get_type_once ();
230 		g_once_init_leave (&valadoc_content_vertical_align_type_id__volatile, valadoc_content_vertical_align_type_id);
231 	}
232 	return valadoc_content_vertical_align_type_id__volatile;
233 }
234 
235 ValadocContentHorizontalAlign
valadoc_content_style_attributes_get_horizontal_align(ValadocContentStyleAttributes * self)236 valadoc_content_style_attributes_get_horizontal_align (ValadocContentStyleAttributes* self)
237 {
238 	g_return_val_if_fail (self != NULL, 0);
239 	return VALADOC_CONTENT_STYLE_ATTRIBUTES_GET_INTERFACE (self)->get_horizontal_align (self);
240 }
241 
242 void
valadoc_content_style_attributes_set_horizontal_align(ValadocContentStyleAttributes * self,ValadocContentHorizontalAlign value)243 valadoc_content_style_attributes_set_horizontal_align (ValadocContentStyleAttributes* self,
244                                                        ValadocContentHorizontalAlign value)
245 {
246 	g_return_if_fail (self != NULL);
247 	VALADOC_CONTENT_STYLE_ATTRIBUTES_GET_INTERFACE (self)->set_horizontal_align (self, value);
248 }
249 
250 ValadocContentVerticalAlign
valadoc_content_style_attributes_get_vertical_align(ValadocContentStyleAttributes * self)251 valadoc_content_style_attributes_get_vertical_align (ValadocContentStyleAttributes* self)
252 {
253 	g_return_val_if_fail (self != NULL, 0);
254 	return VALADOC_CONTENT_STYLE_ATTRIBUTES_GET_INTERFACE (self)->get_vertical_align (self);
255 }
256 
257 void
valadoc_content_style_attributes_set_vertical_align(ValadocContentStyleAttributes * self,ValadocContentVerticalAlign value)258 valadoc_content_style_attributes_set_vertical_align (ValadocContentStyleAttributes* self,
259                                                      ValadocContentVerticalAlign value)
260 {
261 	g_return_if_fail (self != NULL);
262 	VALADOC_CONTENT_STYLE_ATTRIBUTES_GET_INTERFACE (self)->set_vertical_align (self, value);
263 }
264 
265 const gchar*
valadoc_content_style_attributes_get_style(ValadocContentStyleAttributes * self)266 valadoc_content_style_attributes_get_style (ValadocContentStyleAttributes* self)
267 {
268 	g_return_val_if_fail (self != NULL, NULL);
269 	return VALADOC_CONTENT_STYLE_ATTRIBUTES_GET_INTERFACE (self)->get_style (self);
270 }
271 
272 void
valadoc_content_style_attributes_set_style(ValadocContentStyleAttributes * self,const gchar * value)273 valadoc_content_style_attributes_set_style (ValadocContentStyleAttributes* self,
274                                             const gchar* value)
275 {
276 	g_return_if_fail (self != NULL);
277 	VALADOC_CONTENT_STYLE_ATTRIBUTES_GET_INTERFACE (self)->set_style (self, value);
278 }
279 
280 static void
valadoc_content_style_attributes_default_init(ValadocContentStyleAttributesIface * iface,gpointer iface_data)281 valadoc_content_style_attributes_default_init (ValadocContentStyleAttributesIface * iface,
282                                                gpointer iface_data)
283 {
284 	g_object_interface_install_property (iface, 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));
285 	g_object_interface_install_property (iface, 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));
286 	g_object_interface_install_property (iface, g_param_spec_string ("style", "style", "style", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
287 }
288 
289 static GType
valadoc_content_style_attributes_get_type_once(void)290 valadoc_content_style_attributes_get_type_once (void)
291 {
292 	static const GTypeInfo g_define_type_info = { sizeof (ValadocContentStyleAttributesIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) valadoc_content_style_attributes_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
293 	GType valadoc_content_style_attributes_type_id;
294 	valadoc_content_style_attributes_type_id = g_type_register_static (G_TYPE_INTERFACE, "ValadocContentStyleAttributes", &g_define_type_info, 0);
295 	g_type_interface_add_prerequisite (valadoc_content_style_attributes_type_id, VALADOC_CONTENT_TYPE_CONTENT_ELEMENT);
296 	return valadoc_content_style_attributes_type_id;
297 }
298 
299 GType
valadoc_content_style_attributes_get_type(void)300 valadoc_content_style_attributes_get_type (void)
301 {
302 	static volatile gsize valadoc_content_style_attributes_type_id__volatile = 0;
303 	if (g_once_init_enter (&valadoc_content_style_attributes_type_id__volatile)) {
304 		GType valadoc_content_style_attributes_type_id;
305 		valadoc_content_style_attributes_type_id = valadoc_content_style_attributes_get_type_once ();
306 		g_once_init_leave (&valadoc_content_style_attributes_type_id__volatile, valadoc_content_style_attributes_type_id);
307 	}
308 	return valadoc_content_style_attributes_type_id__volatile;
309 }
310 
311