summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/plucker.h
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/plucker.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/plucker.h86
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
10struct CPlucker_dataRecord
11{
12 UInt16 uid;
13 UInt16 nParagraphs;
14 UInt16 size;
15 UInt8 type;
16 UInt8 reserved;
17};
18
19struct CPlucker_record0
20{
21 UInt16 uid;
22 UInt16 version;
23 UInt16 nRecords;
24};
25
26struct CPluckerbkmk
27{
28 UInt32 offset;
29 tchar title[MAX_BMRK_LENGTH];
30};
31
32
33const UInt32 CPLUCKER_ID = 0x5458547a;
34
35class 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