]> git.lyx.org Git - lyx.git/blob - src/mathed/TextPainter.h
Merge branch 'master' of git.lyx.org:lyx
[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
21 namespace lyx {
22
23 // FIXME: Abdel 16/10/2006
24 // This TextPainter class is never used, this is dead code.
25 /* Georg explanation of current situation:
26 AFAIK the text painter was used to export math formulas as ASCII art.
27 The text painter is     like a real painter, but operating on a very coarse
28 grid of character cells where each cell can be filled with an ASCII character.
29 I don't know why it is currently disabled. I do know that we have a bugzilla
30 request for reenabling it.
31 */
32
33 class TextPainter {
34         public:
35                 ///
36                 TextPainter(int xmax, int ymax);
37                 ///
38                 void draw(int x, int y, char_type const * str);
39                 ///
40                 void draw(int x, int y, char_type c);
41                 ///
42                 void show(odocstream & os, int offset = 0) const;
43                 ///
44                 int textheight() const { return ymax_; }
45                 ///
46                 void horizontalLine(int x, int y, int len, char_type c = '-');
47                 ///
48                 void verticalLine(int x, int y, int len, char_type c = '|');
49
50         private:
51                 ///
52                 typedef std::vector<char_type> data_type;
53                 ///
54                 char_type at(int x, int y) const;
55                 ///
56                 char_type & at(int x, int y);
57
58                 /// xsize of the painter area
59                 int xmax_;
60                 /// ysize of the painter area
61                 int ymax_;
62                 /// the image
63                 data_type data_;
64 };
65
66
67 } // namespace lyx
68
69 #endif