From 576eb4299a00bc053db35414406f46372a0f70f2 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:42:31 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kfouleggs/board.cpp | 4 ++-- kfouleggs/board.h | 4 ++-- kfouleggs/field.cpp | 12 ++++++------ kfouleggs/field.h | 2 +- kfouleggs/main.cpp | 2 +- kfouleggs/main.h | 6 +++--- kfouleggs/piece.cpp | 38 +++++++++++++++++++------------------- kfouleggs/piece.h | 8 ++++---- 8 files changed, 38 insertions(+), 38 deletions(-) (limited to 'kfouleggs') diff --git a/kfouleggs/board.cpp b/kfouleggs/board.cpp index 836c7e1e..5383c619 100644 --- a/kfouleggs/board.cpp +++ b/kfouleggs/board.cpp @@ -9,7 +9,7 @@ using namespace KGrid2D; -FEBoard::FEBoard(bool graphic, QWidget *parent) +FEBoard::FEBoard(bool graphic, TQWidget *parent) : Board(graphic, new GiftPool(parent), parent), _field(matrix().width(), matrix().height()), _chainedPuyos(4) { @@ -126,7 +126,7 @@ uint FEBoard::gift() bool FEBoard::putGift(uint n) { - QMemArray free(matrix().width()); + TQMemArray free(matrix().width()); // garbage blocks are put randomly on conlumns with more than 5 free lines. uint nbFree = 0; diff --git a/kfouleggs/board.h b/kfouleggs/board.h index e0889b3b..da5a6275 100644 --- a/kfouleggs/board.h +++ b/kfouleggs/board.h @@ -8,7 +8,7 @@ class FEBoard : public Board { Q_OBJECT public: - FEBoard(bool graphic, QWidget *parent); + FEBoard(bool graphic, TQWidget *parent); void copy(const GenericTetris &); void start(const GTInitData &); @@ -37,7 +37,7 @@ class FEBoard : public Board bool putGift(uint); KGrid2D::Square _field; - QMemArray _groups, _chainedPuyos; + TQMemArray _groups, _chainedPuyos; uint _nbPuyos, _chained, _giftRest, _lastChained; }; diff --git a/kfouleggs/field.cpp b/kfouleggs/field.cpp index 9d7abe85..ae9bcdce 100644 --- a/kfouleggs/field.cpp +++ b/kfouleggs/field.cpp @@ -1,7 +1,7 @@ #include "field.h" #include "field.moc" -#include +#include #include #include @@ -10,11 +10,11 @@ #include "board.h" -FEField::FEField(QWidget *parent) +FEField::FEField(TQWidget *parent) : Field(parent) { Board *b = static_cast(board); - QWhatsThis::add(b->giftPool(), i18n("Display the amount of foul eggs sent by your opponent.")); + TQWhatsThis::add(b->giftPool(), i18n("Display the amount of foul eggs sent by your opponent.")); } void FEField::removedUpdated() @@ -45,17 +45,17 @@ void FEField::settingsChanged() lcd->show(); if ( CommonPrefs::showDetailedRemoved() ) { - QWhatsThis::add(removedList, + TQWhatsThis::add(removedList, i18n("Display the number of removed groups (\"puyos\") classified by the number of chained removal.")); for (uint i=0; i<4; i++) { KGameLCD *lcd = new KGameLCD(6, removedList); - QString s = (i==3 ? ">3" : QString::number(i)); + TQString s = (i==3 ? ">3" : TQString::number(i)); removedList->append(s, lcd); uint nb = static_cast(board)->nbChainedPuyos(i); lcd->displayInt(nb); lcd->show(); } } else - QWhatsThis::add(removedList, + TQWhatsThis::add(removedList, i18n("Display the number of removed groups (\"puyos\").")); } diff --git a/kfouleggs/field.h b/kfouleggs/field.h index df7812f2..a1c9824e 100644 --- a/kfouleggs/field.h +++ b/kfouleggs/field.h @@ -9,7 +9,7 @@ class FEField : public Field { Q_OBJECT public: - FEField(QWidget *parent); + FEField(TQWidget *parent); private slots: virtual void removedUpdated(); diff --git a/kfouleggs/main.cpp b/kfouleggs/main.cpp index 4fbee4c7..89295d08 100644 --- a/kfouleggs/main.cpp +++ b/kfouleggs/main.cpp @@ -65,7 +65,7 @@ FEFactory::FEFactory() : CommonFactory(MAIN_DATA, BASE_BOARD_INFO, COMMON_BOARD_INFO) {} -BaseInterface *FEFactory::createInterface(QWidget *parent) +BaseInterface *FEFactory::createInterface(TQWidget *parent) { return new Interface(MP_GAME_INFO, parent); } diff --git a/kfouleggs/main.h b/kfouleggs/main.h index 5831d546..52108b2d 100644 --- a/kfouleggs/main.h +++ b/kfouleggs/main.h @@ -15,11 +15,11 @@ class FEFactory : public CommonFactory FEFactory(); protected: - virtual BaseBoard *createBoard(bool graphic, QWidget *parent) + virtual BaseBoard *createBoard(bool graphic, TQWidget *parent) { return new FEBoard(graphic, parent); } - virtual BaseField *createField(QWidget *parent) + virtual BaseField *createField(TQWidget *parent) { return new FEField(parent); } - virtual BaseInterface *createInterface(QWidget *parent); + virtual BaseInterface *createInterface(TQWidget *parent); virtual AI *createAI() { return new FEAI; } }; diff --git a/kfouleggs/piece.cpp b/kfouleggs/piece.cpp index 3c676f1c..bb5aad42 100644 --- a/kfouleggs/piece.cpp +++ b/kfouleggs/piece.cpp @@ -2,8 +2,8 @@ #include -#include -#include +#include +#include #include @@ -19,45 +19,45 @@ const char *FEPieceInfo::DEFAULT_COLORS[NB_NORM_BLOCK_TYPES + 1] = { "#64C864", "#64C8C8", "#C86464", "#C864C8", "#C8C8C8" }; -QColor FEPieceInfo::defaultColor(uint i) const +TQColor FEPieceInfo::defaultColor(uint i) const { - if ( i>=nbColors() ) return QColor(); - return QColor(DEFAULT_COLORS[i]); + if ( i>=nbColors() ) return TQColor(); + return TQColor(DEFAULT_COLORS[i]); } -QString FEPieceInfo::colorLabel(uint i) const +TQString FEPieceInfo::colorLabel(uint i) const { return (i==NB_NORM_BLOCK_TYPES ? i18n("Garbage color:") : i18n("Color #%1:").arg(i+1)); } -void FEPieceInfo::draw(QPixmap *pixmap, uint blockType, uint, +void FEPieceInfo::draw(TQPixmap *pixmap, uint blockType, uint, bool lighted) const { - QColor col = color(blockType); + TQColor col = color(blockType); if (lighted) col = col.light(); pixmap->fill(col); } -void FEPieceInfo::setMask(QPixmap *pixmap, uint blockMode) const +void FEPieceInfo::setMask(TQPixmap *pixmap, uint blockMode) const { Q_ASSERT( pixmap->width()==pixmap->height() ); // drawing code assumes that - QBitmap bitmap(pixmap->size(), true); - QPainter p(&bitmap); + TQBitmap bitmap(pixmap->size(), true); + TQPainter p(&bitmap); p.setBrush(Qt::color1); - p.setPen( QPen(Qt::NoPen) ); + p.setPen( TQPen(Qt::NoPen) ); // base circle int w = pixmap->width(); int d = (int)((sqrt(2)-2./3)*w); - QRect cr = QRect(0, 0, d, d); - cr.moveCenter(QPoint(w/2, w/2)); + TQRect cr = TQRect(0, 0, d, d); + cr.moveCenter(TQPoint(w/2, w/2)); p.drawEllipse(cr); if (blockMode) { int a = (int)(w/(3.*sqrt(2))); int ra = 2*w/3+1; - cr = QRect(0, 0, ra, ra); + cr = TQRect(0, 0, ra, ra); // first drawing with color1 if ( blockMode & BaseBoard::Up ) p.drawRect( 0, 0, w, a); @@ -68,19 +68,19 @@ void FEPieceInfo::setMask(QPixmap *pixmap, uint blockMode) const // second drawing with color0 p.setBrush(Qt::color0); if ( (blockMode & BaseBoard::Up) || (blockMode & BaseBoard::Left) ) { - cr.moveCenter(QPoint(0, 0)); + cr.moveCenter(TQPoint(0, 0)); p.drawEllipse(cr); } if ( (blockMode & BaseBoard::Right) || (blockMode & BaseBoard::Up) ) { - cr.moveCenter(QPoint(w-1, 0)); + cr.moveCenter(TQPoint(w-1, 0)); p.drawEllipse(cr); } if ( (blockMode & BaseBoard::Down) || (blockMode & BaseBoard::Right) ){ - cr.moveCenter(QPoint(w-1, w-1)); + cr.moveCenter(TQPoint(w-1, w-1)); p.drawEllipse(cr); } if ( (blockMode & BaseBoard::Left) || (blockMode & BaseBoard::Down) ) { - cr.moveCenter(QPoint(0, w-1)); + cr.moveCenter(TQPoint(0, w-1)); p.drawEllipse(cr); } } diff --git a/kfouleggs/piece.h b/kfouleggs/piece.h index ba90e902..e7b23e1e 100644 --- a/kfouleggs/piece.h +++ b/kfouleggs/piece.h @@ -27,12 +27,12 @@ class FEPieceInfo : public GPieceInfo virtual uint nbBlockModes() const { return NB_BLOCK_MODES; } virtual uint nbColors() const { return NB_NORM_BLOCK_TYPES + 1; } - virtual QString colorLabel(uint i) const; - virtual QColor defaultColor(uint i) const; + virtual TQString colorLabel(uint i) const; + virtual TQColor defaultColor(uint i) const; private: - void draw(QPixmap *, uint blockType, uint blockMode, bool lighted) const; - void setMask(QPixmap *, uint blockMode) const; + void draw(TQPixmap *, uint blockType, uint blockMode, bool lighted) const; + void setMask(TQPixmap *, uint blockMode) const; enum { NB_BLOCKS = 2, NB_NORM_BLOCK_TYPES = 4, -- cgit v1.2.1