summaryrefslogtreecommitdiffstats
path: root/kpacman
diff options
context:
space:
mode:
authorgregory guy <gregory-tde@laposte.net>2020-08-17 20:03:11 +0200
committergregory guy <gregory-tde@laposte.net>2020-08-17 20:03:11 +0200
commit503fddb48f2229ecc6ed6930a99c4d740ff979e5 (patch)
tree81206d9572927fd636b43a00005808cec6c0ce3e /kpacman
parente0031ac458d4f414ae583a709d48c4cb0f14b09e (diff)
downloadtdepacman-503fddb48f2229ecc6ed6930a99c4d740ff979e5.tar.gz
tdepacman-503fddb48f2229ecc6ed6930a99c4d740ff979e5.zip
Second step, convert to tqt3 libraries.
Signed-off-by: gregory guy <gregory-tde@laposte.net>
Diffstat (limited to 'kpacman')
-rw-r--r--kpacman/bitfont.cpp14
-rw-r--r--kpacman/bitfont.h16
-rw-r--r--kpacman/board.cpp34
-rw-r--r--kpacman/board.h16
-rw-r--r--kpacman/colors.h28
-rw-r--r--kpacman/keys.cpp68
-rw-r--r--kpacman/keys.h20
-rw-r--r--kpacman/kpacman.cpp30
-rw-r--r--kpacman/kpacman.h20
-rw-r--r--kpacman/kpacmanview.cpp22
-rw-r--r--kpacman/kpacmanview.h16
-rw-r--r--kpacman/monster.h4
-rw-r--r--kpacman/pacman.h4
-rw-r--r--kpacman/painter.cpp174
-rw-r--r--kpacman/painter.h156
-rw-r--r--kpacman/referee.cpp152
-rw-r--r--kpacman/referee.h88
-rw-r--r--kpacman/score.cpp126
-rw-r--r--kpacman/score.h50
-rw-r--r--kpacman/status.cpp70
-rw-r--r--kpacman/status.h50
21 files changed, 579 insertions, 579 deletions
diff --git a/kpacman/bitfont.cpp b/kpacman/bitfont.cpp
index 40581c8..91b4baa 100644
--- a/kpacman/bitfont.cpp
+++ b/kpacman/bitfont.cpp
@@ -1,6 +1,6 @@
#include "bitfont.h"
-Bitfont::Bitfont(QString fontname, uchar firstChar, uchar lastChar)
+Bitfont::Bitfont(TQString fontname, uchar firstChar, uchar lastChar)
{
if (!fontname.isEmpty())
font.load(fontname);
@@ -16,15 +16,15 @@ Bitfont::Bitfont(QString fontname, uchar firstChar, uchar lastChar)
}
}
-QRect Bitfont::rect(QString str)
+TQRect Bitfont::rect(TQString str)
{
- return QRect(0, 0, str.length()*fontWidth, fontHeight);
+ return TQRect(0, 0, str.length()*fontWidth, fontHeight);
}
-QPixmap Bitfont::text(QString str, QColor fg, QColor bg)
+TQPixmap Bitfont::text(TQString str, TQColor fg, TQColor bg)
{
- QPixmap FG(str.length()*fontWidth, fontHeight);
- QBitmap MASK(str.length()*fontWidth, fontHeight, TRUE);
+ TQPixmap FG(str.length()*fontWidth, fontHeight);
+ TQBitmap MASK(str.length()*fontWidth, fontHeight, TRUE);
const uchar *s = (const uchar *) str.data();
for (uint i = 0; i < str.length(); i++) {
@@ -42,7 +42,7 @@ QPixmap Bitfont::text(QString str, QColor fg, QColor bg)
FG.setMask(MASK);
if (bg.isValid()) {
- QPixmap BG(str.length()*fontWidth, fontHeight);
+ TQPixmap BG(str.length()*fontWidth, fontHeight);
BG.fill(bg);
bitBlt(&BG, 0, 0, &FG);
return BG;
diff --git a/kpacman/bitfont.h b/kpacman/bitfont.h
index c12aa0f..5976a51 100644
--- a/kpacman/bitfont.h
+++ b/kpacman/bitfont.h
@@ -1,26 +1,26 @@
#ifndef BITFONT_H
#define BITFONT_H
-#include <qstring.h>
-#include <qbitmap.h>
-#include <qpixmap.h>
-#include <qrect.h>
+#include <ntqstring.h>
+#include <ntqbitmap.h>
+#include <ntqpixmap.h>
+#include <ntqrect.h>
#include "colors.h"
class Bitfont
{
public:
- Bitfont(QString fontname, uchar firstChar, uchar lastChar);
+ Bitfont(TQString fontname, uchar firstChar, uchar lastChar);
- QPixmap text(QString str, QColor fg = BLACK, QColor bg = QColor());
- QRect rect(QString str);
+ TQPixmap text(TQString str, TQColor fg = BLACK, TQColor bg = TQColor());
+ TQRect rect(TQString str);
int width();
int height();
uchar firstChar();
uchar lastChar();
private:
- QBitmap font;
+ TQBitmap font;
int fontWidth;
int fontHeight;
uchar fontFirstChar;
diff --git a/kpacman/board.cpp b/kpacman/board.cpp
index 5a30994..1f98f7f 100644
--- a/kpacman/board.cpp
+++ b/kpacman/board.cpp
@@ -1,16 +1,16 @@
#include <kapp.h>
#include <klocale.h>
-#include <qrect.h>
-#include <qregexp.h>
-#include <qmessagebox.h>
-#include <qfile.h>
-#include <qtextstream.h>
+#include <ntqrect.h>
+#include <ntqregexp.h>
+#include <ntqmessagebox.h>
+#include <ntqfile.h>
+#include <ntqtextstream.h>
#include "board.h"
#include "bitmaps.h"
-Board::Board(int size) : QArray<int> (size)
+Board::Board(int size) : TQArray<int> (size)
{
sz = size; // set size of board
@@ -20,7 +20,7 @@ Board::Board(int size) : QArray<int> (size)
init(None); // initialize varibales
}
-void Board::init(Image image, QString levelName)
+void Board::init(Image image, TQString levelName)
{
prisonEntry = OUT;
prisonExit = OUT;
@@ -49,28 +49,28 @@ void Board::init(Image image, QString levelName)
if (mapName == levelName)
image = File;
else {
- QFile levelFile(levelName);
+ TQFile levelFile(levelName);
if (!levelFile.open(IO_ReadOnly)) {
- QString msg = i18n("The levelmap could not be constructed.\n\n"
+ TQString msg = i18n("The levelmap could not be constructed.\n\n"
"The file '@LEVELNAME@' does not exist,\n"
"or could not be opened for reading.");
- msg.replace(QRegExp("@LEVELNAME@"), levelName);
- // QMessageBox::information(0, i18n("Initialization Error"), msg);
+ msg.replace(TQRegExp("@LEVELNAME@"), levelName);
+ // TQMessageBox::information(0, i18n("Initialization Error"), msg);
printf("%s\n", msg.data());
} else {
map.fill(' ', BoardHeight*BoardWidth);
int height = 0;
- QTextStream levelStream(&levelFile);
+ TQTextStream levelStream(&levelFile);
while (!levelStream.eof() && height < BoardHeight) {
- QString line = levelStream.readLine();
+ TQString line = levelStream.readLine();
- if (line.find(QRegExp("^ *;")) == -1) {
+ if (line.find(TQRegExp("^ *;")) == -1) {
- line.replace(QRegExp(";.*"), ""); // strip off comments
- line.replace(QRegExp("\" *$"), ""); // strip off trailing "
- line.replace(QRegExp("^ *\""), ""); // strip off leading "
+ line.replace(TQRegExp(";.*"), ""); // strip off comments
+ line.replace(TQRegExp("\" *$"), ""); // strip off trailing "
+ line.replace(TQRegExp("^ *\""), ""); // strip off leading "
map.replace(height*BoardWidth,
(line.length() > BoardWidth) ? BoardWidth : line.length(),
diff --git a/kpacman/board.h b/kpacman/board.h
index fffde95..061cbd8 100644
--- a/kpacman/board.h
+++ b/kpacman/board.h
@@ -1,10 +1,10 @@
#ifndef BOARD_H
#define BOARD_H
-#include <qarray.h>
-#include <qstring.h>
-#include <qlist.h>
-#include <qrect.h>
+#include <ntqarray.h>
+#include <ntqstring.h>
+#include <ntqlist.h>
+#include <ntqrect.h>
#define OUT -1
@@ -37,12 +37,12 @@ enum Image { None, Intro, Demo, Level, File };
#define pacmanBit 0x0040
#define monsterBit 0x0100
-class Board : public QArray<int>
+class Board : public TQArray<int>
{
public:
Board (int size);
~Board() {};
- void init(Image image, QString levelName=0);
+ void init(Image image, TQString levelName=0);
void setup(const uchar *buf);
void set(int pos, Square sq, int m = 0);
@@ -78,8 +78,8 @@ private:
bool inBounds(int pos);
int sz; // size of board
- QString map;
- QString mapName; // Filename of the latest loaded map
+ TQString map;
+ TQString mapName; // Filename of the latest loaded map
int prisonEntry; // position of prisonentry
int prisonExit; // position of prisonexit
diff --git a/kpacman/colors.h b/kpacman/colors.h
index 6abf385..dd32b18 100644
--- a/kpacman/colors.h
+++ b/kpacman/colors.h
@@ -1,21 +1,21 @@
#ifndef COLORS_H
#define COLORS_H
-#include <qcolor.h>
+#include <ntqcolor.h>
-#define BLACK QColor(Qt::black)
-#define RED QColor(Qt::red)
-#define BROWN QColor(0xde, 0x95, 0x41)
-#define PINK QColor(0xff, 0xba, 0xde)
-#define CYAN QColor(0x00, 0xff, 0xde)
-#define LIGHTBLUE QColor(0x41, 0xba, 0xde)
-#define ORANGE QColor(0xff, 0xba, 0x41)
-#define YELLOW QColor(Qt::yellow)
-#define BLUE QColor(0x20, 0x20, 0xde)
-#define GREEN QColor(Qt::green)
-#define LIGHTGREEN QColor(0x41, 0xba, 0x94)
-#define FLESH QColor(0xff, 0xba, 0x94)
-#define WHITE QColor(0xd8, 0xdc, 0xd8)
+#define BLACK TQColor(TQt::black)
+#define RED TQColor(TQt::red)
+#define BROWN TQColor(0xde, 0x95, 0x41)
+#define PINK TQColor(0xff, 0xba, 0xde)
+#define CYAN TQColor(0x00, 0xff, 0xde)
+#define LIGHTBLUE TQColor(0x41, 0xba, 0xde)
+#define ORANGE TQColor(0xff, 0xba, 0x41)
+#define YELLOW TQColor(TQt::yellow)
+#define BLUE TQColor(0x20, 0x20, 0xde)
+#define GREEN TQColor(TQt::green)
+#define LIGHTGREEN TQColor(0x41, 0xba, 0x94)
+#define FLESH TQColor(0xff, 0xba, 0x94)
+#define WHITE TQColor(0xd8, 0xdc, 0xd8)
#endif // COLORS_H
diff --git a/kpacman/keys.cpp b/kpacman/keys.cpp
index a3c2c81..8dc5648 100644
--- a/kpacman/keys.cpp
+++ b/kpacman/keys.cpp
@@ -6,42 +6,42 @@
#include <keys.h>
#include <kaccel.h>
-#include <qpushbt.h>
-#include <qlabel.h>
-#include <qframe.h>
-#include <qkeycode.h>
-#include <qpixmap.h>
-#include <qstring.h>
-
-Keys::Keys( QWidget *parent, const char *name)
- : QDialog( parent, name, TRUE )
+#include <ntqpushbt.h>
+#include <ntqlabel.h>
+#include <ntqframe.h>
+#include <ntqkeycode.h>
+#include <ntqpixmap.h>
+#include <ntqstring.h>
+
+Keys::Keys( TQWidget *parent, const char *name)
+ : TQDialog( parent, name, TRUE )
{
KStandardDirs *dirs = KGlobal::dirs();
- QPushButton *okButton = new QPushButton(this);
+ TQPushButton *okButton = new TQPushButton(this);
okButton->setText(i18n("Ok"));
okButton->setFixedSize(okButton->size());
connect( okButton, SIGNAL(clicked()),this, SLOT(ok()) );
okButton->move(20,210);
- QPushButton *defaultButton = new QPushButton(this);
+ TQPushButton *defaultButton = new TQPushButton(this);
defaultButton->setText(i18n("Defaults"));
defaultButton->setFixedSize(defaultButton->size());
connect( defaultButton, SIGNAL(clicked()),this, SLOT(defaults()) );
defaultButton->move(140,210);
- QPushButton *cancelButton = new QPushButton(this);
+ TQPushButton *cancelButton = new TQPushButton(this);
cancelButton->setText(i18n("Cancel"));
cancelButton->setFixedSize(cancelButton->size());
connect( cancelButton, SIGNAL(clicked()),this, SLOT(reject()) );
cancelButton->move(260,210);
- QFrame *separator = new QFrame(this);
- separator->setFrameStyle( QFrame::HLine | QFrame::Sunken );
+ TQFrame *separator = new TQFrame(this);
+ separator->setFrameStyle( TQFrame::HLine | TQFrame::Sunken );
separator->setGeometry( 20, 190, 340, 4 );
for ( int x = 0; x < 4; x++) {
- QLabel *l = new QLabel(this);
+ TQLabel *l = new TQLabel(this);
l->setAlignment(AlignCenter);
labels[x] = l;
}
@@ -51,32 +51,32 @@ Keys::Keys( QWidget *parent, const char *name)
labels[2]->setGeometry( 20, 92, 100, 20 );
labels[3]->setGeometry(265, 92, 100, 20 );
- QString pixPath;
+ TQString pixPath;
- QPushButton *up = new QPushButton(this);
+ TQPushButton *up = new TQPushButton(this);
pixPath = dirs->findResource("appdata", "pics/up.xpm");
- up->setPixmap( QPixmap(pixPath));
+ up->setPixmap( TQPixmap(pixPath));
up->setFixedSize(up->pixmap()->size());
connect( up, SIGNAL(clicked()),this, SLOT(butUp()) );
up->move(180, 50);
- QPushButton *down = new QPushButton(this);
+ TQPushButton *down = new TQPushButton(this);
pixPath = dirs->findResource("appdata", "pics/down.xpm");
- down->setPixmap( QPixmap(pixPath));
+ down->setPixmap( TQPixmap(pixPath));
down->setFixedSize(down->pixmap()->size());
connect( down, SIGNAL(clicked()),this, SLOT(butDown()) );
down->move(180, 130);
- QPushButton *left = new QPushButton(this);
+ TQPushButton *left = new TQPushButton(this);
pixPath = dirs->findResource("appdata", "pics/left.xpm");
- left->setPixmap( QPixmap(pixPath));
+ left->setPixmap( TQPixmap(pixPath));
left->setFixedSize(left->pixmap()->size());
connect( left, SIGNAL(clicked()),this, SLOT(butLeft()) );
left->move(140, 90);
- QPushButton *right = new QPushButton(this);
+ TQPushButton *right = new TQPushButton(this);
pixPath = dirs->findResource("appdata", "pics/right.xpm");
- right->setPixmap( QPixmap(pixPath));
+ right->setPixmap( TQPixmap(pixPath));
right->setFixedSize(right->pixmap()->size());
connect( right, SIGNAL(clicked()),this, SLOT(butRight()) );
right->move(220, 90);
@@ -88,10 +88,10 @@ Keys::Keys( QWidget *parent, const char *name)
init();
}
-void Keys::keyPressEvent( QKeyEvent *e )
+void Keys::keyPressEvent( TQKeyEvent *e )
{
uint kCode = e->key() & ~(SHIFT | CTRL | ALT);
- QString string = KAccel::keyToString(kCode);
+ TQString string = KAccel::keyToString(kCode);
if (lab != 0) {
if ( string.isNull() )
@@ -131,17 +131,17 @@ void Keys::getKey(int i)
focusIn(labels[i]);
}
-void Keys::focusOut(QLabel *l)
+void Keys::focusOut(TQLabel *l)
{
- l->setFrameStyle( QFrame::NoFrame );
+ l->setFrameStyle( TQFrame::NoFrame );
l->setBackgroundColor(backgroundColor());
l->repaint();
}
-void Keys::focusIn(QLabel *l)
+void Keys::focusIn(TQLabel *l)
{
lab = l;
- lab->setFrameStyle( QFrame::Panel | QFrame::Sunken );
+ lab->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
lab->setBackgroundColor(white);
lab->repaint();
}
@@ -161,19 +161,19 @@ void Keys::defaults()
void Keys::init()
{
- QString up("Up");
+ TQString up("Up");
up = kapp->config()->readEntry("upKey", (const char*) up);
labels[0]->setText(up);
- QString down("Down");
+ TQString down("Down");
down = kapp->config()->readEntry("downKey", (const char*) down);
labels[1]->setText(down);
- QString left("Left");
+ TQString left("Left");
left = kapp->config()->readEntry("leftKey", (const char*) left);
labels[2]->setText(left);
- QString right("Right");
+ TQString right("Right");
right = kapp->config()->readEntry("rightKey", (const char*) right);
labels[3]->setText(right);
}
diff --git a/kpacman/keys.h b/kpacman/keys.h
index 955afea..ca27d99 100644
--- a/kpacman/keys.h
+++ b/kpacman/keys.h
@@ -7,17 +7,17 @@
#include <kapp.h>
-#include <qdialog.h>
-#include <qlabel.h>
-#include <qstring.h>
+#include <ntqdialog.h>
+#include <ntqlabel.h>
+#include <ntqstring.h>
#include <kaccel.h>
-class Keys : public QDialog
+class Keys : public TQDialog
{
Q_OBJECT
public:
- Keys( QWidget *parent=0, const char *name=0 );
+ Keys( TQWidget *parent=0, const char *name=0 );
private slots:
void butRight();
@@ -27,19 +27,19 @@ private slots:
void getKey(int);
void defaults();
- void focusIn(QLabel *);
- void focusOut(QLabel *);
+ void focusIn(TQLabel *);
+ void focusOut(TQLabel *);
void ok();
protected:
- void keyPressEvent( QKeyEvent * );
+ void keyPressEvent( TQKeyEvent * );
private:
void init();
- QLabel *labels[4];
- QLabel *lab;
+ TQLabel *labels[4];
+ TQLabel *lab;
};
#endif // KEYS_H
diff --git a/kpacman/kpacman.cpp b/kpacman/kpacman.cpp
index 5479861..7ee12c3 100644
--- a/kpacman/kpacman.cpp
+++ b/kpacman/kpacman.cpp
@@ -15,11 +15,11 @@
* *
***************************************************************************/
-// include files for Qt
-#include <qkeycode.h>
-#include <qcolor.h>
-#include <qstring.h>
-#include <qmsgbox.h>
+// include files for TQt
+#include <ntqkeycode.h>
+#include <ntqcolor.h>
+#include <ntqstring.h>
+#include <ntqmsgbox.h>
// include files for KDE
#include <kcolordlg.h>
@@ -32,7 +32,7 @@
#define ID_STATUS_MSG 1
-KpacmanApp::KpacmanApp(QWidget *, const char *name) : KMainWindow(0, name)
+KpacmanApp::KpacmanApp(TQWidget *, const char *name) : KMainWindow(0, name)
{
config=kapp->config();
@@ -171,7 +171,7 @@ void KpacmanApp::readOptions()
toolBarPos = (KToolBar::BarPosition) config->readNumEntry("ToolBarPos", KToolBar::Top);
toolBar("mainToolBar")->setBarPos(toolBarPos);
- QSize size = config->readSizeEntry("Geometry");
+ TQSize size = config->readSizeEntry("Geometry");
if (!size.isEmpty())
{
resize(size);
@@ -185,9 +185,9 @@ void KpacmanApp::readOptions()
void KpacmanApp::readSchemes()
{
- QString saveGroup = config->group();
- QString group;
- QString description;
+ TQString saveGroup = config->group();
+ TQString group;
+ TQString description;
int modeCount = config->readNumEntry("ModeCount", -1);
int schemeCount = config->readNumEntry("SchemeCount");
@@ -196,20 +196,20 @@ void KpacmanApp::readSchemes()
schemeID.resize(schemeCount);
schemeMode.resize(schemeCount);
- schemesPopup = new QList<KPopupMenu>;
+ schemesPopup = new TQList<KPopupMenu>;
schemesPopup->setAutoDelete(true);
modesPopup = selectGraphicScheme->popupMenu();
connect(modesPopup, SIGNAL(activated(int)), this, SLOT(slotSchemeActivated(int)));
if (schemeCount == 0 || scheme == -1) {
- QMessageBox::warning(this, i18n("Configuration Error"),
+ TQMessageBox::warning(this, i18n("Configuration Error"),
i18n("There are no schemes defined,\n"
"or no scheme is selected."));
return;
}
- // create submenus (QPopupMenu) for graphic-modes
+ // create submenus (TQPopupMenu) for graphic-modes
for (int m = 0; m < modeCount; m++) {
group.sprintf("Mode %d", m);
config->setGroup(group);
@@ -446,7 +446,7 @@ void KpacmanApp::slotKeyBindings()
///////////////////////////////////////////////////////////////////
// configure key bindings
Keys *keys = new Keys();
- if (keys->exec() == QDialog::Accepted) {
+ if (keys->exec() == TQDialog::Accepted) {
view->referee->initKeys();
view->score->initKeys();
}
@@ -465,7 +465,7 @@ void KpacmanApp::slotGameFinished()
slotStatusMsg(i18n("Ready."));
}
-void KpacmanApp::slotStatusMsg(const QString &text)
+void KpacmanApp::slotStatusMsg(const TQString &text)
{
///////////////////////////////////////////////////////////////////
// change status message permanently
diff --git a/kpacman/kpacman.h b/kpacman/kpacman.h
index 527d344..04210af 100644
--- a/kpacman/kpacman.h
+++ b/kpacman/kpacman.h
@@ -23,10 +23,10 @@
#include <config.h>
#endif
-// include files for Qt
-#include <qlist.h>
-#include <qfileinf.h>
-#include <qregexp.h>
+// include files for TQt
+#include <ntqlist.h>
+#include <ntqfileinf.h>
+#include <ntqregexp.h>
//include files for KDE
#include <kapp.h>
@@ -58,7 +58,7 @@ class KpacmanApp : public KMainWindow
public:
/** constructor of KpacmanApp, calls all init functions to create the application.
*/
- KpacmanApp(QWidget *parent = 0, const char *name = 0);
+ KpacmanApp(TQWidget *parent = 0, const char *name = 0);
virtual ~KpacmanApp();
protected:
@@ -134,7 +134,7 @@ class KpacmanApp : public KMainWindow
/** changes the statusbar contents for the standard label permanently, used to indicate current actions.
* @param text the text that is displayed in the statusbar
*/
- void slotStatusMsg(const QString &text);
+ void slotStatusMsg(const TQString &text);
/** configure keysbindings dialog
*/
void slotKeyBindings();
@@ -170,13 +170,13 @@ class KpacmanApp : public KMainWindow
int mode;
KPopupMenu *modesPopup; // KAction main scheme selection menu
- QList<KPopupMenu> *schemesPopup; // submenus for selecting scheme
+ TQList<KPopupMenu> *schemesPopup; // submenus for selecting scheme
// ID's of the menuitem(s) for finding/selecting scheme by id
- QArray<int> modeID;
- QArray<int> schemeID;
+ TQArray<int> modeID;
+ TQArray<int> schemeID;
- QArray<int> schemeMode; // mode(group) of the schemes, -1 if no group
+ TQArray<int> schemeMode; // mode(group) of the schemes, -1 if no group
bool highscoresChecked; // highscores display active
bool focusedPause; // Pause caused by focusEvents
diff --git a/kpacman/kpacmanview.cpp b/kpacman/kpacmanview.cpp
index 73d3f44..b1931ec 100644
--- a/kpacman/kpacmanview.cpp
+++ b/kpacman/kpacmanview.cpp
@@ -15,8 +15,8 @@
* *
***************************************************************************/
-// include files for Qt
-#include <qmessagebox.h>
+// include files for TQt
+#include <ntqmessagebox.h>
// include files for KDE
#include <kapp.h>
@@ -30,7 +30,7 @@
#include "referee.h"
#include "status.h"
-KpacmanView::KpacmanView( QWidget *parent, const char *name) : QWidget( parent, name )
+KpacmanView::KpacmanView( TQWidget *parent, const char *name) : TQWidget( parent, name )
{
bitfont = NULL;
fontName = "";
@@ -52,7 +52,7 @@ KpacmanView::~KpacmanView()
void KpacmanView::confMisc(bool defGroup)
{
KStandardDirs *dirs = KGlobal::dirs();
- QString findPath;
+ TQString findPath;
if (defGroup || kapp->config()->hasKey("Font")) {
fontName = kapp->config()->readEntry("Font");
@@ -73,9 +73,9 @@ void KpacmanView::confMisc(bool defGroup)
void KpacmanView::confScheme()
{
- QString lastFontName = fontName;
- QString oldgroup = kapp->config()->group();
- QString newgroup;
+ TQString lastFontName = fontName;
+ TQString oldgroup = kapp->config()->group();
+ TQString newgroup;
// if not set, read mode and scheme from the configfile
if (mode == -1 && scheme == -1) {
@@ -115,11 +115,11 @@ void KpacmanView::confScheme()
bitfont = new Bitfont(fontName, bitfontFirstChar, bitfontLastChar);
if (bitfont->width() == 0 || bitfont->height() == 0) {
- QString msg = i18n("The bitfont could not be contructed.\n\n"
+ TQString msg = i18n("The bitfont could not be contructed.\n\n"
"The file '@FONTNAME@' does not exist,\n"
"or is of an unknown format.");
- msg.replace(QRegExp("@FONTNAME@"), fontName);
- // QMessageBox::critical(this, i18n("Initialization Error"), msg);
+ msg.replace(TQRegExp("@FONTNAME@"), fontName);
+ // TQMessageBox::critical(this, i18n("Initialization Error"), msg);
printf("%s\n", msg.data());
}
}
@@ -147,7 +147,7 @@ void KpacmanView::setScheme(int Scheme, int Mode)
status->repaint(FALSE);
}
-void KpacmanView::resizeEvent( QResizeEvent * )
+void KpacmanView::resizeEvent( TQResizeEvent * )
{
referee->setGeometry(0, bitfont->height()*3, referee->width(), referee->height());
referee->setBackgroundColor(BLACK);
diff --git a/kpacman/kpacmanview.h b/kpacman/kpacmanview.h
index e7025e1..9108bc9 100644
--- a/kpacman/kpacmanview.h
+++ b/kpacman/kpacmanview.h
@@ -22,9 +22,9 @@
#include <config.h>
#endif
-//include files for Qt
-#include <qwidget.h>
-#include <qregexp.h>
+//include files for TQt
+#include <ntqwidget.h>
+#include <ntqregexp.h>
// application specific includes
#include "score.h"
@@ -33,14 +33,14 @@
#include "painter.h"
/** The KpacmanView class provides the view widget for the KpacmanApp instance.
- * The View instance inherits QWidget as a base class and represents the view object of a KTMainWindow.
+ * The View instance inherits TQWidget as a base class and represents the view object of a KTMainWindow.
*/
-class KpacmanView : public QWidget
+class KpacmanView : public TQWidget
{
Q_OBJECT
public:
/** Constructor for the main view */
- KpacmanView ( QWidget *parent = 0, const char *name = 0);
+ KpacmanView ( TQWidget *parent = 0, const char *name = 0);
/** Destructor for the main view */
virtual ~KpacmanView();
@@ -52,14 +52,14 @@ public:
protected:
void confScheme();
void confMisc(bool defGroup=TRUE);
- void resizeEvent( QResizeEvent * );
+ void resizeEvent( TQResizeEvent * );
private:
Bitfont *bitfont;
uchar bitfontFirstChar;
uchar bitfontLastChar;
- QString fontName;
+ TQString fontName;
int scheme;
int mode;
diff --git a/kpacman/monster.h b/kpacman/monster.h
index b5d7f36..4f508b0 100644
--- a/kpacman/monster.h
+++ b/kpacman/monster.h
@@ -2,8 +2,8 @@
#define MONSTER_H
#include <stdlib.h>
-#include <qpixmap.h>
-#include <qwidget.h>
+#include <ntqpixmap.h>
+#include <ntqwidget.h>
#include "board.h"
diff --git a/kpacman/pacman.h b/kpacman/pacman.h
index e81fdd2..b951ee4 100644
--- a/kpacman/pacman.h
+++ b/kpacman/pacman.h
@@ -2,8 +2,8 @@
#define PACMAN_H
#include <stdlib.h>
-#include <qpixmap.h>
-#include <qwidget.h>
+#include <ntqpixmap.h>
+#include <ntqwidget.h>
#include "board.h"
diff --git a/kpacman/painter.cpp b/kpacman/painter.cpp
index 93a3782..9060620 100644
--- a/kpacman/painter.cpp
+++ b/kpacman/painter.cpp
@@ -2,20 +2,20 @@
#include <kconfig.h>
#include <kstddirs.h>
-#include <qcolor.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qbitmap.h>
-#include <qrect.h>
-#include <qstring.h>
+#include <ntqcolor.h>
+#include <ntqpainter.h>
+#include <ntqpixmap.h>
+#include <ntqbitmap.h>
+#include <ntqrect.h>
+#include <ntqstring.h>
-#include <qmessagebox.h>
-#include <qfileinfo.h>
+#include <ntqmessagebox.h>
+#include <ntqfileinfo.h>
#include "painter.h"
#include "board.h"
-Painter::Painter( Board *b, QWidget *parent, int Scheme, int Mode, Bitfont *font)
+Painter::Painter( Board *b, TQWidget *parent, int Scheme, int Mode, Bitfont *font)
{
w = parent;
board = b;
@@ -53,24 +53,24 @@ Painter::Painter( Board *b, QWidget *parent, int Scheme, int Mode, Bitfont *font
confScheme();
}
-QList<QPixmap> *Painter::loadPixmap(QWidget *parent, QString pixmapName,
- QList<QPixmap> *pixmaps)
+TQList<TQPixmap> *Painter::loadPixmap(TQWidget *parent, TQString pixmapName,
+ TQList<TQPixmap> *pixmaps)
{
if (pixmaps == NULL) {
- pixmaps = new QList<QPixmap>;
+ pixmaps = new TQList<TQPixmap>;
pixmaps->setAutoDelete(TRUE);
}
if (!pixmaps->isEmpty())
pixmaps->clear();
- QPixmap PIXMAP(pixmapName);
+ TQPixmap PIXMAP(pixmapName);
if (PIXMAP.isNull() || PIXMAP.mask() == NULL) {
- QString msg = i18n("The pixmap could not be contructed.\n\n"
+ TQString msg = i18n("The pixmap could not be contructed.\n\n"
"The file '@PIXMAPNAME@' does not exist,\n"
"or is of an unknown format.");
- msg.replace(QRegExp("@PIXMAPNAME@"), pixmapName);
- // QMessageBox::critical(parent, i18n("Initialization Error"), msg);
+ msg.replace(TQRegExp("@PIXMAPNAME@"), pixmapName);
+ // TQMessageBox::critical(parent, i18n("Initialization Error"), msg);
printf("%s\n", msg.data());
return 0;
}
@@ -78,28 +78,28 @@ QList<QPixmap> *Painter::loadPixmap(QWidget *parent, QString pixmapName,
int height = PIXMAP.height();
int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height);
- QBitmap BITMAP;
- QBitmap MASK;
+ TQBitmap BITMAP;
+ TQBitmap MASK;
BITMAP = *PIXMAP.mask();
MASK.resize(width, height);
for (int x = 0; x < PIXMAP.width()/width; x++) {
- QPixmap *pixmap = new QPixmap(width, height);
+ TQPixmap *pixmap = new TQPixmap(width, height);
pixmaps->append(pixmap);
- bitBlt(pixmap, 0, 0, &PIXMAP, x*width, 0, width, height, QPixmap::CopyROP, TRUE);
- bitBlt(&MASK, 0, 0, &BITMAP, x*width, 0, width, height, QPixmap::CopyROP, TRUE);
+ bitBlt(pixmap, 0, 0, &PIXMAP, x*width, 0, width, height, TQPixmap::CopyROP, TRUE);
+ bitBlt(&MASK, 0, 0, &BITMAP, x*width, 0, width, height, TQPixmap::CopyROP, TRUE);
pixmap->setMask(MASK);
}
return pixmaps;
}
-QList<QPixmap> *Painter::textPixmap(QStrList &str, QList<QPixmap> *pixmaps,
- QColor fg, QColor bg)
+TQList<TQPixmap> *Painter::textPixmap(TQStrList &str, TQList<TQPixmap> *pixmaps,
+ TQColor fg, TQColor bg)
{
if (pixmaps == NULL) {
- pixmaps = new QList<QPixmap>;
+ pixmaps = new TQList<TQPixmap>;
pixmaps->setAutoDelete(TRUE);
}
@@ -107,25 +107,25 @@ QList<QPixmap> *Painter::textPixmap(QStrList &str, QList<QPixmap> *pixmaps,
pixmaps->clear();
for (uint s = 0; s < str.count(); s++) {
- QPixmap *pixmap = new QPixmap(bitfont->text(str.at(s), fg, bg));
+ TQPixmap *pixmap = new TQPixmap(bitfont->text(str.at(s), fg, bg));
pixmaps->append(pixmap);
}
return pixmaps;
}
-QList<QPixmap> *Painter::textPixmap(QString str, QList<QPixmap> *pixmaps,
- QColor fg, QColor bg)
+TQList<TQPixmap> *Painter::textPixmap(TQString str, TQList<TQPixmap> *pixmaps,
+ TQColor fg, TQColor bg)
{
if (pixmaps == NULL) {
- pixmaps = new QList<QPixmap>;
+ pixmaps = new TQList<TQPixmap>;
pixmaps->setAutoDelete(TRUE);
}
if (!pixmaps->isEmpty())
pixmaps->clear();
- QPixmap *pixmap = new QPixmap(bitfont->text(str, fg, bg));
+ TQPixmap *pixmap = new TQPixmap(bitfont->text(str, fg, bg));
pixmaps->append(pixmap);
return pixmaps;
@@ -134,18 +134,18 @@ QList<QPixmap> *Painter::textPixmap(QString str, QList<QPixmap> *pixmaps,
/* Return the point of the upperleft pixel of the block representing that position
* on the board.
*/
-QPoint Painter::point(int pos)
+TQPoint Painter::point(int pos)
{
- return QPoint((board->x(pos)-1)*BlockWidth, (board->y(pos)-1)*BlockHeight);
+ return TQPoint((board->x(pos)-1)*BlockWidth, (board->y(pos)-1)*BlockHeight);
}
-QRect Painter::rect(int pos, PixMap pix, uint i)
+TQRect Painter::rect(int pos, PixMap pix, uint i)
{
if (pos == OUT)
- return QRect();
+ return TQRect();
- QPixmap *PIXMAP = NULL;
+ TQPixmap *PIXMAP = NULL;
switch (pix) {
case PacmanPix : PIXMAP = pacmanPix->
at(checkRange(i, pacmanPix->count()-1));
@@ -178,36 +178,36 @@ QRect Painter::rect(int pos, PixMap pix, uint i)
at(checkRange(i, wallPix->count()-1));
}
if (PIXMAP == NULL)
- return QRect();
+ return TQRect();
- QRect rect = PIXMAP->rect();
- QPoint point = this->point(pos);
- rect.moveCenter(QPoint(point.x()-1, point.y()-1));
+ TQRect rect = PIXMAP->rect();
+ TQPoint point = this->point(pos);
+ rect.moveCenter(TQPoint(point.x()-1, point.y()-1));
return rect;
}
-QRect Painter::rect(int pos, QString str, int align)
+TQRect Painter::rect(int pos, TQString str, int align)
{
if (pos == OUT) // return an empty rect if the position
- return QRect(); // is invalid
- QPoint point = this->point(pos);
- QRect rect = bitfont->rect(str);
+ return TQRect(); // is invalid
+ TQPoint point = this->point(pos);
+ TQRect rect = bitfont->rect(str);
- rect.moveCenter(QPoint(point.x()-1, point.y()-1));
+ rect.moveCenter(TQPoint(point.x()-1, point.y()-1));
int dx = 0;
int dy = 0;
- if (align & QLabel::AlignLeft || align & QLabel::AlignRight) {
+ if (align & TQLabel::AlignLeft || align & TQLabel::AlignRight) {
dx = (str.length()-1) * (bitfont->width()/2);
- if (align & QLabel::AlignRight)
+ if (align & TQLabel::AlignRight)
dx *= -1;
}
- if (align & QLabel::AlignTop || align & QLabel::AlignBottom) {
+ if (align & TQLabel::AlignTop || align & TQLabel::AlignBottom) {
dy = bitfont->height()/2;
- if (align & QLabel::AlignBottom)
+ if (align & TQLabel::AlignBottom)
dy *= -1;
}
@@ -217,9 +217,9 @@ QRect Painter::rect(int pos, QString str, int align)
return rect;
}
-QRect Painter::rect(QRect r1, QRect r2)
+TQRect Painter::rect(TQRect r1, TQRect r2)
{
- QRect rect;
+ TQRect rect;
rect.setLeft(r1.left() < r2.left() ? r1.left() : r2.left());
rect.setTop(r1.top() < r2.top() ? r1.top() : r2.top());
rect.setRight(r1.right() > r2.right() ? r1.right() : r2.right());
@@ -232,7 +232,7 @@ void Painter::erase(int pos, PixMap pix, uint i)
{
if (pos == OUT)
return;
- QRect rect = this->rect(pos, pix, i);
+ TQRect rect = this->rect(pos, pix, i);
bitBlt(&roomPix, rect.x(), rect.y(), &backPix,
rect.x(), rect.y(), rect.width(), rect.height());
}
@@ -255,7 +255,7 @@ int Painter::maxPixmaps(PixMap pix)
}
}
-void Painter::draw(QPoint point, DrawWidget where, QPixmap pix)
+void Painter::draw(TQPoint point, DrawWidget where, TQPixmap pix)
{
switch (where) {
case Widget : bitBlt(w, point.x(), point.y(), &pix);
@@ -267,14 +267,14 @@ void Painter::draw(QPoint point, DrawWidget where, QPixmap pix)
}
}
-void Painter::draw(QRect rect, DrawWidget where, QPixmap pix)
+void Painter::draw(TQRect rect, DrawWidget where, TQPixmap pix)
{
- draw(QPoint(rect.x(), rect.y()), where, pix);
+ draw(TQPoint(rect.x(), rect.y()), where, pix);
}
void Painter::draw(int pos, DrawWidget where, PixMap pix, uint i)
{
- QPixmap *PIXMAP = NULL;
+ TQPixmap *PIXMAP = NULL;
switch (pix) {
case PacmanPix : PIXMAP = pacmanPix->
at(checkRange(i, pacmanPix->count()-1));
@@ -306,9 +306,9 @@ void Painter::draw(int pos, DrawWidget where, PixMap pix, uint i)
if (PIXMAP == NULL)
return;
- QRect rect = PIXMAP->rect();
- QPoint point = this->point(pos);
- rect.moveCenter(QPoint(point.x()-1, point.y()-1));
+ TQRect rect = PIXMAP->rect();
+ TQPoint point = this->point(pos);
+ rect.moveCenter(TQPoint(point.x()-1, point.y()-1));
switch (where) {
case Widget : bitBlt(w, rect.x(), rect.y(), PIXMAP);
@@ -320,13 +320,13 @@ void Painter::draw(int pos, DrawWidget where, PixMap pix, uint i)
}
}
-QPixmap Painter::draw(int pos, DrawWidget where,
- QString str, QColor fg, QColor bg, int align)
+TQPixmap Painter::draw(int pos, DrawWidget where,
+ TQString str, TQColor fg, TQColor bg, int align)
{
- QPixmap TEXT = bitfont->text(str, fg, bg);
+ TQPixmap TEXT = bitfont->text(str, fg, bg);
- QRect rect = this->rect(pos, str, align);
- QPixmap SAVE = QPixmap(rect.width(), rect.height());
+ TQRect rect = this->rect(pos, str, align);
+ TQPixmap SAVE = TQPixmap(rect.width(), rect.height());
switch (where) {
case Widget : bitBlt(&SAVE, 0, 0, w, rect.x(), rect.y());
@@ -343,12 +343,12 @@ QPixmap Painter::draw(int pos, DrawWidget where,
return SAVE;
}
-QRect Painter::draw(int col, int row, DrawWidget where,
- QString str, QColor fg, QColor bg, int align)
+TQRect Painter::draw(int col, int row, DrawWidget where,
+ TQString str, TQColor fg, TQColor bg, int align)
{
- QPixmap TEXT = bitfont->text(str, fg, bg);
+ TQPixmap TEXT = bitfont->text(str, fg, bg);
- QRect rect = this->rect(row*BoardWidth+col, str, align);
+ TQRect rect = this->rect(row*BoardWidth+col, str, align);
draw(rect, where, TEXT);
return rect;
@@ -545,7 +545,7 @@ void Painter::drawBrick(int pos)
default : border = -1;
}
if (border != -1 && border < (int) wallPix->count()) {
- QRect rect = this->rect(pos, WallPix);
+ TQRect rect = this->rect(pos, WallPix);
bitBlt(&roomPix, rect.x(), rect.y(), wallPix->at((uint) border));
}
}
@@ -618,7 +618,7 @@ void Painter::drawPrison(int pos)
}
if (border != -1 && border < (int) prisonPix->count()) {
- QRect rect = this->rect(pos, PrisonPix);
+ TQRect rect = this->rect(pos, PrisonPix);
bitBlt(&roomPix, rect.x(), rect.y(), prisonPix->at((uint) border));
}
}
@@ -626,22 +626,22 @@ void Painter::drawPrison(int pos)
void Painter::drawPoint(int pos)
{
if (!pointPix->isEmpty()) {
- QRect rect = this->rect(pos, PointPix);
+ TQRect rect = this->rect(pos, PointPix);
bitBlt(&roomPix, rect.x(), rect.y(), pointPix->at(0));
}
}
-QString Painter::decodeHexOctString(QString s)
+TQString Painter::decodeHexOctString(TQString s)
{
- QString value;
- QString valids;
+ TQString value;
+ TQString valids;
int pos, xpos = 0, opos = 0;
int v, len, leadin;
const char *ptr;
uchar c;
- while (((xpos = s.find(QRegExp("\\\\x[0-9a-fA-F]+"), xpos)) != -1) ||
- ((opos = s.find(QRegExp("\\\\[0-7]+"), opos)) != -1)) {
+ while (((xpos = s.find(TQRegExp("\\\\x[0-9a-fA-F]+"), xpos)) != -1) ||
+ ((opos = s.find(TQRegExp("\\\\[0-7]+"), opos)) != -1)) {
if (xpos != -1) {
valids = "0123456789abcdef";
leadin = 2;
@@ -669,12 +669,12 @@ QString Painter::decodeHexOctString(QString s)
return s;
}
-void Painter::fillScoreString(QStrList &list, QArray<int> &values)
+void Painter::fillScoreString(TQStrList &list, TQArray<int> &values)
{
if( !list.isEmpty())
list.clear();
- QString s;
+ TQString s;
for (uint i = 0; i < values.size(); i++) {
@@ -697,12 +697,12 @@ void Painter::fillScoreString(QStrList &list, QArray<int> &values)
}
}
-void Painter::fillArray(QArray<int> &array, QString values, int max)
+void Painter::fillArray(TQArray<int> &array, TQString values, int max)
{
array.resize(max);
int last = 0;
bool ok;
- QString value;
+ TQString value;
for (uint i = 0; i < array.size(); i++) {
if (values.find(',') < 0 && values.length() > 0) {
@@ -721,13 +721,13 @@ void Painter::fillArray(QArray<int> &array, QString values, int max)
}
}
-void Painter::fillStrList(QStrList &list, QString values, int max)
+void Painter::fillStrList(TQStrList &list, TQString values, int max)
{
if (!list.isEmpty())
list.clear();
- QString last = "";
- QString value;
+ TQString last = "";
+ TQString value;
for (uint i = 0; i < (uint) max; i++) {
if (values.find(',') < 0 && values.length() > 0) {
@@ -744,16 +744,16 @@ void Painter::fillStrList(QStrList &list, QString values, int max)
}
}
-void Painter::fillPixmapName(QStrList &pixmapName)
+void Painter::fillPixmapName(TQStrList &pixmapName)
{
- QStrList list = pixmapName;
+ TQStrList list = pixmapName;
if (!pixmapName.isEmpty())
pixmapName.clear();
- QString pixmap;
+ TQString pixmap;
- QFileInfo fileInfo;
+ TQFileInfo fileInfo;
for (uint i = 0; i < list.count(); i++) {
pixmap = list.at(i);
@@ -843,8 +843,8 @@ void Painter::confScoring(bool defGroup)
void Painter::confScheme()
{
- QString oldgroup = kapp->config()->group();
- QString newgroup;
+ TQString oldgroup = kapp->config()->group();
+ TQString newgroup;
// if not set, read mode and scheme from the configfile
if (mode == -1 && scheme == -1) {
diff --git a/kpacman/painter.h b/kpacman/painter.h
index 7e63b96..ebd5bba 100644
--- a/kpacman/painter.h
+++ b/kpacman/painter.h
@@ -4,13 +4,13 @@
#include <kapp.h>
#include <klocale.h>
-#include <qpixmap.h>
-#include <qbitmap.h>
-#include <qlabel.h>
-#include <qcolor.h>
-#include <qlist.h>
-#include <qstrlist.h>
-#include <qregexp.h>
+#include <ntqpixmap.h>
+#include <ntqbitmap.h>
+#include <ntqlabel.h>
+#include <ntqcolor.h>
+#include <ntqlist.h>
+#include <ntqstrlist.h>
+#include <ntqregexp.h>
#include "board.h"
#include "bitfont.h"
@@ -24,23 +24,23 @@ enum DrawWidget { Widget, RoomPix, BackPix };
class Painter
{
public:
- Painter (Board *, QWidget *parent=0, int scheme=-1, int mode=-1,Bitfont *font=0);
- QPixmap levelPix() { return roomPix; }
+ Painter (Board *, TQWidget *parent=0, int scheme=-1, int mode=-1,Bitfont *font=0);
+ TQPixmap levelPix() { return roomPix; }
void setScheme(int scheme=-1, int mode=-1, Bitfont *font=0);
void setLevel(int level=0);
- QRect rect(int pos, PixMap pix, uint i = 0);
- QRect rect(int pos, QString str, int align = QLabel::AlignCenter );
- QRect rect(QRect r1, QRect r2);
+ TQRect rect(int pos, PixMap pix, uint i = 0);
+ TQRect rect(int pos, TQString str, int align = TQLabel::AlignCenter );
+ TQRect rect(TQRect r1, TQRect r2);
- void draw(QPoint point, DrawWidget where, QPixmap pix);
- void draw(QRect rect, DrawWidget where, QPixmap pix);
+ void draw(TQPoint point, DrawWidget where, TQPixmap pix);
+ void draw(TQRect rect, DrawWidget where, TQPixmap pix);
void draw(int pos, DrawWidget where, PixMap pix, uint i = 0);
- QPixmap draw(int pos, DrawWidget where, QString str,
- QColor fg, QColor bg = QColor(), int align = QLabel::AlignCenter);
- QRect draw(int col, int row, DrawWidget where, QString str,
- QColor fg, QColor bg = QColor(), int align = QLabel::AlignCenter);
+ TQPixmap draw(int pos, DrawWidget where, TQString str,
+ TQColor fg, TQColor bg = TQColor(), int align = TQLabel::AlignCenter);
+ TQRect draw(int col, int row, DrawWidget where, TQString str,
+ TQColor fg, TQColor bg = TQColor(), int align = TQLabel::AlignCenter);
void drawBrick(int pos);
void drawPrison(int pos);
@@ -51,12 +51,12 @@ public:
int maxPixmaps(PixMap pix);
protected:
- QString decodeHexOctString(QString str);
+ TQString decodeHexOctString(TQString str);
- void fillScoreString(QStrList &, QArray<int> &);
- void fillArray(QArray<int> &, QString, int);
- void fillStrList(QStrList &, QString, int);
- void fillPixmapName(QStrList &);
+ void fillScoreString(TQStrList &, TQArray<int> &);
+ void fillArray(TQArray<int> &, TQString, int);
+ void fillStrList(TQStrList &, TQString, int);
+ void fillPixmapName(TQStrList &);
void confScheme();
void confLevels(bool defGroup=TRUE);
@@ -68,71 +68,71 @@ protected:
void initbackPixmaps();
private:
- QWidget *w;
+ TQWidget *w;
Board *board;
Bitfont *bitfont;
int BlockWidth;
int BlockHeight;
- QArray<int> fruitScore;
- QStrList fruitScoreString;
- QArray<int> monsterScore;
- QStrList monsterScoreString;
-
- QString pixmapDirectory;
-
- QStrList pointPixmapName;
- QStrList wallPixmapName;
- QStrList prisonPixmapName;
- QStrList energizerPixmapName;
- QStrList fruitPixmapName;
- QStrList pacmanPixmapName;
- QStrList dyingPixmapName;
- QStrList eyesPixmapName;
- QStrList monsterPixmapName;
- QStrList fruitScorePixmapName;
- QStrList monsterScorePixmapName;
-
- QString lastPointPixmapName;
- QString lastWallPixmapName;
- QString lastPrisonPixmapName;
- QString lastEnergizerPixmapName;
- QString lastFruitPixmapName;
- QString lastPacmanPixmapName;
- QString lastDyingPixmapName;
- QString lastEyesPixmapName;
- QString lastMonsterPixmapName;
- QString lastFruitScorePixmapName;
- QString lastMonsterScorePixmapName;
-
- QList<QPixmap> *loadPixmap(QWidget *parent, QString pixmapName,
- QList<QPixmap> *pixmaps=0);
- QList<QPixmap> *textPixmap(QStrList &, QList<QPixmap> *pixmaps=0,
- QColor fg = BLACK, QColor bg = QColor());
- QList<QPixmap> *textPixmap(QString str, QList<QPixmap> *pixmaps=0,
- QColor fg = BLACK, QColor bg = QColor());
-
- QPoint point(int pos);
+ TQArray<int> fruitScore;
+ TQStrList fruitScoreString;
+ TQArray<int> monsterScore;
+ TQStrList monsterScoreString;
+
+ TQString pixmapDirectory;
+
+ TQStrList pointPixmapName;
+ TQStrList wallPixmapName;
+ TQStrList prisonPixmapName;
+ TQStrList energizerPixmapName;
+ TQStrList fruitPixmapName;
+ TQStrList pacmanPixmapName;
+ TQStrList dyingPixmapName;
+ TQStrList eyesPixmapName;
+ TQStrList monsterPixmapName;
+ TQStrList fruitScorePixmapName;
+ TQStrList monsterScorePixmapName;
+
+ TQString lastPointPixmapName;
+ TQString lastWallPixmapName;
+ TQString lastPrisonPixmapName;
+ TQString lastEnergizerPixmapName;
+ TQString lastFruitPixmapName;
+ TQString lastPacmanPixmapName;
+ TQString lastDyingPixmapName;
+ TQString lastEyesPixmapName;
+ TQString lastMonsterPixmapName;
+ TQString lastFruitScorePixmapName;
+ TQString lastMonsterScorePixmapName;
+
+ TQList<TQPixmap> *loadPixmap(TQWidget *parent, TQString pixmapName,
+ TQList<TQPixmap> *pixmaps=0);
+ TQList<TQPixmap> *textPixmap(TQStrList &, TQList<TQPixmap> *pixmaps=0,
+ TQColor fg = BLACK, TQColor bg = TQColor());
+ TQList<TQPixmap> *textPixmap(TQString str, TQList<TQPixmap> *pixmaps=0,
+ TQColor fg = BLACK, TQColor bg = TQColor());
+
+ TQPoint point(int pos);
int checkRange(int value, int max, int min=0);
- QList<QPixmap> *wallPix;
- QList<QPixmap> *prisonPix;
- QList<QPixmap> *pointPix;
- QList<QPixmap> *energizerPix;
- QList<QPixmap> *fruitPix;
- QList<QPixmap> *pacmanPix;
- QList<QPixmap> *dyingPix;
- QList<QPixmap> *eyesPix;
- QList<QPixmap> *monsterPix;
- QList<QPixmap> *fruitScorePix;
- QList<QPixmap> *monsterScorePix;
-
- QPixmap roomPix;
- QPixmap backPix;
+ TQList<TQPixmap> *wallPix;
+ TQList<TQPixmap> *prisonPix;
+ TQList<TQPixmap> *pointPix;
+ TQList<TQPixmap> *energizerPix;
+ TQList<TQPixmap> *fruitPix;
+ TQList<TQPixmap> *pacmanPix;
+ TQList<TQPixmap> *dyingPix;
+ TQList<TQPixmap> *eyesPix;
+ TQList<TQPixmap> *monsterPix;
+ TQList<TQPixmap> *fruitScorePix;
+ TQList<TQPixmap> *monsterScorePix;
+
+ TQPixmap roomPix;
+ TQPixmap backPix;
bool plainColor;
- QColor backgroundColor;
+ TQColor backgroundColor;
int maxLevel;
int level;
diff --git a/kpacman/referee.cpp b/kpacman/referee.cpp
index 55f03f8..bc8660b 100644
--- a/kpacman/referee.cpp
+++ b/kpacman/referee.cpp
@@ -4,13 +4,13 @@
#include <referee.h>
-#include <qdatetm.h>
+#include <ntqdatetm.h>
#include <stdlib.h>
-#include <qtimer.h>
-#include <qevent.h>
-#include <qcolor.h>
-#include <qkeycode.h>
-#include <qfileinfo.h>
+#include <ntqtimer.h>
+#include <ntqevent.h>
+#include <ntqcolor.h>
+#include <ntqkeycode.h>
+#include <ntqfileinfo.h>
#include <kaccel.h>
#include "board.h"
@@ -19,15 +19,15 @@
#include "fruit.h"
#include "painter.h"
-Referee::Referee( QWidget *parent, const char *name, int Scheme, int Mode, Bitfont *font)
- : QWidget( parent, name )
+Referee::Referee( TQWidget *parent, const char *name, int Scheme, int Mode, Bitfont *font)
+ : TQWidget( parent, name )
{
gameState.resize(12);
gameTimer = 0;
energizerTimer = 0;
focusedPause = false;
- setFocusPolicy(QWidget::StrongFocus);
+ setFocusPolicy(TQWidget::StrongFocus);
initKeys();
@@ -44,23 +44,23 @@ Referee::Referee( QWidget *parent, const char *name, int Scheme, int Mode, Bitfo
fruit = new Fruit(board);
- monsters = new QList<Monster>;
+ monsters = new TQList<Monster>;
monsters->setAutoDelete(TRUE);
- monsterRect = new QList<QRect>;
+ monsterRect = new TQList<TQRect>;
monsterRect->setAutoDelete(TRUE);
- energizers = new QList<Energizer>;
+ energizers = new TQList<Energizer>;
energizers->setAutoDelete(TRUE);
- energizerRect = new QList<QRect>;
+ energizerRect = new TQList<TQRect>;
energizerRect->setAutoDelete(TRUE);
pacmanRect.setRect(0, 0, 0, 0);
fruitRect.setRect(0, 0, 0, 0);
- QTime midnight( 0, 0, 0 );
- srand( midnight.secsTo(QTime::currentTime()) );
+ TQTime midnight( 0, 0, 0 );
+ srand( midnight.secsTo(TQTime::currentTime()) );
lifes = 0;
points = 0;
@@ -71,15 +71,15 @@ Referee::Referee( QWidget *parent, const char *name, int Scheme, int Mode, Bitfo
intro();
}
-void Referee::paintEvent( QPaintEvent *e)
+void Referee::paintEvent( TQPaintEvent *e)
{
if (gameState.testBit(HallOfFame))
return;
- QRect rect = e->rect();
+ TQRect rect = e->rect();
if (!rect.isEmpty()) {
- QPixmap p = pix->levelPix();
+ TQPixmap p = pix->levelPix();
bitBlt(this, rect.x(), rect.y(),
&p, rect.x(), rect.y(), rect.width(), rect.height());
}
@@ -159,12 +159,12 @@ void Referee::paintEvent( QPaintEvent *e)
pix->draw((BoardWidth*BoardHeight)/2-BoardWidth, Widget, i18n("PAUSED"), RED, BLACK);
}
-void Referee::timerEvent( QTimerEvent *e )
+void Referee::timerEvent( TQTimerEvent *e )
{
if (gameState.testBit(HallOfFame))
return;
- QRect lastRect;
+ TQRect lastRect;
int lastPix;
bool moved = FALSE;
int eated = 0;
@@ -407,24 +407,24 @@ void Referee::repaintFigures()
void Referee::initKeys()
{
- QString up("Up");
+ TQString up("Up");
up = kapp->config()->readEntry("upKey", (const char*) up);
UpKey = KAccel::stringToKey(up);
- QString down("Down");
+ TQString down("Down");
down = kapp->config()->readEntry("downKey", (const char*) down);
DownKey = KAccel::stringToKey(down);
- QString left("Left");
+ TQString left("Left");
left = kapp->config()->readEntry("leftKey", (const char*) left);
LeftKey = KAccel::stringToKey(left);
- QString right("Right");
+ TQString right("Right");
right = kapp->config()->readEntry("rightKey", (const char*) right);
RightKey = KAccel::stringToKey(right);
}
-void Referee::fillArray(QArray<int> &array, QString values, int max)
+void Referee::fillArray(TQArray<int> &array, TQString values, int max)
{
if (max < 0)
max = values.contains(',')+1;
@@ -432,7 +432,7 @@ void Referee::fillArray(QArray<int> &array, QString values, int max)
array.resize(max);
int last = 0;
bool ok;
- QString value;
+ TQString value;
for (uint i = 0; i < array.size(); i++) {
if (values.find(',') < 0 && values.length() > 0) {
@@ -451,13 +451,13 @@ void Referee::fillArray(QArray<int> &array, QString values, int max)
}
}
-void Referee::fillStrList(QStrList &list, QString values, int max)
+void Referee::fillStrList(TQStrList &list, TQString values, int max)
{
if (!list.isEmpty())
list.clear();
- QString last = "";
- QString value;
+ TQString last = "";
+ TQString value;
for (uint i = 0; i < (uint) max; i++) {
if (values.find(',') < 0 && values.length() > 0) {
@@ -477,14 +477,14 @@ void Referee::fillStrList(QStrList &list, QString values, int max)
void Referee::fillMapName()
{
- QStrList list = mapName;
+ TQStrList list = mapName;
if (!mapName.isEmpty())
mapName.clear();
- QString map;
+ TQString map;
- QFileInfo fileInfo;
+ TQFileInfo fileInfo;
for (uint i = 0; i < list.count(); i++) {
map = list.at(i);
@@ -610,8 +610,8 @@ void Referee::confScoring(bool defGroup)
void Referee::confScheme()
{
- QString oldgroup = kapp->config()->group();
- QString newgroup;
+ TQString oldgroup = kapp->config()->group();
+ TQString newgroup;
// if not set, read mode and scheme from the configfile
if (mode == -1 && scheme == -1) {
@@ -701,7 +701,7 @@ void Referee::setScheme(int Scheme, int Mode, Bitfont *font)
repaint();
}
-void Referee::keyPressEvent( QKeyEvent *k )
+void Referee::keyPressEvent( TQKeyEvent *k )
{
if (gameState.testBit(Paused) || gameState.testBit(HallOfFame) ||
gameState.testBit(Demonstration) || gameState.testBit(Dying) ||
@@ -770,13 +770,13 @@ void Referee::eaten()
pix->rect(pacman->position(), MonsterScorePix, monstersEaten-1)));
if (--timerCount > 0)
- QTimer::singleShot( monsterScoreDurMS, this, SLOT(eaten()));
+ TQTimer::singleShot( monsterScoreDurMS, this, SLOT(eaten()));
else {
for (Monster *m = monsters->first(); m != 0; m = monsters->next())
if (m && m->direction() == X && !gameState.testBit(Introducing))
m->setDirection(N);
if (monstersEaten != 4 || !gameState.testBit(Introducing))
- QTimer::singleShot( monsterScoreDurMS, this, SLOT(start()));
+ TQTimer::singleShot( monsterScoreDurMS, this, SLOT(start()));
}
}
@@ -869,43 +869,43 @@ void Referee::introMonster(int id)
void Referee::introPaint(int t)
{
- QString pts;
+ TQString pts;
switch (t) {
- case 0 : repaint(pix->draw(16, 6, RoomPix, i18n("CHARACTER"), WHITE, QColor(), AlignLeft), FALSE);
- repaint(pix->draw(36, 6, RoomPix, i18n("/"), WHITE, QColor(), AlignLeft), FALSE);
- repaint(pix->draw(40, 6, RoomPix, i18n("NICKNAME"), WHITE, QColor(), AlignLeft), FALSE);
+ case 0 : repaint(pix->draw(16, 6, RoomPix, i18n("CHARACTER"), WHITE, TQColor(), AlignLeft), FALSE);
+ repaint(pix->draw(36, 6, RoomPix, i18n("/"), WHITE, TQColor(), AlignLeft), FALSE);
+ repaint(pix->draw(40, 6, RoomPix, i18n("NICKNAME"), WHITE, TQColor(), AlignLeft), FALSE);
break;
case 1 : introMonster(0);
break;
- case 2 : repaint(pix->draw(16, 10, RoomPix, i18n("-SHADOW"), RED, QColor(), AlignLeft), FALSE);
+ case 2 : repaint(pix->draw(16, 10, RoomPix, i18n("-SHADOW"), RED, TQColor(), AlignLeft), FALSE);
break;
- case 3 : repaint(pix->draw(38, 10, RoomPix, i18n("\"BLINKY\""), RED, QColor(), AlignLeft), FALSE);
+ case 3 : repaint(pix->draw(38, 10, RoomPix, i18n("\"BLINKY\""), RED, TQColor(), AlignLeft), FALSE);
break;
case 4 : introMonster(1);
break;
- case 5 : repaint(pix->draw(16, 16, RoomPix, i18n("-SPEEDY"), PINK, QColor(), AlignLeft), FALSE);
+ case 5 : repaint(pix->draw(16, 16, RoomPix, i18n("-SPEEDY"), PINK, TQColor(), AlignLeft), FALSE);
break;
- case 6 : repaint(pix->draw(38, 16, RoomPix, i18n("\"PINKY\""), PINK, QColor(), AlignLeft), FALSE);
+ case 6 : repaint(pix->draw(38, 16, RoomPix, i18n("\"PINKY\""), PINK, TQColor(), AlignLeft), FALSE);
break;
case 7 : introMonster(2);
break;
- case 8 : repaint(pix->draw(16, 22, RoomPix, i18n("-BASHFUL"), CYAN, QColor(), AlignLeft), FALSE);
+ case 8 : repaint(pix->draw(16, 22, RoomPix, i18n("-BASHFUL"), CYAN, TQColor(), AlignLeft), FALSE);
break;
- case 9 : repaint(pix->draw(38, 22, RoomPix, i18n("\"INKY\""), CYAN, QColor(), AlignLeft), FALSE);
+ case 9 : repaint(pix->draw(38, 22, RoomPix, i18n("\"INKY\""), CYAN, TQColor(), AlignLeft), FALSE);
break;
case 10 : introMonster(3);
break;
- case 11 : repaint(pix->draw(16, 28, RoomPix, i18n("-POKEY"), ORANGE, QColor(), AlignLeft), FALSE);
+ case 11 : repaint(pix->draw(16, 28, RoomPix, i18n("-POKEY"), ORANGE, TQColor(), AlignLeft), FALSE);
break;
- case 12 : repaint(pix->draw(38, 28, RoomPix, i18n("\"CLYDE\""), ORANGE, QColor(), AlignLeft), FALSE);
+ case 12 : repaint(pix->draw(38, 28, RoomPix, i18n("\"CLYDE\""), ORANGE, TQColor(), AlignLeft), FALSE);
break;
case 13 : pts.sprintf("%d", pointScore);
- repaint(pix->draw(28, 44, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE);
- repaint(pix->draw(31, 44, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE);
+ repaint(pix->draw(28, 44, RoomPix, pts.data(), WHITE, TQColor(), AlignRight), FALSE);
+ repaint(pix->draw(31, 44, RoomPix, "\x1C\x1D\x1E", WHITE, TQColor(), AlignLeft), FALSE);
pts.sprintf("%d", energizerScore);
- repaint(pix->draw(28, 48, RoomPix, pts.data(), WHITE, QColor(), AlignRight), FALSE);
- repaint(pix->draw(31, 48, RoomPix, "\x1C\x1D\x1E", WHITE, QColor(), AlignLeft), FALSE);
+ repaint(pix->draw(28, 48, RoomPix, pts.data(), WHITE, TQColor(), AlignRight), FALSE);
+ repaint(pix->draw(31, 48, RoomPix, "\x1C\x1D\x1E", WHITE, TQColor(), AlignLeft), FALSE);
break;
case 14 : // "@ 1980 MIDWAY MFG.CO."
repaint(pix->draw(30, 58, RoomPix, "© 1998-2003 J.THÖNNISSEN", PINK), FALSE);
@@ -918,14 +918,14 @@ void Referee::introPlay()
if (!gameState.testBit(Introducing) || gameState.testBit(Ready))
return;
if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) {
- QTimer::singleShot(afterPauseMS, this, SLOT(introPlay()));
+ TQTimer::singleShot(afterPauseMS, this, SLOT(introPlay()));
return;
}
if (!gameState.testBit(Init)) {
if (monstersEaten == 4) {
stop();
- QTimer::singleShot(introPostAnimationMS, this, SLOT(demo()));
+ TQTimer::singleShot(introPostAnimationMS, this, SLOT(demo()));
}
if (pacman->direction() == W) {
int id = -1;
@@ -984,7 +984,7 @@ void Referee::introPlay()
}
if (timerCount++ < 15)
- QTimer::singleShot(introAnimationMS, this, SLOT(introPlay()));
+ TQTimer::singleShot(introAnimationMS, this, SLOT(introPlay()));
}
void Referee::demo()
@@ -993,7 +993,7 @@ void Referee::demo()
return;
if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) {
- QTimer::singleShot(afterPauseMS, this, SLOT(demo()));
+ TQTimer::singleShot(afterPauseMS, this, SLOT(demo()));
return;
}
@@ -1020,7 +1020,7 @@ void Referee::demo()
repaint();
timerCount = 0;
- QTimer::singleShot(playerDurMS, this, SLOT(start()));
+ TQTimer::singleShot(playerDurMS, this, SLOT(start()));
}
void Referee::play()
@@ -1061,13 +1061,13 @@ void Referee::play()
repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE);
timerCount = 0;
- QTimer::singleShot(playerDurMS, this, SLOT(ready()));
+ TQTimer::singleShot(playerDurMS, this, SLOT(ready()));
}
void Referee::ready()
{
if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) {
- QTimer::singleShot(afterPauseMS, this, SLOT(ready()));
+ TQTimer::singleShot(afterPauseMS, this, SLOT(ready()));
return;
}
@@ -1077,7 +1077,7 @@ void Referee::ready()
gameState.clearBit(Init);
repaint(pix->rect(board->position(monsterhome, 0), i18n("PLAYER ONE")), FALSE);
repaintFigures();
- QTimer::singleShot(playerDurMS, this, SLOT(ready()));
+ TQTimer::singleShot(playerDurMS, this, SLOT(ready()));
return;
}
@@ -1089,7 +1089,7 @@ void Referee::ready()
gameState.setBit(Ready);
gameState.clearBit(Init);
repaint(pix->rect(board->position(fruithome), i18n("READY!")), FALSE);
- QTimer::singleShot(readyDurMS, this, SLOT(ready()));
+ TQTimer::singleShot(readyDurMS, this, SLOT(ready()));
}
}
@@ -1104,7 +1104,7 @@ void Referee::levelUp()
repaint(pix->rect(pacman->position(), PacmanPix));
timerCount = 0;
- QTimer::singleShot(levelUpPreAnimationMS, this, SLOT(levelUpPlay()));
+ TQTimer::singleShot(levelUpPreAnimationMS, this, SLOT(levelUpPlay()));
}
void Referee::levelUpPlay()
@@ -1113,7 +1113,7 @@ void Referee::levelUpPlay()
return;
if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) {
- QTimer::singleShot(afterPauseMS, this, SLOT(levelUpPlay()));
+ TQTimer::singleShot(afterPauseMS, this, SLOT(levelUpPlay()));
return;
}
@@ -1128,7 +1128,7 @@ void Referee::levelUpPlay()
}
if (timerCount++ < 2) {
- QTimer::singleShot(levelUpAnimationMS, this, SLOT(levelUpPlay()));
+ TQTimer::singleShot(levelUpAnimationMS, this, SLOT(levelUpPlay()));
return;
}
@@ -1162,7 +1162,7 @@ void Referee::start()
return;
if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) {
- QTimer::singleShot(afterPauseMS, this, SLOT(start()));
+ TQTimer::singleShot(afterPauseMS, this, SLOT(start()));
return;
}
@@ -1212,11 +1212,11 @@ void Referee::killed()
for (Monster *m = monsters->first(); m != 0; m = monsters->next())
if (m)
m->setDirection(X);
- QTimer::singleShot(dyingPreAnimationMS, this, SLOT(killed()));
+ TQTimer::singleShot(dyingPreAnimationMS, this, SLOT(killed()));
} else {
stop();
if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) {
- QTimer::singleShot(afterPauseMS, this, SLOT(killed()));
+ TQTimer::singleShot(afterPauseMS, this, SLOT(killed()));
return;
}
@@ -1234,16 +1234,16 @@ void Referee::killedPlay()
if (!gameState.testBit(Dying) || gameState.testBit(Ready))
return;
if (gameState.testBit(Paused) || gameState.testBit(HallOfFame)) {
- QTimer::singleShot(afterPauseMS, this, SLOT(killedPlay()));
+ TQTimer::singleShot(afterPauseMS, this, SLOT(killedPlay()));
return;
}
if (timerCount <= pix->maxPixmaps(DyingPix)) {
repaint(pix->rect(pacman->position(), PacmanPix), FALSE);
if (timerCount >= pix->maxPixmaps(DyingPix)-1 || timerCount == 0)
- QTimer::singleShot(dyingPostAnimationMS, this, SLOT(killedPlay()));
+ TQTimer::singleShot(dyingPostAnimationMS, this, SLOT(killedPlay()));
else
- QTimer::singleShot(dyingAnimationMS, this, SLOT(killedPlay()));
+ TQTimer::singleShot(dyingAnimationMS, this, SLOT(killedPlay()));
timerCount++;
} else {
gameState.clearBit(Dying);
@@ -1256,7 +1256,7 @@ void Referee::killedPlay()
repaint(pix->rect(board->position(energizer, e), EnergizerPix), FALSE);
}
repaint(pix->rect(board->position(fruithome), i18n("GAME OVER")), FALSE);
- QTimer::singleShot(gameOverDurMS, this, SLOT(hallOfFame()));
+ TQTimer::singleShot(gameOverDurMS, this, SLOT(hallOfFame()));
} else {
gameState.clearBit(Init);
initPacman();
@@ -1311,7 +1311,7 @@ void Referee::initMonsters()
for (int id = 0; id < (gameState.testBit(Introducing) ? 4 : board->monsters()); id++) {
Monster *m = new Monster(board, id);
monsters->append(m);
- QRect *r = new QRect();
+ TQRect *r = new TQRect();
monsterRect->append(r);
if (!gameState.testBit(Introducing)) {
m->setFreedom(board->position(prisonexit));
@@ -1343,7 +1343,7 @@ void Referee::initEnergizers()
for (int id = 0; id < (gameState.testBit(Introducing) ? 2 : board->energizers()); id++) {
Energizer *e = new Energizer(board);
energizers->append(e);
- QRect *r = new QRect();
+ TQRect *r = new TQRect();
energizerRect->append(r);
if (!gameState.testBit(Introducing)) {
e->setPosition(board->position(energizer, id));
@@ -1370,7 +1370,7 @@ void Referee::setFocusInContinue(bool FocusInContinue)
focusInContinue = FocusInContinue;
}
-void Referee::focusInEvent(QFocusEvent *)
+void Referee::focusInEvent(TQFocusEvent *)
{
if (focusInContinue && focusedPause &&
gameState.testBit(Paused) && gameState.testBit(Playing)) {
@@ -1380,7 +1380,7 @@ void Referee::focusInEvent(QFocusEvent *)
}
}
-void Referee::focusOutEvent(QFocusEvent *)
+void Referee::focusOutEvent(TQFocusEvent *)
{
if (focusOutPause && !focusedPause &&
!gameState.testBit(Paused) && gameState.testBit(Playing)) {
diff --git a/kpacman/referee.h b/kpacman/referee.h
index 376b5c2..3cb2b59 100644
--- a/kpacman/referee.h
+++ b/kpacman/referee.h
@@ -6,11 +6,11 @@
#endif
#include <kapp.h>
-#include <qwidget.h>
-#include <qlist.h>
-#include <qstrlist.h>
-#include <qarray.h>
-#include <qbitarry.h>
+#include <ntqwidget.h>
+#include <ntqlist.h>
+#include <ntqstrlist.h>
+#include <ntqarray.h>
+#include <ntqbitarry.h>
#include "board.h"
#include "pacman.h"
@@ -24,11 +24,11 @@ enum { Init, Introducing, Playing, Demonstration, Paused, Player, Ready,
Scoring, LevelDone, Dying, GameOver, HallOfFame };
-class Referee : public QWidget
+class Referee : public TQWidget
{
Q_OBJECT
public:
- Referee (QWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1, Bitfont *font=0);
+ Referee (TQWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1, Bitfont *font=0);
void setSkill(int);
void setRoom(int);
@@ -72,15 +72,15 @@ signals:
void forcedGameHighscores();
protected:
- void timerEvent(QTimerEvent *);
- void paintEvent(QPaintEvent *);
- void keyPressEvent(QKeyEvent *);
+ void timerEvent(TQTimerEvent *);
+ void paintEvent(TQPaintEvent *);
+ void keyPressEvent(TQKeyEvent *);
- void focusOutEvent(QFocusEvent *);
- void focusInEvent(QFocusEvent *);
+ void focusOutEvent(TQFocusEvent *);
+ void focusInEvent(TQFocusEvent *);
- void fillArray(QArray<int> &, QString, int);
- void fillStrList(QStrList &, QString, int);
+ void fillArray(TQArray<int> &, TQString, int);
+ void fillStrList(TQStrList &, TQString, int);
void fillMapName();
void confScheme();
@@ -90,33 +90,33 @@ protected:
void confScoring(bool defGroup=TRUE);
private:
- QBitArray gameState;
+ TQBitArray gameState;
int timerCount;
int maxLevel;
int scheme;
int mode;
- QString pixmapDirectory;
- QString mapDirectory;
- QStrList mapName;
-
- QArray<int> speed;
- QArray<int> monsterIQ;
- QArray<int> fruitIQ;
- QArray<int> fruitIndex;
- QArray<int> pacmanTicks;
- QArray<int> remTicks;
- QArray<int> dangerousTicks;
- QArray<int> harmlessTicks;
- QArray<int> harmlessDurTicks;
- QArray<int> harmlessWarnTicks;
- QArray<int> arrestTicks;
- QArray<int> arrestDurTicks;
- QArray<int> fruitTicks;
- QArray<int> fruitAppearsTicks;
- QArray<int> fruitDurTicks;
- QArray<int> fruitScoreDurTicks;
+ TQString pixmapDirectory;
+ TQString mapDirectory;
+ TQStrList mapName;
+
+ TQArray<int> speed;
+ TQArray<int> monsterIQ;
+ TQArray<int> fruitIQ;
+ TQArray<int> fruitIndex;
+ TQArray<int> pacmanTicks;
+ TQArray<int> remTicks;
+ TQArray<int> dangerousTicks;
+ TQArray<int> harmlessTicks;
+ TQArray<int> harmlessDurTicks;
+ TQArray<int> harmlessWarnTicks;
+ TQArray<int> arrestTicks;
+ TQArray<int> arrestDurTicks;
+ TQArray<int> fruitTicks;
+ TQArray<int> fruitAppearsTicks;
+ TQArray<int> fruitDurTicks;
+ TQArray<int> fruitScoreDurTicks;
int monsterScoreDurMS;
int playerDurMS;
@@ -134,9 +134,9 @@ private:
int pointScore;
int energizerScore;
- QArray<int> fruitScore;
- QArray<int> monsterScore;
- QArray<int> extraLifeScore;
+ TQArray<int> fruitScore;
+ TQArray<int> monsterScore;
+ TQArray<int> extraLifeScore;
int extraLifeScoreIndex;
int nextExtraLifeScore;
@@ -155,14 +155,14 @@ private:
Pacman *pacman;
Fruit *fruit;
- QList<Monster> *monsters;
- QList<QRect> *monsterRect;
+ TQList<Monster> *monsters;
+ TQList<TQRect> *monsterRect;
- QList<Energizer> *energizers;
- QList<QRect> *energizerRect;
+ TQList<Energizer> *energizers;
+ TQList<TQRect> *energizerRect;
- QRect pacmanRect;
- QRect fruitRect;
+ TQRect pacmanRect;
+ TQRect fruitRect;
void introMonster(int id);
void introPaint(int t);
diff --git a/kpacman/score.cpp b/kpacman/score.cpp
index 1bbd427..aa2045a 100644
--- a/kpacman/score.cpp
+++ b/kpacman/score.cpp
@@ -9,18 +9,18 @@
#include <kconfig.h>
#include <kstddirs.h>
#include <kmessagebox.h>
-#include <qpixmap.h>
-#include <qstring.h>
-#include <qdstream.h>
-#include <qkeycode.h>
-#include <qtimer.h>
-#include <qfileinfo.h>
+#include <ntqpixmap.h>
+#include <ntqstring.h>
+#include <ntqdstream.h>
+#include <ntqkeycode.h>
+#include <ntqtimer.h>
+#include <ntqfileinfo.h>
#include "bitfont.h"
-Score::Score(QWidget *parent, const char *name, int Scheme, int Mode, Bitfont *font) : QWidget(parent, name)
+Score::Score(TQWidget *parent, const char *name, int Scheme, int Mode, Bitfont *font) : TQWidget(parent, name)
{
- setFocusPolicy(QWidget::StrongFocus);
+ setFocusPolicy(TQWidget::StrongFocus);
paused = FALSE;
@@ -32,7 +32,7 @@ Score::Score(QWidget *parent, const char *name, int Scheme, int Mode, Bitfont *f
cursor.x = -1;
cursor.y = -1;
cursor.on = FALSE;
- cursor.chr = QChar('?');
+ cursor.chr = TQChar('?');
initKeys();
@@ -63,11 +63,11 @@ Score::~Score()
// write();
}
-void Score::paintEvent( QPaintEvent *e)
+void Score::paintEvent( TQPaintEvent *e)
{
if (rect(1, 0, i18n(" 1UP ")).intersects(e->rect())) {
- QPixmap pix;
- QColor fg = BLACK;
+ TQPixmap pix;
+ TQColor fg = BLACK;
if (cursor.on || paused || lastPlayer != 0)
fg = WHITE;
pix = bitfont->text(i18n(" 1UP "), fg, BLACK);
@@ -75,54 +75,54 @@ void Score::paintEvent( QPaintEvent *e)
}
if (rect(8, 0, i18n(" HIGH SCORE ")).intersects(e->rect())) {
- QPixmap pix = bitfont->text(i18n(" HIGH SCORE "), WHITE, BLACK);
+ TQPixmap pix = bitfont->text(i18n(" HIGH SCORE "), WHITE, BLACK);
bitBlt(this, x(8), y(0), &pix);
}
if (maxPlayer > 1 && rect(21, 0, i18n(" 2UP ")).intersects(e->rect())) {
- QPixmap pix;
- QColor fg = BLACK;
+ TQPixmap pix;
+ TQColor fg = BLACK;
if (cursor.on || paused || lastPlayer != 1)
fg = WHITE;
pix = bitfont->text(i18n(" 2UP "), fg, BLACK);
bitBlt(this, x(21), y(0), &pix);
}
- QString s;
+ TQString s;
s.sprintf("%6d0", playerScore[0]/10);
if (rect(0, 1, s).intersects(e->rect())) {
- QPixmap pix = bitfont->text(s, WHITE, BLACK);
+ TQPixmap pix = bitfont->text(s, WHITE, BLACK);
bitBlt(this, x(0), y(1), &pix);
}
s.sprintf("%8d0", HighScore/10);
if (rect(8, 1, s).intersects(e->rect())) {
- QPixmap pix = bitfont->text(s, WHITE, BLACK);
+ TQPixmap pix = bitfont->text(s, WHITE, BLACK);
bitBlt(this, x(8), y(1), &pix);
}
if (lastScore >= 0) {
if (rect(1, 4*1.25, i18n(" CONGRATULATIONS ")).intersects(e->rect())) {
- QPixmap pix = bitfont->text(i18n(" CONGRATULATIONS "), YELLOW, BLACK);
+ TQPixmap pix = bitfont->text(i18n(" CONGRATULATIONS "), YELLOW, BLACK);
bitBlt(this, x(1), y(4*1.25), &pix);
}
if (rect(1, 6*1.25, i18n(" YOU HAVE ARCHIEVED ")).intersects(e->rect())) {
- QPixmap pix = bitfont->text(i18n(" YOU HAVE ARCHIEVED "), CYAN, BLACK);
+ TQPixmap pix = bitfont->text(i18n(" YOU HAVE ARCHIEVED "), CYAN, BLACK);
bitBlt(this, x(1), y(6*1.25), &pix);
}
if (rect(1, 7*1.25, i18n(" A SCORE IN THE TOP 10. ")).intersects(e->rect())) {
- QPixmap pix = bitfont->text(i18n(" A SCORE IN THE TOP 10. "), CYAN, BLACK);
+ TQPixmap pix = bitfont->text(i18n(" A SCORE IN THE TOP 10. "), CYAN, BLACK);
bitBlt(this, x(1), y(7*1.25), &pix);
}
if (rect(1, 8*1.25, i18n(" ")).intersects(e->rect())) {
- QPixmap pix = bitfont->text(i18n(" "), CYAN, BLACK);
+ TQPixmap pix = bitfont->text(i18n(" "), CYAN, BLACK);
bitBlt(this, x(1), y(8*1.25), &pix);
}
}
if (rect(1, 9.5*1.25, i18n("RNK SCORE NAME DATE")).intersects(e->rect())) {
- QPixmap pix = bitfont->text(i18n("RNK SCORE NAME DATE"), WHITE, BLACK);
+ TQPixmap pix = bitfont->text(i18n("RNK SCORE NAME DATE"), WHITE, BLACK);
bitBlt(this, x(1), y(9.5*1.25), &pix);
}
@@ -131,29 +131,29 @@ void Score::paintEvent( QPaintEvent *e)
i+1, hallOfFame[i].points, hallOfFame[i].name.utf8().data(),
formatDate(hallOfFame[i].moment.date()).data());
if (rect(1, (11+i)*1.25, s).intersects(e->rect())) {
- QPixmap pix = bitfont->text(s, (i == lastScore) ? YELLOW : WHITE, BLACK);
+ TQPixmap pix = bitfont->text(s, (i == lastScore) ? YELLOW : WHITE, BLACK);
bitBlt(this, x(1), y((11+i)*1.25), &pix);
}
}
if (cursor.x != -1 && cursor.y != -1 && cursor.on) {
if (rect(cursor.x, (cursor.y*1.25), cursor.chr).intersects(e->rect())) {
- QPixmap pix = bitfont->text(cursor.chr, BLACK, YELLOW);
+ TQPixmap pix = bitfont->text(cursor.chr, BLACK, YELLOW);
bitBlt(this, x(cursor.x), y(cursor.y*1.25), &pix);
}
}
if (paused) {
- QPixmap pix = bitfont->text(i18n("PAUSED"), RED, BLACK);
- QRect r = bitfont->rect(i18n("PAUSED"));
- r.moveCenter(QPoint(this->width()/2, this->height()/2));
+ TQPixmap pix = bitfont->text(i18n("PAUSED"), RED, BLACK);
+ TQRect r = bitfont->rect(i18n("PAUSED"));
+ r.moveCenter(TQPoint(this->width()/2, this->height()/2));
bitBlt(this, r.x(), r.y(), &pix);
}
}
-void Score::timerEvent(QTimerEvent *e)
+void Score::timerEvent(TQTimerEvent *e)
{
cursor.on = !cursor.on;
@@ -171,7 +171,7 @@ void Score::timerEvent(QTimerEvent *e)
repaint(rect(21, 0, i18n(" 2UP ")), FALSE);
}
-void Score::keyPressEvent(QKeyEvent *k)
+void Score::keyPressEvent(TQKeyEvent *k)
{
if (lastScore < 0 || lastPlayer < 0 || lastPlayer >= maxPlayer || paused) {
k->ignore();
@@ -250,19 +250,19 @@ void Score::keyPressEvent(QKeyEvent *k)
void Score::initKeys()
{
- QString up("Up");
+ TQString up("Up");
up = kapp->config()->readEntry("upKey", (const char*) up);
UpKey = KAccel::stringToKey(up);
- QString down("Down");
+ TQString down("Down");
down = kapp->config()->readEntry("downKey", (const char*) down);
DownKey = KAccel::stringToKey(down);
- QString left("Left");
+ TQString left("Left");
left = kapp->config()->readEntry("leftKey", (const char*) left);
LeftKey = KAccel::stringToKey(left);
- QString right("Right");
+ TQString right("Right");
right = kapp->config()->readEntry("rightKey", (const char*) right);
RightKey = KAccel::stringToKey(right);
}
@@ -279,8 +279,8 @@ void Score::confTiming(bool defGroup)
void Score::confScheme()
{
- QString oldgroup = kapp->config()->group();
- QString newgroup;
+ TQString oldgroup = kapp->config()->group();
+ TQString newgroup;
// if not set, read mode and scheme from the configfile
if (mode == -1 && scheme == -1) {
@@ -363,7 +363,7 @@ void Score::set(int score, int player)
lastPlayer = player;
playerScore[lastPlayer] = score;
- QString s;
+ TQString s;
s.sprintf("%6d0", playerScore[lastPlayer]/10);
repaint(rect(0, 1, s), FALSE);
@@ -403,7 +403,7 @@ void Score::setScore(int level, int player)
// enable gameNew directly for an immediate next try
emit gameFinished();
lastPlayer = -1;
- QTimer::singleShot(hallOfFameMS, this, SLOT(end()));
+ TQTimer::singleShot(hallOfFameMS, this, SLOT(end()));
return;
}
@@ -413,7 +413,7 @@ void Score::setScore(int level, int player)
hallOfFame[lastScore].points = playerScore[lastPlayer];
hallOfFame[lastScore].levels = level;
- hallOfFame[lastScore].moment = QDateTime::currentDateTime();
+ hallOfFame[lastScore].moment = TQDateTime::currentDateTime();
hallOfFame[lastScore].name = playerName[lastPlayer];
cursor.x = 14;
@@ -432,12 +432,12 @@ void Score::read()
{
if (highscoreFile.exists() && highscoreFile.size() > 4) {
if (highscoreFile.open(IO_ReadOnly)) {
- QDataStream s(&highscoreFile);
+ TQDataStream s(&highscoreFile);
char *name;
for (int i = 0; i < 10; i++) {
s >> hallOfFame[i].points >> hallOfFame[i].levels >> hallOfFame[i].duration >>
hallOfFame[i].moment >> name;
- hallOfFame[i].name = QString::fromLatin1(name);
+ hallOfFame[i].name = TQString::fromLatin1(name);
delete(name);
}
highscoreFile.close();
@@ -446,8 +446,8 @@ void Score::read()
for (int i = 0; i < 10; i++) {
hallOfFame[i].points = 5000;
hallOfFame[i].levels = 0;
- hallOfFame[i].duration = QTime();
- hallOfFame[i].moment = QDateTime();
+ hallOfFame[i].duration = TQTime();
+ hallOfFame[i].moment = TQDateTime();
hallOfFame[i].name = "???";
}
// write();
@@ -489,10 +489,10 @@ void Score::write()
"To use a different directory or filename for the highscores,"
"specify them in the configfile (kpacmanrc:highscoreFilePath)."
).arg(systemHighscoreFileInfo.filePath()),
- QString::null, "PrivateHighscore");
+ TQString::null, "PrivateHighscore");
if (highscoreFile.open(IO_WriteOnly)) {
- QDataStream s(&highscoreFile);
+ TQDataStream s(&highscoreFile);
for (int i = 0; i < 10; i++)
s << hallOfFame[i].points << hallOfFame[i].levels << hallOfFame[i].duration <<
hallOfFame[i].moment << hallOfFame[i].name.latin1();
@@ -504,8 +504,8 @@ void Score::setPause(bool Paused)
{
paused = Paused;
- QRect r = bitfont->rect(i18n("PAUSED"));
- r.moveCenter(QPoint(this->width()/2, this->height()/2));
+ TQRect r = bitfont->rect(i18n("PAUSED"));
+ r.moveCenter(TQPoint(this->width()/2, this->height()/2));
repaint(r, TRUE);
// repaint 1UP or 2UP
@@ -515,7 +515,7 @@ void Score::setPause(bool Paused)
void Score::end()
{
if (paused) {
- QTimer::singleShot(afterPauseMS, this, SLOT(end()));
+ TQTimer::singleShot(afterPauseMS, this, SLOT(end()));
return;
}
@@ -528,27 +528,27 @@ void Score::end()
}
/*
- * Return the date in a formatted QString. The format can be changed using internationalization
- * of the string "YY/MM/DD". Invalid QDate's where returned as "00/00/00".
+ * Return the date in a formatted TQString. The format can be changed using internationalization
+ * of the string "YY/MM/DD". Invalid TQDate's where returned as "00/00/00".
*/
-QString Score::formatDate(QDate date)
+TQString Score::formatDate(TQDate date)
{
- QString s = i18n("@YY@/@MM@/@DD@");
+ TQString s = i18n("@YY@/@MM@/@DD@");
- QString dd;
+ TQString dd;
dd.sprintf("%02d", date.isValid() ? date.year() % 100 : 0);
- s.replace(QRegExp("@YY@"), dd);
+ s.replace(TQRegExp("@YY@"), dd);
dd.sprintf("%02d", date.isValid() ? date.month() : 0);
- s.replace(QRegExp("@MM@"), dd);
+ s.replace(TQRegExp("@MM@"), dd);
dd.sprintf("%02d", date.isValid() ? date.day() : 0);
- s.replace(QRegExp("@DD@"), dd);
+ s.replace(TQRegExp("@DD@"), dd);
return s;
}
-QRect Score::rect(int col, float row, QString str, int align)
+TQRect Score::rect(int col, float row, TQString str, int align)
{
- QRect r = bitfont->rect(str);
+ TQRect r = bitfont->rect(str);
r.moveBy(x(col), y(row));
int dx = 0;
@@ -589,10 +589,10 @@ int Score::y(float row)
* Wenn die systemweite "highscore"-Datei nicht beschrieben werden kann, wird mit einer
* privaten Datei gearbeitet.
*/
-QFileInfo Score::locateHighscoreFilePath()
+TQFileInfo Score::locateHighscoreFilePath()
{
- QFileInfo systemHighscoreDirPath;
- QStringList systemHighscoreDirs;
+ TQFileInfo systemHighscoreDirPath;
+ TQStringList systemHighscoreDirs;
// Schreibfähige "private" highscore-Datei ermitteln für den fallback.
privateHighscoreFileInfo.setFile(KGlobal::dirs()->saveLocation("appdata")+highscoreName);
@@ -604,9 +604,9 @@ QFileInfo Score::locateHighscoreFilePath()
if (systemHighscoreFileInfo.filePath().isEmpty())
systemHighscoreDirs = KGlobal::dirs()->resourceDirs("appdata");
else
- systemHighscoreDirs = QStringList(systemHighscoreFileInfo.filePath());
+ systemHighscoreDirs = TQStringList(systemHighscoreFileInfo.filePath());
- for (QStringList::Iterator i = systemHighscoreDirs.begin(); i != systemHighscoreDirs.end(); ++i) {
+ for (TQStringList::Iterator i = systemHighscoreDirs.begin(); i != systemHighscoreDirs.end(); ++i) {
systemHighscoreFileInfo.setFile(*i);
if (systemHighscoreFileInfo.fileName().isEmpty())
diff --git a/kpacman/score.h b/kpacman/score.h
index 8f6a644..a6bc1de 100644
--- a/kpacman/score.h
+++ b/kpacman/score.h
@@ -6,14 +6,14 @@
#endif
#include <kapp.h>
-#include <qwidget.h>
-#include <qstring.h>
-#include <qpoint.h>
-#include <qrect.h>
-#include <qfile.h>
+#include <ntqwidget.h>
+#include <ntqstring.h>
+#include <ntqpoint.h>
+#include <ntqrect.h>
+#include <ntqfile.h>
-#include <qfileinfo.h>
-#include <qdatetime.h>
+#include <ntqfileinfo.h>
+#include <ntqdatetime.h>
#include "painter.h"
#include "bitfont.h"
@@ -22,11 +22,11 @@
#define minPlayerNameLength 3
#define highscoreName "highscore"
-class Score : public QWidget
+class Score : public TQWidget
{
Q_OBJECT
public:
- Score (QWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1, Bitfont *font=0);
+ Score (TQWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1, Bitfont *font=0);
~Score();
public slots:
@@ -49,12 +49,12 @@ signals:
void gameHighscores();
protected:
- void timerEvent(QTimerEvent *);
- void paintEvent(QPaintEvent *);
- void keyPressEvent(QKeyEvent *);
+ void timerEvent(TQTimerEvent *);
+ void paintEvent(TQPaintEvent *);
+ void keyPressEvent(TQKeyEvent *);
- void focusInEvent(QFocusEvent *) { ; }
- void focusOutEvent(QFocusEvent *) { ; }
+ void focusInEvent(TQFocusEvent *) { ; }
+ void focusOutEvent(TQFocusEvent *) { ; }
void confScheme();
void confTiming(bool defGroup=TRUE);
@@ -62,11 +62,11 @@ protected:
private:
Bitfont *bitfont;
- QRect rect(int col, float row, QString str, int align = AlignCenter);
+ TQRect rect(int col, float row, TQString str, int align = AlignCenter);
int x(int col);
int y(float row);
- QString formatDate(QDate date);
+ TQString formatDate(TQDate date);
/**
* Ermittelt die zu benutzende "highscore"-Datei, in die auch geschrieben werden kann.
@@ -75,7 +75,7 @@ private:
* Wenn die systemweite "globale" Datei nicht beschrieben werden kann, wird mit einer
* privaten Datei gearbeitet.
*/
- QFileInfo locateHighscoreFilePath();
+ TQFileInfo locateHighscoreFilePath();
int cursorBlinkMS;
int hallOfFameMS;
@@ -92,12 +92,12 @@ private:
int lastPlayer;
int HighScore;
int playerScore[maxPlayer];
- QString playerName[maxPlayer];
+ TQString playerName[maxPlayer];
struct {
int x;
int y;
- QChar chr;
+ TQChar chr;
bool on;
} cursor;
@@ -107,15 +107,15 @@ private:
struct {
int points;
int levels;
- QTime duration;
- QDateTime moment;
- QString name;
+ TQTime duration;
+ TQDateTime moment;
+ TQString name;
} hallOfFame[10];
- QFileInfo systemHighscoreFileInfo;
- QFileInfo privateHighscoreFileInfo;
+ TQFileInfo systemHighscoreFileInfo;
+ TQFileInfo privateHighscoreFileInfo;
- QFile highscoreFile;
+ TQFile highscoreFile;
int scheme;
int mode;
diff --git a/kpacman/status.cpp b/kpacman/status.cpp
index e93111b..8ccb7ab 100644
--- a/kpacman/status.cpp
+++ b/kpacman/status.cpp
@@ -4,14 +4,14 @@
#include <status.h>
-#include <qpixmap.h>
-#include <qbitmap.h>
-#include <qstring.h>
-#include <qmsgbox.h>
-#include <qfileinfo.h>
-
-Status::Status( QWidget *parent, const char *name, int Scheme, int Mode ) :
- QWidget( parent, name )
+#include <ntqpixmap.h>
+#include <ntqbitmap.h>
+#include <ntqstring.h>
+#include <ntqmsgbox.h>
+#include <ntqfileinfo.h>
+
+Status::Status( TQWidget *parent, const char *name, int Scheme, int Mode ) :
+ TQWidget( parent, name )
{
actualLifes = 0;
actualLevel = 0;
@@ -26,24 +26,24 @@ Status::Status( QWidget *parent, const char *name, int Scheme, int Mode ) :
confScheme();
}
-QList<QPixmap> *Status::loadPixmap(QWidget *parent, QString pixmapName,
- QList<QPixmap> *pixmaps)
+TQList<TQPixmap> *Status::loadPixmap(TQWidget *parent, TQString pixmapName,
+ TQList<TQPixmap> *pixmaps)
{
if (pixmaps == NULL) {
- pixmaps = new QList<QPixmap>;
+ pixmaps = new TQList<TQPixmap>;
pixmaps->setAutoDelete(TRUE);
}
if (!pixmaps->isEmpty())
pixmaps->clear();
- QPixmap PIXMAP(pixmapName);
+ TQPixmap PIXMAP(pixmapName);
if (PIXMAP.isNull() || PIXMAP.mask() == NULL) {
- QString msg = i18n("The pixmap could not be contructed.\n\n"
+ TQString msg = i18n("The pixmap could not be contructed.\n\n"
"The file '@PIXMAPNAME@' does not exist,\n"
"or is of an unknown format.");
- msg.replace(QRegExp("@PIXMAPNAME@"), pixmapName);
- QMessageBox::information(parent, i18n("Initialization Error"),
+ msg.replace(TQRegExp("@PIXMAPNAME@"), pixmapName);
+ TQMessageBox::information(parent, i18n("Initialization Error"),
(const char *) msg);
return 0;
}
@@ -51,14 +51,14 @@ QList<QPixmap> *Status::loadPixmap(QWidget *parent, QString pixmapName,
int height = PIXMAP.height();
int width = (height == 0) ? 0 : PIXMAP.width()/(PIXMAP.width()/height);
- QBitmap BITMAP;
- QBitmap MASK;
+ TQBitmap BITMAP;
+ TQBitmap MASK;
BITMAP = *PIXMAP.mask();
MASK.resize(width, height);
for (int x = 0; x < PIXMAP.width()/width; x++) {
- QPixmap *pixmap = new QPixmap(width, height);
+ TQPixmap *pixmap = new TQPixmap(width, height);
pixmaps->append(pixmap);
bitBlt(pixmap, 0, 0, &PIXMAP, x*width, 0, width, height, CopyROP, TRUE);
bitBlt(&MASK, 0, 0, &BITMAP, x*width, 0, width, height, CopyROP, TRUE);
@@ -68,7 +68,7 @@ QList<QPixmap> *Status::loadPixmap(QWidget *parent, QString pixmapName,
return pixmaps;
}
-void Status::paintEvent( QPaintEvent *)
+void Status::paintEvent( TQPaintEvent *)
{
for (int x = 0; x < actualLifes && !lifesPix->isEmpty(); x++)
bitBlt(this, lifesPix->at(0)->width()+(lifesPix->at(0)->width()*x),
@@ -99,17 +99,17 @@ void Status::initPixmaps()
}
}
-QString Status::decodeHexOctString(QString s)
+TQString Status::decodeHexOctString(TQString s)
{
- QString value;
- QString valids;
+ TQString value;
+ TQString valids;
int pos, xpos = 0, opos = 0;
int v, len, leadin;
const char *ptr;
uchar c;
- while (((xpos = s.find(QRegExp("\\\\x[0-9a-fA-F]+"), xpos)) != -1) ||
- ((opos = s.find(QRegExp("\\\\[0-7]+"), opos)) != -1)) {
+ while (((xpos = s.find(TQRegExp("\\\\x[0-9a-fA-F]+"), xpos)) != -1) ||
+ ((opos = s.find(TQRegExp("\\\\[0-7]+"), opos)) != -1)) {
if (xpos != -1) {
valids = "0123456789abcdef";
leadin = 2;
@@ -137,12 +137,12 @@ QString Status::decodeHexOctString(QString s)
return s;
}
-void Status::fillArray(QArray<int> &array, QString values, int max)
+void Status::fillArray(TQArray<int> &array, TQString values, int max)
{
array.resize(max);
int last = 0;
bool ok;
- QString value;
+ TQString value;
for (uint i = 0; i < array.size(); i++) {
if (values.find(',') < 0 && values.length() > 0) {
@@ -161,13 +161,13 @@ void Status::fillArray(QArray<int> &array, QString values, int max)
}
}
-void Status::fillStrList(QStrList &list, QString values, int max)
+void Status::fillStrList(TQStrList &list, TQString values, int max)
{
if (!list.isEmpty())
list.clear();
- QString last = "";
- QString value;
+ TQString last = "";
+ TQString value;
for (uint i = 0; i < (uint) max; i++) {
if (values.find(',') < 0 && values.length() > 0) {
@@ -184,16 +184,16 @@ void Status::fillStrList(QStrList &list, QString values, int max)
}
}
-void Status::fillPixmapName(QStrList &pixmapName)
+void Status::fillPixmapName(TQStrList &pixmapName)
{
- QStrList list = pixmapName;
+ TQStrList list = pixmapName;
if (!pixmapName.isEmpty())
pixmapName.clear();
- QString pixmap;
+ TQString pixmap;
- QFileInfo fileInfo;
+ TQFileInfo fileInfo;
for (uint i = 0; i < list.count(); i++) {
pixmap = list.at(i);
@@ -240,8 +240,8 @@ void Status::confMisc(bool defGroup)
void Status::confScheme()
{
- QString oldgroup = kapp->config()->group();
- QString newgroup;
+ TQString oldgroup = kapp->config()->group();
+ TQString newgroup;
// if not set, read mode and scheme from the configfile
if (mode == -1 && scheme == -1) {
diff --git a/kpacman/status.h b/kpacman/status.h
index c749f69..6eeb4ac 100644
--- a/kpacman/status.h
+++ b/kpacman/status.h
@@ -8,19 +8,19 @@
#include <kapp.h>
#include <kconfig.h>
-#include <qwidget.h>
-#include <qpixmap.h>
-#include <qstring.h>
-#include <qarray.h>
-#include <qlist.h>
-#include <qstrlist.h>
-#include <qregexp.h>
-
-class Status : public QWidget
+#include <ntqwidget.h>
+#include <ntqpixmap.h>
+#include <ntqstring.h>
+#include <ntqarray.h>
+#include <ntqlist.h>
+#include <ntqstrlist.h>
+#include <ntqregexp.h>
+
+class Status : public TQWidget
{
Q_OBJECT
public:
- Status(QWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1);
+ Status(TQWidget *parent=0, const char *name=0, int scheme=-1, int mode=-1);
~Status() {};
public slots:
@@ -29,15 +29,15 @@ public slots:
void setLifes(int lifes);
protected:
- void paintEvent(QPaintEvent *);
+ void paintEvent(TQPaintEvent *);
int minHeight();
int minWidth();
- QString decodeHexOctString(QString str);
+ TQString decodeHexOctString(TQString str);
- void fillArray(QArray<int> &, QString, int);
- void fillStrList(QStrList &, QString, int);
- void fillPixmapName(QStrList &);
+ void fillArray(TQArray<int> &, TQString, int);
+ void fillStrList(TQStrList &, TQString, int);
+ void fillPixmapName(TQStrList &);
void confScheme();
void confLevels(bool defGroup=TRUE);
@@ -46,23 +46,23 @@ protected:
void initPixmaps();
private:
- QArray<int> levelPos;
+ TQArray<int> levelPos;
int actualLifes;
int actualLevel;
- QString pixmapDirectory;
+ TQString pixmapDirectory;
- QStrList lifesPixmapName;
- QStrList levelPixmapName;
+ TQStrList lifesPixmapName;
+ TQStrList levelPixmapName;
- QString lastLifesPixmapName;
- QString lastLevelPixmapName;
+ TQString lastLifesPixmapName;
+ TQString lastLevelPixmapName;
- QList<QPixmap> *loadPixmap(QWidget *parent, QString pixmapName,
- QList<QPixmap> *pixmaps=0);
+ TQList<TQPixmap> *loadPixmap(TQWidget *parent, TQString pixmapName,
+ TQList<TQPixmap> *pixmaps=0);
- QList<QPixmap> *lifesPix;
- QList<QPixmap> *levelPix;
+ TQList<TQPixmap> *lifesPix;
+ TQList<TQPixmap> *levelPix;
int maxLevel;
int level;