Replace TRUE/FALSE with boolean values true/false

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/50/head
Michele Calgaro 5 months ago
parent e36f7dafae
commit 66230b1cca
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -641,7 +641,7 @@ void KAstTopLevel::doStats()
.arg(view->shots() - view->hits()) .arg(view->shots() - view->hits())
.arg(r); .arg(r);
view->showText( s, green, FALSE ); view->showText( s, green, false );
} }
void KAstTopLevel::slotUpdateVitals() void KAstTopLevel::slotUpdateVitals()

@ -43,7 +43,7 @@ public:
void brake( bool b ); void brake( bool b );
void pause( bool p); 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(); void hideText();
int shots() const { return shotsFired; } int shots() const { return shotsFired; }

@ -698,11 +698,11 @@ bool KBgEngineOffline::queryClose()
i18n("In the middle of a game. " i18n("In the middle of a game. "
"Really quit?"), TQString(), KStdGuiItem::quit())) { "Really quit?"), TQString(), KStdGuiItem::quit())) {
case KMessageBox::Continue : case KMessageBox::Continue :
return TRUE; return true;
case KMessageBox::Cancel : case KMessageBox::Cancel :
return FALSE; return false;
default: // cancel default: // cancel
return FALSE; return false;
} }
return true; return true;
} }

@ -104,7 +104,7 @@ KBBGame::KBBGame()
/* /*
Game initializations Game initializations
*/ */
running = FALSE; running = false;
gameBoard = NULL; gameBoard = NULL;
TDEConfig *kConf; TDEConfig *kConf;
@ -141,7 +141,7 @@ KBBGame::KBBGame()
} }
if (kConf->hasKey( "tutorial" )) { if (kConf->hasKey( "tutorial" )) {
tutorial = (bool) kConf->readNumEntry( "tutorial" ); tutorial = (bool) kConf->readNumEntry( "tutorial" );
} else tutorial = FALSE; } else tutorial = false;
tutorialAction->setChecked(tutorial); tutorialAction->setChecked(tutorial);
setCentralWidget( gr ); setCentralWidget( gr );
@ -298,11 +298,11 @@ void KBBGame::newGame()
randomBalls( balls ); randomBalls( balls );
remap( gameBoard, gr->getGraphicBoard() ); remap( gameBoard, gr->getGraphicBoard() );
gr->repaint( TRUE ); gr->repaint( true );
setScore( 0 ); setScore( 0 );
detourCounter = -1; detourCounter = -1;
ballsPlaced = 0; ballsPlaced = 0;
running = TRUE; running = true;
updateStats(); updateStats();
emit gameRuns( running ); emit gameRuns( running );
} }
@ -370,7 +370,7 @@ void KBBGame::getResults()
void KBBGame::abortGame() void KBBGame::abortGame()
{ {
if (running) { if (running) {
running = FALSE; running = false;
ballsPlaced = 0; ballsPlaced = 0;
updateStats(); updateStats();
gr->clearFocus(); gr->clearFocus();
@ -437,7 +437,7 @@ void KBBGame::setScore( int n )
bool KBBGame::setSize( int w, int h ) bool KBBGame::setSize( int w, int h )
{ {
bool ok = FALSE; bool ok = false;
if (((w+4) != gr->numC()) || ((h+4) != gr->numR())) { if (((w+4) != gr->numC()) || ((h+4) != gr->numR())) {
if (running) { if (running) {
ok = KMessageBox::warningContinueCancel(0, 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")) "This will be the end of the current game!"),TQString(),i18n("End Game"))
== KMessageBox::Continue; == KMessageBox::Continue;
} else ok = TRUE; } else ok = true;
if (ok) { if (ok) {
gr->setSize( w+4, h+4 ); // +4 is the space for "lasers" and an edge... gr->setSize( w+4, h+4 ); // +4 is the space for "lasers" and an edge...
setMinSize(); setMinSize();
@ -454,7 +454,7 @@ bool KBBGame::setSize( int w, int h )
gameBoard = new RectOnArray( gr->numC(), gr->numR() ); gameBoard = new RectOnArray( gr->numC(), gr->numR() );
if (running) abortGame(); if (running) abortGame();
newGame(); newGame();
// gr->repaint( TRUE ); // gr->repaint( true );
} }
} }
return ok; return ok;
@ -466,13 +466,13 @@ bool KBBGame::setSize( int w, int h )
bool KBBGame::setBalls( int n ) bool KBBGame::setBalls( int n )
{ {
bool ok = FALSE; bool ok = false;
if (balls != n) { if (balls != n) {
if (running) { if (running) {
ok = KMessageBox::warningContinueCancel(0, ok = KMessageBox::warningContinueCancel(0,
i18n("This will be the end of the current game!"),TQString(),i18n("End Game")) i18n("This will be the end of the current game!"),TQString(),i18n("End Game"))
== KMessageBox::Continue; == KMessageBox::Continue;
} else ok = TRUE; } else ok = true;
if (ok) { if (ok) {
balls = n; balls = n;
if (running) abortGame(); if (running) abortGame();
@ -551,7 +551,7 @@ int KBBGame::traceRay( int startX, int startY, int *endX, int *endY )
sly = 1; scy = 0; sry = -1; sly = 1; scy = 0; sry = -1;
break; break;
} }
directionChanged = FALSE; directionChanged = false;
if (gameBoard->get( x+scx, y+scy ) == LASERBBT) { if (gameBoard->get( x+scx, y+scy ) == LASERBBT) {
type = DETOUR; type = DETOUR;
*endX = x+scx; *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) { if (gameBoard->get( x+slx, y+sly ) == BALLBBT) {
type = REFLECTION; type = REFLECTION;
if (gameBoard->get( x, y ) == LASERBBT) break; if (gameBoard->get( x, y ) == LASERBBT) break;
directionChanged = TRUE; directionChanged = true;
refl += 1; refl += 1;
} }
if (gameBoard->get( x+srx, y+sry ) == BALLBBT) { if (gameBoard->get( x+srx, y+sry ) == BALLBBT) {
type = REFLECTION; type = REFLECTION;
if (gameBoard->get( x, y ) == LASERBBT) break; if (gameBoard->get( x, y ) == LASERBBT) break;
directionChanged = TRUE; directionChanged = true;
refl +=2; refl +=2;
} }
// turn to the right // turn to the right

@ -32,7 +32,7 @@ KBBGraphic::KBBGraphic( TQPixmap **p, TQWidget* parent, const char* name )
setBackgroundColor( gray ); setBackgroundColor( gray );
setCellWidth( CELLW ); // set width of cell in pixels setCellWidth( CELLW ); // set width of cell in pixels
setCellHeight( CELLH ); // set height of cell in pixels setCellHeight( CELLH ); // set height of cell in pixels
setMouseTracking( FALSE ); setMouseTracking( false );
pix = p; pix = p;
if (pix == NULL) pixScaled = NULL; if (pix == NULL) pixScaled = NULL;
@ -434,7 +434,7 @@ void KBBGraphic::moveSelection(int drow, int dcol)
void KBBGraphic::focusInEvent( TQFocusEvent* ) void KBBGraphic::focusInEvent( TQFocusEvent* )
{ {
repaint( FALSE ); repaint( false );
} }
@ -444,7 +444,7 @@ void KBBGraphic::focusInEvent( TQFocusEvent* )
void KBBGraphic::focusOutEvent( TQFocusEvent* ) void KBBGraphic::focusOutEvent( TQFocusEvent* )
{ {
repaint( FALSE ); repaint( false );
} }
/* /*

@ -218,7 +218,7 @@ void KJezzball::pauseGame()
void KJezzball::gameOver() void KJezzball::gameOver()
{ {
stopLevel(); stopLevel();
m_gameOverTimer->start( 100, TRUE ); m_gameOverTimer->start( 100, true );
} }
@ -436,7 +436,7 @@ void KJezzball::stopLevel()
void KJezzball::nextLevel() void KJezzball::nextLevel()
{ {
stopLevel(); stopLevel();
m_nextLevelTimer->start( 100, TRUE ); m_nextLevelTimer->start( 100, true );
} }
void KJezzball::switchLevel() void KJezzball::switchLevel()

@ -424,7 +424,7 @@ void AbTop::setupStatusBar()
connect( spyPopup, TQ_SIGNAL(activated(int)), connect( spyPopup, TQ_SIGNAL(activated(int)),
this, TQ_SLOT(setSpy(int)) ); this, TQ_SLOT(setSpy(int)) );
tb->insertButton(spy0, 30, spyPopup, tb->insertButton(spy0, 30, spyPopup,
TRUE, i18n("Spy")); true, i18n("Spy"));
} }
#endif #endif
@ -608,7 +608,7 @@ void AbTop::timerDone()
return; return;
} }
timerState++; timerState++;
timer->start(interval,TRUE); timer->start(interval,true);
} }
void AbTop::userMove() void AbTop::userMove()

@ -52,9 +52,9 @@ BoardWidget::BoardWidget(Board& b, TQWidget *parent, const char *name)
#define createCursor(bitmap,name) \ #define createCursor(bitmap,name) \
static TQBitmap bitmap(bitmap##_width, bitmap##_height, \ 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, \ 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); name = new TQCursor(bitmap, bitmap##Mask, bitmap##_x_hot, bitmap##_y_hot);
createCursor(Arrow1, arrow[1]); createCursor(Arrow1, arrow[1]);

@ -38,7 +38,7 @@ EvalDlgImpl::EvalDlgImpl(TQWidget* parent, Board* board)
for(int i=0;i<list.count();i++) for(int i=0;i<list.count();i++)
evalList->insertItem(list[i]); evalList->insertItem(list[i]);
evalList->setSelected(0, TRUE); evalList->setSelected(0, true);
updateWidgets(); updateWidgets();
connectEditLines(); connectEditLines();
@ -261,7 +261,7 @@ void EvalDlgImpl::saveas()
list << name; list << name;
config->writeEntry("EvalSchemes", list); config->writeEntry("EvalSchemes", list);
} }
evalList->setSelected(it, TRUE); evalList->setSelected(it, true);
EvalScheme savedScheme(*_scheme); EvalScheme savedScheme(*_scheme);
savedScheme.setName(name); savedScheme.setName(name);

@ -30,7 +30,7 @@ Network::Network(int port)
struct sockaddr_in name; struct sockaddr_in name;
int i,j; int i,j;
listeners.setAutoDelete(TRUE); listeners.setAutoDelete(true);
fd = ::socket (PF_INET, SOCK_STREAM, 0); fd = ::socket (PF_INET, SOCK_STREAM, 0);
if (fd<0) return; if (fd<0) return;

@ -42,12 +42,12 @@ KGoldrunner::KGoldrunner()
/******************************************************************************/ /******************************************************************************/
// Avoid "saveOK()" check if an error-exit occurs during the file checks. // 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. // Get directory paths for the system levels, user levels and manual.
if (! getDirectories()) { if (! getDirectories()) {
fprintf (stderr, "getDirectories() FAILED\n"); fprintf (stderr, "getDirectories() FAILED\n");
startupOK = FALSE; startupOK = false;
return; // If games directory not found, abort. return; // If games directory not found, abort.
} }
@ -65,7 +65,7 @@ KGoldrunner::KGoldrunner()
// Initialise the collections of levels (i.e. the list of games). // Initialise the collections of levels (i.e. the list of games).
if (! game->initCollections()) { if (! game->initCollections()) {
startupOK = FALSE; startupOK = false;
return; // If no game files, abort. return; // If no game files, abort.
} }
@ -107,7 +107,7 @@ KGoldrunner::KGoldrunner()
if (dw > 1024) { // More than 1024x768. if (dw > 1024) { // More than 1024x768.
view->changeSize (+1); view->changeSize (+1);
view->changeSize (+1); // Scale 1.75: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. view->setBaseScale(); // Set scale for level-names.
#endif #endif
@ -115,16 +115,16 @@ KGoldrunner::KGoldrunner()
makeEditToolbar(); // Uses pixmaps from "view". makeEditToolbar(); // Uses pixmaps from "view".
editToolbar->hide(); editToolbar->hide();
setDockEnabled (DockBottom, FALSE); setDockEnabled (DockBottom, false);
setDockEnabled (DockLeft, FALSE); setDockEnabled (DockLeft, false);
setDockEnabled (DockRight, FALSE); setDockEnabled (DockRight, false);
// Make it impossible to turn off the editor toolbar. // Make it impossible to turn off the editor toolbar.
// Accidentally hiding it would make editing impossible. // Accidentally hiding it would make editing impossible.
setDockMenuEnabled (FALSE); setDockMenuEnabled (false);
// Set mouse control of the hero as the default. // 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). // Paint the main widget (title, menu, status bar, blank playfield).
show(); show();
@ -251,7 +251,7 @@ void KGoldrunner::setupActions()
0, 0,
game, TQ_SLOT(saveLevelFile()), actionCollection(), game, TQ_SLOT(saveLevelFile()), actionCollection(),
"save_edits"); "save_edits");
saveEdits->setEnabled (FALSE); // Nothing to save, yet. saveEdits->setEnabled (false); // Nothing to save, yet.
(void) new TDEAction ( (void) new TDEAction (
i18n("&Move Level..."), i18n("&Move Level..."),
@ -318,7 +318,7 @@ void KGoldrunner::setupActions()
setIceCave-> setExclusiveGroup ("landscapes"); setIceCave-> setExclusiveGroup ("landscapes");
setMidnight-> setExclusiveGroup ("landscapes"); setMidnight-> setExclusiveGroup ("landscapes");
setKDEKool-> setExclusiveGroup ("landscapes"); setKDEKool-> setExclusiveGroup ("landscapes");
setKGoldrunner-> setChecked (TRUE); setKGoldrunner-> setChecked (true);
/**************************************************************************/ /**************************************************************************/
/**************************** SETTINGS MENU ****************************/ /**************************** SETTINGS MENU ****************************/
@ -343,7 +343,7 @@ void KGoldrunner::setupActions()
setMouse-> setExclusiveGroup ("control"); setMouse-> setExclusiveGroup ("control");
setKeyboard-> setExclusiveGroup ("control"); setKeyboard-> setExclusiveGroup ("control");
setMouse-> setChecked (TRUE); setMouse-> setChecked (true);
// Normal Speed // Normal Speed
// Beginner Speed // Beginner Speed
@ -381,7 +381,7 @@ void KGoldrunner::setupActions()
nSpeed-> setExclusiveGroup ("speed"); nSpeed-> setExclusiveGroup ("speed");
bSpeed-> setExclusiveGroup ("speed"); bSpeed-> setExclusiveGroup ("speed");
cSpeed-> setExclusiveGroup ("speed"); cSpeed-> setExclusiveGroup ("speed");
nSpeed-> setChecked (TRUE); nSpeed-> setChecked (true);
// Traditional Rules // Traditional Rules
// KGoldrunner Rules // KGoldrunner Rules
@ -400,7 +400,7 @@ void KGoldrunner::setupActions()
tradRules-> setExclusiveGroup ("rules"); tradRules-> setExclusiveGroup ("rules");
kgrRules-> setExclusiveGroup ("rules"); kgrRules-> setExclusiveGroup ("rules");
tradRules-> setChecked (TRUE); tradRules-> setChecked (true);
// Larger Playing Area // Larger Playing Area
// Smaller Playing Area // Smaller Playing Area
@ -507,7 +507,7 @@ void KGoldrunner::initStatusBar()
int i = statusBar()->fontInfo().pointSize(); int i = statusBar()->fontInfo().pointSize();
statusBar()->setFont (TQFont (s, i, TQFont::Bold)); 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_LIVES);
statusBar()->insertItem ("", ID_SCORE); statusBar()->insertItem ("", ID_SCORE);
@ -518,12 +518,12 @@ void KGoldrunner::initStatusBar()
showLives (5); // Start with 5 lives. showLives (5); // Start with 5 lives.
showScore (0); showScore (0);
showLevel (0); showLevel (0);
adjustHintAction (FALSE); adjustHintAction (false);
// Set the PAUSE/RESUME key-names into the status bar message. // Set the PAUSE/RESUME key-names into the status bar message.
pauseKeys = myPause->shortcut().toString(); pauseKeys = myPause->shortcut().toString();
pauseKeys = pauseKeys.replace (';', "\" " + i18n("or") + " \""); pauseKeys = pauseKeys.replace (';', "\" " + i18n("or") + " \"");
gameFreeze (FALSE); gameFreeze (false);
statusBar()->setItemFixed (ID_LIVES, -1); // Fix current sizes. statusBar()->setItemFixed (ID_LIVES, -1); // Fix current sizes.
statusBar()->setItemFixed (ID_SCORE, -1); 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. // Local slots to set mouse or keyboard control of the hero.
void KGoldrunner::setMouseMode() {game->setMouseMode (TRUE);} void KGoldrunner::setMouseMode() {game->setMouseMode (true);}
void KGoldrunner::setKeyBoardMode() {game->setMouseMode (FALSE);} void KGoldrunner::setKeyBoardMode() {game->setMouseMode (false);}
// Local slots to set game speed. // Local slots to set game speed.
@ -661,19 +661,19 @@ void KGoldrunner::decSpeed() {hero->setSpeed (-1);}
void KGoldrunner::setTradRules() void KGoldrunner::setTradRules()
{ {
KGrFigure::variableTiming = TRUE; KGrFigure::variableTiming = true;
KGrFigure::alwaysCollectNugget = TRUE; KGrFigure::alwaysCollectNugget = true;
KGrFigure::runThruHole = TRUE; KGrFigure::runThruHole = true;
KGrFigure::reappearAtTop = TRUE; KGrFigure::reappearAtTop = true;
KGrFigure::searchStrategy = LOW; KGrFigure::searchStrategy = LOW;
} }
void KGoldrunner::setKGrRules() void KGoldrunner::setKGrRules()
{ {
KGrFigure::variableTiming = FALSE; KGrFigure::variableTiming = false;
KGrFigure::alwaysCollectNugget = FALSE; KGrFigure::alwaysCollectNugget = false;
KGrFigure::runThruHole = FALSE; KGrFigure::runThruHole = false;
KGrFigure::reappearAtTop = FALSE; KGrFigure::reappearAtTop = false;
KGrFigure::searchStrategy = MEDIUM; KGrFigure::searchStrategy = MEDIUM;
} }
@ -819,7 +819,7 @@ void KGoldrunner::changeCaption(const TQString& text)
bool KGoldrunner::getDirectories() bool KGoldrunner::getDirectories()
{ {
bool result = TRUE; bool result = true;
// WHERE THINGS ARE: In the KDE 3 environment (Release 3.1.1), application // WHERE THINGS ARE: In the KDE 3 environment (Release 3.1.1), application
// documentation and data files are in a directory structure given by // 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/' " i18n("Cannot find documentation sub-folder 'en/%1/' "
"in area '%2' of the TDE folder ($TDEDIRS).") "in area '%2' of the TDE folder ($TDEDIRS).")
.arg(myDir).arg(dirs->kde_default ("html"))); .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 else
systemHTMLDir.append ("en/" + myDir + "/"); systemHTMLDir.append ("en/" + myDir + "/");
@ -862,20 +862,20 @@ bool KGoldrunner::getDirectories()
i18n("Cannot find system games sub-folder '%1/system/' " i18n("Cannot find system games sub-folder '%1/system/' "
"in area '%2' of the TDE folder ($TDEDIRS).") "in area '%2' of the TDE folder ($TDEDIRS).")
.arg(myDir).arg(dirs->kde_default ("data"))); .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 else
systemDataDir.append (myDir + "/system/"); systemDataDir.append (myDir + "/system/");
// Locate and optionally create directories for user collections and levels. // Locate and optionally create directories for user collections and levels.
bool create = TRUE; bool create = true;
userDataDir = dirs->saveLocation ("data", myDir + "/user/", create); userDataDir = dirs->saveLocation ("data", myDir + "/user/", create);
if (userDataDir.length() <= 0) { if (userDataDir.length() <= 0) {
KGrMessage::information (this, i18n("Get Folders"), KGrMessage::information (this, i18n("Get Folders"),
i18n("Cannot find or create user games sub-folder '%1/user/' " i18n("Cannot find or create user games sub-folder '%1/user/' "
"in area '%2' of the TDE user area ($TDEHOME).") "in area '%2' of the TDE user area ($TDEHOME).")
.arg(myDir).arg(dirs->kde_default ("data"))); .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 { else {
create = dirs->makeDir (userDataDir + "levels/"); create = dirs->makeDir (userDataDir + "levels/");
@ -883,7 +883,7 @@ bool KGoldrunner::getDirectories()
KGrMessage::information (this, i18n("Get Folders"), KGrMessage::information (this, i18n("Get Folders"),
i18n("Cannot find or create 'levels/' folder in " i18n("Cannot find or create 'levels/' folder in "
"sub-folder '%1/user/' in the TDE user area ($TDEHOME).").arg(myDir)); "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 () bool KGoldrunner::queryClose ()
{ {
// Last chance to save: user has clicked "X" widget or menu-Quit. // Last chance to save: user has clicked "X" widget or menu-Quit.
bool cannotContinue = TRUE; bool cannotContinue = true;
game->saveOK (cannotContinue); game->saveOK (cannotContinue);
return (TRUE); return (true);
} }
void KGoldrunner::setKey (KBAction movement) void KGoldrunner::setKey (KBAction movement)
@ -908,7 +908,7 @@ void KGoldrunner::setKey (KBAction movement)
// Using keyboard control can automatically disable mouse control. // Using keyboard control can automatically disable mouse control.
if (game->inMouseMode()) { if (game->inMouseMode()) {
// Halt the game while a message is displayed. // Halt the game while a message is displayed.
game->setMessageFreeze (TRUE); game->setMessageFreeze (true);
switch (KGrMessage::warning (this, i18n("Switch to Keyboard Mode"), switch (KGrMessage::warning (this, i18n("Switch to Keyboard Mode"),
i18n("You have pressed a key that can be used to move the " 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!"), "- like riding a bike rather than walking!"),
i18n("Switch to &Keyboard Mode"), i18n("Stay in &Mouse Mode"))) i18n("Switch to &Keyboard Mode"), i18n("Stay in &Mouse Mode")))
{ {
case 0: game->setMouseMode (FALSE); // Set internal mouse mode OFF. case 0: game->setMouseMode (false); // Set internal mouse mode OFF.
setMouse->setChecked (FALSE); // Adjust the Settings menu. setMouse->setChecked (false); // Adjust the Settings menu.
setKeyboard->setChecked (TRUE); setKeyboard->setChecked (true);
break; break;
case 1: break; case 1: break;
} }
// Unfreeze the game, but only if it was previously unfrozen. // Unfreeze the game, but only if it was previously unfrozen.
game->setMessageFreeze (FALSE); game->setMessageFreeze (false);
if (game->inMouseMode()) if (game->inMouseMode())
return; // Stay in Mouse Mode. return; // Stay in Mouse Mode.
@ -987,77 +987,77 @@ void KGoldrunner::makeEditToolbar()
edenemybg = edenemybg.xForm (w); 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. // Choose a colour that enhances visibility of the KGoldrunner pixmaps.
// editToolbar->setPalette (TQPalette (TQColor (150, 150, 230))); // 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 // 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->insertSeparator();
editToolbar->insertButton ("document-new", 0, TQ_SIGNAL(clicked()), game, 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, 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, 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->insertSeparator(); editToolbar->insertSeparator();
editToolbar->insertButton ("ktip", 3, TQ_SIGNAL(clicked()), game, 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->insertSeparator(); editToolbar->insertSeparator();
editToolbar->insertButton (freebg, (int)FREE, TQ_SIGNAL(clicked()), this, 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->insertSeparator();
editToolbar->insertButton (edherobg, (int)HERO, TQ_SIGNAL(clicked()), this, editToolbar->insertButton (edherobg, (int)HERO, TQ_SIGNAL(clicked()), this,
TQ_SLOT (edheroSlot()), TRUE, i18n("Hero")); TQ_SLOT (edheroSlot()), true, i18n("Hero"));
editToolbar->insertSeparator(); editToolbar->insertSeparator();
editToolbar->insertButton (edenemybg, (int)ENEMY, TQ_SIGNAL(clicked()), this, editToolbar->insertButton (edenemybg, (int)ENEMY, TQ_SIGNAL(clicked()), this,
TQ_SLOT (edenemySlot()), TRUE, i18n("Enemy")); TQ_SLOT (edenemySlot()), true, i18n("Enemy"));
editToolbar->insertSeparator(); editToolbar->insertSeparator();
editToolbar->insertButton (brickbg, (int)BRICK, TQ_SIGNAL(clicked()), this, 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->insertSeparator();
editToolbar->insertButton (betonbg, (int)BETON, TQ_SIGNAL(clicked()), this, 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->insertSeparator();
editToolbar->insertButton (fbrickbg, (int)FBRICK, TQ_SIGNAL(clicked()), this, 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->insertSeparator();
editToolbar->insertButton (ladderbg, (int)LADDER, TQ_SIGNAL(clicked()), this, editToolbar->insertButton (ladderbg, (int)LADDER, TQ_SIGNAL(clicked()), this,
TQ_SLOT (ladderSlot()), TRUE, i18n("Ladder")); TQ_SLOT (ladderSlot()), true, i18n("Ladder"));
editToolbar->insertSeparator(); editToolbar->insertSeparator();
editToolbar->insertButton (hladderbg, (int)HLADDER, TQ_SIGNAL(clicked()), this, 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->insertSeparator();
editToolbar->insertButton (polebg, (int)POLE, TQ_SIGNAL(clicked()), this, 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->insertSeparator();
editToolbar->insertButton (nuggetbg, (int)NUGGET, TQ_SIGNAL(clicked()), this, editToolbar->insertButton (nuggetbg, (int)NUGGET, TQ_SIGNAL(clicked()), this,
TQ_SLOT (nuggetSlot()), TRUE, i18n("Gold nugget")); TQ_SLOT (nuggetSlot()), true, i18n("Gold nugget"));
editToolbar->setToggle ((int) FREE, TRUE); editToolbar->setToggle ((int) FREE, true);
editToolbar->setToggle ((int) HERO, TRUE); editToolbar->setToggle ((int) HERO, true);
editToolbar->setToggle ((int) ENEMY, TRUE); editToolbar->setToggle ((int) ENEMY, true);
editToolbar->setToggle ((int) BRICK, TRUE); editToolbar->setToggle ((int) BRICK, true);
editToolbar->setToggle ((int) BETON, TRUE); editToolbar->setToggle ((int) BETON, true);
editToolbar->setToggle ((int) FBRICK, TRUE); editToolbar->setToggle ((int) FBRICK, true);
editToolbar->setToggle ((int) LADDER, TRUE); editToolbar->setToggle ((int) LADDER, true);
editToolbar->setToggle ((int) HLADDER, TRUE); editToolbar->setToggle ((int) HLADDER, true);
editToolbar->setToggle ((int) POLE, TRUE); editToolbar->setToggle ((int) POLE, true);
editToolbar->setToggle ((int) NUGGET, TRUE); editToolbar->setToggle ((int) NUGGET, true);
pressedButton = (int) BRICK; pressedButton = (int) BRICK;
editToolbar->setButton (pressedButton, TRUE); editToolbar->setButton (pressedButton, true);
} }
/******************************************************************************/ /******************************************************************************/
@ -1089,9 +1089,9 @@ void KGoldrunner::defaultEditObj()
void KGoldrunner::setButton (int btn) void KGoldrunner::setButton (int btn)
{ {
editToolbar->setButton (pressedButton, FALSE); editToolbar->setButton (pressedButton, false);
pressedButton = btn; pressedButton = btn;
editToolbar->setButton (pressedButton, TRUE); editToolbar->setButton (pressedButton, true);
} }
#include "kgoldrunner.moc" #include "kgoldrunner.moc"

@ -107,14 +107,14 @@ bool KGrCanvas::changeSize (int d)
// Note: Smaller scales lose detail (e.g. the joints in brickwork). // Note: Smaller scales lose detail (e.g. the joints in brickwork).
KGrMessage::information (this, i18n("Change Size"), KGrMessage::information (this, i18n("Change Size"),
i18n("Sorry, you cannot make the play area any smaller.")); i18n("Sorry, you cannot make the play area any smaller."));
return FALSE; return false;
} }
if ((d >= 0) && (scaleStep >= 2 * STEP)) { if ((d >= 0) && (scaleStep >= 2 * STEP)) {
// Note: Larger scales go off the edge of the monitor. // Note: Larger scales go off the edge of the monitor.
KGrMessage::information (this, i18n("Change Size"), KGrMessage::information (this, i18n("Change Size"),
i18n("Sorry, you cannot make the play area any larger.")); i18n("Sorry, you cannot make the play area any larger."));
return FALSE; return false;
} }
TQWMatrix wm = worldMatrix(); TQWMatrix wm = worldMatrix();
@ -140,13 +140,13 @@ bool KGrCanvas::changeSize (int d)
int frame = frameWidth()*2; int frame = frameWidth()*2;
setFixedSize ((FIELDWIDTH + 4) * 4 * scaleStep + frame, setFixedSize ((FIELDWIDTH + 4) * 4 * scaleStep + frame,
(FIELDHEIGHT + 4) * 4 * scaleStep + frame); (FIELDHEIGHT + 4) * 4 * scaleStep + frame);
return TRUE; return true;
#else #else
KGrMessage::information (this, i18n( "Change Size" ), KGrMessage::information (this, i18n( "Change Size" ),
i18n( "Sorry, you cannot change the size of the playing area. " i18n( "Sorry, you cannot change the size of the playing area. "
"That function requires TQt Library version 3 or later." )); "That function requires TQt Library version 3 or later." ));
return FALSE; return false;
#endif #endif
} }
@ -200,7 +200,7 @@ void KGrCanvas::makeTitle ()
// object does not always display scaled-up fonts cleanly (in TQt 3.1.1). // object does not always display scaled-up fonts cleanly (in TQt 3.1.1).
if (title != 0) if (title != 0)
title->close (TRUE); // Close and delete previous title. title->close (true); // Close and delete previous title.
title = new TQLabel ("", this); title = new TQLabel ("", this);
title->setFixedWidth (((FIELDWIDTH * cw + 2 * bw) * scaleStep) / STEP); title->setFixedWidth (((FIELDWIDTH * cw + 2 * bw) * scaleStep) / STEP);
@ -257,7 +257,7 @@ void KGrCanvas::makeHeroSprite (int i, int j, int startFrame)
i++; j++; i++; j++;
heroSprite->move (i * 4 * STEP, j * 4 * STEP, startFrame); heroSprite->move (i * 4 * STEP, j * 4 * STEP, startFrame);
heroSprite->setZ (1); heroSprite->setZ (1);
heroSprite->setVisible (TRUE); heroSprite->setVisible (true);
} }
void KGrCanvas::setHeroVisible (bool newState) void KGrCanvas::setHeroVisible (bool newState)
@ -471,7 +471,7 @@ void KGrCanvas::initView()
#else #else
enemySprites = new TQPtrList<TQCanvasSprite> (); enemySprites = new TQPtrList<TQCanvasSprite> ();
#endif #endif
enemySprites->setAutoDelete(TRUE); enemySprites->setAutoDelete(true);
} }
void KGrCanvas::makeTiles () void KGrCanvas::makeTiles ()

@ -30,7 +30,7 @@
KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex,
TQPtrList<KGrCollection> & gamesList, KGrGame * theGame, TQPtrList<KGrCollection> & gamesList, KGrGame * theGame,
TQWidget * parent, const char * name) TQWidget * parent, const char * name)
: TQDialog (parent, name, TRUE, : TQDialog (parent, name, true,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title) WStyle_Customize | WStyle_NormalBorder | WStyle_Title)
#else #else
KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex,
@ -71,7 +71,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex,
gameInfo->setSpacing (spacing); gameInfo->setSpacing (spacing);
collnN = new TQLabel ("", gameInfo); // Name of selected collection. collnN = new TQLabel ("", gameInfo); // Name of selected collection.
TQFont f = collnN->font(); TQFont f = collnN->font();
f.setBold (TRUE); f.setBold (true);
collnN->setFont (f); collnN->setFont (f);
collnA = new TQPushButton (i18n("More Info"), gameInfo); collnA = new TQPushButton (i18n("More Info"), gameInfo);
@ -143,7 +143,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex,
#endif #endif
// Set the default for the level-number in the scrollbar. // Set the default for the level-number in the scrollbar.
number-> setTracking (TRUE); number-> setTracking (true);
number->setValue (requestedLevel); number->setValue (requestedLevel);
slSetCollections (defaultGame); 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. case SL_START: // Must start at level 1, but can choose a collection.
OKText = i18n("Start Game"); OKText = i18n("Start Game");
number->setValue (1); number->setValue (1);
number->setEnabled(FALSE); number->setEnabled(false);
display->setEnabled(FALSE); display->setEnabled(false);
number->hide(); number->hide();
numberL->hide(); numberL->hide();
display->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. case SL_UPD_GAME: // Can only edit USER collection details.
OKText = i18n("Edit Game Info"); OKText = i18n("Edit Game Info");
number->setValue (1); number->setValue (1);
number->setEnabled(FALSE); number->setEnabled(false);
display->setEnabled(FALSE); display->setEnabled(false);
number->hide(); number->hide();
numberL->hide(); numberL->hide();
display->hide(); display->hide();
@ -227,7 +227,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex,
connect (levelNH, TQ_SIGNAL (clicked()), game, TQ_SLOT (editNameAndHint())); connect (levelNH, TQ_SIGNAL (clicked()), game, TQ_SLOT (editNameAndHint()));
} }
else { else {
levelNH->setEnabled (FALSE); levelNH->setEnabled (false);
levelNH->hide(); levelNH->hide();
} }
@ -275,7 +275,7 @@ void KGrSLDialog::slSetCollections (int cIndex)
} }
// Mark the currently selected collection (or default 0). // Mark the currently selected collection (or default 0).
colln->setCurrentItem (cIndex); colln->setCurrentItem (cIndex);
colln->setSelected (cIndex, TRUE); colln->setSelected (cIndex, true);
// Fetch and display information on the selected collection. // Fetch and display information on the selected collection.
slColln (cIndex); slColln (cIndex);
@ -293,7 +293,7 @@ void KGrSLDialog::slColln (int i)
} }
// User "highlighted" a new collection (with one click) ... // User "highlighted" a new collection (with one click) ...
colln->setSelected (i, TRUE); // One click = selected. colln->setSelected (i, true); // One click = selected.
slCollnIndex = i; slCollnIndex = i;
int n = slCollnIndex; // Collection selected. int n = slCollnIndex; // Collection selected.
int N = defaultGame; // Current collection. 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. // Move the slider when a valid level number is entered.
TQString s = text; TQString s = text;
bool ok = FALSE; bool ok = false;
int n = s.toInt (&ok); int n = s.toInt (&ok);
if (ok) { if (ok) {
number->setValue (n); number->setValue (n);
@ -487,7 +487,7 @@ void KGrSLDialog::slotHelp ()
#ifdef KGR_PORTABLE #ifdef KGR_PORTABLE
KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint,
TQWidget * parent, const char * name) TQWidget * parent, const char * name)
: TQDialog (parent, name, TRUE, : TQDialog (parent, name, true,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title) WStyle_Customize | WStyle_NormalBorder | WStyle_Title)
#else #else
KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint,
@ -574,7 +574,7 @@ KGrNHDialog::~KGrNHDialog()
KGrECDialog::KGrECDialog (int action, int collnIndex, KGrECDialog::KGrECDialog (int action, int collnIndex,
TQPtrList<KGrCollection> & gamesList, TQPtrList<KGrCollection> & gamesList,
TQWidget * parent, const char * name) TQWidget * parent, const char * name)
: TQDialog (parent, name, TRUE, : TQDialog (parent, name, true,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title) WStyle_Customize | WStyle_NormalBorder | WStyle_Title)
#else #else
KGrECDialog::KGrECDialog (int action, int collnIndex, KGrECDialog::KGrECDialog (int action, int collnIndex,
@ -661,7 +661,7 @@ KGrECDialog::KGrECDialog (int action, int collnIndex,
ecPrefix-> setText (collections.at(defaultGame)->prefix); ecPrefix-> setText (collections.at(defaultGame)->prefix);
if (collections.at(defaultGame)->nLevels > 0) { if (collections.at(defaultGame)->nLevels > 0) {
// Collection already has some levels, so cannot change the prefix. // Collection already has some levels, so cannot change the prefix.
ecPrefix-> setEnabled (FALSE); ecPrefix-> setEnabled (false);
} }
TQString s; TQString s;
#ifndef KGR_PORTABLE #ifndef KGR_PORTABLE
@ -732,12 +732,12 @@ KGrECDialog::~KGrECDialog()
void KGrECDialog::ecSetRules (const char settings) void KGrECDialog::ecSetRules (const char settings)
{ {
ecKGrB-> setChecked (FALSE); ecKGrB-> setChecked (false);
ecTradB-> setChecked (FALSE); ecTradB-> setChecked (false);
if (settings == 'K') if (settings == 'K')
ecKGrB-> setChecked (TRUE); ecKGrB-> setChecked (true);
else else
ecTradB-> setChecked (TRUE); ecTradB-> setChecked (true);
} }
void KGrECDialog::ecSetKGr () {ecSetRules ('K');} // Radio button slots. void KGrECDialog::ecSetKGr () {ecSetRules ('K');} // Radio button slots.
@ -751,7 +751,7 @@ void KGrECDialog::ecSetTrad () {ecSetRules ('T');}
KGrLGDialog::KGrLGDialog (TQFile * savedGames, KGrLGDialog::KGrLGDialog (TQFile * savedGames,
TQPtrList<KGrCollection> & collections, TQPtrList<KGrCollection> & collections,
TQWidget * parent, const char * name) TQWidget * parent, const char * name)
: TQDialog (parent, name, TRUE, : TQDialog (parent, name, true,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title) WStyle_Customize | WStyle_NormalBorder | WStyle_Title)
#else #else
KGrLGDialog::KGrLGDialog (TQFile * savedGames, KGrLGDialog::KGrLGDialog (TQFile * savedGames,
@ -784,9 +784,9 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames,
#else #else
TQFont f = TDEGlobalSettings::fixedFont(); // KDE version. TQFont f = TDEGlobalSettings::fixedFont(); // KDE version.
#endif #endif
f.setFixedPitch (TRUE); f.setFixedPitch (true);
lgList-> setFont (f); lgList-> setFont (f);
f.setBold (TRUE); f.setBold (true);
lgHeader-> setFont (f); lgHeader-> setFont (f);
mainLayout-> addWidget (lgHeader); mainLayout-> addWidget (lgHeader);
@ -825,11 +825,11 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames,
// Read the saved games into the list box. // Read the saved games into the list box.
while (! gameText.endData()) { while (! gameText.endData()) {
s = gameText.readLine(); // Read in one saved game. 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. for (i = 0; i < imax; i++) { // Get the collection name.
if (collections.at(i)->prefix == pr) { if (collections.at(i)->prefix == pr) {
s = s.insert (0, s = s.insert (0,
collections.at(i)->name.leftJustify (20, ' ', TRUE) + " "); collections.at(i)->name.leftJustify (20, ' ', true) + " ");
break; break;
} }
} }
@ -839,7 +839,7 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames,
// Mark row 0 (the most recently saved game) as the default selection. // Mark row 0 (the most recently saved game) as the default selection.
lgList-> setCurrentItem (0); lgList-> setCurrentItem (0);
lgList-> setSelected (0, TRUE); lgList-> setSelected (0, true);
lgHighlight = 0; lgHighlight = 0;
connect (lgList, TQ_SIGNAL (highlighted (int)), this, TQ_SLOT (lgSelect (int))); 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 #ifndef KGR_PORTABLE
KMessageBox::information (parent, contents, title); KMessageBox::information (parent, contents, title);
#else #else
TQDialog * mm = new TQDialog (parent, "wrappedMessage", TRUE, TQDialog * mm = new TQDialog (parent, "wrappedMessage", true,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title); WStyle_Customize | WStyle_NormalBorder | WStyle_Title);
int margin = 10; int margin = 10;
@ -951,7 +951,7 @@ void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents)
mle-> setFrameStyle (TQFrame::NoFrame); mle-> setFrameStyle (TQFrame::NoFrame);
mle-> setAlignment (AlignLeft); mle-> setAlignment (AlignLeft);
mle-> setReadOnly (TRUE); mle-> setReadOnly (true);
mle-> setText (contents); mle-> setText (contents);
#ifndef QT3 #ifndef QT3

@ -36,10 +36,10 @@ KGrFigure :: KGrFigure (int px, int py)
} }
// Initialise the global settings flags. // Initialise the global settings flags.
bool KGrFigure::variableTiming = TRUE; bool KGrFigure::variableTiming = true;
bool KGrFigure::alwaysCollectNugget = TRUE; bool KGrFigure::alwaysCollectNugget = true;
bool KGrFigure::runThruHole = TRUE; bool KGrFigure::runThruHole = true;
bool KGrFigure::reappearAtTop = TRUE; bool KGrFigure::reappearAtTop = true;
SearchStrategy KGrFigure::searchStrategy = LOW; SearchStrategy KGrFigure::searchStrategy = LOW;
int KGrFigure::herox = 0; int KGrFigure::herox = 0;
@ -155,7 +155,7 @@ void KGrFigure::walkUp(int WALKDELAY)
rely -= STEP; rely -= STEP;
absy -= STEP; absy -= STEP;
} }
walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); walkTimer->start ((WALKDELAY * NSPEED) / speed, true);
} }
else { else {
// End of 4-step cycle: move up to next cell, if possible. // 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; rely += STEP;
absy += STEP; absy += STEP;
} }
walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); walkTimer->start ((WALKDELAY * NSPEED) / speed, true);
} }
else { else {
// End of 4-step cycle: move down to next cell, if possible. // 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; relx -= STEP;
absx -=STEP; absx -=STEP;
} }
walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); walkTimer->start ((WALKDELAY * NSPEED) / speed, true);
} }
else { else {
// End of 4-pixmap cycle: start again, in next cell if possible. // 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; relx += STEP;
absx += STEP; // nur vorwärts gehen, wenn es auch möglich ist 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 { else {
actualPixmap -= 4; // Schritt war vollendet actualPixmap -= 4; // Schritt war vollendet
@ -277,7 +277,7 @@ void KGrFigure::initFall(int apm, int FALLDELAY)
actualPixmap = apm; actualPixmap = apm;
walkCounter=1; walkCounter=1;
walkTimer->stop(); walkTimer->stop();
fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); fallTimer->start((FALLDELAY * NSPEED) / speed, true);
} }
void KGrFigure::showFigure () void KGrFigure::showFigure ()
@ -303,12 +303,12 @@ KGrHero :: KGrHero (KGrCanvas * view, int x, int y)
herox = x; herox = x;
heroy = y; heroy = y;
started = FALSE; started = false;
mouseMode = TRUE; mouseMode = true;
walkCounter = 1; walkCounter = 1;
walkFrozen = FALSE; walkFrozen = false;
fallFrozen = FALSE; fallFrozen = false;
connect (walkTimer, TQ_SIGNAL (timeout ()), TQ_SLOT (walkTimeDone ())); connect (walkTimer, TQ_SIGNAL (timeout ()), TQ_SLOT (walkTimeDone ()));
connect (fallTimer, TQ_SIGNAL (timeout ()), TQ_SLOT (fallTimeDone ())); 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. // 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. // Sets a simulated mouse-pointer above, below, left, right or on the hero.
mouseMode = FALSE; mouseMode = false;
stopped = FALSE; stopped = false;
switch (key) { switch (key) {
case UP: mousex = x; mousey = 0; break; case UP: mousex = x; mousey = 0; break;
case DOWN: mousex = x; mousey = FIELDHEIGHT + 1; break; case DOWN: mousex = x; mousey = FIELDHEIGHT + 1; break;
case LEFT: mousex = 0; mousey = y; break; case LEFT: mousex = 0; mousey = y; break;
case RIGHT: mousex = FIELDWIDTH + 1; 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) void KGrHero::setDirection(int i, int j)
{ {
// Mouse control of hero: direction is updated continually on a timer. // Mouse control of hero: direction is updated continually on a timer.
mouseMode = TRUE; mouseMode = true;
stopped = FALSE; stopped = false;
mousex = i; mousex = i;
mousey = j; mousey = j;
} }
@ -446,11 +446,11 @@ void KGrHero::setNextDir()
void KGrHero::doStep() { void KGrHero::doStep() {
if (walkFrozen) { if (walkFrozen) {
walkFrozen = FALSE; walkFrozen = false;
walkTimeDone(); walkTimeDone();
} }
if (fallFrozen) { if (fallFrozen) {
fallFrozen = FALSE; fallFrozen = false;
fallTimeDone(); fallTimeDone();
} }
} }
@ -479,7 +479,7 @@ void KGrHero::init(int a,int b)
walkTimer->stop(); walkTimer->stop();
fallTimer->stop(); fallTimer->stop();
walkCounter = 1; walkCounter = 1;
started = FALSE; started = false;
x = mem_x = a; x = mem_x = a;
y = mem_y = b; y = mem_y = b;
@ -503,9 +503,9 @@ void KGrHero::init(int a,int b)
void KGrHero::start() void KGrHero::start()
{ {
started = TRUE; started = true;
walkFrozen = FALSE; walkFrozen = false;
fallFrozen = FALSE; fallFrozen = false;
if (!(canStand()||hangAtPole())) { // Held muss wohl fallen... if (!(canStand()||hangAtPole())) { // Held muss wohl fallen...
status = FALLING; status = FALLING;
@ -539,7 +539,7 @@ void KGrHero::setSpeed (int gamespeed)
void KGrHero::walkTimeDone () void KGrHero::walkTimeDone ()
{ {
if (! started) return; // Ignore signals from earlier play. 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) { if ((*playfield)[x][y]->whatIam() == BRICK) {
emit caughtHero(); // Brick closed over hero. emit caughtHero(); // Brick closed over hero.
@ -587,7 +587,7 @@ void KGrHero::walkTimeDone ()
if (!canStand()&&!hangAtPole()) if (!canStand()&&!hangAtPole())
initFall(FALL1, FALLDELAY); initFall(FALL1, FALLDELAY);
else 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 // This additional showFigure() is to update the hero position after it is
// altered by the hero-enemy deadlock fix in standOnEnemy(). Messy, but ... // altered by the hero-enemy deadlock fix in standOnEnemy(). Messy, but ...
@ -602,11 +602,11 @@ void KGrHero::walkTimeDone ()
void KGrHero::fallTimeDone() void KGrHero::fallTimeDone()
{ {
if (! started) return; // Ignore signals from earlier play. if (! started) return; // Ignore signals from earlier play.
if (KGrObject::frozen) {fallFrozen = TRUE; return; } if (KGrObject::frozen) {fallFrozen = true; return; }
if (!standOnEnemy()) { if (!standOnEnemy()) {
if (walkCounter++ < 4) { // Held fällt vier Positionen if (walkCounter++ < 4) { // Held fällt vier Positionen
fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); fallTimer->start((FALLDELAY * NSPEED) / speed, true);
rely+=STEP; rely+=STEP;
absy+=STEP; absy+=STEP;
} }
@ -617,12 +617,12 @@ void KGrHero::fallTimeDone()
absy = y*16; // wird Null und Figur eins runter absy = y*16; // wird Null und Figur eins runter
collectNugget(); // gesetzt. Zeit evtl. Nugget zu nehmen collectNugget(); // gesetzt. Zeit evtl. Nugget zu nehmen
if (! (canStand()||hangAtPole())) { // Held muss wohl weiterfallen. if (! (canStand()||hangAtPole())) { // Held muss wohl weiterfallen.
fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); fallTimer->start((FALLDELAY * NSPEED) / speed, true);
walkCounter = 1; walkCounter = 1;
} }
else { // Held hat Boden (oder Feind) unter den else { // Held hat Boden (oder Feind) unter den
status = STANDING; // Füssen oder hängt an Stange -> steh! 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; direction = (actualPixmap == 19) ? RIGHT : LEFT;
if ((*playfield)[x][y]->whatIam() == POLE) if ((*playfield)[x][y]->whatIam() == POLE)
actualPixmap = (direction == RIGHT)? RIGHTCLIMB1:LEFTCLIMB1; actualPixmap = (direction == RIGHT)? RIGHTCLIMB1:LEFTCLIMB1;
@ -643,11 +643,11 @@ void KGrHero::fallTimeDone()
// else // else
// Reduce jerkiness when descending over a falling enemy. // Reduce jerkiness when descending over a falling enemy.
// actualPixmap = (direction == RIGHT)? RIGHTWALK1:LEFTWALK1; // actualPixmap = (direction == RIGHT)? RIGHTWALK1:LEFTWALK1;
walkTimer->start((WALKDELAY * NSPEED) / speed, TRUE); walkTimer->start((WALKDELAY * NSPEED) / speed, true);
} }
else { else {
// Else, freeze hero until enemy moves out of the way. // 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())) if (isInEnemy() && (! standOnEnemy()))
@ -812,9 +812,9 @@ KGrEnemy :: KGrEnemy (KGrCanvas * view, int x, int y)
birthX=x; birthX=x;
birthY=y; birthY=y;
walkFrozen = FALSE; walkFrozen = false;
fallFrozen = FALSE; fallFrozen = false;
captiveFrozen = FALSE; captiveFrozen = false;
captiveTimer = new TQTimer (this); captiveTimer = new TQTimer (this);
connect (captiveTimer,TQ_SIGNAL(timeout()),TQ_SLOT(captiveTimeDone())); connect (captiveTimer,TQ_SIGNAL(timeout()),TQ_SLOT(captiveTimeDone()));
@ -828,15 +828,15 @@ int KGrEnemy::CAPTIVEDELAY = 0;
void KGrEnemy::doStep() { void KGrEnemy::doStep() {
if (walkFrozen) { if (walkFrozen) {
walkFrozen = FALSE; walkFrozen = false;
walkTimeDone(); walkTimeDone();
} }
if (fallFrozen) { if (fallFrozen) {
fallFrozen = FALSE; fallFrozen = false;
fallTimeDone(); fallTimeDone();
} }
if (captiveFrozen) { if (captiveFrozen) {
captiveFrozen = FALSE; captiveFrozen = false;
captiveTimeDone(); captiveTimeDone();
} }
} }
@ -885,7 +885,7 @@ void KGrEnemy::init(int a,int b)
void KGrEnemy::walkTimeDone () 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. // Check we are alive BEFORE checking for friends being in the way.
// Maybe a friend overhead is blocking our escape from a brick. // 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 status = WALKING; // initialisiere die Zählervariablen und
walkCounter = 1; // den Timer um den Held weiter 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 (); startWalk ();
} }
} }
@ -953,14 +953,14 @@ void KGrEnemy::walkTimeDone ()
rely = 0; absy = 16 * y; rely = 0; absy = 16 * y;
startWalk (); startWalk ();
} }
walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); walkTimer->start ((WALKDELAY * NSPEED) / speed, true);
} }
showFigure(); showFigure();
} }
void KGrEnemy::fallTimeDone () 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 if ((*playfield)[x][y+1]->whatIam() == HOLE) { // wenn Enemy ins Loch fällt
((KGrBrick*)(*playfield)[x][y+1])->useHole(); // reserviere das Loch, damit ((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. if (standOnEnemy()) { // Don't fall into a friend.
fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); fallTimer->start((FALLDELAY * NSPEED) / speed, true);
return; return;
} }
if (walkCounter++ < 4){ if (walkCounter++ < 4){
fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); fallTimer->start((FALLDELAY * NSPEED) / speed, true);
{ rely+=STEP; absy+=STEP;} { rely+=STEP; absy+=STEP;}
} }
else { else {
@ -1003,10 +1003,10 @@ void KGrEnemy::fallTimeDone ()
if ((*playfield)[x][y]->whatIam() == USEDHOLE) { if ((*playfield)[x][y]->whatIam() == USEDHOLE) {
captiveCounter = 0; captiveCounter = 0;
status = CAPTIVE; status = CAPTIVE;
captiveTimer->start((CAPTIVEDELAY * NSPEED) / speed, TRUE); captiveTimer->start((CAPTIVEDELAY * NSPEED) / speed, true);
} }
else if (!(canStand()||hangAtPole())) { else if (!(canStand()||hangAtPole())) {
fallTimer->start((FALLDELAY * NSPEED) / speed, TRUE); fallTimer->start((FALLDELAY * NSPEED) / speed, true);
walkCounter=1; walkCounter=1;
} }
else { else {
@ -1019,7 +1019,7 @@ void KGrEnemy::fallTimeDone ()
status = WALKING; status = WALKING;
walkCounter = 1; walkCounter = 1;
direction = searchbestway(x,y,herox,heroy); direction = searchbestway(x,y,herox,heroy);
walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); walkTimer->start ((WALKDELAY * NSPEED) / speed, true);
startWalk (); startWalk ();
if (!nuggets) if (!nuggets)
collectNugget(); collectNugget();
@ -1031,7 +1031,7 @@ void KGrEnemy::fallTimeDone ()
void KGrEnemy::captiveTimeDone() void KGrEnemy::captiveTimeDone()
{ {
if (KGrObject::frozen) {captiveFrozen = TRUE; return; } if (KGrObject::frozen) {captiveFrozen = true; return; }
if ((*playfield)[x][y]->whatIam()==BRICK) if ((*playfield)[x][y]->whatIam()==BRICK)
dieAndReappear(); dieAndReappear();
else else
@ -1039,11 +1039,11 @@ void KGrEnemy::captiveTimeDone()
status = WALKING; status = WALKING;
walkCounter = 1; walkCounter = 1;
direction = UP; direction = UP;
walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); walkTimer->start ((WALKDELAY * NSPEED) / speed, true);
captiveCounter = 0; captiveCounter = 0;
} else { } else {
captiveCounter ++; captiveCounter ++;
captiveTimer->start((CAPTIVEDELAY * NSPEED) / speed, TRUE); captiveTimer->start((CAPTIVEDELAY * NSPEED) / speed, true);
showFigure(); showFigure();
} }
} }
@ -1055,11 +1055,11 @@ void KGrEnemy::startSearching()
if (canStand()||((*playfield)[x][y+1]->whatIam()==USEDHOLE)) { if (canStand()||((*playfield)[x][y+1]->whatIam()==USEDHOLE)) {
status = WALKING; status = WALKING;
walkTimer->start ((WALKDELAY * NSPEED) / speed, TRUE); walkTimer->start ((WALKDELAY * NSPEED) / speed, true);
} }
else { else {
status = FALLING; status = FALLING;
fallTimer->start ((FALLDELAY * NSPEED) / speed, TRUE); fallTimer->start ((FALLDELAY * NSPEED) / speed, true);
} }
walkCounter = 1; walkCounter = 1;
@ -1137,7 +1137,7 @@ void KGrEnemy::dieAndReappear()
if (reappearAtTop) { if (reappearAtTop) {
// Follow Traditional rules: enemies reappear at top. // Follow Traditional rules: enemies reappear at top.
looking = TRUE; looking = true;
y = 2; y = 2;
// Randomly look for a free spot in row 2. Limit the number of tries. // Randomly look for a free spot in row 2. Limit the number of tries.
for (i = 1; ((i <= 3) && looking); i++) { for (i = 1; ((i <= 3) && looking); i++) {
@ -1145,7 +1145,7 @@ void KGrEnemy::dieAndReappear()
switch ((*playfield)[x][2]->whatIam()) { switch ((*playfield)[x][2]->whatIam()) {
case FREE: case FREE:
case HLADDER: case HLADDER:
looking = FALSE; looking = false;
break; break;
default: default:
break; break;
@ -1160,7 +1160,7 @@ void KGrEnemy::dieAndReappear()
switch ((*playfield)[x][y]->whatIam()) { switch ((*playfield)[x][y]->whatIam()) {
case FREE: case FREE:
case HLADDER: case HLADDER:
looking = FALSE; looking = false;
break; break;
default: default:
break; break;
@ -1540,7 +1540,7 @@ int KGrEnemy::distanceDown (int x, int y, int deltah)
int rungs = -1; int rungs = -1;
int exitRung = 0; int exitRung = 0;
bool canGoThru = TRUE; bool canGoThru = true;
char objType; char objType;
// If there is a way down at (x,y), return its length, else return zero. // 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)) if ((objType == HOLE) && (rungs < 0))
rungs = 0; // Enemy can go SIDEWAYS through a hole. rungs = 0; // Enemy can go SIDEWAYS through a hole.
else else
canGoThru = FALSE; // Cannot go through here. canGoThru = false; // Cannot go through here.
break; break;
case LADDER: case LADDER:
case POLE: // Can go through or stop. case POLE: // Can go through or stop.
@ -1575,7 +1575,7 @@ int KGrEnemy::distanceDown (int x, int y, int deltah)
exitRung = rungs; exitRung = rungs;
} }
else else
canGoThru = FALSE; // Should stop at hero's level. canGoThru = false; // Should stop at hero's level.
} }
break; break;
default: default:
@ -1603,9 +1603,9 @@ bool KGrEnemy::searchOK (int direction, int x, int y)
if (canWalkLR (direction, x, y) > 0) { if (canWalkLR (direction, x, y) > 0) {
// Can go into that cell, but check for a fall. // Can go into that cell, but check for a fall.
if (willNotFall (x+direction, y)) 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) 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()) { switch ( (*playfield)[x][y]->whatIam()) {
case LADDER: case LADDER:
case POLE: case POLE:
return TRUE; break; // OK, can hang on ladder or pole. return true; break; // OK, can hang on ladder or pole.
default: default:
break; break;
} }
@ -1661,12 +1661,12 @@ bool KGrEnemy::willNotFall (int x, int y)
for (c = 0; c < cmax; c++) { for (c = 0; c < cmax; c++) {
enemy = enemies->at(c); enemy = enemies->at(c);
if ((enemy->getx()==16*x) && (enemy->gety()==16*(y+1))) 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: 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 ((dx >= -32) && (dx < 16) && (dy > -16) && (dy < 16)) {
if ((enemy->direction == RIGHT) && if ((enemy->direction == RIGHT) &&
(enemy->status == WALKING) && (absx%16==0)) { (enemy->status == WALKING) && (absx%16==0)) {
return TRUE; return true;
} }
else if (dx >= -16) { else if (dx >= -16) {
if ((dx > -16) && (enemyId < enemy->enemyId)) if ((dx > -16) && (enemyId < enemy->enemyId))
return FALSE; return false;
else else
return TRUE; // Wait for the one in front. return true; // Wait for the one in front.
} }
} }
break; break;
@ -1747,13 +1747,13 @@ bool KGrEnemy::bumpingFriend()
if ((dx > -16) && (dx < 32) && (dy > -16) && (dy < 16)) { if ((dx > -16) && (dx < 32) && (dy > -16) && (dy < 16)) {
if ((enemy->direction == LEFT) && if ((enemy->direction == LEFT) &&
(enemy->status == WALKING) && (absx%16==0)) { (enemy->status == WALKING) && (absx%16==0)) {
return TRUE; return true;
} }
else if (dx <= 16) { else if (dx <= 16) {
if ((dx < 16) && (enemyId < enemy->enemyId)) if ((dx < 16) && (enemyId < enemy->enemyId))
return FALSE; return false;
else else
return TRUE; // Wait for the one in front. return true; // Wait for the one in front.
} }
} }
break; break;
@ -1761,13 +1761,13 @@ bool KGrEnemy::bumpingFriend()
if ((dy >= -32) && (dy < 16) && (dx > -16) && (dx < 16)) { if ((dy >= -32) && (dy < 16) && (dx > -16) && (dx < 16)) {
if ((enemy->direction == DOWN) && if ((enemy->direction == DOWN) &&
(enemy->status == WALKING) && (absy%16==0)) { (enemy->status == WALKING) && (absy%16==0)) {
return TRUE; return true;
} }
else if (dy >= -16) { else if (dy >= -16) {
if ((dy > -16) && (enemyId < enemy->enemyId)) if ((dy > -16) && (enemyId < enemy->enemyId))
return FALSE; return false;
else else
return TRUE; // Wait for the one above. return true; // Wait for the one above.
} }
} }
break; break;
@ -1775,13 +1775,13 @@ bool KGrEnemy::bumpingFriend()
if ((dy > -16) && (dy < 32) && (dx > -16) && (dx < 16)) { if ((dy > -16) && (dy < 32) && (dx > -16) && (dx < 16)) {
if ((enemy->direction == UP) && if ((enemy->direction == UP) &&
(enemy->status == WALKING) && (absy%16==0)) { (enemy->status == WALKING) && (absy%16==0)) {
return TRUE; return true;
} }
else if (dy <= 16) { else if (dy <= 16) {
if ((dy < 16) && (enemyId < enemy->enemyId)) if ((dy < 16) && (enemyId < enemy->enemyId))
return FALSE; return false;
else else
return TRUE; // Wait for the one below. return true; // Wait for the one below.
} }
} }
break; break;
@ -1790,7 +1790,7 @@ bool KGrEnemy::bumpingFriend()
} }
} }
} }
return FALSE; return false;
} }
KGrEnemy :: ~KGrEnemy () KGrEnemy :: ~KGrEnemy ()

@ -44,24 +44,24 @@ KGrGame::KGrGame (KGrCanvas * theView, TQString theSystemDir, TQString theUserDi
userDataDir = theUserDir; userDataDir = theUserDir;
// Set the game-editor OFF, but available. // Set the game-editor OFF, but available.
editMode = FALSE; editMode = false;
paintEditObj = FALSE; paintEditObj = false;
editObj = BRICK; editObj = BRICK;
shouldSave = FALSE; shouldSave = false;
enemies.setAutoDelete(TRUE); enemies.setAutoDelete(true);
hero = new KGrHero (view, 0, 0); // The hero is born ... Yay !!! hero = new KGrHero (view, 0, 0); // The hero is born ... Yay !!!
hero->setPlayfield (&playfield); hero->setPlayfield (&playfield);
setBlankLevel (TRUE); // Fill the playfield with blank walls. setBlankLevel (true); // Fill the playfield with blank walls.
enemy = NULL; enemy = NULL;
newLevel = TRUE; // Next level will be a new one. newLevel = true; // Next level will be a new one.
loading = TRUE; // Stop input until it is loaded. loading = true; // Stop input until it is loaded.
modalFreeze = FALSE; modalFreeze = false;
messageFreeze = FALSE; messageFreeze = false;
connect (hero, TQ_SIGNAL (gotNugget(int)), TQ_SLOT (incScore(int))); connect (hero, TQ_SIGNAL (gotNugget(int)), TQ_SLOT (incScore(int)));
connect (hero, TQ_SIGNAL (caughtHero()), TQ_SLOT (herosDead())); 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. // Get the mouse position every 40 msec. It is used to steer the hero.
mouseSampler = new TQTimer (this); mouseSampler = new TQTimer (this);
connect (mouseSampler, TQ_SIGNAL(timeout()), TQ_SLOT (readMousePos ())); connect (mouseSampler, TQ_SIGNAL(timeout()), TQ_SLOT (readMousePos ()));
mouseSampler->start (40, FALSE); mouseSampler->start (40, false);
srand(1); // initialisiere Random-Generator srand(1); // initialisiere Random-Generator
} }
@ -104,7 +104,7 @@ void KGrGame::startNextLevel()
void KGrGame::startLevel (int startingAt, int requestedLevel) void KGrGame::startLevel (int startingAt, int requestedLevel)
{ {
if (! saveOK (FALSE)) { // Check unsaved work. if (! saveOK (false)) { // Check unsaved work.
return; return;
} }
// Use dialog box to select game and level: startingAt = ID_FIRST or ID_ANY. // Use dialog box to select game and level: startingAt = ID_FIRST or ID_ANY.
@ -135,8 +135,8 @@ void KGrGame::herosDead()
if (--lives > 0) { if (--lives > 0) {
// Still some life left, so PAUSE and then re-start the level. // Still some life left, so PAUSE and then re-start the level.
emit showLives (lives); emit showLives (lives);
KGrObject::frozen = TRUE; // Freeze the animation and let KGrObject::frozen = true; // Freeze the animation and let
dyingTimer->start (1500, TRUE); // the player see what happened. dyingTimer->start (1500, true); // the player see what happened.
} }
else { else {
// Game over: display the "ENDE" screen. // Game over: display the "ENDE" screen.
@ -150,10 +150,10 @@ void KGrGame::herosDead()
enemies.clear(); // Stop the enemies catching the hero again ... enemies.clear(); // Stop the enemies catching the hero again ...
view->deleteEnemySprites(); view->deleteEnemySprites();
unfreeze(); // ... NOW we can unfreeze. unfreeze(); // ... NOW we can unfreeze.
newLevel = TRUE; newLevel = true;
level = 0; level = 0;
loadLevel (level); // Display the "ENDE" screen. 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. enemyCount = 0; // Hero is dead: re-start the level.
loadLevel (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() void KGrGame::showHiddenLadders()
@ -204,9 +204,9 @@ void KGrGame::goUpOneLevel()
enemyCount = 0; enemyCount = 0;
enemies.clear(); enemies.clear();
view->deleteEnemySprites(); view->deleteEnemySprites();
newLevel = TRUE; newLevel = true;
loadLevel (level); loadLevel (level);
newLevel = FALSE; newLevel = false;
} }
void KGrGame::loseNugget() void KGrGame::loseNugget()
@ -226,17 +226,17 @@ int KGrGame::getLevel() // Return the current game-level.
bool KGrGame::inMouseMode() 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() 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() 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) void KGrGame::setMouseMode (bool on_off)
@ -247,33 +247,33 @@ void KGrGame::setMouseMode (bool on_off)
void KGrGame::freeze() void KGrGame::freeze()
{ {
if ((! modalFreeze) && (! messageFreeze)) { 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() void KGrGame::unfreeze()
{ {
if ((! modalFreeze) && (! messageFreeze)) { 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. restart(); // the game goes on running after the next step.
} }
void KGrGame::setMessageFreeze (bool on_off) void KGrGame::setMessageFreeze (bool on_off)
{ {
if (on_off) { // Freeze the game action during a message. if (on_off) { // Freeze the game action during a message.
messageFreeze = FALSE; messageFreeze = false;
if (! KGrObject::frozen) { if (! KGrObject::frozen) {
messageFreeze = TRUE; messageFreeze = true;
freeze(); freeze();
} }
} }
else { // Unfreeze the game action after a message. else { // Unfreeze the game action after a message.
if (messageFreeze) { if (messageFreeze) {
unfreeze(); unfreeze();
messageFreeze = FALSE; messageFreeze = false;
} }
} }
} }
@ -318,19 +318,19 @@ void KGrGame::setBlankLevel(bool playable)
void KGrGame::newGame (const int lev, const int gameIndex) void KGrGame::newGame (const int lev, const int gameIndex)
{ {
// Ignore player input from keyboard or mouse while the screen is set up. // 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) { if (editMode) {
emit setEditMenu (FALSE); // Disable edit menu items and toolbar. emit setEditMenu (false); // Disable edit menu items and toolbar.
editMode = FALSE; editMode = false;
paintEditObj = FALSE; paintEditObj = false;
editObj = BRICK; editObj = BRICK;
view->setHeroVisible (TRUE); view->setHeroVisible (true);
} }
newLevel = TRUE; newLevel = true;
level = lev; level = lev;
collnIndex = gameIndex; collnIndex = gameIndex;
collection = collections.at (collnIndex); collection = collections.at (collnIndex);
@ -348,26 +348,26 @@ void KGrGame::newGame (const int lev, const int gameIndex)
enemies.clear(); enemies.clear();
view->deleteEnemySprites(); view->deleteEnemySprites();
newLevel = TRUE;; newLevel = true;;
loadLevel (level); loadLevel (level);
newLevel = FALSE; newLevel = false;
} }
void KGrGame::startTutorial() void KGrGame::startTutorial()
{ {
if (! saveOK (FALSE)) { // Check unsaved work. if (! saveOK (false)) { // Check unsaved work.
return; return;
} }
int i, index; int i, index;
int imax = collections.count(); int imax = collections.count();
bool found = FALSE; bool found = false;
index = 0; index = 0;
for (i = 0; i < imax; i++) { for (i = 0; i < imax; i++) {
index = i; // Index within owner. index = i; // Index within owner.
if (collections.at(i)->prefix == "tute") { if (collections.at(i)->prefix == "tute") {
found = TRUE; found = true;
break; break;
} }
} }
@ -410,7 +410,7 @@ int KGrGame::loadLevel (int levelNo)
} }
// Ignore player input from keyboard or mouse while the screen is set up. // Ignore player input from keyboard or mouse while the screen is set up.
loading = TRUE; loading = true;
nuggets = 0; nuggets = 0;
enemyCount=0; enemyCount=0;
@ -494,7 +494,7 @@ int KGrGame::loadLevel (int levelNo)
connect (view, TQ_SIGNAL(mouseClick(int)), TQ_SLOT(doDig(int))); connect (view, TQ_SIGNAL(mouseClick(int)), TQ_SLOT(doDig(int)));
// Re-enable player input. // Re-enable player input.
loading = FALSE; loading = false;
return 1; return 1;
} }
@ -515,17 +515,17 @@ bool KGrGame::openLevelFile (int levelNo, TQFile & openlevel)
i18n("Cannot find file '%1'. Please make sure '%2' has been " i18n("Cannot find file '%1'. Please make sure '%2' has been "
"run in the '%3' folder.") "run in the '%3' folder.")
.arg(filePath).arg("tar xf levels.tar").arg(systemDataDir.myStr())); .arg(filePath).arg("tar xf levels.tar").arg(systemDataDir.myStr()));
return (FALSE); return (false);
} }
// <20>ffne Level zum lesen // <20>ffne Level zum lesen
if (! openlevel.open (IO_ReadOnly)) { if (! openlevel.open (IO_ReadOnly)) {
KGrMessage::information (view, i18n("Load Level"), KGrMessage::information (view, i18n("Load Level"),
i18n("Cannot open file '%1' for read-only.").arg(filePath)); 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) 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); case HERO: createObject(new KGrFree (FREE,i,j,view),FREE,i,j);
hero->init(i,j); hero->init(i,j);
startI = i; startJ = j; startI = i; startJ = j;
hero->started = FALSE; hero->started = false;
hero->showFigure(); hero->showFigure();
break; break;
case ENEMY: createObject(new KGrFree (FREE,i,j,view),FREE,i,j); 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(); file2.close();
TQDir dir; TQDir dir;
dir.rename (file2.name(), file1.name(), TRUE); dir.rename (file2.name(), file1.name(), true);
KGrMessage::information (view, i18n("Save Game"), KGrMessage::information (view, i18n("Save Game"),
i18n("Your game has been saved.")); i18n("Your game has been saved."));
} }
void KGrGame::loadGame() // Re-load game, score and level. void KGrGame::loadGame() // Re-load game, score and level.
{ {
if (! saveOK (FALSE)) { // Check unsaved work. if (! saveOK (false)) { // Check unsaved work.
return; return;
} }
@ -853,9 +853,9 @@ void KGrGame::loadGame() // Re-load game, score and level.
} }
// Halt the game during the loadGame() dialog. // Halt the game during the loadGame() dialog.
modalFreeze = FALSE; modalFreeze = false;
if (!KGrObject::frozen) { if (!KGrObject::frozen) {
modalFreeze = TRUE; modalFreeze = true;
freeze(); freeze();
} }
@ -868,7 +868,7 @@ void KGrGame::loadGame() // Re-load game, score and level.
s = lg->getCurrentText(); s = lg->getCurrentText();
} }
bool found = FALSE; bool found = false;
TQString pr; TQString pr;
int lev; int lev;
int i; int i;
@ -876,14 +876,14 @@ void KGrGame::loadGame() // Re-load game, score and level.
if (! s.isNull()) { if (! s.isNull()) {
pr = s.mid (21, 7); // Get the collection prefix. 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. for (i = 0; i < imax; i++) { // Find the collection.
if (collections.at(i)->prefix == pr) { if (collections.at(i)->prefix == pr) {
collection = collections.at(i); collection = collections.at(i);
collnIndex = i; collnIndex = i;
owner = collections.at(i)->owner; owner = collections.at(i)->owner;
found = TRUE; found = true;
break; break;
} }
} }
@ -906,7 +906,7 @@ void KGrGame::loadGame() // Re-load game, score and level.
// Unfreeze the game, but only if it was previously unfrozen. // Unfreeze the game, but only if it was previously unfrozen.
if (modalFreeze) { if (modalFreeze) {
unfreeze(); unfreeze();
modalFreeze = FALSE; modalFreeze = false;
} }
delete lg; delete lg;
@ -918,7 +918,7 @@ void KGrGame::loadGame() // Re-load game, score and level.
void KGrGame::checkHighScore() void KGrGame::checkHighScore()
{ {
bool prevHigh = TRUE; bool prevHigh = true;
TQ_INT16 prevLevel = 0; TQ_INT16 prevLevel = 0;
TQ_INT32 prevScore = 0; TQ_INT32 prevScore = 0;
TQString thisUser = i18n("Unknown"); TQString thisUser = i18n("Unknown");
@ -938,7 +938,7 @@ void KGrGame::checkHighScore()
if (! high1.exists()) { if (! high1.exists()) {
high1.setName (systemDataDir + "hi_" + collection->prefix + ".dat"); high1.setName (systemDataDir + "hi_" + collection->prefix + ".dat");
if (! high1.exists()) { 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. // Read previous users, levels and scores from the high score file.
s1.setDevice (&high1); s1.setDevice (&high1);
bool found = FALSE; bool found = false;
highCount = 0; highCount = 0;
while (! s1.endData()) { while (! s1.endData()) {
char * prevUser; char * prevUser;
@ -966,7 +966,7 @@ void KGrGame::checkHighScore()
delete prevDate; delete prevDate;
highCount++; highCount++;
if (score > prevScore) { if (score > prevScore) {
found = TRUE; // We have a high score. found = true; // We have a high score.
break; break;
} }
} }
@ -992,7 +992,7 @@ void KGrGame::checkHighScore()
} }
// Dialog to ask the user to enter their name. // 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); WStyle_Customize | WStyle_NormalBorder | WStyle_Title);
int margin = 10; int margin = 10;
@ -1023,7 +1023,7 @@ void KGrGame::checkHighScore()
connect (hsnUser, TQ_SIGNAL (returnPressed ()), hsn, TQ_SLOT (accept ())); connect (hsnUser, TQ_SIGNAL (returnPressed ()), hsn, TQ_SLOT (accept ()));
connect (OK, TQ_SIGNAL (clicked ()), hsn, TQ_SLOT (accept ())); connect (OK, TQ_SIGNAL (clicked ()), hsn, TQ_SLOT (accept ()));
while (TRUE) { while (true) {
hsn->exec(); hsn->exec();
thisUser = hsnUser->text(); thisUser = hsnUser->text();
if (thisUser.length() > 0) if (thisUser.length() > 0)
@ -1050,7 +1050,7 @@ void KGrGame::checkHighScore()
if (prevHigh) { if (prevHigh) {
high1.reset(); high1.reset();
bool scoreRecorded = FALSE; bool scoreRecorded = false;
highCount = 0; highCount = 0;
while ((! s1.endData()) && (highCount < 10)) { while ((! s1.endData()) && (highCount < 10)) {
char * prevUser; char * prevUser;
@ -1067,7 +1067,7 @@ void KGrGame::checkHighScore()
s2 << (TQ_INT16) level; s2 << (TQ_INT16) level;
s2 << (TQ_INT32) score; s2 << (TQ_INT32) score;
s2 << hsDate.myStr(); s2 << hsDate.myStr();
scoreRecorded = TRUE; scoreRecorded = true;
} }
if (highCount < 10) { if (highCount < 10) {
highCount++; highCount++;
@ -1102,7 +1102,7 @@ void KGrGame::checkHighScore()
TQDir dir; TQDir dir;
dir.rename (high2.name(), dir.rename (high2.name(),
userDataDir + "hi_" + collection->prefix + ".dat", TRUE); userDataDir + "hi_" + collection->prefix + ".dat", true);
KGrMessage::information (view, i18n("Save High Score"), KGrMessage::information (view, i18n("Save High Score"),
i18n("Your high score has been saved.")); i18n("Your high score has been saved."));
@ -1144,7 +1144,7 @@ void KGrGame::showHighScores()
return; return;
} }
TQDialog * hs = new TQDialog (view, "hsDialog", TRUE, TQDialog * hs = new TQDialog (view, "hsDialog", true,
WStyle_Customize | WStyle_NormalBorder | WStyle_Title); WStyle_Customize | WStyle_NormalBorder | WStyle_Title);
int margin = 10; int margin = 10;
@ -1164,8 +1164,8 @@ void KGrGame::showHighScores()
#else #else
TQFont f = TDEGlobalSettings::fixedFont(); // KDE version. TQFont f = TDEGlobalSettings::fixedFont(); // KDE version.
#endif #endif
f. setFixedPitch (TRUE); f. setFixedPitch (true);
f. setBold (TRUE); f. setBold (true);
hsColHeader-> setFont (f); hsColHeader-> setFont (f);
TQLabel * hsLine [10]; TQLabel * hsLine [10];
@ -1182,7 +1182,7 @@ void KGrGame::showHighScores()
OK-> setAccel (Key_Return); OK-> setAccel (Key_Return);
// Set up the format for the high-score lines. // Set up the format for the high-score lines.
f. setBold (FALSE); f. setBold (false);
TQString line; TQString line;
const char * hsFormat = "%2d. %-30.30s %3d %7ld %s"; const char * hsFormat = "%2d. %-30.30s %3d %7ld %s";
@ -1250,7 +1250,7 @@ void KGrGame::restart()
temp = KGrObject::frozen; 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. // any timer events that have been blocked.
readMousePos(); // Set hero's direction. readMousePos(); // Set hero's direction.
@ -1270,7 +1270,7 @@ void KGrGame::restart()
((KGrBrick *)playfield[i][j])->doStep(); ((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. // single-step effect, otherwise go on running.
} }
@ -1323,7 +1323,7 @@ void KGrGame::showObjectState()
void KGrGame::bugFix() void KGrGame::bugFix()
{ {
if (KGrObject::frozen) { // Toggle a bug fix on/off dynamically. 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 ("%s", (KGrObject::bugFixed) ? "\n" : "");
printf (">>> Bug fix is %s\n", (KGrObject::bugFixed) ? "ON" : "OFF\n"); printf (">>> Bug fix is %s\n", (KGrObject::bugFixed) ? "ON" : "OFF\n");
} }
@ -1332,7 +1332,7 @@ void KGrGame::bugFix()
void KGrGame::startLogging() void KGrGame::startLogging()
{ {
if (KGrObject::frozen) { // Toggle logging on/off dynamically. 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 ("%s", (KGrObject::logging) ? "\n" : "");
printf (">>> Logging is %s\n", (KGrObject::logging) ? "ON" : "OFF\n"); printf (">>> Logging is %s\n", (KGrObject::logging) ? "ON" : "OFF\n");
} }
@ -1351,7 +1351,7 @@ void KGrGame::createLevel()
{ {
int i, j; int i, j;
if (! saveOK (FALSE)) { // Check unsaved work. if (! saveOK (false)) { // Check unsaved work.
return; return;
} }
@ -1364,7 +1364,7 @@ void KGrGame::createLevel()
} }
// Ignore player input from keyboard or mouse while the screen is set up. // Ignore player input from keyboard or mouse while the screen is set up.
loading = TRUE; loading = true;
level = 0; level = 0;
initEdit(); initEdit();
@ -1392,7 +1392,7 @@ void KGrGame::createLevel()
} }
// Re-enable player input. // Re-enable player input.
loading = FALSE; loading = false;
view->updateCanvas(); // Show the edit area. view->updateCanvas(); // Show the edit area.
view->update(); // Show the level name. view->update(); // Show the level name.
@ -1400,7 +1400,7 @@ void KGrGame::createLevel()
void KGrGame::updateLevel() void KGrGame::updateLevel()
{ {
if (! saveOK (FALSE)) { // Check unsaved work. if (! saveOK (false)) { // Check unsaved work.
return; return;
} }
@ -1429,7 +1429,7 @@ void KGrGame::updateLevel()
void KGrGame::updateNext() void KGrGame::updateNext()
{ {
if (! saveOK (FALSE)) { // Check unsaved work. if (! saveOK (false)) { // Check unsaved work.
return; return;
} }
level++; level++;
@ -1445,7 +1445,7 @@ void KGrGame::loadEditLevel (int lev)
return; return;
// Ignore player input from keyboard or mouse while the screen is set up. // Ignore player input from keyboard or mouse while the screen is set up.
loading = TRUE; loading = true;
level = lev; level = lev;
initEdit(); initEdit();
@ -1498,7 +1498,7 @@ void KGrGame::loadEditLevel (int lev)
showEditLevel(); // Reconnect signals. showEditLevel(); // Reconnect signals.
// Re-enable player input. // Re-enable player input.
loading = FALSE; loading = false;
} }
void KGrGame::editNameAndHint() void KGrGame::editNameAndHint()
@ -1512,7 +1512,7 @@ void KGrGame::editNameAndHint()
if (nh->exec() == TQDialog::Accepted) { if (nh->exec() == TQDialog::Accepted) {
levelName = nh->getName(); levelName = nh->getName();
levelHint = nh->getHint(); levelHint = nh->getHint();
shouldSave = TRUE; shouldSave = true;
} }
delete nh; delete nh;
@ -1530,7 +1530,7 @@ bool KGrGame::saveLevelFile()
if (! editMode) { if (! editMode) {
KGrMessage::information (view, i18n("Save Level"), KGrMessage::information (view, i18n("Save Level"),
i18n("Inappropriate action: you are not editing a level.")); i18n("Inappropriate action: you are not editing a level."));
return (FALSE); return (false);
} }
// Save the current collection index. // 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. // Pop up dialog box, which could change the collection or level or both.
selectedLevel = selectLevel (action, selectedLevel); selectedLevel = selectLevel (action, selectedLevel);
if (selectedLevel == 0) if (selectedLevel == 0)
return (FALSE); return (false);
// Get the new collection (if changed). // Get the new collection (if changed).
int n = collnIndex; int n = collnIndex;
@ -1559,10 +1559,10 @@ bool KGrGame::saveLevelFile()
if ((action == SL_SAVE) && (n == N) && (selectedLevel == level)) { if ((action == SL_SAVE) && (n == N) && (selectedLevel == level)) {
// This is a normal edit: the old file is to be re-written. // This is a normal edit: the old file is to be re-written.
isNew = FALSE; isNew = false;
} }
else { else {
isNew = TRUE; isNew = true;
// Check if the file is to be inserted in or appended to the collection. // Check if the file is to be inserted in or appended to the collection.
if (levelFile.exists()) { if (levelFile.exists()) {
switch (KGrMessage::warning (view, i18n("Save Level"), switch (KGrMessage::warning (view, i18n("Save Level"),
@ -1572,10 +1572,10 @@ bool KGrGame::saveLevelFile()
case 0: if (! reNumberLevels (n, selectedLevel, case 0: if (! reNumberLevels (n, selectedLevel,
collections.at(n)->nLevels, +1)) { collections.at(n)->nLevels, +1)) {
return (FALSE); return (false);
} }
break; break;
case 1: return (FALSE); case 1: return (false);
break; break;
} }
} }
@ -1585,7 +1585,7 @@ bool KGrGame::saveLevelFile()
if (! levelFile.open (IO_WriteOnly)) { if (! levelFile.open (IO_WriteOnly)) {
KGrMessage::information (view, i18n("Save Level"), KGrMessage::information (view, i18n("Save Level"),
i18n("Cannot open file '%1' for output.").arg(filePath)); i18n("Cannot open file '%1' for output.").arg(filePath));
return (FALSE); return (false);
} }
// Save the level. // Save the level.
@ -1622,7 +1622,7 @@ bool KGrGame::saveLevelFile()
} }
levelFile.close (); levelFile.close ();
shouldSave = FALSE; shouldSave = false;
if (isNew) { if (isNew) {
collections.at(n)->nLevels++; collections.at(n)->nLevels++;
@ -1633,7 +1633,7 @@ bool KGrGame::saveLevelFile()
emit showLevel (level); emit showLevel (level);
view->setTitle (getTitle()); // Display new title. view->setTitle (getTitle()); // Display new title.
view->updateCanvas(); // Show the edit area. view->updateCanvas(); // Show the edit area.
return (TRUE); return (true);
} }
void KGrGame::moveLevelFile () void KGrGame::moveLevelFile ()
@ -1690,7 +1690,7 @@ void KGrGame::moveLevelFile ()
filePath1 = getFilePath (USER, collections.at(fromC), fromL); filePath1 = getFilePath (USER, collections.at(fromC), fromL);
filePath2 = filePath1; filePath2 = filePath1;
filePath2 = filePath2.append (".tmp"); filePath2 = filePath2.append (".tmp");
dir.rename (filePath1, filePath2, TRUE); dir.rename (filePath1, filePath2, true);
if (toC == fromC) { // Same collection. if (toC == fromC) { // Same collection.
if (toL < fromL) { // Decrease level. if (toL < fromL) { // Decrease level.
@ -1725,7 +1725,7 @@ void KGrGame::moveLevelFile ()
// Rename the saved "fromL" file to become "toL". // Rename the saved "fromL" file to become "toL".
filePath1 = getFilePath (USER, collections.at(toC), toL); filePath1 = getFilePath (USER, collections.at(toC), toL);
dir.rename (filePath2, filePath1, TRUE); dir.rename (filePath2, filePath1, true);
level = toL; level = toL;
collection = collections.at(toC); collection = collections.at(toC);
@ -1801,9 +1801,9 @@ void KGrGame::deleteLevelFile ()
enemyCount = 0; // Load level in play mode. enemyCount = 0; // Load level in play mode.
enemies.clear(); enemies.clear();
view->deleteEnemySprites(); view->deleteEnemySprites();
newLevel = TRUE;; newLevel = true;;
loadLevel (level); loadLevel (level);
newLevel = FALSE; newLevel = false;
} }
else { else {
createLevel(); // No levels left in collection. createLevel(); // No levels left in collection.
@ -1855,10 +1855,10 @@ void KGrGame::editCollection (int action)
continue; continue;
} }
bool allAlpha = TRUE; bool allAlpha = true;
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
if (! isalpha(ecPrefix.myChar(i))) { if (! isalpha(ecPrefix.myChar(i))) {
allAlpha = FALSE; allAlpha = false;
break; break;
} }
} }
@ -1869,13 +1869,13 @@ void KGrGame::editCollection (int action)
continue; continue;
} }
bool duplicatePrefix = FALSE; bool duplicatePrefix = false;
KGrCollection * c; KGrCollection * c;
int imax = collections.count(); int imax = collections.count();
for (int i = 0; i < imax; i++) { for (int i = 0; i < imax; i++) {
c = collections.at(i); c = collections.at(i);
if ((c->prefix == ecPrefix) && (i != n)) { if ((c->prefix == ecPrefix) && (i != n)) {
duplicatePrefix = TRUE; duplicatePrefix = true;
break; break;
} }
} }
@ -1921,7 +1921,7 @@ bool KGrGame::saveOK (bool exiting)
bool result; bool result;
TQString option2 = i18n("&Go on editing"); TQString option2 = i18n("&Go on editing");
result = TRUE; result = true;
if (editMode) { if (editMode) {
if (exiting) { // If window is closing, if (exiting) { // If window is closing,
@ -1930,14 +1930,14 @@ bool KGrGame::saveOK (bool exiting)
for (j = 1; j <= FIELDHEIGHT; j++) for (j = 1; j <= FIELDHEIGHT; j++)
for (i = 1; i <= FIELDWIDTH; i++) { // Check cell changes. for (i = 1; i <= FIELDWIDTH; i++) { // Check cell changes.
if ((shouldSave) || (editObjArray[i][j] != lastSaveArray[i][j])) { 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"), switch (KGrMessage::warning (view, i18n("Editor"),
i18n("You have not saved your work. Do " i18n("You have not saved your work. Do "
"you want to save it now?"), "you want to save it now?"),
i18n("&Save"), i18n("&Don't Save"), option2)) { i18n("&Save"), i18n("&Don't Save"), option2)) {
case 0: result = saveLevelFile(); break;// Save and continue. case 0: result = saveLevelFile(); break;// Save and continue.
case 1: shouldSave = FALSE; break; // Continue: don't save. case 1: shouldSave = false; break; // Continue: don't save.
case 2: result = FALSE; break; // Go back to editing. case 2: result = false; break; // Go back to editing.
} }
return (result); return (result);
} }
@ -1950,15 +1950,15 @@ void KGrGame::initEdit()
{ {
if (! editMode) { if (! editMode) {
editMode = TRUE; editMode = true;
emit setEditMenu (TRUE); // Enable edit menu items and toolbar. emit setEditMenu (true); // Enable edit menu items and toolbar.
// We were previously in play mode: stop the hero running or falling. // We were previously in play mode: stop the hero running or falling.
hero->init (1, 1); hero->init (1, 1);
view->setHeroVisible (FALSE); view->setHeroVisible (false);
} }
paintEditObj = FALSE; paintEditObj = false;
// Set the default object and button. // Set the default object and button.
editObj = BRICK; editObj = BRICK;
@ -1977,12 +1977,12 @@ void KGrGame::initEdit()
emit showScore (0); emit showScore (0);
deleteLevel(); deleteLevel();
setBlankLevel(FALSE); // Fill playfield with Editable objects. setBlankLevel(false); // Fill playfield with Editable objects.
view->setTitle (getTitle());// Show title of level. view->setTitle (getTitle());// Show title of level.
view->updateCanvas(); // Show the edit area. 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() void KGrGame::deleteLevel()
@ -2058,16 +2058,16 @@ bool KGrGame::reNumberLevels (int cIndex, int first, int last, int inc)
while (i != n) { while (i != n) {
file1 = getFilePath (USER, collections.at(cIndex), i); file1 = getFilePath (USER, collections.at(cIndex), i);
file2 = getFilePath (USER, collections.at(cIndex), i - step); 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"), KGrMessage::information (view, i18n("Save Level"),
i18n("Cannot rename file '%1' to '%2'.") i18n("Cannot rename file '%1' to '%2'.")
.arg(file1).arg(file2)); .arg(file1).arg(file2));
return (FALSE); return (false);
} }
i = i + step; i = i + step;
} }
return (TRUE); return (true);
} }
void KGrGame::setLevel (int lev) void KGrGame::setLevel (int lev)
@ -2092,7 +2092,7 @@ void KGrGame::doEdit (int button)
switch (button) { switch (button) {
case TQt::LeftButton: case TQt::LeftButton:
case TQt::RightButton: case TQt::RightButton:
paintEditObj = TRUE; paintEditObj = true;
insertEditObj (i, j); insertEditObj (i, j);
view->updateCanvas(); view->updateCanvas();
oldI = i; oldI = i;
@ -2115,7 +2115,7 @@ void KGrGame::endEdit (int button)
switch (button) { switch (button) {
case TQt::LeftButton: case TQt::LeftButton:
case TQt::RightButton: case TQt::RightButton:
paintEditObj = FALSE; paintEditObj = false;
if ((i != oldI) || (j != oldJ)) { if ((i != oldI) || (j != oldJ)) {
insertEditObj (i, j); insertEditObj (i, j);
view->updateCanvas(); view->updateCanvas();
@ -2135,9 +2135,9 @@ int KGrGame::selectLevel (int action, int requestedLevel)
int selectedLevel = 0; // 0 = no selection (Cancel) or invalid. int selectedLevel = 0; // 0 = no selection (Cancel) or invalid.
// Halt the game during the dialog. // Halt the game during the dialog.
modalFreeze = FALSE; modalFreeze = false;
if (! KGrObject::frozen) { if (! KGrObject::frozen) {
modalFreeze = TRUE; modalFreeze = true;
freeze(); freeze();
} }
@ -2199,7 +2199,7 @@ int KGrGame::selectLevel (int action, int requestedLevel)
// Unfreeze the game, but only if it was previously unfrozen. // Unfreeze the game, but only if it was previously unfrozen.
if (modalFreeze) { if (modalFreeze) {
unfreeze(); unfreeze();
modalFreeze = FALSE; modalFreeze = false;
} }
delete sl; delete sl;
@ -2210,11 +2210,11 @@ bool KGrGame::ownerOK (Owner o)
{ {
// Check that this owner has at least one collection. // Check that this owner has at least one collection.
KGrCollection * c; KGrCollection * c;
bool OK = FALSE; bool OK = false;
for (c = collections.first(); c != 0; c = collections.next()) { for (c = collections.first(); c != 0; c = collections.next()) {
if (c->owner == o) { if (c->owner == o) {
OK = TRUE; OK = true;
break; break;
} }
} }
@ -2335,10 +2335,10 @@ void KGrThumbNail::drawContents (TQPainter * p) // Activated via "paintEvent".
bool KGrGame::initCollections () bool KGrGame::initCollections ()
{ {
// Initialise the list of collections of levels (i.e. the list of games). // 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. owner = SYSTEM; // Use system levels initially.
if (! loadCollections (SYSTEM)) // Load system collections list. 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. loadCollections (USER); // Load user collections list.
// If none, don't worry. // If none, don't worry.
@ -2349,7 +2349,7 @@ bool KGrGame::initCollections ()
collection = collections.at (collnIndex); collection = collections.at (collnIndex);
level = 1; // Default start is at level 1. level = 1; // Default start is at level 1.
return (TRUE); return (true);
} }
void KGrGame::mapCollections() void KGrGame::mapCollections()
@ -2401,7 +2401,7 @@ void KGrGame::mapCollections()
// Get the name of the file found on disk. // Get the name of the file found on disk.
fileName1 = file->fileName(); fileName1 = file->fileName();
while (TRUE) { while (true) {
// Work out what the file name should be, based on the level no. // Work out what the file name should be, based on the level no.
fileName2.setNum (lev); // Convert to TQString. fileName2.setNum (lev); // Convert to TQString.
fileName2 = fileName2.rightJustify (3,'0'); // Add zeros. fileName2 = fileName2.rightJustify (3,'0'); // Add zeros.
@ -2459,13 +2459,13 @@ bool KGrGame::loadCollections (Owner o)
i18n("Cannot find game info file '%1'.") i18n("Cannot find game info file '%1'.")
.arg(filePath)); .arg(filePath));
} }
return (FALSE); return (false);
} }
if (! c.open (IO_ReadOnly)) { if (! c.open (IO_ReadOnly)) {
KGrMessage::information (view, i18n("Load Game Info"), KGrMessage::information (view, i18n("Load Game Info"),
i18n("Cannot open file '%1' for read-only.").arg(filePath)); i18n("Cannot open file '%1' for read-only.").arg(filePath));
return (FALSE); return (false);
} }
TQCString line = ""; TQCString line = "";
@ -2515,14 +2515,14 @@ bool KGrGame::loadCollections (Owner o)
i18n("Format error in game info file '%1'.") i18n("Format error in game info file '%1'.")
.arg(filePath)); .arg(filePath));
c.close(); c.close();
return (FALSE); return (false);
} }
line = ""; line = "";
} }
} }
c.close(); c.close();
return (TRUE); return (true);
} }
bool KGrGame::saveCollections (Owner o) bool KGrGame::saveCollections (Owner o)
@ -2532,7 +2532,7 @@ bool KGrGame::saveCollections (Owner o)
if (o != USER) { if (o != USER) {
KGrMessage::information (view, i18n("Save Game Info"), KGrMessage::information (view, i18n("Save Game Info"),
i18n("You can only modify user games.")); i18n("You can only modify user games."));
return (FALSE); return (false);
} }
filePath = ((o == SYSTEM)? systemDataDir : userDataDir) + "games.dat"; filePath = ((o == SYSTEM)? systemDataDir : userDataDir) + "games.dat";
@ -2543,7 +2543,7 @@ bool KGrGame::saveCollections (Owner o)
if (! c.open (IO_WriteOnly)) { if (! c.open (IO_WriteOnly)) {
KGrMessage::information (view, i18n("Save Game Info"), KGrMessage::information (view, i18n("Save Game Info"),
i18n("Cannot open file '%1' for output.").arg(filePath)); i18n("Cannot open file '%1' for output.").arg(filePath));
return (FALSE); return (false);
} }
// Save the collections. // Save the collections.
@ -2581,7 +2581,7 @@ bool KGrGame::saveCollections (Owner o)
} }
c.close(); c.close();
return (TRUE); return (true);
} }
/******************************************************************************/ /******************************************************************************/
@ -2591,12 +2591,12 @@ bool KGrGame::saveCollections (Owner o)
void KGrGame::myMessage (TQWidget * parent, TQString title, TQString contents) void KGrGame::myMessage (TQWidget * parent, TQString title, TQString contents)
{ {
// Halt the game while the message is displayed. // Halt the game while the message is displayed.
setMessageFreeze (TRUE); setMessageFreeze (true);
KGrMessage::wrapped (parent, title, contents); KGrMessage::wrapped (parent, title, contents);
// Unfreeze the game, but only if it was previously unfrozen. // Unfreeze the game, but only if it was previously unfrozen.
setMessageFreeze (FALSE); setMessageFreeze (false);
} }
/******************************************************************************/ /******************************************************************************/

@ -26,18 +26,18 @@ KGrObject::KGrObject (char objType)
{ {
iamA = objType; iamA = objType;
searchValue = 0; searchValue = 0;
blocker = FALSE; blocker = false;
if ((objType == BRICK) || (objType == BETON) || (objType == FBRICK)) { if ((objType == BRICK) || (objType == BETON) || (objType == FBRICK)) {
blocker = TRUE; blocker = true;
} }
xpos = 0; xpos = 0;
ypos = 0; ypos = 0;
objectView = NULL; objectView = NULL;
} }
bool KGrObject::frozen = FALSE; // Initialise game as running, not halted. bool KGrObject::frozen = false; // Initialise game as running, not halted.
bool KGrObject::bugFixed = FALSE;// Initialise game with dynamic bug-fix OFF. bool KGrObject::bugFixed = false;// Initialise game with dynamic bug-fix OFF.
bool KGrObject::logging = FALSE;// Initialise game with log printing OFF. bool KGrObject::logging = false;// Initialise game with log printing OFF.
char KGrObject::whatIam () char KGrObject::whatIam ()
{ {
@ -103,7 +103,7 @@ KGrBrick::KGrBrick (char objType, int i, int j, KGrCanvas * view)
ypos = j; ypos = j;
objectView = view; objectView = view;
dig_counter = 0; dig_counter = 0;
holeFrozen = FALSE; holeFrozen = false;
iamA = BRICK; iamA = BRICK;
timer = new TQTimer (this); timer = new TQTimer (this);
connect (timer, TQ_SIGNAL (timeout ()), TQ_SLOT (timeDone ())); connect (timer, TQ_SIGNAL (timeout ()), TQ_SLOT (timeDone ()));
@ -116,12 +116,12 @@ void KGrBrick::dig (void)
iamA = HOLE; iamA = HOLE;
objectView->paintCell (xpos, ypos, BRICK, dig_counter); objectView->paintCell (xpos, ypos, BRICK, dig_counter);
objectView->updateCanvas(); objectView->updateCanvas();
timer->start ((DIGDELAY * NSPEED) / speed, TRUE); timer->start ((DIGDELAY * NSPEED) / speed, true);
} }
void KGrBrick::doStep() { void KGrBrick::doStep() {
if (holeFrozen) { if (holeFrozen) {
holeFrozen = FALSE; holeFrozen = false;
timeDone(); timeDone();
} }
} }
@ -137,19 +137,19 @@ void KGrBrick::showState (int i, int j)
void KGrBrick::timeDone () 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. // When the hole is complete, we need a longer delay.
if (dig_counter == 5) { if (dig_counter == 5) {
hole_counter--; hole_counter--;
if (hole_counter > 0) { if (hole_counter > 0) {
timer->start ((DIGDELAY * NSPEED) / speed, TRUE); timer->start ((DIGDELAY * NSPEED) / speed, true);
return; return;
} }
} }
if (dig_counter < 9) { if (dig_counter < 9) {
dig_counter++; dig_counter++;
timer->start ((DIGDELAY * NSPEED) / speed, TRUE); timer->start ((DIGDELAY * NSPEED) / speed, true);
if (dig_counter >= 8) if (dig_counter >= 8)
iamA = BRICK; iamA = BRICK;
} }

@ -41,7 +41,7 @@ public:
char whatIam(); char whatIam();
int searchValue; int searchValue;
bool blocker; // Beton or Brick -> TRUE bool blocker; // Beton or Brick -> true
void showState (int, int); void showState (int, int);
protected: protected:

@ -104,7 +104,7 @@ public:
TQPalette color(Player forWhom); 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); void checkComputerplayer(Player player);

@ -73,7 +73,7 @@ void Field::putBall(int x, int y, char color)
if( checkBounds(x,y) ){ if( checkBounds(x,y) ){
field[y][x].setColor(color); field[y][x].setColor(color);
erase5Balls(); erase5Balls();
repaint(FALSE); repaint(false);
} }
}*/ }*/
void Field::moveBall(int xa, int ya, int xb, int yb) void Field::moveBall(int xa, int ya, int xb, int yb)

@ -478,7 +478,7 @@ void KLines::undo()
updateStat(); updateStat();
lPrompt->SetBalls(nextBalls); lPrompt->SetBalls(nextBalls);
lsb->undo(); lsb->undo();
switchUndo(FALSE); switchUndo(false);
} }
void KLines::makeTurn() void KLines::makeTurn()

@ -54,12 +54,12 @@ LinesBoard::LinesBoard( BallPainter * abPainter, TQWidget* parent, const char* n
setFocusPolicy( TQWidget::NoFocus ); setFocusPolicy( TQWidget::NoFocus );
setBackgroundColor( gray ); setBackgroundColor( gray );
setMouseTracking( FALSE ); setMouseTracking( false );
setFixedSize(wHint(), hHint()); setFixedSize(wHint(), hHint());
timer = new TQTimer(this); timer = new TQTimer(this);
connect( timer, TQ_SIGNAL(timeout()), TQ_SLOT(timerSlot()) ); 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() { /*id LinesBoard::doAfterBalls() {
erase5Balls(); erase5Balls();
repaint(FALSE); repaint(false);
} }
*/ */
/* /*
@ -306,7 +306,7 @@ void LinesBoard::moveFocus(int dx, int dy)
focusX = (focusX + dx + NUMCELLSW) % NUMCELLSW; focusX = (focusX + dx + NUMCELLSW) % NUMCELLSW;
focusY = (focusY + dy + NUMCELLSH) % NUMCELLSH; focusY = (focusY + dy + NUMCELLSH) % NUMCELLSH;
} }
repaint(FALSE); repaint(false);
} }
void LinesBoard::moveLeft() void LinesBoard::moveLeft()
@ -401,7 +401,7 @@ int LinesBoard::AnimEnd( )
else if ( oldanim == ANIM_BURN ) else if ( oldanim == ANIM_BURN )
{ {
emit eraseLine( deleteAnimatedBalls() ); emit eraseLine( deleteAnimatedBalls() );
repaint(FALSE); repaint(false);
if ( nextBallToPlace < BALLSDROP ) if ( nextBallToPlace < BALLSDROP )
{ {
placeBall(); placeBall();
@ -455,7 +455,7 @@ void LinesBoard::AnimNext() {
if ( (direction > 0 && animstep == animmax) || ( direction < 0 && animstep == 0)) if ( (direction > 0 && animstep == animmax) || ( direction < 0 && animstep == 0))
direction = -direction; direction = -direction;
animstep += direction; animstep += direction;
repaint(FALSE); repaint(false);
} else { } else {
if ( animstep >= animmax ) if ( animstep >= animmax )
AnimEnd(); AnimEnd();
@ -466,7 +466,7 @@ void LinesBoard::AnimNext() {
moveBall(way[animstep].x,way[animstep].y,way[animstep+1].x,way[animstep+1].y); moveBall(way[animstep].x,way[animstep].y,way[animstep+1].x,way[animstep+1].y);
animstep++; animstep++;
animdelaycount = animdelaystart; animdelaycount = animdelaystart;
repaint( FALSE ); repaint( false );
} }
} }
} }
@ -698,7 +698,7 @@ void LinesBoard::undo()
AnimEnd(); AnimEnd();
restoreUndo(); restoreUndo();
restoreRandomState(); restoreRandomState();
repaint( FALSE ); repaint( false );
} }
void LinesBoard::showDemoText(const TQString &text) 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 = new TQLabel(0, "demoTip", WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM );
demoLabel->setMargin(1); demoLabel->setMargin(1);
demoLabel->setIndent(0); demoLabel->setIndent(0);
demoLabel->setAutoMask( FALSE ); demoLabel->setAutoMask( false );
demoLabel->setFrameStyle( TQFrame::Plain | TQFrame::Box ); demoLabel->setFrameStyle( TQFrame::Plain | TQFrame::Box );
demoLabel->setLineWidth( 1 ); demoLabel->setLineWidth( 1 );
demoLabel->setAlignment( AlignHCenter | AlignTop ); demoLabel->setAlignment( AlignHCenter | AlignTop );

@ -28,7 +28,7 @@ LinesPrompt::LinesPrompt( BallPainter * abPainter, TQWidget* parent, const char*
setFocusPolicy( TQWidget::NoFocus ); setFocusPolicy( TQWidget::NoFocus );
setBackgroundColor( gray ); setBackgroundColor( gray );
setMouseTracking( FALSE ); setMouseTracking( false );
setFixedSize(wPrompt(), hPrompt()); setFixedSize(wPrompt(), hPrompt());
PromptEnabled = true; PromptEnabled = true;

@ -288,7 +288,7 @@ void Card::flipTo(int x2, int y2, int steps)
m_animSteps = steps; m_animSteps = steps;
setVelocity(dx/m_animSteps, dy/m_animSteps-flipLift); 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. // Reset all things that might have changed during the animation.
scaleX = 1.0; scaleX = 1.0;
scaleY = 1.0; scaleY = 1.0;
m_flipping = FALSE; m_flipping = false;
setVelocity(0, 0); setVelocity(0, 0);
// Move the card to its destination immediately. // Move the card to its destination immediately.
@ -374,7 +374,7 @@ void Card::getUp(int steps)
// Animation // Animation
m_animSteps = steps; m_animSteps = steps;
setVelocity(0, 0); setVelocity(0, 0);
setAnimated(TRUE); setAnimated(true);
} }
#include "card.moc" #include "card.moc"

@ -25,9 +25,6 @@
#include "dmalloc.h" #include "dmalloc.h"
#endif #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 /* 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 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... */ the list is sorted ascending or descending... */
@ -50,10 +47,10 @@ void freecell_solver_PQueueInitialise(
} }
/* join a priority queue /* 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 */ 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; uint32 i;
pq_element_t * Elements = pq->Elements; 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; pq->CurrentSize = CurrentSize;
return TRUE; return;
} }
#define PQueueIsEmpty(pq) ((pq)->CurrentSize == 0) #define PQueueIsEmpty(pq) ((pq)->CurrentSize == 0)

@ -58,7 +58,7 @@ void freecell_solver_PQueueInitialise(
void freecell_solver_PQueueFree( PQUEUE *pq ); 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); void *freecell_solver_PQueuePop( PQUEUE *pq);

@ -438,7 +438,7 @@ void kpok::newRound()
paintCash(); paintCash();
drawTimer->start(drawDelay, TRUE); drawTimer->start(drawDelay, true);
} }
@ -763,9 +763,9 @@ void kpok::drawClick()
} }
if (playerBox[0]->getHeld(0)) if (playerBox[0]->getHeld(0))
drawTimer->start(0, TRUE); drawTimer->start(0, true);
else else
drawTimer->start(drawDelay, TRUE); drawTimer->start(drawDelay, true);
} }
else if (m_game.getState() == StateBet2) { // raise else if (m_game.getState() == StateBet2) { // raise
setBetButtonEnabled(false); setBetButtonEnabled(false);
@ -905,9 +905,9 @@ void kpok::drawCardsEvent()
drawStat++; drawStat++;
// look at next card and if it is held instantly call drawCardEvent again // look at next card and if it is held instantly call drawCardEvent again
if (playerBox[0]->getHeld(drawStat)) if (playerBox[0]->getHeld(drawStat))
drawTimer->start(0,TRUE); drawTimer->start(0,true);
else else
drawTimer->start(drawDelay,TRUE); drawTimer->start(drawDelay,true);
} }
} }
@ -1028,7 +1028,7 @@ void kpok::stopWave()
{ {
waveTimer->stop(); waveTimer->stop();
fCount = -1; /* clear image */ fCount = -1; /* clear image */
repaint ( FALSE ); repaint ( false );
waveActive = false; waveActive = false;
} }
@ -1042,7 +1042,7 @@ void kpok::stopDrawing()
void kpok::waveTimerEvent() void kpok::waveTimerEvent()
{ {
fCount = (fCount + 1) & 15; fCount = (fCount + 1) & 15;
repaint( FALSE ); repaint( false );
} }

@ -80,7 +80,7 @@ public:
void setShowLastMove(bool show); void setShowLastMove(bool show);
// View methods called from the outside. // View methods called from the outside.
void updateBoard(bool force = FALSE); void updateBoard(bool force = false);
void animateChanged(Move move); void animateChanged(Move move);
void setAnimationSpeed(uint); void setAnimationSpeed(uint);

@ -344,7 +344,7 @@ void KReversi::slotUndo()
void KReversi::slotInterrupt() void KReversi::slotInterrupt()
{ {
m_engine->setInterrupt(TRUE); m_engine->setInterrupt(true);
// Indicate that the computer was interrupted. // Indicate that the computer was interrupted.
showTurn(); showTurn();
@ -706,7 +706,7 @@ bool KReversi::loadGame(TDEConfig *config)
m_humanColor = (Color) config->readNumEntry("HumanColor"); m_humanColor = (Color) config->readNumEntry("HumanColor");
m_competitiveGame = (bool) config->readNumEntry("Competitive"); m_competitiveGame = (bool) config->readNumEntry("Competitive");
m_gameView->updateBoard(TRUE); m_gameView->updateBoard(true);
setState(State(config->readNumEntry("State"))); setState(State(config->readNumEntry("State")));
setStrength(config->readNumEntry("Strength", 1)); setStrength(config->readNumEntry("Strength", 1));

@ -78,7 +78,7 @@ public:
// Methods that deal with the engine. // Methods that deal with the engine.
void setStrength(uint); void setStrength(uint);
uint strength() const { return m_engine->strength(); } 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() bool interrupted() const { return (m_game->toMove() == computerColor()
&& m_state == Ready); } && m_state == Ready); }

@ -77,7 +77,7 @@ class QReversiGame : public TQObject, public Game {
#if 0 #if 0
void loadSettings(); void loadSettings();
bool loadGame(TDEConfig *, bool noupdate = FALSE); bool loadGame(TDEConfig *, bool noupdate = false);
void saveGame(TDEConfig *); void saveGame(TDEConfig *);
#endif #endif

@ -130,7 +130,7 @@ public slots:
void updateView(); // Update the entire view. void updateView(); // Update the entire view.
void updateStatus(); // Update the status widgets (score) 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. void updateMovelist(); // Update the move list.
signals: signals:

@ -279,7 +279,7 @@ StoneWidget::paintEvent( TQPaintEvent *e ) {
bitBlt(this,cx,cy, bitBlt(this,cx,cy,
&map[stone->color-1][tslice].stone, &map[stone->color-1][tslice].stone,
0, 0, 0, 0,
stone_width,stone_height,CopyROP,FALSE); stone_width,stone_height,CopyROP,false);
} else { } else {
erase(cx, cy, stone_width, stone_height); erase(cx, cy, stone_width, stone_height);

@ -108,7 +108,7 @@ public:
int getCurrentTime() const; int getCurrentTime() const;
int getTimeForGame() const; int getTimeForGame() const;
bool solvable(bool norestore = FALSE); bool solvable(bool norestore = false);
bool getSolvableFlag() const; bool getSolvableFlag() const;
void setSolvableFlag(bool); void setSolvableFlag(bool);

@ -69,7 +69,7 @@ protected:
void appendSamy(); void appendSamy();
void updateSamy(); void updateSamy();
int tail() const { return (list.count() -1 ); } int tail() const { return (list.count() -1 ); }
bool growing() const { return (grow > 0 ? TRUE : FALSE); } bool growing() const { return (grow > 0); }
int hold; int hold;
int grow; int grow;

@ -299,8 +299,8 @@ bool BaseBoard::timeout()
Q_ASSERT( graphic() ); Q_ASSERT( graphic() );
if ( state==GameOver ) return true; if ( state==GameOver ) return true;
switch (state) { switch (state) {
case BeforeRemove: _beforeRemove(FALSE); break; case BeforeRemove: _beforeRemove(false); break;
case AfterRemove: _afterRemove(FALSE); break; case AfterRemove: _afterRemove(false); break;
default: return false; default: return false;
} }
main->update(); main->update();

@ -74,9 +74,9 @@ void SequenceArray::setBlockSize(uint bsize)
_size = bsize; _size = bsize;
const GPieceInfo &pinfo = Piece::info(); const GPieceInfo &pinfo = Piece::info();
TQPtrList<TQPixmap> pixmaps; TQPtrList<TQPixmap> pixmaps;
pixmaps.setAutoDelete(TRUE); pixmaps.setAutoDelete(true);
TQPtrList<TQPoint> points; TQPtrList<TQPoint> points;
points.setAutoDelete(TRUE); points.setAutoDelete(true);
uint nm = pinfo.nbBlockModes(); uint nm = pinfo.nbBlockModes();
for (uint i=0; i<size(); i++) { for (uint i=0; i<size(); i++) {
for (uint k=0; k<2; k++) for (uint k=0; k<2; k++)

@ -82,14 +82,14 @@ class Led : public TQWidget
{ {
public: public:
Led(const TQColor &c, TQWidget *parent) Led(const TQColor &c, TQWidget *parent)
: TQWidget(parent), col(c), _on(FALSE) {} : TQWidget(parent), col(c), _on(false) {}
TQSizePolicy sizePolicy() const TQSizePolicy sizePolicy() const
{ return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); } { return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); }
TQSize sizeHint() const { return TQSize(LED_WIDTH, LED_HEIGHT); } TQSize sizeHint() const { return TQSize(LED_WIDTH, LED_HEIGHT); }
void on() { if (!_on) { _on = TRUE; repaint(); } } void on() { if (!_on) { _on = true; repaint(); } }
void off() { if (_on) {_on = FALSE; repaint(); } } void off() { if (_on) {_on = false; repaint(); } }
void setColor(const TQColor &c) { if (c!=col) { col = c; repaint(); } } void setColor(const TQColor &c) { if (c!=col) { col = c; repaint(); } }
protected: protected:

@ -39,12 +39,12 @@ void Local::writeData(bool inverse)
void Local::treatData() void Local::treatData()
{ {
readData(TRUE); readData(true);
interface->treatData(); interface->treatData();
// check reading stream // check reading stream
for (uint i=0; i<ios.size(); i++) for (uint i=0; i<ios.size(); i++)
if ( !ios[i]->reading.readOk() ) DATA_ERROR(i); if ( !ios[i]->reading.readOk() ) DATA_ERROR(i);
writeData(TRUE); writeData(true);
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -61,7 +61,7 @@ void Server::congestion()
void Server::serverTimeout() void Server::serverTimeout()
{ {
ctimer.start(2*interval, TRUE); ctimer.start(2*interval, true);
timeout(); timeout();
} }
@ -75,7 +75,7 @@ Network::Network(MPInterface *_interface,
TQPtrListIterator<RemoteHostData> it(rhd); TQPtrListIterator<RemoteHostData> it(rhd);
for (; it.current(); ++it) { for (; it.current(); ++it) {
rd.socket = it.current()->socket; rd.socket = it.current()->socket;
rd.socket->notifier()->setEnabled(TRUE); rd.socket->notifier()->setEnabled(true);
connect(rd.socket->notifier(), TQ_SIGNAL(activated(int)), connect(rd.socket->notifier(), TQ_SIGNAL(activated(int)),
TQ_SLOT(notifier(int))); TQ_SLOT(notifier(int)));
uint nb = it.current()->bds.count(); uint nb = it.current()->bds.count();
@ -122,7 +122,7 @@ IOBuffer *Network::ioBuffer(uint i) const
if ( i<remotes[k].array->size() ) return (*remotes[k].array)[i]; if ( i<remotes[k].array->size() ) return (*remotes[k].array)[i];
i -= remotes[k].array->size(); i -= remotes[k].array->size();
} }
Q_ASSERT(FALSE); Q_ASSERT(false);
return 0; return 0;
} }
@ -170,7 +170,7 @@ NetworkServer::NetworkServer(MPInterface *_interface,
connect(&timer, TQ_SIGNAL(timeout()), TQ_SLOT(timeoutSlot())); connect(&timer, TQ_SIGNAL(timeout()), TQ_SLOT(timeoutSlot()));
connect(&ctimer, TQ_SIGNAL(timeout()), TQ_SLOT(congestionTimeoutSlot())); connect(&ctimer, TQ_SIGNAL(timeout()), TQ_SLOT(congestionTimeoutSlot()));
// to catch unexpected data // to catch unexpected data
for (uint i=0; i<remotes.count(); i++) remotes[i].received = TRUE; for (uint i=0; i<remotes.count(); i++) remotes[i].received = true;
nbReceived = remotes.count(); nbReceived = remotes.count();
// let the client the time to create itself ... // let the client the time to create itself ...
// serverTimeout(); // serverTimeout();
@ -180,7 +180,7 @@ void NetworkServer::timeout()
{ {
if ( nbReceived<remotes.count() ) LAG_ERROR; if ( nbReceived<remotes.count() ) LAG_ERROR;
nbReceived = 0; nbReceived = 0;
for (uint i=0; i<remotes.count(); i++) remotes[i].received = FALSE; for (uint i=0; i<remotes.count(); i++) remotes[i].received = false;
// send MF_ASK : asking for data from clients // send MF_ASK : asking for data from clients
for (uint i=0; i<remotes.count(); i++) { for (uint i=0; i<remotes.count(); i++) {
remotes[i].socket->writingStream() << MF_Ask; remotes[i].socket->writingStream() << MF_Ask;
@ -202,7 +202,7 @@ void NetworkServer::notifier(int fd)
case 0: BROKE_ERROR(i); case 0: BROKE_ERROR(i);
} }
remotes[i].received = TRUE; remotes[i].received = true;
nbReceived++; nbReceived++;
ReadingStream &s = remotes[i].socket->readingStream(); ReadingStream &s = remotes[i].socket->readingStream();
@ -256,7 +256,7 @@ void Client::notifier(int)
case MF_Ask: case MF_Ask:
// write data from local boards to server socket (cleaning // write data from local boards to server socket (cleaning
// of writing stream is done in write()) // of writing stream is done in write())
readData(FALSE); readData(false);
remotes[0].socket->writingStream() << ios; remotes[0].socket->writingStream() << ios;
// debug("CLIENT : send ios (size=%i)", // debug("CLIENT : send ios (size=%i)",
// remotes[0].socket->writingStream().size()); // remotes[0].socket->writingStream().size());
@ -270,7 +270,7 @@ void Client::notifier(int)
interface->dataFromServer(s); interface->dataFromServer(s);
// debug("CLIENT : after dataFromServer (at=%i)", s.device()->at()); // debug("CLIENT : after dataFromServer (at=%i)", s.device()->at());
if ( !s.readOk() ) DATA_ERROR(0); if ( !s.readOk() ) DATA_ERROR(0);
writeData(FALSE); writeData(false);
break; break;
default: DATA_ERROR(0); default: DATA_ERROR(0);
} }

@ -18,10 +18,10 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket,
: KDialogBase(Plain, i18n("Network Meeting"), : KDialogBase(Plain, i18n("Network Meeting"),
(_server ? Ok|Cancel|Help : Cancel|Help), (_server ? Ok|Cancel|Help : Cancel|Help),
(_server ? Ok : Cancel), parent, name), (_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.append(socket, SocketManager::ReadWrite);
sm[0]->notifier()->setEnabled(TRUE); sm[0]->notifier()->setEnabled(true);
/* top layout */ /* top layout */
TQVBoxLayout *top = new TQVBoxLayout(plainPage(), spacingHint()); TQVBoxLayout *top = new TQVBoxLayout(plainPage(), spacingHint());
@ -49,13 +49,13 @@ NetMeeting::NetMeeting(const cId &_id, Socket *socket,
top->addWidget(status); top->addWidget(status);
// buttons // buttons
enableButtonSeparator(TRUE); enableButtonSeparator(true);
if (server) { if (server) {
setButtonOK(i18n("Start Game")); setButtonOK(i18n("Start Game"));
enableButtonOK(FALSE); enableButtonOK(false);
} }
setButtonCancel(server ? i18n("Abort") : i18n("Quit")); setButtonCancel(server ? i18n("Abort") : i18n("Quit"));
enableButton(Help, FALSE); enableButton(Help, false);
} }
NetMeeting::~NetMeeting() NetMeeting::~NetMeeting()
@ -115,7 +115,7 @@ bool NetMeeting::ready() const
for(uint k=0; k<wl->size(); k++) { for(uint k=0; k<wl->size(); k++) {
switch ( wl->widget(k)->type() ) { switch ( wl->widget(k)->type() ) {
case MeetingCheckBox::Ready : nbReady++; break; case MeetingCheckBox::Ready : nbReady++; break;
case MeetingCheckBox::NotReady : return FALSE; case MeetingCheckBox::NotReady : return false;
default : break; default : break;
} }
} }
@ -163,7 +163,7 @@ void NetMeeting::readData(uint i)
default: dataError(i); default: dataError(i);
} }
if (socketRemoved) socketRemoved = FALSE; if (socketRemoved) socketRemoved = false;
else if ( !sm[i]->readingStream().atEnd() ) else if ( !sm[i]->readingStream().atEnd() )
readData(i); // more pending data readData(i); // more pending data
} }
@ -214,7 +214,7 @@ void NetMeeting::message(const TQString &str)
ServerNetMeeting::ServerNetMeeting(const cId &id, ServerNetMeeting::ServerNetMeeting(const cId &id,
const RemoteHostData &r, MPOptionWidget *option, const RemoteHostData &r, MPOptionWidget *option,
TQPtrList<RemoteHostData> &arhd, TQWidget *parent, const char * name) TQPtrList<RemoteHostData> &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))); connect(sm[0]->notifier(), TQ_SIGNAL(activated(int)), TQ_SLOT(newHost(int)));
players.append(Accepted); // server players.append(Accepted); // server
@ -247,7 +247,7 @@ void ServerNetMeeting::netError(uint i, const TQString &type)
void ServerNetMeeting::disconnectHost(uint i, const TQString &str) void ServerNetMeeting::disconnectHost(uint i, const TQString &str)
{ {
sm.remove(i, true); sm.remove(i, true);
socketRemoved = TRUE; socketRemoved = true;
if ( players[i]==Accepted ) { if ( players[i]==Accepted ) {
removeLine(i-1); removeLine(i-1);
@ -273,7 +273,7 @@ void ServerNetMeeting::newHost(int)
uint i = sm.append(socket, SocketManager::ReadWrite); uint i = sm.append(socket, SocketManager::ReadWrite);
connect(sm[i]->notifier(), TQ_SIGNAL(activated(int)), connect(sm[i]->notifier(), TQ_SIGNAL(activated(int)),
TQ_SLOT(readNotifier(int))); TQ_SLOT(readNotifier(int)));
sm[i]->notifier()->setEnabled(TRUE); sm[i]->notifier()->setEnabled(true);
} }
void ServerNetMeeting::idFlag(uint i) void ServerNetMeeting::idFlag(uint i)
@ -314,10 +314,10 @@ void ServerNetMeeting::newFlag(uint i)
CHECK_READ(i); CHECK_READ(i);
// complete the MeetingLineData struct with initial values // 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.type = MeetingCheckBox::NotReady; // not ready by default
pld.ed.text = ""; // empty line to begin with 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 // send to the new client already present lines including its own
// (New flag + MeetingLineData struct) // (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) // send to all other clients the new line (New flag + MeetingLineData struct)
wl->widget(i-1)->data(pld.ed); wl->widget(i-1)->data(pld.ed);
pld.own = FALSE; pld.own = false;
sm.commonWritingStream() << NewFlag << pld; sm.commonWritingStream() << NewFlag << pld;
writeToAll(i); writeToAll(i);
} }
@ -407,12 +407,12 @@ void ServerNetMeeting::accept()
ExtData ed; ExtData ed;
bool willPlay; bool willPlay;
for (uint k=1; k<players.count(); k++) { for (uint k=1; k<players.count(); k++) {
willPlay = FALSE; willPlay = false;
if ( players[k]==Accepted ) { // client with lines if ( players[k]==Accepted ) { // client with lines
wl->widget(k-1)->data(ed); wl->widget(k-1)->data(ed);
if ( ed.type==MeetingCheckBox::Ready ) { if ( ed.type==MeetingCheckBox::Ready ) {
willPlay = TRUE; willPlay = true;
RemoteHostData *r = new RemoteHostData; RemoteHostData *r = new RemoteHostData;
r->socket = sm[0]; r->socket = sm[0];
r->bds = ed.bds; r->bds = ed.bds;
@ -449,7 +449,7 @@ void ServerNetMeeting::optionsChanged()
ClientNetMeeting::ClientNetMeeting(const cId &id, ClientNetMeeting::ClientNetMeeting(const cId &id,
const RemoteHostData &rhd, MPOptionWidget *option, const RemoteHostData &rhd, MPOptionWidget *option,
TQWidget *parent, const char * name) 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)), connect(sm[0]->notifier(), TQ_SIGNAL(activated(int)),
TQ_SLOT(readNotifier(int))); TQ_SLOT(readNotifier(int)));
@ -499,7 +499,7 @@ void ClientNetMeeting::newFlag(uint)
} else { } else {
MeetingLineData pld; MeetingLineData pld;
sm[0]->readingStream() >> pld; sm[0]->readingStream() >> pld;
appendLine(pld, FALSE); appendLine(pld, false);
} }
CHECK_READ(0); CHECK_READ(0);
} }

@ -19,9 +19,9 @@ class MPBoard : public TQWidget
/** /**
* This method is called once at the board creation. * This method is called once at the board creation.
* @param AI is TRUE if the player is not human. * @param AI is true if the player is not human.
* @param multiplayers is TRUE if the game is not a single player game. * @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 first is true if this board is the first local one.
*/ */
virtual void init(bool AI, bool multiplayers, bool server, bool first, virtual void init(bool AI, bool multiplayers, bool server, bool first,
const TQString &name) = 0; const TQString &name) = 0;

@ -64,7 +64,7 @@ void MPInterface::dialog()
// net meeting // net meeting
TQPtrList<RemoteHostData> rhd; TQPtrList<RemoteHostData> rhd;
rhd.setAutoDelete(TRUE); rhd.setAutoDelete(true);
if (cd.network) { if (cd.network) {
cId id(tdeApp->name(), gameInfo.gameId); cId id(tdeApp->name(), gameInfo.gameId);
MPOptionWidget *ow = newOptionWidget(); MPOptionWidget *ow = newOptionWidget();
@ -110,8 +110,8 @@ void MPInterface::specialLocalGame(uint nbHumans, uint nbAIs)
: i18n("AI %1").arg(i-nbHumans+1)); : i18n("AI %1").arg(i-nbHumans+1));
cd.rhd.bds += bd; cd.rhd.bds += bd;
} }
cd.server = TRUE; cd.server = true;
cd.network = FALSE; cd.network = false;
Q_ASSERT( (nbHumans+nbAIs)<=gameInfo.maxNbLocalPlayers ); Q_ASSERT( (nbHumans+nbAIs)<=gameInfo.maxNbLocalPlayers );
Q_ASSERT( gameInfo.AIAllowed || nbAIs==0 ); Q_ASSERT( gameInfo.AIAllowed || nbAIs==0 );
@ -255,7 +255,7 @@ void MPInterface::hostDisconnected(uint, const TQString &msg)
errorBox(msg, TQString(), this); errorBox(msg, TQString(), this);
if ( !disconnected ) { // to avoid multiple calls if ( !disconnected ) { // to avoid multiple calls
disconnected = TRUE; disconnected = true;
// the zero timer is used to be outside the "internal" class // the zero timer is used to be outside the "internal" class
TQTimer::singleShot(0, this, TQ_SLOT(singleHumanSlot())); TQTimer::singleShot(0, this, TQ_SLOT(singleHumanSlot()));
} }
@ -263,7 +263,7 @@ void MPInterface::hostDisconnected(uint, const TQString &msg)
void MPInterface::singleHumanSlot() void MPInterface::singleHumanSlot()
{ {
disconnected = FALSE; disconnected = false;
singleHuman(); singleHuman();
} }

@ -49,19 +49,19 @@ void MPSimpleBoard::pauseFlag()
void MPSimpleBoard::gameOverFlag() void MPSimpleBoard::gameOverFlag()
{ {
Q_ASSERT( BS_Play ); Q_ASSERT( BS_Play );
_stop(TRUE); _stop(true);
state = BS_Stop; state = BS_Stop;
} }
void MPSimpleBoard::stopFlag() void MPSimpleBoard::stopFlag()
{ {
_stop(FALSE); _stop(false);
state = BS_Standby; state = BS_Standby;
} }
void MPSimpleBoard::_stop(bool gameover) void MPSimpleBoard::_stop(bool gameover)
{ {
if ( state==BS_Pause ) _pauseFlag(FALSE); if ( state==BS_Pause ) _pauseFlag(false);
emit enableKeys(false); emit enableKeys(false);
_stopFlag(gameover); _stopFlag(gameover);
} }

@ -21,7 +21,7 @@ void MPSimpleInterface::init()
{ {
if ( server() ) { if ( server() ) {
state = SS_Standby; state = SS_Standby;
first_init = TRUE; first_init = true;
} }
_init(); _init();
} }
@ -90,8 +90,8 @@ void MPSimpleInterface::treatData()
case SS_Pause: break; case SS_Pause: break;
case SS_Stop: treatStop(); break; case SS_Stop: treatStop(); break;
case SS_Standby: break; case SS_Standby: break;
case SS_PauseAsked: treatPause(TRUE); break; case SS_PauseAsked: treatPause(true); break;
case SS_UnpauseAsked: treatPause(FALSE); break; case SS_UnpauseAsked: treatPause(false); break;
} }
} }
@ -101,7 +101,7 @@ void MPSimpleInterface::treatInit()
if (first_init) { if (first_init) {
_firstInit(); _firstInit();
first_init = FALSE; first_init = false;
} }
IO_Flag f(IO_Flag::Init); IO_Flag f(IO_Flag::Init);

@ -20,7 +20,7 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine,
/* TriCheckBox */ /* TriCheckBox */
tcb = new MeetingCheckBox(MeetingCheckBox::Ready, isOwner, serverIsReader, tcb = new MeetingCheckBox(MeetingCheckBox::Ready, isOwner, serverIsReader,
this); 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))); else connect(tcb, TQ_SIGNAL(changed(int)), TQ_SLOT(_typeChanged(int)));
hbl->addWidget(tcb); hbl->addWidget(tcb);
@ -31,7 +31,7 @@ MeetingLine::MeetingLine(bool isOwner, bool serverIsReader, bool serverLine,
lname->setLineWidth(2); lname->setLineWidth(2);
lname->setMidLineWidth(3); lname->setMidLineWidth(3);
TQFont f = lname->font(); TQFont f = lname->font();
f.setBold(TRUE); f.setBold(true);
lname->setFont(f); lname->setFont(f);
lname->setFixedSize(lname->fontMetrics().maxWidth()*NAME_MAX_LENGTH, lname->setFixedSize(lname->fontMetrics().maxWidth()*NAME_MAX_LENGTH,
lname->sizeHint().height()); lname->sizeHint().height());
@ -131,7 +131,7 @@ void PlayerLine::setSlot()
GWidgetList::GWidgetList(uint interval, TQWidget *parent, const char * name) GWidgetList::GWidgetList(uint interval, TQWidget *parent, const char * name)
: TQWidget(parent, name), vbl(this, interval) : TQWidget(parent, name), vbl(this, interval)
{ {
widgets.setAutoDelete(TRUE); widgets.setAutoDelete(true);
} }
void GWidgetList::append(TQWidget *wi) void GWidgetList::append(TQWidget *wi)

@ -57,10 +57,10 @@ class SocketManager
*/ */
void remove(uint i, bool deleteSocket); 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); 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); bool canWrite(uint i, uint sec = 0, uint usec = 0);
Stream &commonWritingStream() { return writing; } Stream &commonWritingStream() { return writing; }

@ -28,7 +28,7 @@ Socket::Socket(KExtendedSocket *s, bool createNotifier,
if (createNotifier) { if (createNotifier) {
_notifier = new TQSocketNotifier(s->fd(), TQSocketNotifier::Read, _notifier = new TQSocketNotifier(s->fd(), TQSocketNotifier::Read,
parent, name); parent, name);
_notifier->setEnabled(FALSE); _notifier->setEnabled(false);
} }
} }

@ -11,7 +11,7 @@
class Socket class Socket
{ {
public: public:
Socket(KExtendedSocket *, bool createNotifier = FALSE, Socket(KExtendedSocket *, bool createNotifier = false,
TQObject *parent = 0, const char *name = 0); TQObject *parent = 0, const char *name = 0);
/** close the socket */ /** close the socket */
@ -33,7 +33,7 @@ class Socket
/** /**
* Write data contained in the writing stream to the socket. * Write data contained in the writing stream to the socket.
* It clears the stream. * It clears the stream.
* @return TRUE if all was written without error. * @return true if all was written without error.
*/ */
bool write(); bool write();
bool write(const TQByteArray &a); bool write(const TQByteArray &a);

@ -33,7 +33,7 @@
MPWizard::MPWizard(const MPGameInfo &gi, ConnectionData &_cd, MPWizard::MPWizard(const MPGameInfo &gi, ConnectionData &_cd,
TQWidget *parent, const char *name) TQWidget *parent, const char *name)
: KWizard(parent, name, TRUE), cd(_cd) : KWizard(parent, name, true), cd(_cd)
{ {
// setupTypePage(); // #### REMOVE NETWORK GAMES UNTIL FIXED // setupTypePage(); // #### REMOVE NETWORK GAMES UNTIL FIXED
type = Local; type = Local;
@ -70,7 +70,7 @@ void MPWizard::setupTypePage()
eport->setRange(MIN_USER_PORT, MAX_USER_PORT, 1, false); eport->setRange(MIN_USER_PORT, MAX_USER_PORT, 1, false);
addPage(typePage, i18n("Choose Game Type")); addPage(typePage, i18n("Choose Game Type"));
setHelpEnabled(typePage, FALSE); setHelpEnabled(typePage, false);
typeChanged(type); typeChanged(type);
} }
@ -115,7 +115,7 @@ void MPWizard::setupLocalPage(const MPGameInfo &gi)
// connect(keys, TQ_SIGNAL(clicked()), TQ_SLOT(configureKeysSlot())); // connect(keys, TQ_SIGNAL(clicked()), TQ_SLOT(configureKeysSlot()));
addPage(localPage, i18n("Local Player's Settings")); addPage(localPage, i18n("Local Player's Settings"));
setHelpEnabled(localPage, FALSE); setHelpEnabled(localPage, false);
lineTypeChanged(0); lineTypeChanged(0);
} }
@ -148,10 +148,10 @@ void MPWizard::typeChanged(int t)
void MPWizard::lineTypeChanged(int) void MPWizard::lineTypeChanged(int)
{ {
bool b = FALSE; bool b = false;
for (uint i=0; i<wl->size(); i++) for (uint i=0; i<wl->size(); i++)
if ( wl->widget(i)->type()==PlayerComboBox::Human ) { if ( wl->widget(i)->type()==PlayerComboBox::Human ) {
b = TRUE; b = true;
break; break;
} }
// keys->setEnabled(b); // keys->setEnabled(b);
@ -216,7 +216,7 @@ void MPWizard::accept()
void MPWizard::showPage(TQWidget *page) void MPWizard::showPage(TQWidget *page)
{ {
if ( page==localPage ) setFinishEnabled(localPage, TRUE); if ( page==localPage ) setFinishEnabled(localPage, true);
KWizard::showPage(page); KWizard::showPage(page);
} }

@ -130,13 +130,13 @@ public:
* *
* @param flags what to show * @param flags what to show
* *
* @param randomDeck if this pointer is non-zero, *ok is set to TRUE if * @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 * 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. * config file of your game to load a random deck on startup.
* See @ref getRandomDeck() * See @ref getRandomDeck()
* *
* @param randomCardDir if this pointer is non-zero, *ok is set to TRUE if * @param randomCardDir if this pointer is non-zero, *ok is set to true if
* the user wants a random card otherwise to FALSE. * the user wants a random card otherwise to false.
* Use this in the config file of your game to load a random card * Use this in the config file of your game to load a random card
* foregrounds on startup. * foregrounds on startup.
* See @ref getRandomCardDir() * See @ref getRandomCardDir()
@ -271,24 +271,24 @@ public:
void setupDialog(bool showResizeBox = false); void setupDialog(bool showResizeBox = false);
/** /**
* @return TRUE if the selected deck is a random deck (i.e. the user checked * @return true if the selected deck is a random deck (i.e. the user checked
* the random checkbox) otherwise FALSE * the random checkbox) otherwise false
**/ **/
bool isRandomDeck() const; bool isRandomDeck() const;
/** /**
* @return TRUE if the selected carddir is a random dir (i.e. the user * @return true if the selected carddir is a random dir (i.e. the user
* checked the random checkbox) otherwise FALSE * checked the random checkbox) otherwise false
**/ **/
bool isRandomCardDir() const; bool isRandomCardDir() const;
/** /**
* @return TRUE if the global checkbox was selected * @return true if the global checkbox was selected
**/ **/
bool isGlobalDeck() const; bool isGlobalDeck() const;
/** /**
* @return TRUE if the global checkbox was selected * @return true if the global checkbox was selected
**/ **/
bool isGlobalCardDir() const; bool isGlobalCardDir() const;

@ -21,7 +21,7 @@
be made a virtual function? be made a virtual function?
MH: This is done now. As this is a central function your programs will 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 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 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. 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 Therefore there can be only one function processing the input. If you really

@ -301,7 +301,7 @@ protected slots:
/** /**
* Called when the ADMIN status of this KGame client changes. See * Called when the ADMIN status of this KGame client changes. See
* KGameNetwork::signalAdminStatusChanged * 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); void setAdmin(bool isAdmin);

@ -122,7 +122,7 @@ public:
KPlayer* owner() const; 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 * @ref setAdmin
**/ **/
bool admin() const; bool admin() const;
@ -157,7 +157,7 @@ public:
* *
* @param parent Parent widget for this dialog. * @param parent Parent widget for this dialog.
* @param initializeGUI If you really don't want to use the * @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) * of the predefined widgets (currently only the name of the player)
* will exist anymore. * will exist anymore.
* *

@ -521,7 +521,7 @@ signals:
* removed. * removed.
* @param player The player that is about to be removed. Add your new * @param player The player that is about to be removed. Add your new
* KGameIO here - but only on <em>one</em> client! * KGameIO here - but only on <em>one</em> 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. * removed completely.
**/ **/
void signalReplacePlayerIO(KPlayer* player, bool* remove); void signalReplacePlayerIO(KPlayer* player, bool* remove);
@ -679,11 +679,11 @@ protected:
* the given player. * the given player.
* Note that you HAVE to overwrite this function. Otherwise your * Note that you HAVE to overwrite this function. Otherwise your
* game makes no sense at all. * 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 * the game sequence is proceeded by calling @ref playerInputFinished
* which in turn will check for game over or the next player * 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 * 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. * and then manually call @ref playerInputFinished to resume it.
* Example: * Example:
* \code * \code
@ -709,7 +709,7 @@ protected:
* checks for game over and nextPlayer (in the case of turn base games) * checks for game over and nextPlayer (in the case of turn base games)
* are processed. * are processed.
* Call this manually if you have a delayed move, i.e. your playerInput * 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. * here.
* *
* @return the current player * @return the current player
@ -880,7 +880,7 @@ protected:
* *
* @param stream a data stream where you can stream the game from * @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 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? * @return true?
*/ */

@ -137,11 +137,11 @@ signals:
* when you get the turn status or when you lose it. * 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 * 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 * send parameter to false then nothing happens: the datastream will be
* ignored. If you set it to TRUE @ref sendInput is used to * ignored. If you set it to true @ref sendInput is used to
* send the move. * 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 * 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 * doesn't react immediately. But you can still use this e.g. to notify the
* player about the turn change. * player about the turn change.

@ -61,7 +61,7 @@ public:
virtual void Debug(); 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. * connected to a remote MASTER.
**/ **/
bool isNetwork() const; bool isNetwork() const;
@ -144,7 +144,7 @@ public:
/** /**
* @since 3.2 * @since 3.2
* @return The name of the host that we are currently connected to is * @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". * was called. Otherwise this will return "localhost".
**/ **/
TQString hostName() const; TQString hostName() const;
@ -381,7 +381,7 @@ signals:
/** /**
* This client gets or loses the admin status. * This client gets or loses the admin status.
* @see KMessageClient::adminStatusChanged * @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); void signalAdminStatusChanged(bool isAdmin);

@ -338,8 +338,8 @@ protected:
* This does <em>not</em> send the current value but the explicitly * This does <em>not</em> send the current value but the explicitly
* given value. * given value.
* *
* @return TRUE if the message could be sent successfully, otherwise * @return true if the message could be sent successfully, otherwise
* FALSE * false
**/ **/
bool sendProperty(const TQByteArray& b); bool sendProperty(const TQByteArray& b);
@ -774,7 +774,7 @@ public:
* other client) or when a game is loaded (and maybe on some other * other client) or when a game is loaded (and maybe on some other
* events). * events).
* *
* Also calls emitSignal if isEmittingSignal is TRUE. * Also calls emitSignal if isEmittingSignal is true.
* @param s The stream to read from * @param s The stream to read from
**/ **/
virtual void load(TQDataStream& s) virtual void load(TQDataStream& s)

@ -159,13 +159,13 @@ public:
bool isConnected () const; 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. KMessageDirect) connection.
*/ */
bool isNetwork () const; 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. connected to. See also KMessageIO::peerPort and TQSocket::peerPort.
@since 3.2 @since 3.2
*/ */
@ -173,7 +173,7 @@ public:
/** /**
@since 3.2 @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(). connected to. See also KMessageIO::peerName() and TQSocket::peerName().
*/ */
TQString peerName() const; TQString peerName() const;

@ -246,7 +246,7 @@ public:
virtual TQString peerName () const; 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; } 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; } bool isNetwork() const { return false; }
@ -361,7 +361,7 @@ class KMessageProcess : public KMessageIO
void writeToProcess(); void writeToProcess();
/** /**
@return FALSE as this is no network IO. @return false as this is no network IO.
*/ */
bool isNetwork() const { return false; } bool isNetwork() const { return false; }
@ -400,7 +400,7 @@ class KMessageFilePipe : public KMessageIO
void exec(); void exec();
/** /**
@return FALSE as this is no network IO. @return false as this is no network IO.
*/ */
bool isNetwork() const { return false; } bool isNetwork() const { return false; }

@ -376,7 +376,7 @@ void KMessageServer::getReceivedMessage (const TQByteArray &msg)
d->mMessageQueue.enqueue (new MessageBuffer (clientID, msg)); d->mMessageQueue.enqueue (new MessageBuffer (clientID, msg));
if (!d->mTimer.isActive()) 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 () void KMessageServer::processOneMessage ()

@ -70,7 +70,7 @@ void KGameProgress::initialize()
use_supplied_bar_color = false; use_supplied_bar_color = false;
bar_pixmap = 0; bar_pixmap = 0;
bar_style = Solid; bar_style = Solid;
text_enabled = TRUE; text_enabled = true;
setBackgroundMode( PaletteBackground ); setBackgroundMode( PaletteBackground );
connect(tdeApp, TQ_SIGNAL(appearanceChanged()), this, TQ_SLOT(paletteChange())); connect(tdeApp, TQ_SIGNAL(appearanceChanged()), this, TQ_SLOT(paletteChange()));
paletteChange(); paletteChange();
@ -196,13 +196,13 @@ int KGameProgress::recalcValue(int range)
void KGameProgress::valueChange() void KGameProgress::valueChange()
{ {
repaint(contentsRect(), FALSE); repaint(contentsRect(), false);
emit percentageChanged(recalcValue(100)); emit percentageChanged(recalcValue(100));
} }
void KGameProgress::rangeChange() void KGameProgress::rangeChange()
{ {
repaint(contentsRect(), FALSE); repaint(contentsRect(), false);
emit percentageChanged(recalcValue(100)); emit percentageChanged(recalcValue(100));
} }

@ -95,7 +95,7 @@ bool KConnectEntry::SendMsg(KEMessage *msg)
bool KConnectEntry::Exit() bool KConnectEntry::Exit()
{ {
bool result; bool result;
result=FALSE; result=false;
switch(type) switch(type)
{ {
case KG_INPUTTYPE_INTERACTIVE: case KG_INPUTTYPE_INTERACTIVE:
@ -110,7 +110,7 @@ bool KConnectEntry::Exit()
result=connect.p->Exit(); result=connect.p->Exit();
delete connect.p; delete connect.p;
break; break;
default: result=FALSE; default: result=false;
break; break;
} }
return result; return result;
@ -135,7 +135,7 @@ bool KConnectEntry::Init(KG_INPUTTYPE stype,int id,KEMessage *msg)
connect.p=new TDEProcessConnect; connect.p=new TDEProcessConnect;
result=connect.p->Init(id,msg); result=connect.p->Init(id,msg);
break; break;
default: result=FALSE; default: result=false;
break; break;
} }
return result; return result;

@ -26,7 +26,7 @@ KEInput::KEInput(TQObject * parent)
: TQObject(parent,0) : TQObject(parent,0)
{ {
number_of_inputs=0; number_of_inputs=0;
locked=FALSE; locked=false;
previous_input=-1; previous_input=-1;
next_input=-1; next_input=-1;
cTimer=0; cTimer=0;
@ -60,9 +60,9 @@ int KEInput::QueryPrevious()
bool KEInput::IsInput(int no) bool KEInput::IsInput(int no)
{ {
if (no>=number_of_inputs || no<0) return FALSE; if (no>=number_of_inputs || no<0) return false;
if (QueryType(no)==0) return FALSE; if (QueryType(no)==0) return false;
return TRUE; return true;
} }
// Default is the type of the current player // 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 KEInput::RemoveInput(int no)
{ {
bool result; bool result;
if (no>=number_of_inputs || no<0) return FALSE; if (no>=number_of_inputs || no<0) return false;
result=playerArray[no].Exit(); result=playerArray[no].Exit();
// shrink if last entry is removed // shrink if last entry is removed
if (no==number_of_inputs-1) if (no==number_of_inputs-1)
@ -169,9 +169,9 @@ bool KEInput::RemoveInput(int no)
// Sets a new player and sends it a message // Sets a new player and sends it a message
bool KEInput::Next(int number, bool force) bool KEInput::Next(int number, bool force)
{ {
if (locked && !force) return FALSE; if (locked && !force) return false;
if (!IsInput(number)) return FALSE; if (!IsInput(number)) return false;
locked=TRUE; locked=true;
// printf("KEInput::Next %d OK ... lock set!!\n",number); // 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... if (cTimer) delete cTimer; // Ouch...
cTimer=new TQTimer(this); cTimer=new TQTimer(this);
connect(cTimer,TQ_SIGNAL(timeout()),this,TQ_SLOT(slotTimerNextRemote())); connect(cTimer,TQ_SIGNAL(timeout()),this,TQ_SLOT(slotTimerNextRemote()));
cTimer->start(K_INPUT_DELAY,TRUE); cTimer->start(K_INPUT_DELAY,true);
} }
else else
{ {
@ -205,14 +205,14 @@ bool KEInput::Next(int number, bool force)
// delay non interactive move to allow interactive inout // delay non interactive move to allow interactive inout
cTimer=new TQTimer(this); cTimer=new TQTimer(this);
connect(cTimer,TQ_SIGNAL(timeout()),this,TQ_SLOT(slotTimerNextProcess())); connect(cTimer,TQ_SIGNAL(timeout()),this,TQ_SLOT(slotTimerNextProcess()));
cTimer->start(K_INPUT_DELAY,TRUE); cTimer->start(K_INPUT_DELAY,true);
} }
else else
playerArray[number].QueryProcessConnect()->Next(); playerArray[number].QueryProcessConnect()->Next();
break; break;
default: return FALSE; default: return false;
} }
return TRUE; return true;
} }
void KEInput::slotTimerNextRemote() void KEInput::slotTimerNextRemote()
@ -263,20 +263,20 @@ bool KEInput::SetInput(KEMessage *msg,int number)
/* /*
if (!locked) if (!locked)
{ {
printf("KEINput:SetInput not locked(should be) returning FALSE\n"); printf("KEINput:SetInput not locked(should be) returning false\n");
return FALSE; return false;
} }
*/ */
if (number<0 || number>=number_of_inputs) number=next_input; // automatically select player if (number<0 || number>=number_of_inputs) number=next_input; // automatically select player
// KEMessage *mMsg= new KEMessage; // KEMessage *mMsg= new KEMessage;
// evt if (mMsg) delete mMsg; // evt if (mMsg) delete mMsg;
// *mMsg=*msg; // *mMsg=*msg;
// locked=FALSE; // locked=false;
// printf("**** KEInput: emitting signalReceiveInput 474\n"); // printf("**** KEInput: emitting signalReceiveInput 474\n");
emit signalReceiveInput(msg,number); emit signalReceiveInput(msg,number);
// emit signalReceiveInput(mMsg); // emit signalReceiveInput(mMsg);
// delete mMsg; // delete mMsg;
return TRUE; return true;
} }
void KEInput::Lock() void KEInput::Lock()

@ -108,8 +108,8 @@ bool tryserver;
if (!kSocket) return false; if (!kSocket) return false;
if (kSocket->socket()!=-1) // success if (kSocket->socket()!=-1) // success
{ {
kSocket->enableRead(TRUE); kSocket->enableRead(true);
//kSocket->enableWrite(TRUE); //kSocket->enableWrite(true);
connect(kSocket,TQ_SIGNAL(closeEvent(TDESocket *)), connect(kSocket,TQ_SIGNAL(closeEvent(TDESocket *)),
this,TQ_SLOT(socketClosed(TDESocket *))); this,TQ_SLOT(socketClosed(TDESocket *)));
connect(kSocket,TQ_SIGNAL(readEvent(TDESocket *)), connect(kSocket,TQ_SIGNAL(readEvent(TDESocket *)),
@ -204,8 +204,8 @@ void KRemoteConnect::socketRequest(TDESocket *sock)
kSocket=sock; kSocket=sock;
if (kSocket->socket()!=-1) // success if (kSocket->socket()!=-1) // success
{ {
kSocket->enableRead(TRUE); kSocket->enableRead(true);
//kSocket->enableWrite(TRUE); //kSocket->enableWrite(true);
connect(kSocket,TQ_SIGNAL(closeEvent(TDESocket *)), connect(kSocket,TQ_SIGNAL(closeEvent(TDESocket *)),
this,TQ_SLOT(socketClosed(TDESocket *))); this,TQ_SLOT(socketClosed(TDESocket *)));
connect(kSocket,TQ_SIGNAL(readEvent(TDESocket *)), connect(kSocket,TQ_SIGNAL(readEvent(TDESocket *)),

@ -84,7 +84,7 @@ bool TDEProcessConnect::Init(int id,KEMessage *msg)
this, TQ_SLOT(slotWroteStdin(TDEProcess *))); this, TQ_SLOT(slotWroteStdin(TDEProcess *)));
*/ */
// TRUE if ok // true if ok
running=process->start(TDEProcess::NotifyOnExit,TDEProcess::All); running=process->start(TDEProcess::NotifyOnExit,TDEProcess::All);
if (running && msg && msg->QueryNumberOfKeys()>0) if (running && msg && msg->QueryNumberOfKeys()>0)

@ -125,7 +125,7 @@ LSkatView::LSkatView(TQWidget *parent, const char *name) : TQWidget(parent, name
introTimer=new TQTimer(this); introTimer=new TQTimer(this);
introTimer->stop(); introTimer->stop();
connect(introTimer,TQ_SIGNAL(timeout()),this,TQ_SLOT(introTimerReady())); connect(introTimer,TQ_SIGNAL(timeout()),this,TQ_SLOT(introTimerReady()));
introTimer->start(75,FALSE); introTimer->start(75,false);
for (int i=0;i<NO_OF_CARDS;i++) for (int i=0;i<NO_OF_CARDS;i++)
{ {
@ -857,7 +857,7 @@ void LSkatView::InitMove(int player,int mx,int my)
cardmovey=my+2*player; cardmovey=my+2*player;
cardmoveunder=getDocument()->GetCard(player,mx+4*my,getDocument()->GetHeight(player,mx+4*my)); cardmoveunder=getDocument()->GetCard(player,mx+4*my,getDocument()->GetHeight(player,mx+4*my));
introTimer->stop(); introTimer->stop();
moveTimer->start(MOVE_TIMER_DELAY,FALSE); moveTimer->start(MOVE_TIMER_DELAY,false);
cardmovecnt=0; cardmovecnt=0;
cardorigin=calcCardPos(mx,my+2*player); cardorigin=calcCardPos(mx,my+2*player);
if (getDocument()->GetCurrentPlayer()==0) if (getDocument()->GetCurrentPlayer()==0)

@ -38,7 +38,7 @@
// Create the dialog for changing the player names // Create the dialog for changing the player names
MsgDlg::MsgDlg( TQWidget *parent, const char *name,const char * /*sufi */ ) 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")); setCaption(i18n("Send Message to Remote Player"));
setMinimumSize(400,160); 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 = new TQPushButton( i18n("Send" ), this, "PushButton_1" );
PushButton->setGeometry( 20, 120, 65, 30 ); PushButton->setGeometry( 20, 120, 65, 30 );
connect( PushButton, TQ_SIGNAL(clicked()), TQ_SLOT(accept()) ); connect( PushButton, TQ_SIGNAL(clicked()), TQ_SLOT(accept()) );
PushButton->setAutoRepeat( FALSE ); PushButton->setAutoRepeat( false );
PushButton = new KPushButton( KStdGuiItem::cancel(), this, "PushButton_2" ); PushButton = new KPushButton( KStdGuiItem::cancel(), this, "PushButton_2" );
PushButton->setGeometry( 305, 120, 65, 30 ); PushButton->setGeometry( 305, 120, 65, 30 );
connect( PushButton, TQ_SIGNAL(clicked()), TQ_SLOT(reject()) ); connect( PushButton, TQ_SIGNAL(clicked()), TQ_SLOT(reject()) );
PushButton->setAutoRepeat( FALSE ); PushButton->setAutoRepeat( false );
} }
TQString MsgDlg::GetMsg() TQString MsgDlg::GetMsg()

@ -23,7 +23,7 @@
* name 'name' and widget flags set to 'f' * name 'name' and widget flags set to 'f'
* *
* The dialog will by default be modeless, unless you set 'modal' to * 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 */ ) NameDlg::NameDlg( TQWidget *parent, const char *name,bool /* modal */, WFlags /* fl */ )
: KDialogBase( Plain, i18n("Configure Names"), Ok|Cancel, Ok, : KDialogBase( Plain, i18n("Configure Names"), Ok|Cancel, Ok,

@ -24,7 +24,7 @@ class NameDlg : public KDialogBase
public: 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(); ~NameDlg();
void SetNames(TQString n1,TQString n2); void SetNames(TQString n1,TQString n2);
void GetNames(TQString &n1,TQString &n2); void GetNames(TQString &n1,TQString &n2);

@ -26,7 +26,7 @@ extern const char* LSKAT_SERVICE;
// Create the dialog // Create the dialog
NetworkDlg::NetworkDlg( TQWidget *parent, const char *name ) NetworkDlg::NetworkDlg( TQWidget *parent, const char *name )
: NetworkDlgBase( parent, name, TRUE ) : NetworkDlgBase( parent, name, true )
{ {
browser = new DNSSD::ServiceBrowser(TQString::fromLatin1(LSKAT_SERVICE)); browser = new DNSSD::ServiceBrowser(TQString::fromLatin1(LSKAT_SERVICE));
connect(browser,TQ_SIGNAL(finished()),TQ_SLOT(gamesFound())); connect(browser,TQ_SIGNAL(finished()),TQ_SLOT(gamesFound()));

@ -59,7 +59,7 @@ GameBoard::GameBoard(TQWidget *parent, const char *name)
tmr = new TQTimer(this); tmr = new TQTimer(this);
TQObject::connect(tmr, TQ_SIGNAL(timeout()), this, TQ_SLOT(moveItem())); TQObject::connect(tmr, TQ_SIGNAL(timeout()), this, TQ_SLOT(moveItem()));
setEnabled(TRUE); setEnabled(true);
origin = xpm; origin = xpm;
} }
@ -331,7 +331,7 @@ GameBoard::checkEndGame()
if (n == 15) { if (n == 15) {
txt = tr("Game Over"); txt = tr("Game Over");
TQMessageBox::information(this, txt, txt); TQMessageBox::information(this, txt, txt);
setEnabled(FALSE); setEnabled(false);
} }
} }
@ -339,7 +339,7 @@ GameBoard::checkEndGame()
void void
GameBoard::newGame() GameBoard::newGame()
{ {
setEnabled(TRUE); setEnabled(true);
initMap(); initMap();
newTask(); newTask();
} }

Loading…
Cancel
Save