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