]> git.lyx.org Git - lyx.git/blob - src/mathed/math_defs.h
mathed95.diff
[lyx.git] / src / mathed / math_defs.h
1 // -*- C++ -*-
2 /*
3  *  File:        math_defs.h
4  *  Purpose:     Math editor definitions 
5  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
6  *  Created:     January 1996
7  *  Description: Math paragraph and objects for a WYSIWYG math editor.
8  *
9  *  Dependencies: Xlib
10  *
11  *  Copyright: 1996, 1997 Alejandro Aguilar Sierra
12  *
13  *   Version: 0.8beta, Math & Lyx project.
14  *
15  *   You are free to use and modify this code under the terms of
16  *   the GNU General Public Licence version 2 or later.
17  * 
18  */
19
20 #ifndef MATH_DEFS
21 #define MATH_DEFS
22
23 #ifdef __GNUG__
24 #pragma interface
25 #endif
26
27
28 /// Standard Math Sizes (Math mode styles)
29 enum MathStyles {
30         ///
31         LM_ST_DISPLAY = 0,
32         ///
33         LM_ST_TEXT,
34         ///
35         LM_ST_SCRIPT,
36         ///
37         LM_ST_SCRIPTSCRIPT
38 };
39
40 // decrease math size for super- and subscripts
41 MathStyles smallerStyleScript(MathStyles);
42
43 // decrease math size for fractions
44 MathStyles smallerStyleFrac(MathStyles st);
45
46
47
48 /** The restrictions of a standard LaTeX math paragraph
49   allows to get a small number of text codes (<30) */
50 enum MathTextCodes  {
51         /// This must be >= 0
52         LM_TC_MIN = 0,
53         /// Open and Close group
54         LM_TC_OPEN,
55         ///
56         LM_TC_CLOSE,
57         /// Math Inset
58         LM_TC_INSET,
59         /// Super and sub scripts
60         LM_TC_UP,
61         ///
62         LM_TC_DOWN,
63         /// Editable Math Inset
64         LM_TC_ACTIVE_INSET,
65         /// Editable Text Inset
66         LM_TC_TEXT_INSET,
67         ///
68         LM_FONT_BEGIN,
69         /// Internal code for constants  11
70         LM_TC_CONST,
71         /// Internal code for variables
72         LM_TC_VAR,
73         ///
74         LM_TC_RM,
75         ///
76         LM_TC_CAL,
77         ///
78         LM_TC_BF,
79         ///
80         LM_TC_SF,
81         ///
82         LM_TC_TT,
83         ///
84         LM_TC_IT,
85         ///
86         LM_TC_TEXTRM,
87         /// Math mode TeX characters ",;:{}"  20
88         LM_TC_TEX,
89         /// Special characters "{}&#_%"
90         LM_TC_SPECIAL,
91         /// Internal code for operators  22
92         LM_TC_BOP,
93         /// Internal code for symbols
94         LM_TC_SYMB,
95         ///
96         LM_TC_BOPS,
97         ///
98         LM_TC_BSYM,
99         ///
100         LM_FONT_END,
101         
102         /// This must be < 32 
103         LM_TC_MAX
104 };
105
106
107 /// Types of lyx-math insets 
108 enum MathInsetTypes  {
109         ///
110         LM_OT_SIMPLE = 0,
111         ///
112         LM_OT_EQUATION,
113         /// 
114         LM_OT_EQNARRAY,
115         ///
116         LM_OT_ALIGN,
117         ///
118         LM_OT_ALIGNAT,
119         ///
120         LM_OT_XALIGN,
121         ///
122         LM_OT_XXALIGN,
123         ///
124         LM_OT_MULTLINE,
125         /// An array
126         LM_OT_MATRIX,
127
128         /// A big operator
129         LM_OT_BIGOP,
130         /// A LaTeX macro
131         LM_OT_UNDEF,
132         ///
133         LM_OT_FUNC,
134         ///
135         LM_OT_FUNCLIM,
136         ///
137         LM_OT_SCRIPT,
138         ///
139         LM_OT_SPACE,
140         ///
141         LM_OT_DOTS,
142         /// A fraction
143         LM_OT_FRAC,
144         ///
145         LM_OT_ATOP,
146         ///
147         LM_OT_STACKREL,
148         /// A radical
149         LM_OT_SQRT,
150         /// A delimiter
151         LM_OT_DELIM,
152         /// A decoration
153         LM_OT_DECO,
154         /// An accent
155         LM_OT_ACCENT,
156         ///
157         LM_OT_MACRO,
158         ///
159         LM_OT_MAX
160 };
161
162
163 ///
164 enum MathBinaryTypes {
165         ///
166         LMB_NONE = 0,
167         ///
168         LMB_RELATION,
169         ///
170         LMB_OPERATOR,
171         ///
172         LMB_BOP = (LMB_RELATION | LMB_OPERATOR)
173 };
174
175
176 /// Paragraph permissions
177 enum MathParFlag {
178         LMPF_BASIC = 0,
179         /// If false can use a non-standard size
180         LMPF_FIXED_SIZE = 1,
181         /// If true can insert newlines 
182         LMPF_ALLOW_CR  = 2,
183         /// If true can use tabs
184         LMPF_ALLOW_TAB = 4,
185         /// If true can insert new columns
186         LMPF_ALLOW_NEW_COL = 8,
187         /// Smaller than current size (frac)
188         LMPF_SMALLER = 16,
189         /// Script size (subscript, stackrel)
190         LMPF_SCRIPT = 32
191 };
192
193 #endif