author | llornkcor <llornkcor> | 2002-09-14 02:19:09 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-09-14 02:19:09 (UTC) |
commit | 2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975 (patch) (unidiff) | |
tree | eeed16b5f80dd5883991a7a06133f5f7a6936256 /noncore/apps/opie-reader/plucker.h | |
parent | 5a95ed6a000a56849b8f093deea500214856c626 (diff) | |
download | opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.zip opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.tar.gz opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.tar.bz2 |
update by Tim
Diffstat (limited to 'noncore/apps/opie-reader/plucker.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/plucker.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/plucker.h b/noncore/apps/opie-reader/plucker.h new file mode 100644 index 0000000..84e855c --- a/dev/null +++ b/noncore/apps/opie-reader/plucker.h | |||
@@ -0,0 +1,86 @@ | |||
1 | #ifndef __plucker_h | ||
2 | #define __plucker_h | ||
3 | |||
4 | #include "CExpander.h" | ||
5 | #include <zlib.h> | ||
6 | #include "ztxt.h" | ||
7 | #include "pdb.h" | ||
8 | #include "CBuffer.h" | ||
9 | |||
10 | struct CPlucker_dataRecord | ||
11 | { | ||
12 | UInt16 uid; | ||
13 | UInt16 nParagraphs; | ||
14 | UInt16 size; | ||
15 | UInt8 type; | ||
16 | UInt8 reserved; | ||
17 | }; | ||
18 | |||
19 | struct CPlucker_record0 | ||
20 | { | ||
21 | UInt16 uid; | ||
22 | UInt16 version; | ||
23 | UInt16 nRecords; | ||
24 | }; | ||
25 | |||
26 | struct CPluckerbkmk | ||
27 | { | ||
28 | UInt32 offset; | ||
29 | tchar title[MAX_BMRK_LENGTH]; | ||
30 | }; | ||
31 | |||
32 | |||
33 | const UInt32 CPLUCKER_ID = 0x5458547a; | ||
34 | |||
35 | class CPlucker : public CExpander, Cpdb | ||
36 | { | ||
37 | size_t textlength; | ||
38 | UInt16 uid; | ||
39 | int m_nextPara, m_nextParaIndex; | ||
40 | CBufferFace<UInt16> m_ParaOffsets; | ||
41 | CBufferFace<UInt16> m_ParaAttrs; | ||
42 | UInt16 m_nParas; | ||
43 | CStyle mystyle; | ||
44 | // bool bInit; | ||
45 | UInt32 buffersize; | ||
46 | UInt32 buffercontent; | ||
47 | UInt8* expandedtextbuffer; | ||
48 | UInt8* compressedtextbuffer; | ||
49 | size_t bufferpos; | ||
50 | UInt16 bufferrec; | ||
51 | CPlucker_record0 hdr0; | ||
52 | size_t currentpos; | ||
53 | bool expand(int); | ||
54 | void UnZip(size_t, UInt8*, UInt16); | ||
55 | void UnDoc(size_t, UInt8*, UInt16); | ||
56 | void expandimg(UInt16 tgt); | ||
57 | void home(); | ||
58 | int bgetch(); | ||
59 | public: | ||
60 | virtual void sizes(unsigned long& _file, unsigned long& _text) | ||
61 | { | ||
62 | _file = file_length; | ||
63 | _text = textlength; | ||
64 | //ntohl(hdr0.size); | ||
65 | } | ||
66 | virtual bool hasrandomaccess() { return true; } | ||
67 | virtual ~CPlucker() | ||
68 | { | ||
69 | if (expandedtextbuffer != NULL) delete [] expandedtextbuffer; | ||
70 | if (compressedtextbuffer != NULL) delete [] compressedtextbuffer; | ||
71 | } | ||
72 | CPlucker(); | ||
73 | virtual int openfile(const char *src); | ||
74 | virtual int getch(); | ||
75 | virtual void getch(int&, CStyle&); | ||
76 | virtual unsigned int locate(); | ||
77 | virtual void locate(unsigned int n); | ||
78 | virtual CList<Bkmk>* getbkmklist(); | ||
79 | virtual bool hyperlink(unsigned int n); | ||
80 | virtual MarkupType PreferredMarkup() | ||
81 | { | ||
82 | return cNONE; | ||
83 | } | ||
84 | }; | ||
85 | |||
86 | #endif | ||