summaryrefslogtreecommitdiffstats
path: root/kbounce
diff options
context:
space:
mode:
Diffstat (limited to 'kbounce')
-rw-r--r--kbounce/game.cpp40
-rw-r--r--kbounce/game.h8
-rw-r--r--kbounce/kbounce.cpp44
-rw-r--r--kbounce/kbounce.h2
4 files changed, 47 insertions, 47 deletions
diff --git a/kbounce/game.cpp b/kbounce/game.cpp
index 4b60df2e..4d5182a9 100644
--- a/kbounce/game.cpp
+++ b/kbounce/game.cpp
@@ -19,7 +19,7 @@
#include <stdlib.h>
#include <tqtimer.h>
-#include <kstandarddirs.h>
+#include <tdestandarddirs.h>
#include <tdeapplication.h>
#include <kdebug.h>
#include <tqimage.h>
@@ -326,13 +326,13 @@ JezzView::JezzView(TQCanvas* viewing, TQWidget* parent, const char* name, WFlags
void JezzView::viewportMouseReleaseEvent( TQMouseEvent *ev )
{
- if ( ev->button() & Qt::RightButton )
+ if ( ev->button() & TQt::RightButton )
{
m_vertical = !m_vertical;
if ( m_vertical ) setCursor( sizeVerCursor ); else setCursor( sizeHorCursor );
}
- if ( ev->button() & Qt::LeftButton )
+ if ( ev->button() & TQt::LeftButton )
{
emit buildWall( ev->x()/TILE_SIZE, ev->y()/TILE_SIZE, m_vertical );
}
@@ -344,7 +344,7 @@ JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent, c
: TQWidget( parent, name ), m_wall1( 0 ), m_wall2( 0 ),
m_text( 0 ), m_running( false ), m_percent( 0 ), m_pictured( false )
{
- TQString path = kapp->dirs()->findResourceDir( "data", "kbounce/pics/ball0000.png" ) + "kbounce/pics/";
+ TQString path = tdeApp->dirs()->findResourceDir( "data", "kbounce/pics/ball0000.png" ) + "kbounce/pics/";
// load gfx
m_ballPixmaps = new TQCanvasPixmapArray( path + "ball%1.png", 25 );
@@ -359,11 +359,11 @@ JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent, c
if ( m_artsServer->isNull() )
kdDebug(12008) << "Can't connect to aRts sound server" << endl;
#endif
- m_soundPath = kapp->dirs()->findResourceDir( "data", "kbounce/sounds/death.au" ) +
+ m_soundPath = tdeApp->dirs()->findResourceDir( "data", "kbounce/sounds/death.au" ) +
"kbounce/sounds/";
// create field
- m_field = new JezzField( tiles, background, TQT_TQOBJECT(this), "m_field" );
+ m_field = new JezzField( tiles, background, this, "m_field" );
m_field->resize( TILE_SIZE*FIELD_WIDTH, TILE_SIZE*FIELD_HEIGHT );
for ( int x=0; x<FIELD_WIDTH; x++ )
@@ -378,23 +378,23 @@ JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent, c
for ( int x=0; x<FIELD_WIDTH; x++ )
m_field->setTile( x, FIELD_HEIGHT-1, TILE_BORDER );
- connect( m_field, TQT_SIGNAL(ballCollision(Ball *, int, int, int)), this, TQT_SLOT(ballCollision(Ball *, int, int, int)) );
+ connect( m_field, TQ_SIGNAL(ballCollision(Ball *, int, int, int)), this, TQ_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, TQT_SIGNAL(buildWall(int, int, bool)), this, TQT_SLOT(buildWall(int, int, bool)) );
+ connect( m_view, TQ_SIGNAL(buildWall(int, int, bool)), this, TQ_SLOT(buildWall(int, int, bool)) );
// create balls
for ( int n=0; n<ballNum; n++ )
{
Ball *ball = new Ball( m_ballPixmaps, m_field );
m_balls.append( ball );
- ball->setVelocity( ((kapp->random() & 1)*2-1)*2, ((kapp->random() & 1)*2-1)*2 );
- ball->setFrame( kapp->random() % 25 );
- ball->move( 4*TILE_SIZE + kapp->random() % ( (FIELD_WIDTH-8)*TILE_SIZE ),
- 4*TILE_SIZE + kapp->random() % ( (FIELD_HEIGHT-8)*TILE_SIZE ) );
+ ball->setVelocity( ((tdeApp->random() & 1)*2-1)*2, ((tdeApp->random() & 1)*2-1)*2 );
+ ball->setFrame( tdeApp->random() % 25 );
+ ball->move( 4*TILE_SIZE + tdeApp->random() % ( (FIELD_WIDTH-8)*TILE_SIZE ),
+ 4*TILE_SIZE + tdeApp->random() % ( (FIELD_HEIGHT-8)*TILE_SIZE ) );
ball->show();
}
@@ -403,7 +403,7 @@ JezzGame::JezzGame( const TQPixmap &background, int ballNum, TQWidget *parent, c
// create game clock
m_clock = new TQTimer( this );
- connect( m_clock, TQT_SIGNAL(timeout()), this, TQT_SLOT(tick()) );
+ connect( m_clock, TQ_SIGNAL(timeout()), this, TQ_SLOT(tick()) );
m_clock->start( GAME_DELAY );
// setup geometry
@@ -617,18 +617,18 @@ void JezzGame::buildWall( int x, int y, bool vertical )
m_wall1 = new Wall( m_field, x, y,
vertical? Wall::Up : Wall::Left,
vertical? TILE_WALLUP : TILE_WALLLEFT,
- TQT_TQOBJECT(this), "m_wall1" );
- connect( m_wall1, TQT_SIGNAL(finished(Wall *, int)),
- this, TQT_SLOT(wallFinished(Wall *, int)) ); }
+ this, "m_wall1" );
+ connect( m_wall1, TQ_SIGNAL(finished(Wall *, int)),
+ this, TQ_SLOT(wallFinished(Wall *, int)) ); }
if ( !m_wall2 )
{
m_wall2 = new Wall( m_field, x, y,
vertical? Wall::Down: Wall::Right,
vertical? TILE_WALLDOWN : TILE_WALLRIGHT,
- TQT_TQOBJECT(this), "m_wall2" );
- connect( m_wall2, TQT_SIGNAL(finished(Wall *, int)),
- this, TQT_SLOT(wallFinished(Wall *, int)) );
+ this, "m_wall2" );
+ connect( m_wall2, TQ_SIGNAL(finished(Wall *, int)),
+ this, TQ_SLOT(wallFinished(Wall *, int)) );
}
}
}
@@ -693,7 +693,7 @@ void JezzGame::tick()
if ( m_wall2 ) m_wall2->update();
}
- //kapp->syncX();
+ //tdeApp->syncX();
}
#include "game.moc"
diff --git a/kbounce/game.h b/kbounce/game.h
index cb7fd66d..761d1235 100644
--- a/kbounce/game.h
+++ b/kbounce/game.h
@@ -54,7 +54,7 @@ class Ball : public TQCanvasSprite
class Wall : public TQObject
{
- Q_OBJECT
+ TQ_OBJECT
public:
enum Direction { Up, Down, Left, Right };
@@ -88,7 +88,7 @@ private:
class JezzField : public TQCanvas
{
- Q_OBJECT
+ TQ_OBJECT
public:
JezzField( const TQPixmap &tiles, const TQPixmap &background, TQObject* parent = 0, const char* name = 0 );
@@ -114,7 +114,7 @@ private:
class JezzView : public TQCanvasView
{
- Q_OBJECT
+ TQ_OBJECT
public:
JezzView(TQCanvas* viewing=0, TQWidget* parent=0, const char* name=0, WFlags f=0);
@@ -132,7 +132,7 @@ private:
class JezzGame : public TQWidget
{
- Q_OBJECT
+ TQ_OBJECT
public:
diff --git a/kbounce/kbounce.cpp b/kbounce/kbounce.cpp
index 9fcb3c63..8aa25ff6 100644
--- a/kbounce/kbounce.cpp
+++ b/kbounce/kbounce.cpp
@@ -41,7 +41,7 @@ KJezzball::KJezzball()
m_game.score = 0;
m_state = Idle;
- TDEConfig *config = kapp->config();
+ TDEConfig *config = tdeApp->config();
m_backgroundDir = config->readPathEntry( "BackgroundDir" );
m_showBackground = config->readBoolEntry( "ShowBackground", false );
@@ -89,13 +89,13 @@ KJezzball::KJezzball()
// create timers
m_nextLevelTimer = new TQTimer( this, "m_nextLevelTimer" );
- connect( m_nextLevelTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(switchLevel()) );
+ connect( m_nextLevelTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(switchLevel()) );
m_gameOverTimer = new TQTimer( this, "m_gameOverTimer" );
- connect( m_gameOverTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(gameOverNow()) );
+ connect( m_gameOverTimer, TQ_SIGNAL(timeout()), this, TQ_SLOT(gameOverNow()) );
m_timer = new TQTimer( this, "m_timer" );
- connect( m_timer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(second()) );
+ connect( m_timer, TQ_SIGNAL(timeout()), this, TQ_SLOT(second()) );
// create demo game
createLevel( 1 );
@@ -103,14 +103,14 @@ KJezzball::KJezzball()
.arg(m_newAction->shortcut().toString()) );
//m_gameWidget->display( i18n("Press <Space> to start a game!") );
- setFocusPolicy(TQ_StrongFocus);
+ setFocusPolicy(TQWidget::StrongFocus);
setFocus();
setupGUI();
}
KJezzball::~KJezzball()
{
- TDEConfig *config = kapp->config();
+ TDEConfig *config = tdeApp->config();
config->writeEntry( "PlaySounds", m_soundAction->isChecked() );
}
@@ -119,23 +119,23 @@ KJezzball::~KJezzball()
*/
void KJezzball::initXMLUI()
{
- m_newAction = KStdGameAction::gameNew( TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection() );
+ m_newAction = KStdGameAction::gameNew( this, TQ_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
TDEShortcut s = m_newAction->shortcut();
s.append(KKeySequence(TQKeySequence(Key_Space)));
m_newAction->setShortcut(s);
- KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection() );
- KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighscore()), actionCollection() );
- m_pauseButton = KStdGameAction::pause(TQT_TQOBJECT(this), TQT_SLOT(pauseGame()), actionCollection());
- KStdGameAction::end(TQT_TQOBJECT(this), TQT_SLOT(closeGame()), actionCollection());
- KStdGameAction::configureHighscores(TQT_TQOBJECT(this), TQT_SLOT(configureHighscores()),actionCollection());
+ KStdGameAction::quit(this, TQ_SLOT(close()), actionCollection() );
+ KStdGameAction::highscores(this, TQ_SLOT(showHighscore()), actionCollection() );
+ m_pauseButton = KStdGameAction::pause(this, TQ_SLOT(pauseGame()), actionCollection());
+ KStdGameAction::end(this, TQ_SLOT(closeGame()), actionCollection());
+ KStdGameAction::configureHighscores(this, TQ_SLOT(configureHighscores()),actionCollection());
- new TDEAction( i18n("&Select Background Folder..."), 0, TQT_TQOBJECT(this), TQT_SLOT(selectBackground()),
+ new TDEAction( i18n("&Select Background Folder..."), 0, this, TQ_SLOT(selectBackground()),
actionCollection(), "background_select" );
m_backgroundShowAction =
- new TDEToggleAction( i18n("Show &Backgrounds"), 0, TQT_TQOBJECT(this), TQT_SLOT(showBackground()),
+ new TDEToggleAction( i18n("Show &Backgrounds"), 0, this, TQ_SLOT(showBackground()),
actionCollection(), "background_show" );
m_backgroundShowAction->setCheckedState(i18n("Hide &Backgrounds"));
m_backgroundShowAction->setEnabled( !m_backgroundDir.isEmpty() );
@@ -218,7 +218,7 @@ void KJezzball::pauseGame()
void KJezzball::gameOver()
{
stopLevel();
- m_gameOverTimer->start( 100, TRUE );
+ m_gameOverTimer->start( 100, true );
}
@@ -264,7 +264,7 @@ void KJezzball::selectBackground()
m_backgroundShowAction->setEnabled(true);
// save settings
- TDEConfig *config = kapp->config();
+ TDEConfig *config = tdeApp->config();
config->writePathEntry( "BackgroundDir", m_backgroundDir );
config->sync();
@@ -289,7 +289,7 @@ void KJezzball::showBackground()
m_showBackground = show;
// save setting
- TDEConfig *config = kapp->config();
+ TDEConfig *config = tdeApp->config();
config->writeEntry( "ShowBackground", m_showBackground );
config->sync();
@@ -315,7 +315,7 @@ TQPixmap KJezzball::getBackgroundPixmap()
if (dir.count() > 1)
{
// return random pixmap
- int num = kapp->random() % dir.count();
+ int num = tdeApp->random() % dir.count();
return TQPixmap( dir.absFilePath( dir[num] ) );
}
else if (dir.count()==1)
@@ -400,9 +400,9 @@ void KJezzball::createLevel( int level )
m_gameWidget->show();
m_layout->addWidget( m_gameWidget, 0, 0 );
- connect( m_gameWidget, TQT_SIGNAL(died()), TQT_TQOBJECT(this), TQT_SLOT(died()) );
- connect( m_gameWidget, TQT_SIGNAL(newPercent(int)), TQT_TQOBJECT(this), TQT_SLOT(newPercent(int)) );
- connect( m_soundAction, TQT_SIGNAL(toggled(bool)), m_gameWidget, TQT_SLOT(setSound(bool)) );
+ connect( m_gameWidget, TQ_SIGNAL(died()), this, TQ_SLOT(died()) );
+ connect( m_gameWidget, TQ_SIGNAL(newPercent(int)), this, TQ_SLOT(newPercent(int)) );
+ connect( m_soundAction, TQ_SIGNAL(toggled(bool)), m_gameWidget, TQ_SLOT(setSound(bool)) );
// update displays
m_level.lifes = level+1;
@@ -436,7 +436,7 @@ void KJezzball::stopLevel()
void KJezzball::nextLevel()
{
stopLevel();
- m_nextLevelTimer->start( 100, TRUE );
+ m_nextLevelTimer->start( 100, true );
}
void KJezzball::switchLevel()
diff --git a/kbounce/kbounce.h b/kbounce/kbounce.h
index 884e3298..130e54b4 100644
--- a/kbounce/kbounce.h
+++ b/kbounce/kbounce.h
@@ -29,7 +29,7 @@ class TDEAction;
class KJezzball : public TDEMainWindow
{
- Q_OBJECT
+ TQ_OBJECT
public: