summaryrefslogtreecommitdiffstats
path: root/kblackbox
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
commit576eb4299a00bc053db35414406f46372a0f70f2 (patch)
tree4c030922d533821db464af566188e7d40cc8848c /kblackbox
parent0718336b6017d1a4fc1d626544180a5a2a29ddec (diff)
downloadtdegames-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 'kblackbox')
-rw-r--r--kblackbox/kbbgame.cpp76
-rw-r--r--kblackbox/kbbgame.h4
-rw-r--r--kblackbox/kbbgfx.cpp60
-rw-r--r--kblackbox/kbbgfx.h32
4 files changed, 86 insertions, 86 deletions
diff --git a/kblackbox/kbbgame.cpp b/kblackbox/kbbgame.cpp
index 82028871..6370291d 100644
--- a/kblackbox/kbbgame.cpp
+++ b/kblackbox/kbbgame.cpp
@@ -10,12 +10,12 @@
#include <config.h>
-#include <qpopupmenu.h>
-#include <qkeycode.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <qtooltip.h>
-#include <qstring.h>
+#include <tqpopupmenu.h>
+#include <tqkeycode.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
+#include <tqtooltip.h>
+#include <tqstring.h>
#include <kmessagebox.h>
#include <kdebug.h>
@@ -58,8 +58,8 @@ KBBGame::KBBGame()
{
int i;
- QPixmap **pix = new QPixmap * [NROFTYPES];
- pix[0] = new QPixmap();
+ TQPixmap **pix = new TQPixmap * [NROFTYPES];
+ pix[0] = new TQPixmap();
*pix[0] = BarIcon( pFNames[0] );
if (!pix[0]->isNull()) {
kdDebug(12009) << "Pixmap \"" << pFNames[0] << "\" loaded." << endl;
@@ -89,15 +89,15 @@ KBBGame::KBBGame()
initKAction();
- connect( gr, SIGNAL(inputAt(int,int,int)),
- this, SLOT(gotInputAt(int,int,int)) );
- connect( this, SIGNAL(gameRuns(bool)),
- gr, SLOT(setInputAccepted(bool)) );
- connect( gr, SIGNAL(endMouseClicked()),
- this, SLOT(gameFinished()) );
+ connect( gr, TQT_SIGNAL(inputAt(int,int,int)),
+ this, TQT_SLOT(gotInputAt(int,int,int)) );
+ connect( this, TQT_SIGNAL(gameRuns(bool)),
+ gr, TQT_SLOT(setInputAccepted(bool)) );
+ connect( gr, TQT_SIGNAL(endMouseClicked()),
+ this, TQT_SLOT(gameFinished()) );
/*
- QToolTip::add( doneButton, i18n(
+ TQToolTip::add( doneButton, i18n(
"Click here when you think you placed all the balls.") );
*/
@@ -164,7 +164,7 @@ KBBGame::KBBGame()
KBBGame::~KBBGame()
{
KConfig *kConf;
- QString s;
+ TQString s;
kConf = kapp->config();
kConf->setGroup( "KBlackBox Setup" );
@@ -266,7 +266,7 @@ void KBBGame::newGame()
if (running) {
bool cancel;
cancel = KMessageBox::warningContinueCancel(0,
- i18n("Do you really want to give up this game?"),QString::null,i18n("Give Up"))
+ i18n("Do you really want to give up this game?"),TQString::null,i18n("Give Up"))
== KMessageBox::Cancel;
if (cancel)
return;
@@ -314,7 +314,7 @@ void KBBGame::newGame()
void KBBGame::gameFinished()
{
if (running) {
- QString s;
+ TQString s;
if (ballsPlaced == balls) {
getResults();
abortGame();
@@ -388,7 +388,7 @@ void KBBGame::giveUp()
bool stop;
stop = KMessageBox::warningContinueCancel(0,
i18n(
- "Do you really want to give up this game?"),QString::null,i18n("Give Up"))
+ "Do you really want to give up this game?"),TQString::null,i18n("Give Up"))
== KMessageBox::Continue;
if (stop) {
@@ -404,8 +404,8 @@ void KBBGame::giveUp()
void KBBGame::updateStats()
{
- QString tmp;
- QString s = i18n("Run: ");
+ TQString tmp;
+ TQString s = i18n("Run: ");
if (running)
s += i18n("Yes");
else
@@ -442,7 +442,7 @@ bool KBBGame::setSize( int w, int h )
if (running) {
ok = KMessageBox::warningContinueCancel(0,
i18n(
- "This will be the end of the current game!"),QString::null,i18n("End Game"))
+ "This will be the end of the current game!"),TQString::null,i18n("End Game"))
== KMessageBox::Continue;
} else ok = TRUE;
@@ -470,7 +470,7 @@ bool KBBGame::setBalls( int n )
if (balls != n) {
if (running) {
ok = KMessageBox::warningContinueCancel(0,
- i18n("This will be the end of the current game!"),QString::null,i18n("End Game"))
+ i18n("This will be the end of the current game!"),TQString::null,i18n("End Game"))
== KMessageBox::Continue;
} else ok = TRUE;
if (ok) {
@@ -698,37 +698,37 @@ void KBBGame::gotInputAt( int col, int row, int state )
void KBBGame::initKAction()
{
// game
- KStdGameAction::gameNew(this, SLOT(newGame()), actionCollection());
- (void)new KAction( i18n("&Give Up"), SmallIcon("giveup"), 0, this, SLOT(giveUp()), actionCollection(), "game_giveup" );
- (void)new KAction( i18n("&Done"), SmallIcon("done"), 0, this, SLOT(gameFinished()), actionCollection(), "game_done" );
- (void)new KAction( i18n("&Resize"), 0, this, SLOT(slotResize()), actionCollection(), "game_resize" );
- KStdGameAction::quit(this, SLOT(close()), actionCollection());
+ KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection());
+ (void)new KAction( i18n("&Give Up"), SmallIcon("giveup"), 0, this, TQT_SLOT(giveUp()), actionCollection(), "game_giveup" );
+ (void)new KAction( i18n("&Done"), SmallIcon("done"), 0, this, TQT_SLOT(gameFinished()), actionCollection(), "game_done" );
+ (void)new KAction( i18n("&Resize"), 0, this, TQT_SLOT(slotResize()), actionCollection(), "game_resize" );
+ KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection());
// settings
- sizeAction = new KSelectAction( i18n("&Size"), 0, this, SLOT(slotSize()), actionCollection(), "options_size");
- QStringList list;
+ sizeAction = new KSelectAction( i18n("&Size"), 0, this, TQT_SLOT(slotSize()), actionCollection(), "options_size");
+ TQStringList list;
list.append(i18n(" 8 x 8 "));
list.append(i18n(" 10 x 10 "));
list.append(i18n(" 12 x 12 "));
sizeAction->setItems(list);
- ballsAction = new KSelectAction( i18n("&Balls"), 0, this, SLOT(slotBalls()), actionCollection(), "options_balls");
+ ballsAction = new KSelectAction( i18n("&Balls"), 0, this, TQT_SLOT(slotBalls()), actionCollection(), "options_balls");
list.clear();
list.append(i18n(" 4 "));
list.append(i18n(" 6 "));
list.append(i18n(" 8 "));
ballsAction->setItems(list);
- tutorialAction = new KToggleAction( i18n("&Tutorial"), 0, this, SLOT(tutorialSwitch()), actionCollection(), "options_tutorial" );
-// KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()),
+ tutorialAction = new KToggleAction( i18n("&Tutorial"), 0, this, TQT_SLOT(tutorialSwitch()), actionCollection(), "options_tutorial" );
+// KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()),
//actionCollection());
// keyboard only
- (void)new KAction( i18n("Move Down"), Qt::Key_Down, gr, SLOT(slotDown()), actionCollection(), "move_down" );
- (void)new KAction( i18n("Move Up"), Qt::Key_Up, gr, SLOT(slotUp()), actionCollection(), "move_up" );
- (void)new KAction( i18n("Move Left"), Qt::Key_Left, gr, SLOT(slotLeft()), actionCollection(), "move_left" );
- (void)new KAction( i18n("Move Right"), Qt::Key_Right, gr, SLOT(slotRight()), actionCollection(), "move_right" );
- (void)new KAction( i18n("Trigger Action"), Qt::Key_Return, gr, SLOT(slotInput()), actionCollection(), "move_trigger" );
+ (void)new KAction( i18n("Move Down"), Qt::Key_Down, gr, TQT_SLOT(slotDown()), actionCollection(), "move_down" );
+ (void)new KAction( i18n("Move Up"), Qt::Key_Up, gr, TQT_SLOT(slotUp()), actionCollection(), "move_up" );
+ (void)new KAction( i18n("Move Left"), Qt::Key_Left, gr, TQT_SLOT(slotLeft()), actionCollection(), "move_left" );
+ (void)new KAction( i18n("Move Right"), Qt::Key_Right, gr, TQT_SLOT(slotRight()), actionCollection(), "move_right" );
+ (void)new KAction( i18n("Trigger Action"), Qt::Key_Return, gr, TQT_SLOT(slotInput()), actionCollection(), "move_trigger" );
}
void KBBGame::slotResize()
diff --git a/kblackbox/kbbgame.h b/kblackbox/kbbgame.h
index 70f6ad48..85b12e29 100644
--- a/kblackbox/kbbgame.h
+++ b/kblackbox/kbbgame.h
@@ -93,8 +93,8 @@ private:
KBBGraphic *gr;
int score;
- /* QLabel *scoreText;
- QLabel *statusText;*/
+ /* TQLabel *scoreText;
+ TQLabel *statusText;*/
KRandomSequence random;
KSelectAction *ballsAction, *sizeAction;
diff --git a/kblackbox/kbbgfx.cpp b/kblackbox/kbbgfx.cpp
index d37edc1e..79e4b029 100644
--- a/kblackbox/kbbgfx.cpp
+++ b/kblackbox/kbbgfx.cpp
@@ -9,11 +9,11 @@
// The implementation of the KBBGraphic widget
//
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qcolor.h>
-#include <qkeycode.h>
-#include <qwmatrix.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqcolor.h>
+#include <tqkeycode.h>
+#include <tqwmatrix.h>
#include "kbbgfx.h"
#include "util.h"
@@ -22,8 +22,8 @@
Constructs a KBBGraphic widget.
*/
-KBBGraphic::KBBGraphic( QPixmap **p, QWidget* parent, const char* name )
- : QWidget( parent, name )
+KBBGraphic::KBBGraphic( TQPixmap **p, TQWidget* parent, const char* name )
+ : TQWidget( parent, name )
{
int i;
@@ -37,7 +37,7 @@ KBBGraphic::KBBGraphic( QPixmap **p, QWidget* parent, const char* name )
pix = p;
if (pix == NULL) pixScaled = NULL;
else {
- pixScaled = new QPixmap * [NROFTYPES];
+ pixScaled = new TQPixmap * [NROFTYPES];
for (i = 0; i < NROFTYPES; i++) {
pixScaled[i] = new QPixmap;
}
@@ -117,7 +117,7 @@ void KBBGraphic::setNumCols( int cols )
void KBBGraphic::scalePixmaps( int w, int h )
{
int i, w0, h0;
- QWMatrix wm;
+ TQWMatrix wm;
w0 = pix[0]->width();
h0 = pix[0]->height();
@@ -137,7 +137,7 @@ int KBBGraphic::width() { return cellW * numRows; }
int KBBGraphic::height() { return cellH * numCols; }
int KBBGraphic::wHint() const { return minW; }
int KBBGraphic::hHint() const { return minH; }
-QSize KBBGraphic::sizeHint() const { return QSize(wHint(), hHint()); }
+TQSize KBBGraphic::sizeHint() const { return TQSize(wHint(), hHint()); }
/*
Returns a pointer to graphicBoard
@@ -149,20 +149,20 @@ RectOnArray *KBBGraphic::getGraphicBoard() { return graphicBoard; }
Handles cell painting for the KBBGraphic widget.
*/
-void KBBGraphic::paintCell( QPainter* p, int row, int col )
+void KBBGraphic::paintCell( TQPainter* p, int row, int col )
{
if (pix == NULL) paintCellDefault( p, row, col );
else paintCellPixmap( p, row, col );
}
-void KBBGraphic::paintCellPixmap( QPainter* p, int row, int col )
+void KBBGraphic::paintCellPixmap( TQPainter* p, int row, int col )
{
int w = cellW;
int h = cellH;
int x2 = w - 1;
int y2 = h - 1;
int type;
- QPixmap pm;
+ TQPixmap pm;
// kdDebug(12009) << p->viewport().width() << endl;
@@ -193,7 +193,7 @@ void KBBGraphic::paintCellPixmap( QPainter* p, int row, int col )
/*
Extra drawings for boxes aroud lasers.
*/
- QString s;
+ TQString s;
switch (type) {
case RLASERBBG:
s.sprintf( "%c", 'R' );
@@ -225,14 +225,14 @@ void KBBGraphic::paintCellPixmap( QPainter* p, int row, int col )
}
}
-void KBBGraphic::paintCellDefault( QPainter* p, int row, int col )
+void KBBGraphic::paintCellDefault( TQPainter* p, int row, int col )
{
int w = cellW;
int h = cellH;
int x2 = w - 1;
int y2 = h - 1;
int type;
- QColor color;
+ TQColor color;
switch (type = graphicBoard->get( col, row )) {
case MARK1BBG: color = darkRed; break;
@@ -254,7 +254,7 @@ void KBBGraphic::paintCellDefault( QPainter* p, int row, int col )
/*
Extra drawings for boxes aroud lasers.
*/
- QString s;
+ TQString s;
switch (type) {
case RLASERBBG:
s.sprintf( "%c", 'R' );
@@ -289,10 +289,10 @@ void KBBGraphic::paintCellDefault( QPainter* p, int row, int col )
Xperimantal...
*/
-void KBBGraphic::paintEvent( QPaintEvent* )
+void KBBGraphic::paintEvent( TQPaintEvent* )
{
int i, j;
- QPainter paint( drawBuffer );
+ TQPainter paint( drawBuffer );
// kdDebug(12009) << drawBuffer->width() << endl;
for (i = 0; i < numRows; i++) {
@@ -308,10 +308,10 @@ void KBBGraphic::paintEvent( QPaintEvent* )
Resize event of the KBBGraphic widget.
*/
-void KBBGraphic::resizeEvent( QResizeEvent* )
+void KBBGraphic::resizeEvent( TQResizeEvent* )
{
- int w = QWidget::width();
- int h = QWidget::height();
+ int w = TQWidget::width();
+ int h = TQWidget::height();
int wNew, hNew;
// kbDebug() << w << " " << h << " " << minW << " " << minH << endl;
@@ -330,13 +330,13 @@ void KBBGraphic::resizeEvent( QResizeEvent* )
setCellHeight( hNew );
delete drawBuffer;
- drawBuffer = new QPixmap( cellW * numRows, cellH * numCols );
+ drawBuffer = new TQPixmap( cellW * numRows, cellH * numCols );
}
/*
Handles mouse press events for the KBBGraphic widget.
*/
-void KBBGraphic::mousePressEvent( QMouseEvent* e )
+void KBBGraphic::mousePressEvent( TQMouseEvent* e )
{
if (inputAccepted) {
/*
@@ -348,7 +348,7 @@ void KBBGraphic::mousePressEvent( QMouseEvent* e )
}
int oldRow = curRow;
int oldCol = curCol;
- QPoint pos = e->pos(); // extract pointer position
+ TQPoint pos = e->pos(); // extract pointer position
curRow = pos.y() / cellH;
curCol = pos.x() / cellW;
//kdDebug(12009) << e->state() << " " << LeftButton << " " << e->state()&LeftButton << endl;
@@ -362,11 +362,11 @@ void KBBGraphic::mousePressEvent( QMouseEvent* e )
Handles mouse move events for the KBBGraphic widget.
*/
-void KBBGraphic::mouseMoveEvent( QMouseEvent* e ) {
+void KBBGraphic::mouseMoveEvent( TQMouseEvent* e ) {
if (inputAccepted) {
int oldRow = curRow;
int oldCol = curCol;
- QPoint pos = e->pos(); // extract pointer position
+ TQPoint pos = e->pos(); // extract pointer position
int movRow = pos.y() / cellH;
int movCol = pos.x() / cellW;
// kdDebug(12009) << movRow << " " << curRow << endl;
@@ -432,7 +432,7 @@ void KBBGraphic::moveSelection(int drow, int dcol)
Handles focus reception events for the KBBGraphic widget.
*/
-void KBBGraphic::focusInEvent( QFocusEvent* )
+void KBBGraphic::focusInEvent( TQFocusEvent* )
{
repaint( FALSE );
}
@@ -442,7 +442,7 @@ void KBBGraphic::focusInEvent( QFocusEvent* )
Handles focus loss events for the KBBGraphic widget.
*/
-void KBBGraphic::focusOutEvent( QFocusEvent* )
+void KBBGraphic::focusOutEvent( TQFocusEvent* )
{
repaint( FALSE );
}
@@ -464,7 +464,7 @@ void KBBGraphic::setInputAccepted( bool b )
void KBBGraphic::updateElement( int col, int row )
{
- QPainter paint( this );
+ TQPainter paint( this );
paint.setViewport( col * cellW, row * cellH, width(), height() );
paintCell( &paint, row, col );
diff --git a/kblackbox/kbbgfx.h b/kblackbox/kbbgfx.h
index ae4d207c..16d97298 100644
--- a/kblackbox/kbbgfx.h
+++ b/kblackbox/kbbgfx.h
@@ -12,8 +12,8 @@
#ifndef KBBGFX_H
#define KBBGFX_H
-#include <qwidget.h>
-#include <qpixmap.h>
+#include <tqwidget.h>
+#include <tqpixmap.h>
#include "util.h"
@@ -54,7 +54,7 @@ class KBBGraphic : public QWidget
{
Q_OBJECT
public:
- KBBGraphic( QPixmap** p=0, QWidget* parent=0, const char* name=0 );
+ KBBGraphic( TQPixmap** p=0, TQWidget* parent=0, const char* name=0 );
~KBBGraphic();
friend class KBBGame;
@@ -87,20 +87,20 @@ signals:
void endMouseClicked();
protected:
- virtual QSize sizeHint() const;
- void paintEvent( QPaintEvent* );
- void mousePressEvent( QMouseEvent* );
- void mouseMoveEvent( QMouseEvent* );
- void focusInEvent( QFocusEvent* );
- void focusOutEvent( QFocusEvent* );
- void resizeEvent( QResizeEvent* e );
+ virtual TQSize sizeHint() const;
+ void paintEvent( TQPaintEvent* );
+ void mousePressEvent( TQMouseEvent* );
+ void mouseMoveEvent( TQMouseEvent* );
+ void focusInEvent( TQFocusEvent* );
+ void focusOutEvent( TQFocusEvent* );
+ void resizeEvent( TQResizeEvent* e );
void moveSelection(int drow, int dcol);
private:
- void paintCell( QPainter* p, int row, int col );
- void paintCellDefault( QPainter*, int row, int col );
- void paintCellPixmap( QPainter*, int row, int col );
+ void paintCell( TQPainter* p, int row, int col );
+ void paintCellDefault( TQPainter*, int row, int col );
+ void paintCellPixmap( TQPainter*, int row, int col );
void scalePixmaps( int w, int h );
RectOnArray *graphicBoard;
int curRow;
@@ -112,9 +112,9 @@ private:
int cellH;
int numCols;
int numRows;
- QPixmap **pix;
- QPixmap **pixScaled;
- QPixmap *drawBuffer;
+ TQPixmap **pix;
+ TQPixmap **pixScaled;
+ TQPixmap *drawBuffer;
};
#endif // KBBGFX_H