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) (side-by-side diff)
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) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/plucker.h125
1 files changed, 19 insertions, 106 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 @@
#ifndef __plucker_h
#define __plucker_h
-#include "CExpander.h"
-#include "zlib/zlib.h"
-#include "ztxt.h"
-#include "pdb.h"
-#include "CBuffer.h"
-#include "Navigation.h"
-#include "my_list.h"
+#include "plucker_base.h"
#ifdef LOCALPICTURES
class QScrollView;
class QWidget;
#endif
-struct CPlucker_dataRecord
+class CPlucker : public CPlucker_base
{
- UInt16 uid;
- UInt16 nParagraphs;
- UInt16 size;
- UInt8 type;
- UInt8 reserved;
-};
-
-struct CPlucker_record0
-{
- UInt16 uid;
- UInt16 version;
- UInt16 nRecords;
-};
+ void start2endSection()
+ {
+ m_currentstart = currentpos-bufferpos;
+ m_currentend = m_currentstart+buffercontent;
+ }
+ void setbuffersize()
+ {
+ compressedbuffersize = buffersize = 32*1024;
+ }
+ int HeaderSize();
+ void GetHeader(UInt16& uid, UInt16& nParagraphs, UInt32& size, UInt8& type, UInt8& reserved);
+ int bgetch();
+ tchar getch(bool fast);
+ UInt8 EOPPhase;
-struct CPluckerbkmk
-{
- UInt32 offset;
- tchar title[MAX_BMRK_LENGTH];
-};
-const UInt32 CPLUCKER_ID = 0x5458547a;
-class CPlucker : public CExpander, Cpdb
-{
- unsigned short finduid(unsigned short);
- char* geturl(UInt16);
- void Expand(UInt16, UInt8, UInt8*, UInt16);
- CList<unsigned long> visited;
- bool m_lastIsBreak;
-#ifdef LOCALPICTURES
- QScrollView* m_viewer;
- QWidget* m_picture;
-#endif
- size_t textlength, m_lastBreak;
- UInt16 uid;
- UInt8 EOPPhase;
- int m_nextPara, m_nextParaIndex;
- CBufferFace<UInt16> m_ParaOffsets;
- CBufferFace<UInt16> m_ParaAttrs;
- UInt16 m_nParas;
- CStyle mystyle;
-// bool bInit;
- UInt32 buffersize;
- UInt32 buffercontent;
- UInt8* expandedtextbuffer;
- UInt8* compressedtextbuffer;
- char* urls;
- size_t urlsize;
- size_t bufferpos;
- UInt16 bufferrec;
- CPlucker_record0 hdr0;
- size_t currentpos;
- bool expand(int);
- void UnZip(size_t, UInt8*, UInt16);
- void UnDoc(size_t, UInt8*, UInt16);
-#ifdef LOCALPICTURES
- void showimg(UInt16 tgt);
-#endif
- QImage* getimg(UInt16 tgt);
- QPixmap* expandimg(UInt16 tgt, bool border=false);
- void home();
- int bgetch();
- CNavigation m_nav;
+ bool CorrectDecoder(); // Virtual
+ void setlink(QString&, const QString&); // Virtual
+ QImage* imagefromdata(UInt8*, UInt32); // virtual
public:
- virtual void suspend()
- {
- CExpander::suspend(fin);
- }
- virtual void unsuspend()
- {
- CExpander::unsuspend(fin);
- }
- virtual QPixmap* getPicture(unsigned long tgt);
- virtual void sizes(unsigned long& _file, unsigned long& _text);
- virtual bool hasrandomaccess() { return true; }
- virtual ~CPlucker();
CPlucker();
- virtual int OpenFile(const char *src);
- virtual int getch();
- virtual void getch(int&, CStyle&);
- virtual unsigned int locate();
- virtual void locate(unsigned int n);
- virtual CList<Bkmk>* getbkmklist();
- virtual bool hyperlink(unsigned int n);
- virtual MarkupType PreferredMarkup()
- {
- return cNONE;
- }
- void saveposn(size_t posn) { m_nav.saveposn(posn); }
- bool forward(size_t& loc) { return m_nav.forward(loc); }
- bool back(size_t& loc) { return m_nav.back(loc); }
- bool hasnavigation() { return true; }
- unsigned long startSection()
- {
- return currentpos-bufferpos;
- }
- unsigned long endSection()
- {
- return startSection()+buffercontent;
- }
- void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen);
- void putSaveData(unsigned char*& src, unsigned short& srclen);
};
-
#endif