diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
commit | 576eb4299a00bc053db35414406f46372a0f70f2 (patch) | |
tree | 4c030922d533821db464af566188e7d40cc8848c /libksirtet/common | |
parent | 0718336b6017d1a4fc1d626544180a5a2a29ddec (diff) | |
download | tdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libksirtet/common')
-rw-r--r-- | libksirtet/common/ai.cpp | 50 | ||||
-rw-r--r-- | libksirtet/common/ai.h | 18 | ||||
-rw-r--r-- | libksirtet/common/board.cpp | 2 | ||||
-rw-r--r-- | libksirtet/common/board.h | 2 | ||||
-rw-r--r-- | libksirtet/common/factory.cpp | 8 | ||||
-rw-r--r-- | libksirtet/common/factory.h | 8 | ||||
-rw-r--r-- | libksirtet/common/field.cpp | 46 | ||||
-rw-r--r-- | libksirtet/common/field.h | 16 | ||||
-rw-r--r-- | libksirtet/common/highscores.cpp | 12 | ||||
-rw-r--r-- | libksirtet/common/inter.cpp | 28 | ||||
-rw-r--r-- | libksirtet/common/inter.h | 10 | ||||
-rw-r--r-- | libksirtet/common/main.cpp | 20 | ||||
-rw-r--r-- | libksirtet/common/main.h | 2 | ||||
-rw-r--r-- | libksirtet/common/misc_ui.cpp | 74 | ||||
-rw-r--r-- | libksirtet/common/misc_ui.h | 30 | ||||
-rw-r--r-- | libksirtet/common/settings.cpp | 26 | ||||
-rw-r--r-- | libksirtet/common/settings.h | 2 | ||||
-rw-r--r-- | libksirtet/common/types.cpp | 12 | ||||
-rw-r--r-- | libksirtet/common/types.h | 16 |
19 files changed, 191 insertions, 191 deletions
diff --git a/libksirtet/common/ai.cpp b/libksirtet/common/ai.cpp index bc1c6722..78f9d5af 100644 --- a/libksirtet/common/ai.cpp +++ b/libksirtet/common/ai.cpp @@ -3,12 +3,12 @@ #include <assert.h> -#include <qlabel.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qlayout.h> -#include <qgrid.h> -#include <qwhatsthis.h> +#include <tqlabel.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqlayout.h> +#include <tqgrid.h> +#include <tqwhatsthis.h> #include <klocale.h> #include <kconfig.h> @@ -61,7 +61,7 @@ bool AIPiece::increment() // nbRot = _current->nbConfigurations() - 1; // curRot = 0; } - _current->rotate(true, QPoint(0, 0)); + _current->rotate(true, TQPoint(0, 0)); nbPos = _board->matrix().width() - _current->size().first + 1; curRot++; curPos = 0; @@ -89,7 +89,7 @@ AI::AI(uint tTime, uint oTime, const Data *DATA) : timer(this), thinkTime(tTime), orderTime(oTime), stopped(false), board(0) { - connect(&timer, SIGNAL(timeout()), SLOT(timeout())); + connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout())); for (uint i=0; DATA[i].name; i++) { Element element; @@ -295,13 +295,13 @@ double AI::nbRemoved(const Board &main, const Board ¤t) const uint AIConfig::minThinkingDepth = 1; const uint AIConfig::maxThinkingDepth = 2; -AIConfig::AIConfig(const QValueVector<AI::Element> &elements) - : QWidget(0, "ai config") +AIConfig::AIConfig(const TQValueVector<AI::Element> &elements) + : TQWidget(0, "ai config") { - QGridLayout *top = new QGridLayout(this, 3, 2, KDialog::marginHint(), + TQGridLayout *top = new TQGridLayout(this, 3, 2, KDialog::marginHint(), KDialog::spacingHint()); - QLabel *label = new QLabel(i18n("Thinking depth:"), this); + TQLabel *label = new TQLabel(i18n("Thinking depth:"), this); top->addWidget(label, 0, 0); KIntNumInput *in = new KIntNumInput(this, "kcfg_ThinkingDepth"); in->setRange(minThinkingDepth, maxThinkingDepth); @@ -309,19 +309,19 @@ AIConfig::AIConfig(const QValueVector<AI::Element> &elements) top->addRowSpacing(1, KDialog::spacingHint()); - QGrid *grid = new QGrid(2, this); + TQGrid *grid = new TQGrid(2, this); top->addMultiCellWidget(grid, 2, 2, 0, 1); for (uint i=0; i<elements.size(); i++) { const AI::Data &data = *elements.at(i).data; - QLabel *label = new QLabel(i18n(data.label), grid); - if (data.whatsthis) QWhatsThis::add(label, i18n(data.whatsthis)); - label->setFrameStyle(QFrame::Panel | QFrame::Plain); + TQLabel *label = new TQLabel(i18n(data.label), grid); + if (data.whatsthis) TQWhatsThis::add(label, i18n(data.whatsthis)); + label->setFrameStyle(TQFrame::Panel | TQFrame::Plain); - QVBox *vb = new QVBox(grid); - if (data.whatsthis) QWhatsThis::add(vb, i18n(data.whatsthis)); + TQVBox *vb = new TQVBox(grid); + if (data.whatsthis) TQWhatsThis::add(vb, i18n(data.whatsthis)); vb->setMargin(KDialog::spacingHint()); vb->setSpacing(KDialog::spacingHint()); - vb->setFrameStyle(QFrame::Panel | QFrame::Plain); + vb->setFrameStyle(TQFrame::Panel | TQFrame::Plain); if (data.triggered) { KIntNumInput *trig = new KIntNumInput(vb, triggerKey(data.name)); trig->setRange(0, 10, 1, true); @@ -331,26 +331,26 @@ AIConfig::AIConfig(const QValueVector<AI::Element> &elements) } } -QCString AIConfig::triggerKey(const char *name) +TQCString AIConfig::triggerKey(const char *name) { - return "kcfg_Trigger_" + QCString(name); + return "kcfg_Trigger_" + TQCString(name); } -QCString AIConfig::coefficientKey(const char *name) +TQCString AIConfig::coefficientKey(const char *name) { - return "kcfg_Coefficient_" + QCString(name); + return "kcfg_Coefficient_" + TQCString(name); } double AIConfig::coefficient(const AI::Data &data) { - KConfigSkeletonItem *item = CommonPrefs::self()->findItem( QString("Coefficient_%1").arg(data.name) ); + KConfigSkeletonItem *item = CommonPrefs::self()->findItem( TQString("Coefficient_%1").arg(data.name) ); assert(item); return item->property().toDouble(); } int AIConfig::trigger(const AI::Data &data) { - KConfigSkeletonItem *item = CommonPrefs::self()->findItem( QString("Trigger_%1").arg(data.name) ); + KConfigSkeletonItem *item = CommonPrefs::self()->findItem( TQString("Trigger_%1").arg(data.name) ); assert(item); return item->property().toInt(); } diff --git a/libksirtet/common/ai.h b/libksirtet/common/ai.h index da298abc..b25a1d90 100644 --- a/libksirtet/common/ai.h +++ b/libksirtet/common/ai.h @@ -1,8 +1,8 @@ #ifndef COMMON_AI_H #define COMMON_AI_H -#include <qtimer.h> -#include <qvaluevector.h> +#include <tqtimer.h> +#include <tqvaluevector.h> #include <kdialogbase.h> #include <knuminput.h> @@ -62,7 +62,7 @@ class LIBKSIRTET_EXPORT AI : public QObject double coefficient; int trigger; }; - const QValueVector<Element> &elements() const { return _elements; } + const TQValueVector<Element> &elements() const { return _elements; } void settingsChanged(); @@ -86,13 +86,13 @@ class LIBKSIRTET_EXPORT AI : public QObject double points() const; void resizePieces(uint size); - QTimer timer; + TQTimer timer; enum ThinkState { Thinking, GivingOrders }; ThinkState state; uint thinkTime, orderTime; bool stopped; - QMemArray<AIPiece *> pieces; - QValueVector<Element> _elements; + TQMemArray<AIPiece *> pieces; + TQValueVector<Element> _elements; Board *main, *board; KRandomSequence random; @@ -107,14 +107,14 @@ class LIBKSIRTET_EXPORT AIConfig : public QWidget { Q_OBJECT public: - AIConfig(const QValueVector<AI::Element> &elements); + AIConfig(const TQValueVector<AI::Element> &elements); static double coefficient(const AI::Data &data); static int trigger(const AI::Data &data); private: - static QCString triggerKey(const char *name); - static QCString coefficientKey(const char *name); + static TQCString triggerKey(const char *name); + static TQCString coefficientKey(const char *name); static const uint minThinkingDepth, maxThinkingDepth; }; diff --git a/libksirtet/common/board.cpp b/libksirtet/common/board.cpp index f5f011a6..7a0802ad 100644 --- a/libksirtet/common/board.cpp +++ b/libksirtet/common/board.cpp @@ -11,7 +11,7 @@ #include "commonprefs.h" -Board::Board(bool graphic, GiftPool *gp, QWidget *parent) +Board::Board(bool graphic, GiftPool *gp, TQWidget *parent) : BaseBoard(graphic, parent), _giftPool(gp), aiEngine(0) {} diff --git a/libksirtet/common/board.h b/libksirtet/common/board.h index 97c37c17..7b9f0b3a 100644 --- a/libksirtet/common/board.h +++ b/libksirtet/common/board.h @@ -12,7 +12,7 @@ class LIBKSIRTET_EXPORT Board : public BaseBoard { Q_OBJECT public: - Board(bool graphic, GiftPool *, QWidget *parent); + Board(bool graphic, GiftPool *, TQWidget *parent); virtual ~Board(); void setType(bool computer); diff --git a/libksirtet/common/factory.cpp b/libksirtet/common/factory.cpp index 1b239a82..a93e6fe5 100644 --- a/libksirtet/common/factory.cpp +++ b/libksirtet/common/factory.cpp @@ -9,20 +9,20 @@ CommonFactory::CommonFactory(const MainData &md, const BaseBoardInfo &bbi, : BaseFactory(md, bbi), cbi(ci) {} -QWidget *CommonFactory::createAppearanceConfig() +TQWidget *CommonFactory::createAppearanceConfig() { return new AppearanceConfig; } -QWidget *CommonFactory::createGameConfig() +TQWidget *CommonFactory::createGameConfig() { return new GameConfig; } -QWidget *CommonFactory::createAIConfig() +TQWidget *CommonFactory::createAIConfig() { AI *ai = createAI(); - QWidget *cw = new AIConfig(ai->elements()); + TQWidget *cw = new AIConfig(ai->elements()); delete ai; return cw; } diff --git a/libksirtet/common/factory.h b/libksirtet/common/factory.h index c0b40d66..2d02dcb2 100644 --- a/libksirtet/common/factory.h +++ b/libksirtet/common/factory.h @@ -25,12 +25,12 @@ class LIBKSIRTET_EXPORT CommonFactory : public BaseFactory const CommonBoardInfo &cbi; - virtual BaseField *createField(QWidget *parent) = 0; + virtual BaseField *createField(TQWidget *parent) = 0; virtual AI *createAI() = 0; - QWidget *createAIConfig(); - virtual QWidget *createAppearanceConfig(); - virtual QWidget *createGameConfig(); + TQWidget *createAIConfig(); + virtual TQWidget *createAppearanceConfig(); + virtual TQWidget *createGameConfig(); }; #endif diff --git a/libksirtet/common/field.cpp b/libksirtet/common/field.cpp index 2d67062e..4c00ba4e 100644 --- a/libksirtet/common/field.cpp +++ b/libksirtet/common/field.cpp @@ -1,9 +1,9 @@ #include "field.h" #include "field.moc" -#include <qwhatsthis.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqwhatsthis.h> +#include <tqlabel.h> +#include <tqlayout.h> #include <klocale.h> #include <kprogress.h> @@ -19,7 +19,7 @@ #include "commonprefs.h" -Field::Field(QWidget *parent) +Field::Field(TQWidget *parent) : MPSimpleBoard(parent), BaseField(this) { // column 1 @@ -38,20 +38,20 @@ Field::Field(QWidget *parent) lcds->setRowStretch(4, 1); // level progress - levelLabel = new QLabel(this); + levelLabel = new TQLabel(this); levelLabel->setAlignment(AlignCenter); lcds->addWidget(levelLabel, 5, 0); toLevel = new KProgress(this); toLevel->setTextEnabled(true); toLevel->setFormat("1"); - QWhatsThis::add(toLevel, i18n("Display the progress to complete the current level or stage.")); + TQWhatsThis::add(toLevel, i18n("Display the progress to complete the current level or stage.")); lcds->addWidget(toLevel, 6, 0); lcds->setRowStretch(7, 1); // column 2 // previous player height prevHeight = new PlayerProgress(board, this, "prev_progress"); - QWhatsThis::add(prevHeight, i18n("Previous player's height")); + TQWhatsThis::add(prevHeight, i18n("Previous player's height")); top->addWidget(prevHeight, 1, 1, AlignHCenter); // column 3 @@ -61,22 +61,22 @@ Field::Field(QWidget *parent) // shadow piece shadow = new Shadow(board, this); - QWhatsThis::add(shadow, i18n("Shadow of the current piece")); + TQWhatsThis::add(shadow, i18n("Shadow of the current piece")); top->addWidget(shadow, 2, 2); // column 4 // next player height nextHeight = new PlayerProgress(board, this, "next_progress"); - QWhatsThis::add(nextHeight, i18n("Next player's height")); + TQWhatsThis::add(nextHeight, i18n("Next player's height")); top->addWidget(nextHeight, 1, 3, AlignHCenter); // column 5 // next piece shower - QVBoxLayout *vbl = new QVBoxLayout(10); + TQVBoxLayout *vbl = new TQVBoxLayout(10); top->addLayout(vbl, 1, 4); vbl->addStretch(1); - labShowNext = new QLabel(i18n("Next Tile"), this); + labShowNext = new TQLabel(i18n("Next Tile"), this); labShowNext->setAlignment(AlignCenter); vbl->addWidget(labShowNext, 0); showNext = new ShowNextPiece(board, this); @@ -85,16 +85,16 @@ Field::Field(QWidget *parent) vbl->addWidget(showNext, 0); vbl->addStretch(4); - connect(board, SIGNAL(scoreUpdated()), SLOT(scoreUpdatedSlot())); - connect(board, SIGNAL(levelUpdated()), SLOT(levelUpdated())); - connect(board, SIGNAL(removedUpdated()), SLOT(removedUpdated())); + connect(board, TQT_SIGNAL(scoreUpdated()), TQT_SLOT(scoreUpdatedSlot())); + connect(board, TQT_SIGNAL(levelUpdated()), TQT_SLOT(levelUpdated())); + connect(board, TQT_SIGNAL(removedUpdated()), TQT_SLOT(removedUpdated())); initVariableGUI(); } void Field::levelUpdated() { - toLevel->setFormat(QString::number(board->level())); + toLevel->setFormat(TQString::number(board->level())); // necessary to update string ... int p = toLevel->progress(); toLevel->setProgress(p+1); @@ -125,7 +125,7 @@ void Field::showOpponents(bool show) void Field::settingsChanged() { BaseField::settingsChanged(); - QColor color = BasePrefs::fadeColor(); + TQColor color = BasePrefs::fadeColor(); double s = BasePrefs::fadeIntensity(); _snRootPixmap->setFadeEffect(s, color); showNext->canvas()->setBackgroundColor(color); @@ -143,14 +143,14 @@ void Field::settingsChanged() } void Field::_init(bool AI, bool multiplayer, bool server, bool first, - const QString &name) + const TQString &name) { BaseField::init(AI, multiplayer, server, first, name); showOpponents(multiplayer); static_cast<Board *>(board)->setType(AI); } -void Field::_initFlag(QDataStream &s) +void Field::_initFlag(TQDataStream &s) { ServerInitData sid; s >> sid; @@ -173,20 +173,20 @@ void Field::initVariableGUI() scoreList->title()->setText(i18n("Elapsed time")); showScore->hide(); showTime->show(); - QWhatsThis::add(scoreList, i18n("Display the elapsed time.")); + TQWhatsThis::add(scoreList, i18n("Display the elapsed time.")); levelLabel->setText(i18n("Stage")); toLevel->setTotalSteps( board->arcadeTodo() ); } else { scoreList->title()->setText(i18n("Score")); showScore->show(); showTime->hide(); - QWhatsThis::add(scoreList, i18n("<qt>Display the current score.<br/>It turns <font color=\"blue\">blue</font> if it is a highscore and <font color=\"red\">red</font> if it is the best local score.</qt>")); + TQWhatsThis::add(scoreList, i18n("<qt>Display the current score.<br/>It turns <font color=\"blue\">blue</font> if it is a highscore and <font color=\"red\">red</font> if it is the best local score.</qt>")); levelLabel->setText(i18n("Level")); toLevel->setTotalSteps(cfactory->cbi.nbRemovedToLevel); } } -void Field::_playFlag(QDataStream &s) +void Field::_playFlag(TQDataStream &s) { ServerPlayData spd; s >> spd; @@ -210,7 +210,7 @@ void Field::_stopFlag(bool gameover) showTime->stop(); } -void Field::_dataOut(QDataStream &s) +void Field::_dataOut(TQDataStream &s) { _cpd.height = board->firstClearLine(); _cpd.end = static_cast<Board *>(board)->isGameOver(); @@ -227,7 +227,7 @@ KExtHighscore::Score Field::currentScore() const return score; } -void Field::_gameOverDataOut(QDataStream &s) +void Field::_gameOverDataOut(TQDataStream &s) { s << currentScore(); } diff --git a/libksirtet/common/field.h b/libksirtet/common/field.h index 8179539b..ce0168e6 100644 --- a/libksirtet/common/field.h +++ b/libksirtet/common/field.h @@ -19,7 +19,7 @@ class LIBKSIRTET_EXPORT Field : public MPSimpleBoard, public BaseField { Q_OBJECT public: - Field(QWidget *parent); + Field(TQWidget *parent); public slots: void moveLeft(); @@ -43,24 +43,24 @@ class LIBKSIRTET_EXPORT Field : public MPSimpleBoard, public BaseField KGameLCDClock *showTime; ShowNextPiece *showNext; KProgress *toLevel; - QLabel *labShowNext, *levelLabel; + TQLabel *labShowNext, *levelLabel; KGameProgress *prevHeight, *nextHeight; Shadow *shadow; KCanvasRootPixmap *_snRootPixmap; ClientPlayData _cpd; void _init(bool AI, bool multiplayer, bool server, bool first, - const QString &name); + const TQString &name); void showOpponents(bool show); void initVariableGUI(); - void _initFlag(QDataStream &); - void _playFlag(QDataStream &); + void _initFlag(TQDataStream &); + void _playFlag(TQDataStream &); void _pauseFlag(bool pause); void _stopFlag(bool gameover); - void _dataOut(QDataStream &); - void _gameOverDataOut(QDataStream &); - void _initDataOut(QDataStream &) {} + void _dataOut(TQDataStream &); + void _gameOverDataOut(TQDataStream &); + void _initDataOut(TQDataStream &) {} KExtHighscore::Score currentScore() const; }; diff --git a/libksirtet/common/highscores.cpp b/libksirtet/common/highscores.cpp index 799a31b9..459b35af 100644 --- a/libksirtet/common/highscores.cpp +++ b/libksirtet/common/highscores.cpp @@ -22,14 +22,14 @@ void CommonHighscores::convertLegacy(uint) { KConfigGroupSaver cg(kapp->config(), "High Scores"); for (uint i=0; i<10; i++) { - QString name - = cg.config()->readEntry(QString("name%1").arg(i), QString::null); + TQString name + = cg.config()->readEntry(TQString("name%1").arg(i), TQString::null); if ( name.isNull() ) break; if ( name.isEmpty() ) name = i18n("anonymous"); uint score - = cg.config()->readUnsignedNumEntry(QString("score%1").arg(i), 0); + = cg.config()->readUnsignedNumEntry(TQString("score%1").arg(i), 0); uint level - = cg.config()->readUnsignedNumEntry(QString("level%1").arg(i), 1); + = cg.config()->readUnsignedNumEntry(TQString("level%1").arg(i), 1); Score s(Won); s.setScore(score); s.setData("name", name); @@ -54,7 +54,7 @@ bool CommonHighscores::isStrictlyLess(const Score &s1, const Score &s2) const void CommonHighscores::additionalQueryItems(KURL &url, const Score &s) const { uint l = s.data("level").toUInt(); - addToQueryURL(url, "scoreLevel", QString::number(l)); + addToQueryURL(url, "scoreLevel", TQString::number(l)); uint r = s.data("removed").toUInt(); - addToQueryURL(url, "scoreRemoved", QString::number(r)); + addToQueryURL(url, "scoreRemoved", TQString::number(r)); } diff --git a/libksirtet/common/inter.cpp b/libksirtet/common/inter.cpp index e9f1688b..c5630108 100644 --- a/libksirtet/common/inter.cpp +++ b/libksirtet/common/inter.cpp @@ -12,17 +12,17 @@ const ActionData Interface::ACTION_DATA[Nb_Actions] = { - { I18N_NOOP("Move Left"), "move left", SLOT(moveLeft()), 0 }, - { I18N_NOOP("Move Right"), "move right", SLOT(moveRight()), 0 }, - { I18N_NOOP("Drop Down"), "drop down", SLOT(dropDownStart()), - SLOT(dropDownStop()) }, - { I18N_NOOP("One Line Down"), "one line down", SLOT(oneLineDown()), 0 }, - { I18N_NOOP("Rotate Left"), "rotate left", SLOT(rotateLeft()), 0 }, - { I18N_NOOP("Rotate Right"), "rotate right", SLOT(rotateRight()), 0 }, + { I18N_NOOP("Move Left"), "move left", TQT_SLOT(moveLeft()), 0 }, + { I18N_NOOP("Move Right"), "move right", TQT_SLOT(moveRight()), 0 }, + { I18N_NOOP("Drop Down"), "drop down", TQT_SLOT(dropDownStart()), + TQT_SLOT(dropDownStop()) }, + { I18N_NOOP("One Line Down"), "one line down", TQT_SLOT(oneLineDown()), 0 }, + { I18N_NOOP("Rotate Left"), "rotate left", TQT_SLOT(rotateLeft()), 0 }, + { I18N_NOOP("Rotate Right"), "rotate right", TQT_SLOT(rotateRight()), 0 }, { I18N_NOOP("Move to Left Column"), "move left total", - SLOT(moveLeftTotal()), 0 }, + TQT_SLOT(moveLeftTotal()), 0 }, { I18N_NOOP("Move to Right Column"), "move right total", - SLOT(moveRightTotal()), 0 } + TQT_SLOT(moveRightTotal()), 0 } }; const int Interface::KEYCODE_ONE[Nb_Actions] = { @@ -33,7 +33,7 @@ const int Interface::KEYCODE_TWO[Nb_Actions] = { Key_F, Key_G, Key_D, Key_Space, Key_E, Key_C, SHIFT+Key_F, SHIFT+Key_G }; -Interface::Interface(const MPGameInfo &gi, QWidget *parent) +Interface::Interface(const MPGameInfo &gi, TQWidget *parent) : MPSimpleInterface(gi, Nb_Actions, ACTION_DATA, parent) { setDefaultKeycodes(1, 0, KEYCODE_ONE); @@ -45,7 +45,7 @@ MPBoard *Interface::newBoard(uint i) { Field *f = static_cast<Field *>(cfactory->createField(this)); f->settingsChanged(); - connect(this, SIGNAL(settingsChanged()), f, SLOT(settingsChanged())); + connect(this, TQT_SIGNAL(settingsChanged()), f, TQT_SLOT(settingsChanged())); if ( i==0 ) _firstField = f; return f; } @@ -91,7 +91,7 @@ void Interface::_sendPlayData() } } -void Interface::_showHighscores(QWidget *parent) +void Interface::_showHighscores(TQWidget *parent) { if ( !server() || nbPlayers()!=1 ) _scores.show(parent); else BaseInterface::_showHighscores(parent); @@ -132,7 +132,7 @@ void Interface::_treatInit() } } -void Interface::_sendGameOverData(QDataStream &s) +void Interface::_sendGameOverData(TQDataStream &s) { bool multiplayers = ( nbPlayers()>1 ); for (uint i=0; i<nbPlayers(); i++) { @@ -144,7 +144,7 @@ void Interface::_sendGameOverData(QDataStream &s) } // client only -void Interface::_readGameOverData(QDataStream &s) +void Interface::_readGameOverData(TQDataStream &s) { s >> _scores; } diff --git a/libksirtet/common/inter.h b/libksirtet/common/inter.h index e38c2ed5..02041afa 100644 --- a/libksirtet/common/inter.h +++ b/libksirtet/common/inter.h @@ -16,7 +16,7 @@ class LIBKSIRTET_EXPORT Interface : public MPSimpleInterface, public BaseInterfa { Q_OBJECT public: - Interface(const MPGameInfo &, QWidget *parent); + Interface(const MPGameInfo &, TQWidget *parent); signals: void settingsChanged(); @@ -27,10 +27,10 @@ public slots: void settingsChangedSlot() { emit settingsChanged(); } protected: - void _showHighscores(QWidget *parent); + void _showHighscores(TQWidget *parent); private: - QMemArray<ClientPlayData> _data; + TQMemArray<ClientPlayData> _data; KExtHighscore::Score _score; KExtHighscore::MultiplayerScores _scores; Field *_firstField; @@ -45,8 +45,8 @@ private: uint prev(uint i) const; uint next(uint i) const; - void _readGameOverData(QDataStream &s); - void _sendGameOverData(QDataStream &s); + void _readGameOverData(TQDataStream &s); + void _sendGameOverData(TQDataStream &s); void _firstInit() {} void _treatInit(); void _init(); diff --git a/libksirtet/common/main.cpp b/libksirtet/common/main.cpp index 004b86ca..e7674846 100644 --- a/libksirtet/common/main.cpp +++ b/libksirtet/common/main.cpp @@ -12,7 +12,7 @@ void MainWindow::addConfig(KConfigDialog *dialog) { - QWidget *w = cfactory->createAIConfig(); + TQWidget *w = cfactory->createAIConfig(); if (w) dialog->addPage(w, i18n("A.I."), "personal"); } @@ -24,23 +24,23 @@ void MainWindow::init() // Modes bool ama = ( bfactory->bbi.nbArcadeStages!=0 ); - QString s = (ama ? i18n("&Single Human (Normal)") : i18n("&Single Human")); - (void)new KAction(s, 0, inter, SLOT(normalGame()), + TQString s = (ama ? i18n("&Single Human (Normal)") : i18n("&Single Human")); + (void)new KAction(s, 0, inter, TQT_SLOT(normalGame()), actionCollection(), "mp_single_human"); if (ama) (void)new KAction(i18n("&Single Human (Arcade)"), 0, - inter, SLOT(arcadeGame()), + inter, TQT_SLOT(arcadeGame()), actionCollection(), "mp_arcade"); - (void)new KAction(i18n("Human vs &Human"), 0, inter, SLOT(humanVsHuman()), + (void)new KAction(i18n("Human vs &Human"), 0, inter, TQT_SLOT(humanVsHuman()), actionCollection(), "mp_human_vs_human"); (void)new KAction(i18n("Human vs &Computer"), 0, - inter, SLOT(humanVsComputer()), + inter, TQT_SLOT(humanVsComputer()), actionCollection(), "mp_human_vs_computer"); - (void)new KAction(i18n("&More..."), 0, inter, SLOT(dialog()), + (void)new KAction(i18n("&More..."), 0, inter, TQT_SLOT(dialog()), actionCollection(), "mp_more"); buildGUI(inter); - connect(this, SIGNAL(settingsChanged()), - inter, SLOT(settingsChangedSlot())); + connect(this, TQT_SIGNAL(settingsChanged()), + inter, TQT_SLOT(settingsChangedSlot())); } void MainWindow::addKeys(KKeyDialog &d) @@ -53,7 +53,7 @@ void MainWindow::saveKeys() static_cast<Interface *>(_inter)->saveKeys(); } -void MainWindow::focusInEvent(QFocusEvent *e) +void MainWindow::focusInEvent(TQFocusEvent *e) { static_cast<Interface *>(_inter)->setFocus(); BaseMainWindow::focusInEvent(e); diff --git a/libksirtet/common/main.h b/libksirtet/common/main.h index d22b7273..a98fc6f1 100644 --- a/libksirtet/common/main.h +++ b/libksirtet/common/main.h @@ -16,7 +16,7 @@ protected: void addConfig(KConfigDialog *); void addKeys(KKeyDialog &); void saveKeys(); - virtual void focusInEvent(QFocusEvent *e); + virtual void focusInEvent(TQFocusEvent *e); }; #endif diff --git a/libksirtet/common/misc_ui.cpp b/libksirtet/common/misc_ui.cpp index 45cfb440..cf802e25 100644 --- a/libksirtet/common/misc_ui.cpp +++ b/libksirtet/common/misc_ui.cpp @@ -1,7 +1,7 @@ #include "misc_ui.h" #include "misc_ui.moc" -#include <qpainter.h> +#include <tqpainter.h> #include "base/piece.h" #include "base/board.h" @@ -24,32 +24,32 @@ const uint LED_HEIGHT = 15; const uint LED_SPACING = 5; /*****************************************************************************/ -ShowNextPiece::ShowNextPiece(BaseBoard *board, QWidget *parent) +ShowNextPiece::ShowNextPiece(BaseBoard *board, TQWidget *parent) : FixedCanvasView(parent, "show_next_piece") { setCanvas(board->next()); - setFrameStyle(QFrame::Panel | QFrame::Sunken); + setFrameStyle(TQFrame::Panel | TQFrame::Sunken); KZoomMainWindow::addWidget(this); } /*****************************************************************************/ -Shadow::Shadow(BaseBoard *board, QWidget *parent) - : QWidget(parent, "shadow"), _xOffset(board->frameWidth()), +Shadow::Shadow(BaseBoard *board, TQWidget *parent) + : TQWidget(parent, "shadow"), _xOffset(board->frameWidth()), _board(board), _show(false) { KZoomMainWindow::addWidget(this); - connect(board, SIGNAL(updatePieceConfigSignal()), SLOT(update())); + connect(board, TQT_SIGNAL(updatePieceConfigSignal()), TQT_SLOT(update())); } -QSize Shadow::sizeHint() const +TQSize Shadow::sizeHint() const { - return QSize(_xOffset + _board->matrix().width() * BasePrefs::blockSize(), + return TQSize(_xOffset + _board->matrix().width() * BasePrefs::blockSize(), SHADOW_HEIGHT); } -QSizePolicy Shadow::sizePolicy() const +TQSizePolicy Shadow::sizePolicy() const { - return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); } void Shadow::setDisplay(bool show) @@ -58,7 +58,7 @@ void Shadow::setDisplay(bool show) update(); } -void Shadow::paintEvent(QPaintEvent *) +void Shadow::paintEvent(TQPaintEvent *) { if ( !_show ) return; @@ -66,11 +66,11 @@ void Shadow::paintEvent(QPaintEvent *) uint pf = piece->min().first + _board->currentPos().first; uint pl = pf + piece->size().first - 1; - QPainter p(this); + TQPainter p(this); p.setBrush(black); p.setPen(black); for (uint i=pf; i<=pl; i++) { - QRect r(_xOffset + i * BasePrefs::blockSize() + 1 , 0, + TQRect r(_xOffset + i * BasePrefs::blockSize() + 1 , 0, BasePrefs::blockSize() - 2, SHADOW_HEIGHT); p.drawRect(r); } @@ -81,32 +81,32 @@ void Shadow::paintEvent(QPaintEvent *) class Led : public QWidget { public: - Led(const QColor &c, QWidget *parent) - : QWidget(parent), col(c), _on(FALSE) {} + Led(const TQColor &c, TQWidget *parent) + : TQWidget(parent), col(c), _on(FALSE) {} - QSizePolicy sizePolicy() const - { return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); } - QSize sizeHint() const { return QSize(LED_WIDTH, LED_HEIGHT); } + TQSizePolicy sizePolicy() const + { return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); } + TQSize sizeHint() const { return TQSize(LED_WIDTH, LED_HEIGHT); } void on() { if (!_on) { _on = TRUE; repaint(); } } void off() { if (_on) {_on = FALSE; repaint(); } } - void setColor(const QColor &c) { if (c!=col) { col = c; repaint(); } } + void setColor(const TQColor &c) { if (c!=col) { col = c; repaint(); } } protected: - void paintEvent(QPaintEvent *) { - QPainter p(this); + void paintEvent(TQPaintEvent *) { + TQPainter p(this); p.setBrush((_on ? col.light() : col.dark())); p.setPen(black); p.drawEllipse(0, 0, width(), height()); } private: - QColor col; + TQColor col; bool _on; }; -GiftPool::GiftPool(QWidget *parent) - : QHBox(parent, "gift_pool"), nb(0), ready(false) +GiftPool::GiftPool(TQWidget *parent) + : TQHBox(parent, "gift_pool"), nb(0), ready(false) { setSpacing(LED_SPACING); leds.resize(cfactory->cbi.nbGiftLeds); @@ -114,23 +114,23 @@ GiftPool::GiftPool(QWidget *parent) leds.insert(i, new Led(yellow, this)); } -QSize GiftPool::sizeHint() const +TQSize GiftPool::sizeHint() const { - QSize s = (leds.size() ? leds[0]->sizeHint() : QSize()); - return QSize((s.width()+LED_SPACING)*leds.size()-LED_SPACING, s.height()); + TQSize s = (leds.size() ? leds[0]->sizeHint() : TQSize()); + return TQSize((s.width()+LED_SPACING)*leds.size()-LED_SPACING, s.height()); } -QSizePolicy GiftPool::sizePolicy() const +TQSizePolicy GiftPool::sizePolicy() const { - return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); } void GiftPool::put(uint n) { if ( n==0 ) return; if ( nb==0 && !ready ) - QTimer::singleShot(cfactory->cbi.giftPoolTimeout, - this, SLOT(timeout())); + TQTimer::singleShot(cfactory->cbi.giftPoolTimeout, + this, TQT_SLOT(timeout())); uint e = QMIN(nb+n, leds.size()); for (uint i=nb; i<e; i++) leds[i]->on(); uint f = QMIN(nb+n-e, leds.size()); @@ -171,7 +171,7 @@ void GiftPool::reset() } //----------------------------------------------------------------------------- -PlayerProgress::PlayerProgress(BaseBoard *board, QWidget *parent, +PlayerProgress::PlayerProgress(BaseBoard *board, TQWidget *parent, const char *name) : KGameProgress(0, board->matrix().height(), 0, KGameProgress::Vertical, parent, name), _board(board) @@ -182,13 +182,13 @@ PlayerProgress::PlayerProgress(BaseBoard *board, QWidget *parent, KZoomMainWindow::addWidget(this); } -QSize PlayerProgress::sizeHint() const +TQSize PlayerProgress::sizeHint() const { - return QSize(10, _board->matrix().height() * BasePrefs::blockSize()) - + 2 * QSize(frameWidth(), frameWidth()); + return TQSize(10, _board->matrix().height() * BasePrefs::blockSize()) + + 2 * TQSize(frameWidth(), frameWidth()); } -QSizePolicy PlayerProgress::sizePolicy() const +TQSizePolicy PlayerProgress::sizePolicy() const { - return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); } diff --git a/libksirtet/common/misc_ui.h b/libksirtet/common/misc_ui.h index 3a89acaa..38544a02 100644 --- a/libksirtet/common/misc_ui.h +++ b/libksirtet/common/misc_ui.h @@ -1,9 +1,9 @@ #ifndef COMMON_MISC_UI_H #define COMMON_MISC_UI_H -#include <qcanvas.h> -#include <qptrvector.h> -#include <qhbox.h> +#include <tqcanvas.h> +#include <tqptrvector.h> +#include <tqhbox.h> #include <kgameprogress.h> #include "lib/libksirtet_export.h" @@ -15,7 +15,7 @@ class LIBKSIRTET_EXPORT ShowNextPiece : public FixedCanvasView { Q_OBJECT public: - ShowNextPiece(BaseBoard *, QWidget *parent); + ShowNextPiece(BaseBoard *, TQWidget *parent); }; /*****************************************************************************/ @@ -23,10 +23,10 @@ class LIBKSIRTET_EXPORT Shadow : public QWidget { Q_OBJECT public: - Shadow(BaseBoard *, QWidget *parent); + Shadow(BaseBoard *, TQWidget *parent); - virtual QSize sizeHint() const; - virtual QSizePolicy sizePolicy() const; + virtual TQSize sizeHint() const; + virtual TQSizePolicy sizePolicy() const; void setDisplay(bool show); private: @@ -34,7 +34,7 @@ class LIBKSIRTET_EXPORT Shadow : public QWidget const BaseBoard *_board; bool _show; - void paintEvent(QPaintEvent *); + void paintEvent(TQPaintEvent *); }; /*****************************************************************************/ @@ -44,10 +44,10 @@ class LIBKSIRTET_EXPORT GiftPool : public QHBox { Q_OBJECT public: - GiftPool(QWidget *parent); + GiftPool(TQWidget *parent); - virtual QSize sizeHint() const; - virtual QSizePolicy sizePolicy() const; + virtual TQSize sizeHint() const; + virtual TQSizePolicy sizePolicy() const; void reset(); void put(uint); @@ -58,7 +58,7 @@ class LIBKSIRTET_EXPORT GiftPool : public QHBox void timeout() { ready = true; } private: - QPtrVector<Led> leds; + TQPtrVector<Led> leds; uint _timeout, nb; bool ready; }; @@ -69,10 +69,10 @@ class LIBKSIRTET_EXPORT PlayerProgress : public KGameProgress { Q_OBJECT public: - PlayerProgress(BaseBoard *board, QWidget *parent = 0, const char *name = 0); + PlayerProgress(BaseBoard *board, TQWidget *parent = 0, const char *name = 0); - virtual QSize sizeHint() const; - virtual QSizePolicy sizePolicy() const; + virtual TQSize sizeHint() const; + virtual TQSizePolicy sizePolicy() const; private: BaseBoard *_board; diff --git a/libksirtet/common/settings.cpp b/libksirtet/common/settings.cpp index 902d1e56..058de034 100644 --- a/libksirtet/common/settings.cpp +++ b/libksirtet/common/settings.cpp @@ -1,10 +1,10 @@ #include "settings.h" #include "settings.moc" -#include <qlabel.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qwhatsthis.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqwhatsthis.h> #include <klocale.h> #include <knuminput.h> @@ -18,26 +18,26 @@ AppearanceConfig::AppearanceConfig() int row = _grid->numRows(); int col = _grid->numCols(); - QCheckBox *cb = new QCheckBox(i18n("Show piece's shadow"), _main, "kcfg_ShowPieceShadow"); + TQCheckBox *cb = new TQCheckBox(i18n("Show piece's shadow"), _main, "kcfg_ShowPieceShadow"); _grid->addMultiCellWidget(cb, row, row, 0, col-1); - cb = new QCheckBox(i18n("Show next piece"), _main, "kcfg_ShowNextPiece"); + cb = new TQCheckBox(i18n("Show next piece"), _main, "kcfg_ShowNextPiece"); _grid->addMultiCellWidget(cb, row+1, row+1, 0, col-1); - cb = new QCheckBox(i18n("Show detailed \"removed lines\" field"), _main, "kcfg_ShowDetailedRemoved"); + cb = new TQCheckBox(i18n("Show detailed \"removed lines\" field"), _main, "kcfg_ShowDetailedRemoved"); _grid->addMultiCellWidget(cb, row+2, row+2, 0, col-1); } //----------------------------------------------------------------------------- GameConfig::GameConfig() - : QWidget(0, "game config") + : TQWidget(0, "game config") { - QVBoxLayout *top = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *top = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - _grid = new QGridLayout(top, 3, 2); + _grid = new TQGridLayout(top, 3, 2); _grid->setColStretch(1, 1); - QLabel *label = new QLabel(i18n("Initial level:"), this); + TQLabel *label = new TQLabel(i18n("Initial level:"), this); _grid->addWidget(label, 0, 0); KIntNumInput *in = new KIntNumInput(this, "kcfg_InitialGameLevel"); in->setRange(1, 20, 1, true); @@ -45,8 +45,8 @@ GameConfig::GameConfig() _grid->addRowSpacing(1, KDialog::spacingHint()); - QCheckBox *cb = new QCheckBox(i18n("Direct drop down"), this, "kcfg_DirectDropDownEnabled"); - QWhatsThis::add(cb, i18n("Drop down is not stopped when drop down key is released.")); + TQCheckBox *cb = new TQCheckBox(i18n("Direct drop down"), this, "kcfg_DirectDropDownEnabled"); + TQWhatsThis::add(cb, i18n("Drop down is not stopped when drop down key is released.")); _grid->addMultiCellWidget(cb, 2, 2, 0, 1); top->addStretch(1); diff --git a/libksirtet/common/settings.h b/libksirtet/common/settings.h index ceda13a1..2a554e8d 100644 --- a/libksirtet/common/settings.h +++ b/libksirtet/common/settings.h @@ -22,7 +22,7 @@ public: GameConfig(); protected: - QGridLayout *_grid; + TQGridLayout *_grid; }; #endif diff --git a/libksirtet/common/types.cpp b/libksirtet/common/types.cpp index 05d91db3..e7876c76 100644 --- a/libksirtet/common/types.cpp +++ b/libksirtet/common/types.cpp @@ -1,16 +1,16 @@ #include "types.h" -LIBKSIRTET_EXPORT QDataStream &operator <<(QDataStream &s, const ClientPlayData &d) +LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ClientPlayData &d) { s << d.height << d.gift << d.end; return s; } -LIBKSIRTET_EXPORT QDataStream &operator >>(QDataStream &s, ClientPlayData &d) +LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ClientPlayData &d) { s >> d.height >> d.gift >> d.end; return s; } -LIBKSIRTET_EXPORT QDataStream &operator <<(QDataStream &s, const ServerPlayData &d) +LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ServerPlayData &d) { s << d.prevHeight << d.nextHeight << d.gift; return s; } -LIBKSIRTET_EXPORT QDataStream &operator >>(QDataStream &s, ServerPlayData &d) +LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ServerPlayData &d) { s >> d.prevHeight >> d.nextHeight >> d.gift; return s; } -LIBKSIRTET_EXPORT QDataStream &operator <<(QDataStream &s, const ServerInitData &d) +LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ServerInitData &d) { s << d.initLevel << d.seed << d.nextName << d.prevName << d.name; return s; } -LIBKSIRTET_EXPORT QDataStream &operator >>(QDataStream &s, ServerInitData &d) +LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ServerInitData &d) { s >> d.initLevel >> d.seed >> d.nextName >> d.prevName >> d.name; return s; } diff --git a/libksirtet/common/types.h b/libksirtet/common/types.h index 8a30d276..5b85f302 100644 --- a/libksirtet/common/types.h +++ b/libksirtet/common/types.h @@ -1,26 +1,26 @@ #ifndef COMMON_TYPES_H #define COMMON_TYPES_H -#include <qdatastream.h> +#include <tqdatastream.h> #include "lib/libksirtet_export.h" struct ClientPlayData { Q_UINT8 height, gift, end; }; -LIBKSIRTET_EXPORT QDataStream &operator <<(QDataStream &s, const ClientPlayData &d); -LIBKSIRTET_EXPORT QDataStream &operator >>(QDataStream &s, ClientPlayData &d); +LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ClientPlayData &d); +LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ClientPlayData &d); struct ServerPlayData { Q_UINT8 prevHeight, nextHeight, gift; }; -LIBKSIRTET_EXPORT QDataStream &operator <<(QDataStream &s, const ServerPlayData &d); -LIBKSIRTET_EXPORT QDataStream &operator >>(QDataStream &s, ServerPlayData &d); +LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ServerPlayData &d); +LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ServerPlayData &d); class ServerInitData { public: - QString prevName, nextName, name; + TQString prevName, nextName, name; Q_UINT32 initLevel, seed; }; -LIBKSIRTET_EXPORT QDataStream &operator <<(QDataStream &s, const ServerInitData &d); -LIBKSIRTET_EXPORT QDataStream &operator >>(QDataStream &s, ServerInitData &d); +LIBKSIRTET_EXPORT TQDataStream &operator <<(TQDataStream &s, const ServerInitData &d); +LIBKSIRTET_EXPORT TQDataStream &operator >>(TQDataStream &s, ServerInitData &d); #endif |