From 66230b1cca2fa5c95886d8cf708829e4bfac2b10 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 7 Apr 2025 15:50:40 +0900 Subject: [PATCH] Replace TRUE/FALSE with boolean values true/false Signed-off-by: Michele Calgaro --- kasteroids/toplevel.cpp | 2 +- kasteroids/view.h | 2 +- kbackgammon/engines/offline/kbgoffline.cpp | 6 +- kblackbox/kbbgame.cpp | 26 +- kblackbox/kbbgfx.cpp | 6 +- kbounce/kbounce.cpp | 4 +- kenolaba/AbTop.cpp | 4 +- kenolaba/BoardWidget.cpp | 4 +- kenolaba/EvalDlgImpl.cpp | 4 +- kenolaba/Network.cpp | 2 +- kgoldrunner/src/kgoldrunner.cpp | 142 +++++----- kgoldrunner/src/kgrcanvas.cpp | 14 +- kgoldrunner/src/kgrdialog.cpp | 52 ++-- kgoldrunner/src/kgrfigure.cpp | 154 +++++------ kgoldrunner/src/kgrgame.cpp | 256 +++++++++--------- kgoldrunner/src/kgrobject.cpp | 22 +- kgoldrunner/src/kgrobject.h | 2 +- kjumpingcube/kcubeboxwidget.h | 2 +- klines/field.cpp | 2 +- klines/klines.cpp | 2 +- klines/linesboard.cpp | 18 +- klines/prompt.cpp | 2 +- kpat/card.cpp | 6 +- kpat/freecell-solver/pqueue.c | 10 +- kpat/freecell-solver/pqueue.h | 2 +- kpoker/kpoker.cpp | 14 +- kreversi/board.h | 2 +- kreversi/kreversi.cpp | 4 +- kreversi/kreversi.h | 2 +- kreversi/qreversigame.h | 2 +- kreversi/qreversigameview.h | 2 +- ksame/StoneWidget.cpp | 2 +- kshisen/board.h | 2 +- ksnake/snake.h | 2 +- libksirtet/base/board.cpp | 4 +- libksirtet/base/piece.cpp | 4 +- libksirtet/common/misc_ui.cpp | 6 +- libksirtet/lib/internal.cpp | 20 +- libksirtet/lib/meeting.cpp | 34 +-- libksirtet/lib/mp_board.h | 6 +- libksirtet/lib/mp_interface.cpp | 10 +- libksirtet/lib/mp_simple_board.cpp | 6 +- libksirtet/lib/mp_simple_interface.cpp | 8 +- libksirtet/lib/pline.cpp | 6 +- libksirtet/lib/smanager.h | 4 +- libksirtet/lib/socket.cpp | 2 +- libksirtet/lib/socket.h | 4 +- libksirtet/lib/wizard.cpp | 12 +- libtdegames/kcarddialog.h | 20 +- libtdegames/kgame/COMPAT | 2 +- libtdegames/kgame/dialogs/kgamedialog.h | 2 +- libtdegames/kgame/dialogs/kgamedialogconfig.h | 4 +- libtdegames/kgame/kgame.h | 10 +- libtdegames/kgame/kgameio.h | 6 +- libtdegames/kgame/kgamenetwork.h | 6 +- libtdegames/kgame/kgameproperty.h | 6 +- libtdegames/kgame/kmessageclient.h | 6 +- libtdegames/kgame/kmessageio.h | 8 +- libtdegames/kgame/kmessageserver.cpp | 2 +- libtdegames/kgameprogress.cpp | 6 +- lskat/lskat/KConnectEntry.cpp | 6 +- lskat/lskat/KEInput.cpp | 32 +-- lskat/lskat/KRemoteConnect.cpp | 8 +- lskat/lskat/TDEProcessConnect.cpp | 2 +- lskat/lskat/lskatview.cpp | 4 +- lskat/lskat/msgdlg.cpp | 6 +- lskat/lskat/namedlg.cpp | 2 +- lskat/lskat/namedlg.h | 2 +- lskat/lskat/networkdlg.cpp | 2 +- tdefifteen/src/gameboard.cpp | 6 +- 70 files changed, 524 insertions(+), 528 deletions(-) diff --git a/kasteroids/toplevel.cpp b/kasteroids/toplevel.cpp index 397f2715..9a6e956c 100644 --- a/kasteroids/toplevel.cpp +++ b/kasteroids/toplevel.cpp @@ -641,7 +641,7 @@ void KAstTopLevel::doStats() .arg(view->shots() - view->hits()) .arg(r); - view->showText( s, green, FALSE ); + view->showText( s, green, false ); } void KAstTopLevel::slotUpdateVitals() diff --git a/kasteroids/view.h b/kasteroids/view.h index e71550e2..9fbbf347 100644 --- a/kasteroids/view.h +++ b/kasteroids/view.h @@ -43,7 +43,7 @@ public: void brake( bool b ); void pause( bool p); - void showText( const TQString &text, const TQColor &color, bool scroll=TRUE ); + void showText( const TQString &text, const TQColor &color, bool scroll=true ); void hideText(); int shots() const { return shotsFired; } diff --git a/kbackgammon/engines/offline/kbgoffline.cpp b/kbackgammon/engines/offline/kbgoffline.cpp index c2095bee..3b6f81cd 100644 --- a/kbackgammon/engines/offline/kbgoffline.cpp +++ b/kbackgammon/engines/offline/kbgoffline.cpp @@ -698,11 +698,11 @@ bool KBgEngineOffline::queryClose() i18n("In the middle of a game. " "Really quit?"), TQString(), KStdGuiItem::quit())) { case KMessageBox::Continue : - return TRUE; + return true; case KMessageBox::Cancel : - return FALSE; + return false; default: // cancel - return FALSE; + return false; } return true; } diff --git a/kblackbox/kbbgame.cpp b/kblackbox/kbbgame.cpp index a78ea013..3b89542d 100644 --- a/kblackbox/kbbgame.cpp +++ b/kblackbox/kbbgame.cpp @@ -104,7 +104,7 @@ KBBGame::KBBGame() /* Game initializations */ - running = FALSE; + running = false; gameBoard = NULL; TDEConfig *kConf; @@ -141,7 +141,7 @@ KBBGame::KBBGame() } if (kConf->hasKey( "tutorial" )) { tutorial = (bool) kConf->readNumEntry( "tutorial" ); - } else tutorial = FALSE; + } else tutorial = false; tutorialAction->setChecked(tutorial); setCentralWidget( gr ); @@ -298,11 +298,11 @@ void KBBGame::newGame() randomBalls( balls ); remap( gameBoard, gr->getGraphicBoard() ); - gr->repaint( TRUE ); + gr->repaint( true ); setScore( 0 ); detourCounter = -1; ballsPlaced = 0; - running = TRUE; + running = true; updateStats(); emit gameRuns( running ); } @@ -370,7 +370,7 @@ void KBBGame::getResults() void KBBGame::abortGame() { if (running) { - running = FALSE; + running = false; ballsPlaced = 0; updateStats(); gr->clearFocus(); @@ -437,7 +437,7 @@ void KBBGame::setScore( int n ) bool KBBGame::setSize( int w, int h ) { - bool ok = FALSE; + bool ok = false; if (((w+4) != gr->numC()) || ((h+4) != gr->numR())) { if (running) { ok = KMessageBox::warningContinueCancel(0, @@ -445,7 +445,7 @@ bool KBBGame::setSize( int w, int h ) "This will be the end of the current game!"),TQString(),i18n("End Game")) == KMessageBox::Continue; - } else ok = TRUE; + } else ok = true; if (ok) { gr->setSize( w+4, h+4 ); // +4 is the space for "lasers" and an edge... setMinSize(); @@ -454,7 +454,7 @@ bool KBBGame::setSize( int w, int h ) gameBoard = new RectOnArray( gr->numC(), gr->numR() ); if (running) abortGame(); newGame(); - // gr->repaint( TRUE ); + // gr->repaint( true ); } } return ok; @@ -466,13 +466,13 @@ bool KBBGame::setSize( int w, int h ) bool KBBGame::setBalls( int n ) { - bool ok = FALSE; + bool ok = false; if (balls != n) { if (running) { ok = KMessageBox::warningContinueCancel(0, i18n("This will be the end of the current game!"),TQString(),i18n("End Game")) == KMessageBox::Continue; - } else ok = TRUE; + } else ok = true; if (ok) { balls = n; if (running) abortGame(); @@ -551,7 +551,7 @@ int KBBGame::traceRay( int startX, int startY, int *endX, int *endY ) sly = 1; scy = 0; sry = -1; break; } - directionChanged = FALSE; + directionChanged = false; if (gameBoard->get( x+scx, y+scy ) == LASERBBT) { type = DETOUR; *endX = x+scx; @@ -566,13 +566,13 @@ int KBBGame::traceRay( int startX, int startY, int *endX, int *endY ) if (gameBoard->get( x+slx, y+sly ) == BALLBBT) { type = REFLECTION; if (gameBoard->get( x, y ) == LASERBBT) break; - directionChanged = TRUE; + directionChanged = true; refl += 1; } if (gameBoard->get( x+srx, y+sry ) == BALLBBT) { type = REFLECTION; if (gameBoard->get( x, y ) == LASERBBT) break; - directionChanged = TRUE; + directionChanged = true; refl +=2; } // turn to the right diff --git a/kblackbox/kbbgfx.cpp b/kblackbox/kbbgfx.cpp index 3aff0369..b83aa292 100644 --- a/kblackbox/kbbgfx.cpp +++ b/kblackbox/kbbgfx.cpp @@ -32,7 +32,7 @@ KBBGraphic::KBBGraphic( TQPixmap **p, TQWidget* parent, const char* name ) setBackgroundColor( gray ); setCellWidth( CELLW ); // set width of cell in pixels setCellHeight( CELLH ); // set height of cell in pixels - setMouseTracking( FALSE ); + setMouseTracking( false ); pix = p; if (pix == NULL) pixScaled = NULL; @@ -434,7 +434,7 @@ void KBBGraphic::moveSelection(int drow, int dcol) void KBBGraphic::focusInEvent( TQFocusEvent* ) { - repaint( FALSE ); + repaint( false ); } @@ -444,7 +444,7 @@ void KBBGraphic::focusInEvent( TQFocusEvent* ) void KBBGraphic::focusOutEvent( TQFocusEvent* ) { - repaint( FALSE ); + repaint( false ); } /* diff --git a/kbounce/kbounce.cpp b/kbounce/kbounce.cpp index fa70e917..8aa25ff6 100644 --- a/kbounce/kbounce.cpp +++ b/kbounce/kbounce.cpp @@ -218,7 +218,7 @@ void KJezzball::pauseGame() void KJezzball::gameOver() { stopLevel(); - m_gameOverTimer->start( 100, TRUE ); + m_gameOverTimer->start( 100, true ); } @@ -436,7 +436,7 @@ void KJezzball::stopLevel() void KJezzball::nextLevel() { stopLevel(); - m_nextLevelTimer->start( 100, TRUE ); + m_nextLevelTimer->start( 100, true ); } void KJezzball::switchLevel() diff --git a/kenolaba/AbTop.cpp b/kenolaba/AbTop.cpp index ba4837e0..83dcea36 100644 --- a/kenolaba/AbTop.cpp +++ b/kenolaba/AbTop.cpp @@ -424,7 +424,7 @@ void AbTop::setupStatusBar() connect( spyPopup, TQ_SIGNAL(activated(int)), this, TQ_SLOT(setSpy(int)) ); tb->insertButton(spy0, 30, spyPopup, - TRUE, i18n("Spy")); + true, i18n("Spy")); } #endif @@ -608,7 +608,7 @@ void AbTop::timerDone() return; } timerState++; - timer->start(interval,TRUE); + timer->start(interval,true); } void AbTop::userMove() diff --git a/kenolaba/BoardWidget.cpp b/kenolaba/BoardWidget.cpp index fbf31eb1..40a61659 100644 --- a/kenolaba/BoardWidget.cpp +++ b/kenolaba/BoardWidget.cpp @@ -52,9 +52,9 @@ BoardWidget::BoardWidget(Board& b, TQWidget *parent, const char *name) #define createCursor(bitmap,name) \ static TQBitmap bitmap(bitmap##_width, bitmap##_height, \ - (unsigned char *) bitmap##_bits, TRUE); \ + (unsigned char *) bitmap##_bits, true); \ static TQBitmap bitmap##Mask(bitmap##Mask_width, bitmap##Mask_height, \ - (unsigned char *) bitmap##Mask_bits, TRUE); \ + (unsigned char *) bitmap##Mask_bits, true); \ name = new TQCursor(bitmap, bitmap##Mask, bitmap##_x_hot, bitmap##_y_hot); createCursor(Arrow1, arrow[1]); diff --git a/kenolaba/EvalDlgImpl.cpp b/kenolaba/EvalDlgImpl.cpp index b08d9133..08aa4959 100644 --- a/kenolaba/EvalDlgImpl.cpp +++ b/kenolaba/EvalDlgImpl.cpp @@ -38,7 +38,7 @@ EvalDlgImpl::EvalDlgImpl(TQWidget* parent, Board* board) for(int i=0;iinsertItem(list[i]); - evalList->setSelected(0, TRUE); + evalList->setSelected(0, true); updateWidgets(); connectEditLines(); @@ -261,7 +261,7 @@ void EvalDlgImpl::saveas() list << name; config->writeEntry("EvalSchemes", list); } - evalList->setSelected(it, TRUE); + evalList->setSelected(it, true); EvalScheme savedScheme(*_scheme); savedScheme.setName(name); diff --git a/kenolaba/Network.cpp b/kenolaba/Network.cpp index 4079feae..fe191948 100644 --- a/kenolaba/Network.cpp +++ b/kenolaba/Network.cpp @@ -30,7 +30,7 @@ Network::Network(int port) struct sockaddr_in name; int i,j; - listeners.setAutoDelete(TRUE); + listeners.setAutoDelete(true); fd = ::socket (PF_INET, SOCK_STREAM, 0); if (fd<0) return; diff --git a/kgoldrunner/src/kgoldrunner.cpp b/kgoldrunner/src/kgoldrunner.cpp index 8d417c8d..28419dc8 100644 --- a/kgoldrunner/src/kgoldrunner.cpp +++ b/kgoldrunner/src/kgoldrunner.cpp @@ -42,12 +42,12 @@ KGoldrunner::KGoldrunner() /******************************************************************************/ // Avoid "saveOK()" check if an error-exit occurs during the file checks. - startupOK = TRUE; + startupOK = true; // Get directory paths for the system levels, user levels and manual. if (! getDirectories()) { fprintf (stderr, "getDirectories() FAILED\n"); - startupOK = FALSE; + startupOK = false; return; // If games directory not found, abort. } @@ -65,7 +65,7 @@ KGoldrunner::KGoldrunner() // Initialise the collections of levels (i.e. the list of games). if (! game->initCollections()) { - startupOK = FALSE; + startupOK = false; return; // If no game files, abort. } @@ -107,7 +107,7 @@ KGoldrunner::KGoldrunner() if (dw > 1024) { // More than 1024x768. view->changeSize (+1); view->changeSize (+1); // Scale 1.75:1. - setUsesBigPixmaps (TRUE); // Use big toolbar buttons. + setUsesBigPixmaps (true); // Use big toolbar buttons. } view->setBaseScale(); // Set scale for level-names. #endif @@ -115,16 +115,16 @@ KGoldrunner::KGoldrunner() makeEditToolbar(); // Uses pixmaps from "view". editToolbar->hide(); - setDockEnabled (DockBottom, FALSE); - setDockEnabled (DockLeft, FALSE); - setDockEnabled (DockRight, FALSE); + setDockEnabled (DockBottom, false); + setDockEnabled (DockLeft, false); + setDockEnabled (DockRight, false); // Make it impossible to turn off the editor toolbar. // Accidentally hiding it would make editing impossible. - setDockMenuEnabled (FALSE); + setDockMenuEnabled (false); // Set mouse control of the hero as the default. - game->setMouseMode (TRUE); + game->setMouseMode (true); // Paint the main widget (title, menu, status bar, blank playfield). show(); @@ -251,7 +251,7 @@ void KGoldrunner::setupActions() 0, game, TQ_SLOT(saveLevelFile()), actionCollection(), "save_edits"); - saveEdits->setEnabled (FALSE); // Nothing to save, yet. + saveEdits->setEnabled (false); // Nothing to save, yet. (void) new TDEAction ( i18n("&Move Level..."), @@ -318,7 +318,7 @@ void KGoldrunner::setupActions() setIceCave-> setExclusiveGroup ("landscapes"); setMidnight-> setExclusiveGroup ("landscapes"); setKDEKool-> setExclusiveGroup ("landscapes"); - setKGoldrunner-> setChecked (TRUE); + setKGoldrunner-> setChecked (true); /**************************************************************************/ /**************************** SETTINGS MENU ****************************/ @@ -343,7 +343,7 @@ void KGoldrunner::setupActions() setMouse-> setExclusiveGroup ("control"); setKeyboard-> setExclusiveGroup ("control"); - setMouse-> setChecked (TRUE); + setMouse-> setChecked (true); // Normal Speed // Beginner Speed @@ -381,7 +381,7 @@ void KGoldrunner::setupActions() nSpeed-> setExclusiveGroup ("speed"); bSpeed-> setExclusiveGroup ("speed"); cSpeed-> setExclusiveGroup ("speed"); - nSpeed-> setChecked (TRUE); + nSpeed-> setChecked (true); // Traditional Rules // KGoldrunner Rules @@ -400,7 +400,7 @@ void KGoldrunner::setupActions() tradRules-> setExclusiveGroup ("rules"); kgrRules-> setExclusiveGroup ("rules"); - tradRules-> setChecked (TRUE); + tradRules-> setChecked (true); // Larger Playing Area // Smaller Playing Area @@ -507,7 +507,7 @@ void KGoldrunner::initStatusBar() int i = statusBar()->fontInfo().pointSize(); statusBar()->setFont (TQFont (s, i, TQFont::Bold)); - statusBar()->setSizeGripEnabled (FALSE); // Use Settings menu ... + statusBar()->setSizeGripEnabled (false); // Use Settings menu ... statusBar()->insertItem ("", ID_LIVES); statusBar()->insertItem ("", ID_SCORE); @@ -518,12 +518,12 @@ void KGoldrunner::initStatusBar() showLives (5); // Start with 5 lives. showScore (0); showLevel (0); - adjustHintAction (FALSE); + adjustHintAction (false); // Set the PAUSE/RESUME key-names into the status bar message. pauseKeys = myPause->shortcut().toString(); pauseKeys = pauseKeys.replace (';', "\" " + i18n("or") + " \""); - gameFreeze (FALSE); + gameFreeze (false); statusBar()->setItemFixed (ID_LIVES, -1); // Fix current sizes. statusBar()->setItemFixed (ID_SCORE, -1); @@ -646,8 +646,8 @@ void KGoldrunner::lsKDEKool() {view->changeLandscape ("TDE Kool");} // Local slots to set mouse or keyboard control of the hero. -void KGoldrunner::setMouseMode() {game->setMouseMode (TRUE);} -void KGoldrunner::setKeyBoardMode() {game->setMouseMode (FALSE);} +void KGoldrunner::setMouseMode() {game->setMouseMode (true);} +void KGoldrunner::setKeyBoardMode() {game->setMouseMode (false);} // Local slots to set game speed. @@ -661,19 +661,19 @@ void KGoldrunner::decSpeed() {hero->setSpeed (-1);} void KGoldrunner::setTradRules() { - KGrFigure::variableTiming = TRUE; - KGrFigure::alwaysCollectNugget = TRUE; - KGrFigure::runThruHole = TRUE; - KGrFigure::reappearAtTop = TRUE; + KGrFigure::variableTiming = true; + KGrFigure::alwaysCollectNugget = true; + KGrFigure::runThruHole = true; + KGrFigure::reappearAtTop = true; KGrFigure::searchStrategy = LOW; } void KGoldrunner::setKGrRules() { - KGrFigure::variableTiming = FALSE; - KGrFigure::alwaysCollectNugget = FALSE; - KGrFigure::runThruHole = FALSE; - KGrFigure::reappearAtTop = FALSE; + KGrFigure::variableTiming = false; + KGrFigure::alwaysCollectNugget = false; + KGrFigure::runThruHole = false; + KGrFigure::reappearAtTop = false; KGrFigure::searchStrategy = MEDIUM; } @@ -819,7 +819,7 @@ void KGoldrunner::changeCaption(const TQString& text) bool KGoldrunner::getDirectories() { - bool result = TRUE; + bool result = true; // WHERE THINGS ARE: In the KDE 3 environment (Release 3.1.1), application // documentation and data files are in a directory structure given by @@ -850,7 +850,7 @@ bool KGoldrunner::getDirectories() i18n("Cannot find documentation sub-folder 'en/%1/' " "in area '%2' of the TDE folder ($TDEDIRS).") .arg(myDir).arg(dirs->kde_default ("html"))); - // result = FALSE; // Don't abort if the doc is missing. + // result = false; // Don't abort if the doc is missing. } else systemHTMLDir.append ("en/" + myDir + "/"); @@ -862,20 +862,20 @@ bool KGoldrunner::getDirectories() i18n("Cannot find system games sub-folder '%1/system/' " "in area '%2' of the TDE folder ($TDEDIRS).") .arg(myDir).arg(dirs->kde_default ("data"))); - result = FALSE; // ABORT if the games data is missing. + result = false; // ABORT if the games data is missing. } else systemDataDir.append (myDir + "/system/"); // Locate and optionally create directories for user collections and levels. - bool create = TRUE; + bool create = true; userDataDir = dirs->saveLocation ("data", myDir + "/user/", create); if (userDataDir.length() <= 0) { KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find or create user games sub-folder '%1/user/' " "in area '%2' of the TDE user area ($TDEHOME).") .arg(myDir).arg(dirs->kde_default ("data"))); - // result = FALSE; // Don't abort if user area is missing. + // result = false; // Don't abort if user area is missing. } else { create = dirs->makeDir (userDataDir + "levels/"); @@ -883,7 +883,7 @@ bool KGoldrunner::getDirectories() KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find or create 'levels/' folder in " "sub-folder '%1/user/' in the TDE user area ($TDEHOME).").arg(myDir)); - // result = FALSE; // Don't abort if user area is missing. + // result = false; // Don't abort if user area is missing. } } @@ -896,9 +896,9 @@ bool KGoldrunner::getDirectories() bool KGoldrunner::queryClose () { // Last chance to save: user has clicked "X" widget or menu-Quit. - bool cannotContinue = TRUE; + bool cannotContinue = true; game->saveOK (cannotContinue); - return (TRUE); + return (true); } void KGoldrunner::setKey (KBAction movement) @@ -908,7 +908,7 @@ void KGoldrunner::setKey (KBAction movement) // Using keyboard control can automatically disable mouse control. if (game->inMouseMode()) { // Halt the game while a message is displayed. - game->setMessageFreeze (TRUE); + game->setMessageFreeze (true); switch (KGrMessage::warning (this, i18n("Switch to Keyboard Mode"), i18n("You have pressed a key that can be used to move the " @@ -917,15 +917,15 @@ void KGoldrunner::setKey (KBAction movement) "- like riding a bike rather than walking!"), i18n("Switch to &Keyboard Mode"), i18n("Stay in &Mouse Mode"))) { - case 0: game->setMouseMode (FALSE); // Set internal mouse mode OFF. - setMouse->setChecked (FALSE); // Adjust the Settings menu. - setKeyboard->setChecked (TRUE); + case 0: game->setMouseMode (false); // Set internal mouse mode OFF. + setMouse->setChecked (false); // Adjust the Settings menu. + setKeyboard->setChecked (true); break; case 1: break; } // Unfreeze the game, but only if it was previously unfrozen. - game->setMessageFreeze (FALSE); + game->setMessageFreeze (false); if (game->inMouseMode()) return; // Stay in Mouse Mode. @@ -987,77 +987,77 @@ void KGoldrunner::makeEditToolbar() edenemybg = edenemybg.xForm (w); } - editToolbar = new TDEToolBar (this, TQt::DockTop, TRUE, "Editor", TRUE); + editToolbar = new TDEToolBar (this, TQt::DockTop, true, "Editor", true); // Choose a colour that enhances visibility of the KGoldrunner pixmaps. // editToolbar->setPalette (TQPalette (TQColor (150, 150, 230))); - // editToolbar->setHorizontallyStretchable (TRUE); // Not effective in KDE. + // editToolbar->setHorizontallyStretchable (true); // Not effective in KDE. // All those separators are just to get reasonable visual spacing of the - // pixmaps in KDE. "setHorizontallyStretchable(TRUE)" does it in TQt. + // pixmaps in KDE. "setHorizontallyStretchable(true)" does it in TQt. editToolbar->insertSeparator(); editToolbar->insertButton ("document-new", 0, TQ_SIGNAL(clicked()), game, - TQ_SLOT(createLevel()), TRUE, i18n("&Create a Level")); + TQ_SLOT(createLevel()), true, i18n("&Create a Level")); editToolbar->insertButton ("document-open", 1, TQ_SIGNAL(clicked()), game, - TQ_SLOT(updateLevel()), TRUE, i18n("&Edit Any Level...")); + TQ_SLOT(updateLevel()), true, i18n("&Edit Any Level...")); editToolbar->insertButton ("document-save", 2, TQ_SIGNAL(clicked()), game, - TQ_SLOT(saveLevelFile()),TRUE, i18n("&Save Edits...")); + TQ_SLOT(saveLevelFile()),true, i18n("&Save Edits...")); editToolbar->insertSeparator(); editToolbar->insertSeparator(); editToolbar->insertButton ("ktip", 3, TQ_SIGNAL(clicked()), game, - TQ_SLOT(editNameAndHint()),TRUE,i18n("Edit Name/Hint")); + TQ_SLOT(editNameAndHint()),true,i18n("Edit Name/Hint")); editToolbar->insertSeparator(); editToolbar->insertSeparator(); editToolbar->insertButton (freebg, (int)FREE, TQ_SIGNAL(clicked()), this, - TQ_SLOT(freeSlot()), TRUE, i18n("Empty space")); + TQ_SLOT(freeSlot()), true, i18n("Empty space")); editToolbar->insertSeparator(); editToolbar->insertButton (edherobg, (int)HERO, TQ_SIGNAL(clicked()), this, - TQ_SLOT (edheroSlot()), TRUE, i18n("Hero")); + TQ_SLOT (edheroSlot()), true, i18n("Hero")); editToolbar->insertSeparator(); editToolbar->insertButton (edenemybg, (int)ENEMY, TQ_SIGNAL(clicked()), this, - TQ_SLOT (edenemySlot()), TRUE, i18n("Enemy")); + TQ_SLOT (edenemySlot()), true, i18n("Enemy")); editToolbar->insertSeparator(); editToolbar->insertButton (brickbg, (int)BRICK, TQ_SIGNAL(clicked()), this, - TQ_SLOT (brickSlot()), TRUE, i18n("Brick (can dig)")); + TQ_SLOT (brickSlot()), true, i18n("Brick (can dig)")); editToolbar->insertSeparator(); editToolbar->insertButton (betonbg, (int)BETON, TQ_SIGNAL(clicked()), this, - TQ_SLOT (betonSlot()), TRUE, i18n("Concrete (cannot dig)")); + TQ_SLOT (betonSlot()), true, i18n("Concrete (cannot dig)")); editToolbar->insertSeparator(); editToolbar->insertButton (fbrickbg, (int)FBRICK, TQ_SIGNAL(clicked()), this, - TQ_SLOT (fbrickSlot()), TRUE, i18n("Trap (can fall through)")); + TQ_SLOT (fbrickSlot()), true, i18n("Trap (can fall through)")); editToolbar->insertSeparator(); editToolbar->insertButton (ladderbg, (int)LADDER, TQ_SIGNAL(clicked()), this, - TQ_SLOT (ladderSlot()), TRUE, i18n("Ladder")); + TQ_SLOT (ladderSlot()), true, i18n("Ladder")); editToolbar->insertSeparator(); editToolbar->insertButton (hladderbg, (int)HLADDER, TQ_SIGNAL(clicked()), this, - TQ_SLOT (hladderSlot()), TRUE, i18n("Hidden ladder")); + TQ_SLOT (hladderSlot()), true, i18n("Hidden ladder")); editToolbar->insertSeparator(); editToolbar->insertButton (polebg, (int)POLE, TQ_SIGNAL(clicked()), this, - TQ_SLOT (poleSlot()), TRUE, i18n("Pole (or bar)")); + TQ_SLOT (poleSlot()), true, i18n("Pole (or bar)")); editToolbar->insertSeparator(); editToolbar->insertButton (nuggetbg, (int)NUGGET, TQ_SIGNAL(clicked()), this, - TQ_SLOT (nuggetSlot()), TRUE, i18n("Gold nugget")); - - editToolbar->setToggle ((int) FREE, TRUE); - editToolbar->setToggle ((int) HERO, TRUE); - editToolbar->setToggle ((int) ENEMY, TRUE); - editToolbar->setToggle ((int) BRICK, TRUE); - editToolbar->setToggle ((int) BETON, TRUE); - editToolbar->setToggle ((int) FBRICK, TRUE); - editToolbar->setToggle ((int) LADDER, TRUE); - editToolbar->setToggle ((int) HLADDER, TRUE); - editToolbar->setToggle ((int) POLE, TRUE); - editToolbar->setToggle ((int) NUGGET, TRUE); + TQ_SLOT (nuggetSlot()), true, i18n("Gold nugget")); + + editToolbar->setToggle ((int) FREE, true); + editToolbar->setToggle ((int) HERO, true); + editToolbar->setToggle ((int) ENEMY, true); + editToolbar->setToggle ((int) BRICK, true); + editToolbar->setToggle ((int) BETON, true); + editToolbar->setToggle ((int) FBRICK, true); + editToolbar->setToggle ((int) LADDER, true); + editToolbar->setToggle ((int) HLADDER, true); + editToolbar->setToggle ((int) POLE, true); + editToolbar->setToggle ((int) NUGGET, true); pressedButton = (int) BRICK; - editToolbar->setButton (pressedButton, TRUE); + editToolbar->setButton (pressedButton, true); } /******************************************************************************/ @@ -1089,9 +1089,9 @@ void KGoldrunner::defaultEditObj() void KGoldrunner::setButton (int btn) { - editToolbar->setButton (pressedButton, FALSE); + editToolbar->setButton (pressedButton, false); pressedButton = btn; - editToolbar->setButton (pressedButton, TRUE); + editToolbar->setButton (pressedButton, true); } #include "kgoldrunner.moc" diff --git a/kgoldrunner/src/kgrcanvas.cpp b/kgoldrunner/src/kgrcanvas.cpp index bd642214..dcb46040 100644 --- a/kgoldrunner/src/kgrcanvas.cpp +++ b/kgoldrunner/src/kgrcanvas.cpp @@ -107,14 +107,14 @@ bool KGrCanvas::changeSize (int d) // Note: Smaller scales lose detail (e.g. the joints in brickwork). KGrMessage::information (this, i18n("Change Size"), i18n("Sorry, you cannot make the play area any smaller.")); - return FALSE; + return false; } if ((d >= 0) && (scaleStep >= 2 * STEP)) { // Note: Larger scales go off the edge of the monitor. KGrMessage::information (this, i18n("Change Size"), i18n("Sorry, you cannot make the play area any larger.")); - return FALSE; + return false; } TQWMatrix wm = worldMatrix(); @@ -140,13 +140,13 @@ bool KGrCanvas::changeSize (int d) int frame = frameWidth()*2; setFixedSize ((FIELDWIDTH + 4) * 4 * scaleStep + frame, (FIELDHEIGHT + 4) * 4 * scaleStep + frame); - return TRUE; + return true; #else KGrMessage::information (this, i18n( "Change Size" ), i18n( "Sorry, you cannot change the size of the playing area. " "That function requires TQt Library version 3 or later." )); - return FALSE; + return false; #endif } @@ -200,7 +200,7 @@ void KGrCanvas::makeTitle () // object does not always display scaled-up fonts cleanly (in TQt 3.1.1). if (title != 0) - title->close (TRUE); // Close and delete previous title. + title->close (true); // Close and delete previous title. title = new TQLabel ("", this); title->setFixedWidth (((FIELDWIDTH * cw + 2 * bw) * scaleStep) / STEP); @@ -257,7 +257,7 @@ void KGrCanvas::makeHeroSprite (int i, int j, int startFrame) i++; j++; heroSprite->move (i * 4 * STEP, j * 4 * STEP, startFrame); heroSprite->setZ (1); - heroSprite->setVisible (TRUE); + heroSprite->setVisible (true); } void KGrCanvas::setHeroVisible (bool newState) @@ -471,7 +471,7 @@ void KGrCanvas::initView() #else enemySprites = new TQPtrList (); #endif - enemySprites->setAutoDelete(TRUE); + enemySprites->setAutoDelete(true); } void KGrCanvas::makeTiles () diff --git a/kgoldrunner/src/kgrdialog.cpp b/kgoldrunner/src/kgrdialog.cpp index 4e7a8dba..0cb8a947 100644 --- a/kgoldrunner/src/kgrdialog.cpp +++ b/kgoldrunner/src/kgrdialog.cpp @@ -30,7 +30,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, TQPtrList & gamesList, KGrGame * theGame, TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + : TQDialog (parent, name, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, @@ -71,7 +71,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, gameInfo->setSpacing (spacing); collnN = new TQLabel ("", gameInfo); // Name of selected collection. TQFont f = collnN->font(); - f.setBold (TRUE); + f.setBold (true); collnN->setFont (f); collnA = new TQPushButton (i18n("More Info"), gameInfo); @@ -143,7 +143,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, #endif // Set the default for the level-number in the scrollbar. - number-> setTracking (TRUE); + number-> setTracking (true); number->setValue (requestedLevel); slSetCollections (defaultGame); @@ -154,8 +154,8 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, case SL_START: // Must start at level 1, but can choose a collection. OKText = i18n("Start Game"); number->setValue (1); - number->setEnabled(FALSE); - display->setEnabled(FALSE); + number->setEnabled(false); + display->setEnabled(false); number->hide(); numberL->hide(); display->hide(); @@ -181,8 +181,8 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, case SL_UPD_GAME: // Can only edit USER collection details. OKText = i18n("Edit Game Info"); number->setValue (1); - number->setEnabled(FALSE); - display->setEnabled(FALSE); + number->setEnabled(false); + display->setEnabled(false); number->hide(); numberL->hide(); display->hide(); @@ -227,7 +227,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, connect (levelNH, TQ_SIGNAL (clicked()), game, TQ_SLOT (editNameAndHint())); } else { - levelNH->setEnabled (FALSE); + levelNH->setEnabled (false); levelNH->hide(); } @@ -275,7 +275,7 @@ void KGrSLDialog::slSetCollections (int cIndex) } // Mark the currently selected collection (or default 0). colln->setCurrentItem (cIndex); - colln->setSelected (cIndex, TRUE); + colln->setSelected (cIndex, true); // Fetch and display information on the selected collection. slColln (cIndex); @@ -293,7 +293,7 @@ void KGrSLDialog::slColln (int i) } // User "highlighted" a new collection (with one click) ... - colln->setSelected (i, TRUE); // One click = selected. + colln->setSelected (i, true); // One click = selected. slCollnIndex = i; int n = slCollnIndex; // Collection selected. int N = defaultGame; // Current collection. @@ -383,7 +383,7 @@ void KGrSLDialog::slUpdate (const TQString & text) { // Move the slider when a valid level number is entered. TQString s = text; - bool ok = FALSE; + bool ok = false; int n = s.toInt (&ok); if (ok) { number->setValue (n); @@ -487,7 +487,7 @@ void KGrSLDialog::slotHelp () #ifdef KGR_PORTABLE KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + : TQDialog (parent, name, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, @@ -574,7 +574,7 @@ KGrNHDialog::~KGrNHDialog() KGrECDialog::KGrECDialog (int action, int collnIndex, TQPtrList & gamesList, TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + : TQDialog (parent, name, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrECDialog::KGrECDialog (int action, int collnIndex, @@ -661,7 +661,7 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, ecPrefix-> setText (collections.at(defaultGame)->prefix); if (collections.at(defaultGame)->nLevels > 0) { // Collection already has some levels, so cannot change the prefix. - ecPrefix-> setEnabled (FALSE); + ecPrefix-> setEnabled (false); } TQString s; #ifndef KGR_PORTABLE @@ -732,12 +732,12 @@ KGrECDialog::~KGrECDialog() void KGrECDialog::ecSetRules (const char settings) { - ecKGrB-> setChecked (FALSE); - ecTradB-> setChecked (FALSE); + ecKGrB-> setChecked (false); + ecTradB-> setChecked (false); if (settings == 'K') - ecKGrB-> setChecked (TRUE); + ecKGrB-> setChecked (true); else - ecTradB-> setChecked (TRUE); + ecTradB-> setChecked (true); } void KGrECDialog::ecSetKGr () {ecSetRules ('K');} // Radio button slots. @@ -751,7 +751,7 @@ void KGrECDialog::ecSetTrad () {ecSetRules ('T');} KGrLGDialog::KGrLGDialog (TQFile * savedGames, TQPtrList & collections, TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + : TQDialog (parent, name, true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrLGDialog::KGrLGDialog (TQFile * savedGames, @@ -784,9 +784,9 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, #else TQFont f = TDEGlobalSettings::fixedFont(); // KDE version. #endif - f.setFixedPitch (TRUE); + f.setFixedPitch (true); lgList-> setFont (f); - f.setBold (TRUE); + f.setBold (true); lgHeader-> setFont (f); mainLayout-> addWidget (lgHeader); @@ -825,11 +825,11 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, // Read the saved games into the list box. while (! gameText.endData()) { s = gameText.readLine(); // Read in one saved game. - pr = s.left (s.find (" ", 0, FALSE)); // Get the collection prefix. + pr = s.left (s.find (" ", 0, false)); // Get the collection prefix. for (i = 0; i < imax; i++) { // Get the collection name. if (collections.at(i)->prefix == pr) { s = s.insert (0, - collections.at(i)->name.leftJustify (20, ' ', TRUE) + " "); + collections.at(i)->name.leftJustify (20, ' ', true) + " "); break; } } @@ -839,7 +839,7 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, // Mark row 0 (the most recently saved game) as the default selection. lgList-> setCurrentItem (0); - lgList-> setSelected (0, TRUE); + lgList-> setSelected (0, true); lgHighlight = 0; connect (lgList, TQ_SIGNAL (highlighted (int)), this, TQ_SLOT (lgSelect (int))); @@ -911,7 +911,7 @@ void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) #ifndef KGR_PORTABLE KMessageBox::information (parent, contents, title); #else - TQDialog * mm = new TQDialog (parent, "wrappedMessage", TRUE, + TQDialog * mm = new TQDialog (parent, "wrappedMessage", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; @@ -951,7 +951,7 @@ void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) mle-> setFrameStyle (TQFrame::NoFrame); mle-> setAlignment (AlignLeft); - mle-> setReadOnly (TRUE); + mle-> setReadOnly (true); mle-> setText (contents); #ifndef QT3 diff --git a/kgoldrunner/src/kgrfigure.cpp b/kgoldrunner/src/kgrfigure.cpp index 0707da67..bfe7a6e1 100644 --- a/kgoldrunner/src/kgrfigure.cpp +++ b/kgoldrunner/src/kgrfigure.cpp @@ -36,10 +36,10 @@ KGrFigure :: KGrFigure (int px, int py) } // Initialise the global settings flags. -bool KGrFigure::variableTiming = TRUE; -bool KGrFigure::alwaysCollectNugget = TRUE; -bool KGrFigure::runThruHole = TRUE; -bool KGrFigure::reappearAtTop = TRUE; +bool KGrFigure::variableTiming = true; +bool KGrFigure::alwaysCollectNugget = true; +bool KGrFigure::runThruHole = true; +bool KGrFigure::reappearAtTop = true; SearchStrategy KGrFigure::searchStrategy = LOW; int KGrFigure::herox = 0; @@ -155,7 +155,7 @@ void KGrFigure::walkUp(int WALKDELAY) rely -= STEP; absy -= STEP; } - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); } else { // End of 4-step cycle: move up to next cell, if possible. @@ -185,7 +185,7 @@ void KGrFigure::walkDown(int WALKDELAY, int FALLDELAY) rely += STEP; absy += STEP; } - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); } else { // End of 4-step cycle: move down to next cell, if possible. @@ -217,7 +217,7 @@ void KGrFigure::walkLeft (int WALKDELAY, int FALLDELAY) relx -= STEP; absx -=STEP; } - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); } else { // End of 4-pixmap cycle: start again, in next cell if possible. @@ -249,7 +249,7 @@ void KGrFigure::walkRight(int WALKDELAY, int FALLDELAY) relx += STEP; absx += STEP; // nur vorwärts gehen, wenn es auch möglich ist } - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); } else { actualPixmap -= 4; // Schritt war vollendet @@ -277,7 +277,7 @@ void KGrFigure::initFall(int apm, int FALLDELAY) actualPixmap = apm; walkCounter=1; walkTimer->stop(); - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); } void KGrFigure::showFigure () @@ -303,12 +303,12 @@ KGrHero :: KGrHero (KGrCanvas * view, int x, int y) herox = x; heroy = y; - started = FALSE; - mouseMode = TRUE; + started = false; + mouseMode = true; walkCounter = 1; - walkFrozen = FALSE; - fallFrozen = FALSE; + walkFrozen = false; + fallFrozen = false; connect (walkTimer, TQ_SIGNAL (timeout ()), TQ_SLOT (walkTimeDone ())); connect (fallTimer, TQ_SIGNAL (timeout ()), TQ_SLOT (fallTimeDone ())); @@ -380,22 +380,22 @@ void KGrHero::setKey(Direction key) { // Keyboard control of hero: direction is fixed until next key is pressed. // Sets a simulated mouse-pointer above, below, left, right or on the hero. - mouseMode = FALSE; - stopped = FALSE; + mouseMode = false; + stopped = false; switch (key) { case UP: mousex = x; mousey = 0; break; case DOWN: mousex = x; mousey = FIELDHEIGHT + 1; break; case LEFT: mousex = 0; mousey = y; break; case RIGHT: mousex = FIELDWIDTH + 1; mousey = y; break; - case STAND: stopped = TRUE; mousex = x; mousey = y; break; + case STAND: stopped = true; mousex = x; mousey = y; break; } } void KGrHero::setDirection(int i, int j) { // Mouse control of hero: direction is updated continually on a timer. - mouseMode = TRUE; - stopped = FALSE; + mouseMode = true; + stopped = false; mousex = i; mousey = j; } @@ -446,11 +446,11 @@ void KGrHero::setNextDir() void KGrHero::doStep() { if (walkFrozen) { - walkFrozen = FALSE; + walkFrozen = false; walkTimeDone(); } if (fallFrozen) { - fallFrozen = FALSE; + fallFrozen = false; fallTimeDone(); } } @@ -479,7 +479,7 @@ void KGrHero::init(int a,int b) walkTimer->stop(); fallTimer->stop(); walkCounter = 1; - started = FALSE; + started = false; x = mem_x = a; y = mem_y = b; @@ -503,9 +503,9 @@ void KGrHero::init(int a,int b) void KGrHero::start() { - started = TRUE; - walkFrozen = FALSE; - fallFrozen = FALSE; + started = true; + walkFrozen = false; + fallFrozen = false; if (!(canStand()||hangAtPole())) { // Held muss wohl fallen... status = FALLING; @@ -539,7 +539,7 @@ void KGrHero::setSpeed (int gamespeed) void KGrHero::walkTimeDone () { if (! started) return; // Ignore signals from earlier play. - if (KGrObject::frozen) {walkFrozen = TRUE; return; } + if (KGrObject::frozen) {walkFrozen = true; return; } if ((*playfield)[x][y]->whatIam() == BRICK) { emit caughtHero(); // Brick closed over hero. @@ -587,7 +587,7 @@ void KGrHero::walkTimeDone () if (!canStand()&&!hangAtPole()) initFall(FALL1, FALLDELAY); else - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); // This additional showFigure() is to update the hero position after it is // altered by the hero-enemy deadlock fix in standOnEnemy(). Messy, but ... @@ -602,11 +602,11 @@ void KGrHero::walkTimeDone () void KGrHero::fallTimeDone() { if (! started) return; // Ignore signals from earlier play. - if (KGrObject::frozen) {fallFrozen = TRUE; return; } + if (KGrObject::frozen) {fallFrozen = true; return; } if (!standOnEnemy()) { if (walkCounter++ < 4) { // Held fällt vier Positionen - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); rely+=STEP; absy+=STEP; } @@ -617,12 +617,12 @@ void KGrHero::fallTimeDone() absy = y*16; // wird Null und Figur eins runter collectNugget(); // gesetzt. Zeit evtl. Nugget zu nehmen if (! (canStand()||hangAtPole())) { // Held muss wohl weiterfallen. - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); walkCounter = 1; } else { // Held hat Boden (oder Feind) unter den status = STANDING; // Füssen oder hängt an Stange -> steh! - walkTimer->start((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start((WALKDELAY * NSPEED) / speed, true); direction = (actualPixmap == 19) ? RIGHT : LEFT; if ((*playfield)[x][y]->whatIam() == POLE) actualPixmap = (direction == RIGHT)? RIGHTCLIMB1:LEFTCLIMB1; @@ -643,11 +643,11 @@ void KGrHero::fallTimeDone() // else // Reduce jerkiness when descending over a falling enemy. // actualPixmap = (direction == RIGHT)? RIGHTWALK1:LEFTWALK1; - walkTimer->start((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start((WALKDELAY * NSPEED) / speed, true); } else { // Else, freeze hero until enemy moves out of the way. - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); } } if (isInEnemy() && (! standOnEnemy())) @@ -812,9 +812,9 @@ KGrEnemy :: KGrEnemy (KGrCanvas * view, int x, int y) birthX=x; birthY=y; - walkFrozen = FALSE; - fallFrozen = FALSE; - captiveFrozen = FALSE; + walkFrozen = false; + fallFrozen = false; + captiveFrozen = false; captiveTimer = new TQTimer (this); connect (captiveTimer,TQ_SIGNAL(timeout()),TQ_SLOT(captiveTimeDone())); @@ -828,15 +828,15 @@ int KGrEnemy::CAPTIVEDELAY = 0; void KGrEnemy::doStep() { if (walkFrozen) { - walkFrozen = FALSE; + walkFrozen = false; walkTimeDone(); } if (fallFrozen) { - fallFrozen = FALSE; + fallFrozen = false; fallTimeDone(); } if (captiveFrozen) { - captiveFrozen = FALSE; + captiveFrozen = false; captiveTimeDone(); } } @@ -885,7 +885,7 @@ void KGrEnemy::init(int a,int b) void KGrEnemy::walkTimeDone () { - if (KGrObject::frozen) {walkFrozen = TRUE; return; } + if (KGrObject::frozen) {walkFrozen = true; return; } // Check we are alive BEFORE checking for friends being in the way. // Maybe a friend overhead is blocking our escape from a brick. @@ -932,7 +932,7 @@ void KGrEnemy::walkTimeDone () } status = WALKING; // initialisiere die Zählervariablen und walkCounter = 1; // den Timer um den Held weiter - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); // zu jagen + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); // zu jagen startWalk (); } } @@ -953,14 +953,14 @@ void KGrEnemy::walkTimeDone () rely = 0; absy = 16 * y; startWalk (); } - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); } showFigure(); } void KGrEnemy::fallTimeDone () { - if (KGrObject::frozen) {fallFrozen = TRUE; return; } + if (KGrObject::frozen) {fallFrozen = true; return; } if ((*playfield)[x][y+1]->whatIam() == HOLE) { // wenn Enemy ins Loch fällt ((KGrBrick*)(*playfield)[x][y+1])->useHole(); // reserviere das Loch, damit @@ -990,12 +990,12 @@ void KGrEnemy::fallTimeDone () } if (standOnEnemy()) { // Don't fall into a friend. - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); return; } if (walkCounter++ < 4){ - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); { rely+=STEP; absy+=STEP;} } else { @@ -1003,10 +1003,10 @@ void KGrEnemy::fallTimeDone () if ((*playfield)[x][y]->whatIam() == USEDHOLE) { captiveCounter = 0; status = CAPTIVE; - captiveTimer->start((CAPTIVEDELAY * NSPEED) / speed, TRUE); + captiveTimer->start((CAPTIVEDELAY * NSPEED) / speed, true); } else if (!(canStand()||hangAtPole())) { - fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start((FALLDELAY * NSPEED) / speed, true); walkCounter=1; } else { @@ -1019,7 +1019,7 @@ void KGrEnemy::fallTimeDone () status = WALKING; walkCounter = 1; direction = searchbestway(x,y,herox,heroy); - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); startWalk (); if (!nuggets) collectNugget(); @@ -1031,7 +1031,7 @@ void KGrEnemy::fallTimeDone () void KGrEnemy::captiveTimeDone() { - if (KGrObject::frozen) {captiveFrozen = TRUE; return; } + if (KGrObject::frozen) {captiveFrozen = true; return; } if ((*playfield)[x][y]->whatIam()==BRICK) dieAndReappear(); else @@ -1039,11 +1039,11 @@ void KGrEnemy::captiveTimeDone() status = WALKING; walkCounter = 1; direction = UP; - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); captiveCounter = 0; } else { captiveCounter ++; - captiveTimer->start((CAPTIVEDELAY * NSPEED) / speed, TRUE); + captiveTimer->start((CAPTIVEDELAY * NSPEED) / speed, true); showFigure(); } } @@ -1055,11 +1055,11 @@ void KGrEnemy::startSearching() if (canStand()||((*playfield)[x][y+1]->whatIam()==USEDHOLE)) { status = WALKING; - walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); + walkTimer->start ((WALKDELAY * NSPEED) / speed, true); } else { status = FALLING; - fallTimer->start ((FALLDELAY * NSPEED) / speed, TRUE); + fallTimer->start ((FALLDELAY * NSPEED) / speed, true); } walkCounter = 1; @@ -1137,7 +1137,7 @@ void KGrEnemy::dieAndReappear() if (reappearAtTop) { // Follow Traditional rules: enemies reappear at top. - looking = TRUE; + looking = true; y = 2; // Randomly look for a free spot in row 2. Limit the number of tries. for (i = 1; ((i <= 3) && looking); i++) { @@ -1145,7 +1145,7 @@ void KGrEnemy::dieAndReappear() switch ((*playfield)[x][2]->whatIam()) { case FREE: case HLADDER: - looking = FALSE; + looking = false; break; default: break; @@ -1160,7 +1160,7 @@ void KGrEnemy::dieAndReappear() switch ((*playfield)[x][y]->whatIam()) { case FREE: case HLADDER: - looking = FALSE; + looking = false; break; default: break; @@ -1540,7 +1540,7 @@ int KGrEnemy::distanceDown (int x, int y, int deltah) int rungs = -1; int exitRung = 0; - bool canGoThru = TRUE; + bool canGoThru = true; char objType; // If there is a way down at (x,y), return its length, else return zero. @@ -1557,7 +1557,7 @@ int KGrEnemy::distanceDown (int x, int y, int deltah) if ((objType == HOLE) && (rungs < 0)) rungs = 0; // Enemy can go SIDEWAYS through a hole. else - canGoThru = FALSE; // Cannot go through here. + canGoThru = false; // Cannot go through here. break; case LADDER: case POLE: // Can go through or stop. @@ -1575,7 +1575,7 @@ int KGrEnemy::distanceDown (int x, int y, int deltah) exitRung = rungs; } else - canGoThru = FALSE; // Should stop at hero's level. + canGoThru = false; // Should stop at hero's level. } break; default: @@ -1603,9 +1603,9 @@ bool KGrEnemy::searchOK (int direction, int x, int y) if (canWalkLR (direction, x, y) > 0) { // Can go into that cell, but check for a fall. if (willNotFall (x+direction, y)) - return TRUE; + return true; } - return FALSE; // Cannot go into and through that cell. + return false; // Cannot go into and through that cell. } int KGrEnemy::canWalkLR (int direction, int x, int y) @@ -1637,7 +1637,7 @@ bool KGrEnemy::willNotFall (int x, int y) switch ( (*playfield)[x][y]->whatIam()) { case LADDER: case POLE: - return TRUE; break; // OK, can hang on ladder or pole. + return true; break; // OK, can hang on ladder or pole. default: break; } @@ -1661,12 +1661,12 @@ bool KGrEnemy::willNotFall (int x, int y) for (c = 0; c < cmax; c++) { enemy = enemies->at(c); if ((enemy->getx()==16*x) && (enemy->gety()==16*(y+1))) - return TRUE; // Standing on a friend. + return true; // Standing on a friend. } - return FALSE; break; // Will fall: there is no floor. + return false; break; // Will fall: there is no floor. default: - return TRUE; break; // OK, will not fall. + return true; break; // OK, will not fall. } } @@ -1733,13 +1733,13 @@ bool KGrEnemy::bumpingFriend() if ((dx >= -32) && (dx < 16) && (dy > -16) && (dy < 16)) { if ((enemy->direction == RIGHT) && (enemy->status == WALKING) && (absx%16==0)) { - return TRUE; + return true; } else if (dx >= -16) { if ((dx > -16) && (enemyId < enemy->enemyId)) - return FALSE; + return false; else - return TRUE; // Wait for the one in front. + return true; // Wait for the one in front. } } break; @@ -1747,13 +1747,13 @@ bool KGrEnemy::bumpingFriend() if ((dx > -16) && (dx < 32) && (dy > -16) && (dy < 16)) { if ((enemy->direction == LEFT) && (enemy->status == WALKING) && (absx%16==0)) { - return TRUE; + return true; } else if (dx <= 16) { if ((dx < 16) && (enemyId < enemy->enemyId)) - return FALSE; + return false; else - return TRUE; // Wait for the one in front. + return true; // Wait for the one in front. } } break; @@ -1761,13 +1761,13 @@ bool KGrEnemy::bumpingFriend() if ((dy >= -32) && (dy < 16) && (dx > -16) && (dx < 16)) { if ((enemy->direction == DOWN) && (enemy->status == WALKING) && (absy%16==0)) { - return TRUE; + return true; } else if (dy >= -16) { if ((dy > -16) && (enemyId < enemy->enemyId)) - return FALSE; + return false; else - return TRUE; // Wait for the one above. + return true; // Wait for the one above. } } break; @@ -1775,13 +1775,13 @@ bool KGrEnemy::bumpingFriend() if ((dy > -16) && (dy < 32) && (dx > -16) && (dx < 16)) { if ((enemy->direction == UP) && (enemy->status == WALKING) && (absy%16==0)) { - return TRUE; + return true; } else if (dy <= 16) { if ((dy < 16) && (enemyId < enemy->enemyId)) - return FALSE; + return false; else - return TRUE; // Wait for the one below. + return true; // Wait for the one below. } } break; @@ -1790,7 +1790,7 @@ bool KGrEnemy::bumpingFriend() } } } - return FALSE; + return false; } KGrEnemy :: ~KGrEnemy () diff --git a/kgoldrunner/src/kgrgame.cpp b/kgoldrunner/src/kgrgame.cpp index 080f55e6..6cc0638c 100644 --- a/kgoldrunner/src/kgrgame.cpp +++ b/kgoldrunner/src/kgrgame.cpp @@ -44,24 +44,24 @@ KGrGame::KGrGame (KGrCanvas * theView, TQString theSystemDir, TQString theUserDi userDataDir = theUserDir; // Set the game-editor OFF, but available. - editMode = FALSE; - paintEditObj = FALSE; + editMode = false; + paintEditObj = false; editObj = BRICK; - shouldSave = FALSE; + shouldSave = false; - enemies.setAutoDelete(TRUE); + enemies.setAutoDelete(true); hero = new KGrHero (view, 0, 0); // The hero is born ... Yay !!! hero->setPlayfield (&playfield); - setBlankLevel (TRUE); // Fill the playfield with blank walls. + setBlankLevel (true); // Fill the playfield with blank walls. enemy = NULL; - newLevel = TRUE; // Next level will be a new one. - loading = TRUE; // Stop input until it is loaded. + newLevel = true; // Next level will be a new one. + loading = true; // Stop input until it is loaded. - modalFreeze = FALSE; - messageFreeze = FALSE; + modalFreeze = false; + messageFreeze = false; connect (hero, TQ_SIGNAL (gotNugget(int)), TQ_SLOT (incScore(int))); connect (hero, TQ_SIGNAL (caughtHero()), TQ_SLOT (herosDead())); @@ -74,7 +74,7 @@ KGrGame::KGrGame (KGrCanvas * theView, TQString theSystemDir, TQString theUserDi // Get the mouse position every 40 msec. It is used to steer the hero. mouseSampler = new TQTimer (this); connect (mouseSampler, TQ_SIGNAL(timeout()), TQ_SLOT (readMousePos ())); - mouseSampler->start (40, FALSE); + mouseSampler->start (40, false); srand(1); // initialisiere Random-Generator } @@ -104,7 +104,7 @@ void KGrGame::startNextLevel() void KGrGame::startLevel (int startingAt, int requestedLevel) { - if (! saveOK (FALSE)) { // Check unsaved work. + if (! saveOK (false)) { // Check unsaved work. return; } // Use dialog box to select game and level: startingAt = ID_FIRST or ID_ANY. @@ -135,8 +135,8 @@ void KGrGame::herosDead() if (--lives > 0) { // Still some life left, so PAUSE and then re-start the level. emit showLives (lives); - KGrObject::frozen = TRUE; // Freeze the animation and let - dyingTimer->start (1500, TRUE); // the player see what happened. + KGrObject::frozen = true; // Freeze the animation and let + dyingTimer->start (1500, true); // the player see what happened. } else { // Game over: display the "ENDE" screen. @@ -150,10 +150,10 @@ void KGrGame::herosDead() enemies.clear(); // Stop the enemies catching the hero again ... view->deleteEnemySprites(); unfreeze(); // ... NOW we can unfreeze. - newLevel = TRUE; + newLevel = true; level = 0; loadLevel (level); // Display the "ENDE" screen. - newLevel = FALSE; + newLevel = false; } } @@ -165,7 +165,7 @@ void KGrGame::finalBreath() enemyCount = 0; // Hero is dead: re-start the level. loadLevel (level); } - KGrObject::frozen = FALSE; // Unfreeze the game, but don't move yet. + KGrObject::frozen = false; // Unfreeze the game, but don't move yet. } void KGrGame::showHiddenLadders() @@ -204,9 +204,9 @@ void KGrGame::goUpOneLevel() enemyCount = 0; enemies.clear(); view->deleteEnemySprites(); - newLevel = TRUE; + newLevel = true; loadLevel (level); - newLevel = FALSE; + newLevel = false; } void KGrGame::loseNugget() @@ -226,17 +226,17 @@ int KGrGame::getLevel() // Return the current game-level. bool KGrGame::inMouseMode() { - return (mouseMode); // Return TRUE if game is under mouse control. + return (mouseMode); // Return true if game is under mouse control. } bool KGrGame::inEditMode() { - return (editMode); // Return TRUE if the game-editor is active. + return (editMode); // Return true if the game-editor is active. } bool KGrGame::isLoading() { - return (loading); // Return TRUE if a level is being loaded. + return (loading); // Return true if a level is being loaded. } void KGrGame::setMouseMode (bool on_off) @@ -247,33 +247,33 @@ void KGrGame::setMouseMode (bool on_off) void KGrGame::freeze() { if ((! modalFreeze) && (! messageFreeze)) { - emit gameFreeze (TRUE); // Do visual feedback in the GUI. + emit gameFreeze (true); // Do visual feedback in the GUI. } - KGrObject::frozen = TRUE; // Halt the game, by blocking all timer events. + KGrObject::frozen = true; // Halt the game, by blocking all timer events. } void KGrGame::unfreeze() { if ((! modalFreeze) && (! messageFreeze)) { - emit gameFreeze (FALSE);// Do visual feedback in the GUI. + emit gameFreeze (false);// Do visual feedback in the GUI. } - KGrObject::frozen = FALSE; // Restart the game. Because frozen == FALSE, + KGrObject::frozen = false; // Restart the game. Because frozen == false, restart(); // the game goes on running after the next step. } void KGrGame::setMessageFreeze (bool on_off) { if (on_off) { // Freeze the game action during a message. - messageFreeze = FALSE; + messageFreeze = false; if (! KGrObject::frozen) { - messageFreeze = TRUE; + messageFreeze = true; freeze(); } } else { // Unfreeze the game action after a message. if (messageFreeze) { unfreeze(); - messageFreeze = FALSE; + messageFreeze = false; } } } @@ -318,19 +318,19 @@ void KGrGame::setBlankLevel(bool playable) void KGrGame::newGame (const int lev, const int gameIndex) { // Ignore player input from keyboard or mouse while the screen is set up. - loading = TRUE; // "loadLevel (level)" will reset it. + loading = true; // "loadLevel (level)" will reset it. if (editMode) { - emit setEditMenu (FALSE); // Disable edit menu items and toolbar. + emit setEditMenu (false); // Disable edit menu items and toolbar. - editMode = FALSE; - paintEditObj = FALSE; + editMode = false; + paintEditObj = false; editObj = BRICK; - view->setHeroVisible (TRUE); + view->setHeroVisible (true); } - newLevel = TRUE; + newLevel = true; level = lev; collnIndex = gameIndex; collection = collections.at (collnIndex); @@ -348,26 +348,26 @@ void KGrGame::newGame (const int lev, const int gameIndex) enemies.clear(); view->deleteEnemySprites(); - newLevel = TRUE;; + newLevel = true;; loadLevel (level); - newLevel = FALSE; + newLevel = false; } void KGrGame::startTutorial() { - if (! saveOK (FALSE)) { // Check unsaved work. + if (! saveOK (false)) { // Check unsaved work. return; } int i, index; int imax = collections.count(); - bool found = FALSE; + bool found = false; index = 0; for (i = 0; i < imax; i++) { index = i; // Index within owner. if (collections.at(i)->prefix == "tute") { - found = TRUE; + found = true; break; } } @@ -410,7 +410,7 @@ int KGrGame::loadLevel (int levelNo) } // Ignore player input from keyboard or mouse while the screen is set up. - loading = TRUE; + loading = true; nuggets = 0; enemyCount=0; @@ -494,7 +494,7 @@ int KGrGame::loadLevel (int levelNo) connect (view, TQ_SIGNAL(mouseClick(int)), TQ_SLOT(doDig(int))); // Re-enable player input. - loading = FALSE; + loading = false; return 1; } @@ -515,17 +515,17 @@ bool KGrGame::openLevelFile (int levelNo, TQFile & openlevel) i18n("Cannot find file '%1'. Please make sure '%2' has been " "run in the '%3' folder.") .arg(filePath).arg("tar xf levels.tar").arg(systemDataDir.myStr())); - return (FALSE); + return (false); } // �ffne Level zum lesen if (! openlevel.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Load Level"), i18n("Cannot open file '%1' for read-only.").arg(filePath)); - return (FALSE); + return (false); } - return (TRUE); + return (true); } void KGrGame::changeObject (unsigned char kind, int i, int j) @@ -544,7 +544,7 @@ void KGrGame::changeObject (unsigned char kind, int i, int j) case HERO: createObject(new KGrFree (FREE,i,j,view),FREE,i,j); hero->init(i,j); startI = i; startJ = j; - hero->started = FALSE; + hero->started = false; hero->showFigure(); break; case ENEMY: createObject(new KGrFree (FREE,i,j,view),FREE,i,j); @@ -826,14 +826,14 @@ void KGrGame::saveGame() // Save game ID, score and level. file2.close(); TQDir dir; - dir.rename (file2.name(), file1.name(), TRUE); + dir.rename (file2.name(), file1.name(), true); KGrMessage::information (view, i18n("Save Game"), i18n("Your game has been saved.")); } void KGrGame::loadGame() // Re-load game, score and level. { - if (! saveOK (FALSE)) { // Check unsaved work. + if (! saveOK (false)) { // Check unsaved work. return; } @@ -853,9 +853,9 @@ void KGrGame::loadGame() // Re-load game, score and level. } // Halt the game during the loadGame() dialog. - modalFreeze = FALSE; + modalFreeze = false; if (!KGrObject::frozen) { - modalFreeze = TRUE; + modalFreeze = true; freeze(); } @@ -868,7 +868,7 @@ void KGrGame::loadGame() // Re-load game, score and level. s = lg->getCurrentText(); } - bool found = FALSE; + bool found = false; TQString pr; int lev; int i; @@ -876,14 +876,14 @@ void KGrGame::loadGame() // Re-load game, score and level. if (! s.isNull()) { pr = s.mid (21, 7); // Get the collection prefix. - pr = pr.left (pr.find (" ", 0, FALSE)); + pr = pr.left (pr.find (" ", 0, false)); for (i = 0; i < imax; i++) { // Find the collection. if (collections.at(i)->prefix == pr) { collection = collections.at(i); collnIndex = i; owner = collections.at(i)->owner; - found = TRUE; + found = true; break; } } @@ -906,7 +906,7 @@ void KGrGame::loadGame() // Re-load game, score and level. // Unfreeze the game, but only if it was previously unfrozen. if (modalFreeze) { unfreeze(); - modalFreeze = FALSE; + modalFreeze = false; } delete lg; @@ -918,7 +918,7 @@ void KGrGame::loadGame() // Re-load game, score and level. void KGrGame::checkHighScore() { - bool prevHigh = TRUE; + bool prevHigh = true; TQ_INT16 prevLevel = 0; TQ_INT32 prevScore = 0; TQString thisUser = i18n("Unknown"); @@ -938,7 +938,7 @@ void KGrGame::checkHighScore() if (! high1.exists()) { high1.setName (systemDataDir + "hi_" + collection->prefix + ".dat"); if (! high1.exists()) { - prevHigh = FALSE; + prevHigh = false; } } @@ -953,7 +953,7 @@ void KGrGame::checkHighScore() // Read previous users, levels and scores from the high score file. s1.setDevice (&high1); - bool found = FALSE; + bool found = false; highCount = 0; while (! s1.endData()) { char * prevUser; @@ -966,7 +966,7 @@ void KGrGame::checkHighScore() delete prevDate; highCount++; if (score > prevScore) { - found = TRUE; // We have a high score. + found = true; // We have a high score. break; } } @@ -992,7 +992,7 @@ void KGrGame::checkHighScore() } // Dialog to ask the user to enter their name. - TQDialog * hsn = new TQDialog (view, "hsNameDialog", TRUE, + TQDialog * hsn = new TQDialog (view, "hsNameDialog", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; @@ -1023,7 +1023,7 @@ void KGrGame::checkHighScore() connect (hsnUser, TQ_SIGNAL (returnPressed ()), hsn, TQ_SLOT (accept ())); connect (OK, TQ_SIGNAL (clicked ()), hsn, TQ_SLOT (accept ())); - while (TRUE) { + while (true) { hsn->exec(); thisUser = hsnUser->text(); if (thisUser.length() > 0) @@ -1050,7 +1050,7 @@ void KGrGame::checkHighScore() if (prevHigh) { high1.reset(); - bool scoreRecorded = FALSE; + bool scoreRecorded = false; highCount = 0; while ((! s1.endData()) && (highCount < 10)) { char * prevUser; @@ -1067,7 +1067,7 @@ void KGrGame::checkHighScore() s2 << (TQ_INT16) level; s2 << (TQ_INT32) score; s2 << hsDate.myStr(); - scoreRecorded = TRUE; + scoreRecorded = true; } if (highCount < 10) { highCount++; @@ -1102,7 +1102,7 @@ void KGrGame::checkHighScore() TQDir dir; dir.rename (high2.name(), - userDataDir + "hi_" + collection->prefix + ".dat", TRUE); + userDataDir + "hi_" + collection->prefix + ".dat", true); KGrMessage::information (view, i18n("Save High Score"), i18n("Your high score has been saved.")); @@ -1144,7 +1144,7 @@ void KGrGame::showHighScores() return; } - TQDialog * hs = new TQDialog (view, "hsDialog", TRUE, + TQDialog * hs = new TQDialog (view, "hsDialog", true, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; @@ -1164,8 +1164,8 @@ void KGrGame::showHighScores() #else TQFont f = TDEGlobalSettings::fixedFont(); // KDE version. #endif - f. setFixedPitch (TRUE); - f. setBold (TRUE); + f. setFixedPitch (true); + f. setBold (true); hsColHeader-> setFont (f); TQLabel * hsLine [10]; @@ -1182,7 +1182,7 @@ void KGrGame::showHighScores() OK-> setAccel (Key_Return); // Set up the format for the high-score lines. - f. setBold (FALSE); + f. setBold (false); TQString line; const char * hsFormat = "%2d. %-30.30s %3d %7ld %s"; @@ -1250,7 +1250,7 @@ void KGrGame::restart() temp = KGrObject::frozen; - KGrObject::frozen = FALSE; // Temporarily restart the game, by re-running + KGrObject::frozen = false; // Temporarily restart the game, by re-running // any timer events that have been blocked. readMousePos(); // Set hero's direction. @@ -1270,7 +1270,7 @@ void KGrGame::restart() ((KGrBrick *)playfield[i][j])->doStep(); } - KGrObject::frozen = temp; // If frozen was TRUE, halt again, which gives a + KGrObject::frozen = temp; // If frozen was true, halt again, which gives a // single-step effect, otherwise go on running. } @@ -1323,7 +1323,7 @@ void KGrGame::showObjectState() void KGrGame::bugFix() { if (KGrObject::frozen) { // Toggle a bug fix on/off dynamically. - KGrObject::bugFixed = (KGrObject::bugFixed) ? FALSE : TRUE; + KGrObject::bugFixed = (KGrObject::bugFixed) ? false : true; printf ("%s", (KGrObject::bugFixed) ? "\n" : ""); printf (">>> Bug fix is %s\n", (KGrObject::bugFixed) ? "ON" : "OFF\n"); } @@ -1332,7 +1332,7 @@ void KGrGame::bugFix() void KGrGame::startLogging() { if (KGrObject::frozen) { // Toggle logging on/off dynamically. - KGrObject::logging = (KGrObject::logging) ? FALSE : TRUE; + KGrObject::logging = (KGrObject::logging) ? false : true; printf ("%s", (KGrObject::logging) ? "\n" : ""); printf (">>> Logging is %s\n", (KGrObject::logging) ? "ON" : "OFF\n"); } @@ -1351,7 +1351,7 @@ void KGrGame::createLevel() { int i, j; - if (! saveOK (FALSE)) { // Check unsaved work. + if (! saveOK (false)) { // Check unsaved work. return; } @@ -1364,7 +1364,7 @@ void KGrGame::createLevel() } // Ignore player input from keyboard or mouse while the screen is set up. - loading = TRUE; + loading = true; level = 0; initEdit(); @@ -1392,7 +1392,7 @@ void KGrGame::createLevel() } // Re-enable player input. - loading = FALSE; + loading = false; view->updateCanvas(); // Show the edit area. view->update(); // Show the level name. @@ -1400,7 +1400,7 @@ void KGrGame::createLevel() void KGrGame::updateLevel() { - if (! saveOK (FALSE)) { // Check unsaved work. + if (! saveOK (false)) { // Check unsaved work. return; } @@ -1429,7 +1429,7 @@ void KGrGame::updateLevel() void KGrGame::updateNext() { - if (! saveOK (FALSE)) { // Check unsaved work. + if (! saveOK (false)) { // Check unsaved work. return; } level++; @@ -1445,7 +1445,7 @@ void KGrGame::loadEditLevel (int lev) return; // Ignore player input from keyboard or mouse while the screen is set up. - loading = TRUE; + loading = true; level = lev; initEdit(); @@ -1498,7 +1498,7 @@ void KGrGame::loadEditLevel (int lev) showEditLevel(); // Reconnect signals. // Re-enable player input. - loading = FALSE; + loading = false; } void KGrGame::editNameAndHint() @@ -1512,7 +1512,7 @@ void KGrGame::editNameAndHint() if (nh->exec() == TQDialog::Accepted) { levelName = nh->getName(); levelHint = nh->getHint(); - shouldSave = TRUE; + shouldSave = true; } delete nh; @@ -1530,7 +1530,7 @@ bool KGrGame::saveLevelFile() if (! editMode) { KGrMessage::information (view, i18n("Save Level"), i18n("Inappropriate action: you are not editing a level.")); - return (FALSE); + return (false); } // Save the current collection index. @@ -1548,7 +1548,7 @@ bool KGrGame::saveLevelFile() // Pop up dialog box, which could change the collection or level or both. selectedLevel = selectLevel (action, selectedLevel); if (selectedLevel == 0) - return (FALSE); + return (false); // Get the new collection (if changed). int n = collnIndex; @@ -1559,10 +1559,10 @@ bool KGrGame::saveLevelFile() if ((action == SL_SAVE) && (n == N) && (selectedLevel == level)) { // This is a normal edit: the old file is to be re-written. - isNew = FALSE; + isNew = false; } else { - isNew = TRUE; + isNew = true; // Check if the file is to be inserted in or appended to the collection. if (levelFile.exists()) { switch (KGrMessage::warning (view, i18n("Save Level"), @@ -1572,10 +1572,10 @@ bool KGrGame::saveLevelFile() case 0: if (! reNumberLevels (n, selectedLevel, collections.at(n)->nLevels, +1)) { - return (FALSE); + return (false); } break; - case 1: return (FALSE); + case 1: return (false); break; } } @@ -1585,7 +1585,7 @@ bool KGrGame::saveLevelFile() if (! levelFile.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Level"), i18n("Cannot open file '%1' for output.").arg(filePath)); - return (FALSE); + return (false); } // Save the level. @@ -1622,7 +1622,7 @@ bool KGrGame::saveLevelFile() } levelFile.close (); - shouldSave = FALSE; + shouldSave = false; if (isNew) { collections.at(n)->nLevels++; @@ -1633,7 +1633,7 @@ bool KGrGame::saveLevelFile() emit showLevel (level); view->setTitle (getTitle()); // Display new title. view->updateCanvas(); // Show the edit area. - return (TRUE); + return (true); } void KGrGame::moveLevelFile () @@ -1690,7 +1690,7 @@ void KGrGame::moveLevelFile () filePath1 = getFilePath (USER, collections.at(fromC), fromL); filePath2 = filePath1; filePath2 = filePath2.append (".tmp"); - dir.rename (filePath1, filePath2, TRUE); + dir.rename (filePath1, filePath2, true); if (toC == fromC) { // Same collection. if (toL < fromL) { // Decrease level. @@ -1725,7 +1725,7 @@ void KGrGame::moveLevelFile () // Rename the saved "fromL" file to become "toL". filePath1 = getFilePath (USER, collections.at(toC), toL); - dir.rename (filePath2, filePath1, TRUE); + dir.rename (filePath2, filePath1, true); level = toL; collection = collections.at(toC); @@ -1801,9 +1801,9 @@ void KGrGame::deleteLevelFile () enemyCount = 0; // Load level in play mode. enemies.clear(); view->deleteEnemySprites(); - newLevel = TRUE;; + newLevel = true;; loadLevel (level); - newLevel = FALSE; + newLevel = false; } else { createLevel(); // No levels left in collection. @@ -1855,10 +1855,10 @@ void KGrGame::editCollection (int action) continue; } - bool allAlpha = TRUE; + bool allAlpha = true; for (int i = 0; i < len; i++) { if (! isalpha(ecPrefix.myChar(i))) { - allAlpha = FALSE; + allAlpha = false; break; } } @@ -1869,13 +1869,13 @@ void KGrGame::editCollection (int action) continue; } - bool duplicatePrefix = FALSE; + bool duplicatePrefix = false; KGrCollection * c; int imax = collections.count(); for (int i = 0; i < imax; i++) { c = collections.at(i); if ((c->prefix == ecPrefix) && (i != n)) { - duplicatePrefix = TRUE; + duplicatePrefix = true; break; } } @@ -1921,7 +1921,7 @@ bool KGrGame::saveOK (bool exiting) bool result; TQString option2 = i18n("&Go on editing"); - result = TRUE; + result = true; if (editMode) { if (exiting) { // If window is closing, @@ -1930,14 +1930,14 @@ bool KGrGame::saveOK (bool exiting) for (j = 1; j <= FIELDHEIGHT; j++) for (i = 1; i <= FIELDWIDTH; i++) { // Check cell changes. if ((shouldSave) || (editObjArray[i][j] != lastSaveArray[i][j])) { - // If shouldSave == TRUE, level name or hint was edited. + // If shouldSave == true, level name or hint was edited. switch (KGrMessage::warning (view, i18n("Editor"), i18n("You have not saved your work. Do " "you want to save it now?"), i18n("&Save"), i18n("&Don't Save"), option2)) { case 0: result = saveLevelFile(); break;// Save and continue. - case 1: shouldSave = FALSE; break; // Continue: don't save. - case 2: result = FALSE; break; // Go back to editing. + case 1: shouldSave = false; break; // Continue: don't save. + case 2: result = false; break; // Go back to editing. } return (result); } @@ -1950,15 +1950,15 @@ void KGrGame::initEdit() { if (! editMode) { - editMode = TRUE; - emit setEditMenu (TRUE); // Enable edit menu items and toolbar. + editMode = true; + emit setEditMenu (true); // Enable edit menu items and toolbar. // We were previously in play mode: stop the hero running or falling. hero->init (1, 1); - view->setHeroVisible (FALSE); + view->setHeroVisible (false); } - paintEditObj = FALSE; + paintEditObj = false; // Set the default object and button. editObj = BRICK; @@ -1977,12 +1977,12 @@ void KGrGame::initEdit() emit showScore (0); deleteLevel(); - setBlankLevel(FALSE); // Fill playfield with Editable objects. + setBlankLevel(false); // Fill playfield with Editable objects. view->setTitle (getTitle());// Show title of level. view->updateCanvas(); // Show the edit area. - shouldSave = FALSE; // Used to flag editing of name or hint. + shouldSave = false; // Used to flag editing of name or hint. } void KGrGame::deleteLevel() @@ -2058,16 +2058,16 @@ bool KGrGame::reNumberLevels (int cIndex, int first, int last, int inc) while (i != n) { file1 = getFilePath (USER, collections.at(cIndex), i); file2 = getFilePath (USER, collections.at(cIndex), i - step); - if (! dir.rename (file1, file2, TRUE)) { // Allow absolute paths. + if (! dir.rename (file1, file2, true)) { // Allow absolute paths. KGrMessage::information (view, i18n("Save Level"), i18n("Cannot rename file '%1' to '%2'.") .arg(file1).arg(file2)); - return (FALSE); + return (false); } i = i + step; } - return (TRUE); + return (true); } void KGrGame::setLevel (int lev) @@ -2092,7 +2092,7 @@ void KGrGame::doEdit (int button) switch (button) { case TQt::LeftButton: case TQt::RightButton: - paintEditObj = TRUE; + paintEditObj = true; insertEditObj (i, j); view->updateCanvas(); oldI = i; @@ -2115,7 +2115,7 @@ void KGrGame::endEdit (int button) switch (button) { case TQt::LeftButton: case TQt::RightButton: - paintEditObj = FALSE; + paintEditObj = false; if ((i != oldI) || (j != oldJ)) { insertEditObj (i, j); view->updateCanvas(); @@ -2135,9 +2135,9 @@ int KGrGame::selectLevel (int action, int requestedLevel) int selectedLevel = 0; // 0 = no selection (Cancel) or invalid. // Halt the game during the dialog. - modalFreeze = FALSE; + modalFreeze = false; if (! KGrObject::frozen) { - modalFreeze = TRUE; + modalFreeze = true; freeze(); } @@ -2199,7 +2199,7 @@ int KGrGame::selectLevel (int action, int requestedLevel) // Unfreeze the game, but only if it was previously unfrozen. if (modalFreeze) { unfreeze(); - modalFreeze = FALSE; + modalFreeze = false; } delete sl; @@ -2210,11 +2210,11 @@ bool KGrGame::ownerOK (Owner o) { // Check that this owner has at least one collection. KGrCollection * c; - bool OK = FALSE; + bool OK = false; for (c = collections.first(); c != 0; c = collections.next()) { if (c->owner == o) { - OK = TRUE; + OK = true; break; } } @@ -2335,10 +2335,10 @@ void KGrThumbNail::drawContents (TQPainter * p) // Activated via "paintEvent". bool KGrGame::initCollections () { // Initialise the list of collections of levels (i.e. the list of games). - collections.setAutoDelete(TRUE); + collections.setAutoDelete(true); owner = SYSTEM; // Use system levels initially. if (! loadCollections (SYSTEM)) // Load system collections list. - return (FALSE); // If no collections, abort. + return (false); // If no collections, abort. loadCollections (USER); // Load user collections list. // If none, don't worry. @@ -2349,7 +2349,7 @@ bool KGrGame::initCollections () collection = collections.at (collnIndex); level = 1; // Default start is at level 1. - return (TRUE); + return (true); } void KGrGame::mapCollections() @@ -2401,7 +2401,7 @@ void KGrGame::mapCollections() // Get the name of the file found on disk. fileName1 = file->fileName(); - while (TRUE) { + while (true) { // Work out what the file name should be, based on the level no. fileName2.setNum (lev); // Convert to TQString. fileName2 = fileName2.rightJustify (3,'0'); // Add zeros. @@ -2459,13 +2459,13 @@ bool KGrGame::loadCollections (Owner o) i18n("Cannot find game info file '%1'.") .arg(filePath)); } - return (FALSE); + return (false); } if (! c.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Load Game Info"), i18n("Cannot open file '%1' for read-only.").arg(filePath)); - return (FALSE); + return (false); } TQCString line = ""; @@ -2515,14 +2515,14 @@ bool KGrGame::loadCollections (Owner o) i18n("Format error in game info file '%1'.") .arg(filePath)); c.close(); - return (FALSE); + return (false); } line = ""; } } c.close(); - return (TRUE); + return (true); } bool KGrGame::saveCollections (Owner o) @@ -2532,7 +2532,7 @@ bool KGrGame::saveCollections (Owner o) if (o != USER) { KGrMessage::information (view, i18n("Save Game Info"), i18n("You can only modify user games.")); - return (FALSE); + return (false); } filePath = ((o == SYSTEM)? systemDataDir : userDataDir) + "games.dat"; @@ -2543,7 +2543,7 @@ bool KGrGame::saveCollections (Owner o) if (! c.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Game Info"), i18n("Cannot open file '%1' for output.").arg(filePath)); - return (FALSE); + return (false); } // Save the collections. @@ -2581,7 +2581,7 @@ bool KGrGame::saveCollections (Owner o) } c.close(); - return (TRUE); + return (true); } /******************************************************************************/ @@ -2591,12 +2591,12 @@ bool KGrGame::saveCollections (Owner o) void KGrGame::myMessage (TQWidget * parent, TQString title, TQString contents) { // Halt the game while the message is displayed. - setMessageFreeze (TRUE); + setMessageFreeze (true); KGrMessage::wrapped (parent, title, contents); // Unfreeze the game, but only if it was previously unfrozen. - setMessageFreeze (FALSE); + setMessageFreeze (false); } /******************************************************************************/ diff --git a/kgoldrunner/src/kgrobject.cpp b/kgoldrunner/src/kgrobject.cpp index 4152770b..8b4e7229 100644 --- a/kgoldrunner/src/kgrobject.cpp +++ b/kgoldrunner/src/kgrobject.cpp @@ -26,18 +26,18 @@ KGrObject::KGrObject (char objType) { iamA = objType; searchValue = 0; - blocker = FALSE; + blocker = false; if ((objType == BRICK) || (objType == BETON) || (objType == FBRICK)) { - blocker = TRUE; + blocker = true; } xpos = 0; ypos = 0; objectView = NULL; } -bool KGrObject::frozen = FALSE; // Initialise game as running, not halted. -bool KGrObject::bugFixed = FALSE;// Initialise game with dynamic bug-fix OFF. -bool KGrObject::logging = FALSE;// Initialise game with log printing OFF. +bool KGrObject::frozen = false; // Initialise game as running, not halted. +bool KGrObject::bugFixed = false;// Initialise game with dynamic bug-fix OFF. +bool KGrObject::logging = false;// Initialise game with log printing OFF. char KGrObject::whatIam () { @@ -103,7 +103,7 @@ KGrBrick::KGrBrick (char objType, int i, int j, KGrCanvas * view) ypos = j; objectView = view; dig_counter = 0; - holeFrozen = FALSE; + holeFrozen = false; iamA = BRICK; timer = new TQTimer (this); connect (timer, TQ_SIGNAL (timeout ()), TQ_SLOT (timeDone ())); @@ -116,12 +116,12 @@ void KGrBrick::dig (void) iamA = HOLE; objectView->paintCell (xpos, ypos, BRICK, dig_counter); objectView->updateCanvas(); - timer->start ((DIGDELAY * NSPEED) / speed, TRUE); + timer->start ((DIGDELAY * NSPEED) / speed, true); } void KGrBrick::doStep() { if (holeFrozen) { - holeFrozen = FALSE; + holeFrozen = false; timeDone(); } } @@ -137,19 +137,19 @@ void KGrBrick::showState (int i, int j) void KGrBrick::timeDone () { - if (KGrObject::frozen) {holeFrozen = TRUE; return;} + if (KGrObject::frozen) {holeFrozen = true; return;} // When the hole is complete, we need a longer delay. if (dig_counter == 5) { hole_counter--; if (hole_counter > 0) { - timer->start ((DIGDELAY * NSPEED) / speed, TRUE); + timer->start ((DIGDELAY * NSPEED) / speed, true); return; } } if (dig_counter < 9) { dig_counter++; - timer->start ((DIGDELAY * NSPEED) / speed, TRUE); + timer->start ((DIGDELAY * NSPEED) / speed, true); if (dig_counter >= 8) iamA = BRICK; } diff --git a/kgoldrunner/src/kgrobject.h b/kgoldrunner/src/kgrobject.h index 2ac41b3a..648b4344 100644 --- a/kgoldrunner/src/kgrobject.h +++ b/kgoldrunner/src/kgrobject.h @@ -41,7 +41,7 @@ public: char whatIam(); int searchValue; - bool blocker; // Beton or Brick -> TRUE + bool blocker; // Beton or Brick -> true void showState (int, int); protected: diff --git a/kjumpingcube/kcubeboxwidget.h b/kjumpingcube/kcubeboxwidget.h index 02060eaf..2768735f 100644 --- a/kjumpingcube/kcubeboxwidget.h +++ b/kjumpingcube/kcubeboxwidget.h @@ -104,7 +104,7 @@ public: TQPalette color(Player forWhom); /** - * checks if 'player' is a computerplayer an computes next move if TRUE + * checks if 'player' is a computerplayer an computes next move if true */ void checkComputerplayer(Player player); diff --git a/klines/field.cpp b/klines/field.cpp index ef509a33..e144fd61 100644 --- a/klines/field.cpp +++ b/klines/field.cpp @@ -73,7 +73,7 @@ void Field::putBall(int x, int y, char color) if( checkBounds(x,y) ){ field[y][x].setColor(color); erase5Balls(); - repaint(FALSE); + repaint(false); } }*/ void Field::moveBall(int xa, int ya, int xb, int yb) diff --git a/klines/klines.cpp b/klines/klines.cpp index f813d0e1..52d5fcb3 100644 --- a/klines/klines.cpp +++ b/klines/klines.cpp @@ -478,7 +478,7 @@ void KLines::undo() updateStat(); lPrompt->SetBalls(nextBalls); lsb->undo(); - switchUndo(FALSE); + switchUndo(false); } void KLines::makeTurn() diff --git a/klines/linesboard.cpp b/klines/linesboard.cpp index e7dcc057..eebcf21e 100644 --- a/klines/linesboard.cpp +++ b/klines/linesboard.cpp @@ -54,12 +54,12 @@ LinesBoard::LinesBoard( BallPainter * abPainter, TQWidget* parent, const char* n setFocusPolicy( TQWidget::NoFocus ); setBackgroundColor( gray ); - setMouseTracking( FALSE ); + setMouseTracking( false ); setFixedSize(wHint(), hHint()); timer = new TQTimer(this); connect( timer, TQ_SIGNAL(timeout()), TQ_SLOT(timerSlot()) ); - timer->start( TIMERCLOCK, FALSE ); + timer->start( TIMERCLOCK, false ); } @@ -163,7 +163,7 @@ void LinesBoard::placeBall( ) /*id LinesBoard::doAfterBalls() { erase5Balls(); - repaint(FALSE); + repaint(false); } */ /* @@ -306,7 +306,7 @@ void LinesBoard::moveFocus(int dx, int dy) focusX = (focusX + dx + NUMCELLSW) % NUMCELLSW; focusY = (focusY + dy + NUMCELLSH) % NUMCELLSH; } - repaint(FALSE); + repaint(false); } void LinesBoard::moveLeft() @@ -401,7 +401,7 @@ int LinesBoard::AnimEnd( ) else if ( oldanim == ANIM_BURN ) { emit eraseLine( deleteAnimatedBalls() ); - repaint(FALSE); + repaint(false); if ( nextBallToPlace < BALLSDROP ) { placeBall(); @@ -455,7 +455,7 @@ void LinesBoard::AnimNext() { if ( (direction > 0 && animstep == animmax) || ( direction < 0 && animstep == 0)) direction = -direction; animstep += direction; - repaint(FALSE); + repaint(false); } else { if ( animstep >= animmax ) AnimEnd(); @@ -466,7 +466,7 @@ void LinesBoard::AnimNext() { moveBall(way[animstep].x,way[animstep].y,way[animstep+1].x,way[animstep+1].y); animstep++; animdelaycount = animdelaystart; - repaint( FALSE ); + repaint( false ); } } } @@ -698,7 +698,7 @@ void LinesBoard::undo() AnimEnd(); restoreUndo(); restoreRandomState(); - repaint( FALSE ); + repaint( false ); } void LinesBoard::showDemoText(const TQString &text) @@ -708,7 +708,7 @@ void LinesBoard::showDemoText(const TQString &text) demoLabel = new TQLabel(0, "demoTip", WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM ); demoLabel->setMargin(1); demoLabel->setIndent(0); - demoLabel->setAutoMask( FALSE ); + demoLabel->setAutoMask( false ); demoLabel->setFrameStyle( TQFrame::Plain | TQFrame::Box ); demoLabel->setLineWidth( 1 ); demoLabel->setAlignment( AlignHCenter | AlignTop ); diff --git a/klines/prompt.cpp b/klines/prompt.cpp index 3e46f52d..5a50dfe2 100644 --- a/klines/prompt.cpp +++ b/klines/prompt.cpp @@ -28,7 +28,7 @@ LinesPrompt::LinesPrompt( BallPainter * abPainter, TQWidget* parent, const char* setFocusPolicy( TQWidget::NoFocus ); setBackgroundColor( gray ); - setMouseTracking( FALSE ); + setMouseTracking( false ); setFixedSize(wPrompt(), hPrompt()); PromptEnabled = true; diff --git a/kpat/card.cpp b/kpat/card.cpp index d3dba426..09773711 100644 --- a/kpat/card.cpp +++ b/kpat/card.cpp @@ -288,7 +288,7 @@ void Card::flipTo(int x2, int y2, int steps) m_animSteps = steps; setVelocity(dx/m_animSteps, dy/m_animSteps-flipLift); - setAnimated(TRUE); + setAnimated(true); } @@ -336,7 +336,7 @@ void Card::setAnimated(bool anim) // Reset all things that might have changed during the animation. scaleX = 1.0; scaleY = 1.0; - m_flipping = FALSE; + m_flipping = false; setVelocity(0, 0); // Move the card to its destination immediately. @@ -374,7 +374,7 @@ void Card::getUp(int steps) // Animation m_animSteps = steps; setVelocity(0, 0); - setAnimated(TRUE); + setAnimated(true); } #include "card.moc" diff --git a/kpat/freecell-solver/pqueue.c b/kpat/freecell-solver/pqueue.c index 086cce96..e507a875 100644 --- a/kpat/freecell-solver/pqueue.c +++ b/kpat/freecell-solver/pqueue.c @@ -25,9 +25,6 @@ #include "dmalloc.h" #endif -#define TRUE 1 -#define FALSE 0 - /* initialise the priority queue with a maximum size of maxelements. maxrating is the highest or lowest value of an entry in the pqueue depending on whether it is ascending or descending respectively. Finally the bool32 tells you whether the list is sorted ascending or descending... */ @@ -50,10 +47,10 @@ void freecell_solver_PQueueInitialise( } /* join a priority queue - returns TRUE if successful, FALSE if fails. (You fail by filling the pqueue.) + returns true if successful, false if fails. (You fail by filling the pqueue.) PGetRating is a function which returns the rating of the item you're adding for sorting purposes */ -int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t r) +void freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t r) { uint32 i; pq_element_t * Elements = pq->Elements; @@ -103,8 +100,7 @@ int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t r) pq->CurrentSize = CurrentSize; - return TRUE; - + return; } #define PQueueIsEmpty(pq) ((pq)->CurrentSize == 0) diff --git a/kpat/freecell-solver/pqueue.h b/kpat/freecell-solver/pqueue.h index cf5f5372..252653d6 100644 --- a/kpat/freecell-solver/pqueue.h +++ b/kpat/freecell-solver/pqueue.h @@ -58,7 +58,7 @@ void freecell_solver_PQueueInitialise( void freecell_solver_PQueueFree( PQUEUE *pq ); -int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t); +void freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t); void *freecell_solver_PQueuePop( PQUEUE *pq); diff --git a/kpoker/kpoker.cpp b/kpoker/kpoker.cpp index cc510319..2d7e53f0 100644 --- a/kpoker/kpoker.cpp +++ b/kpoker/kpoker.cpp @@ -438,7 +438,7 @@ void kpok::newRound() paintCash(); - drawTimer->start(drawDelay, TRUE); + drawTimer->start(drawDelay, true); } @@ -763,9 +763,9 @@ void kpok::drawClick() } if (playerBox[0]->getHeld(0)) - drawTimer->start(0, TRUE); + drawTimer->start(0, true); else - drawTimer->start(drawDelay, TRUE); + drawTimer->start(drawDelay, true); } else if (m_game.getState() == StateBet2) { // raise setBetButtonEnabled(false); @@ -905,9 +905,9 @@ void kpok::drawCardsEvent() drawStat++; // look at next card and if it is held instantly call drawCardEvent again if (playerBox[0]->getHeld(drawStat)) - drawTimer->start(0,TRUE); + drawTimer->start(0,true); else - drawTimer->start(drawDelay,TRUE); + drawTimer->start(drawDelay,true); } } @@ -1028,7 +1028,7 @@ void kpok::stopWave() { waveTimer->stop(); fCount = -1; /* clear image */ - repaint ( FALSE ); + repaint ( false ); waveActive = false; } @@ -1042,7 +1042,7 @@ void kpok::stopDrawing() void kpok::waveTimerEvent() { fCount = (fCount + 1) & 15; - repaint( FALSE ); + repaint( false ); } diff --git a/kreversi/board.h b/kreversi/board.h index bf87bdbc..68047178 100644 --- a/kreversi/board.h +++ b/kreversi/board.h @@ -80,7 +80,7 @@ public: void setShowLastMove(bool show); // View methods called from the outside. - void updateBoard(bool force = FALSE); + void updateBoard(bool force = false); void animateChanged(Move move); void setAnimationSpeed(uint); diff --git a/kreversi/kreversi.cpp b/kreversi/kreversi.cpp index e70cba53..1b5533b3 100644 --- a/kreversi/kreversi.cpp +++ b/kreversi/kreversi.cpp @@ -344,7 +344,7 @@ void KReversi::slotUndo() void KReversi::slotInterrupt() { - m_engine->setInterrupt(TRUE); + m_engine->setInterrupt(true); // Indicate that the computer was interrupted. showTurn(); @@ -706,7 +706,7 @@ bool KReversi::loadGame(TDEConfig *config) m_humanColor = (Color) config->readNumEntry("HumanColor"); m_competitiveGame = (bool) config->readNumEntry("Competitive"); - m_gameView->updateBoard(TRUE); + m_gameView->updateBoard(true); setState(State(config->readNumEntry("State"))); setStrength(config->readNumEntry("Strength", 1)); diff --git a/kreversi/kreversi.h b/kreversi/kreversi.h index 5d14a501..48d593e7 100644 --- a/kreversi/kreversi.h +++ b/kreversi/kreversi.h @@ -78,7 +78,7 @@ public: // Methods that deal with the engine. void setStrength(uint); uint strength() const { return m_engine->strength(); } - void interrupt() { m_engine->setInterrupt(TRUE); } + void interrupt() { m_engine->setInterrupt(true); } bool interrupted() const { return (m_game->toMove() == computerColor() && m_state == Ready); } diff --git a/kreversi/qreversigame.h b/kreversi/qreversigame.h index bbfb4467..3e7388e0 100644 --- a/kreversi/qreversigame.h +++ b/kreversi/qreversigame.h @@ -77,7 +77,7 @@ class QReversiGame : public TQObject, public Game { #if 0 void loadSettings(); - bool loadGame(TDEConfig *, bool noupdate = FALSE); + bool loadGame(TDEConfig *, bool noupdate = false); void saveGame(TDEConfig *); #endif diff --git a/kreversi/qreversigameview.h b/kreversi/qreversigameview.h index e7198d5c..3adc112c 100644 --- a/kreversi/qreversigameview.h +++ b/kreversi/qreversigameview.h @@ -130,7 +130,7 @@ public slots: void updateView(); // Update the entire view. void updateStatus(); // Update the status widgets (score) - void updateBoard(bool force = FALSE); // Update the board. + void updateBoard(bool force = false); // Update the board. void updateMovelist(); // Update the move list. signals: diff --git a/ksame/StoneWidget.cpp b/ksame/StoneWidget.cpp index f0adcba8..57ef5c8f 100644 --- a/ksame/StoneWidget.cpp +++ b/ksame/StoneWidget.cpp @@ -279,7 +279,7 @@ StoneWidget::paintEvent( TQPaintEvent *e ) { bitBlt(this,cx,cy, &map[stone->color-1][tslice].stone, 0, 0, - stone_width,stone_height,CopyROP,FALSE); + stone_width,stone_height,CopyROP,false); } else { erase(cx, cy, stone_width, stone_height); diff --git a/kshisen/board.h b/kshisen/board.h index 2444b420..08da3fcd 100644 --- a/kshisen/board.h +++ b/kshisen/board.h @@ -108,7 +108,7 @@ public: int getCurrentTime() const; int getTimeForGame() const; - bool solvable(bool norestore = FALSE); + bool solvable(bool norestore = false); bool getSolvableFlag() const; void setSolvableFlag(bool); diff --git a/ksnake/snake.h b/ksnake/snake.h index 396f928a..6bfda05e 100644 --- a/ksnake/snake.h +++ b/ksnake/snake.h @@ -69,7 +69,7 @@ protected: void appendSamy(); void updateSamy(); int tail() const { return (list.count() -1 ); } - bool growing() const { return (grow > 0 ? TRUE : FALSE); } + bool growing() const { return (grow > 0); } int hold; int grow; diff --git a/libksirtet/base/board.cpp b/libksirtet/base/board.cpp index 816d15e3..74643374 100644 --- a/libksirtet/base/board.cpp +++ b/libksirtet/base/board.cpp @@ -299,8 +299,8 @@ bool BaseBoard::timeout() Q_ASSERT( graphic() ); if ( state==GameOver ) return true; switch (state) { - case BeforeRemove: _beforeRemove(FALSE); break; - case AfterRemove: _afterRemove(FALSE); break; + case BeforeRemove: _beforeRemove(false); break; + case AfterRemove: _afterRemove(false); break; default: return false; } main->update(); diff --git a/libksirtet/base/piece.cpp b/libksirtet/base/piece.cpp index 061088fb..27d704bd 100644 --- a/libksirtet/base/piece.cpp +++ b/libksirtet/base/piece.cpp @@ -74,9 +74,9 @@ void SequenceArray::setBlockSize(uint bsize) _size = bsize; const GPieceInfo &pinfo = Piece::info(); TQPtrList pixmaps; - pixmaps.setAutoDelete(TRUE); + pixmaps.setAutoDelete(true); TQPtrList points; - points.setAutoDelete(TRUE); + points.setAutoDelete(true); uint nm = pinfo.nbBlockModes(); for (uint i=0; itreatData(); // check reading stream for (uint i=0; ireading.readOk() ) DATA_ERROR(i); - writeData(TRUE); + writeData(true); } //----------------------------------------------------------------------------- @@ -61,7 +61,7 @@ void Server::congestion() void Server::serverTimeout() { - ctimer.start(2*interval, TRUE); + ctimer.start(2*interval, true); timeout(); } @@ -75,7 +75,7 @@ Network::Network(MPInterface *_interface, TQPtrListIterator it(rhd); for (; it.current(); ++it) { rd.socket = it.current()->socket; - rd.socket->notifier()->setEnabled(TRUE); + rd.socket->notifier()->setEnabled(true); connect(rd.socket->notifier(), TQ_SIGNAL(activated(int)), TQ_SLOT(notifier(int))); uint nb = it.current()->bds.count(); @@ -122,7 +122,7 @@ IOBuffer *Network::ioBuffer(uint i) const if ( isize() ) return (*remotes[k].array)[i]; i -= remotes[k].array->size(); } - Q_ASSERT(FALSE); + Q_ASSERT(false); return 0; } @@ -170,7 +170,7 @@ NetworkServer::NetworkServer(MPInterface *_interface, connect(&timer, TQ_SIGNAL(timeout()), TQ_SLOT(timeoutSlot())); connect(&ctimer, TQ_SIGNAL(timeout()), TQ_SLOT(congestionTimeoutSlot())); // to catch unexpected data - for (uint i=0; iwritingStream() << MF_Ask; @@ -202,7 +202,7 @@ void NetworkServer::notifier(int fd) case 0: BROKE_ERROR(i); } - remotes[i].received = TRUE; + remotes[i].received = true; nbReceived++; ReadingStream &s = remotes[i].socket->readingStream(); @@ -256,7 +256,7 @@ void Client::notifier(int) case MF_Ask: // write data from local boards to server socket (cleaning // of writing stream is done in write()) - readData(FALSE); + readData(false); remotes[0].socket->writingStream() << ios; // debug("CLIENT : send ios (size=%i)", // remotes[0].socket->writingStream().size()); @@ -270,7 +270,7 @@ void Client::notifier(int) interface->dataFromServer(s); // debug("CLIENT : after dataFromServer (at=%i)", s.device()->at()); if ( !s.readOk() ) DATA_ERROR(0); - writeData(FALSE); + writeData(false); break; default: DATA_ERROR(0); } diff --git a/libksirtet/lib/meeting.cpp b/libksirtet/lib/meeting.cpp index 7c246356..a0df2404 100644 --- a/libksirtet/lib/meeting.cpp +++ b/libksirtet/lib/meeting.cpp @@ -18,10 +18,10 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, : KDialogBase(Plain, i18n("Network Meeting"), (_server ? Ok|Cancel|Help : Cancel|Help), (_server ? Ok : Cancel), parent, name), - server(_server), ow(option), id(_id), socketRemoved(FALSE) + server(_server), ow(option), id(_id), socketRemoved(false) { sm.append(socket, SocketManager::ReadWrite); - sm[0]->notifier()->setEnabled(TRUE); + sm[0]->notifier()->setEnabled(true); /* top layout */ TQVBoxLayout *top = new TQVBoxLayout(plainPage(), spacingHint()); @@ -49,13 +49,13 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket, top->addWidget(status); // buttons - enableButtonSeparator(TRUE); + enableButtonSeparator(true); if (server) { setButtonOK(i18n("Start Game")); - enableButtonOK(FALSE); + enableButtonOK(false); } setButtonCancel(server ? i18n("Abort") : i18n("Quit")); - enableButton(Help, FALSE); + enableButton(Help, false); } NetMeeting::~NetMeeting() @@ -115,7 +115,7 @@ bool NetMeeting::ready() const for(uint k=0; ksize(); k++) { switch ( wl->widget(k)->type() ) { case MeetingCheckBox::Ready : nbReady++; break; - case MeetingCheckBox::NotReady : return FALSE; + case MeetingCheckBox::NotReady : return false; default : break; } } @@ -163,7 +163,7 @@ void NetMeeting::readData(uint i) default: dataError(i); } - if (socketRemoved) socketRemoved = FALSE; + if (socketRemoved) socketRemoved = false; else if ( !sm[i]->readingStream().atEnd() ) readData(i); // more pending data } @@ -214,7 +214,7 @@ void NetMeeting::message(const TQString &str) ServerNetMeeting::ServerNetMeeting(const cId &id, const RemoteHostData &r, MPOptionWidget *option, TQPtrList &arhd, TQWidget *parent, const char * name) -: NetMeeting(id, r.socket, option, TRUE, parent, name), rhd(arhd) +: NetMeeting(id, r.socket, option, true, parent, name), rhd(arhd) { connect(sm[0]->notifier(), TQ_SIGNAL(activated(int)), TQ_SLOT(newHost(int))); players.append(Accepted); // server @@ -247,7 +247,7 @@ void ServerNetMeeting::netError(uint i, const TQString &type) void ServerNetMeeting::disconnectHost(uint i, const TQString &str) { sm.remove(i, true); - socketRemoved = TRUE; + socketRemoved = true; if ( players[i]==Accepted ) { removeLine(i-1); @@ -273,7 +273,7 @@ void ServerNetMeeting::newHost(int) uint i = sm.append(socket, SocketManager::ReadWrite); connect(sm[i]->notifier(), TQ_SIGNAL(activated(int)), TQ_SLOT(readNotifier(int))); - sm[i]->notifier()->setEnabled(TRUE); + sm[i]->notifier()->setEnabled(true); } void ServerNetMeeting::idFlag(uint i) @@ -314,10 +314,10 @@ void ServerNetMeeting::newFlag(uint i) CHECK_READ(i); // complete the MeetingLineData struct with initial values - pld.own = FALSE; // client line + pld.own = false; // client line pld.ed.type = MeetingCheckBox::NotReady; // not ready by default pld.ed.text = ""; // empty line to begin with - appendLine(pld, TRUE); + appendLine(pld, true); // send to the new client already present lines including its own // (New flag + MeetingLineData struct) @@ -332,7 +332,7 @@ void ServerNetMeeting::newFlag(uint i) // send to all other clients the new line (New flag + MeetingLineData struct) wl->widget(i-1)->data(pld.ed); - pld.own = FALSE; + pld.own = false; sm.commonWritingStream() << NewFlag << pld; writeToAll(i); } @@ -407,12 +407,12 @@ void ServerNetMeeting::accept() ExtData ed; bool willPlay; for (uint k=1; kwidget(k-1)->data(ed); if ( ed.type==MeetingCheckBox::Ready ) { - willPlay = TRUE; + willPlay = true; RemoteHostData *r = new RemoteHostData; r->socket = sm[0]; r->bds = ed.bds; @@ -449,7 +449,7 @@ void ServerNetMeeting::optionsChanged() ClientNetMeeting::ClientNetMeeting(const cId &id, const RemoteHostData &rhd, MPOptionWidget *option, TQWidget *parent, const char * name) -: NetMeeting(id, rhd.socket, option, FALSE, parent, name), bds(rhd.bds) +: NetMeeting(id, rhd.socket, option, false, parent, name), bds(rhd.bds) { connect(sm[0]->notifier(), TQ_SIGNAL(activated(int)), TQ_SLOT(readNotifier(int))); @@ -499,7 +499,7 @@ void ClientNetMeeting::newFlag(uint) } else { MeetingLineData pld; sm[0]->readingStream() >> pld; - appendLine(pld, FALSE); + appendLine(pld, false); } CHECK_READ(0); } diff --git a/libksirtet/lib/mp_board.h b/libksirtet/lib/mp_board.h index 4d689b60..ca40df56 100644 --- a/libksirtet/lib/mp_board.h +++ b/libksirtet/lib/mp_board.h @@ -19,9 +19,9 @@ class MPBoard : public TQWidget /** * This method is called once at the board creation. - * @param AI is TRUE if the player is not human. - * @param multiplayers is TRUE if the game is not a single player game. - * @param first is TRUE if this board is the first local one. + * @param AI is true if the player is not human. + * @param multiplayers is true if the game is not a single player game. + * @param first is true if this board is the first local one. */ virtual void init(bool AI, bool multiplayers, bool server, bool first, const TQString &name) = 0; diff --git a/libksirtet/lib/mp_interface.cpp b/libksirtet/lib/mp_interface.cpp index b38a4896..ce341c24 100644 --- a/libksirtet/lib/mp_interface.cpp +++ b/libksirtet/lib/mp_interface.cpp @@ -64,7 +64,7 @@ void MPInterface::dialog() // net meeting TQPtrList rhd; - rhd.setAutoDelete(TRUE); + rhd.setAutoDelete(true); if (cd.network) { cId id(tdeApp->name(), gameInfo.gameId); MPOptionWidget *ow = newOptionWidget(); @@ -110,8 +110,8 @@ void MPInterface::specialLocalGame(uint nbHumans, uint nbAIs) : i18n("AI %1").arg(i-nbHumans+1)); cd.rhd.bds += bd; } - cd.server = TRUE; - cd.network = FALSE; + cd.server = true; + cd.network = false; Q_ASSERT( (nbHumans+nbAIs)<=gameInfo.maxNbLocalPlayers ); Q_ASSERT( gameInfo.AIAllowed || nbAIs==0 ); @@ -255,7 +255,7 @@ void MPInterface::hostDisconnected(uint, const TQString &msg) errorBox(msg, TQString(), this); if ( !disconnected ) { // to avoid multiple calls - disconnected = TRUE; + disconnected = true; // the zero timer is used to be outside the "internal" class TQTimer::singleShot(0, this, TQ_SLOT(singleHumanSlot())); } @@ -263,7 +263,7 @@ void MPInterface::hostDisconnected(uint, const TQString &msg) void MPInterface::singleHumanSlot() { - disconnected = FALSE; + disconnected = false; singleHuman(); } diff --git a/libksirtet/lib/mp_simple_board.cpp b/libksirtet/lib/mp_simple_board.cpp index c0828f1e..a7e7ab64 100644 --- a/libksirtet/lib/mp_simple_board.cpp +++ b/libksirtet/lib/mp_simple_board.cpp @@ -49,19 +49,19 @@ void MPSimpleBoard::pauseFlag() void MPSimpleBoard::gameOverFlag() { Q_ASSERT( BS_Play ); - _stop(TRUE); + _stop(true); state = BS_Stop; } void MPSimpleBoard::stopFlag() { - _stop(FALSE); + _stop(false); state = BS_Standby; } void MPSimpleBoard::_stop(bool gameover) { - if ( state==BS_Pause ) _pauseFlag(FALSE); + if ( state==BS_Pause ) _pauseFlag(false); emit enableKeys(false); _stopFlag(gameover); } diff --git a/libksirtet/lib/mp_simple_interface.cpp b/libksirtet/lib/mp_simple_interface.cpp index 004f1a78..831d9daa 100644 --- a/libksirtet/lib/mp_simple_interface.cpp +++ b/libksirtet/lib/mp_simple_interface.cpp @@ -21,7 +21,7 @@ void MPSimpleInterface::init() { if ( server() ) { state = SS_Standby; - first_init = TRUE; + first_init = true; } _init(); } @@ -90,8 +90,8 @@ void MPSimpleInterface::treatData() case SS_Pause: break; case SS_Stop: treatStop(); break; case SS_Standby: break; - case SS_PauseAsked: treatPause(TRUE); break; - case SS_UnpauseAsked: treatPause(FALSE); break; + case SS_PauseAsked: treatPause(true); break; + case SS_UnpauseAsked: treatPause(false); break; } } @@ -101,7 +101,7 @@ void MPSimpleInterface::treatInit() if (first_init) { _firstInit(); - first_init = FALSE; + first_init = false; } IO_Flag f(IO_Flag::Init); diff --git a/libksirtet/lib/pline.cpp b/libksirtet/lib/pline.cpp index fd2d9200..587f1f2f 100644 --- a/libksirtet/lib/pline.cpp +++ b/libksirtet/lib/pline.cpp @@ -20,7 +20,7 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, /* TriCheckBox */ tcb = new MeetingCheckBox(MeetingCheckBox::Ready, isOwner, serverIsReader, this); - if ( !XOR(isOwner, serverIsReader) ) tcb->setEnabled(FALSE); + if ( !XOR(isOwner, serverIsReader) ) tcb->setEnabled(false); else connect(tcb, TQ_SIGNAL(changed(int)), TQ_SLOT(_typeChanged(int))); hbl->addWidget(tcb); @@ -31,7 +31,7 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine, lname->setLineWidth(2); lname->setMidLineWidth(3); TQFont f = lname->font(); - f.setBold(TRUE); + f.setBold(true); lname->setFont(f); lname->setFixedSize(lname->fontMetrics().maxWidth()*NAME_MAX_LENGTH, lname->sizeHint().height()); @@ -131,7 +131,7 @@ void PlayerLine::setSlot() GWidgetList::GWidgetList(uint interval, TQWidget *parent, const char * name) : TQWidget(parent, name), vbl(this, interval) { - widgets.setAutoDelete(TRUE); + widgets.setAutoDelete(true); } void GWidgetList::append(TQWidget *wi) diff --git a/libksirtet/lib/smanager.h b/libksirtet/lib/smanager.h index 59dd0edb..3c050a6c 100644 --- a/libksirtet/lib/smanager.h +++ b/libksirtet/lib/smanager.h @@ -57,10 +57,10 @@ class SocketManager */ void remove(uint i, bool deleteSocket); - /** @return TRUE if it is possible to write to all the writeable sockets. */ + /** @return true if it is possible to write to all the writeable sockets. */ bool canWriteAll(uint sec = 0, uint usec = 0); - /** @return TRUE if it is possible to write to the specified socket. */ + /** @return true if it is possible to write to the specified socket. */ bool canWrite(uint i, uint sec = 0, uint usec = 0); Stream &commonWritingStream() { return writing; } diff --git a/libksirtet/lib/socket.cpp b/libksirtet/lib/socket.cpp index 6defc94b..0298645c 100644 --- a/libksirtet/lib/socket.cpp +++ b/libksirtet/lib/socket.cpp @@ -28,7 +28,7 @@ Socket::Socket(KExtendedSocket *s, bool createNotifier, if (createNotifier) { _notifier = new TQSocketNotifier(s->fd(), TQSocketNotifier::Read, parent, name); - _notifier->setEnabled(FALSE); + _notifier->setEnabled(false); } } diff --git a/libksirtet/lib/socket.h b/libksirtet/lib/socket.h index 01dac726..f6e3f3be 100644 --- a/libksirtet/lib/socket.h +++ b/libksirtet/lib/socket.h @@ -11,7 +11,7 @@ class Socket { public: - Socket(KExtendedSocket *, bool createNotifier = FALSE, + Socket(KExtendedSocket *, bool createNotifier = false, TQObject *parent = 0, const char *name = 0); /** close the socket */ @@ -33,7 +33,7 @@ class Socket /** * Write data contained in the writing stream to the socket. * It clears the stream. - * @return TRUE if all was written without error. + * @return true if all was written without error. */ bool write(); bool write(const TQByteArray &a); diff --git a/libksirtet/lib/wizard.cpp b/libksirtet/lib/wizard.cpp index 6bd4451a..5098938a 100644 --- a/libksirtet/lib/wizard.cpp +++ b/libksirtet/lib/wizard.cpp @@ -33,7 +33,7 @@ MPWizard::MPWizard(const MPGameInfo &gi, ConnectionData &_cd, TQWidget *parent, const char *name) -: KWizard(parent, name, TRUE), cd(_cd) +: KWizard(parent, name, true), cd(_cd) { // setupTypePage(); // #### REMOVE NETWORK GAMES UNTIL FIXED type = Local; @@ -70,7 +70,7 @@ void MPWizard::setupTypePage() eport->setRange(MIN_USER_PORT, MAX_USER_PORT, 1, false); addPage(typePage, i18n("Choose Game Type")); - setHelpEnabled(typePage, FALSE); + setHelpEnabled(typePage, false); typeChanged(type); } @@ -115,7 +115,7 @@ void MPWizard::setupLocalPage(const MPGameInfo &gi) // connect(keys, TQ_SIGNAL(clicked()), TQ_SLOT(configureKeysSlot())); addPage(localPage, i18n("Local Player's Settings")); - setHelpEnabled(localPage, FALSE); + setHelpEnabled(localPage, false); lineTypeChanged(0); } @@ -148,10 +148,10 @@ void MPWizard::typeChanged(int t) void MPWizard::lineTypeChanged(int) { - bool b = FALSE; + bool b = false; for (uint i=0; isize(); i++) if ( wl->widget(i)->type()==PlayerComboBox::Human ) { - b = TRUE; + b = true; break; } // keys->setEnabled(b); @@ -216,7 +216,7 @@ void MPWizard::accept() void MPWizard::showPage(TQWidget *page) { - if ( page==localPage ) setFinishEnabled(localPage, TRUE); + if ( page==localPage ) setFinishEnabled(localPage, true); KWizard::showPage(page); } diff --git a/libtdegames/kcarddialog.h b/libtdegames/kcarddialog.h index b4d9d23f..c48c51d0 100644 --- a/libtdegames/kcarddialog.h +++ b/libtdegames/kcarddialog.h @@ -130,13 +130,13 @@ public: * * @param flags what to show * - * @param randomDeck if this pointer is non-zero, *ok is set to TRUE if - * the user wants a random deck otherwise to FALSE. Use this in the + * @param randomDeck if this pointer is non-zero, *ok is set to true if + * the user wants a random deck otherwise to false. Use this in the * config file of your game to load a random deck on startup. * See @ref getRandomDeck() * - * @param randomCardDir if this pointer is non-zero, *ok is set to TRUE if - * the user wants a random card otherwise to FALSE. + * @param randomCardDir if this pointer is non-zero, *ok is set to true if + * the user wants a random card otherwise to false. * Use this in the config file of your game to load a random card * foregrounds on startup. * See @ref getRandomCardDir() @@ -271,24 +271,24 @@ public: void setupDialog(bool showResizeBox = false); /** - * @return TRUE if the selected deck is a random deck (i.e. the user checked - * the random checkbox) otherwise FALSE + * @return true if the selected deck is a random deck (i.e. the user checked + * the random checkbox) otherwise false **/ bool isRandomDeck() const; /** - * @return TRUE if the selected carddir is a random dir (i.e. the user - * checked the random checkbox) otherwise FALSE + * @return true if the selected carddir is a random dir (i.e. the user + * checked the random checkbox) otherwise false **/ bool isRandomCardDir() const; /** - * @return TRUE if the global checkbox was selected + * @return true if the global checkbox was selected **/ bool isGlobalDeck() const; /** - * @return TRUE if the global checkbox was selected + * @return true if the global checkbox was selected **/ bool isGlobalCardDir() const; diff --git a/libtdegames/kgame/COMPAT b/libtdegames/kgame/COMPAT index cfe81537..11457cd4 100644 --- a/libtdegames/kgame/COMPAT +++ b/libtdegames/kgame/COMPAT @@ -21,7 +21,7 @@ be made a virtual function? MH: This is done now. As this is a central function your programs will not run anymore. Fix: rename your slot which is connected to the above - signal to playerInput() and return TRUE in it. This will make it 100% + signal to playerInput() and return true in it. This will make it 100% compatible to the old version. I think this chagne is necessary especially as a signal is of no use here as you cannot read twice from the same stream. Therefore there can be only one function processing the input. If you really diff --git a/libtdegames/kgame/dialogs/kgamedialog.h b/libtdegames/kgame/dialogs/kgamedialog.h index 2530d665..cc123457 100644 --- a/libtdegames/kgame/dialogs/kgamedialog.h +++ b/libtdegames/kgame/dialogs/kgamedialog.h @@ -301,7 +301,7 @@ protected slots: /** * Called when the ADMIN status of this KGame client changes. See * KGameNetwork::signalAdminStatusChanged - * @param isAdmin TRUE if this client is now the ADMIN otherwise FALSE + * @param isAdmin true if this client is now the ADMIN otherwise false **/ void setAdmin(bool isAdmin); diff --git a/libtdegames/kgame/dialogs/kgamedialogconfig.h b/libtdegames/kgame/dialogs/kgamedialogconfig.h index 24f40949..6d1f9586 100644 --- a/libtdegames/kgame/dialogs/kgamedialogconfig.h +++ b/libtdegames/kgame/dialogs/kgamedialogconfig.h @@ -122,7 +122,7 @@ public: KPlayer* owner() const; /** - * @return True if the owner is ADMIN otherwise FALSE. See also + * @return True if the owner is ADMIN otherwise false. See also * @ref setAdmin **/ bool admin() const; @@ -157,7 +157,7 @@ public: * * @param parent Parent widget for this dialog. * @param initializeGUI If you really don't want to use the - * predefined widget and/or layout use FALSE here. Note that then none + * predefined widget and/or layout use false here. Note that then none * of the predefined widgets (currently only the name of the player) * will exist anymore. * diff --git a/libtdegames/kgame/kgame.h b/libtdegames/kgame/kgame.h index a6ab40f1..238d4865 100644 --- a/libtdegames/kgame/kgame.h +++ b/libtdegames/kgame/kgame.h @@ -521,7 +521,7 @@ signals: * removed. * @param player The player that is about to be removed. Add your new * KGameIO here - but only on one client! - * @param remove Set this to FALSE if you don't want this player to be + * @param remove Set this to false if you don't want this player to be * removed completely. **/ void signalReplacePlayerIO(KPlayer* player, bool* remove); @@ -679,11 +679,11 @@ protected: * the given player. * Note that you HAVE to overwrite this function. Otherwise your * game makes no sense at all. - * Generally you have to return TRUE in this function. Only then + * Generally you have to return true in this function. Only then * the game sequence is proceeded by calling @ref playerInputFinished * which in turn will check for game over or the next player * However, if you have a delayed move, because you e.g. move a - * card or a piece you want to return FALSE to pause the game sequence + * card or a piece you want to return false to pause the game sequence * and then manually call @ref playerInputFinished to resume it. * Example: * \code @@ -709,7 +709,7 @@ protected: * checks for game over and nextPlayer (in the case of turn base games) * are processed. * Call this manually if you have a delayed move, i.e. your playerInput - * function returns FALSE. If it returns true you need not do anything + * function returns false. If it returns true you need not do anything * here. * * @return the current player @@ -880,7 +880,7 @@ protected: * * @param stream a data stream where you can stream the game from * @param network is it a call from the network or from a file (unused but informative) - * @param saveplayers shall the players be saved too (should be TRUE) + * @param saveplayers shall the players be saved too (should be true) * * @return true? */ diff --git a/libtdegames/kgame/kgameio.h b/libtdegames/kgame/kgameio.h index b73d401b..0260b61d 100644 --- a/libtdegames/kgame/kgameio.h +++ b/libtdegames/kgame/kgameio.h @@ -137,11 +137,11 @@ signals: * when you get the turn status or when you lose it. * * The datastream has to be filled with a move. If you set (or leave) the - * send parameter to FALSE then nothing happens: the datastream will be - * ignored. If you set it to TRUE @ref sendInput is used to + * send parameter to false then nothing happens: the datastream will be + * ignored. If you set it to true @ref sendInput is used to * send the move. * - * Often you want to ignore this signal (leave send=FALSE) and send the + * Often you want to ignore this signal (leave send=false) and send the * message later. This is usually the case for a human player as he probably * doesn't react immediately. But you can still use this e.g. to notify the * player about the turn change. diff --git a/libtdegames/kgame/kgamenetwork.h b/libtdegames/kgame/kgamenetwork.h index 06a74731..0b7be6e8 100644 --- a/libtdegames/kgame/kgamenetwork.h +++ b/libtdegames/kgame/kgamenetwork.h @@ -61,7 +61,7 @@ public: virtual void Debug(); /** - * @return TRUE if this is a network game - i.e. you are either MASTER or + * @return true if this is a network game - i.e. you are either MASTER or * connected to a remote MASTER. **/ bool isNetwork() const; @@ -144,7 +144,7 @@ public: /** * @since 3.2 * @return The name of the host that we are currently connected to is - * isNetwork is TRUE and we are not the MASTER, i.e. if connectToServer + * isNetwork is true and we are not the MASTER, i.e. if connectToServer * was called. Otherwise this will return "localhost". **/ TQString hostName() const; @@ -381,7 +381,7 @@ signals: /** * This client gets or loses the admin status. * @see KMessageClient::adminStatusChanged - * @param isAdmin True if this client gets the ADMIN status otherwise FALSE + * @param isAdmin True if this client gets the ADMIN status otherwise false **/ void signalAdminStatusChanged(bool isAdmin); diff --git a/libtdegames/kgame/kgameproperty.h b/libtdegames/kgame/kgameproperty.h index 1b2c2fc3..76d389ac 100644 --- a/libtdegames/kgame/kgameproperty.h +++ b/libtdegames/kgame/kgameproperty.h @@ -338,8 +338,8 @@ protected: * This does not send the current value but the explicitly * given value. * - * @return TRUE if the message could be sent successfully, otherwise - * FALSE + * @return true if the message could be sent successfully, otherwise + * false **/ bool sendProperty(const TQByteArray& b); @@ -774,7 +774,7 @@ public: * other client) or when a game is loaded (and maybe on some other * events). * - * Also calls emitSignal if isEmittingSignal is TRUE. + * Also calls emitSignal if isEmittingSignal is true. * @param s The stream to read from **/ virtual void load(TQDataStream& s) diff --git a/libtdegames/kgame/kmessageclient.h b/libtdegames/kgame/kmessageclient.h index 456f79cc..c08b05e4 100644 --- a/libtdegames/kgame/kmessageclient.h +++ b/libtdegames/kgame/kmessageclient.h @@ -159,13 +159,13 @@ public: bool isConnected () const; /** - @return TRUE if isConnected() is true AND this is not a local (like + @return true if isConnected() is true AND this is not a local (like KMessageDirect) connection. */ bool isNetwork () const; /** - @return 0 if isConnected() is FALSE, otherwise the port number this client is + @return 0 if isConnected() is false, otherwise the port number this client is connected to. See also KMessageIO::peerPort and TQSocket::peerPort. @since 3.2 */ @@ -173,7 +173,7 @@ public: /** @since 3.2 - @return "localhost" if isConnected() is FALSE, otherwise the hostname this client is + @return "localhost" if isConnected() is false, otherwise the hostname this client is connected to. See also KMessageIO::peerName() and TQSocket::peerName(). */ TQString peerName() const; diff --git a/libtdegames/kgame/kmessageio.h b/libtdegames/kgame/kmessageio.h index e503da6d..42acaf41 100644 --- a/libtdegames/kgame/kmessageio.h +++ b/libtdegames/kgame/kmessageio.h @@ -246,7 +246,7 @@ public: virtual TQString peerName () const; /** - @return TRUE as this is a network IO. + @return true as this is a network IO. */ bool isNetwork() const { return true; } @@ -322,7 +322,7 @@ public: /** - @return FALSE as this is no network IO. + @return false as this is no network IO. */ bool isNetwork() const { return false; } @@ -361,7 +361,7 @@ class KMessageProcess : public KMessageIO void writeToProcess(); /** - @return FALSE as this is no network IO. + @return false as this is no network IO. */ bool isNetwork() const { return false; } @@ -400,7 +400,7 @@ class KMessageFilePipe : public KMessageIO void exec(); /** - @return FALSE as this is no network IO. + @return false as this is no network IO. */ bool isNetwork() const { return false; } diff --git a/libtdegames/kgame/kmessageserver.cpp b/libtdegames/kgame/kmessageserver.cpp index e8617f57..f74628cb 100644 --- a/libtdegames/kgame/kmessageserver.cpp +++ b/libtdegames/kgame/kmessageserver.cpp @@ -376,7 +376,7 @@ void KMessageServer::getReceivedMessage (const TQByteArray &msg) d->mMessageQueue.enqueue (new MessageBuffer (clientID, msg)); if (!d->mTimer.isActive()) - d->mTimer.start(0); // AB: should be , TRUE i guess + d->mTimer.start(0); // AB: should be , true i guess } void KMessageServer::processOneMessage () diff --git a/libtdegames/kgameprogress.cpp b/libtdegames/kgameprogress.cpp index 7e0067cf..7002ee8d 100644 --- a/libtdegames/kgameprogress.cpp +++ b/libtdegames/kgameprogress.cpp @@ -70,7 +70,7 @@ void KGameProgress::initialize() use_supplied_bar_color = false; bar_pixmap = 0; bar_style = Solid; - text_enabled = TRUE; + text_enabled = true; setBackgroundMode( PaletteBackground ); connect(tdeApp, TQ_SIGNAL(appearanceChanged()), this, TQ_SLOT(paletteChange())); paletteChange(); @@ -196,13 +196,13 @@ int KGameProgress::recalcValue(int range) void KGameProgress::valueChange() { - repaint(contentsRect(), FALSE); + repaint(contentsRect(), false); emit percentageChanged(recalcValue(100)); } void KGameProgress::rangeChange() { - repaint(contentsRect(), FALSE); + repaint(contentsRect(), false); emit percentageChanged(recalcValue(100)); } diff --git a/lskat/lskat/KConnectEntry.cpp b/lskat/lskat/KConnectEntry.cpp index ba714b58..750a4405 100644 --- a/lskat/lskat/KConnectEntry.cpp +++ b/lskat/lskat/KConnectEntry.cpp @@ -95,7 +95,7 @@ bool KConnectEntry::SendMsg(KEMessage *msg) bool KConnectEntry::Exit() { bool result; - result=FALSE; + result=false; switch(type) { case KG_INPUTTYPE_INTERACTIVE: @@ -110,7 +110,7 @@ bool KConnectEntry::Exit() result=connect.p->Exit(); delete connect.p; break; - default: result=FALSE; + default: result=false; break; } return result; @@ -135,7 +135,7 @@ bool KConnectEntry::Init(KG_INPUTTYPE stype,int id,KEMessage *msg) connect.p=new TDEProcessConnect; result=connect.p->Init(id,msg); break; - default: result=FALSE; + default: result=false; break; } return result; diff --git a/lskat/lskat/KEInput.cpp b/lskat/lskat/KEInput.cpp index 91377f38..21c299ae 100644 --- a/lskat/lskat/KEInput.cpp +++ b/lskat/lskat/KEInput.cpp @@ -26,7 +26,7 @@ KEInput::KEInput(TQObject * parent) : TQObject(parent,0) { number_of_inputs=0; - locked=FALSE; + locked=false; previous_input=-1; next_input=-1; cTimer=0; @@ -60,9 +60,9 @@ int KEInput::QueryPrevious() bool KEInput::IsInput(int no) { - if (no>=number_of_inputs || no<0) return FALSE; - if (QueryType(no)==0) return FALSE; - return TRUE; + if (no>=number_of_inputs || no<0) return false; + if (QueryType(no)==0) return false; + return true; } // Default is the type of the current player @@ -154,7 +154,7 @@ bool KEInput::SetInputDevice(int no, KG_INPUTTYPE type,KEMessage *msg) bool KEInput::RemoveInput(int no) { bool result; - if (no>=number_of_inputs || no<0) return FALSE; + if (no>=number_of_inputs || no<0) return false; result=playerArray[no].Exit(); // shrink if last entry is removed if (no==number_of_inputs-1) @@ -169,9 +169,9 @@ bool KEInput::RemoveInput(int no) // Sets a new player and sends it a message bool KEInput::Next(int number, bool force) { - if (locked && !force) return FALSE; - if (!IsInput(number)) return FALSE; - locked=TRUE; + if (locked && !force) return false; + if (!IsInput(number)) return false; + locked=true; // printf("KEInput::Next %d OK ... lock set!!\n",number); @@ -191,7 +191,7 @@ bool KEInput::Next(int number, bool force) if (cTimer) delete cTimer; // Ouch... cTimer=new TQTimer(this); connect(cTimer,TQ_SIGNAL(timeout()),this,TQ_SLOT(slotTimerNextRemote())); - cTimer->start(K_INPUT_DELAY,TRUE); + cTimer->start(K_INPUT_DELAY,true); } else { @@ -205,14 +205,14 @@ bool KEInput::Next(int number, bool force) // delay non interactive move to allow interactive inout cTimer=new TQTimer(this); connect(cTimer,TQ_SIGNAL(timeout()),this,TQ_SLOT(slotTimerNextProcess())); - cTimer->start(K_INPUT_DELAY,TRUE); + cTimer->start(K_INPUT_DELAY,true); } else playerArray[number].QueryProcessConnect()->Next(); break; - default: return FALSE; + default: return false; } - return TRUE; + return true; } void KEInput::slotTimerNextRemote() @@ -263,20 +263,20 @@ bool KEInput::SetInput(KEMessage *msg,int number) /* if (!locked) { - printf("KEINput:SetInput not locked(should be) returning FALSE\n"); - return FALSE; + printf("KEINput:SetInput not locked(should be) returning false\n"); + return false; } */ if (number<0 || number>=number_of_inputs) number=next_input; // automatically select player // KEMessage *mMsg= new KEMessage; // evt if (mMsg) delete mMsg; // *mMsg=*msg; - // locked=FALSE; + // locked=false; // printf("**** KEInput: emitting signalReceiveInput 474\n"); emit signalReceiveInput(msg,number); // emit signalReceiveInput(mMsg); // delete mMsg; - return TRUE; + return true; } void KEInput::Lock() diff --git a/lskat/lskat/KRemoteConnect.cpp b/lskat/lskat/KRemoteConnect.cpp index d3310324..f8c91e70 100644 --- a/lskat/lskat/KRemoteConnect.cpp +++ b/lskat/lskat/KRemoteConnect.cpp @@ -108,8 +108,8 @@ bool tryserver; if (!kSocket) return false; if (kSocket->socket()!=-1) // success { - kSocket->enableRead(TRUE); - //kSocket->enableWrite(TRUE); + kSocket->enableRead(true); + //kSocket->enableWrite(true); connect(kSocket,TQ_SIGNAL(closeEvent(TDESocket *)), this,TQ_SLOT(socketClosed(TDESocket *))); connect(kSocket,TQ_SIGNAL(readEvent(TDESocket *)), @@ -204,8 +204,8 @@ void KRemoteConnect::socketRequest(TDESocket *sock) kSocket=sock; if (kSocket->socket()!=-1) // success { - kSocket->enableRead(TRUE); - //kSocket->enableWrite(TRUE); + kSocket->enableRead(true); + //kSocket->enableWrite(true); connect(kSocket,TQ_SIGNAL(closeEvent(TDESocket *)), this,TQ_SLOT(socketClosed(TDESocket *))); connect(kSocket,TQ_SIGNAL(readEvent(TDESocket *)), diff --git a/lskat/lskat/TDEProcessConnect.cpp b/lskat/lskat/TDEProcessConnect.cpp index 286e6942..541a84a2 100644 --- a/lskat/lskat/TDEProcessConnect.cpp +++ b/lskat/lskat/TDEProcessConnect.cpp @@ -84,7 +84,7 @@ bool TDEProcessConnect::Init(int id,KEMessage *msg) this, TQ_SLOT(slotWroteStdin(TDEProcess *))); */ - // TRUE if ok + // true if ok running=process->start(TDEProcess::NotifyOnExit,TDEProcess::All); if (running && msg && msg->QueryNumberOfKeys()>0) diff --git a/lskat/lskat/lskatview.cpp b/lskat/lskat/lskatview.cpp index c206e108..f78967cd 100644 --- a/lskat/lskat/lskatview.cpp +++ b/lskat/lskat/lskatview.cpp @@ -125,7 +125,7 @@ LSkatView::LSkatView(TQWidget *parent, const char *name) : TQWidget(parent, name introTimer=new TQTimer(this); introTimer->stop(); connect(introTimer,TQ_SIGNAL(timeout()),this,TQ_SLOT(introTimerReady())); - introTimer->start(75,FALSE); + introTimer->start(75,false); for (int i=0;iGetCard(player,mx+4*my,getDocument()->GetHeight(player,mx+4*my)); introTimer->stop(); - moveTimer->start(MOVE_TIMER_DELAY,FALSE); + moveTimer->start(MOVE_TIMER_DELAY,false); cardmovecnt=0; cardorigin=calcCardPos(mx,my+2*player); if (getDocument()->GetCurrentPlayer()==0) diff --git a/lskat/lskat/msgdlg.cpp b/lskat/lskat/msgdlg.cpp index 4788318b..fa9692cc 100644 --- a/lskat/lskat/msgdlg.cpp +++ b/lskat/lskat/msgdlg.cpp @@ -38,7 +38,7 @@ // Create the dialog for changing the player names MsgDlg::MsgDlg( TQWidget *parent, const char *name,const char * /*sufi */ ) - : TQDialog( parent, name,TRUE ) + : TQDialog( parent, name,true ) { setCaption(i18n("Send Message to Remote Player")); setMinimumSize(400,160); @@ -58,12 +58,12 @@ MsgDlg::MsgDlg( TQWidget *parent, const char *name,const char * /*sufi */ ) PushButton = new TQPushButton( i18n("Send" ), this, "PushButton_1" ); PushButton->setGeometry( 20, 120, 65, 30 ); connect( PushButton, TQ_SIGNAL(clicked()), TQ_SLOT(accept()) ); - PushButton->setAutoRepeat( FALSE ); + PushButton->setAutoRepeat( false ); PushButton = new KPushButton( KStdGuiItem::cancel(), this, "PushButton_2" ); PushButton->setGeometry( 305, 120, 65, 30 ); connect( PushButton, TQ_SIGNAL(clicked()), TQ_SLOT(reject()) ); - PushButton->setAutoRepeat( FALSE ); + PushButton->setAutoRepeat( false ); } TQString MsgDlg::GetMsg() diff --git a/lskat/lskat/namedlg.cpp b/lskat/lskat/namedlg.cpp index 2cbe6ef1..1f9ae93f 100644 --- a/lskat/lskat/namedlg.cpp +++ b/lskat/lskat/namedlg.cpp @@ -23,7 +23,7 @@ * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to - * TRUE to construct a modal dialog. + * true to construct a modal dialog. */ NameDlg::NameDlg( TQWidget *parent, const char *name,bool /* modal */, WFlags /* fl */ ) : KDialogBase( Plain, i18n("Configure Names"), Ok|Cancel, Ok, diff --git a/lskat/lskat/namedlg.h b/lskat/lskat/namedlg.h index 16c09398..4aff2fde 100644 --- a/lskat/lskat/namedlg.h +++ b/lskat/lskat/namedlg.h @@ -24,7 +24,7 @@ class NameDlg : public KDialogBase public: - NameDlg( TQWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 ); + NameDlg( TQWidget* parent = 0, const char* name = 0, bool modal = true, WFlags fl = 0 ); ~NameDlg(); void SetNames(TQString n1,TQString n2); void GetNames(TQString &n1,TQString &n2); diff --git a/lskat/lskat/networkdlg.cpp b/lskat/lskat/networkdlg.cpp index 12b19569..6e0b003e 100644 --- a/lskat/lskat/networkdlg.cpp +++ b/lskat/lskat/networkdlg.cpp @@ -26,7 +26,7 @@ extern const char* LSKAT_SERVICE; // Create the dialog NetworkDlg::NetworkDlg( TQWidget *parent, const char *name ) - : NetworkDlgBase( parent, name, TRUE ) + : NetworkDlgBase( parent, name, true ) { browser = new DNSSD::ServiceBrowser(TQString::fromLatin1(LSKAT_SERVICE)); connect(browser,TQ_SIGNAL(finished()),TQ_SLOT(gamesFound())); diff --git a/tdefifteen/src/gameboard.cpp b/tdefifteen/src/gameboard.cpp index 0fb2084c..d3f9d6de 100644 --- a/tdefifteen/src/gameboard.cpp +++ b/tdefifteen/src/gameboard.cpp @@ -59,7 +59,7 @@ GameBoard::GameBoard(TQWidget *parent, const char *name) tmr = new TQTimer(this); TQObject::connect(tmr, TQ_SIGNAL(timeout()), this, TQ_SLOT(moveItem())); - setEnabled(TRUE); + setEnabled(true); origin = xpm; } @@ -331,7 +331,7 @@ GameBoard::checkEndGame() if (n == 15) { txt = tr("Game Over"); TQMessageBox::information(this, txt, txt); - setEnabled(FALSE); + setEnabled(false); } } @@ -339,7 +339,7 @@ GameBoard::checkEndGame() void GameBoard::newGame() { - setEnabled(TRUE); + setEnabled(true); initMap(); newTask(); }