-#include <iostream>
+/**
+ * \file textpainter.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
#include "textpainter.h"
+#include "support/std_ostream.h"
TextPainter::TextPainter(int xmax, int ymax)
void TextPainter::draw(int x, int y, char const * str)
{
- //cerr << "drawing string '" << str << "' at " << x << "," << y << "\n";
+ //cerr << "drawing string '" << str << "' at " << x << ',' << y << endl;
for (int i = 0; *str && x + i < xmax_; ++i, ++str)
at(x + i, y) = *str;
//show();
void TextPainter::draw(int x, int y, char c)
{
- //cerr << "drawing char '" << c << "' at " << x << "," << y << "\n";
+ //cerr << "drawing char '" << c << "' at " << x << ',' << y << endl;
at(x, y) = c;
//show();
}
-void TextPainter::show(std::ostream & os) const
+void TextPainter::show(std::ostream & os, int offset) const
{
os << '\n';
for (int j = 0; j <= ymax_; ++j) {
+ for (int i = 0; i < offset; ++i)
+ os << ' ';
for (int i = 0; i < xmax_; ++i)
os << at(i, j);
os << '\n';