]> git.lyx.org Git - lyx.git/blob - src/mathed/TextPainter.h
This commit saves the need to check for lyx::use_gui in a number of places.
[lyx.git] / src / mathed / TextPainter.h
1 // -*- C++ -*-
2 /**
3  * \file TextPainter.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef TEXTPAINTER_H
13 #define TEXTPAINTER_H
14
15
16 #include "support/docstream.h"
17
18 #include <vector>
19
20 class TextPainter {
21         public:
22                 ///
23                 TextPainter(int xmax, int ymax);
24                 ///
25                 void draw(int x, int y, char const * str);
26                 ///
27                 void draw(int x, int y, char c);
28                 ///
29                 void show(lyx::odocstream & os, int offset = 0) const;
30                 ///
31                 int textheight() const { return ymax_; }
32                 ///
33                 void horizontalLine(int x, int y, int len, char c = '-');
34                 ///
35                 void verticalLine(int x, int y, int len, char c = '|');
36
37         private:
38                 ///
39                 typedef std::vector<char> data_type;
40                 ///
41                 char at(int x, int y) const;
42                 ///
43                 char & at(int x, int y);
44
45                 /// xsize of the painter area
46                 int xmax_;
47                 /// ysize of the painter area
48                 int ymax_;
49                 /// the image
50                 data_type data_;
51 };
52
53 #endif