#include "support/std_ostream.h"
+namespace lyx {
+
+
TextPainter::TextPainter(int xmax, int ymax)
: xmax_(xmax), ymax_(ymax), data_(xmax_ * (ymax_ + 1), ' ')
{}
-char & TextPainter::at(int x, int y)
+char_type & TextPainter::at(int x, int y)
{
return data_[y * xmax_ + x];
}
-char TextPainter::at(int x, int y) const
+char_type TextPainter::at(int x, int y) const
{
return data_[y * xmax_ + x];
}
-void TextPainter::draw(int x, int y, char const * str)
+void TextPainter::draw(int x, int y, char_type const * str)
{
//cerr << "drawing string '" << str << "' at " << x << ',' << y << endl;
for (int i = 0; *str && x + i < xmax_; ++i, ++str)
}
-void TextPainter::horizontalLine(int x, int y, int n, char c)
+void TextPainter::horizontalLine(int x, int y, int n, char_type c)
{
for (int i = 0; i < n && i + x < xmax_; ++i)
at(x + i, y) = c;
}
-void TextPainter::verticalLine(int x, int y, int n, char c)
+void TextPainter::verticalLine(int x, int y, int n, char_type c)
{
for (int i = 0; i < n && i + y < ymax_; ++i)
at(x, y + i) = c;
}
-void TextPainter::draw(int x, int y, char c)
+void TextPainter::draw(int x, int y, char_type c)
{
//cerr << "drawing char '" << c << "' at " << x << ',' << y << endl;
at(x, y) = c;
}
-void TextPainter::show(lyx::odocstream & os, int offset) const
+void TextPainter::show(odocstream & os, int offset) const
{
os << '\n';
for (int j = 0; j <= ymax_; ++j) {
os << '\n';
}
}
+
+
+} // namespace lyx