Diffstat (limited to 'noncore/apps/opie-reader/plucker.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/plucker.h | 61 |
1 files changed, 49 insertions, 12 deletions
diff --git a/noncore/apps/opie-reader/plucker.h b/noncore/apps/opie-reader/plucker.h index d3ca732..083eac6 100644 --- a/noncore/apps/opie-reader/plucker.h +++ b/noncore/apps/opie-reader/plucker.h | |||
@@ -7,4 +7,11 @@ | |||
7 | #include "pdb.h" | 7 | #include "pdb.h" |
8 | #include "CBuffer.h" | 8 | #include "CBuffer.h" |
9 | #include "Navigation.h" | ||
10 | #include "my_list.h" | ||
11 | |||
12 | #ifdef LOCALPICTURES | ||
13 | class QScrollView; | ||
14 | class QWidget; | ||
15 | #endif | ||
9 | 16 | ||
10 | struct CPlucker_dataRecord | 17 | struct CPlucker_dataRecord |
@@ -30,11 +37,20 @@ struct CPluckerbkmk | |||
30 | }; | 37 | }; |
31 | 38 | ||
32 | |||
33 | const UInt32 CPLUCKER_ID = 0x5458547a; | 39 | const UInt32 CPLUCKER_ID = 0x5458547a; |
34 | 40 | ||
35 | class CPlucker : public CExpander, Cpdb | 41 | class CPlucker : public CExpander, Cpdb |
36 | { | 42 | { |
37 | size_t textlength; | 43 | unsigned short finduid(unsigned short); |
44 | char* geturl(UInt16); | ||
45 | void Expand(UInt16, UInt8, UInt8*, UInt16); | ||
46 | CList<unsigned long> visited; | ||
47 | bool m_lastIsBreak; | ||
48 | #ifdef LOCALPICTURES | ||
49 | QScrollView* m_viewer; | ||
50 | QWidget* m_picture; | ||
51 | #endif | ||
52 | size_t textlength, m_lastBreak; | ||
38 | UInt16 uid; | 53 | UInt16 uid; |
54 | UInt8 EOPPhase; | ||
39 | int m_nextPara, m_nextParaIndex; | 55 | int m_nextPara, m_nextParaIndex; |
40 | CBufferFace<UInt16> m_ParaOffsets; | 56 | CBufferFace<UInt16> m_ParaOffsets; |
@@ -47,4 +63,6 @@ class CPlucker : public CExpander, Cpdb | |||
47 | UInt8* expandedtextbuffer; | 63 | UInt8* expandedtextbuffer; |
48 | UInt8* compressedtextbuffer; | 64 | UInt8* compressedtextbuffer; |
65 | char* urls; | ||
66 | size_t urlsize; | ||
49 | size_t bufferpos; | 67 | size_t bufferpos; |
50 | UInt16 bufferrec; | 68 | UInt16 bufferrec; |
@@ -54,22 +72,27 @@ class CPlucker : public CExpander, Cpdb | |||
54 | void UnZip(size_t, UInt8*, UInt16); | 72 | void UnZip(size_t, UInt8*, UInt16); |
55 | void UnDoc(size_t, UInt8*, UInt16); | 73 | void UnDoc(size_t, UInt8*, UInt16); |
56 | void expandimg(UInt16 tgt); | 74 | #ifdef LOCALPICTURES |
75 | void showimg(UInt16 tgt); | ||
76 | #endif | ||
77 | QImage* getimg(UInt16 tgt); | ||
78 | QPixmap* expandimg(UInt16 tgt, bool border=false); | ||
57 | void home(); | 79 | void home(); |
58 | int bgetch(); | 80 | int bgetch(); |
81 | CNavigation m_nav; | ||
59 | public: | 82 | public: |
60 | virtual void sizes(unsigned long& _file, unsigned long& _text) | 83 | virtual void suspend() |
61 | { | 84 | { |
62 | _file = file_length; | 85 | CExpander::suspend(fin); |
63 | _text = textlength; | ||
64 | //ntohl(hdr0.size); | ||
65 | } | 86 | } |
66 | virtual bool hasrandomaccess() { return true; } | 87 | virtual void unsuspend() |
67 | virtual ~CPlucker() | ||
68 | { | 88 | { |
69 | if (expandedtextbuffer != NULL) delete [] expandedtextbuffer; | 89 | CExpander::unsuspend(fin); |
70 | if (compressedtextbuffer != NULL) delete [] compressedtextbuffer; | ||
71 | } | 90 | } |
91 | virtual QPixmap* getPicture(unsigned long tgt); | ||
92 | virtual void sizes(unsigned long& _file, unsigned long& _text); | ||
93 | virtual bool hasrandomaccess() { return true; } | ||
94 | virtual ~CPlucker(); | ||
72 | CPlucker(); | 95 | CPlucker(); |
73 | virtual int openfile(const char *src); | 96 | virtual int OpenFile(const char *src); |
74 | virtual int getch(); | 97 | virtual int getch(); |
75 | virtual void getch(int&, CStyle&); | 98 | virtual void getch(int&, CStyle&); |
@@ -82,4 +105,18 @@ class CPlucker : public CExpander, Cpdb | |||
82 | return cNONE; | 105 | return cNONE; |
83 | } | 106 | } |
107 | void saveposn(size_t posn) { m_nav.saveposn(posn); } | ||
108 | bool forward(size_t& loc) { return m_nav.forward(loc); } | ||
109 | bool back(size_t& loc) { return m_nav.back(loc); } | ||
110 | bool hasnavigation() { return true; } | ||
111 | unsigned long startSection() | ||
112 | { | ||
113 | return currentpos-bufferpos; | ||
114 | } | ||
115 | unsigned long endSection() | ||
116 | { | ||
117 | return startSection()+buffercontent; | ||
118 | } | ||
119 | void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen); | ||
120 | void putSaveData(unsigned char*& src, unsigned short& srclen); | ||
84 | }; | 121 | }; |
85 | 122 | ||