]> git.lyx.org Git - lyx.git/blob - src/mathed/math_support.h
Make Helge happy: no more crash on arrow up/down in math macro
[lyx.git] / src / mathed / math_support.h
1 // -*- C++ -*-
2 /**
3  * \file math_support.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author André Pönitz
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef MATH_SUPPORT_H
14 #define MATH_SUPPORT_H
15
16 #include <string>
17
18 class PainterInfo;
19 class LyXFont;
20 class Dimension;
21 class MathArray;
22 class MathAtom;
23 class MathInset;
24
25
26 void mathed_char_dim(LyXFont const &, unsigned char c, Dimension & dim);
27 int mathed_char_width(LyXFont const &, unsigned char c);
28 int mathed_char_ascent(LyXFont const &, unsigned char c);
29 int mathed_char_descent(LyXFont const &, unsigned char c);
30
31 void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
32         std::string const & name);
33
34 void mathed_string_dim(LyXFont const & font, std::string const & s, Dimension & dim);
35 int mathed_string_width(LyXFont const &, std::string const & s);
36
37 void drawStr(PainterInfo & pi,
38         LyXFont const &, int x, int y, std::string const & s);
39 void drawStrRed(PainterInfo & pi, int x, int y, std::string const & s);
40 void drawStrBlack(PainterInfo & pi, int x, int y, std::string const & s);
41 void drawChar(PainterInfo & pi, LyXFont const & font, int x, int y, char c);
42
43 void math_font_max_dim(LyXFont const &, int & asc, int & desc);
44
45 void augmentFont(LyXFont & f, std::string const & cmd);
46
47 bool isFontName(std::string const & name);
48
49 // converts single cell to string
50 std::string asString(MathArray const & ar);
51 // converts single inset to string
52 std::string asString(MathInset const &);
53 std::string asString(MathAtom const &);
54 // converts string to single cell
55 void asArray(std::string const & str, MathArray & ar);
56
57 #endif