diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
commit | 576eb4299a00bc053db35414406f46372a0f70f2 (patch) | |
tree | 4c030922d533821db464af566188e7d40cc8848c /kgoldrunner | |
parent | 0718336b6017d1a4fc1d626544180a5a2a29ddec (diff) | |
download | tdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kgoldrunner')
-rw-r--r-- | kgoldrunner/src/kgoldrunner.cpp | 246 | ||||
-rw-r--r-- | kgoldrunner/src/kgoldrunner.h | 10 | ||||
-rw-r--r-- | kgoldrunner/src/kgrcanvas.cpp | 176 | ||||
-rw-r--r-- | kgoldrunner/src/kgrcanvas.h | 56 | ||||
-rw-r--r-- | kgoldrunner/src/kgrdialog.cpp | 282 | ||||
-rw-r--r-- | kgoldrunner/src/kgrdialog.h | 130 | ||||
-rw-r--r-- | kgoldrunner/src/kgrfigure.cpp | 20 | ||||
-rw-r--r-- | kgoldrunner/src/kgrfigure.h | 28 | ||||
-rw-r--r-- | kgoldrunner/src/kgrgame.cpp | 262 | ||||
-rw-r--r-- | kgoldrunner/src/kgrgame.h | 68 | ||||
-rw-r--r-- | kgoldrunner/src/kgrobject.cpp | 4 | ||||
-rw-r--r-- | kgoldrunner/src/kgrobject.h | 4 |
12 files changed, 643 insertions, 643 deletions
diff --git a/kgoldrunner/src/kgoldrunner.cpp b/kgoldrunner/src/kgoldrunner.cpp index 6e8cfb3c..13300f9e 100644 --- a/kgoldrunner/src/kgoldrunner.cpp +++ b/kgoldrunner/src/kgoldrunner.cpp @@ -3,8 +3,8 @@ */ #include <kprinter.h> -#include <qpainter.h> -#include <qpaintdevicemetrics.h> +#include <tqpainter.h> +#include <tqpaintdevicemetrics.h> #include <kglobal.h> #include <klocale.h> @@ -88,10 +88,10 @@ KGoldrunner::KGoldrunner() initStatusBar(); // Connect the game actions to the menu and toolbar displays. - connect(game, SIGNAL (setEditMenu (bool)), SLOT (setEditMenu (bool))); - connect(game, SIGNAL (markRuleType (char)), SLOT (markRuleType (char))); - connect(game, SIGNAL (hintAvailable(bool)), SLOT (adjustHintAction(bool))); - connect(game, SIGNAL (defaultEditObj()), SLOT (defaultEditObj())); + connect(game, TQT_SIGNAL (setEditMenu (bool)), TQT_SLOT (setEditMenu (bool))); + connect(game, TQT_SIGNAL (markRuleType (char)), TQT_SLOT (markRuleType (char))); + connect(game, TQT_SIGNAL (hintAvailable(bool)), TQT_SLOT (adjustHintAction(bool))); + connect(game, TQT_SIGNAL (defaultEditObj()), TQT_SLOT (defaultEditObj())); // Apply the saved mainwindow settings, if any, and ask the mainwindow // to automatically save settings if changed: window size, toolbar @@ -157,22 +157,22 @@ void KGoldrunner::setupActions() KAction * newAction = KStdGameAction:: gameNew ( game, - SLOT(startLevelOne()), actionCollection()); + TQT_SLOT(startLevelOne()), actionCollection()); newAction-> setText (i18n("&New Game...")); KAction * loadGame = KStdGameAction:: load ( - game, SLOT(loadGame()), actionCollection()); + game, TQT_SLOT(loadGame()), actionCollection()); loadGame-> setText (i18n("&Load Saved Game...")); (void) new KAction ( i18n("&Play Any Level..."), 0, - game, SLOT(startAnyLevel()), actionCollection(), + game, TQT_SLOT(startAnyLevel()), actionCollection(), "play_any"); (void) new KAction ( i18n("Play &Next Level..."), 0, game, - SLOT(startNextLevel()), actionCollection(), + TQT_SLOT(startNextLevel()), actionCollection(), "play_next"); // Save Game... @@ -181,7 +181,7 @@ void KGoldrunner::setupActions() saveGame = KStdGameAction:: save ( - game, SLOT(saveGame()), actionCollection()); + game, TQT_SLOT(saveGame()), actionCollection()); saveGame-> setText (i18n("&Save Game...")); saveGame-> setShortcut (Key_S); // Alternate key. @@ -193,20 +193,20 @@ void KGoldrunner::setupActions() myPause = KStdGameAction:: pause ( - this, SLOT(stopStart()), actionCollection()); + this, TQT_SLOT(stopStart()), actionCollection()); myPause-> setShortcut (Key_Escape); // Alternate key. highScore = KStdGameAction:: highscores ( - game, SLOT(showHighScores()), actionCollection()); + game, TQT_SLOT(showHighScores()), actionCollection()); hintAction = new KAction ( i18n("&Get Hint"), "ktip", 0, - game, SLOT(showHint()), actionCollection(), + game, TQT_SLOT(showHint()), actionCollection(), "get_hint"); killHero = new KAction ( i18n("&Kill Hero"), Key_Q, - game, SLOT(herosDead()), actionCollection(), + game, TQT_SLOT(herosDead()), actionCollection(), "kill_hero"); // Quit @@ -214,7 +214,7 @@ void KGoldrunner::setupActions() (void) KStdGameAction:: quit ( - this, SLOT(close()), actionCollection()); + this, TQT_SLOT(close()), actionCollection()); /**************************************************************************/ /*************************** GAME EDITOR MENU **************************/ @@ -228,17 +228,17 @@ void KGoldrunner::setupActions() (void) new KAction ( i18n("&Create Level"), 0, - game, SLOT(createLevel()), actionCollection(), + game, TQT_SLOT(createLevel()), actionCollection(), "create"); (void) new KAction ( i18n("&Edit Any Level..."), 0, - game, SLOT(updateLevel()), actionCollection(), + game, TQT_SLOT(updateLevel()), actionCollection(), "edit_any"); (void) new KAction ( i18n("Edit &Next Level..."), 0, - game, SLOT(updateNext()), actionCollection(), + game, TQT_SLOT(updateNext()), actionCollection(), "edit_next"); // Save Edits... @@ -249,20 +249,20 @@ void KGoldrunner::setupActions() saveEdits = new KAction ( i18n("&Save Edits..."), 0, - game, SLOT(saveLevelFile()), actionCollection(), + game, TQT_SLOT(saveLevelFile()), actionCollection(), "save_edits"); saveEdits->setEnabled (FALSE); // Nothing to save, yet. (void) new KAction ( i18n("&Move Level..."), 0, - game, SLOT(moveLevelFile()), actionCollection(), + game, TQT_SLOT(moveLevelFile()), actionCollection(), "move_level"); (void) new KAction ( i18n("&Delete Level..."), 0, game, - SLOT(deleteLevelFile()), actionCollection(), + TQT_SLOT(deleteLevelFile()), actionCollection(), "delete_level"); // Create a Game @@ -272,13 +272,13 @@ void KGoldrunner::setupActions() (void) new KAction ( i18n("Create Game..."), 0, - this, SLOT(createGame()), actionCollection(), + this, TQT_SLOT(createGame()), actionCollection(), "create_game"); (void) new KAction ( i18n("Edit Game Info..."), 0, this, - SLOT(editGameInfo()), actionCollection(), + TQT_SLOT(editGameInfo()), actionCollection(), "edit_game"); /**************************************************************************/ @@ -290,27 +290,27 @@ void KGoldrunner::setupActions() setKGoldrunner = new KRadioAction ( "K&Goldrunner", 0, // Default Shift+G - this, SLOT(lsKGoldrunner()), actionCollection(), + this, TQT_SLOT(lsKGoldrunner()), actionCollection(), "kgoldrunner"); setAppleII = new KRadioAction ( "&Apple II", 0, // Default Shift+A - this, SLOT(lsApple2()), actionCollection(), + this, TQT_SLOT(lsApple2()), actionCollection(), "apple_2"); setIceCave = new KRadioAction ( i18n("&Ice Cave"), 0, // Default Shift+I - this, SLOT(lsIceCave()), actionCollection(), + this, TQT_SLOT(lsIceCave()), actionCollection(), "ice_cave"); setMidnight = new KRadioAction ( i18n("&Midnight"), 0, // Default Shift+M - this, SLOT(lsMidnight()), actionCollection(), + this, TQT_SLOT(lsMidnight()), actionCollection(), "midnight"); setKDEKool = new KRadioAction ( i18n("&KDE Kool"), 0, // Default Shift+K - this, SLOT(lsKDEKool()), actionCollection(), + this, TQT_SLOT(lsKDEKool()), actionCollection(), "kde_kool"); setKGoldrunner-> setExclusiveGroup ("landscapes"); @@ -332,13 +332,13 @@ void KGoldrunner::setupActions() i18n("&Mouse Controls Hero"), 0, this, - SLOT(setMouseMode()), actionCollection(), + TQT_SLOT(setMouseMode()), actionCollection(), "mouse_mode"); setKeyboard = new KRadioAction ( i18n("&Keyboard Controls Hero"), 0, this, - SLOT(setKeyBoardMode()), actionCollection(), + TQT_SLOT(setKeyBoardMode()), actionCollection(), "keyboard_mode"); setMouse-> setExclusiveGroup ("control"); @@ -355,27 +355,27 @@ void KGoldrunner::setupActions() KRadioAction * nSpeed = new KRadioAction ( i18n("Normal Speed"), 0, - this, SLOT(normalSpeed()), actionCollection(), + this, TQT_SLOT(normalSpeed()), actionCollection(), "normal_speed"); KRadioAction * bSpeed = new KRadioAction ( i18n("Beginner Speed"), 0, - this, SLOT(beginSpeed()), actionCollection(), + this, TQT_SLOT(beginSpeed()), actionCollection(), "beginner_speed"); KRadioAction * cSpeed = new KRadioAction ( i18n("Champion Speed"), 0, - this, SLOT(champSpeed()), actionCollection(), + this, TQT_SLOT(champSpeed()), actionCollection(), "champion_speed"); (void) new KAction ( // Repeatable action. i18n("Increase Speed"), Key_Plus, - this, SLOT(incSpeed()), actionCollection(), + this, TQT_SLOT(incSpeed()), actionCollection(), "increase_speed"); (void) new KAction ( // Repeatable action. i18n("Decrease Speed"), Key_Minus, - this, SLOT(decSpeed()), actionCollection(), + this, TQT_SLOT(decSpeed()), actionCollection(), "decrease_speed"); nSpeed-> setExclusiveGroup ("speed"); @@ -390,12 +390,12 @@ void KGoldrunner::setupActions() tradRules = new KRadioAction ( i18n("&Traditional Rules"), 0, - this, SLOT(setTradRules()), actionCollection(), + this, TQT_SLOT(setTradRules()), actionCollection(), "trad_rules"); kgrRules = new KRadioAction ( i18n("K&Goldrunner Rules"), 0, - this, SLOT(setKGrRules()), actionCollection(), + this, TQT_SLOT(setKGrRules()), actionCollection(), "kgr_rules"); tradRules-> setExclusiveGroup ("rules"); @@ -409,12 +409,12 @@ void KGoldrunner::setupActions() (void) new KAction ( i18n("Larger Playing Area"), 0, - this, SLOT(makeLarger()), actionCollection(), + this, TQT_SLOT(makeLarger()), actionCollection(), "larger_area"); (void) new KAction ( i18n("Smaller Playing Area"), 0, - this, SLOT(makeSmaller()), actionCollection(), + this, TQT_SLOT(makeSmaller()), actionCollection(), "smaller_area"); // Configure Shortcuts... @@ -422,10 +422,10 @@ void KGoldrunner::setupActions() // -------------------------- KStdAction::keyBindings ( - this, SLOT(optionsConfigureKeys()), + this, TQT_SLOT(optionsConfigureKeys()), actionCollection()); // KStdAction::configureToolbars ( - // this, SLOT(optionsConfigureToolbars()), + // this, TQT_SLOT(optionsConfigureToolbars()), // actionCollection()); /**************************************************************************/ @@ -435,19 +435,19 @@ void KGoldrunner::setupActions() // Two-handed KB controls and alternate one-handed controls for the hero. (void) new KAction (i18n("Move Up"), Key_Up, - this, SLOT(goUp()), actionCollection(), "move_up"); + this, TQT_SLOT(goUp()), actionCollection(), "move_up"); (void) new KAction (i18n("Move Right"), Key_Right, - this, SLOT(goR()), actionCollection(), "move_right"); + this, TQT_SLOT(goR()), actionCollection(), "move_right"); (void) new KAction (i18n("Move Down"), Key_Down, - this, SLOT(goDown()), actionCollection(), "move_down"); + this, TQT_SLOT(goDown()), actionCollection(), "move_down"); (void) new KAction (i18n("Move Left"), Key_Left, - this, SLOT(goL()), actionCollection(), "move_left"); + this, TQT_SLOT(goL()), actionCollection(), "move_left"); (void) new KAction (i18n("Stop"), Key_Space, - this, SLOT(stop()), actionCollection(), "stop"); + this, TQT_SLOT(stop()), actionCollection(), "stop"); (void) new KAction (i18n("Dig Right"), Key_C, - this, SLOT(digR()), actionCollection(), "dig_right"); + this, TQT_SLOT(digR()), actionCollection(), "dig_right"); (void) new KAction (i18n("Dig Left"), Key_Z, - this, SLOT(digL()), actionCollection(), "dig_left"); + this, TQT_SLOT(digL()), actionCollection(), "dig_left"); // Alternate one-handed controls. Set up in "kgoldrunnerui.rc". @@ -463,31 +463,31 @@ void KGoldrunner::setupActions() // Authors' debugging aids. (void) new KAction (i18n("Step"), Key_Period, - game, SLOT(doStep()), actionCollection(), "do_step"); + game, TQT_SLOT(doStep()), actionCollection(), "do_step"); (void) new KAction (i18n("Test Bug Fix"), Key_B, - game, SLOT(bugFix()), actionCollection(), "bug_fix"); + game, TQT_SLOT(bugFix()), actionCollection(), "bug_fix"); (void) new KAction (i18n("Show Positions"), Key_D, - game, SLOT(showFigurePositions()), actionCollection(), "step"); + game, TQT_SLOT(showFigurePositions()), actionCollection(), "step"); (void) new KAction (i18n("Start Logging"), Key_G, - game, SLOT(startLogging()), actionCollection(), "logging"); + game, TQT_SLOT(startLogging()), actionCollection(), "logging"); (void) new KAction (i18n("Show Hero"), Key_H, - game, SLOT(showHeroState()), actionCollection(), "show_hero"); + game, TQT_SLOT(showHeroState()), actionCollection(), "show_hero"); (void) new KAction (i18n("Show Object"), Key_Question, - game, SLOT(showObjectState()), actionCollection(), "show_obj"); + game, TQT_SLOT(showObjectState()), actionCollection(), "show_obj"); (void) new KAction (i18n("Show Enemy") + "0", Key_0, - this, SLOT(showEnemy0()), actionCollection(), "show_enemy_0"); + this, TQT_SLOT(showEnemy0()), actionCollection(), "show_enemy_0"); (void) new KAction (i18n("Show Enemy") + "1", Key_1, - this, SLOT(showEnemy1()), actionCollection(), "show_enemy_1"); + this, TQT_SLOT(showEnemy1()), actionCollection(), "show_enemy_1"); (void) new KAction (i18n("Show Enemy") + "2", Key_2, - this, SLOT(showEnemy2()), actionCollection(), "show_enemy_2"); + this, TQT_SLOT(showEnemy2()), actionCollection(), "show_enemy_2"); (void) new KAction (i18n("Show Enemy") + "3", Key_3, - this, SLOT(showEnemy3()), actionCollection(), "show_enemy_3"); + this, TQT_SLOT(showEnemy3()), actionCollection(), "show_enemy_3"); (void) new KAction (i18n("Show Enemy") + "4", Key_4, - this, SLOT(showEnemy4()), actionCollection(), "show_enemy_4"); + this, TQT_SLOT(showEnemy4()), actionCollection(), "show_enemy_4"); (void) new KAction (i18n("Show Enemy") + "5", Key_5, - this, SLOT(showEnemy5()), actionCollection(), "show_enemy_5"); + this, TQT_SLOT(showEnemy5()), actionCollection(), "show_enemy_5"); (void) new KAction (i18n("Show Enemy") + "6", Key_6, - this, SLOT(showEnemy6()), actionCollection(), "show_enemy_6"); + this, TQT_SLOT(showEnemy6()), actionCollection(), "show_enemy_6"); #endif /**************************************************************************/ @@ -503,9 +503,9 @@ void KGoldrunner::setupActions() void KGoldrunner::initStatusBar() { - QString s = statusBar()->fontInfo().family(); // Set bold font. + TQString s = statusBar()->fontInfo().family(); // Set bold font. int i = statusBar()->fontInfo().pointSize(); - statusBar()->setFont (QFont (s, i, QFont::Bold)); + statusBar()->setFont (TQFont (s, i, TQFont::Bold)); statusBar()->setSizeGripEnabled (FALSE); // Use Settings menu ... @@ -513,7 +513,7 @@ void KGoldrunner::initStatusBar() statusBar()->insertItem ("", ID_SCORE); statusBar()->insertItem ("", ID_LEVEL); statusBar()->insertItem ("", ID_HINTAVL); - statusBar()->insertItem ("", ID_MSG, QSizePolicy::Horizontally); + statusBar()->insertItem ("", ID_MSG, TQSizePolicy::Horizontally); showLives (5); // Start with 5 lives. showScore (0); @@ -529,15 +529,15 @@ void KGoldrunner::initStatusBar() statusBar()->setItemFixed (ID_SCORE, -1); statusBar()->setItemFixed (ID_LEVEL, -1); - connect(game, SIGNAL (showLives (long)), SLOT (showLives (long))); - connect(game, SIGNAL (showScore (long)), SLOT (showScore (long))); - connect(game, SIGNAL (showLevel (int)), SLOT (showLevel (int))); - connect(game, SIGNAL (gameFreeze (bool)), SLOT (gameFreeze (bool))); + connect(game, TQT_SIGNAL (showLives (long)), TQT_SLOT (showLives (long))); + connect(game, TQT_SIGNAL (showScore (long)), TQT_SLOT (showScore (long))); + connect(game, TQT_SIGNAL (showLevel (int)), TQT_SLOT (showLevel (int))); + connect(game, TQT_SIGNAL (gameFreeze (bool)), TQT_SLOT (gameFreeze (bool))); } void KGoldrunner::showLives (long newLives) { - QString tmp; + TQString tmp; tmp.setNum (newLives); if (newLives < 100) tmp = tmp.rightJustify (3, '0'); @@ -548,7 +548,7 @@ void KGoldrunner::showLives (long newLives) void KGoldrunner::showScore (long newScore) { - QString tmp; + TQString tmp; tmp.setNum (newScore); if (newScore < 10000) tmp = tmp.rightJustify (5, '0'); @@ -559,7 +559,7 @@ void KGoldrunner::showScore (long newScore) void KGoldrunner::showLevel (int newLevelNo) { - QString tmp; + TQString tmp; tmp.setNum (newLevelNo); if (newLevelNo < 100) tmp = tmp.rightJustify (3, '0'); @@ -731,7 +731,7 @@ void KGoldrunner::readProperties(KConfig *config) config->setGroup ("Game"); // Prevents a compiler warning. printf ("I am in KGoldrunner::readProperties.\n"); - // QString qqq = config->readEntry("qqq"); + // TQString qqq = config->readEntry("qqq"); } void KGoldrunner::optionsShowToolbar() @@ -805,13 +805,13 @@ void KGoldrunner::optionsPreferences() // } } -void KGoldrunner::changeStatusbar(const QString& text) +void KGoldrunner::changeStatusbar(const TQString& text) { // display the text on the statusbar statusBar()->message(text); } -void KGoldrunner::changeCaption(const QString& text) +void KGoldrunner::changeCaption(const TQString& text) { // display the text on the caption setCaption(text); @@ -838,9 +838,9 @@ bool KGoldrunner::getDirectories() KStandardDirs * dirs = new KStandardDirs(); #ifdef QT3 - QString myDir = "kgoldrunner"; + TQString myDir = "kgoldrunner"; #else - QString myDir = "kgoldrun"; + TQString myDir = "kgoldrun"; #endif // Find the KGoldrunner Users' Guide, English version (en). @@ -943,36 +943,36 @@ void KGoldrunner::setKey (KBAction movement) /********************** MAKE A TOOLBAR FOR THE EDITOR **********************/ /******************************************************************************/ -#include <qwmatrix.h> +#include <tqwmatrix.h> void KGoldrunner::makeEditToolbar() { // Set up the pixmaps for the editable objects. - QPixmap pixmap; - QImage image; + TQPixmap pixmap; + TQImage image; - QPixmap brickbg = view->getPixmap (BRICK); - QPixmap fbrickbg = view->getPixmap (FBRICK); + TQPixmap brickbg = view->getPixmap (BRICK); + TQPixmap fbrickbg = view->getPixmap (FBRICK); - QPixmap freebg = view->getPixmap (FREE); - QPixmap nuggetbg = view->getPixmap (NUGGET); - QPixmap polebg = view->getPixmap (POLE); - QPixmap betonbg = view->getPixmap (BETON); - QPixmap ladderbg = view->getPixmap (LADDER); - QPixmap hladderbg = view->getPixmap (HLADDER); - QPixmap edherobg = view->getPixmap (HERO); - QPixmap edenemybg = view->getPixmap (ENEMY); + TQPixmap freebg = view->getPixmap (FREE); + TQPixmap nuggetbg = view->getPixmap (NUGGET); + TQPixmap polebg = view->getPixmap (POLE); + TQPixmap betonbg = view->getPixmap (BETON); + TQPixmap ladderbg = view->getPixmap (LADDER); + TQPixmap hladderbg = view->getPixmap (HLADDER); + TQPixmap edherobg = view->getPixmap (HERO); + TQPixmap edenemybg = view->getPixmap (ENEMY); if (usesBigPixmaps()) { // Scale up the pixmaps (to give cleaner looking - // icons than leaving it for QToolButton to do). - QWMatrix w; + // icons than leaving it for TQToolButton to do). + TQWMatrix w; w = w.scale (2.0, 2.0); // The pixmaps shown on the buttons used to remain small and incorrectly // painted, in KDE, in spite of the 2x (32x32) scaling. "insertButton" - // calls QIconSet, to generate a set of icons from each pixmapx, then + // calls TQIconSet, to generate a set of icons from each pixmapx, then // seems to select the small size to paint on the button. The following // line forces all icons, large and small, to be size 32x32 in advance. - QIconSet::setIconSize (QIconSet::Small, QSize (32, 32)); + TQIconSet::setIconSize (TQIconSet::Small, TQSize (32, 32)); brickbg = brickbg.xForm (w); fbrickbg = fbrickbg.xForm (w); @@ -990,7 +990,7 @@ void KGoldrunner::makeEditToolbar() editToolbar = new KToolBar (this, Qt::DockTop, TRUE, "Editor", TRUE); // Choose a colour that enhances visibility of the KGoldrunner pixmaps. - // editToolbar->setPalette (QPalette (QColor (150, 150, 230))); + // editToolbar->setPalette (TQPalette (TQColor (150, 150, 230))); // editToolbar->setHorizontallyStretchable (TRUE); // Not effective in KDE. @@ -999,51 +999,51 @@ void KGoldrunner::makeEditToolbar() editToolbar->insertSeparator(); - editToolbar->insertButton ("filenew", 0, SIGNAL(clicked()), game, - SLOT(createLevel()), TRUE, i18n("&Create a Level")); - editToolbar->insertButton ("fileopen", 1, SIGNAL(clicked()), game, - SLOT(updateLevel()), TRUE, i18n("&Edit Any Level...")); - editToolbar->insertButton ("filesave", 2, SIGNAL(clicked()), game, - SLOT(saveLevelFile()),TRUE, i18n("&Save Edits...")); + editToolbar->insertButton ("filenew", 0, TQT_SIGNAL(clicked()), game, + TQT_SLOT(createLevel()), TRUE, i18n("&Create a Level")); + editToolbar->insertButton ("fileopen", 1, TQT_SIGNAL(clicked()), game, + TQT_SLOT(updateLevel()), TRUE, i18n("&Edit Any Level...")); + editToolbar->insertButton ("filesave", 2, TQT_SIGNAL(clicked()), game, + TQT_SLOT(saveLevelFile()),TRUE, i18n("&Save Edits...")); editToolbar->insertSeparator(); editToolbar->insertSeparator(); - editToolbar->insertButton ("ktip", 3, SIGNAL(clicked()), game, - SLOT(editNameAndHint()),TRUE,i18n("Edit Name/Hint")); + editToolbar->insertButton ("ktip", 3, TQT_SIGNAL(clicked()), game, + TQT_SLOT(editNameAndHint()),TRUE,i18n("Edit Name/Hint")); editToolbar->insertSeparator(); editToolbar->insertSeparator(); - editToolbar->insertButton (freebg, (int)FREE, SIGNAL(clicked()), this, - SLOT(freeSlot()), TRUE, i18n("Empty space")); + editToolbar->insertButton (freebg, (int)FREE, TQT_SIGNAL(clicked()), this, + TQT_SLOT(freeSlot()), TRUE, i18n("Empty space")); editToolbar->insertSeparator(); - editToolbar->insertButton (edherobg, (int)HERO, SIGNAL(clicked()), this, - SLOT (edheroSlot()), TRUE, i18n("Hero")); + editToolbar->insertButton (edherobg, (int)HERO, TQT_SIGNAL(clicked()), this, + TQT_SLOT (edheroSlot()), TRUE, i18n("Hero")); editToolbar->insertSeparator(); - editToolbar->insertButton (edenemybg, (int)ENEMY, SIGNAL(clicked()), this, - SLOT (edenemySlot()), TRUE, i18n("Enemy")); + editToolbar->insertButton (edenemybg, (int)ENEMY, TQT_SIGNAL(clicked()), this, + TQT_SLOT (edenemySlot()), TRUE, i18n("Enemy")); editToolbar->insertSeparator(); - editToolbar->insertButton (brickbg, (int)BRICK, SIGNAL(clicked()), this, - SLOT (brickSlot()), TRUE, i18n("Brick (can dig)")); + editToolbar->insertButton (brickbg, (int)BRICK, TQT_SIGNAL(clicked()), this, + TQT_SLOT (brickSlot()), TRUE, i18n("Brick (can dig)")); editToolbar->insertSeparator(); - editToolbar->insertButton (betonbg, (int)BETON, SIGNAL(clicked()), this, - SLOT (betonSlot()), TRUE, i18n("Concrete (cannot dig)")); + editToolbar->insertButton (betonbg, (int)BETON, TQT_SIGNAL(clicked()), this, + TQT_SLOT (betonSlot()), TRUE, i18n("Concrete (cannot dig)")); editToolbar->insertSeparator(); - editToolbar->insertButton (fbrickbg, (int)FBRICK, SIGNAL(clicked()), this, - SLOT (fbrickSlot()), TRUE, i18n("Trap (can fall through)")); + editToolbar->insertButton (fbrickbg, (int)FBRICK, TQT_SIGNAL(clicked()), this, + TQT_SLOT (fbrickSlot()), TRUE, i18n("Trap (can fall through)")); editToolbar->insertSeparator(); - editToolbar->insertButton (ladderbg, (int)LADDER, SIGNAL(clicked()), this, - SLOT (ladderSlot()), TRUE, i18n("Ladder")); + editToolbar->insertButton (ladderbg, (int)LADDER, TQT_SIGNAL(clicked()), this, + TQT_SLOT (ladderSlot()), TRUE, i18n("Ladder")); editToolbar->insertSeparator(); - editToolbar->insertButton (hladderbg, (int)HLADDER, SIGNAL(clicked()), this, - SLOT (hladderSlot()), TRUE, i18n("Hidden ladder")); + editToolbar->insertButton (hladderbg, (int)HLADDER, TQT_SIGNAL(clicked()), this, + TQT_SLOT (hladderSlot()), TRUE, i18n("Hidden ladder")); editToolbar->insertSeparator(); - editToolbar->insertButton (polebg, (int)POLE, SIGNAL(clicked()), this, - SLOT (poleSlot()), TRUE, i18n("Pole (or bar)")); + editToolbar->insertButton (polebg, (int)POLE, TQT_SIGNAL(clicked()), this, + TQT_SLOT (poleSlot()), TRUE, i18n("Pole (or bar)")); editToolbar->insertSeparator(); - editToolbar->insertButton (nuggetbg, (int)NUGGET, SIGNAL(clicked()), this, - SLOT (nuggetSlot()), TRUE, i18n("Gold nugget")); + editToolbar->insertButton (nuggetbg, (int)NUGGET, TQT_SIGNAL(clicked()), this, + TQT_SLOT (nuggetSlot()), TRUE, i18n("Gold nugget")); editToolbar->setToggle ((int) FREE, TRUE); editToolbar->setToggle ((int) HERO, TRUE); diff --git a/kgoldrunner/src/kgoldrunner.h b/kgoldrunner/src/kgoldrunner.h index 57123596..358a5561 100644 --- a/kgoldrunner/src/kgoldrunner.h +++ b/kgoldrunner/src/kgoldrunner.h @@ -130,8 +130,8 @@ private slots: void optionsPreferences(); void newToolbarConfig(); - void changeStatusbar(const QString& text); - void changeCaption(const QString& text); + void changeStatusbar(const TQString& text); + void changeCaption(const TQString& text); void showLevel (int); // Show the current level number. void showLives (long); // Show how many lives are remaining. @@ -156,9 +156,9 @@ private: KGrGame * game; bool getDirectories(); // Get directory paths, as below. - QString systemHTMLDir; // Where the manual is stored. - QString systemDataDir; // Where the system levels are stored. - QString userDataDir; // Where the user levels are stored. + TQString systemHTMLDir; // Where the manual is stored. + TQString systemDataDir; // Where the system levels are stored. + TQString userDataDir; // Where the user levels are stored. KAction * saveGame; // Save game, level, lives and score. diff --git a/kgoldrunner/src/kgrcanvas.cpp b/kgoldrunner/src/kgrcanvas.cpp index 6104939e..111913a1 100644 --- a/kgoldrunner/src/kgrcanvas.cpp +++ b/kgoldrunner/src/kgrcanvas.cpp @@ -34,11 +34,11 @@ class KGoldrunner; -KGrCanvas::KGrCanvas (QWidget * parent, const char *name) - : QCanvasView (0, parent, name) +KGrCanvas::KGrCanvas (TQWidget * parent, const char *name) + : TQCanvasView (0, parent, name) { setBackgroundMode (NoBackground); - m = new QCursor (); // For handling the mouse. + m = new TQCursor (); // For handling the mouse. scaleStep = STEP; // Initial scale is 1:1. baseScale = scaleStep; @@ -57,12 +57,12 @@ KGrCanvas::~KGrCanvas() { } -void KGrCanvas::changeLandscape (const QString & name) +void KGrCanvas::changeLandscape (const TQString & name) { for (int i = 0; strcmp (colourScheme [i], "") != 0; i++) { if (colourScheme [i] == name) { - // Change XPM colours and re-draw the tile-pictures used by QCanvas. + // Change XPM colours and re-draw the tile-pictures used by TQCanvas. changeColours (& colourScheme [i]); makeTiles(); @@ -85,11 +85,11 @@ void KGrCanvas::changeLandscape (const QString & name) } } - borderB->setBrush (QBrush (borderColor)); - borderL->setBrush (QBrush (borderColor)); - borderR->setBrush (QBrush (borderColor)); + borderB->setBrush (TQBrush (borderColor)); + borderL->setBrush (TQBrush (borderColor)); + borderR->setBrush (TQBrush (borderColor)); - QString t = title->text(); + TQString t = title->text(); makeTitle (); setTitle (t); @@ -117,7 +117,7 @@ bool KGrCanvas::changeSize (int d) return FALSE; } - QWMatrix wm = worldMatrix(); + TQWMatrix wm = worldMatrix(); double wmScale = 1.0; // Set the scale back to 1:1 and calculate the new scale factor. @@ -132,11 +132,11 @@ bool KGrCanvas::changeSize (int d) setWorldMatrix (wm); // Force the title size and position to be re-calculated. - QString t = title->text(); + TQString t = title->text(); makeTitle (); setTitle (t); - // Fit the QCanvasView and its frame to the canvas. + // Fit the TQCanvasView and its frame to the canvas. int frame = frameWidth()*2; setFixedSize ((FIELDWIDTH + 4) * 4 * scaleStep + frame, (FIELDHEIGHT + 4) * 4 * scaleStep + frame); @@ -175,7 +175,7 @@ void KGrCanvas::paintCell (int x, int y, char type, int offset) tileNumber = tileNumber + offset; // Offsets 1-9 are for digging sequence. - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. x++; y++; field->setTile (x, y, tileNumber); // Paint cell with required pixmap. } @@ -184,56 +184,56 @@ void KGrCanvas::setBaseScale () { // Synchronise the desktop font size with the initial canvas scale. baseScale = scaleStep; - QString t = title->text(); + TQString t = title->text(); makeTitle (); setTitle (t); } -void KGrCanvas::setTitle (QString newTitle) +void KGrCanvas::setTitle (TQString newTitle) { title->setText (newTitle); } void KGrCanvas::makeTitle () { - // This uses a calculated QLabel and QFont size because a QCanvasText + // This uses a calculated TQLabel and TQFont size because a QCanvasText // object does not always display scaled-up fonts cleanly (in Qt 3.1.1). if (title != 0) title->close (TRUE); // Close and delete previous title. - title = new QLabel ("", this); + title = new TQLabel ("", this); title->setFixedWidth (((FIELDWIDTH * cw + 2 * bw) * scaleStep) / STEP); title->setFixedHeight ((mw * scaleStep) / STEP); title->move (0, 0); title->setPaletteBackgroundColor (borderColor); title->setPaletteForegroundColor (textColor); - title->setFont (QFont (fontInfo().family(), - (baseFontSize * scaleStep) / baseScale, QFont::Bold)); + title->setFont (TQFont (fontInfo().family(), + (baseFontSize * scaleStep) / baseScale, TQFont::Bold)); title->setAlignment (Qt::AlignCenter); title->raise(); title->show(); } -void KGrCanvas::contentsMousePressEvent (QMouseEvent * m) { +void KGrCanvas::contentsMousePressEvent (TQMouseEvent * m) { emit mouseClick (m->button ()); } -void KGrCanvas::contentsMouseReleaseEvent (QMouseEvent * m) { +void KGrCanvas::contentsMouseReleaseEvent (TQMouseEvent * m) { emit mouseLetGo (m->button ()); } -QPoint KGrCanvas::getMousePos () +TQPoint KGrCanvas::getMousePos () { int i, j; int fw = frameWidth(); int cell = 4 * scaleStep; - QPoint p = mapFromGlobal (m->pos()); + TQPoint p = mapFromGlobal (m->pos()); - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. i = ((p.x() - fw) / cell) - 1; j = ((p.y() - fw) / cell) - 1; - return (QPoint (i, j)); + return (TQPoint (i, j)); } void KGrCanvas::setMousePos (int i, int j) @@ -241,19 +241,19 @@ void KGrCanvas::setMousePos (int i, int j) int fw = frameWidth(); int cell = 4 * scaleStep; - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. i++; j++; - //m->setPos (mapToGlobal (QPoint (i * 4 * STEP + 8, j * 4 * STEP + 8))); - //m->setPos (mapToGlobal (QPoint (i * 5 * STEP + 10, j * 5 * STEP + 10))); + //m->setPos (mapToGlobal (TQPoint (i * 4 * STEP + 8, j * 4 * STEP + 8))); + //m->setPos (mapToGlobal (TQPoint (i * 5 * STEP + 10, j * 5 * STEP + 10))); m->setPos (mapToGlobal ( - QPoint (i * cell + fw + cell / 2, j * cell + fw + cell / 2))); + TQPoint (i * cell + fw + cell / 2, j * cell + fw + cell / 2))); } void KGrCanvas::makeHeroSprite (int i, int j, int startFrame) { - heroSprite = new QCanvasSprite (heroArray, field); + heroSprite = new TQCanvasSprite (heroArray, field); - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. i++; j++; heroSprite->move (i * 4 * STEP, j * 4 * STEP, startFrame); heroSprite->setZ (1); @@ -267,11 +267,11 @@ void KGrCanvas::setHeroVisible (bool newState) void KGrCanvas::makeEnemySprite (int i, int j, int startFrame) { - QCanvasSprite * enemySprite = new QCanvasSprite (enemyArray, field); + TQCanvasSprite * enemySprite = new TQCanvasSprite (enemyArray, field); enemySprites->append (enemySprite); - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. i++; j++; enemySprite->move (i * 4 * STEP, j * 4 * STEP, startFrame); enemySprite->setZ (2); @@ -280,7 +280,7 @@ void KGrCanvas::makeEnemySprite (int i, int j, int startFrame) void KGrCanvas::moveHero (int x, int y, int frame) { - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. heroSprite->move (x + 4 * STEP, y + 4 * STEP, frame); updateCanvas(); } @@ -291,7 +291,7 @@ void KGrCanvas::moveEnemy (int id, int x, int y, int frame, int nuggets) frame = frame + goldEnemy; // show him with gold outline. } - // In KGoldrunner, the top-left visible cell is [1,1] --- in QCanvas [2,2]. + // In KGoldrunner, the top-left visible cell is [1,1] --- in TQCanvas [2,2]. enemySprites->at(id)->move (x + 4 * STEP, y + 4 * STEP, frame); updateCanvas(); } @@ -301,10 +301,10 @@ void KGrCanvas::deleteEnemySprites() enemySprites->clear(); } -QPixmap KGrCanvas::getPixmap (char type) +TQPixmap KGrCanvas::getPixmap (char type) { - QPixmap pic (bgw, bgh, bgd); - QPainter p (& pic); + TQPixmap pic (bgw, bgh, bgd); + TQPainter p (& pic); int tileNumber; // Get a pixmap from the tile-array for use on an edit-button. @@ -347,30 +347,30 @@ void KGrCanvas::initView() brickbg = 8; // Solid brick - 1st pixmap. fbrickbg = 15; // False brick - 8th pixmap (for editing). - QPixmap pixmap; - QImage image; + TQPixmap pixmap; + TQImage image; - pixmap = QPixmap (hgbrick_xpm); + pixmap = TQPixmap (hgbrick_xpm); bgw = pixmap.width(); // Save dimensions for "getPixmap". bgh = pixmap.height(); bgd = pixmap.depth(); // Assemble the background and editing pixmaps into a strip (18 pixmaps). - bgPix = QPixmap ((brickbg + 10) * bgw, bgh, bgd); + bgPix = TQPixmap ((brickbg + 10) * bgw, bgh, bgd); makeTiles(); // Fill the strip with 18 tiles. // Define the canvas as an array of tiles. Default tile is 0 (free space). int frame = frameWidth()*2; - field = new QCanvas ((FIELDWIDTH+border) * bgw, (FIELDHEIGHT+border) * bgh); + field = new TQCanvas ((FIELDWIDTH+border) * bgw, (FIELDHEIGHT+border) * bgh); field->setTiles (bgPix, (FIELDWIDTH+border), (FIELDHEIGHT+border), bgw, bgh); // Embed the canvas in the view and make it occupy the whole of the view. setCanvas (field); - setVScrollBarMode (QScrollView::AlwaysOff); - setHScrollBarMode (QScrollView::AlwaysOff); + setVScrollBarMode (TQScrollView::AlwaysOff); + setHScrollBarMode (TQScrollView::AlwaysOff); setFixedSize (field->width() + frame, field->height() + frame); ////////////////////////////////////////////////////////////////////////// @@ -379,41 +379,41 @@ void KGrCanvas::initView() // climb up ladder (2) and fall (2) --- total 20. // ////////////////////////////////////////////////////////////////////////// - // Convert the pixmap strip for hero animation into a QCanvasPixmapArray. - pixmap = QPixmap (hero_xpm); + // Convert the pixmap strip for hero animation into a TQCanvasPixmapArray. + pixmap = TQPixmap (hero_xpm); image = pixmap.convertToImage (); #ifdef QT3 - QPixmap pm; - QValueList<QPixmap> pmList; + TQPixmap pm; + TQValueList<TQPixmap> pmList; for (int i = 0; i < 20; i++) { pm.convertFromImage (image.copy (i * 16, 0, 16, 16)); pmList.append (pm); } - heroArray = new QCanvasPixmapArray (pmList); // Hot spots all (0,0). + heroArray = new TQCanvasPixmapArray (pmList); // Hot spots all (0,0). #else - QPixmap * pm; - QPoint * pt; - QList<QPixmap> pmList; - QList<QPoint> ptList; + TQPixmap * pm; + TQPoint * pt; + QList<TQPixmap> pmList; + QList<TQPoint> ptList; - pt = new QPoint (0, 0); // "Hot spot" not used in KGoldrunner. + pt = new TQPoint (0, 0); // "Hot spot" not used in KGoldrunner. for (int i = 0; i < 20; i++) { - pm = new QPixmap (); + pm = new TQPixmap (); pm->convertFromImage (image.copy (i * 16, 0, 16, 16)); pmList.append (pm); ptList.append (pt); } - heroArray = new QCanvasPixmapArray (pmList, ptList); + heroArray = new TQCanvasPixmapArray (pmList, ptList); #endif - // Convert pixmap strips for enemy animations into a QCanvasPixmapArray. + // Convert pixmap strips for enemy animations into a TQCanvasPixmapArray. // First convert the pixmaps for enemies with no gold ... - pixmap = QPixmap (enemy1_xpm); + pixmap = TQPixmap (enemy1_xpm); image = pixmap.convertToImage (); pmList.clear(); @@ -427,7 +427,7 @@ void KGrCanvas::initView() ptList.clear(); for (int i = 0; i < 20; i++) { - pm = new QPixmap (); + pm = new TQPixmap (); pm->convertFromImage (image.copy (i * 16, 0, 16, 16)); pmList.append (pm); ptList.append (pt); @@ -435,7 +435,7 @@ void KGrCanvas::initView() #endif // ... then convert the gold-carrying enemies. - pixmap = QPixmap (enemy2_xpm); + pixmap = TQPixmap (enemy2_xpm); image = pixmap.convertToImage (); #ifdef QT3 @@ -444,16 +444,16 @@ void KGrCanvas::initView() pmList.append (pm); } - enemyArray = new QCanvasPixmapArray (pmList); // Hot spots all (0,0). + enemyArray = new TQCanvasPixmapArray (pmList); // Hot spots all (0,0). #else for (int i = 0; i < 20; i++) { - pm = new QPixmap (); + pm = new TQPixmap (); pm->convertFromImage (image.copy (i * 16, 0, 16, 16)); pmList.append (pm); ptList.append (pt); } - enemyArray = new QCanvasPixmapArray (pmList, ptList); + enemyArray = new TQCanvasPixmapArray (pmList, ptList); #endif goldEnemy = 20; // Offset of gold-carrying frames. @@ -467,29 +467,29 @@ void KGrCanvas::initView() // Create an empty list of enemy sprites. #ifdef QT3 - enemySprites = new QPtrList<QCanvasSprite> (); + enemySprites = new TQPtrList<TQCanvasSprite> (); #else - enemySprites = new QList<QCanvasSprite> (); + enemySprites = new QList<TQCanvasSprite> (); #endif enemySprites->setAutoDelete(TRUE); } void KGrCanvas::makeTiles () { - QPainter p (& bgPix); + TQPainter p (& bgPix); // First draw the single pixmaps (8 tiles) ... - p.drawPixmap (freebg * bgw, 0, QPixmap (hgbrick_xpm)); // Free space. - p.drawPixmap (nuggetbg * bgw, 0, QPixmap (nugget_xpm)); // Nugget. - p.drawPixmap (polebg * bgw, 0, QPixmap (pole_xpm)); // Pole or bar. - p.drawPixmap (ladderbg * bgw, 0, QPixmap (ladder_xpm)); // Ladder. - p.drawPixmap (hladderbg * bgw, 0, QPixmap (hladder_xpm)); // Hidden laddr. - p.drawPixmap (edherobg * bgw, 0, QPixmap (edithero_xpm)); // Static hero. - p.drawPixmap (edenemybg * bgw, 0, QPixmap (editenemy_xpm)); // Static enemy. - p.drawPixmap (betonbg * bgw, 0, QPixmap (beton_xpm)); // Concrete. + p.drawPixmap (freebg * bgw, 0, TQPixmap (hgbrick_xpm)); // Free space. + p.drawPixmap (nuggetbg * bgw, 0, TQPixmap (nugget_xpm)); // Nugget. + p.drawPixmap (polebg * bgw, 0, TQPixmap (pole_xpm)); // Pole or bar. + p.drawPixmap (ladderbg * bgw, 0, TQPixmap (ladder_xpm)); // Ladder. + p.drawPixmap (hladderbg * bgw, 0, TQPixmap (hladder_xpm)); // Hidden laddr. + p.drawPixmap (edherobg * bgw, 0, TQPixmap (edithero_xpm)); // Static hero. + p.drawPixmap (edenemybg * bgw, 0, TQPixmap (editenemy_xpm)); // Static enemy. + p.drawPixmap (betonbg * bgw, 0, TQPixmap (beton_xpm)); // Concrete. // ... then add the 10 brick pixmaps. - p.drawPixmap (brickbg * bgw, 0, QPixmap (bricks_xpm)); // Bricks. + p.drawPixmap (brickbg * bgw, 0, TQPixmap (bricks_xpm)); // Bricks. p.end(); } @@ -500,7 +500,7 @@ void KGrCanvas::makeBorder () // Allow some overlap to prevent slits appearing when using "changeSize". colour = borderColor; - // The first rectangle is actually a QLabel drawn by "makeTitle()". + // The first rectangle is actually a TQLabel drawn by "makeTitle()". // borderT = drawRectangle (11, 0, 0, FIELDWIDTH*cw + 2*bw, mw); borderB = drawRectangle (11, 0, FIELDHEIGHT*cw + bw + lw, FIELDWIDTH*cw + 2*bw, mw); @@ -509,19 +509,19 @@ void KGrCanvas::makeBorder () mw, FIELDHEIGHT*cw + 2*lw + 2); // Draw inside edges of border, in the same way. - colour = QColor (black); + colour = TQColor (black); drawRectangle (10, bw-lw, bw-lw-1, FIELDWIDTH*cw + 2*lw, lw+1); drawRectangle (10, bw-lw, FIELDHEIGHT*cw + bw, FIELDWIDTH*cw + 2*lw, lw+1); drawRectangle (10, bw - lw, bw, lw, FIELDHEIGHT*cw); drawRectangle (10, FIELDWIDTH*cw + bw, bw, lw, FIELDHEIGHT*cw); } -QCanvasRectangle * KGrCanvas::drawRectangle (int z, int x, int y, int w, int h) +TQCanvasRectangle * KGrCanvas::drawRectangle (int z, int x, int y, int w, int h) { - QCanvasRectangle * r = new QCanvasRectangle (x, y, w, h, field); + TQCanvasRectangle * r = new TQCanvasRectangle (x, y, w, h, field); - r->setBrush (QBrush (colour)); - r->setPen (QPen (NoPen)); + r->setBrush (TQBrush (colour)); + r->setPen (TQPen (NoPen)); r->setZ (z); r->show(); @@ -541,13 +541,13 @@ void KGrCanvas::changeColours (const char * colours []) recolourObject (beton_xpm, colours); recolourObject (bricks_xpm, colours); - borderColor = QColor (colours [1]); - textColor = QColor (colours [2]); + borderColor = TQColor (colours [1]); + textColor = TQColor (colours [2]); - KGrThumbNail::backgroundColor = QColor (QString(colours [3]).right(7)); - KGrThumbNail::brickColor = QColor (QString(colours [6]).right(7)); - KGrThumbNail::ladderColor = QColor (QString(colours [9]).right(7)); - KGrThumbNail::poleColor = QColor (QString(colours [11]).right(7)); + KGrThumbNail::backgroundColor = TQColor (TQString(colours [3]).right(7)); + KGrThumbNail::brickColor = TQColor (TQString(colours [6]).right(7)); + KGrThumbNail::ladderColor = TQColor (TQString(colours [9]).right(7)); + KGrThumbNail::poleColor = TQColor (TQString(colours [11]).right(7)); } void KGrCanvas::recolourObject (const char * object [], const char * colours []) diff --git a/kgoldrunner/src/kgrcanvas.h b/kgoldrunner/src/kgrcanvas.h index 02b89bed..2c0ab270 100644 --- a/kgoldrunner/src/kgrcanvas.h +++ b/kgoldrunner/src/kgrcanvas.h @@ -22,22 +22,22 @@ #include <config.h> #endif -#include <qcursor.h> -#include <qcanvas.h> -#include <qlabel.h> -#include <qimage.h> -#include <qpainter.h> +#include <tqcursor.h> +#include <tqcanvas.h> +#include <tqlabel.h> +#include <tqimage.h> +#include <tqpainter.h> class KGrCanvas : public QCanvasView { Q_OBJECT public: - KGrCanvas (QWidget * parent = 0, const char *name = 0); + KGrCanvas (TQWidget * parent = 0, const char *name = 0); virtual ~KGrCanvas(); - void changeLandscape (const QString & name); + void changeLandscape (const TQString & name); - QPoint getMousePos (); + TQPoint getMousePos (); void setMousePos (int, int); bool changeSize (int); @@ -45,7 +45,7 @@ public: void updateCanvas (); void paintCell (int, int, char, int offset = 0); - void setTitle (QString); + void setTitle (TQString); void makeHeroSprite (int, int, int); void setHeroVisible (bool); @@ -55,55 +55,55 @@ public: void moveEnemy (int, int, int, int, int); void deleteEnemySprites(); - QPixmap getPixmap (char type); + TQPixmap getPixmap (char type); signals: void mouseClick (int); void mouseLetGo (int); protected: - void contentsMousePressEvent (QMouseEvent *); - void contentsMouseReleaseEvent (QMouseEvent *); + void contentsMousePressEvent (TQMouseEvent *); + void contentsMouseReleaseEvent (TQMouseEvent *); private: - QCursor * m; + TQCursor * m; - QCanvas * field; - QCanvasView * fieldView; + TQCanvas * field; + TQCanvasView * fieldView; int scaleStep; // Current scale-factor of canvas. int baseScale; // Starting scale-factor of canvas. int baseFontSize; int border; // Number of tiles allowed for border. int cw, bw, lw, mw; // Dimensions (in pixels) of the border. - QColor borderColor, textColor; // Border colours. - QLabel * title; // Title and top part of border. - QCanvasRectangle * borderB; // Bottom part of border. - QCanvasRectangle * borderL; // Left-hand part of border. - QCanvasRectangle * borderR; // Right-hand part of border. + TQColor borderColor, textColor; // Border colours. + TQLabel * title; // Title and top part of border. + TQCanvasRectangle * borderB; // Bottom part of border. + TQCanvasRectangle * borderL; // Left-hand part of border. + TQCanvasRectangle * borderR; // Right-hand part of border. int freebg, nuggetbg, polebg, ladderbg, hladderbg; int edherobg, edenemybg, betonbg, brickbg, fbrickbg; int bgw, bgh, bgd; - QPixmap bgPix; + TQPixmap bgPix; - QCanvasPixmapArray * heroArray; - QCanvasPixmapArray * enemyArray; + TQCanvasPixmapArray * heroArray; + TQCanvasPixmapArray * enemyArray; int goldEnemy; - QCanvasSprite * heroSprite; + TQCanvasSprite * heroSprite; #ifdef QT3 - QPtrList<QCanvasSprite> * enemySprites; + TQPtrList<TQCanvasSprite> * enemySprites; #else - QList<QCanvasSprite> * enemySprites; + QList<TQCanvasSprite> * enemySprites; #endif void initView(); void makeTiles(); void makeBorder(); void makeTitle(); - QColor colour; - QCanvasRectangle * drawRectangle (int, int, int, int, int); + TQColor colour; + TQCanvasRectangle * drawRectangle (int, int, int, int, int); void changeColours (const char * colours []); void recolourObject (const char * object [], const char * colours []); }; diff --git a/kgoldrunner/src/kgrdialog.cpp b/kgoldrunner/src/kgrdialog.cpp index 61ca2f29..632eb617 100644 --- a/kgoldrunner/src/kgrdialog.cpp +++ b/kgoldrunner/src/kgrdialog.cpp @@ -28,14 +28,14 @@ #ifdef KGR_PORTABLE KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, - QPtrList<KGrCollection> & gamesList, KGrGame * theGame, - QWidget * parent, const char * name) - : QDialog (parent, name, TRUE, + TQPtrList<KGrCollection> & gamesList, KGrGame * theGame, + TQWidget * parent, const char * name) + : TQDialog (parent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, - QPtrList<KGrCollection> & gamesList, KGrGame * theGame, - QWidget * parent, const char * name) + TQPtrList<KGrCollection> & gamesList, KGrGame * theGame, + TQWidget * parent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Select Game"), KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help, KDialogBase::Ok, parent, name) @@ -52,66 +52,66 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, #ifdef KGR_PORTABLE int margin = 10; int spacing = 10; - QWidget * dad = this; + TQWidget * dad = this; #else int margin = marginHint(); int spacing = spacingHint(); - QWidget * dad = plainPage(); + TQWidget * dad = plainPage(); #endif - QVBoxLayout * mainLayout = new QVBoxLayout (dad, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (dad, margin, spacing); - collnL = new QLabel (i18n("List of games:"), dad); + collnL = new TQLabel (i18n("List of games:"), dad); mainLayout->addWidget (collnL); - colln = new QListBox (dad); + colln = new TQListBox (dad); mainLayout->addWidget (colln); - QHBox * gameInfo = new QHBox (dad); + TQHBox * gameInfo = new TQHBox (dad); mainLayout->addWidget (gameInfo); gameInfo->setSpacing (spacing); - collnN = new QLabel ("", gameInfo); // Name of selected collection. - QFont f = collnN->font(); + collnN = new TQLabel ("", gameInfo); // Name of selected collection. + TQFont f = collnN->font(); f.setBold (TRUE); collnN->setFont (f); - collnA = new QPushButton (i18n("More Info"), gameInfo); + collnA = new TQPushButton (i18n("More Info"), gameInfo); - collnD = new QLabel ("", dad); // Description of collection. + collnD = new TQLabel ("", dad); // Description of collection. mainLayout->addWidget (collnD); - QFrame * separator = new QFrame (dad); - separator->setFrameStyle (QFrame::HLine + QFrame::Sunken); + TQFrame * separator = new TQFrame (dad); + separator->setFrameStyle (TQFrame::HLine + TQFrame::Sunken); mainLayout->addWidget (separator); if ((action == SL_START) || (action == SL_UPD_GAME)) { dad-> setCaption (i18n("Select Game")); - QLabel * startMsg = new QLabel + TQLabel * startMsg = new QLabel ("<b>" + i18n("Level 1 of the selected game is:") + "</b>", dad); mainLayout->addWidget (startMsg); } else { dad-> setCaption (i18n("Select Game/Level")); - QLabel * selectLev = new QLabel (i18n("Select level:"), dad); + TQLabel * selectLev = new TQLabel (i18n("Select level:"), dad); mainLayout->addWidget (selectLev); } - QGridLayout * grid = new QGridLayout (3, 2, -1); + TQGridLayout * grid = new TQGridLayout (3, 2, -1); mainLayout->addLayout (grid); // Initial range 1->150, small step 1, big step 10 and default value 1. - number = new QScrollBar (1, 150, 1, 10, 1, - QScrollBar::Horizontal, dad); + number = new TQScrollBar (1, 150, 1, 10, 1, + TQScrollBar::Horizontal, dad); grid->addWidget (number, 1, 1); - QHBox * numberPair = new QHBox (dad); + TQHBox * numberPair = new TQHBox (dad); grid->addWidget (numberPair, 2, 1); numberPair->setSpacing (spacing); - numberL = new QLabel (i18n("Level number:"), numberPair); - display = new QLineEdit (numberPair); + numberL = new TQLabel (i18n("Level number:"), numberPair); + display = new TQLineEdit (numberPair); - levelNH = new QPushButton (i18n("Edit Level Name && Hint"), dad); + levelNH = new TQPushButton (i18n("Edit Level Name && Hint"), dad); mainLayout->addWidget (levelNH); - slName = new QLabel ("", dad); + slName = new TQLabel ("", dad); grid->addWidget (slName, 3, 1); thumbNail = new KGrThumbNail (dad); grid->addMultiCellWidget (thumbNail, 1, 3, 2, 2); @@ -122,15 +122,15 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, thumbNail-> setFixedHeight ((FIELDHEIGHT * cellSize) + 2); #ifdef KGR_PORTABLE - QHBox * buttons = new QHBox (this); + TQHBox * buttons = new TQHBox (this); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. - HELP = new QPushButton (i18n("Help"), buttons); - OK = new QPushButton (i18n("&OK"), buttons); - CANCEL = new QPushButton (i18n("&Cancel"), buttons); + HELP = new TQPushButton (i18n("Help"), buttons); + OK = new TQPushButton (i18n("&OK"), buttons); + CANCEL = new TQPushButton (i18n("&Cancel"), buttons); - QPoint p = parent->mapToGlobal (QPoint (0,0)); + TQPoint p = parent->mapToGlobal (TQPoint (0,0)); // Base the geometry of the dialog box on the playing area. int cell = parent->width() / (FIELDWIDTH + 4); @@ -149,7 +149,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, slSetCollections (defaultGame); // Vary the dialog according to the action. - QString OKText = ""; + TQString OKText = ""; switch (slAction) { case SL_START: // Must start at level 1, but can choose a collection. OKText = i18n("Start Game"); @@ -208,41 +208,41 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, } // Paint a thumbnail sketch of the level. - thumbNail->setFrameStyle (QFrame::Box | QFrame::Plain); + thumbNail->setFrameStyle (TQFrame::Box | TQFrame::Plain); thumbNail->setLineWidth (1); slPaintLevel(); thumbNail->show(); - connect (colln, SIGNAL (highlighted (int)), this, SLOT (slColln (int))); - connect (collnA, SIGNAL (clicked ()), this, SLOT (slAboutColln ())); + connect (colln, TQT_SIGNAL (highlighted (int)), this, TQT_SLOT (slColln (int))); + connect (collnA, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slAboutColln ())); - connect (display, SIGNAL (textChanged (const QString &)), - this, SLOT (slUpdate (const QString &))); + connect (display, TQT_SIGNAL (textChanged (const TQString &)), + this, TQT_SLOT (slUpdate (const TQString &))); - connect (number, SIGNAL (valueChanged(int)), this, SLOT(slShowLevel(int))); + connect (number, TQT_SIGNAL (valueChanged(int)), this, TQT_SLOT(slShowLevel(int))); // Only enable name and hint dialog here if saving a new or edited level. // At other times the name and hint have not been loaded or initialised yet. if ((slAction == SL_CREATE) || (slAction == SL_SAVE)) { - connect (levelNH, SIGNAL (clicked()), game, SLOT (editNameAndHint())); + connect (levelNH, TQT_SIGNAL (clicked()), game, TQT_SLOT (editNameAndHint())); } else { levelNH->setEnabled (FALSE); levelNH->hide(); } - connect (colln, SIGNAL (highlighted (int)), this, SLOT (slPaintLevel ())); - connect (number, SIGNAL (sliderReleased()), this, SLOT (slPaintLevel())); - connect (number, SIGNAL (nextLine()), this, SLOT (slPaintLevel())); - connect (number, SIGNAL (prevLine()), this, SLOT (slPaintLevel())); - connect (number, SIGNAL (nextPage()), this, SLOT (slPaintLevel())); - connect (number, SIGNAL (prevPage()), this, SLOT (slPaintLevel())); + connect (colln, TQT_SIGNAL (highlighted (int)), this, TQT_SLOT (slPaintLevel ())); + connect (number, TQT_SIGNAL (sliderReleased()), this, TQT_SLOT (slPaintLevel())); + connect (number, TQT_SIGNAL (nextLine()), this, TQT_SLOT (slPaintLevel())); + connect (number, TQT_SIGNAL (prevLine()), this, TQT_SLOT (slPaintLevel())); + connect (number, TQT_SIGNAL (nextPage()), this, TQT_SLOT (slPaintLevel())); + connect (number, TQT_SIGNAL (prevPage()), this, TQT_SLOT (slPaintLevel())); #ifdef KGR_PORTABLE // Set the exits from this dialog box. - connect (OK, SIGNAL (clicked ()), this, SLOT (accept ())); - connect (CANCEL, SIGNAL (clicked ()), this, SLOT (reject ())); - connect (HELP, SIGNAL (clicked ()), this, SLOT (slotHelp ())); + connect (OK, TQT_SIGNAL (clicked ()), this, TQT_SLOT (accept ())); + connect (CANCEL, TQT_SIGNAL (clicked ()), this, TQT_SLOT (reject ())); + connect (HELP, TQT_SIGNAL (clicked ()), this, TQT_SLOT (slotHelp ())); #endif } @@ -343,7 +343,7 @@ void KGrSLDialog::slColln (int i) collnD->setText (i18n("1 level, uses Traditional rules.", "%n levels, uses Traditional rules.", levCnt)); #else - QString levCnt; + TQString levCnt; levCnt = levCnt.setNum (collections.at(n)->nLevels); if (collections.at(n)->settings == 'K') collnD->setText (levCnt + i18n(" levels, uses KGoldrunner rules.")); @@ -373,16 +373,16 @@ void KGrSLDialog::slAboutColln () void KGrSLDialog::slShowLevel (int i) { // Display the level number as the slider is moved. - QString tmp; + TQString tmp; tmp.setNum(i); tmp = tmp.rightJustify(3,'0'); display->setText(tmp); } -void KGrSLDialog::slUpdate (const QString & text) +void KGrSLDialog::slUpdate (const TQString & text) { // Move the slider when a valid level number is entered. - QString s = text; + TQString s = text; bool ok = FALSE; int n = s.toInt (&ok); if (ok) { @@ -410,7 +410,7 @@ void KGrSLDialog::slPaintLevel () void KGrSLDialog::slotHelp () { // Help for "Select Game and Level" dialog box. - QString s = + TQString s = i18n("The main button at the bottom echoes the " "menu action you selected. Click it after choosing " "a game and level - or use \"Cancel\"."); @@ -485,13 +485,13 @@ void KGrSLDialog::slotHelp () *******************************************************************************/ #ifdef KGR_PORTABLE -KGrNHDialog::KGrNHDialog(const QString & levelName, const QString & levelHint, - QWidget * parent, const char * name) - : QDialog (parent, name, TRUE, +KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, + TQWidget * parent, const char * name) + : TQDialog (parent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else -KGrNHDialog::KGrNHDialog(const QString & levelName, const QString & levelHint, - QWidget * parent, const char * name) +KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, + TQWidget * parent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Edit Name & Hint"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent, name) @@ -500,45 +500,45 @@ KGrNHDialog::KGrNHDialog(const QString & levelName, const QString & levelHint, #ifdef KGR_PORTABLE int margin = 10; int spacing = 10; - QWidget * dad = this; + TQWidget * dad = this; #else int margin = marginHint(); int spacing = spacingHint(); - QWidget * dad = plainPage(); + TQWidget * dad = plainPage(); #endif - QVBoxLayout * mainLayout = new QVBoxLayout (dad, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (dad, margin, spacing); - QLabel * nameL = new QLabel (i18n("Name of level:"), dad); + TQLabel * nameL = new TQLabel (i18n("Name of level:"), dad); mainLayout->addWidget (nameL); - nhName = new QLineEdit (dad); + nhName = new TQLineEdit (dad); mainLayout->addWidget (nhName); - QLabel * mleL = new QLabel (i18n("Hint for level:"), dad); + TQLabel * mleL = new TQLabel (i18n("Hint for level:"), dad); mainLayout->addWidget (mleL); // Set up a widget to hold the wrapped text, using \n for paragraph breaks. #ifdef QT3 - mle = new QTextEdit (dad); + mle = new TQTextEdit (dad); mle-> setTextFormat (PlainText); #else - mle = new QMultiLineEdit (dad); + mle = new TQMultiLineEdit (dad); #endif mainLayout->addWidget (mle); #ifdef KGR_PORTABLE - QHBox * buttons = new QHBox (dad); + TQHBox * buttons = new TQHBox (dad); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. - QPushButton * OK = new QPushButton (i18n("&OK"), buttons); - QPushButton * CANCEL = new QPushButton (i18n("&Cancel"), buttons); + TQPushButton * OK = new TQPushButton (i18n("&OK"), buttons); + TQPushButton * CANCEL = new TQPushButton (i18n("&Cancel"), buttons); dad-> setCaption (i18n("Edit Name & Hint")); #endif // Base the geometry of the text box on the playing area. - QPoint p = parent->mapToGlobal (QPoint (0,0)); + QPoint p = parent->mapToGlobal (TQPoint (0,0)); int c = parent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+4*c, p.y()+4*c); mle-> setMinimumSize ((FIELDWIDTH*c/2), (FIELDHEIGHT/2)*c); @@ -546,7 +546,7 @@ KGrNHDialog::KGrNHDialog(const QString & levelName, const QString & levelHint, // Configure the text box. mle-> setAlignment (AlignLeft); #ifndef QT3 - mle-> setWordWrap (QMultiLineEdit::WidgetWidth); + mle-> setWordWrap (TQMultiLineEdit::WidgetWidth); mle-> setFixedVisibleLines (9); #endif @@ -557,8 +557,8 @@ KGrNHDialog::KGrNHDialog(const QString & levelName, const QString & levelHint, // OK-> setAccel (Key_Return); // No! We need it in "mle" box. CANCEL-> setAccel (Key_Escape); - connect (OK, SIGNAL (clicked ()), dad, SLOT (accept ())); - connect (CANCEL, SIGNAL (clicked ()), dad, SLOT (reject ())); + connect (OK, TQT_SIGNAL (clicked ()), dad, TQT_SLOT (accept ())); + connect (CANCEL, TQT_SIGNAL (clicked ()), dad, TQT_SLOT (reject ())); #endif } @@ -572,14 +572,14 @@ KGrNHDialog::~KGrNHDialog() #ifdef KGR_PORTABLE KGrECDialog::KGrECDialog (int action, int collnIndex, - QPtrList<KGrCollection> & gamesList, - QWidget * parent, const char * name) - : QDialog (parent, name, TRUE, + TQPtrList<KGrCollection> & gamesList, + TQWidget * parent, const char * name) + : TQDialog (parent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrECDialog::KGrECDialog (int action, int collnIndex, - QPtrList<KGrCollection> & gamesList, - QWidget * parent, const char * name) + TQPtrList<KGrCollection> & gamesList, + TQWidget * parent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Edit Game Info"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent, name) @@ -591,56 +591,56 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, #ifdef KGR_PORTABLE int margin = 10; int spacing = 10; - QWidget * dad = this; + TQWidget * dad = this; #else int margin = marginHint(); int spacing = spacingHint(); - QWidget * dad = plainPage(); + TQWidget * dad = plainPage(); #endif - QVBoxLayout * mainLayout = new QVBoxLayout (dad, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (dad, margin, spacing); - QHBox * nameBox = new QHBox (dad); + TQHBox * nameBox = new TQHBox (dad); mainLayout->addWidget (nameBox); nameBox->setSpacing (spacing); - nameL = new QLabel (i18n("Name of game:"), nameBox); - ecName = new QLineEdit (nameBox); + nameL = new TQLabel (i18n("Name of game:"), nameBox); + ecName = new TQLineEdit (nameBox); - QHBox * prefixBox = new QHBox (dad); + TQHBox * prefixBox = new TQHBox (dad); mainLayout->addWidget (prefixBox); prefixBox->setSpacing (spacing); - prefixL = new QLabel (i18n("File name prefix:"), prefixBox); - ecPrefix = new QLineEdit (prefixBox); + prefixL = new TQLabel (i18n("File name prefix:"), prefixBox); + ecPrefix = new TQLineEdit (prefixBox); - ecGrp = new QButtonGroup (1, QButtonGroup::Horizontal, 0, dad); + ecGrp = new TQButtonGroup (1, TQButtonGroup::Horizontal, 0, dad); mainLayout->addWidget (ecGrp); - ecTradB = new QRadioButton (i18n("Traditional rules"), ecGrp); - ecKGrB = new QRadioButton (i18n("KGoldrunner rules"), ecGrp); + ecTradB = new TQRadioButton (i18n("Traditional rules"), ecGrp); + ecKGrB = new TQRadioButton (i18n("KGoldrunner rules"), ecGrp); - nLevL = new QLabel (i18n( "0 levels" ), dad); + nLevL = new TQLabel (i18n( "0 levels" ), dad); mainLayout->addWidget (nLevL); - mleL = new QLabel (i18n("About this game:"), dad); + mleL = new TQLabel (i18n("About this game:"), dad); mainLayout->addWidget (mleL); // Set up a widget to hold the wrapped text, using \n for paragraph breaks. #ifdef QT3 - mle = new QTextEdit (dad); + mle = new TQTextEdit (dad); mle-> setTextFormat (PlainText); #else - mle = new QMultiLineEdit (dad); + mle = new TQMultiLineEdit (dad); #endif mainLayout->addWidget (mle); #ifdef KGR_PORTABLE - QHBox * buttons = new QHBox (dad); + TQHBox * buttons = new TQHBox (dad); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. - OK = new QPushButton (i18n("&OK"), buttons); - CANCEL = new QPushButton (i18n("&Cancel"), buttons); + OK = new TQPushButton (i18n("&OK"), buttons); + CANCEL = new TQPushButton (i18n("&Cancel"), buttons); - QPoint p = parent->mapToGlobal (QPoint (0,0)); + TQPoint p = parent->mapToGlobal (TQPoint (0,0)); // Base the geometry of the dialog box on the playing area. int cell = parent->width() / (FIELDWIDTH + 4); @@ -655,7 +655,7 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, setCaption (i18n("Edit Game Info")); } - QString OKText = ""; + TQString OKText = ""; if (action == SL_UPD_GAME) { // Edit existing collection. ecName-> setText (collections.at(defaultGame)->name); ecPrefix-> setText (collections.at(defaultGame)->prefix); @@ -696,7 +696,7 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, // Configure the edit box. mle-> setAlignment (AlignLeft); #ifndef QT3 - mle-> setWordWrap (QMultiLineEdit::WidgetWidth); + mle-> setWordWrap (TQMultiLineEdit::WidgetWidth); mle-> setFixedVisibleLines (8); #endif @@ -709,8 +709,8 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, mle-> setText (""); } - connect (ecKGrB, SIGNAL (clicked ()), this, SLOT (ecSetKGr ())); - connect (ecTradB, SIGNAL (clicked ()), this, SLOT (ecSetTrad ())); + connect (ecKGrB, TQT_SIGNAL (clicked ()), this, TQT_SLOT (ecSetKGr ())); + connect (ecTradB, TQT_SIGNAL (clicked ()), this, TQT_SLOT (ecSetTrad ())); #ifdef KGR_PORTABLE OK-> setGeometry (10, 145 + mle->height(), 100, 25); @@ -721,8 +721,8 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, dad-> resize (300, 175 + mle->height()); - connect (OK, SIGNAL (clicked ()), this, SLOT (accept())); - connect (CANCEL, SIGNAL (clicked ()), this, SLOT (reject())); + connect (OK, TQT_SIGNAL (clicked ()), this, TQT_SLOT (accept())); + connect (CANCEL, TQT_SIGNAL (clicked ()), this, TQT_SLOT (reject())); #endif } @@ -748,15 +748,15 @@ void KGrECDialog::ecSetTrad () {ecSetRules ('T');} *******************************************************************************/ #ifdef KGR_PORTABLE -KGrLGDialog::KGrLGDialog (QFile * savedGames, - QPtrList<KGrCollection> & collections, - QWidget * parent, const char * name) - : QDialog (parent, name, TRUE, +KGrLGDialog::KGrLGDialog (TQFile * savedGames, + TQPtrList<KGrCollection> & collections, + TQWidget * parent, const char * name) + : TQDialog (parent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else -KGrLGDialog::KGrLGDialog (QFile * savedGames, - QPtrList<KGrCollection> & collections, - QWidget * parent, const char * name) +KGrLGDialog::KGrLGDialog (TQFile * savedGames, + TQPtrList<KGrCollection> & collections, + TQWidget * parent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Select Saved Game"), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent, name) @@ -765,20 +765,20 @@ KGrLGDialog::KGrLGDialog (QFile * savedGames, #ifdef KGR_PORTABLE int margin = 10; int spacing = 10; - QWidget * dad = this; + TQWidget * dad = this; #else int margin = marginHint(); int spacing = spacingHint(); - QWidget * dad = plainPage(); + TQWidget * dad = plainPage(); #endif - QVBoxLayout * mainLayout = new QVBoxLayout (dad, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (dad, margin, spacing); - QLabel * lgHeader = new QLabel ( + TQLabel * lgHeader = new TQLabel ( i18n("Game Level/Lives/Score " "Day Date Time "), dad); - lgList = new QListBox (dad); + lgList = new TQListBox (dad); #ifdef KGR_PORTABLE QFont f ("courier", 12); #else @@ -793,17 +793,17 @@ KGrLGDialog::KGrLGDialog (QFile * savedGames, mainLayout-> addWidget (lgList); #ifdef KGR_PORTABLE - QHBox * buttons = new QHBox (dad); + TQHBox * buttons = new TQHBox (dad); buttons-> setSpacing (spacing); // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. - QPushButton * OK = new QPushButton (i18n("&OK"), buttons); - QPushButton * CANCEL = new QPushButton (i18n("&Cancel"), buttons); + TQPushButton * OK = new TQPushButton (i18n("&OK"), buttons); + TQPushButton * CANCEL = new TQPushButton (i18n("&Cancel"), buttons); mainLayout-> addWidget (buttons); dad-> setCaption (i18n("Select Saved Game")); // Base the geometry of the list box on the playing area. - QPoint p = parent->mapToGlobal (QPoint (0,0)); + QPoint p = parent->mapToGlobal (TQPoint (0,0)); int c = parent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+2*c, p.y()+2*c); lgList-> setMinimumHeight ((FIELDHEIGHT/2)*c); @@ -842,10 +842,10 @@ KGrLGDialog::KGrLGDialog (QFile * savedGames, lgList-> setSelected (0, TRUE); lgHighlight = 0; - connect (lgList, SIGNAL (highlighted (int)), this, SLOT (lgSelect (int))); + connect (lgList, TQT_SIGNAL (highlighted (int)), this, TQT_SLOT (lgSelect (int))); #ifdef KGR_PORTABLE - connect (OK, SIGNAL (clicked ()), this, SLOT (accept ())); - connect (CANCEL, SIGNAL (clicked ()), this, SLOT (reject ())); + connect (OK, TQT_SIGNAL (clicked ()), this, TQT_SLOT (accept ())); + connect (CANCEL, TQT_SIGNAL (clicked ()), this, TQT_SLOT (reject ())); #endif } @@ -858,11 +858,11 @@ void KGrLGDialog::lgSelect (int n) *********************** CENTRALISED MESSAGE FUNCTIONS ************************ *******************************************************************************/ -void KGrMessage::information (QWidget * parent, const QString &caption, const QString &text) +void KGrMessage::information (TQWidget * parent, const TQString &caption, const TQString &text) { #ifdef KGR_PORTABLE // Force Qt to do word-wrapping (but it ignores "\n" line-breaks). - QMessageBox::information (parent, caption, + TQMessageBox::information (parent, caption, "<qt>" + text + "</qt>"); #else // KDE does word-wrapping and will observe "\n" line-breaks. @@ -870,14 +870,14 @@ void KGrMessage::information (QWidget * parent, const QString &caption, const QS #endif } -int KGrMessage::warning (QWidget * parent, QString caption, QString text, - QString label0, QString label1, QString label2) +int KGrMessage::warning (TQWidget * parent, TQString caption, TQString text, + TQString label0, TQString label1, TQString label2) { int ans = 0; #ifdef KGR_PORTABLE // Display a box with 2 or 3 buttons, depending on if label2 is empty or not. // Force Qt to do word-wrapping (but it ignores "\n" line-breaks). - ans = QMessageBox::warning (parent, caption, + ans = TQMessageBox::warning (parent, caption, "<qt>" + text + "</qt>", label0, label1, label2, 0, (label2.isEmpty()) ? 1 : 2); @@ -906,56 +906,56 @@ int KGrMessage::warning (QWidget * parent, QString caption, QString text, /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ -void KGrMessage::wrapped (QWidget * parent, QString title, QString contents) +void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) { #ifndef KGR_PORTABLE KMessageBox::information (parent, contents, title); #else - QDialog * mm = new QDialog (parent, "wrappedMessage", TRUE, + TQDialog * mm = new TQDialog (parent, "wrappedMessage", TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; int spacing = 10; - QVBoxLayout * mainLayout = new QVBoxLayout (mm, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (mm, margin, spacing); // Make text background grey not white (i.e. same as widget background). QPalette pl = mm->palette(); #ifdef QT3 - pl.setColor (QColorGroup::Base, mm->paletteBackgroundColor()); + pl.setColor (TQColorGroup::Base, mm->paletteBackgroundColor()); #else - pl.setColor (QColorGroup::Base, mm->backgroundColor()); + pl.setColor (TQColorGroup::Base, mm->backgroundColor()); #endif mm-> setPalette (pl); // Set up a widget to hold the wrapped text, using \n for paragraph breaks. #ifdef QT3 - QTextEdit * mle = new QTextEdit (mm); + TQTextEdit * mle = new TQTextEdit (mm); mle-> setTextFormat (PlainText); #else - QMultiLineEdit * mle = new QMultiLineEdit (mm); + TQMultiLineEdit * mle = new TQMultiLineEdit (mm); #endif mainLayout->addWidget (mle); // Button is for Qt-only portability. NOT COMPILED in KDE environment. - QPushButton * OK = new QPushButton (i18n("&OK"), mm); + TQPushButton * OK = new TQPushButton (i18n("&OK"), mm); mainLayout->addWidget (OK, Qt::AlignHCenter); mm-> setCaption (title); // Base the geometry of the text box on the playing area. - QPoint p = parent->mapToGlobal (QPoint (0,0)); + QPoint p = parent->mapToGlobal (TQPoint (0,0)); int c = parent->width() / (FIELDWIDTH + 4); mm-> move (p.x()+4*c, p.y()+4*c); mle-> setMinimumSize ((FIELDWIDTH*c/2), (FIELDHEIGHT/2)*c); OK-> setMaximumWidth (3*c); - mle-> setFrameStyle (QFrame::NoFrame); + mle-> setFrameStyle (TQFrame::NoFrame); mle-> setAlignment (AlignLeft); mle-> setReadOnly (TRUE); mle-> setText (contents); #ifndef QT3 - mle-> setWordWrap (QMultiLineEdit::WidgetWidth); + mle-> setWordWrap (TQMultiLineEdit::WidgetWidth); mle-> setFixedVisibleLines (10); if (mle-> numLines() < 10) { mle-> setFixedVisibleLines (mle->numLines()); @@ -963,7 +963,7 @@ void KGrMessage::wrapped (QWidget * parent, QString title, QString contents) #endif OK-> setAccel (Key_Return); - connect (OK, SIGNAL (clicked ()), mm, SLOT (accept ())); + connect (OK, TQT_SIGNAL (clicked ()), mm, TQT_SLOT (accept ())); mm-> exec (); diff --git a/kgoldrunner/src/kgrdialog.h b/kgoldrunner/src/kgrdialog.h index 2e2e847c..860328eb 100644 --- a/kgoldrunner/src/kgrdialog.h +++ b/kgoldrunner/src/kgrdialog.h @@ -10,13 +10,13 @@ #ifndef KGRDIALOG_QT_H #define KGRDIALOG_QT_H -// If portable version, use QDialog and QMessageBox. +// If portable version, use TQDialog and TQMessageBox. // If KDE version, use KDialogBase and KMessageBox. #ifdef KGR_PORTABLE -#include <qdialog.h> +#include <tqdialog.h> #define KGR_DIALOG QDialog -#include <qmessagebox.h> +#include <tqmessagebox.h> #else #include <klocale.h> @@ -25,22 +25,22 @@ #include <kmessagebox.h> #endif -#include <qlayout.h> +#include <tqlayout.h> -#include <qlistbox.h> -#include <qscrollbar.h> -#include <qlineedit.h> -#include <qhbox.h> -#include <qpushbutton.h> -#include <qbuttongroup.h> -#include <qradiobutton.h> +#include <tqlistbox.h> +#include <tqscrollbar.h> +#include <tqlineedit.h> +#include <tqhbox.h> +#include <tqpushbutton.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> #ifdef QT3 -#include <qtextedit.h> +#include <tqtextedit.h> #else -#include <qmultilineedit.h> +#include <tqmultilineedit.h> #endif -#include <qptrlist.h> +#include <tqptrlist.h> /** @author Ian Wadham and Marco Krüger @@ -60,8 +60,8 @@ class KGrSLDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase Q_OBJECT public: KGrSLDialog (int action, int requestedLevel, int collnIndex, - QPtrList<KGrCollection> & gamesList, KGrGame * theGame, - QWidget * parent = 0, const char *name = 0); + TQPtrList<KGrCollection> & gamesList, KGrGame * theGame, + TQWidget * parent = 0, const char *name = 0); ~KGrSLDialog(); int selectedLevel() {return (number->value());} @@ -72,37 +72,37 @@ private slots: void slColln (int i); void slAboutColln (); void slShowLevel (int i); - void slUpdate (const QString & text); + void slUpdate (const TQString & text); void slPaintLevel (); void slotHelp (); // Will replace KDE slotHelp(). private: int slAction; - QPtrList<KGrCollection> collections; // List of games. + TQPtrList<KGrCollection> collections; // List of games. int defaultLevel; int defaultGame; int slCollnIndex; KGrGame * game; KGrCollection * collection; - QWidget * slParent; - - QLabel * collnL; - QListBox * colln; - QLabel * collnN; - QLabel * collnD; - QPushButton * collnA; - - QLabel * numberL; - QLineEdit * display; - QScrollBar * number; - QPushButton * levelNH; - QLabel * slName; + TQWidget * slParent; + + TQLabel * collnL; + TQListBox * colln; + TQLabel * collnN; + TQLabel * collnD; + TQPushButton * collnA; + + TQLabel * numberL; + TQLineEdit * display; + TQScrollBar * number; + TQPushButton * levelNH; + TQLabel * slName; KGrThumbNail * thumbNail; #ifdef KGR_PORTABLE - QPushButton * OK; - QPushButton * HELP; - QPushButton * CANCEL; + TQPushButton * OK; + TQPushButton * HELP; + TQPushButton * CANCEL; #endif }; @@ -114,19 +114,19 @@ class KGrNHDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase { Q_OBJECT public: - KGrNHDialog (const QString & levelName, const QString & levelHint, - QWidget * parent = 0, const char * name = 0); + KGrNHDialog (const TQString & levelName, const TQString & levelHint, + TQWidget * parent = 0, const char * name = 0); ~KGrNHDialog(); QString getName() {return (nhName->text());} QString getHint() {return (mle->text());} private: - QLineEdit * nhName; + TQLineEdit * nhName; #ifdef QT3 - QTextEdit * mle; + TQTextEdit * mle; #else - QMultiLineEdit * mle; + TQMultiLineEdit * mle; #endif }; @@ -139,8 +139,8 @@ class KGrECDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase Q_OBJECT public: KGrECDialog (int action, int collnIndex, - QPtrList<KGrCollection> & gamesList, - QWidget *parent = 0, const char *name = 0); + TQPtrList<KGrCollection> & gamesList, + TQWidget *parent = 0, const char *name = 0); ~KGrECDialog(); QString getName() {return (ecName->text());} @@ -154,28 +154,28 @@ private slots: void ecSetTrad(); private: - QPtrList<KGrCollection> collections; // List of existing games. + TQPtrList<KGrCollection> collections; // List of existing games. int defaultGame; - QLabel * nameL; - QLineEdit * ecName; - QLabel * prefixL; - QLineEdit * ecPrefix; - QButtonGroup * ecGrp; - QRadioButton * ecKGrB; - QRadioButton * ecTradB; - QLabel * nLevL; + TQLabel * nameL; + TQLineEdit * ecName; + TQLabel * prefixL; + TQLineEdit * ecPrefix; + TQButtonGroup * ecGrp; + TQRadioButton * ecKGrB; + TQRadioButton * ecTradB; + TQLabel * nLevL; - QLabel * mleL; + TQLabel * mleL; #ifdef QT3 - QTextEdit * mle; + TQTextEdit * mle; #else - QMultiLineEdit * mle; + TQMultiLineEdit * mle; #endif #ifdef KGR_PORTABLE - QPushButton * OK; - QPushButton * CANCEL; + TQPushButton * OK; + TQPushButton * CANCEL; #endif }; @@ -183,22 +183,22 @@ private: *************** DIALOG TO SELECT A SAVED GAME TO BE RE-LOADED **************** *******************************************************************************/ -#include <qfile.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqtextstream.h> class KGrLGDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase { Q_OBJECT public: - KGrLGDialog (QFile * savedGames, QPtrList<KGrCollection> & collections, - QWidget * parent, const char * name); - QString getCurrentText() {return (lgList->currentText());} + KGrLGDialog (TQFile * savedGames, TQPtrList<KGrCollection> & collections, + TQWidget * parent, const char * name); + TQString getCurrentText() {return (lgList->currentText());} private slots: void lgSelect (int n); private: - QListBox * lgList; + TQListBox * lgList; int lgHighlight; }; @@ -209,10 +209,10 @@ private: class KGrMessage : public QDialog { public: - static void information (QWidget * parent, const QString &caption, const QString &text); - static int warning (QWidget * parent, QString caption, QString text, - QString label0, QString label1, QString label2 = ""); - static void wrapped (QWidget * parent, QString caption, QString text); + static void information (TQWidget * parent, const TQString &caption, const TQString &text); + static int warning (TQWidget * parent, TQString caption, TQString text, + TQString label0, TQString label1, TQString label2 = ""); + static void wrapped (TQWidget * parent, TQString caption, TQString text); }; #endif diff --git a/kgoldrunner/src/kgrfigure.cpp b/kgoldrunner/src/kgrfigure.cpp index 08fc91d4..0dcb68af 100644 --- a/kgoldrunner/src/kgrfigure.cpp +++ b/kgoldrunner/src/kgrfigure.cpp @@ -31,8 +31,8 @@ KGrFigure :: KGrFigure (int px, int py) nuggets = 0; status = STANDING; - walkTimer = new QTimer (this); - fallTimer = new QTimer (this); + walkTimer = new TQTimer (this); + fallTimer = new TQTimer (this); } // Initialise the global settings flags. @@ -310,8 +310,8 @@ KGrHero :: KGrHero (KGrCanvas * view, int x, int y) walkFrozen = FALSE; fallFrozen = FALSE; - connect (walkTimer, SIGNAL (timeout ()), SLOT (walkTimeDone ())); - connect (fallTimer, SIGNAL (timeout ()), SLOT (fallTimeDone ())); + connect (walkTimer, TQT_SIGNAL (timeout ()), TQT_SLOT (walkTimeDone ())); + connect (fallTimer, TQT_SIGNAL (timeout ()), TQT_SLOT (fallTimeDone ())); } int KGrHero::WALKDELAY = 0; @@ -711,7 +711,7 @@ void KGrHero::digRight(){ } #ifdef QT3 -void KGrHero::setEnemyList(QPtrList<KGrEnemy> *e) +void KGrHero::setEnemyList(TQPtrList<KGrEnemy> *e) #else void KGrHero::setEnemyList(QList<KGrEnemy> *e) #endif @@ -816,10 +816,10 @@ KGrEnemy :: KGrEnemy (KGrCanvas * view, int x, int y) fallFrozen = FALSE; captiveFrozen = FALSE; - captiveTimer = new QTimer (this); - connect (captiveTimer,SIGNAL(timeout()),SLOT(captiveTimeDone())); - connect (walkTimer, SIGNAL (timeout ()), SLOT (walkTimeDone ())); - connect (fallTimer, SIGNAL (timeout ()), SLOT (fallTimeDone ())); + captiveTimer = new TQTimer (this); + connect (captiveTimer,TQT_SIGNAL(timeout()),TQT_SLOT(captiveTimeDone())); + connect (walkTimer, TQT_SIGNAL (timeout ()), TQT_SLOT (walkTimeDone ())); + connect (fallTimer, TQT_SIGNAL (timeout ()), TQT_SLOT (fallTimeDone ())); } int KGrEnemy::WALKDELAY = 0; @@ -1671,7 +1671,7 @@ bool KGrEnemy::willNotFall (int x, int y) } #ifdef QT3 -void KGrEnemy::setEnemyList(QPtrList<KGrEnemy> *e) +void KGrEnemy::setEnemyList(TQPtrList<KGrEnemy> *e) #else void KGrEnemy::setEnemyList(QList<KGrEnemy> *e) #endif diff --git a/kgoldrunner/src/kgrfigure.h b/kgoldrunner/src/kgrfigure.h index e6ee0f2e..12551418 100644 --- a/kgoldrunner/src/kgrfigure.h +++ b/kgoldrunner/src/kgrfigure.h @@ -17,16 +17,16 @@ // Obsolete - #include <iostream.h> #include <iostream> -#include <qimage.h> +#include <tqimage.h> #ifdef QT3 -#include <qptrlist.h> +#include <tqptrlist.h> #else -#include <qlist.h> +#include <tqlist.h> #endif -#include <qpainter.h> -#include <qpixmap.h> -#include <qtimer.h> -#include <qwidget.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqtimer.h> +#include <tqwidget.h> #include <stdlib.h> // für Zufallsfunktionen class KGrCanvas; @@ -76,8 +76,8 @@ protected: int walkCounter; int nuggets; int actualPixmap; // ArrayPos der zu zeichnenden Pixmap - QTimer *walkTimer; - QTimer *fallTimer; + TQTimer *walkTimer; + TQTimer *fallTimer; KGrObject *(*playfield)[30][22]; Status status; @@ -112,7 +112,7 @@ public: void digRight(); void startWalk(); #ifdef QT3 - void setEnemyList(QPtrList<KGrEnemy> *); + void setEnemyList(TQPtrList<KGrEnemy> *); #else void setEnemyList(QList<KGrEnemy> *); #endif @@ -129,7 +129,7 @@ public: private: #ifdef QT3 - QPtrList<KGrEnemy> *enemies; + TQPtrList<KGrEnemy> *enemies; #else QList<KGrEnemy> *enemies; #endif @@ -167,7 +167,7 @@ public: void showFigure(); void startSearching(); #ifdef QT3 - void setEnemyList(QPtrList<KGrEnemy> *); + void setEnemyList(TQPtrList<KGrEnemy> *); #else void setEnemyList(QList<KGrEnemy> *); #endif @@ -184,10 +184,10 @@ private: int birthX, birthY; int searchStatus; int captiveCounter; - QTimer *captiveTimer; + TQTimer *captiveTimer; bool canWalkUp(); #ifdef QT3 - QPtrList<KGrEnemy> *enemies; + TQPtrList<KGrEnemy> *enemies; #else QList<KGrEnemy> *enemies; #endif diff --git a/kgoldrunner/src/kgrgame.cpp b/kgoldrunner/src/kgrgame.cpp index 93164d88..985d0783 100644 --- a/kgoldrunner/src/kgrgame.cpp +++ b/kgoldrunner/src/kgrgame.cpp @@ -37,7 +37,7 @@ /*********************** KGOLDRUNNER GAME CLASS *************************/ /******************************************************************************/ -KGrGame::KGrGame (KGrCanvas * theView, QString theSystemDir, QString theUserDir) +KGrGame::KGrGame (KGrCanvas * theView, TQString theSystemDir, TQString theUserDir) { view = theView; systemDataDir = theSystemDir; @@ -63,17 +63,17 @@ KGrGame::KGrGame (KGrCanvas * theView, QString theSystemDir, QString theUserDir) modalFreeze = FALSE; messageFreeze = FALSE; - connect (hero, SIGNAL (gotNugget(int)), SLOT (incScore(int))); - connect (hero, SIGNAL (caughtHero()), SLOT (herosDead())); - connect (hero, SIGNAL (haveAllNuggets()), SLOT (showHiddenLadders())); - connect (hero, SIGNAL (leaveLevel()), SLOT (goUpOneLevel())); + connect (hero, TQT_SIGNAL (gotNugget(int)), TQT_SLOT (incScore(int))); + connect (hero, TQT_SIGNAL (caughtHero()), TQT_SLOT (herosDead())); + connect (hero, TQT_SIGNAL (haveAllNuggets()), TQT_SLOT (showHiddenLadders())); + connect (hero, TQT_SIGNAL (leaveLevel()), TQT_SLOT (goUpOneLevel())); - dyingTimer = new QTimer (this); - connect (dyingTimer, SIGNAL (timeout()), SLOT (finalBreath())); + dyingTimer = new TQTimer (this); + connect (dyingTimer, TQT_SIGNAL (timeout()), TQT_SLOT (finalBreath())); // Get the mouse position every 40 msec. It is used to steer the hero. - mouseSampler = new QTimer (this); - connect (mouseSampler, SIGNAL(timeout()), SLOT (readMousePos ())); + mouseSampler = new TQTimer (this); + connect (mouseSampler, TQT_SIGNAL(timeout()), TQT_SLOT (readMousePos ())); mouseSampler->start (40, FALSE); srand(1); // initialisiere Random-Generator @@ -142,7 +142,7 @@ void KGrGame::herosDead() // Game over: display the "ENDE" screen. emit showLives (lives); freeze(); - QString gameOver = "<NOBR><B>" + i18n("GAME OVER !!!") + "</B></NOBR>"; + TQString gameOver = "<NOBR><B>" + i18n("GAME OVER !!!") + "</B></NOBR>"; KGrMessage::information (view, collection->name, gameOver); checkHighScore(); // Check if there is a high score for this game. @@ -294,18 +294,18 @@ void KGrGame::setBlankLevel(bool playable) editObjArray[i+1][j+1] = FREE; } for (int j=0;j<30;j++) { - //playfield[j][0]=new KGrBeton(QPixmap ()); + //playfield[j][0]=new KGrBeton(TQPixmap ()); playfield[j][0]=new KGrObject (BETON); editObjArray[j][0] = BETON; - //playfield[j][21]=new KGrBeton(QPixmap ()); + //playfield[j][21]=new KGrBeton(TQPixmap ()); playfield[j][21]=new KGrObject (BETON); editObjArray[j][21] = BETON; } for (int i=0;i<22;i++) { - //playfield[0][i]=new KGrBeton(QPixmap ()); + //playfield[0][i]=new KGrBeton(TQPixmap ()); playfield[0][i]=new KGrObject (BETON); editObjArray[0][i] = BETON; - //playfield[29][i]=new KGrBeton(QPixmap ()); + //playfield[29][i]=new KGrBeton(TQPixmap ()); playfield[29][i]=new KGrObject (BETON); editObjArray[29][i] = BETON; } @@ -391,7 +391,7 @@ void KGrGame::startTutorial() void KGrGame::showHint() { // Put out a hint for this level. - QString caption = i18n("Hint"); + TQString caption = i18n("Hint"); if (levelHint.length() > 0) myMessage (view, caption, levelHint); @@ -403,7 +403,7 @@ void KGrGame::showHint() int KGrGame::loadLevel (int levelNo) { int i,j; - QFile openlevel; + TQFile openlevel; if (! openLevelFile (levelNo, openlevel)) { return 0; @@ -426,8 +426,8 @@ int KGrGame::loadLevel (int levelNo) int c = openlevel.getch(); levelName = ""; levelHint = ""; - QCString levelNameC = ""; - QCString levelHintC = ""; + TQCString levelNameC = ""; + TQCString levelHintC = ""; i = 1; while ((c = openlevel.getch()) != EOF) { switch (i) { @@ -456,8 +456,8 @@ int KGrGame::loadLevel (int levelNo) levelHint = i18n((const char *) levelHintC.left(len-1)); // Disconnect edit-mode slots from signals from "view". - disconnect (view, SIGNAL (mouseClick(int)), 0, 0); - disconnect (view, SIGNAL (mouseLetGo(int)), 0, 0); + disconnect (view, TQT_SIGNAL (mouseClick(int)), 0, 0); + disconnect (view, TQT_SIGNAL (mouseLetGo(int)), 0, 0); if (newLevel) { hero->setEnemyList (&enemies); @@ -491,7 +491,7 @@ int KGrGame::loadLevel (int levelNo) view->setMousePos (startI, startJ); // Connect play-mode slot to signal from "view". - connect (view, SIGNAL(mouseClick(int)), SLOT(doDig(int))); + connect (view, TQT_SIGNAL(mouseClick(int)), TQT_SLOT(doDig(int))); // Re-enable player input. loading = FALSE; @@ -499,10 +499,10 @@ int KGrGame::loadLevel (int levelNo) return 1; } -bool KGrGame::openLevelFile (int levelNo, QFile & openlevel) +bool KGrGame::openLevelFile (int levelNo, TQFile & openlevel) { - QString filePath; - QString msg; + TQString filePath; + TQString msg; filePath = getFilePath (owner, collection, levelNo); @@ -554,9 +554,9 @@ void KGrGame::changeObject (unsigned char kind, int i, int j) enemy->setPlayfield(&playfield); enemy->enemyId = enemyCount++; enemies.append(enemy); - connect(enemy, SIGNAL(lostNugget()), SLOT(loseNugget())); - connect(enemy, SIGNAL(trapped(int)), SLOT(incScore(int))); - connect(enemy, SIGNAL(killed(int)), SLOT(incScore(int))); + connect(enemy, TQT_SIGNAL(lostNugget()), TQT_SLOT(loseNugget())); + connect(enemy, TQT_SIGNAL(trapped(int)), TQT_SLOT(incScore(int))); + connect(enemy, TQT_SIGNAL(killed(int)), TQT_SLOT(incScore(int))); } else { // Starting a level again after losing. enemy=enemies.at(enemyCount); @@ -650,9 +650,9 @@ void KGrGame::startPlaying () { } } -QString KGrGame::getFilePath (Owner o, KGrCollection * colln, int lev) +TQString KGrGame::getFilePath (Owner o, KGrCollection * colln, int lev) { - QString filePath; + TQString filePath; if (lev == 0) { // End of game: show the "ENDE" screen. @@ -660,7 +660,7 @@ QString KGrGame::getFilePath (Owner o, KGrCollection * colln, int lev) filePath = "level000.grl"; } else { - filePath.setNum (lev); // Convert INT -> QString. + filePath.setNum (lev); // Convert INT -> TQString. filePath = filePath.rightJustify (3,'0'); // Add 0-2 zeros at left. filePath.append (".grl"); // Add KGoldrunner level-suffix. filePath.prepend (colln->prefix); // Add collection file-prefix. @@ -671,9 +671,9 @@ QString KGrGame::getFilePath (Owner o, KGrCollection * colln, int lev) return (filePath); } -QString KGrGame::getTitle() +TQString KGrGame::getTitle() { - QString levelTitle; + TQString levelTitle; if (level == 0) { // Generate a special title: end of game or creating a new level. if (! editMode) @@ -695,7 +695,7 @@ QString KGrGame::getTitle() void KGrGame::readMousePos() { - QPoint p; + TQPoint p; int i, j; // If loading a level for play or editing, ignore mouse-position input. @@ -778,10 +778,10 @@ void KGrGame::saveGame() // Save game ID, score and level. "level, not as they are now.")); } - QDate today = QDate::currentDate(); - QTime now = QTime::currentTime(); - QString saved; - QString day; + TQDate today = TQDate::currentDate(); + TQTime now = TQTime::currentTime(); + TQString saved; + TQString day; #ifdef QT3 day = today.shortDayName(today.dayOfWeek()); #else @@ -794,8 +794,8 @@ void KGrGame::saveGame() // Save game ID, score and level. today.year(), today.month(), today.day(), now.hour(), now.minute()); - QFile file1 (userDataDir + "savegame.dat"); - QFile file2 (userDataDir + "savegame.tmp"); + TQFile file1 (userDataDir + "savegame.dat"); + TQFile file2 (userDataDir + "savegame.tmp"); if (! file2.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Game"), @@ -803,7 +803,7 @@ void KGrGame::saveGame() // Save game ID, score and level. .arg(userDataDir + "savegame.tmp")); return; } - QTextStream text2 (&file2); + TQTextStream text2 (&file2); text2 << saved; if (file1.exists()) { @@ -814,7 +814,7 @@ void KGrGame::saveGame() // Save game ID, score and level. return; } - QTextStream text1 (&file1); + TQTextStream text1 (&file1); int n = 30; // Limit the file to the last 30 saves. while ((! text1.endData()) && (--n > 0)) { saved = text1.readLine() + "\n"; @@ -825,7 +825,7 @@ void KGrGame::saveGame() // Save game ID, score and level. file2.close(); - QDir dir; + TQDir dir; dir.rename (file2.name(), file1.name(), TRUE); KGrMessage::information (view, i18n("Save Game"), i18n("Your game has been saved.")); @@ -837,7 +837,7 @@ void KGrGame::loadGame() // Re-load game, score and level. return; } - QFile savedGames (userDataDir + "savegame.dat"); + TQFile savedGames (userDataDir + "savegame.dat"); if (! savedGames.exists()) { // Use myMessage() because it stops the game while the message appears. myMessage (view, i18n("Load Game"), @@ -859,17 +859,17 @@ void KGrGame::loadGame() // Re-load game, score and level. freeze(); } - QString s; + TQString s; KGrLGDialog * lg = new KGrLGDialog (&savedGames, collections, view, "loadDialog"); - if (lg->exec() == QDialog::Accepted) { + if (lg->exec() == TQDialog::Accepted) { s = lg->getCurrentText(); } bool found = FALSE; - QString pr; + TQString pr; int lev; int i; int imax = collections.count(); @@ -932,8 +932,8 @@ void KGrGame::checkHighScore() return; // Look for user's high-score file or for a released high-score file. - QFile high1 (userDataDir + "hi_" + collection->prefix + ".dat"); - QDataStream s1; + TQFile high1 (userDataDir + "hi_" + collection->prefix + ".dat"); + TQDataStream s1; if (! high1.exists()) { high1.setName (systemDataDir + "hi_" + collection->prefix + ".dat"); @@ -945,7 +945,7 @@ void KGrGame::checkHighScore() // If a previous high score file exists, check the current score against it. if (prevHigh) { if (! high1.open (IO_ReadOnly)) { - QString high1_name = high1.name(); + TQString high1_name = high1.name(); KGrMessage::information (view, i18n("Check for High Score"), i18n("Cannot open file '%1' for read-only.").arg(high1_name)); return; @@ -981,8 +981,8 @@ void KGrGame::checkHighScore() /* If we have come this far, we have a new high score to record. */ /* ************************************************************* */ - QFile high2 (userDataDir + "hi_" + collection->prefix + ".tmp"); - QDataStream s2; + TQFile high2 (userDataDir + "hi_" + collection->prefix + ".tmp"); + TQDataStream s2; if (! high2.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Check for High Score"), @@ -992,21 +992,21 @@ void KGrGame::checkHighScore() } // Dialog to ask the user to enter their name. - QDialog * hsn = new QDialog (view, "hsNameDialog", TRUE, + TQDialog * hsn = new TQDialog (view, "hsNameDialog", TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; int spacing = 10; - QVBoxLayout * mainLayout = new QVBoxLayout (hsn, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (hsn, margin, spacing); - QLabel * hsnMessage = new QLabel ( + TQLabel * hsnMessage = new TQLabel ( i18n("<b>Congratulations !!!</b> " "You have achieved a high " "score in this game. Please enter your name so that " "it may be enshrined in the KGoldrunner Hall of Fame."), hsn); - QLineEdit * hsnUser = new QLineEdit (hsn); - QPushButton * OK = new KPushButton (KStdGuiItem::ok(), hsn); + TQLineEdit * hsnUser = new TQLineEdit (hsn); + TQPushButton * OK = new KPushButton (KStdGuiItem::ok(), hsn); mainLayout-> addWidget (hsnMessage); mainLayout-> addWidget (hsnUser); @@ -1014,14 +1014,14 @@ void KGrGame::checkHighScore() hsn-> setCaption (i18n("Save High Score")); - QPoint p = view->mapToGlobal (QPoint (0,0)); + QPoint p = view->mapToGlobal (TQPoint (0,0)); hsn-> move (p.x() + 50, p.y() + 50); OK-> setAccel (Key_Return); hsnUser-> setFocus(); // Set the keyboard input on. - connect (hsnUser, SIGNAL (returnPressed ()), hsn, SLOT (accept ())); - connect (OK, SIGNAL (clicked ()), hsn, SLOT (accept ())); + connect (hsnUser, TQT_SIGNAL (returnPressed ()), hsn, TQT_SLOT (accept ())); + connect (OK, TQT_SIGNAL (clicked ()), hsn, TQT_SLOT (accept ())); while (TRUE) { hsn->exec(); @@ -1034,12 +1034,12 @@ void KGrGame::checkHighScore() delete hsn; - QDate today = QDate::currentDate(); - QString hsDate; + TQDate today = TQDate::currentDate(); + TQString hsDate; #ifdef QT3 - QString day = today.shortDayName(today.dayOfWeek()); + TQString day = today.shortDayName(today.dayOfWeek()); #else - QString day = today.dayName(today.dayOfWeek()); + TQString day = today.dayName(today.dayOfWeek()); #endif hsDate = hsDate.sprintf ("%s %04d-%02d-%02d", @@ -1100,7 +1100,7 @@ void KGrGame::checkHighScore() high2.close(); - QDir dir; + TQDir dir; dir.rename (high2.name(), userDataDir + "hi_" + collection->prefix + ".dat", TRUE); KGrMessage::information (view, i18n("Save High Score"), @@ -1124,8 +1124,8 @@ void KGrGame::showHighScores() int n = 0; // Look for user's high-score file or for a released high-score file. - QFile high1 (userDataDir + "hi_" + collection->prefix + ".dat"); - QDataStream s1; + TQFile high1 (userDataDir + "hi_" + collection->prefix + ".dat"); + TQDataStream s1; if (! high1.exists()) { high1.setName (systemDataDir + "hi_" + collection->prefix + ".dat"); @@ -1138,25 +1138,25 @@ void KGrGame::showHighScores() } if (! high1.open (IO_ReadOnly)) { - QString high1_name = high1.name(); + TQString high1_name = high1.name(); KGrMessage::information (view, i18n("Show High Scores"), i18n("Cannot open file '%1' for read-only.").arg(high1_name)); return; } - QDialog * hs = new QDialog (view, "hsDialog", TRUE, + TQDialog * hs = new TQDialog (view, "hsDialog", TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; int spacing = 10; - QVBoxLayout * mainLayout = new QVBoxLayout (hs, margin, spacing); + TQVBoxLayout * mainLayout = new TQVBoxLayout (hs, margin, spacing); - QLabel * hsHeader = new QLabel (i18n ( + TQLabel * hsHeader = new TQLabel (i18n ( "<center><h2>KGoldrunner Hall of Fame</h2></center><br>" "<center><h3>\"%1\" Game</h3></center>") .arg(collection->name), hs); - QLabel * hsColHeader = new QLabel ( + TQLabel * hsColHeader = new TQLabel ( i18n(" Name " "Level Score Date"), hs); #ifdef KGR_PORTABLE @@ -1168,11 +1168,11 @@ void KGrGame::showHighScores() f. setBold (TRUE); hsColHeader-> setFont (f); - QLabel * hsLine [10]; + TQLabel * hsLine [10]; - QHBox * buttons = new QHBox (hs); + TQHBox * buttons = new TQHBox (hs); buttons-> setSpacing (spacing); - QPushButton * OK = new KPushButton (KStdGuiItem::close(), buttons); + TQPushButton * OK = new KPushButton (KStdGuiItem::close(), buttons); mainLayout-> addWidget (hsHeader); mainLayout-> addWidget (hsColHeader); @@ -1197,13 +1197,13 @@ void KGrGame::showHighScores() s1 >> prevScore; s1 >> prevDate; - // QString::sprintf expects UTF-8 encoding in its string arguments, so + // TQString::sprintf expects UTF-8 encoding in its string arguments, so // prevUser has been saved on file as UTF-8 to allow non=ASCII chars // in the user's name (e.g. "Krüger" is encoded as "Krüger" in UTF-8). line = line.sprintf (hsFormat, n+1, prevUser, prevLevel, prevScore, prevDate); - hsLine [n] = new QLabel (line, hs); + hsLine [n] = new TQLabel (line, hs); hsLine [n]->setFont (f); mainLayout->addWidget (hsLine [n]); @@ -1212,18 +1212,18 @@ void KGrGame::showHighScores() n++; } - QFrame * separator = new QFrame (hs); - separator->setFrameStyle (QFrame::HLine + QFrame::Sunken); + TQFrame * separator = new TQFrame (hs); + separator->setFrameStyle (TQFrame::HLine + TQFrame::Sunken); mainLayout->addWidget (separator); OK-> setMaximumWidth (100); mainLayout-> addWidget (buttons); - QPoint p = view->mapToGlobal (QPoint (0,0)); + QPoint p = view->mapToGlobal (TQPoint (0,0)); hs-> move (p.x() + 50, p.y() + 50); // Start up the dialog box. - connect (OK, SIGNAL (clicked ()), hs, SLOT (accept ())); + connect (OK, TQT_SIGNAL (clicked ()), hs, TQT_SLOT (accept ())); hs-> exec(); delete hs; @@ -1302,7 +1302,7 @@ void KGrGame::showEnemyState(int enemyId) void KGrGame::showObjectState() { - QPoint p; + TQPoint p; int i, j; KGrObject * myObject; @@ -1439,7 +1439,7 @@ void KGrGame::updateNext() void KGrGame::loadEditLevel (int lev) { int i, j; - QFile levelFile; + TQFile levelFile; if (! openLevelFile (lev, levelFile)) return; @@ -1461,8 +1461,8 @@ void KGrGame::loadEditLevel (int lev) // Read a newline character, then read in the level name and hint (if any). int c = levelFile.getch(); - QCString levelHintC = ""; - QCString levelNameC = ""; + TQCString levelHintC = ""; + TQCString levelNameC = ""; levelHint = ""; levelName = ""; i = 1; @@ -1484,11 +1484,11 @@ void KGrGame::loadEditLevel (int lev) // to Unicode (eg. ü to ü). int len = levelHintC.length(); if (len > 0) - levelHint = QString::fromUtf8((const char *) levelHintC.left(len-1)); + levelHint = TQString::fromUtf8((const char *) levelHintC.left(len-1)); len = levelNameC.length(); if (len > 0) - levelName = QString::fromUtf8((const char *) levelNameC); + levelName = TQString::fromUtf8((const char *) levelNameC); editObj = BRICK; // Reset default object. levelFile.close (); @@ -1509,7 +1509,7 @@ void KGrGame::editNameAndHint() // Run a dialog box to create/edit the level name and hint. KGrNHDialog * nh = new KGrNHDialog (levelName, levelHint, view, "NHDialog"); - if (nh->exec() == QDialog::Accepted) { + if (nh->exec() == TQDialog::Accepted) { levelName = nh->getName(); levelHint = nh->getHint(); shouldSave = TRUE; @@ -1525,7 +1525,7 @@ bool KGrGame::saveLevelFile() int selectedLevel = level; int i, j; - QString filePath; + TQString filePath; if (! editMode) { KGrMessage::information (view, i18n("Save Level"), @@ -1555,7 +1555,7 @@ bool KGrGame::saveLevelFile() // Set the name of the output file. filePath = getFilePath (owner, collection, selectedLevel); - QFile levelFile (filePath); + TQFile levelFile (filePath); if ((action == SL_SAVE) && (n == N) && (selectedLevel == level)) { // This is a normal edit: the old file is to be re-written. @@ -1597,7 +1597,7 @@ bool KGrGame::saveLevelFile() levelFile.putch ('\n'); // Save the level name, changing non-ASCII chars to UTF-8 (eg. ü to ü). - QCString levelNameC = levelName.utf8(); + TQCString levelNameC = levelName.utf8(); int len1 = levelNameC.length(); if (len1 > 0) { for (i = 0; i < len1; i++) @@ -1606,7 +1606,7 @@ bool KGrGame::saveLevelFile() } // Save the level hint, changing non-ASCII chars to UTF-8 (eg. ü to ü). - QCString levelHintC = levelHint.utf8(); + TQCString levelHintC = levelHint.utf8(); int len2 = levelHintC.length(); char ch = '\0'; @@ -1682,9 +1682,9 @@ void KGrGame::moveLevelFile () } } - QDir dir; - QString filePath1; - QString filePath2; + TQDir dir; + TQString filePath1; + TQString filePath2; // Save the "fromN" file under a temporary name. filePath1 = getFilePath (USER, collections.at(fromC), fromL); @@ -1752,12 +1752,12 @@ void KGrGame::deleteLevelFile () if (lev == 0) return; - QString filePath; + TQString filePath; // Set the name of the file to be deleted. int n = collnIndex; filePath = getFilePath (USER, collections.at(n), lev); - QFile levelFile (filePath); + TQFile levelFile (filePath); // Delete the file for the selected collection and level. if (levelFile.exists()) { @@ -1828,10 +1828,10 @@ void KGrGame::editCollection (int action) KGrECDialog * ec = new KGrECDialog (action, n, collections, view, "editGameDialog"); - while (ec->exec() == QDialog::Accepted) { // Loop until valid. + while (ec->exec() == TQDialog::Accepted) { // Loop until valid. // Validate the collection details. - QString ecName = ec->getName(); + TQString ecName = ec->getName(); int len = ecName.length(); if (len == 0) { KGrMessage::information (view, i18n("Save Game Info"), @@ -1839,7 +1839,7 @@ void KGrGame::editCollection (int action) continue; } - QString ecPrefix = ec->getPrefix(); + TQString ecPrefix = ec->getPrefix(); if ((action == SL_CR_GAME) || (collections.at(n)->nLevels <= 0)) { // The filename prefix could have been entered, so validate it. len = ecPrefix.length(); @@ -2030,19 +2030,19 @@ void KGrGame::setEditableCell (int i, int j, char type) void KGrGame::showEditLevel() { // Disconnect play-mode slots from signals from "view". - disconnect (view, SIGNAL(mouseClick(int)), 0, 0); - disconnect (view, SIGNAL(mouseLetGo(int)), 0, 0); + disconnect (view, TQT_SIGNAL(mouseClick(int)), 0, 0); + disconnect (view, TQT_SIGNAL(mouseLetGo(int)), 0, 0); // Connect edit-mode slots to signals from "view". - connect (view, SIGNAL(mouseClick(int)), SLOT(doEdit(int))); - connect (view, SIGNAL(mouseLetGo(int)), SLOT(endEdit(int))); + connect (view, TQT_SIGNAL(mouseClick(int)), TQT_SLOT(doEdit(int))); + connect (view, TQT_SIGNAL(mouseLetGo(int)), TQT_SLOT(endEdit(int))); } bool KGrGame::reNumberLevels (int cIndex, int first, int last, int inc) { int i, n, step; - QDir dir; - QString file1, file2; + TQDir dir; + TQString file1, file2; if (inc > 0) { i = last; @@ -2083,7 +2083,7 @@ void KGrGame::setLevel (int lev) void KGrGame::doEdit (int button) { // Mouse button down: start making changes. - QPoint p; + TQPoint p; int i, j; p = view->getMousePos (); @@ -2106,7 +2106,7 @@ void KGrGame::doEdit (int button) void KGrGame::endEdit (int button) { // Mouse button released: finish making changes. - QPoint p; + TQPoint p; int i, j; p = view->getMousePos (); @@ -2144,7 +2144,7 @@ int KGrGame::selectLevel (int action, int requestedLevel) // Create and run a modal dialog box to select a game and level. KGrSLDialog * sl = new KGrSLDialog (action, requestedLevel, collnIndex, collections, this, view, "levelDialog"); - while (sl->exec() == QDialog::Accepted) { + while (sl->exec() == TQDialog::Accepted) { selectedGame = sl->selectedGame(); selectedLevel = 0; // In case the selection is invalid. if (collections.at(selectedGame)->owner == SYSTEM) { @@ -2226,26 +2226,26 @@ bool KGrGame::ownerOK (Owner o) /********************** CLASS TO DISPLAY THUMBNAIL ***********************/ /******************************************************************************/ -KGrThumbNail::KGrThumbNail (QWidget * parent, const char * name) - : QFrame (parent, name) +KGrThumbNail::KGrThumbNail (TQWidget * parent, const char * name) + : TQFrame (parent, name) { // Let the parent do all the work. We need a class here so that - // QFrame::drawContents (QPainter *) can be re-implemented and + // TQFrame::drawContents (TQPainter *) can be re-implemented and // the thumbnail can be automatically re-painted when required. } -QColor KGrThumbNail::backgroundColor = QColor ("#dddddd"); -QColor KGrThumbNail::brickColor = QColor ("#ff0000"); -QColor KGrThumbNail::ladderColor = QColor ("#ddcc00"); -QColor KGrThumbNail::poleColor = QColor ("#aa7700"); +TQColor KGrThumbNail::backgroundColor = TQColor ("#dddddd"); +TQColor KGrThumbNail::brickColor = TQColor ("#ff0000"); +TQColor KGrThumbNail::ladderColor = TQColor ("#ddcc00"); +TQColor KGrThumbNail::poleColor = TQColor ("#aa7700"); -void KGrThumbNail::setFilePath (QString & fp, QLabel * sln) +void KGrThumbNail::setFilePath (TQString & fp, TQLabel * sln) { filePath = fp; // Keep safe copies of file lName = sln; // path and level name field. } -void KGrThumbNail::drawContents (QPainter * p) // Activated via "paintEvent". +void KGrThumbNail::drawContents (TQPainter * p) // Activated via "paintEvent". { QFile openFile; QPen pen = p->pen(); @@ -2259,7 +2259,7 @@ void KGrThumbNail::drawContents (QPainter * p) // Activated via "paintEvent". openFile.setName (filePath); if ((! openFile.exists()) || (! openFile.open (IO_ReadOnly))) { // There is no file, so fill the thumbnail with "FREE" cells. - p->drawRect (QRect(fw, fw, FIELDWIDTH*n, FIELDHEIGHT*n)); + p->drawRect (TQRect(fw, fw, FIELDWIDTH*n, FIELDHEIGHT*n)); return; } @@ -2301,7 +2301,7 @@ void KGrThumbNail::drawContents (QPainter * p) // Activated via "paintEvent". // For a nugget, add just a vertical touch of yellow (2-3 pixels). if (obj == NUGGET) { int k = (n/2)+fw; - // pen.setColor (QColor("#ffff00")); + // pen.setColor (TQColor("#ffff00")); pen.setColor (ladderColor); p->setPen (pen); p->drawLine (i*n+k, j*n+k, i*n+k, j*n+(n-1)+fw); @@ -2311,7 +2311,7 @@ void KGrThumbNail::drawContents (QPainter * p) // Activated via "paintEvent". // Absorb a newline character, then read in the level name (if any). int c = openFile.getch(); - QCString s = ""; + TQCString s = ""; while ((c = openFile.getch()) != EOF) { if (c == '\n') // Level name is on one line. break; @@ -2330,7 +2330,7 @@ void KGrThumbNail::drawContents (QPainter * p) // Activated via "paintEvent". /******************************************************************************/ // NOTE: Macros "myStr" and "myChar", defined in "kgrgame.h", are used -// to smooth out differences between Qt 1 and Qt2 QString classes. +// to smooth out differences between Qt 1 and Qt2 TQString classes. bool KGrGame::initCollections () { @@ -2381,9 +2381,9 @@ void KGrGame::mapCollections() } const QFileInfoList * files = d.entryInfoList - (colln->prefix + "???.grl", QDir::Files, QDir::Name); + (colln->prefix + "???.grl", TQDir::Files, TQDir::Name); QFileInfoListIterator i (* files); - QFileInfo * file; + TQFileInfo * file; if ((files->count() <= 0) && (colln->nLevels > 0)) { KGrMessage::information (view, i18n("Check Games & Levels"), @@ -2403,7 +2403,7 @@ void KGrGame::mapCollections() while (TRUE) { // Work out what the file name should be, based on the level no. - fileName2.setNum (lev); // Convert to QString. + fileName2.setNum (lev); // Convert to TQString. fileName2 = fileName2.rightJustify (3,'0'); // Add zeros. fileName2.append (".grl"); // Add level-suffix. fileName2.prepend (colln->prefix); // Add colln. prefix. @@ -2450,7 +2450,7 @@ bool KGrGame::loadCollections (Owner o) filePath = ((o == SYSTEM)? systemDataDir : userDataDir) + "games.dat"; - QFile c (filePath); + TQFile c (filePath); if (! c.exists()) { // If the user has not yet created a collection, don't worry. @@ -2506,7 +2506,7 @@ bool KGrGame::loadCollections (Owner o) collections.append (new KGrCollection (o, i18n((const char *) name), // Translate now. prefix, settings, nLevels, - QString::fromUtf8((const char *) line))); + TQString::fromUtf8((const char *) line))); name = ""; prefix = ""; settings = ' '; nLevels = -1; } else if (ch >= 0) { @@ -2537,7 +2537,7 @@ bool KGrGame::saveCollections (Owner o) filePath = ((o == SYSTEM)? systemDataDir : userDataDir) + "games.dat"; - QFile c (filePath); + TQFile c (filePath); // Open the output file. if (! c.open (IO_WriteOnly)) { @@ -2563,7 +2563,7 @@ bool KGrGame::saveCollections (Owner o) len = colln->about.length(); if (len > 0) { - QCString aboutC = colln->about.utf8(); + TQCString aboutC = colln->about.utf8(); len = aboutC.length(); // Might be longer now. for (i = 0; i < len; i++) { ch = aboutC[i]; @@ -2588,7 +2588,7 @@ bool KGrGame::saveCollections (Owner o) /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ -void KGrGame::myMessage (QWidget * parent, QString title, QString contents) +void KGrGame::myMessage (TQWidget * parent, TQString title, TQString contents) { // Halt the game while the message is displayed. setMessageFreeze (TRUE); @@ -2603,8 +2603,8 @@ void KGrGame::myMessage (QWidget * parent, QString title, QString contents) /*********************** COLLECTION DATA CLASS **************************/ /******************************************************************************/ -KGrCollection::KGrCollection (Owner o, const QString & n, const QString & p, - const char s, int nl, const QString & a) +KGrCollection::KGrCollection (Owner o, const TQString & n, const TQString & p, + const char s, int nl, const TQString & a) { // Holds information about a collection of KGoldrunner levels (i.e. a game). owner = o; name = n; prefix = p; settings = s; nLevels = nl; about = a; diff --git a/kgoldrunner/src/kgrgame.h b/kgoldrunner/src/kgrgame.h index 86144ef6..18003e3c 100644 --- a/kgoldrunner/src/kgrgame.h +++ b/kgoldrunner/src/kgrgame.h @@ -12,29 +12,29 @@ // Macros to smooth out the differences between Qt 1 and Qt 2 classes. // -// "myStr" converts a QString object to a C language "char*" character string. -// "myChar" extracts a C language character (type "char") from a QString object. +// "myStr" converts a TQString object to a C language "char*" character string. +// "myChar" extracts a C language character (type "char") from a TQString object. // "endData" checks for an end-of-file condition. // #define myStr latin1 #define myChar(i) at((i)).latin1() #define endData atEnd -#include <qobject.h> +#include <tqobject.h> #ifdef QT3 -#include <qptrlist.h> +#include <tqptrlist.h> #else -#include <qlist.h> +#include <tqlist.h> #endif -#include <qstring.h> +#include <tqstring.h> -#include <qdir.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qdatastream.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqdatastream.h> -#include <qcolor.h> +#include <tqcolor.h> /** Sets up games and levels in KGoldrunner and controls the play. @@ -51,7 +51,7 @@ class KGrGame : public QObject { Q_OBJECT public: - KGrGame (KGrCanvas * theView, QString theSystemDir, QString theUserDir); + KGrGame (KGrCanvas * theView, TQString theSystemDir, TQString theUserDir); ~KGrGame(); bool initCollections(); @@ -71,7 +71,7 @@ public: void setEditObj (char newEditObj); // Set object for editor to paint. - QString getFilePath (Owner o, KGrCollection * colln, int lev); + TQString getFilePath (Owner o, KGrCollection * colln, int lev); public slots: void startLevelOne(); // Start any game from level 1. @@ -117,7 +117,7 @@ private slots: private: void setBlankLevel (bool playable); int loadLevel (int levelNo); - bool openLevelFile (int levelNo, QFile & openlevel); + bool openLevelFile (int levelNo, TQFile & openlevel); void changeObject (unsigned char kind, int i, int j); void createObject (KGrObject *o, char picType, int x, int y); void setTimings (); @@ -155,7 +155,7 @@ private: int startI, startJ; // The hero's starting position. #ifdef QT3 - QPtrList<KGrEnemy> enemies; // The list of enemies. + TQPtrList<KGrEnemy> enemies; // The list of enemies. #else QList<KGrEnemy> enemies; // The list of enemies. #endif @@ -170,8 +170,8 @@ private: bool modalFreeze; // Stop game during dialog. bool messageFreeze; // Stop game during message. - QTimer * mouseSampler; // Timer for mouse tracking. - QTimer * dyingTimer; // For pause when the hero dies. + TQTimer * mouseSampler; // Timer for mouse tracking. + TQTimer * dyingTimer; // For pause when the hero dies. int lgHighlight; // Row selected in "loadGame()". @@ -230,10 +230,10 @@ private: bool ownerOK (Owner o); // Pixmaps for repainting objects as they are edited. - QPixmap digpix[10]; - QPixmap brickbg, fbrickbg; - QPixmap freebg, nuggetbg, polebg, betonbg, ladderbg, hladderbg; - QPixmap edherobg, edenemybg; + TQPixmap digpix[10]; + TQPixmap brickbg, fbrickbg; + TQPixmap freebg, nuggetbg, polebg, betonbg, ladderbg, hladderbg; + TQPixmap edherobg, edenemybg; private slots: void doEdit(int); // For mouse-click when in edit-mode. @@ -247,7 +247,7 @@ private: // Note that a collection of KGoldrunner levels is the same thing as a "game". #ifdef QT3 - QPtrList<KGrCollection> collections; // List of ALL collections. + TQPtrList<KGrCollection> collections; // List of ALL collections. #else QList<KGrCollection> collections; // List of ALL collections. #endif @@ -264,7 +264,7 @@ private: /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ - void myMessage (QWidget * parent, QString title, QString contents); + void myMessage (TQWidget * parent, TQString title, TQString contents); }; /******************************************************************************/ @@ -274,18 +274,18 @@ private: class KGrThumbNail : public QFrame { public: - KGrThumbNail (QWidget *parent = 0, const char *name = 0); - void setFilePath (QString &, QLabel *); // Set filepath and name field. + KGrThumbNail (TQWidget *parent = 0, const char *name = 0); + void setFilePath (TQString &, TQLabel *); // Set filepath and name field. - static QColor backgroundColor; - static QColor brickColor; - static QColor ladderColor; - static QColor poleColor; + static TQColor backgroundColor; + static TQColor brickColor; + static TQColor ladderColor; + static TQColor poleColor; protected: - void drawContents (QPainter *); // Draw a preview of a level. - QString filePath; - QLabel * lName; + void drawContents (TQPainter *); // Draw a preview of a level. + TQString filePath; + TQLabel * lName; }; /******************************************************************************/ @@ -296,8 +296,8 @@ protected: class KGrCollection { public: - KGrCollection (Owner o, const QString & n, const QString & p, - const char s, int nl, const QString & a); + KGrCollection (Owner o, const TQString & n, const TQString & p, + const char s, int nl, const TQString & a); Owner owner; // Collection owner: "System" or "User". QString name; // Collection name. QString prefix; // Collection's filename prefix. diff --git a/kgoldrunner/src/kgrobject.cpp b/kgoldrunner/src/kgrobject.cpp index 948fd540..277dbc6a 100644 --- a/kgoldrunner/src/kgrobject.cpp +++ b/kgoldrunner/src/kgrobject.cpp @@ -105,8 +105,8 @@ KGrBrick::KGrBrick (char objType, int i, int j, KGrCanvas * view) dig_counter = 0; holeFrozen = FALSE; iamA = BRICK; - timer = new QTimer (this); - connect (timer, SIGNAL (timeout ()), SLOT (timeDone ())); + timer = new TQTimer (this); + connect (timer, TQT_SIGNAL (timeout ()), TQT_SLOT (timeDone ())); } void KGrBrick::dig (void) diff --git a/kgoldrunner/src/kgrobject.h b/kgoldrunner/src/kgrobject.h index a48eba88..cc262d0d 100644 --- a/kgoldrunner/src/kgrobject.h +++ b/kgoldrunner/src/kgrobject.h @@ -21,7 +21,7 @@ // Obsolete - #include <iostream.h> #include <iostream> -#include <qtimer.h> +#include <tqtimer.h> #include <stdlib.h> // for random class KGrCanvas; @@ -91,7 +91,7 @@ private: int dig_counter; int hole_counter; bool holeFrozen; - QTimer *timer; + TQTimer *timer; }; class KGrHladder : public KGrFree |