summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/plucker.h
authorgroucho <groucho>2003-05-07 09:01:39 (UTC)
committer groucho <groucho>2003-05-07 09:01:39 (UTC)
commit118d03d815a7615b9c53363218a7ac45b3f4c514 (patch) (unidiff)
tree356953e2413cddcec0f35bd47bb6439767da7051 /noncore/apps/opie-reader/plucker.h
parent00894537decf01c5a5cdc565b2740b5e67a2e90f (diff)
downloadopie-118d03d815a7615b9c53363218a7ac45b3f4c514.zip
opie-118d03d815a7615b9c53363218a7ac45b3f4c514.tar.gz
opie-118d03d815a7615b9c53363218a7ac45b3f4c514.tar.bz2
Incorporated TimWs current source tree and make it compile
Diffstat (limited to 'noncore/apps/opie-reader/plucker.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/plucker.h123
1 files changed, 18 insertions, 105 deletions
diff --git a/noncore/apps/opie-reader/plucker.h b/noncore/apps/opie-reader/plucker.h
index 083eac6..6d62195 100644
--- a/noncore/apps/opie-reader/plucker.h
+++ b/noncore/apps/opie-reader/plucker.h
@@ -1,123 +1,36 @@
1#ifndef __plucker_h 1#ifndef __plucker_h
2#define __plucker_h 2#define __plucker_h
3 3
4#include "CExpander.h" 4#include "plucker_base.h"
5#include "zlib/zlib.h"
6#include "ztxt.h"
7#include "pdb.h"
8#include "CBuffer.h"
9#include "Navigation.h"
10#include "my_list.h"
11 5
12#ifdef LOCALPICTURES 6#ifdef LOCALPICTURES
13class QScrollView; 7class QScrollView;
14class QWidget; 8class QWidget;
15#endif 9#endif
16 10
17struct CPlucker_dataRecord 11class CPlucker : public CPlucker_base
18{ 12{
19 UInt16 uid; 13 void start2endSection()
20 UInt16 nParagraphs;
21 UInt16 size;
22 UInt8 type;
23 UInt8 reserved;
24};
25
26struct CPlucker_record0
27{ 14{
28 UInt16 uid; 15 m_currentstart = currentpos-bufferpos;
29 UInt16 version; 16 m_currentend = m_currentstart+buffercontent;
30 UInt16 nRecords; 17 }
31}; 18 void setbuffersize()
32
33struct CPluckerbkmk
34{ 19{
35 UInt32 offset; 20 compressedbuffersize = buffersize = 32*1024;
36 tchar title[MAX_BMRK_LENGTH]; 21 }
37}; 22 int HeaderSize();
23 void GetHeader(UInt16& uid, UInt16& nParagraphs, UInt32& size, UInt8& type, UInt8& reserved);
24 int bgetch();
25 tchar getch(bool fast);
26 UInt8 EOPPhase;
38 27
39const UInt32 CPLUCKER_ID = 0x5458547a;
40 28
41class CPlucker : public CExpander, Cpdb 29
42{ 30 bool CorrectDecoder(); // Virtual
43 unsigned short finduid(unsigned short); 31 void setlink(QString&, const QString&); // Virtual
44 char* geturl(UInt16); 32 QImage* imagefromdata(UInt8*, UInt32); // virtual
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;
53 UInt16 uid;
54 UInt8 EOPPhase;
55 int m_nextPara, m_nextParaIndex;
56 CBufferFace<UInt16> m_ParaOffsets;
57 CBufferFace<UInt16> m_ParaAttrs;
58 UInt16 m_nParas;
59 CStyle mystyle;
60// bool bInit;
61 UInt32 buffersize;
62 UInt32 buffercontent;
63 UInt8* expandedtextbuffer;
64 UInt8* compressedtextbuffer;
65 char* urls;
66 size_t urlsize;
67 size_t bufferpos;
68 UInt16 bufferrec;
69 CPlucker_record0 hdr0;
70 size_t currentpos;
71 bool expand(int);
72 void UnZip(size_t, UInt8*, UInt16);
73 void UnDoc(size_t, UInt8*, UInt16);
74#ifdef LOCALPICTURES
75 void showimg(UInt16 tgt);
76#endif
77 QImage* getimg(UInt16 tgt);
78 QPixmap* expandimg(UInt16 tgt, bool border=false);
79 void home();
80 int bgetch();
81 CNavigation m_nav;
82 public: 33 public:
83 virtual void suspend()
84 {
85 CExpander::suspend(fin);
86 }
87 virtual void unsuspend()
88 {
89 CExpander::unsuspend(fin);
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();
95 CPlucker(); 34 CPlucker();
96 virtual int OpenFile(const char *src);
97 virtual int getch();
98 virtual void getch(int&, CStyle&);
99 virtual unsigned int locate();
100 virtual void locate(unsigned int n);
101 virtual CList<Bkmk>* getbkmklist();
102 virtual bool hyperlink(unsigned int n);
103 virtual MarkupType PreferredMarkup()
104 {
105 return cNONE;
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);
121}; 35};
122
123#endif 36#endif