1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/*
|
|
|
|
* File: math_defs.h
|
|
|
|
* Purpose: Math editor definitions
|
|
|
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
|
|
|
* Created: January 1996
|
|
|
|
* Description: Math paragraph and objects for a WYSIWYG math editor.
|
|
|
|
*
|
|
|
|
* Dependencies: Xlib
|
|
|
|
*
|
2000-03-09 03:36:48 +00:00
|
|
|
* Copyright: 1996, 1997 Alejandro Aguilar Sierra
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
2001-06-25 00:06:33 +00:00
|
|
|
* Version: 0.8beta, Math & Lyx project.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* You are free to use and modify this code under the terms of
|
|
|
|
* the GNU General Public Licence version 2 or later.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
1999-10-02 16:21:10 +00:00
|
|
|
#ifndef MATH_DEFS
|
|
|
|
#define MATH_DEFS
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/// Standard Math Sizes (Math mode styles)
|
2001-06-25 00:06:33 +00:00
|
|
|
enum MathStyles {
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-12-07 00:44:53 +00:00
|
|
|
LM_ST_DISPLAY = 0,
|
|
|
|
///
|
|
|
|
LM_ST_TEXT,
|
|
|
|
///
|
|
|
|
LM_ST_SCRIPT,
|
|
|
|
///
|
|
|
|
LM_ST_SCRIPTSCRIPT
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
2001-07-06 12:09:32 +00:00
|
|
|
// decrease math size for super- and subscripts
|
|
|
|
MathStyles smallerStyleScript(MathStyles);
|
|
|
|
|
|
|
|
// decrease math size for fractions
|
|
|
|
MathStyles smallerStyleFrac(MathStyles st);
|
|
|
|
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/** The restrictions of a standard LaTeX math paragraph
|
|
|
|
allows to get a small number of text codes (<30) */
|
2001-06-25 00:06:33 +00:00
|
|
|
enum MathTextCodes {
|
1999-12-07 00:44:53 +00:00
|
|
|
/// This must be >= 0
|
|
|
|
LM_TC_MIN = 0,
|
|
|
|
/// Math Inset
|
|
|
|
LM_TC_INSET,
|
2001-07-09 16:59:57 +00:00
|
|
|
|
1999-12-07 00:44:53 +00:00
|
|
|
///
|
|
|
|
LM_FONT_BEGIN,
|
|
|
|
/// Internal code for variables
|
|
|
|
LM_TC_VAR,
|
|
|
|
///
|
2001-08-17 15:47:02 +00:00
|
|
|
LM_TC_CONST,
|
|
|
|
///
|
1999-12-07 00:44:53 +00:00
|
|
|
LM_TC_RM,
|
|
|
|
///
|
|
|
|
LM_TC_CAL,
|
|
|
|
///
|
|
|
|
LM_TC_BF,
|
|
|
|
///
|
|
|
|
LM_TC_SF,
|
|
|
|
///
|
|
|
|
LM_TC_TT,
|
|
|
|
///
|
|
|
|
LM_TC_IT,
|
|
|
|
///
|
|
|
|
LM_TC_TEXTRM,
|
2001-08-13 14:02:37 +00:00
|
|
|
/// Math mode TeX characters ",;:{}"
|
1999-12-07 00:44:53 +00:00
|
|
|
LM_TC_TEX,
|
|
|
|
/// Special characters "{}&#_%"
|
|
|
|
LM_TC_SPECIAL,
|
2001-08-13 14:02:37 +00:00
|
|
|
/// Internal code when typing greek
|
|
|
|
LM_TC_GREEK,
|
|
|
|
/// Internal code when typing a single greek character
|
|
|
|
LM_TC_GREEK1,
|
1999-12-07 00:44:53 +00:00
|
|
|
/// Internal code for symbols
|
|
|
|
LM_TC_SYMB,
|
2001-07-26 15:28:45 +00:00
|
|
|
/// Internal code for symbols that get bigger in displayed math
|
1999-12-07 00:44:53 +00:00
|
|
|
LM_TC_BSYM,
|
|
|
|
///
|
|
|
|
LM_FONT_END,
|
|
|
|
|
|
|
|
/// This must be < 32
|
|
|
|
LM_TC_MAX
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
2001-02-13 19:10:18 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Types of lyx-math insets
|
2001-06-25 00:06:33 +00:00
|
|
|
enum MathInsetTypes {
|
2001-02-03 21:02:22 +00:00
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
LM_OT_SIMPLE = 0,
|
2001-02-11 09:58:20 +00:00
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
LM_OT_EQUATION,
|
|
|
|
///
|
|
|
|
LM_OT_EQNARRAY,
|
|
|
|
///
|
|
|
|
LM_OT_ALIGN,
|
2001-02-11 09:58:20 +00:00
|
|
|
///
|
2001-02-03 21:02:22 +00:00
|
|
|
LM_OT_ALIGNAT,
|
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
LM_OT_XALIGN,
|
2001-02-03 21:02:22 +00:00
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
LM_OT_XXALIGN,
|
2001-02-03 21:02:22 +00:00
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
LM_OT_MULTLINE,
|
1999-12-07 00:44:53 +00:00
|
|
|
/// An array
|
|
|
|
LM_OT_MATRIX,
|
2001-02-03 21:02:22 +00:00
|
|
|
|
1999-12-07 00:44:53 +00:00
|
|
|
/// A LaTeX macro
|
|
|
|
LM_OT_UNDEF,
|
|
|
|
///
|
|
|
|
LM_OT_FUNCLIM,
|
|
|
|
///
|
|
|
|
LM_OT_MACRO,
|
|
|
|
///
|
|
|
|
LM_OT_MAX
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
2001-02-13 19:10:18 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
enum MathBinaryTypes {
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-12-07 00:44:53 +00:00
|
|
|
LMB_NONE = 0,
|
|
|
|
///
|
|
|
|
LMB_RELATION,
|
|
|
|
///
|
|
|
|
LMB_OPERATOR,
|
|
|
|
///
|
|
|
|
LMB_BOP = (LMB_RELATION | LMB_OPERATOR)
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/// Paragraph permissions
|
2001-06-25 00:06:33 +00:00
|
|
|
enum MathParFlag {
|
1999-12-07 00:44:53 +00:00
|
|
|
LMPF_BASIC = 0,
|
|
|
|
/// If false can use a non-standard size
|
|
|
|
LMPF_FIXED_SIZE = 1,
|
|
|
|
/// If true can insert newlines
|
|
|
|
LMPF_ALLOW_CR = 2,
|
|
|
|
/// If true can use tabs
|
|
|
|
LMPF_ALLOW_TAB = 4,
|
|
|
|
/// If true can insert new columns
|
|
|
|
LMPF_ALLOW_NEW_COL = 8,
|
|
|
|
/// Smaller than current size (frac)
|
|
|
|
LMPF_SMALLER = 16,
|
|
|
|
/// Script size (subscript, stackrel)
|
|
|
|
LMPF_SCRIPT = 32
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|