mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 13:46:43 +00:00
1f9e9cf517
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7574 a592a061-630c-0410-9148-cb99ea01b6c8
53 lines
992 B
C++
53 lines
992 B
C++
// -*- C++ -*-
|
|
/**
|
|
* \file textpainter.h
|
|
* 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.
|
|
*/
|
|
|
|
#ifndef TEXTPAINTER_H
|
|
#define TEXTPAINTER_H
|
|
|
|
|
|
#include <vector>
|
|
#include <iosfwd>
|
|
|
|
class TextPainter {
|
|
public:
|
|
///
|
|
TextPainter(int xmax, int ymax);
|
|
///
|
|
void draw(int x, int y, char const * str);
|
|
///
|
|
void draw(int x, int y, char c);
|
|
///
|
|
void show(std::ostream & os, int offset = 0) const;
|
|
///
|
|
int textheight() const { return ymax_; }
|
|
///
|
|
void horizontalLine(int x, int y, int len, char c = '-');
|
|
///
|
|
void verticalLine(int x, int y, int len, char c = '|');
|
|
|
|
private:
|
|
///
|
|
typedef std::vector<char> data_type;
|
|
///
|
|
char at(int x, int y) const;
|
|
///
|
|
char & at(int x, int y);
|
|
|
|
/// xsize of the painter area
|
|
int xmax_;
|
|
/// ysize of the painter area
|
|
int ymax_;
|
|
/// the image
|
|
data_type data_;
|
|
};
|
|
|
|
#endif
|