1 /* Lasem 2 * 3 * Copyright © 2009 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_MATHML_TRAITS_H 25 #define LSM_MATHML_TRAITS_H 26 27 #include <lsmmathmlenums.h> 28 #include <lsmtraits.h> 29 30 G_BEGIN_DECLS 31 32 #define LSM_MATHML_SPACE_EM_NEGATIVE_VERY_VERY_THIN -0.055556 33 #define LSM_MATHML_SPACE_EM_NEGATIVE_VERY_THIN -0.111111 34 #define LSM_MATHML_SPACE_EM_NEGATIVE_THIN -0.166667 35 #define LSM_MATHML_SPACE_EM_NEGATIVE_MEDIUM -0.222222 36 #define LSM_MATHML_SPACE_EM_NEGATIVE_THICK -0.277778 37 #define LSM_MATHML_SPACE_EM_NEGATIVE_VERY_THICK -0.333333 38 #define LSM_MATHML_SPACE_EM_NEGATIVE_VERY_VERY_THICK -0.388889 39 40 #define LSM_MATHML_SPACE_EM_VERY_VERY_THIN 0.055556 41 #define LSM_MATHML_SPACE_EM_VERY_THIN 0.111111 42 #define LSM_MATHML_SPACE_EM_THIN 0.166667 43 #define LSM_MATHML_SPACE_EM_MEDIUM 0.222222 44 #define LSM_MATHML_SPACE_EM_THICK 0.277778 45 #define LSM_MATHML_SPACE_EM_VERY_THICK 0.333333 46 #define LSM_MATHML_SPACE_EM_VERY_VERY_THICK 0.388889 47 48 #define LSM_TYPE_MATHML_COLOR (lsm_mathml_color_get_type()) 49 50 typedef struct { 51 double red; 52 double green; 53 double blue; 54 double alpha; 55 } LsmMathmlColor; 56 57 GType lsm_mathml_color_get_type (void); 58 59 #define LSM_TYPE_MATHML_LENGTH (lsm_mathml_length_get_type()) 60 61 typedef struct { 62 double value; 63 LsmMathmlUnit unit; 64 } LsmMathmlLength; 65 66 GType lsm_mathml_length_get_type (void); 67 double lsm_mathml_length_normalize (const LsmMathmlLength *length, 68 double base, 69 double font_size); 70 71 typedef struct { 72 LsmMathmlScriptLevelSign sign; 73 int level; 74 } LsmMathmlScriptLevel; 75 76 typedef struct { 77 unsigned int n_values; 78 int *values; 79 } LsmMathmlEnumList; 80 81 #define LSM_TYPE_MATHML_SPACE (lsm_mathml_space_get_type()) 82 83 typedef struct { 84 LsmMathmlSpaceName name; 85 LsmMathmlLength length; 86 } LsmMathmlSpace; 87 88 GType lsm_mathml_space_get_type (void); 89 90 typedef struct { 91 unsigned int n_spaces; 92 LsmMathmlSpace *spaces; 93 } LsmMathmlSpaceList; 94 95 void lsm_mathml_enum_list_init (LsmMathmlEnumList *enum_list, const LsmMathmlEnumList *enum_list_default); 96 void lsm_mathml_space_list_init (LsmMathmlSpaceList *space_list, const LsmMathmlSpaceList *space_list_default); 97 98 extern const LsmTraitClass lsm_mathml_boolean_trait_class; 99 100 extern const LsmTraitClass lsm_mathml_unsigned_trait_class; 101 102 extern const LsmTraitClass lsm_mathml_display_trait_class; 103 extern const LsmTraitClass lsm_mathml_mode_trait_class; 104 extern const LsmTraitClass lsm_mathml_line_trait_class; 105 extern const LsmTraitClass lsm_mathml_font_style_trait_class; 106 extern const LsmTraitClass lsm_mathml_font_weight_trait_class; 107 extern const LsmTraitClass lsm_mathml_variant_trait_class; 108 extern const LsmTraitClass lsm_mathml_form_trait_class; 109 extern const LsmTraitClass lsm_mathml_notation_trait_class; 110 extern const LsmTraitClass lsm_mathml_linebreak_trait_class; 111 112 extern const LsmTraitClass lsm_mathml_row_align_list_trait_class; 113 extern const LsmTraitClass lsm_mathml_column_align_list_trait_class; 114 extern const LsmTraitClass lsm_mathml_line_list_trait_class; 115 116 extern const LsmTraitClass lsm_mathml_script_level_trait_class; 117 118 extern const LsmTraitClass lsm_mathml_double_trait_class; 119 extern const LsmTraitClass lsm_mathml_string_trait_class; 120 extern const LsmTraitClass lsm_mathml_length_trait_class; 121 122 extern const LsmTraitClass lsm_mathml_space_trait_class; 123 extern const LsmTraitClass lsm_mathml_space_list_trait_class; 124 125 extern const LsmTraitClass lsm_mathml_color_trait_class; 126 127 G_END_DECLS 128 129 #endif 130