summaryrefslogtreecommitdiffstats
path: root/libkdegames/kgame
diff options
context:
space:
mode:
Diffstat (limited to 'libkdegames/kgame')
-rw-r--r--libkdegames/kgame/COMPAT6
-rw-r--r--libkdegames/kgame/DESIGN2
-rw-r--r--libkdegames/kgame/dialogs/kgameconnectdialog.cpp14
-rw-r--r--libkdegames/kgame/dialogs/kgameconnectdialog.h22
-rw-r--r--libkdegames/kgame/dialogs/kgamedebugdialog.cpp48
-rw-r--r--libkdegames/kgame/dialogs/kgamedebugdialog.h7
-rw-r--r--libkdegames/kgame/dialogs/kgamedialog.cpp34
-rw-r--r--libkdegames/kgame/dialogs/kgamedialog.h25
-rw-r--r--libkdegames/kgame/dialogs/kgamedialogconfig.cpp40
-rw-r--r--libkdegames/kgame/dialogs/kgamedialogconfig.h32
-rw-r--r--libkdegames/kgame/dialogs/kgameerrordialog.cpp30
-rw-r--r--libkdegames/kgame/dialogs/kgameerrordialog.h16
-rw-r--r--libkdegames/kgame/kgame.cpp110
-rw-r--r--libkdegames/kgame/kgame.h53
-rw-r--r--libkdegames/kgame/kgamechat.cpp28
-rw-r--r--libkdegames/kgame/kgamechat.h13
-rw-r--r--libkdegames/kgame/kgameerror.cpp22
-rw-r--r--libkdegames/kgame/kgameio.cpp58
-rw-r--r--libkdegames/kgame/kgameio.h29
-rw-r--r--libkdegames/kgame/kgamemessage.cpp32
-rw-r--r--libkdegames/kgame/kgamemessage.h16
-rw-r--r--libkdegames/kgame/kgamenetwork.cpp78
-rw-r--r--libkdegames/kgame/kgamenetwork.h49
-rw-r--r--libkdegames/kgame/kgameprocess.cpp16
-rw-r--r--libkdegames/kgame/kgameprocess.h13
-rw-r--r--libkdegames/kgame/kgameproperty.cpp12
-rw-r--r--libkdegames/kgame/kgameproperty.h42
-rw-r--r--libkdegames/kgame/kgamepropertyhandler.cpp34
-rw-r--r--libkdegames/kgame/kgamepropertyhandler.h23
-rw-r--r--libkdegames/kgame/kgamepropertylist.h2
-rw-r--r--libkdegames/kgame/kgamesequence.h3
-rw-r--r--libkdegames/kgame/kmessageclient.cpp58
-rw-r--r--libkdegames/kgame/kmessageclient.h45
-rw-r--r--libkdegames/kgame/kmessageio.cpp48
-rw-r--r--libkdegames/kgame/kmessageio.h45
-rw-r--r--libkdegames/kgame/kmessageserver.cpp102
-rw-r--r--libkdegames/kgame/kmessageserver.h112
-rw-r--r--libkdegames/kgame/kplayer.cpp26
-rw-r--r--libkdegames/kgame/kplayer.h17
-rw-r--r--libkdegames/kgame/messages.txt2
40 files changed, 698 insertions, 666 deletions
diff --git a/libkdegames/kgame/COMPAT b/libkdegames/kgame/COMPAT
index 146d3a88..4551c679 100644
--- a/libkdegames/kgame/COMPAT
+++ b/libkdegames/kgame/COMPAT
@@ -10,7 +10,7 @@
KGameIO::signalPrepareMove(..., bool*): don't know why this was
necessary but it didn't work anymore...
16.09.2001: KGamePropertyHandler uses bool* for the sent parameter now. This is
- because QT3 obviously doesn't honor referneces in signals/slots.
+ because QT3 obviously doesn't honor referneces in Q_SIGNALS/Q_SLOTS.
This might even be a QT bug. Bad situation - we use references
everywhere in KGame... hope nothing else is affecterd by this
problem (signalPrepareMove was fixed already by me)
@@ -38,7 +38,7 @@
too!
The API stays the same.
11.10.2001 KGameDialogGeneralConfig now doesn't provide setMin/maxPlayers()
- anymore. The game should manage this internally. layout() is
+ anymore. The game should manage this internally. tqlayout() is
obsolete as well
18.10.2001 KPlayer::signalNetworkData contained QDataStream& instead of const
QByteArray& parameter (oops!). This is fixed now. All apps which
@@ -47,7 +47,7 @@
KPlayer::sendProperty() and related functions contain a "int msgid"
parameter. This is the id() of the property handler. This parameter
enables us to easily add any number of property handler to a game
- just by connecting it to existing send slots and call
+ just by connecting it to existing send Q_SLOTS and call
processMessage() in slotNetworkData()
03.11.2001 KPlayer::signalNetworkData now emits msgid-KGameMessage::IdUser just
like KGame::signalNetworkData does
diff --git a/libkdegames/kgame/DESIGN b/libkdegames/kgame/DESIGN
index b1c48146..cd737e3a 100644
--- a/libkdegames/kgame/DESIGN
+++ b/libkdegames/kgame/DESIGN
@@ -359,7 +359,7 @@ KDialogBase::addVBoxPage() (for example).
5.1.1 Debug KGame
-----------------
The first page, "Debug KGame" shows on the left most or even all status values of
-KGame. That contains e.g. minPlayers(), isAdmin(), gameStatus(), ...
+KGame. That contains e.g. minPlayers(), isAdmin(), gametqStatus(), ...
The right side is probably the more important one. It lists *all* KGameProperties
which have been inserted to this KGame object (only to this KGame object - not
the ones that have been added to the players!). Most of the status variables of
diff --git a/libkdegames/kgame/dialogs/kgameconnectdialog.cpp b/libkdegames/kgame/dialogs/kgameconnectdialog.cpp
index 575b3090..f0e0c606 100644
--- a/libkdegames/kgame/dialogs/kgameconnectdialog.cpp
+++ b/libkdegames/kgame/dialogs/kgameconnectdialog.cpp
@@ -56,7 +56,7 @@ class KGameConnectWidgetPrivate
TQString mType;
};
-KGameConnectWidget::KGameConnectWidget(TQWidget* parent) : TQWidget(parent)
+KGameConnectWidget::KGameConnectWidget(TQWidget* tqparent) : TQWidget(tqparent)
{
d = new KGameConnectWidgetPrivate;
@@ -165,7 +165,7 @@ TQString KGameConnectWidget::host() const
if (d->mHost->isEnabled()) {
return d->mHost->text();
} else {
- return TQString::null;
+ return TQString();
}
}
@@ -212,9 +212,9 @@ class KGameConnectDialogPrivate
KGameConnectWidget* mConnect;
};
-// buttonmask =Ok|Cancel
-KGameConnectDialog::KGameConnectDialog(TQWidget* parent,int buttonmask) : KDialogBase(Plain,
- i18n("Network Game"),buttonmask , Ok, parent, 0, true, buttonmask!=0)
+// buttontqmask =Ok|Cancel
+KGameConnectDialog::KGameConnectDialog(TQWidget* tqparent,int buttontqmask) : KDialogBase(Plain,
+ i18n("Network Game"),buttontqmask , Ok, tqparent, 0, true, buttontqmask!=0)
{
d = new KGameConnectDialogPrivate;
TQVBoxLayout* vb = new TQVBoxLayout(plainPage(), spacingHint());
@@ -228,9 +228,9 @@ KGameConnectDialog::~KGameConnectDialog()
}
int KGameConnectDialog::initConnection( unsigned short int& port,
- TQString& host, TQWidget* parent, bool server)
+ TQString& host, TQWidget* tqparent, bool server)
{
- KGameConnectDialog d(parent);
+ KGameConnectDialog d(tqparent);
d.setHost(host);
d.setPort(port);
if (server) {
diff --git a/libkdegames/kgame/dialogs/kgameconnectdialog.h b/libkdegames/kgame/dialogs/kgameconnectdialog.h
index fdb0be4f..ad4ff7d1 100644
--- a/libkdegames/kgame/dialogs/kgameconnectdialog.h
+++ b/libkdegames/kgame/dialogs/kgameconnectdialog.h
@@ -26,11 +26,12 @@
class KGameConnectDialogPrivate;
class KGameConnectWidgetPrivate;
-class KGameConnectWidget : public QWidget
+class KGameConnectWidget : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KGameConnectWidget(TQWidget* parent);
+ KGameConnectWidget(TQWidget* tqparent);
virtual ~KGameConnectWidget();
/**
@@ -39,7 +40,7 @@ public:
void setHost(const TQString& host);
/**
- * @return The host to connect to or TQString::null if the user wants to
+ * @return The host to connect to or TQString() if the user wants to
* be the MASTER
**/
TQString host() const;
@@ -108,16 +109,17 @@ private:
* @short Dialog to ask for host and port
*
* This Dialog is used to create a game. You call initConnection(port,
- * TQString::null, parent, true) to create a network game (as a server)
- * or initConnection(port, host, parent) to join a network game.
+ * TQString(), tqparent, true) to create a network game (as a server)
+ * or initConnection(port, host, tqparent) to join a network game.
*
* @author Andreas Beckermann <b_mann@gmx.de>
**/
class KGameConnectDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KGameConnectDialog(TQWidget* parent = 0,int buttonmask=Ok|Cancel);
+ KGameConnectDialog(TQWidget* tqparent = 0,int buttontqmask=Ok|Cancel);
virtual ~KGameConnectDialog();
/**
@@ -125,12 +127,12 @@ public:
* server game, depending on user's choice.
* @param port The port the user wants to connect to.
* @param host The host the user wants to connect to. Will be
- * TQString::null if server game is chosen
- * @param parent The parent of the dialog
+ * TQString() if server game is chosen
+ * @param tqparent The tqparent of the dialog
* @param server True to create a network game per default, false to
* join a game by default
**/
- static int initConnection(unsigned short int& port, TQString& host, TQWidget* parent, bool server = false);
+ static int initConnection(unsigned short int& port, TQString& host, TQWidget* tqparent, bool server = false);
/**
* @param host The host to connect to by default
@@ -138,7 +140,7 @@ public:
void setHost(const TQString& host);
/**
- * @return The host to connect to or TQString::null if the user wants to
+ * @return The host to connect to or TQString() if the user wants to
* be the MASTER
**/
TQString host() const;
diff --git a/libkdegames/kgame/dialogs/kgamedebugdialog.cpp b/libkdegames/kgame/dialogs/kgamedebugdialog.cpp
index 09a35e56..06987aad 100644
--- a/libkdegames/kgame/dialogs/kgamedebugdialog.cpp
+++ b/libkdegames/kgame/dialogs/kgamedebugdialog.cpp
@@ -56,7 +56,7 @@ public:
mGameMaster = 0;
mGameAdmin = 0;
mGameOffering = 0;
- mGameStatus = 0;
+ mGametqStatus = 0;
mGameRunning = 0;
mGameMaxPlayers = 0;
mGameMinPlayers = 0;
@@ -93,7 +93,7 @@ public:
TQListViewItem* mGameMaster;
TQListViewItem* mGameAdmin;
TQListViewItem* mGameOffering;
- TQListViewItem* mGameStatus;
+ TQListViewItem* mGametqStatus;
TQListViewItem* mGameRunning;
TQListViewItem* mGameMaxPlayers;
TQListViewItem* mGameMinPlayers;
@@ -120,9 +120,9 @@ public:
KListBox* mHideIdList;
};
-KGameDebugDialog::KGameDebugDialog(KGame* g, TQWidget* parent, bool modal) :
+KGameDebugDialog::KGameDebugDialog(KGame* g, TQWidget* tqparent, bool modal) :
KDialogBase(Tabbed, i18n("KGame Debug Dialog"), Close, Close,
- parent, 0, modal, true)
+ tqparent, 0, modal, true)
{
d = new KGameDebugDialogPrivate;
@@ -142,18 +142,18 @@ void KGameDebugDialog::initGamePage()
{
d->mGamePage = addPage(i18n("Debug &KGame"));
TQVBoxLayout* topLayout = new TQVBoxLayout(d->mGamePage, marginHint(), spacingHint());
- TQHBoxLayout* layout = new TQHBoxLayout(topLayout);
+ TQHBoxLayout* tqlayout = new TQHBoxLayout(topLayout);
KListView* v = new KListView(d->mGamePage);
v->addColumn(i18n("Data"));
v->addColumn(i18n("Value"));
- layout->addWidget(v);
+ tqlayout->addWidget(v);
d->mGameProperties = new KListView(d->mGamePage);
d->mGameProperties->addColumn(i18n("Property"));
d->mGameProperties->addColumn(i18n("Value"));
d->mGameProperties->addColumn(i18n("Policy"));
- layout->addWidget(d->mGameProperties);
+ tqlayout->addWidget(d->mGameProperties);
TQPushButton* b = new TQPushButton(i18n("Update"), d->mGamePage);
connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdateGameData()));
@@ -166,7 +166,7 @@ void KGameDebugDialog::initGamePage()
d->mGameMaster = new TQListViewItem(v, i18n("Is Master"));
d->mGameAdmin = new TQListViewItem(v, i18n("Is Admin"));
d->mGameOffering = new TQListViewItem(v, i18n("Is Offering Connections"));
- d->mGameStatus = new TQListViewItem(v, i18n("Game Status"));
+ d->mGametqStatus = new TQListViewItem(v, i18n("Game tqStatus"));
d->mGameRunning = new TQListViewItem(v, i18n("Game is Running"));
d->mGameMaxPlayers = new TQListViewItem(v, i18n("Maximal Players"));
d->mGameMinPlayers = new TQListViewItem(v, i18n("Minimal Players"));
@@ -177,19 +177,19 @@ void KGameDebugDialog::initPlayerPage()
{
d->mPlayerPage = addPage(i18n("Debug &Players"));
TQVBoxLayout* topLayout = new TQVBoxLayout(d->mPlayerPage, marginHint(), spacingHint());
- TQHBoxLayout* layout = new TQHBoxLayout(topLayout);
+ TQHBoxLayout* tqlayout = new TQHBoxLayout(topLayout);
//TODO: connect to the KGame signals for joined/removed players!!!
- TQVBoxLayout* listLayout = new TQVBoxLayout(layout);
+ TQVBoxLayout* listLayout = new TQVBoxLayout(tqlayout);
TQLabel* listLabel = new TQLabel(i18n("Available Players"), d->mPlayerPage);
listLayout->addWidget(listLabel);
d->mPlayerList = new KListBox(d->mPlayerPage);
connect(d->mPlayerList, TQT_SIGNAL(executed(TQListBoxItem*)), this, TQT_SLOT(slotUpdatePlayerData(TQListBoxItem*)));
listLayout->addWidget(d->mPlayerList);
- d->mPlayerList->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding));
+ d->mPlayerList->tqsetSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Expanding));
KListView* v = new KListView(d->mPlayerPage);
- layout->addWidget(v);
+ tqlayout->addWidget(v);
v->addColumn(i18n("Data"));
v->addColumn(i18n("Value"));
@@ -197,7 +197,7 @@ void KGameDebugDialog::initPlayerPage()
d->mPlayerProperties->addColumn(i18n("Property"));
d->mPlayerProperties->addColumn(i18n("Value"));
d->mPlayerProperties->addColumn(i18n("Policy"));
- layout->addWidget(d->mPlayerProperties);
+ tqlayout->addWidget(d->mPlayerProperties);
TQPushButton* b = new TQPushButton(i18n("Update"), d->mPlayerPage);
connect(b, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotUpdatePlayerList()));
@@ -220,9 +220,9 @@ void KGameDebugDialog::initPlayerPage()
void KGameDebugDialog::initMessagePage()
{
d->mMessagePage = addPage(i18n("Debug &Messages"));
- TQGridLayout* layout = new TQGridLayout(d->mMessagePage, 11, 7, marginHint(), spacingHint());
+ TQGridLayout* tqlayout = new TQGridLayout(d->mMessagePage, 11, 7, marginHint(), spacingHint());
d->mMessageList = new KListView(d->mMessagePage);
- layout->addMultiCellWidget(d->mMessageList, 0, 9, 0, 3);
+ tqlayout->addMultiCellWidget(d->mMessageList, 0, 9, 0, 3);
d->mMessageList->addColumn(i18n("Time"));
d->mMessageList->addColumn(i18n("ID"));
d->mMessageList->addColumn(i18n("Receiver"));
@@ -231,20 +231,20 @@ void KGameDebugDialog::initMessagePage()
TQPushButton* hide = new TQPushButton(i18n("&>>"), d->mMessagePage);
connect(hide, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotHideId()));
- layout->addWidget(hide, 4, 4);
+ tqlayout->addWidget(hide, 4, 4);
TQPushButton* show = new TQPushButton(i18n("&<<"), d->mMessagePage);
connect(show, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotShowId()));
- layout->addWidget(show, 6, 4);
+ tqlayout->addWidget(show, 6, 4);
TQLabel* l = new TQLabel(i18n("Do not show IDs:"), d->mMessagePage);
- layout->addMultiCellWidget(l, 0, 0, 5, 6);
+ tqlayout->addMultiCellWidget(l, 0, 0, 5, 6);
d->mHideIdList = new KListBox(d->mMessagePage);
- layout->addMultiCellWidget(d->mHideIdList, 1, 8, 5, 6);
+ tqlayout->addMultiCellWidget(d->mHideIdList, 1, 8, 5, 6);
TQPushButton* clear = new KPushButton(KStdGuiItem::clear(), d->mMessagePage);
connect(clear, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotClearMessages()));
- layout->addMultiCellWidget(clear, 10, 10, 0, 6);
+ tqlayout->addMultiCellWidget(clear, 10, 10, 0, 6);
//TODO: "show all but..." and "show nothing but..."
}
@@ -274,7 +274,7 @@ void KGameDebugDialog::clearGameData()
d->mGameMaster->setText(1, "");
d->mGameAdmin->setText(1, "");
d->mGameOffering->setText(1, "");
- d->mGameStatus->setText(1, "");
+ d->mGametqStatus->setText(1, "");
d->mGameRunning->setText(1, "");
d->mGameMaxPlayers->setText(1, "");
d->mGameMinPlayers->setText(1, "");
@@ -320,7 +320,7 @@ void KGameDebugDialog::slotUpdateGameData()
d->mGameMaster->setText(1, d->mGame->isMaster() ? i18n("True") : i18n("False"));
d->mGameAdmin->setText(1, d->mGame->isAdmin() ? i18n("True") : i18n("False"));
d->mGameOffering->setText(1, d->mGame->isOfferingConnections() ? i18n("True") : i18n("False"));
- d->mGameStatus->setText(1, TQString::number(d->mGame->gameStatus()));
+ d->mGametqStatus->setText(1, TQString::number(d->mGame->gametqStatus()));
d->mGameRunning->setText(1, d->mGame->isRunning() ? i18n("True") : i18n("False"));
d->mGameMaxPlayers->setText(1, TQString::number(d->mGame->maxPlayers()));
d->mGameMinPlayers->setText(1, TQString::number(d->mGame->minPlayers()));
@@ -441,7 +441,7 @@ void KGameDebugDialog::setKGame(const KGame* g)
slotUpdateGameData();
- connect(d->mGame, TQT_SIGNAL(signalMessageUpdate(int, Q_UINT32, Q_UINT32)), this, TQT_SLOT(slotMessageUpdate(int, Q_UINT32, Q_UINT32)));
+ connect(d->mGame, TQT_SIGNAL(signalMessageUpdate(int, TQ_UINT32, TQ_UINT32)), this, TQT_SLOT(slotMessageUpdate(int, TQ_UINT32, TQ_UINT32)));
}
}
@@ -481,7 +481,7 @@ void KGameDebugDialog::removePlayer(TQListBoxItem* i)
delete i;
}
-void KGameDebugDialog::slotMessageUpdate(int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+void KGameDebugDialog::slotMessageUpdate(int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
{
if (!showId(msgid)) {
return;
diff --git a/libkdegames/kgame/dialogs/kgamedebugdialog.h b/libkdegames/kgame/dialogs/kgamedebugdialog.h
index 57f20c34..924037ff 100644
--- a/libkdegames/kgame/dialogs/kgamedebugdialog.h
+++ b/libkdegames/kgame/dialogs/kgamedebugdialog.h
@@ -34,8 +34,9 @@ class KGameDebugDialogPrivate;
class KDE_EXPORT KGameDebugDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KGameDebugDialog(KGame* g, TQWidget* parent, bool modal = false);
+ KGameDebugDialog(KGame* g, TQWidget* tqparent, bool modal = false);
~KGameDebugDialog();
/**
@@ -77,7 +78,7 @@ public slots:
signals:
/**
- * This signal is emitted when the "debug messages" page couldn't find
+ * This signal is emitted when the "debug messages" page couldn't tqfind
* the name of a message id. This is usually the case for user-defined
* messages. KGameDebugDialog asks you to give the msgid a name.
* @param messageid The ID of the message. As given to @ref
@@ -134,7 +135,7 @@ protected slots:
/**
* A message has been received - see @ref KGame::signalMessageUpdate
**/
- void slotMessageUpdate(int msgid, Q_UINT32 receiver, Q_UINT32 sender);
+ void slotMessageUpdate(int msgid, TQ_UINT32 receiver, TQ_UINT32 sender);
private:
void initGamePage();
diff --git a/libkdegames/kgame/dialogs/kgamedialog.cpp b/libkdegames/kgame/dialogs/kgamedialog.cpp
index c03df4ff..f589333e 100644
--- a/libkdegames/kgame/dialogs/kgamedialog.cpp
+++ b/libkdegames/kgame/dialogs/kgamedialog.cpp
@@ -64,17 +64,17 @@ public:
};
KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const TQString& title,
- TQWidget* parent, bool modal)
+ TQWidget* tqparent, bool modal)
: KDialogBase(Tabbed, title, Ok|Default|Apply,
- Ok, parent, 0, modal, true)
+ Ok, tqparent, 0, modal, true)
{
init(g, owner);
}
KGameDialog::KGameDialog(KGame* g, KPlayer* owner, const TQString& title,
- TQWidget* parent, long initConfigs, int chatMsgId, bool modal)
+ TQWidget* tqparent, long initConfigs, int chatMsgId, bool modal)
: KDialogBase(Tabbed, title, Ok|Default|Apply,
- Ok, parent, 0, modal, true)
+ Ok, tqparent, 0, modal, true)
{
init(g, owner);
if ((ConfigOptions)initConfigs!=NoConfig) {
@@ -165,34 +165,34 @@ void KGameDialog::addMsgServerConfig(KGameDialogMsgServerConfig* msgConf)
d->mMsgServerPage = addConfigPage(msgConf, i18n("&Message Server"));
}
-void KGameDialog::addChatWidget(KGameDialogChatConfig* chat, TQVBox* parent)
+void KGameDialog::addChatWidget(KGameDialogChatConfig* chat, TQVBox* tqparent)
{
if (!chat) {
return;
}
- if (!parent) {
- parent = d->mGamePage;
+ if (!tqparent) {
+ tqparent = d->mGamePage;
}
- if (!parent) {
+ if (!tqparent) {
kdError(11001) << "cannot add chat widget without page" << endl;
return;
}
- addConfigWidget(chat, parent);
+ addConfigWidget(chat, tqparent);
}
-void KGameDialog::addConnectionList(KGameDialogConnectionConfig* c, TQVBox* parent)
+void KGameDialog::addConnectionList(KGameDialogConnectionConfig* c, TQVBox* tqparent)
{
if (!c) {
return;
}
- if (!parent) {
- parent = d->mNetworkPage;
+ if (!tqparent) {
+ tqparent = d->mNetworkPage;
}
- if (!parent) {
+ if (!tqparent) {
kdError(11001) << "Cannot add connection list without page" << endl;
return;
}
- addConfigWidget(c, parent);
+ addConfigWidget(c, tqparent);
}
TQVBox *KGameDialog::configPage(ConfigOptions which)
@@ -226,18 +226,18 @@ TQVBox* KGameDialog::addConfigPage(KGameDialogConfig* widget, const TQString& ti
return page;
}
-void KGameDialog::addConfigWidget(KGameDialogConfig* widget, TQWidget* parent)
+void KGameDialog::addConfigWidget(KGameDialogConfig* widget, TQWidget* tqparent)
{
if (!widget) {
kdError(11001) << "Cannot add NULL config widget" << endl;
return;
}
- if (!parent) {
+ if (!tqparent) {
kdError(11001) << "Cannot reparent to NULL widget" << endl;
return;
}
// kdDebug(11001) << "reparenting widget" << endl;
- widget->reparent(parent, TQPoint(0,0));
+ widget->reparent(tqparent, TQPoint(0,0));
d->mConfigWidgets.append(widget);
connect(widget, TQT_SIGNAL(destroyed(TQObject*)), this, TQT_SLOT(slotRemoveConfigWidget(TQObject*)));
if (!d->mGame) {
diff --git a/libkdegames/kgame/dialogs/kgamedialog.h b/libkdegames/kgame/dialogs/kgamedialog.h
index 709f71c6..cb731993 100644
--- a/libkdegames/kgame/dialogs/kgamedialog.h
+++ b/libkdegames/kgame/dialogs/kgamedialog.h
@@ -74,6 +74,7 @@ class KGameDialogPrivate;
class KDE_EXPORT KGameDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
enum ConfigOptions
@@ -94,11 +95,11 @@ public:
* @param owner The KPlayer object who is responsible for this
* dialog, aka "the local player"
* @param title The title of the dialog - see KDialog::setCaption
- * @param parent The parent of the dialog
+ * @param tqparent The tqparent of the dialog
* @param modal Whether the dialog is modal or not
**/
KGameDialog(KGame* g, KPlayer* owner, const TQString& title,
- TQWidget* parent, bool modal = false);
+ TQWidget* tqparent, bool modal = false);
/**
* Create a KGameDialog with the standard configuration widgets. This
@@ -121,7 +122,7 @@ public:
* @param owner The KPlayer object who is responsible for this
* dialog, aka "the local player"
* @param title The title of the dialog - see KDialog::setCaption
- * @param parent The parent of the dialog
+ * @param tqparent The tqparent of the dialog
* @param modal Whether the dialog is modal or not
* @param initConfigs whether the default KGameDialogConfig widgets
* shall be created using initDefaultDialog. Use false if you want
@@ -130,7 +131,7 @@ public:
* if initConfigs = false
**/
KGameDialog(KGame* g, KPlayer* owner, const TQString& title,
- TQWidget* parent, long initConfigs = AllConfig,
+ TQWidget* tqparent, long initConfigs = AllConfig,
int chatMsgId = 15432, bool modal = false);
virtual ~KGameDialog();
@@ -168,14 +169,14 @@ public:
virtual void submitToKGame();
/**
- * Adds a KGameChat to the dialog. If no parent is specified the
+ * Adds a KGameChat to the dialog. If no tqparent is specified the
* game page will be used.
* @param chat The chat widget
- * @param parent The parent of the chat widget. This MUST be an
+ * @param tqparent The tqparent of the chat widget. This MUST be an
* already added config widget. Note that the game page will be used
- * if parent is 0.
+ * if tqparent is 0.
**/
- void addChatWidget(KGameDialogChatConfig* chat, TQVBox* parent = 0);
+ void addChatWidget(KGameDialogChatConfig* chat, TQVBox* tqparent = 0);
/**
* Add a connection list to the dialog. The list consists of a
@@ -186,10 +187,10 @@ public:
* This is another not-really-config-config-widget. It just displays the
* connections and lets you ban players.
* @param c The KGameDialogConnectionConfig object
- * @param parent The parent of the widget. If 0 the networkConfig
+ * @param tqparent The tqparent of the widget. If 0 the networkConfig
* page is used.
**/
- void addConnectionList(KGameDialogConnectionConfig* c, TQVBox* parent = 0);
+ void addConnectionList(KGameDialogConnectionConfig* c, TQVBox* tqparent = 0);
/**
* Add a new page to the dialog. The page will contain you new config
@@ -222,12 +223,12 @@ public:
KGameDialogGeneralConfig* gameConfig() const;
/**
- * Add a config widget to the specified parent. Usually you call
+ * Add a config widget to the specified tqparent. Usually you call
* addConfigPage for one widget and addConfigWidget for another to add
* it to the same page. Just use the returned page of
* addConfigPage.
**/
- void addConfigWidget(KGameDialogConfig* widget, TQWidget* parent);
+ void addConfigWidget(KGameDialogConfig* widget, TQWidget* tqparent);
/**
* Used to add the main network config widget in a new page. Use this to
diff --git a/libkdegames/kgame/dialogs/kgamedialogconfig.cpp b/libkdegames/kgame/dialogs/kgamedialogconfig.cpp
index 44eaa3c7..af0172ef 100644
--- a/libkdegames/kgame/dialogs/kgamedialogconfig.cpp
+++ b/libkdegames/kgame/dialogs/kgamedialogconfig.cpp
@@ -57,7 +57,7 @@ public:
KPlayer* mOwner;
};
-KGameDialogConfig::KGameDialogConfig(TQWidget* parent) : TQWidget(parent)
+KGameDialogConfig::KGameDialogConfig(TQWidget* tqparent) : TQWidget(tqparent)
{
d = new KGameDialogConfigPrivate;
}
@@ -116,13 +116,13 @@ public:
};
-KGameDialogNetworkConfig::KGameDialogNetworkConfig(TQWidget* parent)
- : KGameDialogConfig(parent)
+KGameDialogNetworkConfig::KGameDialogNetworkConfig(TQWidget* tqparent)
+ : KGameDialogConfig(tqparent)
{
// kdDebug(11001) << k_funcinfo << ": this=" << this << endl;
d = new KGameDialogNetworkConfigPrivate();
- TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "toplayout");
+ TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint(), "toptqlayout");
TQHBoxLayout *hb = new TQHBoxLayout(topLayout, KDialog::spacingHint());
@@ -261,8 +261,8 @@ public:
TQVBoxLayout* mTopLayout;
};
-KGameDialogGeneralConfig::KGameDialogGeneralConfig(TQWidget* parent, bool initializeGUI)
- : KGameDialogConfig(parent)
+KGameDialogGeneralConfig::KGameDialogGeneralConfig(TQWidget* tqparent, bool initializeGUI)
+ : KGameDialogConfig(tqparent)
{
// kdDebug(11001) << k_funcinfo << ": this=" << this << endl;
d = new KGameDialogGeneralConfigPrivate;
@@ -295,7 +295,7 @@ void KGameDialogGeneralConfig::setPlayerName(const TQString& name)
TQString KGameDialogGeneralConfig::playerName() const
{
- return d->mName ? d->mName->text() : TQString::null;
+ return d->mName ? d->mName->text() : TQString();
}
void KGameDialogGeneralConfig::setOwner(KPlayer* p)
@@ -386,10 +386,10 @@ public:
// TODO: change ADMIN ID, remove CLIENTS, change MAXCLIENTS
-// we do everything here with QPushButtons as we want to wait a moment before
+// we do everything here with TQPushButtons as we want to wait a moment before
// continuing - the message must be sent over network first
-KGameDialogMsgServerConfig::KGameDialogMsgServerConfig(TQWidget* parent)
- : KGameDialogConfig(parent)
+KGameDialogMsgServerConfig::KGameDialogMsgServerConfig(TQWidget* tqparent)
+ : KGameDialogConfig(tqparent)
{
d = new KGameDialogMsgServerConfigPrivate;
@@ -465,12 +465,12 @@ void KGameDialogMsgServerConfig::slotChangeAdmin()
return;
}
//TODO
- Q_UINT32 newAdmin = 0;
+ TQ_UINT32 newAdmin = 0;
// newAdmin = ;
game()->electAdmin(newAdmin);
}
-void KGameDialogMsgServerConfig::removeClient(Q_UINT32 /*id*/)
+void KGameDialogMsgServerConfig::removeClient(TQ_UINT32 /*id*/)
{
//TODO
}
@@ -531,7 +531,7 @@ void KGameDialogMsgServerConfig::setHasMsgServer(bool has)
}
//TODO
// list all connections, data (max clients) and so on
- // cannot be done above (together with QPushButtons) as it is possible that
+ // cannot be done above (together with TQPushButtons) as it is possible that
// this client is ADMIN but not MASTER (i.e. doesn't own the messageserver)
}
@@ -547,8 +547,8 @@ public:
KGameChat* mChat;
};
-KGameDialogChatConfig::KGameDialogChatConfig(int chatMsgId, TQWidget* parent)
- : KGameDialogConfig(parent)
+KGameDialogChatConfig::KGameDialogChatConfig(int chatMsgId, TQWidget* tqparent)
+ : KGameDialogConfig(tqparent)
{
d = new KGameDialogChatConfigPrivate;
TQVBoxLayout* topLayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
@@ -599,8 +599,8 @@ public:
KListBox* mPlayerBox;
};
-KGameDialogConnectionConfig::KGameDialogConnectionConfig(TQWidget* parent)
- : KGameDialogConfig(parent)
+KGameDialogConnectionConfig::KGameDialogConnectionConfig(TQWidget* tqparent)
+ : KGameDialogConfig(tqparent)
{
//TODO: prevent player to ban himself
d = new KGameDialogConnectionConfigPrivate;
@@ -714,7 +714,7 @@ void KGameDialogConnectionConfig::slotPlayerLeftGame(KPlayer* p)
// disconnect first
this->disconnect(p);
if (!item(p)) {
- kdError(11001) << k_funcinfo << ": cannot find " << p->id()
+ kdError(11001) << k_funcinfo << ": cannot tqfind " << p->id()
<< " in list" << endl;
return;
}
@@ -743,8 +743,8 @@ void KGameDialogConnectionConfig::slotKickPlayerOut(TQListBoxItem* item)
return;
}
- if (KMessageBox::questionYesNo(this, i18n("Do you want to ban player \"%1\" from the game?").arg(
- p->name()), TQString::null, i18n("Ban Player"), i18n("Do Not Ban")) == KMessageBox::Yes) {
+ if (KMessageBox::questionYesNo(this, i18n("Do you want to ban player \"%1\" from the game?").tqarg(
+ p->name()), TQString(), i18n("Ban Player"), i18n("Do Not Ban")) == KMessageBox::Yes) {
kdDebug(11001) << "will remove player " << p << endl;
game()->removePlayer(p);
// d->mPlayerBox->removeItem(d->mPlayerBox->index(item)); // should be done by signalPlayerLeftGame
diff --git a/libkdegames/kgame/dialogs/kgamedialogconfig.h b/libkdegames/kgame/dialogs/kgamedialogconfig.h
index 911c63aa..7c42d05d 100644
--- a/libkdegames/kgame/dialogs/kgamedialogconfig.h
+++ b/libkdegames/kgame/dialogs/kgamedialogconfig.h
@@ -48,11 +48,12 @@ class KGameDialogConfigPrivate;
* @short Base class for configuration widgets
* @author Andreas Beckermann <b_mann@gmx.de>
**/
-class KDE_EXPORT KGameDialogConfig : public QWidget
+class KDE_EXPORT KGameDialogConfig : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KGameDialogConfig(TQWidget* parent = 0);
+ KGameDialogConfig(TQWidget* tqparent = 0);
virtual ~KGameDialogConfig();
/**
@@ -136,7 +137,7 @@ private:
* The main game configuration widget.
*
* It currently contains a line edit for the name of the player only. You can
- * add widgets by using the KGameDialogGeneralConfig as parent parameter as it
+ * add widgets by using the KGameDialogGeneralConfig as tqparent parameter as it
* uses TQLayout::autoAdd == true.
* @author Andreas Beckermann <b_mann@gmx.de>
**/
@@ -144,23 +145,24 @@ class KGameDialogGeneralConfigPrivate;
class KGameDialogGeneralConfig : public KGameDialogConfig
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Construct a KGameDialogGeneralConfig. Currently it contains a line
* edit widget to change the player name only.
*
* If you just want to add more widgets you can just create your widgets
- * with the KGameDialogGeneralConfig as parent as it uses
+ * with the KGameDialogGeneralConfig as tqparent as it uses
* TQLayout::setAutoAdd(true).
*
- * @param parent Parent widget for this dialog.
+ * @param tqparent Parent widget for this dialog.
* @param initializeGUI If you really don't want to use the
- * predefined widget and/or layout use FALSE here. Note that then none
+ * predefined widget and/or tqlayout use FALSE here. Note that then none
* of the predefined widgets (currently only the name of the player)
* will exist anymore.
*
**/
- KGameDialogGeneralConfig(TQWidget* parent = 0, bool initializeGUI = true);
+ KGameDialogGeneralConfig(TQWidget* tqparent = 0, bool initializeGUI = true);
virtual ~KGameDialogGeneralConfig();
/**
@@ -211,8 +213,9 @@ class KGameDialogNetworkConfigPrivate;
class KDE_EXPORT KGameDialogNetworkConfig : public KGameDialogConfig
{
Q_OBJECT
+ TQ_OBJECT
public:
- KGameDialogNetworkConfig(TQWidget* parent = 0);
+ KGameDialogNetworkConfig(TQWidget* tqparent = 0);
virtual ~KGameDialogNetworkConfig();
@@ -248,7 +251,7 @@ public:
* @param type Service type (something like _kwin4._tcp). It should be unique for application.
* @since 3.4
**/
- void setDiscoveryInfo(const TQString& type, const TQString& name=TQString::null);
+ void setDiscoveryInfo(const TQString& type, const TQString& name=TQString());
signals:
/**
@@ -277,8 +280,9 @@ class KGameDialogMsgServerConfigPrivate;
class KGameDialogMsgServerConfig : public KGameDialogConfig
{
Q_OBJECT
+ TQ_OBJECT
public:
- KGameDialogMsgServerConfig(TQWidget* parent = 0);
+ KGameDialogMsgServerConfig(TQWidget* tqparent = 0);
virtual ~KGameDialogMsgServerConfig();
virtual void submitToKGame(KGame*, KPlayer*) {}
@@ -294,7 +298,7 @@ protected slots:
void slotRemoveClient();
protected:
- void removeClient(Q_UINT32 id);
+ void removeClient(TQ_UINT32 id);
private:
KGameDialogMsgServerConfigPrivate* d;
@@ -310,8 +314,9 @@ class KGameDialogChatConfigPrivate;
class KGameDialogChatConfig : public KGameDialogConfig
{
Q_OBJECT
+ TQ_OBJECT
public:
- KGameDialogChatConfig(int chatMsgId, TQWidget* parent = 0);
+ KGameDialogChatConfig(int chatMsgId, TQWidget* tqparent = 0);
virtual ~KGameDialogChatConfig();
virtual void setKGame(KGame* g);
@@ -331,8 +336,9 @@ class KGameDialogConnectionConfigPrivate;
class KGameDialogConnectionConfig : public KGameDialogConfig
{
Q_OBJECT
+ TQ_OBJECT
public:
- KGameDialogConnectionConfig(TQWidget* parent = 0);
+ KGameDialogConnectionConfig(TQWidget* tqparent = 0);
virtual ~KGameDialogConnectionConfig();
virtual void setKGame(KGame* g);
diff --git a/libkdegames/kgame/dialogs/kgameerrordialog.cpp b/libkdegames/kgame/dialogs/kgameerrordialog.cpp
index 7c3b0509..d5df6ba3 100644
--- a/libkdegames/kgame/dialogs/kgameerrordialog.cpp
+++ b/libkdegames/kgame/dialogs/kgameerrordialog.cpp
@@ -37,7 +37,7 @@ public:
const KGame* mGame;
};
-KGameErrorDialog::KGameErrorDialog(TQWidget* parent) : TQObject(parent)
+KGameErrorDialog::KGameErrorDialog(TQWidget* tqparent) : TQObject(tqparent)
{
d = new KGameErrorDialogPrivate;
}
@@ -59,8 +59,8 @@ void KGameErrorDialog::setKGame(const KGame* g)
this, TQT_SLOT(slotError(int, TQString)));
connect(d->mGame, TQT_SIGNAL(signalConnectionBroken()),
this, TQT_SLOT(slotServerConnectionLost()));
- connect(d->mGame, TQT_SIGNAL(signalClientDisconnected(Q_UINT32,bool)),
- this, TQT_SLOT(slotClientConnectionLost(Q_UINT32,bool)));
+ connect(d->mGame, TQT_SIGNAL(signalClientDisconnected(TQ_UINT32,bool)),
+ this, TQT_SLOT(slotClientConnectionLost(TQ_UINT32,bool)));
}
void KGameErrorDialog::slotUnsetKGame()
@@ -71,33 +71,33 @@ void KGameErrorDialog::slotUnsetKGame()
d->mGame = 0;
}
-void KGameErrorDialog::error(const TQString& errorText, TQWidget* parent)
-{ KMessageBox::error(parent, errorText); }
+void KGameErrorDialog::error(const TQString& errorText, TQWidget* tqparent)
+{ KMessageBox::error(tqparent, errorText); }
void KGameErrorDialog::slotServerConnectionLost()
{
// TODO: add IP/port of the server
TQString message = i18n("Connection to the server has been lost!");
- error(message, (TQWidget*)parent());
+ error(message, (TQWidget*)tqparent());
}
-void KGameErrorDialog::slotClientConnectionLost(Q_UINT32 /*id*/,bool)
+void KGameErrorDialog::slotClientConnectionLost(TQ_UINT32 /*id*/,bool)
{
//TODO: add IP/port of the client
TQString message;
// if (c) {
-// message = i18n("Connection to client has been lost!\nID: %1\nIP: %2").arg(c->id()).arg(c->IP());
+// message = i18n("Connection to client has been lost!\nID: %1\nIP: %2").tqarg(c->id()).tqarg(c->IP());
// } else {
// message = i18n("Connection to client has been lost!");
// }
message = i18n("Connection to client has been lost!");
- error(message, (TQWidget*)parent());
+ error(message, (TQWidget*)tqparent());
}
void KGameErrorDialog::slotError(int errorNo, TQString text)
{
- TQString message = i18n("Received a network error!\nError number: %1\nError message: %2").arg(errorNo).arg(text);
- error(message, (TQWidget*)parent());
+ TQString message = i18n("Received a network error!\nError number: %1\nError message: %2").tqarg(errorNo).tqarg(text);
+ error(message, (TQWidget*)tqparent());
}
void KGameErrorDialog::connectionError(TQString s)
@@ -106,17 +106,17 @@ void KGameErrorDialog::connectionError(TQString s)
if (s.isNull()) {
message = i18n("No connection could be created.");
} else {
- message = i18n("No connection could be created.\nThe error message was:\n%1").arg(s);
+ message = i18n("No connection could be created.\nThe error message was:\n%1").tqarg(s);
}
- error(message, (TQWidget*)parent());
+ error(message, (TQWidget*)tqparent());
}
// should become the real dialog - currently we just use messageboxes
// -> maybe unused forever
-KGameErrorMessageDialog::KGameErrorMessageDialog(TQWidget* parent)
- : KDialogBase(Plain, i18n("Error"), Ok, Ok, parent, 0, true, true)
+KGameErrorMessageDialog::KGameErrorMessageDialog(TQWidget* tqparent)
+ : KDialogBase(Plain, i18n("Error"), Ok, Ok, tqparent, 0, true, true)
{
}
diff --git a/libkdegames/kgame/dialogs/kgameerrordialog.h b/libkdegames/kgame/dialogs/kgameerrordialog.h
index 3883399b..b8d34c1a 100644
--- a/libkdegames/kgame/dialogs/kgameerrordialog.h
+++ b/libkdegames/kgame/dialogs/kgameerrordialog.h
@@ -36,11 +36,12 @@ class KGameErrorDialogPrivate;
* @short Error handling for KGame
* @author Andreas Beckermann <b_mann@gmx.de>
**/
-class KGameErrorDialog : public QObject
+class KGameErrorDialog : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
- KGameErrorDialog(TQWidget* parent);
+ KGameErrorDialog(TQWidget* tqparent);
~KGameErrorDialog();
/**
@@ -55,9 +56,9 @@ public:
* KGame couldn't establish a connection. Use this if
* KGame::initConnection returns false
* @param s A string that describes the error further (like port is
- * already in use). Will be ignored if TQString::null
+ * already in use). Will be ignored if TQString()
**/
- void connectionError(TQString s = TQString::null);
+ void connectionError(TQString s = TQString());
public slots:
void slotError(int error, TQString text);
@@ -74,7 +75,7 @@ public slots:
*
* See @ref KGameNetwork::signalClientDisconnected
**/
- void slotClientConnectionLost(Q_UINT32 clientID,bool broken);
+ void slotClientConnectionLost(TQ_UINT32 clientID,bool broken);
/**
* Unsets a @ref KGame which has been set using @ref setKGame before.
@@ -87,7 +88,7 @@ public slots:
void slotUnsetKGame();
protected:
- void error(const TQString& errorText, TQWidget* parent = 0);
+ void error(const TQString& errorText, TQWidget* tqparent = 0);
private:
KGameErrorDialogPrivate* d;
@@ -103,8 +104,9 @@ private:
class KGameErrorMessageDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KGameErrorMessageDialog(TQWidget* parent);
+ KGameErrorMessageDialog(TQWidget* tqparent);
~KGameErrorMessageDialog();
private:
diff --git a/libkdegames/kgame/kgame.cpp b/libkdegames/kgame/kgame.cpp
index ff215837..42a21580 100644
--- a/libkdegames/kgame/kgame.cpp
+++ b/libkdegames/kgame/kgame.cpp
@@ -75,13 +75,13 @@ public:
//KGamePropertys
KGamePropertyInt mMaxPlayer;
KGamePropertyUInt mMinPlayer;
- KGamePropertyInt mGameStatus; // Game running?
+ KGamePropertyInt mGametqStatus; // Game running?
TQValueList<int> mInactiveIdList;
};
// ------------------- GAME CLASS --------------------------
-KGame::KGame(int cookie,TQObject* parent) : KGameNetwork(cookie,parent)
+KGame::KGame(int cookie,TQObject* tqparent) : KGameNetwork(cookie,tqparent)
{
kdDebug(11001) << k_funcinfo << " - " << this << ", sizeof(KGame)=" << sizeof(KGame) << endl;
d = new KGamePrivate;
@@ -95,16 +95,16 @@ KGame::KGame(int cookie,TQObject* parent) : KGameNetwork(cookie,parent)
d->mMaxPlayer.setLocal(-1); // Infinite
d->mMinPlayer.registerData(KGamePropertyBase::IdMinPlayer, this, i18n("MinPlayers"));
d->mMinPlayer.setLocal(0); // Always ok
- d->mGameStatus.registerData(KGamePropertyBase::IdGameStatus, this, i18n("GameStatus"));
- d->mGameStatus.setLocal(Init);
+ d->mGametqStatus.registerData(KGamePropertyBase::IdGametqStatus, this, i18n("GametqStatus"));
+ d->mGametqStatus.setLocal(Init);
// d->mUniquePlayerNumber = 0;
d->mRandom = new KRandomSequence;
d->mRandom->setSeed(0);
- connect(this, TQT_SIGNAL(signalClientConnected(Q_UINT32)),
- this, TQT_SLOT(slotClientConnected(Q_UINT32)));
- connect(this, TQT_SIGNAL(signalClientDisconnected(Q_UINT32,bool)),
- this, TQT_SLOT(slotClientDisconnected(Q_UINT32,bool)));
+ connect(this, TQT_SIGNAL(signalClientConnected(TQ_UINT32)),
+ this, TQT_SLOT(slotClientConnected(TQ_UINT32)));
+ connect(this, TQT_SIGNAL(signalClientDisconnected(TQ_UINT32,bool)),
+ this, TQT_SLOT(slotClientDisconnected(TQ_UINT32,bool)));
connect(this, TQT_SIGNAL(signalConnectionBroken()),
this, TQT_SLOT(slotServerDisconnected()));
@@ -184,7 +184,7 @@ bool KGame::loadgame(TQDataStream &stream, bool network,bool resetgame)
// Load Game Data
// internal data
- Q_INT32 c;
+ TQ_INT32 c;
stream >> c; // cookie
if (c!=cookie())
@@ -241,7 +241,7 @@ bool KGame::loadgame(TQDataStream &stream, bool network,bool resetgame)
systemAddPlayer(newplayer);
}
- Q_INT16 cookie;
+ TQ_INT16 cookie;
stream >> cookie;
if (cookie==KGAME_LOAD_COOKIE) {
kdDebug(11001) << " Game loaded propertly"<<endl;
@@ -289,7 +289,7 @@ bool KGame::savegame(TQDataStream &stream,bool /*network*/,bool saveplayers)
// Save Game Data
// internal variables
- Q_INT32 c=cookie();
+ TQ_INT32 c=cookie();
stream << c;
uint p=(uint)policy();
@@ -314,7 +314,7 @@ bool KGame::savegame(TQDataStream &stream,bool /*network*/,bool saveplayers)
stream << (uint)0; // no players saved
}
- stream << (Q_INT16)KGAME_LOAD_COOKIE;
+ stream << (TQ_INT16)KGAME_LOAD_COOKIE;
emit signalSave(stream);
return true;
@@ -323,9 +323,9 @@ bool KGame::savegame(TQDataStream &stream,bool /*network*/,bool saveplayers)
void KGame::savePlayer(TQDataStream &stream,KPlayer* p)
{
// this could be in KGameMessage as well
- stream << (Q_INT32)p->rtti();
- stream << (Q_INT32)p->id();
- stream << (Q_INT32)p->calcIOValue();
+ stream << (TQ_INT32)p->rtti();
+ stream << (TQ_INT32)p->id();
+ stream << (TQ_INT32)p->calcIOValue();
p->save(stream);
}
@@ -336,7 +336,7 @@ void KGame::savePlayers(TQDataStream &stream, KGamePlayerList *list)
list=playerList();
}
- Q_INT32 cnt=list->count();
+ TQ_INT32 cnt=list->count();
kdDebug(11001) << "Saving KGame " << cnt << " KPlayer objects " << endl;
stream << cnt;
KPlayer *player;
@@ -353,7 +353,7 @@ KPlayer *KGame::createPlayer(int /*rtti*/,int /*io*/,bool /*isvirtual*/)
}
KPlayer *KGame::loadPlayer(TQDataStream& stream,bool isvirtual)
{
- Q_INT32 rtti,id,iovalue;
+ TQ_INT32 rtti,id,iovalue;
stream >> rtti >> id >> iovalue;
KPlayer *newplayer=findPlayer(id);
if (!newplayer)
@@ -383,7 +383,7 @@ KPlayer *KGame::loadPlayer(TQDataStream& stream,bool isvirtual)
// ----------------- Player handling -----------------------
-KPlayer * KGame::findPlayer(Q_UINT32 id) const
+KPlayer * KGame::findPlayer(TQ_UINT32 id) const
{
for (TQPtrListIterator<KPlayer> it(d->mPlayerList); it.current(); ++it)
{
@@ -507,7 +507,7 @@ void KGame::playerDeleted(KPlayer *player)
}
}
-bool KGame::removePlayer(KPlayer * player, Q_UINT32 receiver)
+bool KGame::removePlayer(KPlayer * player, TQ_UINT32 receiver)
{//transmit to all clients, or to receiver only
if (!player)
{
@@ -542,10 +542,10 @@ void KGame::systemRemovePlayer(KPlayer* player,bool deleteit)
kdWarning(11001) << "player " << player << "(" << player->id() << ") Could not be found!" << endl;
}
- if (gameStatus()==(int)Run && playerCount()<minPlayers())
+ if (gametqStatus()==(int)Run && playerCount()<minPlayers())
{
kdWarning(11001) << k_funcinfo ": not enough players, PAUSING game\n" << endl;
- setGameStatus(Pause);
+ setGametqStatus(Pause);
}
}
@@ -680,11 +680,11 @@ int KGame::maxPlayers() const
uint KGame::playerCount() const
{ return d->mPlayerList.count(); }
-int KGame::gameStatus() const
-{ return d->mGameStatus.value(); }
+int KGame::gametqStatus() const
+{ return d->mGametqStatus.value(); }
bool KGame::isRunning() const
-{ return d->mGameStatus.value() == Run; }
+{ return d->mGametqStatus.value() == Run; }
KGamePropertyHandler* KGame::dataHandler() const
{ return d->mProperties; }
@@ -706,7 +706,7 @@ KRandomSequence* KGame::random() const
{ return d->mRandom; }
-bool KGame::sendPlayerInput(TQDataStream &msg, KPlayer *player, Q_UINT32 sender)
+bool KGame::sendPlayerInput(TQDataStream &msg, KPlayer *player, TQ_UINT32 sender)
{
if (!player)
{
@@ -724,7 +724,7 @@ bool KGame::sendPlayerInput(TQDataStream &msg, KPlayer *player, Q_UINT32 sender)
return true;
}
-bool KGame::systemPlayerInput(TQDataStream &msg, KPlayer *player, Q_UINT32 sender)
+bool KGame::systemPlayerInput(TQDataStream &msg, KPlayer *player, TQ_UINT32 sender)
{
if (!player)
{
@@ -772,7 +772,7 @@ KPlayer * KGame::playerInputFinished(KPlayer *player)
{
player->setTurn(false);
}
- setGameStatus(End);
+ setGametqStatus(End);
emit signalGameOver(gameOver,player,this);
}
else if (!player->asyncInput())
@@ -829,7 +829,7 @@ KPlayer *KGame::nextPlayer(KPlayer *last,bool exclusive)
return 0;
}
-void KGame::setGameStatus(int status)
+void KGame::setGametqStatus(int status)
{
kdDebug(11001) << k_funcinfo << ": GAMESTATUS CHANGED to" << status << endl;
if (status==(int)Run && playerCount()<minPlayers())
@@ -837,10 +837,10 @@ void KGame::setGameStatus(int status)
kdDebug(11001) << k_funcinfo << ": not enough players, pausing game\n" << endl;
status=Pause;
}
- d->mGameStatus = status;
+ d->mGametqStatus = status;
}
-void KGame::networkTransmission(TQDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender, Q_UINT32 /*clientID*/)
+void KGame::networkTransmission(TQDataStream &stream, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender, TQ_UINT32 /*clientID*/)
{//clientID is unused
// message targets a playerobject. If we find it we forward the message to the
// player. Otherwise we proceed here and hope the best that the user processes
@@ -884,8 +884,8 @@ void KGame::networkTransmission(TQDataStream &stream, int msgid, Q_UINT32 receiv
{
case KGameMessage::IdSetupGame: // Client: First step in setup game
{
- Q_INT16 v;
- Q_INT32 c;
+ TQ_INT16 v;
+ TQ_INT32 c;
stream >> v >> c;
kdDebug(11001) << " ===================> (Client) " << k_funcinfo << ": Got IdSetupGame ================== " << endl;
kdDebug(11001) << "our game id is " << gameId() << " Lib version=" << v << " App Cookie=" << c << endl;
@@ -1043,10 +1043,10 @@ void KGame::networkTransmission(TQDataStream &stream, int msgid, Q_UINT32 receiv
// called by the IdSetupGameContinue Message - MASTER SIDE
// Here the master needs to decide which players can take part at the game
// and which will be deactivated
-void KGame::setupGameContinue(TQDataStream& stream, Q_UINT32 sender)
+void KGame::setupGameContinue(TQDataStream& stream, TQ_UINT32 sender)
{
KPlayer *player;
- Q_INT32 cnt;
+ TQ_INT32 cnt;
int i;
stream >> cnt;
@@ -1093,7 +1093,7 @@ void KGame::setupGameContinue(TQDataStream& stream, Q_UINT32 sender)
for ( player=newPlayerList.first(); player != 0; player=newPlayerList.next() )
{
// Already in the list
- if (inactivateIds.find(player->id())!=inactivateIds.end())
+ if (inactivateIds.tqfind(player->id())!=inactivateIds.end())
{
continue;
}
@@ -1109,7 +1109,7 @@ void KGame::setupGameContinue(TQDataStream& stream, Q_UINT32 sender)
for ( player=d->mPlayerList.first(); player != 0; player=d->mPlayerList.next() )
{
// Already in the list
- if (inactivateIds.find(player->id())!=inactivateIds.end())
+ if (inactivateIds.tqfind(player->id())!=inactivateIds.end())
{
continue;
}
@@ -1171,9 +1171,9 @@ void KGame::setupGameContinue(TQDataStream& stream, Q_UINT32 sender)
// Now send out the player list which the client can activate
for ( player=newPlayerList.first(); player != 0; player=newPlayerList.next() )
{
- kdDebug(11001) << " newplayerlist contains " << player->id() << endl;
+ kdDebug(11001) << " newplayerlist tqcontains " << player->id() << endl;
// Only activate what is not in the list
- if (inactivateIds.find(player->id())!=inactivateIds.end())
+ if (inactivateIds.tqfind(player->id())!=inactivateIds.end())
{
continue;
}
@@ -1195,14 +1195,14 @@ void KGame::setupGameContinue(TQDataStream& stream, Q_UINT32 sender)
// called by the IdSetupGame Message - CLIENT SIDE
// Client needs to prepare for network transfer
-void KGame::setupGame(Q_UINT32 sender)
+void KGame::setupGame(TQ_UINT32 sender)
{
TQByteArray bufferS;
TQDataStream streamS(bufferS,IO_WriteOnly);
// Deactivate all players
KGamePlayerList mTmpList(d->mPlayerList); // we need copy otherwise the removal crashes
- Q_INT32 cnt=mTmpList.count();
+ TQ_INT32 cnt=mTmpList.count();
kdDebug(11001) << "Client: playerlistcount=" << d->mPlayerList.count() << " tmplistcout=" << cnt << endl;
streamS << cnt;
@@ -1244,14 +1244,14 @@ void KGame::Debug()
kdDebug(11001) << "------------------- KGAME -------------------------" << endl;
kdDebug(11001) << "this: " << this << endl;
kdDebug(11001) << "uniquePlayer " << d->mUniquePlayerNumber << endl;
- kdDebug(11001) << "gameStatus " << gameStatus() << endl;
+ kdDebug(11001) << "gametqStatus " << gametqStatus() << endl;
kdDebug(11001) << "MaxPlayers : " << maxPlayers() << endl;
kdDebug(11001) << "NoOfPlayers : " << playerCount() << endl;
kdDebug(11001) << "NoOfInactive: " << d->mInactivePlayerList.count() << endl;
kdDebug(11001) << "---------------------------------------------------" << endl;
}
-void KGame::slotClientConnected(Q_UINT32 clientID)
+void KGame::slotClientConnected(TQ_UINT32 clientID)
{
if (isAdmin())
{
@@ -1264,7 +1264,7 @@ void KGame::slotServerDisconnected() // Client side
kdDebug(11001) << "======= SERVER DISCONNECT ======="<<endl;
kdDebug(11001) << "+++ (CLIENT)++++++++" << k_funcinfo << ": our GameID="<<gameId() << endl;
- int oldgamestatus=gameStatus();
+ int oldgamestatus=gametqStatus();
KPlayer *player;
KGamePlayerList removeList;
@@ -1322,11 +1322,11 @@ void KGame::slotServerDisconnected() // Client side
emit signalClientLeftGame(0,oldgamestatus,this);
}
-void KGame::slotClientDisconnected(Q_UINT32 clientID,bool /*broken*/) // server side
+void KGame::slotClientDisconnected(TQ_UINT32 clientID,bool /*broken*/) // server side
{
kdDebug(11001) << "++++(SERVER)+++++++" << k_funcinfo << " clientId=" << clientID << endl;
- int oldgamestatus=gameStatus();
+ int oldgamestatus=gametqStatus();
KPlayer *player;
KGamePlayerList removeList;
@@ -1373,7 +1373,7 @@ void KGame::slotClientDisconnected(Q_UINT32 clientID,bool /*broken*/) // server
// we send the number of players (including type) as well as game status and
// properties to the client. After the initialization has been completed both
// clients should have the same status (ie players, properties, etc)
-void KGame::negotiateNetworkGame(Q_UINT32 clientID)
+void KGame::negotiateNetworkGame(TQ_UINT32 clientID)
{
kdDebug(11001) << "===========================" << k_funcinfo << ": clientID=" << clientID << " =========================== "<< endl;
if (!isAdmin())
@@ -1386,17 +1386,17 @@ void KGame::negotiateNetworkGame(Q_UINT32 clientID)
TQDataStream streamGS(buffer,IO_WriteOnly);
// write Game setup specific data
- //streamGS << (Q_INT32)maxPlayers();
- //streamGS << (Q_INT32)minPlayers();
+ //streamGS << (TQ_INT32)maxPlayers();
+ //streamGS << (TQ_INT32)minPlayers();
// send to the newly connected client *only*
- Q_INT16 v=KGameMessage::version();
- Q_INT32 c=cookie();
+ TQ_INT16 v=KGameMessage::version();
+ TQ_INT32 c=cookie();
streamGS << v << c;
sendSystemMessage(streamGS, KGameMessage::IdSetupGame, clientID);
}
-bool KGame::sendGroupMessage(const TQByteArray &msg, int msgid, Q_UINT32 sender, const TQString& group)
+bool KGame::sendGroupMessage(const TQByteArray &msg, int msgid, TQ_UINT32 sender, const TQString& group)
{
// AB: group must not be i18n'ed!! we should better use an id for group and use
// a groupName() for the name // FIXME
@@ -1411,10 +1411,10 @@ bool KGame::sendGroupMessage(const TQByteArray &msg, int msgid, Q_UINT32 sender,
return true;
}
-bool KGame::sendGroupMessage(const TQDataStream &msg, int msgid, Q_UINT32 sender, const TQString& group)
+bool KGame::sendGroupMessage(const TQDataStream &msg, int msgid, TQ_UINT32 sender, const TQString& group)
{ return sendGroupMessage(((TQBuffer*)msg.device())->buffer(), msgid, sender, group); }
-bool KGame::sendGroupMessage(const TQString& msg, int msgid, Q_UINT32 sender, const TQString& group)
+bool KGame::sendGroupMessage(const TQString& msg, int msgid, TQ_UINT32 sender, const TQString& group)
{
TQByteArray buffer;
TQDataStream stream(buffer, IO_WriteOnly);
@@ -1425,7 +1425,7 @@ bool KGame::sendGroupMessage(const TQString& msg, int msgid, Q_UINT32 sender, co
bool KGame::addProperty(KGamePropertyBase* data)
{ return dataHandler()->addProperty(data); }
-bool KGame::sendPlayerProperty(int msgid, TQDataStream& s, Q_UINT32 playerId)
+bool KGame::sendPlayerProperty(int msgid, TQDataStream& s, TQ_UINT32 playerId)
{ return sendSystemMessage(s, msgid, playerId); }
void KGame::sendProperty(int msgid, TQDataStream& stream, bool* sent)
@@ -1443,7 +1443,7 @@ void KGame::emitSignal(KGamePropertyBase *me)
}
KGamePropertyBase* KGame::findProperty(int id) const
-{ return d->mProperties->find(id); }
+{ return d->mProperties->tqfind(id); }
KGame::GamePolicy KGame::policy() const
{
diff --git a/libkdegames/kgame/kgame.h b/libkdegames/kgame/kgame.h
index 85a8356c..af278d5a 100644
--- a/libkdegames/kgame/kgame.h
+++ b/libkdegames/kgame/kgame.h
@@ -62,6 +62,7 @@ class KGamePrivate;
class KDE_EXPORT KGame : public KGameNetwork
{
Q_OBJECT
+ TQ_OBJECT
public:
typedef TQPtrList<KPlayer> KGamePlayerList;
@@ -100,7 +101,7 @@ public:
* game in load/save and network operations. Change this between
* games.
*/
- KGame(int cookie=42,TQObject* parent=0);
+ KGame(int cookie=42,TQObject* tqparent=0);
/**
* Destructs the game
@@ -117,7 +118,7 @@ public:
* The KGame e.g. sets the status to Pause when you have
* less player than the minimum amount
*/
- enum GameStatus
+ enum GametqStatus
{
Init = 0,
Run = 1,
@@ -126,7 +127,7 @@ public:
Abort = 4,
SystemPause = 5,
Intro = 6,
- UserStatus = 7
+ UsertqStatus = 7
};
// Properties
@@ -178,7 +179,7 @@ public:
* @param id Player id
* @return player object
*/
- KPlayer *findPlayer(Q_UINT32 id) const;
+ KPlayer *findPlayer(TQ_UINT32 id) const;
/**
* Set a new @ref KGameSequence to control player management. By default
@@ -282,7 +283,7 @@ public:
* Called by KPlayer to send a player input to the
* KMessageServer.
**/
- virtual bool sendPlayerInput(TQDataStream &msg,KPlayer *player,Q_UINT32 sender=0);
+ virtual bool sendPlayerInput(TQDataStream &msg,KPlayer *player,TQ_UINT32 sender=0);
/**
* Called when a player input arrives from KMessageServer.
@@ -294,7 +295,7 @@ public:
*
* For documentation see playerInput.
**/
- virtual bool systemPlayerInput(TQDataStream &msg,KPlayer *player,Q_UINT32 sender=0);
+ virtual bool systemPlayerInput(TQDataStream &msg,KPlayer *player,TQ_UINT32 sender=0);
/**
* This virtual function is called if the KGame needs to create a new player.
@@ -386,14 +387,14 @@ public:
*
* @return game status
*/
- int gameStatus() const;
+ int gametqStatus() const;
/**
* sets the game status
*
* @param status the new status
*/
- void setGameStatus(int status);
+ void setGametqStatus(int status);
/**
* docu: see KPlayer
@@ -403,7 +404,7 @@ public:
/**
* This is called by KPlayer::sendProperty only! Internal function!
**/
- bool sendPlayerProperty(int msgid, TQDataStream& s, Q_UINT32 playerId);
+ bool sendPlayerProperty(int msgid, TQDataStream& s, TQ_UINT32 playerId);
/**
* This function allows to find the pointer to a player
@@ -432,13 +433,13 @@ public:
* @param msg the message which will be send. See messages.txt for contents
* @param msgid an id for this message
* @param sender the id of the sender
- * @param group the group of the receivers
+ * @param group the group of the tqreceivers
* @return true if worked
*/
- bool sendGroupMessage(const TQByteArray& msg, int msgid, Q_UINT32 sender, const TQString& group);
- bool sendGroupMessage(const TQDataStream &msg, int msgid, Q_UINT32 sender, const TQString& group);
- bool sendGroupMessage(int msg, int msgid, Q_UINT32 sender, const TQString& group);
- bool sendGroupMessage(const TQString& msg, int msgid, Q_UINT32 sender, const TQString& group);
+ bool sendGroupMessage(const TQByteArray& msg, int msgid, TQ_UINT32 sender, const TQString& group);
+ bool sendGroupMessage(const TQDataStream &msg, int msgid, TQ_UINT32 sender, const TQString& group);
+ bool sendGroupMessage(int msg, int msgid, TQ_UINT32 sender, const TQString& group);
+ bool sendGroupMessage(const TQString& msg, int msgid, TQ_UINT32 sender, const TQString& group);
/**
* This will either forward an incoming message to a specified player
@@ -458,7 +459,7 @@ public:
* @param sender
* @param clientID the client from which we received the transmission - hardly used
**/
- virtual void networkTransmission(TQDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender, Q_UINT32 clientID);
+ virtual void networkTransmission(TQDataStream &stream, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender, TQ_UINT32 clientID);
/**
* Returns a pointer to the KGame property handler
@@ -487,7 +488,7 @@ protected slots:
* Calls negotiateNetworkGame()
* See KGameNetwork::signalClientConnected
**/
- void slotClientConnected(Q_UINT32 clientId);
+ void slotClientConnected(TQ_UINT32 clientId);
/**
* This slot is called whenever the connection to a client is lost (ie the
@@ -496,7 +497,7 @@ protected slots:
* @param clientId The client the connection has been lost to
* @param broken (ignore this - not used)
**/
- void slotClientDisconnected(Q_UINT32 clientId,bool broken);
+ void slotClientDisconnected(TQ_UINT32 clientId,bool broken);
/**
* This slot is called whenever the connection to the server is lost (ie the
@@ -593,14 +594,14 @@ signals:
* own methods and has to syncronise them over the network.
* Reaction to this is usually a call to a KGame function.
*/
- void signalNetworkData(int msgid,const TQByteArray& buffer, Q_UINT32 receiver, Q_UINT32 sender);
+ void signalNetworkData(int msgid,const TQByteArray& buffer, TQ_UINT32 receiver, TQ_UINT32 sender);
/**
* We got an network message. this can be used to notify us that something
* changed. What changed can be seen in the message id. Whether this is
* the best possible method to do this is unclear...
*/
- void signalMessageUpdate(int msgid,Q_UINT32 receiver,Q_UINT32 sender);
+ void signalMessageUpdate(int msgid,TQ_UINT32 receiver,TQ_UINT32 sender);
/**
* a player left the game because of a broken connection or so!
@@ -649,7 +650,7 @@ signals:
* @param clientid - The id of the new client
* @param me - our game pointer
*/
- void signalClientJoinedGame(Q_UINT32 clientid,KGame *me);
+ void signalClientJoinedGame(TQ_UINT32 clientid,KGame *me);
/**
* This signal is emitted after a network partner left the
@@ -688,7 +689,7 @@ protected:
* \code
* bool MyClass::playerInput(TQDataStream &msg,KPlayer *player)
* {
- * Q_INT32 move;
+ * TQ_INT32 move;
* msg >> move;
* kdDebug() << " Player " << player->id() << " moved to " << move <<
* endl;
@@ -839,7 +840,7 @@ protected:
* Only the ADMIN is allowed to call this.
* @param clientID The ID of the message client which has connected
**/
- virtual void negotiateNetworkGame(Q_UINT32 clientID);
+ virtual void negotiateNetworkGame(TQ_UINT32 clientID);
/**
* syncronise the random numbers with all network clients
@@ -896,24 +897,24 @@ private:
* ever need this. It it internally used to initialize a newly connected
* client.
**/
- //void addPlayer(KPlayer* newplayer, Q_UINT32 receiver);
+ //void addPlayer(KPlayer* newplayer, TQ_UINT32 receiver);
/**
* Just the same as the public one except receiver:
* @param receiver 0 for broadcast, otherwise the receiver. Should only be
* used in special circumstances and not outside KGame.
**/
- bool removePlayer(KPlayer * player, Q_UINT32 receiver);
+ bool removePlayer(KPlayer * player, TQ_UINT32 receiver);
/**
* Helping function - game negotiation
**/
- void setupGame(Q_UINT32 sender);
+ void setupGame(TQ_UINT32 sender);
/**
* Helping function - game negotiation
**/
- void setupGameContinue(TQDataStream& msg, Q_UINT32 sender);
+ void setupGameContinue(TQDataStream& msg, TQ_UINT32 sender);
/**
* Removes a player from all lists, removes the @ref KGame pointer from the
diff --git a/libkdegames/kgame/kgamechat.cpp b/libkdegames/kgame/kgamechat.cpp
index ddc1bd66..29d80807 100644
--- a/libkdegames/kgame/kgamechat.cpp
+++ b/libkdegames/kgame/kgamechat.cpp
@@ -57,18 +57,18 @@ public:
int mToMyGroup; // just as the above - but for the group, not for players
};
-KGameChat::KGameChat(KGame* g, int msgid, TQWidget* parent) : KChatBase(parent)
+KGameChat::KGameChat(KGame* g, int msgid, TQWidget* tqparent) : KChatBase(tqparent)
{
init(g, msgid);
}
-KGameChat::KGameChat(KGame* g, int msgid, KPlayer* fromPlayer, TQWidget* parent) : KChatBase(parent)
+KGameChat::KGameChat(KGame* g, int msgid, KPlayer* fromPlayer, TQWidget* tqparent) : KChatBase(tqparent)
{
init(g, msgid);
setFromPlayer(fromPlayer);
}
-KGameChat::KGameChat(TQWidget* parent) : KChatBase(parent)
+KGameChat::KGameChat(TQWidget* tqparent) : KChatBase(tqparent)
{
init(0, -1);
}
@@ -92,7 +92,7 @@ void KGameChat::addMessage(int fromId, const TQString& text)
{
if (!d->mGame) {
kdWarning(11001) << "no KGame object has been set" << endl;
- addMessage(i18n("Player %1").arg(fromId), text);
+ addMessage(i18n("Player %1").tqarg(fromId), text);
} else {
KPlayer* p = d->mGame->findPlayer(fromId);
if (p) {
@@ -162,10 +162,10 @@ bool KGameChat::isToGroupMessage(int id) const
bool KGameChat::isToPlayerMessage(int id) const
{
-return d->mSendId2PlayerId.contains(id); }
+return d->mSendId2PlayerId.tqcontains(id); }
TQString KGameChat::sendToPlayerEntry(const TQString& name) const
-{ return i18n("Send to %1").arg(name); }
+{ return i18n("Send to %1").tqarg(name); }
int KGameChat::playerId(int id) const
{
@@ -188,7 +188,7 @@ int KGameChat::sendingId(int playerId) const
}
const TQString& KGameChat::fromName() const
-{ return d->mFromPlayer ? d->mFromPlayer->name() : TQString::null; }
+{ return d->mFromPlayer ? d->mFromPlayer->name() : TQString(); }
bool KGameChat::hasPlayer(int id) const
{
@@ -211,7 +211,7 @@ void KGameChat::setFromPlayer(KPlayer* p)
removeSendingEntry(d->mToMyGroup);
}
d->mToMyGroup = nextId();
- addSendingEntry(i18n("Send to My Group (\"%1\")").arg(p->group()), d->mToMyGroup);
+ addSendingEntry(i18n("Send to My Group (\"%1\")").tqarg(p->group()), d->mToMyGroup);
}
d->mFromPlayer = p;
kdDebug(11001) << k_funcinfo << " player=" << p << endl;
@@ -231,8 +231,8 @@ void KGameChat::setKGame(KGame* g)
this, TQT_SLOT(slotAddPlayer(KPlayer*)));
connect(d->mGame, TQT_SIGNAL(signalPlayerLeftGame(KPlayer*)),
this, TQT_SLOT(slotRemovePlayer(KPlayer*)));
- connect(d->mGame, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, Q_UINT32, Q_UINT32)),
- this, TQT_SLOT(slotReceiveMessage(int, const TQByteArray&, Q_UINT32, Q_UINT32)));
+ connect(d->mGame, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, TQ_UINT32, TQ_UINT32)),
+ this, TQT_SLOT(slotReceiveMessage(int, const TQByteArray&, TQ_UINT32, TQ_UINT32)));
connect(d->mGame, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotUnsetKGame()));
TQPtrList<KPlayer> playerList = *d->mGame->playerList();
@@ -283,8 +283,8 @@ void KGameChat::slotAddPlayer(KPlayer* p)
d->mSendId2PlayerId.insert(sendingId, p->id());
connect(p, TQT_SIGNAL(signalPropertyChanged(KGamePropertyBase*, KPlayer*)),
this, TQT_SLOT(slotPropertyChanged(KGamePropertyBase*, KPlayer*)));
- connect(p, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, Q_UINT32, KPlayer*)),
- this, TQT_SLOT(slotReceivePrivateMessage(int, const TQByteArray&, Q_UINT32, KPlayer*)));
+ connect(p, TQT_SIGNAL(signalNetworkData(int, const TQByteArray&, TQ_UINT32, KPlayer*)),
+ this, TQT_SLOT(slotReceivePrivateMessage(int, const TQByteArray&, TQ_UINT32, KPlayer*)));
}
void KGameChat::slotRemovePlayer(KPlayer* p)
@@ -317,7 +317,7 @@ void KGameChat::slotPropertyChanged(KGamePropertyBase* prop, KPlayer* player)
}
}
-void KGameChat::slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, Q_UINT32 sender, KPlayer* me)
+void KGameChat::slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, TQ_UINT32 sender, KPlayer* me)
{
if (!me || me != fromPlayer()) {
kdDebug() << k_funcinfo << "nope - not for us!" << endl;
@@ -326,7 +326,7 @@ void KGameChat::slotReceivePrivateMessage(int msgid, const TQByteArray& buffer,
slotReceiveMessage(msgid, buffer, me->id(), sender);
}
-void KGameChat::slotReceiveMessage(int msgid, const TQByteArray& buffer, Q_UINT32 , Q_UINT32 sender)
+void KGameChat::slotReceiveMessage(int msgid, const TQByteArray& buffer, TQ_UINT32 , TQ_UINT32 sender)
{
TQDataStream msg(buffer, IO_ReadOnly);
if (msgid != messageId()) {
diff --git a/libkdegames/kgame/kgamechat.h b/libkdegames/kgame/kgamechat.h
index effcca22..f0d8310d 100644
--- a/libkdegames/kgame/kgamechat.h
+++ b/libkdegames/kgame/kgamechat.h
@@ -43,20 +43,21 @@ class KGameChatPrivate;
class KDE_EXPORT KGameChat : public KChatBase
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Construct a @ref KGame chat widget on @p game that used @p msgid for
* the chat message. The @p fromPlayer is the local player (see @ref
* setFromPlayer).
**/
- KGameChat(KGame* game, int msgid, KPlayer* fromPlayer, TQWidget * parent);
+ KGameChat(KGame* game, int msgid, KPlayer* fromPlayer, TQWidget * tqparent);
/**
* @overload
* To make use of this widget you need to call @ref setFromPlayer
* manually.
**/
- KGameChat(KGame* game, int msgId, TQWidget* parent);
+ KGameChat(KGame* game, int msgId, TQWidget* tqparent);
/**
* @overload
@@ -64,7 +65,7 @@ public:
* setGame, setFromPlayer and setMessageId manually.
* @since 3.2
**/
- KGameChat(TQWidget* parent);
+ KGameChat(TQWidget* tqparent);
virtual ~KGameChat();
@@ -102,7 +103,7 @@ public:
/**
* Change the message id of the chat widget. It is recommended that you
* don't use this but prefer the constructor instead, but in certain
- * situations (such as using this widget in Qt designer) it may be
+ * situations (such as using this widget in TQt designer) it may be
* useful to change the message id.
*
* See also @ref messageId
@@ -121,7 +122,7 @@ public slots:
virtual void addMessage(const TQString& fromName, const TQString& text) { KChatBase::addMessage(fromName, text);}
virtual void addMessage(int fromId, const TQString& text);
- void slotReceiveMessage(int, const TQByteArray&, Q_UINT32 receiver, Q_UINT32 sender);
+ void slotReceiveMessage(int, const TQByteArray&, TQ_UINT32 receiver, TQ_UINT32 sender);
protected:
/**
@@ -208,7 +209,7 @@ protected slots:
* gets forwarded to slotReceiveMessage if @p me equals
* fromPlayer.
**/
- void slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, Q_UINT32 sender, KPlayer* me);
+ void slotReceivePrivateMessage(int msgid, const TQByteArray& buffer, TQ_UINT32 sender, KPlayer* me);
protected:
virtual void returnPressed(const TQString& text);
diff --git a/libkdegames/kgame/kgameerror.cpp b/libkdegames/kgame/kgameerror.cpp
index eb98a797..ef6145fb 100644
--- a/libkdegames/kgame/kgameerror.cpp
+++ b/libkdegames/kgame/kgameerror.cpp
@@ -30,8 +30,8 @@ TQByteArray KGameError::errVersion(int remoteVersion)
{
TQByteArray b;
TQDataStream s(b, IO_WriteOnly);
- s << (Q_INT32)KGameMessage::version();
- s << (Q_INT32)remoteVersion;
+ s << (TQ_INT32)KGameMessage::version();
+ s << (TQ_INT32)remoteVersion;
return b;
}
@@ -39,8 +39,8 @@ TQByteArray KGameError::errCookie(int localCookie, int remoteCookie)
{
TQByteArray b;
TQDataStream s(b, IO_WriteOnly);
- s << (Q_INT32)localCookie;
- s << (Q_INT32)remoteCookie;
+ s << (TQ_INT32)localCookie;
+ s << (TQ_INT32)remoteCookie;
return b;
}
@@ -56,24 +56,24 @@ TQString KGameError::errorText(int errorCode, TQDataStream& s)
switch (errorCode) {
case Cookie:
{
- Q_INT32 cookie1;
- Q_INT32 cookie2;
+ TQ_INT32 cookie1;
+ TQ_INT32 cookie2;
s >> cookie1;
s >> cookie2;
- text = i18n("Cookie mismatch!\nExpected Cookie: %1\nReceived Cookie: %2").arg(cookie1).arg(cookie2);
+ text = i18n("Cookie mismatch!\nExpected Cookie: %1\nReceived Cookie: %2").tqarg(cookie1).tqarg(cookie2);
break;
}
case Version:
{
- Q_INT32 version1;
- Q_INT32 version2;
+ TQ_INT32 version1;
+ TQ_INT32 version2;
s >> version1;
s >> version2;
- text = i18n("KGame Version mismatch!\nExpected Version: %1\nReceived Version: %2\n").arg(version1).arg(version2);
+ text = i18n("KGame Version mismatch!\nExpected Version: %1\nReceived Version: %2\n").tqarg(version1).tqarg(version2);
break;
}
default:
- text = i18n("Unknown error code %1").arg(errorCode);
+ text = i18n("Unknown error code %1").tqarg(errorCode);
}
return text;
}
diff --git a/libkdegames/kgame/kgameio.cpp b/libkdegames/kgame/kgameio.cpp
index 7183d5d3..a408c0cd 100644
--- a/libkdegames/kgame/kgameio.cpp
+++ b/libkdegames/kgame/kgameio.cpp
@@ -82,7 +82,7 @@ void KGameIO::notifyTurn(bool b)
if (sendit)
{
TQDataStream ostream(buffer,IO_ReadOnly);
- Q_UINT32 sender = player()->id(); // force correct sender
+ TQ_UINT32 sender = player()->id(); // force correct sender
kdDebug(11001) << "Prepare turn sendInput" << endl;
sendInput(ostream, true, sender);
}
@@ -97,7 +97,7 @@ KGame* KGameIO::game() const
return player()->game();
}
-bool KGameIO::sendInput(TQDataStream& s, bool transmit, Q_UINT32 sender)
+bool KGameIO::sendInput(TQDataStream& s, bool transmit, TQ_UINT32 sender)
{
if (!player())
{
@@ -117,21 +117,21 @@ void KGameIO::Debug()
// ----------------------- Key IO ---------------------------
-KGameKeyIO::KGameKeyIO(TQWidget *parent)
+KGameKeyIO::KGameKeyIO(TQWidget *tqparent)
: KGameIO()
{
- if (parent)
+ if (tqparent)
{
kdDebug(11001) << "Key Event filter installed" << endl;
- parent->installEventFilter(this);
+ tqparent->installEventFilter(this);
}
}
KGameKeyIO::~KGameKeyIO()
{
- if (parent())
+ if (tqparent())
{
- parent()->removeEventFilter(this);
+ tqparent()->removeEventFilter(this);
}
}
@@ -167,22 +167,22 @@ bool KGameKeyIO::eventFilter( TQObject *o, TQEvent *e )
// ----------------------- Mouse IO ---------------------------
-KGameMouseIO::KGameMouseIO(TQWidget *parent,bool trackmouse)
+KGameMouseIO::KGameMouseIO(TQWidget *tqparent,bool trackmouse)
: KGameIO()
{
- if (parent)
+ if (tqparent)
{
kdDebug(11001) << "Mouse Event filter installed tracking=" << trackmouse << endl;
- parent->installEventFilter(this);
- parent->setMouseTracking(trackmouse);
+ tqparent->installEventFilter(this);
+ tqparent->setMouseTracking(trackmouse);
}
}
KGameMouseIO::~KGameMouseIO()
{
- if (parent())
+ if (tqparent())
{
- parent()->removeEventFilter(this);
+ tqparent()->removeEventFilter(this);
}
}
@@ -193,9 +193,9 @@ int KGameMouseIO::rtti() const
void KGameMouseIO::setMouseTracking(bool b)
{
- if (parent())
+ if (tqparent())
{
- ((TQWidget*)parent())->setMouseTracking(b);
+ ((TQWidget*)tqparent())->setMouseTracking(b);
}
}
@@ -266,10 +266,10 @@ KGameProcessIO::KGameProcessIO(const TQString& name)
//kdDebug(11001) << "================= KMEssage SetSErver ==================== " << endl;
//d->mMessageClient->setServer(d->mMessageServer);
kdDebug(11001) << "================= KMEssage: Connect ==================== " << endl;
- //connect(d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)),
- // this, TQT_SLOT(clientMessage(const TQByteArray&, Q_UINT32)));
- //connect(d->mMessageClient, TQT_SIGNAL(forwardReceived(const TQByteArray&, Q_UINT32, const TQValueList <Q_UINT32> &)),
- // this, TQT_SLOT(clientMessage(const TQByteArray&, Q_UINT32, const TQValueList <Q_UINT32> &)));
+ //connect(d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, TQ_UINT32)),
+ // this, TQT_SLOT(clientMessage(const TQByteArray&, TQ_UINT32)));
+ //connect(d->mMessageClient, TQT_SIGNAL(forwardReceived(const TQByteArray&, TQ_UINT32, const TQValueList <TQ_UINT32> &)),
+ // this, TQT_SLOT(clientMessage(const TQByteArray&, TQ_UINT32, const TQValueList <TQ_UINT32> &)));
connect(d->mProcessIO, TQT_SIGNAL(received(const TQByteArray&)),
this, TQT_SLOT(receivedMessage(const TQByteArray&)));
//kdDebug(11001) << "Our client is id="<<d->mMessageClient->id() << endl;
@@ -302,7 +302,7 @@ void KGameProcessIO::initIO(KPlayer *p)
// Send 'hello' to process
TQByteArray buffer;
TQDataStream stream(buffer, IO_WriteOnly);
- Q_INT16 id = p->userId();
+ TQ_INT16 id = p->userId();
stream << id;
bool sendit=true;
@@ -311,7 +311,7 @@ void KGameProcessIO::initIO(KPlayer *p)
emit signalIOAdded(this,stream,p,&sendit);
if (sendit )
{
- Q_UINT32 sender = p->id();
+ TQ_UINT32 sender = p->id();
kdDebug(11001) << "Sending IOAdded to process player !!!!!!!!!!!!!! " << endl;
sendSystemMessage(stream, KGameMessage::IdIOAdded, 0, sender);
}
@@ -328,27 +328,27 @@ void KGameProcessIO::notifyTurn(bool b)
bool sendit=true;
TQByteArray buffer;
TQDataStream stream(buffer,IO_WriteOnly);
- stream << (Q_INT8)b;
+ stream << (TQ_INT8)b;
emit signalPrepareTurn(stream,b,this,&sendit);
if (sendit)
{
- Q_UINT32 sender=player()->id();
+ TQ_UINT32 sender=player()->id();
kdDebug(11001) << "Sending Turn to process player !!!!!!!!!!!!!! " << endl;
sendSystemMessage(stream, KGameMessage::IdTurn, 0, sender);
}
}
-void KGameProcessIO::sendSystemMessage(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+void KGameProcessIO::sendSystemMessage(TQDataStream &stream,int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
{
sendAllMessages(stream, msgid, receiver, sender, false);
}
-void KGameProcessIO::sendMessage(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+void KGameProcessIO::sendMessage(TQDataStream &stream,int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
{
sendAllMessages(stream, msgid, receiver, sender, true);
}
-void KGameProcessIO::sendAllMessages(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender, bool usermsg)
+void KGameProcessIO::sendAllMessages(TQDataStream &stream,int msgid, TQ_UINT32 receiver, TQ_UINT32 sender, bool usermsg)
{
kdDebug(11001) << "==============> KGameProcessIO::sendMessage (usermsg="<<usermsg<<")" << endl;
// if (!player()) return ;
@@ -377,13 +377,13 @@ void KGameProcessIO::sendAllMessages(TQDataStream &stream,int msgid, Q_UINT32 re
}
}
-//void KGameProcessIO::clientMessage(const TQByteArray& receiveBuffer, Q_UINT32 clientID, const TQValueList <Q_UINT32> &recv)
+//void KGameProcessIO::clientMessage(const TQByteArray& receiveBuffer, TQ_UINT32 clientID, const TQValueList <TQ_UINT32> &recv)
void KGameProcessIO::receivedMessage(const TQByteArray& receiveBuffer)
{
TQDataStream stream(receiveBuffer,IO_ReadOnly);
int msgid;
- Q_UINT32 sender;
- Q_UINT32 receiver;
+ TQ_UINT32 sender;
+ TQ_UINT32 receiver;
KGameMessage::extractHeader(stream,sender,receiver,msgid);
kdDebug(11001) << "************* Got process message sender =" << sender
diff --git a/libkdegames/kgame/kgameio.h b/libkdegames/kgame/kgameio.h
index 82b84740..2f4b89ab 100644
--- a/libkdegames/kgame/kgameio.h
+++ b/libkdegames/kgame/kgameio.h
@@ -52,9 +52,10 @@ class KProcess;
*
* @author Martin Heni <martin@heni-online.de>
*/
-class KDE_EXPORT KGameIO : public QObject
+class KDE_EXPORT KGameIO : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -128,7 +129,7 @@ public:
/**
* Send an input message using @ref KPlayer::forwardInput
**/
- bool sendInput(TQDataStream& stream, bool transmit = true, Q_UINT32 sender = 0);
+ bool sendInput(TQDataStream& stream, bool transmit = true, TQ_UINT32 sender = 0);
signals:
/**
@@ -177,6 +178,7 @@ private:
class KDE_EXPORT KGameKeyIO : public KGameIO
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -185,7 +187,7 @@ public:
* handler signalKeyEvent and can be used to generate
* a valid move for the player.
* Note the widget you pass to the constructor must be
- * the main window of your application, e.g. view->parentWidget()
+ * the main window of your application, e.g. view->tqparentWidget()
* as QT does not forward your keyevents otherwise. This means
* that this might be a different widget comapred to the one you
* use for mouse inputs!
@@ -197,9 +199,9 @@ public:
* this,TQT_SLOT(slotKeyInput(KGameIO *,TQDataStream &,TQKeyEvent *,bool *)));
* \endcode
*
- * @param parent The parents widget whose keyboard events * should be grabbed
+ * @param tqparent The tqparents widget whose keyboard events * should be grabbed
*/
- KGameKeyIO(TQWidget *parent);
+ KGameKeyIO(TQWidget *tqparent);
virtual ~KGameKeyIO();
/**
@@ -221,7 +223,7 @@ signals:
* Example:
* \code
* KPlayer *player=input->player(); // Get the player
- * Q_INT32 key=e->key();
+ * TQ_INT32 key=e->key();
* stream << key;
* eatevent=true;
* \endcode
@@ -248,6 +250,7 @@ protected:
class KDE_EXPORT KGameMouseIO : public KGameIO
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -262,10 +265,10 @@ public:
* this,TQT_SLOT(slotMouseInput(KGameIO *,TQDataStream &,TQMouseEvent *,bool *)));
* \endcode
*
- * @param parent The widget whose events should be captured
+ * @param tqparent The widget whose events should be captured
* @param trackmouse enables mouse tracking (gives mouse move events)
*/
- KGameMouseIO(TQWidget *parent,bool trackmouse=false);
+ KGameMouseIO(TQWidget *tqparent,bool trackmouse=false);
virtual ~KGameMouseIO();
/**
@@ -291,7 +294,7 @@ signals:
* Example:
* \code
* KPlayer *player=input->player(); // Get the player
- * Q_INT32 button=e->button();
+ * TQ_INT32 button=e->button();
* stream << button;
* eatevent=true;
* \endcode
@@ -323,6 +326,7 @@ protected:
class KDE_EXPORT KGameProcessIO : public KGameIO
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -364,7 +368,7 @@ public:
* @param receiver - not used
* @param sender - who send the message
*/
- void sendMessage(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender);
+ void sendMessage(TQDataStream &stream,int msgid, TQ_UINT32 receiver, TQ_UINT32 sender);
/**
* Send a system message to the process. This is analogous to the sendMessage
@@ -376,7 +380,7 @@ public:
* @param receiver - not used
* @param sender - who send the message
*/
- void sendSystemMessage(TQDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender);
+ void sendSystemMessage(TQDataStream &stream, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender);
/**
* Init this device by setting the player and e.g. sending an
@@ -403,7 +407,7 @@ public:
/**
* Internal ~ombined function for all message handling
**/
- void sendAllMessages(TQDataStream &stream,int msgid, Q_UINT32 receiver, Q_UINT32 sender, bool usermsg);
+ void sendAllMessages(TQDataStream &stream,int msgid, TQ_UINT32 receiver, TQ_UINT32 sender, bool usermsg);
protected slots:
/**
@@ -477,6 +481,7 @@ private:
class KDE_EXPORT KGameComputerIO : public KGameIO
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
diff --git a/libkdegames/kgame/kgamemessage.cpp b/libkdegames/kgame/kgamemessage.cpp
index 228708e9..9f5e4694 100644
--- a/libkdegames/kgame/kgamemessage.cpp
+++ b/libkdegames/kgame/kgamemessage.cpp
@@ -27,7 +27,7 @@
#define MESSAGE_VERSION 2
-Q_UINT32 KGameMessage::createPlayerId(int oldplayerid,Q_UINT32 gameid)
+TQ_UINT32 KGameMessage::createPlayerId(int oldplayerid,TQ_UINT32 gameid)
{
int p;
p = oldplayerid & 0x3ff; // remove game id
@@ -35,17 +35,17 @@ Q_UINT32 KGameMessage::createPlayerId(int oldplayerid,Q_UINT32 gameid)
return p;
}
-int KGameMessage::rawPlayerId(Q_UINT32 playerid)
+int KGameMessage::rawPlayerId(TQ_UINT32 playerid)
{
return playerid & 0x03ff;
}
-Q_UINT32 KGameMessage::rawGameId(Q_UINT32 playerid)
+TQ_UINT32 KGameMessage::rawGameId(TQ_UINT32 playerid)
{
return (playerid & 0xfc00) >> 10;
}
-bool KGameMessage::isPlayer(Q_UINT32 msgid)
+bool KGameMessage::isPlayer(TQ_UINT32 msgid)
{
if (msgid & 0xfc00) {
return true;
@@ -54,32 +54,32 @@ bool KGameMessage::isPlayer(Q_UINT32 msgid)
}
}
-bool KGameMessage::isGame(Q_UINT32 msgid)
+bool KGameMessage::isGame(TQ_UINT32 msgid)
{
return !isPlayer(msgid);
}
-void KGameMessage::createHeader(TQDataStream &msg,Q_UINT32 sender,Q_UINT32 receiver,int msgid)
+void KGameMessage::createHeader(TQDataStream &msg,TQ_UINT32 sender,TQ_UINT32 receiver,int msgid)
{
- msg << (Q_INT16)sender << (Q_INT16)receiver << (Q_INT16)msgid;
+ msg << (TQ_INT16)sender << (TQ_INT16)receiver << (TQ_INT16)msgid;
}
-void KGameMessage::extractHeader(TQDataStream &msg,Q_UINT32 &sender,Q_UINT32 &receiver,int &msgid)
+void KGameMessage::extractHeader(TQDataStream &msg,TQ_UINT32 &sender,TQ_UINT32 &receiver,int &msgid)
{
- Q_INT16 d3,d4,d5;
+ TQ_INT16 d3,d4,d5;
msg >> d3 >> d4 >> d5;
sender=d3;receiver=d4;msgid=d5;
}
void KGameMessage::createPropertyHeader(TQDataStream &msg,int id)
{
- msg << (Q_INT16)id;
+ msg << (TQ_INT16)id;
}
void KGameMessage::extractPropertyHeader(TQDataStream &msg,int &id)
{
- Q_INT16 d1;
+ TQ_INT16 d1;
msg >> d1;
id=d1;
}
@@ -87,14 +87,14 @@ void KGameMessage::extractPropertyHeader(TQDataStream &msg,int &id)
void KGameMessage::createPropertyCommand(TQDataStream &msg,int cmdid,int pid,int cmd)
{
createPropertyHeader(msg,cmdid);
- msg << (Q_INT16)pid ;
- msg << (Q_INT8)cmd ;
+ msg << (TQ_INT16)pid ;
+ msg << (TQ_INT8)cmd ;
}
void KGameMessage::extractPropertyCommand(TQDataStream &msg,int &pid,int &cmd)
{
- Q_INT16 d1;
- Q_INT8 d2;
+ TQ_INT16 d1;
+ TQ_INT8 d2;
msg >> d1 >> d2;
pid=d1;
cmd=d2;
@@ -151,6 +151,6 @@ TQString KGameMessage::messageId2Text(int msgid)
return i18n("Player ID");
case KGameMessage::IdUser: // IdUser must be unknown for use, too!
default:
- return TQString::null;
+ return TQString();
}
}
diff --git a/libkdegames/kgame/kgamemessage.h b/libkdegames/kgame/kgamemessage.h
index d671a948..f4029895 100644
--- a/libkdegames/kgame/kgamemessage.h
+++ b/libkdegames/kgame/kgamemessage.h
@@ -41,7 +41,7 @@ class KDE_EXPORT KGameMessage
* @param gameid The game id (<64). 0 For broadcast.
* @return the new player id
*/
- static Q_UINT32 createPlayerId(int player, Q_UINT32 game);
+ static TQ_UINT32 createPlayerId(int player, TQ_UINT32 game);
/**
* Returns the raw playerid, that is, a id which does not
@@ -51,7 +51,7 @@ class KDE_EXPORT KGameMessage
* @param the player id
* @return the raw player id
**/
- static int rawPlayerId(Q_UINT32 playerid);
+ static int rawPlayerId(TQ_UINT32 playerid);
/**
* Returns the raw game id, that is, the game id the player
@@ -60,7 +60,7 @@ class KDE_EXPORT KGameMessage
* @param the player id
* @return the raw game id
**/
- static Q_UINT32 rawGameId(Q_UINT32 playerid);
+ static TQ_UINT32 rawGameId(TQ_UINT32 playerid);
/**
* Checks whether a message receiver/sender is a player
@@ -68,7 +68,7 @@ class KDE_EXPORT KGameMessage
* @param id The ID of the sender/receiver
* @return true/false
*/
- static bool isPlayer(Q_UINT32 id);
+ static bool isPlayer(TQ_UINT32 id);
/**
* Checks whether the sender/receiver of a message is a game
@@ -76,7 +76,7 @@ class KDE_EXPORT KGameMessage
* @param id The ID of the sender/receiver
* @return true/false
*/
- static bool isGame(Q_UINT32 id);
+ static bool isGame(TQ_UINT32 id);
/**
* Creates a message header given cookie,sender,receiver,...
@@ -85,14 +85,14 @@ class KDE_EXPORT KGameMessage
* (message length and magic cookie). If you don't need them remove them
* with @ref dropExternalHeader
*/
- static void createHeader(TQDataStream &msg, Q_UINT32 sender, Q_UINT32 receiver, int msgid);
+ static void createHeader(TQDataStream &msg, TQ_UINT32 sender, TQ_UINT32 receiver, int msgid);
/**
* Retrieves the information like cookie,sender,receiver,... from a message header
*
* Note that it could be necessary to call @ref dropExternalHeader first
*/
- static void extractHeader(TQDataStream &msg,Q_UINT32 &sender, Q_UINT32 &receiver, int &msgid);
+ static void extractHeader(TQDataStream &msg,TQ_UINT32 &sender, TQ_UINT32 &receiver, int &msgid);
/**
* Creates a property header given the property id
@@ -124,7 +124,7 @@ class KDE_EXPORT KGameMessage
* suitable string for it. This string can't be used to identify a message
* (as it is i18n'ed) but it can make debugging more easy. See also @ref
* KGameDebugDialog.
- * @return Either a i18n'ed string (the name of the id) or TQString::null if
+ * @return Either a i18n'ed string (the name of the id) or TQString() if
* the msgid is unknown
**/
static TQString messageId2Text(int msgid);
diff --git a/libkdegames/kgame/kgamenetwork.cpp b/libkdegames/kgame/kgamenetwork.cpp
index 92669834..2fe901b3 100644
--- a/libkdegames/kgame/kgamenetwork.cpp
+++ b/libkdegames/kgame/kgamenetwork.cpp
@@ -50,7 +50,7 @@ public:
public:
KMessageClient* mMessageClient;
KMessageServer* mMessageServer;
- Q_UINT32 mDisconnectId; // Stores gameId() over a disconnect process
+ TQ_UINT32 mDisconnectId; // Stores gameId() over a disconnect process
DNSSD::PublicService* mService;
TQString mType;
TQString mName;
@@ -59,10 +59,10 @@ public:
};
// ------------------- NETWORK GAME ------------------------
-KGameNetwork::KGameNetwork(int c, TQObject* parent) : TQObject(parent, 0)
+KGameNetwork::KGameNetwork(int c, TQObject* tqparent) : TQObject(tqparent, 0)
{
d = new KGameNetworkPrivate;
- d->mCookie = (Q_INT16)c;
+ d->mCookie = (TQ_INT16)c;
// Init the game as a local game, i.e.
// create your own KMessageServer and a KMessageClient connected to it.
@@ -83,7 +83,7 @@ KGameNetwork::~KGameNetwork()
bool KGameNetwork::isNetwork() const
{ return isOfferingConnections() || d->mMessageClient->isNetwork();}
-Q_UINT32 KGameNetwork::gameId() const
+TQ_UINT32 KGameNetwork::gameId() const
{
//return d->mMessageClient->id() ;
// Return stored id in the case of disconnect. In any other
@@ -120,25 +120,25 @@ void KGameNetwork::setMaster()
}
if (!d->mMessageClient) {
d->mMessageClient = new KMessageClient (this);
- connect (d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)),
- this, TQT_SLOT(receiveNetworkTransmission(const TQByteArray&, Q_UINT32)));
+ connect (d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, TQ_UINT32)),
+ this, TQT_SLOT(receiveNetworkTransmission(const TQByteArray&, TQ_UINT32)));
connect (d->mMessageClient, TQT_SIGNAL(connectionBroken()),
this, TQT_SIGNAL(signalConnectionBroken()));
- connect (d->mMessageClient, TQT_SIGNAL(aboutToDisconnect(Q_UINT32)),
- this, TQT_SLOT(aboutToLoseConnection(Q_UINT32)));
+ connect (d->mMessageClient, TQT_SIGNAL(aboutToDisconnect(TQ_UINT32)),
+ this, TQT_SLOT(aboutToLoseConnection(TQ_UINT32)));
connect (d->mMessageClient, TQT_SIGNAL(connectionBroken()),
this, TQT_SLOT(slotResetConnection()));
connect (d->mMessageClient, TQT_SIGNAL(adminStatusChanged(bool)),
this, TQT_SLOT(slotAdminStatusChanged(bool)));
- connect (d->mMessageClient, TQT_SIGNAL(eventClientConnected(Q_UINT32)),
- this, TQT_SIGNAL(signalClientConnected(Q_UINT32)));
- connect (d->mMessageClient, TQT_SIGNAL(eventClientDisconnected(Q_UINT32, bool)),
- this, TQT_SIGNAL(signalClientDisconnected(Q_UINT32, bool)));
+ connect (d->mMessageClient, TQT_SIGNAL(eventClientConnected(TQ_UINT32)),
+ this, TQT_SIGNAL(signalClientConnected(TQ_UINT32)));
+ connect (d->mMessageClient, TQT_SIGNAL(eventClientDisconnected(TQ_UINT32, bool)),
+ this, TQT_SIGNAL(signalClientDisconnected(TQ_UINT32, bool)));
// broacast and direct messages are treated equally on receive.
- connect (d->mMessageClient, TQT_SIGNAL(forwardReceived(const TQByteArray&, Q_UINT32, const TQValueList<Q_UINT32>&)),
- d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)));
+ connect (d->mMessageClient, TQT_SIGNAL(forwardReceived(const TQByteArray&, TQ_UINT32, const TQValueList<TQ_UINT32>&)),
+ d->mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, TQ_UINT32)));
} else {
// should be no problem but still has to be tested
@@ -171,7 +171,7 @@ void KGameNetwork::tryStopPublishing()
if (d->mService) d->mService->stop();
}
-bool KGameNetwork::offerConnections(Q_UINT16 port)
+bool KGameNetwork::offerConnections(TQ_UINT16 port)
{
kdDebug (11001) << k_funcinfo << "on port " << port << endl;
if (!isMaster()) {
@@ -201,7 +201,7 @@ bool KGameNetwork::offerConnections(Q_UINT16 port)
return true;
}
-bool KGameNetwork::connectToServer (const TQString& host, Q_UINT16 port)
+bool KGameNetwork::connectToServer (const TQString& host, TQ_UINT16 port)
{
if (host.isEmpty()) {
kdError(11001) << k_funcinfo << "No hostname given" << endl;
@@ -239,7 +239,7 @@ bool KGameNetwork::connectToServer (const TQString& host, Q_UINT16 port)
return true;
}
-Q_UINT16 KGameNetwork::port() const
+TQ_UINT16 KGameNetwork::port() const
{
if (isNetwork()) {
if (isOfferingConnections()) {
@@ -276,8 +276,8 @@ void KGameNetwork::disconnect()
kdDebug(11001) << k_funcinfo << endl;
stopServerConnection();
if (d->mMessageServer) {
- TQValueList <Q_UINT32> list=d->mMessageServer->clientIDs();
- TQValueList<Q_UINT32>::Iterator it;
+ TQValueList <TQ_UINT32> list=d->mMessageServer->clientIDs();
+ TQValueList<TQ_UINT32>::Iterator it;
for( it = list.begin(); it != list.end(); ++it )
{
kdDebug(11001) << "Client id=" << (*it) << endl;
@@ -320,7 +320,7 @@ void KGameNetwork::disconnect()
kdDebug(11001) << k_funcinfo << "DONE" << endl;
}
-void KGameNetwork::aboutToLoseConnection(Q_UINT32 clientID)
+void KGameNetwork::aboutToLoseConnection(TQ_UINT32 clientID)
{
kdDebug(11001) << "Storing client id of connection "<<clientID<<endl;
d->mDisconnectId = clientID;
@@ -332,7 +332,7 @@ void KGameNetwork::slotResetConnection()
d->mDisconnectId = 0;
}
-void KGameNetwork::electAdmin(Q_UINT32 clientID)
+void KGameNetwork::electAdmin(TQ_UINT32 clientID)
{
if (!isAdmin()) {
kdWarning(11001) << k_funcinfo << "only ADMIN is allowed to call this!" << endl;
@@ -340,7 +340,7 @@ void KGameNetwork::electAdmin(Q_UINT32 clientID)
}
TQByteArray buffer;
TQDataStream stream(buffer,IO_WriteOnly);
- stream << static_cast<Q_UINT32>( KMessageServer::REQ_ADMIN_CHANGE );
+ stream << static_cast<TQ_UINT32>( KMessageServer::RETQ_ADMIN_CHANGE );
stream << clientID;
d->mMessageClient->sendServerMessage(buffer);
}
@@ -353,8 +353,8 @@ void KGameNetwork::setMaxClients(int max)
}
TQByteArray buffer;
TQDataStream stream(buffer,IO_WriteOnly);
- stream << static_cast<Q_UINT32>( KMessageServer::REQ_MAX_NUM_CLIENTS );
- stream << (Q_INT32)max;
+ stream << static_cast<TQ_UINT32>( KMessageServer::RETQ_MAX_NUM_CLIENTS );
+ stream << (TQ_INT32)max;
d->mMessageClient->sendServerMessage(buffer);
}
@@ -374,7 +374,7 @@ void KGameNetwork::unlock()
// --------------------- send messages ---------------------------
-bool KGameNetwork::sendSystemMessage(int data, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+bool KGameNetwork::sendSystemMessage(int data, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
{
TQByteArray buffer;
TQDataStream stream(buffer,IO_WriteOnly);
@@ -382,7 +382,7 @@ bool KGameNetwork::sendSystemMessage(int data, int msgid, Q_UINT32 receiver, Q_U
return sendSystemMessage(buffer,msgid,receiver,sender);
}
-bool KGameNetwork::sendSystemMessage(const TQString &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+bool KGameNetwork::sendSystemMessage(const TQString &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
{
TQByteArray buffer;
TQDataStream stream(buffer, IO_WriteOnly);
@@ -390,10 +390,10 @@ bool KGameNetwork::sendSystemMessage(const TQString &msg, int msgid, Q_UINT32 re
return sendSystemMessage(buffer, msgid, receiver, sender);
}
-bool KGameNetwork::sendSystemMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+bool KGameNetwork::sendSystemMessage(const TQDataStream &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
{ return sendSystemMessage(((TQBuffer*)msg.device())->buffer(), msgid, receiver, sender); }
-bool KGameNetwork::sendSystemMessage(const TQByteArray& data, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+bool KGameNetwork::sendSystemMessage(const TQByteArray& data, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
{
TQByteArray buffer;
TQDataStream stream(buffer,IO_WriteOnly);
@@ -401,7 +401,7 @@ bool KGameNetwork::sendSystemMessage(const TQByteArray& data, int msgid, Q_UINT3
sender = gameId();
}
- Q_UINT32 receiverClient = KGameMessage::rawGameId(receiver); // KGame::gameId()
+ TQ_UINT32 receiverClient = KGameMessage::rawGameId(receiver); // KGame::gameId()
int receiverPlayer = KGameMessage::rawPlayerId(receiver); // KPlayer::id()
KGameMessage::createHeader(stream, sender, receiver, msgid);
@@ -435,35 +435,35 @@ bool KGameNetwork::sendSystemMessage(const TQByteArray& data, int msgid, Q_UINT3
return true;
}
-bool KGameNetwork::sendMessage(int data, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+bool KGameNetwork::sendMessage(int data, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
{ return sendSystemMessage(data,msgid+KGameMessage::IdUser,receiver,sender); }
-bool KGameNetwork::sendMessage(const TQString &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+bool KGameNetwork::sendMessage(const TQString &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
{ return sendSystemMessage(msg,msgid+KGameMessage::IdUser,receiver,sender); }
-bool KGameNetwork::sendMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+bool KGameNetwork::sendMessage(const TQDataStream &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
{ return sendSystemMessage(msg, msgid+KGameMessage::IdUser, receiver, sender); }
-bool KGameNetwork::sendMessage(const TQByteArray &msg, int msgid, Q_UINT32 receiver, Q_UINT32 sender)
+bool KGameNetwork::sendMessage(const TQByteArray &msg, int msgid, TQ_UINT32 receiver, TQ_UINT32 sender)
{ return sendSystemMessage(msg, msgid+KGameMessage::IdUser, receiver, sender); }
-void KGameNetwork::sendError(int error,const TQByteArray& message, Q_UINT32 receiver, Q_UINT32 sender)
+void KGameNetwork::sendError(int error,const TQByteArray& message, TQ_UINT32 receiver, TQ_UINT32 sender)
{
TQByteArray buffer;
TQDataStream stream(buffer,IO_WriteOnly);
- stream << (Q_INT32) error;
+ stream << (TQ_INT32) error;
stream.writeRawBytes(message.data(), message.size());
sendSystemMessage(stream,KGameMessage::IdError,receiver,sender);
}
// ----------------- receive messages from the network
-void KGameNetwork::receiveNetworkTransmission(const TQByteArray& receiveBuffer, Q_UINT32 clientID)
+void KGameNetwork::receiveNetworkTransmission(const TQByteArray& receiveBuffer, TQ_UINT32 clientID)
{
TQDataStream stream(receiveBuffer, IO_ReadOnly);
int msgid;
- Q_UINT32 sender; // the id of the KGame/KPlayer who sent the message
- Q_UINT32 receiver; // the id of the KGame/KPlayer the message is for
+ TQ_UINT32 sender; // the id of the KGame/KPlayer who sent the message
+ TQ_UINT32 receiver; // the id of the KGame/KPlayer the message is for
KGameMessage::extractHeader(stream, sender, receiver, msgid);
// kdDebug(11001) << k_funcinfo << "id=" << msgid << " sender=" << sender << " recv=" << receiver << endl;
@@ -481,7 +481,7 @@ void KGameNetwork::receiveNetworkTransmission(const TQByteArray& receiveBuffer,
else if (msgid==KGameMessage::IdError)
{
TQString text;
- Q_INT32 error;
+ TQ_INT32 error;
stream >> error;
kdDebug(11001) << k_funcinfo << "Got IdError " << error << endl;
text = KGameError::errorText(error, stream);
diff --git a/libkdegames/kgame/kgamenetwork.h b/libkdegames/kgame/kgamenetwork.h
index 47276d06..1766ac90 100644
--- a/libkdegames/kgame/kgamenetwork.h
+++ b/libkdegames/kgame/kgamenetwork.h
@@ -43,15 +43,16 @@ class KGameNetworkPrivate;
* @author Martin Heni <martin@heni-online.de>
* @version $Id$
*/
-class KDE_EXPORT KGameNetwork : public QObject
+class KDE_EXPORT KGameNetwork : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Create a KGameNetwork object
*/
- KGameNetwork(int cookie=42,TQObject* parent=0);
+ KGameNetwork(int cookie=42,TQObject* tqparent=0);
virtual ~KGameNetwork();
/**
@@ -96,7 +97,7 @@ public:
*
* @return int id
**/
- Q_UINT32 gameId() const;
+ TQ_UINT32 gameId() const;
/**
* Inits a network game as network MASTER. Note that if the
@@ -108,7 +109,7 @@ public:
* @param port The port on which the service is offered
* @return true if it worked
**/
- bool offerConnections (Q_UINT16 port);
+ bool offerConnections (TQ_UINT16 port);
/**
* Announces game MASTER on network using DNS-SD. Clients then can discover it using
@@ -120,7 +121,7 @@ public:
* set hostname will be used. In case of name conflict -2, -3 and so on will be added to name.
* @since 3.4
**/
- void setDiscoveryInfo(const TQString& type, const TQString& name=TQString::null);
+ void setDiscoveryInfo(const TQString& type, const TQString& name=TQString());
/**
* Inits a network game as a network CLIENT
@@ -130,7 +131,7 @@ public:
*
* @return true if connected
**/
- bool connectToServer(const TQString& host, Q_UINT16 port);
+ bool connectToServer(const TQString& host, TQ_UINT16 port);
/**
* @since 3.2
@@ -138,7 +139,7 @@ public:
* or the port we are connected to if connectToServer was called.
* Otherwise 0.
**/
- Q_UINT16 port() const;
+ TQ_UINT16 port() const;
/**
* @since 3.2
@@ -189,22 +190,22 @@ public:
* @return true if worked
*/
// AB: TODO: doc on how "receiver" and "sender" should be created!
- bool sendSystemMessage(const TQByteArray& buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendSystemMessage(const TQByteArray& buffer, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
/**
* @overload
**/
- bool sendSystemMessage(int data, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendSystemMessage(int data, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
/**
* @overload
**/
- bool sendSystemMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendSystemMessage(const TQDataStream &msg, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
/**
* @overload
**/
- bool sendSystemMessage(const TQString& msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendSystemMessage(const TQString& msg, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
/**
* Sends a network message
@@ -217,7 +218,7 @@ public:
* the correct value for you. You might want to use this if you send a
* message from a specific player.
**/
- void sendError(int error, const TQByteArray& message, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ void sendError(int error, const TQByteArray& message, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
/**
* Are we still offer offering server connections - only for game MASTER
@@ -265,29 +266,29 @@ public:
* @return true if worked
**/
// AB: TODO: doc on how "receiver" and "sender" should be created!
- bool sendMessage(const TQByteArray& buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendMessage(const TQByteArray& buffer, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
/**
* This is an overloaded member function, provided for convenience.
**/
- bool sendMessage(const TQDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendMessage(const TQDataStream &msg, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
/**
* This is an overloaded member function, provided for convenience.
**/
- bool sendMessage(const TQString& msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendMessage(const TQString& msg, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
/**
* This is an overloaded member function, provided for convenience.
**/
- bool sendMessage(int data, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0);
+ bool sendMessage(int data, int msgid, TQ_UINT32 receiver=0, TQ_UINT32 sender=0);
/**
* Called by ReceiveNetworkTransmission(). Will be overwritten by
* KGame and handle the incoming message.
**/
- virtual void networkTransmission(TQDataStream&, int, Q_UINT32, Q_UINT32, Q_UINT32 clientID) = 0;
+ virtual void networkTransmission(TQDataStream&, int, TQ_UINT32, TQ_UINT32, TQ_UINT32 clientID) = 0;
/**
@@ -304,7 +305,7 @@ public:
* @param clientID the ID of the new ADMIN (note: this is the _client_ID
* which has nothing to do with the player IDs. See KMessageServer)
**/
- void electAdmin(Q_UINT32 clientID);
+ void electAdmin(TQ_UINT32 clientID);
/**
* Don't use this unless you really know what youre doing! You might
@@ -321,13 +322,13 @@ public:
* experience some strange behaviour if you use the message server directly!
*
* @return a pointer to the message server if this is the MASTER KGame
- * object. Note that it might be possible that no KGame object contains
+ * object. Note that it might be possible that no KGame object tqcontains
* the KMessageServer at all! It might even run stand alone!
**/
KMessageServer* messageServer() const;
/**
- * You should call this before doing thigs like, e.g. qApp->processEvents().
+ * You should call this before doing thigs like, e.g. tqApp->processEvents().
* Don't forget to call unlock once you are done!
*
* @see KMessageClient::lock
@@ -362,7 +363,7 @@ signals:
*
* @param clientID the ID of the newly connected client
**/
- void signalClientConnected(Q_UINT32 clientID);
+ void signalClientConnected(TQ_UINT32 clientID);
/**
* This signal is emitted whenever the KMessageServer sends us a message
@@ -375,7 +376,7 @@ signals:
* @param broken true if the connection was lost because of a network error, false
* if the connection was closed by the message server admin.
*/
- void signalClientDisconnected(Q_UINT32 clientID, bool broken);
+ void signalClientDisconnected(TQ_UINT32 clientID, bool broken);
/**
* This client gets or loses the admin status.
@@ -401,7 +402,7 @@ protected slots:
* If it is valid, the pure virtual method networkTransmission() is called.
* (This one is overwritten in KGame.)
**/
- void receiveNetworkTransmission(const TQByteArray& a, Q_UINT32 clientID);
+ void receiveNetworkTransmission(const TQByteArray& a, TQ_UINT32 clientID);
/**
* This KGame object receives or loses the admin status.
@@ -413,7 +414,7 @@ protected slots:
* Called when the network connection is about to terminate. Is used
* to store the network parameter like the game id
*/
- void aboutToLoseConnection(Q_UINT32 id);
+ void aboutToLoseConnection(TQ_UINT32 id);
/**
* Called when the network connection is terminated. Used to clean
diff --git a/libkdegames/kgame/kgameprocess.cpp b/libkdegames/kgame/kgameprocess.cpp
index ffbf0936..9dcc66c0 100644
--- a/libkdegames/kgame/kgameprocess.cpp
+++ b/libkdegames/kgame/kgameprocess.cpp
@@ -52,8 +52,8 @@ KGameProcess::KGameProcess() : TQObject(0,0)
mMessageIO=new KMessageFilePipe(this,&rFile,&wFile);
// mMessageClient=new KMessageClient(this);
// mMessageClient->setServer(mMessageIO);
-// connect (mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, Q_UINT32)),
-// this, TQT_SLOT(receivedMessage(const TQByteArray&, Q_UINT32)));
+// connect (mMessageClient, TQT_SIGNAL(broadcastReceived(const TQByteArray&, TQ_UINT32)),
+// this, TQT_SLOT(receivedMessage(const TQByteArray&, TQ_UINT32)));
connect (mMessageIO, TQT_SIGNAL(received(const TQByteArray&)),
this, TQT_SLOT(receivedMessage(const TQByteArray&)));
fprintf(stderr,"KGameProcess::constructor %p %p\n",&rFile,&wFile);
@@ -88,7 +88,7 @@ bool KGameProcess::exec(int argc, char *argv[])
// TQByteArray buffer;
// TQDataStream wstream(buffer,IO_WriteOnly);
// then stream data into the stream and call this function
-void KGameProcess::sendSystemMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver)
+void KGameProcess::sendSystemMessage(TQDataStream &stream,int msgid,TQ_UINT32 receiver)
{
fprintf(stderr,"KGameProcess::sendMessage id=%d recv=%d",msgid,receiver);
TQByteArray a;
@@ -107,7 +107,7 @@ void KGameProcess::sendSystemMessage(TQDataStream &stream,int msgid,Q_UINT32 rec
if (mMessageIO) mMessageIO->send(a);
}
-void KGameProcess::sendMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver)
+void KGameProcess::sendMessage(TQDataStream &stream,int msgid,TQ_UINT32 receiver)
{
sendSystemMessage(stream,msgid+KGameMessage::IdUser,receiver);
}
@@ -133,19 +133,19 @@ void KGameProcess::receivedMessage(const TQByteArray& receiveBuffer)
{
TQDataStream stream(receiveBuffer, IO_ReadOnly);
int msgid;
- Q_UINT32 sender;
- Q_UINT32 receiver;
+ TQ_UINT32 sender;
+ TQ_UINT32 receiver;
KGameMessage::extractHeader(stream, sender, receiver, msgid);
fprintf(stderr,"------ receiveNetworkTransmission(): id=%d sender=%d,recv=%d\n",msgid,sender,receiver);
switch(msgid)
{
case KGameMessage::IdTurn:
- Q_INT8 b;
+ TQ_INT8 b;
stream >> b;
emit signalTurn(stream,(bool)b);
break;
case KGameMessage::IdIOAdded:
- Q_INT16 id;
+ TQ_INT16 id;
stream >> id;
emit signalInit(stream,(int)id);
break;
diff --git a/libkdegames/kgame/kgameprocess.h b/libkdegames/kgame/kgameprocess.h
index ac6389be..b7e2d145 100644
--- a/libkdegames/kgame/kgameprocess.h
+++ b/libkdegames/kgame/kgameprocess.h
@@ -37,11 +37,12 @@ class KMessageFilePipe;
* This is the process class used on the computer player
* side to communicate with its counterpart KProcessIO class.
* Using these two classes will give fully transparent communication
- * via QDataStreams.
+ * via TQDataStreams.
*/
-class KDE_EXPORT KGameProcess: public QObject
+class KDE_EXPORT KGameProcess: public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -107,7 +108,7 @@ class KDE_EXPORT KGameProcess: public QObject
* @param msgid the message id for the message
* @param receiver unused
*/
- void sendMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver=0);
+ void sendMessage(TQDataStream &stream,int msgid,TQ_UINT32 receiver=0);
/**
* Sends a system message to the corresonding KGameIO device.
@@ -128,7 +129,7 @@ class KDE_EXPORT KGameProcess: public QObject
* @param msgid the message id for the message
* @param receiver unused
*/
- void sendSystemMessage(TQDataStream &stream,int msgid,Q_UINT32 receiver=0);
+ void sendSystemMessage(TQDataStream &stream,int msgid,TQ_UINT32 receiver=0);
/**
* Returns a pointer to a KRandomSequence. You can generate
@@ -164,7 +165,7 @@ class KDE_EXPORT KGameProcess: public QObject
* \code
* void Computer::slotCommand(int &msgid,TQDataStream &in,TQDataStream &out)
* {
- * Q_INT32 data,move;
+ * TQ_INT32 data,move;
* in >> data;
* // compute move ...
* move=data*2;
@@ -200,7 +201,7 @@ class KDE_EXPORT KGameProcess: public QObject
* {
* // Create a move - the format is yours to decide
* // It arrives exactly as this in the kgame inputMove function!!
- * Q_INT8 x1,y1,pl;
+ * TQ_INT8 x1,y1,pl;
* pl=-1;
* x1=proc.random()->getLong(8);
* y1=proc.random()->getLong(8);
diff --git a/libkdegames/kgame/kgameproperty.cpp b/libkdegames/kgame/kgameproperty.cpp
index 3b8c3109..e7d35410 100644
--- a/libkdegames/kgame/kgameproperty.cpp
+++ b/libkdegames/kgame/kgameproperty.cpp
@@ -29,16 +29,16 @@
#define KPLAYERHANDLER_LOAD_COOKIE 6239
-KGamePropertyBase::KGamePropertyBase(int id, KGame* parent)
+KGamePropertyBase::KGamePropertyBase(int id, KGame* tqparent)
{
init();
- registerData(id, parent);
+ registerData(id, tqparent);
}
-KGamePropertyBase::KGamePropertyBase(int id, KPlayer* parent)
+KGamePropertyBase::KGamePropertyBase(int id, KPlayer* tqparent)
{
init();
- registerData(id, parent);
+ registerData(id, tqparent);
}
KGamePropertyBase::KGamePropertyBase(int id, KGamePropertyHandler* owner)
@@ -173,7 +173,7 @@ void KGamePropertyBase::setLock(bool l)
TQDataStream s(b, IO_WriteOnly);
KGameMessage::createPropertyCommand(s, IdCommand, id(), CmdLock);
- s << (Q_INT8)l;
+ s << (TQ_INT8)l;
if (mOwner) {
mOwner->sendProperty(s);
} else {
@@ -198,7 +198,7 @@ void KGamePropertyBase::command(TQDataStream& s, int cmd, bool isSender)
case CmdLock:
{
if (!isSender) {
- Q_INT8 locked;
+ TQ_INT8 locked;
s >> locked;
mFlags.bits.locked = (bool)locked ;
break;
diff --git a/libkdegames/kgame/kgameproperty.h b/libkdegames/kgame/kgameproperty.h
index 04474603..03fcae87 100644
--- a/libkdegames/kgame/kgameproperty.h
+++ b/libkdegames/kgame/kgameproperty.h
@@ -51,7 +51,7 @@ public:
IdName=5,
//KGame
- IdGameStatus=6,
+ IdGametqStatus=6,
IdMaxPlayer=7,
IdMinPlayer=8,
@@ -66,7 +66,7 @@ public:
};
/**
- * Commands for advanced properties (Q_INT8)
+ * Commands for advanced properties (TQ_INT8)
**/
enum PropertyCommandIds
{
@@ -117,7 +117,7 @@ public:
/**
* Constructs a KGamePropertyBase object and calls registerData.
- * @param id The id of this property. MUST be UNIQUE! Used to send and
+ * @param id The id of this property. MUST be UNITQUE! Used to send and
* receive changes in the property of the playere automatically via
* network.
* @param owner The owner of the object. Must be a KGamePropertyHandler which manages
@@ -125,8 +125,8 @@ public:
**/
KGamePropertyBase(int id, KGamePropertyHandler* owner);
- KGamePropertyBase(int id, KGame* parent);
- KGamePropertyBase(int id, KPlayer* parent);
+ KGamePropertyBase(int id, KGame* tqparent);
+ KGamePropertyBase(int id, KPlayer* tqparent);
/**
* Creates a KGamePropertyBase object without an owner. Remember to call
@@ -238,7 +238,7 @@ public:
int id() const { return mId; }
/**
- * @return a type_info of the data this property contains. This is used
+ * @return a type_info of the data this property tqcontains. This is used
* e.g. by KGameDebugDialog
**/
virtual const type_info* typeinfo() { return &typeid(this); }
@@ -344,7 +344,7 @@ protected:
bool sendProperty(const TQByteArray& b);
/**
- * Causes the parent object to emit a signal on value change
+ * Causes the tqparent object to emit a signal on value change
**/
void emitSignal();
@@ -359,7 +359,7 @@ protected:
struct {
// unsigned char dosave : 1; // do save this property
// unsigned char delaytransmit : 1; // do not send immediately on
- // change but a KPlayer:QTimer
+ // change but a KPlayer:TQTimer
// sends it later on - fast
// changing variables
unsigned char emitsignal : 1; // KPlayer notifies on variable change (true)
@@ -403,7 +403,7 @@ private:
* <li> A Mixture (very dirty)
* </ul>
* I repeat: we do <em>not</em> recommend the third option ("a mixture"). Unless
- * you have a good reason for this you will probably introduce some hard to find
+ * you have a good reason for this you will probably introduce some hard to tqfind
* (and to fix) bugs.
*
* @section Always consistent (clean):
@@ -413,7 +413,7 @@ private:
* property. This is achieved by using send to change the value of the
* property. send needs a running KMessageServer and therefore
* <em>MUST</em> be plugged into a KGamePropertyHandler using either
- * registerData or the constructor. The parent of the dataHandler must be able
+ * registerData or the constructor. The tqparent of the dataHandler must be able
* to send messages (see above: the message server must be running). If you use
* send to change the value of a property you won't see the effect
* immediately: The new value is first transferred to the message server which
@@ -488,7 +488,7 @@ private:
* which result in inconsistent properties (like "game running" on client A but
* "game ended/paused" on client B). But note that there is a very good reason
* for the existence of these different concepts of KGameProperty. I have
- * myself experienced such a "strange error" and it took me several days to find
+ * myself experienced such a "strange error" and it took me several days to tqfind
* the reason until I could fix it. So I personally recommend the "clean" way.
* On the other hand if you want to port a non-network game to a network game
* you will probably start with "dirty" properties as it is you will not have to
@@ -546,16 +546,16 @@ private:
* };
* TQDataStream& operator<<(TQDataStream& stream, Card& card)
* {
- * Q_INT16 type = card.type;
- * Q_INT16 suite = card.suite;
+ * TQ_INT16 type = card.type;
+ * TQ_INT16 suite = card.suite;
* s << type;
* s << suite;
* return s;
* }
* TQDataStream& operator>>(TQDataStream& stream, Card& card)
* {
- * Q_INT16 type;
- * Q_INT16 suite;
+ * TQ_INT16 type;
+ * TQ_INT16 suite;
* s >> type;
* s >> suite;
* card.type = (int)type;
@@ -585,15 +585,15 @@ public:
* Constructs a KGameProperty object. A KGameProperty object will transmit
* any changes to the KMessageServer and then to all clients in the
* game (including the one that has sent the new value)
- * @param id The id of this property. <em>MUST be UNIQUE</em>! Used to send and
+ * @param id The id of this property. <em>MUST be UNITQUE</em>! Used to send and
* receive changes in the property of the playere automatically via
* network.
- * @param owner The parent of the object. Must be a KGame which manages
+ * @param owner The tqparent of the object. Must be a KGame which manages
* the changes made to this object, i.e. which will send the new data.
* Note that in contrast to most KDE/QT classes KGameProperty objects
* are <em>not</em> deleted automatically!
**/
-// TODO: ID: Very ugly - better use something like parent()->propertyId() or so which assigns a free id automatically.
+// TODO: ID: Very ugly - better use something like tqparent()->propertyId() or so which assigns a free id automatically.
KGameProperty(int id, KGamePropertyHandler* owner) : KGamePropertyBase(id, owner) { init(); }
/**
@@ -651,7 +651,7 @@ public:
* \endcode
* as myProperty has not yet been set when doSomething is being called.
*
- * You are informed about a value change by a singal from the parent of
+ * You are informed about a value change by a singal from the tqparent of
* the property which can be deactivated by setEmittingSignal because of
* performance (you probably don't have to deactivate it - except you
* want to write a real-time game like Command&Conquer with a lot of
@@ -842,7 +842,7 @@ private:
typedef KGameProperty<int> KGamePropertyInt;
typedef KGameProperty<unsigned int> KGamePropertyUInt;
-typedef KGameProperty<TQString> KGamePropertyQString;
-typedef KGameProperty<Q_INT8> KGamePropertyBool;
+typedef KGameProperty<TQString> KGamePropertyTQString;
+typedef KGameProperty<TQ_INT8> KGamePropertyBool;
#endif
diff --git a/libkdegames/kgame/kgamepropertyhandler.cpp b/libkdegames/kgame/kgamepropertyhandler.cpp
index f395fc66..32e831d8 100644
--- a/libkdegames/kgame/kgamepropertyhandler.cpp
+++ b/libkdegames/kgame/kgamepropertyhandler.cpp
@@ -51,13 +51,13 @@ public:
TQPtrQueue<KGamePropertyBase> mSignalQueue;
};
-KGamePropertyHandler::KGamePropertyHandler(int id, const TQObject* receiver, const char * sendf, const char *emitf, TQObject* parent) : TQObject(parent)
+KGamePropertyHandler::KGamePropertyHandler(int id, const TQObject* receiver, const char * sendf, const char *emitf, TQObject* tqparent) : TQObject(tqparent)
{
init();
registerHandler(id,receiver,sendf,emitf);
}
-KGamePropertyHandler::KGamePropertyHandler(TQObject* parent) : TQObject(parent)
+KGamePropertyHandler::KGamePropertyHandler(TQObject* tqparent) : TQObject(tqparent)
{
init();
}
@@ -117,7 +117,7 @@ bool KGamePropertyHandler::processMessage(TQDataStream &stream, int id, bool isS
int cmd;
KGameMessage::extractPropertyCommand(stream, propertyId, cmd);
//kdDebug(11001) << k_funcinfo << ": Got COMMAND for id= "<<propertyId <<endl;
- p = d->mIdDict.find(propertyId);
+ p = d->mIdDict.tqfind(propertyId);
if (p) {
if (!isSender || p->policy()==KGamePropertyBase::PolicyClean) {
p->command(stream, cmd, isSender);
@@ -127,7 +127,7 @@ bool KGamePropertyHandler::processMessage(TQDataStream &stream, int id, bool isS
}
return true;
}
- p = d->mIdDict.find(propertyId);
+ p = d->mIdDict.tqfind(propertyId);
if (p) {
//kdDebug(11001) << k_funcinfo << ": Loading " << propertyId << endl;
if (!isSender || p->policy()==KGamePropertyBase::PolicyClean) {
@@ -151,7 +151,7 @@ bool KGamePropertyHandler::removeProperty(KGamePropertyBase* data)
bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, TQString name)
{
//kdDebug(11001) << k_funcinfo << ": " << data->id() << endl;
- if (d->mIdDict.find(data->id())) {
+ if (d->mIdDict.tqfind(data->id())) {
// this id already exists
kdError(11001) << " -> cannot add property " << data->id() << endl;
return false;
@@ -172,15 +172,15 @@ bool KGamePropertyHandler::addProperty(KGamePropertyBase* data, TQString name)
TQString KGamePropertyHandler::propertyName(int id) const
{
TQString s;
- if (d->mIdDict.find(id)) {
- if (d->mNameMap.contains(id)) {
- s = i18n("%1 (%2)").arg(d->mNameMap[id]).arg(id);
+ if (d->mIdDict.tqfind(id)) {
+ if (d->mNameMap.tqcontains(id)) {
+ s = i18n("%1 (%2)").tqarg(d->mNameMap[id]).tqarg(id);
} else {
- s = i18n("Unnamed - ID: %1").arg(id);
+ s = i18n("Unnamed - ID: %1").tqarg(id);
}
} else {
// Should _never_ happen
- s = i18n("%1 unregistered").arg(id);
+ s = i18n("%1 unregistered").tqarg(id);
}
return s;
}
@@ -195,7 +195,7 @@ bool KGamePropertyHandler::load(TQDataStream &stream)
for (i = 0; i < count; i++) {
processMessage(stream, id(),false);
}
- Q_INT16 cookie;
+ TQ_INT16 cookie;
stream >> cookie;
if (cookie == KPLAYERHANDLER_LOAD_COOKIE) {
kdDebug(11001) << " KGamePropertyHandler loaded propertly"<<endl;
@@ -220,7 +220,7 @@ bool KGamePropertyHandler::save(TQDataStream &stream)
}
++it;
}
- stream << (Q_INT16)KPLAYERHANDLER_LOAD_COOKIE;
+ stream << (TQ_INT16)KPLAYERHANDLER_LOAD_COOKIE;
return true;
}
@@ -326,9 +326,9 @@ bool KGamePropertyHandler::sendProperty(TQDataStream &s)
return sent;
}
-KGamePropertyBase *KGamePropertyHandler::find(int id)
+KGamePropertyBase *KGamePropertyHandler::tqfind(int id)
{
- return d->mIdDict.find(id);
+ return d->mIdDict.tqfind(id);
}
void KGamePropertyHandler::clear()
@@ -338,7 +338,7 @@ void KGamePropertyHandler::clear()
while (it.toFirst()) {
KGamePropertyBase* p = it.toFirst();
p->unregisterData();
- if (d->mIdDict.find(p->id())) {
+ if (d->mIdDict.tqfind(p->id())) {
// shouldn't happen - but if mOwner in KGamePropertyBase is NULL
// this might be possible
removeProperty(p);
@@ -371,8 +371,8 @@ TQString KGamePropertyHandler::propertyValue(KGamePropertyBase* prop)
} else if (*t == typeid(unsigned long int)) {
value = TQString::number(((KGameProperty<unsigned long int> *)prop)->value());
} else if (*t == typeid(TQString)) {
- value = ((KGamePropertyQString*)prop)->value();
- } else if (*t == typeid(Q_INT8)) {
+ value = ((KGamePropertyTQString*)prop)->value();
+ } else if (*t == typeid(TQ_INT8)) {
value = ((KGamePropertyBool*)prop)->value() ? i18n("True") : i18n("False");
} else {
emit signalRequestValue(prop, value);
diff --git a/libkdegames/kgame/kgamepropertyhandler.h b/libkdegames/kgame/kgamepropertyhandler.h
index 29a57cf1..7388b510 100644
--- a/libkdegames/kgame/kgamepropertyhandler.h
+++ b/libkdegames/kgame/kgamepropertyhandler.h
@@ -43,8 +43,8 @@ class KGamePropertyHandlerPrivate; // wow - what a name ;-)
* to care about the KGamePropertHandler. KGame and KPlayer implement
* all features of KGamePropertyHandler so you will rather use it there.
*
- * You have to use the KGamePropertyHandler as parent for all KGameProperty
- * objects but you can also use KPlayer or KGame as parent - then
+ * You have to use the KGamePropertyHandler as tqparent for all KGameProperty
+ * objects but you can also use KPlayer or KGame as tqparent - then
* KPlayer::dataHandler or KGame::dataHandler will be used.
*
* Every KGamePropertyHandler must have - just like every KGameProperty -
@@ -69,9 +69,10 @@ class KGamePropertyHandlerPrivate; // wow - what a name ;-)
* multiplied.
*
**/
-class KDE_EXPORT KGamePropertyHandler : public QObject
+class KDE_EXPORT KGamePropertyHandler : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -80,18 +81,18 @@ public:
* You have to call registerHandler before you can use this
* handler!
**/
- KGamePropertyHandler(TQObject* parent = 0);
+ KGamePropertyHandler(TQObject* tqparent = 0);
/**
* Construct a registered handler.
*
* @see registerHandler
**/
- KGamePropertyHandler(int id, const TQObject* receiver, const char* sendf, const char* emitf, TQObject* parent = 0);
+ KGamePropertyHandler(int id, const TQObject* receiver, const char* sendf, const char* emitf, TQObject* tqparent = 0);
~KGamePropertyHandler();
/**
- * Register the handler with a parent. This is to use
+ * Register the handler with a tqparent. This is to use
* if the constructor without arguments has been chosen.
* Otherwise you need not call this.
*
@@ -105,7 +106,7 @@ public:
/**
* Main message process function. This has to be called by
- * the parent's message event handler. If the id of the message
+ * the tqparent's message event handler. If the id of the message
* agrees with the id of the handler, the message is extracted
* and processed. Otherwise false is returned.
* Example:
@@ -169,7 +170,7 @@ public:
/**
* called by a property to send itself into the
* datastream. This call is simply forwarded to
- * the parent object
+ * the tqparent object
**/
bool sendProperty(TQDataStream &s);
@@ -178,7 +179,7 @@ public:
/**
* called by a property to emit a signal
* This call is simply forwarded to
- * the parent object
+ * the tqparent object
**/
void emitSignal(KGamePropertyBase *data);
@@ -194,7 +195,7 @@ public:
* @param id The ID of the property. See KGamePropertyBase::id
* @return The KGameProperty this ID is assigned to
**/
- KGamePropertyBase *find(int id);
+ KGamePropertyBase *tqfind(int id);
/**
* Clear the KGamePropertyHandler. Note that the properties are
@@ -315,7 +316,7 @@ signals:
/**
* This signal is emitted when a property needs to be sent. Only the
- * parent has to react to this.
+ * tqparent has to react to this.
* @param msgid The id of the handler
* @param sent set this to true if the property was sent successfully -
* otherwise don't touch
diff --git a/libkdegames/kgame/kgamepropertylist.h b/libkdegames/kgame/kgamepropertylist.h
index df8eb604..af380b0a 100644
--- a/libkdegames/kgame/kgamepropertylist.h
+++ b/libkdegames/kgame/kgamepropertylist.h
@@ -139,7 +139,7 @@ public:
void remove( const type& d )
{
- Iterator it=find(d);
+ Iterator it=tqfind(d);
remove(it);
}
diff --git a/libkdegames/kgame/kgamesequence.h b/libkdegames/kgame/kgamesequence.h
index 19699d6b..8047c642 100644
--- a/libkdegames/kgame/kgamesequence.h
+++ b/libkdegames/kgame/kgamesequence.h
@@ -39,9 +39,10 @@ class KGame;
* @short Round/move management class
* @author Andreas Beckermann <b_mann@gmx.de>
**/
-class KGameSequence : public QObject
+class KGameSequence : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
KGameSequence();
virtual ~KGameSequence();
diff --git a/libkdegames/kgame/kmessageclient.cpp b/libkdegames/kgame/kmessageclient.cpp
index e490a084..03a39df9 100644
--- a/libkdegames/kgame/kmessageclient.cpp
+++ b/libkdegames/kgame/kmessageclient.cpp
@@ -40,16 +40,16 @@ public:
delete connection;
}
- Q_UINT32 adminID;
- TQValueList <Q_UINT32> clientList;
+ TQ_UINT32 adminID;
+ TQValueList <TQ_UINT32> clientList;
KMessageIO *connection;
bool isLocked;
TQValueList <TQByteArray> delayedMessages;
};
-KMessageClient::KMessageClient (TQObject *parent, const char *name)
- : TQObject (parent, name)
+KMessageClient::KMessageClient (TQObject *tqparent, const char *name)
+ : TQObject (tqparent, name)
{
d = new KMessageClientPrivate ();
d->isLocked = false;
@@ -63,7 +63,7 @@ KMessageClient::~KMessageClient ()
// -- setServer stuff
-void KMessageClient::setServer (const TQString &host, Q_UINT16 port)
+void KMessageClient::setServer (const TQString &host, TQ_UINT16 port)
{
setServer (new KMessageSocket (host, port));
}
@@ -95,7 +95,7 @@ void KMessageClient::setServer (KMessageIO *connection)
// -- id stuff
-Q_UINT32 KMessageClient::id () const
+TQ_UINT32 KMessageClient::id () const
{
return (d->connection) ? d->connection->id () : 0;
}
@@ -105,12 +105,12 @@ bool KMessageClient::isAdmin () const
return id() != 0 && id() == adminId();
}
-Q_UINT32 KMessageClient::adminId () const
+TQ_UINT32 KMessageClient::adminId () const
{
return d->adminID;
}
-const TQValueList <Q_UINT32> &KMessageClient::clientList() const
+const TQValueList <TQ_UINT32> &KMessageClient::clientList() const
{
return d->clientList;
}
@@ -125,14 +125,14 @@ bool KMessageClient::isNetwork () const
return isConnected() ? d->connection->isNetwork() : false;
}
-Q_UINT16 KMessageClient::peerPort () const
+TQ_UINT16 KMessageClient::peerPort () const
{
return d->connection ? d->connection->peerPort() : 0;
}
TQString KMessageClient::peerName () const
{
- return d->connection ? d->connection->peerName() : TQString::fromLatin1("localhost");
+ return d->connection ? d->connection->peerName() : TQString::tqfromLatin1("localhost");
}
// --------------------- Sending messages
@@ -154,26 +154,26 @@ void KMessageClient::sendBroadcast (const TQByteArray &msg)
buffer.open (IO_WriteOnly);
TQDataStream stream (&buffer);
- stream << static_cast<Q_UINT32> ( KMessageServer::REQ_BROADCAST );
- buffer.TQIODevice::writeBlock (msg);
+ stream << static_cast<TQ_UINT32> ( KMessageServer::RETQ_BROADCAST );
+ TQT_TQIODEVICE(&buffer)->writeBlock (msg);
sendServerMessage (sendBuffer);
}
-void KMessageClient::sendForward (const TQByteArray &msg, const TQValueList <Q_UINT32> &clients)
+void KMessageClient::sendForward (const TQByteArray &msg, const TQValueList <TQ_UINT32> &clients)
{
TQByteArray sendBuffer;
TQBuffer buffer (sendBuffer);
buffer.open (IO_WriteOnly);
TQDataStream stream (&buffer);
- stream << static_cast<Q_UINT32>( KMessageServer::REQ_FORWARD ) << clients;
- buffer.TQIODevice::writeBlock (msg);
+ stream << static_cast<TQ_UINT32>( KMessageServer::RETQ_FORWARD ) << clients;
+ TQT_TQIODEVICE(&buffer)->writeBlock (msg);
sendServerMessage (sendBuffer);
}
-void KMessageClient::sendForward (const TQByteArray &msg, Q_UINT32 client)
+void KMessageClient::sendForward (const TQByteArray &msg, TQ_UINT32 client)
{
- sendForward (msg, TQValueList <Q_UINT32> () << client);
+ sendForward (msg, TQValueList <TQ_UINT32> () << client);
}
@@ -213,13 +213,13 @@ void KMessageClient::processMessage (const TQByteArray &msg)
bool unknown = false;
- Q_UINT32 messageID;
+ TQ_UINT32 messageID;
in_stream >> messageID;
switch (messageID)
{
case KMessageServer::MSG_BROADCAST:
{
- Q_UINT32 clientID;
+ TQ_UINT32 clientID;
in_stream >> clientID;
emit broadcastReceived (in_buffer.readAll(), clientID);
}
@@ -227,17 +227,17 @@ void KMessageClient::processMessage (const TQByteArray &msg)
case KMessageServer::MSG_FORWARD:
{
- Q_UINT32 clientID;
- TQValueList <Q_UINT32> receivers;
- in_stream >> clientID >> receivers;
- emit forwardReceived (in_buffer.readAll(), clientID, receivers);
+ TQ_UINT32 clientID;
+ TQValueList <TQ_UINT32> tqreceivers;
+ in_stream >> clientID >> tqreceivers;
+ emit forwardReceived (in_buffer.readAll(), clientID, tqreceivers);
}
break;
case KMessageServer::ANS_CLIENT_ID:
{
bool old_admin = isAdmin();
- Q_UINT32 clientID;
+ TQ_UINT32 clientID;
in_stream >> clientID;
d->connection->setId (clientID);
if (old_admin != isAdmin())
@@ -262,10 +262,10 @@ void KMessageClient::processMessage (const TQByteArray &msg)
case KMessageServer::EVNT_CLIENT_CONNECTED:
{
- Q_UINT32 id;
+ TQ_UINT32 id;
in_stream >> id;
- if (d->clientList.contains (id))
+ if (d->clientList.tqcontains (id))
kdWarning (11001) << k_funcinfo << ": Adding a client that already existed!" << endl;
else
d->clientList.append (id);
@@ -276,11 +276,11 @@ void KMessageClient::processMessage (const TQByteArray &msg)
case KMessageServer::EVNT_CLIENT_DISCONNECTED:
{
- Q_UINT32 id;
- Q_INT8 broken;
+ TQ_UINT32 id;
+ TQ_INT8 broken;
in_stream >> id >> broken;
- if (!d->clientList.contains (id))
+ if (!d->clientList.tqcontains (id))
kdWarning (11001) << k_funcinfo << ": Removing a client that doesn't exist!" << endl;
else
d->clientList.remove (id);
diff --git a/libkdegames/kgame/kmessageclient.h b/libkdegames/kgame/kmessageclient.h
index 71ab7a1e..f81d7a69 100644
--- a/libkdegames/kgame/kmessageclient.h
+++ b/libkdegames/kgame/kmessageclient.h
@@ -47,9 +47,10 @@ class KMessageClientPrivate;
In that case the messages must be of the format specified in KMessageServer.
@author Burkhard Lehner <Burkhard.Lehner@gmx.de>
*/
-class KMessageClient : public QObject
+class KMessageClient : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
@@ -58,7 +59,7 @@ public:
Creates an unconnected KMessageClient object. Use setServer() later to connect to a
KMessageServer object.
*/
- KMessageClient (TQObject *parent = 0, const char *name = 0);
+ KMessageClient (TQObject *tqparent = 0, const char *name = 0);
/**
Destructor.
@@ -73,7 +74,7 @@ public:
NOTE: As long as the object is not yet connected to the server, and as long as the server
hasn't sent the client ID, this method returns 0.
*/
- Q_UINT32 id () const;
+ TQ_UINT32 id () const;
/**
@return Whether or not this client is the server admin.
@@ -90,12 +91,12 @@ public:
/**
@return The ID of the admin client on the message server.
*/
- Q_UINT32 adminId() const;
+ TQ_UINT32 adminId() const;
/**
@return The list of the IDs of all the message clients connected to the message server.
*/
- const TQValueList <Q_UINT32> &clientList() const;
+ const TQValueList <TQ_UINT32> &clientList() const;
/**
Connects the client to (another) server.
@@ -108,7 +109,7 @@ public:
be resolved to an IP or just an IP
@param port The port to connect to
*/
- void setServer (const TQString &host, Q_UINT16 port);
+ void setServer (const TQString &host, TQ_UINT16 port);
/**
Connects the client to (another) server.
@@ -168,7 +169,7 @@ public:
connected to. See also KMessageIO::peerPort and TQSocket::peerPort.
@since 3.2
*/
- Q_UINT16 peerPort () const;
+ TQ_UINT16 peerPort () const;
/**
@since 3.2
@@ -218,11 +219,11 @@ public:
@param clients A list of clients the message should be sent to
*/
//AB: processForward doesn't exist!! is processIncomingMessage meant?
- void sendForward (const TQByteArray &msg, const TQValueList <Q_UINT32> &clients);
+ void sendForward (const TQByteArray &msg, const TQValueList <TQ_UINT32> &clients);
/**
Sends a message to a single client. This is a convenieance method. It calls
- sendForward (const TQByteArray &msg, const TQValueList &ltQ_UINT32> &clients)
+ sendForward (const TQByteArray &msg, const TQValueList &ltTQ_UINT32> &clients)
with a list containing only one client ID.
To send a message to the admin of the KMessageServer, you can use 0 as clientID,
@@ -230,7 +231,7 @@ public:
@param msg The message to be sent to the client
@param client The id of the client the message shall be sent to
*/
- void sendForward (const TQByteArray &msg, Q_UINT32 client);
+ void sendForward (const TQByteArray &msg, TQ_UINT32 client);
/**
Once this function is called no message will be received anymore.
@@ -263,7 +264,7 @@ signals:
to ignore broadcast messages that were sent by yourself:
\code
- void myObject::myBroadcastSlot (const TQByteArray &msg, Q_UINT32 senderID)
+ void myObject::myBroadcastSlot (const TQByteArray &msg, TQ_UINT32 senderID)
{
if (senderID == ((KMessageClient *)sender())->id())
return;
@@ -273,7 +274,7 @@ signals:
@param msg The message that has been sent to us
@param senderID The ID of the client which sent the message
*/
- void broadcastReceived (const TQByteArray &msg, Q_UINT32 senderID);
+ void broadcastReceived (const TQByteArray &msg, TQ_UINT32 senderID);
/**
This signal is emitted when the client receives a forward message from the
@@ -283,27 +284,27 @@ signals:
senderID contains the ID of the client that sent the broadcast message. You can
use this e.g. to send a reply message to only that client.
- receivers contains the list of the clients that got the message. (If this list
+ tqreceivers contains the list of the clients that got the message. (If this list
only contains one number, this will be your client ID, and it was exclusivly
sent to you.)
If you don't want to distinguish between broadcast and forward messages and
treat them the same, you can connect forwardReceived signal to the
- broadcastReceived signal. (Yes, that's possible! You can connect a Qt signal to
- a Qt signal, and the second one can have less parameters.)
+ broadcastReceived signal. (Yes, that's possible! You can connect a TQt signal to
+ a TQt signal, and the second one can have less parameters.)
\code
KMessageClient *client = new KMessageClient ();
- connect (client, TQT_SIGNAL (forwardReceived (const TQByteArray &, Q_UINT32, const TQValueList <Q_UINT32>&)),
- client, TQT_SIGNAL (broadcastReceived (const TQByteArray &, Q_UINT32)));
+ connect (client, TQT_SIGNAL (forwardReceived (const TQByteArray &, TQ_UINT32, const TQValueList <TQ_UINT32>&)),
+ client, TQT_SIGNAL (broadcastReceived (const TQByteArray &, TQ_UINT32)));
\endcode
Then connect the broadcast signal to your slot that analyzes the message.
@param msg The message that has been sent to us
@param senderID The ID of the client which sent the message
- @param receivers All clients which receive this message
+ @param tqreceivers All clients which receive this message
*/
- void forwardReceived (const TQByteArray &msg, Q_UINT32 senderID, const TQValueList <Q_UINT32> &receivers);
+ void forwardReceived (const TQByteArray &msg, TQ_UINT32 senderID, const TQValueList <TQ_UINT32> &tqreceivers);
/**
This signal is emitted when the connection to the KMessageServer is broken.
@@ -320,7 +321,7 @@ signals:
This signal is emitted right before the client disconnects. It can be used
to this store the id of the client which is about to be lost.
*/
- void aboutToDisconnect(Q_UINT32 id);
+ void aboutToDisconnect(TQ_UINT32 id);
/**
This signal is emitted when this client becomes the admin client or when it loses
@@ -336,7 +337,7 @@ signals:
This should usually only be done in one client, e.g. the admin client.
@param clientID The ID of the client that has newly connectd.
*/
- void eventClientConnected (Q_UINT32 clientID);
+ void eventClientConnected (TQ_UINT32 clientID);
/**
This signal is emitted when the server has lost the
@@ -345,7 +346,7 @@ signals:
@param clientID The ID of the client that has disconnected
@param broken true if it was disconnected because of a network error
*/
- void eventClientDisconnected (Q_UINT32 clientID, bool broken);
+ void eventClientDisconnected (TQ_UINT32 clientID, bool broken);
/**
This signal is emitted on every message that came from the server. You can connect to this
diff --git a/libkdegames/kgame/kmessageio.cpp b/libkdegames/kgame/kmessageio.cpp
index 7057a621..ec33b159 100644
--- a/libkdegames/kgame/kmessageio.cpp
+++ b/libkdegames/kgame/kmessageio.cpp
@@ -29,54 +29,54 @@
// ----------------------- KMessageIO -------------------------
-KMessageIO::KMessageIO (TQObject *parent, const char *name)
- : TQObject (parent, name), m_id (0)
+KMessageIO::KMessageIO (TQObject *tqparent, const char *name)
+ : TQObject (tqparent, name), m_id (0)
{}
KMessageIO::~KMessageIO ()
{}
-void KMessageIO::setId (Q_UINT32 id)
+void KMessageIO::setId (TQ_UINT32 id)
{
m_id = id;
}
-Q_UINT32 KMessageIO::id ()
+TQ_UINT32 KMessageIO::id ()
{
return m_id;
}
// ----------------------KMessageSocket -----------------------
-KMessageSocket::KMessageSocket (TQString host, Q_UINT16 port, TQObject *parent,
+KMessageSocket::KMessageSocket (TQString host, TQ_UINT16 port, TQObject *tqparent,
const char *name)
- : KMessageIO (parent, name)
+ : KMessageIO (tqparent, name)
{
mSocket = new TQSocket ();
mSocket->connectToHost (host, port);
initSocket ();
}
-KMessageSocket::KMessageSocket (TQHostAddress host, Q_UINT16 port, TQObject
-*parent, const char *name)
- : KMessageIO (parent, name)
+KMessageSocket::KMessageSocket (TQHostAddress host, TQ_UINT16 port, TQObject
+*tqparent, const char *name)
+ : KMessageIO (tqparent, name)
{
mSocket = new TQSocket ();
mSocket->connectToHost (host.toString(), port);
initSocket ();
}
-KMessageSocket::KMessageSocket (TQSocket *socket, TQObject *parent, const char
+KMessageSocket::KMessageSocket (TQSocket *socket, TQObject *tqparent, const char
*name)
- : KMessageIO (parent, name)
+ : KMessageIO (tqparent, name)
{
mSocket = socket;
initSocket ();
}
-KMessageSocket::KMessageSocket (int socketFD, TQObject *parent, const char
+KMessageSocket::KMessageSocket (int socketFD, TQObject *tqparent, const char
*name)
- : KMessageIO (parent, name)
+ : KMessageIO (tqparent, name)
{
mSocket = new TQSocket ();
mSocket->setSocket (socketFD);
@@ -96,8 +96,8 @@ bool KMessageSocket::isConnected () const
void KMessageSocket::send (const TQByteArray &msg)
{
TQDataStream str (mSocket);
- str << Q_UINT8 ('M'); // magic number for begin of message
- str.writeBytes (msg.data(), msg.size()); // writes the length (as Q_UINT32) and the data
+ str << TQ_UINT8 ('M'); // magic number for begin of message
+ str.writeBytes (msg.data(), msg.size()); // writes the length (as TQ_UINT32) and the data
}
void KMessageSocket::processNewData ()
@@ -121,7 +121,7 @@ void KMessageSocket::processNewData ()
// Read the magic number first. If something unexpected is found,
// start over again, ignoring the data that was read up to then.
- Q_UINT8 v;
+ TQ_UINT8 v;
str >> v;
if (v != 'M')
{
@@ -135,7 +135,7 @@ void KMessageSocket::processNewData ()
else
{
// Data not completely read => wait for more
- if (mSocket->bytesAvailable() < (Q_ULONG) mNextBlockLength)
+ if (mSocket->bytesAvailable() < (TQ_ULONG) mNextBlockLength)
{
isRecursive = false;
return;
@@ -165,7 +165,7 @@ void KMessageSocket::initSocket ()
isRecursive = false;
}
-Q_UINT16 KMessageSocket::peerPort () const
+TQ_UINT16 KMessageSocket::peerPort () const
{
return mSocket->peerPort();
}
@@ -177,9 +177,9 @@ TQString KMessageSocket::peerName () const
// ----------------------KMessageDirect -----------------------
-KMessageDirect::KMessageDirect (KMessageDirect *partner, TQObject *parent,
+KMessageDirect::KMessageDirect (KMessageDirect *partner, TQObject *tqparent,
const char *name)
- : KMessageIO (parent, name), mPartner (0)
+ : KMessageIO (tqparent, name), mPartner (0)
{
// 0 as first parameter leaves the object unconnected
if (!partner)
@@ -238,14 +238,14 @@ KMessageProcess::~KMessageProcess()
// Maybe todo: delete mSendBuffer
}
}
-KMessageProcess::KMessageProcess(TQObject *parent, TQString file) : KMessageIO(parent,0)
+KMessageProcess::KMessageProcess(TQObject *tqparent, TQString file) : KMessageIO(tqparent,0)
{
// Start process
kdDebug(11001) << "@@@KMessageProcess::Start process" << endl;
mProcessName=file;
mProcess=new KProcess;
int id=0;
- *mProcess << mProcessName << TQString("%1").arg(id);
+ *mProcess << mProcessName << TQString("%1").tqarg(id);
kdDebug(11001) << "@@@KMessageProcess::Init:Id= " << id << endl;
kdDebug(11001) << "@@@KMessgeProcess::Init:Processname: " << mProcessName << endl;
connect(mProcess, TQT_SIGNAL(receivedStdout(KProcess *, char *, int )),
@@ -397,7 +397,7 @@ void KMessageProcess::slotProcessExited(KProcess * /*p*/)
// ----------------------- KMessageFilePipe ---------------------------
-KMessageFilePipe::KMessageFilePipe(TQObject *parent,TQFile *readfile,TQFile *writefile) : KMessageIO(parent,0)
+KMessageFilePipe::KMessageFilePipe(TQObject *tqparent,TQFile *readfile,TQFile *writefile) : KMessageIO(tqparent,0)
{
mReadFile=readfile;
mWriteFile=writefile;
@@ -430,7 +430,7 @@ void KMessageFilePipe::send(const TQByteArray &msg)
mWriteFile->writeBlock(buffer);
mWriteFile->flush();
/*
- fprintf(stderr,"+++ KMessageFilePipe:: SEND(%d to parent) realsize=%d\n",msg.size(),buffer.size());
+ fprintf(stderr,"+++ KMessageFilePipe:: SEND(%d to tqparent) realsize=%d\n",msg.size(),buffer.size());
for (int i=0;i<buffer.size();i++) fprintf(stderr,"%02x ",buffer[i]);fprintf(stderr,"\n");
fflush(stderr);
*/
diff --git a/libkdegames/kgame/kmessageio.h b/libkdegames/kgame/kmessageio.h
index 5a102e11..7d4bc92a 100644
--- a/libkdegames/kgame/kmessageio.h
+++ b/libkdegames/kgame/kmessageio.h
@@ -53,15 +53,16 @@ class KProcess;
sides must be within the same process).
*/
-class KMessageIO : public QObject
+class KMessageIO : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* The usual TQObject constructor, does nothing else.
**/
- KMessageIO (TQObject *parent = 0, const char *name = 0);
+ KMessageIO (TQObject *tqparent = 0, const char *name = 0);
/**
* The usual destructor, does nothing special.
@@ -105,24 +106,24 @@ public:
have the same ID number. You have to do so yourself, KMessageIO doesn't
change this value on its own!
*/
- void setId (Q_UINT32 id);
+ void setId (TQ_UINT32 id);
/**
Queries the ID of this object.
*/
- Q_UINT32 id ();
+ TQ_UINT32 id ();
/**
@since 3.2
@return 0 in the default implementation. Reimplemented in @ref KMessageSocket.
*/
- virtual Q_UINT16 peerPort () const { return 0; }
+ virtual TQ_UINT16 peerPort () const { return 0; }
/**
@since 3.2
@return "localhost" in the default implementation. Reimplemented in @ref KMessageSocket
*/
- virtual TQString peerName () const { return TQString::fromLatin1("localhost"); }
+ virtual TQString peerName () const { return TQString::tqfromLatin1("localhost"); }
signals:
@@ -157,7 +158,7 @@ public slots:
virtual void send (const TQByteArray &msg) = 0;
protected:
- Q_UINT32 m_id;
+ TQ_UINT32 m_id;
};
@@ -169,6 +170,7 @@ protected:
class KMessageSocket : public KMessageIO
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -181,7 +183,7 @@ public:
If the connection could not be established (e.g. unknown host or no server
socket at this port), the signal /e connectionBroken is emitted.
*/
- KMessageSocket (TQString host, Q_UINT16 port, TQObject *parent = 0,
+ KMessageSocket (TQString host, TQ_UINT16 port, TQObject *tqparent = 0,
const char *name = 0);
/**
@@ -192,7 +194,7 @@ public:
If the connection could not be established (e.g. unknown host or no server
socket at this port), the signal /e connectionBroken is emitted.
*/
- KMessageSocket (TQHostAddress host, Q_UINT16 port, TQObject *parent = 0,
+ KMessageSocket (TQHostAddress host, TQ_UINT16 port, TQObject *tqparent = 0,
const char *name = 0);
/**
@@ -203,10 +205,10 @@ public:
Note: The /e socket object is then owned by the /e KMessageSocket object.
So don't use it otherwise any more and don't delete it. It is deleted
- together with this KMessageSocket object. (Use 0 as parent for the QSocket
+ together with this KMessageSocket object. (Use 0 as tqparent for the TQSocket
object t ensure it is not deleted.)
*/
- KMessageSocket (TQSocket *socket, TQObject *parent = 0, const char *name = 0);
+ KMessageSocket (TQSocket *socket, TQObject *tqparent = 0, const char *name = 0);
/**
Uses the socket specified by the socket descriptor socketFD to do the
@@ -219,7 +221,7 @@ public:
manipulate the socket afterwards, especially don't close it. The socket is
automatically closed when KMessageSocket is deleted.
*/
- KMessageSocket (int socketFD, TQObject *parent = 0, const char *name = 0);
+ KMessageSocket (int socketFD, TQObject *tqparent = 0, const char *name = 0);
/**
Destructor, closes the socket.
@@ -235,7 +237,7 @@ public:
@since 3.2
@return The port that this object is connected to. See TQSocket::peerPort
*/
- virtual Q_UINT16 peerPort () const;
+ virtual TQ_UINT16 peerPort () const;
/**
@since 3.2
@@ -268,9 +270,9 @@ protected:
void initSocket ();
TQSocket *mSocket;
bool mAwaitingHeader;
- Q_UINT32 mNextBlockLength;
+ TQ_UINT32 mNextBlockLength;
- bool isRecursive; // workaround for "bug" in TQSocket, Qt 2.2.3 or older
+ bool isRecursive; // workaround for "bug" in TQSocket, TQt 2.2.3 or older
};
@@ -295,6 +297,7 @@ protected:
class KMessageDirect : public KMessageIO
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -304,7 +307,7 @@ public:
If that object is already connected, the object remains unconnected.
*/
- KMessageDirect (KMessageDirect *partner = 0, TQObject *parent = 0, const char
+ KMessageDirect (KMessageDirect *partner = 0, TQObject *tqparent = 0, const char
*name = 0);
/**
@@ -347,10 +350,11 @@ protected:
class KMessageProcess : public KMessageIO
{
- Q_OBJECT
+ Q_OBJECT
+ TQ_OBJECT
public:
- KMessageProcess(TQObject *parent, TQString file);
+ KMessageProcess(TQObject *tqparent, TQString file);
~KMessageProcess();
bool isConnected() const;
void send (const TQByteArray &msg);
@@ -385,10 +389,11 @@ class KMessageProcess : public KMessageIO
class KMessageFilePipe : public KMessageIO
{
- Q_OBJECT
+ Q_OBJECT
+ TQ_OBJECT
public:
- KMessageFilePipe(TQObject *parent,TQFile *readFile,TQFile *writeFile);
+ KMessageFilePipe(TQObject *tqparent,TQFile *readFile,TQFile *writeFile);
~KMessageFilePipe();
bool isConnected() const;
void send (const TQByteArray &msg);
diff --git a/libkdegames/kgame/kmessageserver.cpp b/libkdegames/kgame/kmessageserver.cpp
index 618a6079..69609002 100644
--- a/libkdegames/kgame/kmessageserver.cpp
+++ b/libkdegames/kgame/kmessageserver.cpp
@@ -31,8 +31,8 @@
// --------------- internal class KMessageServerSocket
-KMessageServerSocket::KMessageServerSocket (Q_UINT16 port, TQObject *parent)
- : TQServerSocket (port, 0, parent)
+KMessageServerSocket::KMessageServerSocket (TQ_UINT16 port, TQObject *tqparent)
+ : TQServerSocket (port, 0, tqparent)
{
}
@@ -50,10 +50,10 @@ void KMessageServerSocket::newConnection (int socket)
class MessageBuffer
{
public:
- MessageBuffer (Q_UINT32 clientID, const TQByteArray &messageData)
+ MessageBuffer (TQ_UINT32 clientID, const TQByteArray &messageData)
: id (clientID), data (messageData) { }
~MessageBuffer () {}
- Q_UINT32 id;
+ TQ_UINT32 id;
TQByteArray data;
};
@@ -71,9 +71,9 @@ public:
int mMaxClients;
int mGameId;
- Q_UINT16 mCookie;
- Q_UINT32 mUniqueClientNumber;
- Q_UINT32 mAdminID;
+ TQ_UINT16 mCookie;
+ TQ_UINT32 mUniqueClientNumber;
+ TQ_UINT32 mAdminID;
KMessageServerSocket* mServerSocket;
@@ -86,8 +86,8 @@ public:
// ------------------ KMessageServer
-KMessageServer::KMessageServer (Q_UINT16 cookie,TQObject* parent)
- : TQObject(parent, 0)
+KMessageServer::KMessageServer (TQ_UINT16 cookie,TQObject* tqparent)
+ : TQObject(tqparent, 0)
{
d = new KMessageServerPrivate;
d->mIsRecursive=false;
@@ -115,7 +115,7 @@ KMessageServer::~KMessageServer()
//------------------------------------- TCP/IP server stuff
-bool KMessageServer::initNetwork (Q_UINT16 port)
+bool KMessageServer::initNetwork (TQ_UINT16 port)
{
kdDebug(11001) << k_funcinfo << endl;
@@ -143,7 +143,7 @@ bool KMessageServer::initNetwork (Q_UINT16 port)
return true;
}
-Q_UINT16 KMessageServer::serverPort () const
+TQ_UINT16 KMessageServer::serverPort () const
{
if (d->mServerSocket)
return d->mServerSocket->port();
@@ -190,18 +190,18 @@ void KMessageServer::addClient (KMessageIO* client)
// Tell everyone about the new guest
// Note: The new client doesn't get this message!
- TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (EVNT_CLIENT_CONNECTED) << client->id();
+ TQDataStream (msg, IO_WriteOnly) << TQ_UINT32 (EVNT_CLIENT_CONNECTED) << client->id();
broadcastMessage (msg);
// add to our list
d->mClientList.append (client);
// tell it its ID
- TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_CLIENT_ID) << client->id();
+ TQDataStream (msg, IO_WriteOnly) << TQ_UINT32 (ANS_CLIENT_ID) << client->id();
client->send (msg);
// Give it the complete list of client IDs
- TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_CLIENT_LIST) << clientIDs();
+ TQDataStream (msg, IO_WriteOnly) << TQ_UINT32 (ANS_CLIENT_LIST) << clientIDs();
client->send (msg);
@@ -213,7 +213,7 @@ void KMessageServer::addClient (KMessageIO* client)
else
{
// otherwise tell it who is the admin
- TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_ADMIN_ID) << adminID();
+ TQDataStream (msg, IO_WriteOnly) << TQ_UINT32 (ANS_ADMIN_ID) << adminID();
client->send (msg);
}
@@ -222,7 +222,7 @@ void KMessageServer::addClient (KMessageIO* client)
void KMessageServer::removeClient (KMessageIO* client, bool broken)
{
- Q_UINT32 clientID = client->id();
+ TQ_UINT32 clientID = client->id();
if (!d->mClientList.removeRef (client))
{
kdError(11001) << k_funcinfo << ": Deleting client that wasn't added before!" << endl;
@@ -231,7 +231,7 @@ void KMessageServer::removeClient (KMessageIO* client, bool broken)
// tell everyone about the removed client
TQByteArray msg;
- TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (EVNT_CLIENT_DISCONNECTED) << client->id() << (Q_INT8)broken;
+ TQDataStream (msg, IO_WriteOnly) << TQ_UINT32 (EVNT_CLIENT_DISCONNECTED) << client->id() << (TQ_INT8)broken;
broadcastMessage (msg);
// If it was the admin, select a new admin.
@@ -280,15 +280,15 @@ int KMessageServer::clientCount() const
return d->mClientList.count();
}
-TQValueList <Q_UINT32> KMessageServer::clientIDs () const
+TQValueList <TQ_UINT32> KMessageServer::clientIDs () const
{
- TQValueList <Q_UINT32> list;
+ TQValueList <TQ_UINT32> list;
for (TQPtrListIterator <KMessageIO> iter (d->mClientList); *iter; ++iter)
list.append ((*iter)->id());
return list;
}
-KMessageIO* KMessageServer::findClient (Q_UINT32 no) const
+KMessageIO* KMessageServer::findClient (TQ_UINT32 no) const
{
if (no == 0)
no = d->mAdminID;
@@ -303,12 +303,12 @@ KMessageIO* KMessageServer::findClient (Q_UINT32 no) const
return 0;
}
-Q_UINT32 KMessageServer::adminID () const
+TQ_UINT32 KMessageServer::adminID () const
{
return d->mAdminID;
}
-void KMessageServer::setAdmin (Q_UINT32 adminID)
+void KMessageServer::setAdmin (TQ_UINT32 adminID)
{
// Trying to set the the client that is already admin => nothing to do
if (adminID == d->mAdminID)
@@ -323,7 +323,7 @@ void KMessageServer::setAdmin (Q_UINT32 adminID)
d->mAdminID = adminID;
TQByteArray msg;
- TQDataStream (msg, IO_WriteOnly) << Q_UINT32 (ANS_ADMIN_ID) << adminID;
+ TQDataStream (msg, IO_WriteOnly) << TQ_UINT32 (ANS_ADMIN_ID) << adminID;
// Tell everyone about the new master
broadcastMessage (msg);
@@ -332,7 +332,7 @@ void KMessageServer::setAdmin (Q_UINT32 adminID)
//------------------------------------------- ID stuff
-Q_UINT32 KMessageServer::uniqueClientNumber() const
+TQ_UINT32 KMessageServer::uniqueClientNumber() const
{
return d->mUniqueClientNumber++;
}
@@ -345,16 +345,16 @@ void KMessageServer::broadcastMessage (const TQByteArray &msg)
(*iter)->send (msg);
}
-void KMessageServer::sendMessage (Q_UINT32 id, const TQByteArray &msg)
+void KMessageServer::sendMessage (TQ_UINT32 id, const TQByteArray &msg)
{
KMessageIO *client = findClient (id);
if (client)
client->send (msg);
}
-void KMessageServer::sendMessage (const TQValueList <Q_UINT32> &ids, const TQByteArray &msg)
+void KMessageServer::sendMessage (const TQValueList <TQ_UINT32> &ids, const TQByteArray &msg)
{
- for (TQValueListConstIterator <Q_UINT32> iter = ids.begin(); iter != ids.end(); ++iter)
+ for (TQValueListConstIterator <TQ_UINT32> iter = ids.begin(); iter != ids.end(); ++iter)
sendMessage (*iter, msg);
}
@@ -367,7 +367,7 @@ void KMessageServer::getReceivedMessage (const TQByteArray &msg)
}
//kdDebug(11001) << k_funcinfo << ": size=" << msg.size() << endl;
KMessageIO *client = (KMessageIO *) sender();
- Q_UINT32 clientID = client->id();
+ TQ_UINT32 clientID = client->id();
//TQByteArray *ta=new TQByteArray;
//ta->duplicate(msg);
@@ -395,7 +395,7 @@ void KMessageServer::processOneMessage ()
MessageBuffer *msg_buf = d->mMessageQueue.head();
- Q_UINT32 clientID = msg_buf->id;
+ TQ_UINT32 clientID = msg_buf->id;
TQBuffer in_buffer (msg_buf->data);
in_buffer.open (IO_ReadOnly);
TQDataStream in_stream (&in_buffer);
@@ -408,56 +408,56 @@ void KMessageServer::processOneMessage ()
bool unknown = false;
TQByteArray ttt=in_buffer.buffer();
- Q_UINT32 messageID;
+ TQ_UINT32 messageID;
in_stream >> messageID;
//kdDebug(11001) << k_funcinfo << ": got message with messageID=" << messageID << endl;
switch (messageID)
{
- case REQ_BROADCAST:
- out_stream << Q_UINT32 (MSG_BROADCAST) << clientID;
+ case RETQ_BROADCAST:
+ out_stream << TQ_UINT32 (MSG_BROADCAST) << clientID;
// FIXME, compiler bug?
- // this should be okay, since TQBuffer is subclass of QIODevice! :
+ // this should be okay, since TQBuffer is subclass of TQIODevice! :
// out_buffer.writeBlock (in_buffer.readAll());
- out_buffer.TQIODevice::writeBlock (in_buffer.readAll());
+ TQT_TQIODEVICE(&out_buffer)->writeBlock (in_buffer.readAll());
broadcastMessage (out_msg);
break;
- case REQ_FORWARD:
+ case RETQ_FORWARD:
{
- TQValueList <Q_UINT32> clients;
+ TQValueList <TQ_UINT32> clients;
in_stream >> clients;
- out_stream << Q_UINT32 (MSG_FORWARD) << clientID << clients;
+ out_stream << TQ_UINT32 (MSG_FORWARD) << clientID << clients;
// see above!
- out_buffer.TQIODevice::writeBlock (in_buffer.readAll());
+ TQT_TQIODEVICE(&out_buffer)->writeBlock (in_buffer.readAll());
sendMessage (clients, out_msg);
}
break;
- case REQ_CLIENT_ID:
- out_stream << Q_UINT32 (ANS_CLIENT_ID) << clientID;
+ case RETQ_CLIENT_ID:
+ out_stream << TQ_UINT32 (ANS_CLIENT_ID) << clientID;
sendMessage (clientID, out_msg);
break;
- case REQ_ADMIN_ID:
- out_stream << Q_UINT32 (ANS_ADMIN_ID) << d->mAdminID;
+ case RETQ_ADMIN_ID:
+ out_stream << TQ_UINT32 (ANS_ADMIN_ID) << d->mAdminID;
sendMessage (clientID, out_msg);
break;
- case REQ_ADMIN_CHANGE:
+ case RETQ_ADMIN_CHANGE:
if (clientID == d->mAdminID)
{
- Q_UINT32 newAdmin;
+ TQ_UINT32 newAdmin;
in_stream >> newAdmin;
setAdmin (newAdmin);
}
break;
- case REQ_REMOVE_CLIENT:
+ case RETQ_REMOVE_CLIENT:
if (clientID == d->mAdminID)
{
- TQValueList <Q_UINT32> client_list;
+ TQValueList <TQ_UINT32> client_list;
in_stream >> client_list;
- for (TQValueListIterator <Q_UINT32> iter = client_list.begin(); iter != client_list.end(); ++iter)
+ for (TQValueListIterator <TQ_UINT32> iter = client_list.begin(); iter != client_list.end(); ++iter)
{
KMessageIO *client = findClient (*iter);
if (client)
@@ -468,18 +468,18 @@ void KMessageServer::processOneMessage ()
}
break;
- case REQ_MAX_NUM_CLIENTS:
+ case RETQ_MAX_NUM_CLIENTS:
if (clientID == d->mAdminID)
{
- Q_INT32 maximum_clients;
+ TQ_INT32 maximum_clients;
in_stream >> maximum_clients;
setMaxClients (maximum_clients);
}
break;
- case REQ_CLIENT_LIST:
+ case RETQ_CLIENT_LIST:
{
- out_stream << Q_UINT32 (ANS_CLIENT_LIST) << clientIDs();
+ out_stream << TQ_UINT32 (ANS_CLIENT_LIST) << clientIDs();
sendMessage (clientID, out_msg);
}
break;
diff --git a/libkdegames/kgame/kmessageserver.h b/libkdegames/kgame/kmessageserver.h
index 3d0b1055..3a416a6b 100644
--- a/libkdegames/kgame/kmessageserver.h
+++ b/libkdegames/kgame/kmessageserver.h
@@ -73,53 +73,53 @@ class KMessageServerPrivate;
Here is a list of the messages the KMessageServer understands:
&lt;&lt; means, the value is inserted into the TQByteArray using TQDataStream. The
- messageIDs (REQ_BROADCAST, ...) are of type Q_UINT32.
+ messageIDs (RETQ_BROADCAST, ...) are of type TQ_UINT32.
- - TQByteArray << static_cast&lt;Q_UINT32>( REQ_BROADCAST ) << raw_data
+ - TQByteArray << static_cast&lt;TQ_UINT32>( RETQ_BROADCAST ) << raw_data
When the server receives this message, it sends the following message to
ALL connected clients (a broadcast), where the raw_data is left unchanged:
- TQByteArray << static_cast &lt;Q_UINT32>( MSG_BROADCAST ) << clientID << raw_data
- Q_UINT32 clientID; // the ID of the client that sent the broadcast request
+ TQByteArray << static_cast &lt;TQ_UINT32>( MSG_BROADCAST ) << clientID << raw_data
+ TQ_UINT32 clientID; // the ID of the client that sent the broadcast request
- - TQByteArray << static_cast&lt;Q_UINT32>( REQ_FORWARD ) << client_list << raw_data
- TQValueList &lt;Q_UINT32> client_list; // list of receivers
+ - TQByteArray << static_cast&lt;TQ_UINT32>( RETQ_FORWARD ) << client_list << raw_data
+ TQValueList &lt;TQ_UINT32> client_list; // list of tqreceivers
When the server receives this message, it sends the following message to
the clients in client_list:
- TQByteArray << static_cast&lt;Q_UINT32>( MSG_FORWARD ) << senderID << client_list << raw_data
- Q_UINT32 senderID; // the sender of the forward request
- TQValueList &lt;Q_UINT32> client_list; // a copy of the receiver list
+ TQByteArray << static_cast&lt;TQ_UINT32>( MSG_FORWARD ) << senderID << client_list << raw_data
+ TQ_UINT32 senderID; // the sender of the forward request
+ TQValueList &lt;TQ_UINT32> client_list; // a copy of the receiver list
Note: Every client receives the message as many times as he is in the client_list.
Note: Since the client_list is sent to all the clients, every client can see who else
- got the message. If you want to prevent this, send a single REQ_FORWARD
+ got the message. If you want to prevent this, send a single RETQ_FORWARD
message for every receiver.
- - TQByteArray << static_cast&lt;Q_UINT32>( REQ_CLIENT_ID )
+ - TQByteArray << static_cast&lt;TQ_UINT32>( RETQ_CLIENT_ID )
When the server receives this message, it sends the following message to
the asking client:
- TQByteArray << static_cast&lt;Q_UINT32>( ANS_CLIENT_ID ) << clientID
- Q_UINT32 clientID; // The ID of the client who asked for it
+ TQByteArray << static_cast&lt;TQ_UINT32>( ANS_CLIENT_ID ) << clientID
+ TQ_UINT32 clientID; // The ID of the client who asked for it
Note: This answer is also automatically sent to a new connected client, so that he
can store his ID. The ID of a client doesn't change during his lifetime, and is
unique for this KMessageServer.
- - TQByteArray << static_cast&lt;Q_UINT32>( REQ_ADMIN_ID )
+ - TQByteArray << static_cast&lt;TQ_UINT32>( RETQ_ADMIN_ID )
When the server receives this message, it sends the following message to
the asking client:
TQByteArray << ANS_ADMIN_ID << adminID
- Q_UINT32 adminID; // The ID of the admin
+ TQ_UINT32 adminID; // The ID of the admin
Note: This answer is also automatically sent to a new connected client, so that he
can see if he is the admin or not. It will also be sent to all connected clients
- when a new admin is set (see REQ_ADMIN_CHANGE).
+ when a new admin is set (see RETQ_ADMIN_CHANGE).
- - TQByteArray << static_cast&lt;Q_UINT32>( REQ_ADMIN_CHANGE ) << new_admin
- Q_UINT32 new_admin; // the ID of the new admin, or 0 for no admin
+ - TQByteArray << static_cast&lt;TQ_UINT32>( RETQ_ADMIN_CHANGE ) << new_admin
+ TQ_UINT32 new_admin; // the ID of the new admin, or 0 for no admin
When the server receives this message, it sets the admin to the new ID. If no client
with that ID exists, nothing happens. With new_admin == 0 no client is a admin.
@@ -127,8 +127,8 @@ class KMessageServerPrivate;
Note: The server sends a ANS_ADMIN_ID message to every connected client.
- - TQByteArray << static_cast&lt;Q_UINT32>( REQ_REMOVE_CLIENT ) << client_list
- TQValueList &lt;Q_UINT32> client_list; // The list of clients to be removed
+ - TQByteArray << static_cast&lt;TQ_UINT32>( RETQ_REMOVE_CLIENT ) << client_list
+ TQValueList &lt;TQ_UINT32> client_list; // The list of clients to be removed
When the server receives this message, it removes the clients with the ids stored in
client_list, disconnecting the connection to them.
@@ -137,22 +137,22 @@ class KMessageServerPrivate;
Note: If one of the clients is the admin himself, he will also be deleted.
Another client (if any left) will become the new admin.
- - TQByteArray << static_cast&lt;Q_UINT32>( REQ_MAX_NUM_CLIENTS ) << maximum_clients
- Q_INT32 maximum_clients; // The maximum of clients connected, or infinite if -1
+ - TQByteArray << static_cast&lt;TQ_UINT32>( RETQ_MAX_NUM_CLIENTS ) << maximum_clients
+ TQ_INT32 maximum_clients; // The maximum of clients connected, or infinite if -1
When the server receives this message, it limits the number of clients to the number given,
or sets it unlimited for maximum_clients == -1.
ONLY THE ADMIN CAN USE THIS MESSAGE!
Note: If there are already more clients, they are not affected. It only prevents new Clients
- to be added. To assure this limit, remove clients afterwards (REQ_REMOVE_CLIENT)
+ to be added. To assure this limit, remove clients afterwards (RETQ_REMOVE_CLIENT)
- - TQByteArray << static_cast&lt;Q_UINT32>( REQ_CLIENT_LIST )
+ - TQByteArray << static_cast&lt;TQ_UINT32>( RETQ_CLIENT_LIST )
When the server receives this message, it answers by sending a list of IDs of all the clients
that are connected at the moment. So it sends the following message to the asking client:
- TQByteArray << static_cast&lt;Q_UINT32>( ANS_CLIENT_LIST ) << clientList
- TQValueList &lt;Q_UINT32> clientList; // The IDs of the connected clients
+ TQByteArray << static_cast&lt;TQ_UINT32>( ANS_CLIENT_LIST ) << clientList
+ TQValueList &lt;TQ_UINT32> clientList; // The IDs of the connected clients
Note: This message is also sent to every new connected client, so that he knows the other
clients.
@@ -160,36 +160,37 @@ class KMessageServerPrivate;
There are two more messages that are sent from the server to the every client automatically
when a new client connects or a connection to a client is lost:
- TQByteArray << static_cast&lt;Q_UINT32>( EVNT_CLIENT_CONNECTED ) << clientID;
- Q_UINT32 clientID; // the ID of the new connected client
+ TQByteArray << static_cast&lt;TQ_UINT32>( EVNT_CLIENT_CONNECTED ) << clientID;
+ TQ_UINT32 clientID; // the ID of the new connected client
- TQByteArray << static_cast&lt;Q_UINT32>( EVNT_CLIENT_DISCONNECTED ) << clientID;
- Q_UINT32 clientID; // the ID of the client that lost the connection
- Q_UINT8 broken; // 1 if the network connection was closed, 0 if it was disconnected
+ TQByteArray << static_cast&lt;TQ_UINT32>( EVNT_CLIENT_DISCONNECTED ) << clientID;
+ TQ_UINT32 clientID; // the ID of the client that lost the connection
+ TQ_UINT8 broken; // 1 if the network connection was closed, 0 if it was disconnected
// on purpose
@author Andreas Beckermann <b_mann@gmx.de>, Burkhard Lehner <Burkhard.Lehner@gmx.de>
@version $Id$
*/
-class KMessageServer : public QObject
+class KMessageServer : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
MessageIDs for messages from a client to the message server.
*/
enum {
- REQ_BROADCAST = 1,
- REQ_FORWARD,
- REQ_CLIENT_ID,
- REQ_ADMIN_ID,
- REQ_ADMIN_CHANGE,
- REQ_REMOVE_CLIENT,
- REQ_MAX_NUM_CLIENTS,
- REQ_CLIENT_LIST,
- REQ_MAX_REQ = 0xffff };
+ RETQ_BROADCAST = 1,
+ RETQ_FORWARD,
+ RETQ_CLIENT_ID,
+ RETQ_ADMIN_ID,
+ RETQ_ADMIN_CHANGE,
+ RETQ_REMOVE_CLIENT,
+ RETQ_MAX_NUM_CLIENTS,
+ RETQ_CLIENT_LIST,
+ RETQ_MAX_REQ = 0xffff };
/**
* MessageIDs for messages from the message server to a client.
@@ -208,7 +209,7 @@ public:
/**
* Create a KGameNetwork object
**/
- KMessageServer(Q_UINT16 cookie = 42, TQObject* parent = 0);
+ KMessageServer(TQ_UINT16 cookie = 42, TQObject* tqparent = 0);
~KMessageServer();
@@ -226,7 +227,7 @@ public:
* system pick a free port
* @return true if it worked
*/
- bool initNetwork (Q_UINT16 port = 0);
+ bool initNetwork (TQ_UINT16 port = 0);
/**
* Returns the TCP/IP port number we are listening to for incoming connections.
@@ -234,7 +235,7 @@ public:
* especially necessary if you used 0 as port number in initNetwork().
* @return the port number
**/
- Q_UINT16 serverPort () const;
+ TQ_UINT16 serverPort () const;
/**
* Stops listening for connections. The already running connections are
@@ -325,14 +326,14 @@ public:
/**
* returns a list of the unique IDs of all clients.
**/
- TQValueList <Q_UINT32> clientIDs() const;
+ TQValueList <TQ_UINT32> clientIDs() const;
/**
* Find the @ref KMessageIO object to the given client number.
* @param no the client number to look for, or 0 to look for the admin
* @return address of the client, or 0 if no client with that number exists
**/
- KMessageIO *findClient (Q_UINT32 no) const;
+ KMessageIO *findClient (TQ_UINT32 no) const;
/**
* Returns the clientID of the admin, if there is a admin, 0 otherwise.
@@ -340,14 +341,14 @@ public:
* NOTE: Most often you don't need to know that id, since you can
* use clientID 0 to specify the admin.
**/
- Q_UINT32 adminID() const;
+ TQ_UINT32 adminID() const;
/**
* Sets the admin to a new client with the given ID.
* The old admin (if existed) and the new admin will get the ANS_ADMIN message.
* If you use 0 as new adminID, no client will be admin.
**/
- void setAdmin (Q_UINT32 adminID);
+ void setAdmin (TQ_UINT32 adminID);
//------------------------------ ID stuff
@@ -385,7 +386,7 @@ public:
* @ref findClient (id)->send(msg) manually, but this method checks for
* errors.
**/
- virtual void sendMessage (Q_UINT32 id, const TQByteArray &msg);
+ virtual void sendMessage (TQ_UINT32 id, const TQByteArray &msg);
/**
* Sends a message to a list of clients. Their ID is given in ids. If
@@ -394,7 +395,7 @@ public:
* This is just a convenience method. You could also iterate over the
* list of IDs.
**/
- virtual void sendMessage (const TQValueList <Q_UINT32> &ids, const TQByteArray &msg);
+ virtual void sendMessage (const TQValueList <TQ_UINT32> &ids, const TQByteArray &msg);
protected slots:
/**
@@ -448,7 +449,7 @@ signals:
* @param clientID the ID of the KMessageIO object that received the message
* @param unknown true, if the message type is not known by the KMessageServer
**/
- void messageReceived (const TQByteArray &data, Q_UINT32 clientID, bool &unknown);
+ void messageReceived (const TQByteArray &data, TQ_UINT32 clientID, bool &unknown);
protected:
/**
@@ -456,7 +457,7 @@ protected:
* incremented after every call so if you need the id twice you have to save
* it anywhere. It's currently used to initialize newly connected clints only.
**/
- Q_UINT32 uniqueClientNumber() const;
+ TQ_UINT32 uniqueClientNumber() const;
private:
KMessageServerPrivate* d;
@@ -468,17 +469,18 @@ private:
connections.
NOTE: This has to be here in the header file, because it is a subclass from
- TQObject and has to go through the moc.
+ TQObject and has to go through the tqmoc.
@short An internal class for KServerSocket
@author Burkhard Lehner <Burkhard.Lehner@gmx.de>
*/
-class KMessageServerSocket : public QServerSocket
+class KMessageServerSocket : public TQServerSocket
{
Q_OBJECT
+ TQ_OBJECT
public:
- KMessageServerSocket (Q_UINT16 port, TQObject *parent = 0);
+ KMessageServerSocket (TQ_UINT16 port, TQObject *tqparent = 0);
~KMessageServerSocket ();
void newConnection (int socket);
diff --git a/libkdegames/kgame/kplayer.cpp b/libkdegames/kgame/kplayer.cpp
index fdde20d9..adc893ff 100644
--- a/libkdegames/kgame/kplayer.cpp
+++ b/libkdegames/kgame/kplayer.cpp
@@ -46,7 +46,7 @@ public:
mNetworkPlayer = 0;
}
- Q_UINT32 mId;
+ TQ_UINT32 mId;
bool mVirtual; // virtual player
int mPriority; // tag for replacement
@@ -55,8 +55,8 @@ public:
KGamePropertyHandler mProperties;
// Playerdata
- KGamePropertyQString mName;
- KGamePropertyQString mGroup;
+ KGamePropertyTQString mName;
+ KGamePropertyTQString mGroup;
};
KPlayer::KPlayer() : TQObject(0,0)
@@ -125,7 +125,7 @@ KPlayer::~KPlayer()
// kdDebug(11001) << k_funcinfo << " done" << endl;
}
-bool KPlayer::forwardMessage(TQDataStream &msg,int msgid,Q_UINT32 receiver,Q_UINT32 sender)
+bool KPlayer::forwardMessage(TQDataStream &msg,int msgid,TQ_UINT32 receiver,TQ_UINT32 sender)
{
if (!isActive())
{
@@ -139,7 +139,7 @@ bool KPlayer::forwardMessage(TQDataStream &msg,int msgid,Q_UINT32 receiver,Q_UIN
return game()->sendSystemMessage(msg,msgid,receiver,sender);
}
-bool KPlayer::forwardInput(TQDataStream &msg,bool transmit,Q_UINT32 sender)
+bool KPlayer::forwardInput(TQDataStream &msg,bool transmit,TQ_UINT32 sender)
{
if (!isActive())
{
@@ -173,7 +173,7 @@ bool KPlayer::forwardInput(TQDataStream &msg,bool transmit,Q_UINT32 sender)
}
}
-void KPlayer::setId(Q_UINT32 newid)
+void KPlayer::setId(TQ_UINT32 newid)
{
// Needs to be after the sendProcess
d->mId=newid;
@@ -192,7 +192,7 @@ void KPlayer::setName(const TQString& name)
const TQString& KPlayer::name() const
{ return d->mName.value(); }
-Q_UINT32 KPlayer::id() const
+TQ_UINT32 KPlayer::id() const
{ return d->mId; }
KGamePropertyHandler * KPlayer::dataHandler()
@@ -313,7 +313,7 @@ bool KPlayer::setTurn(bool b, bool exclusive)
bool KPlayer::load(TQDataStream &stream)
{
- Q_INT32 id,priority;
+ TQ_INT32 id,priority;
stream >> id >> priority;
setId(id);
setNetworkPriority(priority);
@@ -322,7 +322,7 @@ bool KPlayer::load(TQDataStream &stream)
//FIXME: maybe set all properties setEmitSignal(false) before?
d->mProperties.load(stream);
- Q_INT16 cookie;
+ TQ_INT16 cookie;
stream >> cookie;
if (cookie==KPLAYER_LOAD_COOKIE)
{
@@ -339,18 +339,18 @@ bool KPlayer::load(TQDataStream &stream)
bool KPlayer::save(TQDataStream &stream)
{
- stream << (Q_INT32)id() << (Q_INT32)networkPriority();
+ stream << (TQ_INT32)id() << (TQ_INT32)networkPriority();
d->mProperties.save(stream);
- stream << (Q_INT16)KPLAYER_LOAD_COOKIE;
+ stream << (TQ_INT16)KPLAYER_LOAD_COOKIE;
//emit signalSave(stream);
return true;
}
-void KPlayer::networkTransmission(TQDataStream &stream,int msgid,Q_UINT32 sender)
+void KPlayer::networkTransmission(TQDataStream &stream,int msgid,TQ_UINT32 sender)
{
//kdDebug(11001) << k_funcinfo ": msgid=" << msgid << " sender=" << sender << " we are=" << id() << endl;
// PlayerProperties processed
@@ -388,7 +388,7 @@ void KPlayer::networkTransmission(TQDataStream &stream,int msgid,Q_UINT32 sender
KGamePropertyBase* KPlayer::findProperty(int id) const
{
- return d->mProperties.find(id);
+ return d->mProperties.tqfind(id);
}
bool KPlayer::addProperty(KGamePropertyBase* data)
diff --git a/libkdegames/kgame/kplayer.h b/libkdegames/kgame/kplayer.h
index a2d78929..7ad23abc 100644
--- a/libkdegames/kgame/kplayer.h
+++ b/libkdegames/kgame/kplayer.h
@@ -58,7 +58,7 @@ class KPlayerPrivate;
* you gain a *very* big advantage: you can exchange a KGameIO whenever you
* want! You can e.g. remove the KGameIO of a local (human) player and just
* replace it by a computerIO on the fly! So from that point on all playerInputs
- * are done by the computerIO instead of the human player. You also can replace
+ * are done by the computerIO instead of the human player. You also can tqreplace
* all network players by computer players when the network connection is broken
* or a player wants to quit.
* So remember: use KGameIO whenever possible! A KPlayer should just
@@ -66,9 +66,10 @@ class KPlayerPrivate;
* functions which are shared by all of your KGameIOs.
*
*/
-class KDE_EXPORT KPlayer : public QObject
+class KDE_EXPORT KPlayer : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
typedef TQPtrList<KGameIO> KGameIOList;
@@ -184,14 +185,14 @@ public:
*
* @return the player id
*/
- Q_UINT32 id() const;
+ TQ_UINT32 id() const;
/* Set the players id. This is done automatically by
* the game object when adding a new player!
*
* @param i the player id
*/
- void setId(Q_UINT32 i);
+ void setId(TQ_UINT32 i);
/**
* Returns the user defined id of the player
@@ -333,12 +334,12 @@ public:
* KGame::playerInput() (if player=false, ie the message *was* sent through
* KGame::sendPlayerInput).
*/
- virtual bool forwardInput(TQDataStream &msg,bool transmit=true, Q_UINT32 sender=0);
+ virtual bool forwardInput(TQDataStream &msg,bool transmit=true, TQ_UINT32 sender=0);
/**
* Forwards Message to the game object..internal use only
*/
- virtual bool forwardMessage(TQDataStream &msg,int msgid,Q_UINT32 receiver=0,Q_UINT32 sender=0);
+ virtual bool forwardMessage(TQDataStream &msg,int msgid,TQ_UINT32 receiver=0,TQ_UINT32 sender=0);
// Game logic
/**
@@ -390,7 +391,7 @@ public:
* @param stream The message itself
* @param sender
**/
- void networkTransmission(TQDataStream &stream,int msgid,Q_UINT32 sender);
+ void networkTransmission(TQDataStream &stream,int msgid,TQ_UINT32 sender);
/**
* Searches for a property of the player given its id.
@@ -430,7 +431,7 @@ signals:
* means probably a user message. Connecting to this signal
* allowed to process it.
*/
- void signalNetworkData(int msgid, const TQByteArray& buffer, Q_UINT32 sender, KPlayer *me);
+ void signalNetworkData(int msgid, const TQByteArray& buffer, TQ_UINT32 sender, KPlayer *me);
/**
* This signal is emmited if a player property changes its value and
diff --git a/libkdegames/kgame/messages.txt b/libkdegames/kgame/messages.txt
index 151196d5..a2b58880 100644
--- a/libkdegames/kgame/messages.txt
+++ b/libkdegames/kgame/messages.txt
@@ -82,7 +82,7 @@ IdRemovePlayer Q_INT16 playerid
IdError Q_INT32 errorcode
QString errortext
-IdGameStatus Q_INT32 status
+IdGametqStatus Q_INT32 status
IdPlayerProperty Q_INT16 propertyId
user defined -> the property