summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader
authorar <ar>2004-05-27 22:04:46 (UTC)
committer ar <ar>2004-05-27 22:04:46 (UTC)
commit4f7c3c4d0d634706d13950b3827714b168e279e3 (patch) (side-by-side diff)
tree2df448e7a4dcd538c26365873e194be2b55e83b7 /noncore/apps/opie-reader
parent46f81a089ba8febdb79e0d150b69f74bb1ea7d18 (diff)
downloadopie-4f7c3c4d0d634706d13950b3827714b168e279e3.zip
opie-4f7c3c4d0d634706d13950b3827714b168e279e3.tar.gz
opie-4f7c3c4d0d634706d13950b3827714b168e279e3.tar.bz2
- convert qDebug to odebug
Diffstat (limited to 'noncore/apps/opie-reader') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/BuffDoc.h116
-rw-r--r--noncore/apps/opie-reader/CEncoding.h16
-rw-r--r--noncore/apps/opie-reader/CExpander.h140
-rw-r--r--noncore/apps/opie-reader/Filedata.h56
-rw-r--r--noncore/apps/opie-reader/FontControl.h178
-rw-r--r--noncore/apps/opie-reader/Palm2QImage.cpp125
-rw-r--r--noncore/apps/opie-reader/QTReader.h124
-rw-r--r--noncore/apps/opie-reader/QTReaderApp.h112
8 files changed, 439 insertions, 428 deletions
diff --git a/noncore/apps/opie-reader/BuffDoc.h b/noncore/apps/opie-reader/BuffDoc.h
index 29d0329..61531c0 100644
--- a/noncore/apps/opie-reader/BuffDoc.h
+++ b/noncore/apps/opie-reader/BuffDoc.h
@@ -23,20 +23,20 @@ class BuffDoc
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);
- }
- }
+ {
+ 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);
- }
- }
+ {
+ if (exp != NULL)
+ {
+ exp->putSaveData(src, srclen);
+ }
+ }
#ifdef USEQPE
@@ -49,20 +49,20 @@ class BuffDoc
~BuffDoc()
- {
- delete filt;
- delete exp;
- }
+ {
+ delete filt;
+ delete exp;
+ }
BuffDoc()
- {
- exp = NULL;
- filt = NULL;
- lastword.empty();
-// // qDebug("Buffdoc created");
- }
+ {
+ exp = NULL;
+ filt = NULL;
+ lastword.empty();
+ // odebug << "Buffdoc created" << oendl;
+ }
bool empty() { return (exp == NULL); }
void setfilter(CFilterChain* _f)
- {
- if (filt != NULL) delete filt;
- filt = _f;
- filt->setsource(exp);
- }
+ {
+ if (filt != NULL) delete filt;
+ filt = _f;
+ filt->setsource(exp);
+ }
CList<Bkmk>* getbkmklist() { return exp->getbkmklist(); }
@@ -72,20 +72,20 @@ class BuffDoc
tchar getch()
- {
- tchar ch = UEOF;
- CStyle sty;
- if (exp != NULL)
- {
- filt->getch(ch, sty);
- }
- return ch;
- }
+ {
+ tchar ch = UEOF;
+ CStyle sty;
+ if (exp != NULL)
+ {
+ filt->getch(ch, sty);
+ }
+ return ch;
+ }
void getch(tchar& ch, CStyle& sty)
- {
- if (exp != NULL)
- {
- filt->getch(ch, sty);
- }
- else
- ch = UEOF;
- }
+ {
+ if (exp != NULL)
+ {
+ filt->getch(ch, sty);
+ }
+ else
+ ch = UEOF;
+ }
void setwidth(int w) { if (exp != NULL) exp->setwidth(w); }
@@ -105,11 +105,11 @@ class BuffDoc
int getpara(CBuffer& buff)
- {
- tchar ch;
- int i = 0;
- while ((ch = getch()) != 10 && ch != UEOF) buff[i++] = ch;
- buff[i] = '\0';
- if (i == 0 && ch == UEOF) i = -1;
- laststartline = exp->locate();
- return i;
- }
+ {
+ tchar ch;
+ int i = 0;
+ while ((ch = getch()) != 10 && ch != UEOF) buff[i++] = ch;
+ buff[i] = '\0';
+ if (i == 0 && ch == UEOF) i = -1;
+ laststartline = exp->locate();
+ return i;
+ }
void saveposn(size_t posn) { exp->saveposn(posn); }
diff --git a/noncore/apps/opie-reader/CEncoding.h b/noncore/apps/opie-reader/CEncoding.h
index 463fba9..df0104a 100644
--- a/noncore/apps/opie-reader/CEncoding.h
+++ b/noncore/apps/opie-reader/CEncoding.h
@@ -62,11 +62,11 @@ class CGeneral8Bit : public CEncoding
CGeneral8Bit(int _i) : m_index(_i)
- {
-// qDebug("8Bit:%d", _i);
-// qDebug("%s", unicodetable::iterator(_i)->mime);
- }
+ {
+// odebug << "8Bit: " << _i << oendl;
+// odebug << unicodetable::iterator(_i)->mime << oendl;
+ }
void getch(tchar& ch, CStyle& sty)
- {
- parent->getch(ch, sty);
- ch = unicodetable::unicodevalue(m_index, ch);
- }
+ {
+ parent->getch(ch, sty);
+ ch = unicodetable::unicodevalue(m_index, ch);
+ }
};
diff --git a/noncore/apps/opie-reader/CExpander.h b/noncore/apps/opie-reader/CExpander.h
index 7b21d3e..9fae245 100644
--- a/noncore/apps/opie-reader/CExpander.h
+++ b/noncore/apps/opie-reader/CExpander.h
@@ -42,3 +42,3 @@ class CExpander
#ifdef USEQPE
- virtual void suspend() = 0;
+ virtual void suspend() = 0;
virtual void unsuspend() = 0;
@@ -49,7 +49,7 @@ class CExpander
int openfile(const char *src)
- {
- bSuspended = false;
- fname = strdup(src);
- return OpenFile(src);
- }
+ {
+ bSuspended = false;
+ fname = strdup(src);
+ return OpenFile(src);
+ }
virtual int OpenFile(const char *src) = 0;
@@ -61,13 +61,13 @@ class CExpander
virtual void getch(tchar& ch, CStyle& sty)
- {
- int ich = getch();
- ch = (ich == EOF) ? UEOF : ich;
- sty.unset();
- }
+ {
+ int ich = getch();
+ ch = (ich == EOF) ? UEOF : ich;
+ sty.unset();
+ }
virtual int getch() = 0;
virtual linkType hyperlink(unsigned int n, QString& wrd)
- {
- locate(n);
- return eLink;
- }
+ {
+ locate(n);
+ return eLink;
+ }
virtual MarkupType PreferredMarkup() = 0;
@@ -79,25 +79,25 @@ class CExpander
unsigned long startSection()
- {
- unsigned long current = locate();
- if (m_currentstart > current || current > m_currentend)
- {
- start2endSection();
- }
- return m_currentstart;
- }
+ {
+ unsigned long current = locate();
+ if (m_currentstart > current || current > m_currentend)
+ {
+ start2endSection();
+ }
+ return m_currentstart;
+ }
unsigned long endSection()
- {
- unsigned long current = locate();
- if (m_currentstart > current || current > m_currentend)
- {
- start2endSection();
- }
- return m_currentend;
- }
+ {
+ unsigned long current = locate();
+ if (m_currentstart > current || current > m_currentend)
+ {
+ start2endSection();
+ }
+ return m_currentend;
+ }
virtual void start2endSection()
- {
- m_currentstart = 0;
- unsigned long file;
- sizes(file, m_currentend);
- }
+ {
+ m_currentstart = 0;
+ unsigned long file;
+ sizes(file, m_currentend);
+ }
virtual QImage* getPicture(unsigned long tgt) { return NULL; }
@@ -107,7 +107,7 @@ class CExpander
{
- bSuspended = true;
- suspos = ftell(fin);
- fclose(fin);
- fin = NULL;
- sustime = time(NULL);
+ bSuspended = true;
+ suspos = ftell(fin);
+ fclose(fin);
+ fin = NULL;
+ sustime = time(NULL);
}
@@ -115,20 +115,20 @@ class CExpander
{
- if (bSuspended)
- {
- bSuspended = false;
- int delay = time(NULL) - sustime;
- if (delay < 10) sleep(10-delay);
- fin = fopen(fname, "rb");
- for (int i = 0; fin == NULL && i < 5; i++)
- {
- sleep(5);
- fin = fopen(fname, "rb");
- }
- if (fin == NULL)
- {
- QMessageBox::warning(NULL, PROGNAME, "Couldn't reopen file");
- exit(0);
- }
- suspos = fseek(fin, suspos, SEEK_SET);
- }
+ if (bSuspended)
+ {
+ bSuspended = false;
+ int delay = time(NULL) - sustime;
+ if (delay < 10) sleep(10-delay);
+ fin = fopen(fname, "rb");
+ for (int i = 0; fin == NULL && i < 5; i++)
+ {
+ sleep(5);
+ fin = fopen(fname, "rb");
+ }
+ if (fin == NULL)
+ {
+ QMessageBox::warning(NULL, PROGNAME, "Couldn't reopen file");
+ exit(0);
+ }
+ suspos = fseek(fin, suspos, SEEK_SET);
+ }
}
@@ -136,14 +136,14 @@ class CExpander
virtual void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen)
- {
- len = srclen;
- data = new unsigned char[len];
- memcpy(data, src, len);
- }
+ {
+ len = srclen;
+ data = new unsigned char[len];
+ memcpy(data, src, len);
+ }
virtual void putSaveData(unsigned char*& src, unsigned short& srclen)
- {
- if (srclen != 0)
- {
- qDebug("Don't know what to do with non-zero save data");
- }
- }
+ {
+ if (srclen != 0)
+ {
+ qDebug("Don't know what to do with non-zero save data");
+ }
+ }
void setwidth(int w) { m_scrWidth = w; }
diff --git a/noncore/apps/opie-reader/Filedata.h b/noncore/apps/opie-reader/Filedata.h
index 096dd31..1b85b71 100644
--- a/noncore/apps/opie-reader/Filedata.h
+++ b/noncore/apps/opie-reader/Filedata.h
@@ -11,26 +11,26 @@ class CFiledata
CFiledata(tchar* d)
- {
- data = (unsigned char*)d;
- m_own = false;
- }
+ {
+ data = (unsigned char*)d;
+ m_own = false;
+ }
CFiledata(time_t dt, tchar* nm)
- {
- int nlen = ustrlen(nm)+1;
- data = new unsigned char[sizeof(time_t)+sizeof(tchar)*nlen];
- *((time_t *)data) = dt;
- memcpy(data+sizeof(time_t), nm, sizeof(tchar)*nlen);
- m_own = true;
- }
+ {
+ int nlen = ustrlen(nm)+1;
+ data = new unsigned char[sizeof(time_t)+sizeof(tchar)*nlen];
+ *((time_t *)data) = dt;
+ memcpy(data+sizeof(time_t), nm, sizeof(tchar)*nlen);
+ m_own = true;
+ }
~CFiledata()
- {
- if (m_own && data != NULL)
- {
- delete [] data;
-// qDebug("~Filedata: deleting");
- }
- else
- {
-// qDebug("~Filedata: not deleting");
- }
- }
+ {
+ if (m_own && data != NULL)
+ {
+ delete [] data;
+// odebug << "~Filedata: deleting" << oendl;
+ }
+ else
+ {
+// odebug << "~Filedata: not deleting" << oendl;
+ }
+ }
tchar* name() const { return (tchar*)(data+sizeof(time_t)); }
@@ -41,9 +41,9 @@ class CFiledata
bool operator==(const CFiledata& rhs)
- {
- return ((length() == rhs.length()) && (memcmp(data, rhs.data, length()) == 0));
- }
+ {
+ return ((length() == rhs.length()) && (memcmp(data, rhs.data, length()) == 0));
+ }
bool samename(const CFiledata& rhs)
- {
- return (ustrcmp((tchar *)(data+sizeof(time_t)),(tchar *)(rhs.data+sizeof(time_t))) == 0);
- }
+ {
+ return (ustrcmp((tchar *)(data+sizeof(time_t)),(tchar *)(rhs.data+sizeof(time_t))) == 0);
+ }
};
diff --git a/noncore/apps/opie-reader/FontControl.h b/noncore/apps/opie-reader/FontControl.h
index 5681496..e56b619 100644
--- a/noncore/apps/opie-reader/FontControl.h
+++ b/noncore/apps/opie-reader/FontControl.h
@@ -22,16 +22,16 @@ class FontControl
FontControl(QString n = "helvetica", int size = 10)
- :
- m_fontsizes(NULL), m_hasCourier(false), m_leading(0), m_extraspace(0)
+ :
+ m_fontsizes(NULL), m_hasCourier(false), m_leading(0), m_extraspace(0)
{
- ChangeFont(n, size);
+ ChangeFont(n, size);
}
~FontControl()
- {
- if (m_fontsizes != NULL) delete [] m_fontsizes;
- }
+ {
+ if (m_fontsizes != NULL) delete [] m_fontsizes;
+ }
void hasCourier(bool _b, const QString& _nm)
- {
- m_hasCourier = _b;
- m_fixedfontname = _nm;
- }
+ {
+ m_hasCourier = _b;
+ m_fixedfontname = _nm;
+ }
QString& fixedfontname() { return m_fixedfontname; }
@@ -41,19 +41,19 @@ class FontControl
int getsize(const CStyle& size)
- {
- int tgt = m_size+size.getFontSize();
- if (tgt < 0)
- {
- tgt = 0;
- }
- if (tgt >= m_maxsize)
- {
- tgt = m_maxsize - 1;
- }
- return m_fontsizes[tgt];
- }
+ {
+ int tgt = m_size+size.getFontSize();
+ if (tgt < 0)
+ {
+ tgt = 0;
+ }
+ if (tgt >= m_maxsize)
+ {
+ tgt = m_maxsize - 1;
+ }
+ return m_fontsizes[tgt];
+ }
int ascent()
{
- QFont f(name(), currentsize());
- QFontMetrics fm(f);
- return fm.ascent();
+ QFont f(name(), currentsize());
+ QFontMetrics fm(f);
+ return fm.ascent();
}
@@ -61,5 +61,5 @@ class FontControl
{
- QFont f(name(), getsize(ch));
- QFontMetrics fm(f);
- return fm.ascent();
+ QFont f(name(), getsize(ch));
+ QFontMetrics fm(f);
+ return fm.ascent();
}
@@ -67,5 +67,5 @@ class FontControl
{
- QFont f(name(), currentsize());
- QFontMetrics fm(f);
- return fm.descent();
+ QFont f(name(), currentsize());
+ QFontMetrics fm(f);
+ return fm.descent();
}
@@ -73,5 +73,5 @@ class FontControl
{
- QFont f(name(), getsize(ch));
- QFontMetrics fm(f);
- return fm.descent();
+ QFont f(name(), getsize(ch));
+ QFontMetrics fm(f);
+ return fm.descent();
}
@@ -79,5 +79,5 @@ class FontControl
{
- QFont f(name(), currentsize());
- QFontMetrics fm(f);
- return fm.lineSpacing();
+ QFont f(name(), currentsize());
+ QFontMetrics fm(f);
+ return fm.lineSpacing();
}
@@ -85,67 +85,67 @@ class FontControl
{
- QFont f(name(), getsize(ch));
- QFontMetrics fm(f);
- return fm.lineSpacing();
+ QFont f(name(), getsize(ch));
+ QFontMetrics fm(f);
+ return fm.lineSpacing();
}
bool decreasesize()
- {
+ {
/*
- if (--m_size < 0)
- {
- m_size = 0;
- return false;
- }
- else return true;
+ if (--m_size < 0)
+ {
+ m_size = 0;
+ return false;
+ }
+ else return true;
*/
- if (g_size-- == m_size)
- {
- if (--m_size < 0)
- {
- m_size = 0;
- }
- }
-// qDebug("Font:%d Graphics:%d", m_size, g_size);
- return true;
- }
+ if (g_size-- == m_size)
+ {
+ if (--m_size < 0)
+ {
+ m_size = 0;
+ }
+ }
+// odebug << "Font:" << m_size << " Graphics:" << g_size << oendl;
+ return true;
+ }
bool increasesize()
- {
+ {
/*
- if (++m_size >= m_maxsize)
- {
- m_size = m_maxsize - 1;
- return false;
- }
- else return true;
+ if (++m_size >= m_maxsize)
+ {
+ m_size = m_maxsize - 1;
+ return false;
+ }
+ else return true;
*/
- if (g_size++ == m_size)
- {
- if (++m_size >= m_maxsize)
- {
- m_size = m_maxsize - 1;
- }
- }
-// qDebug("Font:%d Graphics:%d", m_size, g_size);
- return true;
- }
+ if (g_size++ == m_size)
+ {
+ if (++m_size >= m_maxsize)
+ {
+ m_size = m_maxsize - 1;
+ }
+ }
+// odebug << "Font:" << m_size << " Graphics:" << g_size << oendl;
+ return true;
+ }
bool ChangeFont(QString& n)
- {
- return ChangeFont(n, currentsize());
- }
+ {
+ return ChangeFont(n, currentsize());
+ }
bool ChangeFont(QString& n, int tgt);
void setlead(int _lead)
- {
- m_leading = _lead;
- }
+ {
+ m_leading = _lead;
+ }
int getlead()
- {
- return m_leading;
- }
+ {
+ return m_leading;
+ }
void setextraspace(int _lead)
- {
- m_extraspace = _lead;
- }
+ {
+ m_extraspace = _lead;
+ }
int getextraspace()
- {
- return m_extraspace;
- }
+ {
+ return m_extraspace;
+ }
};
diff --git a/noncore/apps/opie-reader/Palm2QImage.cpp b/noncore/apps/opie-reader/Palm2QImage.cpp
index 9339595..b0d4e00 100644
--- a/noncore/apps/opie-reader/Palm2QImage.cpp
+++ b/noncore/apps/opie-reader/Palm2QImage.cpp
@@ -1,2 +1,10 @@
/* -*- mode: c; indent-tabs-mode: nil; -*- */
+
+/* OPIE */
+#include <opie2/odebug.h>
+
+/* QT */
+#include <qimage.h>
+
+/* STD */
#include <stdio.h>
@@ -11,3 +19,2 @@
-#include <qimage.h>
@@ -44,6 +51,6 @@ typedef struct {
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, 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 },
@@ -141,5 +148,7 @@ QImage* Palm2QImage
/* bytes 14 and 15 are reserved by Palm and always 0 */
-
+
#if 0
-// qDebug ("Palm image is %dx%d, %d bpp, version %d, flags 0x%x, compression %d", width, height, bits_per_pixel, version, flags, compression_type);
+// odebug << "Palm image is " << width << "x" << height
+// << ", " << bits_per_pixel << " bpp, version " << version
+// << ", flags 0x" << flags << ", compression " << compression_type << oendl;
#endif
@@ -147,3 +156,3 @@ QImage* Palm2QImage
if (compression_type == PALM_COMPRESSION_PACKBITS) {
-// qDebug ("Image uses packbits compression; not yet supported");
+// odebug << "Image uses packbits compression; not yet supported" << oendl;
return NULL;
@@ -152,3 +161,3 @@ QImage* Palm2QImage
(compression_type != PALM_COMPRESSION_SCANLINE)) {
-// qDebug ("Image uses unknown compression, code 0x%x", compression_type);
+// odebug << "Image uses unknown compression, code 0x" << compression_type << oendl;
return NULL;
@@ -157,3 +166,3 @@ QImage* Palm2QImage
/* as of PalmOS 4.0, there are 6 different kinds of Palm pixmaps:
-
+
1, 2, or 4 bit grayscale
@@ -162,6 +171,6 @@ QImage* Palm2QImage
16-bit DirectColor using 5 bits for red, 6 for green, and 5 for blue
-
+
Each of these can be compressed with one of four compression schemes,
"RLE", "Scanline", "PackBits", or none.
-
+
We begin by constructing the colormap.
@@ -170,3 +179,3 @@ QImage* Palm2QImage
if (flags & PALM_HAS_COLORMAP_FLAG) {
-// qDebug("Palm images with custom colormaps are not currently supported.\n");
+// odebug << "Palm images with custom colormaps are not currently supported." << oendl;
return NULL;
@@ -189,5 +198,6 @@ QImage* Palm2QImage
palm_blue_bits = palmimage[18];
-// qDebug("Bits:%d, %d, %d", palm_red_bits, palm_green_bits, palm_blue_bits);
+// odebug << "Bits:" << palm_red_bits << ", " << palm_green_bits << ", " << palm_blue_bits << oendl;
if (palm_blue_bits > 8 || palm_green_bits > 8 || palm_red_bits > 8) {
-// qDebug("Can't handle this format DirectColor image -- too wide in some color (%d:%d:%d)\n", palm_red_bits, palm_green_bits, palm_blue_bits);
+// odebug << "Can't handle this format DirectColor image -- too wide in some color ("
+// << palm_red_bits << ":" << palm_green_bits << ":" << palm_blue_bits << oendl;
return NULL;
@@ -195,3 +205,4 @@ QImage* Palm2QImage
if (bits_per_pixel > (8 * sizeof(unsigned long))) {
-// qDebug ("Can't handle this format DirectColor image -- too many bits per pixel (%d)\n", bits_per_pixel);
+// odebug << "Can't handle this format DirectColor image -- too many bits per pixel ("
+// << bits_per_pixel << ")" << oendl;
return NULL;
@@ -200,3 +211,3 @@ QImage* Palm2QImage
} else {
-// qDebug("Unknown bits-per-pixel of %d encountered.\n", bits_per_pixel);
+// odebug << "Unknown bits-per-pixel of " << bits_per_pixel << " encountered" << oendl;
return NULL;
@@ -215,3 +226,4 @@ QImage* Palm2QImage
for (i=0, palm_ptr = imagedatastart , x_ptr = imagedata; i < height; ++i) {
-// qDebug("inval:%x palm_ptr:%x x_ptr:%x bpr:%x", inval, palm_ptr, x_ptr, bytes_per_row);
+// odebug << "inval:" << inval << " palm_ptr:" << palm_ptr << " x_ptr:" << x_ptr
+// << " bpr:" << bytes_per_row << oendl;
@@ -220,6 +232,6 @@ QImage* Palm2QImage
for (j = 0; j < bytes_per_row; ) {
- incount = *palm_ptr++;
- inval = *palm_ptr++;
- memset(rowbuf + j, inval, incount);
- j += incount;
+ incount = *palm_ptr++;
+ inval = *palm_ptr++;
+ memset(rowbuf + j, inval, incount);
+ j += incount;
}
@@ -227,10 +239,10 @@ QImage* Palm2QImage
for (j = 0; j < bytes_per_row; j += 8) {
- incount = *palm_ptr++;
- inval = ((bytes_per_row - j) < 8) ? (bytes_per_row - j) : 8;
- for (inbit = 0; inbit < inval; inbit += 1) {
- if (incount & (1 << (7 - inbit)))
- rowbuf[j + inbit] = *palm_ptr++;
- else
- rowbuf[j + inbit] = lastrow[j + inbit];
- }
+ incount = *palm_ptr++;
+ inval = ((bytes_per_row - j) < 8) ? (bytes_per_row - j) : 8;
+ for (inbit = 0; inbit < inval; inbit += 1) {
+ if (incount & (1 << (7 - inbit)))
+ rowbuf[j + inbit] = *palm_ptr++;
+ else
+ rowbuf[j + inbit] = lastrow[j + inbit];
+ }
}
@@ -245,8 +257,8 @@ QImage* Palm2QImage
else {
- qDebug("Case 4");
- qDebug("Is compressed:%s", ((flags & PALM_IS_COMPRESSED_FLAG) == 0) ? "false" : "true");
- qDebug("Has colourmap:%s", ((flags & PALM_HAS_COLORMAP_FLAG) == 0) ? "false" : "true");
- qDebug("Has transparency:%s", ((flags & PALM_HAS_TRANSPARENCY_FLAG) == 0) ? "false" : "true");
- qDebug("Direct colour:%s", ((flags & PALM_DIRECT_COLOR_FLAG) == 0) ? "false" : "true");
- qDebug("four byte field:%s", ((flags & PALM_4_BYTE_FIELD_FLAG) == 0) ? "false" : "true");
+ odebug << "Case 4" << oendl;
+ odebug << "Is compressed:" << (((flags & PALM_IS_COMPRESSED_FLAG) == 0) ? "false" : "true") << oendl;
+ odebug << "Has colourmap:" << (((flags & PALM_HAS_COLORMAP_FLAG) == 0) ? "false" : "true") << oendl;
+ odebug << "Has transparency:" << (((flags & PALM_HAS_TRANSPARENCY_FLAG) == 0) ? "false" : "true") << oendl;
+ odebug << "Direct colour:" << (((flags & PALM_DIRECT_COLOR_FLAG) == 0) ? "false" : "true") << oendl;
+ odebug << "four byte field:" << (((flags & PALM_4_BYTE_FIELD_FLAG) == 0) ? "false" : "true") << oendl;
memcpy (rowbuf, palm_ptr, bytes_per_row);
@@ -258,14 +270,14 @@ QImage* Palm2QImage
for (inbit = 8 - bits_per_pixel, inbyte = rowbuf, j = 0; j < width; ++j) {
- inval = ((*inbyte) & (mask << inbit)) >> inbit;
- /* correct for oddity of the 8-bit color Palm pixmap... */
- if ((bits_per_pixel == 8) && (inval == 0xFF)) inval = 231;
- /* now lookup the correct color and set the pixel in the GTK bitmap */
- QRgb colour = qRgb(colormap[inval].red, colormap[inval].green, colormap[inval].blue);
+ inval = ((*inbyte) & (mask << inbit)) >> inbit;
+ /* correct for oddity of the 8-bit color Palm pixmap... */
+ if ((bits_per_pixel == 8) && (inval == 0xFF)) inval = 231;
+ /* now lookup the correct color and set the pixel in the GTK bitmap */
+ QRgb colour = qRgb(colormap[inval].red, colormap[inval].green, colormap[inval].blue);
qimage->setPixel(j, i, colour);
- if (!inbit) {
- ++inbyte;
- inbit = 8 - bits_per_pixel;
- } else {
- inbit -= bits_per_pixel;
- }
+ if (!inbit) {
+ ++inbyte;
+ inbit = 8 - bits_per_pixel;
+ } else {
+ inbit -= bits_per_pixel;
+ }
}
@@ -274,13 +286,12 @@ QImage* Palm2QImage
for (inbyte = rowbuf, j = 0; j < width; ++j) {
- inval = ((unsigned short)inbyte[0] << (unsigned short)8) | inbyte[1];
+ inval = ((unsigned short)inbyte[0] << (unsigned short)8) | inbyte[1];
/*
- qDebug ("pixel is %d,%d (%d:%d:%d)",
- j, i,
- ((inval >> (bits_per_pixel - palm_red_bits)) & ((1 << palm_red_bits) - 1)) << (8-palm_red_bits),
- ((inval >> palm_blue_bits) & ((1 << palm_green_bits) - 1)) << (8-palm_green_bits),
- ((inval >> 0) & ((1 << palm_blue_bits) - 1)) << (8-palm_blue_bits));
+ odebug << "pixel is " << j << "," << i << " ("
+ << (((inval >> (bits_per_pixel - palm_red_bits)) & ((1 << palm_red_bits) - 1)) << (8-palm_red_bits)) << ":"
+ << (((inval >> palm_blue_bits) & ((1 << palm_green_bits) - 1)) << (8-palm_green_bits)) << ":"
+ << (((inval >> 0) & ((1 << palm_blue_bits) - 1)) << (8-palm_blue_bits)) << ")" << oendl;
*/
- QRgb colour = qRgb(
- ((inval >> (bits_per_pixel - palm_red_bits)) & ((1 << palm_red_bits) - 1)) << (8-palm_red_bits),
+ QRgb colour = qRgb(
+ ((inval >> (bits_per_pixel - palm_red_bits)) & ((1 << palm_red_bits) - 1)) << (8-palm_red_bits),
((inval >> palm_blue_bits) & ((1 << palm_green_bits) - 1)) << (8-palm_green_bits),
@@ -288,3 +299,3 @@ QImage* Palm2QImage
qimage->setPixel(j, i, colour);
- inbyte += 2;
+ inbyte += 2;
}
@@ -301,3 +312,3 @@ QImage* hRule(int w, int h, unsigned char r, unsigned char g, unsigned char b)
{
-//// qDebug("hrule [%d, %d]", w, h);
+// odebug << "hrule [" << w << ", " << h << "]" << oendl;
QPixmap* qimage = new QPixmap(w, h);
diff --git a/noncore/apps/opie-reader/QTReader.h b/noncore/apps/opie-reader/QTReader.h
index dfbdfb9..f89de63 100644
--- a/noncore/apps/opie-reader/QTReader.h
+++ b/noncore/apps/opie-reader/QTReader.h
@@ -23,4 +23,4 @@ class QTReader : public QWidget
- static tchar pluckernextpart[];
- static tchar jplucknextpart[];
+ static tchar pluckernextpart[];
+ static tchar jplucknextpart[];
friend class QTReaderApp;
@@ -61,9 +61,9 @@ public:
void setSaveData(unsigned char*& data, unsigned short& len, unsigned char* src, unsigned short srclen)
- {
- buffdoc.setSaveData(data, len, src, srclen);
- }
+ {
+ buffdoc.setSaveData(data, len, src, srclen);
+ }
void putSaveData(unsigned char*& src, unsigned short& srclen)
- {
- buffdoc.putSaveData(src, srclen);
- }
+ {
+ buffdoc.putSaveData(src, srclen);
+ }
bool empty();
@@ -77,3 +77,3 @@ public:
size_t nd = locate();
- jumpto(m_mark);
+ jumpto(m_mark);
QString text;
@@ -93,11 +93,11 @@ public:
{
- if (oldfile)
- {
- m_string = m_lastfile;
- load_file((const tchar*)m_string);
- }
- else
- {
- m_string = QString::null;
- }
+ if (oldfile)
+ {
+ m_string = m_lastfile;
+ load_file((const tchar*)m_string);
+ }
+ else
+ {
+ m_string = QString::null;
+ }
};
@@ -105,20 +105,20 @@ public:
void setlead(int _lead)
- {
- m_fontControl.setlead(_lead);
- }
+ {
+ m_fontControl.setlead(_lead);
+ }
int getlead()
- {
- return m_fontControl.getlead();
- }
+ {
+ return m_fontControl.getlead();
+ }
void setextraspace(int _lead)
- {
- m_fontControl.setextraspace(_lead);
- }
+ {
+ m_fontControl.setextraspace(_lead);
+ }
int getextraspace()
- {
- return m_fontControl.getextraspace();
- }
+ {
+ return m_fontControl.getextraspace();
+ }
void setpagemode(bool _b)
{
- m_bpagemode = _b;
+ m_bpagemode = _b;
}
@@ -126,36 +126,36 @@ public:
{
- m_bMonoSpaced = _b;
- ChangeFont(m_fontControl.currentsize());
- locate(pagelocate());
+ m_bMonoSpaced = _b;
+ ChangeFont(m_fontControl.currentsize());
+ locate(pagelocate());
}
void setencoding(int _f)
- {
- m_encd = _f;
- setfilter(getfilter());
- }
+ {
+ m_encd = _f;
+ setfilter(getfilter());
+ }
MarkupType PreferredMarkup();
CEncoding* getencoding()
- {
-// qDebug("m_encd:%d", m_encd);
- switch (m_encd)
- {
- case 4:
-// qDebug("palm");
- return new CPalm;
- case 1:
-// qDebug("utf8");
- return new CUtf8;
- case 2:
-// qDebug("ucs16be");
- return new CUcs16be;
- case 3:
-// qDebug("ucs16le");
- return new CUcs16le;
- case 0:
-// qDebug("ascii");
- return new CAscii;
- default:
- return new CGeneral8Bit(m_encd-MAX_ENCODING+1);
- }
- }
+ {
+// odebug << "m_encd:" << m_encd << oendl;
+ switch (m_encd)
+ {
+ case 4:
+// odebug << "palm" << oendl;
+ return new CPalm;
+ case 1:
+// odebug << "utf8" << oendl;
+ return new CUtf8;
+ case 2:
+// odebug << "ucs16be" << oendl;
+ return new CUcs16be;
+ case 3:
+// odebug << "ucs16le" << oendl;
+ return new CUcs16le;
+ case 0:
+// odebug << "ascii" << oendl;
+ return new CAscii;
+ default:
+ return new CGeneral8Bit(m_encd-MAX_ENCODING+1);
+ }
+ }
CFilterChain* getfilter()
@@ -191,3 +191,3 @@ private slots:
void goForward();
- void doscroll();
+ void doscroll();
void drawIt( QPainter * );
diff --git a/noncore/apps/opie-reader/QTReaderApp.h b/noncore/apps/opie-reader/QTReaderApp.h
index ab6f60e..fe3eebf 100644
--- a/noncore/apps/opie-reader/QTReaderApp.h
+++ b/noncore/apps/opie-reader/QTReaderApp.h
@@ -45,5 +45,5 @@ class QPopupMenu;
class QToolBar;
-#ifdef USEQPE
+#ifdef USEQPE
class QToolBar;
-class QMenuBar;
+class QMenuBar;
#endif
@@ -142,3 +142,3 @@ class QTReaderApp : public QMainWindow
- unsigned long m_savedpos;
+ unsigned long m_savedpos;
int m_debounce;
@@ -151,3 +151,3 @@ class QTReaderApp : public QMainWindow
- public:
+ public:
QTReaderApp( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
@@ -157,5 +157,5 @@ class QTReaderApp : public QMainWindow
void hideEvent(QHideEvent*)
- {
- suspend();
- }
+ {
+ suspend();
+ }
@@ -173,13 +173,13 @@ class QTReaderApp : public QMainWindow
void closeEvent( QCloseEvent *e );
- void readbkmks();
- void do_mono(const QString&);
- void do_jump(const QString&);
- void do_settarget(const QString&);
+ void readbkmks();
+ void do_mono(const QString&);
+ void do_jump(const QString&);
+ void do_settarget(const QString&);
#ifdef _SCROLLPIPE
-// void do_setpipetarget(const QString&);
+// void do_setpipetarget(const QString&);
#endif
- void do_saveconfig(const QString&, bool);
- bool readconfig(const QString&, bool);
- bool PopulateConfig(const char*);
- ActionTypes ActNameToInt(const QString&);
+ void do_saveconfig(const QString&, bool);
+ bool readconfig(const QString&, bool);
+ bool PopulateConfig(const char*);
+ ActionTypes ActNameToInt(const QString&);
bool m_doAnnotation;
@@ -190,3 +190,3 @@ class QTReaderApp : public QMainWindow
public:
- void saveprefs();
+ void saveprefs();
public slots:
@@ -209,13 +209,13 @@ private slots:
void OnAnnotation(bool _b)
- {
- m_doAnnotation = _b;
- }
+ {
+ m_doAnnotation = _b;
+ }
void OnDictionary(bool _b)
- {
- m_doDictionary = _b;
- }
+ {
+ m_doDictionary = _b;
+ }
void OnClipboard(bool _b)
- {
- m_doClipboard = _b;
- }
+ {
+ m_doClipboard = _b;
+ }
void OnWordSelected(const QString&, size_t, const QString&);
@@ -228,26 +228,26 @@ private slots:
void do_setencoding(int i);
- void do_setfont(const QString&);
- void buttonActionSelected(QAction*);
-// void msgHandler(const QCString&, const QByteArray&);
- void monospace(bool);
- void jump();
- void settarget();
+ void do_setfont(const QString&);
+ void buttonActionSelected(QAction*);
+// void msgHandler(const QCString&, const QByteArray&);
+ void monospace(bool);
+ void jump();
+ void settarget();
#ifdef _SCROLLPIPE
-// void setpipetarget();
-// void setpause(bool);
+// void setpipetarget();
+// void setpause(bool);
#endif
-// void setspacing();
- void setfont();
- void clearBkmkList();
- void listBkmkFiles();
- void editMark();
- void autoScroll(bool);
- void addbkmk();
- void savebkmks();
-// void importFiles();
- void showprefs();
- void showtoolbarprefs();
- void infoClose();
- // void oldFile();
- void showinfo();
+// void setspacing();
+ void setfont();
+ void clearBkmkList();
+ void listBkmkFiles();
+ void editMark();
+ void autoScroll(bool);
+ void addbkmk();
+ void savebkmks();
+// void importFiles();
+ void showprefs();
+ void showtoolbarprefs();
+ void infoClose();
+ // void oldFile();
+ void showinfo();
@@ -369,3 +369,3 @@ private slots:
ActionTypes m_spaceTarget, m_escapeTarget, m_returnTarget, m_leftTarget, m_rightTarget,
- m_upTarget, m_downTarget;
+ m_upTarget, m_downTarget;
bool m_leftScroll, m_rightScroll, m_upScroll, m_downScroll;
@@ -384,7 +384,7 @@ private slots:
QToolBar *menubar, *fileBar, *navBar, *viewBar, *markBar;
-#ifdef USEQPE
- QMenuBar *mb;
-#else
- QMenuBar *mb;
-#endif
+#ifdef USEQPE
+ QMenuBar *mb;
+#else
+ QMenuBar *mb;
+#endif
QFloatBar *searchBar, *regBar/*, *m_fontBar*/;
@@ -401,4 +401,4 @@ private slots:
{
-// qDebug("resize:(%u,%u)", r->oldSize().width(), r->oldSize().height());
-// qDebug("resize:(%u,%u)", r->size().width(), r->size().height());
+// odebug << "resize:(" << r->oldSize().width() << "," << r->oldSize().height() << ")" << oendl;
+// odebug << "resize:(" << r->size().width() << "," << r->size().height() << ")" << oendl;
// bgroup->move( width()-bgroup->width(), 0 );