]> git.lyx.org Git - lyx.git/blob - src/mathed/textpainter.h
Jean-Marc's fix for wrong descent
[lyx.git] / src / mathed / textpainter.h
1 #ifndef TEXTPAINTER_H
2 #define TEXTPAINTER_H
3
4
5 #include <vector>
6 #include <iosfwd>
7
8 class TextPainter {
9         public:
10                 ///
11                 TextPainter(int xmax, int ymax);
12                 ///
13                 void draw(int x, int y, char const * str);
14                 ///
15                 void draw(int x, int y, char c);
16                 ///
17                 void show(std::ostream & os, int offset = 0) const;
18                 ///
19                 int textheight() const { return ymax_; }
20                 ///
21                 void horizontalLine(int x, int y, int len, char c = '-');
22                 ///
23                 void verticalLine(int x, int y, int len, char c = '|');
24
25         private:
26                 ///
27                 typedef std::vector<char> data_type;
28                 ///
29                 char at(int x, int y) const;
30                 ///
31                 char & at(int x, int y);
32
33                 /// xsize of the painter area
34                 int xmax_;
35                 /// ysize of the painter area
36                 int ymax_;
37                 /// the image
38                 data_type data_;
39 };
40
41 #endif