summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/CDrawBuffer.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/CDrawBuffer.h b/noncore/apps/opie-reader/CDrawBuffer.h
new file mode 100644
index 0000000..4d3696e
--- a/dev/null
+++ b/noncore/apps/opie-reader/CDrawBuffer.h
@@ -0,0 +1,59 @@
1#ifndef __CDRAWBUFFER_H
2#define __CDRAWBUFFER_H
3
4#include "StyleConsts.h"
5#include "CBuffer.h"
6#include "my_list.h"
7
8class QPainter;
9
10struct textsegment
11{
12 int start;
13 CStyle style;
14 textsegment(int _start, CStyle _style)
15 :
16 start(_start), style(_style)
17 {}
18};
19
20class FontControl;
21
22class CDrawBuffer : public CBuffer
23{
24 CList<textsegment> segs;
25 int len;
26 FontControl* fc;
27 int m_maxstyle, m_ascent, m_descent, m_lineSpacing;
28 public:
29 CDrawBuffer(FontControl* _fs = NULL)
30 :
31 fc(_fs)
32 {
33 empty();
34 }
35/*
36 CDrawBuffer()
37 :
38 size(0)
39 {
40 empty();
41 }
42*/
43 int width(int numchars = -1);
44 void render(QPainter* _p, int _y, bool _bMono, int _charWidth, int scw);
45 CDrawBuffer& operator=(const tchar*sztmp);
46 CDrawBuffer& operator=(CDrawBuffer&);
47 void empty();
48 void addch(tchar ch, CStyle _style);
49 void truncate(int);
50 void setright(CDrawBuffer&, int);
51 CStyle laststyle();
52 int ascent() { return m_ascent; }
53 int descent() { return m_descent; }
54 int lineSpacing() { return m_lineSpacing; }
55
56// void frig();
57 bool isLink(int numchars, size_t& tgt);
58};
59#endif