summaryrefslogtreecommitdiff
path: root/noncore/apps
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
parent46f81a089ba8febdb79e0d150b69f74bb1ea7d18 (diff)
downloadopie-4f7c3c4d0d634706d13950b3827714b168e279e3.zip
opie-4f7c3c4d0d634706d13950b3827714b168e279e3.tar.gz
opie-4f7c3c4d0d634706d13950b3827714b168e279e3.tar.bz2
- convert qDebug to odebug
Diffstat (limited to 'noncore/apps') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/keyz-cfg/zkb.cpp26
-rw-r--r--noncore/apps/opie-gutenbrowser/gutenbrowser.cpp15
-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
-rw-r--r--noncore/apps/tinykate/libkate/document/katedocument.h2
-rw-r--r--noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp80
12 files changed, 114 insertions, 94 deletions
diff --git a/noncore/apps/keyz-cfg/zkb.cpp b/noncore/apps/keyz-cfg/zkb.cpp
index 58bde2a..c9e1dc5 100644
--- a/noncore/apps/keyz-cfg/zkb.cpp
+++ b/noncore/apps/keyz-cfg/zkb.cpp
@@ -1,25 +1,29 @@
#include "zkb.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
+
#include <stdio.h>
// Implementation of Action class
Action::Action():state(0), keycode(0), unicode(0), flags(0) {
}
Action::Action(State* s, ushort kc, ushort uni, int f):
state(s), keycode(kc), unicode(uni), flags(f) {
}
Action::~Action() {
}
State* Action::getState() const {
return state;
}
void Action::setState(State* s) {
state = s;
setDefined(true);
}
bool Action::hasEvent() const {
return flags & Event;
@@ -231,75 +235,73 @@ int State::translateKeycode(int keycode) const {
return x2[keycode - 0x1000];
}
return -1;
}
// Implementation of Keymap class
Keymap::Keymap():enabled(true), currentState(0), autoRepeatAction(0), repeater(this) {
repeatDelay=400;
repeatPeriod=80;
connect(&repeater, SIGNAL(timeout()), this, SLOT(autoRepeat()));
}
Keymap::~Keymap() {
QMap<QString, State*>::Iterator it;
for(it = states.begin(); it != states.end(); ++it) {
delete it.data();
}
states.clear();
}
bool Keymap::filter(int unicode, int keycode, int modifiers,
bool isPress, bool autoRepeat) {
- qDebug("filter: >>> unicode=%x, keycode=%x, modifiers=%x, "
- "ispressed=%x\n", unicode, keycode, modifiers, isPress);
+ odebug << "filter: >>> unicode=" << unicode << ", keycode=" << keycode
+ << ", modifiers=" << modifiers << ", ispressed=" << isPress << oendl;
if (!enabled) {
return false;
}
// the second check is workaround to make suspend work if
// the user pressed it right after he did resume. for some
// reason the event sent by qt has autoRepeat true in this
// case
if (autoRepeat && keycode != 4177) {
return true;
}
(void) unicode; (void) modifiers;
Action* action = currentState->get(keycode, isPress, true);
if (action==0 || !action->isDefined()) {
return true;
}
if (action->hasEvent()) {
- qDebug("filter:<<< unicode=%x, keycode=%x, modifiers=%x, "
- "ispressed=%x\n", action->getUnicode(),
- action->getKeycode(), action->getModifiers(),
- action->isPressed());
+ odebug << "filter:<<< unicode=" << action->getUnicode() << ", keycode=" << action->getKeycode()
+ << ", modifiers=" << action->getModifiers() << ", ispressed=" << action->isPressed() << oendl;
QWSServer::sendKeyEvent(action->getUnicode(),
action->getKeycode(), action->getModifiers(),
action->isPressed(), false);
}
if (action->isAutorepeat()) {
autoRepeatAction = action;
repeater.start(repeatDelay, TRUE);
} else {
autoRepeatAction = 0;
}
State* nstate = action->getState();
if (nstate != 0) {
setCurrentState(nstate);
QString lbl = getCurrentLabel();
if (!lbl.isEmpty()) {
emit stateChanged(lbl);
}
}
return true;
@@ -383,50 +385,49 @@ bool Keymap::addState(const QString& name, State* state) {
if (currentState == 0) {
setCurrentState(state);
}
return true;
}
State* Keymap::getCurrentState() const {
return currentState;
}
QString Keymap::getCurrentLabel() {
return currentLabel;
}
bool Keymap::setCurrentState(State* state) {
QMap<QString, State*>::Iterator it;
for(it = states.begin(); it != states.end(); ++it) {
State* s = it.data();
if (s == state) {
currentState = s;
currentStateName = it.key();
- qDebug("state changed: %s\n", (const char*)
- currentStateName.utf8());
+ odebug << "state changed: " << (const char*)currentStateName.utf8() << oendl;
if (!lsmapInSync) {
generateLabelStateMaps();
}
QMap<State*, QString>::Iterator tit;
tit = stateLabelMap.find(state);
if (tit != stateLabelMap.end()) {
currentLabel = tit.data();
} else {
// odebug << "no label for: " + currentStateName + "\n" << oendl;
currentLabel = "";
}
return true;
}
}
return false;
}
bool Keymap::removeState(const QString& name, bool force) {
QMap<QString, State*>::Iterator it = states.find(name);
@@ -442,53 +443,52 @@ bool Keymap::removeState(const QString& name, bool force) {
return false;
} else {
for(Action* a = acts.first(); a != 0; a = acts.next()) {
a->setState(0);
}
}
}
if (state == currentState) {
if (states.begin() != states.end()) {
setCurrentState(states.begin().data());
}
}
states.remove(it);
delete state;
lsmapInSync = false;
return true;
}
void Keymap::autoRepeat() {
if (autoRepeatAction != 0) {
- qDebug("filter:<<< unicode=%x, keycode=%x, modifiers=%x, "
- "ispressed=%x\n", autoRepeatAction->getUnicode(),
- autoRepeatAction->getKeycode(),
- autoRepeatAction->getModifiers(),
- autoRepeatAction->isPressed());
+ odebug << "filter:<<< unicode=" << autoRepeatAction->getUnicode()
+ << ", keycode=" << autoRepeatAction->getKeycode()
+ << ", modifiers=" << autoRepeatAction->getModifiers()
+ << "ispressed=" << autoRepeatAction->isPressed() << oendl;
QWSServer::sendKeyEvent(autoRepeatAction->getUnicode(),
autoRepeatAction->getKeycode(),
autoRepeatAction->getModifiers(),
autoRepeatAction->isPressed(), true);
}
repeater.start(repeatPeriod, TRUE);
}
bool Keymap::addLabel(const QString& label, const QString& state, int index) {
if (labels.find(label) != labels.end()) {
return false;
}
labels.insert(label, state);
const QString& l = labels.find(label).key();
if (index == -1) {
labelList.append(l);
} else {
labelList.insert(labelList.at(index), l);
}
lsmapInSync = false;
diff --git a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp
index be2b897..f14080f 100644
--- a/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp
+++ b/noncore/apps/opie-gutenbrowser/gutenbrowser.cpp
@@ -400,84 +400,86 @@ void Gutenbrowser::ForwardBtn() {
QString s;
QString insertString;
int pageSize= Lview->PageSize();
Lview->clear();
for(int fd=0; fd < pageSize - 1;fd++) {
f.readLine(s, 256);
if(useWrap)
s.replace(QRegExp("\n"),"");
insertString+=s;
Lview->insertLine( s, -1);
// odebug << s << oendl;
currentLine++;
}
// Lview->insertAt( insertString,0,0, FALSE);
currentFilePos = f.at();
// if( i_pageNum != pages) {
// Lview->MultiLine_Ex::pageDown( FALSE);
i_pageNum++;
pageStopArray.resize(i_pageNum + 1);
// int length = Lview->length();
pageStopArray[i_pageNum ] = currentFilePos;
- // qDebug("%d current page is number %d, pagesize %d, length %d, current %d",
- // currentFilePos, i_pageNum, pageSize, Lview->length(), pageStopArray[i_pageNum] );
+ // odebug << currentFilePos << " current page is number " << i_pageNum
+ // << ", pagesize " << pageSize << ", length " << Lview->length()
+ // << ", current " << pageStopArray[i_pageNum] << oendl;
setStatus();
Lview->setCursorPosition( 0, 0, FALSE);
// }
} else {
// odebug << "bal" << oendl;
// if( i_pageNum != pages) {
// // int newTop = Lview->Top();
// // if(Lview->lastRow() > i)
// Lview->ScrollUp(1);
// // i_pageNum++;
// setStatus();
// Lview->setCursorPosition( Lview->Top(), 0, FALSE);
// }
}
Lview->setFocus();
// odebug << "page number " << i_pageNum << " line number " << currentLine << "" << oendl;
}
void Gutenbrowser::BackBtn() {
if( i_pageNum > 0) {
int pageSize= Lview->PageSize();
// int length=Lview->length();
i_pageNum--;
currentFilePos = f.at();
- // qDebug("%d move back to %d, current page number %d, %d, length %d",
- // currentFilePos, pageStopArray[i_pageNum - 1 ], i_pageNum, pageSize, Lview->length() );
+ // odebug << currentFilePos << " move back to " << pageStopArray[i_pageNum - 1 ]
+ // << ", current page number " << i_pageNum
+ // << ", " << pageSize << ", length " << Lview->length() << oendl;
if( i_pageNum < 2) {
f.at( 0);
} else {
if(!f.at( pageStopArray[i_pageNum - 1] ))
odebug << "File positioned backward did not work" << oendl;
}
QString s;
// int sizeLine=0;
Lview->clear();
// QString insertString;
for(int fd = 0; fd < pageSize ;fd++) {
// Lview->removeLine( Lview->PageSize() );
f.readLine(s, 256);
if(useWrap)
s.replace(QRegExp("\n"),"");
currentLine++;
// insertString+=s;
Lview->insertLine( s, -1);
}
// Lview->insertAt( insertString,0,0, FALSE);
@@ -778,50 +780,51 @@ bool Gutenbrowser::load( const char *fileName) {
}
currentFilePos = 0;
pageStopArray.resize(3);
pageStopArray[0] = currentFilePos;
fileHandle = f.handle();
QString insertString;
QTextStream t(&f);
QString s;
for(int fd=0; fd < Lview->PageSize() ;fd++) {
s=t.readLine();
// insertString+=s;
if(useWrap)
s.replace(QRegExp("\n"),"");
// s.replace(QRegExp("\r"),"");
Lview->insertLine( s,-1);
currentLine++;
}
// int length = Lview->length();
currentFilePos = f.at();
pageStopArray[1] = currentFilePos;
- qDebug("<<<<<<<<<<<%d current page is number %d, length %d, current %d, pageSize %d",
- currentFilePos, i_pageNum, Lview->length(), pageStopArray[i_pageNum], Lview->PageSize() );
+ odebug << "<<<<<<<<<<<" << currentFilePos << " current page is number " << i_pageNum
+ << ", length " << Lview->length() << ", current " << pageStopArray[i_pageNum]
+ << ", pageSize " << Lview->PageSize() << oendl;
Lview->setMaxLines(Lview->PageSize()*2);
odebug << "Gulped " << currentLine << "" << oendl;
setCaption(title);
Lview->setAutoUpdate( TRUE);
Lview->setCursorPosition(0,0,FALSE);
// pages = (int)(( Lview->numLines() / Lview->editSize() ) / 2 ) +1;
//odebug << "number of pages " << pages << "" << oendl;
loadCheck = true;
enableButtons(true);
if( donateMenu->count() == 3) {
donateMenu->insertItem("Current Title", this, SLOT( InfoBarClick() ));
}
Lview->setFocus();
// QCopEnvelope("QPE/System", "notBusy()" );
return true;
} // end load
void Gutenbrowser::Search() {
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
@@ -35,49 +35,49 @@ class BuffDoc
void putSaveData(unsigned char*& src, unsigned short& srclen)
{
if (exp != NULL)
{
exp->putSaveData(src, srclen);
}
}
#ifdef USEQPE
void suspend() { if (exp != NULL) exp->suspend(); }
void unsuspend() { if (exp != NULL) exp->unsuspend(); }
#else
void suspend() {}
void unsuspend() {}
#endif
~BuffDoc()
{
delete filt;
delete exp;
}
BuffDoc()
{
exp = NULL;
filt = NULL;
lastword.empty();
-// // qDebug("Buffdoc created");
+ // odebug << "Buffdoc created" << oendl;
}
bool empty() { return (exp == NULL); }
void setfilter(CFilterChain* _f)
{
if (filt != NULL) delete filt;
filt = _f;
filt->setsource(exp);
}
CList<Bkmk>* getbkmklist() { return exp->getbkmklist(); }
bool hasrandomaccess() { return (exp == NULL) ? false : exp->hasrandomaccess(); }
bool iseol() { return (lastword[0] == '\0'); }
int openfile(QWidget* _parent, const char *src);
tchar getch()
{
tchar ch = UEOF;
CStyle sty;
if (exp != NULL)
{
filt->getch(ch, sty);
}
return ch;
}
void getch(tchar& ch, CStyle& sty)
{
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
@@ -40,35 +40,35 @@ class Ccp1252 : public CEncoding
public:
void getch(tchar& ch, CStyle& sty);
};
class CPalm : public Ccp1252
{
public:
void getch(tchar& ch, CStyle& sty);
};
class CAscii : public CEncoding
{
public:
void getch(tchar& ch, CStyle& sty);
};
#include "CEncoding_tables.h"
class CGeneral8Bit : public CEncoding
{
int m_index;
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)
{
parent->getch(ch, sty);
ch = unicodetable::unicodevalue(m_index, ch);
}
};
#endif
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
@@ -5,47 +5,47 @@
class CFiledata
{
unsigned char* data;
bool m_own;
public:
CFiledata(tchar* d)
{
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;
}
~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)); }
time_t date() { return *((time_t *)data); }
void setdate(time_t _t) { *((time_t *)data) = _t; }
unsigned char* content() { return data; }
size_t length() const { return sizeof(time_t)+sizeof(tchar)*(ustrlen(name())+1); }
bool operator==(const CFiledata& rhs)
{
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);
}
};
#endif
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
@@ -83,69 +83,69 @@ class FontControl
}
int lineSpacing(const CStyle& ch)
{
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 (g_size-- == m_size)
{
if (--m_size < 0)
{
m_size = 0;
}
}
-// qDebug("Font:%d Graphics:%d", m_size, g_size);
+// 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 (g_size++ == m_size)
{
if (++m_size >= m_maxsize)
{
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)
{
return ChangeFont(n, currentsize());
}
bool ChangeFont(QString& n, int tgt);
void setlead(int _lead)
{
m_leading = _lead;
}
int getlead()
{
return m_leading;
}
void setextraspace(int _lead)
{
m_extraspace = _lead;
}
int getextraspace()
{
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,36 +1,43 @@
/* -*- 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>
#ifndef _WINDOWS
#include <unistd.h> /* for link */
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <stdarg.h>
-#include <qimage.h>
/***********************************************************************/
/***********************************************************************/
/***** *****/
/***** Code to decode the Palm image format to JPEG *****/
/***** *****/
/***********************************************************************/
/***********************************************************************/
#define READ_BIGENDIAN_SHORT(p) (((p)[0] << 8)|((p)[1]))
#define READ_BIGENDIAN_LONG(p) (((p)[0] << 24)|((p)[1] << 16)|((p)[2] << 8)|((p)[3]))
#define PALM_IS_COMPRESSED_FLAG 0x8000
#define PALM_HAS_COLORMAP_FLAG 0x4000
#define PALM_HAS_TRANSPARENCY_FLAG 0x2000
#define PALM_DIRECT_COLOR_FLAG 0x0400
#define PALM_4_BYTE_FIELD_FLAG 0x0200
#define PALM_COMPRESSION_SCANLINE 0x00
#define PALM_COMPRESSION_RLE 0x01
#define PALM_COMPRESSION_PACKBITS 0x02
#define PALM_COMPRESSION_NONE 0xFF
#define PALM_COLORMAP_SIZE 232
@@ -120,189 +127,193 @@ static ColorMapEntry Palm4BitColormap[] = {
QImage* Palm2QImage
(unsigned char *image_bytes_in, int byte_count_in)
{
unsigned int width, height, bytes_per_row, flags, next_depth_offset;
unsigned int bits_per_pixel, version, transparent_index, compression_type, i, j, inval, inbit, mask, incount;
unsigned int palm_red_bits, palm_green_bits, palm_blue_bits;
unsigned char *palm_ptr, *x_ptr, *imagedata, *inbyte, *rowbuf, *lastrow,
*imagedatastart, *palmimage;
ColorMapEntry *colormap;
palmimage = image_bytes_in;
width = READ_BIGENDIAN_SHORT(palmimage + 0);
height = READ_BIGENDIAN_SHORT(palmimage + 2);
bytes_per_row = READ_BIGENDIAN_SHORT(palmimage + 4);
flags = READ_BIGENDIAN_SHORT(palmimage + 6);
bits_per_pixel = palmimage[8];
version = palmimage[9];
next_depth_offset = READ_BIGENDIAN_SHORT(palmimage + 10);
transparent_index = palmimage[12];
compression_type = palmimage[13];
/* 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;
}
/* as of PalmOS 4.0, there are 6 different kinds of Palm pixmaps:
1, 2, or 4 bit grayscale
8-bit StaticColor using the Palm standard colormap
8-bit PseudoColor using a user-specified colormap
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.
*/
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;
imagedatastart = palmimage + 16;
} else if (bits_per_pixel == 2) {
colormap = Palm2BitColormap;
imagedatastart = palmimage + 16;
} else if (bits_per_pixel == 4) {
colormap = Palm4BitColormap;
imagedatastart = palmimage + 16;
} else if (bits_per_pixel == 8) {
colormap = Palm8BitColormap;
imagedatastart = palmimage + 16;
} else if (bits_per_pixel == 16 && (flags & PALM_DIRECT_COLOR_FLAG)) {
colormap = NULL;
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;
}
#ifndef USEQPE
QImage* qimage = new QImage(width, height, 32);
#else
QImage* qimage = new QImage(width, height, 16);
#endif
/* row by row, uncompress the Palm image and copy it to the JPEG buffer */
rowbuf = new unsigned char[bytes_per_row * width];
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)) {
for (j = 0; j < bytes_per_row; ) {
incount = *palm_ptr++;
inval = *palm_ptr++;
memset(rowbuf + j, inval, incount);
j += incount;
}
} else if ((flags & PALM_IS_COMPRESSED_FLAG) && (compression_type == PALM_COMPRESSION_SCANLINE)) {
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];
}
}
memcpy (lastrow, rowbuf, bytes_per_row);
} else if (((flags & PALM_IS_COMPRESSED_FLAG) &&
(compression_type == PALM_COMPRESSION_NONE)) ||
((flags & PALM_IS_COMPRESSED_FLAG) == 0))
{
memcpy (rowbuf, palm_ptr, bytes_per_row);
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;
}
/* next, write it to the GDK bitmap */
if (colormap) {
mask = (1 << bits_per_pixel) - 1;
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);
qimage->setPixel(j, i, colour);
if (!inbit) {
++inbyte;
inbit = 8 - bits_per_pixel;
} else {
inbit -= bits_per_pixel;
}
}
} else if (!colormap &&
bits_per_pixel == 16) {
for (inbyte = rowbuf, j = 0; j < width; ++j) {
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),
((inval >> palm_blue_bits) & ((1 << palm_green_bits) - 1)) << (8-palm_green_bits),
((inval >> 0) & ((1 << palm_blue_bits) - 1)) << (8-palm_blue_bits));
qimage->setPixel(j, i, colour);
inbyte += 2;
}
}
}
delete [] rowbuf;
delete [] lastrow;
return qimage;
}
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());
delete qimage;
return ret;
}
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
@@ -115,65 +115,65 @@ public:
m_fontControl.setextraspace(_lead);
}
int getextraspace()
{
return m_fontControl.getextraspace();
}
void setpagemode(bool _b)
{
m_bpagemode = _b;
}
void setmono(bool _b)
{
m_bMonoSpaced = _b;
ChangeFont(m_fontControl.currentsize());
locate(pagelocate());
}
void setencoding(int _f)
{
m_encd = _f;
setfilter(getfilter());
}
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);
}
}
CFilterChain* getfilter()
{
CFilterChain * filt = new CFilterChain(getencoding());
if (bstripcr) filt->addfilter(new stripcr);
if (btextfmt || (bautofmt && (PreferredMarkup() == cTEXT))) filt->addfilter(new textfmt);
if (bpeanut || (bautofmt && (PreferredMarkup() == cPML))) filt->addfilter(new PeanutFormatter);
if (bstriphtml || (bautofmt && (PreferredMarkup() == cHTML))) filt->addfilter(new striphtml);
if (bdehyphen) filt->addfilter(new dehyphen);
if (bunindent) filt->addfilter(new unindent);
if (brepara) filt->addfilter(new repara);
if (bonespace) filt->addfilter(new OnePara);
if (bindenter) filt->addfilter(new indenter(bindenter));
if (bdblspce) filt->addfilter(new dblspce);
#ifdef REPALM
if (brepalm) filt->addfilter(new repalm);
#endif
if (bremap) filt->addfilter(new remap);
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
@@ -378,50 +378,50 @@ private slots:
bool dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg);
#endif
QWidgetStack *editorStack;
QTReader* reader;
QComboBox* m_fontSelector;
// QToolBar /* *menu,*/ *fileBar;
QToolBar *menubar, *fileBar, *navBar, *viewBar, *markBar;
#ifdef USEQPE
QMenuBar *mb;
#else
QMenuBar *mb;
#endif
QFloatBar *searchBar, *regBar/*, *m_fontBar*/;
QToolBar /* *searchBar, *regBar,*/ *m_fontBar;
QLineEdit *searchEdit, *regEdit;
bool searchVisible;
bool regVisible;
bool m_fontVisible, m_twoTouch;
bool bFromDocView;
static unsigned long m_uid;
long unsigned get_unique_id() { return m_uid++; }
/*
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 );
}
*/
CList<Bkmk>* pBkmklist;
CList<Bkmk>* pOpenlist;
infowin* m_infoWin;
GraphicWin* m_graphicwin;
QProgressBar* pbar;
bool m_fBkmksChanged;
// int m_nRegAction;
regedit_type m_nRegAction;
bkmk_action m_nBkmkAction;
QString m_autogenstr;
bool m_dontSave;
};
//const int cAutoGen = 0;
//const int cAddBkmk = 1;
//const int cDelBkmk = 2;
//const int cGotoBkmk = 3;
//const int cRmBkmkFile = 4;
//const int cJump = 5;
//const int cMonoSpace = 6;
//const int cOverlap = 7;
diff --git a/noncore/apps/tinykate/libkate/document/katedocument.h b/noncore/apps/tinykate/libkate/document/katedocument.h
index 9d8ec6a..969be87 100644
--- a/noncore/apps/tinykate/libkate/document/katedocument.h
+++ b/noncore/apps/tinykate/libkate/document/katedocument.h
@@ -55,49 +55,49 @@
#include "katebuffer.h"
#include "katetextline.h"
#include <qptrdict.h>
class KateCmd;
class CachedFontMetrics : public QFontMetrics {
private:
short *warray[256];
public:
CachedFontMetrics(const QFont& f) : QFontMetrics(f) {
for (int i=0; i<256; i++) warray[i]=0;
}
~CachedFontMetrics() {
for (int i=0; i<256; i++)
if (warray[i]) delete[] warray[i];
}
int width(QChar c) {
uchar cell=c.cell();
uchar row=c.row();
short *wa=warray[row];
if (!wa) {
- // qDebug("create row: %d",row);
+ // odebug << "create row: " << row << oendl;
wa=warray[row]=new short[256];
for (int i=0; i<256; i++) wa[i]=-1;
}
if (wa[cell]<0) wa[cell]=(short) QFontMetrics::width(c);
return (int)wa[cell];
}
int width(QString s) { return QFontMetrics::width(s); }
};
class Attribute {
public:
Attribute() { ; };
QColor col;
QColor selCol;
bool bold;
bool italic;
};
class KateAction {
public:
enum Action {replace, wordWrap, wordUnWrap, newLine, delLine,
insLine, killLine};//, doubleLine, removeLine};
diff --git a/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp b/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp
index a2c680f..78635b2 100644
--- a/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp
+++ b/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp
@@ -17,62 +17,68 @@
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#if QT_VERSION >=300
#error QRegExp3 is now in QT 3 use QRegExp instead
#endif
-#include "qarray.h"
-#include "qbitarray.h"
-#include "qcache.h"
-#include "qintdict.h"
-#include "qmap.h"
#if QT_VERSION < 300
#include "./qregexp3.h"
#else
#include "qregexp.h"
#endif
-#include "qstring.h"
-#include "qtl.h"
-#include "qvector.h"
+/* OPIE */
+#include <opie2/odebug.h>
+
+/* QT */
+#include <qarray.h>
+#include <qbitarray.h>
+#include <qcache.h>
+#include <qintdict.h>
+#include <qmap.h>
+#include <qstring.h>
+#include <qtl.h>
+#include <qvector.h>
+
+/* STD */
#include <limits.h>
/*
WARNING! Be sure to read qregexp.tex before modifying this file.
*/
/*!
\class QRegExp3 qregexp.h
\brief The QRegExp class provides pattern matching using regular expressions.
\ingroup tools
\ingroup misc
\ingroup shared
Regular expressions, "regexps", provide a way to find patterns
within text. This is useful in many contexts, for example:
<ol>
<li>\e Validation. A regexp can be used to check whether a piece of
text meets some criteria, e.g. is an integer or contains no
whitespace.
<li>\e Searching. Regexps provide a much more powerful means of
@@ -1410,92 +1416,92 @@ void QRegExpEngine::heuristicallyChooseHeuristic()
( goodLateStart - goodEarlyStart );
/*
Less magic formula: We pick a couple of characters at random, and check
whether they are good or bad.
*/
int badCharScore = 0;
int step = QMAX( 1, NumBadChars / 32 );
for ( i = 1; i < NumBadChars; i += step ) {
if ( occ1[i] == NoOccurrence )
badCharScore += minl;
else
badCharScore += occ1[i];
}
badCharScore /= minl;
useGoodStringHeuristic = ( goodStringScore > badCharScore );
}
#endif
#if defined(QT_DEBUG)
void QRegExpEngine::dump() const
{
int i, j;
- qDebug( "Case %ssensitive engine", cs ? "" : "in" );
- qDebug( " States" );
+ odebug << "Case " << (cs ? "" : "in") << "sensitive engine" << oendl;
+ odebug << " States" << oendl;
for ( i = 0; i < ns; i++ ) {
- qDebug( " %d%s", i,
- i == InitialState ? " (initial)" :
- i == FinalState ? " (final)" : "" );
+ odebug << " " << i
+ << (i == InitialState ? " (initial)" : i == FinalState ? " (final)" : "") << oendl;
+
#ifndef QT_NO_REGEXP_CAPTURE
- qDebug( " in atom %d", s[i]->atom );
+ odebug << " in atom " << s[i]->atom << oendl;
#endif
int m = s[i]->match;
if ( (m & CharClassBit) != 0 ) {
- qDebug( " match character class %d", m ^ CharClassBit );
+ odebug << " match character class " << (m ^ CharClassBit) << oendl;
#ifndef QT_NO_REGEXP_CCLASS
cl[m ^ CharClassBit]->dump();
#else
- qDebug( " negative character class" );
+ odebug << " negative character class" << oendl;
#endif
} else if ( (m & BackRefBit) != 0 ) {
- qDebug( " match back-reference %d", m ^ BackRefBit );
+ odebug << " match back-reference " << (m ^ BackRefBit) << oendl;
} else if ( m >= 0x20 && m <= 0x7e ) {
- qDebug( " match 0x%.4x (%c)", m, m );
+ odebug << " match " << QString().sprintf( "0x%.4x", m) << " (" << m << ")" << oendl;
+
} else {
- qDebug( " match 0x%.4x", m );
+ odebug << " match " << QString().sprintf( "0x%.4x", m) << oendl;
}
for ( j = 0; j < (int) s[i]->outs.size(); j++ ) {
int next = s[i]->outs[j];
- qDebug( " -> %d", next );
+ odebug << " -> " << next << oendl;
if ( s[i]->reenter != 0 && s[i]->reenter->contains(next) )
- qDebug( " [reenter %d]", (*s[i]->reenter)[next] );
+ odebug << " [reenter " << (*s[i]->reenter)[next] << "]" << oendl;
if ( s[i]->anchors != 0 && at(*s[i]->anchors, next) != 0 )
- qDebug( " [anchors 0x%.8x]", (*s[i]->anchors)[next] );
+ odebug << " [anchors " << QString().sprintf( "0x%.8x]", (*s[i]->anchors)[next] ) << oendl;
}
}
#ifndef QT_NO_REGEXP_CAPTURE
if ( nf > 0 ) {
- qDebug( " Atom Parent Capture" );
+ odebug << " Atom Parent Capture" << oendl;
for ( i = 0; i < nf; i++ )
- qDebug( " %6d %6d %6d", i, f[i].parent, f[i].capture );
+ odebug << QString().sprintf(" %6d %6d %6d", i, f[i].parent, f[i].capture ) << oendl;
}
#endif
#ifndef QT_NO_REGEXP_ANCHOR_ALT
for ( i = 0; i < (int) aa.size(); i++ )
- qDebug( " Anchor alternation 0x%.8x: 0x%.8x 0x%.9x", i, aa[i].a,
- aa[i].b );
+ odebug << QString().sprintf(" Anchor alternation 0x%.8x: 0x%.8x 0x%.9x", i, aa[i].a, aa[i].b ) << oendl;
#endif
}
#endif
void QRegExpEngine::setup( bool caseSensitive )
{
#ifndef QT_NO_REGEXP_OPTIM
if ( engCount++ == 0 ) {
noOccurrences = new QArray<int>( NumBadChars );
firstOccurrenceAtZero = new QArray<int>( NumBadChars );
noOccurrences->fill( NoOccurrence );
firstOccurrenceAtZero->fill( 0 );
}
#endif
s.setAutoDelete( TRUE );
s.resize( 32 );
ns = 0;
#ifndef QT_NO_REGEXP_CAPTURE
f.resize( 32 );
nf = 0;
cf = -1;
#endif
realncap = 0;
ncap = 0;
@@ -2175,55 +2181,55 @@ void QRegExpEngine::CharClass::addRange( ushort from, ushort to )
}
#endif
}
bool QRegExpEngine::CharClass::in( QChar ch ) const
{
#ifndef QT_NO_REGEXP_OPTIM
if ( occ1[BadChar(ch)] == NoOccurrence )
return n;
#endif
if ( c != 0 && (c & (1 << (int) ch.category())) != 0 )
return !n;
for ( int i = 0; i < (int) r.size(); i++ ) {
if ( ch.unicode() >= r[i].from && ch.unicode() <= r[i].to )
return !n;
}
return n;
}
#if defined(QT_DEBUG)
void QRegExpEngine::CharClass::dump() const
{
int i;
- qDebug( " %stive character class", n ? "nega" : "posi" );
+ odebug << " " << (n ? "nega" : "posi") << "tive character class" << oendl;
#ifndef QT_NO_REGEXP_CCLASS
if ( c != 0 )
- qDebug( " categories 0x%.8x", c );
+ odebug << QString().sprintf(" categories 0x%.8x", c ) << oendl;
#endif
for ( i = 0; i < (int) r.size(); i++ )
- qDebug( " 0x%.4x through 0x%.4x", r[i].from, r[i].to );
+ odebug << QString().sprintf(" 0x%.4x through 0x%.4x", r[i].from, r[i].to ) << oendl;
}
#endif
#endif
QRegExpEngine::Box::Box( QRegExpEngine *engine )
: eng( engine ), skipanchors( 0 )
#ifndef QT_NO_REGEXP_OPTIM
, earlyStart( 0 ), lateStart( 0 ), maxl( 0 ), occ1( *noOccurrences )
#endif
{
minl = 0;
}
QRegExpEngine::Box& QRegExpEngine::Box::operator=( const Box& b )
{
eng = b.eng;
ls = b.ls;
rs = b.rs;
lanchors = b.lanchors;
ranchors = b.ranchors;
skipanchors = b.skipanchors;
#ifndef QT_NO_REGEXP_OPTIM
earlyStart = b.earlyStart;
lateStart = b.lateStart;
@@ -2425,64 +2431,64 @@ void QRegExpEngine::Box::setupHeuristics()
/*
A regular expression such as 112|1 has occ1['2'] = 2 and minl = 1 at this
point. An entry of occ1 has to be at most minl or infinity for the rest
of the algorithm to go well.
We waited until here before normalizing these cases (instead of doing it
in Box::orx()) because sometimes things improve by themselves; consider
(112|1)34.
*/
for ( int i = 0; i < NumBadChars; i++ ) {
if ( occ1[i] != NoOccurrence && occ1[i] >= minl )
occ1[i] = minl;
}
eng->setupBadCharHeuristic( minl, occ1 );
eng->heuristicallyChooseHeuristic();
}
#endif
#if defined(QT_DEBUG)
void QRegExpEngine::Box::dump() const
{
int i;
- qDebug( "Box of at least %d character%s", minl, minl == 1 ? "" : "s" );
- qDebug( " Left states:" );
+ odebug << "Box of at least " << minl << " character" << (minl == 1 ? "" : "s") << oendl;
+ odebug << " Left states:" << oendl;
for ( i = 0; i < (int) ls.size(); i++ ) {
if ( at(lanchors, ls[i]) == 0 )
- qDebug( " %d", ls[i] );
+ odebug << " " << ls[i] << oendl;
else
- qDebug( " %d [anchors 0x%.8x]", ls[i], lanchors[ls[i]] );
+ odebug << " " << ls[i] << QString().sprintf(" [anchors 0x%.8x]", lanchors[ls[i]]) << oendl;
}
- qDebug( " Right states:" );
+ odebug << " Right states:" << oendl;
for ( i = 0; i < (int) rs.size(); i++ ) {
if ( at(ranchors, ls[i]) == 0 )
- qDebug( " %d", rs[i] );
+ odebug << " " << rs[i] << oendl;
else
- qDebug( " %d [anchors 0x%.8x]", rs[i], ranchors[rs[i]] );
+ odebug << " " << rs[i] << QString().sprintf(" [anchors 0x%.8x]", ranchors[rs[i]]) << oendl;
}
- qDebug( " Skip anchors: 0x%.8x", skipanchors );
+ odebug << QString().sprintf(" Skip anchors: 0x%.8x", skipanchors) << oendl;
}
#endif
void QRegExpEngine::Box::addAnchorsToEngine( const Box& to ) const
{
for ( int i = 0; i < (int) to.ls.size(); i++ ) {
for ( int j = 0; j < (int) rs.size(); j++ ) {
int a = eng->anchorConcatenation( at(ranchors, rs[j]),
at(to.lanchors, to.ls[i]) );
eng->addAnchors( rs[j], to.ls[i], a );
}
}
}
int QRegExpEngine::getChar()
{
return ( yyPos == yyLen ) ? EOS : yyIn[yyPos++].unicode();
}
int QRegExpEngine::getEscape()
{
#ifndef QT_NO_REGEXP_ESCAPE
const char tab[] = "afnrtv"; // no b, as \b means word boundary
const char backTab[] = "\a\f\n\r\t\v";