summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/BuffDoc.h2
-rw-r--r--noncore/apps/opie-reader/CEncoding.h4
-rw-r--r--noncore/apps/opie-reader/CExpander.h0
-rw-r--r--noncore/apps/opie-reader/Filedata.h4
-rw-r--r--noncore/apps/opie-reader/FontControl.h4
-rw-r--r--noncore/apps/opie-reader/Palm2QImage.cpp55
-rw-r--r--noncore/apps/opie-reader/QTReader.h12
-rw-r--r--noncore/apps/opie-reader/QTReaderApp.h4
8 files changed, 48 insertions, 37 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
@@ -56,7 +56,7 @@ class BuffDoc
exp = NULL;
filt = NULL;
lastword.empty();
-// // qDebug("Buffdoc created");
+ // odebug << "Buffdoc created" << oendl;
}
bool empty() { return (exp == NULL); }
void setfilter(CFilterChain* _f)
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
@@ -61,8 +61,8 @@ class CGeneral8Bit : public CEncoding
public:
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)
{
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
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
@@ -26,11 +26,11 @@ class CFiledata
if (m_own && data != NULL)
{
delete [] data;
-// qDebug("~Filedata: deleting");
+// odebug << "~Filedata: deleting" << oendl;
}
else
{
-// qDebug("~Filedata: not deleting");
+// odebug << "~Filedata: not deleting" << oendl;
}
}
tchar* name() const { return (tchar*)(data+sizeof(time_t)); }
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
@@ -104,7 +104,7 @@ class FontControl
m_size = 0;
}
}
-// qDebug("Font:%d Graphics:%d", m_size, g_size);
+// odebug << "Font:" << m_size << " Graphics:" << g_size << oendl;
return true;
}
bool increasesize()
@@ -124,7 +124,7 @@ class FontControl
m_size = m_maxsize - 1;
}
}
-// qDebug("Font:%d Graphics:%d", m_size, g_size);
+// odebug << "Font:" << m_size << " Graphics:" << g_size << oendl;
return true;
}
bool ChangeFont(QString& n)
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,4 +1,12 @@
/* -*- mode: c; indent-tabs-mode: nil; -*- */
+
+/* OPIE */
+#include <opie2/odebug.h>
+
+/* QT */
+#include <qimage.h>
+
+/* STD */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -9,7 +17,6 @@
#include <sys/stat.h>
#include <stdarg.h>
-#include <qimage.h>
/***********************************************************************/
/***********************************************************************/
@@ -141,16 +148,18 @@ 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
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;
} else if ((compression_type != PALM_COMPRESSION_NONE) &&
(compression_type != PALM_COMPRESSION_RLE) &&
(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;
}
@@ -168,7 +177,7 @@ 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;
} else if (bits_per_pixel == 1) {
colormap = Palm1BitColormap;
@@ -187,18 +196,20 @@ QImage* Palm2QImage
palm_red_bits = palmimage[16];
palm_green_bits = palmimage[17];
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;
}
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;
}
imagedatastart = palmimage + 24;
} 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;
}
@@ -213,7 +224,8 @@ QImage* Palm2QImage
lastrow = new unsigned char[bytes_per_row * width];
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;
/* first, uncompress the Palm image */
if ((flags & PALM_IS_COMPRESSED_FLAG) && (compression_type == PALM_COMPRESSION_RLE)) {
@@ -243,12 +255,12 @@ QImage* Palm2QImage
palm_ptr += bytes_per_row;
}
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);
palm_ptr += bytes_per_row;
}
@@ -275,11 +287,10 @@ QImage* Palm2QImage
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),
@@ -299,7 +310,7 @@ QImage* Palm2QImage
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);
qimage->fill(QColor(r,g,b));
QImage* ret = new QImage(qimage->convertToImage());
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
@@ -136,23 +136,23 @@ public:
MarkupType PreferredMarkup();
CEncoding* getencoding()
{
-// qDebug("m_encd:%d", m_encd);
+// odebug << "m_encd:" << m_encd << oendl;
switch (m_encd)
{
case 4:
-// qDebug("palm");
+// odebug << "palm" << oendl;
return new CPalm;
case 1:
-// qDebug("utf8");
+// odebug << "utf8" << oendl;
return new CUtf8;
case 2:
-// qDebug("ucs16be");
+// odebug << "ucs16be" << oendl;
return new CUcs16be;
case 3:
-// qDebug("ucs16le");
+// odebug << "ucs16le" << oendl;
return new CUcs16le;
case 0:
-// qDebug("ascii");
+// odebug << "ascii" << oendl;
return new CAscii;
default:
return new CGeneral8Bit(m_encd-MAX_ENCODING+1);
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
@@ -399,8 +399,8 @@ private slots:
/*
void resizeEvent( QResizeEvent * r)
{
-// 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 );
}
*/