summaryrefslogtreecommitdiffstats
path: root/ktuberling
diff options
context:
space:
mode:
Diffstat (limited to 'ktuberling')
-rw-r--r--ktuberling/pics/layout.i18n2
-rw-r--r--ktuberling/pics/layout.xml8
-rw-r--r--ktuberling/playground.cpp84
-rw-r--r--ktuberling/playground.h15
-rw-r--r--ktuberling/soundfactory.cpp32
-rw-r--r--ktuberling/soundfactory.h9
-rw-r--r--ktuberling/todraw.cpp10
-rw-r--r--ktuberling/toplevel.cpp108
-rw-r--r--ktuberling/toplevel.h3
9 files changed, 137 insertions, 134 deletions
diff --git a/ktuberling/pics/layout.i18n b/ktuberling/pics/layout.i18n
index 373203cb..85c63ed9 100644
--- a/ktuberling/pics/layout.i18n
+++ b/ktuberling/pics/layout.i18n
@@ -1,6 +1,6 @@
/* -------------------------------------------------------------
KDE Tuberling
- List of strings in layout.xml that are translatable
+ List of strings in tqlayout.xml that are translatable
mailto:e.bischoff@noos.fr
------------------------------------------------------------- */
diff --git a/ktuberling/pics/layout.xml b/ktuberling/pics/layout.xml
index c5b02fb8..84b09a2a 100644
--- a/ktuberling/pics/layout.xml
+++ b/ktuberling/pics/layout.xml
@@ -5,13 +5,13 @@
Modify this file if you want to add new playgrounds, new sounds,
or modify existing ones. If you do that, don't forget to update:
- - layout.i18n (strings that might be translated)
+ - tqlayout.i18n (strings that might be translated)
- ktuberlingui.rc (actions associated with menu items).
-->
<ktuberling>
- <playground gameboard="potato-game.png" masks="potato-mask.png">
+ <playground gameboard="potato-game.png" tqmasks="potato-tqmask.png">
<menuitem action="playground_potato_guy">
<label>Potato &amp;Guy</label>
@@ -269,7 +269,7 @@
</playground>
- <playground gameboard="penguin-game.png" masks="penguin-mask.png">
+ <playground gameboard="penguin-game.png" tqmasks="penguin-tqmask.png">
<menuitem action="playground_penguin">
<label>&amp;Penguin</label>
@@ -422,7 +422,7 @@
</playground>
- <playground gameboard="aquarium-game.png" masks="aquarium-mask.png">
+ <playground gameboard="aquarium-game.png" tqmasks="aquarium-tqmask.png">
<menuitem action="playground_aquarium">
<label>&amp;Aquarium</label>
diff --git a/ktuberling/playground.cpp b/ktuberling/playground.cpp
index 4488fe8d..760ad9b8 100644
--- a/ktuberling/playground.cpp
+++ b/ktuberling/playground.cpp
@@ -24,10 +24,10 @@
#define YMARGIN 5
// Constructor
-PlayGround::PlayGround(TopLevel *parent, const char *name, uint selectedGameboard)
- : TQWidget(parent, name)
+PlayGround::PlayGround(TopLevel *tqparent, const char *name, uint selectedGameboard)
+ : TQWidget(tqparent, name)
{
- topLevel = parent;
+ topLevel = tqparent;
textsLayout = objectsLayout = 0;
textsList = soundsList = 0;
@@ -38,10 +38,10 @@ PlayGround::PlayGround(TopLevel *parent, const char *name, uint selectedGameboar
setBackgroundColor(white);
- TQDomDocument layoutsDocument;
- bool ok = topLevel->loadLayout(layoutsDocument);
- if (ok) ok = registerPlayGrounds(layoutsDocument);
- if (ok) ok = loadPlayGround(layoutsDocument, selectedGameboard);
+ TQDomDocument tqlayoutsDocument;
+ bool ok = topLevel->loadLayout(tqlayoutsDocument);
+ if (ok) ok = registerPlayGrounds(tqlayoutsDocument);
+ if (ok) ok = loadPlayGround(tqlayoutsDocument, selectedGameboard);
if (!ok) loadFailure();
currentAction = 0;
@@ -71,9 +71,9 @@ void PlayGround::reset()
// Change the gameboard
void PlayGround::change(uint selectedGameboard)
{
- TQDomDocument layoutsDocument;
- bool ok = topLevel->loadLayout(layoutsDocument);
- if (ok) ok = loadPlayGround(layoutsDocument, selectedGameboard);
+ TQDomDocument tqlayoutsDocument;
+ bool ok = topLevel->loadLayout(tqlayoutsDocument);
+ if (ok) ok = loadPlayGround(tqlayoutsDocument, selectedGameboard);
if (!ok) loadFailure();
toDraw.clear();
@@ -86,7 +86,7 @@ void PlayGround::change(uint selectedGameboard)
}
// Repaint all the editable area
-void PlayGround::repaintAll()
+void PlayGround::tqrepaintAll()
{
TQRect dirtyArea
(editableArea.left() - 10,
@@ -94,7 +94,7 @@ void PlayGround::repaintAll()
editableArea.width() + 20,
editableArea.height() + 20);
- repaint(dirtyArea, false);
+ tqrepaint(dirtyArea, false);
}
// Undo last action
@@ -221,7 +221,7 @@ void PlayGround::drawGameboard( TQPainter &artist, const TQRect &area ) const
for (TQPtrListIterator<ToDraw> currentObject(toDraw);
currentObject.current();
++currentObject)
- currentObject.current()->draw(artist, area, objectsLayout, &gameboard, &masks);
+ currentObject.current()->draw(artist, area, objectsLayout, &gameboard, &tqmasks);
}
// Painting event
@@ -241,7 +241,7 @@ void PlayGround::paintEvent( TQPaintEvent *event )
drawGameboard(artist, area);
- bitBlt(this, destination, &cache, area, Qt::CopyROP);
+ bitBlt(this, destination, &cache, area, TQt::CopyROP);
}
// Mouse pressed event
@@ -255,10 +255,10 @@ void PlayGround::mousePressEvent( TQMouseEvent *event )
int draggedNumber = draggedObject.getNumber();
TQPixmap object(objectsLayout[draggedNumber].size());
- TQBitmap shape(objectsLayout[draggedNumber].size());
- bitBlt(&object, TQPoint(0, 0), &gameboard, objectsLayout[draggedNumber], Qt::CopyROP);
- bitBlt(&shape, TQPoint(0, 0), &masks, objectsLayout[draggedNumber], Qt::CopyROP);
- object.setMask(shape);
+ TQBitmap tqshape(objectsLayout[draggedNumber].size());
+ bitBlt(&object, TQPoint(0, 0), &gameboard, objectsLayout[draggedNumber], TQt::CopyROP);
+ bitBlt(&tqshape, TQPoint(0, 0), &tqmasks, objectsLayout[draggedNumber], TQt::CopyROP);
+ object.setMask(tqshape);
draggedCursor = new TQCursor(object, position.x(), position.y());
setCursor(*draggedCursor);
@@ -293,7 +293,7 @@ void PlayGround::mouseReleaseEvent( TQMouseEvent *event )
setCursor(arrow);
// If we are not moving the object to the editable area
- if (!dirtyArea.contains(event->pos()))
+ if (!dirtyArea.tqcontains(event->pos()))
{
// ... then register its deletion (if coming from the editable area), and return
if (draggedZOrder == -1) return;
@@ -320,18 +320,18 @@ void PlayGround::mouseReleaseEvent( TQMouseEvent *event )
// Repaint the editable area
position.moveBy(XMARGIN, YMARGIN);
- repaint(position, false);
+ tqrepaint(position, false);
}
// Register the various playgrounds
-bool PlayGround::registerPlayGrounds(TQDomDocument &layoutDocument)
+bool PlayGround::registerPlayGrounds(TQDomDocument &tqlayoutDocument)
{
TQDomNodeList playGroundsList, menuItemsList, labelsList;
TQDomElement playGroundElement, menuItemElement, labelElement;
TQDomAttr actionAttribute;
- playGroundsList = layoutDocument.elementsByTagName("playground");
+ playGroundsList = tqlayoutDocument.elementsByTagName("playground");
if (playGroundsList.count() < 1)
return false;
@@ -357,20 +357,20 @@ bool PlayGround::registerPlayGrounds(TQDomDocument &layoutDocument)
return true;
}
-// Load background and draggable objects masks
-bool PlayGround::loadPlayGround(TQDomDocument &layoutDocument, uint toLoad)
+// Load background and draggable objects tqmasks
+bool PlayGround::loadPlayGround(TQDomDocument &tqlayoutDocument, uint toLoad)
{
TQDomNodeList playGroundsList,
editableAreasList, categoriesList, objectsList,
- gameAreasList, maskAreasList, soundNamesList, labelsList;
+ gameAreasList, tqmaskAreasList, soundNamesList, labelsList;
TQDomElement playGroundElement,
editableAreaElement, categoryElement, objectElement,
- gameAreaElement, maskAreaElement, soundNameElement, labelElement;
- TQDomAttr gameboardAttribute, masksAttribute,
+ gameAreaElement, tqmaskAreaElement, soundNameElement, labelElement;
+ TQDomAttr gameboardAttribute, tqmasksAttribute,
leftAttribute, topAttribute, rightAttribute, bottomAttribute,
refAttribute;
- playGroundsList = layoutDocument.elementsByTagName("playground");
+ playGroundsList = tqlayoutDocument.elementsByTagName("playground");
if (toLoad >= playGroundsList.count())
return false;
@@ -380,8 +380,8 @@ bool PlayGround::loadPlayGround(TQDomDocument &layoutDocument, uint toLoad)
if (!gameboard.load(locate("data", "ktuberling/pics/" + gameboardAttribute.value())))
return false;
- masksAttribute = playGroundElement.attributeNode("masks");
- if (!masks.load(locate("data", "ktuberling/pics/" + masksAttribute.value())))
+ tqmasksAttribute = playGroundElement.attributeNode("tqmasks");
+ if (!tqmasks.load(locate("data", "ktuberling/pics/" + tqmasksAttribute.value())))
return false;
editableAreasList = playGroundElement.elementsByTagName("editablearea");
@@ -421,9 +421,9 @@ bool PlayGround::loadPlayGround(TQDomDocument &layoutDocument, uint toLoad)
return false;
delete[] textsLayout;
- textsLayout = new QRect[texts];
+ textsLayout = new TQRect[texts];
delete[] textsList;
- textsList = new QString[texts];
+ textsList = new TQString[texts];
for (int text = 0; text < texts; text++)
{
@@ -460,9 +460,9 @@ bool PlayGround::loadPlayGround(TQDomDocument &layoutDocument, uint toLoad)
return false;
delete[] objectsLayout;
- objectsLayout = new QRect[decorations];
+ objectsLayout = new TQRect[decorations];
delete[] soundsList;
- soundsList = new QString[decorations];
+ soundsList = new TQString[decorations];
for (int decoration = 0; decoration < decorations; decoration++)
{
@@ -506,7 +506,7 @@ void PlayGround::loadFailure()
exit(-1);
}
-// Set up play ground's geometry
+// Set up play ground's tqgeometry
void PlayGround::setupGeometry()
{
int width = gameboard.width() + 2 * XMARGIN,
@@ -524,7 +524,7 @@ bool PlayGround::zone(TQPoint &position)
int draggedNumber;
for (draggedNumber = 0;
draggedNumber < decorations;
- draggedNumber++) if (objectsLayout[draggedNumber].contains(position))
+ draggedNumber++) if (objectsLayout[draggedNumber].tqcontains(position))
{
position.setX(position.x() - objectsLayout[draggedNumber].x());
position.setY(position.y() - objectsLayout[draggedNumber].y());
@@ -541,21 +541,21 @@ bool PlayGround::zone(TQPoint &position)
for (draggedZOrder = toDraw.count()-1; draggedZOrder >= 0; draggedZOrder--)
{
currentObject = toDraw.at(draggedZOrder);
- if (!currentObject->getPosition().contains(position)) continue;
+ if (!currentObject->getPosition().tqcontains(position)) continue;
TQRect toUpdate(currentObject->getPosition());
draggedObject = *currentObject;
draggedNumber = draggedObject.getNumber();
- TQBitmap shape(objectsLayout[draggedNumber].size());
+ TQBitmap tqshape(objectsLayout[draggedNumber].size());
TQPoint relative(position.x() - toUpdate.x(),
position.y() - toUpdate.y());
- bitBlt(&shape, TQPoint(0, 0), &masks, objectsLayout[draggedNumber], Qt::CopyROP);
- if (!shape.convertToImage().pixelIndex(relative.x(), relative.y())) continue;
+ bitBlt(&tqshape, TQPoint(0, 0), &tqmasks, objectsLayout[draggedNumber], TQt::CopyROP);
+ if (!tqshape.convertToImage().pixelIndex(relative.x(), relative.y())) continue;
toDraw.remove(draggedZOrder);
toUpdate.moveBy(XMARGIN, YMARGIN);
- repaint(toUpdate, false);
+ tqrepaint(toUpdate, false);
position = relative;
@@ -563,7 +563,7 @@ bool PlayGround::zone(TQPoint &position)
}
// If we are on the gameboard itself, then play "tuberling" sound
- if (editableArea.contains(position))
+ if (editableArea.tqcontains(position))
topLevel->playSound(editableSound);
return false;
diff --git a/ktuberling/playground.h b/ktuberling/playground.h
index bdb7e47f..146ffe2c 100644
--- a/ktuberling/playground.h
+++ b/ktuberling/playground.h
@@ -20,18 +20,19 @@
class TQDomDocument;
class TopLevel;
-class PlayGround : public QWidget
+class PlayGround : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- PlayGround(TopLevel *parent, const char *name, uint selectedGameboard);
+ PlayGround(TopLevel *tqparent, const char *name, uint selectedGameboard);
~PlayGround();
void reset();
void change(uint selectedGameboard);
- void repaintAll();
+ void tqrepaintAll();
bool undo();
bool redo();
bool loadFrom(const TQString &name);
@@ -50,8 +51,8 @@ protected:
private:
- bool registerPlayGrounds(TQDomDocument &layoutDocument);
- bool loadPlayGround(TQDomDocument &layoutDocument, uint toLoad);
+ bool registerPlayGrounds(TQDomDocument &tqlayoutDocument);
+ bool loadPlayGround(TQDomDocument &tqlayoutDocument, uint toLoad);
void loadFailure();
void setupGeometry();
bool zone(TQPoint &position);
@@ -61,7 +62,7 @@ private:
private:
TQPixmap gameboard; // Picture of the game board
- TQBitmap masks; // Pictures of the objects' shapes
+ TQBitmap tqmasks; // Pictures of the objects' tqshapes
TQRect editableArea; // Part of the gameboard where the player can lay down objects
TQString menuItem, // Menu item describing describing this gameboard
editableSound; // Sound associated with this area
@@ -72,7 +73,7 @@ private:
TQString *textsList, // List of the message numbers associated with categories
*soundsList; // List of sounds associated with each object
- TQCursor *draggedCursor; // Cursor's shape for currently dragged object
+ TQCursor *draggedCursor; // Cursor's tqshape for currently dragged object
ToDraw draggedObject; // Object currently dragged
int draggedZOrder; // Z-order (in to-draw buffer) of this object
diff --git a/ktuberling/soundfactory.cpp b/ktuberling/soundfactory.cpp
index 9831adcd..5bb309d8 100644
--- a/ktuberling/soundfactory.cpp
+++ b/ktuberling/soundfactory.cpp
@@ -18,17 +18,17 @@
#include "toplevel.h"
// Constructor
-SoundFactory::SoundFactory(TopLevel *parent, const char *name, uint selectedLanguage)
- : TQObject(parent, name)
+SoundFactory::SoundFactory(TopLevel *tqparent, const char *name, uint selectedLanguage)
+ : TQObject(tqparent, name)
{
- topLevel = parent;
+ topLevel = tqparent;
namesList = filesList = 0;
- TQDomDocument layoutsDocument;
- bool ok = topLevel->loadLayout(layoutsDocument);
- if (ok) ok = registerLanguages(layoutsDocument);
- if (ok) ok = loadLanguage(layoutsDocument, selectedLanguage);
+ TQDomDocument tqlayoutsDocument;
+ bool ok = topLevel->loadLayout(tqlayoutsDocument);
+ if (ok) ok = registerLanguages(tqlayoutsDocument);
+ if (ok) ok = loadLanguage(tqlayoutsDocument, selectedLanguage);
if (!ok) loadFailure();
}
@@ -42,9 +42,9 @@ SoundFactory::~SoundFactory()
// Change the language
void SoundFactory::change(uint selectedLanguage)
{
- TQDomDocument layoutsDocument;
- bool ok = topLevel->loadLayout(layoutsDocument);
- if (ok) ok = loadLanguage(layoutsDocument, selectedLanguage);
+ TQDomDocument tqlayoutsDocument;
+ bool ok = topLevel->loadLayout(tqlayoutsDocument);
+ if (ok) ok = loadLanguage(tqlayoutsDocument, selectedLanguage);
if (!ok) loadFailure();
}
@@ -74,14 +74,14 @@ void SoundFactory::loadFailure()
}
// Register the various languages
-bool SoundFactory::registerLanguages(TQDomDocument &layoutDocument)
+bool SoundFactory::registerLanguages(TQDomDocument &tqlayoutDocument)
{
TQDomNodeList languagesList, menuItemsList, labelsList;
TQDomElement languageElement, menuItemElement, labelElement;
TQDomAttr codeAttribute, actionAttribute;
bool enabled;
- languagesList = layoutDocument.elementsByTagName("language");
+ languagesList = tqlayoutDocument.elementsByTagName("language");
if (languagesList.count() < 1)
return false;
@@ -110,7 +110,7 @@ bool SoundFactory::registerLanguages(TQDomDocument &layoutDocument)
}
// Load the sounds of one given language
-bool SoundFactory::loadLanguage(TQDomDocument &layoutDocument, uint toLoad)
+bool SoundFactory::loadLanguage(TQDomDocument &tqlayoutDocument, uint toLoad)
{
TQDomNodeList languagesList,
soundNamesList;
@@ -118,7 +118,7 @@ bool SoundFactory::loadLanguage(TQDomDocument &layoutDocument, uint toLoad)
soundNameElement;
TQDomAttr nameAttribute, fileAttribute;
- languagesList = layoutDocument.elementsByTagName("language");
+ languagesList = tqlayoutDocument.elementsByTagName("language");
if (toLoad >= languagesList.count())
return false;
@@ -129,9 +129,9 @@ bool SoundFactory::loadLanguage(TQDomDocument &layoutDocument, uint toLoad)
if (sounds < 1)
return false;
- if (!(namesList = new QString[sounds]))
+ if (!(namesList = new TQString[sounds]))
return false;
- if (!(filesList = new QString[sounds]))
+ if (!(filesList = new TQString[sounds]))
return false;
for (uint sound = 0; sound < sounds; sound++)
diff --git a/ktuberling/soundfactory.h b/ktuberling/soundfactory.h
index 6fcf9abb..6fe923bc 100644
--- a/ktuberling/soundfactory.h
+++ b/ktuberling/soundfactory.h
@@ -13,13 +13,14 @@
class TQDomDocument;
class TopLevel;
-class SoundFactory : public QObject
+class SoundFactory : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
- SoundFactory(TopLevel *parent, const char *name, uint selectedLanguage);
+ SoundFactory(TopLevel *tqparent, const char *name, uint selectedLanguage);
~SoundFactory();
void change(uint selectedLanguage);
@@ -27,8 +28,8 @@ public:
protected:
- bool registerLanguages(TQDomDocument &layoutDocument);
- bool loadLanguage(TQDomDocument &layoutDocument, uint toLoad);
+ bool registerLanguages(TQDomDocument &tqlayoutDocument);
+ bool loadLanguage(TQDomDocument &tqlayoutDocument, uint toLoad);
private:
diff --git a/ktuberling/todraw.cpp b/ktuberling/todraw.cpp
index c88328a7..c148b3a0 100644
--- a/ktuberling/todraw.cpp
+++ b/ktuberling/todraw.cpp
@@ -44,16 +44,16 @@ ToDraw &ToDraw::operator=(const ToDraw &model)
// Draw an object previously laid down on the game board
void ToDraw::draw(TQPainter &artist, const TQRect &area,
const TQRect *objectsLayout,
- const TQPixmap *gameboard, const TQBitmap *masks) const
+ const TQPixmap *gameboard, const TQBitmap *tqmasks) const
{
if (!position.intersects(area)) return;
TQPixmap objectPixmap(objectsLayout[number].size());
- TQBitmap shapeBitmap(objectsLayout[number].size());
+ TQBitmap tqshapeBitmap(objectsLayout[number].size());
- bitBlt(&objectPixmap, TQPoint(0, 0), gameboard, objectsLayout[number], Qt::CopyROP);
- bitBlt(&shapeBitmap, TQPoint(0, 0), masks, objectsLayout[number], Qt::CopyROP);
- objectPixmap.setMask(shapeBitmap);
+ bitBlt(&objectPixmap, TQPoint(0, 0), gameboard, objectsLayout[number], TQt::CopyROP);
+ bitBlt(&tqshapeBitmap, TQPoint(0, 0), tqmasks, objectsLayout[number], TQt::CopyROP);
+ objectPixmap.setMask(tqshapeBitmap);
artist.drawPixmap(position.topLeft(), objectPixmap);
}
diff --git a/ktuberling/toplevel.cpp b/ktuberling/toplevel.cpp
index 53566f17..c0822446 100644
--- a/ktuberling/toplevel.cpp
+++ b/ktuberling/toplevel.cpp
@@ -61,21 +61,21 @@ void TopLevel::registerGameboard(const TQString &menuItem, const char *actionId)
switch (gameboards)
{
- case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard0()), actionCollection(), actionId);
+ case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard0()), actionCollection(), actionId);
break;
- case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard1()), actionCollection(), actionId);
+ case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard1()), actionCollection(), actionId);
break;
- case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard2()), actionCollection(), actionId);
+ case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard2()), actionCollection(), actionId);
break;
- case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard3()), actionCollection(), actionId);
+ case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard3()), actionCollection(), actionId);
break;
- case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard4()), actionCollection(), actionId);
+ case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard4()), actionCollection(), actionId);
break;
- case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard5()), actionCollection(), actionId);
+ case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard5()), actionCollection(), actionId);
break;
- case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard6()), actionCollection(), actionId);
+ case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard6()), actionCollection(), actionId);
break;
- case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(gameboard7()), actionCollection(), actionId);
+ case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(gameboard7()), actionCollection(), actionId);
break;
}
@@ -93,37 +93,37 @@ void TopLevel::registerLanguage(const TQString &menuItem, const char *actionId,
switch (languages)
{
- case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language0()), actionCollection(), actionId);
+ case 0: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language0()), actionCollection(), actionId);
break;
- case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language1()), actionCollection(), actionId);
+ case 1: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language1()), actionCollection(), actionId);
break;
- case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language2()), actionCollection(), actionId);
+ case 2: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language2()), actionCollection(), actionId);
break;
- case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language3()), actionCollection(), actionId);
+ case 3: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language3()), actionCollection(), actionId);
break;
- case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language4()), actionCollection(), actionId);
+ case 4: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language4()), actionCollection(), actionId);
break;
- case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language5()), actionCollection(), actionId);
+ case 5: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language5()), actionCollection(), actionId);
break;
- case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language6()), actionCollection(), actionId);
+ case 6: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language6()), actionCollection(), actionId);
break;
- case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language7()), actionCollection(), actionId);
+ case 7: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language7()), actionCollection(), actionId);
break;
- case 8: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language8()), actionCollection(), actionId);
+ case 8: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language8()), actionCollection(), actionId);
break;
- case 9: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language9()), actionCollection(), actionId);
+ case 9: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language9()), actionCollection(), actionId);
break;
- case 10: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language10()), actionCollection(), actionId);
+ case 10: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language10()), actionCollection(), actionId);
break;
- case 11: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language11()), actionCollection(), actionId);
+ case 11: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language11()), actionCollection(), actionId);
break;
- case 12: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language12()), actionCollection(), actionId);
+ case 12: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language12()), actionCollection(), actionId);
break;
- case 13: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language13()), actionCollection(), actionId);
+ case 13: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language13()), actionCollection(), actionId);
break;
- case 14: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language14()), actionCollection(), actionId);
+ case 14: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language14()), actionCollection(), actionId);
break;
- case 15: t = new KToggleAction(i18n(menuItem.latin1()), 0, this, TQT_SLOT(language15()), actionCollection(), actionId);
+ case 15: t = new KToggleAction(i18n(menuItem.latin1()), 0, TQT_TQOBJECT(this), TQT_SLOT(language15()), actionCollection(), actionId);
break;
}
@@ -186,19 +186,19 @@ void TopLevel::changeLanguage(uint newLanguage)
soundFactory->change(newLanguage);
}
-// Load the layouts file
-bool TopLevel::loadLayout(TQDomDocument &layoutDocument)
+// Load the tqlayouts file
+bool TopLevel::loadLayout(TQDomDocument &tqlayoutDocument)
{
- TQFile layoutFile(TQFile::encodeName(locate("data", "ktuberling/pics/layout.xml")));
- if (!layoutFile.open(IO_ReadOnly))
+ TQFile tqlayoutFile(TQFile::encodeName(locate("data", "ktuberling/pics/tqlayout.xml")));
+ if (!tqlayoutFile.open(IO_ReadOnly))
return false;
- if (!layoutDocument.setContent(&layoutFile))
+ if (!tqlayoutDocument.setContent(&tqlayoutFile))
{
- layoutFile.close();
+ tqlayoutFile.close();
return false;
}
- layoutFile.close();
+ tqlayoutFile.close();
return true;
}
@@ -219,7 +219,7 @@ void TopLevel::readOptions()
config->setGroup("General");
option = config->readEntry("Sound", "on");
- soundEnabled = option.find("on") == 0;
+ soundEnabled = option.tqfind("on") == 0;
option = config->readEntry("GameboardNumber", "0");
selectedGameboard = option.toInt();
@@ -254,22 +254,22 @@ void TopLevel::writeOptions()
void TopLevel::setupKAction()
{
//Game
- KStdGameAction::gameNew(this, TQT_SLOT(fileNew()), actionCollection());
- KStdGameAction::load(this, TQT_SLOT(fileOpen()), actionCollection());
- KStdGameAction::save(this, TQT_SLOT(fileSave()), actionCollection());
- KStdGameAction::print(this, TQT_SLOT(filePrint()), actionCollection());
- KStdGameAction::quit(kapp, TQT_SLOT(quit()), actionCollection());
- (void) new KAction(i18n("Save &as Picture..."), 0, this, TQT_SLOT(filePicture()), actionCollection(), "game_save_picture");
+ KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(fileNew()), actionCollection());
+ KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(fileOpen()), actionCollection());
+ KStdGameAction::save(TQT_TQOBJECT(this), TQT_SLOT(fileSave()), actionCollection());
+ KStdGameAction::print(TQT_TQOBJECT(this), TQT_SLOT(filePrint()), actionCollection());
+ KStdGameAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), actionCollection());
+ (void) new KAction(i18n("Save &as Picture..."), 0, TQT_TQOBJECT(this), TQT_SLOT(filePicture()), actionCollection(), "game_save_picture");
//Edit
- KStdAction::copy(this, TQT_SLOT(editCopy()), actionCollection());
- KStdAction::undo(this, TQT_SLOT(editUndo()), actionCollection());
- KStdAction::redo(this, TQT_SLOT(editRedo()), actionCollection());
+ KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(editCopy()), actionCollection());
+ KStdAction::undo(TQT_TQOBJECT(this), TQT_SLOT(editUndo()), actionCollection());
+ KStdAction::redo(TQT_TQOBJECT(this), TQT_SLOT(editRedo()), actionCollection());
enableUndo(false);
enableRedo(false);
//Speech
- KToggleAction* t = new KToggleAction(i18n("&No Sound"), 0, this, TQT_SLOT(soundOff()), actionCollection(), "speech_no_sound");
+ KToggleAction* t = new KToggleAction(i18n("&No Sound"), 0, TQT_TQOBJECT(this), TQT_SLOT(soundOff()), actionCollection(), "speech_no_sound");
if (!soundEnabled) t->setChecked(true);
setupGUI();
@@ -283,14 +283,14 @@ void TopLevel::fileNew()
enableUndo(false);
enableRedo(false);
- playGround->repaintAll();
+ playGround->tqrepaintAll();
}
// Load gameboard
void TopLevel::fileOpen()
{
TQString dir = locate("data", "ktuberling/museum/miss.tuberling");
- dir.truncate(dir.findRev('/') + 1);
+ dir.truncate(dir.tqfindRev('/') + 1);
KURL url = KFileDialog::getOpenURL(dir, "*.tuberling");
@@ -314,7 +314,7 @@ void TopLevel::open(const KURL &url)
enableUndo(!playGround->isFirstAction());
enableRedo(false);
- playGround->repaintAll();
+ playGround->tqrepaintAll();
KIO::NetAccess::removeTempFile( name );
}
@@ -323,7 +323,7 @@ void TopLevel::open(const KURL &url)
void TopLevel::fileSave()
{
KURL url = KFileDialog::getSaveURL
- ( TQString::null,
+ ( TQString(),
"*.tuberling");
if (url.isEmpty())
@@ -340,7 +340,7 @@ void TopLevel::fileSave()
TQString name = url.path();
int suffix;
- suffix = name.findRev('.');
+ suffix = name.tqfindRev('.');
if (suffix == -1)
{
name += ".tuberling";
@@ -356,7 +356,7 @@ void TopLevel::filePicture()
TQPixmap picture(playGround->getPicture());
KURL url = KFileDialog::getSaveURL
- ( TQString::null,
+ ( TQString(),
i18n( "*.xpm|UNIX Pixmaps (*.xpm)\n"
"*.jpg|JPEG Compressed Files (*.jpg)\n"
"*.png|Next Generation Pictures (*.png)\n"
@@ -379,7 +379,7 @@ void TopLevel::filePicture()
int suffix;
TQString end;
- suffix = name.findRev('.');
+ suffix = name.tqfindRev('.');
if (suffix == -1)
{
name += ".xpm";
@@ -408,9 +408,9 @@ void TopLevel::filePrint()
KPrinter printer;
bool ok;
- ok = printer.setup(this, i18n("Print %1").arg(actionCollection()->action(gameboardActions[selectedGameboard].latin1())->plainText()));
+ ok = printer.setup(this, i18n("Print %1").tqarg(actionCollection()->action(gameboardActions[selectedGameboard].latin1())->plainText()));
if (!ok) return;
- playGround->repaint(true);
+ playGround->tqrepaint(true);
if (!playGround->printPicture(printer))
KMessageBox::error(this,
i18n("Could not print picture."));
@@ -422,7 +422,7 @@ void TopLevel::filePrint()
// Copy modified area to clipboard
void TopLevel::editCopy()
{
- QClipboard *clipboard = TQApplication::clipboard();
+ TQClipboard *clipboard = TQApplication::tqclipboard();
TQPixmap picture(playGround->getPicture());
clipboard->setPixmap(picture);
@@ -438,7 +438,7 @@ void TopLevel::editUndo()
if (playGround->isFirstAction()) enableUndo(false);
enableRedo(true);
- playGround->repaintAll();
+ playGround->tqrepaintAll();
}
// Redo last action
@@ -451,7 +451,7 @@ void TopLevel::editRedo()
if (playGround->isLastAction()) enableRedo(false);
enableUndo(true);
- playGround->repaintAll();
+ playGround->tqrepaintAll();
}
// Switch to gameboard #0
diff --git a/ktuberling/toplevel.h b/ktuberling/toplevel.h
index 26993202..04ceaa96 100644
--- a/ktuberling/toplevel.h
+++ b/ktuberling/toplevel.h
@@ -18,6 +18,7 @@ class SoundFactory;
class TopLevel : public KMainWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
@@ -31,7 +32,7 @@ public:
void registerLanguage(const TQString &menuItem, const char *actionId, bool enabled);
void changeGameboard(uint newGameboard);
void changeLanguage(uint newLanguage);
- bool loadLayout(TQDomDocument &layoutDocument);
+ bool loadLayout(TQDomDocument &tqlayoutDocument);
void playSound(const TQString &ref) const;
inline bool isSoundEnabled() const {return soundEnabled;}