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 /kbounce | |
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 'kbounce')
-rw-r--r-- | kbounce/game.cpp | 84 | ||||
-rw-r--r-- | kbounce/game.h | 42 | ||||
-rw-r--r-- | kbounce/kbounce.cpp | 106 | ||||
-rw-r--r-- | kbounce/kbounce.h | 30 | ||||
-rw-r--r-- | kbounce/main.cpp | 2 |
5 files changed, 132 insertions, 132 deletions
diff --git a/kbounce/game.cpp b/kbounce/game.cpp index 853a645d..0c5f1e2d 100644 --- a/kbounce/game.cpp +++ b/kbounce/game.cpp @@ -18,11 +18,11 @@ #include <stdlib.h> -#include <qtimer.h> +#include <tqtimer.h> #include <kstandarddirs.h> #include <kapplication.h> #include <kdebug.h> -#include <qimage.h> +#include <tqimage.h> #include <kglobalsettings.h> #include "game.h" @@ -47,13 +47,13 @@ #if HAVE_ARTS SimpleSoundServer *JezzGame::m_artsServer = 0; #endif -QString JezzGame::m_soundPath; +TQString JezzGame::m_soundPath; bool JezzGame::m_sound = true; #define MS2TICKS( ms ) ((ms)/GAME_DELAY) -Ball::Ball(QCanvasPixmapArray* array, QCanvas* canvas) - : QCanvasSprite( array, canvas ), m_animDelay( 0 ), m_soundDelay( MS2TICKS(BALL_ANIM_DELAY)/2 ) +Ball::Ball(TQCanvasPixmapArray* array, TQCanvas* canvas) + : TQCanvasSprite( array, canvas ), m_animDelay( 0 ), m_soundDelay( MS2TICKS(BALL_ANIM_DELAY)/2 ) { } @@ -90,7 +90,7 @@ void Ball::advance(int stage) if ( !reflectX && !reflectY && collide(xVelocity(), yVelocity()) ) reflectX = reflectY = true; // emit collision - QRect r = boundingRect(); + TQRect r = boundingRect(); r.moveBy( xVelocity(), yVelocity() ); JezzField* field = (JezzField *)canvas(); @@ -117,12 +117,12 @@ void Ball::advance(int stage) // update field update(); - QCanvasSprite::advance( stage ); + TQCanvasSprite::advance( stage ); } bool Ball::collide( double dx, double dy ) { - QRect r = boundingRect(); + TQRect r = boundingRect(); r.moveBy( dx, dy ); JezzField* field = (JezzField *)canvas(); @@ -136,8 +136,8 @@ bool Ball::collide( double dx, double dy ) /*************************************************************************/ -Wall::Wall( JezzField *field, int x, int y, Direction dir, int tile, QObject *parent, const char *name ) - : QObject( parent, name ), m_dir( dir ), m_field( field ), m_startX( x ), m_startY( y ), +Wall::Wall( JezzField *field, int x, int y, Direction dir, int tile, TQObject *parent, const char *name ) + : TQObject( parent, name ), m_dir( dir ), m_field( field ), m_startX( x ), m_startY( y ), m_tile( tile ), m_delay( MS2TICKS(WALL_DELAY)/2 ), m_active( true ) { //kdDebug(12008) << "Wall::Wall" << endl; @@ -169,7 +169,7 @@ bool Wall::isFree( int x, int y ) if ( m_field->tile(x, y)==TILE_FREE ) { // check whether there is a ball at the moment - QCanvasItemList cols = m_field->collisions( QRect(x*TILE_SIZE, y*TILE_SIZE, + TQCanvasItemList cols = m_field->collisions( TQRect(x*TILE_SIZE, y*TILE_SIZE, TILE_SIZE, TILE_SIZE) ); if ( cols.count()==0 ) return true; @@ -236,8 +236,8 @@ void Wall::fill( bool black ) /*************************************************************************/ -JezzField::JezzField( const QPixmap &tiles, const QPixmap &background, QObject* parent, const char* name ) - : QCanvas( parent, name ), m_tiles( tiles ) +JezzField::JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* parent, const char* name ) + : TQCanvas( parent, name ), m_tiles( tiles ) { setPixmaps( tiles, background ); } @@ -250,7 +250,7 @@ void JezzField::setGameTile( int x, int y, bool black ) setTile( x, y, black ? TILE_BORDER : TILE_FREE ); } -void JezzField::setBackground( const QPixmap &background ) +void JezzField::setBackground( const TQPixmap &background ) { // copy current field into buffer int backup[FIELD_WIDTH][FIELD_HEIGHT]; @@ -287,18 +287,18 @@ void JezzField::setBackground( const QPixmap &background ) setTile( x, FIELD_HEIGHT-1, TILE_BORDER ); } -void JezzField::setPixmaps( const QPixmap &tiles, const QPixmap &background ) +void JezzField::setPixmaps( const TQPixmap &tiles, const TQPixmap &background ) { // create new tiles - QPixmap allTiles( TILE_SIZE*(FIELD_WIDTH-2), TILE_SIZE*(FIELD_HEIGHT-1) ); + TQPixmap allTiles( TILE_SIZE*(FIELD_WIDTH-2), TILE_SIZE*(FIELD_HEIGHT-1) ); if ( background.width()==0 || background.height()==0 ) { m_background = false; } else { // handle background m_background = true; - QImage img = background.convertToImage(); - QPixmap scalledBackground( img.smoothScale( TILE_SIZE*(FIELD_WIDTH-2), + TQImage img = background.convertToImage(); + TQPixmap scalledBackground( img.smoothScale( TILE_SIZE*(FIELD_WIDTH-2), TILE_SIZE*(FIELD_HEIGHT-2) ) ); bitBlt( &allTiles, 0, 0, &scalledBackground, 0, 0, scalledBackground.width(), scalledBackground.height() ); } @@ -314,8 +314,8 @@ void JezzField::setPixmaps( const QPixmap &tiles, const QPixmap &background ) /*************************************************************************/ -JezzView::JezzView(QCanvas* viewing, QWidget* parent, const char* name, WFlags f) - : QCanvasView( viewing, parent, name, f ), m_vertical( false ) +JezzView::JezzView(TQCanvas* viewing, TQWidget* parent, const char* name, WFlags f) + : TQCanvasView( viewing, parent, name, f ), m_vertical( false ) { setResizePolicy( AutoOne ); setHScrollBarMode( AlwaysOff ); @@ -324,7 +324,7 @@ JezzView::JezzView(QCanvas* viewing, QWidget* parent, const char* name, WFlags f setCursor( sizeHorCursor ); } -void JezzView::viewportMouseReleaseEvent( QMouseEvent *ev ) +void JezzView::viewportMouseReleaseEvent( TQMouseEvent *ev ) { if ( ev->button() & RightButton ) { @@ -340,17 +340,17 @@ void JezzView::viewportMouseReleaseEvent( QMouseEvent *ev ) /*************************************************************************/ -JezzGame::JezzGame( const QPixmap &background, int ballNum, QWidget *parent, const char *name ) - : QWidget( parent, name ), m_wall1( 0 ), m_wall2( 0 ), +JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent, const char *name ) + : TQWidget( parent, name ), m_wall1( 0 ), m_wall2( 0 ), m_text( 0 ), m_running( false ), m_percent( 0 ), m_pictured( false ) { - QString path = kapp->dirs()->findResourceDir( "data", "kbounce/pics/ball0000.png" ) + "kbounce/pics/"; + TQString path = kapp->dirs()->findResourceDir( "data", "kbounce/pics/ball0000.png" ) + "kbounce/pics/"; // load gfx - m_ballPixmaps = new QCanvasPixmapArray( path + "ball%1.png", 25 ); + m_ballPixmaps = new TQCanvasPixmapArray( path + "ball%1.png", 25 ); for ( unsigned n=0; n<m_ballPixmaps->count(); n++ ) m_ballPixmaps->image(n)->setOffset( 0, 0 ); - QPixmap tiles( path + "tiles.png" ); + TQPixmap tiles( path + "tiles.png" ); // setup arts #if HAVE_ARTS @@ -378,13 +378,13 @@ JezzGame::JezzGame( const QPixmap &background, int ballNum, QWidget *parent, con for ( int x=0; x<FIELD_WIDTH; x++ ) m_field->setTile( x, FIELD_HEIGHT-1, TILE_BORDER ); - connect( m_field, SIGNAL(ballCollision(Ball *, int, int, int)), this, SLOT(ballCollision(Ball *, int, int, int)) ); + connect( m_field, TQT_SIGNAL(ballCollision(Ball *, int, int, int)), this, TQT_SLOT(ballCollision(Ball *, int, int, int)) ); // create view m_view = new JezzView( m_field, this, "m_view" ); m_view->move( 0, 0 ); m_view->adjustSize(); - connect( m_view, SIGNAL(buildWall(int, int, bool)), this, SLOT(buildWall(int, int, bool)) ); + connect( m_view, TQT_SIGNAL(buildWall(int, int, bool)), this, TQT_SLOT(buildWall(int, int, bool)) ); // create balls for ( int n=0; n<ballNum; n++ ) @@ -399,11 +399,11 @@ JezzGame::JezzGame( const QPixmap &background, int ballNum, QWidget *parent, con } // create text label - m_text = new QCanvasText( m_field ); + m_text = new TQCanvasText( m_field ); // create game clock - m_clock = new QTimer( this ); - connect( m_clock, SIGNAL(timeout()), this, SLOT(tick()) ); + m_clock = new TQTimer( this ); + connect( m_clock, TQT_SIGNAL(timeout()), this, TQT_SLOT(tick()) ); m_clock->start( GAME_DELAY ); // setup geometry @@ -422,20 +422,20 @@ JezzGame::~JezzGame() } -void JezzGame::display( const QString &text, int size ) +void JezzGame::display( const TQString &text, int size ) { qDebug("This function \"display\" shouldn't be called!!!"); if ( !text.isEmpty() ) { //kdDebug(12008) << "text = " << text << endl; - QFont font = KGlobalSettings::generalFont(); + TQFont font = KGlobalSettings::generalFont(); font.setBold(true); font.setPointSize(size); m_text->setFont( font ); m_text->setText( text ); - QRect size = m_text->boundingRect(); + TQRect size = m_text->boundingRect(); m_text->move( ( FIELD_WIDTH*TILE_SIZE - size.width() ) / 2, ( FIELD_HEIGHT*TILE_SIZE - size.height() ) / 2 ); @@ -446,12 +446,12 @@ void JezzGame::display( const QString &text, int size ) } } -void JezzGame::playSound( const QString &name ) +void JezzGame::playSound( const TQString &name ) { #if HAVE_ARTS if( !m_artsServer->isNull() && m_sound) { - QString path = m_soundPath + name; + TQString path = m_soundPath + name; m_artsServer->play( path.latin1() ); } #else @@ -459,7 +459,7 @@ void JezzGame::playSound( const QString &name ) #endif } -void JezzGame::setBackground( const QPixmap &background ) +void JezzGame::setBackground( const TQPixmap &background ) { m_field->setBackground( background ); } @@ -603,7 +603,7 @@ void JezzGame::buildWall( int x, int y, bool vertical ) playSound( "wallstart.au" ); // check whether there is a ball at the moment - QCanvasItemList cols = m_field->collisions( QRect(x*TILE_SIZE, y*TILE_SIZE, TILE_SIZE, TILE_SIZE) ); + TQCanvasItemList cols = m_field->collisions( TQRect(x*TILE_SIZE, y*TILE_SIZE, TILE_SIZE, TILE_SIZE) ); if ( cols.count()>0 ) { kdDebug(12008) << "Direct collision" << endl; @@ -618,8 +618,8 @@ void JezzGame::buildWall( int x, int y, bool vertical ) vertical? Wall::Up : Wall::Left, vertical? TILE_WALLUP : TILE_WALLLEFT, this, "m_wall1" ); - connect( m_wall1, SIGNAL(finished(Wall *, int)), - this, SLOT(wallFinished(Wall *, int)) ); } + connect( m_wall1, TQT_SIGNAL(finished(Wall *, int)), + this, TQT_SLOT(wallFinished(Wall *, int)) ); } if ( !m_wall2 ) { @@ -627,8 +627,8 @@ void JezzGame::buildWall( int x, int y, bool vertical ) vertical? Wall::Down: Wall::Right, vertical? TILE_WALLDOWN : TILE_WALLRIGHT, this, "m_wall2" ); - connect( m_wall2, SIGNAL(finished(Wall *, int)), - this, SLOT(wallFinished(Wall *, int)) ); + connect( m_wall2, TQT_SIGNAL(finished(Wall *, int)), + this, TQT_SLOT(wallFinished(Wall *, int)) ); } } } diff --git a/kbounce/game.h b/kbounce/game.h index eb5208cd..b7ebe769 100644 --- a/kbounce/game.h +++ b/kbounce/game.h @@ -19,9 +19,9 @@ #ifndef GAME_H_INCLUDED #define GAME_H_INCLUDED -#include <qwidget.h> -#include <qcanvas.h> -#include <qmemarray.h> +#include <tqwidget.h> +#include <tqcanvas.h> +#include <tqmemarray.h> #if HAVE_ARTS #include <arts/soundserver.h> @@ -38,7 +38,7 @@ class JezzField; class Ball : public QCanvasSprite { public: - Ball(QCanvasPixmapArray* array, QCanvas* canvas); + Ball(TQCanvasPixmapArray* array, TQCanvas* canvas); void update(); void advance(int stage); @@ -57,7 +57,7 @@ public: enum Direction { Up, Down, Left, Right }; Wall( JezzField *field, int x, int y, Direction dir, int tile, - QObject *parent=0, const char *name=0 ); + TQObject *parent=0, const char *name=0 ); void finish(); void fill( bool black ); @@ -87,10 +87,10 @@ class JezzField : public QCanvas { Q_OBJECT public: - JezzField( const QPixmap &tiles, const QPixmap &background, QObject* parent = 0, const char* name = 0 ); + JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* parent = 0, const char* name = 0 ); void setGameTile( int x, int y, bool black ); - void setBackground( const QPixmap &background ); + void setBackground( const TQPixmap &background ); signals: void ballCollision( Ball *ball, int x, int y, int tile ); @@ -98,10 +98,10 @@ signals: private: friend class Ball; bool m_background; - QPixmap m_tiles; - QMemArray<QPixmap> m_backTiles; + TQPixmap m_tiles; + TQMemArray<TQPixmap> m_backTiles; - void setPixmaps( const QPixmap &tiles, const QPixmap &background ); + void setPixmaps( const TQPixmap &tiles, const TQPixmap &background ); void emitBallCollisiton( Ball *ball, int x, int y, int tile ) { emit ballCollision( ball, x, y, tile ); } @@ -112,13 +112,13 @@ class JezzView : public QCanvasView { Q_OBJECT public: - JezzView(QCanvas* viewing=0, QWidget* parent=0, const char* name=0, WFlags f=0); + JezzView(TQCanvas* viewing=0, TQWidget* parent=0, const char* name=0, WFlags f=0); signals: void buildWall( int x, int y, bool vertical ); protected: - void viewportMouseReleaseEvent( QMouseEvent * ); + void viewportMouseReleaseEvent( TQMouseEvent * ); private: bool m_vertical; @@ -130,13 +130,13 @@ class JezzGame : public QWidget Q_OBJECT public: - JezzGame( const QPixmap &background, int ballNum, QWidget *parent=0, const char *name=0 ); + JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent=0, const char *name=0 ); ~JezzGame(); int percent(); - static void playSound( const QString &name ); - void display( const QString &text, int size=20 ); - void setBackground( const QPixmap &background ); + static void playSound( const TQString &name ); + void display( const TQString &text, int size=20 ); + void setBackground( const TQPixmap &background ); signals: void died(); @@ -164,11 +164,11 @@ protected: Wall *m_wall1, *m_wall2; - QPtrList<Ball> m_balls; - QCanvasPixmapArray *m_ballPixmaps; - QCanvasText *m_text; + TQPtrList<Ball> m_balls; + TQCanvasPixmapArray *m_ballPixmaps; + TQCanvasText *m_text; - QTimer *m_clock; + TQTimer *m_clock; bool m_running; int m_percent; bool m_pictured; @@ -176,7 +176,7 @@ protected: #if HAVE_ARTS static SimpleSoundServer *m_artsServer; #endif - static QString m_soundPath; + static TQString m_soundPath; static bool m_sound; }; diff --git a/kbounce/kbounce.cpp b/kbounce/kbounce.cpp index eab691b8..65fcaae9 100644 --- a/kbounce/kbounce.cpp +++ b/kbounce/kbounce.cpp @@ -16,13 +16,13 @@ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qlayout.h> +#include <tqlayout.h> #include <klocale.h> #include <kapplication.h> #include <kaction.h> #include <kstdgameaction.h> -#include <qtimer.h> -#include <qlcdnumber.h> +#include <tqtimer.h> +#include <tqlcdnumber.h> #include <kmessagebox.h> #include <kdebug.h> #include <kfiledialog.h> @@ -51,51 +51,51 @@ KJezzball::KJezzball() m_soundAction -> setChecked((config->readBoolEntry( "PlaySounds", true ))); // create widgets - m_view = new QWidget( this, "m_view" ); + m_view = new TQWidget( this, "m_view" ); setCentralWidget( m_view ); - m_layout = new QGridLayout( m_view, 1, 3 ); + m_layout = new TQGridLayout( m_view, 1, 3 ); m_layout->setColStretch( 2, 1 ); - QVBoxLayout *infoLayout = new QVBoxLayout; + TQVBoxLayout *infoLayout = new QVBoxLayout; m_layout->addLayout( infoLayout, 0, 1 ); - QLabel *label = new QLabel( i18n("Level:"), m_view ); + TQLabel *label = new TQLabel( i18n("Level:"), m_view ); infoLayout->addWidget( label ); - m_levelLCD = new QLCDNumber( 5, m_view ); + m_levelLCD = new TQLCDNumber( 5, m_view ); infoLayout->addWidget( m_levelLCD ); - label = new QLabel( i18n("Score:"), m_view ); + label = new TQLabel( i18n("Score:"), m_view ); infoLayout->addWidget( label ); - m_scoreLCD = new QLCDNumber( 5, m_view ); + m_scoreLCD = new TQLCDNumber( 5, m_view ); infoLayout->addWidget( m_scoreLCD ); infoLayout->addSpacing( 20 ); - label = new QLabel( i18n("Filled area:"), m_view ); + label = new TQLabel( i18n("Filled area:"), m_view ); infoLayout->addWidget( label ); - m_percentLCD = new QLCDNumber( 5, m_view ); + m_percentLCD = new TQLCDNumber( 5, m_view ); infoLayout->addWidget( m_percentLCD ); - label = new QLabel( i18n("Lives:"), m_view ); + label = new TQLabel( i18n("Lives:"), m_view ); infoLayout->addWidget( label ); - m_lifesLCD = new QLCDNumber( 5, m_view ); + m_lifesLCD = new TQLCDNumber( 5, m_view ); infoLayout->addWidget( m_lifesLCD ); - label = new QLabel( i18n("Time:"), m_view ); + label = new TQLabel( i18n("Time:"), m_view ); infoLayout->addWidget( label ); - m_timeLCD = new QLCDNumber( 5, m_view ); + m_timeLCD = new TQLCDNumber( 5, m_view ); infoLayout->addWidget( m_timeLCD ); // create timers - m_nextLevelTimer = new QTimer( this, "m_nextLevelTimer" ); - connect( m_nextLevelTimer, SIGNAL(timeout()), this, SLOT(switchLevel()) ); + m_nextLevelTimer = new TQTimer( this, "m_nextLevelTimer" ); + connect( m_nextLevelTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(switchLevel()) ); - m_gameOverTimer = new QTimer( this, "m_gameOverTimer" ); - connect( m_gameOverTimer, SIGNAL(timeout()), this, SLOT(gameOverNow()) ); + m_gameOverTimer = new TQTimer( this, "m_gameOverTimer" ); + connect( m_gameOverTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(gameOverNow()) ); - m_timer = new QTimer( this, "m_timer" ); - connect( m_timer, SIGNAL(timeout()), this, SLOT(second()) ); + m_timer = new TQTimer( this, "m_timer" ); + connect( m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(second()) ); // create demo game createLevel( 1 ); @@ -103,7 +103,7 @@ KJezzball::KJezzball() .arg(m_newAction->shortcut().toString()) ); //m_gameWidget->display( i18n("Press <Space> to start a game!") ); - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); setFocus(); setupGUI(); } @@ -119,23 +119,23 @@ KJezzball::~KJezzball() */ void KJezzball::initXMLUI() { - m_newAction = KStdGameAction::gameNew( this, SLOT(newGame()), actionCollection() ); + m_newAction = KStdGameAction::gameNew( this, TQT_SLOT(newGame()), actionCollection() ); // AB: originally KBounce/KJezzball used Space for new game - but Ctrl+N is // default. We solve this by providing space as an alternative key KShortcut s = m_newAction->shortcut(); - s.append(KKeySequence(QKeySequence(Key_Space))); + s.append(KKeySequence(TQKeySequence(Key_Space))); m_newAction->setShortcut(s); - KStdGameAction::quit(this, SLOT(close()), actionCollection() ); - KStdGameAction::highscores(this, SLOT(showHighscore()), actionCollection() ); - m_pauseButton = KStdGameAction::pause(this, SLOT(pauseGame()), actionCollection()); - KStdGameAction::end(this, SLOT(closeGame()), actionCollection()); - KStdGameAction::configureHighscores(this, SLOT(configureHighscores()),actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection() ); + KStdGameAction::highscores(this, TQT_SLOT(showHighscore()), actionCollection() ); + m_pauseButton = KStdGameAction::pause(this, TQT_SLOT(pauseGame()), actionCollection()); + KStdGameAction::end(this, TQT_SLOT(closeGame()), actionCollection()); + KStdGameAction::configureHighscores(this, TQT_SLOT(configureHighscores()),actionCollection()); - new KAction( i18n("&Select Background Folder..."), 0, this, SLOT(selectBackground()), + new KAction( i18n("&Select Background Folder..."), 0, this, TQT_SLOT(selectBackground()), actionCollection(), "background_select" ); m_backgroundShowAction = - new KToggleAction( i18n("Show &Backgrounds"), 0, this, SLOT(showBackground()), + new KToggleAction( i18n("Show &Backgrounds"), 0, this, TQT_SLOT(showBackground()), actionCollection(), "background_show" ); m_backgroundShowAction->setCheckedState(i18n("Hide &Backgrounds")); m_backgroundShowAction->setEnabled( !m_backgroundDir.isEmpty() ); @@ -177,7 +177,7 @@ void KJezzball::closeGame() int old_state = m_state; if (old_state == Running) pauseGame(); - int ret = KMessageBox::questionYesNo( this, i18n("Do you really want to close the running game?"), QString::null, KStdGuiItem::close(), KStdGuiItem::cancel() ); + int ret = KMessageBox::questionYesNo( this, i18n("Do you really want to close the running game?"), TQString::null, KStdGuiItem::close(), KStdGuiItem::cancel() ); if ( ret==KMessageBox::Yes ) { stopLevel(); @@ -206,7 +206,7 @@ void KJezzball::pauseGame() case Suspend: m_state = Running; statusBar()->clear(); - //m_gameWidget->display( QString::null ); + //m_gameWidget->display( TQString::null ); startLevel(); break; @@ -226,7 +226,7 @@ void KJezzball::gameOverNow() { m_state = Idle; - QString score; + TQString score; score.setNum( m_game.score ); KMessageBox::information( this, i18n("Game Over! Score: %1").arg(score) ); statusBar()->message( i18n("Game over. Press <Space> for a new game") ); @@ -255,7 +255,7 @@ void KJezzball::showHighscore() */ void KJezzball::selectBackground() { - QString path = KFileDialog::getExistingDirectory( m_backgroundDir, this, + TQString path = KFileDialog::getExistingDirectory( m_backgroundDir, this, i18n("Select Background Image Folder") ); if ( !path.isEmpty() && path!=m_backgroundDir ) { m_backgroundDir = path; @@ -299,33 +299,33 @@ void KJezzball::showBackground() m_background = getBackgroundPixmap(); } - m_gameWidget->setBackground( m_showBackground ? m_background : QPixmap() ); + m_gameWidget->setBackground( m_showBackground ? m_background : TQPixmap() ); } } -QPixmap KJezzball::getBackgroundPixmap() +TQPixmap KJezzball::getBackgroundPixmap() { // list directory - QDir dir( m_backgroundDir, "*.png *.jpg", QDir::Name|QDir::IgnoreCase, QDir::Files ); + TQDir dir( m_backgroundDir, "*.png *.jpg", TQDir::Name|TQDir::IgnoreCase, TQDir::Files ); if ( !dir.exists() ) { kdDebug(12008) << "Directory not found" << endl; - return QPixmap(); + return TQPixmap(); } if (dir.count() > 1) { // return random pixmap int num = kapp->random() % dir.count(); - return QPixmap( dir.absFilePath( dir[num] ) ); + return TQPixmap( dir.absFilePath( dir[num] ) ); } else if (dir.count()==1) { - return QPixmap( dir.absFilePath(dir[0]) ); + return TQPixmap( dir.absFilePath(dir[0]) ); } - else return QPixmap(); + else return TQPixmap(); } -void KJezzball::focusOutEvent( QFocusEvent *ev ) +void KJezzball::focusOutEvent( TQFocusEvent *ev ) { if ( m_state==Running ) { @@ -339,7 +339,7 @@ void KJezzball::focusOutEvent( QFocusEvent *ev ) KMainWindow::focusOutEvent( ev ); } -void KJezzball::focusInEvent ( QFocusEvent *ev ) +void KJezzball::focusInEvent ( TQFocusEvent *ev ) { if ( m_state==Suspend ) { @@ -347,7 +347,7 @@ void KJezzball::focusInEvent ( QFocusEvent *ev ) m_state = Running; statusBar()->clear(); m_pauseButton->setChecked(false); - //m_gameWidget->display( QString::null ); + //m_gameWidget->display( TQString::null ); } KMainWindow::focusInEvent( ev ); @@ -393,16 +393,16 @@ void KJezzball::createLevel( int level ) if ( m_showBackground ) m_background = getBackgroundPixmap(); else - m_background = QPixmap(); + m_background = TQPixmap(); m_gameWidget = new JezzGame( m_background, level+1, m_view, "m_gameWidget" ); m_gameWidget->setSound(m_soundAction->isChecked()); m_gameWidget->show(); m_layout->addWidget( m_gameWidget, 0, 0 ); - connect( m_gameWidget, SIGNAL(died()), this, SLOT(died()) ); - connect( m_gameWidget, SIGNAL(newPercent(int)), this, SLOT(newPercent(int)) ); - connect( m_soundAction, SIGNAL(toggled(bool)), m_gameWidget, SLOT(setSound(bool)) ); + connect( m_gameWidget, TQT_SIGNAL(died()), this, TQT_SLOT(died()) ); + connect( m_gameWidget, TQT_SIGNAL(newPercent(int)), this, TQT_SLOT(newPercent(int)) ); + connect( m_soundAction, TQT_SIGNAL(toggled(bool)), m_gameWidget, TQT_SLOT(setSound(bool)) ); // update displays m_level.lifes = level+1; @@ -453,13 +453,13 @@ void KJezzball::switchLevel() m_scoreLCD->setNumDigits( numDigits ); m_scoreLCD->display( m_game.score ); - QString score; + TQString score; score.setNum( m_level.score ); - QString level; + TQString level; level.setNum( m_game.level ); -QString foo = QString( +TQString foo = TQString( i18n("You have successfully cleared more than 75% of the board.\n") + i18n("%1 points: 15 points per remaining life\n").arg(m_level.lifes*15) + i18n("%1 points: Bonus\n").arg((m_gameWidget->percent()-75)*2*(m_game.level+5)) + diff --git a/kbounce/kbounce.h b/kbounce/kbounce.h index a4e0a95f..34d1ee77 100644 --- a/kbounce/kbounce.h +++ b/kbounce/kbounce.h @@ -60,29 +60,29 @@ protected: void gameOver(); void initXMLUI(); - void focusOutEvent( QFocusEvent * ); - void focusInEvent ( QFocusEvent * ); + void focusOutEvent( TQFocusEvent * ); + void focusInEvent ( TQFocusEvent * ); - QPixmap getBackgroundPixmap(); + TQPixmap getBackgroundPixmap(); JezzGame *m_gameWidget; - QWidget *m_view; - QGridLayout *m_layout; - QLCDNumber *m_levelLCD; - QLCDNumber *m_lifesLCD; - QLCDNumber *m_scoreLCD; - QLCDNumber *m_percentLCD; - QLCDNumber *m_timeLCD; + TQWidget *m_view; + TQGridLayout *m_layout; + TQLCDNumber *m_levelLCD; + TQLCDNumber *m_lifesLCD; + TQLCDNumber *m_scoreLCD; + TQLCDNumber *m_percentLCD; + TQLCDNumber *m_timeLCD; KToggleAction *m_pauseButton, *m_backgroundShowAction, *m_soundAction; KAction *m_newAction; - QTimer *m_timer; - QTimer *m_nextLevelTimer; - QTimer *m_gameOverTimer; + TQTimer *m_timer; + TQTimer *m_nextLevelTimer; + TQTimer *m_gameOverTimer; - QString m_backgroundDir; + TQString m_backgroundDir; bool m_showBackground; - QPixmap m_background; + TQPixmap m_background; enum { Idle, Running, Paused, Suspend } m_state; diff --git a/kbounce/main.cpp b/kbounce/main.cpp index 390b7c62..41ed3a7b 100644 --- a/kbounce/main.cpp +++ b/kbounce/main.cpp @@ -52,7 +52,7 @@ int main(int argc, char **argv) KCmdLineArgs::init( argc, argv, &aboutData ); - QApplication::setColorSpec(QApplication::ManyColor); + TQApplication::setColorSpec(TQApplication::ManyColor); KApplication a; KGlobal::locale()->insertCatalogue("libkdegames"); |