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 /kfouleggs | |
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 'kfouleggs')
-rw-r--r-- | kfouleggs/board.cpp | 4 | ||||
-rw-r--r-- | kfouleggs/board.h | 4 | ||||
-rw-r--r-- | kfouleggs/field.cpp | 12 | ||||
-rw-r--r-- | kfouleggs/field.h | 2 | ||||
-rw-r--r-- | kfouleggs/main.cpp | 2 | ||||
-rw-r--r-- | kfouleggs/main.h | 6 | ||||
-rw-r--r-- | kfouleggs/piece.cpp | 38 | ||||
-rw-r--r-- | kfouleggs/piece.h | 8 |
8 files changed, 38 insertions, 38 deletions
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<bool> free(matrix().width()); + TQMemArray<bool> 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<int> _field; - QMemArray<uint> _groups, _chainedPuyos; + TQMemArray<uint> _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 <qwhatsthis.h> +#include <tqwhatsthis.h> #include <klocale.h> #include <kgamelcd.h> @@ -10,11 +10,11 @@ #include "board.h" -FEField::FEField(QWidget *parent) +FEField::FEField(TQWidget *parent) : Field(parent) { Board *b = static_cast<Board *>(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<const FEBoard *>(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 <math.h> -#include <qpainter.h> -#include <qbitmap.h> +#include <tqpainter.h> +#include <tqbitmap.h> #include <klocale.h> @@ -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, |