summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/plucker_base.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/plucker_base.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/plucker_base.cpp148
1 files changed, 78 insertions, 70 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>
+
@@ -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;
@@ -105,3 +113,3 @@ char* CPlucker_base::geturl(UInt16 tgt)
fread(&id, 1, sizeof(id), fin);
- //qDebug("N:%d, I:%d", ntohs(name), ntohs(id));
+ //odebug << "N:" << ntohs(name) << ", I:" << ntohs(id) << "" << oendl;
if (ntohs(name) == 2)
@@ -110,5 +118,5 @@ char* CPlucker_base::geturl(UInt16 tgt)
urlid = id;
- //qDebug("Found url index:%d", ntohs(urlid));
+ //odebug << "Found url index:" << ntohs(urlid) << "" << oendl;
}
-// //qDebug("%x", id);
+// //odebug << "" << id << "" << oendl;
}
@@ -131,3 +139,3 @@ char* CPlucker_base::geturl(UInt16 tgt)
tctr = ntohs(tctr);
- //qDebug("tgt:%u urlctr:%u tctr:%u", tgt, urlctr, tctr);
+ //odebug << "tgt:" << tgt << " urlctr:" << urlctr << " tctr:" << tctr << "" << oendl;
if (tctr >= tgt)
@@ -138,3 +146,3 @@ char* CPlucker_base::geturl(UInt16 tgt)
}
- //qDebug("urls are in %d", ntohs(urlid));
+ //odebug << "urls are in " << ntohs(urlid) << "" << oendl;
recptr = finduid(ntohs(urlid));
@@ -145,3 +153,3 @@ char* CPlucker_base::geturl(UInt16 tgt)
GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
- //qDebug("Found urls:%x",thishdr_type);
+ //odebug << "Found urls:" << thishdr_type << "" << oendl;
urlsize = thishdr_size;
@@ -155,3 +163,3 @@ char* CPlucker_base::geturl(UInt16 tgt)
{
- //qDebug("URL:%s", ptr);
+ //odebug << "URL:" << ptr << "" << oendl;
int len = strlen(ptr)+1;
@@ -252,3 +260,3 @@ void CPlucker_base::locate(unsigned int n)
gotorecordnumber(recptr);
- //qDebug("recptr:%u", recptr);
+ //odebug << "recptr:" << recptr << "" << oendl;
GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved);
@@ -277,3 +285,3 @@ void CPlucker_base::locate(unsigned int n)
}
-// qDebug("Time(1): %u", clock()-start);
+// odebug << "Time(1): " << clock()-start << "" << oendl;
/*
@@ -323,6 +331,6 @@ void CPlucker_base::locate(unsigned int n)
-// qDebug("Time(2): %u", clock()-start);
+// odebug << "Time(2): " << clock()-start << "" << oendl;
if (recptr != thisrec)
{
- qDebug("Disaster:recptr:%u thisrec:%u", recptr, thisrec);
+ odebug << "Disaster:recptr:" << recptr << " thisrec:" << thisrec << "" << oendl;
UInt16 thishdr_uid, thishdr_nParagraphs;
@@ -334,3 +342,3 @@ void CPlucker_base::locate(unsigned int n)
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);
+// odebug << "UID:" << thishdr_uid << " Paras:" << thishdr_nParagraphs << " Size:" << thishdr_size << " Type:" << (unsigned int)thishdr_type << " Reserved:" << (unsigned int)thishdr_reserved << "" << oendl;
}
@@ -373,5 +381,5 @@ 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);
+ //odebug << "This (" << thisrec << ") type is " << thishdr_type << ", uid is " << thishdr_uid << "" << oendl;
if (thishdr_type < 2) break;
- //qDebug("Skipping paragraph of type %d", thishdr_type);
+ //odebug << "Skipping paragraph of type " << thishdr_type << "" << oendl;
if (++thisrec >= ntohs(head.recordList.numRecords) - 1) return false;
@@ -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;
@@ -393,3 +401,3 @@ bool CPlucker_base::expand(int thisrec)
m_ParaAttrs[i] = ntohs(attrs);
-// //qDebug("Bytes %u, Attr %x", ntohs(ubytes), ntohs(attrs));
+// //odebug << "Bytes " << ntohs(ubytes) << ", Attr " << ntohs(attrs) << "" << oendl;
}
@@ -398,3 +406,3 @@ bool CPlucker_base::expand(int thisrec)
m_nextPara = m_ParaOffsets[0];
- //qDebug("First offset = %u", m_nextPara);
+ //odebug << "First offset = " << m_nextPara << "" << oendl;
m_nextParaIndex = 0;
@@ -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;
@@ -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;
@@ -536,5 +544,5 @@ CList<Bkmk>* CPlucker_base::getbkmklist()
n = ntohs(n);
- //qDebug("Found %u bookmarks", n);
+ //odebug << "Found " << n << " bookmarks" << oendl;
}
- //qDebug("Found:%d, %u", i , thishdr_type);
+ //odebug << "Found:" << i << ", " << thishdr_type << "" << oendl;
}
@@ -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,3 +620,3 @@ void CPlucker_base::showimg(UInt16 tgt)
close(f);
- //qDebug("TMPFILE:%s", tmpfile);
+ //odebug << "TMPFILE:" << tmpfile << "" << oendl;
if (image->save(tmpfile,"PNG"))
@@ -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);
@@ -640,3 +648,3 @@ unsigned short CPlucker_base::finduid(unsigned short urlid)
unsigned short luid = thishdr_uid;
-// //qDebug("%u %u %u : %u", jmin, jmid, jmax, urlid);
+// //odebug << "" << jmin << " " << jmid << " " << jmax << " : " << urlid << "" << oendl;
if (luid == urlid)
@@ -661,3 +669,3 @@ 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)
@@ -669,3 +677,3 @@ 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)
@@ -674,3 +682,3 @@ unsigned short CPlucker_base::finduid(unsigned short urlid)
}
- //qDebug("Couldn't find %u", urlid);
+ //odebug << "Couldn't find " << urlid << "" << oendl;
return 0; // Not found!
@@ -700,3 +708,3 @@ void CPlucker_base::setSaveData(unsigned char*& data, unsigned short& len, unsig
unsigned long t = *it;
-// qDebug("[%u]", t);
+// odebug << "[" << t << "]" << oendl;
memcpy(newdata, &t, sizeof(t));
@@ -723,3 +731,3 @@ void CPlucker_base::putSaveData(unsigned char*& src, unsigned short& srclen)
memcpy(&t, src, sizeof(t));
-// qDebug("[%u]", t);
+// odebug << "[" << t << "]" << oendl;
visited.push_front(t);
@@ -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;
@@ -763,3 +771,3 @@ int CPlucker_base::OpenFile(const char *src)
fread(&id, 1, sizeof(id), fin);
- //qDebug("N:%d, I:%d", ntohs(name), ntohs(id));
+ //odebug << "N:" << ntohs(name) << ", I:" << ntohs(id) << "" << oendl;
if (ntohs(name) == 0) homerecid = ntohs(id);
@@ -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;
@@ -833,3 +841,3 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd)
if (thishdr_type < 2) currentpos += thishdr_size;
-// //qDebug("hyper-cp:%u", currentpos);
+// //odebug << "hyper-cp:" << currentpos << "" << oendl;
thisrec++;
@@ -859,3 +867,3 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd)
#endif /* USEQPE */
- //qDebug("Link:%s", (const char*)wrd);
+ //odebug << "Link:" << wrd << "" << oendl;
// setlink(fn, wrd);
@@ -928,3 +936,3 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd)
}
- //qDebug("Hyper:<%u,%u>", tuid, n);
+ //odebug << "Hyper:<" << tuid << "," << n << ">" << oendl;
while (bufferpos < n && bufferpos < buffercontent) getch_base(true);
@@ -958,3 +966,3 @@ tchar CPlucker_base::getch_base(bool fast)
ch = bgetch();
-// //qDebug("Function:%x", ch);
+// //odebug << "Function:" << ch << "" << oendl;
switch (ch)
@@ -962,3 +970,3 @@ tchar CPlucker_base::getch_base(bool fast)
case 0x38:
-// //qDebug("Break:%u", locate());
+// //odebug << "Break:" << locate() << "" << oendl;
if (m_lastBreak == locate())
@@ -982,3 +990,3 @@ tchar CPlucker_base::getch_base(bool fast)
ln = (ln << 8) + ch;
-// //qDebug("ch:%d, ln:%u", ch, ln);
+// //odebug << "ch:" << ch << ", ln:" << ln << "" << oendl;
}
@@ -994,6 +1002,6 @@ tchar CPlucker_base::getch_base(bool fast)
ln = (ln << 8) + ch;
-// //qDebug("ch:%d, ln:%u", ch, ln);
+// //odebug << "ch:" << ch << ", ln:" << ln << "" << oendl;
}
}
-// //qDebug("ln:%u", ln);
+// //odebug << "ln:" << ln << "" << oendl;
mystyle.setLink(true);
@@ -1040,3 +1048,3 @@ tchar CPlucker_base::getch_base(bool fast)
ch = bgetch();
-// //qDebug("Font:%d",ch);
+// //odebug << "Font:" << ch << "" << oendl;
mystyle.setVOffset(0);
@@ -1074,3 +1082,3 @@ tchar CPlucker_base::getch_base(bool fast)
case 8: // should be fixed width
- //qDebug("Trying fixed width");
+ //odebug << "Trying fixed width" << oendl;
mystyle.setMono();
@@ -1089,3 +1097,3 @@ tchar CPlucker_base::getch_base(bool fast)
default:
- qDebug("Unrecognised font");
+ odebug << "Unrecognised font" << oendl;
break;
@@ -1101,3 +1109,3 @@ tchar CPlucker_base::getch_base(bool fast)
mystyle.setLeftJustify();
-// //qDebug("left");
+// //odebug << "left" << oendl;
break;
@@ -1105,3 +1113,3 @@ tchar CPlucker_base::getch_base(bool fast)
mystyle.setRightJustify();
-// //qDebug("right");
+// //odebug << "right" << oendl;
break;
@@ -1109,3 +1117,3 @@ tchar CPlucker_base::getch_base(bool fast)
mystyle.setCentreJustify();
-// //qDebug("centre");
+// //odebug << "centre" << oendl;
break;
@@ -1113,3 +1121,3 @@ tchar CPlucker_base::getch_base(bool fast)
mystyle.setFullJustify();
-// //qDebug("full");
+// //odebug << "full" << oendl;
break;
@@ -1136,3 +1144,3 @@ tchar CPlucker_base::getch_base(bool fast)
{
- //qDebug("Alternate image:%x", ir);
+ //odebug << "Alternate image:" << ir << "" << oendl;
UInt16 ir2 = bgetch();
@@ -1151,3 +1159,3 @@ tchar CPlucker_base::getch_base(bool fast)
}
-// if (mystyle.getLink()) qDebug("Picture link!");
+// if (mystyle.getLink()) odebug << "Picture link!" << oendl;
ch = '#';
@@ -1162,3 +1170,3 @@ tchar CPlucker_base::getch_base(bool fast)
UInt16 w = wc;
-// //qDebug("h,w,pc [%u, %u, %u]", h, w, pc);
+// //odebug << "h,w,pc [" << h << ", " << w << ", " << pc << "]" << oendl;
if (w == 0)
@@ -1169,3 +1177,3 @@ tchar CPlucker_base::getch_base(bool fast)
mystyle.setPicture(false, hRule(w,h,mystyle.Red(),mystyle.Green(),mystyle.Blue()));
-// if (mystyle.getLink()) //qDebug("hRule link!");
+// if (mystyle.getLink()) //odebug << "hRule link!" << oendl;
ch = '#';
@@ -1184,6 +1192,6 @@ tchar CPlucker_base::getch_base(bool fast)
mystyle.setLeftMargin(ch);
-// //qDebug("Left margin:%d", ch);
+// //odebug << "Left margin:" << ch << "" << oendl;
ch = bgetch();
mystyle.setRightMargin(ch);
-// //qDebug("Right margin:%d", ch);
+// //odebug << "Right margin:" << ch << "" << oendl;
ch = bgetch();
@@ -1205,3 +1213,3 @@ tchar CPlucker_base::getch_base(bool fast)
for (int i = 0; i < tlen; i++) bgetch();
- //qDebug("Function 83");
+ //odebug << "Function 83" << oendl;
}
@@ -1210,3 +1218,3 @@ tchar CPlucker_base::getch_base(bool fast)
default:
- qDebug("Function:%x NOT IMPLEMENTED", ch);
+ odebug << "Function:" << ch << " NOT IMPLEMENTED" << oendl;
{
@@ -1216,3 +1224,3 @@ tchar CPlucker_base::getch_base(bool fast)
ch = bgetch();
- //qDebug("Arg %d, %d", i, ch);
+ //odebug << "Arg " << i << ", " << ch << "" << oendl;
}