2003-08-19 13:00:56 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2006-09-17 09:14:18 +00:00
|
|
|
* \file TextPainter.h
|
2003-08-19 13:00:56 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2003-08-19 13:00:56 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2002-03-18 11:45:53 +00:00
|
|
|
#ifndef TEXTPAINTER_H
|
|
|
|
#define TEXTPAINTER_H
|
|
|
|
|
2002-09-11 09:14:57 +00:00
|
|
|
|
2006-10-11 19:40:50 +00:00
|
|
|
#include "support/docstream.h"
|
|
|
|
|
2002-03-18 11:45:53 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2006-10-16 09:08:05 +00:00
|
|
|
// FIXME: Abdel 16/10/2006
|
|
|
|
// This TextPainter class is never used, this is dead code.
|
|
|
|
/* Georg explanation of current situation:
|
|
|
|
AFAIK the text painter was used to export math formulas as ASCII art.
|
|
|
|
The text painter is like a real painter, but operating on a very coarse
|
|
|
|
grid of character cells where each cell can be filled with an ASCII character.
|
|
|
|
I don't know why it is currently disabled. I do know that we have a bugzilla
|
|
|
|
request for reenabling it.
|
|
|
|
*/
|
|
|
|
|
2002-03-18 11:45:53 +00:00
|
|
|
class TextPainter {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
TextPainter(int xmax, int ymax);
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
void draw(int x, int y, char_type const * str);
|
2002-03-19 16:55:58 +00:00
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
void draw(int x, int y, char_type c);
|
2002-03-19 16:55:58 +00:00
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
void show(odocstream & os, int offset = 0) const;
|
2002-03-19 16:55:58 +00:00
|
|
|
///
|
|
|
|
int textheight() const { return ymax_; }
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
void horizontalLine(int x, int y, int len, char_type c = '-');
|
2002-03-19 16:55:58 +00:00
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
void verticalLine(int x, int y, int len, char_type c = '|');
|
2002-03-18 11:45:53 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
typedef std::vector<char_type> data_type;
|
2002-03-18 11:45:53 +00:00
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
char_type at(int x, int y) const;
|
2002-03-18 11:45:53 +00:00
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
char_type & at(int x, int y);
|
2002-03-18 11:45:53 +00:00
|
|
|
|
2002-03-19 16:55:58 +00:00
|
|
|
/// xsize of the painter area
|
2002-03-18 11:45:53 +00:00
|
|
|
int xmax_;
|
2002-03-19 16:55:58 +00:00
|
|
|
/// ysize of the painter area
|
2002-03-18 11:45:53 +00:00
|
|
|
int ymax_;
|
2002-03-19 16:55:58 +00:00
|
|
|
/// the image
|
|
|
|
data_type data_;
|
2002-03-18 11:45:53 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2002-03-18 11:45:53 +00:00
|
|
|
#endif
|