diff options
Diffstat (limited to 'libksirtet')
67 files changed, 766 insertions, 766 deletions
diff --git a/libksirtet/base/board.cpp b/libksirtet/base/board.cpp index 257e72c3..12193e31 100644 --- a/libksirtet/base/board.cpp +++ b/libksirtet/base/board.cpp @@ -12,14 +12,14 @@ using namespace KGrid2D; //----------------------------------------------------------------------------- -FixedCanvasView::FixedCanvasView(QWidget *parent, const char *name) - : QCanvasView(parent, name, WNoAutoErase) +FixedCanvasView::FixedCanvasView(TQWidget *parent, const char *name) + : TQCanvasView(parent, name, WNoAutoErase) {} -QSize FixedCanvasView::sizeHint() const +TQSize FixedCanvasView::sizeHint() const { - if ( canvas()==0 ) return QSize(); - return canvas()->size() + 2 * QSize(frameWidth(), frameWidth()); + if ( canvas()==0 ) return TQSize(); + return canvas()->size() + 2 * TQSize(frameWidth(), frameWidth()); } void FixedCanvasView::adjustSize() @@ -35,7 +35,7 @@ const BaseBoard::DirectionData BaseBoard::DIRECTION_DATA[Nb_Direction] = { { SquareBase::Up, Down } }; -BaseBoard::BaseBoard(bool graphic, QWidget *parent) +BaseBoard::BaseBoard(bool graphic, TQWidget *parent) : FixedCanvasView(parent, "board"), GenericTetris(bfactory->bbi.width, bfactory->bbi.height, bfactory->bbi.withPieces, graphic), @@ -45,7 +45,7 @@ BaseBoard::BaseBoard(bool graphic, QWidget *parent) if (graphic) { setVScrollBarMode(AlwaysOff); setHScrollBarMode(AlwaysOff); - setFrameStyle( QFrame::Panel | QFrame::Sunken ); + setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); sequences = new SequenceArray; main = new BlockInfo(*sequences); @@ -54,7 +54,7 @@ BaseBoard::BaseBoard(bool graphic, QWidget *parent) _next = new BlockInfo(*sequences); setBlockInfo(main, _next); - connect(&timer, SIGNAL(timeout()), SLOT(timeout())); + connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout())); Piece::info().loadColors(); KZoomMainWindow::addWidget(this); @@ -83,7 +83,7 @@ void BaseBoard::adjustSize() for (uint j=0; j<firstClearLine(); j++) { Coord c(i, j); if ( matrix()[c]==0 ) continue; - partialMoveBlock(c, QPoint(0, 0)); + partialMoveBlock(c, TQPoint(0, 0)); } if (_next) { @@ -143,10 +143,10 @@ void BaseBoard::gameOver() emit gameOverSignal(); } -void BaseBoard::showCanvas(QCanvas *c, bool show) +void BaseBoard::showCanvas(TQCanvas *c, bool show) { - QCanvasItemList l = c->allItems(); - QCanvasItemList::Iterator it; + TQCanvasItemList l = c->allItems(); + TQCanvasItemList::Iterator it; for (it=l.begin(); it!=l.end(); ++it) { if (show) (*it)->show(); else (*it)->hide(); @@ -236,7 +236,7 @@ bool BaseBoard::doFall(bool doAll, bool first, bool lineByLine) // we do not rely on firstClearLine() here since this method is // used in kfouleggs to make gift blocks fall down ... uint h = 0; - QMemArray<uint> heights(matrix().height()); + TQMemArray<uint> heights(matrix().height()); for (uint j=1; j<matrix().height(); j++) { // first line cannot fall Coord src(i, j); if ( toFall(src) ) h++; @@ -347,7 +347,7 @@ void BaseBoard::partialBlockFall(const Coord &src, const Coord &dest) float c = float(loop+1) / bfactory->bbi.nbFallStages * BasePrefs::blockSize(); int xdec = dest.first - src.first; int ydec = src.second - dest.second; - QPoint p(int(xdec * c), int(ydec * c)); + TQPoint p(int(xdec * c), int(ydec * c)); partialMoveBlock(src, p); } @@ -383,11 +383,11 @@ void BaseBoard::blockInGroup(Square<int> &field, const Coord &c, uint value, _findGroup(field, c, nb, set); } -QMemArray<uint> BaseBoard::findGroups(Square<int> &field, uint minSize, +TQMemArray<uint> BaseBoard::findGroups(Square<int> &field, uint minSize, bool exitAtFirstFound) const { field.fill(0); - QMemArray<uint> groups; + TQMemArray<uint> groups; for (uint j=0; j<firstClearLine(); j++) for (uint i=0; i<matrix().width(); i++) { Coord c(i, j); diff --git a/libksirtet/base/board.h b/libksirtet/base/board.h index 443c6532..7be2a4ec 100644 --- a/libksirtet/base/board.h +++ b/libksirtet/base/board.h @@ -1,8 +1,8 @@ #ifndef BASE_BOARD_H #define BASE_BOARD_H -#include <qtimer.h> -#include <qcanvas.h> +#include <tqtimer.h> +#include <tqcanvas.h> #include "gtetris.h" @@ -16,9 +16,9 @@ class KDE_EXPORT FixedCanvasView : public QCanvasView { Q_OBJECT public: - FixedCanvasView(QWidget *parent = 0, const char *name = 0); + FixedCanvasView(TQWidget *parent = 0, const char *name = 0); - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; public slots: virtual void adjustSize(); @@ -38,7 +38,7 @@ class KDE_EXPORT BaseBoard : public FixedCanvasView, public GenericTetris static const DirectionData DIRECTION_DATA[Nb_Direction]; public: - BaseBoard(bool graphic, QWidget *parent); + BaseBoard(bool graphic, TQWidget *parent); virtual ~BaseBoard(); void copy(const GenericTetris &); @@ -93,7 +93,7 @@ class KDE_EXPORT BaseBoard : public FixedCanvasView, public GenericTetris void partialBlockFall(const KGrid2D::Coord &src, const KGrid2D::Coord &dest); // return the sizes of the groups (>=minSize) - QMemArray<uint> findGroups(KGrid2D::Square<int> &field, uint minSize, + TQMemArray<uint> findGroups(KGrid2D::Square<int> &field, uint minSize, bool exitAtFirstFound = false) const; // find group size and put -1 in the corresponding blocks (these blocks // should be 0 at start) @@ -107,13 +107,13 @@ class KDE_EXPORT BaseBoard : public FixedCanvasView, public GenericTetris void updateScore(uint newScore); virtual void showBoard(bool show); - void showCanvas(QCanvas *c, bool show); + void showCanvas(TQCanvas *c, bool show); enum BoardState { GameOver, Normal, Paused, DropDown, BeforeGlue, AfterGlue, BeforeRemove, AfterRemove, AfterGift }; BoardState state, _oldState; - QTimer timer; + TQTimer timer; SequenceArray *sequences; BlockInfo *main, *_next; uint loop; diff --git a/libksirtet/base/factory.cpp b/libksirtet/base/factory.cpp index 55850f0b..cb2f484b 100644 --- a/libksirtet/base/factory.cpp +++ b/libksirtet/base/factory.cpp @@ -41,12 +41,12 @@ BaseFactory::~BaseFactory() _self = 0; } -QWidget *BaseFactory::createAppearanceConfig() +TQWidget *BaseFactory::createAppearanceConfig() { return new BaseAppearanceConfig; } -QWidget *BaseFactory::createColorConfig() +TQWidget *BaseFactory::createColorConfig() { return new ColorConfig; } diff --git a/libksirtet/base/factory.h b/libksirtet/base/factory.h index b542205e..60717f4c 100644 --- a/libksirtet/base/factory.h +++ b/libksirtet/base/factory.h @@ -1,7 +1,7 @@ #ifndef BASE_FACTORY_H #define BASE_FACTORY_H -#include <qglobal.h> +#include <tqglobal.h> #include <kdemacros.h> @@ -43,12 +43,12 @@ class KDE_EXPORT BaseFactory const MainData &mainData; const BaseBoardInfo &bbi; - virtual BaseBoard *createBoard(bool graphic, QWidget *parent) = 0; - virtual BaseInterface *createInterface(QWidget *parent) = 0; + virtual BaseBoard *createBoard(bool graphic, TQWidget *parent) = 0; + virtual BaseInterface *createInterface(TQWidget *parent) = 0; - virtual QWidget *createAppearanceConfig(); - virtual QWidget *createColorConfig(); - virtual QWidget *createGameConfig() { return 0; } + virtual TQWidget *createAppearanceConfig(); + virtual TQWidget *createColorConfig(); + virtual TQWidget *createGameConfig() { return 0; } protected: KAboutData *_aboutData; diff --git a/libksirtet/base/field.cpp b/libksirtet/base/field.cpp index 53f6220a..fae20266 100644 --- a/libksirtet/base/field.cpp +++ b/libksirtet/base/field.cpp @@ -1,9 +1,9 @@ #include "field.h" -#include <qwhatsthis.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qpushbutton.h> +#include <tqwhatsthis.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpushbutton.h> #include <klocale.h> #include <kcanvasrootpixmap.h> @@ -19,12 +19,12 @@ const char *BaseField::BUTTON_TEXTS[NB_BUTTON_TYPE] = { I18N_NOOP("Start"), I18N_NOOP("Resume"), I18N_NOOP("Proceed") }; -BaseField::BaseField(QWidget *w) +BaseField::BaseField(TQWidget *w) : _widget(w), _boardLayout(0), _label(0), _button(0) { - top = new QGridLayout(w, 3, 5, 10); + top = new TQGridLayout(w, 3, 5, 10); - lcds = new QGridLayout(7, 1, 5); + lcds = new TQGridLayout(7, 1, 5); top->addLayout(lcds, 1, 0); lcds->setRowStretch(1, 0); @@ -35,15 +35,15 @@ BaseField::BaseField(QWidget *w) } void BaseField::init(bool AI, bool multiplayer, bool server, bool first, - const QString &name) + const TQString &name) { _flags.AI = AI; _flags.multiplayer = multiplayer; _flags.server = server; _flags.first = first; - QString text = (AI ? i18n("%1\n(AI player)").arg(name) + TQString text = (AI ? i18n("%1\n(AI player)").arg(name) : (multiplayer ? i18n("%1\n(Human player)").arg(name) - : QString::null)); + : TQString::null)); if ( first && !server ) text += i18n("\nWaiting for server"); setMessage(text, (first && server ? StartButton : NoButton)); showScore->resetColor(); @@ -61,7 +61,7 @@ bool BaseField::isArcade() const return board->isArcade(); } -void BaseField::setMessage(const QString &label, ButtonType type) +void BaseField::setMessage(const TQString &label, ButtonType type) { delete _label; _label = 0; @@ -75,24 +75,24 @@ void BaseField::setMessage(const QString &label, ButtonType type) return; } - _boardLayout = new QVBoxLayout(board); + _boardLayout = new TQVBoxLayout(board); _boardLayout->addStretch(3); if ( !label.isEmpty() ) { - QString str = (isArcade() ? i18n("Arcade game") + '\n' - : QString::null) + label; - _label = new QLabel(str, board); + TQString str = (isArcade() ? i18n("Arcade game") + '\n' + : TQString::null) + label; + _label = new TQLabel(str, board); _label->setAlignment(Qt::AlignCenter); - _label->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + _label->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); _boardLayout->addWidget(_label, 0, Qt::AlignCenter); _label->show(); } _boardLayout->addStretch(1); if ( type!=NoButton ) { - _button = new QPushButton(i18n(BUTTON_TEXTS[type]), board); + _button = new TQPushButton(i18n(BUTTON_TEXTS[type]), board); _button->setFocus(); - const char *slot = (type==ResumeButton ? SLOT(pause()) - : SLOT(start())); - _button->connect(_button, SIGNAL(clicked()), + const char *slot = (type==ResumeButton ? TQT_SLOT(pause()) + : TQT_SLOT(start())); + _button->connect(_button, TQT_SIGNAL(clicked()), _widget->parent(), slot); _boardLayout->addWidget(_button, 0, Qt::AlignCenter); _button->show(); @@ -123,7 +123,7 @@ void BaseField::stop(bool gameover) { board->stop(); ButtonType button = StartButton; - QString msg = (gameover ? i18n("Game over") : QString::null); + TQString msg = (gameover ? i18n("Game over") : TQString::null); if ( board->isArcade() && board->arcadeStageDone() ) { if ( board->arcadeStage()==bfactory->bbi.nbArcadeStages ) msg = i18n("The End"); @@ -135,7 +135,7 @@ void BaseField::stop(bool gameover) setMessage(msg, button); } -void BaseField::gameOver(const KExtHighscore::Score &score, QWidget *parent) +void BaseField::gameOver(const KExtHighscore::Score &score, TQWidget *parent) { KNotifyClient::event(parent->winId(), "game over", i18n("Game Over")); KExtHighscore::submitScore(score, parent); @@ -146,7 +146,7 @@ void BaseField::scoreUpdated() showScore->display( (int)board->score() ); if (_flags.multiplayer) return; - QColor color; + TQColor color; if ( _firstScore<currentScore() ) color = Qt::red; else if ( _lastScore<currentScore() ) color = Qt::blue; showScore->setColor(color); @@ -154,7 +154,7 @@ void BaseField::scoreUpdated() void BaseField::settingsChanged() { - QColor color = BasePrefs::fadeColor(); + TQColor color = BasePrefs::fadeColor(); double s = BasePrefs::fadeIntensity(); _boardRootPixmap->setFadeEffect(s, color); board->canvas()->setBackgroundColor(color); diff --git a/libksirtet/base/field.h b/libksirtet/base/field.h index d006a052..f4478ad5 100644 --- a/libksirtet/base/field.h +++ b/libksirtet/base/field.h @@ -18,39 +18,39 @@ class KCanvasRootPixmap; class KDE_EXPORT BaseField { public: - BaseField(QWidget *widget); + BaseField(TQWidget *widget); virtual ~BaseField() {} virtual KExtHighscore::Score currentScore() const = 0; - static void gameOver(const KExtHighscore::Score &, QWidget *parent); + static void gameOver(const KExtHighscore::Score &, TQWidget *parent); virtual void setArcade(); bool isArcade() const; protected: - QGridLayout *top, *lcds; + TQGridLayout *top, *lcds; KGameLCD *showScore; KGameLCDList *removedList, *scoreList; BaseBoard *board; virtual void scoreUpdated(); virtual void init(bool AI, bool multiplayer, bool server, bool first, - const QString &name); + const TQString &name); virtual void start(const GTInitData &); virtual void pause(bool pause); virtual void stop(bool gameover); virtual void settingsChanged(); private: - QWidget *_widget; + TQWidget *_widget; struct Flags { bool AI, multiplayer, server, first; }; Flags _flags; uint _arcadeStage; - QVBoxLayout *_boardLayout; - QLabel *_label; - QButton *_button; + TQVBoxLayout *_boardLayout; + TQLabel *_label; + TQButton *_button; KCanvasRootPixmap *_boardRootPixmap; KExtHighscore::Score _firstScore, _lastScore; @@ -59,8 +59,8 @@ class KDE_EXPORT BaseField static const char *BUTTON_TEXTS[NB_BUTTON_TYPE]; bool hasButton() const { return _flags.server && _flags.first; } - void setMessage(const QString &label, ButtonType); - void hideMessage() { setMessage(QString::null, NB_BUTTON_TYPE); } + void setMessage(const TQString &label, ButtonType); + void hideMessage() { setMessage(TQString::null, NB_BUTTON_TYPE); } }; #endif diff --git a/libksirtet/base/gtetris.cpp b/libksirtet/base/gtetris.cpp index 2141f9ef..6c2a66a9 100644 --- a/libksirtet/base/gtetris.cpp +++ b/libksirtet/base/gtetris.cpp @@ -166,7 +166,7 @@ bool GenericTetris::rotate(bool left) Piece tmp; tmp.copy(_currentPiece); - QPoint p(0, 0); + TQPoint p(0, 0); tmp.rotate(left, p); if ( canPosition(_currentPos, &tmp) ) { if (_graphic) p = toPoint(_currentPos); @@ -192,7 +192,7 @@ void GenericTetris::setBlock(const Coord &c, Block *b) Q_ASSERT( b && _matrix[c]==0 ); _matrix[c] = b; if (_graphic) { - QPoint p = toPoint(c); + TQPoint p = toPoint(c); b->sprite()->move(p.x(), p.y()); } } @@ -212,7 +212,7 @@ void GenericTetris::moveBlock(const Coord &src, const Coord &dest) } } -QPoint GenericTetris::toPoint(const Coord &c) const +TQPoint GenericTetris::toPoint(const Coord &c) const { return _main->toPoint(Coord(c.first, _matrix.height() - 1 - c.second)); } @@ -230,12 +230,12 @@ void GenericTetris::gluePiece() void GenericTetris::bumpCurrentPiece(int dec) { Q_ASSERT( _graphic && _currentPiece ); - _currentPiece->move(toPoint(_currentPos) + QPoint(0, dec)); + _currentPiece->move(toPoint(_currentPos) + TQPoint(0, dec)); } -void GenericTetris::partialMoveBlock(const Coord &c, const QPoint &dec) +void GenericTetris::partialMoveBlock(const Coord &c, const TQPoint &dec) { Q_ASSERT( _graphic && _matrix[c]!=0 ); - QPoint p = toPoint(c) + dec; + TQPoint p = toPoint(c) + dec; _matrix[c]->sprite()->move(p.x(), p.y()); } diff --git a/libksirtet/base/gtetris.h b/libksirtet/base/gtetris.h index 48aefb9d..b0f990b9 100644 --- a/libksirtet/base/gtetris.h +++ b/libksirtet/base/gtetris.h @@ -91,7 +91,7 @@ #ifndef GTETRIS_H #define GTETRIS_H -#include <qpoint.h> +#include <tqpoint.h> #include <krandomsequence.h> #include <kgrid2d.h> @@ -155,10 +155,10 @@ class KDE_EXPORT GenericTetris virtual void updateNextPiece() {} virtual void updatePieceConfig() {} void bumpCurrentPiece(int dec); - void partialMoveBlock(const KGrid2D::Coord &, const QPoint &dec); + void partialMoveBlock(const KGrid2D::Coord &, const TQPoint &dec); private: - QPoint toPoint(const KGrid2D::Coord &) const; + TQPoint toPoint(const KGrid2D::Coord &) const; uint moveTo(const KGrid2D::Coord &dec); bool rotate(bool left); void clear(); diff --git a/libksirtet/base/highscores.cpp b/libksirtet/base/highscores.cpp index 2b3596d7..d1836d78 100644 --- a/libksirtet/base/highscores.cpp +++ b/libksirtet/base/highscores.cpp @@ -12,7 +12,7 @@ BaseHighscores::BaseHighscores() setWWHighscores(KURL( bfactory->mainData.homepage ), bfactory->mainData.version); const BaseBoardInfo &bi = bfactory->bbi; if ( bi.histogramSize!=0 ) { - QMemArray<uint> a; + TQMemArray<uint> a; a.duplicate(bi.histogram, bi.histogramSize); setScoreHistogram(a, bi.scoreBound ? ScoreBound : ScoreNotBound); } diff --git a/libksirtet/base/inter.cpp b/libksirtet/base/inter.cpp index 4f40b63f..658e7c47 100644 --- a/libksirtet/base/inter.cpp +++ b/libksirtet/base/inter.cpp @@ -3,13 +3,13 @@ #include <kexthighscore.h> -void BaseInterface::showHighscores(QWidget *parent) +void BaseInterface::showHighscores(TQWidget *parent) { if ( !_isPaused() ) _pause(); _showHighscores(parent); } -void BaseInterface::_showHighscores(QWidget *parent) +void BaseInterface::_showHighscores(TQWidget *parent) { KExtHighscore::show(parent); } diff --git a/libksirtet/base/inter.h b/libksirtet/base/inter.h index 446a77d3..ac72b61c 100644 --- a/libksirtet/base/inter.h +++ b/libksirtet/base/inter.h @@ -14,10 +14,10 @@ public: virtual void _pause() = 0; virtual bool _isPaused() const = 0; - void showHighscores(QWidget *parent); + void showHighscores(TQWidget *parent); protected: - virtual void _showHighscores(QWidget *parent); + virtual void _showHighscores(TQWidget *parent); }; #endif diff --git a/libksirtet/base/kzoommainwindow.cpp b/libksirtet/base/kzoommainwindow.cpp index 115d5175..4e1b85a5 100644 --- a/libksirtet/base/kzoommainwindow.cpp +++ b/libksirtet/base/kzoommainwindow.cpp @@ -30,11 +30,11 @@ KZoomMainWindow::KZoomMainWindow(uint min, uint max, uint step, const char *name { installEventFilter(this); - _zoomInAction = KStdAction::zoomIn(this, SLOT(zoomIn()), actionCollection()); + _zoomInAction = KStdAction::zoomIn(this, TQT_SLOT(zoomIn()), actionCollection()); _zoomOutAction = - KStdAction::zoomOut(this, SLOT(zoomOut()), actionCollection()); + KStdAction::zoomOut(this, TQT_SLOT(zoomOut()), actionCollection()); _menu = - KStdAction::showMenubar(this, SLOT(toggleMenubar()), actionCollection()); + KStdAction::showMenubar(this, TQT_SLOT(toggleMenubar()), actionCollection()); } void KZoomMainWindow::init(const char *popupName) @@ -48,32 +48,32 @@ void KZoomMainWindow::init(const char *popupName) // context popup if (popupName) { - QPopupMenu *popup = - static_cast<QPopupMenu *>(factory()->container(popupName, this)); + TQPopupMenu *popup = + static_cast<TQPopupMenu *>(factory()->container(popupName, this)); Q_ASSERT(popup); if (popup) KContextMenuManager::insert(this, popup); } } -void KZoomMainWindow::addWidget(QWidget *widget) +void KZoomMainWindow::addWidget(TQWidget *widget) { widget->adjustSize(); - QWidget *tlw = widget->topLevelWidget(); + TQWidget *tlw = widget->topLevelWidget(); KZoomMainWindow *zm = static_cast<KZoomMainWindow *>(tlw->qt_cast("KZoomMainWindow")); Q_ASSERT(zm); zm->_widgets.append(widget); - connect(widget, SIGNAL(destroyed()), zm, SLOT(widgetDestroyed())); + connect(widget, TQT_SIGNAL(destroyed()), zm, TQT_SLOT(widgetDestroyed())); } void KZoomMainWindow::widgetDestroyed() { - _widgets.remove(static_cast<const QWidget *>(sender())); + _widgets.remove(static_cast<const TQWidget *>(sender())); } -bool KZoomMainWindow::eventFilter(QObject *o, QEvent *e) +bool KZoomMainWindow::eventFilter(TQObject *o, TQEvent *e) { - if ( e->type()==QEvent::LayoutHint ) + if ( e->type()==TQEvent::LayoutHint ) setFixedSize(minimumSize()); // because K/QMainWindow // does not manage fixed central widget // with hidden menubar... @@ -84,7 +84,7 @@ void KZoomMainWindow::setZoom(uint zoom) { _zoom = zoom; writeZoomSetting(_zoom); - QPtrListIterator<QWidget> it(_widgets); + TQPtrListIterator<TQWidget> it(_widgets); for (; it.current(); ++it) (*it)->adjustSize();; _zoomOutAction->setEnabled( _zoom>_minZoom ); diff --git a/libksirtet/base/kzoommainwindow.h b/libksirtet/base/kzoommainwindow.h index 14f780fb..fd213fd7 100644 --- a/libksirtet/base/kzoommainwindow.h +++ b/libksirtet/base/kzoommainwindow.h @@ -53,7 +53,7 @@ public: * widget is called whenever the zoom is changed. * This function assumes that the topLevelWidget() is the KZoomMainWindow. */ - static void addWidget(QWidget *widget); + static void addWidget(TQWidget *widget); uint zoom() const { return _zoom; } @@ -71,7 +71,7 @@ protected: void init(const char *popupName = 0); virtual void setZoom(uint zoom); - virtual bool eventFilter(QObject *o, QEvent *e); + virtual bool eventFilter(TQObject *o, TQEvent *e); virtual bool queryExit(); /** You need to implement this method since different application @@ -117,7 +117,7 @@ private slots: private: uint _zoom, _zoomStep, _minZoom, _maxZoom; - QPtrList<QWidget> _widgets; + TQPtrList<TQWidget> _widgets; KAction *_zoomInAction, *_zoomOutAction; KToggleAction *_menu; diff --git a/libksirtet/base/main.cpp b/libksirtet/base/main.cpp index 4b5a4160..e09a9c50 100644 --- a/libksirtet/base/main.cpp +++ b/libksirtet/base/main.cpp @@ -24,26 +24,26 @@ BaseMainWindow::BaseMainWindow() KNotifyClient::startDaemon(); // File & Popup - KStdGameAction::gameNew(this, SLOT(start()), actionCollection()); - _pause = KStdGameAction::pause(this, SLOT(pause()), actionCollection()); + KStdGameAction::gameNew(this, TQT_SLOT(start()), actionCollection()); + _pause = KStdGameAction::pause(this, TQT_SLOT(pause()), actionCollection()); _pause->setEnabled(false); - KStdGameAction::highscores(this, SLOT(showHighscores()), + KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), actionCollection()); - KStdGameAction::quit(qApp, SLOT(quit()), actionCollection()); + KStdGameAction::quit(qApp, TQT_SLOT(quit()), actionCollection()); // Settings - KStdAction::preferences(this, SLOT(configureSettings()), + KStdAction::preferences(this, TQT_SLOT(configureSettings()), actionCollection()); - KStdAction::keyBindings(this, SLOT(configureKeys()), actionCollection()); - KStdAction::configureNotifications(this, SLOT(configureNotifications()), + KStdAction::keyBindings(this, TQT_SLOT(configureKeys()), actionCollection()); + KStdAction::configureNotifications(this, TQT_SLOT(configureNotifications()), actionCollection()); - KStdGameAction::configureHighscores(this, SLOT(configureHighscores()), + KStdGameAction::configureHighscores(this, TQT_SLOT(configureHighscores()), actionCollection()); _inter = bfactory->createInterface(this); } -void BaseMainWindow::buildGUI(QWidget *widget) +void BaseMainWindow::buildGUI(TQWidget *widget) { createGUI(); setCentralWidget(widget); @@ -81,7 +81,7 @@ void BaseMainWindow::configureSettings() if ( KConfigDialog::showDialog("settings") ) return; KConfigDialog *dialog = new KConfigDialog(this, "settings", BasePrefs::self() ); - QWidget *w = bfactory->createGameConfig(); + TQWidget *w = bfactory->createGameConfig(); if (w) dialog->addPage(w, i18n("Game"), "package_system"); w = bfactory->createAppearanceConfig(); if (w) dialog->addPage(w, i18n("Appearance"), "style"); @@ -89,7 +89,7 @@ void BaseMainWindow::configureSettings() if (w) dialog->addPage(w, i18n("Colors"), "colorize"); // dialog->addPage(new BackgroundConfigWidget, i18n("Background"), "background"); addConfig(dialog); - connect(dialog, SIGNAL(settingsChanged()), SIGNAL(settingsChanged())); + connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_SIGNAL(settingsChanged())); dialog->show(); } diff --git a/libksirtet/base/main.h b/libksirtet/base/main.h index d2e108aa..cd165963 100644 --- a/libksirtet/base/main.h +++ b/libksirtet/base/main.h @@ -32,7 +32,7 @@ private slots: protected: BaseInterface *_inter; - void buildGUI(QWidget *widget); + void buildGUI(TQWidget *widget); virtual void addConfig(KConfigDialog *) {} virtual void addKeys(KKeyDialog &) {} virtual void saveKeys() {} diff --git a/libksirtet/base/piece.cpp b/libksirtet/base/piece.cpp index 25aed934..d423473c 100644 --- a/libksirtet/base/piece.cpp +++ b/libksirtet/base/piece.cpp @@ -7,9 +7,9 @@ using namespace KGrid2D; -QPoint operator *(const Coord &c, int i) +TQPoint operator *(const Coord &c, int i) { - return QPoint(c.first * i, c.second * i); + return TQPoint(c.first * i, c.second * i); } //----------------------------------------------------------------------------- @@ -18,10 +18,10 @@ GPieceInfo::GPieceInfo() Piece::setPieceInfo(this); } -QPixmap *GPieceInfo::pixmap(uint blockSize, uint blockType, uint blockMode, +TQPixmap *GPieceInfo::pixmap(uint blockSize, uint blockType, uint blockMode, bool lighted) const { - QPixmap *pixmap = new QPixmap(blockSize, blockSize); + TQPixmap *pixmap = new TQPixmap(blockSize, blockSize); draw(pixmap, blockType, blockMode, lighted); setMask(pixmap, blockMode); return pixmap; @@ -73,18 +73,18 @@ void SequenceArray::setBlockSize(uint bsize) { _size = bsize; const GPieceInfo &pinfo = Piece::info(); - QPtrList<QPixmap> pixmaps; + TQPtrList<TQPixmap> pixmaps; pixmaps.setAutoDelete(TRUE); - QPtrList<QPoint> points; + TQPtrList<TQPoint> points; points.setAutoDelete(TRUE); uint nm = pinfo.nbBlockModes(); for (uint i=0; i<size(); i++) { for (uint k=0; k<2; k++) for (uint j=0; j<nm; j++) { - QPoint *po = new QPoint(0, 0); - QPixmap *pi = pinfo.pixmap(bsize, i, j, k==1); + TQPoint *po = new TQPoint(0, 0); + TQPixmap *pi = pinfo.pixmap(bsize, i, j, k==1); if ( at(i) ) { - at(i)->setImage(k*nm + j, new QCanvasPixmap(*pi, *po)); + at(i)->setImage(k*nm + j, new TQCanvasPixmap(*pi, *po)); delete po; delete pi; } else { @@ -93,7 +93,7 @@ void SequenceArray::setBlockSize(uint bsize) } } if ( at(i)==0 ) { - at(i) = new QCanvasPixmapArray(pixmaps, points); + at(i) = new TQCanvasPixmapArray(pixmaps, points); pixmaps.clear(); points.clear(); } @@ -110,7 +110,7 @@ BlockInfo::BlockInfo(const SequenceArray &s) : _sequences(s) {} -QPoint BlockInfo::toPoint(const Coord &pos) const +TQPoint BlockInfo::toPoint(const Coord &pos) const { return pos * _sequences.blockSize(); } @@ -129,10 +129,10 @@ void Block::setValue(uint value, BlockInfo *binfo) { _value = value; if (binfo) { - QCanvasPixmapArray *seq = binfo->sequences()[value]; + TQCanvasPixmapArray *seq = binfo->sequences()[value]; if (_sprite) _sprite->setSequence(seq); else { - _sprite = new QCanvasSprite(seq, binfo); + _sprite = new TQCanvasSprite(seq, binfo); _sprite->setZ(0); } } @@ -161,7 +161,7 @@ Piece::Piece() _blocks.setAutoDelete(true); } -void Piece::rotate(bool left, const QPoint &p) +void Piece::rotate(bool left, const TQPoint &p) { if (left) { if ( _rotation==0 ) _rotation = 3; @@ -231,7 +231,7 @@ void Piece::generateNext(int type) void Piece::moveCenter() { uint s = _binfo->sequences().blockSize(); - QPoint p = QPoint(_binfo->width(), _binfo->height()) - size() * s; + TQPoint p = TQPoint(_binfo->width(), _binfo->height()) - size() * s; move(p/2 - min() * s); } @@ -240,14 +240,14 @@ Coord Piece::pos(uint k, const Coord &pos) const return Coord(pos.first + coord(k).first, pos.second - coord(k).second); } -void Piece::move(const QPoint &p) +void Piece::move(const TQPoint &p) { for (uint k=0; k<_blocks.size(); k++) moveBlock(k, p); } -void Piece::moveBlock(uint k, const QPoint &p) +void Piece::moveBlock(uint k, const TQPoint &p) { - QPoint po = p + _binfo->toPoint(coord(k)); + TQPoint po = p + _binfo->toPoint(coord(k)); _blocks[k]->sprite()->move(po.x(), po.y()); } diff --git a/libksirtet/base/piece.h b/libksirtet/base/piece.h index 4c0486a8..6cdd667c 100644 --- a/libksirtet/base/piece.h +++ b/libksirtet/base/piece.h @@ -1,8 +1,8 @@ #ifndef BASE_PIECE_H #define BASE_PIECE_H -#include <qcanvas.h> -#include <qptrvector.h> +#include <tqcanvas.h> +#include <tqptrvector.h> #include <kgrid2d.h> @@ -29,7 +29,7 @@ class GPieceInfo KGrid2D::Coord maxSize() const; - QPixmap *pixmap(uint blockSize, uint blockType, uint blockMode, + TQPixmap *pixmap(uint blockSize, uint blockType, uint blockMode, bool lighted) const; virtual uint nbNormalBlockTypes() const = 0; @@ -39,23 +39,23 @@ class GPieceInfo uint generateGarbageBlockType(KRandomSequence *) const; virtual uint nbColors() const = 0; - virtual QString colorLabel(uint i) const = 0; - QCString colorKey(uint i) const; - virtual QColor defaultColor(uint i) const = 0; + virtual TQString colorLabel(uint i) const = 0; + TQCString colorKey(uint i) const; + virtual TQColor defaultColor(uint i) const = 0; void loadColors(); protected: - QColor color(uint i) const { return _colors[i]; } + TQColor color(uint i) const { return _colors[i]; } - virtual void draw(QPixmap *, uint blockType, uint blockMode, + virtual void draw(TQPixmap *, uint blockType, uint blockMode, bool lighted) const = 0; - virtual void setMask(QPixmap *, uint /*blockMode*/) const {} + virtual void setMask(TQPixmap *, uint /*blockMode*/) const {} private: - QValueVector<QColor> _colors; + TQValueVector<TQColor> _colors; }; -class SequenceArray : public QMemArray<QCanvasPixmapArray *> +class SequenceArray : public TQMemArray<TQCanvasPixmapArray *> { public: SequenceArray(); @@ -75,7 +75,7 @@ class BlockInfo : public QCanvas BlockInfo(const SequenceArray &); const SequenceArray &sequences() const { return _sequences; } - QPoint toPoint(const KGrid2D::Coord &) const; + TQPoint toPoint(const KGrid2D::Coord &) const; private: const SequenceArray &_sequences; @@ -92,11 +92,11 @@ class Block uint value() const { return _value; } bool isGarbage() const; void toggleLight(); - QCanvasSprite *sprite() const { return _sprite; } + TQCanvasSprite *sprite() const { return _sprite; } private: uint _value; - QCanvasSprite *_sprite; + TQCanvasSprite *_sprite; Block(const Block &); // disabled Block &operator =(const Block &); // disabled @@ -125,8 +125,8 @@ class Piece KGrid2D::Coord size() const { return max() - min() + KGrid2D::Coord(1, 1); } void generateNext(int type = -1); - void rotate(bool left, const QPoint &); - void move(const QPoint &); + void rotate(bool left, const TQPoint &); + void move(const TQPoint &); void moveCenter(); void show(bool show); @@ -136,7 +136,7 @@ class Piece Block *takeBlock(uint k); private: - QPtrVector<Block> _blocks; + TQPtrVector<Block> _blocks; uint _type; KRandomSequence *_random; static GPieceInfo *_info; @@ -149,7 +149,7 @@ class Piece Piece &operator =(const Piece &); // disabled KGrid2D::Coord coord(uint k) const { return KGrid2D::Coord(_i[k], _j[k]); } - void moveBlock(uint k, const QPoint &); + void moveBlock(uint k, const TQPoint &); }; #endif diff --git a/libksirtet/base/settings.cpp b/libksirtet/base/settings.cpp index 1ea3b16a..a695d746 100644 --- a/libksirtet/base/settings.cpp +++ b/libksirtet/base/settings.cpp @@ -1,11 +1,11 @@ #include "settings.h" #include "settings.moc" -#include <qlabel.h> -#include <qhbox.h> -#include <qlayout.h> -#include <qcheckbox.h> -#include <qhgroupbox.h> +#include <tqlabel.h> +#include <tqhbox.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqhgroupbox.h> #include <klocale.h> #include <knuminput.h> @@ -19,35 +19,35 @@ //----------------------------------------------------------------------------- BaseAppearanceConfig::BaseAppearanceConfig() - : QWidget(0, "appearance_config") + : TQWidget(0, "appearance_config") { - QVBoxLayout *top = new QVBoxLayout(this); + TQVBoxLayout *top = new TQVBoxLayout(this); // upper part - _main = new QWidget(this); + _main = new TQWidget(this); top->addWidget(_main); - _grid = new QGridLayout(_main, 3, 2, 0, KDialog::spacingHint()); + _grid = new TQGridLayout(_main, 3, 2, 0, KDialog::spacingHint()); _grid->setColStretch(1, 1); - QCheckBox *chb = - new QCheckBox(i18n("Enable animations"), _main, "kcfg_AnimationsEnabled"); + TQCheckBox *chb = + new TQCheckBox(i18n("Enable animations"), _main, "kcfg_AnimationsEnabled"); _grid->addMultiCellWidget(chb, 2, 2, 0, 1); top->addSpacing(KDialog::spacingHint()); // lower part - QHGroupBox *gbox = new QHGroupBox(i18n("Background"), this); + TQHGroupBox *gbox = new TQHGroupBox(i18n("Background"), this); top->addWidget(gbox); - QWidget *widget = new QWidget(gbox); - QGridLayout *grid = - new QGridLayout(widget, 2, 3, 0, KDialog::spacingHint()); + TQWidget *widget = new TQWidget(gbox); + TQGridLayout *grid = + new TQGridLayout(widget, 2, 3, 0, KDialog::spacingHint()); grid->setColStretch(2, 1); - QLabel *label = new QLabel(i18n("Color:"), widget); + TQLabel *label = new TQLabel(i18n("Color:"), widget); grid->addWidget(label, 0, 0); KColorButton *cob = new KColorButton(widget, "kcfg_FadeColor"); cob->setFixedWidth(100); grid->addWidget(cob, 0, 1); - label = new QLabel(i18n("Opacity:"), widget); + label = new TQLabel(i18n("Opacity:"), widget); grid->addWidget(label, 1, 0); KDoubleNumInput *dn = new KDoubleNumInput(widget, "kcfg_FadeIntensity"); dn->setRange(0.0, 1.0, 0.01); @@ -58,15 +58,15 @@ BaseAppearanceConfig::BaseAppearanceConfig() //----------------------------------------------------------------------------- ColorConfig::ColorConfig() - : QWidget(0, "color_config") + : TQWidget(0, "color_config") { const GPieceInfo &info = Piece::info(); - QVBoxLayout *top = new QVBoxLayout(this); + TQVBoxLayout *top = new TQVBoxLayout(this); uint nb = info.nbColors(); - QGridLayout *grid = new QGridLayout(top, nb+1, 3, KDialog::spacingHint()); + TQGridLayout *grid = new TQGridLayout(top, nb+1, 3, KDialog::spacingHint()); grid->setColStretch(2, 1); for (uint i=0; i<nb; i++) { - QLabel *label = new QLabel(info.colorLabel(i), this); + TQLabel *label = new TQLabel(info.colorLabel(i), this); grid->addWidget(label, i, 0); KColorButton *cob = new KColorButton(this, colorKey(i)); cob->setFixedWidth(100); @@ -75,9 +75,9 @@ ColorConfig::ColorConfig() grid->setRowStretch(nb, 1); } -QCString ColorConfig::colorKey(uint i) +TQCString ColorConfig::colorKey(uint i) { - QCString s; + TQCString s; s.setNum(i); return "kcfg_Color" + s; } diff --git a/libksirtet/base/settings.h b/libksirtet/base/settings.h index c64bfd5b..37d0aea7 100644 --- a/libksirtet/base/settings.h +++ b/libksirtet/base/settings.h @@ -1,7 +1,7 @@ #ifndef BASE_SETTINGS_H #define BASE_SETTINGS_H -#include <qwidget.h> +#include <tqwidget.h> #include <kconfig.h> class QGridLayout; @@ -15,8 +15,8 @@ public: BaseAppearanceConfig(); protected: - QWidget *_main; - QGridLayout *_grid; + TQWidget *_main; + TQGridLayout *_grid; }; //----------------------------------------------------------------------------- @@ -27,7 +27,7 @@ public: ColorConfig(); private: - static QCString colorKey(uint i); + static TQCString colorKey(uint i); }; #endif 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 diff --git a/libksirtet/lib/defines.cpp b/libksirtet/lib/defines.cpp index 7c897dd9..baf91083 100644 --- a/libksirtet/lib/defines.cpp +++ b/libksirtet/lib/defines.cpp @@ -2,21 +2,21 @@ #include <klocale.h> -void errorBox(const QString &msg1, const QString &msg2, QWidget *parent) +void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *parent) { - QString str; + TQString str; if ( msg2.isNull() ) str = msg1; else str = i18n("%1:\n%2").arg(msg1).arg(msg2); KMessageBox::error(parent, str); } -QString socketError(const KExtendedSocket *socket) +TQString socketError(const KExtendedSocket *socket) { return KExtendedSocket::strError(socket->status(), socket->systemError()); } bool checkSocket(int res, const KExtendedSocket *socket, - const QString &msg, QWidget *parent) + const TQString &msg, TQWidget *parent) { if ( res==0 ) return false; errorBox(msg, socketError(socket), parent); diff --git a/libksirtet/lib/defines.h b/libksirtet/lib/defines.h index 9015c6b1..a6728a38 100644 --- a/libksirtet/lib/defines.h +++ b/libksirtet/lib/defines.h @@ -16,10 +16,10 @@ #define MP_SERVER_ADDRESS "Server address" #define MP_PORT "Port" -void errorBox(const QString &msg1, const QString &msg2, QWidget *parent); -QString socketError(const KExtendedSocket *socket); +void errorBox(const TQString &msg1, const TQString &msg2, TQWidget *parent); +TQString socketError(const KExtendedSocket *socket); bool checkSocket(int res, const KExtendedSocket *, - const QString &msg, QWidget *parent); + const TQString &msg, TQWidget *parent); #define R_ERROR_BOX(msg1, msg2) { \ errorBox(msg1, msg2, this); \ diff --git a/libksirtet/lib/internal.cpp b/libksirtet/lib/internal.cpp index c7b69f9e..f8b34085 100644 --- a/libksirtet/lib/internal.cpp +++ b/libksirtet/lib/internal.cpp @@ -1,7 +1,7 @@ #include "internal.h" #include "internal.moc" -#include <qptrlist.h> +#include <tqptrlist.h> #include <klocale.h> #include "mp_interface.h" @@ -67,17 +67,17 @@ void Server::serverTimeout() //----------------------------------------------------------------------------- Network::Network(MPInterface *_interface, - QValueList<MPInterface::Data> &_boards, - const QPtrList<RemoteHostData> &rhd) + TQValueList<MPInterface::Data> &_boards, + const TQPtrList<RemoteHostData> &rhd) : Local(_interface, _boards) { RemoteData rd; - QPtrListIterator<RemoteHostData> it(rhd); + TQPtrListIterator<RemoteHostData> it(rhd); for (; it.current(); ++it) { rd.socket = it.current()->socket; rd.socket->notifier()->setEnabled(TRUE); - connect(rd.socket->notifier(), SIGNAL(activated(int)), - SLOT(notifier(int))); + connect(rd.socket->notifier(), TQT_SIGNAL(activated(int)), + TQT_SLOT(notifier(int))); uint nb = it.current()->bds.count(); Q_ASSERT( nb>=1 ); rd.array = new BufferArray(nb); @@ -102,7 +102,7 @@ uint Network::nbPlayers() const return nb; } -QString Network::playerName(uint i) const +TQString Network::playerName(uint i) const { uint l = Local::nbPlayers(); if ( i<l ) return Local::playerName(i); @@ -111,7 +111,7 @@ QString Network::playerName(uint i) const if ( i<(l+ll) ) return remotes[k].names[i-l]; l += ll; } - return QString::null; // dummy + return TQString::null; // dummy } IOBuffer *Network::ioBuffer(uint i) const @@ -141,7 +141,7 @@ void Network::brokeError(uint i) disconnectHost(i, i18n("Link broken")); } -void Network::disconnectHost(uint i, const QString &msg) +void Network::disconnectHost(uint i, const TQString &msg) { delete remotes[i].socket; delete remotes[i].array; @@ -151,24 +151,24 @@ void Network::disconnectHost(uint i, const QString &msg) //----------------------------------------------------------------------------- LocalServer::LocalServer(MPInterface *_interface, - QValueList<MPInterface::Data> &_boards, + TQValueList<MPInterface::Data> &_boards, uint _interval) : Local(_interface, _boards), Server(_interval) { - connect(&timer, SIGNAL(timeout()), SLOT(timeoutSlot())); - connect(&ctimer, SIGNAL(timeout()), SLOT(congestionTimeoutSlot())); + connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeoutSlot())); + connect(&ctimer, TQT_SIGNAL(timeout()), TQT_SLOT(congestionTimeoutSlot())); serverTimeout(); } //----------------------------------------------------------------------------- NetworkServer::NetworkServer(MPInterface *_interface, - QValueList<MPInterface::Data> &_boards, - const QPtrList<RemoteHostData> &rhd, uint _interval) + TQValueList<MPInterface::Data> &_boards, + const TQPtrList<RemoteHostData> &rhd, uint _interval) : Network(_interface, _boards, rhd), Server(_interval), nbReceived(remotes.count()) { - connect(&timer, SIGNAL(timeout()), SLOT(timeoutSlot())); - connect(&ctimer, SIGNAL(timeout()), SLOT(congestionTimeoutSlot())); + connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeoutSlot())); + connect(&ctimer, TQT_SIGNAL(timeout()), TQT_SLOT(congestionTimeoutSlot())); // to catch unexpected data for (uint i=0; i<remotes.count(); i++) remotes[i].received = TRUE; nbReceived = remotes.count(); diff --git a/libksirtet/lib/internal.h b/libksirtet/lib/internal.h index 4dece16a..cc74fbc4 100644 --- a/libksirtet/lib/internal.h +++ b/libksirtet/lib/internal.h @@ -1,8 +1,8 @@ #ifndef INTERNAL_H #define INTERNAL_H -#include <qtimer.h> -#include <qstringlist.h> +#include <tqtimer.h> +#include <tqstringlist.h> #include "socket.h" #include "mp_interface.h" @@ -14,12 +14,12 @@ class RemoteHostData; class Local { public: - Local(MPInterface *_interface, QValueList<MPInterface::Data> &_boards) + Local(MPInterface *_interface, TQValueList<MPInterface::Data> &_boards) : interface(_interface), ios(_boards.count()), boards(_boards) {} virtual ~Local() {} virtual uint nbPlayers() const { return boards.count(); } - virtual QString playerName(uint i) const { return boards[i].name; } + virtual TQString playerName(uint i) const { return boards[i].name; } virtual IOBuffer *ioBuffer(uint i) const { return ios[i]; } virtual void writeData(bool inverse); virtual WritingStream *globalStream() { return 0; } @@ -33,7 +33,7 @@ class Local void treatData(); private: - QValueList<MPInterface::Data> boards; + TQValueList<MPInterface::Data> boards; }; //----------------------------------------------------------------------------- @@ -45,7 +45,7 @@ class Server protected: WritingStream stream; - QTimer timer, ctimer; + TQTimer timer, ctimer; virtual void timeout() = 0; void serverTimeout(); @@ -56,17 +56,17 @@ class Server }; //----------------------------------------------------------------------------- -class Network : public QObject, public Local +class Network : public TQObject, public Local { Q_OBJECT public: - Network(MPInterface *_interface, QValueList<MPInterface::Data> &_boards, - const QPtrList<RemoteHostData> &rhd); + Network(MPInterface *_interface, TQValueList<MPInterface::Data> &_boards, + const TQPtrList<RemoteHostData> &rhd); virtual ~Network(); virtual uint nbPlayers() const; - QString playerName(uint i) const; + TQString playerName(uint i) const; IOBuffer *ioBuffer(uint i) const; protected slots: @@ -79,24 +79,24 @@ class Network : public QObject, public Local Socket *socket; BufferArray *array; bool received; - QStringList names; + TQStringList names; }; - QValueList<RemoteData> remotes; + TQValueList<RemoteData> remotes; void readError(uint i); void writeError(uint i); void brokeError(uint i); - void disconnectHost(uint i, const QString &msg); + void disconnectHost(uint i, const TQString &msg); }; //----------------------------------------------------------------------------- -class LocalServer : public QObject, public Local, public Server +class LocalServer : public TQObject, public Local, public Server { Q_OBJECT public: LocalServer(MPInterface *_interface, - QValueList<MPInterface::Data> &_boards, uint _interval); + TQValueList<MPInterface::Data> &_boards, uint _interval); WritingStream *globalStream() { return &stream; } @@ -115,8 +115,8 @@ class NetworkServer : public Network, public Server public: NetworkServer(MPInterface *_interface, - QValueList<MPInterface::Data> &_boards, - const QPtrList<RemoteHostData> &rhd, uint _interval); + TQValueList<MPInterface::Data> &_boards, + const TQPtrList<RemoteHostData> &rhd, uint _interval); void writeData(bool inverse); WritingStream *globalStream() { return &stream; } @@ -139,8 +139,8 @@ class Client : public Network Q_OBJECT public: - Client(MPInterface *_interface, QValueList<MPInterface::Data> &_boards, - const QPtrList<RemoteHostData> &rhd) + Client(MPInterface *_interface, TQValueList<MPInterface::Data> &_boards, + const TQPtrList<RemoteHostData> &rhd) : Network(_interface, _boards, rhd) {} uint nbPlayers() const { return Local::nbPlayers(); } diff --git a/libksirtet/lib/keys.cpp b/libksirtet/lib/keys.cpp index 879f0bfa..8433503f 100644 --- a/libksirtet/lib/keys.cpp +++ b/libksirtet/lib/keys.cpp @@ -1,14 +1,14 @@ #include "keys.h" #include "keys.moc" -#include <qsignal.h> +#include <tqsignal.h> #include <kkeydialog.h> #include <klocale.h> KeyData::KeyData(uint maxNb, uint nbActions, const ActionData *data, - QObject *parent) - : QObject(parent), _maxNb(maxNb) + TQObject *parent) + : TQObject(parent), _maxNb(maxNb) { _data.duplicate(data, nbActions); @@ -40,13 +40,13 @@ void KeyData::clear() _cols.resize(0); } -void KeyData::createActionCollection(uint index, QWidget *receiver) +void KeyData::createActionCollection(uint index, TQWidget *receiver) { Q_ASSERT( index<_cols.size() ); _cols[index] = new KActionCollection(receiver, this); for (uint k=0; k<_data.size(); k++) { - QString label = i18n(_data[k].label); - QString name = QString("%2 %3").arg(index+1).arg(_data[k].name); + TQString label = i18n(_data[k].label); + TQString name = TQString("%2 %3").arg(index+1).arg(_data[k].name); const char *slot = (_data[k].slotRelease ? 0 : _data[k].slot); KAction *a = new KAction(label, _keycodes[_cols.size()-1][index][k], receiver, slot, _cols[index], name.utf8()); @@ -54,9 +54,9 @@ void KeyData::createActionCollection(uint index, QWidget *receiver) if ( slot==0 ) { SpecialData data; data.enabled = false; - data.pressed = new QSignal(this); + data.pressed = new TQSignal(this); data.pressed->connect(receiver, _data[k].slot); - data.released = new QSignal(this); + data.released = new TQSignal(this); data.released->connect(receiver, _data[k].slotRelease); _specActions[a] = data; } @@ -67,7 +67,7 @@ void KeyData::createActionCollection(uint index, QWidget *receiver) void KeyData::setEnabled(uint index, bool enabled) { for (uint k=0; k<_cols[index]->count(); k++) { - QMap<KAction *, SpecialData>::Iterator it = + TQMap<KAction *, SpecialData>::Iterator it = _specActions.find(_cols[index]->action(k)); if ( it==_specActions.end() ) _cols[index]->action(k)->setEnabled(enabled); @@ -88,12 +88,12 @@ void KeyData::save() _cols[i]->writeShortcutSettings(group()); } -void KeyData::keyEvent(QKeyEvent *e, bool pressed) +void KeyData::keyEvent(TQKeyEvent *e, bool pressed) { if ( e->isAutoRepeat() ) return; KKey key(e); - QMap<KAction *, SpecialData>::Iterator it = _specActions.begin(); + TQMap<KAction *, SpecialData>::Iterator it = _specActions.begin(); for(; it!=_specActions.end(); ++it) { if ( !it.data().enabled ) continue; if ( !it.key()->shortcut().contains(key) ) continue; diff --git a/libksirtet/lib/keys.h b/libksirtet/lib/keys.h index 07c08419..62bb818c 100644 --- a/libksirtet/lib/keys.h +++ b/libksirtet/lib/keys.h @@ -1,7 +1,7 @@ #ifndef KEYS_H #define KEYS_H -#include <qmap.h> +#include <tqmap.h> #include <kaction.h> #include "mp_interface.h" @@ -12,31 +12,31 @@ class KeyData : public QObject Q_OBJECT public: KeyData(uint maxNb, uint nbActions, const ActionData *, - QObject *parent); + TQObject *parent); void setKeycodes(uint nb, uint i, const int *keycodes); void setCurrentNb(uint nb); void clear(); - void createActionCollection(uint index, QWidget *receiver); + void createActionCollection(uint index, TQWidget *receiver); void setEnabled(uint index, bool enabled); void addKeys(KKeyDialog &); void save(); - void keyEvent(QKeyEvent *e, bool pressed); + void keyEvent(TQKeyEvent *e, bool pressed); private: uint _maxNb; - QMemArray<ActionData> _data; - QMap<int, QMap<int, QMemArray<int> > > _keycodes; - QMemArray<KActionCollection *> _cols; + TQMemArray<ActionData> _data; + TQMap<int, TQMap<int, TQMemArray<int> > > _keycodes; + TQMemArray<KActionCollection *> _cols; struct SpecialData { bool enabled; - QSignal *pressed, *released; + TQSignal *pressed, *released; }; - QMap<KAction *, SpecialData> _specActions; + TQMap<KAction *, SpecialData> _specActions; - QString group() const - { return QString("Keys (%1 humans)").arg(_cols.size()); } + TQString group() const + { return TQString("Keys (%1 humans)").arg(_cols.size()); } }; #endif // KEYS_H diff --git a/libksirtet/lib/meeting.cpp b/libksirtet/lib/meeting.cpp index 2cb6e285..71df0e4d 100644 --- a/libksirtet/lib/meeting.cpp +++ b/libksirtet/lib/meeting.cpp @@ -1,7 +1,7 @@ #include "meeting.h" -#include <qmessagebox.h> -#include <qpushbutton.h> +#include <tqmessagebox.h> +#include <tqpushbutton.h> #include <klocale.h> #include <kmessagebox.h> @@ -14,7 +14,7 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, MPOptionWidget *option, - bool _server, QWidget *parent, const char * name) + bool _server, TQWidget *parent, const char * name) : KDialogBase(Plain, i18n("Network Meeting"), (_server ? Ok|Cancel|Help : Cancel|Help), (_server ? Ok : Cancel), parent, name), @@ -24,8 +24,8 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, sm[0]->notifier()->setEnabled(TRUE); /* top layout */ - QVBoxLayout *top = new QVBoxLayout(plainPage(), spacingHint()); - top->setResizeMode(QLayout::Fixed); + TQVBoxLayout *top = new TQVBoxLayout(plainPage(), spacingHint()); + top->setResizeMode(TQLayout::Fixed); // server line spl = new MeetingLine(server, server, true, plainPage()); @@ -36,7 +36,7 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, wl->hide(); top->addWidget(wl); - labWait = new QLabel(i18n("Waiting for clients"), plainPage()); + labWait = new TQLabel(i18n("Waiting for clients"), plainPage()); labWait->setAlignment(AlignCenter); top->addWidget(labWait); @@ -44,7 +44,7 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, // if (ow) top->addWidget(ow); #### FIXME // status bar - status = new QStatusBar(plainPage()); + status = new TQStatusBar(plainPage()); status->setSizeGripEnabled(false); top->addWidget(status); @@ -65,13 +65,13 @@ void NetMeeting::appendLine(const MeetingLineData &pld, bool server) { MeetingLine *pl; pl = new MeetingLine(pld.own, server, false, wl); - if (pld.own) connect(pl, SIGNAL(textChanged(const QString &)), - SLOT(textChanged(const QString &))); + if (pld.own) connect(pl, TQT_SIGNAL(textChanged(const TQString &)), + TQT_SLOT(textChanged(const TQString &))); else message(i18n("A new client has just arrived (#%1)") .arg(wl->size()+1)); pl->setData(pld.ed); - connect(pl, SIGNAL(typeChanged(MeetingCheckBox::Type)), - SLOT(typeChanged(MeetingCheckBox::Type))); + connect(pl, TQT_SIGNAL(typeChanged(MeetingCheckBox::Type)), + TQT_SLOT(typeChanged(MeetingCheckBox::Type))); wl->append(pl); waiting(); } @@ -122,7 +122,7 @@ bool NetMeeting::ready() const return ( nbReady!=0 ); } -void NetMeeting::cleanReject(const QString &str) +void NetMeeting::cleanReject(const TQString &str) { sm.clean(); // remove the sockets immediately to avoid possible further mess if ( !str.isEmpty() ) @@ -205,7 +205,7 @@ void NetMeeting::accept() KDialogBase::accept(); } -void NetMeeting::message(const QString &str) +void NetMeeting::message(const TQString &str) { status->message(str, 3000); } @@ -213,20 +213,20 @@ void NetMeeting::message(const QString &str) /** ServerNetMeeting *********************************************************/ ServerNetMeeting::ServerNetMeeting(const cId &id, const RemoteHostData &r, MPOptionWidget *option, - QPtrList<RemoteHostData> &arhd, QWidget *parent, const char * name) + TQPtrList<RemoteHostData> &arhd, TQWidget *parent, const char * name) : NetMeeting(id, r.socket, option, TRUE, parent, name), rhd(arhd) { - connect(sm[0]->notifier(), SIGNAL(activated(int)), SLOT(newHost(int))); + connect(sm[0]->notifier(), TQT_SIGNAL(activated(int)), TQT_SLOT(newHost(int))); players.append(Accepted); // server // set server line ExtData ed(r.bds, "", MeetingCheckBox::Ready); spl->setData(ed); - connect(spl, SIGNAL(textChanged(const QString &)), - SLOT(textChanged(const QString &))); + connect(spl, TQT_SIGNAL(textChanged(const TQString &)), + TQT_SLOT(textChanged(const TQString &))); // options signal - if (ow) connect(ow, SIGNAL(changed()), SLOT(optionsChanged())); + if (ow) connect(ow, TQT_SIGNAL(changed()), TQT_SLOT(optionsChanged())); } void ServerNetMeeting::writeToAll(uint i) @@ -238,13 +238,13 @@ void ServerNetMeeting::writeToAll(uint i) sm.commonWritingStream().clear(); } -void ServerNetMeeting::netError(uint i, const QString &type) +void ServerNetMeeting::netError(uint i, const TQString &type) { Q_ASSERT( i!=0 ); disconnectHost(i, i18n("%1 client #%2: disconnect it").arg(type).arg(i)); } -void ServerNetMeeting::disconnectHost(uint i, const QString &str) +void ServerNetMeeting::disconnectHost(uint i, const TQString &str) { sm.remove(i, true); socketRemoved = TRUE; @@ -271,8 +271,8 @@ void ServerNetMeeting::newHost(int) players.append(NewPlayer); Socket *socket = new Socket(s, true); uint i = sm.append(socket, SocketManager::ReadWrite); - connect(sm[i]->notifier(), SIGNAL(activated(int)), - SLOT(readNotifier(int))); + connect(sm[i]->notifier(), TQT_SIGNAL(activated(int)), + TQT_SLOT(readNotifier(int))); sm[i]->notifier()->setEnabled(TRUE); } @@ -341,7 +341,7 @@ void ServerNetMeeting::modTextFlag(uint i) { checkState(i-1, Accepted); - // the client i has just sent a new text (QString) + // the client i has just sent a new text (TQString) TextInfo ti; sm[i]->readingStream() >> ti.text; CHECK_READ(i); @@ -369,7 +369,7 @@ void ServerNetMeeting::modTypeFlag(uint i) writeToAll(i); } -void ServerNetMeeting::textChanged(const QString &text) +void ServerNetMeeting::textChanged(const TQString &text) { // server line text changed : send to every clients (Mod_Text flag + TextInfo struct) TextInfo ti; ti.i = 0; ti.text = text; @@ -448,11 +448,11 @@ void ServerNetMeeting::optionsChanged() /** ClientNetMeeting *********************************************************/ ClientNetMeeting::ClientNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *option, - QWidget *parent, const char * name) + TQWidget *parent, const char * name) : NetMeeting(id, rhd.socket, option, FALSE, parent, name), bds(rhd.bds) { - connect(sm[0]->notifier(), SIGNAL(activated(int)), - SLOT(readNotifier(int))); + connect(sm[0]->notifier(), TQT_SIGNAL(activated(int)), + TQT_SLOT(readNotifier(int))); players.append(NewPlayer); // server player // Send id to server (Id flag + Id struct) @@ -460,7 +460,7 @@ ClientNetMeeting::ClientNetMeeting(const cId &id, writeToAll(); // what happens if there is a message box appearing before exec() call ?? } -void ClientNetMeeting::netError(uint, const QString &str) +void ClientNetMeeting::netError(uint, const TQString &str) { cleanReject(i18n("%1 server: aborting connection.").arg(str)); } @@ -532,9 +532,9 @@ void ClientNetMeeting::delFlag(uint) message(i18n("Client %1 has left").arg(k)); } -void ClientNetMeeting::textChanged(const QString &text) +void ClientNetMeeting::textChanged(const TQString &text) { - // text changed : send to server (Mod_Text flag + QString) + // text changed : send to server (Mod_Text flag + TQString) sm.commonWritingStream() << Mod_TextFlag << text; writeToAll(); } diff --git a/libksirtet/lib/meeting.h b/libksirtet/lib/meeting.h index cb534404..1e9ba267 100644 --- a/libksirtet/lib/meeting.h +++ b/libksirtet/lib/meeting.h @@ -1,7 +1,7 @@ #ifndef MEETING_H #define MEETING_H -#include <qstatusbar.h> +#include <tqstatusbar.h> #include <kdialogbase.h> #include "smanager.h" #include "pline.h" @@ -15,22 +15,22 @@ class NetMeeting : public KDialogBase Q_OBJECT public: - // "gameName" and "gameId" are QByteArray because they are + // "gameName" and "gameId" are TQByteArray because they are // used for ID comparing between games. NetMeeting(const cId &id, Socket *, MPOptionWidget *option, bool server, - QWidget *parent = 0, const char * name = 0); + TQWidget *parent = 0, const char * name = 0); virtual ~NetMeeting(); protected slots: void readNotifier(int socket); - virtual void textChanged(const QString &) = 0; + virtual void textChanged(const TQString &) = 0; virtual void typeChanged(MeetingCheckBox::Type) = 0; virtual void reject(); virtual void accept(); protected: enum PlayerState { NewPlayer, IdChecked, Accepted }; - QValueList<PlayerState> players; + TQValueList<PlayerState> players; bool server; MeetingLine *spl; WidgetList<MeetingLine> *wl; @@ -44,7 +44,7 @@ class NetMeeting : public KDialogBase void setType(const TypeInfo &ti); void setText(const TextInfo &ti); - void cleanReject(const QString &str = QString::null); + void cleanReject(const TQString &str = TQString::null); bool checkState(uint i, PlayerState s); bool checkAndSetState(uint i, PlayerState os, PlayerState ns); bool ready() const; @@ -58,17 +58,17 @@ class NetMeeting : public KDialogBase virtual void modOptFlag(uint i) { dataError(i); } virtual void playFlag(uint i) { dataError(i); } - virtual void netError(uint i, const QString &str) = 0; + virtual void netError(uint i, const TQString &str) = 0; virtual void writeToAll(uint i=0) = 0; void readError(uint i); void writeError(uint i); void dataError(uint i); void brokeError(uint i); - void message(const QString &str); + void message(const TQString &str); private: - QLabel *labWait; - QStatusBar *status; + TQLabel *labWait; + TQStatusBar *status; void waiting(); void readData(uint i); @@ -81,18 +81,18 @@ class ServerNetMeeting : public NetMeeting public: ServerNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *options, - QPtrList<RemoteHostData> &arhd, - QWidget *parent = 0, const char * name = 0); + TQPtrList<RemoteHostData> &arhd, + TQWidget *parent = 0, const char * name = 0); private slots: void newHost(int); - void textChanged(const QString &text); + void textChanged(const TQString &text); void typeChanged(MeetingCheckBox::Type); void accept(); void optionsChanged(); private: - QPtrList<RemoteHostData> &rhd; + TQPtrList<RemoteHostData> &rhd; void idFlag(uint i); void newFlag(uint i); @@ -100,9 +100,9 @@ class ServerNetMeeting : public NetMeeting void modTypeFlag(uint i); void modTextFlag(uint i); - void netError(uint i, const QString &str); + void netError(uint i, const TQString &str); void writeToAll(uint i = 0); - void disconnectHost(uint i, const QString &str); + void disconnectHost(uint i, const TQString &str); }; class ClientNetMeeting : public NetMeeting @@ -112,14 +112,14 @@ class ClientNetMeeting : public NetMeeting public: ClientNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *options, - QWidget *parent = 0, const char * name = 0); + TQWidget *parent = 0, const char * name = 0); private slots: - void textChanged(const QString &text); + void textChanged(const TQString &text); void typeChanged(MeetingCheckBox::Type); private: - QValueList<BoardData> bds; + TQValueList<BoardData> bds; void idFlag(uint); void newFlag(uint); @@ -131,7 +131,7 @@ class ClientNetMeeting : public NetMeeting void playFlag(uint); void writeToAll(uint i=0); - void netError(uint, const QString &str); + void netError(uint, const TQString &str); }; #endif // MEETING_H diff --git a/libksirtet/lib/miscui.cpp b/libksirtet/lib/miscui.cpp index 28f00914..dde70adb 100644 --- a/libksirtet/lib/miscui.cpp +++ b/libksirtet/lib/miscui.cpp @@ -1,27 +1,27 @@ #include "miscui.h" #include "miscui.moc" -#include <qlayout.h> +#include <tqlayout.h> #include <klocale.h> //----------------------------------------------------------------------------- MeetingCheckBox::MeetingCheckBox(Type type, bool owner, bool server, - QWidget *parent) - : QWidget(parent, "meeting_check_box") + TQWidget *parent) + : TQWidget(parent, "meeting_check_box") { - QVBoxLayout *vbox = new QVBoxLayout(this); + TQVBoxLayout *vbox = new TQVBoxLayout(this); - _ready = new QCheckBox(i18n("Ready"), this); + _ready = new TQCheckBox(i18n("Ready"), this); vbox->addWidget(_ready); _ready->setEnabled(owner); - connect(_ready, SIGNAL(clicked()), SLOT(changedSlot())); + connect(_ready, TQT_SIGNAL(clicked()), TQT_SLOT(changedSlot())); - _excluded = new QCheckBox(i18n("Excluded"), this); + _excluded = new TQCheckBox(i18n("Excluded"), this); vbox->addWidget(_excluded); _excluded->setEnabled(server); - connect(_excluded, SIGNAL(clicked()), SLOT(changedSlot())); + connect(_excluded, TQT_SIGNAL(clicked()), TQT_SLOT(changedSlot())); setType(type); } @@ -46,13 +46,13 @@ void MeetingCheckBox::changedSlot() //----------------------------------------------------------------------------- PlayerComboBox::PlayerComboBox(Type type, bool canBeEmpty, bool acceptAI, - QWidget *parent) - : QComboBox(parent, "player_combo_box") + TQWidget *parent) + : TQComboBox(parent, "player_combo_box") { insertItem(i18n("Human")); if (acceptAI) insertItem(i18n("AI")); if (canBeEmpty) insertItem(i18n("None")); setCurrentItem(type); - connect(this, SIGNAL(activated(int)), SIGNAL(changed(int))); + connect(this, TQT_SIGNAL(activated(int)), TQT_SIGNAL(changed(int))); } diff --git a/libksirtet/lib/miscui.h b/libksirtet/lib/miscui.h index 7de5dfbc..fb40e0ec 100644 --- a/libksirtet/lib/miscui.h +++ b/libksirtet/lib/miscui.h @@ -1,8 +1,8 @@ #ifndef MISCUI_H #define MISCUI_H -#include <qcombobox.h> -#include <qcheckbox.h> +#include <tqcombobox.h> +#include <tqcheckbox.h> //----------------------------------------------------------------------------- @@ -11,7 +11,7 @@ class MeetingCheckBox : public QWidget Q_OBJECT public: enum Type { Ready, NotReady, Excluded }; - MeetingCheckBox(Type, bool owner, bool server, QWidget *parent); + MeetingCheckBox(Type, bool owner, bool server, TQWidget *parent); void setType(Type); Type type() const; @@ -23,7 +23,7 @@ class MeetingCheckBox : public QWidget void changedSlot(); private: - QCheckBox *_ready, *_excluded; + TQCheckBox *_ready, *_excluded; }; //----------------------------------------------------------------------------- @@ -32,7 +32,7 @@ class PlayerComboBox : public QComboBox Q_OBJECT public: enum Type { Human = 0, AI, None }; - PlayerComboBox(Type, bool canBeNone, bool acceptAI, QWidget *parent); + PlayerComboBox(Type, bool canBeNone, bool acceptAI, TQWidget *parent); Type type() const { return (Type)currentItem(); } diff --git a/libksirtet/lib/mp_board.h b/libksirtet/lib/mp_board.h index fbd1e01f..5e84825c 100644 --- a/libksirtet/lib/mp_board.h +++ b/libksirtet/lib/mp_board.h @@ -1,7 +1,7 @@ #ifndef MP_BOARD_H #define MP_BOARD_H -#include <qwidget.h> +#include <tqwidget.h> /** * The MP_Board class is the base widget from which each individual @@ -12,8 +12,8 @@ class MPBoard : public QWidget Q_OBJECT public: - MPBoard(QWidget *parent, const char *name=0) - : QWidget(parent, name) {} + MPBoard(TQWidget *parent, const char *name=0) + : TQWidget(parent, name) {} virtual ~MPBoard() {} /** @@ -23,7 +23,7 @@ class MPBoard : public QWidget * @param first is TRUE if this board is the first local one. */ virtual void init(bool AI, bool multiplayers, bool server, bool first, - const QString &name) = 0; + const TQString &name) = 0; /** * Put data on the stream. @@ -31,7 +31,7 @@ class MPBoard : public QWidget * This method is the communication way out. The data given here will * be the only information that will go to the server. */ - virtual void dataOut(QDataStream &) = 0; + virtual void dataOut(TQDataStream &) = 0; /** * Get data from the stream. @@ -39,7 +39,7 @@ class MPBoard : public QWidget * This method is the communication way in. The data given here will be * the only information that you will receive from the server. */ - virtual void dataIn(QDataStream &) = 0; + virtual void dataIn(TQDataStream &) = 0; signals: /** diff --git a/libksirtet/lib/mp_interface.cpp b/libksirtet/lib/mp_interface.cpp index 61742562..cfe06cd0 100644 --- a/libksirtet/lib/mp_interface.cpp +++ b/libksirtet/lib/mp_interface.cpp @@ -1,8 +1,8 @@ #include "mp_interface.h" #include "mp_interface.moc" -#include <qpainter.h> -#include <qlayout.h> +#include <tqpainter.h> +#include <tqlayout.h> #include <klocale.h> #include <kmessagebox.h> @@ -21,13 +21,13 @@ /*****************************************************************************/ MPInterface::MPInterface(const MPGameInfo &_gameInfo, uint nbActions, const ActionData *data, - QWidget *parent, const char *name) -: QWidget(parent, name), internal(0), gameInfo(_gameInfo), nbLocalHumans(0) + TQWidget *parent, const char *name) +: TQWidget(parent, name), internal(0), gameInfo(_gameInfo), nbLocalHumans(0) { Q_ASSERT( gameInfo.maxNbLocalPlayers>=1 ); - hbl = new QHBoxLayout(this, 0, 5); - hbl->setResizeMode( QLayout::Fixed ); + hbl = new TQHBoxLayout(this, 0, 5); + hbl->setResizeMode( TQLayout::Fixed ); _keyData = new KeyData(gameInfo.maxNbLocalPlayers, nbActions, data, this); } @@ -57,13 +57,13 @@ void MPInterface::dialog() // configuration wizard ConnectionData cd; MPWizard wiz(gameInfo, cd, this); - if ( wiz.exec()==QDialog::Rejected ) { + if ( wiz.exec()==TQDialog::Rejected ) { singleHuman(); // create a single game return; } // net meeting - QPtrList<RemoteHostData> rhd; + TQPtrList<RemoteHostData> rhd; rhd.setAutoDelete(TRUE); if (cd.network) { cId id(kapp->name(), gameInfo.gameId); @@ -98,13 +98,13 @@ void MPInterface::specialLocalGame(uint nbHumans, uint nbAIs) KConfigGroupSaver cg(kapp->config(), MP_GROUP); for (uint i=0; i<(nbHumans+nbAIs); i++) { bd.type = (i<nbHumans ? PlayerComboBox::Human : PlayerComboBox::AI); - bd.name = QString::null; + bd.name = TQString::null; t = (PlayerComboBox::Type) - cg.config()->readNumEntry(QString(MP_PLAYER_TYPE).arg(i), + cg.config()->readNumEntry(TQString(MP_PLAYER_TYPE).arg(i), PlayerComboBox::None); if ( bd.type==t ) - bd.name = cg.config()->readEntry(QString(MP_PLAYER_NAME).arg(i), - QString::null); + bd.name = cg.config()->readEntry(TQString(MP_PLAYER_NAME).arg(i), + TQString::null); if ( bd.name.isNull() ) bd.name = (i<nbHumans ? i18n("Human %1").arg(i+1) : i18n("AI %1").arg(i-nbHumans+1)); @@ -116,11 +116,11 @@ void MPInterface::specialLocalGame(uint nbHumans, uint nbAIs) Q_ASSERT( gameInfo.AIAllowed || nbAIs==0 ); createLocalGame(cd); - QPtrList<RemoteHostData> rhd; + TQPtrList<RemoteHostData> rhd; createServerGame(rhd); } -void MPInterface::createServerGame(const QPtrList<RemoteHostData> &rhd) +void MPInterface::createServerGame(const TQPtrList<RemoteHostData> &rhd) { internal = (rhd.count() ? (Local *)new NetworkServer(this, boards, rhd, gameInfo.interval) @@ -130,7 +130,7 @@ void MPInterface::createServerGame(const QPtrList<RemoteHostData> &rhd) void MPInterface::createClientGame(const RemoteHostData &rhd) { - QPtrList<RemoteHostData> r; + TQPtrList<RemoteHostData> r; r.append((RemoteHostData *)&rhd); internal = new Client(this, boards, r); init(); @@ -155,7 +155,7 @@ void MPInterface::createLocalGame(const ConnectionData &cd) d.ptr = newBoard(i); hbl->addWidget(d.ptr); d.ptr->show(); - connect(d.ptr, SIGNAL(enableKeys(bool)), SLOT(enableKeys(bool))); + connect(d.ptr, TQT_SIGNAL(enableKeys(bool)), TQT_SLOT(enableKeys(bool))); boards += d; } @@ -204,12 +204,12 @@ void MPInterface::enableKeys(bool enable) _keyData->setEnabled(hi, enable); } -void MPInterface::keyPressEvent(QKeyEvent *e) +void MPInterface::keyPressEvent(TQKeyEvent *e) { _keyData->keyEvent(e, true); } -void MPInterface::keyReleaseEvent(QKeyEvent *e) +void MPInterface::keyReleaseEvent(TQKeyEvent *e) { _keyData->keyEvent(e, false); } @@ -222,24 +222,24 @@ uint MPInterface::nbPlayers() const return internal->nbPlayers(); } -QString MPInterface::playerName(uint i) const +TQString MPInterface::playerName(uint i) const { Q_ASSERT(_server); return internal->playerName(i); } -QDataStream &MPInterface::readingStream(uint i) const +TQDataStream &MPInterface::readingStream(uint i) const { Q_ASSERT(_server); return internal->ioBuffer(i)->reading; } -QDataStream &MPInterface::writingStream(uint i) const +TQDataStream &MPInterface::writingStream(uint i) const { return internal->ioBuffer(i)->writing; } -QDataStream &MPInterface::dataToClientsStream() const +TQDataStream &MPInterface::dataToClientsStream() const { Q_ASSERT(_server); return *internal->globalStream(); @@ -250,14 +250,14 @@ void MPInterface::immediateWrite() internal->writeData(_server); } -void MPInterface::hostDisconnected(uint, const QString &msg) +void MPInterface::hostDisconnected(uint, const TQString &msg) { - errorBox(msg, QString::null, this); + errorBox(msg, TQString::null, this); if ( !disconnected ) { // to avoid multiple calls disconnected = TRUE; // the zero timer is used to be outside the "internal" class - QTimer::singleShot(0, this, SLOT(singleHumanSlot())); + TQTimer::singleShot(0, this, TQT_SLOT(singleHumanSlot())); } } @@ -267,8 +267,8 @@ void MPInterface::singleHumanSlot() singleHuman(); } -void MPInterface::paintEvent(QPaintEvent *e) +void MPInterface::paintEvent(TQPaintEvent *e) { - QPainter p(this); + TQPainter p(this); p.fillRect(e->rect(), darkGray); } diff --git a/libksirtet/lib/mp_interface.h b/libksirtet/lib/mp_interface.h index ad925cba..e52ea9f7 100644 --- a/libksirtet/lib/mp_interface.h +++ b/libksirtet/lib/mp_interface.h @@ -1,9 +1,9 @@ #ifndef MP_INTERFACE_H #define MP_INTERFACE_H -#include <qwidget.h> -#include <qvaluelist.h> -#include <qptrlist.h> +#include <tqwidget.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> #include "mp_board.h" #include "mp_option.h" @@ -82,7 +82,7 @@ class MPInterface : public QWidget */ MPInterface(const MPGameInfo &gameInfo, uint nbActions, const ActionData *data, - QWidget *parent = 0, const char *name = 0); + TQWidget *parent = 0, const char *name = 0); virtual ~MPInterface(); public slots: @@ -135,7 +135,7 @@ class MPInterface : public QWidget /** @return the player name. Do not call from client ! */ - QString playerName(uint i) const; + TQString playerName(uint i) const; /** * Create a new @ref MPBoard. @@ -161,11 +161,11 @@ class MPInterface : public QWidget /** @return the reading stream for board #i. * Do not call from client ! */ - QDataStream &readingStream(uint i) const; + TQDataStream &readingStream(uint i) const; /** @return the writing stream for board #i. */ - QDataStream &writingStream(uint i) const; + TQDataStream &writingStream(uint i) const; /** * Read data sent from server to clients "MultiplayersInterface" @@ -175,13 +175,13 @@ class MPInterface : public QWidget * local games. * NB: the use of this method is optional. */ - virtual void dataFromServer(QDataStream &) {} + virtual void dataFromServer(TQDataStream &) {} /** Used by the server to write meta data to clients. * NB: the use of this method is optional. * Do not call from client ! */ - QDataStream &dataToClientsStream() const; + TQDataStream &dataToClientsStream() const; /** Write immediately data to clients and local boards. * It is unlike the normal exchange which is driven @@ -203,12 +203,12 @@ class MPInterface : public QWidget * ie it stops the current game. By overloading this method, it is * possible to continue the game at this point with the remaining players. */ - virtual void hostDisconnected(uint i, const QString &msg); + virtual void hostDisconnected(uint i, const TQString &msg); protected: - void paintEvent(QPaintEvent *); - void keyPressEvent(QKeyEvent *); - void keyReleaseEvent(QKeyEvent *); + void paintEvent(TQPaintEvent *); + void keyPressEvent(TQKeyEvent *); + void keyReleaseEvent(TQKeyEvent *); private slots: void enableKeys(bool enable); @@ -220,21 +220,21 @@ class MPInterface : public QWidget Data() {} MPBoard *ptr; int humanIndex; - QString name; + TQString name; }; private: Local *internal; const MPGameInfo gameInfo; - QValueList<Data> boards; + TQValueList<Data> boards; uint nbLocalHumans; - QHBoxLayout *hbl; + TQHBoxLayout *hbl; bool _server, disconnected; KeyData *_keyData; - QMemArray<KeyCollection *> _keyCol; + TQMemArray<KeyCollection *> _keyCol; - void createServerGame(const QPtrList<RemoteHostData> &); + void createServerGame(const TQPtrList<RemoteHostData> &); void createClientGame(const RemoteHostData &); void createLocalGame(const ConnectionData &); void specialLocalGame(uint nbHumans, uint nbComputers); diff --git a/libksirtet/lib/mp_option.h b/libksirtet/lib/mp_option.h index 94c59107..2db2eacf 100644 --- a/libksirtet/lib/mp_option.h +++ b/libksirtet/lib/mp_option.h @@ -1,7 +1,7 @@ #ifndef MP_OPTION_H #define MP_OPTION_H -#include <qwidget.h> +#include <tqwidget.h> /** * The OptionWidget is a base widget for the option widget in the @@ -37,8 +37,8 @@ class MPOptionWidget : public QWidget Q_OBJECT public: - MPOptionWidget(bool Server, QWidget *parent = 0, const char *name = 0) - : QWidget(parent, name), server(Server) {} + MPOptionWidget(bool Server, TQWidget *parent = 0, const char *name = 0) + : TQWidget(parent, name), server(Server) {} virtual ~MPOptionWidget() {} bool isServer() const { return server; } @@ -47,10 +47,10 @@ class MPOptionWidget : public QWidget * This method is used on the client side to set the data coming from * the server widget. */ - virtual void dataIn(QDataStream &s) = 0; + virtual void dataIn(TQDataStream &s) = 0; /** This method is used on the server side to get the data. */ - virtual void dataOut(QDataStream &s) const = 0; + virtual void dataOut(TQDataStream &s) const = 0; /** * When the game will begin (ie when the "netmeeting" is over and the diff --git a/libksirtet/lib/mp_simple_board.cpp b/libksirtet/lib/mp_simple_board.cpp index f032c488..c0828f1e 100644 --- a/libksirtet/lib/mp_simple_board.cpp +++ b/libksirtet/lib/mp_simple_board.cpp @@ -3,13 +3,13 @@ void MPSimpleBoard::init(bool AI, bool multiplayers, bool server, bool first, - const QString &name) + const TQString &name) { state = BS_Init; _init(AI, multiplayers, server, first, name); } -void MPSimpleBoard::dataIn(QDataStream &s) +void MPSimpleBoard::dataIn(TQDataStream &s) { if ( s.atEnd() ) return; // no data @@ -24,14 +24,14 @@ void MPSimpleBoard::dataIn(QDataStream &s) } } -void MPSimpleBoard::initFlag(QDataStream &s) +void MPSimpleBoard::initFlag(TQDataStream &s) { state = BS_Play; emit enableKeys(true); _initFlag(s); } -void MPSimpleBoard::playFlag(QDataStream &s) +void MPSimpleBoard::playFlag(TQDataStream &s) { Q_ASSERT( state==BS_Play ); _playFlag(s); @@ -66,7 +66,7 @@ void MPSimpleBoard::_stop(bool gameover) _stopFlag(gameover); } -void MPSimpleBoard::dataOut(QDataStream &s) +void MPSimpleBoard::dataOut(TQDataStream &s) { switch (state) { case BS_Init: diff --git a/libksirtet/lib/mp_simple_board.h b/libksirtet/lib/mp_simple_board.h index 2131feb2..d9a681f7 100644 --- a/libksirtet/lib/mp_simple_board.h +++ b/libksirtet/lib/mp_simple_board.h @@ -11,31 +11,31 @@ class KDE_EXPORT MPSimpleBoard : public MPBoard Q_OBJECT public: - MPSimpleBoard(QWidget *parent = 0, const char *name = 0) + MPSimpleBoard(TQWidget *parent = 0, const char *name = 0) : MPBoard(parent, name) {} virtual ~MPSimpleBoard() {} void init(bool AI, bool multiplayers, bool server, bool first, - const QString &name); - void dataOut(QDataStream &s); - void dataIn(QDataStream &s); + const TQString &name); + void dataOut(TQDataStream &s); + void dataIn(TQDataStream &s); protected: virtual void _init(bool AI, bool multiplayers, bool server, bool first, - const QString &name) = 0; - virtual void _initFlag(QDataStream &s) = 0; - virtual void _playFlag(QDataStream &s) = 0; + const TQString &name) = 0; + virtual void _initFlag(TQDataStream &s) = 0; + virtual void _playFlag(TQDataStream &s) = 0; virtual void _pauseFlag(bool pause) = 0; virtual void _stopFlag(bool gameover) = 0; - virtual void _dataOut(QDataStream &s) = 0; - virtual void _gameOverDataOut(QDataStream &s) = 0; - virtual void _initDataOut(QDataStream &s) = 0; + virtual void _dataOut(TQDataStream &s) = 0; + virtual void _gameOverDataOut(TQDataStream &s) = 0; + virtual void _initDataOut(TQDataStream &s) = 0; private: BoardState state; - void initFlag(QDataStream &s); - void playFlag(QDataStream &s); + void initFlag(TQDataStream &s); + void playFlag(TQDataStream &s); void pauseFlag(); void stopFlag(); void gameOverFlag(); diff --git a/libksirtet/lib/mp_simple_interface.cpp b/libksirtet/lib/mp_simple_interface.cpp index e75243a6..1b83be40 100644 --- a/libksirtet/lib/mp_simple_interface.cpp +++ b/libksirtet/lib/mp_simple_interface.cpp @@ -2,7 +2,7 @@ #include "mp_simple_interface.moc" #include <kmessagebox.h> -#include <qtimer.h> +#include <tqtimer.h> #include <klocale.h> #include <kaction.h> #include <kmainwindow.h> @@ -13,7 +13,7 @@ MPSimpleInterface::MPSimpleInterface(const MPGameInfo &gi, uint nbActions, const ActionData *data, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) : MPInterface(gi, nbActions, data, parent, name), state(SS_Standby) {} @@ -64,7 +64,7 @@ void MPSimpleInterface::pause() } } -void MPSimpleInterface::dataFromServer(QDataStream &s) +void MPSimpleInterface::dataFromServer(TQDataStream &s) { if ( s.atEnd() ) return; // no data @@ -73,7 +73,7 @@ void MPSimpleInterface::dataFromServer(QDataStream &s) switch (scf.value()) { case SC_Flag::Stop: KMessageBox::information(this, i18n("Server has left game!")); - QTimer::singleShot(0, this, SLOT(singleHuman())); + TQTimer::singleShot(0, this, TQT_SLOT(singleHuman())); return; case SC_Flag::GameOver: _readGameOverData(s); @@ -141,7 +141,7 @@ void MPSimpleInterface::treatStop() state = SS_Standby; // read game over data + send them to all clients - QDataStream &s = dataToClientsStream(); + TQDataStream &s = dataToClientsStream(); SC_Flag f(SC_Flag::GameOver); s << f; _sendGameOverData(s); diff --git a/libksirtet/lib/mp_simple_interface.h b/libksirtet/lib/mp_simple_interface.h index 84e6f444..d366dafd 100644 --- a/libksirtet/lib/mp_simple_interface.h +++ b/libksirtet/lib/mp_simple_interface.h @@ -11,7 +11,7 @@ class MPSimpleInterface : public MPInterface public: MPSimpleInterface(const MPGameInfo &gi, uint nbActions, const ActionData *data, - QWidget *parent = 0, const char *name = 0); + TQWidget *parent = 0, const char *name = 0); bool isPaused() const { return state==SS_Pause; } @@ -22,8 +22,8 @@ class MPSimpleInterface : public MPInterface protected: virtual void _init() = 0; - virtual void _readGameOverData(QDataStream &s) = 0; - virtual void _sendGameOverData(QDataStream &s) = 0; + virtual void _readGameOverData(TQDataStream &s) = 0; + virtual void _sendGameOverData(TQDataStream &s) = 0; virtual void _showGameOverData() = 0; virtual void _firstInit() = 0; virtual void _treatInit() = 0; @@ -42,7 +42,7 @@ class MPSimpleInterface : public MPInterface void init(); void stop(); - void dataFromServer(QDataStream &); + void dataFromServer(TQDataStream &); }; #endif // MP_SIMPLE_INTERFACE_H diff --git a/libksirtet/lib/mp_simple_types.cpp b/libksirtet/lib/mp_simple_types.cpp index a470ce7c..c2a9dc27 100644 --- a/libksirtet/lib/mp_simple_types.cpp +++ b/libksirtet/lib/mp_simple_types.cpp @@ -1,6 +1,6 @@ #include "mp_simple_types.h" -QDataStream &operator <<(QDataStream &s, const EnumClass &ec) +TQDataStream &operator <<(TQDataStream &s, const EnumClass &ec) { s << (Q_UINT8)ec.f; return s; } -QDataStream &operator >>(QDataStream &s, EnumClass &ec) +TQDataStream &operator >>(TQDataStream &s, EnumClass &ec) { Q_UINT8 t; s >> t; ec.f = (int)t; return s; } diff --git a/libksirtet/lib/mp_simple_types.h b/libksirtet/lib/mp_simple_types.h index 2fd0c289..248d3fee 100644 --- a/libksirtet/lib/mp_simple_types.h +++ b/libksirtet/lib/mp_simple_types.h @@ -1,7 +1,7 @@ #ifndef WF_TYPES_H #define WF_TYPES_H -#include <qdatastream.h> +#include <tqdatastream.h> class EnumClass { @@ -9,8 +9,8 @@ class EnumClass EnumClass(int _f) : f(_f) {} int f; }; -QDataStream &operator <<(QDataStream &s, const EnumClass &f); -QDataStream &operator >>(QDataStream &s, EnumClass &f); +TQDataStream &operator <<(TQDataStream &s, const EnumClass &f); +TQDataStream &operator >>(TQDataStream &s, EnumClass &f); class IO_Flag : public EnumClass { diff --git a/libksirtet/lib/pline.cpp b/libksirtet/lib/pline.cpp index 41faf6ac..86fde398 100644 --- a/libksirtet/lib/pline.cpp +++ b/libksirtet/lib/pline.cpp @@ -1,36 +1,36 @@ #include "pline.h" #include "pline.moc" -#include <qfont.h> -#include <qpushbutton.h> +#include <tqfont.h> +#include <tqpushbutton.h> #include <klocale.h> #include "defines.h" #define THIN_BORDER 4 MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, - QWidget *parent, const char *name) -: QFrame(parent, name) + TQWidget *parent, const char *name) +: TQFrame(parent, name) { setFrameStyle(Panel | (serverLine ? Raised : Plain)); // Top layout - hbl = new QHBoxLayout(this, THIN_BORDER + frameWidth()); + hbl = new TQHBoxLayout(this, THIN_BORDER + frameWidth()); /* TriCheckBox */ tcb = new MeetingCheckBox(MeetingCheckBox::Ready, isOwner, serverIsReader, this); if ( !XOR(isOwner, serverIsReader) ) tcb->setEnabled(FALSE); - else connect(tcb, SIGNAL(changed(int)), SLOT(_typeChanged(int))); + else connect(tcb, TQT_SIGNAL(changed(int)), TQT_SLOT(_typeChanged(int))); hbl->addWidget(tcb); /* Name */ - lname = new QLabel(" ", this); + lname = new TQLabel(" ", this); lname->setAlignment(AlignCenter); - lname->setFrameStyle(QFrame::Panel | QFrame::Sunken); + lname->setFrameStyle(TQFrame::Panel | TQFrame::Sunken); lname->setLineWidth(2); lname->setMidLineWidth(3); - QFont f = lname->font(); + TQFont f = lname->font(); f.setBold(TRUE); lname->setFont(f); lname->setFixedSize(lname->fontMetrics().maxWidth()*NAME_MAX_LENGTH, @@ -39,21 +39,21 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, hbl->addStretch(1); // Nb humans - labH = new QLabel(this); + labH = new TQLabel(this); hbl->addWidget(labH); // Nb AIs - labAI = new QLabel(this); + labAI = new TQLabel(this); hbl->addWidget(labAI); // talker - qle = new QLineEdit(this); + qle = new TQLineEdit(this); qle->setMaxLength(TALKER_MAX_LENGTH); - qle->setFont( QFont("fixed", 12, QFont::Bold) ); + qle->setFont( TQFont("fixed", 12, TQFont::Bold) ); qle->setFixedSize(qle->fontMetrics().maxWidth()*TALKER_MAX_LENGTH, qle->sizeHint().height()); - connect(qle, SIGNAL(textChanged(const QString &)), - SLOT(_textChanged(const QString &))); + connect(qle, TQT_SIGNAL(textChanged(const TQString &)), + TQT_SLOT(_textChanged(const TQString &))); qle->setEnabled(isOwner); hbl->addWidget(qle); } @@ -81,33 +81,33 @@ void MeetingLine::data(ExtData &ed) const } /*****************************************************************************/ -PlayerLine::PlayerLine(PlayerComboBox::Type type, const QString &txt, +PlayerLine::PlayerLine(PlayerComboBox::Type type, const TQString &txt, bool humanSetting, bool AISetting, bool canBeEmpty, bool acceptAI, - QWidget *parent, const char *name) -: QFrame(parent, name), hs(humanSetting), as(AISetting) + TQWidget *parent, const char *name) +: TQFrame(parent, name), hs(humanSetting), as(AISetting) { setFrameStyle(Panel | Raised); // Top layout - QHBoxLayout *hbl; - hbl = new QHBoxLayout(this, THIN_BORDER + frameWidth()); + TQHBoxLayout *hbl; + hbl = new TQHBoxLayout(this, THIN_BORDER + frameWidth()); /* CheckBox */ pcb = new PlayerComboBox(type, canBeEmpty, acceptAI, this); - connect(pcb, SIGNAL(changed(int)), SLOT(typeChangedSlot(int))); + connect(pcb, TQT_SIGNAL(changed(int)), TQT_SLOT(typeChangedSlot(int))); hbl->addWidget(pcb); /* Name */ - edit = new QLineEdit(txt, this); + edit = new TQLineEdit(txt, this); edit->setMaxLength(NAME_MAX_LENGTH); edit->setFixedSize(edit->fontMetrics().maxWidth()*(NAME_MAX_LENGTH+2), edit->sizeHint().height()); hbl->addWidget(edit); /* settings button */ - setting = new QPushButton(i18n("Settings"), this); - connect(setting, SIGNAL(clicked()), SLOT(setSlot())); + setting = new TQPushButton(i18n("Settings"), this); + connect(setting, TQT_SIGNAL(clicked()), TQT_SLOT(setSlot())); hbl->addWidget(setting); typeChangedSlot(type); @@ -128,13 +128,13 @@ void PlayerLine::setSlot() } /*****************************************************************************/ -GWidgetList::GWidgetList(uint interval, QWidget *parent, const char * name) - : QWidget(parent, name), vbl(this, interval) +GWidgetList::GWidgetList(uint interval, TQWidget *parent, const char * name) + : TQWidget(parent, name), vbl(this, interval) { widgets.setAutoDelete(TRUE); } -void GWidgetList::append(QWidget *wi) +void GWidgetList::append(TQWidget *wi) { vbl.addWidget(wi); wi->show(); diff --git a/libksirtet/lib/pline.h b/libksirtet/lib/pline.h index 2defd10a..7d6e97e7 100644 --- a/libksirtet/lib/pline.h +++ b/libksirtet/lib/pline.h @@ -1,12 +1,12 @@ #ifndef PLINE_H #define PLINE_H -#include <qframe.h> -#include <qscrollbar.h> -#include <qlineedit.h> -#include <qlabel.h> -#include <qptrlist.h> -#include <qlayout.h> +#include <tqframe.h> +#include <tqscrollbar.h> +#include <tqlineedit.h> +#include <tqlabel.h> +#include <tqptrlist.h> +#include <tqlayout.h> #include "types.h" @@ -19,33 +19,33 @@ class MeetingLine : public QFrame public: MeetingLine(bool isOwner, bool readerIsServer, bool serverLine, - QWidget *parent, const char *name = 0); + TQWidget *parent, const char *name = 0); MeetingCheckBox::Type type() const { return tcb->type(); } void setType(MeetingCheckBox::Type type) { tcb->setType(type); } - void setText(const QString &text) { qle->setText(text); } + void setText(const TQString &text) { qle->setText(text); } void setData(const ExtData &ed); void data(ExtData &ed) const; - QString text() const { return qle->text(); } + TQString text() const { return qle->text(); } signals: void typeChanged(MeetingCheckBox::Type); - void textChanged(const QString &); + void textChanged(const TQString &); private slots: void _typeChanged(int t) { emit typeChanged((MeetingCheckBox::Type)t); } - void _textChanged(const QString &text) { emit textChanged(text); } + void _textChanged(const TQString &text) { emit textChanged(text); } protected: - QHBoxLayout *hbl; + TQHBoxLayout *hbl; private: MeetingCheckBox *tcb; - QLabel *lname, *labH, *labAI; - QValueList<BoardData> bds; - QLineEdit *qle; + TQLabel *lname, *labH, *labAI; + TQValueList<BoardData> bds; + TQLineEdit *qle; }; class PlayerLine : public QFrame @@ -53,13 +53,13 @@ class PlayerLine : public QFrame Q_OBJECT public: - PlayerLine(PlayerComboBox::Type type, const QString &txt, + PlayerLine(PlayerComboBox::Type type, const TQString &txt, bool humanSetting, bool AISetting, bool canBeEmpty, bool acceptAI, - QWidget *parent = 0, const char *name = 0); + TQWidget *parent = 0, const char *name = 0); PlayerComboBox::Type type() const { return pcb->type(); } - QString name() const { return edit->text(); } + TQString name() const { return edit->text(); } signals: void setHuman(); @@ -72,8 +72,8 @@ class PlayerLine : public QFrame private: PlayerComboBox *pcb; - QLineEdit *edit; - QPushButton *setting; + TQLineEdit *edit; + TQPushButton *setting; bool hs, as; }; @@ -83,26 +83,26 @@ class GWidgetList : public QWidget Q_OBJECT public: - GWidgetList(uint interval, QWidget *parent = 0, const char * name = 0); + GWidgetList(uint interval, TQWidget *parent = 0, const char * name = 0); void remove(uint i); uint size() const { return widgets.count(); } protected: /** The widget must be created with this widget as parent. */ - void append(QWidget *); - QWidget *widget(uint i) { return widgets.at(i); } + void append(TQWidget *); + TQWidget *widget(uint i) { return widgets.at(i); } private: - QPtrList<QWidget> widgets; - QVBoxLayout vbl; + TQPtrList<TQWidget> widgets; + TQVBoxLayout vbl; }; template <class Type> class WidgetList : public GWidgetList { public: - WidgetList(uint interval, QWidget *parent=0, const char *name=0) + WidgetList(uint interval, TQWidget *parent=0, const char *name=0) : GWidgetList(interval, parent, name) {} void append(Type *w) { GWidgetList::append(w); } diff --git a/libksirtet/lib/smanager.h b/libksirtet/lib/smanager.h index a831b702..59dd0edb 100644 --- a/libksirtet/lib/smanager.h +++ b/libksirtet/lib/smanager.h @@ -75,7 +75,7 @@ class SocketManager bool dataPending(uint i); private: - QMemArray<Socket *> sockets; + TQMemArray<Socket *> sockets; fd_set read_set, write_set, read_tmp, write_tmp; struct timeval tv; diff --git a/libksirtet/lib/socket.cpp b/libksirtet/lib/socket.cpp index 9ef3ba3c..6defc94b 100644 --- a/libksirtet/lib/socket.cpp +++ b/libksirtet/lib/socket.cpp @@ -21,12 +21,12 @@ #endif Socket::Socket(KExtendedSocket *s, bool createNotifier, - QObject *parent, const char *name) + TQObject *parent, const char *name) : _socket(s), _notifier(0) { Q_ASSERT(s); if (createNotifier) { - _notifier = new QSocketNotifier(s->fd(), QSocketNotifier::Read, + _notifier = new TQSocketNotifier(s->fd(), TQSocketNotifier::Read, parent, name); _notifier->setEnabled(FALSE); } @@ -38,7 +38,7 @@ Socket::~Socket() delete _socket; } -bool Socket::write(const QByteArray &a) +bool Socket::write(const TQByteArray &a) { return ( _socket->writeBlock(a.data(), a.size())==(int)a.size() ); } diff --git a/libksirtet/lib/socket.h b/libksirtet/lib/socket.h index a2f47a63..01dac726 100644 --- a/libksirtet/lib/socket.h +++ b/libksirtet/lib/socket.h @@ -1,7 +1,7 @@ #ifndef SOCKET_H #define SOCKET_H -#include <qsocketnotifier.h> +#include <tqsocketnotifier.h> #include <kextsock.h> @@ -12,7 +12,7 @@ class Socket { public: Socket(KExtendedSocket *, bool createNotifier = FALSE, - QObject *parent = 0, const char *name = 0); + TQObject *parent = 0, const char *name = 0); /** close the socket */ ~Socket(); @@ -28,7 +28,7 @@ class Socket * @return the socket notifier associated with the socket * (0 if none). */ - QSocketNotifier *notifier() const { return _notifier; } + TQSocketNotifier *notifier() const { return _notifier; } /** * Write data contained in the writing stream to the socket. @@ -36,9 +36,9 @@ class Socket * @return TRUE if all was written without error. */ bool write(); - bool write(const QByteArray &a); + bool write(const TQByteArray &a); - /** @return the QDataStream for writing. */ + /** @return the TQDataStream for writing. */ WritingStream &writingStream() { return writing; } /** @return the size of pending data. */ @@ -56,7 +56,7 @@ class Socket private: KExtendedSocket *_socket; - QSocketNotifier *_notifier; + TQSocketNotifier *_notifier; WritingStream writing; ReadingStream reading; diff --git a/libksirtet/lib/types.cpp b/libksirtet/lib/types.cpp index 557fffff..ad3dbc9b 100644 --- a/libksirtet/lib/types.cpp +++ b/libksirtet/lib/types.cpp @@ -3,7 +3,7 @@ #include <klocale.h> #include "version.h" -cId::cId(const QString &_gameName, const QString &_gameId) +cId::cId(const TQString &_gameName, const TQString &_gameId) : libId(MULTI_ID), gameName(_gameName), gameId(_gameId) {} @@ -15,12 +15,12 @@ void cId::check(const cId &id) else state = Accepted; } -QString cId::errorMessage(const cId &id) const +TQString cId::errorMessage(const cId &id) const { - QString str = i18n("\nServer: \"%1\"\nClient: \"%2\""); + TQString str = i18n("\nServer: \"%1\"\nClient: \"%2\""); switch (state) { - case Accepted: return QString::null; + case Accepted: return TQString::null; case LibIdClash: return i18n("The MultiPlayer library of the server is incompatible") + str.arg(libId).arg(id.libId); @@ -32,16 +32,16 @@ QString cId::errorMessage(const cId &id) const + str.arg(gameId).arg(id.gameId); } Q_ASSERT(0); - return QString::null; + return TQString::null; } -QDataStream &operator << (QDataStream &s, const cId &id) +TQDataStream &operator << (TQDataStream &s, const cId &id) { s << id.libId << id.gameName << id.gameId << (Q_UINT8)id.state; return s; } -QDataStream &operator >> (QDataStream &s, cId &id) +TQDataStream &operator >> (TQDataStream &s, cId &id) { Q_UINT8 state; s >> id.libId >> id.gameName >> id.gameId >> state; @@ -50,13 +50,13 @@ QDataStream &operator >> (QDataStream &s, cId &id) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const MeetingMsgFlag &f) +TQDataStream &operator << (TQDataStream &s, const MeetingMsgFlag &f) { s << (Q_UINT8)f; return s; } -QDataStream &operator >> (QDataStream &s, MeetingMsgFlag &f) +TQDataStream &operator >> (TQDataStream &s, MeetingMsgFlag &f) { Q_UINT8 i; s >> i; f = (MeetingMsgFlag)i; @@ -64,13 +64,13 @@ QDataStream &operator >> (QDataStream &s, MeetingMsgFlag &f) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const TextInfo &ti) +TQDataStream &operator << (TQDataStream &s, const TextInfo &ti) { s << (Q_UINT32)ti.i << ti.text; return s; } -QDataStream &operator >> (QDataStream &s, TextInfo &ti) +TQDataStream &operator >> (TQDataStream &s, TextInfo &ti) { Q_UINT32 i; s >> i >> ti.text; ti.i = i; @@ -78,13 +78,13 @@ QDataStream &operator >> (QDataStream &s, TextInfo &ti) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const MeetingCheckBox::Type &t) +TQDataStream &operator << (TQDataStream &s, const MeetingCheckBox::Type &t) { s << (Q_UINT8)t; return s; } -QDataStream &operator >> (QDataStream &s, MeetingCheckBox::Type &t) +TQDataStream &operator >> (TQDataStream &s, MeetingCheckBox::Type &t) { Q_UINT8 i; s >> i; t = (MeetingCheckBox::Type)i; @@ -92,13 +92,13 @@ QDataStream &operator >> (QDataStream &s, MeetingCheckBox::Type &t) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const TypeInfo &ti) +TQDataStream &operator << (TQDataStream &s, const TypeInfo &ti) { s << (Q_UINT32)ti.i << ti.type; return s; } -QDataStream &operator >> (QDataStream &s, TypeInfo &ti) +TQDataStream &operator >> (TQDataStream &s, TypeInfo &ti) { Q_UINT32 i; s >> i >> ti.type; ti.i = i; @@ -106,13 +106,13 @@ QDataStream &operator >> (QDataStream &s, TypeInfo &ti) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const BoardData &bd) +TQDataStream &operator << (TQDataStream &s, const BoardData &bd) { s << (Q_UINT8)bd.type << bd.name; return s; } -QDataStream &operator >> (QDataStream &s, BoardData &bd) +TQDataStream &operator >> (TQDataStream &s, BoardData &bd) { Q_UINT8 i; s >> i >> bd.name; @@ -121,26 +121,26 @@ QDataStream &operator >> (QDataStream &s, BoardData &bd) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const ExtData &ed) +TQDataStream &operator << (TQDataStream &s, const ExtData &ed) { s << ed.bds << ed.text << ed.type; return s; } -QDataStream &operator >> (QDataStream &s, ExtData &ed) +TQDataStream &operator >> (TQDataStream &s, ExtData &ed) { s >> ed.bds >> ed.text >> ed.type; return s; } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const MeetingLineData &pld) +TQDataStream &operator << (TQDataStream &s, const MeetingLineData &pld) { s << pld.ed << (Q_UINT8)pld.own; return s; } -QDataStream &operator >> (QDataStream &s, MeetingLineData &pld) +TQDataStream &operator >> (TQDataStream &s, MeetingLineData &pld) { Q_UINT8 b; s >> pld.ed >> b; pld.own = b; @@ -148,13 +148,13 @@ QDataStream &operator >> (QDataStream &s, MeetingLineData &pld) } //----------------------------------------------------------------------------- -QDataStream &operator << (QDataStream &s, const MetaFlag &f) +TQDataStream &operator << (TQDataStream &s, const MetaFlag &f) { s << (Q_UINT8)f; return s; } -QDataStream &operator >> (QDataStream &s, MetaFlag &f) +TQDataStream &operator >> (TQDataStream &s, MetaFlag &f) { Q_UINT8 i; s >> i; f = (MetaFlag)i; @@ -177,7 +177,7 @@ void Stream::clear() buf.open(mode | IO_Truncate); } -void Stream::setArray(QByteArray a) +void Stream::setArray(TQByteArray a) { buf.close(); buf.setBuffer(a); @@ -194,7 +194,7 @@ void ReadingStream::clearRead() int i = buf.at(); if ( i==0 ) return; buf.close(); - QByteArray a; + TQByteArray a; a.duplicate(buffer().data() + i, size() - i); buf.setBuffer(a); buf.open(IO_ReadOnly); @@ -205,7 +205,7 @@ void IOBuffer::writingToReading() { // this should do the trick :) reading.setArray(writing.buffer()); - QByteArray a; + TQByteArray a; writing.setArray(a); } @@ -228,7 +228,7 @@ void BufferArray::resize(uint nb) for (uint i=s; i<nb; i++) a[i] = new IOBuffer; } -QDataStream &operator <<(QDataStream &s, const BufferArray &b) +TQDataStream &operator <<(TQDataStream &s, const BufferArray &b) { for (uint i=0; i<b.size(); i++) { s.writeBytes(b[i]->writing.buffer().data(), b[i]->writing.size()); @@ -238,13 +238,13 @@ QDataStream &operator <<(QDataStream &s, const BufferArray &b) return s; } -QDataStream &operator >>(QDataStream &s, BufferArray &b) +TQDataStream &operator >>(TQDataStream &s, BufferArray &b) { uint size; char *c; for (uint i=0; i<b.size(); i++) { s.readBytes(c, size); - QByteArray a; + TQByteArray a; a.assign(c, size); b[i]->reading.setArray(a); // debug("BUFFERARRAY : >> (i=%i c=%i size=%i s=%i)", diff --git a/libksirtet/lib/types.h b/libksirtet/lib/types.h index 2ccdcba0..ee5867fa 100644 --- a/libksirtet/lib/types.h +++ b/libksirtet/lib/types.h @@ -1,9 +1,9 @@ #ifndef MTYPES_H #define MTYPES_H -#include <qstring.h> -#include <qbuffer.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqbuffer.h> +#include <tqvaluelist.h> #include "miscui.h" @@ -13,28 +13,28 @@ class cId { public: cId() {} - cId(const QString &gameName, const QString &gameId); + cId(const TQString &gameName, const TQString &gameId); enum State { Accepted, LibIdClash, GameNameClash, GameIdClash }; void check(const cId &id); bool accepted() const { return state==Accepted; } - QString errorMessage(const cId &id) const; + TQString errorMessage(const cId &id) const; - friend QDataStream &operator << (QDataStream &s, const cId &id); - friend QDataStream &operator >> (QDataStream &s, cId &id); + friend TQDataStream &operator << (TQDataStream &s, const cId &id); + friend TQDataStream &operator >> (TQDataStream &s, cId &id); private: - QString libId, gameName, gameId; + TQString libId, gameName, gameId; State state; }; -QDataStream &operator << (QDataStream &s, const cId &id); -QDataStream &operator >> (QDataStream &s, cId &id); +TQDataStream &operator << (TQDataStream &s, const cId &id); +TQDataStream &operator >> (TQDataStream &s, cId &id); /** Flags used for the netmeeting. */ enum MeetingMsgFlag { IdFlag = 0, EndFlag, NewFlag, DelFlag, Mod_TextFlag, Mod_TypeFlag, Mod_OptFlag, PlayFlag }; -QDataStream &operator << (QDataStream &s, const MeetingMsgFlag &f); -QDataStream &operator >> (QDataStream &s, MeetingMsgFlag &f); +TQDataStream &operator << (TQDataStream &s, const MeetingMsgFlag &f); +TQDataStream &operator >> (TQDataStream &s, MeetingMsgFlag &f); /** Internal class : used in netmeeting to transport text line. */ class TextInfo @@ -43,20 +43,20 @@ class TextInfo TextInfo() {} uint i; - QString text; + TQString text; }; -QDataStream &operator << (QDataStream &s, const TextInfo &ti); -QDataStream &operator >> (QDataStream &s, TextInfo &ti); +TQDataStream &operator << (TQDataStream &s, const TextInfo &ti); +TQDataStream &operator >> (TQDataStream &s, TextInfo &ti); /** Internal class : used in netmeeting to transport readiness status. */ typedef struct { uint i; MeetingCheckBox::Type type; } TypeInfo; -QDataStream &operator << (QDataStream &s, const MeetingCheckBox::Type &t); -QDataStream &operator >> (QDataStream &s, MeetingCheckBox::Type &t); -QDataStream &operator << (QDataStream &s, const TypeInfo &ti); -QDataStream &operator >> (QDataStream &s, TypeInfo &ti); +TQDataStream &operator << (TQDataStream &s, const MeetingCheckBox::Type &t); +TQDataStream &operator >> (TQDataStream &s, MeetingCheckBox::Type &t); +TQDataStream &operator << (TQDataStream &s, const TypeInfo &ti); +TQDataStream &operator >> (TQDataStream &s, TypeInfo &ti); /* Internal class : store game data. */ class BoardData @@ -64,27 +64,27 @@ class BoardData public: BoardData() {} - QString name; + TQString name; PlayerComboBox::Type type; }; -QDataStream &operator <<(QDataStream &, const BoardData &); -QDataStream &operator >>(QDataStream &, BoardData &); +TQDataStream &operator <<(TQDataStream &, const BoardData &); +TQDataStream &operator >>(TQDataStream &, BoardData &); /* Internal class : store extended game data (used in netmeeting). */ class ExtData { public: ExtData() {} - ExtData(const QValueList<BoardData> &_bds, const QString &_text, + ExtData(const TQValueList<BoardData> &_bds, const TQString &_text, MeetingCheckBox::Type _type) : bds(_bds), text(_text), type(_type) {} - QValueList<BoardData> bds; - QString text; + TQValueList<BoardData> bds; + TQString text; MeetingCheckBox::Type type; }; -QDataStream &operator << (QDataStream &s, const ExtData &ed); -QDataStream &operator >> (QDataStream &s, ExtData &ed); +TQDataStream &operator << (TQDataStream &s, const ExtData &ed); +TQDataStream &operator >> (TQDataStream &s, ExtData &ed); /* Internal class : store meeting line data (in netmeeting). */ class MeetingLineData @@ -95,8 +95,8 @@ class MeetingLineData ExtData ed; bool own; }; -QDataStream &operator << (QDataStream &s, const MeetingLineData &pld); -QDataStream &operator >> (QDataStream &s, MeetingLineData &pld); +TQDataStream &operator << (TQDataStream &s, const MeetingLineData &pld); +TQDataStream &operator >> (TQDataStream &s, MeetingLineData &pld); /* Internal class : store remote host data. */ class Socket; @@ -107,7 +107,7 @@ class RemoteHostData RemoteHostData() : socket(0) {} Socket *socket; - QValueList<BoardData> bds; + TQValueList<BoardData> bds; }; /* Internal class : store connection data (used by config. wizard). */ @@ -122,36 +122,36 @@ class ConnectionData /** Flags used for network communication. */ enum MetaFlag { MF_Ask = 0, MF_Data }; -QDataStream &operator << (QDataStream &s, const MetaFlag &f); -QDataStream &operator >> (QDataStream &s, MetaFlag &f); +TQDataStream &operator << (TQDataStream &s, const MetaFlag &f); +TQDataStream &operator >> (TQDataStream &s, MetaFlag &f); -/** Internal class : encapsulate read/write QBuffer. */ +/** Internal class : encapsulate read/write TQBuffer. */ class Stream : public QDataStream { public: Stream(int mode); void clear(); - void setArray(QByteArray a); + void setArray(TQByteArray a); - QByteArray buffer() const { return buf.buffer(); } + TQByteArray buffer() const { return buf.buffer(); } uint size() const { return buf.buffer().size(); } protected: - QBuffer buf; + TQBuffer buf; private: int mode; }; -/** Internal class : encapsulate write QBuffer. */ +/** Internal class : encapsulate write TQBuffer. */ class WritingStream : public Stream { public: WritingStream() : Stream(IO_WriteOnly) {} }; -/** Internal class : encapsulate read QBuffer. */ +/** Internal class : encapsulate read TQBuffer. */ class ReadingStream : public Stream { public: @@ -187,11 +187,11 @@ class BufferArray IOBuffer *operator [](uint i) const { return a[i]; } private: - QMemArray<IOBuffer *> a; + TQMemArray<IOBuffer *> a; void clear(uint nb); }; -QDataStream &operator <<(QDataStream &s, const BufferArray &b); -QDataStream &operator >>(QDataStream &s, BufferArray &b); +TQDataStream &operator <<(TQDataStream &s, const BufferArray &b); +TQDataStream &operator >>(TQDataStream &s, BufferArray &b); #endif // MTYPES_H diff --git a/libksirtet/lib/wizard.cpp b/libksirtet/lib/wizard.cpp index 30d5a89d..19d9de34 100644 --- a/libksirtet/lib/wizard.cpp +++ b/libksirtet/lib/wizard.cpp @@ -4,14 +4,14 @@ #include <sys/types.h> #include <netinet/in.h> -#include <qvbuttongroup.h> -#include <qradiobutton.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qsignalmapper.h> -#include <qvgroupbox.h> -#include <qgrid.h> -#include <qfile.h> +#include <tqvbuttongroup.h> +#include <tqradiobutton.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqsignalmapper.h> +#include <tqvgroupbox.h> +#include <tqgrid.h> +#include <tqfile.h> #include <kapplication.h> #include <klocale.h> @@ -32,7 +32,7 @@ #define MAX_USER_PORT 65535 MPWizard::MPWizard(const MPGameInfo &gi, ConnectionData &_cd, - QWidget *parent, const char *name) + TQWidget *parent, const char *name) : KWizard(parent, name, TRUE), cd(_cd) { // setupTypePage(); // #### REMOVE NETWORK GAMES UNTIL FIXED @@ -45,26 +45,26 @@ void MPWizard::setupTypePage() { KConfigGroupSaver cg(kapp->config(), MP_GROUP); - typePage = new QVBox(this); + typePage = new TQVBox(this); typePage->setMargin(KDialogBase::marginHint()); - QVButtonGroup *vbg = new QVButtonGroup(typePage); - connect(vbg, SIGNAL(clicked(int)), SLOT(typeChanged(int))); - QRadioButton *b; - b = new QRadioButton(i18n("Create a local game"), vbg); - b = new QRadioButton(i18n("Create a network game"), vbg); - b = new QRadioButton(i18n("Join a network game"), vbg); + TQVButtonGroup *vbg = new TQVButtonGroup(typePage); + connect(vbg, TQT_SIGNAL(clicked(int)), TQT_SLOT(typeChanged(int))); + TQRadioButton *b; + b = new TQRadioButton(i18n("Create a local game"), vbg); + b = new TQRadioButton(i18n("Create a network game"), vbg); + b = new TQRadioButton(i18n("Join a network game"), vbg); type = (Type)cg.config()->readNumEntry(MP_GAMETYPE, 0); if ( type<0 || type>2 ) type = Local; vbg->setButton(type); typePage->setSpacing(KDialogBase::spacingHint()); - net = new QVGroupBox(i18n("Network Settings"), typePage); - QGrid *grid = new QGrid(2, net); - lserver = new QLabel(" ", grid); + net = new TQVGroupBox(i18n("Network Settings"), typePage); + TQGrid *grid = new TQGrid(2, net); + lserver = new TQLabel(" ", grid); grid->setSpacing(KDialogBase::spacingHint()); - eserver = new QLineEdit(grid); - (void)new QLabel(i18n("Port:"), grid); + eserver = new TQLineEdit(grid); + (void)new TQLabel(i18n("Port:"), grid); int p = cg.config()->readNumEntry(MP_PORT, (uint)MIN_USER_PORT); eport = new KIntNumInput(p, grid); eport->setRange(MIN_USER_PORT, MAX_USER_PORT, 1, false); @@ -77,51 +77,51 @@ void MPWizard::setupTypePage() //----------------------------------------------------------------------------- void MPWizard::setupLocalPage(const MPGameInfo &gi) { - localPage = new QVBox(this); + localPage = new TQVBox(this); localPage->setMargin(KDialogBase::marginHint()); wl = new WidgetList<PlayerLine>(5, localPage); - QSignalMapper *husm = new QSignalMapper(this); - if (gi.humanSettingSlot) connect(husm, SIGNAL(mapped(int)), + TQSignalMapper *husm = new TQSignalMapper(this); + if (gi.humanSettingSlot) connect(husm, TQT_SIGNAL(mapped(int)), gi.humanSettingSlot); - QSignalMapper *aism = new QSignalMapper(this); - if (gi.AISettingSlot) connect(aism, SIGNAL(mapped(int)), gi.AISettingSlot); + TQSignalMapper *aism = new TQSignalMapper(this); + if (gi.AISettingSlot) connect(aism, TQT_SIGNAL(mapped(int)), gi.AISettingSlot); KConfigGroupSaver cg(kapp->config(), MP_GROUP); - QString n; + TQString n; PlayerComboBox::Type type; PlayerLine *pl; Q_ASSERT( gi.maxNbLocalPlayers>0 ); for (uint i=0; i<gi.maxNbLocalPlayers; i++) { type = (PlayerComboBox::Type) - cg.config()->readNumEntry(QString(MP_PLAYER_TYPE).arg(i), + cg.config()->readNumEntry(TQString(MP_PLAYER_TYPE).arg(i), (i==0 ? PlayerComboBox::Human : PlayerComboBox::None)); - n = cg.config()->readEntry(QString(MP_PLAYER_NAME).arg(i), + n = cg.config()->readEntry(TQString(MP_PLAYER_NAME).arg(i), i18n("Player #%1").arg(i)); pl = new PlayerLine(type, n, gi.humanSettingSlot, gi.AISettingSlot, i!=0, gi.AIAllowed, wl); - connect(pl, SIGNAL(typeChanged(int)), SLOT(lineTypeChanged(int))); + connect(pl, TQT_SIGNAL(typeChanged(int)), TQT_SLOT(lineTypeChanged(int))); husm->setMapping(pl, i); - connect(pl, SIGNAL(setHuman()), husm, SLOT(map())); + connect(pl, TQT_SIGNAL(setHuman()), husm, TQT_SLOT(map())); aism->setMapping(pl, i); - connect(pl, SIGNAL(setAI()), aism, SLOT(map())); + connect(pl, TQT_SIGNAL(setAI()), aism, TQT_SLOT(map())); wl->append(pl); } - ((QVBox *)localPage)->setSpacing(KDialogBase::spacingHint()); + ((TQVBox *)localPage)->setSpacing(KDialogBase::spacingHint()); -// keys = new QPushButton(i18n("Configure Keys..."), localPage); -// connect(keys, SIGNAL(clicked()), SLOT(configureKeysSlot())); +// keys = new TQPushButton(i18n("Configure Keys..."), localPage); +// connect(keys, TQT_SIGNAL(clicked()), TQT_SLOT(configureKeysSlot())); addPage(localPage, i18n("Local Player's Settings")); setHelpEnabled(localPage, FALSE); lineTypeChanged(0); } -QString MPWizard::name(uint i) const +TQString MPWizard::name(uint i) const { - QString s = wl->widget(i)->name(); + TQString s = wl->widget(i)->name(); if ( s.length()==0 ) s = i18n("Player #%1").arg(i); return s; } @@ -130,7 +130,7 @@ void MPWizard::typeChanged(int t) { type = (Type)t; - QString str; + TQString str; if ( type!=Client ) { str = "localhost"; lserver->setText(i18n("Hostname:")); @@ -170,7 +170,7 @@ void MPWizard::accept() int flags = KExtendedSocket::inetSocket | KExtendedSocket::streamSocket; if (cd.server) flags |= KExtendedSocket::passiveSocket; - QString host = QFile::encodeName(eserver->text()); + TQString host = TQFile::encodeName(eserver->text()); KExtendedSocket *socket = new KExtendedSocket(host, eport->value(), flags); @@ -206,15 +206,15 @@ void MPWizard::accept() cg.config()->writeEntry(MP_GAMETYPE, (int)type); for (uint i=0; i<wl->size(); i++) { - cg.config()->writeEntry(QString(MP_PLAYER_TYPE).arg(i), + cg.config()->writeEntry(TQString(MP_PLAYER_TYPE).arg(i), (int)wl->widget(i)->type()); - cg.config()->writeEntry(QString(MP_PLAYER_NAME).arg(i), name(i)); + cg.config()->writeEntry(TQString(MP_PLAYER_NAME).arg(i), name(i)); } KWizard::accept(); } -void MPWizard::showPage(QWidget *page) +void MPWizard::showPage(TQWidget *page) { if ( page==localPage ) setFinishEnabled(localPage, TRUE); KWizard::showPage(page); diff --git a/libksirtet/lib/wizard.h b/libksirtet/lib/wizard.h index 29287508..fd90a3b8 100644 --- a/libksirtet/lib/wizard.h +++ b/libksirtet/lib/wizard.h @@ -1,11 +1,11 @@ #ifndef WIZARD_H #define WIZARD_H -#include <qlabel.h> -#include <qlineedit.h> -#include <qvbox.h> -#include <qvgroupbox.h> -#include <qpushbutton.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqvbox.h> +#include <tqvgroupbox.h> +#include <tqpushbutton.h> #include <knuminput.h> #include <kconfig.h> @@ -22,9 +22,9 @@ class MPWizard : public KWizard public: MPWizard(const MPGameInfo &gi, ConnectionData &cd, - QWidget *parent = 0, const char *name = 0); + TQWidget *parent = 0, const char *name = 0); - void showPage(QWidget *page); + void showPage(TQWidget *page); signals: void configureKeys(uint); @@ -41,17 +41,17 @@ class MPWizard : public KWizard ConnectionData &cd; enum Type { Local, Server, Client }; Type type; - QVBox *typePage, *localPage; + TQVBox *typePage, *localPage; WidgetList<PlayerLine> *wl; - QLabel *lserver; - QLineEdit *eserver; + TQLabel *lserver; + TQLineEdit *eserver; KIntNumInput *eport; - QVGroupBox *net; -// QPushButton *keys; + TQVGroupBox *net; +// TQPushButton *keys; void setupTypePage(); void setupLocalPage(const MPGameInfo &gi); - QString name(uint i) const; + TQString name(uint i) const; }; #endif // WIZARD_H |