summaryrefslogtreecommitdiffstats
path: root/kmahjongg
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
commit838baf3f99ec5ab81b063eb5449a3381d860f377 (patch)
treedd31abcfde08ca92e4623b8f50b3d762a87c997a /kmahjongg
parent2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff)
downloadtdegames-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 'kmahjongg')
-rw-r--r--kmahjongg/Background.cpp8
-rw-r--r--kmahjongg/BoardLayout.cpp4
-rw-r--r--kmahjongg/BoardLayout.h2
-rw-r--r--kmahjongg/Editor.cpp48
-rw-r--r--kmahjongg/Editor.h5
-rw-r--r--kmahjongg/GameTimer.cpp6
-rw-r--r--kmahjongg/GameTimer.h7
-rw-r--r--kmahjongg/HighScore.cpp26
-rw-r--r--kmahjongg/HighScore.h9
-rw-r--r--kmahjongg/Preview.cpp88
-rw-r--r--kmahjongg/Preview.h12
-rw-r--r--kmahjongg/Tileset.cpp66
-rw-r--r--kmahjongg/Tileset.h26
-rw-r--r--kmahjongg/boardwidget.cpp42
-rw-r--r--kmahjongg/boardwidget.h7
-rw-r--r--kmahjongg/kmahjongg.cpp68
-rw-r--r--kmahjongg/kmahjongg.h5
-rw-r--r--kmahjongg/pics/cross.layout2
-rw-r--r--kmahjongg/pics/default.layout2
-rw-r--r--kmahjongg/pics/default.theme2
-rw-r--r--kmahjongg/pics/pirates.layout2
-rw-r--r--kmahjongg/pics/pirates.theme2
-rw-r--r--kmahjongg/pics/pyramid.layout2
-rw-r--r--kmahjongg/pics/stax.layout2
-rw-r--r--kmahjongg/pics/test.layout2
-rw-r--r--kmahjongg/pics/test2.layout2
-rw-r--r--kmahjongg/pics/tower.layout2
-rw-r--r--kmahjongg/pics/triangle.layout2
-rw-r--r--kmahjongg/settings.ui30
29 files changed, 244 insertions, 237 deletions
diff --git a/kmahjongg/Background.cpp b/kmahjongg/Background.cpp
index 432ae5fb..2cf7296f 100644
--- a/kmahjongg/Background.cpp
+++ b/kmahjongg/Background.cpp
@@ -78,8 +78,8 @@ void Background::sourceToBackground() {
if (tile) {
// copy new to background wrapping on w and height
for (int y=0; y<backgroundImage->height(); y++) {
- QRgb *dest = (QRgb *) backgroundImage->scanLine(y);
- QRgb *src = (QRgb *) sourceImage->scanLine(y % sourceImage->height());
+ TQRgb *dest = (TQRgb *) backgroundImage->scanLine(y);
+ TQRgb *src = (TQRgb *) sourceImage->scanLine(y % sourceImage->height());
for (int x=0; x< backgroundImage->width(); x++) {
*dest = *(src + (x % sourceImage->width()));
dest++;
@@ -99,8 +99,8 @@ void Background::sourceToBackground() {
TQImage tmp;
tmp.create(backgroundImage->width(), backgroundImage->height(), 32);
for (int ys=0; ys < tmp.height(); ys++) {
- QRgb *src = (QRgb *) backgroundImage->scanLine(ys);
- QRgb *dst = (QRgb *) tmp.scanLine(ys);
+ TQRgb *src = (TQRgb *) backgroundImage->scanLine(ys);
+ TQRgb *dst = (TQRgb *) tmp.scanLine(ys);
for (int xs=0; xs < tmp.width(); xs++) {
*dst=TQColor(*src).dark(133).rgb();
src++;
diff --git a/kmahjongg/BoardLayout.cpp b/kmahjongg/BoardLayout.cpp
index 8da404ae..c9fd188e 100644
--- a/kmahjongg/BoardLayout.cpp
+++ b/kmahjongg/BoardLayout.cpp
@@ -29,7 +29,7 @@ bool BoardLayout::saveBoardLayout(const TQString where) {
return false;
}
- TQCString tmp = layoutMagic1_0.utf8();
+ TQCString tmp = tqlayoutMagic1_0.utf8();
if (f.writeBlock(tmp, tmp.length()) == -1) {
return(false);
}
@@ -71,7 +71,7 @@ bool BoardLayout::loadBoardLayout(const TQString from)
t.setCodec(TQTextCodec::codecForName("UTF-8"));
TQString s;
s = t.readLine();
- if (s != layoutMagic1_0) {
+ if (s != tqlayoutMagic1_0) {
f.close();
return(false);
}
diff --git a/kmahjongg/BoardLayout.h b/kmahjongg/BoardLayout.h
index 468bf5bc..7bf58003 100644
--- a/kmahjongg/BoardLayout.h
+++ b/kmahjongg/BoardLayout.h
@@ -4,7 +4,7 @@
#include <tqstring.h>
#include "KmTypes.h"
-const TQString layoutMagic1_0 = "kmahjongg-layout-v1.0";
+const TQString tqlayoutMagic1_0 = "kmahjongg-tqlayout-v1.0";
class BoardLayout {
diff --git a/kmahjongg/Editor.cpp b/kmahjongg/Editor.cpp
index d11ff7b2..833718c3 100644
--- a/kmahjongg/Editor.cpp
+++ b/kmahjongg/Editor.cpp
@@ -35,17 +35,17 @@
// When we assign a tile to draw in a slot we do it in order from te following
-// table, wrapping on the tile number. It makes the tile layout look more
+// table, wrapping on the tile number. It makes the tile tqlayout look more
// random.
Editor::Editor
(
- TQWidget* parent,
+ TQWidget* tqparent,
const char* name
)
:
- TQDialog( parent, name, true, 0 ), tiles(false)
+ TQDialog( tqparent, name, true, 0 ), tiles(false)
{
clean= true;
@@ -61,7 +61,7 @@ Editor::Editor
drawFrame->setGeometry( 10, 40 ,sWidth ,sHeight);
drawFrame->setMinimumSize( 0, 0 );
drawFrame->setMaximumSize( 32767, 32767 );
- drawFrame->setFocusPolicy( TQWidget::NoFocus );
+ drawFrame->setFocusPolicy( TQ_NoFocus );
drawFrame->setBackgroundMode( TQWidget::PaletteBackground );
drawFrame->setFrameStyle( 49 );
drawFrame->setMouseTracking(true);
@@ -69,10 +69,10 @@ Editor::Editor
// setup the tool bar
setupToolbar();
- TQVBoxLayout *layout = new TQVBoxLayout(this, 1);
- layout->addWidget(topToolbar,0);
- layout->addWidget(drawFrame,1);
- layout->activate();
+ TQVBoxLayout *tqlayout = new TQVBoxLayout(this, 1);
+ tqlayout->addWidget(topToolbar,0);
+ tqlayout->addWidget(drawFrame,1);
+ tqlayout->activate();
resize( sWidth+60, sHeight+60);
setMinimumSize( sWidth+60, sHeight+60);
@@ -170,7 +170,7 @@ void Editor::setupToolbar()
// status in the toolbar for now (ick)
theLabel = new TQLabel(statusText(), topToolbar);
- int lWidth = theLabel->sizeHint().width();
+ int lWidth = theLabel->tqsizeHint().width();
topToolbar->insertWidget(ID_TOOL_STATUS,lWidth, theLabel );
topToolbar->alignItemRight( ID_TOOL_STATUS, true );
@@ -209,19 +209,19 @@ void Editor::topToolbarOption(int option) {
break;
case ID_TOOL_LEFT:
theBoard.shiftLeft();
- repaint(false);
+ tqrepaint(false);
break;
case ID_TOOL_RIGHT:
theBoard.shiftRight();
- repaint(false);
+ tqrepaint(false);
break;
case ID_TOOL_UP:
theBoard.shiftUp();
- repaint(false);
+ tqrepaint(false);
break;
case ID_TOOL_DOWN:
theBoard.shiftDown();
- repaint(false);
+ tqrepaint(false);
break;
case ID_TOOL_DEL:
mode=remove;
@@ -260,7 +260,7 @@ TQString Editor::statusText() {
if (x >=BoardLayout::width || x <0 || y >=BoardLayout::height || y <0)
x = y = z = 0;
- buf = i18n("Tiles: %1 Pos: %2,%3,%4").arg(numTiles).arg(x).arg(y).arg(z);
+ buf = i18n("Tiles: %1 Pos: %2,%3,%4").tqarg(numTiles).tqarg(x).tqarg(y).tqarg(z);
return buf;
}
@@ -272,7 +272,7 @@ void Editor::loadBoard() {
KURL url = KFileDialog::getOpenURL(
NULL,
- i18n("*.layout|Board Layout (*.layout)\n"
+ i18n("*.tqlayout|Board Layout (*.tqlayout)\n"
"*|All Files"),
this,
i18n("Open Board Layout" ));
@@ -283,7 +283,7 @@ void Editor::loadBoard() {
theBoard.loadBoardLayout( url.path() );
- repaint(false);
+ tqrepaint(false);
}
@@ -302,14 +302,14 @@ void Editor::newBoard() {
clean=true;
numTiles=0;
statusChanged();
- repaint(false);
+ tqrepaint(false);
}
bool Editor::saveBoard() {
// get a save file name
KURL url = KFileDialog::getSaveURL(
NULL,
- i18n("*.layout|Board Layout (*.layout)\n"
+ i18n("*.tqlayout|Board Layout (*.tqlayout)\n"
"*|All Files"),
this,
i18n("Save Board Layout" ));
@@ -356,7 +356,7 @@ bool Editor::testSave()
int res;
res=KMessageBox::warningYesNoCancel(this,
i18n("The board has been modified. Would you "
- "like to save the changes?"),TQString::null,KStdGuiItem::save(),KStdGuiItem::dontSave());
+ "like to save the changes?"),TQString(),KStdGuiItem::save(),KStdGuiItem::dontSave());
if (res == KMessageBox::Yes) {
// yes to save
@@ -373,7 +373,7 @@ bool Editor::testSave()
// The main paint event, draw in the grid and blit in
-// the tiles as specified by the layout.
+// the tiles as specified by the tqlayout.
void Editor::paintEvent( TQPaintEvent* ) {
@@ -386,7 +386,7 @@ void Editor::paintEvent( TQPaintEvent* ) {
drawTiles(&buff);
bitBlt(dest, 0,0,&buff, 0,0,buff.width(), buff.height(), CopyROP);
- drawFrame->repaint(false);
+ drawFrame->tqrepaint(false);
}
void Editor::drawBackground(TQPixmap *pixmap) {
@@ -564,7 +564,7 @@ void Editor::drawFrameMousePressEvent( TQMouseEvent* e )
numTiles--;
statusChanged();
drawFrameMouseMovedEvent(e);
- repaint(false);
+ tqrepaint(false);
}
break;
case insert: {
@@ -577,7 +577,7 @@ void Editor::drawFrameMousePressEvent( TQMouseEvent* e )
theBoard.insertTile(n);
numTiles++;
statusChanged();
- repaint(false);
+ tqrepaint(false);
}
}
break;
@@ -599,7 +599,7 @@ void Editor::drawCursor(POSITION &p, bool visible)
if (p.e==100 || !visible)
x = -1;
drawFrame->setRect(x,y,w,h, tiles.shadowSize(), mode-remove);
- drawFrame->repaint(false);
+ drawFrame->tqrepaint(false);
diff --git a/kmahjongg/Editor.h b/kmahjongg/Editor.h
index edc8f912..a42f237d 100644
--- a/kmahjongg/Editor.h
+++ b/kmahjongg/Editor.h
@@ -13,16 +13,17 @@
#include "Preview.h"
-class Editor: public QDialog
+class Editor: public TQDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
Editor
(
- TQWidget* parent = NULL,
+ TQWidget* tqparent = NULL,
const char* name = NULL
);
diff --git a/kmahjongg/GameTimer.cpp b/kmahjongg/GameTimer.cpp
index f3ce4f52..d4fc4009 100644
--- a/kmahjongg/GameTimer.cpp
+++ b/kmahjongg/GameTimer.cpp
@@ -8,11 +8,11 @@
//
-// Constructs a GameTimer widget with a parent and a name.
+// Constructs a GameTimer widget with a tqparent and a name.
//
-GameTimer::GameTimer( TQWidget *parent, const char *name )
- : TQLCDNumber( parent, name )
+GameTimer::GameTimer( TQWidget *tqparent, const char *name )
+ : TQLCDNumber( tqparent, name )
{
showingColon = false;
setNumDigits(7);
diff --git a/kmahjongg/GameTimer.h b/kmahjongg/GameTimer.h
index 10d97e13..cae1961e 100644
--- a/kmahjongg/GameTimer.h
+++ b/kmahjongg/GameTimer.h
@@ -8,7 +8,7 @@
**
** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved.
**
-** This file is part of an example program for Qt. This example
+** This file is part of an example program for TQt. This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/
@@ -24,8 +24,9 @@ enum TimerMode {running = -53 , stopped= -54 , paused = -55};
class GameTimer: public TQLCDNumber
{
Q_OBJECT
+ TQ_OBJECT
public:
- GameTimer( TQWidget *parent=0, const char *name=0 );
+ GameTimer( TQWidget *tqparent=0, const char *name=0 );
int toInt();
TQString toString() {return theTimer.toString();}
@@ -45,7 +46,7 @@ private slots: // internal slots
private: // internal data
bool showingColon;
- QTime theTimer;
+ TQTime theTimer;
TimerMode timerMode;
};
diff --git a/kmahjongg/HighScore.cpp b/kmahjongg/HighScore.cpp
index f59e782b..856ed7fb 100644
--- a/kmahjongg/HighScore.cpp
+++ b/kmahjongg/HighScore.cpp
@@ -43,11 +43,11 @@ int defTimes[numScores] = {ages, ages-1, ages-2, ages-3,
HighScore::HighScore
(
- TQWidget* parent,
+ TQWidget* tqparent,
const char* name
)
:
- TQDialog( parent, name, true, 0 )
+ TQDialog( tqparent, name, true, 0 )
{
// form the target name
@@ -62,7 +62,7 @@ HighScore::HighScore
qtarch_Label_3->setGeometry( 10, 45, 30, 30 );
qtarch_Label_3->setFrameStyle( 50 );
qtarch_Label_3->setText( i18n("Pos") );
- qtarch_Label_3->setAlignment( AlignCenter );
+ qtarch_Label_3->tqsetAlignment( AlignCenter );
fnt = qtarch_Label_3->font();
fnt.setBold(true);
qtarch_Label_3->setFont(fnt);
@@ -112,7 +112,7 @@ HighScore::HighScore
qtarch_PushButton_1->setGeometry( 110+35, 340+50, 100, 30 );
qtarch_PushButton_1->setMinimumSize( 0, 0 );
qtarch_PushButton_1->setMaximumSize( 32767, 32767 );
- qtarch_PushButton_1->setFocusPolicy( TQWidget::TabFocus );
+ qtarch_PushButton_1->setFocusPolicy( TQ_TabFocus );
qtarch_PushButton_1->setAutoRepeat( false );
qtarch_PushButton_1->setAutoResize( false );
qtarch_PushButton_1->setDefault(true);
@@ -122,7 +122,7 @@ HighScore::HighScore
resetBtn->setGeometry( 10, 5, 25, 25);
resetBtn->setMinimumSize( 0, 0 );
resetBtn->setMaximumSize( 32767, 32767 );
- resetBtn->setFocusPolicy( TQWidget::TabFocus );
+ resetBtn->setFocusPolicy( TQ_TabFocus );
//resetBtn->setText(i18n( "Reset" ));
resetBtn->setAutoRepeat( false );
resetBtn->setAutoResize( false );
@@ -138,7 +138,7 @@ HighScore::HighScore
lineEdit = new TQLineEdit(this, "");
lineEdit->setGeometry( 50, 40+(20*30), 190, 30 );
- lineEdit->setFocusPolicy(TQWidget::StrongFocus);
+ lineEdit->setFocusPolicy(TQ_StrongFocus);
lineEdit->setFrame(true);
lineEdit->setEchoMode(TQLineEdit::Normal);
lineEdit->setText("");
@@ -149,7 +149,7 @@ HighScore::HighScore
combo->setGeometry( 65, 5, 220, 25 );
combo->setMinimumSize( 0, 0 );
combo->setMaximumSize( 32767, 32767 );
- combo->setFocusPolicy( TQWidget::StrongFocus );
+ combo->setFocusPolicy( TQ_StrongFocus );
combo->setSizeLimit( 10 );
combo->setAutoResize( false );
connect( combo, TQT_SIGNAL(activated(int)), TQT_SLOT(selectionChanged(int)) );
@@ -341,7 +341,7 @@ void HighScore::addRow(int num) {
numbersWidgets[num] = new TQLabel( this);
numbersWidgets[num]->setGeometry( 10, 75+(num*30), 30, 30 );
numbersWidgets[num]->setFrameStyle( 50 );
- numbersWidgets[num]->setAlignment( AlignRight | AlignVCenter );
+ numbersWidgets[num]->tqsetAlignment( AlignRight | AlignVCenter );
numbersWidgets[num]->setNum(num+1);
@@ -349,13 +349,13 @@ void HighScore::addRow(int num) {
namesWidgets[num] = new TQLabel( this);
namesWidgets[num]->setGeometry( 40, 75+(num*30), 150, 30 );
namesWidgets[num]->setFrameStyle( 50 );
- namesWidgets[num]->setAlignment( 289 );
+ namesWidgets[num]->tqsetAlignment( 289 );
// board
boardWidgets[num] = new TQLabel( this);
boardWidgets[num]->setGeometry( 190, 75+(num*30), 80, 30 );
boardWidgets[num]->setFrameStyle( 50 );
- boardWidgets[num]->setAlignment( 289 );
+ boardWidgets[num]->tqsetAlignment( 289 );
// score
scoresWidgets[num] = new TQLabel( this);
@@ -396,11 +396,11 @@ void HighScore::copyTableToScreen(const TQString &name) {
elapsedWidgets[p]->setText(buff);
}
- repaint(false);
+ tqrepaint(false);
}
-int HighScore::exec(TQString &layout) {
- copyTableToScreen(layout);
+int HighScore::exec(TQString &tqlayout) {
+ copyTableToScreen(tqlayout);
return(TQDialog::exec());
}
diff --git a/kmahjongg/HighScore.h b/kmahjongg/HighScore.h
index d6935ab5..bd593c09 100644
--- a/kmahjongg/HighScore.h
+++ b/kmahjongg/HighScore.h
@@ -26,21 +26,22 @@ typedef struct TableInstance {
};
-class HighScore : public QDialog
+class HighScore : public TQDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
HighScore
(
- TQWidget* parent = NULL,
+ TQWidget* tqparent = NULL,
const char* name = NULL
);
virtual ~HighScore();
- int exec(TQString &layout);
+ int exec(TQString &tqlayout);
void checkHighScore(int score, int elapsed, long game, TQString &board);
@@ -58,7 +59,7 @@ private:
void selectTable(const TQString &name);
void setComboTo(const TQString &to);
void copyTableToScreen(const TQString &name);
- QString &highScoreFile();
+ TQString &highScoreFile();
int selectedLine;
TQLineEdit *lineEdit;
diff --git a/kmahjongg/Preview.cpp b/kmahjongg/Preview.cpp
index 11fbcdbd..5c5871bf 100644
--- a/kmahjongg/Preview.cpp
+++ b/kmahjongg/Preview.cpp
@@ -19,7 +19,7 @@
static const char * themeMagicV1_0= "kmahjongg-theme-v1.0";
-Preview::Preview(TQWidget* parent) : KDialogBase(parent), m_tiles(true)
+Preview::Preview(TQWidget* tqparent) : KDialogBase(tqparent), m_tiles(true)
{
KPushButton *loadButton;
TQGroupBox *group;
@@ -41,7 +41,7 @@ Preview::Preview(TQWidget* parent) : KDialogBase(parent), m_tiles(true)
m_changed = false;
setMainWidget(page);
- setFixedSize(sizeHint());
+ setFixedSize(tqsizeHint());
}
Preview::~Preview()
@@ -52,7 +52,7 @@ void Preview::selectionChanged(int which)
{
m_selectedFile = m_fileList[which];
drawPreview();
- m_drawFrame->repaint(0,0,-1,-1,false);
+ m_drawFrame->tqrepaint(0,0,-1,-1,false);
markChanged();
}
@@ -76,7 +76,7 @@ void Preview::initialise(const PreviewType type)
TQString extension;
TQString tile = Prefs::tileSet();
TQString back = Prefs::background();
- TQString layout = Prefs::layout();
+ TQString tqlayout = Prefs::layout();
// set up the concept of the current file. Initialised to the preferences
// value initially. Set the caption to indicate what we are doing
@@ -98,10 +98,10 @@ void Preview::initialise(const PreviewType type)
break;
case board:
- m_fileSelector = i18n("*.layout|Board Layout File (*.layout)\n");
+ m_fileSelector = i18n("*.tqlayout|Board Layout File (*.tqlayout)\n");
setCaption(i18n("Change Board Layout"));
- m_selectedFile = layout;
- extension = "*.layout";
+ m_selectedFile = tqlayout;
+ extension = "*.tqlayout";
break;
case theme:
@@ -158,16 +158,16 @@ void Preview::slotOk() {
}
void Preview::load() {
- KURL url = KFileDialog::getOpenURL(TQString::null, m_fileSelector, this, i18n("Open Board Layout" ));
+ KURL url = KFileDialog::getOpenURL(TQString(), m_fileSelector, this, i18n("Open Board Layout" ));
if ( !url.isEmpty() ) {
m_selectedFile = url.path();
drawPreview();
- m_drawFrame->repaint(0,0,-1,-1,false);
+ m_drawFrame->tqrepaint(0,0,-1,-1,false);
markChanged();
}
}
-// Top level preview drawing method. Background, tileset and layout
+// Top level preview drawing method. Background, tileset and tqlayout
// are initialised from the preferences. Depending on the type
// of preview dialog we pick up the selected file for one of these
// chaps.
@@ -176,7 +176,7 @@ void Preview::drawPreview()
{
TQString tile = Prefs::tileSet();
TQString back = Prefs::background();
- TQString layout = Prefs::layout();
+ TQString tqlayout = Prefs::layout();
switch (m_previewType)
{
@@ -189,15 +189,15 @@ void Preview::drawPreview()
break;
case board:
- layout = m_selectedFile;
+ tqlayout = m_selectedFile;
break;
case theme:
// a theme is quite a bit of work. We load the
- // specified bits in (layout, background and tileset
+ // specified bits in (tqlayout, background and tileset
if (!m_selectedFile.isEmpty())
{
- TQString backRaw, layoutRaw, tilesetRaw, magic;
+ TQString backRaw, tqlayoutRaw, tilesetRaw, magic;
TQFile in(m_selectedFile);
if (in.open(IO_ReadOnly))
@@ -212,38 +212,38 @@ void Preview::drawPreview()
}
tilesetRaw = stream.readLine();
backRaw = stream.readLine();
- layoutRaw = stream.readLine();
+ tqlayoutRaw = stream.readLine();
in.close();
tile = tilesetRaw;
- tile.replace(":", "/kmahjongg/pics/");
+ tile.tqreplace(":", "/kmahjongg/pics/");
if (!TQFile::exists(tile))
{
tile = tilesetRaw;
- tile = "pics/" + tile.right(tile.length() - tile.find(":") - 1 );
+ tile = "pics/" + tile.right(tile.length() - tile.tqfind(":") - 1 );
tile = locate("appdata", tile);
}
back = backRaw;
- back.replace(":", "/kmahjongg/pics/");
+ back.tqreplace(":", "/kmahjongg/pics/");
if (!TQFile::exists(back))
{
back = backRaw;
- back = "pics/" + back.right(back.length() - back.find(":") - 1);
+ back = "pics/" + back.right(back.length() - back.tqfind(":") - 1);
back = locate("appdata", back);
}
- layout = layoutRaw;
- layout.replace(":", "/kmahjongg/pics/");
- if (!TQFile::exists(layout))
+ tqlayout = tqlayoutRaw;
+ tqlayout.tqreplace(":", "/kmahjongg/pics/");
+ if (!TQFile::exists(tqlayout))
{
- layout = layoutRaw;
- layout = "pics/" + layout.right(layout.length() - layout.find(":") - 1);
- layout = locate("appdata", layout);
+ tqlayout = tqlayoutRaw;
+ tqlayout = "pics/" + tqlayout.right(tqlayout.length() - tqlayout.tqfind(":") - 1);
+ tqlayout = locate("appdata", tqlayout);
}
m_themeBack=back;
- m_themeLayout=layout;
+ m_themeLayout=tqlayout;
m_themeTileset=tile;
}
}
@@ -251,16 +251,16 @@ void Preview::drawPreview()
}
renderBackground(back);
- renderTiles(tile, layout);
+ renderTiles(tile, tqlayout);
}
void Preview::paintEvent( TQPaintEvent* ){
- m_drawFrame->repaint(false);
+ m_drawFrame->tqrepaint(false);
}
// the user selected ok, or apply. This method passes the changes
// across to the game widget and if necessary forces a board redraw
-// (unnecessary on layout changes since it only effects the next game)
+// (unnecessary on tqlayout changes since it only effects the next game)
void Preview::applyChange()
{
switch (m_previewType)
@@ -287,8 +287,8 @@ void Preview::applyChange()
break;
}
- // don't redraw for a layout change
- if (m_previewType == board || m_previewType == theme) layoutChange();
+ // don't redraw for a tqlayout change
+ if (m_previewType == board || m_previewType == theme) tqlayoutChange();
else boardRedraw(true);
// either way we mark the current value as unchanged
@@ -310,9 +310,9 @@ void Preview::renderBackground(const TQString &bg) {
// This method draws a mini-tiled board with no tiles missing.
-void Preview::renderTiles(const TQString &file, const TQString &layout) {
+void Preview::renderTiles(const TQString &file, const TQString &tqlayout) {
m_tiles.loadTileset(file, true);
- m_boardLayout.loadBoardLayout(layout);
+ m_boardLayout.loadBoardLayout(tqlayout);
TQPixmap *dest = m_drawFrame->getPreviewPixmap();
int xOffset = m_tiles.width()/2;
@@ -366,23 +366,23 @@ void Preview::renderTiles(const TQString &file, const TQString &layout) {
void Preview::saveTheme() {
TQString tile = Prefs::tileSet();
TQString back = Prefs::background();
- TQString layout = Prefs::layout();
+ TQString tqlayout = Prefs::layout();
TQString with = ":";
// we want to replace any path in the default store
// with a +
TQRegExp p(locate("data_dir", "/kmahjongg/pics/"));
- back.replace(p,with);
- tile.replace(p,with);
- layout.replace(p,with);
+ back.tqreplace(p,with);
+ tile.tqreplace(p,with);
+ tqlayout.tqreplace(p,with);
// Get the name of the file to save
KURL url = KFileDialog::getSaveURL(
NULL,
"*.theme",
- parentWidget(),
+ tqparentWidget(),
i18n("Save Theme" ));
if ( url.isEmpty() )
return;
@@ -402,7 +402,7 @@ void Preview::saveTheme() {
int res=KMessageBox::warningContinueCancel(this,
i18n("A file with that name "
"already exists. Do you "
- "wish to overwrite it?"),TQString::null,i18n("Overwrite"));
+ "wish to overwrite it?"),TQString(),i18n("Overwrite"));
if (res != KMessageBox::Continue)
return ;
}
@@ -417,12 +417,12 @@ void Preview::saveTheme() {
themeMagicV1_0,
tile.utf8().data(),
back.utf8().data(),
- layout.utf8().data());
+ tqlayout.utf8().data());
fclose(outFile);
}
-FrameImage::FrameImage (TQWidget *parent, const char *name)
- : TQFrame(parent, name)
+FrameImage::FrameImage (TQWidget *tqparent, const char *name)
+ : TQFrame(tqparent, name)
{
rx = -1;
thePixmap = new TQPixmap();
@@ -448,11 +448,11 @@ void FrameImage::paintEvent( TQPaintEvent* pa )
TQPen line;
- line.setStyle(DotLine);
+ line.setStyle(Qt::DotLine);
line.setWidth(2);
line.setColor(yellow);
p.setPen(line);
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setBackgroundColor(black);
int x = pa->rect().left();
diff --git a/kmahjongg/Preview.h b/kmahjongg/Preview.h
index 96aae3ef..0c4b37c2 100644
--- a/kmahjongg/Preview.h
+++ b/kmahjongg/Preview.h
@@ -12,11 +12,12 @@
class TQComboBox;
class TQPixmap;
-class FrameImage: public QFrame
+class FrameImage: public TQFrame
{
Q_OBJECT
+ TQ_OBJECT
public:
- FrameImage(TQWidget *parent=NULL, const char *name = NULL);
+ FrameImage(TQWidget *tqparent=NULL, const char *name = NULL);
~FrameImage();
void setGeometry(int x, int y, int w, int h);
TQPixmap *getPreviewPixmap() {return thePixmap;}
@@ -43,11 +44,12 @@ private:
class Preview: public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
enum PreviewType {background, tileset, board, theme};
- Preview(TQWidget* parent);
+ Preview(TQWidget* tqparent);
~Preview();
void initialise(const PreviewType type);
@@ -61,7 +63,7 @@ protected:
virtual void drawPreview();
void applyChange() ;
void renderBackground(const TQString &bg);
- void renderTiles(const TQString &file, const TQString &layout);
+ void renderTiles(const TQString &file, const TQString &tqlayout);
void paintEvent( TQPaintEvent* pa );
signals:
@@ -69,7 +71,7 @@ signals:
void loadTileset(const TQString &);
void loadBackground(const TQString &, bool);
void loadBoard(const TQString &);
- void layoutChange();
+ void tqlayoutChange();
public slots:
void selectionChanged(int which);
diff --git a/kmahjongg/Tileset.cpp b/kmahjongg/Tileset.cpp
index b7e04f4e..fb4b1d05 100644
--- a/kmahjongg/Tileset.cpp
+++ b/kmahjongg/Tileset.cpp
@@ -16,9 +16,9 @@ static unsigned char mini_bits[] = {
0xff, 0xff, 0x0f, 0xff, 0xff, 0x0f, 0xff, 0xff, 0x07, 0xff, 0xff, 0x03,
};
-#define mask_width 40
-#define mask_height 56
-static unsigned char mask_bits[] = {
+#define tqmask_width 40
+#define tqmask_height 56
+static unsigned char tqmask_bits[] = {
0xf0, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff,
0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
@@ -48,8 +48,8 @@ static unsigned char mask_bits[] = {
// ---------------------------------------------------------
Tileset::Tileset(bool scale):
- maskBits(mask_width, mask_height, mask_bits, true),
- maskBitsMini(mini_width, mini_height, mini_bits, true)
+ tqmaskBits(tqmask_width, tqmask_height, tqmask_bits, true),
+ tqmaskBitsMini(mini_width, mini_height, mini_bits, true)
{
isScaled = scale;
divisor = (isScaled) ? 2 : 1;
@@ -62,12 +62,12 @@ Tileset::Tileset(bool scale):
s = w*h; // RGBA's required per tile
// Allocate memory for the 9*5 tile arrays
- tiles = new QRgb [9*5*s];
- selectedTiles = new QRgb [9*5*s];
+ tiles = new TQRgb [9*5*s];
+ selectedTiles = new TQRgb [9*5*s];
// allocate memory for single tile storage
- selectedFace = new QRgb [s];
- unselectedFace = new QRgb [s];
+ selectedFace = new TQRgb [s];
+ unselectedFace = new TQRgb [s];
// quarter widths are used as an offset when
// overlaying tiles in 3 dimensions.
@@ -94,14 +94,14 @@ Tileset::~Tileset() {
// method returns the address of the byte after the copied image
// and can be used to fill a larger array of tiles.
-QRgb *Tileset::copyTileImage(short tileX, short tileY, QRgb *to, TQImage &from) {
- QRgb *dest = to;
- QRgb *src;
+TQRgb *Tileset::copyTileImage(short tileX, short tileY, TQRgb *to, TQImage &from) {
+ TQRgb *dest = to;
+ TQRgb *src;
- src = (QRgb *) from.scanLine(tileY * h)
+ src = (TQRgb *) from.scanLine(tileY * h)
+(tileX * w);
for (short pos=0; pos < h; pos++) {
- memcpy(dest, src, w*sizeof(QRgb));
+ memcpy(dest, src, w*sizeof(TQRgb));
dest+=w;
src += from.width();
}
@@ -117,16 +117,16 @@ QRgb *Tileset::copyTileImage(short tileX, short tileY, QRgb *to, TQImage &from)
// color).
-QRgb *Tileset::createTile(short x, short y,
- QRgb *det, TQImage &allTiles , QRgb *face) {
- QRgb *image ;
- QRgb *to = det;
+TQRgb *Tileset::createTile(short x, short y,
+ TQRgb *det, TQImage &allTiles , TQRgb *face) {
+ TQRgb *image ;
+ TQRgb *to = det;
// Alloc the space
- image = new QRgb[s];
+ image = new TQRgb[s];
// copy in the background
- memcpy(to, face, s*sizeof(QRgb));
+ memcpy(to, face, s*sizeof(TQRgb));
// get the tile gylph
copyTileImage(x, y , image, allTiles);
@@ -135,7 +135,7 @@ QRgb *Tileset::createTile(short x, short y,
// top left colour as the transparency. We step over
// the shadow and the boarder
- QRgb* src = image+ // image
+ TQRgb* src = image+ // image
ss+ // past the left shadow
bs+ // then the tile border
(bs * w); // then step past the top border
@@ -144,7 +144,7 @@ QRgb *Tileset::createTile(short x, short y,
to += (((ss+bs))+(bs*w));
- QRgb trans = *src;
+ TQRgb trans = *src;
// start after the top border rows and go through all rows
for( short YP=0; YP < h-ss - (2*bs); YP++) {
@@ -173,17 +173,17 @@ QRgb *Tileset::createTile(short x, short y,
// version, which can be used for mini tile requirements.
// this gives us a small tile for previews and showing
// removed tiles.
-void Tileset::createPixmap(QRgb *src, TQPixmap &dest, bool scale, bool shadow)
+void Tileset::createPixmap(TQRgb *src, TQPixmap &dest, bool scale, bool shadow)
{
TQImage buff;
- QRgb *line;
+ TQRgb *line;
buff.create(w, h, 32);
for (int y=0; y<h; y++) {
- line = (QRgb *) buff.scanLine(y);
- memcpy( line, src, w*sizeof(QRgb));
+ line = (TQRgb *) buff.scanLine(y);
+ memcpy( line, src, w*sizeof(TQRgb));
if (shadow) {
for (int spos=0; spos <w; spos++) {
@@ -195,13 +195,13 @@ void Tileset::createPixmap(QRgb *src, TQPixmap &dest, bool scale, bool shadow)
}
- // create the pixmap and initialise the drawing mask
+ // create the pixmap and initialise the drawing tqmask
if (!scale) {
dest.convertFromImage(buff);
- dest.setMask(maskBits);
+ dest.setMask(tqmaskBits);
} else {
dest.convertFromImage(buff.smoothScale(w/2, h/2));
- dest.setMask(maskBitsMini);
+ dest.setMask(tqmaskBitsMini);
}
}
@@ -212,10 +212,10 @@ bool Tileset::loadTileset( const TQString& tilesetPath, const bool isPreview)
{
TQImage qiTiles;
- QRgb *unsel;
- QRgb *sel;
- QRgb *nextSel=0;
- QRgb *nextUnsel=0;
+ TQRgb *unsel;
+ TQRgb *sel;
+ TQRgb *nextSel=0;
+ TQRgb *nextUnsel=0;
if (filename == tilesetPath) {
return true;
diff --git a/kmahjongg/Tileset.h b/kmahjongg/Tileset.h
index 3c09a37c..f728dfb0 100644
--- a/kmahjongg/Tileset.h
+++ b/kmahjongg/Tileset.h
@@ -10,14 +10,14 @@ class Tileset {
~Tileset();
bool loadTileset(const TQString &filesetPath, const bool isPreview = false);
- QRgb *createTile(short x, short y, QRgb *dst, TQImage &src , QRgb *face);
- QRgb *copyTileImage(short tileX, short tileY, QRgb *to, TQImage &from);
+ TQRgb *createTile(short x, short y, TQRgb *dst, TQImage &src , TQRgb *face);
+ TQRgb *copyTileImage(short tileX, short tileY, TQRgb *to, TQImage &from);
void setScaled(bool sc) {isScaled = sc; divisor = (sc) ? 2 : 1;}
- QRgb *tile(short tnum);
- QRgb *selectedTile(short tnum);
+ TQRgb *tile(short tnum);
+ TQRgb *selectedTile(short tnum);
short width() {return w/divisor;}
short height() {return h/divisor;}
short shadowSize() {return ss/divisor;}
@@ -57,18 +57,18 @@ class Tileset {
protected:
enum { maxTiles=45 };
- void createPixmap(QRgb *src, TQPixmap &dest, bool scale, bool shadow);
+ void createPixmap(TQRgb *src, TQPixmap &dest, bool scale, bool shadow);
private:
- TQBitmap maskBits; // xbm mask for the tile
- TQBitmap maskBitsMini; // xbm mask for the tile
- QRgb* tiles; // Buffer containing all tiles (unselected glyphs)
- QRgb* selectedTiles; // Buffer containing all tiles (selected glyphs)
+ TQBitmap tqmaskBits; // xbm tqmask for the tile
+ TQBitmap tqmaskBitsMini; // xbm tqmask for the tile
+ TQRgb* tiles; // Buffer containing all tiles (unselected glyphs)
+ TQRgb* selectedTiles; // Buffer containing all tiles (selected glyphs)
// in version 0.5 we have moved ftom using images and calculating
- // masks etc, to using pixmaps and letting the blt do the hard work,
+ // tqmasks etc, to using pixmaps and letting the blt do the hard work,
// in hardware.
TQPixmap selectedPix[maxTiles]; // selected tiles
TQPixmap unselectedPix[maxTiles]; // unselected tiles
@@ -83,10 +83,10 @@ class Tileset {
- QRgb* selectedFace; // The tile background face for a selected tile
- QRgb* unselectedFace;// The tile background face for an unselected tile
+ TQRgb* selectedFace; // The tile background face for a selected tile
+ TQRgb* unselectedFace;// The tile background face for an unselected tile
- QRgb tr; // transparenct color for tile bg
+ TQRgb tr; // transparenct color for tile bg
short ss; // left/bottom shadow width
short bs; // width of the border around a tile
diff --git a/kmahjongg/boardwidget.cpp b/kmahjongg/boardwidget.cpp
index c8a5cd61..615091ab 100644
--- a/kmahjongg/boardwidget.cpp
+++ b/kmahjongg/boardwidget.cpp
@@ -14,8 +14,8 @@
* Constructor.
* Loads tileset and background bitmaps.
*/
-BoardWidget::BoardWidget( TQWidget* parent, const char *name )
- : TQWidget( parent, name ), theTiles(false)
+BoardWidget::BoardWidget( TQWidget* tqparent, const char *name )
+ : TQWidget( tqparent, name ), theTiles(false)
{
setBackgroundColor( TQColor( 0,0,0 ) );
@@ -45,7 +45,7 @@ BoardWidget::BoardWidget( TQWidget* parent, const char *name )
if (!loadTileset(tFile)){
KMessageBox::error(this,
i18n("An error occurred when loading the tileset file %1\n"
- "KMahjongg will now terminate.").arg(tFile));
+ "KMahjongg will now terminate.").tqarg(tFile));
kapp->quit();
}
@@ -55,17 +55,17 @@ BoardWidget::BoardWidget( TQWidget* parent, const char *name )
if( ! loadBackground(tFile, false ) )
{
KMessageBox::error(this,
- i18n("An error occurred when loading the background image\n%1").arg(tFile)+
+ i18n("An error occurred when loading the background image\n%1").tqarg(tFile)+
i18n("KMahjongg will now terminate."));
kapp->quit();
}
- getFileOrDefault(Prefs::layout(), "layout", tFile);
+ getFileOrDefault(Prefs::layout(), "tqlayout", tFile);
if( ! loadBoardLayout(tFile) )
{
KMessageBox::error(this,
- i18n("An error occurred when loading the board layout %1\n"
- "KMahjongg will now terminate.").arg(tFile));
+ i18n("An error occurred when loading the board tqlayout %1\n"
+ "KMahjongg will now terminate.").tqarg(tFile));
kapp->quit();
}
setDisplayedWidth();
@@ -92,7 +92,7 @@ void BoardWidget::saveSettings(){
//config->writePathEntry("Tileset_file", tileFile);
//config->writePathEntry("Background_file", backgroundFile);
- //config->writePathEntry("Layout_file", layout);
+ //config->writePathEntry("Layout_file", tqlayout);
}
void BoardWidget::getFileOrDefault(TQString filename, TQString type, TQString &res)
@@ -111,7 +111,7 @@ void BoardWidget::getFileOrDefault(TQString filename, TQString type, TQString &r
if (res.isEmpty()) {
KMessageBox::error(this, i18n("KMahjongg could not locate the file: %1\n"
"or the default file of type: %2\n"
- "KMahjongg will now terminate").arg(filename).arg(type) );
+ "KMahjongg will now terminate").tqarg(filename).tqarg(type) );
kapp->quit();
}
}
@@ -264,7 +264,7 @@ void BoardWidget::paintEvent( TQPaintEvent* pa )
return;
}
- // if the repaint is because of a window redraw after a move
+ // if the tqrepaint is because of a window redraw after a move
// or a menu roll up, then just blit in the last rendered image
if (!updateBackBuffer) {
bitBlt(this, xx,pa->rect().top(),
@@ -440,7 +440,7 @@ void BoardWidget::stackTiles(unsigned char t, unsigned short h, unsigned short x
int ss = theTiles.shadowSize();
TQPainter p(&backBuffer);
TQPen line;
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setBackgroundColor(black);
@@ -766,7 +766,7 @@ void BoardWidget::calculateNewGame( int gNumber)
}
// ---------------------------------------------------------
-// Generate the position data for the layout from contents of Game.Map.
+// Generate the position data for the tqlayout from contents of Game.Map.
void BoardWidget::generateTilePositions() {
numTiles = 0;
@@ -788,7 +788,7 @@ void BoardWidget::generateTilePositions() {
}
// ---------------------------------------------------------
-// Generate the dependency data for the layout from the position data.
+// Generate the dependency data for the tqlayout from the position data.
// Note that the coordinates of each tile in tilePositions are those of
// the upper left quarter of the tile.
void BoardWidget::generatePositionDepends() {
@@ -882,7 +882,7 @@ int BoardWidget::tileAt(int x, int y, int z) {
bool BoardWidget::generateSolvableGame() {
// Initially we want to mark positions on layer 0 so that we have only
- // one free position per apparent horizontal line.
+ // one free position per aptqparent horizontal line.
for (int i = 0; i < numTiles; i++) {
// Pick a random tile on layer 0
@@ -894,7 +894,7 @@ bool BoardWidget::generateSolvableGame() {
}
} while (tilePositions[position].e != 0);
- // If there are no other free positions on the same apparent
+ // If there are no other free positions on the same aptqparent
// horizontal line, we can mark that position as free.
if (onlyFreeInLine(position)) {
positionDepends[position].free = true;
@@ -965,7 +965,7 @@ bool BoardWidget::generateSolvableGame() {
// ---------------------------------------------------------
// Determines whether it is ok to mark this position as "free" because
-// there are no other positions marked "free" in its apparent horizontal
+// there are no other positions marked "free" in its aptqparent horizontal
// line.
bool BoardWidget::onlyFreeInLine(int position) {
@@ -1104,7 +1104,7 @@ void BoardWidget::updateDepend(int position) {
}
}
- // If position is first free on apparent horizontal, it is
+ // If position is first free on aptqparent horizontal, it is
// now free to be filled.
if (onlyFreeInLine(position)) {
positionDepends[position].free = true;
@@ -1393,7 +1393,7 @@ bool BoardWidget::findMove( POSITION& posA, POSITION& posB )
iPosCount = 0; // Hier Anzahl der gefunden Paare merken
- // The new tile layout with non-contiguos horizantle spans
+ // The new tile tqlayout with non-contiguos horizantle spans
// can lead to huge numbers of matching pairs being exposed.
// we alter the loop to bail out when BoardLayout::maxTiles/2 pairs are found
// (or less);
@@ -1623,7 +1623,7 @@ void BoardWidget::mousePressEvent ( TQMouseEvent* event )
if (gamePaused)
return;
- if( event->button() == LeftButton )
+ if( event->button() == Qt::LeftButton )
{
if( TimerState == Demo )
{
@@ -1804,7 +1804,7 @@ bool BoardWidget::loadBackground(
if( ! theBackground.load( pszFileName, requiredWidth(), requiredHeight()) )
{
if( bShowError )
- KMessageBox::sorry(this, i18n("Failed to load image:\n%1").arg(pszFileName) );
+ KMessageBox::sorry(this, i18n("Failed to load image:\n%1").tqarg(pszFileName) );
return( false );
}
Prefs::setBackground(pszFileName);
@@ -2010,7 +2010,7 @@ void BoardWidget::shuffle() {
// force a redraw
updateBackBuffer=true;
- repaint(false);
+ tqrepaint(false);
// I consider this s very bad cheat so, I punish the user
diff --git a/kmahjongg/boardwidget.h b/kmahjongg/boardwidget.h
index 3fe7c3b7..749f5452 100644
--- a/kmahjongg/boardwidget.h
+++ b/kmahjongg/boardwidget.h
@@ -86,12 +86,13 @@ typedef struct gamedata {
/**
* @author Mathias Mueller
*/
-class BoardWidget : public QWidget
+class BoardWidget : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- BoardWidget( TQWidget* parent = 0, const char *name = 0 );
+ BoardWidget( TQWidget* tqparent = 0, const char *name = 0 );
~BoardWidget();
void calculateNewGame(int num = -1 );
@@ -204,7 +205,7 @@ class BoardWidget : public QWidget
- bool updateBackBuffer; // does board need redrawing. Not if it is just a repaint
+ bool updateBackBuffer; // does board need redrawing. Not if it is just a tqrepaint
bool gamePaused;
diff --git a/kmahjongg/kmahjongg.cpp b/kmahjongg/kmahjongg.cpp
index dd49fedd..d9f20522 100644
--- a/kmahjongg/kmahjongg.cpp
+++ b/kmahjongg/kmahjongg.cpp
@@ -4,7 +4,7 @@
kmahjongg, the classic mahjongg game for KDE project
- Requires the Qt widget libraries, available at no cost at
+ Requires the TQt widget libraries, available at no cost at
http://www.troll.no
Copyright (C) 1997 Mathias Mueller <in5y158@public.uni-hamburg.de>
@@ -57,8 +57,8 @@ int is_paused = 0;
/**
Constructor.
*/
-KMahjongg::KMahjongg( TQWidget* parent, const char *name)
- : KMainWindow(parent, name)
+KMahjongg::KMahjongg( TQWidget* tqparent, const char *name)
+ : KMainWindow(tqparent, name)
{
boardEditor = 0;
@@ -100,7 +100,7 @@ KMahjongg::KMahjongg( TQWidget* parent, const char *name)
connect( previewLoad, TQT_SIGNAL( boardRedraw(bool) ),
bw, TQT_SLOT( drawBoard(bool) ) );
- connect( previewLoad, TQT_SIGNAL( layoutChange() ),
+ connect( previewLoad, TQT_SIGNAL( tqlayoutChange() ),
this, TQT_SLOT( newGame() ) );
@@ -128,41 +128,41 @@ KMahjongg::~KMahjongg()
void KMahjongg::setupKAction()
{
// game
- KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection());
- KStdGameAction::load(this, TQT_SLOT(loadGame()), actionCollection());
- KStdGameAction::save(this, TQT_SLOT(saveGame()), actionCollection());
- KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection());
- KStdGameAction::restart(this, TQT_SLOT(restartGame()), actionCollection());
- new KAction(i18n("New Numbered Game..."), "newnum", 0, this, TQT_SLOT(startNewNumeric()), actionCollection(), "game_new_numeric");
- new KAction(i18n("Open Th&eme..."), 0, this, TQT_SLOT(openTheme()), actionCollection(), "game_open_theme");
- new KAction(i18n("Open &Tileset..."), 0, this, TQT_SLOT(openTileset()), actionCollection(), "game_open_tileset");
- new KAction(i18n("Open &Background..."), 0, this, TQT_SLOT(openBackground()), actionCollection(), "game_open_background");
- new KAction(i18n("Open La&yout..."), 0, this, TQT_SLOT(openLayout()), actionCollection(), "game_open_layout");
- new KAction(i18n("Sa&ve Theme..."), 0, this, TQT_SLOT(saveTheme()), actionCollection(), "game_save_theme");
+ KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection());
+ KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(loadGame()), actionCollection());
+ KStdGameAction::save(TQT_TQOBJECT(this), TQT_SLOT(saveGame()), actionCollection());
+ KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection());
+ KStdGameAction::restart(TQT_TQOBJECT(this), TQT_SLOT(restartGame()), actionCollection());
+ new KAction(i18n("New Numbered Game..."), "newnum", 0, TQT_TQOBJECT(this), TQT_SLOT(startNewNumeric()), actionCollection(), "game_new_numeric");
+ new KAction(i18n("Open Th&eme..."), 0, TQT_TQOBJECT(this), TQT_SLOT(openTheme()), actionCollection(), "game_open_theme");
+ new KAction(i18n("Open &Tileset..."), 0, TQT_TQOBJECT(this), TQT_SLOT(openTileset()), actionCollection(), "game_open_tileset");
+ new KAction(i18n("Open &Background..."), 0, TQT_TQOBJECT(this), TQT_SLOT(openBackground()), actionCollection(), "game_open_background");
+ new KAction(i18n("Open La&yout..."), 0, TQT_TQOBJECT(this), TQT_SLOT(openLayout()), actionCollection(), "game_open_layout");
+ new KAction(i18n("Sa&ve Theme..."), 0, TQT_TQOBJECT(this), TQT_SLOT(saveTheme()), actionCollection(), "game_save_theme");
// originally "file" ends here
- KStdGameAction::hint(bw, TQT_SLOT(helpMove()), actionCollection());
- new KAction(i18n("Shu&ffle"), "reload", 0, bw, TQT_SLOT(shuffle()), actionCollection(), "move_shuffle");
- demoAction = KStdGameAction::demo(this, TQT_SLOT(demoMode()), actionCollection());
- showMatchingTilesAction = new KToggleAction(i18n("Show &Matching Tiles"), 0, this, TQT_SLOT(showMatchingTiles()), actionCollection(), "options_show_matching_tiles");
+ KStdGameAction::hint(TQT_TQOBJECT(bw), TQT_SLOT(helpMove()), actionCollection());
+ new KAction(i18n("Shu&ffle"), "reload", 0, TQT_TQOBJECT(bw), TQT_SLOT(shuffle()), actionCollection(), "move_shuffle");
+ demoAction = KStdGameAction::demo(TQT_TQOBJECT(this), TQT_SLOT(demoMode()), actionCollection());
+ showMatchingTilesAction = new KToggleAction(i18n("Show &Matching Tiles"), 0, TQT_TQOBJECT(this), TQT_SLOT(showMatchingTiles()), actionCollection(), "options_show_matching_tiles");
showMatchingTilesAction->setCheckedState(i18n("Hide &Matching Tiles"));
showMatchingTilesAction->setChecked(Prefs::showMatchingTiles());
bw->setShowMatch( Prefs::showMatchingTiles() );
- KStdGameAction::highscores(this, TQT_SLOT(showHighscores()), actionCollection());
- pauseAction = KStdGameAction::pause(this, TQT_SLOT(pause()), actionCollection());
+ KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighscores()), actionCollection());
+ pauseAction = KStdGameAction::pause(TQT_TQOBJECT(this), TQT_SLOT(pause()), actionCollection());
// TODO: store the background ; open on startup
- // TODO: same about layout
+ // TODO: same about tqlayout
// TODO: same about theme
// move
- undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection());
- redoAction = KStdGameAction::redo(this, TQT_SLOT(redo()), actionCollection());
+ undoAction = KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection());
+ redoAction = KStdGameAction::redo(TQT_TQOBJECT(this), TQT_SLOT(redo()), actionCollection());
// edit
- new KAction(i18n("&Board Editor"), 0, this, TQT_SLOT(slotBoardEditor()), actionCollection(), "edit_board_editor");
+ new KAction(i18n("&Board Editor"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotBoardEditor()), actionCollection(), "edit_board_editor");
// settings
- KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection());
+ KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showSettings()), actionCollection());
setupGUI();
}
@@ -179,19 +179,19 @@ void KMahjongg::setupStatusBar()
tilesLeftLabel= new TQLabel("Removed: 0000/0000", statusBar());
tilesLeftLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
- statusBar()->addWidget(tilesLeftLabel, tilesLeftLabel->sizeHint().width(), ID_STATUS_GAME);
+ statusBar()->addWidget(tilesLeftLabel, tilesLeftLabel->tqsizeHint().width(), ID_STATUS_GAME);
gameNumLabel = new TQLabel("Game: 000000000000000000000", statusBar());
gameNumLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
- statusBar()->addWidget(gameNumLabel, gameNumLabel->sizeHint().width(), ID_STATUS_TILENUMBER);
+ statusBar()->addWidget(gameNumLabel, gameNumLabel->tqsizeHint().width(), ID_STATUS_TILENUMBER);
statusLabel= new TQLabel("Kmahjongg", statusBar());
statusLabel->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
- statusBar()->addWidget(statusLabel, statusLabel->sizeHint().width(), ID_STATUS_MESSAGE);
+ statusBar()->addWidget(statusLabel, statusLabel->tqsizeHint().width(), ID_STATUS_MESSAGE);
- // pStatusBar->setAlignment( ID_STATUS_TILENUMBER, AlignCenter );
+ // pStatusBar->tqsetAlignment( ID_STATUS_TILENUMBER, AlignCenter );
}
void KMahjongg::setDisplayedWidth()
@@ -239,7 +239,7 @@ void KMahjongg::showSettings(){
KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs::self(), KDialogBase::Swallow);
dialog->addPage(new Settings(0, "General"), i18n("General"), "package_settings");
connect(dialog, TQT_SIGNAL(settingsChanged()), bw, TQT_SLOT(loadSettings()));
- connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(setDisplayedWidth()));
+ connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_TQOBJECT(this), TQT_SLOT(setDisplayedWidth()));
dialog->show();
}
@@ -397,7 +397,7 @@ void KMahjongg::gameOver(
void KMahjongg::showStatusText( const TQString &msg, long board )
{
statusLabel->setText(msg);
- TQString str = i18n("Game number: %1").arg(board);
+ TQString str = i18n("Game number: %1").tqarg(board);
gameNumLabel->setText(str);
}
@@ -406,8 +406,8 @@ void KMahjongg::showStatusText( const TQString &msg, long board )
void KMahjongg::showTileNumber( int iMaximum, int iCurrent, int iLeft )
{
// Hmm... seems iCurrent is the number of remaining tiles, not removed ...
- //TQString szBuffer = i18n("Removed: %1/%2").arg(iCurrent).arg(iMaximum);
- TQString szBuffer = i18n("Removed: %1/%2 Combinations left: %3").arg(iMaximum-iCurrent).arg(iMaximum).arg(iLeft);
+ //TQString szBuffer = i18n("Removed: %1/%2").tqarg(iCurrent).tqarg(iMaximum);
+ TQString szBuffer = i18n("Removed: %1/%2 Combinations left: %3").tqarg(iMaximum-iCurrent).tqarg(iMaximum).tqarg(iLeft);
tilesLeftLabel->setText(szBuffer);
// Update here since undo allow is effected by demo mode
diff --git a/kmahjongg/kmahjongg.h b/kmahjongg/kmahjongg.h
index a1e14efa..54c5ca92 100644
--- a/kmahjongg/kmahjongg.h
+++ b/kmahjongg/kmahjongg.h
@@ -4,7 +4,7 @@
kmahjongg, the classic mahjongg game for KDE project
- Requires the Qt widget libraries, available at no cost at
+ Requires the TQt widget libraries, available at no cost at
http://www.troll.no
Copyright (C) 1997 Mathias Mueller <in5y158@public.uni-hamburg.de>
@@ -51,9 +51,10 @@ class TQLabel;
class KMahjongg : public KMainWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
- KMahjongg( TQWidget* parent = 0, const char *name = 0);
+ KMahjongg( TQWidget* tqparent = 0, const char *name = 0);
~KMahjongg();
public slots:
diff --git a/kmahjongg/pics/cross.layout b/kmahjongg/pics/cross.layout
index 39c58f1e..de71a115 100644
--- a/kmahjongg/pics/cross.layout
+++ b/kmahjongg/pics/cross.layout
@@ -1,4 +1,4 @@
-kmahjongg-layout-v1.0
+kmahjongg-tqlayout-v1.0
12....12121212121212121212....12
4312..43434343434343434343..1243
124312........1212........124312
diff --git a/kmahjongg/pics/default.layout b/kmahjongg/pics/default.layout
index f72ed794..005254ed 100644
--- a/kmahjongg/pics/default.layout
+++ b/kmahjongg/pics/default.layout
@@ -1,4 +1,4 @@
-kmahjongg-layout-v1.0
+kmahjongg-tqlayout-v1.0
# Level 0 -------------------------
...121212121212121212121212.....
...434343434343434343434343.....
diff --git a/kmahjongg/pics/default.theme b/kmahjongg/pics/default.theme
index 9ba994bc..49502e04 100644
--- a/kmahjongg/pics/default.theme
+++ b/kmahjongg/pics/default.theme
@@ -1,4 +1,4 @@
kmahjongg-theme-v1.0
:default.tileset
:default.bgnd
-:default.layout
+:default.tqlayout
diff --git a/kmahjongg/pics/pirates.layout b/kmahjongg/pics/pirates.layout
index c5bb895c..3cce44e3 100644
--- a/kmahjongg/pics/pirates.layout
+++ b/kmahjongg/pics/pirates.layout
@@ -1,4 +1,4 @@
-kmahjongg-layout-v1.0
+kmahjongg-tqlayout-v1.0
.............121212.......12..12
.............434343.......43..43
.............12.............12..
diff --git a/kmahjongg/pics/pirates.theme b/kmahjongg/pics/pirates.theme
index 748b3ffa..51b6ec88 100644
--- a/kmahjongg/pics/pirates.theme
+++ b/kmahjongg/pics/pirates.theme
@@ -1,5 +1,5 @@
kmahjongg-theme-v1.0
:pirates.tileset
:pirates.bgnd
-:pirates.layout
+:pirates.tqlayout
diff --git a/kmahjongg/pics/pyramid.layout b/kmahjongg/pics/pyramid.layout
index edd634dc..0239212b 100644
--- a/kmahjongg/pics/pyramid.layout
+++ b/kmahjongg/pics/pyramid.layout
@@ -1,4 +1,4 @@
-kmahjongg-layout-v1.0
+kmahjongg-tqlayout-v1.0
# Level 0 -------------------------
....121212121212121212121212....
....434343434343434343434343....
diff --git a/kmahjongg/pics/stax.layout b/kmahjongg/pics/stax.layout
index f5595dca..abc7e969 100644
--- a/kmahjongg/pics/stax.layout
+++ b/kmahjongg/pics/stax.layout
@@ -1,4 +1,4 @@
-kmahjongg-layout-v1.0
+kmahjongg-tqlayout-v1.0
................................
12121212..121212121212..12121212
43434343..434343434343..43434343
diff --git a/kmahjongg/pics/test.layout b/kmahjongg/pics/test.layout
index d46a4e21..2c76ddec 100644
--- a/kmahjongg/pics/test.layout
+++ b/kmahjongg/pics/test.layout
@@ -1,4 +1,4 @@
-kmahjongg-layout-v1.0
+kmahjongg-tqlayout-v1.0
.1212121212121212121212121212...
.4343434343434343434343434343...
.1212121212121212121212121212...
diff --git a/kmahjongg/pics/test2.layout b/kmahjongg/pics/test2.layout
index aedc6290..9ab29fdf 100644
--- a/kmahjongg/pics/test2.layout
+++ b/kmahjongg/pics/test2.layout
@@ -1,4 +1,4 @@
-kmahjongg-layout-v1.0
+kmahjongg-tqlayout-v1.0
................................
................................
.121212121212121212.............
diff --git a/kmahjongg/pics/tower.layout b/kmahjongg/pics/tower.layout
index 76fe96a0..3ca7bfc6 100644
--- a/kmahjongg/pics/tower.layout
+++ b/kmahjongg/pics/tower.layout
@@ -1,4 +1,4 @@
-kmahjongg-layout-v1.0
+kmahjongg-tqlayout-v1.0
# Level 0 -------------------------
....121212121212121212121212....
....434343434343434343434343....
diff --git a/kmahjongg/pics/triangle.layout b/kmahjongg/pics/triangle.layout
index e1dd4891..e04c405a 100644
--- a/kmahjongg/pics/triangle.layout
+++ b/kmahjongg/pics/triangle.layout
@@ -1,4 +1,4 @@
-kmahjongg-layout-v1.0
+kmahjongg-tqlayout-v1.0
# Level 0 -------------------------
.121212121212121212121212121212.
.434343434343434343434343434343.
diff --git a/kmahjongg/settings.ui b/kmahjongg/settings.ui
index e53c6e37..81f40b8a 100644
--- a/kmahjongg/settings.ui
+++ b/kmahjongg/settings.ui
@@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>Settings</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>Settings</cstring>
</property>
- <property name="geometry">
+ <property name="tqgeometry">
<rect>
<x>0</x>
<y>0</y>
@@ -22,7 +22,7 @@
<property name="spacing">
<number>0</number>
</property>
- <widget class="QFrame">
+ <widget class="TQFrame">
<property name="name">
<cstring>frame3</cstring>
</property>
@@ -39,7 +39,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="2">
+ <widget class="TQGroupBox" row="0" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>groupBox1</cstring>
</property>
@@ -50,7 +50,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>kcfg_ShowRemoved</cstring>
</property>
@@ -58,7 +58,7 @@
<string>Show removed tiles</string>
</property>
</widget>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>kcfg_SolvableGames</cstring>
</property>
@@ -69,7 +69,7 @@
<bool>true</bool>
</property>
</widget>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>kcfg_PlayAnimation</cstring>
</property>
@@ -92,14 +92,14 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>16</height>
</size>
</property>
</spacer>
- <widget class="QButtonGroup" row="1" column="1">
+ <widget class="TQButtonGroup" row="1" column="1">
<property name="name">
<cstring>kcfg_TiledBackground</cstring>
</property>
@@ -110,7 +110,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QRadioButton">
+ <widget class="TQRadioButton">
<property name="name">
<cstring>Background_scale</cstring>
</property>
@@ -118,7 +118,7 @@
<string>Scale</string>
</property>
</widget>
- <widget class="QRadioButton">
+ <widget class="TQRadioButton">
<property name="name">
<cstring>Background_tiled</cstring>
</property>
@@ -131,7 +131,7 @@
</widget>
</vbox>
</widget>
- <widget class="QGroupBox" row="1" column="0">
+ <widget class="TQGroupBox" row="1" column="0">
<property name="name">
<cstring>groupBox2</cstring>
</property>
@@ -142,7 +142,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>kcfg_ShowShadows</cstring>
</property>
@@ -153,7 +153,7 @@
<bool>false</bool>
</property>
</widget>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>kcfg_MiniTiles</cstring>
</property>
@@ -167,5 +167,5 @@
</widget>
</vbox>
</widget>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
</UI>