author | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
---|---|---|
committer | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
commit | 73253e93327cf4ef0932de1b4afb56af22a0f37e (patch) (unidiff) | |
tree | 1c9a7a6dd3341e036a894d348a3372525d29acec /noncore/apps/opie-reader/Aportis.h | |
parent | e90847c784c48bd21bf8768cb38edb853b832697 (diff) | |
download | opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.zip opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.gz opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.bz2 |
updated source to opie-reader 0.7g
Diffstat (limited to 'noncore/apps/opie-reader/Aportis.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/Aportis.h | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/noncore/apps/opie-reader/Aportis.h b/noncore/apps/opie-reader/Aportis.h index 202a36f..5e9d1da 100644 --- a/noncore/apps/opie-reader/Aportis.h +++ b/noncore/apps/opie-reader/Aportis.h | |||
@@ -1,19 +1,18 @@ | |||
1 | /* | 1 | /* |
2 | Derived from makedoc9 by Pat Beirne | 2 | Derived from makedoc9 by Pat Beirne |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #ifndef __Aportis_h | 5 | #ifndef __Aportis_h |
6 | #define __Aportis_h | 6 | #define __Aportis_h |
7 | #include "useqpe.h" | ||
8 | #include "CExpander.h" | 7 | #include "CExpander.h" |
9 | #include "pdb.h" | 8 | #include "pdb.h" |
10 | 9 | ||
11 | typedef UInt32 DWORD; | 10 | typedef UInt32 DWORD; |
12 | typedef UInt16 WORD; | 11 | typedef UInt16 WORD; |
13 | 12 | ||
14 | #define DISP_BITS 11 | 13 | #define DISP_BITS 11 |
15 | #define COUNT_BITS 3 | 14 | #define COUNT_BITS 3 |
16 | /* | 15 | /* |
17 | // all numbers in these structs are big-endian, MAC format | 16 | // all numbers in these structs are big-endian, MAC format |
18 | struct tDocHeader { | 17 | struct tDocHeader { |
19 | char sName[32]; | 18 | char sName[32]; |
@@ -51,60 +50,54 @@ struct PeanutHeader | |||
51 | ////////////// utilities ////////////////////////////////////// | 50 | ////////////// utilities ////////////////////////////////////// |
52 | 51 | ||
53 | inline WORD SwapWord(WORD r) | 52 | inline WORD SwapWord(WORD r) |
54 | { | 53 | { |
55 | return (r>>8) + (r<<8); | 54 | return (r>>8) + (r<<8); |
56 | } | 55 | } |
57 | 56 | ||
58 | inline DWORD SwapLong(DWORD r) | 57 | inline DWORD SwapLong(DWORD r) |
59 | { | 58 | { |
60 | return ((r>>24) & 0xFF) + (r<<24) + ((r>>8) & 0xFF00) + ((r<<8) & 0xFF0000); | 59 | return ((r>>24) & 0xFF) + (r<<24) + ((r>>8) & 0xFF00) + ((r<<8) & 0xFF0000); |
61 | } | 60 | } |
62 | 61 | ||
63 | class Aportis : public CExpander, Cpdb { | 62 | class Aportis : public Cpdb { |
64 | bool peanutfile; | 63 | bool peanutfile, html; |
65 | void dePeanut(int&); | 64 | void dePeanut(int&); |
66 | DWORD dwLen; | 65 | DWORD dwLen; |
67 | WORD nRecs2; | 66 | WORD nRecs2; |
68 | DWORD dwTLen; | 67 | DWORD dwTLen; |
69 | WORD nRecs; | 68 | WORD nRecs; |
70 | WORD BlockSize; | 69 | WORD BlockSize; |
71 | DWORD dwRecLen; | 70 | DWORD dwRecLen; |
71 | WORD mobiimagerec; | ||
72 | int currentrec, currentpos; | 72 | int currentrec, currentpos; |
73 | unsigned int cbptr; | 73 | unsigned int cbptr; |
74 | unsigned int outptr; | 74 | unsigned int outptr; |
75 | unsigned char circbuf[2048]; | 75 | unsigned char circbuf[2048]; |
76 | char bCompressed; | 76 | char bCompressed; |
77 | public: | 77 | public: |
78 | #ifdef USEQPE | ||
79 | void suspend() | ||
80 | { | ||
81 | CExpander::suspend(fin); | ||
82 | } | ||
83 | void unsuspend() | ||
84 | { | ||
85 | CExpander::unsuspend(fin); | ||
86 | } | ||
87 | #endif | ||
88 | void sizes(unsigned long& _file, unsigned long& _text) | 78 | void sizes(unsigned long& _file, unsigned long& _text) |
89 | { | 79 | { |
80 | qDebug("Calling aportis sizes:(%u,%u,%u)", dwTLen, nRecs, BlockSize); | ||
90 | _file = dwLen; | 81 | _file = dwLen; |
91 | _text = dwTLen; | 82 | _text = dwTLen; |
92 | } | 83 | } |
93 | bool hasrandomaccess() { return true; } | 84 | bool hasrandomaccess() { return true; } |
94 | virtual ~Aportis() {} | 85 | virtual ~Aportis() {} |
95 | Aportis(); | 86 | Aportis(); |
96 | int OpenFile(const char *src); | 87 | int OpenFile(const char *src); |
97 | int getch(); | 88 | int getch(); |
98 | unsigned int locate(); | 89 | unsigned int locate(); |
99 | void locate(unsigned int n); | 90 | void locate(unsigned int n); |
100 | CList<Bkmk>* getbkmklist(); | 91 | CList<Bkmk>* getbkmklist(); |
101 | MarkupType PreferredMarkup() | 92 | MarkupType PreferredMarkup() |
102 | { | 93 | { |
103 | return (peanutfile) ? cPML : cTEXT; | 94 | return (peanutfile) ? cPML : ((html) ? cHTML : cTEXT); |
104 | } | 95 | } |
96 | QImage* getPicture(unsigned long); | ||
97 | QString about() { return QString("AportisDoc codec (c) Tim Wentford"); } | ||
105 | private: | 98 | private: |
106 | bool refreshbuffer(); | 99 | bool refreshbuffer(); |
107 | unsigned int GetBS(unsigned int bn); | 100 | unsigned int GetBS(unsigned int bn); |
108 | }; | 101 | }; |
109 | 102 | ||
110 | #endif | 103 | #endif |