blob: 4d3696ea78341dd332258d6b563e95f468a16f21 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
#ifndef __CDRAWBUFFER_H
#define __CDRAWBUFFER_H
#include "StyleConsts.h"
#include "CBuffer.h"
#include "my_list.h"
class QPainter;
struct textsegment
{
int start;
CStyle style;
textsegment(int _start, CStyle _style)
:
start(_start), style(_style)
{}
};
class FontControl;
class CDrawBuffer : public CBuffer
{
CList<textsegment> segs;
int len;
FontControl* fc;
int m_maxstyle, m_ascent, m_descent, m_lineSpacing;
public:
CDrawBuffer(FontControl* _fs = NULL)
:
fc(_fs)
{
empty();
}
/*
CDrawBuffer()
:
size(0)
{
empty();
}
*/
int width(int numchars = -1);
void render(QPainter* _p, int _y, bool _bMono, int _charWidth, int scw);
CDrawBuffer& operator=(const tchar*sztmp);
CDrawBuffer& operator=(CDrawBuffer&);
void empty();
void addch(tchar ch, CStyle _style);
void truncate(int);
void setright(CDrawBuffer&, int);
CStyle laststyle();
int ascent() { return m_ascent; }
int descent() { return m_descent; }
int lineSpacing() { return m_lineSpacing; }
// void frig();
bool isLink(int numchars, size_t& tgt);
};
#endif
|