diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
commit | 838baf3f99ec5ab81b063eb5449a3381d860f377 (patch) | |
tree | dd31abcfde08ca92e4623b8f50b3d762a87c997a /kgoldrunner | |
parent | 2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff) | |
download | tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.tar.gz tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.zip |
TQt4 port kdegames
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kgoldrunner')
-rw-r--r-- | kgoldrunner/Doxyfile | 2 | ||||
-rw-r--r-- | kgoldrunner/gamedata/levels.tar | bin | 317440 -> 317446 bytes | |||
-rw-r--r-- | kgoldrunner/src/kgoldrunner.cpp | 112 | ||||
-rw-r--r-- | kgoldrunner/src/kgoldrunner.h | 7 | ||||
-rw-r--r-- | kgoldrunner/src/kgrcanvas.cpp | 26 | ||||
-rw-r--r-- | kgoldrunner/src/kgrcanvas.h | 7 | ||||
-rw-r--r-- | kgoldrunner/src/kgrconsts.h | 2 | ||||
-rw-r--r-- | kgoldrunner/src/kgrdialog.cpp | 138 | ||||
-rw-r--r-- | kgoldrunner/src/kgrdialog.h | 46 | ||||
-rw-r--r-- | kgoldrunner/src/kgrfigure.cpp | 18 | ||||
-rw-r--r-- | kgoldrunner/src/kgrfigure.h | 19 | ||||
-rw-r--r-- | kgoldrunner/src/kgrgame.cpp | 200 | ||||
-rw-r--r-- | kgoldrunner/src/kgrgame.h | 37 | ||||
-rw-r--r-- | kgoldrunner/src/kgrobject.h | 7 |
14 files changed, 318 insertions, 303 deletions
diff --git a/kgoldrunner/Doxyfile b/kgoldrunner/Doxyfile index e76fadd7..25996b5a 100644 --- a/kgoldrunner/Doxyfile +++ b/kgoldrunner/Doxyfile @@ -82,7 +82,7 @@ FILE_PATTERNS = *.c \ *.tlh \ *.diff \ *.patch \ - *.moc \ + *.tqmoc \ *.xpm RECURSIVE = yes EXCLUDE = diff --git a/kgoldrunner/gamedata/levels.tar b/kgoldrunner/gamedata/levels.tar Binary files differindex 851ff50e..1e30bd67 100644 --- a/kgoldrunner/gamedata/levels.tar +++ b/kgoldrunner/gamedata/levels.tar diff --git a/kgoldrunner/src/kgoldrunner.cpp b/kgoldrunner/src/kgoldrunner.cpp index 13300f9e..7d5676c5 100644 --- a/kgoldrunner/src/kgoldrunner.cpp +++ b/kgoldrunner/src/kgoldrunner.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Ian Wadham and Marco Kr�ger <[email protected]> + * Copyright (C) 2003 Ian Wadham and Marco Kr�ger <[email protected]> */ #include <kprinter.h> @@ -130,7 +130,7 @@ KGoldrunner::KGoldrunner() show(); // Force the main widget to appear before the "Start Game" dialog does. - qApp->processEvents(); + tqApp->processEvents(); // Call the "Start Game" function and pop up the "Start Game" dialog. game->startLevelOne(); @@ -193,7 +193,7 @@ void KGoldrunner::setupActions() myPause = KStdGameAction:: pause ( - this, TQT_SLOT(stopStart()), actionCollection()); + TQT_TQOBJECT(this), TQT_SLOT(stopStart()), actionCollection()); myPause-> setShortcut (Key_Escape); // Alternate key. highScore = KStdGameAction:: highscores ( @@ -214,7 +214,7 @@ void KGoldrunner::setupActions() (void) KStdGameAction:: quit ( - this, TQT_SLOT(close()), actionCollection()); + TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); /**************************************************************************/ /*************************** GAME EDITOR MENU **************************/ @@ -228,17 +228,17 @@ void KGoldrunner::setupActions() (void) new KAction ( i18n("&Create Level"), 0, - game, TQT_SLOT(createLevel()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(createLevel()), actionCollection(), "create"); (void) new KAction ( i18n("&Edit Any Level..."), 0, - game, TQT_SLOT(updateLevel()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(updateLevel()), actionCollection(), "edit_any"); (void) new KAction ( i18n("Edit &Next Level..."), 0, - game, TQT_SLOT(updateNext()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(updateNext()), actionCollection(), "edit_next"); // Save Edits... @@ -249,19 +249,19 @@ void KGoldrunner::setupActions() saveEdits = new KAction ( i18n("&Save Edits..."), 0, - game, TQT_SLOT(saveLevelFile()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(saveLevelFile()), actionCollection(), "save_edits"); saveEdits->setEnabled (FALSE); // Nothing to save, yet. (void) new KAction ( i18n("&Move Level..."), 0, - game, TQT_SLOT(moveLevelFile()), actionCollection(), + TQT_TQOBJECT(game), TQT_SLOT(moveLevelFile()), actionCollection(), "move_level"); (void) new KAction ( i18n("&Delete Level..."), 0, - game, + TQT_TQOBJECT(game), TQT_SLOT(deleteLevelFile()), actionCollection(), "delete_level"); @@ -272,12 +272,12 @@ void KGoldrunner::setupActions() (void) new KAction ( i18n("Create Game..."), 0, - this, TQT_SLOT(createGame()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(createGame()), actionCollection(), "create_game"); (void) new KAction ( i18n("Edit Game Info..."), 0, - this, + TQT_TQOBJECT(this), TQT_SLOT(editGameInfo()), actionCollection(), "edit_game"); @@ -290,27 +290,27 @@ void KGoldrunner::setupActions() setKGoldrunner = new KRadioAction ( "K&Goldrunner", 0, // Default Shift+G - this, TQT_SLOT(lsKGoldrunner()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsKGoldrunner()), actionCollection(), "kgoldrunner"); setAppleII = new KRadioAction ( "&Apple II", 0, // Default Shift+A - this, TQT_SLOT(lsApple2()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsApple2()), actionCollection(), "apple_2"); setIceCave = new KRadioAction ( i18n("&Ice Cave"), 0, // Default Shift+I - this, TQT_SLOT(lsIceCave()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsIceCave()), actionCollection(), "ice_cave"); setMidnight = new KRadioAction ( i18n("&Midnight"), 0, // Default Shift+M - this, TQT_SLOT(lsMidnight()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsMidnight()), actionCollection(), "midnight"); setKDEKool = new KRadioAction ( i18n("&KDE Kool"), 0, // Default Shift+K - this, TQT_SLOT(lsKDEKool()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(lsKDEKool()), actionCollection(), "kde_kool"); setKGoldrunner-> setExclusiveGroup ("landscapes"); @@ -331,13 +331,13 @@ void KGoldrunner::setupActions() setMouse = new KRadioAction ( i18n("&Mouse Controls Hero"), 0, - this, + TQT_TQOBJECT(this), TQT_SLOT(setMouseMode()), actionCollection(), "mouse_mode"); setKeyboard = new KRadioAction ( i18n("&Keyboard Controls Hero"), 0, - this, + TQT_TQOBJECT(this), TQT_SLOT(setKeyBoardMode()), actionCollection(), "keyboard_mode"); @@ -355,27 +355,27 @@ void KGoldrunner::setupActions() KRadioAction * nSpeed = new KRadioAction ( i18n("Normal Speed"), 0, - this, TQT_SLOT(normalSpeed()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(normalSpeed()), actionCollection(), "normal_speed"); KRadioAction * bSpeed = new KRadioAction ( i18n("Beginner Speed"), 0, - this, TQT_SLOT(beginSpeed()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(beginSpeed()), actionCollection(), "beginner_speed"); KRadioAction * cSpeed = new KRadioAction ( i18n("Champion Speed"), 0, - this, TQT_SLOT(champSpeed()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(champSpeed()), actionCollection(), "champion_speed"); (void) new KAction ( // Repeatable action. i18n("Increase Speed"), Key_Plus, - this, TQT_SLOT(incSpeed()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(incSpeed()), actionCollection(), "increase_speed"); (void) new KAction ( // Repeatable action. i18n("Decrease Speed"), Key_Minus, - this, TQT_SLOT(decSpeed()), actionCollection(), + TQT_TQOBJECT(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, TQT_SLOT(setTradRules()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(setTradRules()), actionCollection(), "trad_rules"); kgrRules = new KRadioAction ( i18n("K&Goldrunner Rules"), 0, - this, TQT_SLOT(setKGrRules()), actionCollection(), + TQT_TQOBJECT(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, TQT_SLOT(makeLarger()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(makeLarger()), actionCollection(), "larger_area"); (void) new KAction ( i18n("Smaller Playing Area"), 0, - this, TQT_SLOT(makeSmaller()), actionCollection(), + TQT_TQOBJECT(this), TQT_SLOT(makeSmaller()), actionCollection(), "smaller_area"); // Configure Shortcuts... @@ -422,7 +422,7 @@ void KGoldrunner::setupActions() // -------------------------- KStdAction::keyBindings ( - this, TQT_SLOT(optionsConfigureKeys()), + TQT_TQOBJECT(this), TQT_SLOT(optionsConfigureKeys()), actionCollection()); // KStdAction::configureToolbars ( // this, TQT_SLOT(optionsConfigureToolbars()), @@ -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, TQT_SLOT(goUp()), actionCollection(), "move_up"); + TQT_TQOBJECT(this), TQT_SLOT(goUp()), actionCollection(), "move_up"); (void) new KAction (i18n("Move Right"), Key_Right, - this, TQT_SLOT(goR()), actionCollection(), "move_right"); + TQT_TQOBJECT(this), TQT_SLOT(goR()), actionCollection(), "move_right"); (void) new KAction (i18n("Move Down"), Key_Down, - this, TQT_SLOT(goDown()), actionCollection(), "move_down"); + TQT_TQOBJECT(this), TQT_SLOT(goDown()), actionCollection(), "move_down"); (void) new KAction (i18n("Move Left"), Key_Left, - this, TQT_SLOT(goL()), actionCollection(), "move_left"); + TQT_TQOBJECT(this), TQT_SLOT(goL()), actionCollection(), "move_left"); (void) new KAction (i18n("Stop"), Key_Space, - this, TQT_SLOT(stop()), actionCollection(), "stop"); + TQT_TQOBJECT(this), TQT_SLOT(stop()), actionCollection(), "stop"); (void) new KAction (i18n("Dig Right"), Key_C, - this, TQT_SLOT(digR()), actionCollection(), "dig_right"); + TQT_TQOBJECT(this), TQT_SLOT(digR()), actionCollection(), "dig_right"); (void) new KAction (i18n("Dig Left"), Key_Z, - this, TQT_SLOT(digL()), actionCollection(), "dig_left"); + TQT_TQOBJECT(this), TQT_SLOT(digL()), actionCollection(), "dig_left"); // Alternate one-handed controls. Set up in "kgoldrunnerui.rc". @@ -522,7 +522,7 @@ void KGoldrunner::initStatusBar() // Set the PAUSE/RESUME key-names into the status bar message. pauseKeys = myPause->shortcut().toString(); - pauseKeys = pauseKeys.replace (';', "\" " + i18n("or") + " \""); + pauseKeys = pauseKeys.tqreplace (';', "\" " + i18n("or") + " \""); gameFreeze (FALSE); statusBar()->setItemFixed (ID_LIVES, -1); // Fix current sizes. @@ -572,10 +572,10 @@ void KGoldrunner::gameFreeze (bool on_off) { if (on_off) statusBar()->changeItem - (i18n("Press \"%1\" to RESUME").arg(pauseKeys), ID_MSG); + (i18n("Press \"%1\" to RESUME").tqarg(pauseKeys), ID_MSG); else statusBar()->changeItem - (i18n("Press \"%1\" to PAUSE").arg(pauseKeys), ID_MSG); + (i18n("Press \"%1\" to PAUSE").tqarg(pauseKeys), ID_MSG); } void KGoldrunner::adjustHintAction (bool hintAvailable) @@ -760,7 +760,7 @@ void KGoldrunner::optionsConfigureKeys() // Update the PAUSE/RESUME message in the status bar. pauseKeys = myPause->shortcut().toString(); - pauseKeys = pauseKeys.replace (';', "\" " + i18n("or") + " \""); + pauseKeys = pauseKeys.tqreplace (';', "\" " + i18n("or") + " \""); gameFreeze (KGrObject::frozen); // Refresh the status bar text. } @@ -849,7 +849,7 @@ bool KGoldrunner::getDirectories() KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find documentation sub-folder 'en/%1/' " "in area '%2' of the KDE folder ($KDEDIRS).") - .arg(myDir).arg(dirs->kde_default ("html"))); + .tqarg(myDir).tqarg(dirs->kde_default ("html"))); // result = FALSE; // Don't abort if the doc is missing. } else @@ -861,7 +861,7 @@ bool KGoldrunner::getDirectories() KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find system games sub-folder '%1/system/' " "in area '%2' of the KDE folder ($KDEDIRS).") - .arg(myDir).arg(dirs->kde_default ("data"))); + .tqarg(myDir).tqarg(dirs->kde_default ("data"))); result = FALSE; // ABORT if the games data is missing. } else @@ -874,7 +874,7 @@ bool KGoldrunner::getDirectories() KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find or create user games sub-folder '%1/user/' " "in area '%2' of the KDE user area ($KDEHOME).") - .arg(myDir).arg(dirs->kde_default ("data"))); + .tqarg(myDir).tqarg(dirs->kde_default ("data"))); // result = FALSE; // Don't abort if user area is missing. } else { @@ -882,7 +882,7 @@ bool KGoldrunner::getDirectories() if (! create) { KGrMessage::information (this, i18n("Get Folders"), i18n("Cannot find or create 'levels/' folder in " - "sub-folder '%1/user/' in the KDE user area ($KDEHOME).").arg(myDir)); + "sub-folder '%1/user/' in the KDE user area ($KDEHOME).").tqarg(myDir)); // result = FALSE; // Don't abort if user area is missing. } } @@ -987,7 +987,7 @@ void KGoldrunner::makeEditToolbar() edenemybg = edenemybg.xForm (w); } - editToolbar = new KToolBar (this, Qt::DockTop, TRUE, "Editor", TRUE); + editToolbar = new KToolBar (this, TQt::DockTop, TRUE, "Editor", TRUE); // Choose a colour that enhances visibility of the KGoldrunner pixmaps. // editToolbar->setPalette (TQPalette (TQColor (150, 150, 230))); @@ -995,7 +995,7 @@ void KGoldrunner::makeEditToolbar() // editToolbar->setHorizontallyStretchable (TRUE); // Not effective in KDE. // All those separators are just to get reasonable visual spacing of the - // pixmaps in KDE. "setHorizontallyStretchable(TRUE)" does it in Qt. + // pixmaps in KDE. "setHorizontallyStretchable(TRUE)" does it in TQt. editToolbar->insertSeparator(); @@ -1015,34 +1015,34 @@ void KGoldrunner::makeEditToolbar() editToolbar->insertSeparator(); editToolbar->insertSeparator(); - editToolbar->insertButton (freebg, (int)FREE, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (freebg, (int)FREE, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(freeSlot()), TRUE, i18n("Empty space")); editToolbar->insertSeparator(); - editToolbar->insertButton (edherobg, (int)HERO, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (edherobg, (int)HERO, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (edheroSlot()), TRUE, i18n("Hero")); editToolbar->insertSeparator(); - editToolbar->insertButton (edenemybg, (int)ENEMY, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (edenemybg, (int)ENEMY, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (edenemySlot()), TRUE, i18n("Enemy")); editToolbar->insertSeparator(); - editToolbar->insertButton (brickbg, (int)BRICK, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (brickbg, (int)BRICK, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (brickSlot()), TRUE, i18n("Brick (can dig)")); editToolbar->insertSeparator(); - editToolbar->insertButton (betonbg, (int)BETON, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (betonbg, (int)BETON, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (betonSlot()), TRUE, i18n("Concrete (cannot dig)")); editToolbar->insertSeparator(); - editToolbar->insertButton (fbrickbg, (int)FBRICK, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (fbrickbg, (int)FBRICK, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (fbrickSlot()), TRUE, i18n("Trap (can fall through)")); editToolbar->insertSeparator(); - editToolbar->insertButton (ladderbg, (int)LADDER, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (ladderbg, (int)LADDER, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (ladderSlot()), TRUE, i18n("Ladder")); editToolbar->insertSeparator(); - editToolbar->insertButton (hladderbg, (int)HLADDER, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (hladderbg, (int)HLADDER, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (hladderSlot()), TRUE, i18n("Hidden ladder")); editToolbar->insertSeparator(); - editToolbar->insertButton (polebg, (int)POLE, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (polebg, (int)POLE, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (poleSlot()), TRUE, i18n("Pole (or bar)")); editToolbar->insertSeparator(); - editToolbar->insertButton (nuggetbg, (int)NUGGET, TQT_SIGNAL(clicked()), this, + editToolbar->insertButton (nuggetbg, (int)NUGGET, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT (nuggetSlot()), TRUE, i18n("Gold nugget")); editToolbar->setToggle ((int) FREE, TRUE); diff --git a/kgoldrunner/src/kgoldrunner.h b/kgoldrunner/src/kgoldrunner.h index 358a5561..2959b3d0 100644 --- a/kgoldrunner/src/kgoldrunner.h +++ b/kgoldrunner/src/kgoldrunner.h @@ -9,7 +9,7 @@ #include <config.h> #endif -// Status bar +// tqStatus bar const int ID_LIVES = 0; // Field IDs in KDE status bar. const int ID_SCORE = 1; const int ID_LEVEL = 2; @@ -40,6 +40,7 @@ class KGrHero; class KGoldrunner : public KMainWindow { Q_OBJECT + TQ_OBJECT public: /** * Default Constructor @@ -136,7 +137,7 @@ private slots: void showLevel (int); // Show the current level number. void showLives (long); // Show how many lives are remaining. void showScore (long); // Show the player's score. - void gameFreeze (bool); // Status feedback on freeze/unfreeze. + void gameFreeze (bool); // tqStatus feedback on freeze/unfreeze. void adjustHintAction (bool); // Enable/disable "Hint" action. void markRuleType (char ruleType); // Check game's rule type in the menu. @@ -163,7 +164,7 @@ private: KAction * saveGame; // Save game, level, lives and score. KAction * myPause; // Pause or resume the game. - QString pauseKeys; // Keystroke names to put in status bar. + TQString pauseKeys; // Keystroke names to put in status bar. KAction * hintAction; // Display a hint, if available. KAction * killHero; // Kill hero (disabled during edits). diff --git a/kgoldrunner/src/kgrcanvas.cpp b/kgoldrunner/src/kgrcanvas.cpp index 111913a1..907463e5 100644 --- a/kgoldrunner/src/kgrcanvas.cpp +++ b/kgoldrunner/src/kgrcanvas.cpp @@ -2,7 +2,7 @@ kgrcanvas.cpp - description ------------------- begin : Wed Jan 23 2002 - copyright : (C) 2002 by Marco Kr�ger and Ian Wadham + copyright : (C) 2002 by Marco Kr�ger and Ian Wadham email : See menu "Help, About KGoldrunner" ***************************************************************************/ @@ -34,8 +34,8 @@ class KGoldrunner; -KGrCanvas::KGrCanvas (TQWidget * parent, const char *name) - : TQCanvasView (0, parent, name) +KGrCanvas::KGrCanvas (TQWidget * tqparent, const char *name) + : TQCanvasView (0, tqparent, name) { setBackgroundMode (NoBackground); m = new TQCursor (); // For handling the mouse. @@ -117,7 +117,7 @@ bool KGrCanvas::changeSize (int d) return FALSE; } - TQWMatrix wm = worldMatrix(); + TQWMatrix wm = tqworldMatrix(); double wmScale = 1.0; // Set the scale back to 1:1 and calculate the new scale factor. @@ -145,7 +145,7 @@ bool KGrCanvas::changeSize (int d) #else KGrMessage::information (this, i18n( "Change Size" ), i18n( "Sorry, you cannot change the size of the playing area. " - "That function requires Qt Library version 3 or later." )); + "That function requires TQt Library version 3 or later." )); return FALSE; #endif } @@ -196,8 +196,8 @@ void KGrCanvas::setTitle (TQString newTitle) void KGrCanvas::makeTitle () { - // 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). + // This uses a calculated TQLabel and TQFont size because a TQCanvasText + // object does not always display scaled-up fonts cleanly (in TQt 3.1.1). if (title != 0) title->close (TRUE); // Close and delete previous title. @@ -210,7 +210,7 @@ void KGrCanvas::makeTitle () title->setPaletteForegroundColor (textColor); title->setFont (TQFont (fontInfo().family(), (baseFontSize * scaleStep) / baseScale, TQFont::Bold)); - title->setAlignment (Qt::AlignCenter); + title->tqsetAlignment (TQt::AlignCenter); title->raise(); title->show(); } @@ -257,12 +257,12 @@ void KGrCanvas::makeHeroSprite (int i, int j, int startFrame) i++; j++; heroSprite->move (i * 4 * STEP, j * 4 * STEP, startFrame); heroSprite->setZ (1); - heroSprite->setVisible (TRUE); + heroSprite->tqsetVisible (TRUE); } void KGrCanvas::setHeroVisible (bool newState) { - heroSprite->setVisible (newState); // Show or hide the hero. + heroSprite->tqsetVisible (newState); // Show or hide the hero. } void KGrCanvas::makeEnemySprite (int i, int j, int startFrame) @@ -396,8 +396,8 @@ void KGrCanvas::initView() #else TQPixmap * pm; TQPoint * pt; - QList<TQPixmap> pmList; - QList<TQPoint> ptList; + TQList<TQPixmap> pmList; + TQList<TQPoint> ptList; pt = new TQPoint (0, 0); // "Hot spot" not used in KGoldrunner. @@ -469,7 +469,7 @@ void KGrCanvas::initView() #ifdef QT3 enemySprites = new TQPtrList<TQCanvasSprite> (); #else - enemySprites = new QList<TQCanvasSprite> (); + enemySprites = new TQList<TQCanvasSprite> (); #endif enemySprites->setAutoDelete(TRUE); } diff --git a/kgoldrunner/src/kgrcanvas.h b/kgoldrunner/src/kgrcanvas.h index 2c0ab270..cfabc408 100644 --- a/kgoldrunner/src/kgrcanvas.h +++ b/kgoldrunner/src/kgrcanvas.h @@ -28,11 +28,12 @@ #include <tqimage.h> #include <tqpainter.h> -class KGrCanvas : public QCanvasView +class KGrCanvas : public TQCanvasView { Q_OBJECT + TQ_OBJECT public: - KGrCanvas (TQWidget * parent = 0, const char *name = 0); + KGrCanvas (TQWidget * tqparent = 0, const char *name = 0); virtual ~KGrCanvas(); void changeLandscape (const TQString & name); @@ -95,7 +96,7 @@ private: #ifdef QT3 TQPtrList<TQCanvasSprite> * enemySprites; #else - QList<TQCanvasSprite> * enemySprites; + TQList<TQCanvasSprite> * enemySprites; #endif void initView(); diff --git a/kgoldrunner/src/kgrconsts.h b/kgoldrunner/src/kgrconsts.h index 2006648a..ce5ada47 100644 --- a/kgoldrunner/src/kgrconsts.h +++ b/kgoldrunner/src/kgrconsts.h @@ -70,7 +70,7 @@ enum Position {RIGHTWALK1,RIGHTWALK2,RIGHTWALK3,RIGHTWALK4, LEFTCLIMB1,LEFTCLIMB2,LEFTCLIMB3,LEFTCLIMB4, CLIMB1,CLIMB2, FALL1,FALL2}; -enum Status {STANDING,FALLING,WALKING,CLIMBING,CAPTIVE}; +enum tqStatus {STANDING,FALLING,WALKING,CLIMBING,CAPTIVE}; enum Direction {RIGHT,LEFT,UP,DOWN,STAND}; enum SearchStrategy {LOW,MEDIUM,HIGH}; diff --git a/kgoldrunner/src/kgrdialog.cpp b/kgoldrunner/src/kgrdialog.cpp index 632eb617..011f56dc 100644 --- a/kgoldrunner/src/kgrdialog.cpp +++ b/kgoldrunner/src/kgrdialog.cpp @@ -29,16 +29,16 @@ #ifdef KGR_PORTABLE KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, TQPtrList<KGrCollection> & gamesList, KGrGame * theGame, - TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + TQWidget * tqparent, const char * name) + : TQDialog (tqparent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, TQPtrList<KGrCollection> & gamesList, KGrGame * theGame, - TQWidget * parent, const char * name) + TQWidget * tqparent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Select Game"), KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help, - KDialogBase::Ok, parent, name) + KDialogBase::Ok, tqparent, name) #endif { slAction = action; @@ -47,7 +47,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, collections = gamesList; game = theGame; collection = collections.at(defaultGame); - slParent = parent; + slParent = tqparent; #ifdef KGR_PORTABLE int margin = 10; @@ -84,7 +84,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, if ((action == SL_START) || (action == SL_UPD_GAME)) { dad-> setCaption (i18n("Select Game")); - TQLabel * startMsg = new QLabel + TQLabel * startMsg = new TQLabel ("<b>" + i18n("Level 1 of the selected game is:") + "</b>", dad); mainLayout->addWidget (startMsg); } @@ -99,7 +99,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, // Initial range 1->150, small step 1, big step 10 and default value 1. number = new TQScrollBar (1, 150, 1, 10, 1, - TQScrollBar::Horizontal, dad); + Qt::Horizontal, dad); grid->addWidget (number, 1, 1); TQHBox * numberPair = new TQHBox (dad); @@ -117,7 +117,7 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, grid->addMultiCellWidget (thumbNail, 1, 3, 2, 2); // Set thumbnail cell size to about 1/5 of game cell size. - int cellSize = parent->width() / (5 * (FIELDWIDTH + 4)); + int cellSize = tqparent->width() / (5 * (FIELDWIDTH + 4)); thumbNail-> setFixedWidth ((FIELDWIDTH * cellSize) + 2); thumbNail-> setFixedHeight ((FIELDHEIGHT * cellSize) + 2); @@ -125,15 +125,15 @@ KGrSLDialog::KGrSLDialog (int action, int requestedLevel, int collnIndex, TQHBox * buttons = new TQHBox (this); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); - // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. + // Buttons are for TQt-only portability. NOT COMPILED in KDE environment. HELP = new TQPushButton (i18n("Help"), buttons); OK = new TQPushButton (i18n("&OK"), buttons); CANCEL = new TQPushButton (i18n("&Cancel"), buttons); - TQPoint p = parent->mapToGlobal (TQPoint (0,0)); + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); - // Base the geometry of the dialog box on the playing area. - int cell = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the dialog box on the playing area. + int cell = tqparent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+2*cell, p.y()+2*cell); dad-> setMinimumSize ((FIELDWIDTH*cell/2), (FIELDHEIGHT-1)*cell); @@ -357,7 +357,7 @@ void KGrSLDialog::slAboutColln () { // User clicked the "About" button ... int n = slCollnIndex; - QString title = i18n("About \"%1\"").arg(collections.at(n)->name); + TQString title = i18n("About \"%1\"").tqarg(collections.at(n)->name); if (collections.at(n)->about.length() > 0) { // Convert game description to ASCII and UTF-8 codes, then translate it. @@ -401,10 +401,10 @@ void KGrSLDialog::slPaintLevel () if (n < 0) { return; // Owner has no collections. } - QString filePath = game->getFilePath + TQString filePath = game->getFilePath (collections.at(n)->owner, collections.at(n), number->value()); thumbNail->setFilePath (filePath, slName); - thumbNail->repaint(); // Will call "drawContents (p)". + thumbNail->tqrepaint(); // Will call "drawContents (p)". } void KGrSLDialog::slotHelp () @@ -486,15 +486,15 @@ void KGrSLDialog::slotHelp () #ifdef KGR_PORTABLE KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, - TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + TQWidget * tqparent, const char * name) + : TQDialog (tqparent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, - TQWidget * parent, const char * name) + TQWidget * tqparent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Edit Name & Hint"), KDialogBase::Ok | KDialogBase::Cancel, - KDialogBase::Ok, parent, name) + KDialogBase::Ok, tqparent, name) #endif { #ifdef KGR_PORTABLE @@ -530,21 +530,21 @@ KGrNHDialog::KGrNHDialog(const TQString & levelName, const TQString & levelHint, TQHBox * buttons = new TQHBox (dad); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); - // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. + // Buttons are for TQt-only portability. NOT COMPILED in KDE environment. 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 (TQPoint (0,0)); - int c = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the text box on the playing area. + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); + int c = tqparent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+4*c, p.y()+4*c); mle-> setMinimumSize ((FIELDWIDTH*c/2), (FIELDHEIGHT/2)*c); // Configure the text box. - mle-> setAlignment (AlignLeft); + mle-> tqsetAlignment (AlignLeft); #ifndef QT3 mle-> setWordWrap (TQMultiLineEdit::WidgetWidth); mle-> setFixedVisibleLines (9); @@ -573,16 +573,16 @@ KGrNHDialog::~KGrNHDialog() #ifdef KGR_PORTABLE KGrECDialog::KGrECDialog (int action, int collnIndex, TQPtrList<KGrCollection> & gamesList, - TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + TQWidget * tqparent, const char * name) + : TQDialog (tqparent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrECDialog::KGrECDialog (int action, int collnIndex, TQPtrList<KGrCollection> & gamesList, - TQWidget * parent, const char * name) + TQWidget * tqparent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Edit Game Info"), KDialogBase::Ok | KDialogBase::Cancel, - KDialogBase::Ok, parent, name) + KDialogBase::Ok, tqparent, name) #endif { collections = gamesList; @@ -612,7 +612,7 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, prefixL = new TQLabel (i18n("File name prefix:"), prefixBox); ecPrefix = new TQLineEdit (prefixBox); - ecGrp = new TQButtonGroup (1, TQButtonGroup::Horizontal, 0, dad); + ecGrp = new TQButtonGroup (1, Qt::Horizontal, 0, dad); mainLayout->addWidget (ecGrp); ecTradB = new TQRadioButton (i18n("Traditional rules"), ecGrp); ecKGrB = new TQRadioButton (i18n("KGoldrunner rules"), ecGrp); @@ -636,14 +636,14 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, TQHBox * buttons = new TQHBox (dad); mainLayout->addWidget (buttons); buttons->setSpacing (spacing); - // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. + // Buttons are for TQt-only portability. NOT COMPILED in KDE environment. OK = new TQPushButton (i18n("&OK"), buttons); CANCEL = new TQPushButton (i18n("&Cancel"), buttons); - TQPoint p = parent->mapToGlobal (TQPoint (0,0)); + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); - // Base the geometry of the dialog box on the playing area. - int cell = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the dialog box on the playing area. + int cell = tqparent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+2*cell, p.y()+2*cell); dad-> setMinimumSize ((FIELDWIDTH*cell/2), (FIELDHEIGHT-1)*cell); #endif @@ -663,13 +663,13 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, // Collection already has some levels, so cannot change the prefix. ecPrefix-> setEnabled (FALSE); } - QString s; + TQString s; #ifndef KGR_PORTABLE nLevL-> setText (i18n("1 level", "%n levels", collections.at(defaultGame)->nLevels)); #else nLevL-> setText (i18n("%1 levels") - .arg(collections.at(defaultGame)->nLevels)); + .tqarg(collections.at(defaultGame)->nLevels)); #endif OKText = i18n("Save Changes"); } @@ -694,7 +694,7 @@ KGrECDialog::KGrECDialog (int action, int collnIndex, } // Configure the edit box. - mle-> setAlignment (AlignLeft); + mle-> tqsetAlignment (AlignLeft); #ifndef QT3 mle-> setWordWrap (TQMultiLineEdit::WidgetWidth); mle-> setFixedVisibleLines (8); @@ -750,16 +750,16 @@ void KGrECDialog::ecSetTrad () {ecSetRules ('T');} #ifdef KGR_PORTABLE KGrLGDialog::KGrLGDialog (TQFile * savedGames, TQPtrList<KGrCollection> & collections, - TQWidget * parent, const char * name) - : TQDialog (parent, name, TRUE, + TQWidget * tqparent, const char * name) + : TQDialog (tqparent, name, TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title) #else KGrLGDialog::KGrLGDialog (TQFile * savedGames, TQPtrList<KGrCollection> & collections, - TQWidget * parent, const char * name) + TQWidget * tqparent, const char * name) : KDialogBase (KDialogBase::Plain, i18n("Select Saved Game"), KDialogBase::Ok | KDialogBase::Cancel, - KDialogBase::Ok, parent, name) + KDialogBase::Ok, tqparent, name) #endif { #ifdef KGR_PORTABLE @@ -780,9 +780,9 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, lgList = new TQListBox (dad); #ifdef KGR_PORTABLE - QFont f ("courier", 12); + TQFont f ("courier", 12); #else - QFont f = KGlobalSettings::fixedFont(); // KDE version. + TQFont f = KGlobalSettings::fixedFont(); // KDE version. #endif f.setFixedPitch (TRUE); lgList-> setFont (f); @@ -795,16 +795,16 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, #ifdef KGR_PORTABLE TQHBox * buttons = new TQHBox (dad); buttons-> setSpacing (spacing); - // Buttons are for Qt-only portability. NOT COMPILED in KDE environment. + // Buttons are for TQt-only portability. NOT COMPILED in KDE environment. 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 (TQPoint (0,0)); - int c = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the list box on the playing area. + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); + int c = tqparent->width() / (FIELDWIDTH + 4); dad-> move (p.x()+2*c, p.y()+2*c); lgList-> setMinimumHeight ((FIELDHEIGHT/2)*c); OK-> setMaximumWidth (4*c); @@ -816,16 +816,16 @@ KGrLGDialog::KGrLGDialog (TQFile * savedGames, lgHighlight = -1; - QTextStream gameText (savedGames); - QString s = ""; - QString pr = ""; + TQTextStream gameText (savedGames); + TQString s = ""; + TQString pr = ""; int i; int imax = collections.count(); // Read the saved games into the list box. while (! gameText.endData()) { s = gameText.readLine(); // Read in one saved game. - pr = s.left (s.find (" ", 0, FALSE)); // Get the collection prefix. + pr = s.left (s.tqfind (" ", 0, FALSE)); // Get the collection prefix. for (i = 0; i < imax; i++) { // Get the collection name. if (collections.at(i)->prefix == pr) { s = s.insert (0, @@ -858,26 +858,26 @@ void KGrLGDialog::lgSelect (int n) *********************** CENTRALISED MESSAGE FUNCTIONS ************************ *******************************************************************************/ -void KGrMessage::information (TQWidget * parent, const TQString &caption, const TQString &text) +void KGrMessage::information (TQWidget * tqparent, const TQString &caption, const TQString &text) { #ifdef KGR_PORTABLE - // Force Qt to do word-wrapping (but it ignores "\n" line-breaks). - TQMessageBox::information (parent, caption, + // Force TQt to do word-wrapping (but it ignores "\n" line-breaks). + TQMessageBox::information (tqparent, caption, "<qt>" + text + "</qt>"); #else // KDE does word-wrapping and will observe "\n" line-breaks. - KMessageBox::information (parent, text, caption); + KMessageBox::information (tqparent, text, caption); #endif } -int KGrMessage::warning (TQWidget * parent, TQString caption, TQString text, +int KGrMessage::warning (TQWidget * tqparent, 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 = TQMessageBox::warning (parent, caption, + // Force TQt to do word-wrapping (but it ignores "\n" line-breaks). + ans = TQMessageBox::warning (tqparent, caption, "<qt>" + text + "</qt>", label0, label1, label2, 0, (label2.isEmpty()) ? 1 : 2); @@ -885,13 +885,13 @@ int KGrMessage::warning (TQWidget * parent, TQString caption, TQString text, // KDE does word-wrapping and will observe "\n" line-breaks. if (label2.isEmpty()) { // Display a box with 2 buttons. - ans = KMessageBox::questionYesNo (parent, text, caption, + ans = KMessageBox::questionYesNo (tqparent, text, caption, label0, label1); ans = (ans == KMessageBox::Yes) ? 0 : 1; } else { // Display a box with 3 buttons. - ans = KMessageBox::questionYesNoCancel (parent, text, caption, + ans = KMessageBox::questionYesNoCancel (tqparent, text, caption, label0, label1); if (ans == KMessageBox::Cancel) ans = 2; @@ -906,12 +906,12 @@ int KGrMessage::warning (TQWidget * parent, TQString caption, TQString text, /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ -void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) +void KGrMessage::wrapped (TQWidget * tqparent, TQString title, TQString contents) { #ifndef KGR_PORTABLE - KMessageBox::information (parent, contents, title); + KMessageBox::information (tqparent, contents, title); #else - TQDialog * mm = new TQDialog (parent, "wrappedMessage", TRUE, + TQDialog * mm = new TQDialog (tqparent, "wrappedMessage", TRUE, WStyle_Customize | WStyle_NormalBorder | WStyle_Title); int margin = 10; @@ -919,7 +919,7 @@ void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) TQVBoxLayout * mainLayout = new TQVBoxLayout (mm, margin, spacing); // Make text background grey not white (i.e. same as widget background). - QPalette pl = mm->palette(); + TQPalette pl = mm->palette(); #ifdef QT3 pl.setColor (TQColorGroup::Base, mm->paletteBackgroundColor()); #else @@ -936,21 +936,21 @@ void KGrMessage::wrapped (TQWidget * parent, TQString title, TQString contents) #endif mainLayout->addWidget (mle); - // Button is for Qt-only portability. NOT COMPILED in KDE environment. + // Button is for TQt-only portability. NOT COMPILED in KDE environment. TQPushButton * OK = new TQPushButton (i18n("&OK"), mm); - mainLayout->addWidget (OK, Qt::AlignHCenter); + mainLayout->addWidget (OK, TQt::AlignHCenter); mm-> setCaption (title); - // Base the geometry of the text box on the playing area. - QPoint p = parent->mapToGlobal (TQPoint (0,0)); - int c = parent->width() / (FIELDWIDTH + 4); + // Base the tqgeometry of the text box on the playing area. + TQPoint p = tqparent->mapToGlobal (TQPoint (0,0)); + int c = tqparent->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 (TQFrame::NoFrame); - mle-> setAlignment (AlignLeft); + mle-> tqsetAlignment (AlignLeft); mle-> setReadOnly (TRUE); mle-> setText (contents); diff --git a/kgoldrunner/src/kgrdialog.h b/kgoldrunner/src/kgrdialog.h index 860328eb..cbf4735a 100644 --- a/kgoldrunner/src/kgrdialog.h +++ b/kgoldrunner/src/kgrdialog.h @@ -7,15 +7,15 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ -#ifndef KGRDIALOG_QT_H -#define KGRDIALOG_QT_H +#ifndef KGRDIALOG_TQT_H +#define KGRDIALOG_TQT_H // If portable version, use TQDialog and TQMessageBox. // If KDE version, use KDialogBase and KMessageBox. #ifdef KGR_PORTABLE #include <tqdialog.h> -#define KGR_DIALOG QDialog +#define KGR_DIALOG TQDialog #include <tqmessagebox.h> #else @@ -55,13 +55,14 @@ class KGrThumbNail; /******************* DIALOG TO SELECT A GAME AND LEVEL *******************/ /******************************************************************************/ -class KGrSLDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase +class KGrSLDialog : public KGR_DIALOG // KGR_PORTABLE sets TQDialog/KDialogBase { Q_OBJECT + TQ_OBJECT public: KGrSLDialog (int action, int requestedLevel, int collnIndex, TQPtrList<KGrCollection> & gamesList, KGrGame * theGame, - TQWidget * parent = 0, const char *name = 0); + TQWidget * tqparent = 0, const char *name = 0); ~KGrSLDialog(); int selectedLevel() {return (number->value());} @@ -110,16 +111,17 @@ private: *************** DIALOG BOX TO CREATE/EDIT A LEVEL NAME AND HINT **************** *******************************************************************************/ -class KGrNHDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase +class KGrNHDialog : public KGR_DIALOG // KGR_PORTABLE sets TQDialog/KDialogBase { Q_OBJECT + TQ_OBJECT public: KGrNHDialog (const TQString & levelName, const TQString & levelHint, - TQWidget * parent = 0, const char * name = 0); + TQWidget * tqparent = 0, const char * name = 0); ~KGrNHDialog(); - QString getName() {return (nhName->text());} - QString getHint() {return (mle->text());} + TQString getName() {return (nhName->text());} + TQString getHint() {return (mle->text());} private: TQLineEdit * nhName; @@ -134,19 +136,20 @@ private: ***************** DIALOG TO CREATE OR EDIT A GAME (COLLECTION) ***************** *******************************************************************************/ -class KGrECDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase +class KGrECDialog : public KGR_DIALOG // KGR_PORTABLE sets TQDialog/KDialogBase { Q_OBJECT + TQ_OBJECT public: KGrECDialog (int action, int collnIndex, TQPtrList<KGrCollection> & gamesList, - TQWidget *parent = 0, const char *name = 0); + TQWidget *tqparent = 0, const char *name = 0); ~KGrECDialog(); - QString getName() {return (ecName->text());} - QString getPrefix() {return (ecPrefix->text());} + TQString getName() {return (ecName->text());} + TQString getPrefix() {return (ecPrefix->text());} bool isTrad() {return (ecTradB->isChecked());} - QString getAboutText() {return (mle->text());} + TQString getAboutText() {return (mle->text());} private slots: void ecSetRules (const char settings); @@ -186,12 +189,13 @@ private: #include <tqfile.h> #include <tqtextstream.h> -class KGrLGDialog : public KGR_DIALOG // KGR_PORTABLE sets QDialog/KDialogBase +class KGrLGDialog : public KGR_DIALOG // KGR_PORTABLE sets TQDialog/KDialogBase { Q_OBJECT + TQ_OBJECT public: KGrLGDialog (TQFile * savedGames, TQPtrList<KGrCollection> & collections, - TQWidget * parent, const char * name); + TQWidget * tqparent, const char * name); TQString getCurrentText() {return (lgList->currentText());} private slots: @@ -203,16 +207,16 @@ private: }; /******************************************************************************* -****************** PORTABLE MESSAGE FUNCTIONS (Qt Version) ******************* +****************** PORTABLE MESSAGE FUNCTIONS (TQt Version) ******************* *******************************************************************************/ -class KGrMessage : public QDialog +class KGrMessage : public TQDialog { public: - static void information (TQWidget * parent, const TQString &caption, const TQString &text); - static int warning (TQWidget * parent, TQString caption, TQString text, + static void information (TQWidget * tqparent, const TQString &caption, const TQString &text); + static int warning (TQWidget * tqparent, TQString caption, TQString text, TQString label0, TQString label1, TQString label2 = ""); - static void wrapped (TQWidget * parent, TQString caption, TQString text); + static void wrapped (TQWidget * tqparent, TQString caption, TQString text); }; #endif diff --git a/kgoldrunner/src/kgrfigure.cpp b/kgoldrunner/src/kgrfigure.cpp index 0dcb68af..7c640e88 100644 --- a/kgoldrunner/src/kgrfigure.cpp +++ b/kgoldrunner/src/kgrfigure.cpp @@ -76,7 +76,7 @@ int KGrFigure::gety() return absy; } -Status KGrFigure::getStatus() +tqStatus KGrFigure::gettqStatus() { return status; } @@ -713,7 +713,7 @@ void KGrHero::digRight(){ #ifdef QT3 void KGrHero::setEnemyList(TQPtrList<KGrEnemy> *e) #else -void KGrHero::setEnemyList(QList<KGrEnemy> *e) +void KGrHero::setEnemyList(TQList<KGrEnemy> *e) #endif { enemies = e; @@ -733,7 +733,7 @@ bool KGrHero::standOnEnemy() (((absx - 16) < enemy->getx()) && ((absx + 16) > enemy->getx()))) { if (((absy + 12) == enemy->gety()) && - (enemy->getStatus() != FALLING)) { + (enemy->gettqStatus() != FALLING)) { absy = absy - rely; // Bounce back from overlap, to avoid rely = 0; // hero-enemy mid-cycle deadlock. walkCounter = 1; @@ -807,7 +807,7 @@ KGrEnemy :: KGrEnemy (KGrCanvas * view, int x, int y) walkCounter = 1; captiveCounter = 0; - searchStatus = HORIZONTAL; + searchtqStatus = HORIZONTAL; birthX=x; birthY=y; @@ -849,7 +849,7 @@ void KGrEnemy::showState(char option) case 's': printf (" nuggets %02d status %d walk-ctr %d ", nuggets, status, walkCounter); printf ("dirn %d search %d capt-ctr %d\n", - direction, searchStatus, captiveCounter); + direction, searchtqStatus, captiveCounter); printf (" rel (%02d,%02d) abs (%03d,%03d)", relx, rely, absx, absy); printf (" pix %02d", actualPixmap); @@ -907,7 +907,7 @@ void KGrEnemy::walkTimeDone () case RIGHT: walkRight (WALKDELAY, FALLDELAY); break; case LEFT: walkLeft (WALKDELAY, FALLDELAY); break; default: // Switch search direction in KGoldrunner search (only). - searchStatus = (searchStatus==VERTIKAL) ? + searchtqStatus = (searchtqStatus==VERTIKAL) ? HORIZONTAL : VERTIKAL; // In KGoldrunner rules, if a hole opens under an enemy @@ -942,7 +942,7 @@ void KGrEnemy::walkTimeDone () // In KGoldrunner rules, change the search strategy, // to avoid enemy-enemy deadlock. - searchStatus = (searchStatus==VERTIKAL) ? HORIZONTAL : VERTIKAL; + searchtqStatus = (searchtqStatus==VERTIKAL) ? HORIZONTAL : VERTIKAL; dirn = searchbestway (x, y, herox, heroy); if ((dirn != direction) && ((*playfield)[x][y]->whatIam() != USEDHOLE)) { @@ -1221,7 +1221,7 @@ Direction KGrEnemy::searchbestway(int ew,int eh,int hw,int hh) // KGoldrunner search strategy. case MEDIUM: case HIGH: - if(searchStatus==VERTIKAL){ + if(searchtqStatus==VERTIKAL){ if (eh > hh) return searchupway(ew,eh); if (eh < hh) @@ -1673,7 +1673,7 @@ bool KGrEnemy::willNotFall (int x, int y) #ifdef QT3 void KGrEnemy::setEnemyList(TQPtrList<KGrEnemy> *e) #else -void KGrEnemy::setEnemyList(QList<KGrEnemy> *e) +void KGrEnemy::setEnemyList(TQList<KGrEnemy> *e) #endif { enemies = e; diff --git a/kgoldrunner/src/kgrfigure.h b/kgoldrunner/src/kgrfigure.h index 12551418..fd7de606 100644 --- a/kgoldrunner/src/kgrfigure.h +++ b/kgoldrunner/src/kgrfigure.h @@ -33,9 +33,10 @@ class KGrCanvas; class KGrObject; class KGrEnemy; -class KGrFigure : public QObject +class KGrFigure : public TQObject { Q_OBJECT + TQ_OBJECT public: KGrFigure (int, int); virtual ~KGrFigure(); @@ -53,7 +54,7 @@ public: // dependent on number of enemies. int getx(); int gety(); - Status getStatus(); + tqStatus gettqStatus(); int getnuggets(); void setNuggets(int n); @@ -80,7 +81,7 @@ protected: TQTimer *fallTimer; KGrObject *(*playfield)[30][22]; - Status status; + tqStatus status; Direction direction; bool canWalkRight(); bool canWalkLeft(); @@ -102,6 +103,7 @@ protected: class KGrHero : public KGrFigure { Q_OBJECT + TQ_OBJECT public: KGrHero(KGrCanvas *, int , int); virtual ~KGrHero(); @@ -114,7 +116,7 @@ public: #ifdef QT3 void setEnemyList(TQPtrList<KGrEnemy> *); #else - void setEnemyList(QList<KGrEnemy> *); + void setEnemyList(TQList<KGrEnemy> *); #endif void init(int,int); void setKey(Direction); @@ -131,7 +133,7 @@ private: #ifdef QT3 TQPtrList<KGrEnemy> *enemies; #else - QList<KGrEnemy> *enemies; + TQList<KGrEnemy> *enemies; #endif KGrCanvas * heroView; bool standOnEnemy(); @@ -161,6 +163,7 @@ signals: class KGrEnemy : public KGrFigure { Q_OBJECT + TQ_OBJECT public: KGrEnemy (KGrCanvas *, int , int); virtual ~KGrEnemy(); @@ -169,7 +172,7 @@ public: #ifdef QT3 void setEnemyList(TQPtrList<KGrEnemy> *); #else - void setEnemyList(QList<KGrEnemy> *); + void setEnemyList(TQList<KGrEnemy> *); #endif virtual void init(int,int); static int WALKDELAY; @@ -182,14 +185,14 @@ public: private: KGrCanvas * enemyView; int birthX, birthY; - int searchStatus; + int searchtqStatus; int captiveCounter; TQTimer *captiveTimer; bool canWalkUp(); #ifdef QT3 TQPtrList<KGrEnemy> *enemies; #else - QList<KGrEnemy> *enemies; + TQList<KGrEnemy> *enemies; #endif bool standOnEnemy(); bool bumpingFriend(); diff --git a/kgoldrunner/src/kgrgame.cpp b/kgoldrunner/src/kgrgame.cpp index 985d0783..b83b35ed 100644 --- a/kgoldrunner/src/kgrgame.cpp +++ b/kgoldrunner/src/kgrgame.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2003 by Ian Wadham and Marco Kr�ger * + * Copyright (C) 2003 by Ian Wadham and Marco Kr�ger * * * * This program is free software; you can redistribute it and/or modify * @@ -190,7 +190,7 @@ void KGrGame::goUpOneLevel() KGrMessage::information (view, collection->name, i18n("<b>CONGRATULATIONS !!!!</b>" "<p>You have conquered the last level in the %1 game !!</p>") - .arg("<b>\"" + collection->name + "\"</b>")); + .tqarg("<b>\"" + collection->name + "\"</b>")); checkHighScore(); // Check if there is a high score for this game. unfreeze(); @@ -384,7 +384,7 @@ void KGrGame::startTutorial() KGrMessage::information (view, i18n("Start Tutorial"), i18n("Cannot find the tutorial game (file-prefix %1) in " "the %2 files.") - .arg("'tute'").arg("'games.dat'")); + .tqarg("'tute'").tqarg("'games.dat'")); } } @@ -514,14 +514,14 @@ bool KGrGame::openLevelFile (int levelNo, TQFile & openlevel) KGrMessage::information (view, i18n("Load Level"), i18n("Cannot find file '%1'. Please make sure '%2' has been " "run in the '%3' folder.") - .arg(filePath).arg("tar xf levels.tar").arg(systemDataDir.myStr())); + .tqarg(filePath).tqarg("tar xf levels.tar").tqarg(systemDataDir.myStr())); return (FALSE); } - // �ffne Level zum lesen + // �ffne Level zum lesen if (! openlevel.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Load Level"), - i18n("Cannot open file '%1' for read-only.").arg(filePath)); + i18n("Cannot open file '%1' for read-only.").tqarg(filePath)); return (FALSE); } @@ -741,8 +741,8 @@ void KGrGame::doDig (int button) { startPlaying(); // If first player-input, start playing. } switch (button) { - case LeftButton: hero->digLeft (); break; - case RightButton: hero->digRight (); break; + case Qt::LeftButton: hero->digLeft (); break; + case Qt::RightButton: hero->digRight (); break; default: break; } } @@ -769,7 +769,7 @@ void KGrGame::saveGame() // Save game ID, score and level. { if (editMode) {myMessage (view, i18n("Save Game"), i18n("Sorry, you cannot save your game play while you are editing. " - "Please try menu item %1.").arg("\"" + i18n("&Save Edits...") + "\"")); + "Please try menu item %1.").tqarg("\"" + i18n("&Save Edits...") + "\"")); return; } if (hero->started) {myMessage (view, i18n("Save Game"), @@ -778,7 +778,7 @@ void KGrGame::saveGame() // Save game ID, score and level. "level, not as they are now.")); } - TQDate today = TQDate::currentDate(); + TQDate today = TQDate::tqcurrentDate(); TQTime now = TQTime::currentTime(); TQString saved; TQString day; @@ -800,7 +800,7 @@ void KGrGame::saveGame() // Save game ID, score and level. if (! file2.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Game"), i18n("Cannot open file '%1' for output.") - .arg(userDataDir + "savegame.tmp")); + .tqarg(userDataDir + "savegame.tmp")); return; } TQTextStream text2 (&file2); @@ -810,7 +810,7 @@ void KGrGame::saveGame() // Save game ID, score and level. if (! file1.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Save Game"), i18n("Cannot open file '%1' for read-only.") - .arg(userDataDir + "savegame.dat")); + .tqarg(userDataDir + "savegame.dat")); return; } @@ -848,7 +848,7 @@ void KGrGame::loadGame() // Re-load game, score and level. if (! savedGames.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Load Game"), i18n("Cannot open file '%1' for read-only.") - .arg(userDataDir + "savegame.dat")); + .tqarg(userDataDir + "savegame.dat")); return; } @@ -876,7 +876,7 @@ void KGrGame::loadGame() // Re-load game, score and level. if (! s.isNull()) { pr = s.mid (21, 7); // Get the collection prefix. - pr = pr.left (pr.find (" ", 0, FALSE)); + pr = pr.left (pr.tqfind (" ", 0, FALSE)); for (i = 0; i < imax; i++) { // Find the collection. if (collections.at(i)->prefix == pr) { @@ -899,7 +899,7 @@ void KGrGame::loadGame() // Re-load game, score and level. } else { KGrMessage::information (view, i18n("Load Game"), - i18n("Cannot find the game with prefix '%1'.").arg(pr)); + i18n("Cannot find the game with prefix '%1'.").tqarg(pr)); } } @@ -919,9 +919,9 @@ void KGrGame::loadGame() // Re-load game, score and level. void KGrGame::checkHighScore() { bool prevHigh = TRUE; - Q_INT16 prevLevel = 0; - Q_INT32 prevScore = 0; - QString thisUser = i18n("Unknown"); + TQ_INT16 prevLevel = 0; + TQ_INT32 prevScore = 0; + TQString thisUser = i18n("Unknown"); int highCount = 0; // Don't keep high scores for tutorial games. @@ -947,7 +947,7 @@ void KGrGame::checkHighScore() if (! high1.open (IO_ReadOnly)) { TQString high1_name = high1.name(); KGrMessage::information (view, i18n("Check for High Score"), - i18n("Cannot open file '%1' for read-only.").arg(high1_name)); + i18n("Cannot open file '%1' for read-only.").tqarg(high1_name)); return; } @@ -987,7 +987,7 @@ void KGrGame::checkHighScore() if (! high2.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Check for High Score"), i18n("Cannot open file '%1' for output.") - .arg(userDataDir + "hi_" + collection->prefix + ".tmp")); + .tqarg(userDataDir + "hi_" + collection->prefix + ".tmp")); return; } @@ -1014,7 +1014,7 @@ void KGrGame::checkHighScore() hsn-> setCaption (i18n("Save High Score")); - QPoint p = view->mapToGlobal (TQPoint (0,0)); + TQPoint p = view->mapToGlobal (TQPoint (0,0)); hsn-> move (p.x() + 50, p.y() + 50); OK-> setAccel (Key_Return); @@ -1034,7 +1034,7 @@ void KGrGame::checkHighScore() delete hsn; - TQDate today = TQDate::currentDate(); + TQDate today = TQDate::tqcurrentDate(); TQString hsDate; #ifdef QT3 TQString day = today.shortDayName(today.dayOfWeek()); @@ -1061,11 +1061,11 @@ void KGrGame::checkHighScore() s1 >> prevDate; if ((! scoreRecorded) && (score > prevScore)) { highCount++; - // Recode the user's name as UTF-8, in case it contains - // non-ASCII chars (e.g. "Kr�ger" is encoded as "Krüger"). + // Recode the user's name as UTF-8, in case it tqcontains + // non-ASCII chars (e.g. "Kr�ger" is encoded as "Krüger"). s2 << (const char *) thisUser.utf8(); - s2 << (Q_INT16) level; - s2 << (Q_INT32) score; + s2 << (TQ_INT16) level; + s2 << (TQ_INT32) score; s2 << hsDate.myStr(); scoreRecorded = TRUE; } @@ -1080,21 +1080,21 @@ void KGrGame::checkHighScore() delete prevDate; } if ((! scoreRecorded) && (highCount < 10)) { - // Recode the user's name as UTF-8, in case it contains - // non-ASCII chars (e.g. "Kr�ger" is encoded as "Krüger"). + // Recode the user's name as UTF-8, in case it tqcontains + // non-ASCII chars (e.g. "Kr�ger" is encoded as "Krüger"). s2 << (const char *) thisUser.utf8(); - s2 << (Q_INT16) level; - s2 << (Q_INT32) score; + s2 << (TQ_INT16) level; + s2 << (TQ_INT32) score; s2 << hsDate.myStr(); } high1.close(); } else { - // Recode the user's name as UTF-8, in case it contains - // non-ASCII chars (e.g. "Kr�ger" is encoded as "Krüger"). + // Recode the user's name as UTF-8, in case it tqcontains + // non-ASCII chars (e.g. "Kr�ger" is encoded as "Krüger"). s2 << (const char *) thisUser.utf8(); - s2 << (Q_INT16) level; - s2 << (Q_INT32) score; + s2 << (TQ_INT16) level; + s2 << (TQ_INT32) score; s2 << hsDate.myStr(); } @@ -1119,8 +1119,8 @@ void KGrGame::showHighScores() return; } - Q_INT16 prevLevel = 0; - Q_INT32 prevScore = 0; + TQ_INT16 prevLevel = 0; + TQ_INT32 prevScore = 0; int n = 0; // Look for user's high-score file or for a released high-score file. @@ -1132,7 +1132,7 @@ void KGrGame::showHighScores() if (! high1.exists()) { KGrMessage::information (view, i18n("Show High Scores"), i18n("Sorry, there are no high scores for the %1 game yet.") - .arg("\"" + collection->name + "\"")); + .tqarg("\"" + collection->name + "\"")); return; } } @@ -1140,7 +1140,7 @@ void KGrGame::showHighScores() if (! high1.open (IO_ReadOnly)) { TQString high1_name = high1.name(); KGrMessage::information (view, i18n("Show High Scores"), - i18n("Cannot open file '%1' for read-only.").arg(high1_name)); + i18n("Cannot open file '%1' for read-only.").tqarg(high1_name)); return; } @@ -1154,15 +1154,15 @@ void KGrGame::showHighScores() TQLabel * hsHeader = new TQLabel (i18n ( "<center><h2>KGoldrunner Hall of Fame</h2></center><br>" "<center><h3>\"%1\" Game</h3></center>") - .arg(collection->name), + .tqarg(collection->name), hs); TQLabel * hsColHeader = new TQLabel ( i18n(" Name " "Level Score Date"), hs); #ifdef KGR_PORTABLE - QFont f ("courier", 12); + TQFont f ("courier", 12); #else - QFont f = KGlobalSettings::fixedFont(); // KDE version. + TQFont f = KGlobalSettings::fixedFont(); // KDE version. #endif f. setFixedPitch (TRUE); f. setBold (TRUE); @@ -1183,7 +1183,7 @@ void KGrGame::showHighScores() // Set up the format for the high-score lines. f. setBold (FALSE); - QString line; + TQString line; const char * hsFormat = "%2d. %-30.30s %3d %7ld %s"; // Read and display the users, levels and scores from the high score file. @@ -1199,7 +1199,7 @@ void KGrGame::showHighScores() // 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). + // 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); @@ -1219,7 +1219,7 @@ void KGrGame::showHighScores() OK-> setMaximumWidth (100); mainLayout-> addWidget (buttons); - QPoint p = view->mapToGlobal (TQPoint (0,0)); + TQPoint p = view->mapToGlobal (TQPoint (0,0)); hs-> move (p.x() + 50, p.y() + 50); // Start up the dialog box. @@ -1481,7 +1481,7 @@ void KGrGame::loadEditLevel (int lev) // Retain the original language of the name and hint when editing, // but remove the final \n and convert non-ASCII, UTF-8 substrings - // to Unicode (eg. ü to �). + // to Unicode (eg. ü to �). int len = levelHintC.length(); if (len > 0) levelHint = TQString::fromUtf8((const char *) levelHintC.left(len-1)); @@ -1584,7 +1584,7 @@ bool KGrGame::saveLevelFile() // Open the output file. if (! levelFile.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Level"), - i18n("Cannot open file '%1' for output.").arg(filePath)); + i18n("Cannot open file '%1' for output.").tqarg(filePath)); return (FALSE); } @@ -1596,7 +1596,7 @@ bool KGrGame::saveLevelFile() } levelFile.putch ('\n'); - // Save the level name, changing non-ASCII chars to UTF-8 (eg. � to ü). + // Save the level name, changing non-ASCII chars to UTF-8 (eg. � to ü). TQCString levelNameC = levelName.utf8(); int len1 = levelNameC.length(); if (len1 > 0) { @@ -1605,7 +1605,7 @@ bool KGrGame::saveLevelFile() levelFile.putch ('\n'); // Add a newline. } - // Save the level hint, changing non-ASCII chars to UTF-8 (eg. � to ü). + // Save the level hint, changing non-ASCII chars to UTF-8 (eg. � to ü). TQCString levelHintC = levelHint.utf8(); int len2 = levelHintC.length(); char ch = '\0'; @@ -1642,8 +1642,8 @@ void KGrGame::moveLevelFile () KGrMessage::information (view, i18n("Move Level"), i18n("You must first load a level to be moved. Use " "the %1 or %2 menu.") - .arg("\"" + i18n("Game") + "\"") - .arg("\"" + i18n("Editor") + "\"")); + .tqarg("\"" + i18n("Game") + "\"") + .tqarg("\"" + i18n("Editor") + "\"")); return; } @@ -1780,7 +1780,7 @@ void KGrGame::deleteLevelFile () } else { KGrMessage::information (view, i18n("Delete Level"), - i18n("Cannot find file '%1' to be deleted.").arg(filePath)); + i18n("Cannot find file '%1' to be deleted.").tqarg(filePath)); return; } @@ -1883,7 +1883,7 @@ void KGrGame::editCollection (int action) if (duplicatePrefix) { KGrMessage::information (view, i18n("Save Game Info"), i18n("The filename prefix '%1' is already in use.") - .arg(ecPrefix)); + .tqarg(ecPrefix)); continue; } } @@ -1919,7 +1919,7 @@ bool KGrGame::saveOK (bool exiting) { int i, j; bool result; - QString option2 = i18n("&Go on editing"); + TQString option2 = i18n("&Go on editing"); result = TRUE; @@ -2061,7 +2061,7 @@ bool KGrGame::reNumberLevels (int cIndex, int first, int last, int inc) if (! dir.rename (file1, file2, TRUE)) { // Allow absolute paths. KGrMessage::information (view, i18n("Save Level"), i18n("Cannot rename file '%1' to '%2'.") - .arg(file1).arg(file2)); + .tqarg(file1).tqarg(file2)); return (FALSE); } i = i + step; @@ -2090,8 +2090,8 @@ void KGrGame::doEdit (int button) i = p.x(); j = p.y(); switch (button) { - case LeftButton: - case RightButton: + case Qt::LeftButton: + case Qt::RightButton: paintEditObj = TRUE; insertEditObj (i, j); view->updateCanvas(); @@ -2113,8 +2113,8 @@ void KGrGame::endEdit (int button) i = p.x(); j = p.y(); switch (button) { - case LeftButton: - case RightButton: + case Qt::LeftButton: + case Qt::RightButton: paintEditObj = FALSE; if ((i != oldI) || (j != oldJ)) { insertEditObj (i, j); @@ -2181,8 +2181,8 @@ int KGrGame::selectLevel (int action, int requestedLevel) KGrMessage::information (view, i18n("Select Level"), i18n("There is no level %1 in %2, " "so you cannot play or edit it.") - .arg(selectedLevel) - .arg("\"" + collections.at(selectedGame)->name + "\"")); + .tqarg(selectedLevel) + .tqarg("\"" + collections.at(selectedGame)->name + "\"")); selectedLevel = 0; // Set an invalid selection. continue; // Re-run the dialog box. } @@ -2226,10 +2226,10 @@ bool KGrGame::ownerOK (Owner o) /********************** CLASS TO DISPLAY THUMBNAIL ***********************/ /******************************************************************************/ -KGrThumbNail::KGrThumbNail (TQWidget * parent, const char * name) - : TQFrame (parent, name) +KGrThumbNail::KGrThumbNail (TQWidget * tqparent, const char * name) + : TQFrame (tqparent, name) { - // Let the parent do all the work. We need a class here so that + // Let the tqparent do all the work. We need a class here so that // TQFrame::drawContents (TQPainter *) can be re-implemented and // the thumbnail can be automatically re-painted when required. } @@ -2247,8 +2247,8 @@ void KGrThumbNail::setFilePath (TQString & fp, TQLabel * sln) void KGrThumbNail::drawContents (TQPainter * p) // Activated via "paintEvent". { - QFile openFile; - QPen pen = p->pen(); + TQFile openFile; + TQPen pen = p->pen(); char obj = FREE; int fw = 1; // Set frame width. int n = width() / FIELDWIDTH; // Set thumbnail cell-size. @@ -2330,7 +2330,7 @@ void KGrThumbNail::drawContents (TQPainter * p) // Activated via "paintEvent". /******************************************************************************/ // NOTE: Macros "myStr" and "myChar", defined in "kgrgame.h", are used -// to smooth out differences between Qt 1 and Qt2 TQString classes. +// to smooth out differences between TQt 1 and TQt2 TQString classes. bool KGrGame::initCollections () { @@ -2354,11 +2354,11 @@ bool KGrGame::initCollections () void KGrGame::mapCollections() { - QDir d; + TQDir d; KGrCollection * colln; - QString d_path; - QString fileName1; - QString fileName2; + TQString d_path; + TQString fileName1; + TQString fileName2; // Find KGoldrunner level files, sorted by name (same as numerical order). for (colln = collections.first(); colln != 0; colln = collections.next()) { @@ -2372,25 +2372,25 @@ void KGrGame::mapCollections() i18n("There is no folder '%1' to hold levels for" " the '%2' game. Please make sure '%3' " "has been run in the '%4' folder.") - .arg(d_path) - .arg(colln->name) - .arg("tar xf levels.tar") - .arg(systemDataDir)); + .tqarg(d_path) + .tqarg(colln->name) + .tqarg("tar xf levels.tar") + .tqarg(systemDataDir)); } continue; } - const QFileInfoList * files = d.entryInfoList + const TQFileInfoList * files = d.entryInfoList (colln->prefix + "???.grl", TQDir::Files, TQDir::Name); - QFileInfoListIterator i (* files); + TQFileInfoListIterator i (* files); TQFileInfo * file; if ((files->count() <= 0) && (colln->nLevels > 0)) { KGrMessage::information (view, i18n("Check Games & Levels"), i18n("There are no files '%1/%2???.grl' for the %3 game.") - .arg(d_path) - .arg(colln->prefix) - .arg("\"" + colln->name + "\"")); + .tqarg(d_path) + .tqarg(colln->prefix) + .tqarg("\"" + colln->name + "\"")); continue; } @@ -2413,8 +2413,8 @@ void KGrGame::mapCollections() i18n("Check Games & Levels"), i18n("File '%1' is beyond the highest level for " "the %2 game and cannot be played.") - .arg(fileName1) - .arg("\"" + colln->name + "\"")); + .tqarg(fileName1) + .tqarg("\"" + colln->name + "\"")); break; } else if (fileName1 == fileName2) { @@ -2426,16 +2426,16 @@ void KGrGame::mapCollections() i18n("Check Games & Levels"), i18n("File '%1' is before the lowest level for " "the %2 game and cannot be played.") - .arg(fileName1) - .arg("\"" + colln->name + "\"")); + .tqarg(fileName1) + .tqarg("\"" + colln->name + "\"")); break; } else { KGrMessage::information (view, i18n("Check Games & Levels"), i18n("Cannot find file '%1' for the %2 game.") - .arg(fileName2) - .arg("\"" + colln->name + "\"")); + .tqarg(fileName2) + .tqarg("\"" + colln->name + "\"")); lev++; } } @@ -2446,7 +2446,7 @@ void KGrGame::mapCollections() bool KGrGame::loadCollections (Owner o) { - QString filePath; + TQString filePath; filePath = ((o == SYSTEM)? systemDataDir : userDataDir) + "games.dat"; @@ -2457,20 +2457,20 @@ bool KGrGame::loadCollections (Owner o) if (o == SYSTEM) { KGrMessage::information (view, i18n("Load Game Info"), i18n("Cannot find game info file '%1'.") - .arg(filePath)); + .tqarg(filePath)); } return (FALSE); } if (! c.open (IO_ReadOnly)) { KGrMessage::information (view, i18n("Load Game Info"), - i18n("Cannot open file '%1' for read-only.").arg(filePath)); + i18n("Cannot open file '%1' for read-only.").tqarg(filePath)); return (FALSE); } - QCString line = ""; - QCString name = ""; - QString prefix = ""; + TQCString line = ""; + TQCString name = ""; + TQString prefix = ""; char settings = ' '; int nLevels = -1; @@ -2496,9 +2496,9 @@ bool KGrGame::loadCollections (Owner o) line = line.simplifyWhiteSpace(); int i, j, len; len = line.length(); - i = 0; j = line.find(' ',i); nLevels = line.left(j).toInt(); - i = j+1; j = line.find(' ',i); settings = line[i]; - i = j+1; j = line.find(' ',i); prefix = line.mid(i,j-i); + i = 0; j = line.tqfind(' ',i); nLevels = line.left(j).toInt(); + i = j+1; j = line.tqfind(' ',i); settings = line[i]; + i = j+1; j = line.tqfind(' ',i); prefix = line.mid(i,j-i); i = j+1; name = line.right(len-i); } // If first character is not a digit, the line should be an "about". @@ -2513,7 +2513,7 @@ bool KGrGame::loadCollections (Owner o) // Not EOF: it's an empty line or out-of-context "about" line. KGrMessage::information (view, i18n("Load Game Info"), i18n("Format error in game info file '%1'.") - .arg(filePath)); + .tqarg(filePath)); c.close(); return (FALSE); } @@ -2527,7 +2527,7 @@ bool KGrGame::loadCollections (Owner o) bool KGrGame::saveCollections (Owner o) { - QString filePath; + TQString filePath; if (o != USER) { KGrMessage::information (view, i18n("Save Game Info"), @@ -2542,13 +2542,13 @@ bool KGrGame::saveCollections (Owner o) // Open the output file. if (! c.open (IO_WriteOnly)) { KGrMessage::information (view, i18n("Save Game Info"), - i18n("Cannot open file '%1' for output.").arg(filePath)); + i18n("Cannot open file '%1' for output.").tqarg(filePath)); return (FALSE); } // Save the collections. KGrCollection * colln; - QCString line; + TQCString line; int i, len; char ch; @@ -2588,12 +2588,12 @@ bool KGrGame::saveCollections (Owner o) /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ -void KGrGame::myMessage (TQWidget * parent, TQString title, TQString contents) +void KGrGame::myMessage (TQWidget * tqparent, TQString title, TQString contents) { // Halt the game while the message is displayed. setMessageFreeze (TRUE); - KGrMessage::wrapped (parent, title, contents); + KGrMessage::wrapped (tqparent, title, contents); // Unfreeze the game, but only if it was previously unfrozen. setMessageFreeze (FALSE); diff --git a/kgoldrunner/src/kgrgame.h b/kgoldrunner/src/kgrgame.h index 18003e3c..5637329c 100644 --- a/kgoldrunner/src/kgrgame.h +++ b/kgoldrunner/src/kgrgame.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2003 by Ian Wadham and Marco Kr�ger * + * Copyright (C) 2003 by Ian Wadham and Marco Kr�ger * * * * This program is free software; you can redistribute it and/or modify * @@ -10,14 +10,14 @@ #ifndef KGRGAME_H #define KGRGAME_H -// Macros to smooth out the differences between Qt 1 and Qt 2 classes. +// Macros to smooth out the differences between TQt 1 and TQt 2 classes. // // "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 myChar(i) tqat((i)).latin1() #define endData atEnd #include <tqobject.h> @@ -47,9 +47,10 @@ class KGrHero; class KGrEnemy; class KGrCollection; -class KGrGame : public QObject +class KGrGame : public TQObject { Q_OBJECT + TQ_OBJECT public: KGrGame (KGrCanvas * theView, TQString theSystemDir, TQString theUserDir); ~KGrGame(); @@ -67,7 +68,7 @@ public: bool saveOK (bool exiting); // Check if edits were saved. - QString getTitle(); // Collection - Level NNN, Name. + TQString getTitle(); // Collection - Level NNN, Name. void setEditObj (char newEditObj); // Set object for editor to paint. @@ -136,16 +137,16 @@ private: private: KGrCanvas * view; // Where the game is displayed. - QString systemDataDir; // System games are stored here. - QString userDataDir; // User games are stored here. + TQString systemDataDir; // System games are stored here. + TQString userDataDir; // User games are stored here. KGrObject * playfield[30][22]; // Array of playfield objects. char editObjArray[30][22]; // Character-code equivalent. char lastSaveArray[30][22]; // Copy for use in "saveOK()". int level; // Current play/edit level. - QString levelName; // Level name (optional). - QString levelHint; // Level hint (optional). + TQString levelName; // Level name (optional). + TQString levelHint; // Level hint (optional). long lives; // Lives remaining. long score; // Current score. @@ -157,7 +158,7 @@ private: #ifdef QT3 TQPtrList<KGrEnemy> enemies; // The list of enemies. #else - QList<KGrEnemy> enemies; // The list of enemies. + TQList<KGrEnemy> enemies; // The list of enemies. #endif int enemyCount; // How many enemies. KGrEnemy * enemy; // One of the enemies. @@ -229,7 +230,7 @@ private: bool reNumberLevels (int, int, int, int); bool ownerOK (Owner o); - // Pixmaps for repainting objects as they are edited. + // Pixmaps for tqrepainting objects as they are edited. TQPixmap digpix[10]; TQPixmap brickbg, fbrickbg; TQPixmap freebg, nuggetbg, polebg, betonbg, ladderbg, hladderbg; @@ -249,7 +250,7 @@ private: #ifdef QT3 TQPtrList<KGrCollection> collections; // List of ALL collections. #else - QList<KGrCollection> collections; // List of ALL collections. + TQList<KGrCollection> collections; // List of ALL collections. #endif KGrCollection * collection; // Collection currently in use. @@ -264,17 +265,17 @@ private: /********************** WORD-WRAPPED MESSAGE BOX ************************/ /******************************************************************************/ - void myMessage (TQWidget * parent, TQString title, TQString contents); + void myMessage (TQWidget * tqparent, TQString title, TQString contents); }; /******************************************************************************/ /********************** CLASS TO DISPLAY THUMBNAIL ***********************/ /******************************************************************************/ -class KGrThumbNail : public QFrame +class KGrThumbNail : public TQFrame { public: - KGrThumbNail (TQWidget *parent = 0, const char *name = 0); + KGrThumbNail (TQWidget *tqparent = 0, const char *name = 0); void setFilePath (TQString &, TQLabel *); // Set filepath and name field. static TQColor backgroundColor; @@ -299,11 +300,11 @@ public: 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. + TQString name; // Collection name. + TQString prefix; // Collection's filename prefix. char settings; // Collection rules: KGoldrunner or Traditional. int nLevels; // Number of levels in the collection. - QString about; // Optional text about the collection. + TQString about; // Optional text about the collection. }; #endif diff --git a/kgoldrunner/src/kgrobject.h b/kgoldrunner/src/kgrobject.h index cc262d0d..e7445873 100644 --- a/kgoldrunner/src/kgrobject.h +++ b/kgoldrunner/src/kgrobject.h @@ -26,9 +26,10 @@ class KGrCanvas; -class KGrObject : public QObject +class KGrObject : public TQObject { Q_OBJECT + TQ_OBJECT public: KGrObject (char objType); virtual ~KGrObject(); @@ -53,6 +54,7 @@ protected: class KGrEditable : public KGrObject { Q_OBJECT + TQ_OBJECT public: KGrEditable (char editType); virtual ~KGrEditable (); @@ -61,6 +63,7 @@ public: class KGrFree : public KGrObject { Q_OBJECT + TQ_OBJECT public: KGrFree (char objType, int i, int j, KGrCanvas * view); virtual ~KGrFree(); @@ -73,6 +76,7 @@ protected: class KGrBrick : public KGrObject { Q_OBJECT + TQ_OBJECT public: KGrBrick (char objType, int i, int j, KGrCanvas * view); virtual ~KGrBrick(); @@ -97,6 +101,7 @@ private: class KGrHladder : public KGrFree { Q_OBJECT + TQ_OBJECT public: // BUG FIX - Ian W., 21/6/01 - must inherit "setNugget()" from "KGrFree". KGrHladder (char objType, int i, int j, KGrCanvas * view); |