author | pohly <pohly> | 2004-08-26 05:57:55 (UTC) |
---|---|---|
committer | pohly <pohly> | 2004-08-26 05:57:55 (UTC) |
commit | 3f36482d9a6c096fdf5d8ab8831eb736746c0565 (patch) (side-by-side diff) | |
tree | fb213ba05e20c9a02bca3d805f8f5c96c1c45da0 | |
parent | e00962edd9d4be58c6184e5b6c5f6ef07f449689 (diff) | |
download | opie-3f36482d9a6c096fdf5d8ab8831eb736746c0565.zip opie-3f36482d9a6c096fdf5d8ab8831eb736746c0565.tar.gz opie-3f36482d9a6c096fdf5d8ab8831eb736746c0565.tar.bz2 |
removed obsolete static.h and useqpe.h
44 files changed, 21 insertions, 61 deletions
diff --git a/noncore/apps/opie-reader/Aportis.cpp b/noncore/apps/opie-reader/Aportis.cpp index 7528e78..353996c 100644 --- a/noncore/apps/opie-reader/Aportis.cpp +++ b/noncore/apps/opie-reader/Aportis.cpp @@ -1,54 +1,53 @@ #include <stdio.h> #include <string.h> #include "Aportis.h" #include "my_list.h" #include "Bkmks.h" -#include "static.h" Aportis::Aportis() : peanutfile(false) { /*printf("constructing:%x\n",fin);*/ } void Aportis::dePeanut(int& ch) { if (peanutfile && ch != EOF) { unsigned char c = ch; if (peanutfile) c ^= 0xa5; ch = c; } } CList<Bkmk>* Aportis::getbkmklist() { /* if (peanutfile) { if (nRecs2 > nRecs) { CList<Bkmk>* t = new CList<Bkmk>; for (int i = nRecs; i < nRecs2; i++) { char name[17]; name[16] = '\0'; // qDebug("Record:%d, Length:%u",i,recordlength(i)); gotorecordnumber(i); fread(name,1,16,fin); unsigned long lcn; fread(&lcn,sizeof(lcn),1,fin); lcn ^= 0xa5a5a5a5; lcn = SwapLong(lcn); // qDebug("Bookmark:%s:%u", name,lcn); tchar tname[17]; memset(tname, 0, sizeof(tname)); for (int i = 0; name[i] != 0; i++) { tname[i] = name[i] ^ 0xa5; } t->push_back(Bkmk(tname, NULL, lcn)); } return t; } else { return NULL; } } diff --git a/noncore/apps/opie-reader/AportisCodec/AportisCodec.pro b/noncore/apps/opie-reader/AportisCodec/AportisCodec.pro index 4b61a7a..fcab192 100644 --- a/noncore/apps/opie-reader/AportisCodec/AportisCodec.pro +++ b/noncore/apps/opie-reader/AportisCodec/AportisCodec.pro @@ -1,30 +1,29 @@ DEFINES += OPIE USEQPE VPATH = .. TEMPLATE = lib CONFIG = qt warn_on release dll HEADERS = Aportis.h \ CExpander.h \ - ../OREADERINC/useqpe.h \ config.h \ ustring.h \ StyleConsts.h \ Markups.h \ names.h \ linktype.h \ pdb.h \ my_list.h \ Bkmks.h \ Filedata.h SOURCES = Aportis.cpp INTERFACES = DESTDIR = $(OPIEDIR)/plugins/reader/codecs TARGET = Aportis LIBS += -lreader_pdb -lreader_codec -INCLUDEPATH += ../OREADERINC $(OPIEDIR)/include -DEPENDPATH += ../OREADERINC $(OPIEDIR)/include +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include -include ( $(OPIEDIR)/include.pro )
\ No newline at end of file +include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/apps/opie-reader/BuffDoc.cpp b/noncore/apps/opie-reader/BuffDoc.cpp index 22934f9..1f0a524 100644 --- a/noncore/apps/opie-reader/BuffDoc.cpp +++ b/noncore/apps/opie-reader/BuffDoc.cpp @@ -1,55 +1,53 @@ -#include "static.h" #include "names.h" #define NEWLINEBREAK #define INCREMENTALWIDTH -#include "useqpe.h" #include "usenef.h" #include "BuffDoc.h" #include "config.h" #include "CDrawBuffer.h" #include "ZText.h" #include "ebookcodec.h" #ifdef __STATIC #include "Aportis.h" #include "CHM.h" #include "ppm_expander.h" #include "ztxt.h" #include "plucker.h" #ifdef USENEF #include "nef.h" #include "arrierego.h" #endif #include "iSilo.h" #endif linkType BuffDoc::hyperlink(unsigned int n, unsigned int noff, QString& wrd, QString& nm) { linkType bRet = eNone; if (exp != NULL) { bRet = filt->hyperlink(n, noff, wrd, nm); if ((bRet & eLink) != 0) { lastword.empty(); lastsizes[0] = laststartline = n; #ifdef NEWLINEBREAK lastispara = false; #else lastispara = false; #endif lastsizes[0] = laststartline = exp->locate(); } } return bRet; } void BuffDoc::locate(unsigned int n) { // //qDebug("BuffDoc:locating:%u",n); lastword.empty(); lastsizes[0] = laststartline = n; #ifdef NEWLINEBREAK diff --git a/noncore/apps/opie-reader/BuffDoc.h b/noncore/apps/opie-reader/BuffDoc.h index a7dd7bf..2b4fb57 100644 --- a/noncore/apps/opie-reader/BuffDoc.h +++ b/noncore/apps/opie-reader/BuffDoc.h @@ -1,52 +1,51 @@ #ifndef __BuffDoc_h #define __BuffDoc_h -#include "useqpe.h" #include "CDrawBuffer.h" #include "CFilter.h" #include "CExpander.h" #include <qfontmetrics.h> #include <qmessagebox.h> class BuffDoc { CDrawBuffer lastword; CSizeBuffer lastsizes, allsizes; size_t laststartline; bool lastispara; CExpander_Interface* exp; CFilterChain* filt; int m_hyphenthreshold; // bool m_customhyphen; public: QString about(); bool findanchor(const QString& nm) { return filt->findanchor(nm); } // void setCustomHyphen(bool _v) { m_customhyphen = _v; } // bool getCustomHyphen() { return m_customhyphen; } void setHyphenThreshold(int _v) { m_hyphenthreshold = _v; } void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen) { if (exp == NULL) { data = NULL; len = 0; } else { exp->setSaveData(data, len, src, srclen); } } void putSaveData(unsigned char*& src, unsigned short& srclen) { if (exp != NULL) { exp->putSaveData(src, srclen); } } #ifdef USEQPE void suspend() { if (exp != NULL) exp->suspend(); } void unsuspend() { if (exp != NULL) exp->unsuspend(); } #else diff --git a/noncore/apps/opie-reader/CDrawBuffer.cpp b/noncore/apps/opie-reader/CDrawBuffer.cpp index caccf1b..bfb3027 100644 --- a/noncore/apps/opie-reader/CDrawBuffer.cpp +++ b/noncore/apps/opie-reader/CDrawBuffer.cpp @@ -1,55 +1,54 @@ #include "CDrawBuffer.h" #include "FontControl.h" #include <qfontmetrics.h> #include <qpainter.h> #include <qpixmap.h> #include <qimage.h> -#include "useqpe.h" CDrawBuffer::~CDrawBuffer() { while (!segs.isEmpty()) segs.erase(0); } void CDrawBuffer::setright(CDrawBuffer& rhs, int f) { int i; len = rhs.len; fc = rhs.fc; m_ascent = m_descent = m_lineSpacing = m_lineExtraSpacing = 0; while (!segs.isEmpty()) { segs.erase(0); } for (CList<textsegment>::iterator iter = rhs.segs.begin(); iter != rhs.segs.end(); ) { CList<textsegment>::iterator next = iter; iter++; if (iter == rhs.segs.end() || iter->start > f) { int st = next->start-f; if (st < 0) st = 0; CStyle _style = next->style; segs.push_back(textsegment(st,next->style)); } } for (i = f; rhs[i] != '\0'; i++) (*this)[i-f] = rhs[i]; (*this)[i-f] = '\0'; len = i; } CDrawBuffer& CDrawBuffer::operator=(CDrawBuffer& rhs) { int i; // //qDebug("Trying 2"); len = rhs.len; m_ascent = rhs.m_ascent; m_descent = rhs.m_descent; m_lineSpacing = rhs.m_lineSpacing; m_lineExtraSpacing = rhs.m_lineExtraSpacing; m_showPartial = rhs.m_showPartial; while (!segs.isEmpty()) { segs.erase(0); } diff --git a/noncore/apps/opie-reader/CExpander.h b/noncore/apps/opie-reader/CExpander.h index e9aaf79..7fa84f9 100644 --- a/noncore/apps/opie-reader/CExpander.h +++ b/noncore/apps/opie-reader/CExpander.h @@ -1,59 +1,58 @@ #ifndef __CExpander_h #define __CExpander_h #ifndef _WINDOWS #include <unistd.h> #endif #include <stdio.h> #include <time.h> #include <sys/stat.h> #include <qmessagebox.h> -#include "useqpe.h" #include "config.h" #include "StyleConsts.h" #include "Markups.h" #include "names.h" #include "linktype.h" class QImage; class Bkmk; class QString; template<class T> class CList; class CCharacterSource { public: virtual void getch(tchar&, CStyle&, unsigned long&) = 0; virtual linkType hyperlink(unsigned int n, unsigned int noff, QString&, QString& nm) = 0; virtual void locate(unsigned int n) = 0; virtual bool findanchor(const QString& nm) = 0; virtual void saveposn(const QString& f, size_t posn) = 0; virtual void writeposn(const QString& f, size_t posn) = 0; virtual linkType forward(QString& f, size_t& loc) = 0; virtual linkType back(QString& f, size_t& loc) = 0; virtual bool hasnavigation() = 0; virtual int getwidth() = 0; virtual QImage* getPicture(unsigned long) = 0; virtual QImage* getPicture(const QString& href) = 0; virtual bool getFile(const QString& href) = 0; virtual QString about() = 0; }; class CExpander_Interface { public: #ifdef USEQPE virtual void suspend() = 0; virtual void unsuspend() = 0; #endif virtual QString about() = 0; virtual size_t getHome() = 0; //CExpander_Interface(); //virtual ~CExpander_Interface(); virtual int openfile(const char *src) = 0; //virtual int OpenFile(const char *src) = 0; virtual unsigned int locate() = 0; virtual void locate(unsigned int n) = 0; virtual bool hasrandomaccess() = 0; diff --git a/noncore/apps/opie-reader/CFilter.cpp b/noncore/apps/opie-reader/CFilter.cpp index 6f76e9a..6d94d70 100644 --- a/noncore/apps/opie-reader/CFilter.cpp +++ b/noncore/apps/opie-reader/CFilter.cpp @@ -1,53 +1,52 @@ #include <qmap.h> #include <qfileinfo.h> #include <qtextstream.h> #include <qdir.h> -#include "useqpe.h" #ifdef USEQPE #include <qpe/global.h> #endif #include "CDrawBuffer.h" #include "CFilter.h" #include "hrule.h" #include "util.h" #include <qregexp.h> #include <qimage.h> #include <qpixmap.h> //#include <qprogressdialog.h> //#include <qapplication.h> void textfmt::mygetch(tchar& ch, CStyle& sty, unsigned long& pos) { if (uselast) { ch = lastchar; uselast = false; } else { parent->getch(ch, sty, pos); } } void textfmt::getch(tchar& ch, CStyle& sty, unsigned long& pos) { mygetch(ch, sty, pos); do { sty = currentstyle; switch (ch) { case 10: currentstyle.unset(); sty = currentstyle; break; // Use this if you want to replace -- by em-dash case '-': // parent->getch(ch, sty); mygetch(ch, sty, pos); if (ch == '-') { ch = 0x2014; } else diff --git a/noncore/apps/opie-reader/CFilter.h b/noncore/apps/opie-reader/CFilter.h index cec9618..174e6b4 100644 --- a/noncore/apps/opie-reader/CFilter.h +++ b/noncore/apps/opie-reader/CFilter.h @@ -346,97 +346,96 @@ class DePluck : public CFilter class repalm : public CFilter { public: ~repalm() {} void getch(tchar& ch, CStyle& sty, unsigned long& pos); QString about() { return QString("Repalm filter (c) Tim Wentford\n")+parent->about(); } }; class FullJust : public CFilter { public: void getch(tchar& ch, CStyle& sty, unsigned long& pos) { parent->getch(ch, sty, pos); if (sty.getJustify() == m_AlignLeft) sty.setFullJustify(); } QString about() { return QString("Full justification filter (c) Tim Wentford\n")+parent->about(); } }; /* class AddSpace : public CFilter { unsigned char m_espc; public: AddSpace(unsigned char s) : m_espc(s) {} void getch(tchar& ch, CStyle& sty, unsigned long& pos) { parent->getch(ch, sty, pos); sty.setExtraSpace(m_espc); } }; */ class QTReader; class HighlightFilter : public CFilter { QTReader* pReader; unsigned long lastpos, nextpos; unsigned char red, green, blue; CList<Bkmk>* bkmks; public: HighlightFilter(QTReader*); void getch(tchar& ch, CStyle& sty, unsigned long& pos); void refresh(unsigned long); QString about() { return QString("High-lighting filter (c) Tim Wentford\n")+parent->about(); } }; -#include "static.h" #ifndef __STATIC #include <dlfcn.h> class ExternFilter : public CFilter_IFace { CFilter* filt; void *handle; public: linkType hyperlink(unsigned int n, unsigned int noff, QString& w, QString& nm) { return filt->hyperlink(n, noff, w, nm); } void setparent(CCharacterSource* p) { filt->setparent(p); } ExternFilter(const QString& nm, const QString& optional); ~ExternFilter() { if (filt != NULL) delete filt; if (handle != NULL) dlclose(handle); } void locate(unsigned int n) { filt->locate(n); } bool findanchor(const QString& nm) { return filt->findanchor(nm); } void saveposn(const QString& f, size_t posn) { filt->saveposn(f, posn); } void writeposn(const QString& f, size_t posn) { filt->writeposn(f, posn); } linkType forward(QString& f, size_t& loc) { return filt->forward(f, loc); } linkType back(QString& f, size_t& loc) { return filt->back(f, loc); } bool hasnavigation() { return filt->hasnavigation(); } int getwidth() { return filt->getwidth(); } CCharacterSource* getparent() { return filt->getparent(); } void getch(tchar& c, CStyle& s, unsigned long& l) { filt->getch(c, s, l); } QImage* getPicture(unsigned long tgt) { return filt->getPicture(tgt); } CFilter* filter() { return filt; } QImage* getPicture(const QString& href) { return filt->getPicture(href); } bool getFile(const QString& href) { return filt->getFile(href); } QString about() { return QString("Filter plug-in (c) Tim Wentford\n")+filt->about(); } }; #endif class kern : public CFilter { tchar lastchar; bool uselast; CStyle laststy; public: kern() : lastchar(0), uselast(false) {} ~kern() {} void getch(tchar& ch, CStyle& sty, unsigned long& pos); QString about() { return QString("Kerning filter (c) Tim Wentford\n")+parent->about(); } }; diff --git a/noncore/apps/opie-reader/CHM.cpp b/noncore/apps/opie-reader/CHM.cpp index 9d1eb87..88d53bf 100644 --- a/noncore/apps/opie-reader/CHM.cpp +++ b/noncore/apps/opie-reader/CHM.cpp @@ -1,51 +1,50 @@ #include "CHM.h" #include "chm_lib.h" -#include "static.h" #include <qstring.h> #include <qstringlist.h> #include <stdio.h> #include <qimage.h> #include <qpixmap.h> #ifndef __STATIC extern "C" { CExpander* newcodec() { return new CHM; } } #endif static int _print_ui_index(struct chmFile *h, struct chmUnitInfo *ui, void *context) { CHM *chm = (CHM *)context; QString temp = "<tr>"; char buff[1024]; sprintf( buff,"<td align=right>%8d\n</td><td><a href=\"%s\">%s</a></td></tr>",(int)ui->length, ui->path, ui->path); temp += buff; chm->addContent(temp); return CHM_ENUMERATOR_CONTINUE; } static int _get_hhc (struct chmFile *h, struct chmUnitInfo *ui, void *context) { CHM *chm = (CHM *)context; QString PathName = ui->path; if (PathName.find(".hhc") > -1) { chm->setPath(PathName); } return CHM_ENUMERATOR_CONTINUE; } CHM::CHM() { chmFile = NULL; chmPath = ""; chmHHCPath = ""; chmBuffer = ""; bufpos = 0; } CHM::~CHM() { if (chmFile != NULL) chm_close(chmFile); } diff --git a/noncore/apps/opie-reader/CHM.h b/noncore/apps/opie-reader/CHM.h index 7dac46f..001f7fc 100644 --- a/noncore/apps/opie-reader/CHM.h +++ b/noncore/apps/opie-reader/CHM.h @@ -1,53 +1,52 @@ #ifndef __CHM_h #define __CHM_h #include <stdio.h> #include <sys/stat.h> -#include "useqpe.h" #include "CExpander.h" #include "chm_lib.h" #include "my_list.h" #include "CExpander.h" struct Ref { QString RefName; QString RefLoc; int beginpos; int endpos; }; struct Pic { QString RefName; QString RefLoc; int beginpos; int endpos; }; class CHM : public CExpander { void start2endSection(); struct chmUnitInfo m_ui; struct chmFile *chmFile; chmUnitInfo chmui; //alloc a meg to buffer QString chmHomeBuffer; QString chmBuffer; QString chmPath; QString chmHHCPath; unsigned int bufpos; unsigned long fsize; unsigned long m_homestart, m_homeend; public: void suspend(); void unsuspend(); bool hasnavigation() { return true; } CHM(); virtual ~CHM(); int OpenFile(const char *src); int getch(); unsigned int locate(); void locate(unsigned int n); bool hasrandomaccess() { return true; } void sizes(unsigned long& _file, unsigned long& _text); void addContent(QString content); void getch(tchar& ch, CStyle& sty); diff --git a/noncore/apps/opie-reader/CHM/CHM.pro b/noncore/apps/opie-reader/CHM/CHM.pro index 6ed86f6..d3a2a28 100644 --- a/noncore/apps/opie-reader/CHM/CHM.pro +++ b/noncore/apps/opie-reader/CHM/CHM.pro @@ -1,18 +1,18 @@ DEFINES += OPIE USEQPE VPATH = .. TEMPLATE = lib CONFIG = qt warn_on release dll HEADERS = CHM.h chm_lib.h lzx.h SOURCES = CHM.cpp chm_lib.c lzx.c INTERFACES = DESTDIR = $(OPIEDIR)/plugins/reader/codecs TARGET = CHM LIBS += -lreader_codec -INCLUDEPATH += ../OREADERINC $(OPIEDIR)/include -DEPENDPATH += ../OREADERINC $(OPIEDIR)/include +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include include ( $(OPIEDIR)/include.pro )
\ No newline at end of file diff --git a/noncore/apps/opie-reader/CloseDialog.h b/noncore/apps/opie-reader/CloseDialog.h index 62e6423..54aaf1c 100644 --- a/noncore/apps/opie-reader/CloseDialog.h +++ b/noncore/apps/opie-reader/CloseDialog.h @@ -1,60 +1,59 @@ /**************************************************************************** ** Form interface generated from reading ui file 'Prefs.ui' ** ** Created: Tue Feb 11 23:53:32 2003 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #ifndef __CLOSEDIALOG_H #define __CLOSEDIALOG_H -#include "useqpe.h" #include <qvariant.h> #include <qwidget.h> #include <qtabdialog.h> #include <qtabwidget.h> #include <qspinbox.h> #include <qcheckbox.h> #include <qcombobox.h> #include <qlineedit.h> //#include <qpe/menubutton.h> #include <qvbuttongroup.h> class QVBoxLayout; class QHBoxLayout; class QGridLayout; //class QCheckBox; class QLabel; //class QSpinBox; class CCloseDialog : public QDialog { Q_OBJECT QCheckBox *file, *marks, *config; #ifndef USEQPE void keyPressEvent(QKeyEvent* e) { switch (e->key()) { case Key_Escape: e->accept(); reject(); break; case Key_Space: case Key_Return: e->accept(); accept(); break; default: QWidget::keyPressEvent(e); } } #endif public: CCloseDialog(const QString&, bool fs = true, QWidget* parent = 0, const char* name = 0); ~CCloseDialog() {} bool delFile() { return file->isChecked(); } bool delMarks() { return marks->isChecked(); } bool delConfig() { return config->isChecked(); } diff --git a/noncore/apps/opie-reader/FontControl.cpp b/noncore/apps/opie-reader/FontControl.cpp index bbd9fe0..9bb3bc0 100644 --- a/noncore/apps/opie-reader/FontControl.cpp +++ b/noncore/apps/opie-reader/FontControl.cpp @@ -1,50 +1,49 @@ #include <qfontdatabase.h> -#include "useqpe.h" #include "FontControl.h" int FontControl::gzoom() { if (m_fixgraphics) { return 100; } else { int ret; if (m_size == g_size) { ret = m_fontsizes[m_size]*m_basesize; } else if (g_size < 0) { int f = -g_size; ret = (m_fontsizes[0]*m_basesize) >> (f/2); if (f%2) ret = (2*ret/3); } else { int f = g_size - m_maxsize + 1; ret = (m_fontsizes[m_maxsize-1]*m_basesize) << (f/2); if (f%2) ret = (3*ret/2); } return ret; } } bool FontControl::ChangeFont(QString& n, int tgt) { QValueList<int>::Iterator it; QFontDatabase fdb; QValueList<int> sizes = fdb.pointSizes(n); if (sizes.count() == 0) { return false; } else { m_fontname = n; m_maxsize = sizes.count(); if (m_fontsizes != NULL) delete [] m_fontsizes; m_fontsizes = new int[m_maxsize]; uint i = 0; uint best = 0; diff --git a/noncore/apps/opie-reader/HTMLFilter/HTMLFilter.pro b/noncore/apps/opie-reader/HTMLFilter/HTMLFilter.pro index cc049a9..8eb6f17 100644 --- a/noncore/apps/opie-reader/HTMLFilter/HTMLFilter.pro +++ b/noncore/apps/opie-reader/HTMLFilter/HTMLFilter.pro @@ -1,20 +1,20 @@ DEFINES += OPIE USEQPE VPATH = .. TEMPLATE = lib CONFIG = qt warn_on release dll HEADERS = CFilter.h \ util.h SOURCES = striphtml.cpp # copy data file to install directory QMAKE_PRE_LINK = mkdir -p $(OPIEDIR)/plugins/reader/data && cp ../HTMLentities $(OPIEDIR)/plugins/reader/data/HTMLentities INTERFACES = DESTDIR = $(OPIEDIR)/plugins/reader/filters TARGET = HTMLfilter -INCLUDEPATH += ../OREADERINC $(OPIEDIR)/include -DEPENDPATH += ../OREADERINC $(OPIEDIR)/include +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/apps/opie-reader/Palm2QImage.cpp b/noncore/apps/opie-reader/Palm2QImage.cpp index c1b7b7a..c6907eb 100644 --- a/noncore/apps/opie-reader/Palm2QImage.cpp +++ b/noncore/apps/opie-reader/Palm2QImage.cpp @@ -1,50 +1,49 @@ /* -*- mode: c; indent-tabs-mode: nil; -*- */ -#include "useqpe.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #ifndef _WINDOWS #include <unistd.h> /* for link */ #endif #include <sys/types.h> #include <sys/stat.h> #include <stdarg.h> #include <qimage.h> /***********************************************************************/ /***********************************************************************/ /***** *****/ /***** Code to decode the Palm image format to JPEG *****/ /***** *****/ /***********************************************************************/ /***********************************************************************/ #define READ_BIGENDIAN_SHORT(p) (((p)[0] << 8)|((p)[1])) #define READ_BIGENDIAN_LONG(p) (((p)[0] << 24)|((p)[1] << 16)|((p)[2] << 8)|((p)[3])) #define PALM_IS_COMPRESSED_FLAG 0x8000 #define PALM_HAS_COLORMAP_FLAG 0x4000 #define PALM_HAS_TRANSPARENCY_FLAG 0x2000 #define PALM_DIRECT_COLOR_FLAG 0x0400 #define PALM_4_BYTE_FIELD_FLAG 0x0200 #define PALM_COMPRESSION_SCANLINE 0x00 #define PALM_COMPRESSION_RLE 0x01 #define PALM_COMPRESSION_PACKBITS 0x02 #define PALM_COMPRESSION_NONE 0xFF #define PALM_COLORMAP_SIZE 232 typedef struct { unsigned char red; unsigned char green; unsigned char blue; } ColorMapEntry; static ColorMapEntry Palm8BitColormap[] = { { 255, 255, 255 }, { 255, 204, 255 }, { 255, 153, 255 }, { 255, 102, 255 }, { 255, 51, 255 }, { 255, 0, 255 }, { 255, 255, 204 }, { 255, 204, 204 }, { 255, 153, 204 }, { 255, 102, 204 }, { 255, 51, 204 }, { 255, 0, 204 }, { 255, 255, 153 }, { 255, 204, 153 }, { 255, 153, 153 }, { 255, 102, 153 }, { 255, 51, 153 }, { 255, 0, 153 }, { 204, 255, 255 }, { 204, 204, 255 }, diff --git a/noncore/apps/opie-reader/PluckerCodec/PluckerCodec.pro b/noncore/apps/opie-reader/PluckerCodec/PluckerCodec.pro index 6ed4032..7042542 100644 --- a/noncore/apps/opie-reader/PluckerCodec/PluckerCodec.pro +++ b/noncore/apps/opie-reader/PluckerCodec/PluckerCodec.pro @@ -1,18 +1,18 @@ DEFINES += OPIE USEQPE VPATH = .. TEMPLATE = lib CONFIG = qt warn_on release dll HEADERS = plucker.h SOURCES = plucker.cpp \ Palm2QImage.cpp INTERFACES = DESTDIR = $(OPIEDIR)/plugins/reader/codecs TARGET = Plucker LIBS += -lreader_pdb -lreader_pluckerbase -lreader_codec -INCLUDEPATH += ../OREADERINC $(OPIEDIR)/include -DEPENDPATH += ../OREADERINC $(OPIEDIR)/include +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/apps/opie-reader/QTReader.cpp b/noncore/apps/opie-reader/QTReader.cpp index dfdba28..33884a0 100644 --- a/noncore/apps/opie-reader/QTReader.cpp +++ b/noncore/apps/opie-reader/QTReader.cpp @@ -1,61 +1,60 @@ /**************************************************************************** ** $Id$ ** ** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. ** ** This file is part of an example program for Qt. This example ** program may be used, distributed and modified without limitation. ** *****************************************************************************/ const int _SBARHEIGHT = 3; -#include "useqpe.h" #include <qpainter.h> //#include <qdirectpainter_qws.h> #include <qimage.h> #include <qtimer.h> #include "config.h" #include "QTReader.h" //#include "QTReaderApp.h" #include "CDrawBuffer.h" #ifdef USEQPE #include <qpe/qpeapplication.h> #endif #include <math.h> #include <ctype.h> #include <stdio.h> //for sprintf #ifdef USEQPE #include <qpe/config.h> #include <qpe/applnk.h> #include <qpe/global.h> #include <qpe/qcopenvelope_qws.h> #endif #include <qfileinfo.h> #include <qdir.h> #ifdef _UNICODE const char *QTReader::fonts[] = { "unifont", "Courier", "Times", 0 }; #else const char *QTReader::fonts[] = { "Helvetica", "Courier", "Times", 0 }; #endif //const int QTReader::fontsizes[] = { 8, 10, 12, 14, 18, 24, 30, 40, 50, 60, 70, 80, 90, 100, 0 }; //const tchar *QTReader::fonts[] = { "unifont", "fixed", "micro", "smoothtimes", "Courier", "Times", 0 }; //const int QTReader::fontsizes[] = {10,16,17,22,0}; //const tchar *QTReader::fonts[] = { "verdana", "Courier", "Times", 0 }; //const int QTReader::fontsizes[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,0}; tchar QTReader::pluckernextpart[] = { 'C','l','i','c','k',' ','h','e','r','e',' ','f','o','r',' ','t','h','e',' ','n','e','x','t',' ','p','a','r','t',0 }; tchar QTReader::jplucknextpart[] = { 'N','e','x','t',' ','P','a','r','t',' ','>','>',0 }; //tchar QTReader::jplucknextpart[] = { 10,'#',10,'N','e','x','t',' ','P','a','r','t',' ','>','>',0 }; QTReader::QTReader( QWidget *parent, const char *name, WFlags f) : QWidget(parent, name, f), m_default_fg(0,0,0), m_default_bg(255,255,255), m_bg(255,255,255), m_delay(100), m_scrolldy1(0), m_scrolldy2(0), diff --git a/noncore/apps/opie-reader/QTReader.h b/noncore/apps/opie-reader/QTReader.h index 7b0ebc8..3bcdde4 100644 --- a/noncore/apps/opie-reader/QTReader.h +++ b/noncore/apps/opie-reader/QTReader.h @@ -1,53 +1,52 @@ #ifndef __QTREADER_H #define __QTREADER_H //#define _SCROLLPIPE -#include "static.h" #include <qwidget.h> //#include <qpainter.h> #include "my_list.h" #include "BuffDoc.h" #include "FontControl.h" //#include <qtimer.h> class CDrawBuffer; //class CBuffer; #include <qpixmap.h> class QPainter; class QTimer; class QImage; #include "BGType.h" #include "striphtml.h" #define ROTATION_ENABLED #define SPECIALSCROLL #define DOUBLEBUFFER #ifdef DOUBLEBUFFER class QPainter; #endif class CStyle; class QTReader : public QWidget { Q_OBJECT friend class QTReaderApp; #ifdef DOUBLEBUFFER QPixmap *dbuff; QPainter* dbp; #endif void drawSingleLine(int lineno); void gotoLink(); void emitRedraw(); CStyle* m_currentlinkstyle; int m_currentlink; int m_currentlinkoffset; QPixmap m_bgpm; bool m_bgIsScaled; bground m_bgtype; int m_scrollpos; unsigned short m_scrollstep; void blitRot(int dx, int sx, int sw, int sh, CDrawBuffer* txt); void setBackgroundBitmap(const QPixmap& _pm, bground bg) diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp index ec7a29c..876b65a 100644 --- a/noncore/apps/opie-reader/QTReaderApp.cpp +++ b/noncore/apps/opie-reader/QTReaderApp.cpp @@ -1,134 +1,132 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. Allrights reserved. ** ** This file is part of Qt Palmtop Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ -#include "useqpe.h" #include <qregexp.h> #include <qclipboard.h> #include <qwidgetstack.h> #ifdef USEQPE #include <qpe/qpemenubar.h> #include <qpe/qpetoolbar.h> #endif #include <qmenubar.h> #include <qtoolbar.h> #ifdef USEQPE #include <qpe/menubutton.h> #endif #include <qcombobox.h> #include <qpopupmenu.h> #include <qaction.h> #include <qapplication.h> #include <qlineedit.h> #include <qtoolbutton.h> #include <qspinbox.h> #include <qobjectlist.h> #include <qstatusbar.h> #ifdef USEQPE #include <qpe/global.h> #include <qpe/applnk.h> #endif #include <qfileinfo.h> #include <stdlib.h> //getenv #include <qprogressbar.h> #ifdef USEQPE #include <qpe/config.h> #endif #include <qbuttongroup.h> #include <qradiobutton.h> #ifdef USEQPE #include <qpe/qcopenvelope_qws.h> #endif #include "QTReader.h" #include "GraphicWin.h" #include "Bkmks.h" #include "cbkmkselector.h" #include "infowin.h" #include "ToolbarPrefs.h" #include "Prefs.h" #include "CAnnoEdit.h" #include "QFloatBar.h" #include "FixedFont.h" #include "URLDialog.h" #include "util.h" #include <qfontdatabase.h> #ifdef USEQPE #include <qpe/resource.h> #ifdef OPIE //#include <qpe/applnk.h> #include <opie2/ofiledialog.h> using namespace Opie::Ui; #else #include "fileBrowser.h" #endif #else #include "qfiledialog.h" #endif #include "QTReaderApp.h" #include "CDrawBuffer.h" #include "Filedata.h" -#include "useqpe.h" #include "names.h" #include "CEncoding_tables.h" #include "CloseDialog.h" #include "ButtonPrefs.h" bool CheckVersion(int&, int&, char&); #ifdef _WINDOWS #define PICDIR "c:\\uqtreader\\pics\\" #else #ifdef USEQPE #define USEMSGS #define PICDIR "opie-reader/" #else //#define PICDIR "/home/tim/uqtreader/pics/" QString picdir() { QString hd(getenv("READERDIR")); return hd + "/pics"; } #define PICDIR picdir() #endif #endif unsigned long QTReaderApp::m_uid = 0; void QTReaderApp::setScrollState(bool _b) { m_scrollButton->setOn(_b); } #ifdef USEQPE #define geticon(iconname) Resource::loadPixmap( iconname ) #define getmyicon(iconname) Resource::loadPixmap( PICDIR iconname ) #else //#define geticon(iconname) QPixmap(PICDIR iconname ".png") #define geticon(iconname) QPixmap(PICDIR +"/"+iconname+".png") #define getmyicon(iconname) geticon(iconname) //#define geticon(iconname) QIconSet( QPixmap(PICDIR iconname) ) #endif #ifndef _WINDOWS #include <unistd.h> #endif #include <stddef.h> #ifndef _WINDOWS #include <dirent.h> #endif void QTReaderApp::listBkmkFiles() diff --git a/noncore/apps/opie-reader/QTReaderApp.h b/noncore/apps/opie-reader/QTReaderApp.h index 5ecc42d..ad47fc9 100644 --- a/noncore/apps/opie-reader/QTReaderApp.h +++ b/noncore/apps/opie-reader/QTReaderApp.h @@ -1,77 +1,76 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qt Palmtop Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef __QTREADERAPP_H #define __QTREADERAPP_H //#define _SCROLLPIPE //#define __ISEARCH //#define MAX_ENCODING 6 #define MAX_ACTIONS 5 -#include "useqpe.h" #include <sys/timeb.h> #include <qmainwindow.h> #include "CExpander.h" #include "CEncoding.h" #include <qlist.h> //#include <qpe/filemanager.h> #include <qmap.h> #include <qlineedit.h> #include <qstack.h> #include <qlistbox.h> #ifdef USEQPE #include <qpe/qpeapplication.h> #endif #include "orkey.h" //#include "Queue.h" #include "BGType.h" class QBoxLayout; class QWidgetStack; class QToolButton; class QPopupMenu; class QToolBar; #ifdef USEQPE class QPEToolBar; class QPEMenuBar; #endif class QScrollBar; class CBkmkSelector; class QProgressBar; class QAction; class CAnnoEdit; class QFloatBar; class CDrawBuffer; class QTReader; class QImage; class Config; class CButtonPrefs; #ifdef USEQPE enum ToolbarPolicy { cesSingle = 0, cesMenuTool, cesMultiple }; #else enum ToolbarPolicy { diff --git a/noncore/apps/opie-reader/ToolbarPrefs.cpp b/noncore/apps/opie-reader/ToolbarPrefs.cpp index 5cf220a..56c4e9b 100644 --- a/noncore/apps/opie-reader/ToolbarPrefs.cpp +++ b/noncore/apps/opie-reader/ToolbarPrefs.cpp @@ -1,57 +1,56 @@ /**************************************************************************** ** Form implementation generated from reading ui file 'Prefs.ui' ** ** Created: Tue Feb 11 23:53:35 2003 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ -#include "useqpe.h" #include "ToolbarPrefs.h" #include <qcheckbox.h> #include <qlabel.h> #include <qpushbutton.h> #include <qspinbox.h> #include <qlayout.h> #include <qvariant.h> #include <qtooltip.h> #include <qwhatsthis.h> #include <qcombobox.h> #include <qbuttongroup.h> #include <qlineedit.h> #ifdef USEQPE #include <qpe/menubutton.h> #endif CBarPrefs::CBarPrefs(const QString& appdir, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true), config( appdir ) { setCaption(tr( "Toolbar Settings" ) ); QTabWidget* td = new QTabWidget(this); misc = new CMiscBarPrefs(this); filebar = new CFileBarPrefs(config, this); navbar = new CNavBarPrefs(config, this); viewbar = new CViewBarPrefs(config, this); markbar = new CMarkBarPrefs(config, this); indbar = new CIndBarPrefs(config, this); td->addTab(filebar, tr("File")); td->addTab(navbar, tr("Navigation")); td->addTab(viewbar, tr("View")); td->addTab(markbar, tr("Marks")); td->addTab(indbar, tr("Indicators")); td->addTab(misc, tr("Policy")); QVBoxLayout* v = new QVBoxLayout(this); v->addWidget(td); if (fs) showMaximized(); } /* CBarPrefs1::CBarPrefs1( Config& _config, QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ), config(_config) { config.setGroup( "Toolbar" ); QVBoxLayout* vb = new QVBoxLayout(this); QGroupBox* bg = new QGroupBox(3, Qt::Horizontal, "File", this); vb->addWidget(bg); diff --git a/noncore/apps/opie-reader/ToolbarPrefs.h b/noncore/apps/opie-reader/ToolbarPrefs.h index a2686e5..0bdae6b 100644 --- a/noncore/apps/opie-reader/ToolbarPrefs.h +++ b/noncore/apps/opie-reader/ToolbarPrefs.h @@ -1,74 +1,72 @@ /**************************************************************************** ** Form interface generated from reading ui file 'Prefs.ui' ** ** Created: Tue Feb 11 23:53:32 2003 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #ifndef CTOOLBARPREFS_H #define CTOOLBARPREFS_H -#include "useqpe.h" #include <qvariant.h> #include <qwidget.h> #include <qtabdialog.h> #include <qtabwidget.h> #include <qspinbox.h> #include <qcheckbox.h> #include <qcombobox.h> #include <qlineedit.h> #ifdef USEQPE #include <qpe/menubutton.h> #include <qpe/config.h> #else #include "preferences.h" #endif -//#include "opie.h" //#ifdef OPIE #define USECOMBO //#endif class QVBoxLayout; class QHBoxLayout; class QGridLayout; //class QCheckBox; class QLabel; //class QSpinBox; /* class CBarPrefs1 : public QWidget { Q_OBJECT Config& config; QCheckBox *open, *close, *info, *twotouch,*find,*scroll,*navigation,*page,*startend,*jump,*pageline; bool m_isChanged; private slots: void isChanged(int _v) { m_isChanged = true; } public: CBarPrefs1( Config&, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~CBarPrefs1(); void saveall(); bool isChanged() { return m_isChanged; } }; */ class CFileBarPrefs : public QWidget { Q_OBJECT Config& config; QCheckBox *open, *close, *info, *twotouch, *find, *scroll; bool m_isChanged; private slots: void isChanged(int _v) { m_isChanged = true; } public: CFileBarPrefs( Config&, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~CFileBarPrefs(); void saveall(); bool isChanged() { return m_isChanged; } }; diff --git a/noncore/apps/opie-reader/URLDialog.h b/noncore/apps/opie-reader/URLDialog.h index 1bcc4bd..792d13a 100644 --- a/noncore/apps/opie-reader/URLDialog.h +++ b/noncore/apps/opie-reader/URLDialog.h @@ -1,60 +1,59 @@ /**************************************************************************** ** Form interface generated from reading ui file 'Prefs.ui' ** ** Created: Tue Feb 11 23:53:32 2003 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #ifndef __URLDIALOG_H #define __URLDIALOG_H -#include "useqpe.h" #include <qvariant.h> #include <qwidget.h> #include <qtabdialog.h> #include <qtabwidget.h> #include <qspinbox.h> #include <qcheckbox.h> #include <qcombobox.h> #include <qlineedit.h> //#include <qpe/menubutton.h> #include <qvbuttongroup.h> class QVBoxLayout; class QHBoxLayout; class QGridLayout; //class QCheckBox; class QLabel; //class QSpinBox; class CURLDialog : public QDialog { Q_OBJECT QCheckBox *m_localfile, *m_globalfile, *m_clipboard; #ifndef USEQPE void keyPressEvent(QKeyEvent* e) { switch (e->key()) { case Key_Escape: e->accept(); reject(); break; case Key_Space: case Key_Return: e->accept(); accept(); break; default: QWidget::keyPressEvent(e); } } #endif public: CURLDialog(const QString&, bool fs = true, QWidget* parent = 0, const char* name = 0); ~CURLDialog() {} bool clipboard() { return m_clipboard->isChecked(); } bool localfile() { return m_localfile->isChecked(); } bool globalfile() { return m_globalfile->isChecked(); } void clipboard(bool _b) { m_clipboard->setChecked(_b); } diff --git a/noncore/apps/opie-reader/WeaselCodec/WeaselCodec.pro b/noncore/apps/opie-reader/WeaselCodec/WeaselCodec.pro index 61e7dc9..f20bdc6 100644 --- a/noncore/apps/opie-reader/WeaselCodec/WeaselCodec.pro +++ b/noncore/apps/opie-reader/WeaselCodec/WeaselCodec.pro @@ -1,17 +1,17 @@ DEFINES += OPIE USEQPE VPATH = .. TEMPLATE = lib CONFIG = qt warn_on release dll HEADERS = ztxt.h SOURCES = ztxt.cpp INTERFACES = DESTDIR = $(OPIEDIR)/plugins/reader/codecs TARGET = Weasel LIBS += -lreader_pdb -lreader_codec -INCLUDEPATH += ../OREADERINC $(OPIEDIR)/include -DEPENDPATH += ../OREADERINC $(OPIEDIR)/include +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/apps/opie-reader/ZText.h b/noncore/apps/opie-reader/ZText.h index 06e3bf8..199c7da 100644 --- a/noncore/apps/opie-reader/ZText.h +++ b/noncore/apps/opie-reader/ZText.h @@ -1,54 +1,53 @@ #ifndef __Text_h #define __Text_h #include <stdio.h> #include <zlib.h> #include <sys/stat.h> -#include "useqpe.h" #include "CExpander.h" class Text: public CExpander { gzFile file; unsigned long fsize; public: void suspend() { #ifdef USEQPE if (!bSuspended) { bSuspended = true; suspos = gztell(file); gzclose(file); file = NULL; sustime = time(NULL); } #endif } void unsuspend() { #ifdef USEQPE if (bSuspended) { bSuspended = false; if (sustime != ((time_t)-1)) { int delay = time(NULL) - sustime; if (delay < 10) sleep(10-delay); } file = gzopen(fname, "rb"); for (int i = 0; file == NULL && i < 5; i++) { sleep(5); file = gzopen(fname, "rb"); } if (file == NULL) { QMessageBox::warning(NULL, PROGNAME, "Couldn't reopen file"); exit(0); } suspos = gzseek(file, suspos, SEEK_SET); } #endif } Text() : file(NULL) {}; virtual ~Text() { diff --git a/noncore/apps/opie-reader/codeclib/codeclib.pro b/noncore/apps/opie-reader/codeclib/codeclib.pro index 6adcda8..c24767b 100644 --- a/noncore/apps/opie-reader/codeclib/codeclib.pro +++ b/noncore/apps/opie-reader/codeclib/codeclib.pro @@ -1,17 +1,17 @@ DEFINES += OPIE USEQPE VPATH = .. TEMPLATE = lib CONFIG = qt warn_on release dll HEADERS = pdb.h SOURCES = CExpander.cpp CBuffer.cpp StyleConsts.cpp \ hrule.cpp Navigation.cpp Bkmks.cpp INTERFACES = DESTDIR = $(OPIEDIR)/lib TARGET = reader_codec -INCLUDEPATH += ../OREADERINC $(OPIEDIR)/include -DEPENDPATH += ../OREADERINC $(OPIEDIR)/include +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/apps/opie-reader/ebookcodec.h b/noncore/apps/opie-reader/ebookcodec.h index b341e55..f6e2daf 100644 --- a/noncore/apps/opie-reader/ebookcodec.h +++ b/noncore/apps/opie-reader/ebookcodec.h @@ -1,61 +1,59 @@ #include "CExpander.h" #include <qfileinfo.h> #include <qdir.h> -#include "useqpe.h" #ifdef USEQPE #include <qpe/global.h> #endif #include "util.h" -#include "static.h" #ifndef __STATIC #include <dlfcn.h> class ebookcodec : public CExpander_Interface { CExpander *codec; void *handle; int status; public: QString about() { return QString("Plug-in ebook codec interface (c) Tim Wentford\n")+codec->about(); } ebookcodec(const QString& _s) : codec(NULL), handle(NULL), status(0) { QString codecpath(QTReaderUtil::getPluginPath()); codecpath += _s; if (QFile::exists(codecpath)) { qDebug("Codec:%s", (const char*)codecpath); handle = dlopen(codecpath, RTLD_LAZY); if (handle == 0) { /* QString wrn(dlerror()); QString fmt; while (wrn.length() > 10) { fmt += wrn.left(10); fmt += '\n'; wrn = wrn.right(wrn.length()-10); } fmt += wrn; QMessageBox::warning(NULL, PROGNAME, fmt); */ qDebug("Can't find codec:%s", dlerror()); status = -10; return; } CExpander* (*newcodec)(); newcodec = (CExpander* (*)())dlsym(handle, "newcodec"); if (newcodec == NULL) { qDebug("Can't find newcodec"); status = -20; return; } codec = (*newcodec)(); } diff --git a/noncore/apps/opie-reader/iSiloCodec/iSiloCodec.pro b/noncore/apps/opie-reader/iSiloCodec/iSiloCodec.pro index 78d5a49..5cf075e 100644 --- a/noncore/apps/opie-reader/iSiloCodec/iSiloCodec.pro +++ b/noncore/apps/opie-reader/iSiloCodec/iSiloCodec.pro @@ -1,19 +1,19 @@ DEFINES += OPIE USEQPE VPATH = .. TEMPLATE = lib CONFIG = qt warn_on release dll #HEADERS = Aportis.h SOURCES = iSilo.cpp INTERFACES = DESTDIR = $(OPIEDIR)/plugins/reader/codecs TARGET = iSilo LIBS += -lreader_pdb -lreader_codec -INCLUDEPATH += ../OREADERINC $(OPIEDIR)/include -DEPENDPATH += ../OREADERINC $(OPIEDIR)/include +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/apps/opie-reader/main.cpp b/noncore/apps/opie-reader/main.cpp index 3e1f5e7..af276da 100644 --- a/noncore/apps/opie-reader/main.cpp +++ b/noncore/apps/opie-reader/main.cpp @@ -1,49 +1,48 @@ -#include "useqpe.h" #ifdef USEQPE #include <qpe/qpeapplication.h> #else #include <qapplication.h> #endif #include "QTReaderApp.h" #include "signal.h" #include "stdio.h" #include "time.h" #ifdef USEQPE QTReaderApp* app = NULL; void handler(int signum) { if (app != NULL) { app->suspend(); app->saveprefs(); } signal(signum, handler); } #endif int main( int argc, char ** argv ) { #ifdef USEQPE signal(SIGCONT, handler); QPEApplication a( argc, argv ); QTReaderApp m; a.showMainDocumentWidget( &m ); app = &m; #else QApplication a( argc, argv ); QTReaderApp m; a.setMainWidget( &m ); if (argc > 1) { m.setDocument(argv[1]); } #endif return a.exec(); } diff --git a/noncore/apps/opie-reader/pdb.cpp b/noncore/apps/opie-reader/pdb.cpp index 39551cc..6719af4 100644 --- a/noncore/apps/opie-reader/pdb.cpp +++ b/noncore/apps/opie-reader/pdb.cpp @@ -1,54 +1,53 @@ #include "pdb.h" #ifdef _WINDOWS #include <winsock2.h> #endif -#include "useqpe.h" #ifdef USEQPE void Cpdb::suspend() { CExpander::suspend(fin); } void Cpdb::unsuspend() { CExpander::unsuspend(fin); } #endif Cpdb::~Cpdb() { if (fin != NULL) { #ifdef USEQPE unsuspend(); #endif fclose(fin); } } size_t Cpdb::recordpos(int n) { UInt16 mxn = ntohs(head.recordList.numRecords); if (n >= mxn) { return file_length; } else { size_t dataoffset = sizeof(DatabaseHdrType) - sizeof(UInt16); dataoffset += /*dataoffset%4 + */ sizeof(RecordListType) * n; fseek(fin, dataoffset, SEEK_SET); RecordListType hdr; fread(&hdr, 1, sizeof(hdr), fin); return ntohl(hdr.nextRecordListID); } } size_t Cpdb::recordlength(int n) { return recordpos(n+1)-recordpos(n); } void Cpdb::gotorecordnumber(int n) diff --git a/noncore/apps/opie-reader/pdb.h b/noncore/apps/opie-reader/pdb.h index 7a6580d..7458919 100644 --- a/noncore/apps/opie-reader/pdb.h +++ b/noncore/apps/opie-reader/pdb.h @@ -1,66 +1,65 @@ /* * This header file defines some structures and types normally found in the * Palm SDK. However, I don't want to require the presense of the SDK for a * small utility since most Palm owners won't have it. * * $Id$ * */ #ifndef __PDB_H__ #define __PDB_H__ #ifndef _WINDOWS #include <netinet/in.h> #endif #include <stdio.h> -#include "useqpe.h" #include "CExpander.h" /* Normal Palm typedefs */ typedef unsigned char UInt8; typedef unsigned short UInt16; typedef signed short Int16; typedef unsigned long UInt32; typedef UInt32 LocalID; /* Max length of DB name */ #define dmDBNameLength 0x20 /************************************************************ * Structure of a Record entry *************************************************************/ typedef struct { LocalID localChunkID; // local chunkID of a record UInt8 attributes; // record attributes; UInt8 uniqueID[3]; // unique ID of record; should // not be 0 for a legal record. } RecordEntryType; /************************************************************ * Structure of a record list extension. This is used if all * the database record/resource entries of a database can't fit into * the database header. *************************************************************/ typedef struct { LocalID nextRecordListID; // local chunkID of next list UInt16 numRecords; // number of records in this list UInt16 firstEntry; // array of Record/Rsrc entries // starts here } RecordListType; /************************************************************ * Structure of a Database Header *************************************************************/ typedef struct { UInt8 name[dmDBNameLength]; // name of database UInt16 attributes; // database attributes UInt16 version; // version of database UInt32 creationDate; // creation date of database UInt32 modificationDate; // latest modification date UInt32 lastBackupDate; // latest backup date UInt32 modificationNumber; // modification number of database diff --git a/noncore/apps/opie-reader/pdblib/pdblib.pro b/noncore/apps/opie-reader/pdblib/pdblib.pro index cb861a8..830d988 100644 --- a/noncore/apps/opie-reader/pdblib/pdblib.pro +++ b/noncore/apps/opie-reader/pdblib/pdblib.pro @@ -1,16 +1,16 @@ DEFINES += OPIE USEQPE VPATH = .. TEMPLATE = lib CONFIG = qt warn_on release dll HEADERS = pdb.h SOURCES = pdb.cpp INTERFACES = DESTDIR = $(OPIEDIR)/lib TARGET = reader_pdb -INCLUDEPATH += ../OREADERINC $(OPIEDIR)/include -DEPENDPATH += ../OREADERINC $(OPIEDIR)/include +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/apps/opie-reader/plucker.cpp b/noncore/apps/opie-reader/plucker.cpp index d1ccd6f..4ea807a 100644 --- a/noncore/apps/opie-reader/plucker.cpp +++ b/noncore/apps/opie-reader/plucker.cpp @@ -1,71 +1,69 @@ -#include "useqpe.h" #include <stdio.h> #include <string.h> #include <qmessagebox.h> #include <qpixmap.h> #ifdef USEQPE #include <qpe/qcopenvelope_qws.h> #endif #ifdef LOCALPICTURES #include <qscrollview.h> #endif #ifdef USEQPE #include <qpe/global.h> #include <qpe/qpeapplication.h> #else #include <qapplication.h> #endif #include <qclipboard.h> #include "plucker.h" #include "Aportis.h" #include "Palm2QImage.h" -#include "static.h" struct CPlucker_dataRecord { UInt16 uid; UInt16 nParagraphs; UInt16 size; UInt8 type; UInt8 reserved; }; int CPlucker::HeaderSize() { return sizeof(CPlucker_dataRecord); } void CPlucker::GetHeader(UInt16& uid, UInt16& nParagraphs, UInt32& size, UInt8& type, UInt8& reserved) { CPlucker_dataRecord thishdr; fread(&thishdr, 1, HeaderSize(), fin); uid = ntohs(thishdr.uid); nParagraphs = ntohs(thishdr.nParagraphs); size = ntohs(thishdr.size); type = thishdr.type; reserved = thishdr.reserved; } CPlucker::CPlucker() { /*printf("constructing:%x\n",fin);*/ EOPPhase = 0; } bool CPlucker::CorrectDecoder() { return (memcmp(&head.type, "DataPlkr", 8) == 0); } int CPlucker::bgetch() { int ch = EOF; if (bufferpos >= buffercontent) { if (isEndOfSection(bufferrec)) { if (!m_continuous) return EOF; } if (bufferrec >= ntohs(head.recordList.numRecords) - 1) { diff --git a/noncore/apps/opie-reader/plucker_base.cpp b/noncore/apps/opie-reader/plucker_base.cpp index 0b7fae8..d7d538f 100644 --- a/noncore/apps/opie-reader/plucker_base.cpp +++ b/noncore/apps/opie-reader/plucker_base.cpp @@ -1,72 +1,70 @@ -#include "useqpe.h" #include "usenef.h" #include <stdio.h> #include <string.h> #include <qmessagebox.h> #include <qpixmap.h> #ifdef USEQPE #include <qpe/qcopenvelope_qws.h> #endif /* USEQPE */ #ifdef LOCALPICTURES #include <qscrollview.h> #endif #ifdef USEQPE #include <qpe/global.h> #endif /* USEQPE */ #include <qclipboard.h> #ifndef USEQPE #include <qapplication.h> #else /* USEQPE */ #include <qpe/qpeapplication.h> #endif /* USEQPE */ #include <qimage.h> -#include "static.h" #include "plucker_base.h" #include "Aportis.h" #include "hrule.h" #include "util.h" const UInt8 CPlucker_base::continuation_bit = 1; CPlucker_base::CPlucker_base() : #ifdef LOCALPICTURES m_viewer(NULL), m_picture(NULL), #endif expandedtextbuffer(NULL), compressedtextbuffer(NULL), bufferrec(-1), m_offset(0) //, urls(NULL) { /*printf("constructing:%x\n",fin);*/ } void CPlucker_base::Expand(UInt32 reclen, UInt8 type, UInt8* buffer, UInt32 buffersize) { if (type%2 == 0) { fread(buffer, reclen, sizeof(char), fin); } else { UInt8* readbuffer = NULL; if (reclen > compressedbuffersize) { readbuffer = new UInt8[reclen]; } else { readbuffer = compressedtextbuffer; } if (readbuffer != NULL) { fread(readbuffer, reclen, sizeof(char), fin); (*m_decompress)(readbuffer, reclen, buffer, buffersize); if (reclen > compressedbuffersize) { delete [] readbuffer; } } } } @@ -1314,97 +1312,96 @@ tchar CPlucker_base::getch_base(bool fast) ch = bgetch(); break; case 0x83: { int tlen = bgetch(); ch = bgetch(); ch <<= 8; ch |= (tchar)bgetch(); for (int i = 0; i < tlen; i++) bgetch(); //qDebug("Function 83"); } break; case 0x9a: { m_offset = 255*bgetch(); m_offset += bgetch(); qDebug("Found offset:%u", m_offset); ch = bgetch(); } break; case 0x85: default: qDebug("Function:%x NOT IMPLEMENTED", ch); { int skip = ch & 7; for (int i = 0; i < skip; i++) { ch = bgetch(); //qDebug("Arg %d, %d", i, ch); } ch = bgetch(); } } } if (m_lastIsBreak && !mystyle.isMono()) { while (ch == ' ') { ch = getch(false); } } m_lastIsBreak = (ch == 10); return (ch == EOF) ? UEOF : ch; } -#include "static.h" #if defined(__STATIC) && defined(USENEF) #include "Model.h" void (*CPlucker_base::getdecompressor(const QString& _s))(UInt8*, size_t, UInt8*, size_t) { if (_s == "PluckerDecompress3") { return PluckerDecompress3; } if (_s == "PluckerDecompress4") { return PluckerDecompress4; } return NULL; } #else #include "qfileinfo.h" #include <dlfcn.h> void (*CPlucker_base::getdecompressor(const QString& _s))(UInt8*, size_t, UInt8*, size_t) { QString codecpath(QTReaderUtil::getPluginPath("support")); codecpath += "/libpluckerdecompress.so"; qDebug("Codec:%s", (const char*)codecpath); if (QFile::exists(codecpath)) { qDebug("Codec:%s", (const char*)codecpath); void* handle = dlopen(codecpath, RTLD_LAZY); if (handle == 0) { qDebug("Can't find codec:%s", dlerror()); return NULL; } return (void (*)(UInt8*, size_t, UInt8*, size_t))dlsym(handle, _s); } return NULL; } #endif QString CPlucker_base::about() { QString abt = "Plucker base codec (c) Tim Wentford"; if (m_decompress != UnDoc && m_decompress != UnZip) { abt += "\nSpecial decompression (c) Tim Wentford"; } return abt; diff --git a/noncore/apps/opie-reader/pluckerbaselib/pluckerbaselib.pro b/noncore/apps/opie-reader/pluckerbaselib/pluckerbaselib.pro index bee1a2d..7c2f31e 100644 --- a/noncore/apps/opie-reader/pluckerbaselib/pluckerbaselib.pro +++ b/noncore/apps/opie-reader/pluckerbaselib/pluckerbaselib.pro @@ -1,18 +1,18 @@ DEFINES += OPIE USEQPE VPATH = .. TEMPLATE = lib CONFIG = qt warn_on release dll HEADERS = pdb.h \ util.h SOURCES = plucker_base.cpp INTERFACES = DESTDIR = $(OPIEDIR)/lib TARGET = reader_pluckerbase LIBS += -ldl -INCLUDEPATH += ../OREADERINC $(OPIEDIR)/include -DEPENDPATH += ../OREADERINC $(OPIEDIR)/include +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/apps/opie-reader/ppm_expander.cpp b/noncore/apps/opie-reader/ppm_expander.cpp index ea5b955..2a4318b 100644 --- a/noncore/apps/opie-reader/ppm_expander.cpp +++ b/noncore/apps/opie-reader/ppm_expander.cpp @@ -1,59 +1,58 @@ /* * Interface pour le programme de compression * (c) 1995 Fabrice Bellard */ #include <stdlib.h> //#include <unistd.h> #include <stdio.h> #include <string.h> #include <time.h> -#include "static.h" /*************************************************************************** * Interface avec les routines de compression */ #define METHOD_NB 2 /* nombre total de méthodes de compression */ #define METHOD_STORE 0 #define METHOD_PPM 1 #define DEFAULT_SUFFIX ".st" /* extension par défault */ /* signature en début de fichier */ #define STAT_MAGIC_SIZE 4 char stat_magic[STAT_MAGIC_SIZE]={'P','P','M','S'}; #include "ppm_expander.h" ppm_expander::~ppm_expander() { if (needppmend) ppm.PPM_End(); ppm.arith.Arith_DecodeEnd(); if (buf_in!=NULL) delete [] buf_in; if (buf_out!=NULL) delete [] buf_out; if (my_read_buf != NULL) delete my_read_buf; if (my_file_in != NULL) fclose(my_file_in); } int ppm_expander::OpenFile(const char* infile) { my_file_in=fopen(infile,"rb"); my_read_buf = new PPM_ReadBuf(my_file_in); return home(); } void ppm_expander::sizes(unsigned long& file, unsigned long& text) { struct stat _stat; fstat(fileno(my_file_in),&_stat); file = _stat.st_size; text = numblocks*blocksize; } int ppm_expander::home() { fseek(my_file_in,0, SEEK_SET); unsigned char header[STAT_MAGIC_SIZE]; size_t len=fread(header,1,STAT_MAGIC_SIZE,my_file_in); if (strncmp((char*)header,stat_magic,STAT_MAGIC_SIZE)!=0) { diff --git a/noncore/apps/opie-reader/ppm_expander.h b/noncore/apps/opie-reader/ppm_expander.h index a1a3b60..ccc89c2 100644 --- a/noncore/apps/opie-reader/ppm_expander.h +++ b/noncore/apps/opie-reader/ppm_expander.h @@ -1,52 +1,51 @@ #ifndef __ppm_expander_h #define __ppm_expander_h -#include "useqpe.h" #include "CExpander.h" #include <sys/stat.h> #include "utypes.h" #include "ppm.h" #include "arith.h" #define SYM_EOF 256 class ppm_expander : public CExpander { UCHAR *buf_in,*buf_out; unsigned int bufsize; unsigned int outbytes; unsigned long blocksize; unsigned short numblocks; unsigned short curblock; unsigned short maxnode; bool needppmend; int home(); FILE* my_file_in; PPM_ReadBuf* my_read_buf; ppm_worker ppm; public: QString about() { return QString("ppms Codec (c) Tim Wentford\nCompression code (c) Fabrice Bellard"); } #ifdef USEQPE void suspend() { CExpander::suspend(my_file_in); } void unsuspend() { CExpander::unsuspend(my_file_in); } #endif ppm_expander() : needppmend(false), my_file_in(NULL), my_read_buf(NULL) { bufsize = 1024; buf_in = new UCHAR[bufsize]; buf_out = new UCHAR[bufsize]; outbytes = 0; } int OpenFile(const char* infile); int getch(); void locate(unsigned short block, unsigned int n); virtual ~ppm_expander(); unsigned int locate() { return outbytes; } diff --git a/noncore/apps/opie-reader/ppmsCodec/ppmsCodec.pro b/noncore/apps/opie-reader/ppmsCodec/ppmsCodec.pro index 8699d3b..d6ec97b 100644 --- a/noncore/apps/opie-reader/ppmsCodec/ppmsCodec.pro +++ b/noncore/apps/opie-reader/ppmsCodec/ppmsCodec.pro @@ -1,19 +1,19 @@ DEFINES += OPIE USEQPE VPATH = .. TEMPLATE = lib CONFIG = qt warn_on release dll HEADERS = Aportis.h SOURCES = ppm_expander.cpp \ ppm.cpp \ arith_d.cpp INTERFACES = DESTDIR = $(OPIEDIR)/plugins/reader/codecs TARGET = ppms LIBS += -lreader_codec -INCLUDEPATH += ../OREADERINC $(OPIEDIR)/include -DEPENDPATH += ../OREADERINC $(OPIEDIR)/include +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/apps/opie-reader/preferences.cpp b/noncore/apps/opie-reader/preferences.cpp index b9397cf..0f59a22 100755 --- a/noncore/apps/opie-reader/preferences.cpp +++ b/noncore/apps/opie-reader/preferences.cpp @@ -1,49 +1,48 @@ -#include "useqpe.h" #ifndef USEQPE #include "preferences.h" #include <qfile.h> #include <qtextstream.h> Config::Config(const QString& _fn) : fname(_fn) { // qDebug("Config::Config:%s", (const char*)fname); QFile fl(fname); if (fl.open(IO_ReadOnly)) { QTextStream t(&fl); QString key, value; while (!t.eof()) { QString data = t.readLine(); int colon = data.find(':'); if (colon > 0) { QString key = data.left(colon); QString value = data.right(data.length()-colon-1); values[key] = value; } } fl.close(); } // read entries into values } Config::~Config() { // qDebug("Config::~Config:%s", (const char*)fname); QFile fl(fname); if (fl.open(IO_WriteOnly)) { QTextStream t(&fl); for (QMap<QString,QString>::Iterator iter = values.begin(); iter != values.end(); iter++) { t << iter.key() << ':' << iter.data() << '\n'; } fl.close(); } } QString Config::readEntry(const QString& key, const QString& deflt) { diff --git a/noncore/apps/opie-reader/preferences.h b/noncore/apps/opie-reader/preferences.h index 69d1774..aeb2a84 100644 --- a/noncore/apps/opie-reader/preferences.h +++ b/noncore/apps/opie-reader/preferences.h @@ -1,27 +1,26 @@ -#include "useqpe.h" #ifndef USEQPE #ifndef __PREFERENCES_H #define __PREFERENCES_H #include <qstring.h> #include <qmap.h> class Config { QMap<QString, QString> values; QString fname; public: Config(const QString& fname); ~Config();
void setGroup(const QString& s) { } QString readEntry(const QString&, const QString&); bool readBoolEntry(const QString&, const bool); int readNumEntry(const QString&, const int); void writeEntry(const QString&, const QString&); void writeEntry(const QString&, const bool); void writeEntry(const QString&, const int); }; #endif // PREFERENCES #endif diff --git a/noncore/apps/opie-reader/static.h b/noncore/apps/opie-reader/static.h deleted file mode 100644 index e69de29..0000000 --- a/noncore/apps/opie-reader/static.h +++ b/dev/null diff --git a/noncore/apps/opie-reader/striphtml.cpp b/noncore/apps/opie-reader/striphtml.cpp index 9cd6a0d..e86402b 100644 --- a/noncore/apps/opie-reader/striphtml.cpp +++ b/noncore/apps/opie-reader/striphtml.cpp @@ -1,53 +1,52 @@ #include <qmap.h> #include <qfileinfo.h> #include <qtextstream.h> #include <qdir.h> -#include "useqpe.h" #ifdef USEQPE #include <qpe/global.h> #endif #include "CDrawBuffer.h" #include "striphtml.h" #include "hrule.h" #include "util.h" #include <qregexp.h> #include <qimage.h> #include <qpixmap.h> //#include <qprogressdialog.h> //#include <qapplication.h> static unsigned char h2i(unsigned char c) { unsigned char ret = 0; if ('0' <= c && c <= '9') { ret = c - '0'; } else if ('a' <= c && c <= 'f') { ret = c - 'a' + 10; } return ret; } static void parse_color(const QString& attr, unsigned char& r, unsigned char& g, unsigned char& b) { r = g = b = 0; if (attr.length() >= 7 && attr[0] == '#') { r = h2i(attr[1].unicode()); r = 16*r + h2i(attr[2].unicode()); g = h2i(attr[3].unicode()); g = 16*g + h2i(attr[4].unicode()); b = h2i(attr[5].unicode()); b = 16*b + h2i(attr[6].unicode()); } else if (attr == "red") { r = 255; } else if (attr == "green") { g = 255; } diff --git a/noncore/apps/opie-reader/useqpe.h b/noncore/apps/opie-reader/useqpe.h deleted file mode 100644 index e69de29..0000000 --- a/noncore/apps/opie-reader/useqpe.h +++ b/dev/null diff --git a/noncore/apps/opie-reader/ztxt.cpp b/noncore/apps/opie-reader/ztxt.cpp index 79c5fa4..35db05e 100644 --- a/noncore/apps/opie-reader/ztxt.cpp +++ b/noncore/apps/opie-reader/ztxt.cpp @@ -1,54 +1,53 @@ #include <stdio.h> #include <string.h> #include "ztxt.h" #include "my_list.h" #include "Bkmks.h" -#include "static.h" ztxt::ztxt() : bInit(false), expandedtextbuffer(NULL), compressedtextbuffer(NULL) { /*printf("constructing:%x\n",fin);*/ } int ztxt::OpenFile(const char *src) { if (!Cpdb::openpdbfile(src)) { return -1; } //printf("Okay %u\n", 4); if (head.type != ZTXT_ID) return -1; gotorecordnumber(0); fread(&hdr0, 1, sizeof(hdr0), fin); //printf("Okay %u\n", 5); buffersize = ntohl(hdr0.size); compressedtextbuffer = new UInt8[buffersize]; expandedtextbuffer = new UInt8[buffersize]; //printf("Okay %u\n", 6); home(); //printf("Okay %u\n", 7); // printf("Returning 0\n"); return 0; } int ztxt::getch() { if (bufferpos >= buffercontent) { size_t reclen = recordlength(++bufferrec); if (reclen == 0) return -1; gotorecordnumber(bufferrec); fread(compressedtextbuffer, reclen, sizeof(char), fin); zstream.next_in = compressedtextbuffer; zstream.next_out = expandedtextbuffer; zstream.avail_out = buffersize; zstream.avail_in = reclen; int ret = inflate(&zstream, Z_SYNC_FLUSH); buffercontent = buffersize - zstream.avail_out; bufferpos = 0; |