author | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
commit | 876e1a4724a7bd75dc642e295de354241096e028 (patch) (unidiff) | |
tree | a37c5dcc9d78e04bb6b859ab89d8cf81e6745087 /noncore/apps/opie-reader/CDrawBuffer.h | |
parent | 5fd6636ba3d94b48dd543887316c47c5388a43c2 (diff) | |
download | opie-876e1a4724a7bd75dc642e295de354241096e028.zip opie-876e1a4724a7bd75dc642e295de354241096e028.tar.gz opie-876e1a4724a7bd75dc642e295de354241096e028.tar.bz2 |
update - sorry it took so long. hope this works correctly
Diffstat (limited to 'noncore/apps/opie-reader/CDrawBuffer.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/CDrawBuffer.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/noncore/apps/opie-reader/CDrawBuffer.h b/noncore/apps/opie-reader/CDrawBuffer.h index 4d3696e..0d8968c 100644 --- a/noncore/apps/opie-reader/CDrawBuffer.h +++ b/noncore/apps/opie-reader/CDrawBuffer.h | |||
@@ -1,59 +1,76 @@ | |||
1 | #ifndef __CDRAWBUFFER_H | 1 | #ifndef __CDRAWBUFFER_H |
2 | #define __CDRAWBUFFER_H | 2 | #define __CDRAWBUFFER_H |
3 | 3 | ||
4 | #include "StyleConsts.h" | 4 | #include "StyleConsts.h" |
5 | #include "CBuffer.h" | 5 | #include "CBuffer.h" |
6 | #include "my_list.h" | 6 | #include "my_list.h" |
7 | 7 | ||
8 | class QPainter; | 8 | class QPainter; |
9 | 9 | ||
10 | enum linkType | ||
11 | { | ||
12 | eNone, | ||
13 | eLink, | ||
14 | ePicture | ||
15 | }; | ||
16 | |||
10 | struct textsegment | 17 | struct textsegment |
11 | { | 18 | { |
12 | int start; | 19 | int start; |
13 | CStyle style; | 20 | CStyle style; |
14 | textsegment(int _start, CStyle _style) | 21 | textsegment(int _start, const CStyle& _style) |
15 | : | 22 | : |
16 | start(_start), style(_style) | 23 | start(_start), style(_style) |
17 | {} | 24 | {} |
18 | }; | 25 | }; |
19 | 26 | ||
20 | class FontControl; | 27 | class FontControl; |
21 | 28 | ||
22 | class CDrawBuffer : public CBuffer | 29 | class CDrawBuffer : public CBuffer |
23 | { | 30 | { |
24 | CList<textsegment> segs; | 31 | CList<textsegment> segs; |
25 | int len; | 32 | int len; |
26 | FontControl* fc; | 33 | FontControl* fc; |
27 | int m_maxstyle, m_ascent, m_descent, m_lineSpacing; | 34 | int m_maxstyle, m_ascent, m_descent, m_lineSpacing, m_lineExtraSpacing; |
35 | bool m_bEof; | ||
36 | CDrawBuffer(const CDrawBuffer&); | ||
37 | CDrawBuffer& operator=(const tchar*sztmp); | ||
28 | public: | 38 | public: |
39 | int leftMargin(); | ||
40 | int rightMargin(); | ||
41 | void setEof() { m_bEof = true; } | ||
42 | bool eof() { return m_bEof; } | ||
43 | CDrawBuffer& operator=(CDrawBuffer&); | ||
29 | CDrawBuffer(FontControl* _fs = NULL) | 44 | CDrawBuffer(FontControl* _fs = NULL) |
30 | : | 45 | : |
31 | fc(_fs) | 46 | fc(_fs) |
32 | { | 47 | { |
33 | empty(); | 48 | empty(); |
34 | } | 49 | } |
50 | ~CDrawBuffer(); | ||
35 | /* | 51 | /* |
36 | CDrawBuffer() | 52 | CDrawBuffer() |
37 | : | 53 | : |
38 | size(0) | 54 | size(0) |
39 | { | 55 | { |
40 | empty(); | 56 | empty(); |
41 | } | 57 | } |
42 | */ | 58 | */ |
43 | int width(int numchars = -1); | 59 | int width(int numchars = -1); |
60 | int offset(int); | ||
44 | void render(QPainter* _p, int _y, bool _bMono, int _charWidth, int scw); | 61 | 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(); | 62 | void empty(); |
48 | void addch(tchar ch, CStyle _style); | 63 | void addch(tchar ch, CStyle _style); |
49 | void truncate(int); | 64 | void truncate(int); |
50 | void setright(CDrawBuffer&, int); | 65 | void setright(CDrawBuffer&, int); |
51 | CStyle laststyle(); | 66 | CStyle laststyle(); |
52 | int ascent() { return m_ascent; } | 67 | int ascent() { return m_ascent; } |
53 | int descent() { return m_descent; } | 68 | int descent() { return m_descent; } |
54 | int lineSpacing() { return m_lineSpacing; } | 69 | int lineSpacing() { return m_lineSpacing; } |
70 | int lineExtraSpacing() { return m_lineExtraSpacing; } | ||
55 | 71 | ||
56 | // void frig(); | 72 | // void frig(); |
57 | bool isLink(int numchars, size_t& tgt); | 73 | linkType getLinkType(int numchars, size_t& tgt); |
74 | void resize(); | ||
58 | }; | 75 | }; |
59 | #endif | 76 | #endif |