summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/plucker_base.cpp
authorar <ar>2004-05-03 21:35:18 (UTC)
committer ar <ar>2004-05-03 21:35:18 (UTC)
commit412619441fab46fc79c695a23ccf9e38135bdfad (patch) (side-by-side diff)
tree19d9b8af14cf6c345ef532bb32368b9c7b43c50f /noncore/apps/opie-reader/plucker_base.cpp
parentd1095d71394779557f446e2a67ba55bc62eec859 (diff)
downloadopie-412619441fab46fc79c695a23ccf9e38135bdfad.zip
opie-412619441fab46fc79c695a23ccf9e38135bdfad.tar.gz
opie-412619441fab46fc79c695a23ccf9e38135bdfad.tar.bz2
- convert qDebug to odebug
Diffstat (limited to 'noncore/apps/opie-reader/plucker_base.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/plucker_base.cpp1402
1 files changed, 705 insertions, 697 deletions
diff --git a/noncore/apps/opie-reader/plucker_base.cpp b/noncore/apps/opie-reader/plucker_base.cpp
index caa945d..b523a54 100644
--- a/noncore/apps/opie-reader/plucker_base.cpp
+++ b/noncore/apps/opie-reader/plucker_base.cpp
@@ -1,13 +1,15 @@
+
+
#include "useqpe.h"
-#include <stdio.h>
-#include <string.h>
+#include "plucker_base.h"
+#include "Aportis.h"
+#include "Palm2QImage.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
#ifdef USEQPE
#include <qpe/qcopenvelope_qws.h>
-#endif /* USEQPE */
-#ifdef LOCALPICTURES
-#include <qscrollview.h>
-#endif
-#ifdef USEQPE
#include <qpe/global.h>
#endif /* USEQPE */
+
#ifndef USEQPE
@@ -18,5 +20,11 @@
-#include "plucker_base.h"
-#include "Aportis.h"
-#include "Palm2QImage.h"
+/* QT */
+#ifdef LOCALPICTURES
+#include <qscrollview.h>
+#endif
+
+/* STD */
+#include <stdio.h>
+#include <string.h>
+
@@ -37,3 +45,3 @@ void CPlucker_base::Expand(UInt32 reclen, UInt8 type, UInt8* buffer, UInt32 buff
{
- fread(buffer, reclen, sizeof(char), fin);
+ fread(buffer, reclen, sizeof(char), fin);
}
@@ -41,28 +49,28 @@ void CPlucker_base::Expand(UInt32 reclen, UInt8 type, UInt8* buffer, UInt32 buff
{
- UInt8* readbuffer = NULL;
- if (reclen > compressedbuffersize)
- {
- readbuffer = new UInt8[reclen];
- }
- else
- {
- readbuffer = compressedtextbuffer;
- }
- if (readbuffer != NULL)
- {
- fread(readbuffer, reclen, sizeof(char), fin);
- switch (ntohs(hdr0.version))
- {
- case 2:
- UnZip(readbuffer, reclen, buffer, buffersize);
- break;
- case 1:
- UnDoc(readbuffer, reclen, buffer, buffersize);
- break;
- }
- if (reclen > compressedbuffersize)
- {
- delete [] readbuffer;
- }
- }
+ UInt8* readbuffer = NULL;
+ if (reclen > compressedbuffersize)
+ {
+ readbuffer = new UInt8[reclen];
+ }
+ else
+ {
+ readbuffer = compressedtextbuffer;
+ }
+ if (readbuffer != NULL)
+ {
+ fread(readbuffer, reclen, sizeof(char), fin);
+ switch (ntohs(hdr0.version))
+ {
+ case 2:
+ UnZip(readbuffer, reclen, buffer, buffersize);
+ break;
+ case 1:
+ UnDoc(readbuffer, reclen, buffer, buffersize);
+ break;
+ }
+ if (reclen > compressedbuffersize)
+ {
+ delete [] readbuffer;
+ }
+ }
}
@@ -75,11 +83,11 @@ void CPlucker_base::sizes(unsigned long& _file, unsigned long& _text)
{
- for (int recptr = 1; recptr < ntohs(head.recordList.numRecords); recptr++)
- {
- gotorecordnumber(recptr);
- UInt16 thishdr_uid, thishdr_nParagraphs;
- UInt32 thishdr_size;
- UInt8 thishdr_type, thishdr_reserved;
- GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- if (thishdr_type < 2) textlength += thishdr_size;
- }
+ for (int recptr = 1; recptr < ntohs(head.recordList.numRecords); recptr++)
+ {
+ gotorecordnumber(recptr);
+ UInt16 thishdr_uid, thishdr_nParagraphs;
+ UInt32 thishdr_size;
+ UInt8 thishdr_type, thishdr_reserved;
+ GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
+ if (thishdr_type < 2) textlength += thishdr_size;
+ }
}
@@ -95,3 +103,3 @@ char* CPlucker_base::geturl(UInt16 tgt)
unsigned int nrecs = ntohs(hdr0.nRecords);
- //qDebug("Version %u, no. recs %u", ntohs(hdr0.version), nrecs);
+ //odebug << "Version " << ntohs(hdr0.version) << ", no. recs " << nrecs << "" << oendl;
UInt16 urlid = 0;
@@ -102,13 +110,13 @@ char* CPlucker_base::geturl(UInt16 tgt)
{
- UInt16 id, name;
- fread(&name, 1, sizeof(name), fin);
- fread(&id, 1, sizeof(id), fin);
- //qDebug("N:%d, I:%d", ntohs(name), ntohs(id));
- if (ntohs(name) == 2)
- {
- urlsfound = true;
- urlid = id;
- //qDebug("Found url index:%d", ntohs(urlid));
- }
-// //qDebug("%x", id);
+ UInt16 id, name;
+ fread(&name, 1, sizeof(name), fin);
+ fread(&id, 1, sizeof(id), fin);
+ //odebug << "N:" << ntohs(name) << ", I:" << ntohs(id) << "" << oendl;
+ if (ntohs(name) == 2)
+ {
+ urlsfound = true;
+ urlid = id;
+ //odebug << "Found url index:" << ntohs(urlid) << "" << oendl;
+ }
+// //odebug << "" << id << "" << oendl;
}
@@ -116,53 +124,53 @@ char* CPlucker_base::geturl(UInt16 tgt)
{
- unsigned short recptr = finduid(ntohs(urlid));
- if (recptr != 0)
- {
- gotorecordnumber(recptr);
- UInt16 thishdr_uid, thishdr_nParagraphs;
- UInt32 thishdr_size;
- UInt8 thishdr_type, thishdr_reserved;
- GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- UInt16 urlctr = 0;
- while (1)
- {
- UInt16 tctr;
- fread(&tctr, 1, sizeof(tctr), fin);
- fread(&urlid, 1, sizeof(urlid), fin);
- tctr = ntohs(tctr);
- //qDebug("tgt:%u urlctr:%u tctr:%u", tgt, urlctr, tctr);
- if (tctr >= tgt)
- {
- break;
- }
- urlctr = tctr;
- }
- //qDebug("urls are in %d", ntohs(urlid));
- recptr = finduid(ntohs(urlid));
- if (recptr != 0)
- {
- UInt32 reclen = recordlength(recptr) - HeaderSize();
- gotorecordnumber(recptr);
- GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- //qDebug("Found urls:%x",thishdr_type);
- urlsize = thishdr_size;
- urls = new char[urlsize];
- Expand(reclen, thishdr_type, (UInt8*)urls, urlsize);
- char* ptr = urls;
- int rn = urlctr+1;
- while (ptr - urls < urlsize)
- {
- if (rn == tgt)
- {
- //qDebug("URL:%s", ptr);
- int len = strlen(ptr)+1;
- pRet = new char[len];
- memcpy(pRet, ptr, len);
- break;
- }
- ptr += strlen(ptr)+1;
- rn++;
- }
- delete [] urls;
- }
- }
+ unsigned short recptr = finduid(ntohs(urlid));
+ if (recptr != 0)
+ {
+ gotorecordnumber(recptr);
+ UInt16 thishdr_uid, thishdr_nParagraphs;
+ UInt32 thishdr_size;
+ UInt8 thishdr_type, thishdr_reserved;
+ GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
+ UInt16 urlctr = 0;
+ while (1)
+ {
+ UInt16 tctr;
+ fread(&tctr, 1, sizeof(tctr), fin);
+ fread(&urlid, 1, sizeof(urlid), fin);
+ tctr = ntohs(tctr);
+ //odebug << "tgt:" << tgt << " urlctr:" << urlctr << " tctr:" << tctr << "" << oendl;
+ if (tctr >= tgt)
+ {
+ break;
+ }
+ urlctr = tctr;
+ }
+ //odebug << "urls are in " << ntohs(urlid) << "" << oendl;
+ recptr = finduid(ntohs(urlid));
+ if (recptr != 0)
+ {
+ UInt32 reclen = recordlength(recptr) - HeaderSize();
+ gotorecordnumber(recptr);
+ GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
+ //odebug << "Found urls:" << thishdr_type << "" << oendl;
+ urlsize = thishdr_size;
+ urls = new char[urlsize];
+ Expand(reclen, thishdr_type, (UInt8*)urls, urlsize);
+ char* ptr = urls;
+ int rn = urlctr+1;
+ while (ptr - urls < urlsize)
+ {
+ if (rn == tgt)
+ {
+ //odebug << "URL:" << ptr << "" << oendl;
+ int len = strlen(ptr)+1;
+ pRet = new char[len];
+ memcpy(pRet, ptr, len);
+ break;
+ }
+ ptr += strlen(ptr)+1;
+ rn++;
+ }
+ delete [] urls;
+ }
+ }
}
@@ -170,6 +178,6 @@ char* CPlucker_base::geturl(UInt16 tgt)
{
- QMessageBox::information(NULL,
- QString(PROGNAME),
- QString("No external links\nin this pluck")
- );
+ QMessageBox::information(NULL,
+ QString(PROGNAME),
+ QString("No external links\nin this pluck")
+ );
}
@@ -208,5 +216,5 @@ unsigned int CPlucker_base::locate()
GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- if (thishdr_type < 2) locpos += thishdr_size;
- thisrec++;
- gotorecordnumber(thisrec);
+ if (thishdr_type < 2) locpos += thishdr_size;
+ thisrec++;
+ gotorecordnumber(thisrec);
}
@@ -224,20 +232,20 @@ void CPlucker_base::locate(unsigned int n)
{
- textlength = 0;
- UInt16 thishdr_uid, thishdr_nParagraphs;
- UInt32 thishdr_size = buffercontent;
- UInt8 thishdr_type, thishdr_reserved;
- for (recptr = 1; recptr < ntohs(head.recordList.numRecords); recptr++)
- {
- gotorecordnumber(recptr);
- GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- if (thishdr_type < 2)
- {
- textlength += thishdr_size;
- if (textlength > n)
- {
- textlength -= thishdr_size;
- break;
- }
- }
- }
+ textlength = 0;
+ UInt16 thishdr_uid, thishdr_nParagraphs;
+ UInt32 thishdr_size = buffercontent;
+ UInt8 thishdr_type, thishdr_reserved;
+ for (recptr = 1; recptr < ntohs(head.recordList.numRecords); recptr++)
+ {
+ gotorecordnumber(recptr);
+ GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
+ if (thishdr_type < 2)
+ {
+ textlength += thishdr_size;
+ if (textlength > n)
+ {
+ textlength -= thishdr_size;
+ break;
+ }
+ }
+ }
}
@@ -245,16 +253,16 @@ void CPlucker_base::locate(unsigned int n)
{
- UInt16 thishdr_uid, thishdr_nParagraphs;
- UInt32 thishdr_size;
- UInt8 thishdr_type, thishdr_reserved;
- while (n < textlength && recptr > 1)
- {
- recptr--;
- gotorecordnumber(recptr);
- //qDebug("recptr:%u", recptr);
- GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- if (thishdr_type < 2)
- {
- textlength -= thishdr_size;
- }
- }
+ UInt16 thishdr_uid, thishdr_nParagraphs;
+ UInt32 thishdr_size;
+ UInt8 thishdr_type, thishdr_reserved;
+ while (n < textlength && recptr > 1)
+ {
+ recptr--;
+ gotorecordnumber(recptr);
+ //odebug << "recptr:" << recptr << "" << oendl;
+ GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
+ if (thishdr_type < 2)
+ {
+ textlength -= thishdr_size;
+ }
+ }
}
@@ -262,18 +270,18 @@ void CPlucker_base::locate(unsigned int n)
{
- UInt16 thishdr_uid, thishdr_nParagraphs;
- UInt32 thishdr_size = buffercontent;
- UInt8 thishdr_type, thishdr_reserved;
- while (n > textlength + thishdr_size && recptr < ntohs(head.recordList.numRecords)-1)
- {
- textlength += thishdr_size;
- recptr++;
- gotorecordnumber(recptr);
- GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- if (!(thishdr_type < 2))
- {
- thishdr_size = 0;
- }
- }
- }
-// qDebug("Time(1): %u", clock()-start);
+ UInt16 thishdr_uid, thishdr_nParagraphs;
+ UInt32 thishdr_size = buffercontent;
+ UInt8 thishdr_type, thishdr_reserved;
+ while (n > textlength + thishdr_size && recptr < ntohs(head.recordList.numRecords)-1)
+ {
+ textlength += thishdr_size;
+ recptr++;
+ gotorecordnumber(recptr);
+ GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
+ if (!(thishdr_type < 2))
+ {
+ thishdr_size = 0;
+ }
+ }
+ }
+// odebug << "Time(1): " << clock()-start << "" << oendl;
/*
@@ -285,12 +293,12 @@ void CPlucker_base::locate(unsigned int n)
{
- UInt16 attr = m_ParaAttrs[m_nextParaIndex];
- m_nextParaIndex++;
- if (m_nextParaIndex == m_nParas)
- {
- m_nextPara = -1;
- }
- else
- {
- m_nextPara += m_ParaOffsets[m_nextParaIndex];
- }
+ UInt16 attr = m_ParaAttrs[m_nextParaIndex];
+ m_nextParaIndex++;
+ if (m_nextParaIndex == m_nParas)
+ {
+ m_nextPara = -1;
+ }
+ else
+ {
+ m_nextPara += m_ParaOffsets[m_nextParaIndex];
+ }
}
@@ -309,30 +317,30 @@ void CPlucker_base::locate(unsigned int n)
{
- thisrec++;
- locpos += bs;
- gotorecordnumber(thisrec);
- GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- if (thishdr_type < 2)
- {
- bs = thishdr_size;
- }
- else
- {
- bs = 0;
- }
+ thisrec++;
+ locpos += bs;
+ gotorecordnumber(thisrec);
+ GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
+ if (thishdr_type < 2)
+ {
+ bs = thishdr_size;
+ }
+ else
+ {
+ bs = 0;
+ }
} while (locpos + bs <= n);
-// qDebug("Time(2): %u", clock()-start);
+// odebug << "Time(2): " << clock()-start << "" << oendl;
if (recptr != thisrec)
{
- qDebug("Disaster:recptr:%u thisrec:%u", recptr, thisrec);
- UInt16 thishdr_uid, thishdr_nParagraphs;
- UInt32 thishdr_size = buffercontent;
- UInt8 thishdr_type, thishdr_reserved;
- for (recptr = 1; recptr < ntohs(head.recordList.numRecords); recptr++)
- {
- gotorecordnumber(recptr);
- GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
-// qDebug("UID:%u Paras:%u Size:%u Type:%u Reserved:%u", thishdr_uid, thishdr_nParagraphs, thishdr_size, (unsigned int)thishdr_type, (unsigned int)thishdr_reserved);
- }
-// QApplication::exit ( 100 );
+ odebug << "Disaster:recptr:" << recptr << " thisrec:" << thisrec << "" << oendl;
+ UInt16 thishdr_uid, thishdr_nParagraphs;
+ UInt32 thishdr_size = buffercontent;
+ UInt8 thishdr_type, thishdr_reserved;
+ for (recptr = 1; recptr < ntohs(head.recordList.numRecords); recptr++)
+ {
+ gotorecordnumber(recptr);
+ GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
+// odebug << "UID:" << thishdr_uid << " Paras:" << thishdr_nParagraphs << " Size:" << thishdr_size << " Type:" << (unsigned int)thishdr_type << " Reserved:" << (unsigned int)thishdr_reserved << "" << oendl;
+ }
+// QApplication::exit ( 100 );
}
@@ -348,12 +356,12 @@ void CPlucker_base::locate(unsigned int n)
{
- UInt16 attr = m_ParaAttrs[m_nextParaIndex];
- m_nextParaIndex++;
- if (m_nextParaIndex == m_nParas)
- {
- m_nextPara = -1;
- }
- else
- {
- m_nextPara += m_ParaOffsets[m_nextParaIndex];
- }
+ UInt16 attr = m_ParaAttrs[m_nextParaIndex];
+ m_nextParaIndex++;
+ if (m_nextParaIndex == m_nParas)
+ {
+ m_nextPara = -1;
+ }
+ else
+ {
+ m_nextPara += m_ParaOffsets[m_nextParaIndex];
+ }
}
@@ -372,9 +380,9 @@ bool CPlucker_base::expand(int thisrec)
{
- GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- //qDebug("This (%d) type is %d, uid is %u", thisrec, thishdr_type, thishdr_uid);
- if (thishdr_type < 2) break;
- //qDebug("Skipping paragraph of type %d", thishdr_type);
- if (++thisrec >= ntohs(head.recordList.numRecords) - 1) return false;
- reclen = recordlength(thisrec);
- gotorecordnumber(thisrec);
+ GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
+ //odebug << "This (" << thisrec << ") type is " << thishdr_type << ", uid is " << thishdr_uid << "" << oendl;
+ if (thishdr_type < 2) break;
+ //odebug << "Skipping paragraph of type " << thishdr_type << "" << oendl;
+ if (++thisrec >= ntohs(head.recordList.numRecords) - 1) return false;
+ reclen = recordlength(thisrec);
+ gotorecordnumber(thisrec);
}
@@ -382,3 +390,3 @@ bool CPlucker_base::expand(int thisrec)
m_bufferisreserved = (thishdr_reserved != 0);
- //qDebug("It has %u paragraphs and is %u bytes", thishdr_nParagraphs, thishdr_size);
+ //odebug << "It has " << thishdr_nParagraphs << " paragraphs and is " << thishdr_size << " bytes" << oendl;
uid = thishdr_uid;
@@ -388,8 +396,8 @@ bool CPlucker_base::expand(int thisrec)
{
- UInt16 ubytes, attrs;
- fread(&ubytes, 1, sizeof(ubytes), fin);
- fread(&attrs, 1, sizeof(attrs), fin);
- m_ParaOffsets[i] = ntohs(ubytes);
- m_ParaAttrs[i] = ntohs(attrs);
-// //qDebug("Bytes %u, Attr %x", ntohs(ubytes), ntohs(attrs));
+ UInt16 ubytes, attrs;
+ fread(&ubytes, 1, sizeof(ubytes), fin);
+ fread(&attrs, 1, sizeof(attrs), fin);
+ m_ParaOffsets[i] = ntohs(ubytes);
+ m_ParaAttrs[i] = ntohs(attrs);
+// //odebug << "Bytes " << ntohs(ubytes) << ", Attr " << ntohs(attrs) << "" << oendl;
}
@@ -397,5 +405,5 @@ bool CPlucker_base::expand(int thisrec)
{
- m_nextPara = m_ParaOffsets[0];
- //qDebug("First offset = %u", m_nextPara);
- m_nextParaIndex = 0;
+ m_nextPara = m_ParaOffsets[0];
+ //odebug << "First offset = " << m_nextPara << "" << oendl;
+ m_nextParaIndex = 0;
}
@@ -403,3 +411,3 @@ bool CPlucker_base::expand(int thisrec)
{
- m_nextPara = -1;
+ m_nextPara = -1;
}
@@ -412,5 +420,5 @@ bool CPlucker_base::expand(int thisrec)
{
- delete [] expandedtextbuffer;
- buffersize = thishdr_size;
- expandedtextbuffer = new UInt8[buffersize];
+ delete [] expandedtextbuffer;
+ buffersize = thishdr_size;
+ expandedtextbuffer = new UInt8[buffersize];
}
@@ -420,3 +428,3 @@ bool CPlucker_base::expand(int thisrec)
bufferrec = thisrec;
- //qDebug("BC:%u, HS:%u", buffercontent, thishdr_size);
+ //odebug << "BC:" << buffercontent << ", HS:" << thishdr_size << "" << oendl;
return true;
@@ -438,5 +446,5 @@ void CPlucker_base::UnZip(UInt8* compressedbuffer, size_t reclen, UInt8* tgtbuff
zstream.opaque = Z_NULL;
-
+
// printf("Initialising\n");
-
+
inflateInit(&zstream);
@@ -454,3 +462,3 @@ void CPlucker_base::UnZip(UInt8* compressedbuffer, size_t reclen, UInt8* tgtbuff
-// //qDebug("err:%d - %u", err, zstream.avail_in);
+// //odebug << "err:" << err << " - " << zstream.avail_in << "" << oendl;
@@ -529,12 +537,12 @@ CList<Bkmk>* CPlucker_base::getbkmklist()
{
- gotorecordnumber(i);
- GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- if (thishdr_type == 8)
- {
- UInt16 n;
- fread(&n, 1, sizeof(n), fin);
- n = ntohs(n);
- //qDebug("Found %u bookmarks", n);
- }
- //qDebug("Found:%d, %u", i , thishdr_type);
+ gotorecordnumber(i);
+ GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
+ if (thishdr_type == 8)
+ {
+ UInt16 n;
+ fread(&n, 1, sizeof(n), fin);
+ n = ntohs(n);
+ //odebug << "Found " << n << " bookmarks" << oendl;
+ }
+ //odebug << "Found:" << i << ", " << thishdr_type << "" << oendl;
}
@@ -552,10 +560,10 @@ QImage* CPlucker_base::expandimg(UInt16 tgt, bool border)
{
- QPixmap* image = new QPixmap(0,0);
- image->convertFromImage(*qimage);
- delete qimage;
- QPixmap* pret = new QPixmap(image->width()+4, image->height()+4);
- pret->fill(Qt::red);
- bitBlt(pret, 2, 2, image, 0, 0, -1, -1);//, Qt::RasterOp::CopyROP);
- delete image;
- ret = new QImage(pret->convertToImage());
+ QPixmap* image = new QPixmap(0,0);
+ image->convertFromImage(*qimage);
+ delete qimage;
+ QPixmap* pret = new QPixmap(image->width()+4, image->height()+4);
+ pret->fill(Qt::red);
+ bitBlt(pret, 2, 2, image, 0, 0, -1, -1);//, Qt::RasterOp::CopyROP);
+ delete image;
+ ret = new QImage(pret->convertToImage());
}
@@ -563,3 +571,3 @@ QImage* CPlucker_base::expandimg(UInt16 tgt, bool border)
{
- ret = qimage;
+ ret = qimage;
}
@@ -579,7 +587,7 @@ QImage* CPlucker_base::getPicture(unsigned long tgt)
{
- pix[tgt] = *expandimg(tgt);
- return &pix[tgt];
+ pix[tgt] = *expandimg(tgt);
+ return &pix[tgt];
}
else
- return &(t.data());
+ return &(t.data());
#else
@@ -594,3 +602,3 @@ void CPlucker_base::showimg(UInt16 tgt)
{
- //qDebug("Crassssssh!");
+ //odebug << "Crassssssh!" << oendl;
QPixmap* qimage = expandimg(tgt);
@@ -605,3 +613,3 @@ void CPlucker_base::showimg(UInt16 tgt)
QPixmap* image = new QPixmap(0,0);
-// //qDebug("New image");
+// //odebug << "New image" << oendl;
image->convertFromImage(*qimage);
@@ -612,7 +620,7 @@ void CPlucker_base::showimg(UInt16 tgt)
close(f);
- //qDebug("TMPFILE:%s", tmpfile);
+ //odebug << "TMPFILE:" << tmpfile << "" << oendl;
if (image->save(tmpfile,"PNG"))
{
- QCopEnvelope e("QPE/Application/showimg", "setDocument(QString)");
- e << QString(tmpfile);
+ QCopEnvelope e("QPE/Application/showimg", "setDocument(QString)");
+ e << QString(tmpfile);
}
@@ -629,3 +637,3 @@ unsigned short CPlucker_base::finduid(unsigned short urlid)
{
-// //qDebug("Finding %u", urlid);
+// //odebug << "Finding " << urlid << "" << oendl;
unsigned short jmin = 1, jmax = ntohs(head.recordList.numRecords);
@@ -634,22 +642,22 @@ unsigned short CPlucker_base::finduid(unsigned short urlid)
{
- gotorecordnumber(jmid);
- UInt16 thishdr_uid, thishdr_nParagraphs;
- UInt32 thishdr_size;
- UInt8 thishdr_type, thishdr_reserved;
- GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- unsigned short luid = thishdr_uid;
-// //qDebug("%u %u %u : %u", jmin, jmid, jmax, urlid);
- if (luid == urlid)
- {
- return jmid;
- }
- if (luid < urlid)
- {
- jmin = jmid;
- }
- else
- {
- jmax = jmid;
- }
- jmid = (jmin+jmax) >> 1;
+ gotorecordnumber(jmid);
+ UInt16 thishdr_uid, thishdr_nParagraphs;
+ UInt32 thishdr_size;
+ UInt8 thishdr_type, thishdr_reserved;
+ GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
+ unsigned short luid = thishdr_uid;
+// //odebug << "" << jmin << " " << jmid << " " << jmax << " : " << urlid << "" << oendl;
+ if (luid == urlid)
+ {
+ return jmid;
+ }
+ if (luid < urlid)
+ {
+ jmin = jmid;
+ }
+ else
+ {
+ jmax = jmid;
+ }
+ jmid = (jmin+jmax) >> 1;
}
@@ -661,6 +669,6 @@ unsigned short CPlucker_base::finduid(unsigned short urlid)
unsigned short luid = thishdr_uid;
- //qDebug("jmin at end:%u,%u", jmin, luid);
+ //odebug << "jmin at end:" << jmin << "," << luid << "" << oendl;
if (luid == urlid)
{
- return jmin;
+ return jmin;
}
@@ -669,8 +677,8 @@ unsigned short CPlucker_base::finduid(unsigned short urlid)
luid = thishdr_uid;
- //qDebug("jmax at end:%u,%u", jmax, luid);
+ //odebug << "jmax at end:" << jmax << "," << luid << "" << oendl;
if (luid == urlid)
{
- return jmax;
+ return jmax;
}
- //qDebug("Couldn't find %u", urlid);
+ //odebug << "Couldn't find " << urlid << "" << oendl;
return 0; // Not found!
@@ -684,3 +692,3 @@ void CPlucker_base::setSaveData(unsigned char*& data, unsigned short& len, unsig
{
- sz++;
+ sz++;
}
@@ -699,6 +707,6 @@ void CPlucker_base::setSaveData(unsigned char*& data, unsigned short& len, unsig
{
- unsigned long t = *it;
-// qDebug("[%u]", t);
- memcpy(newdata, &t, sizeof(t));
- newdata += sizeof(t);
+ unsigned long t = *it;
+// odebug << "[" << t << "]" << oendl;
+ memcpy(newdata, &t, sizeof(t));
+ newdata += sizeof(t);
}
@@ -713,5 +721,5 @@ void CPlucker_base::putSaveData(unsigned char*& src, unsigned short& srclen)
{
- memcpy(&sz, src, sizeof(sz));
- src += sizeof(sz);
- srclen -= sizeof(sz);
+ memcpy(&sz, src, sizeof(sz));
+ src += sizeof(sz);
+ srclen -= sizeof(sz);
}
@@ -719,16 +727,16 @@ void CPlucker_base::putSaveData(unsigned char*& src, unsigned short& srclen)
{
- unsigned long t;
- if (srclen >= sizeof(t))
- {
- memcpy(&t, src, sizeof(t));
-// qDebug("[%u]", t);
- visited.push_front(t);
- src += sizeof(t);
- srclen -= sizeof(t);
- }
- else
- {
- QMessageBox::warning(NULL, PROGNAME, "File data mismatch\nMight fix itself");
- break;
- }
+ unsigned long t;
+ if (srclen >= sizeof(t))
+ {
+ memcpy(&t, src, sizeof(t));
+// odebug << "[" << t << "]" << oendl;
+ visited.push_front(t);
+ src += sizeof(t);
+ srclen -= sizeof(t);
+ }
+ else
+ {
+ QMessageBox::warning(NULL, PROGNAME, "File data mismatch\nMight fix itself");
+ break;
+ }
}
@@ -742,3 +750,3 @@ int CPlucker_base::OpenFile(const char *src)
{
- return -1;
+ return -1;
}
@@ -753,6 +761,6 @@ int CPlucker_base::OpenFile(const char *src)
- //qDebug("Total number of records:%u", ntohs(head.recordList.numRecords));
-
+ //odebug << "Total number of records:" << ntohs(head.recordList.numRecords) << "" << oendl;
+
unsigned int nrecs = ntohs(hdr0.nRecords);
- //qDebug("Version %u, no. recs %u", ntohs(hdr0.version), nrecs);
+ //odebug << "Version " << ntohs(hdr0.version) << ", no. recs " << nrecs << "" << oendl;
UInt16 homerecid = 1;
@@ -760,7 +768,7 @@ int CPlucker_base::OpenFile(const char *src)
{
- UInt16 id, name;
- fread(&name, 1, sizeof(name), fin);
- fread(&id, 1, sizeof(id), fin);
- //qDebug("N:%d, I:%d", ntohs(name), ntohs(id));
- if (ntohs(name) == 0) homerecid = ntohs(id);
+ UInt16 id, name;
+ fread(&name, 1, sizeof(name), fin);
+ fread(&id, 1, sizeof(id), fin);
+ //odebug << "N:" << ntohs(name) << ", I:" << ntohs(id) << "" << oendl;
+ if (ntohs(name) == 0) homerecid = ntohs(id);
}
@@ -770,13 +778,13 @@ int CPlucker_base::OpenFile(const char *src)
{
- gotorecordnumber(recptr);
- UInt16 thishdr_uid, thishdr_nParagraphs;
- UInt32 thishdr_size;
- UInt8 thishdr_type, thishdr_reserved;
- GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- if (thishdr_uid == homerecid)
- {
- m_homepos = textlength;
- break;
- }
- if (thishdr_type < 2) textlength += thishdr_size;
+ gotorecordnumber(recptr);
+ UInt16 thishdr_uid, thishdr_nParagraphs;
+ UInt32 thishdr_size;
+ UInt8 thishdr_type, thishdr_reserved;
+ GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
+ if (thishdr_uid == homerecid)
+ {
+ m_homepos = textlength;
+ break;
+ }
+ if (thishdr_type < 2) textlength += thishdr_size;
}
@@ -787,5 +795,5 @@ int CPlucker_base::OpenFile(const char *src)
{
- m_viewer = new QScrollView(NULL);
- m_picture = new QWidget(m_viewer->viewport());
- m_viewer->addChild(m_picture);
+ m_viewer = new QScrollView(NULL);
+ m_picture = new QWidget(m_viewer->viewport());
+ m_viewer->addChild(m_picture);
}
@@ -810,3 +818,3 @@ QImage* CPlucker_base::getimg(UInt16 tgt)
UInt8* imgbuffer = new UInt8[imgsize];
-
+
Expand(reclen, thishdr_type, imgbuffer, imgsize);
@@ -821,3 +829,3 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd)
n &= 0xffff;
-// //qDebug("Hyper:<%u,%u>", tuid, n);
+// //odebug << "Hyper:<" << tuid << "," << n << ">" << oendl;
UInt16 thisrec = 1;
@@ -830,38 +838,38 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd)
{
- GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- if (tuid == thishdr_uid) break;
- if (thishdr_type < 2) currentpos += thishdr_size;
-// //qDebug("hyper-cp:%u", currentpos);
- thisrec++;
- if (thisrec >= ntohs(head.recordList.numRecords))
- {
- char *turl = geturl(tuid);
- if (turl == NULL)
- {
- QMessageBox::information(NULL,
- QString(PROGNAME),
- QString("Couldn't find link")
- );
- }
- else
- {
- wrd = turl;
+ GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
+ if (tuid == thishdr_uid) break;
+ if (thishdr_type < 2) currentpos += thishdr_size;
+// //odebug << "hyper-cp:" << currentpos << "" << oendl;
+ thisrec++;
+ if (thisrec >= ntohs(head.recordList.numRecords))
+ {
+ char *turl = geturl(tuid);
+ if (turl == NULL)
+ {
+ QMessageBox::information(NULL,
+ QString(PROGNAME),
+ QString("Couldn't find link")
+ );
+ }
+ else
+ {
+ wrd = turl;
#ifdef USEQPE
- if (wrd.length() > 10)
- {
- Global::statusMessage(wrd.left(8) + "..");
- }
- else
- {
- Global::statusMessage(wrd);
- }
+ if (wrd.length() > 10)
+ {
+ Global::statusMessage(wrd.left(8) + "..");
+ }
+ else
+ {
+ Global::statusMessage(wrd);
+ }
#else
#endif /* USEQPE */
- //qDebug("Link:%s", (const char*)wrd);
-// setlink(fn, wrd);
- delete [] turl;
- }
- return eNone;
- }
- gotorecordnumber(thisrec);
+ //odebug << "Link:" << wrd << "" << oendl;
+// setlink(fn, wrd);
+ delete [] turl;
+ }
+ return eNone;
+ }
+ gotorecordnumber(thisrec);
}
@@ -869,28 +877,28 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd)
{
- if (thishdr_type == 4)
- {
- QMessageBox::information(NULL,
- QString(PROGNAME),
- QString("Mailto links\nnot yet supported (2)"));
- }
- else
- {
- if (thishdr_type > 3)
- {
- QMessageBox::information(NULL,
- QString(PROGNAME),
- QString("External links\nnot yet supported (2)")
- );
- return eNone;
- }
- else
- {
+ if (thishdr_type == 4)
+ {
+ QMessageBox::information(NULL,
+ QString(PROGNAME),
+ QString("Mailto links\nnot yet supported (2)"));
+ }
+ else
+ {
+ if (thishdr_type > 3)
+ {
+ QMessageBox::information(NULL,
+ QString(PROGNAME),
+ QString("External links\nnot yet supported (2)")
+ );
+ return eNone;
+ }
+ else
+ {
#ifdef LOCALPICTURES
- showimg(tuid);
+ showimg(tuid);
#else
- return ePicture;
+ return ePicture;
#endif
- }
- }
- return eNone;
+ }
+ }
+ return eNone;
}
@@ -899,3 +907,3 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd)
{
- expandimg(thisrec);
+ expandimg(thisrec);
@@ -905,44 +913,44 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd)
{
- expand(thisrec);
- if (n != 0)
- {
- if (n >= m_nParas)
- {
- QMessageBox::information(NULL,
- QString(PROGNAME),
- QString("Error in link\nPara # too big")
- );
- return eNone;
- }
- unsigned int noff = 0;
- for (unsigned int i = 0; i < n; i++) noff += m_ParaOffsets[i];
- n = noff;
- }
- if (n > thishdr_size)
- {
- QMessageBox::information(NULL,
- QString(PROGNAME),
- QString("Error in link\nOffset too big")
- );
- return eNone;
- }
- //qDebug("Hyper:<%u,%u>", tuid, n);
- while (bufferpos < n && bufferpos < buffercontent) getch_base(true);
+ expand(thisrec);
+ if (n != 0)
+ {
+ if (n >= m_nParas)
+ {
+ QMessageBox::information(NULL,
+ QString(PROGNAME),
+ QString("Error in link\nPara # too big")
+ );
+ return eNone;
+ }
+ unsigned int noff = 0;
+ for (unsigned int i = 0; i < n; i++) noff += m_ParaOffsets[i];
+ n = noff;
+ }
+ if (n > thishdr_size)
+ {
+ QMessageBox::information(NULL,
+ QString(PROGNAME),
+ QString("Error in link\nOffset too big")
+ );
+ return eNone;
+ }
+ //odebug << "Hyper:<" << tuid << "," << n << ">" << oendl;
+ while (bufferpos < n && bufferpos < buffercontent) getch_base(true);
/* // This is faster but the alignment doesn't get set
- mystyle.unset();
- bufferpos = n;
- currentpos += n;
- while (bufferpos >= m_nextPara && m_nextPara >= 0)
- {
- UInt16 attr = m_ParaAttrs[m_nextParaIndex];
- m_nextParaIndex++;
- if (m_nextParaIndex == m_nParas)
- {
- m_nextPara = -1;
- }
- else
- {
- m_nextPara += m_ParaOffsets[m_nextParaIndex];
- }
- }
+ mystyle.unset();
+ bufferpos = n;
+ currentpos += n;
+ while (bufferpos >= m_nextPara && m_nextPara >= 0)
+ {
+ UInt16 attr = m_ParaAttrs[m_nextParaIndex];
+ m_nextParaIndex++;
+ if (m_nextParaIndex == m_nParas)
+ {
+ m_nextPara = -1;
+ }
+ else
+ {
+ m_nextPara += m_ParaOffsets[m_nextParaIndex];
+ }
+ }
*/
@@ -957,266 +965,266 @@ tchar CPlucker_base::getch_base(bool fast)
{
- ch = bgetch();
-// //qDebug("Function:%x", ch);
- switch (ch)
- {
- case 0x38:
-// //qDebug("Break:%u", locate());
- if (m_lastBreak == locate())
- {
- ch = bgetch();
- }
- else
- {
- ch = 10;
- }
- m_lastBreak = locate();
- break;
- case 0x0a:
- case 0x0c:
- {
- unsigned long ln = 0;
- int skip = ch & 7;
- for (int i = 0; i < 2; i++)
- {
- int ch = bgetch();
- ln = (ln << 8) + ch;
-// //qDebug("ch:%d, ln:%u", ch, ln);
- }
- if (skip == 2)
- {
- ln <<= 16;
- }
- else
- {
- for (int i = 0; i < 2; i++)
- {
- int ch = bgetch();
- ln = (ln << 8) + ch;
-// //qDebug("ch:%d, ln:%u", ch, ln);
- }
- }
-// //qDebug("ln:%u", ln);
- mystyle.setLink(true);
- mystyle.setData(ln);
-// mystyle.setColour(255, 0, 0);
- bool hasseen = false;
- for (CList<unsigned long>::iterator it = visited.begin(); it != visited.end(); it++)
- {
- if (*it == ln)
- {
- hasseen = true;
- break;
- }
- }
- if (hasseen)
- {
- mystyle.setStrikethru();
- }
- else
- {
- mystyle.setUnderline();
- }
- ch = bgetch();
- }
- break;
- case 0x08:
- ch = bgetch();
-// mystyle.setColour(0, 0, 0);
- mystyle.unsetUnderline();
- mystyle.unsetStrikethru();
- mystyle.setLink(false);
- mystyle.setData(0);
- break;
- case 0x40:
- mystyle.setItalic();
- ch = bgetch();
- break;
- case 0x48:
- mystyle.unsetItalic();
- ch = bgetch();
- break;
- case 0x11:
- {
- ch = bgetch();
-// //qDebug("Font:%d",ch);
- mystyle.setVOffset(0);
- mystyle.unsetMono();
- mystyle.unsetBold();
- mystyle.setFontSize(0);
- switch (ch)
- {
- case 0:
- break;
- case 1:
- mystyle.setBold();
- mystyle.setFontSize(3);
- break;
- case 2:
- mystyle.setBold();
- mystyle.setFontSize(2);
- break;
- case 3:
- mystyle.setBold();
- mystyle.setFontSize(1);
- break;
- case 4:
- mystyle.setBold();
- break;
- case 5:
- mystyle.setBold();
- break;
- case 6:
- mystyle.setBold();
- break;
- case 7:
- mystyle.setBold();
- break;
- case 8: // should be fixed width
- //qDebug("Trying fixed width");
- mystyle.setMono();
- break;
- case 9:
- mystyle.setFontSize(-1);
- break;
- case 10:
- mystyle.setFontSize(-2);
- mystyle.setVOffset(1);
- break;
- case 11:
- mystyle.setFontSize(-2);
- mystyle.setVOffset(-1);
- break;
- default:
- qDebug("Unrecognised font");
- break;
- }
- ch = bgetch();
- }
- break;
- case 0x29:
- ch = bgetch();
- switch (ch)
- {
- case 0:
- mystyle.setLeftJustify();
-// //qDebug("left");
- break;
- case 1:
- mystyle.setRightJustify();
-// //qDebug("right");
- break;
- case 2:
- mystyle.setCentreJustify();
-// //qDebug("centre");
- break;
- case 3:
- mystyle.setFullJustify();
-// //qDebug("full");
- break;
-
- }
- ch = bgetch();
- break;
- case 0x53:
- {
- int r = bgetch();
- int g = bgetch();
- int b = bgetch();
- mystyle.setColour(r,g,b);
- ch = bgetch();
- }
- break;
- case 0x1a:
- case 0x5c:
- {
- bool hasalternate = (ch == 0x5c);
- UInt16 ir = bgetch();
- ir = (ir << 8) + bgetch();
- if (hasalternate)
- {
- //qDebug("Alternate image:%x", ir);
- UInt16 ir2 = bgetch();
- ir2 = (ir2 << 8) + bgetch();
- if (!fast) mystyle.setPicture(true, expandimg(ir2, true), true, ir << 16);
+ ch = bgetch();
+// //odebug << "Function:" << ch << "" << oendl;
+ switch (ch)
+ {
+ case 0x38:
+// //odebug << "Break:" << locate() << "" << oendl;
+ if (m_lastBreak == locate())
+ {
+ ch = bgetch();
+ }
+ else
+ {
+ ch = 10;
+ }
+ m_lastBreak = locate();
+ break;
+ case 0x0a:
+ case 0x0c:
+ {
+ unsigned long ln = 0;
+ int skip = ch & 7;
+ for (int i = 0; i < 2; i++)
+ {
+ int ch = bgetch();
+ ln = (ln << 8) + ch;
+// //odebug << "ch:" << ch << ", ln:" << ln << "" << oendl;
+ }
+ if (skip == 2)
+ {
+ ln <<= 16;
+ }
+ else
+ {
+ for (int i = 0; i < 2; i++)
+ {
+ int ch = bgetch();
+ ln = (ln << 8) + ch;
+// //odebug << "ch:" << ch << ", ln:" << ln << "" << oendl;
+ }
+ }
+// //odebug << "ln:" << ln << "" << oendl;
+ mystyle.setLink(true);
+ mystyle.setData(ln);
+// mystyle.setColour(255, 0, 0);
+ bool hasseen = false;
+ for (CList<unsigned long>::iterator it = visited.begin(); it != visited.end(); it++)
+ {
+ if (*it == ln)
+ {
+ hasseen = true;
+ break;
+ }
+ }
+ if (hasseen)
+ {
+ mystyle.setStrikethru();
+ }
+ else
+ {
+ mystyle.setUnderline();
+ }
+ ch = bgetch();
+ }
+ break;
+ case 0x08:
+ ch = bgetch();
+// mystyle.setColour(0, 0, 0);
+ mystyle.unsetUnderline();
+ mystyle.unsetStrikethru();
+ mystyle.setLink(false);
+ mystyle.setData(0);
+ break;
+ case 0x40:
+ mystyle.setItalic();
+ ch = bgetch();
+ break;
+ case 0x48:
+ mystyle.unsetItalic();
+ ch = bgetch();
+ break;
+ case 0x11:
+ {
+ ch = bgetch();
+// //odebug << "Font:" << ch << "" << oendl;
+ mystyle.setVOffset(0);
+ mystyle.unsetMono();
+ mystyle.unsetBold();
+ mystyle.setFontSize(0);
+ switch (ch)
+ {
+ case 0:
+ break;
+ case 1:
+ mystyle.setBold();
+ mystyle.setFontSize(3);
+ break;
+ case 2:
+ mystyle.setBold();
+ mystyle.setFontSize(2);
+ break;
+ case 3:
+ mystyle.setBold();
+ mystyle.setFontSize(1);
+ break;
+ case 4:
+ mystyle.setBold();
+ break;
+ case 5:
+ mystyle.setBold();
+ break;
+ case 6:
+ mystyle.setBold();
+ break;
+ case 7:
+ mystyle.setBold();
+ break;
+ case 8: // should be fixed width
+ //odebug << "Trying fixed width" << oendl;
+ mystyle.setMono();
+ break;
+ case 9:
+ mystyle.setFontSize(-1);
+ break;
+ case 10:
+ mystyle.setFontSize(-2);
+ mystyle.setVOffset(1);
+ break;
+ case 11:
+ mystyle.setFontSize(-2);
+ mystyle.setVOffset(-1);
+ break;
+ default:
+ odebug << "Unrecognised font" << oendl;
+ break;
+ }
+ ch = bgetch();
+ }
+ break;
+ case 0x29:
+ ch = bgetch();
+ switch (ch)
+ {
+ case 0:
+ mystyle.setLeftJustify();
+// //odebug << "left" << oendl;
+ break;
+ case 1:
+ mystyle.setRightJustify();
+// //odebug << "right" << oendl;
+ break;
+ case 2:
+ mystyle.setCentreJustify();
+// //odebug << "centre" << oendl;
+ break;
+ case 3:
+ mystyle.setFullJustify();
+// //odebug << "full" << oendl;
+ break;
+
+ }
+ ch = bgetch();
+ break;
+ case 0x53:
+ {
+ int r = bgetch();
+ int g = bgetch();
+ int b = bgetch();
+ mystyle.setColour(r,g,b);
+ ch = bgetch();
+ }
+ break;
+ case 0x1a:
+ case 0x5c:
+ {
+ bool hasalternate = (ch == 0x5c);
+ UInt16 ir = bgetch();
+ ir = (ir << 8) + bgetch();
+ if (hasalternate)
+ {
+ //odebug << "Alternate image:" << ir << "" << oendl;
+ UInt16 ir2 = bgetch();
+ ir2 = (ir2 << 8) + bgetch();
+ if (!fast) mystyle.setPicture(true, expandimg(ir2, true), true, ir << 16);
#ifdef LOCALPICTURES
- UInt32 ln = ir;
- ln <<= 16;
- mystyle.setLink(true);
- mystyle.setData(ln);
+ UInt32 ln = ir;
+ ln <<= 16;
+ mystyle.setLink(true);
+ mystyle.setData(ln);
#endif
- }
- else
- {
- if (!fast) mystyle.setPicture(true, expandimg(ir));
- }
-// if (mystyle.getLink()) qDebug("Picture link!");
- ch = '#';
- }
-// ch = bgetch();
- break;
- case 0x33:
- {
- UInt8 h = bgetch();
- UInt8 wc = bgetch();
- UInt8 pc = bgetch();
- UInt16 w = wc;
-// //qDebug("h,w,pc [%u, %u, %u]", h, w, pc);
- if (w == 0)
- {
- w = (m_scrWidth*(unsigned long)pc)/100;
- }
- if (w == 0) w = m_scrWidth;
- mystyle.setPicture(false, hRule(w,h,mystyle.Red(),mystyle.Green(),mystyle.Blue()));
-// if (mystyle.getLink()) //qDebug("hRule link!");
- ch = '#';
- }
- break;
- case 0x60:
- mystyle.setUnderline();
- ch = bgetch();
- break;
- case 0x68:
- mystyle.unsetUnderline();
- ch = bgetch();
- break;
- case 0x22:
- ch = bgetch();
- mystyle.setLeftMargin(ch);
-// //qDebug("Left margin:%d", ch);
- ch = bgetch();
- mystyle.setRightMargin(ch);
-// //qDebug("Right margin:%d", ch);
- ch = bgetch();
- break;
- case 0x70:
- mystyle.setStrikethru();
- ch = bgetch();
- break;
- case 0x78:
- mystyle.unsetStrikethru();
- 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 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();
- }
- }
+ }
+ else
+ {
+ if (!fast) mystyle.setPicture(true, expandimg(ir));
+ }
+// if (mystyle.getLink()) odebug << "Picture link!" << oendl;
+ ch = '#';
+ }
+// ch = bgetch();
+ break;
+ case 0x33:
+ {
+ UInt8 h = bgetch();
+ UInt8 wc = bgetch();
+ UInt8 pc = bgetch();
+ UInt16 w = wc;
+// //odebug << "h,w,pc [" << h << ", " << w << ", " << pc << "]" << oendl;
+ if (w == 0)
+ {
+ w = (m_scrWidth*(unsigned long)pc)/100;
+ }
+ if (w == 0) w = m_scrWidth;
+ mystyle.setPicture(false, hRule(w,h,mystyle.Red(),mystyle.Green(),mystyle.Blue()));
+// if (mystyle.getLink()) //odebug << "hRule link!" << oendl;
+ ch = '#';
+ }
+ break;
+ case 0x60:
+ mystyle.setUnderline();
+ ch = bgetch();
+ break;
+ case 0x68:
+ mystyle.unsetUnderline();
+ ch = bgetch();
+ break;
+ case 0x22:
+ ch = bgetch();
+ mystyle.setLeftMargin(ch);
+// //odebug << "Left margin:" << ch << "" << oendl;
+ ch = bgetch();
+ mystyle.setRightMargin(ch);
+// //odebug << "Right margin:" << ch << "" << oendl;
+ ch = bgetch();
+ break;
+ case 0x70:
+ mystyle.setStrikethru();
+ ch = bgetch();
+ break;
+ case 0x78:
+ mystyle.unsetStrikethru();
+ ch = bgetch();
+ break;
+ case 0x83:
+ {
+ int tlen = bgetch();
+ ch = bgetch();
+ ch <<= 8;
+ ch |= (tchar)bgetch();
+ for (int i = 0; i < tlen; i++) bgetch();
+ //odebug << "Function 83" << oendl;
+ }
+ break;
+ case 0x85:
+ default:
+ odebug << "Function:" << ch << " NOT IMPLEMENTED" << oendl;
+ {
+ int skip = ch & 7;
+ for (int i = 0; i < skip; i++)
+ {
+ ch = bgetch();
+ //odebug << "Arg " << i << ", " << ch << "" << oendl;
+ }
+ ch = bgetch();
+ }
+ }
}
@@ -1225,6 +1233,6 @@ tchar CPlucker_base::getch_base(bool fast)
{
- while (ch == ' ')
- {
- ch = getch(false);
- }
+ while (ch == ' ')
+ {
+ ch = getch(false);
+ }
}