1 /* Lasem - SVG and Mathml library
2  *
3  * Copyright © 2009-2010  Emmanuel Pacaud
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General
16  * Public License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18  * Boston, MA 02111-1307, USA.
19  *
20  * Author:
21  * 	Emmanuel Pacaud <emmanuel@gnome.org>
22  */
23 
24 #ifndef LSM_TRAITS_H
25 #define LSM_TRAITS_H
26 
27 #include <lsmtypes.h>
28 
29 G_BEGIN_DECLS
30 
31 typedef void LsmTrait;
32 
33 typedef struct {
34 	size_t		size;
35 	void 		(*init)			(LsmTrait *abstract_trait, const LsmTrait *trait_default);
36 	void 		(*finalize)		(LsmTrait *abstract_trait);
37 	gboolean	(*from_string)		(LsmTrait *abstract_trait, char *string);
38 	char * 		(*to_string)		(LsmTrait *abstract_trait);
39 } LsmTraitClass;
40 
41 extern const LsmTraitClass lsm_null_trait_class;
42 extern const LsmTraitClass lsm_boolean_trait_class;
43 extern const LsmTraitClass lsm_integer_trait_class;
44 extern const LsmTraitClass lsm_double_trait_class;
45 extern const LsmTraitClass lsm_box_trait_class;
46 
47 int 	lsm_enum_value_from_string 	(const char *string, const char **strings, unsigned int n_strings);
48 
49 G_END_DECLS
50 
51 #endif
52