]> git.lyx.org Git - lyx.git/blob - src/mathed/math_defs.h
Small bugfixes and cosmetic changes
[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_MACRO,
138         ///
139         LM_OT_MAX
140 };
141
142
143 ///
144 enum MathBinaryTypes {
145         ///
146         LMB_NONE = 0,
147         ///
148         LMB_RELATION,
149         ///
150         LMB_OPERATOR,
151         ///
152         LMB_BOP = (LMB_RELATION | LMB_OPERATOR)
153 };
154
155
156 /// Paragraph permissions
157 enum MathParFlag {
158         LMPF_BASIC = 0,
159         /// If false can use a non-standard size
160         LMPF_FIXED_SIZE = 1,
161         /// If true can insert newlines 
162         LMPF_ALLOW_CR  = 2,
163         /// If true can use tabs
164         LMPF_ALLOW_TAB = 4,
165         /// If true can insert new columns
166         LMPF_ALLOW_NEW_COL = 8,
167         /// Smaller than current size (frac)
168         LMPF_SMALLER = 16,
169         /// Script size (subscript, stackrel)
170         LMPF_SCRIPT = 32
171 };
172
173 #endif