aportis.h
来自「一个小的非常好用的电子书阅读器源码」· C头文件 代码 · 共 78 行
H
78 行
#include "CExpander.h"typedef unsigned long DWORD;typedef unsigned short WORD;#define DISP_BITS 11#define COUNT_BITS 3// all numbers in these structs are big-endian, MAC formatstruct tDocHeader { char sName[32]; DWORD dwUnknown1; DWORD dwTime1; DWORD dwTime2; DWORD dwTime3; DWORD dwLastSync; DWORD ofsSort; DWORD ofsCatagories; DWORD dwCreator; DWORD dwType; DWORD dwUnknown2; DWORD dwUnknown3; WORD wNumRecs;};struct tDocRecord0 { WORD wVersion; // 1=plain text, 2=compressed WORD wSpare; DWORD dwStoryLen; // in chars, when decompressed WORD wNumRecs; // text records only; equals tDocHeader.wNumRecs-1 WORD wRecSize; // usually 0x1000 DWORD dwSpare2;};////////////// utilities //////////////////////////////////////inline WORD SwapWord(WORD r){ return (r>>8) + (r<<8);}inline DWORD SwapLong(DWORD r){ return ((r>>24) & 0xFF) + (r<<24) + ((r>>8) & 0xFF00) + ((r<<8) & 0xFF0000);}class Aportis : public CExpander { DWORD dwLen; WORD nRecs2; DWORD dwTLen; WORD nRecs; WORD BlockSize; FILE* fin; DWORD dwRecLen; int currentrec, currentpos; unsigned int cbptr; unsigned int outptr; char circbuf[2048]; char bCompressed;public: virtual void sizes(unsigned long& _file, unsigned long& _text) { _file = dwLen; _text = dwTLen; } virtual bool hasrandomaccess() { return true; } virtual ~Aportis() { if (fin != NULL) fclose(fin); } Aportis(); virtual int openfile(char *src); virtual int getch(); virtual unsigned int locate(); virtual void locate(unsigned int n); virtual CList<Bkmk>* getbkmklist();private: bool refreshbuffer(); unsigned int GetBS(unsigned int bn);};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?