summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/CDrawBuffer.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/CDrawBuffer.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/CDrawBuffer.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/noncore/apps/opie-reader/CDrawBuffer.h b/noncore/apps/opie-reader/CDrawBuffer.h
index 0d8968c..9ec0ed9 100644
--- a/noncore/apps/opie-reader/CDrawBuffer.h
+++ b/noncore/apps/opie-reader/CDrawBuffer.h
@@ -1,73 +1,70 @@
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#include "linktype.h"
7 8
8class QPainter; 9class QPainter;
9 10
10enum linkType
11{
12 eNone,
13 eLink,
14 ePicture
15};
16
17struct textsegment 11struct textsegment
18{ 12{
19 int start; 13 int start;
20 CStyle style; 14 CStyle style;
21 textsegment(int _start, const CStyle& _style) 15 textsegment(int _start, const CStyle& _style)
22 : 16 :
23 start(_start), style(_style) 17 start(_start), style(_style)
24 {} 18 {}
25}; 19};
26 20
27class FontControl; 21class FontControl;
28 22
29class CDrawBuffer : public CBuffer 23class CDrawBuffer : public CBuffer
30{ 24{
31 CList<textsegment> segs; 25 CList<textsegment> segs;
32 int len; 26 int len;
33 FontControl* fc; 27 FontControl* fc;
34 int m_maxstyle, m_ascent, m_descent, m_lineSpacing, m_lineExtraSpacing; 28 int m_maxstyle, m_ascent, m_descent, m_lineSpacing, m_lineExtraSpacing;
35 bool m_bEof; 29 bool m_bEof;
30 bool m_bSop, m_bEop;
36 CDrawBuffer(const CDrawBuffer&); 31 CDrawBuffer(const CDrawBuffer&);
37 CDrawBuffer& operator=(const tchar*sztmp); 32 CDrawBuffer& operator=(const tchar*sztmp);
38 public: 33 public:
34 void setstartpara() { m_bSop = true; }
35 void setendpara() { m_bEop = true; }
39 int leftMargin(); 36 int leftMargin();
40 int rightMargin(); 37 int rightMargin();
41 void setEof() { m_bEof = true; } 38 void setEof() { m_bEof = true; }
42 bool eof() { return m_bEof; } 39 bool eof() { return m_bEof; }
43 CDrawBuffer& operator=(CDrawBuffer&); 40 CDrawBuffer& operator=(CDrawBuffer&);
44 CDrawBuffer(FontControl* _fs = NULL) 41 CDrawBuffer(FontControl* _fs = NULL)
45 : 42 :
46 fc(_fs) 43 fc(_fs)
47 { 44 {
48 empty(); 45 empty();
49 } 46 }
50 ~CDrawBuffer(); 47 ~CDrawBuffer();
51/* 48/*
52 CDrawBuffer() 49 CDrawBuffer()
53 : 50 :
54 size(0) 51 size(0)
55 { 52 {
56 empty(); 53 empty();
57 } 54 }
58*/ 55*/
59 int width(int numchars = -1); 56 int width(int numchars = -1, bool onscreen = false, int scwidth = 0, unsigned char _border = 0);
60 int offset(int); 57 int offset(int, unsigned char);
61 void render(QPainter* _p, int _y, bool _bMono, int _charWidth, int scw); 58 void render(QPainter* _p, int _y, bool _bMono, int _charWidth, int scw, unsigned char);
62 void empty(); 59 void empty();
63 void addch(tchar ch, CStyle _style); 60 void addch(tchar ch, CStyle _style);
64 void truncate(int); 61 void truncate(int);
65 void setright(CDrawBuffer&, int); 62 void setright(CDrawBuffer&, int);
66 CStyle laststyle(); 63 CStyle laststyle();
67 int ascent() { return m_ascent; } 64 int ascent() { return m_ascent; }
68 int descent() { return m_descent; } 65 int descent() { return m_descent; }
69 int lineSpacing() { return m_lineSpacing; } 66 int lineSpacing() { return m_lineSpacing; }
70 int lineExtraSpacing() { return m_lineExtraSpacing; } 67 int lineExtraSpacing() { return m_lineExtraSpacing; }
71 68
72// void frig(); 69// void frig();
73 linkType getLinkType(int numchars, size_t& tgt); 70 linkType getLinkType(int numchars, size_t& tgt);