summaryrefslogtreecommitdiffstats
path: root/lskat
diff options
context:
space:
mode:
Diffstat (limited to 'lskat')
-rw-r--r--lskat/lskat/KChildConnect.cpp16
-rw-r--r--lskat/lskat/KChildConnect.h12
-rw-r--r--lskat/lskat/KEInput.cpp36
-rw-r--r--lskat/lskat/KEInput.h20
-rw-r--r--lskat/lskat/KEMessage.cpp70
-rw-r--r--lskat/lskat/KEMessage.h56
-rw-r--r--lskat/lskat/KInputChildProcess.cpp10
-rw-r--r--lskat/lskat/KInputChildProcess.h4
-rw-r--r--lskat/lskat/KInteractiveConnect.cpp2
-rw-r--r--lskat/lskat/KInteractiveConnect.h2
-rw-r--r--lskat/lskat/KProcessConnect.cpp22
-rw-r--r--lskat/lskat/KProcessConnect.h6
-rw-r--r--lskat/lskat/KRSocket.cpp18
-rw-r--r--lskat/lskat/KRSocket.h4
-rw-r--r--lskat/lskat/KRemoteConnect.cpp54
-rw-r--r--lskat/lskat/KRemoteConnect.h12
-rw-r--r--lskat/lskat/lskat.cpp226
-rw-r--r--lskat/lskat/lskat.h16
-rw-r--r--lskat/lskat/lskatdoc.cpp62
-rw-r--r--lskat/lskat/lskatdoc.h82
-rw-r--r--lskat/lskat/lskatview.cpp316
-rw-r--r--lskat/lskat/lskatview.h44
-rw-r--r--lskat/lskat/main.cpp2
-rw-r--r--lskat/lskat/msgdlg.cpp24
-rw-r--r--lskat/lskat/msgdlg.h12
-rw-r--r--lskat/lskat/namedlg.cpp44
-rw-r--r--lskat/lskat/namedlg.h34
-rw-r--r--lskat/lskat/networkdlg.cpp32
-rw-r--r--lskat/lskat/networkdlg.h12
-rw-r--r--lskat/lskatproc/KChildConnect.cpp20
-rw-r--r--lskat/lskatproc/KChildConnect.h12
-rw-r--r--lskat/lskatproc/KEMessage.cpp70
-rw-r--r--lskat/lskatproc/KEMessage.h56
-rw-r--r--lskat/lskatproc/KInputChildProcess.cpp10
-rw-r--r--lskat/lskatproc/KInputChildProcess.h4
-rw-r--r--lskat/lskatproc/lskatproc.cpp34
36 files changed, 728 insertions, 728 deletions
diff --git a/lskat/lskat/KChildConnect.cpp b/lskat/lskat/KChildConnect.cpp
index 61931693..35ac9408 100644
--- a/lskat/lskat/KChildConnect.cpp
+++ b/lskat/lskat/KChildConnect.cpp
@@ -20,7 +20,7 @@
#include "KChildConnect.moc"
KChildConnect::KChildConnect()
- : QObject(0,0)
+ : TQObject(0,0)
{
input_pending=false;
inputbuffer="";
@@ -38,14 +38,14 @@ KR_STATUS KChildConnect::QueryStatus()
// Communication with process
bool KChildConnect::SendMsg(KEMessage *msg)
{
- QString sendstring=msg->ToString();
+ TQString sendstring=msg->ToString();
// Debug only
- if (msg->HasKey(QCString("KLogSendMsg")))
+ if (msg->HasKey(TQCString("KLogSendMsg")))
{
char *p;
int size;
FILE *fp;
- msg->GetData(QCString("KLogSendMsg"),p,size);
+ msg->GetData(TQCString("KLogSendMsg"),p,size);
if (p && (fp=fopen(p,"a")) )
{
fprintf(fp,"------------------------------------\n");
@@ -58,7 +58,7 @@ bool KChildConnect::SendMsg(KEMessage *msg)
}
// Send string to parent
-bool KChildConnect::Send(QString str)
+bool KChildConnect::Send(TQString str)
{
if (!str || str.length()<1) return true; // no need to send crap
printf("%s",str.latin1());
@@ -66,11 +66,11 @@ bool KChildConnect::Send(QString str)
return true;
}
-void KChildConnect::Receive(QString input)
+void KChildConnect::Receive(TQString input)
{
// Cut out CR
int len,pos;
- QString tmp;
+ TQString tmp;
// Call us recursive until there are no CR left
@@ -104,7 +104,7 @@ void KChildConnect::Receive(QString input)
char *it;
for (it=inputcache.first();it!=0;it=inputcache.next())
{
- msg->AddString(QCString(it));
+ msg->AddString(TQCString(it));
}
// printf("+- CHILDprocess:: GOT MESSAGE::Emmiting slotReceiveMsg\n");
diff --git a/lskat/lskat/KChildConnect.h b/lskat/lskat/KChildConnect.h
index d90c62ca..b8e48fcd 100644
--- a/lskat/lskat/KChildConnect.h
+++ b/lskat/lskat/KChildConnect.h
@@ -17,8 +17,8 @@
#ifndef _KCHILDCONNECT_H_
#define _KCHILDCONNECT_H_
-#include <qobject.h>
-#include <qstrlist.h>
+#include <tqobject.h>
+#include <tqstrlist.h>
#include "KEMessage.h"
@@ -27,20 +27,20 @@ class KChildConnect: public QObject
Q_OBJECT
protected:
- QStrList inputcache;
+ TQStrList inputcache;
bool input_pending;
- QString inputbuffer;
+ TQString inputbuffer;
int ID;
public:
KChildConnect();
~KChildConnect();
- void Receive(QString input);
+ void Receive(TQString input);
int QueryID();
void SetID(int id);
virtual bool SendMsg(KEMessage *msg);
- virtual bool Send(QString str);
+ virtual bool Send(TQString str);
virtual KR_STATUS QueryStatus();
public slots:
diff --git a/lskat/lskat/KEInput.cpp b/lskat/lskat/KEInput.cpp
index b5765d00..091bf4e1 100644
--- a/lskat/lskat/KEInput.cpp
+++ b/lskat/lskat/KEInput.cpp
@@ -22,8 +22,8 @@
#include "KEInput.moc"
-KEInput::KEInput(QObject * parent)
- : QObject(parent,0)
+KEInput::KEInput(TQObject * parent)
+ : TQObject(parent,0)
{
number_of_inputs=0;
locked=FALSE;
@@ -127,22 +127,22 @@ bool KEInput::SetInputDevice(int no, KG_INPUTTYPE type,KEMessage *msg)
switch(QueryType(no))
{
case KG_INPUTTYPE_INTERACTIVE:
- connect(playerArray[no].QueryInteractiveConnect(),SIGNAL(signalReceiveMsg(KEMessage *,int )),
- this,SLOT(slotSetInput(KEMessage *,int )));
- connect(playerArray[no].QueryInteractiveConnect(),SIGNAL(signalPrepareMove(KEMessage *,KG_INPUTTYPE)),
- this,SLOT(slotPrepareMove(KEMessage *,KG_INPUTTYPE)));
+ connect(playerArray[no].QueryInteractiveConnect(),TQT_SIGNAL(signalReceiveMsg(KEMessage *,int )),
+ this,TQT_SLOT(slotSetInput(KEMessage *,int )));
+ connect(playerArray[no].QueryInteractiveConnect(),TQT_SIGNAL(signalPrepareMove(KEMessage *,KG_INPUTTYPE)),
+ this,TQT_SLOT(slotPrepareMove(KEMessage *,KG_INPUTTYPE)));
break;
case KG_INPUTTYPE_REMOTE:
- connect(playerArray[no].QueryRemoteConnect(),SIGNAL(signalReceiveMsg(KEMessage *,int )),
- this,SLOT(slotSetInput(KEMessage *,int )));
- connect(playerArray[no].QueryRemoteConnect(),SIGNAL(signalPrepareMove(KEMessage *,KG_INPUTTYPE)),
- this,SLOT(slotPrepareMove(KEMessage *,KG_INPUTTYPE)));
+ connect(playerArray[no].QueryRemoteConnect(),TQT_SIGNAL(signalReceiveMsg(KEMessage *,int )),
+ this,TQT_SLOT(slotSetInput(KEMessage *,int )));
+ connect(playerArray[no].QueryRemoteConnect(),TQT_SIGNAL(signalPrepareMove(KEMessage *,KG_INPUTTYPE)),
+ this,TQT_SLOT(slotPrepareMove(KEMessage *,KG_INPUTTYPE)));
break;
case KG_INPUTTYPE_PROCESS:
- connect(playerArray[no].QueryProcessConnect(),SIGNAL(signalReceiveMsg(KEMessage *,int )),
- this,SLOT(slotSetInput(KEMessage *,int )));
- connect(playerArray[no].QueryProcessConnect(),SIGNAL(signalPrepareMove(KEMessage *,KG_INPUTTYPE)),
- this,SLOT(slotPrepareMove(KEMessage *,KG_INPUTTYPE)));
+ connect(playerArray[no].QueryProcessConnect(),TQT_SIGNAL(signalReceiveMsg(KEMessage *,int )),
+ this,TQT_SLOT(slotSetInput(KEMessage *,int )));
+ connect(playerArray[no].QueryProcessConnect(),TQT_SIGNAL(signalPrepareMove(KEMessage *,KG_INPUTTYPE)),
+ this,TQT_SLOT(slotPrepareMove(KEMessage *,KG_INPUTTYPE)));
break;
default:
break;
@@ -189,8 +189,8 @@ bool KEInput::Next(int number, bool force)
{
// delay non interactive move to allow interactive inout
if (cTimer) delete cTimer; // Ouch...
- cTimer=new QTimer(this);
- connect(cTimer,SIGNAL(timeout()),this,SLOT(slotTimerNextRemote()));
+ cTimer=new TQTimer(this);
+ connect(cTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(slotTimerNextRemote()));
cTimer->start(K_INPUT_DELAY,TRUE);
}
else
@@ -203,8 +203,8 @@ bool KEInput::Next(int number, bool force)
QueryType(previous_input)!=KG_INPUTTYPE_INTERACTIVE)
{
// delay non interactive move to allow interactive inout
- cTimer=new QTimer(this);
- connect(cTimer,SIGNAL(timeout()),this,SLOT(slotTimerNextProcess()));
+ cTimer=new TQTimer(this);
+ connect(cTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(slotTimerNextProcess()));
cTimer->start(K_INPUT_DELAY,TRUE);
}
else
diff --git a/lskat/lskat/KEInput.h b/lskat/lskat/KEInput.h
index e2f3ef8b..4e83f36a 100644
--- a/lskat/lskat/KEInput.h
+++ b/lskat/lskat/KEInput.h
@@ -17,10 +17,10 @@
#ifndef _KEINPUT_H_
#define _KEINPUT_H_
-#include <qptrlist.h>
-#include <qobject.h>
-#include <qtimer.h>
-#include <qmemarray.h>
+#include <tqptrlist.h>
+#include <tqobject.h>
+#include <tqtimer.h>
+#include <tqmemarray.h>
#include "KConnectEntry.h"
#include "KRemoteConnect.h"
#include "KProcessConnect.h"
@@ -38,15 +38,15 @@ class KEInput : public QObject
int previous_input,next_input;
bool locked;
// KEMessage *mMsg;
- QTimer *cTimer;
+ TQTimer *cTimer;
- QPtrList<KRemoteConnect> remoteList;
- QPtrList<KProcessConnect> computerList;
- QPtrList<KInteractiveConnect> interactiveList;
- QMemArray<KConnectEntry> playerArray;
+ TQPtrList<KRemoteConnect> remoteList;
+ TQPtrList<KProcessConnect> computerList;
+ TQPtrList<KInteractiveConnect> interactiveList;
+ TQMemArray<KConnectEntry> playerArray;
public:
- KEInput(QObject * parent=0);
+ KEInput(TQObject * parent=0);
~KEInput();
int QueryNumberOfInputs();
int QueryNext();
diff --git a/lskat/lskat/KEMessage.cpp b/lskat/lskat/KEMessage.cpp
index 9d3d3d3f..38cd2e8d 100644
--- a/lskat/lskat/KEMessage.cpp
+++ b/lskat/lskat/KEMessage.cpp
@@ -19,7 +19,7 @@
#include <stdlib.h>
#include "KEMessage.h"
-void KEMessage::AddEntry(QString key,KMessageEntry *entry)
+void KEMessage::AddEntry(TQString key,KMessageEntry *entry)
{
// printf(" AddingEntry: %s with data field %p\n",(char *)key,entry->QueryData());
if (!entry) return ;
@@ -27,7 +27,7 @@ void KEMessage::AddEntry(QString key,KMessageEntry *entry)
keys.append(key.latin1());
}
-void KEMessage::AddDataType(QString key,int size,const char *data,KGM_TYPE type)
+void KEMessage::AddDataType(TQString key,int size,const char *data,KGM_TYPE type)
{
// printf("AddDataType for %s size=%d\n",(const char *)key,size);
if (size<=0) return ;
@@ -37,28 +37,28 @@ void KEMessage::AddDataType(QString key,int size,const char *data,KGM_TYPE type)
AddEntry(key,entry);
}
-void KEMessage::AddData(QString key,short data)
+void KEMessage::AddData(TQString key,short data)
{
AddDataType(key,sizeof(short),(char *)&data,KGM_TYPE_SHORT);
}
-void KEMessage::AddData(QString key,long data)
+void KEMessage::AddData(TQString key,long data)
{
AddDataType(key,sizeof(long),(char *)&data,KGM_TYPE_LONG);
}
-void KEMessage::AddData(QString key,float data)
+void KEMessage::AddData(TQString key,float data)
{
AddDataType(key,sizeof(float),(char *)&data,KGM_TYPE_FLOAT);
}
-void KEMessage::AddData(QString key, const char *data,int size)
+void KEMessage::AddData(TQString key, const char *data,int size)
{
if (size<0) size=strlen(data)+1; // +1 for 0 Byte
AddDataType(key,size,data,KGM_TYPE_DATA);
}
-KGM_TYPE KEMessage::QueryType(QString key)
+KGM_TYPE KEMessage::QueryType(TQString key)
{
KMessageEntry *entry;
entry=dict.find(key);
@@ -66,7 +66,7 @@ KGM_TYPE KEMessage::QueryType(QString key)
return entry->QueryType();
}
-bool KEMessage::HasKey(QString key)
+bool KEMessage::HasKey(TQString key)
{
KMessageEntry *entry;
entry=dict.find(key);
@@ -74,7 +74,7 @@ bool KEMessage::HasKey(QString key)
return true;
}
-bool KEMessage::GetData(QString key,short &s)
+bool KEMessage::GetData(TQString key,short &s)
{
short *result;
KMessageEntry *entry;
@@ -87,7 +87,7 @@ bool KEMessage::GetData(QString key,short &s)
return true;
}
-bool KEMessage::GetData(QString key,long &l)
+bool KEMessage::GetData(TQString key,long &l)
{
long *result;
KMessageEntry *entry;
@@ -99,7 +99,7 @@ bool KEMessage::GetData(QString key,long &l)
return true;
}
-bool KEMessage::GetData(QString key,float &f)
+bool KEMessage::GetData(TQString key,float &f)
{
float *result;
KMessageEntry *entry;
@@ -112,7 +112,7 @@ bool KEMessage::GetData(QString key,float &f)
return true;
}
-bool KEMessage::GetData(QString key,char * &c,int &size)
+bool KEMessage::GetData(TQString key,char * &c,int &size)
{
KMessageEntry *entry;
entry=dict.find(key);
@@ -123,13 +123,13 @@ bool KEMessage::GetData(QString key,char * &c,int &size)
return true;
}
-QString KEMessage::EntryToString(char *key,KMessageEntry *entry)
+TQString KEMessage::EntryToString(char *key,KMessageEntry *entry)
{
- QString s,tmp;
+ TQString s,tmp;
int size,i;
KGM_TYPE type;
char *data;
- s=QCString("");
+ s=TQCString("");
if (!entry) return s;
size=entry->QuerySize();
type=entry->QueryType();
@@ -142,7 +142,7 @@ QString KEMessage::EntryToString(char *key,KMessageEntry *entry)
size,KEMESSAGE_SEP,
(int)type,KEMESSAGE_SEP);
*/
- tmp=QCString(key);
+ tmp=TQCString(key);
s+=tmp;
s+=KEMESSAGE_SEP;
tmp.sprintf("%d",size);
@@ -168,31 +168,31 @@ QString KEMessage::EntryToString(char *key,KMessageEntry *entry)
return s;
}
-QString KEMessage::StringToEntry(QString str,KMessageEntry *entry)
+TQString KEMessage::StringToEntry(TQString str,KMessageEntry *entry)
{
int pos,oldpos,cnt,len;
- QString key,size,type,data;
+ TQString key,size,type,data;
const char *p;
char *q;
char c;
len=KEMESSAGE_SEP.length();
- if (!entry) return QString();
+ if (!entry) return TQString();
pos=str.find(KEMESSAGE_SEP,0);
- if (pos<0) return QString(); // wrong format
+ if (pos<0) return TQString(); // wrong format
key=str.left(pos);
oldpos=pos;
pos=str.find(KEMESSAGE_SEP,oldpos+len);
- if (pos<0) return QString(); // wrong format
+ if (pos<0) return TQString(); // wrong format
size=str.mid(oldpos+len,pos-oldpos-len);
oldpos=pos;
pos=str.find(KEMESSAGE_SEP,oldpos+len);
- if (pos<0) return QString(); // wrong format
+ if (pos<0) return TQString(); // wrong format
type=str.mid(oldpos+len,pos-oldpos-len);
@@ -205,10 +205,10 @@ QString KEMessage::StringToEntry(QString str,KMessageEntry *entry)
// I hope this works with unicode strings as well
p=data.latin1();
q=(char *)calloc(data.length()/2,sizeof(char));
- if (!q) return QString();
+ if (!q) return TQString();
for(pos=0;pos<cnt;pos++)
{
- if (pos*2+1>(int)data.length()) return QString(); // SEVERE ERROR
+ if (pos*2+1>(int)data.length()) return TQString(); // SEVERE ERROR
c=*(p+2*pos)-'a' | ((*(p+2*pos+1)-'a')<<4);
q[pos]=c;
}
@@ -218,35 +218,35 @@ QString KEMessage::StringToEntry(QString str,KMessageEntry *entry)
return key;
}
-QString KEMessage::ToString()
+TQString KEMessage::ToString()
{
- QString s;
+ TQString s;
KMessageEntry *entry;
char *it;
s=KEMESSAGE_HEAD+KEMESSAGE_CR;
for (it=keys.first();it!=0;it=keys.next())
{
- entry=dict.find(QCString(it));
+ entry=dict.find(TQCString(it));
s+=EntryToString(it,entry);
}
s+=KEMESSAGE_TAIL+KEMESSAGE_CR;
return s;
}
-bool KEMessage::AddString(QString s)
+bool KEMessage::AddString(TQString s)
{
// break s into key,size and data
- QString key;
+ TQString key;
KMessageEntry *entry=new KMessageEntry;
key=StringToEntry(s,entry);
if (!key) return false;
AddEntry(key,entry);
return true;
}
-bool KEMessage::AddStringMsg(QString str)
+bool KEMessage::AddStringMsg(TQString str)
{
bool result;
- QString data;
+ TQString data;
int pos,oldpos,len;
len=KEMESSAGE_CR.length();
@@ -277,7 +277,7 @@ void KEMessage::RemoveAll()
dict.clear();
}
-void KEMessage::Remove(QString key)
+void KEMessage::Remove(TQString key)
{
keys.remove(key.latin1());
dict.remove(key);
@@ -287,7 +287,7 @@ uint KEMessage::QueryNumberOfKeys()
{
return keys.count();
}
-QStrList *KEMessage::QueryKeys()
+TQStrList *KEMessage::QueryKeys()
{
return &keys;
}
@@ -315,10 +315,10 @@ KEMessage &KEMessage::operator=(KEMessage &msg)
// printf("Assigning = KEMessage from %p to %p\n",&msg,this);
for (it=msg.keys.first();it!=0;it=msg.keys.next())
{
- entry=msg.dict.find(QCString(it));
+ entry=msg.dict.find(TQCString(it));
newentry=new KMessageEntry;
*newentry=*entry;
- AddEntry(QCString(it),newentry);
+ AddEntry(TQCString(it),newentry);
}
// return *newmsg;
diff --git a/lskat/lskat/KEMessage.h b/lskat/lskat/KEMessage.h
index 0a1913cc..9e4d6912 100644
--- a/lskat/lskat/KEMessage.h
+++ b/lskat/lskat/KEMessage.h
@@ -18,44 +18,44 @@
#define _KEMESSAGE_H_
#include <string.h>
-#include <qstring.h>
-#include <qstrlist.h>
-#include <qdict.h>
+#include <tqstring.h>
+#include <tqstrlist.h>
+#include <tqdict.h>
#include "KMessageEntry.h"
-#define KEMESSAGE_HEAD QString(QCString("BEGIN_V1000"))
-#define KEMESSAGE_TAIL QString(QCString("END_V1000"))
-#define KEMESSAGE_CR QString(QCString("\n"))
-#define KEMESSAGE_SEP QString(QCString(":::"))
+#define KEMESSAGE_HEAD TQString(TQCString("BEGIN_V1000"))
+#define KEMESSAGE_TAIL TQString(TQCString("END_V1000"))
+#define KEMESSAGE_CR TQString(TQCString("\n"))
+#define KEMESSAGE_SEP TQString(TQCString(":::"))
class KEMessage
{
private:
- QStrList keys;
- QDict<KMessageEntry> dict;
+ TQStrList keys;
+ TQDict<KMessageEntry> dict;
protected:
- void AddEntry(QString key,KMessageEntry *entry);
+ void AddEntry(TQString key,KMessageEntry *entry);
public:
- QStrList *QueryKeys();
+ TQStrList *QueryKeys();
uint QueryNumberOfKeys();
- void AddDataType(QString key,int size,const char *data,KGM_TYPE type);
- void AddData(QString key,short data);
- void AddData(QString key,long data);
- void AddData(QString key,float data);
- void AddData(QString key,const char *data,int size=-1);
- bool GetData(QString key,short &s);
- bool GetData(QString key,long &l);
- bool GetData(QString key,float &f);
- bool GetData(QString key,char * &c,int &size);
- bool HasKey(QString key);
- void Remove(QString key);
- KGM_TYPE QueryType(QString key);
- QString ToString();
- QString EntryToString(char *key,KMessageEntry *entry);
- QString StringToEntry(QString str,KMessageEntry *entry);
- bool AddString(QString s);
- bool AddStringMsg(QString str);
+ void AddDataType(TQString key,int size,const char *data,KGM_TYPE type);
+ void AddData(TQString key,short data);
+ void AddData(TQString key,long data);
+ void AddData(TQString key,float data);
+ void AddData(TQString key,const char *data,int size=-1);
+ bool GetData(TQString key,short &s);
+ bool GetData(TQString key,long &l);
+ bool GetData(TQString key,float &f);
+ bool GetData(TQString key,char * &c,int &size);
+ bool HasKey(TQString key);
+ void Remove(TQString key);
+ KGM_TYPE QueryType(TQString key);
+ TQString ToString();
+ TQString EntryToString(char *key,KMessageEntry *entry);
+ TQString StringToEntry(TQString str,KMessageEntry *entry);
+ bool AddString(TQString s);
+ bool AddStringMsg(TQString str);
void RemoveAll();
~KEMessage();
KEMessage();
diff --git a/lskat/lskat/KInputChildProcess.cpp b/lskat/lskat/KInputChildProcess.cpp
index fb6e743a..bd78235c 100644
--- a/lskat/lskat/KInputChildProcess.cpp
+++ b/lskat/lskat/KInputChildProcess.cpp
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <qstring.h>
+#include <tqstring.h>
#include "KInputChildProcess.h"
#include "KInputChildProcess.moc"
@@ -21,7 +21,7 @@ KInputChildProcess::~KInputChildProcess()
delete childConnect;
}
KInputChildProcess::KInputChildProcess(int size_buffer)
- : QObject(0,0)
+ : TQObject(0,0)
{
buffersize=size_buffer;
if (buffersize<1) buffersize=1024;
@@ -32,12 +32,12 @@ KInputChildProcess::KInputChildProcess(int size_buffer)
bool KInputChildProcess::exec()
{
int pos;
- QString s;
+ TQString s;
childConnect=new KChildConnect;
if (!childConnect) return false;
- connect(childConnect,SIGNAL(signalReceiveMsg(KEMessage *,int)),
- this,SLOT(slotReceiveMsg(KEMessage *,int)));
+ connect(childConnect,TQT_SIGNAL(signalReceiveMsg(KEMessage *,int)),
+ this,TQT_SLOT(slotReceiveMsg(KEMessage *,int)));
do
{
// Wait for input
diff --git a/lskat/lskat/KInputChildProcess.h b/lskat/lskat/KInputChildProcess.h
index b4694df5..2f964e71 100644
--- a/lskat/lskat/KInputChildProcess.h
+++ b/lskat/lskat/KInputChildProcess.h
@@ -17,7 +17,7 @@
#ifndef _KINPUTCHILDPROCESS_H_
#define _KINPUTCHILDPROCESS_H_
-#include <qobject.h>
+#include <tqobject.h>
#include "KEMessage.h"
#include "KChildConnect.h"
@@ -28,7 +28,7 @@ class KInputChildProcess : public QObject
private:
char *buffer;
- QString inputbuffer;
+ TQString inputbuffer;
int buffersize;
bool terminateChild;
protected:
diff --git a/lskat/lskat/KInteractiveConnect.cpp b/lskat/lskat/KInteractiveConnect.cpp
index e95dcbe1..d0fe3437 100644
--- a/lskat/lskat/KInteractiveConnect.cpp
+++ b/lskat/lskat/KInteractiveConnect.cpp
@@ -73,7 +73,7 @@ bool KInteractiveConnect::SendMsg(KEMessage *msg)
}
// Try not to use this..prodices just unnecessary string-msg
// conversion
-bool KInteractiveConnect::Send(QString str)
+bool KInteractiveConnect::Send(TQString str)
{
Receive(str);
return true;
diff --git a/lskat/lskat/KInteractiveConnect.h b/lskat/lskat/KInteractiveConnect.h
index 5a393c26..1585f60f 100644
--- a/lskat/lskat/KInteractiveConnect.h
+++ b/lskat/lskat/KInteractiveConnect.h
@@ -31,7 +31,7 @@ class KInteractiveConnect:public KChildConnect
bool Init(int id=0,KEMessage *msg=0);
bool Exit();
bool SendMsg(KEMessage *msg);
- bool Send(QString str);
+ bool Send(TQString str);
signals:
void signalPrepareMove(KEMessage *msg,KG_INPUTTYPE type);
diff --git a/lskat/lskat/KProcessConnect.cpp b/lskat/lskat/KProcessConnect.cpp
index 740486b3..97cd9221 100644
--- a/lskat/lskat/KProcessConnect.cpp
+++ b/lskat/lskat/KProcessConnect.cpp
@@ -57,13 +57,13 @@ bool KProcessConnect::Init(int id,KEMessage *msg)
SetID(id);
if (msg)
{
- if (!msg->GetData(QCString("ProcessName"),p,size)) return false; // no process name
+ if (!msg->GetData(TQCString("ProcessName"),p,size)) return false; // no process name
processname=p;
/*
printf("Found processname '%s' size %d size=%u\n",
p,size,msg->QueryNumberOfKeys());
*/
- msg->Remove(QCString("ProcessName"));
+ msg->Remove(TQCString("ProcessName"));
}
if (processname.length()<1) return false;
@@ -75,13 +75,13 @@ bool KProcessConnect::Init(int id,KEMessage *msg)
// create process
process=new KProcess;
*process << processname;
- connect(process, SIGNAL(receivedStdout(KProcess *, char *, int )),
- this, SLOT(slotReceivedStdout(KProcess *, char * , int )));
- connect(process, SIGNAL(processExited(KProcess *)),
- this, SLOT(slotProcessExited(KProcess *)));
+ connect(process, TQT_SIGNAL(receivedStdout(KProcess *, char *, int )),
+ this, TQT_SLOT(slotReceivedStdout(KProcess *, char * , int )));
+ connect(process, TQT_SIGNAL(processExited(KProcess *)),
+ this, TQT_SLOT(slotProcessExited(KProcess *)));
/*
- connect(process, SIGNAL(wroteStdin(KProcess *)),
- this, SLOT(slotWroteStdin(KProcess *)));
+ connect(process, TQT_SIGNAL(wroteStdin(KProcess *)),
+ this, TQT_SLOT(slotWroteStdin(KProcess *)));
*/
// TRUE if ok
@@ -97,7 +97,7 @@ bool KProcessConnect::Init(int id,KEMessage *msg)
void KProcessConnect::slotReceivedStdout(KProcess *, char *buffer, int buflen)
{
- QString s;
+ TQString s;
char c;
int pos;
@@ -174,14 +174,14 @@ bool KProcessConnect::Next()
}
// Send string to child
-bool KProcessConnect::Send(QString str)
+bool KProcessConnect::Send(TQString str)
{
bool result;
// printf("****** PROCESS:SEND\n");
if (!running || !process) return false;
if (!str || str.length()<1) return true; // no need to send crap
// TODO ..why?
- QString s;
+ TQString s;
s=KEMESSAGE_CR+KEMESSAGE_CR;
str=s+str;
// printf("+++ Sending to child '%s'!!!\n",(const char *)str);
diff --git a/lskat/lskat/KProcessConnect.h b/lskat/lskat/KProcessConnect.h
index 9229ddd4..0e7b491a 100644
--- a/lskat/lskat/KProcessConnect.h
+++ b/lskat/lskat/KProcessConnect.h
@@ -30,7 +30,7 @@ class KProcessConnect: public KChildConnect
private:
KProcess *process;
- QString processname;
+ TQString processname;
bool running;
public:
@@ -40,8 +40,8 @@ class KProcessConnect: public KChildConnect
bool Exit();
bool Next();
// bool SendMsg(KEMessage *msg);
- virtual bool Send(QString str);
- // void Receive(QString input);
+ virtual bool Send(TQString str);
+ // void Receive(TQString input);
public slots:
void slotReceivedStdout(KProcess *proc, char *buffer, int buflen);
diff --git a/lskat/lskat/KRSocket.cpp b/lskat/lskat/KRSocket.cpp
index 0a699600..91c5e42e 100644
--- a/lskat/lskat/KRSocket.cpp
+++ b/lskat/lskat/KRSocket.cpp
@@ -94,7 +94,7 @@
#define SOMAXCONN 5
#endif
-#include <qsocketnotifier.h>
+#include <tqsocketnotifier.h>
#ifndef UNIX_PATH_MAX
#define UNIX_PATH_MAX 108 // this is the value, I found under Linux
@@ -113,8 +113,8 @@ KRServerSocket::KRServerSocket( const char *_path, int optname, int value, int l
return;
}
- notifier = new QSocketNotifier( sock, QSocketNotifier::Read );
- connect( notifier, SIGNAL( activated(int) ), this, SLOT( slotAccept(int) ) );
+ notifier = new TQSocketNotifier( sock, TQSocketNotifier::Read );
+ connect( notifier, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( slotAccept(int) ) );
}
KRServerSocket::KRServerSocket( const char *_path ) :
@@ -128,8 +128,8 @@ KRServerSocket::KRServerSocket( const char *_path ) :
return;
}
- notifier = new QSocketNotifier( sock, QSocketNotifier::Read );
- connect( notifier, SIGNAL( activated(int) ), this, SLOT( slotAccept(int) ) );
+ notifier = new TQSocketNotifier( sock, TQSocketNotifier::Read );
+ connect( notifier, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( slotAccept(int) ) );
}
KRServerSocket::KRServerSocket( unsigned short int _port ) :
@@ -143,8 +143,8 @@ KRServerSocket::KRServerSocket( unsigned short int _port ) :
return;
}
- notifier = new QSocketNotifier( sock, QSocketNotifier::Read );
- connect( notifier, SIGNAL( activated(int) ), this, SLOT( slotAccept(int) ) );
+ notifier = new TQSocketNotifier( sock, TQSocketNotifier::Read );
+ connect( notifier, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( slotAccept(int) ) );
}
KRServerSocket::KRServerSocket( unsigned short int _port,int optname,int value,int level ) :
@@ -158,8 +158,8 @@ KRServerSocket::KRServerSocket( unsigned short int _port,int optname,int value,i
return;
}
- notifier = new QSocketNotifier( sock, QSocketNotifier::Read );
- connect( notifier, SIGNAL( activated(int) ), this, SLOT( slotAccept(int) ) );
+ notifier = new TQSocketNotifier( sock, TQSocketNotifier::Read );
+ connect( notifier, TQT_SIGNAL( activated(int) ), this, TQT_SLOT( slotAccept(int) ) );
}
bool KRServerSocket::init( const char *_path )
diff --git a/lskat/lskat/KRSocket.h b/lskat/lskat/KRSocket.h
index 6c0b9974..40c1e51c 100644
--- a/lskat/lskat/KRSocket.h
+++ b/lskat/lskat/KRSocket.h
@@ -24,7 +24,7 @@
#ifndef KRSOCK_H
#define KRSOCK_H
-#include <qobject.h>
+#include <tqobject.h>
#include <sys/types.h>
// we define STRICT_ANSI to get rid of some warnings in glibc
#ifndef __STRICT_ANSI__
@@ -129,7 +129,7 @@ protected:
/**
* Notifies us when there is something to read on the port.
*/
- QSocketNotifier *notifier;
+ TQSocketNotifier *notifier;
/**
* The file descriptor for this socket. sock may be -1.
diff --git a/lskat/lskat/KRemoteConnect.cpp b/lskat/lskat/KRemoteConnect.cpp
index f1bcb4f3..315d2a96 100644
--- a/lskat/lskat/KRemoteConnect.cpp
+++ b/lskat/lskat/KRemoteConnect.cpp
@@ -78,20 +78,20 @@ bool tryserver;
SetID(id);
if (msg)
{
- if (msg->GetData(QCString("Port"),prt))
+ if (msg->GetData(TQCString("Port"),prt))
{
port=(unsigned int)prt;
- msg->Remove(QCString("Port"));
+ msg->Remove(TQCString("Port"));
}
- if (msg->GetData(QCString("IP"),p,size))
+ if (msg->GetData(TQCString("IP"),p,size))
{
- IP=QCString(p);
- msg->Remove(QCString("IP"));
+ IP=TQCString(p);
+ msg->Remove(TQCString("IP"));
}
- if (msg->GetData(QCString("Name"),p,size))
+ if (msg->GetData(TQCString("Name"),p,size))
{
- Name=QString::fromUtf8(p);
- msg->Remove(QCString("Name"));
+ Name=TQString::fromUtf8(p);
+ msg->Remove(TQCString("Name"));
}
}
/*
@@ -110,13 +110,13 @@ bool tryserver;
{
kSocket->enableRead(TRUE);
//kSocket->enableWrite(TRUE);
- connect(kSocket,SIGNAL(closeEvent(KSocket *)),
- this,SLOT(socketClosed(KSocket *)));
- connect(kSocket,SIGNAL(readEvent(KSocket *)),
- this,SLOT(socketRead(KSocket *)));
+ connect(kSocket,TQT_SIGNAL(closeEvent(KSocket *)),
+ this,TQT_SLOT(socketClosed(KSocket *)));
+ connect(kSocket,TQT_SIGNAL(readEvent(KSocket *)),
+ this,TQT_SLOT(socketRead(KSocket *)));
/*
- connect(kSocket,SIGNAL(writeEvent(KSocket *)),
- this,SLOT(socketWrite(KSocket *)));
+ connect(kSocket,TQT_SIGNAL(writeEvent(KSocket *)),
+ this,TQT_SLOT(socketWrite(KSocket *)));
*/
/*
printf("Socket(%d) %p connection built to a server\n",
@@ -127,7 +127,7 @@ bool tryserver;
// Send msg if any
if (msg->QueryNumberOfKeys()>0)
{
- msg->AddData(QCString("Server"),(short)QueryID());
+ msg->AddData(TQCString("Server"),(short)QueryID());
SendMsg(msg);
}
@@ -187,8 +187,8 @@ bool KRemoteConnect::OfferServerSocket()
printf("Offering socket and publishing stuff\n");
service = new DNSSD::PublicService(Name,LSKAT_SERVICE,port);
service->publishAsync();
- connect(kServerSocket,SIGNAL(accepted(KSocket *)),
- this,SLOT(socketRequest(KSocket *)));
+ connect(kServerSocket,TQT_SIGNAL(accepted(KSocket *)),
+ this,TQT_SLOT(socketRequest(KSocket *)));
return true;
}
@@ -206,13 +206,13 @@ void KRemoteConnect::socketRequest(KSocket *sock)
{
kSocket->enableRead(TRUE);
//kSocket->enableWrite(TRUE);
- connect(kSocket,SIGNAL(closeEvent(KSocket *)),
- this,SLOT(socketClosed(KSocket *)));
- connect(kSocket,SIGNAL(readEvent(KSocket *)),
- this,SLOT(socketRead(KSocket *)));
+ connect(kSocket,TQT_SIGNAL(closeEvent(KSocket *)),
+ this,TQT_SLOT(socketClosed(KSocket *)));
+ connect(kSocket,TQT_SIGNAL(readEvent(KSocket *)),
+ this,TQT_SLOT(socketRead(KSocket *)));
/*
- connect(kSocket,SIGNAL(writeEvent(KSocket *)),
- this,SLOT(socketWrite(KSocket *)));
+ connect(kSocket,TQT_SIGNAL(writeEvent(KSocket *)),
+ this,TQT_SLOT(socketWrite(KSocket *)));
*/
socketStatus=KR_SERVER;
delete kServerSocket; // no more connections
@@ -220,7 +220,7 @@ void KRemoteConnect::socketRequest(KSocket *sock)
if (bufferMsg)
{
// Delayed sending of init msg
- bufferMsg->AddData(QCString("Client"),(short)QueryID());
+ bufferMsg->AddData(TQCString("Client"),(short)QueryID());
SendMsg(bufferMsg);
delete bufferMsg;
bufferMsg=0;
@@ -234,14 +234,14 @@ void KRemoteConnect::socketClosed(KSocket *sock)
kSocket=0;
socketStatus=KR_INVALID;
KEMessage *msg=new KEMessage;
- msg->AddData(QCString("ConnectionLost"),(short)QueryID());
+ msg->AddData(TQCString("ConnectionLost"),(short)QueryID());
emit signalReceiveMsg(msg,QueryID());
delete msg;
}
void KRemoteConnect::socketRead(KSocket *sock)
{
ssize_t buflen;
- QString s;
+ TQString s;
char c;
int pos;
@@ -319,7 +319,7 @@ bool KRemoteConnect::Next()
}
// Send string to child
-bool KRemoteConnect::Send(QString str)
+bool KRemoteConnect::Send(TQString str)
{
// connected?
if (!kSocket || kSocket->socket()==-1) return false;
diff --git a/lskat/lskat/KRemoteConnect.h b/lskat/lskat/KRemoteConnect.h
index baa005d6..99f9280d 100644
--- a/lskat/lskat/KRemoteConnect.h
+++ b/lskat/lskat/KRemoteConnect.h
@@ -33,16 +33,16 @@ class KRemoteConnect: public KChildConnect
protected:
KRServerSocket *kServerSocket;
KSocket *kSocket;
- QString IP;
- QString Name;
+ TQString IP;
+ TQString Name;
ushort port;
KR_STATUS socketStatus;
char *buffer;
KEMessage *bufferMsg;
DNSSD::PublicService *service;
-// QString inputbuffer;
+// TQString inputbuffer;
// bool input_pending;
-// QStrList inputcache;
+// TQStrList inputcache;
public:
KRemoteConnect();
@@ -51,8 +51,8 @@ class KRemoteConnect: public KChildConnect
bool Exit();
bool Next();
// bool SendMsg(KEMessage *msg);
- virtual bool Send(QString str);
-// void Receive(QString input);
+ virtual bool Send(TQString str);
+// void Receive(TQString input);
virtual KR_STATUS QueryStatus();
protected:
diff --git a/lskat/lskat/lskat.cpp b/lskat/lskat/lskat.cpp
index 9d1ce7a6..41309afd 100644
--- a/lskat/lskat/lskat.cpp
+++ b/lskat/lskat/lskat.cpp
@@ -16,7 +16,7 @@
***************************************************************************/
// include files for QT
-#include <qprogressdialog.h>
+#include <tqprogressdialog.h>
// include files for KDE
#include <kstandarddirs.h>
@@ -50,10 +50,10 @@ LSkatApp::LSkatApp() : KMainWindow(0)
config=kapp->config();
// localise data file
- QString file=QString::fromLatin1("lskat/grafix/t1.png");
+ TQString file=TQString::fromLatin1("lskat/grafix/t1.png");
mGrafix=kapp->dirs()->findResourceDir("data", file);
- if (mGrafix.isNull()) mGrafix = QCString("grafix/");
- else mGrafix+=QCString("lskat/grafix/");
+ if (mGrafix.isNull()) mGrafix = TQCString("grafix/");
+ else mGrafix+=TQCString("lskat/grafix/");
if (global_debug>3) printf("Localised datafile=%s\n",mGrafix.latin1());
@@ -63,7 +63,7 @@ LSkatApp::LSkatApp() : KMainWindow(0)
initStatusBar();
setupGUI(KMainWindow::StatusBar | Save);
- createGUI(QString::null, false);
+ createGUI(TQString::null, false);
initDocument();
initView();
@@ -75,14 +75,14 @@ LSkatApp::LSkatApp() : KMainWindow(0)
mInput=new KEInput(this);
doc->SetInputHandler(mInput);
- connect(mInput,SIGNAL(signalPrepareProcessMove(KEMessage *)),
- this,SLOT(slotPrepareProcessMove(KEMessage *)));
- connect(mInput,SIGNAL(signalPrepareRemoteMove(KEMessage *)),
- this,SLOT(slotPrepareRemoteMove(KEMessage *)));
- connect(mInput,SIGNAL(signalPrepareInteractiveMove(KEMessage *)),
- this,SLOT(slotPrepareInteractiveMove(KEMessage *)));
- connect(mInput,SIGNAL(signalReceiveInput(KEMessage *, int)),
- this,SLOT(slotReceiveInput(KEMessage *,int )));
+ connect(mInput,TQT_SIGNAL(signalPrepareProcessMove(KEMessage *)),
+ this,TQT_SLOT(slotPrepareProcessMove(KEMessage *)));
+ connect(mInput,TQT_SIGNAL(signalPrepareRemoteMove(KEMessage *)),
+ this,TQT_SLOT(slotPrepareRemoteMove(KEMessage *)));
+ connect(mInput,TQT_SIGNAL(signalPrepareInteractiveMove(KEMessage *)),
+ this,TQT_SLOT(slotPrepareInteractiveMove(KEMessage *)));
+ connect(mInput,TQT_SIGNAL(signalReceiveInput(KEMessage *, int)),
+ this,TQT_SLOT(slotReceiveInput(KEMessage *,int )));
setMinimumSize(640,480);
setMaximumSize(800,600);
@@ -156,28 +156,28 @@ void LSkatApp::checkMenus(int menu)
void LSkatApp::initGUI()
{
- QStringList list;
+ TQStringList list;
- (void)KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection(), "new_game");
+ (void)KStdAction::openNew(this, TQT_SLOT(slotFileNew()), actionCollection(), "new_game");
ACTION("new_game")->setStatusText(i18n("Starting a new game..."));
ACTION("new_game")->setWhatsThis(i18n("Starting a new game..."));
- (void)new KAction(i18n("&End Game"),"stop", 0, this, SLOT(slotFileEnd()),
+ (void)new KAction(i18n("&End Game"),"stop", 0, this, TQT_SLOT(slotFileEnd()),
actionCollection(), "end_game");
ACTION("end_game")->setStatusText(i18n("Ending the current game..."));
ACTION("end_game")->setWhatsThis(i18n("Aborts a currently played game. No winner will be declared."));
- (void)new KAction(i18n("&Clear Statistics"),"flag", 0, this, SLOT(slotFileStatistics()),
+ (void)new KAction(i18n("&Clear Statistics"),"flag", 0, this, TQT_SLOT(slotFileStatistics()),
actionCollection(), "clear_statistics");
ACTION("clear_statistics")->setStatusText(i18n("Delete all time statistics..."));
ACTION("clear_statistics")->setWhatsThis(i18n("Clears the all time statistics which is kept in all sessions."));
- (void)new KAction(i18n("Send &Message..."), CTRL+Key_M, this, SLOT(slotFileMessage()),
+ (void)new KAction(i18n("Send &Message..."), CTRL+Key_M, this, TQT_SLOT(slotFileMessage()),
actionCollection(), "send_message");
ACTION("send_message")->setStatusText(i18n("Sending message to remote player..."));
ACTION("send_message")->setWhatsThis(i18n("Allows you to talk with a remote player."));
- (void)KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection(), "game_exit");
+ (void)KStdAction::quit(this, TQT_SLOT(slotFileQuit()), actionCollection(), "game_exit");
ACTION("game_exit")->setStatusText(i18n("Exiting..."));
ACTION("game_exit")->setWhatsThis(i18n("Quits the program."));
- (void)new KSelectAction(i18n("Starting Player"),0,this,SLOT(slotStartplayer()),
+ (void)new KSelectAction(i18n("Starting Player"),0,this,TQT_SLOT(slotStartplayer()),
actionCollection(), "startplayer");
ACTION("startplayer")->setStatusText(i18n("Changing starting player..."));
ACTION("startplayer")->setWhatsThis(i18n("Chooses which player begins the next game."));
@@ -186,7 +186,7 @@ void LSkatApp::initGUI()
list.append(i18n("Player &2"));
((KSelectAction *)ACTION("startplayer"))->setItems(list);
- (void)new KSelectAction(i18n("Player &1 Played By"),0,this,SLOT(slotPlayer1By()),
+ (void)new KSelectAction(i18n("Player &1 Played By"),0,this,TQT_SLOT(slotPlayer1By()),
actionCollection(), "player1");
ACTION("player1")->setStatusText(i18n("Changing who plays player 1..."));
ACTION("player1")->setWhatsThis(i18n("Changing who plays player 1..."));
@@ -195,13 +195,13 @@ void LSkatApp::initGUI()
list.append(i18n("&Computer"));
list.append(i18n("&Remote"));
((KSelectAction *)ACTION("player1"))->setItems(list);
- (void)new KSelectAction(i18n("Player &2 Played By"),0,this,SLOT(slotPlayer2By()),
+ (void)new KSelectAction(i18n("Player &2 Played By"),0,this,TQT_SLOT(slotPlayer2By()),
actionCollection(), "player2");
ACTION("player1")->setStatusText(i18n("Changing who plays player 2..."));
ACTION("player1")->setWhatsThis(i18n("Changing who plays player 2..."));
((KSelectAction *)ACTION("player2"))->setItems(list);
- (void)new KSelectAction(i18n("&Level"),0,this,SLOT(slotLevel()),
+ (void)new KSelectAction(i18n("&Level"),0,this,TQT_SLOT(slotLevel()),
actionCollection(), "choose_level");
ACTION("choose_level")->setStatusText(i18n("Change level..."));
ACTION("choose_level")->setWhatsThis(i18n("Change the strength of the computer player."));
@@ -211,21 +211,21 @@ void LSkatApp::initGUI()
list.append(i18n("&Hard"));
((KSelectAction *)ACTION("choose_level"))->setItems(list);
- (void)new KAction(i18n("Select &Card Deck..."), 0, this, SLOT(slotOptionsCardDeck()),
+ (void)new KAction(i18n("Select &Card Deck..."), 0, this, TQT_SLOT(slotOptionsCardDeck()),
actionCollection(), "select_carddeck");
ACTION("select_carddeck")->setStatusText(i18n("Configure card decks..."));
ACTION("select_carddeck")->setWhatsThis(i18n("Choose how the cards should look."));
- (void)new KAction(i18n("Change &Names..."), 0, this, SLOT(slotOptionsNames()),
+ (void)new KAction(i18n("Change &Names..."), 0, this, TQT_SLOT(slotOptionsNames()),
actionCollection(), "change_names");
ACTION("change_names")->setStatusText(i18n("Configure player names..."));
ACTION("change_names")->setWhatsThis(i18n("Configure player names..."));
actionCollection()->setHighlightingEnabled(true);
- connect(actionCollection(), SIGNAL(actionStatusText(const QString &)), SLOT(slotStatusMsg(const QString &)));
- connect(actionCollection(), SIGNAL(clearStatusText()), SLOT(slotClearStatusMsg()));
+ connect(actionCollection(), TQT_SIGNAL(actionStatusText(const TQString &)), TQT_SLOT(slotStatusMsg(const TQString &)));
+ connect(actionCollection(), TQT_SIGNAL(clearStatusText()), TQT_SLOT(slotClearStatusMsg()));
- KStdAction::keyBindings(guiFactory(), SLOT(configureShortcuts()),
+ KStdAction::keyBindings(guiFactory(), TQT_SLOT(configureShortcuts()),
actionCollection());
}
@@ -242,8 +242,8 @@ void LSkatApp::initStatusBar()
slotStatusMsg(i18n("Welcome to Lieutenant Skat"));
// computer move timer
- procTimer=new QTimer(this);
- connect(procTimer,SIGNAL(timeout()),this,SLOT(slotProcTimer()));
+ procTimer=new TQTimer(this);
+ connect(procTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(slotProcTimer()));
}
void LSkatApp::initDocument()
@@ -295,11 +295,11 @@ void LSkatApp::saveProperties(KConfig *_cfg)
}
else
{
- QString filename=doc->getAbsFilePath();
+ TQString filename=doc->getAbsFilePath();
_cfg->writePathEntry("filename", filename);
_cfg->writeEntry("modified", doc->isModified());
- QString tempname = kapp->tempSaveName(filename);
+ TQString tempname = kapp->tempSaveName(filename);
doc->saveDocument(tempname);
}
}
@@ -307,21 +307,21 @@ void LSkatApp::saveProperties(KConfig *_cfg)
void LSkatApp::readProperties(KConfig* _cfg)
{
- QString filename = _cfg->readPathEntry("filename");
+ TQString filename = _cfg->readPathEntry("filename");
bool modified = _cfg->readBoolEntry("modified", false);
if(modified)
{
bool canRecover;
- QString tempname = kapp->checkRecoverFile(filename, canRecover);
+ TQString tempname = kapp->checkRecoverFile(filename, canRecover);
if(canRecover)
{
doc->openDocument(tempname);
doc->setModified();
- QFileInfo info(filename);
+ TQFileInfo info(filename);
doc->setAbsFilePath(info.absFilePath());
doc->setTitle(info.fileName());
- QFile::remove(tempname);
+ TQFile::remove(tempname);
}
}
else
@@ -332,7 +332,7 @@ void LSkatApp::readProperties(KConfig* _cfg)
}
}
- //QString caption=kapp->caption();
+ //TQString caption=kapp->caption();
setCaption(i18n("Lieutenant Skat"));
}
@@ -349,16 +349,16 @@ bool LSkatApp::queryExit()
}
/////////////////////////////////////////////////////////////////////
-// SLOT IMPLEMENTATION
+// TQT_SLOT IMPLEMENTATION
/////////////////////////////////////////////////////////////////////
void LSkatApp::slotFileStatistics()
{
- QString message;
+ TQString message;
message=i18n("Do you really want to clear the all time "
"statistical data?");
- if (KMessageBox::Yes==KMessageBox::questionYesNo(this,message,QString::null,KStdGuiItem::clear()))
+ if (KMessageBox::Yes==KMessageBox::questionYesNo(this,message,TQString::null,KStdGuiItem::clear()))
{
doc->ClearStats();
doc->slotUpdateAllViews(0);
@@ -370,18 +370,18 @@ void LSkatApp::slotFileMessage()
{
int res;
- MsgDlg *dlg=new MsgDlg(this,QCString("Send message..."));
+ MsgDlg *dlg=new MsgDlg(this,TQCString("Send message..."));
res=dlg->exec();
- if (res==QDialog::Accepted)
+ if (res==TQDialog::Accepted)
{
- QString s;
+ TQString s;
s=dlg->GetMsg();
- if (!s || s.length()<1) s=QCString("...");
+ if (!s || s.length()<1) s=TQCString("...");
KEMessage *msg=new KEMessage;
// printf("Msg: %s\n",(char *)msg);
- msg->AddData(QCString("Message"),(char *)(s.latin1()));
+ msg->AddData(TQCString("Message"),(char *)(s.latin1()));
if (mInput->QueryType(0)==KG_INPUTTYPE_REMOTE)
mInput->SendMsg(msg,0);
if (mInput->QueryType(1)==KG_INPUTTYPE_REMOTE)
@@ -403,14 +403,14 @@ void LSkatApp::slotFileEnd()
slotStatusMsg(i18n("Game ended...start a new one..."));
KEMessage *msg=new KEMessage;
- msg->AddData(QCString("EndGame"),(short)1);
+ msg->AddData(TQCString("EndGame"),(short)1);
if (mInput->QueryType(0)==KG_INPUTTYPE_REMOTE)
mInput->SendMsg(msg,0);
if (mInput->QueryType(1)==KG_INPUTTYPE_REMOTE)
mInput->SendMsg(msg,1);
msg->RemoveAll();
- msg->AddData(QCString("Terminate"),(short)1);
+ msg->AddData(TQCString("Terminate"),(short)1);
if (mInput->QueryType(0)==KG_INPUTTYPE_PROCESS)
mInput->SendMsg(msg,0);
if (mInput->QueryType(1)==KG_INPUTTYPE_PROCESS)
@@ -503,11 +503,11 @@ void LSkatApp::slotPlayer2(KG_INPUTTYPE i)
void LSkatApp::slotOptionsNames()
{
- NameDlg *dlg=new NameDlg(this,QCString("Enter your name..."));
+ NameDlg *dlg=new NameDlg(this,TQCString("Enter your name..."));
dlg->SetNames(doc->GetName(0),doc->GetName(1));
- if (dlg->exec()==QDialog::Accepted)
+ if (dlg->exec()==TQDialog::Accepted)
{
- QString n1,n2;
+ TQString n1,n2;
dlg->GetNames(n1,n2);
doc->SetName(0,n1);
doc->SetName(1,n2);
@@ -518,13 +518,13 @@ void LSkatApp::slotOptionsNames()
void LSkatApp::slotOptionsCardDeck()
{
- QString s1,s2;
+ TQString s1,s2;
int result;
s1=doc->GetDeckpath();
s2=doc->GetCardpath();
result=KCardDialog::getCardDeck(s1,s2);
- if (result==QDialog::Accepted)
+ if (result==TQDialog::Accepted)
{
doc->SetCardDeckPath(s1,s2);
doc->slotUpdateAllViews(0);
@@ -545,7 +545,7 @@ void LSkatApp::slotClearStatusMsg()
slotStatusMsg(i18n("Ready"));
}
-void LSkatApp::slotStatusMsg(const QString &text)
+void LSkatApp::slotStatusMsg(const TQString &text)
{
///////////////////////////////////////////////////////////////////
// change status message permanently
@@ -553,7 +553,7 @@ void LSkatApp::slotStatusMsg(const QString &text)
statusBar()->changeItem(text, ID_STATUS_MSG);
}
-void LSkatApp::slotStatusMover(const QString &text)
+void LSkatApp::slotStatusMover(const TQString &text)
{
///////////////////////////////////////////////////////////////////
// change status mover permanently
@@ -562,7 +562,7 @@ void LSkatApp::slotStatusMover(const QString &text)
}
-void LSkatApp::slotStatusHelpMsg(const QString &text)
+void LSkatApp::slotStatusHelpMsg(const TQString &text)
{
///////////////////////////////////////////////////////////////////
// change status message of whole statusbar temporary (text, msec)
@@ -583,7 +583,7 @@ void LSkatApp::slotProcTimer(void)
/** Set the names in the mover field */
void LSkatApp::slotStatusNames(){
- QString msg;
+ TQString msg;
if (!doc->IsRunning()) msg=i18n("No game running");
else
{
@@ -653,9 +653,9 @@ bool LSkatApp::MakeInputDevice(int no)
}
else if (type==KG_INPUTTYPE_REMOTE)
{
- QString host;
+ TQString host;
short port;
- QString Name;
+ TQString Name;
msg=new KEMessage;
PrepareGame(msg);
// Build new connection
@@ -665,14 +665,14 @@ bool LSkatApp::MakeInputDevice(int no)
port=doc->QueryPort();
host=doc->QueryHost();
Name=doc->QueryName();
- msg->AddData(QCString("Port"),(short)port);
- msg->AddData(QCString("IP"),(char *)(host.latin1()));
- msg->AddData(QCString("Name"),(const char *)(Name.utf8()));
+ msg->AddData(TQCString("Port"),(short)port);
+ msg->AddData(TQCString("IP"),(char *)(host.latin1()));
+ msg->AddData(TQCString("Name"),(const char *)(Name.utf8()));
res=mInput->SetInputDevice(no,type,msg);
if (!res)
{
- QProgressDialog *progress;
- QString s;
+ TQProgressDialog *progress;
+ TQString s;
int tim,j;
tim=10000;
if (!host.isEmpty())
@@ -683,7 +683,7 @@ bool LSkatApp::MakeInputDevice(int no)
{
s=i18n("Offering remote connection on port %1...").arg(port);
}
- progress=new QProgressDialog(s, i18n("Abort"), tim, this,0,true );
+ progress=new TQProgressDialog(s, i18n("Abort"), tim, this,0,true );
progress->setCaption(i18n("Lieutenant Skat"));
for (j=0; j<tim; j++)
{
@@ -704,7 +704,7 @@ bool LSkatApp::MakeInputDevice(int no)
{
if (global_debug>10)
printf("We want theother one to be client\n");
- msg->AddData(QCString("Client"),(short)-1); // force client
+ msg->AddData(TQCString("Client"),(short)-1); // force client
mInput->SendMsg(msg,no);
}
// resp server
@@ -712,7 +712,7 @@ bool LSkatApp::MakeInputDevice(int no)
{
if (global_debug>10)
printf("We want theother one to be server\n");
- msg->AddData(QCString("Server"),(short)-1); // force server
+ msg->AddData(TQCString("Server"),(short)-1); // force server
mInput->SendMsg(msg,no);
}
}
@@ -728,8 +728,8 @@ bool LSkatApp::MakeInputDevice(int no)
{
if (mInput->QueryType(no)!=type)
{
- // QString path=kapp->dirs()->findExe(doc->QueryProcessName());
- QString path=doc->GetProcess();
+ // TQString path=kapp->dirs()->findExe(doc->QueryProcessName());
+ TQString path=doc->GetProcess();
if (global_debug>5)
{
printf("Make Process %d\n",no);
@@ -737,7 +737,7 @@ bool LSkatApp::MakeInputDevice(int no)
}
if (path.isNull()) return false;
msg=new KEMessage;
- msg->AddData(QCString("ProcessName"),(char *)(path.latin1()));
+ msg->AddData(TQCString("ProcessName"),(char *)(path.latin1()));
// msg->AddData("ProcessName",doc->QueryProcessName());
res=mInput->SetInputDevice(no,KG_INPUTTYPE_PROCESS,msg);
delete msg;
@@ -751,7 +751,7 @@ void LSkatApp::OptionsNetwork()
{
int res;
- NetworkDlg *dlg=new NetworkDlg(this,QCString("Configure a network game..."));
+ NetworkDlg *dlg=new NetworkDlg(this,TQCString("Configure a network game..."));
dlg->SetPort(doc->QueryPort());
dlg->SetHost(doc->QueryHost());
dlg->SetName(doc->QueryName());
@@ -768,13 +768,13 @@ void LSkatApp::slotPrepareProcessMove(KEMessage *msg)
printf("+++ main should prepare process move\n");
slotStatusMsg(i18n("Waiting for the computer to move..."));
- msg->AddData(QCString("Hint"),(short)0);
- msg->AddData(QCString("Move"),(short)1);
+ msg->AddData(TQCString("Hint"),(short)0);
+ msg->AddData(TQCString("Move"),(short)1);
if (global_debug>3)
printf("PREPARE GAME in processmove\n");
if (global_debug>1)
- msg->AddData(QCString("KLogSendMsg"),"process.log");
+ msg->AddData(TQCString("KLogSendMsg"),"process.log");
PrepareGame(msg);
}
@@ -797,7 +797,7 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int )
/*
if (global_debug>=0)
{
- QStrList *keys=msg->QueryKeys();
+ TQStrList *keys=msg->QueryKeys();
char *it;
printf(" MESSAGESIZE=%u\n",msg->QueryNumberOfKeys());
for (it=keys->first();it!=0;it=keys->next())
@@ -807,20 +807,20 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int )
}
*/
short move;
- QString message;
+ TQString message;
short x,y,player;
bool remotesend;
int size;
- if (msg->HasKey(QCString("Debug")))
+ if (msg->HasKey(TQCString("Debug")))
{
char *debug;
- msg->GetData(QCString("Debug"),debug,size);
+ msg->GetData(TQCString("Debug"),debug,size);
printf("Received Debug: %d <%s>\n",size,debug);
}
- if (msg->HasKey(QCString("ConnectionLost")))
+ if (msg->HasKey(TQCString("ConnectionLost")))
{
- if (msg->GetData(QCString("ConnectionLost"),move))
+ if (msg->GetData(TQCString("ConnectionLost"),move))
{
if (move==0)
{
@@ -838,10 +838,10 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int )
}
}
}
- if (msg->HasKey(QCString("Message")))
+ if (msg->HasKey(TQCString("Message")))
{
char *p;
- if (msg->GetData(QCString("Message"),p,size))
+ if (msg->GetData(TQCString("Message"),p,size))
{
message=i18n("Message from remote player:\n")+p;
KMessageBox::information(this,message);
@@ -849,18 +849,18 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int )
printf("MESSAGE **** %s ****\n",message.latin1());
}
}
- if (msg->HasKey(QCString("EndGame")))
+ if (msg->HasKey(TQCString("EndGame")))
{
KEMessage *msg2=new KEMessage;
- msg2->AddData(QCString("Terminate"),(short)1);
+ msg2->AddData(TQCString("Terminate"),(short)1);
if (mInput->QueryType(0)==KG_INPUTTYPE_PROCESS)
mInput->SendMsg(msg2,0);
if (mInput->QueryType(1)==KG_INPUTTYPE_PROCESS)
mInput->SendMsg(msg2,1);
delete msg2;
- msg->GetData(QCString("EndGame"),move);
+ msg->GetData(TQCString("EndGame"),move);
message=i18n("Remote player ended game...");
KMessageBox::information(this,message);
slotStatusMsg(message);
@@ -870,19 +870,19 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int )
slotStatusNames();
}
- if (msg->HasKey(QCString("Move")))
+ if (msg->HasKey(TQCString("Move")))
{
slotStatusMsg(i18n("Ready"));
- msg->GetData(QCString("Move"),player);
- msg->GetData(QCString("MoveX"),x);
- msg->GetData(QCString("MoveY"),y);
- remotesend=msg->HasKey(QCString("RemoteMove"));
+ msg->GetData(TQCString("Move"),player);
+ msg->GetData(TQCString("MoveX"),x);
+ msg->GetData(TQCString("MoveY"),y);
+ remotesend=msg->HasKey(TQCString("RemoteMove"));
if (remotesend && doc->IsRemoteSwitch())
player=1-player;
Move((int)x,(int)y,(int)player,remotesend);
}
// Client key is automatically added by message system !!!
- if (msg->HasKey(QCString("Client")))
+ if (msg->HasKey(TQCString("Client")))
{
if (global_debug>5)
printf("We are client and extracting game data now.\n");
@@ -895,7 +895,7 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int )
mInput->Next(doc->GetStartPlayer());
}
// Server key is automatically added by message system !!!
- if (msg->HasKey(QCString("Server")))
+ if (msg->HasKey(TQCString("Server")))
{
if (global_debug>5)
printf("We are server now.\n");
@@ -910,7 +910,7 @@ void LSkatApp::slotReceiveInput(KEMessage *msg,int )
void LSkatApp::MoveFinished()
{
int res=doc->MakeMove();
- QString ld,s;
+ TQString ld,s;
if (res==2) // end game
{
doc->EvaluateGame();
@@ -969,10 +969,10 @@ void LSkatApp::Move(int x,int y,int player,bool remote)
{
msg=new KEMessage;
if (doc->IsRemoteSwitch()) player=1-player;
- msg->AddData(QCString("Move"),(short)player);
- msg->AddData(QCString("MoveX"),(short)x);
- msg->AddData(QCString("MoveY"),(short)y);
- msg->AddData(QCString("RemoteMove"),(short)1);
+ msg->AddData(TQCString("Move"),(short)player);
+ msg->AddData(TQCString("MoveX"),(short)x);
+ msg->AddData(TQCString("MoveY"),(short)y);
+ msg->AddData(TQCString("RemoteMove"),(short)1);
if (mInput->QueryType(0)==KG_INPUTTYPE_REMOTE)
mInput->SendMsg(msg,0);
if (mInput->QueryType(1)==KG_INPUTTYPE_REMOTE)
@@ -1004,22 +1004,22 @@ void LSkatApp::PrepareGame(KEMessage *msg)
if (!msg)
return;
- msg->AddData(QCString("Cards"),(char *)doc->GetCardP(),NO_OF_CARDS*sizeof(int));
- msg->AddData(QCString("Startplayer"),(short)doc->GetStartPlayer());
- msg->AddData(QCString("CurrentPlayer"),(short)doc->GetCurrentPlayer());
+ msg->AddData(TQCString("Cards"),(char *)doc->GetCardP(),NO_OF_CARDS*sizeof(int));
+ msg->AddData(TQCString("Startplayer"),(short)doc->GetStartPlayer());
+ msg->AddData(TQCString("CurrentPlayer"),(short)doc->GetCurrentPlayer());
if (doc->GetPlayedBy(0)==KG_INPUTTYPE_REMOTE)
- msg->AddData(QCString("RemoteIs"),(short)0);
+ msg->AddData(TQCString("RemoteIs"),(short)0);
else if (doc->GetPlayedBy(1)==KG_INPUTTYPE_REMOTE)
- msg->AddData(QCString("RemoteIs"),(short)1);
- msg->AddData(QCString("Trump"),(short)doc->GetTrump());
+ msg->AddData(TQCString("RemoteIs"),(short)1);
+ msg->AddData(TQCString("Trump"),(short)doc->GetTrump());
// For computer player
// -1 or the current played card
- msg->AddData(QCString("CurrentMove"),(short)doc->GetMove(doc->GetStartPlayer()));
- msg->AddData(QCString("Height"),(char *)doc->GetCardHeightP(),NO_OF_CARDS/2*sizeof(int));
- msg->AddData(QCString("No"),(short)doc->GetMoveNo());
- msg->AddData(QCString("Sc1"),(short)doc->GetScore(0));
- msg->AddData(QCString("Sc2"),(short)doc->GetScore(1));
- msg->AddData(QCString("Level"),(short)doc->GetComputerLevel());
+ msg->AddData(TQCString("CurrentMove"),(short)doc->GetMove(doc->GetStartPlayer()));
+ msg->AddData(TQCString("Height"),(char *)doc->GetCardHeightP(),NO_OF_CARDS/2*sizeof(int));
+ msg->AddData(TQCString("No"),(short)doc->GetMoveNo());
+ msg->AddData(TQCString("Sc1"),(short)doc->GetScore(0));
+ msg->AddData(TQCString("Sc2"),(short)doc->GetScore(1));
+ msg->AddData(TQCString("Level"),(short)doc->GetComputerLevel());
}
void LSkatApp::ExtractGame(KEMessage *msg)
@@ -1029,7 +1029,7 @@ void LSkatApp::ExtractGame(KEMessage *msg)
// Do we have to switch players?
bool switchit;
short remote;
- msg->GetData(QCString("RemoteIs"),remote);
+ msg->GetData(TQCString("RemoteIs"),remote);
if (doc->GetPlayedBy(remote)==KG_INPUTTYPE_REMOTE) switchit=true;
else switchit=false;
@@ -1038,10 +1038,10 @@ void LSkatApp::ExtractGame(KEMessage *msg)
int *cards;
char *p;
short trump;
- msg->GetData(QCString("Startplayer"),start);
- msg->GetData(QCString("Cards"),p,size);
+ msg->GetData(TQCString("Startplayer"),start);
+ msg->GetData(TQCString("Cards"),p,size);
cards=(int *)p;
- msg->GetData(QCString("Trump"),trump);
+ msg->GetData(TQCString("Trump"),trump);
if (size!=NO_OF_CARDS*sizeof(int))
{
printf("Error: Transmission of cards failed..wrong sizes\n");
@@ -1073,7 +1073,7 @@ void LSkatApp::ExtractGame(KEMessage *msg)
}
-void LSkatApp::SetGrafix(QString s)
+void LSkatApp::SetGrafix(TQString s)
{
mGrafix=s;
}
diff --git a/lskat/lskat/lskat.h b/lskat/lskat/lskat.h
index b5686dde..e44f7e1b 100644
--- a/lskat/lskat/lskat.h
+++ b/lskat/lskat/lskat.h
@@ -24,7 +24,7 @@
#endif
// include files for Qt
-#include <qstrlist.h>
+#include <tqstrlist.h>
// include files for KDE
#include <kapplication.h>
@@ -91,7 +91,7 @@ class LSkatApp : public KMainWindow
LSkatDoc *getDocument() const;
void MoveFinished();
void Move(int x,int y,int player,bool remote);
- void SetGrafix(QString s);
+ void SetGrafix(TQString s);
protected:
void NewGame();
@@ -166,16 +166,16 @@ class LSkatApp : public KMainWindow
/** changes the statusbar contents for the standard label permanently, used to indicate current actions.
* @param text the text that is displayed in the statusbar
*/
- void slotStatusMsg(const QString &text);
+ void slotStatusMsg(const TQString &text);
void slotClearStatusMsg();
/** changes the status message of the whole statusbar for two seconds, then restores the last status. This is used to display
* statusbar messages that give information about actions for toolbar icons and menuentries.
* @param text the text that is displayed in the statusbar
*/
- void slotStatusHelpMsg(const QString &text);
+ void slotStatusHelpMsg(const TQString &text);
/** Set the names in the mover field */
void slotStatusNames();
- void slotStatusMover(const QString &text);
+ void slotStatusMover(const TQString &text);
void slotLevel();
void slotStartplayer();
@@ -194,13 +194,13 @@ protected: // Protected attributes
/** */
/** Counts the time in the status bar */
- QTimer * procTimer;
+ TQTimer * procTimer;
KEInput *mInput;
- QString mGrafix;
+ TQString mGrafix;
private:
/** contains the recently used filenames */
- QStrList recentFiles;
+ TQStrList recentFiles;
/** the configuration object of the application */
KConfig *config;
diff --git a/lskat/lskat/lskatdoc.cpp b/lskat/lskat/lskatdoc.cpp
index 8da62ea4..fd95f0c8 100644
--- a/lskat/lskat/lskatdoc.cpp
+++ b/lskat/lskat/lskatdoc.cpp
@@ -16,8 +16,8 @@
***************************************************************************/
// include files for Qt
-#include <qdir.h>
-#include <qfileinfo.h>
+#include <tqdir.h>
+#include <tqfileinfo.h>
#include <time.h>
#include <unistd.h>
#include <stdlib.h>
@@ -34,14 +34,14 @@
#include "lskatview.h"
#include <kcarddialog.h>
-QPtrList<LSkatView> *LSkatDoc::pViewList = 0L;
+TQPtrList<LSkatView> *LSkatDoc::pViewList = 0L;
-LSkatDoc::LSkatDoc(QWidget *parent, const char *name) : QObject(parent, name)
+LSkatDoc::LSkatDoc(TQWidget *parent, const char *name) : TQObject(parent, name)
{
int i;
if(!pViewList)
{
- pViewList = new QPtrList<LSkatView>();
+ pViewList = new TQPtrList<LSkatView>();
}
pViewList->setAutoDelete(true);
@@ -95,22 +95,22 @@ void LSkatDoc::removeView(LSkatView *view)
pViewList->remove(view);
}
-void LSkatDoc::setAbsFilePath(const QString &filename)
+void LSkatDoc::setAbsFilePath(const TQString &filename)
{
absFilePath=filename;
}
-const QString &LSkatDoc::getAbsFilePath() const
+const TQString &LSkatDoc::getAbsFilePath() const
{
return absFilePath;
}
-void LSkatDoc::setTitle(const QString &_t)
+void LSkatDoc::setTitle(const TQString &_t)
{
title=_t;
}
-const QString &LSkatDoc::getTitle() const
+const TQString &LSkatDoc::getTitle() const
{
return title;
}
@@ -162,11 +162,11 @@ void LSkatDoc::closeDocument()
deleteContents();
}
-bool LSkatDoc::newDocument(KConfig * /*config*/,QString path)
+bool LSkatDoc::newDocument(KConfig * /*config*/,TQString path)
{
int res;
modified=false;
- absFilePath=QDir::homeDirPath();
+ absFilePath=TQDir::homeDirPath();
title=i18n("Untitled");
if (global_debug>1) printf("path=%s\n",path.latin1());
res=LoadBitmap(path);
@@ -174,7 +174,7 @@ bool LSkatDoc::newDocument(KConfig * /*config*/,QString path)
return true;
}
-bool LSkatDoc::LoadGrafix(QString path)
+bool LSkatDoc::LoadGrafix(TQString path)
{
int res;
res=LoadCards(cardPath);
@@ -184,7 +184,7 @@ bool LSkatDoc::LoadGrafix(QString path)
return true;
}
-bool LSkatDoc::SetCardDeckPath(QString deck,QString card)
+bool LSkatDoc::SetCardDeckPath(TQString deck,TQString card)
{
bool update=false;
if (!deck.isNull() && deck!=deckPath)
@@ -202,9 +202,9 @@ bool LSkatDoc::SetCardDeckPath(QString deck,QString card)
return update;
}
-bool LSkatDoc::openDocument(const QString &filename, const char * /*format*/ /*=0*/)
+bool LSkatDoc::openDocument(const TQString &filename, const char * /*format*/ /*=0*/)
{
- QFileInfo fileInfo(filename);
+ TQFileInfo fileInfo(filename);
title=fileInfo.fileName();
absFilePath=fileInfo.absFilePath();
/////////////////////////////////////////////////
@@ -215,7 +215,7 @@ bool LSkatDoc::openDocument(const QString &filename, const char * /*format*/ /*=
return true;
}
-bool LSkatDoc::saveDocument(const QString & /*filename*/, const char * /*format*/ /*=0*/)
+bool LSkatDoc::saveDocument(const TQString & /*filename*/, const char * /*format*/ /*=0*/)
{
/////////////////////////////////////////////////
// TODO: Add your document saving code here
@@ -535,8 +535,8 @@ void LSkatDoc::SetCurrentPlayer(int i) {currentplayer=i;}
int LSkatDoc::GetStartPlayer() {return startplayer;}
void LSkatDoc::SetStartPlayer(int i) {startplayer=i;}
-void LSkatDoc::SetName(int no, QString n) { names[no]=n; }
-QString LSkatDoc::GetName(int no) {return names[no];}
+void LSkatDoc::SetName(int no, TQString n) { names[no]=n; }
+TQString LSkatDoc::GetName(int no) {return names[no];}
int LSkatDoc::GetScore(int no) {return score[no];}
int LSkatDoc::GetMoveNo() {return moveno;}
@@ -562,10 +562,10 @@ bool LSkatDoc::IsIntro() {return isintro;}
bool LSkatDoc::WasRunning() {return wasgame;}
void LSkatDoc::SetIntro(bool b) {isintro=b;}
-int LSkatDoc::LoadBitmap(QString path)
+int LSkatDoc::LoadBitmap(TQString path)
{
int i;
- QString buf;
+ TQString buf;
if (global_debug>5) printf("Loading bitmaps\n");
for (i=0;i<NO_OF_TRUMPS;i++)
{
@@ -606,9 +606,9 @@ int LSkatDoc::LoadBitmap(QString path)
}
-int LSkatDoc::LoadCards(QString path)
+int LSkatDoc::LoadCards(TQString path)
{
- QString buf;
+ TQString buf;
for (int i=0;i<NO_OF_CARDS;i++)
{
buf.sprintf("%s%d.png",path.latin1(),i+1);
@@ -622,7 +622,7 @@ int LSkatDoc::LoadCards(QString path)
return 1;
}
-int LSkatDoc::LoadDeck(QString path)
+int LSkatDoc::LoadDeck(TQString path)
{
if (!mPixDeck.load(path))return 0;
return 1;
@@ -651,11 +651,11 @@ void LSkatDoc::SetServer(bool b)
{
server=b;
}
-void LSkatDoc::SetHost(QString h)
+void LSkatDoc::SetHost(TQString h)
{
host=h;
}
-void LSkatDoc::SetName(const QString& n)
+void LSkatDoc::SetName(const TQString& n)
{
Name=n;
}
@@ -663,7 +663,7 @@ void LSkatDoc::SetPort(short p)
{
port=p;
}
-QString LSkatDoc::QueryHost()
+TQString LSkatDoc::QueryHost()
{
return host;
}
@@ -671,7 +671,7 @@ short LSkatDoc::QueryPort()
{
return port;
}
-QString LSkatDoc::QueryName() const
+TQString LSkatDoc::QueryName() const
{
return Name;
}
@@ -714,7 +714,7 @@ int LSkatDoc::GetStatPoints(int no)
return stat_points[no];
}
-QString LSkatDoc::GetProcess()
+TQString LSkatDoc::GetProcess()
{
return procfile;
}
@@ -733,18 +733,18 @@ void LSkatDoc::ReadConfig(KConfig *config)
{
KConfig emailCfg( "emaildefaults", true );
emailCfg.setGroup( "UserInfo" );
- QString name = emailCfg.readEntry( "FullName" );
+ TQString name = emailCfg.readEntry( "FullName" );
if ( name.isEmpty() )
{
struct passwd *pw = getpwuid( getuid() );
if ( pw )
- name = QString::fromLocal8Bit( pw->pw_gecos );
+ name = TQString::fromLocal8Bit( pw->pw_gecos );
}
config->setGroup("Parameter");
host=config->readEntry("host");
port=(unsigned short)config->readNumEntry("port",7432);
- procfile=config->readEntry("process",QCString("lskatproc"));
+ procfile=config->readEntry("process",TQCString("lskatproc"));
Name=config->readEntry("gamename");
names[0]=config->readEntry("Name1",i18n("Alice"));
// names[1]=config->readEntry("Name2",i18n("Bob"));
diff --git a/lskat/lskat/lskatdoc.h b/lskat/lskat/lskatdoc.h
index 1b880360..8e62a27f 100644
--- a/lskat/lskat/lskatdoc.h
+++ b/lskat/lskat/lskatdoc.h
@@ -23,9 +23,9 @@
#endif
// include files for QT
-#include <qobject.h>
-#include <qstring.h>
-#include <qptrlist.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqptrlist.h>
#include <kconfig.h>
#include "lskat.h"
@@ -49,7 +49,7 @@ class LSkatDoc : public QObject
Q_OBJECT
public:
/** Constructor for the fileclass of the application */
- LSkatDoc(QWidget *parent, const char *name=0);
+ LSkatDoc(TQWidget *parent, const char *name=0);
/** Destructor for the fileclass of the application */
~LSkatDoc();
@@ -66,21 +66,21 @@ class LSkatDoc : public QObject
/** deletes the document's contents */
void deleteContents();
/** initializes the document generally */
- bool newDocument(KConfig *config,QString path);
+ bool newDocument(KConfig *config,TQString path);
/** closes the acutal document */
void closeDocument();
/** loads the document by filename and format and emits the updateViews() signal */
- bool openDocument(const QString &filename, const char *format=0);
+ bool openDocument(const TQString &filename, const char *format=0);
/** saves the document under filename and format.*/
- bool saveDocument(const QString &filename, const char *format=0);
+ bool saveDocument(const TQString &filename, const char *format=0);
/** sets the path to the file connected with the document */
- void setAbsFilePath(const QString &filename);
+ void setAbsFilePath(const TQString &filename);
/** returns the pathname of the current document file*/
- const QString &getAbsFilePath() const;
+ const TQString &getAbsFilePath() const;
/** sets the filename of the document */
- void setTitle(const QString &_t);
+ void setTitle(const TQString &_t);
/** returns the title of the document */
- const QString &getTitle() const;
+ const TQString &getTitle() const;
int random(int max);
void NewGame();
@@ -102,8 +102,8 @@ class LSkatDoc : public QObject
void SetCurrentPlayer(int i);
int GetStartPlayer();
void SetStartPlayer(int i);
- void SetName(int no,QString n);
- QString GetName(int no);
+ void SetName(int no,TQString n);
+ TQString GetName(int no);
int GetScore(int no);
int GetMoveNo();
bool LegalMove(int card1, int card2);
@@ -143,48 +143,48 @@ class LSkatDoc : public QObject
void UpdateViews(int mode);
bool IsServer();
void SetServer(bool b);
- void SetHost(QString h);
- void SetName(const QString& n);
+ void SetHost(TQString h);
+ void SetName(const TQString& n);
void SetPort(short p);
- QString QueryHost();
+ TQString QueryHost();
short QueryPort();
- QString QueryName() const;
+ TQString QueryName() const;
// Only for fast remote access
int *GetCardP();
int *GetCardHeightP();
void SetCard(int i,int c);
bool IsRemoteSwitch();
void SetRemoteSwitch(bool b);
- QString GetProcess();
- int LoadCards(QString path);
- int LoadDeck(QString path);
- bool SetCardDeckPath(QString deck,QString card);
- QString GetDeckpath() {return deckPath;}
- QString GetCardpath() {return cardPath;}
- bool LoadGrafix(QString path);
+ TQString GetProcess();
+ int LoadCards(TQString path);
+ int LoadDeck(TQString path);
+ bool SetCardDeckPath(TQString deck,TQString card);
+ TQString GetDeckpath() {return deckPath;}
+ TQString GetCardpath() {return cardPath;}
+ bool LoadGrafix(TQString path);
protected:
void initrandom();
- int LoadBitmap(QString path);
+ int LoadBitmap(TQString path);
public:
- QPixmap mPixCard[NO_OF_CARDS];
- QPixmap mPixTrump[NO_OF_TRUMPS];
- QPixmap mPixDeck;
- QPixmap mPixBackground;
- QSize cardsize;
- QPixmap mPixType[3];
- QPixmap mPixAnim[NO_OF_ANIM];
+ TQPixmap mPixCard[NO_OF_CARDS];
+ TQPixmap mPixTrump[NO_OF_TRUMPS];
+ TQPixmap mPixDeck;
+ TQPixmap mPixBackground;
+ TQSize cardsize;
+ TQPixmap mPixType[3];
+ TQPixmap mPixAnim[NO_OF_ANIM];
private:
- QString procfile;
- QString picpath;
+ TQString procfile;
+ TQString picpath;
int delpath;
bool remoteswitch;
KEInput *inputHandler;
short port;
- QString host;
- QString Name;
+ TQString host;
+ TQString Name;
bool server;
bool lock;
int startplayer;
@@ -198,7 +198,7 @@ public:
int movestatus;
int currentplayer;
CCOLOUR trump;
- QString names[2];
+ TQString names[2];
int score[2];
int laststartplayer;
int began_game;
@@ -222,14 +222,14 @@ public:
public:
/** the list of the views currently connected to the document */
- static QPtrList<LSkatView> *pViewList;
+ static TQPtrList<LSkatView> *pViewList;
private:
/** the modified flag of the current document */
bool modified;
- QString title;
- QString absFilePath;
- QString deckPath,cardPath;
+ TQString title;
+ TQString absFilePath;
+ TQString deckPath,cardPath;
};
#endif // LSKATDOC_H
diff --git a/lskat/lskat/lskatview.cpp b/lskat/lskat/lskatview.cpp
index c14d5cee..a338bc00 100644
--- a/lskat/lskat/lskatview.cpp
+++ b/lskat/lskat/lskatview.cpp
@@ -16,14 +16,14 @@
***************************************************************************/
// include files for Qt
-#include <qpixmap.h>
-#include <qcolor.h>
-#include <qrect.h>
-#include <qfontmetrics.h>
-#include <qpoint.h>
-#include <qstring.h>
-#include <qpainter.h>
-#include <qdatetime.h>
+#include <tqpixmap.h>
+#include <tqcolor.h>
+#include <tqrect.h>
+#include <tqfontmetrics.h>
+#include <tqpoint.h>
+#include <tqstring.h>
+#include <tqpainter.h>
+#include <tqdatetime.h>
#include <kmessagebox.h>
#include <kdebug.h>
#include <klocale.h>
@@ -92,39 +92,39 @@
//#define COL_STATUSLIGHT white
#define COL_STATUSBORDER black
-//#define COL_STATUSFIELD QColor(192,192,192)
-//#define COL_STATUSDARK QColor(65,65,65)
-#define COL_STATUSFIELD QColor(130,130,255)
-#define COL_STATUSDARK QColor(0,0,65)
-#define COL_STATUSLIGHT QColor(210,210,255)
-#define COL_PLAYER QColor(255,255,0)
+//#define COL_STATUSFIELD TQColor(192,192,192)
+//#define COL_STATUSDARK TQColor(65,65,65)
+#define COL_STATUSFIELD TQColor(130,130,255)
+#define COL_STATUSDARK TQColor(0,0,65)
+#define COL_STATUSLIGHT TQColor(210,210,255)
+#define COL_PLAYER TQColor(255,255,0)
#define DLGBOXTITLE TITLE
#define MOVECOUNTER 20 // so many moves when playing card
#define MOVE_TIMER_DELAY 7 // timer in milllisec default 7
-LSkatView::LSkatView(QWidget *parent, const char *name) : QWidget(parent, name)
+LSkatView::LSkatView(TQWidget *parent, const char *name) : TQWidget(parent, name)
{
setBackgroundMode(PaletteBase);
// setBackgroundMode(NoBackground);
- status_rect1=QRect(412,CARD_Y_OFFSET+5,180,95+25);
- status_rect2=QRect(412,310,180,95+25);
- status_rect3=QRect(CARD_X_OFFSET+60,CARD_Y_OFFSET+5+100+15+20,
+ status_rect1=TQRect(412,CARD_Y_OFFSET+5,180,95+25);
+ status_rect2=TQRect(412,310,180,95+25);
+ status_rect3=TQRect(CARD_X_OFFSET+60,CARD_Y_OFFSET+5+100+15+20,
400,320-100-CARD_Y_OFFSET-30);
- setBackgroundColor(QColor(0,0,128));
+ setBackgroundColor(TQColor(0,0,128));
setBackgroundPixmap( getDocument()->mPixBackground );
- moveTimer=new QTimer(this);
+ moveTimer=new TQTimer(this);
moveTimer->stop();
- connect(moveTimer,SIGNAL(timeout()),this,SLOT(moveTimerReady()));
+ connect(moveTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(moveTimerReady()));
introcnt=0;
- introTimer=new QTimer(this);
+ introTimer=new TQTimer(this);
introTimer->stop();
- connect(introTimer,SIGNAL(timeout()),this,SLOT(introTimerReady()));
+ connect(introTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(introTimerReady()));
introTimer->start(75,FALSE);
for (int i=0;i<NO_OF_CARDS;i++)
@@ -146,11 +146,11 @@ LSkatDoc *LSkatView::getDocument() const
// offset: An offset to the rect to make it smaller
// width: The width of the border
// mode: 0: Light border, 1: dark border
-void LSkatView::drawBorder(QPainter *p,QRect rect,int offset,int width,int mode)
+void LSkatView::drawBorder(TQPainter *p,TQRect rect,int offset,int width,int mode)
{
-QPen graypen;
+TQPen graypen;
int i;
-QPoint p1,p2;
+TQPoint p1,p2;
if (mode!=0 && mode!=1) return;
@@ -179,16 +179,16 @@ QPoint p1,p2;
// draw a move by animating the movment and turning of the
// card. This is called until the card reaches its final
// position
-void LSkatView::drawMove(QPainter *p)
+void LSkatView::drawMove(TQPainter *p)
{
int m1,m2;
int below;
- QPoint point1,point2;
+ TQPoint point1,point2;
m1=getDocument()->GetMove(0);
m2=getDocument()->GetMove(1);
- point1=QPoint(CARD_X_MOVE1,CARD_Y_MOVE1);
- point2=QPoint(CARD_X_MOVE2,CARD_Y_MOVE2);
+ point1=TQPoint(CARD_X_MOVE1,CARD_Y_MOVE1);
+ point2=TQPoint(CARD_X_MOVE2,CARD_Y_MOVE2);
below=getDocument()->GetLastStartPlayer();
if (below<0) below=getDocument()->GetStartPlayer();
@@ -205,7 +205,7 @@ void LSkatView::drawMove(QPainter *p)
}
int card;
- QPoint point;
+ TQPoint point;
card=getDocument()->GetMoveStatus();
if (card>=0)
{
@@ -215,23 +215,23 @@ void LSkatView::drawMove(QPainter *p)
// turn new card
if ((double)cardmovecnt/(double)MOVECOUNTER>0.5)
{
- QPixmap pix1(getDocument()->mPixCard[cardmoveunder]);
+ TQPixmap pix1(getDocument()->mPixCard[cardmoveunder]);
int wid=pix1.width();
- QWMatrix m;
+ TQWMatrix m;
m.scale(2.0*((double)cardmovecnt/(double)MOVECOUNTER-0.5),1.0);
pix1=pix1.xForm(m);
- point=QPoint((wid-pix1.width())/2,0);
+ point=TQPoint((wid-pix1.width())/2,0);
p->drawPixmap(cardorigin+point,pix1);
}
// turn deck
else
{
- QPixmap pix1(getDocument()->mPixDeck);
+ TQPixmap pix1(getDocument()->mPixDeck);
int wid=pix1.width();
- QWMatrix m;
+ TQWMatrix m;
m.scale(1.0-2.0*((double)cardmovecnt/(double)MOVECOUNTER),1.0);
pix1=pix1.xForm(m);
- point=QPoint((wid-pix1.width())/2,0);
+ point=TQPoint((wid-pix1.width())/2,0);
p->drawPixmap(cardorigin+point,pix1);
}
} /* end turn card */
@@ -244,18 +244,18 @@ void LSkatView::drawMove(QPainter *p)
// Show the intro (Cards+Text)
// This is called repeatetly
-void LSkatView::drawIntro(QPainter *p)
+void LSkatView::drawIntro(TQPainter *p)
{
int i,c1,c2,x,cnt,y,col,col2,col3,col4;
// The window width;
// int win_width = p->window().width();
- QPoint point,point1,p2;
- QString s;
+ TQPoint point,point1,p2;
+ TQString s;
// Get a nice font
- QFont font = KGlobalSettings::generalFont();
+ TQFont font = KGlobalSettings::generalFont();
font.setPointSize(48);
// Get the font info to determine text sizes
- QFontMetrics fontMetrics(font);
+ TQFontMetrics fontMetrics(font);
p->setFont(font);
@@ -264,17 +264,17 @@ void LSkatView::drawIntro(QPainter *p)
i=0;
- point=QPoint(20,20);
- point1=QPoint(550,20);
+ point=TQPoint(20,20);
+ point1=TQPoint(550,20);
for (i=0;i<cnt;i++)
{
x=(int)((i+10)*5*sin(1.5*i*M_PI/(float)NO_OF_CARDS));
c1=introCards[i];
c2=introCards[(i+17)%NO_OF_CARDS];
- p2=QPoint(i*10+x, i*10);
+ p2=TQPoint(i*10+x, i*10);
p->drawPixmap(point+p2,getDocument()->mPixCard[c1]);
- p2=QPoint(-i*10-x, i*10);
+ p2=TQPoint(-i*10-x, i*10);
p->drawPixmap(point1+p2,getDocument()->mPixCard[c2]);
}
@@ -288,38 +288,38 @@ void LSkatView::drawIntro(QPainter *p)
s=i18n("Lieutenant Skat");
x=310-fontMetrics.width(s)/2;
y=-20+(int)(200.0*sin(0.5*M_PI/(float)NO_OF_CARDS*cnt));
- p->setPen(QColor(col4,col2,0));
+ p->setPen(TQColor(col4,col2,0));
p->drawText(x-2,y+2,s);
- p->setPen(QColor(col3,col,0));
+ p->setPen(TQColor(col3,col,0));
p->drawText(x,y,s);
s=i18n("for");
y=270+(NO_OF_CARDS-cnt)*3;
x=-fontMetrics.width(s)/2+(int)(310.0*sin(0.5*M_PI/(float)NO_OF_CARDS*cnt));
- p->setPen(QColor(col4,col2,0));
+ p->setPen(TQColor(col4,col2,0));
p->drawText(x-2,y+2,s);
- p->setPen(QColor(col3,col,0));
+ p->setPen(TQColor(col3,col,0));
p->drawText(x,y,s);
s=i18n("K D E");
y=350+(NO_OF_CARDS-cnt)*3;
// x=640-(int)(380.0*sin(0.5*M_PI/(float)NO_OF_CARDS*cnt));
x=570-fontMetrics.width(s)/2-(int)(260.0*sin(0.5*M_PI/(float)NO_OF_CARDS*cnt));
- p->setPen(QColor(col4,col2,0));
+ p->setPen(TQColor(col4,col2,0));
p->drawText(x-2,y+2,s);
- p->setPen(QColor(col3,col,0));
+ p->setPen(TQColor(col3,col,0));
p->drawText(x,y,s);
}
// Draw all cards to create the game board
-void LSkatView::drawDeck(QPainter *p)
+void LSkatView::drawDeck(TQPainter *p)
{
int x,y,card;
int player,pos,height;
- QPoint point;
+ TQPoint point;
for (y=0;y<4;y++)
{
@@ -338,7 +338,7 @@ void LSkatView::drawDeck(QPainter *p)
if (height==2)
- p->drawPixmap(point-QPoint(CARD_X_DECK,CARD_Y_DECK),getDocument()->mPixDeck);
+ p->drawPixmap(point-TQPoint(CARD_X_DECK,CARD_Y_DECK),getDocument()->mPixDeck);
if (cardmovecnt<1 || x!=cardmovex || y!=cardmovey)
{
@@ -358,18 +358,18 @@ void LSkatView::drawDeck(QPainter *p)
}
}
// Draw the winner field
-void LSkatView::drawFinal(QPainter *p)
+void LSkatView::drawFinal(TQPainter *p)
{
int sc1,sc0,pt0,pt1;
- //QPoint p1,p2;
+ //TQPoint p1,p2;
int trump;
- //QRect r;
- QString ld;
+ //TQRect r;
+ TQString ld;
int ts[10];
- QFont font24 = KGlobalSettings::generalFont();
+ TQFont font24 = KGlobalSettings::generalFont();
font24.setPointSize(24);
- QFont font14 = KGlobalSettings::generalFont();
+ TQFont font14 = KGlobalSettings::generalFont();
font14.setPointSize(13);
//p1=status_rect3.topLeft();
@@ -394,14 +394,14 @@ void LSkatView::drawFinal(QPainter *p)
- QString line1,line2,line3,line4,line5;
- QString col1_3,col2_3,col3_3,col4_3;
- QString col1_4,col2_4,col3_4,col4_4;
- QRect sumrect;
- QRect rect;
- QRect brect1,brect2,brect3,brect4,brect5;
- QRect brect1_3,brect2_3,brect3_3,brect4_3;
- QRect brect1_4,brect2_4,brect3_4,brect4_4;
+ TQString line1,line2,line3,line4,line5;
+ TQString col1_3,col2_3,col3_3,col4_3;
+ TQString col1_4,col2_4,col3_4,col4_4;
+ TQRect sumrect;
+ TQRect rect;
+ TQRect brect1,brect2,brect3,brect4,brect5;
+ TQRect brect1_3,brect2_3,brect3_3,brect4_3;
+ TQRect brect1_4,brect2_4,brect3_4,brect4_4;
// Calculate geometry
line1=i18n("Game over");
@@ -409,14 +409,14 @@ void LSkatView::drawFinal(QPainter *p)
//rect1.moveBy(0,FINAL_Y0-24);
p->setFont(font24);
brect1=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line1);
- //QRect wrect=p->window();
+ //TQRect wrect=p->window();
sumrect=brect1;
if (sc0+sc1!=120) // aborted
{
line2=i18n("Game was aborted - no winner");
int hp=getDocument()->mPixTrump[trump].height()+5;
- rect=QRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height());
+ rect=TQRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height());
p->setFont(font14);
brect2=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line2);
sumrect|=brect2;
@@ -436,55 +436,55 @@ void LSkatView::drawFinal(QPainter *p)
line2=i18n("Player 2 - %1 won ").arg(getDocument()->GetName(1));
}
int hp=getDocument()->mPixTrump[trump].height()+5;
- rect=QRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height());
+ rect=TQRect(0,hp>sumrect.height()?hp:sumrect.height(),p->window().width(),p->window().height());
p->setFont(font14);
brect2=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line2);
sumrect|=brect2;
p->setFont(font14);
col1_3=i18n("Score:");
- col1_4=QString(" ");
- rect=QRect(0,0,p->window().width(),p->window().height());
+ col1_4=TQString(" ");
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect1_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col1_3);
ts[0]=brect1_3.width()+10;
col2_3=getDocument()->GetName(0);
- rect=QRect(0,0,p->window().width(),p->window().height());
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect2_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col2_3);
col2_4=getDocument()->GetName(1);
- rect=QRect(0,0,p->window().width(),p->window().height());
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect2_4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col2_4);
rect=brect2_3|brect2_4;
ts[1]=ts[0]+rect.width()+10;
col3_3.sprintf("%d",sc0);
- rect=QRect(0,0,p->window().width(),p->window().height());
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect3_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col3_3);
col3_4.sprintf("%d",sc1);
- rect=QRect(0,0,p->window().width(),p->window().height());
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect3_4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col3_4);
rect=brect3_3|brect3_4;
ts[2]=ts[1]+rect.width()+30;
col4_3=i18n("%1 points").arg(pt0);
- rect=QRect(0,0,p->window().width(),p->window().height());
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect4_3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col4_3);
col4_4=i18n("%1 points").arg(pt1);
- rect=QRect(0,0,p->window().width(),p->window().height());
+ rect=TQRect(0,0,p->window().width(),p->window().height());
brect4_4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,col4_4);
rect=brect4_3|brect4_4;
ts[3]=ts[2]+rect.width()+10;
ts[4]=0;
- line3=col1_3+QString("\t")+col2_3+QString("\t")+col3_3+QString("\t")+col4_3;
- line4=col1_4+QString("\t")+col2_4+QString("\t")+col3_4+QString("\t")+col4_4;
- brect3=QRect(sumrect.left(),sumrect.bottom()+10,ts[3],brect4_3.height());
- brect4=QRect(sumrect.left(),sumrect.bottom()+10+brect4_3.height()+6,ts[3],brect4_4.height());
+ line3=col1_3+TQString("\t")+col2_3+TQString("\t")+col3_3+TQString("\t")+col4_3;
+ line4=col1_4+TQString("\t")+col2_4+TQString("\t")+col3_4+TQString("\t")+col4_4;
+ brect3=TQRect(sumrect.left(),sumrect.bottom()+10,ts[3],brect4_3.height());
+ brect4=TQRect(sumrect.left(),sumrect.bottom()+10+brect4_3.height()+6,ts[3],brect4_4.height());
sumrect|=brect3;
sumrect|=brect4;
@@ -493,7 +493,7 @@ void LSkatView::drawFinal(QPainter *p)
if (sc0>=120)
{
line5=i18n("%1 won to nil. Congratulations!").arg(getDocument()->GetName(0));
- rect=QRect(0,sumrect.height()+10,p->window().width(),p->window().height());
+ rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height());
brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5);
sumrect|=brect5;
}
@@ -503,14 +503,14 @@ void LSkatView::drawFinal(QPainter *p)
line5=i18n("%1 won with 90 points. Super!").arg(getDocument()->GetName(0));
else
line5=i18n("%1 won over 90 points. Super!").arg(getDocument()->GetName(0));
- rect=QRect(0,sumrect.height()+10,p->window().width(),p->window().height());
+ rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height());
brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5);
sumrect|=brect5;
}
if (sc1>=120)
{
line5=i18n("%1 won to nil. Congratulations!").arg(getDocument()->GetName(1));
- rect=QRect(0,sumrect.height()+10,p->window().width(),p->window().height());
+ rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height());
brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5);
sumrect|=brect5;
}
@@ -520,18 +520,18 @@ void LSkatView::drawFinal(QPainter *p)
line5=i18n("%1 won with 90 points. Super!").arg(getDocument()->GetName(1));
else
line5=i18n("%1 won over 90 points. Super!").arg(getDocument()->GetName(1));
- rect=QRect(0,sumrect.height()+10,p->window().width(),p->window().height());
+ rect=TQRect(0,sumrect.height()+10,p->window().width(),p->window().height());
brect5=p->boundingRect(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line5);
sumrect|=brect5;
}
}
- QPoint offset=QPoint(status_rect3.left()-sumrect.left(),status_rect3.top());
+ TQPoint offset=TQPoint(status_rect3.left()-sumrect.left(),status_rect3.top());
sumrect.moveBy(offset.x(),offset.y());
// draw actual strings and symbols
- QRect borderrect=QRect(sumrect.left()-20,sumrect.top()-20,sumrect.width()+40,sumrect.height()+40);
+ TQRect borderrect=TQRect(sumrect.left()-20,sumrect.top()-20,sumrect.width()+40,sumrect.height()+40);
p->drawRect(borderrect);
drawBorder(p,borderrect,0,4,0);
drawBorder(p,borderrect,10,1,1);
@@ -551,8 +551,8 @@ void LSkatView::drawFinal(QPainter *p)
//brect2.moveBy(offset.x(),offset.y());
p->drawText(rect,Qt::AlignHCenter|Qt::SingleLine|Qt::AlignTop,line2);
- p->drawPixmap(sumrect.topLeft()+QPoint(-5,-5), getDocument()->mPixTrump[trump]);
- p->drawPixmap(sumrect.topLeft()+QPoint(5,-5)+QPoint(sumrect.width()-getDocument()->mPixTrump[trump].width(),0),
+ p->drawPixmap(sumrect.topLeft()+TQPoint(-5,-5), getDocument()->mPixTrump[trump]);
+ p->drawPixmap(sumrect.topLeft()+TQPoint(5,-5)+TQPoint(sumrect.width()-getDocument()->mPixTrump[trump].width(),0),
getDocument()->mPixTrump[trump]);
@@ -585,7 +585,7 @@ void LSkatView::drawFinal(QPainter *p)
// This function is just a workaround for the QT function drawText
// with Qt::EXpandTAbs eanbled. For some strange reasons this crashes...
-void LSkatView::drawTabText(QPainter *p,QRect rect,QString s,int *ts)
+void LSkatView::drawTabText(TQPainter *p,TQRect rect,TQString s,int *ts)
{
int lcnt=0;
@@ -600,9 +600,9 @@ void LSkatView::drawTabText(QPainter *p,QRect rect,QString s,int *ts)
lpos=s.length();
rpos=0;
}
- QString tmp=s.left(lpos);
+ TQString tmp=s.left(lpos);
s=s.right(rpos);
- QRect rect2=rect;
+ TQRect rect2=rect;
if (lcnt>0)
rect2.setLeft(rect.left()+ts[lcnt-1]);
p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,tmp);
@@ -611,17 +611,17 @@ void LSkatView::drawTabText(QPainter *p,QRect rect,QString s,int *ts)
}
// Draw the status field at the right side
-void LSkatView::drawStatus(QPainter *p)
+void LSkatView::drawStatus(TQPainter *p)
{
- QPoint p1,p2;
+ TQPoint p1,p2;
int trump;
- QRect drawrect;
+ TQRect drawrect;
// For loop
- QRect srect[2];
+ TQRect srect[2];
srect[0]=status_rect1;
srect[1]=status_rect2;
- QFont font10 = KGlobalSettings::generalFont();
+ TQFont font10 = KGlobalSettings::generalFont();
font10.setPointSize(13);
p->setFont(font10);
@@ -629,14 +629,14 @@ void LSkatView::drawStatus(QPainter *p)
// draw text
- QString ld;
- QString line1,line2,line3,line4,line2a,line2b,line2c;
- QRect sumrect,rect,rect2,brect1,brect2,brect3,brect4;
- QPoint pa;
+ TQString ld;
+ TQString line1,line2,line3,line4,line2a,line2b,line2c;
+ TQRect sumrect,rect,rect2,brect1,brect2,brect3,brect4;
+ TQPoint pa;
for (int pl=0;pl<2;pl++)
{
- drawrect=QRect(srect[pl].left()+14,srect[pl].top()+14,srect[pl].width()-28,srect[pl].height()-28);
+ drawrect=TQRect(srect[pl].left()+14,srect[pl].top()+14,srect[pl].width()-28,srect[pl].height()-28);
p1=drawrect.topLeft();
p2=drawrect.bottomRight();
@@ -649,7 +649,7 @@ void LSkatView::drawStatus(QPainter *p)
// Player pl -------------------
- // line1=QString(i18n("Player 1"))+QString(QCString(" - "))+getDocument()->GetName(0);
+ // line1=TQString(i18n("Player 1"))+TQString(TQCString(" - "))+getDocument()->GetName(0);
line1=getDocument()->GetName(pl);
brect1=p->boundingRect(drawrect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line1);
sumrect=brect1;
@@ -658,11 +658,11 @@ void LSkatView::drawStatus(QPainter *p)
{
// Geometry and strings
line2=i18n("Score:");
- rect=QRect(drawrect.left(),sumrect.bottom()+16,drawrect.width(),drawrect.height()-sumrect.height());
+ rect=TQRect(drawrect.left(),sumrect.bottom()+16,drawrect.width(),drawrect.height()-sumrect.height());
brect2=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2);
sumrect|=brect2;
line3=i18n("Move:");
- rect=QRect(drawrect.left(),sumrect.bottom()+10,drawrect.width(),drawrect.height()-sumrect.height());
+ rect=TQRect(drawrect.left(),sumrect.bottom()+10,drawrect.width(),drawrect.height()-sumrect.height());
brect3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3);
sumrect|=brect3;
@@ -678,33 +678,33 @@ void LSkatView::drawStatus(QPainter *p)
p->setPen(black);
p->drawText(brect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2);
p->drawText(brect3,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3);
- rect2=QRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width(),brect2.height());
+ rect2=TQRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width(),brect2.height());
p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2a);
- rect2=QRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width(),brect3.height());
+ rect2=TQRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width(),brect3.height());
p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2b);
- pa=QPoint(drawrect.width()-getDocument()->mPixTrump[trump].width(),drawrect.height()-getDocument()->mPixTrump[trump].height());
+ pa=TQPoint(drawrect.width()-getDocument()->mPixTrump[trump].width(),drawrect.height()-getDocument()->mPixTrump[trump].height());
if (getDocument()->GetStartPlayer()==pl)
- p->drawPixmap(p1+pa+QPoint(3,3),getDocument()->mPixTrump[trump]);
+ p->drawPixmap(p1+pa+TQPoint(3,3),getDocument()->mPixTrump[trump]);
- pa=QPoint(drawrect.width()-getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1].width(),0);
- p->drawPixmap(p1+pa+QPoint(3,-3), getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1]);
+ pa=TQPoint(drawrect.width()-getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1].width(),0);
+ p->drawPixmap(p1+pa+TQPoint(3,-3), getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1]);
}
else // draw all time score
{
// Geometry and strings
line2=i18n("Points:");
- rect=QRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height());
+ rect=TQRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height());
brect2=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2);
sumrect|=brect2;
line3=i18n("Won:");
- rect=QRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height());
+ rect=TQRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height());
brect3=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3);
sumrect|=brect3;
line4=i18n("Games:");
- rect=QRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height());
+ rect=TQRect(drawrect.left(),sumrect.bottom()+6,drawrect.width(),drawrect.height()-sumrect.height());
brect4=p->boundingRect(rect,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line4);
sumrect|=brect4;
@@ -721,15 +721,15 @@ void LSkatView::drawStatus(QPainter *p)
p->drawText(brect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2);
p->drawText(brect3,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line3);
p->drawText(brect4,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line4);
- rect2=QRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width()+5,brect2.height());
+ rect2=TQRect(brect2.left()+rect.width(),brect2.top(),drawrect.width()-brect2.width()-rect.width()+5,brect2.height());
p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2a);
- rect2=QRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width()+5,brect3.height());
+ rect2=TQRect(brect3.left()+rect.width(),brect3.top(),drawrect.width()-brect3.width()-rect.width()+5,brect3.height());
p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2b);
- rect2=QRect(brect4.left()+rect.width(),brect4.top(),drawrect.width()-brect4.width()-rect.width()+5,brect4.height());
+ rect2=TQRect(brect4.left()+rect.width(),brect4.top(),drawrect.width()-brect4.width()-rect.width()+5,brect4.height());
p->drawText(rect2,Qt::AlignLeft|Qt::SingleLine|Qt::AlignTop,line2c);
- pa=QPoint(drawrect.width()-getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1].width(),0);
- p->drawPixmap(p1+pa+QPoint(3,-3), getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1]);
+ pa=TQPoint(drawrect.width()-getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1].width(),0);
+ p->drawPixmap(p1+pa+TQPoint(3,-3), getDocument()->mPixType[getDocument()->GetPlayedBy(pl)-1]);
}
@@ -737,7 +737,7 @@ void LSkatView::drawStatus(QPainter *p)
}
// paint function
-void LSkatView::Paint(QPainter *p)
+void LSkatView::Paint(TQPainter *p)
{
// If game is running
drawStatus(p);
@@ -753,13 +753,13 @@ void LSkatView::Paint(QPainter *p)
}
// paint event
-void LSkatView::paintEvent( QPaintEvent * e)
+void LSkatView::paintEvent( TQPaintEvent * e)
{
if (getDocument()->IsIntro())
{
- QPixmap pm(this->rect().size());
- QPainter p;
- QBrush brush;
+ TQPixmap pm(this->rect().size());
+ TQPainter p;
+ TQBrush brush;
p.begin(&pm,this);
brush.setPixmap( getDocument()->mPixBackground );
p.fillRect(0,0,this->rect().width(),this->rect().height(),brush);
@@ -769,7 +769,7 @@ void LSkatView::paintEvent( QPaintEvent * e)
}
else
{
- QPainter paint( this );
+ TQPainter paint( this );
paint.setClipRect(e->rect());
Paint( &paint );
}
@@ -777,32 +777,32 @@ void LSkatView::paintEvent( QPaintEvent * e)
// x=0..4, y=0..4
-QPoint LSkatView::calcCardPos(int x,int y)
+TQPoint LSkatView::calcCardPos(int x,int y)
{
- QPoint point;
- point=QPoint(CARD_X_OFFSET+x*(CARD_X_SPACE+getDocument()->cardsize.width()),
+ TQPoint point;
+ point=TQPoint(CARD_X_OFFSET+x*(CARD_X_SPACE+getDocument()->cardsize.width()),
CARD_Y_OFFSET+y*(CARD_Y_SPACE+getDocument()->cardsize.height()));
- if (y>=2) point+=QPoint(0,CARD_Y_BOARD_OFFSET);
- point+=QPoint(CARD_X_DECK,CARD_Y_DECK);
+ if (y>=2) point+=TQPoint(0,CARD_Y_BOARD_OFFSET);
+ point+=TQPoint(CARD_X_DECK,CARD_Y_DECK);
return point;
}
// mouse click event
-void LSkatView::mousePressEvent( QMouseEvent *mouse )
+void LSkatView::mousePressEvent( TQMouseEvent *mouse )
{
if (mouse->button()!=LeftButton) return ;
if (!getDocument()->IsRunning()) return ;
if (getDocument()->GetMoveStatus()!=-1) return ;
- QPoint point;
+ TQPoint point;
int mx,my,player;
point=mouse->pos();
- point-=QPoint(CARD_X_OFFSET,CARD_Y_OFFSET);
+ point-=TQPoint(CARD_X_OFFSET,CARD_Y_OFFSET);
if (point.y()>2*(getDocument()->cardsize.height()+CARD_Y_SPACE))
{
- point-=QPoint(0,CARD_Y_BOARD_OFFSET+2*(getDocument()->cardsize.height()+CARD_Y_SPACE));
+ point-=TQPoint(0,CARD_Y_BOARD_OFFSET+2*(getDocument()->cardsize.height()+CARD_Y_SPACE));
player=1;
}
else
@@ -823,15 +823,15 @@ void LSkatView::mousePressEvent( QMouseEvent *mouse )
!getDocument()->IsLocked())
{
KEMessage *msg=new KEMessage;
- msg->AddData(QCString("Move"),(short)player);
- msg->AddData(QCString("MoveX"),(short)mx);
- msg->AddData(QCString("MoveY"),(short)my);
+ msg->AddData(TQCString("Move"),(short)player);
+ msg->AddData(TQCString("MoveX"),(short)mx);
+ msg->AddData(TQCString("MoveY"),(short)my);
getDocument()->QueryInputHandler()->SetInput(msg);
delete msg;
}
else
{
- QString m;
+ TQString m;
switch(getDocument()->random(4))
{
case 0:
@@ -861,16 +861,16 @@ void LSkatView::InitMove(int player,int mx,int my)
cardmovecnt=0;
cardorigin=calcCardPos(mx,my+2*player);
if (getDocument()->GetCurrentPlayer()==0)
- cardend=QPoint(CARD_X_MOVE1,CARD_Y_MOVE1);
- else cardend=QPoint(CARD_X_MOVE2,CARD_Y_MOVE2);
- update(QRect(
- cardorigin-QPoint(CARD_X_DECK,CARD_Y_DECK),
- getDocument()->cardsize+QSize(CARD_X_DECK,CARD_Y_DECK)));
-
- QPoint point1=QPoint(CARD_X_MOVE1,CARD_Y_MOVE1);
- QPoint point2=QPoint(CARD_X_MOVE2,CARD_Y_MOVE2);
- update(QRect(point1,getDocument()->cardsize));
- update(QRect(point2,getDocument()->cardsize));
+ cardend=TQPoint(CARD_X_MOVE1,CARD_Y_MOVE1);
+ else cardend=TQPoint(CARD_X_MOVE2,CARD_Y_MOVE2);
+ update(TQRect(
+ cardorigin-TQPoint(CARD_X_DECK,CARD_Y_DECK),
+ getDocument()->cardsize+TQSize(CARD_X_DECK,CARD_Y_DECK)));
+
+ TQPoint point1=TQPoint(CARD_X_MOVE1,CARD_Y_MOVE1);
+ TQPoint point2=TQPoint(CARD_X_MOVE2,CARD_Y_MOVE2);
+ update(TQRect(point1,getDocument()->cardsize));
+ update(TQRect(point2,getDocument()->cardsize));
}
void LSkatView::introTimerReady()
{
@@ -896,15 +896,15 @@ void LSkatView::introTimerReady()
void LSkatView::moveTimerReady()
{
- QPoint pos;
- QString ld,s;
+ TQPoint pos;
+ TQString ld,s;
if (cardmovecnt>=MOVECOUNTER)
{
LSkatApp *m=(LSkatApp *) parentWidget();
moveTimer->stop();
cardmovecnt=0;
- update(QRect(cardend,getDocument()->cardsize));
- update(QRect(cardorigin,getDocument()->cardsize));
+ update(TQRect(cardend,getDocument()->cardsize));
+ update(TQRect(cardorigin,getDocument()->cardsize));
update(status_rect1);
update(status_rect2);
m->MoveFinished();
@@ -913,14 +913,14 @@ void LSkatView::moveTimerReady()
else
{
pos=cardorigin+(cardend-cardorigin)*cardmovecnt/MOVECOUNTER;
- update(QRect(pos,getDocument()->cardsize));
+ update(TQRect(pos,getDocument()->cardsize));
cardmovecnt++;
pos=cardorigin+(cardend-cardorigin)*cardmovecnt/MOVECOUNTER;
- update(QRect(pos,getDocument()->cardsize));
+ update(TQRect(pos,getDocument()->cardsize));
// Turning of the card
if ( cardmoveunder>=0)
{
- update(QRect(cardorigin,getDocument()->cardsize));
+ update(TQRect(cardorigin,getDocument()->cardsize));
}
}
}
diff --git a/lskat/lskat/lskatview.h b/lskat/lskat/lskatview.h
index 05b31356..19146cc5 100644
--- a/lskat/lskat/lskatview.h
+++ b/lskat/lskat/lskatview.h
@@ -22,14 +22,14 @@
#include <config.h>
#endif
-#include <qwidget.h>
-#include <qrect.h>
+#include <tqwidget.h>
+#include <tqrect.h>
#include "lskat.h"
class LSkatDoc;
/** The LSkatView class provides the view widget for the LSkatApp instance.
- * The View instance inherits QWidget as a base class and represents the view object of a KTMainWindow. As LSkatView is part of the
+ * The View instance inherits TQWidget as a base class and represents the view object of a KTMainWindow. As LSkatView is part of the
* docuement-view model, it needs a reference to the document object connected with it by the LSkatApp class to manipulate and display
* the document structure provided by the LSkatDoc class.
*
@@ -41,7 +41,7 @@ class LSkatView : public QWidget
Q_OBJECT
public:
/** Constructor for the main view */
- LSkatView(QWidget *parent = 0, const char *name=0);
+ LSkatView(TQWidget *parent = 0, const char *name=0);
/** returns a pointer to the document connected to the view instance. Mind that this method requires a LSkatApp instance as a parent
* widget to get to the window document pointer by calling the LSkatApp::getDocument() method.
@@ -50,40 +50,40 @@ class LSkatView : public QWidget
*/
LSkatDoc *getDocument() const;
- void paintEvent( QPaintEvent * p);
- void Paint(QPainter *p);
+ void paintEvent( TQPaintEvent * p);
+ void Paint(TQPainter *p);
void InitMove(int player,int x,int y);
void updateStatus();
protected:
- void drawDeck(QPainter *p);
- void drawIntro(QPainter *p);
- void drawMove(QPainter *p);
- void drawStatus(QPainter *p);
- void drawFinal(QPainter *p);
- void drawBorder(QPainter *p,QRect rect,int offset,int width,int mode);
- QPoint calcCardPos(int x,int y);
+ void drawDeck(TQPainter *p);
+ void drawIntro(TQPainter *p);
+ void drawMove(TQPainter *p);
+ void drawStatus(TQPainter *p);
+ void drawFinal(TQPainter *p);
+ void drawBorder(TQPainter *p,TQRect rect,int offset,int width,int mode);
+ TQPoint calcCardPos(int x,int y);
- void mousePressEvent ( QMouseEvent *m );
+ void mousePressEvent ( TQMouseEvent *m );
protected slots:
void moveTimerReady();
void introTimerReady();
- void drawTabText(QPainter *p,QRect rect,QString s,int *ts);
+ void drawTabText(TQPainter *p,TQRect rect,TQString s,int *ts);
private:
- QRect status_rect1;
- QRect status_rect2;
- QRect status_rect3;
- QTimer *moveTimer;
- QTimer *introTimer;
+ TQRect status_rect1;
+ TQRect status_rect2;
+ TQRect status_rect3;
+ TQTimer *moveTimer;
+ TQTimer *introTimer;
int introcnt;
int cardmovecnt;
int cardmovex,cardmovey;
int cardmoveunder;
- QPoint cardorigin;
- QPoint cardend;
+ TQPoint cardorigin;
+ TQPoint cardend;
int introCards[NO_OF_CARDS];
};
diff --git a/lskat/lskat/main.cpp b/lskat/lskat/main.cpp
index 50910540..fa3a777f 100644
--- a/lskat/lskat/main.cpp
+++ b/lskat/lskat/main.cpp
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
if (args->isSet("debug"))
{
- QString s = args->getOption("debug");
+ TQString s = args->getOption("debug");
global_debug = s.toInt();
qDebug("Debug level set to %d\n", global_debug);
}
diff --git a/lskat/lskat/msgdlg.cpp b/lskat/lskat/msgdlg.cpp
index daea1dac..cb3e6334 100644
--- a/lskat/lskat/msgdlg.cpp
+++ b/lskat/lskat/msgdlg.cpp
@@ -28,7 +28,7 @@
*/
-#include <qgroupbox.h>
+#include <tqgroupbox.h>
#include <klocale.h>
#include <kpushbutton.h>
#include <kstdguiitem.h>
@@ -37,36 +37,36 @@
// Create the dialog for changing the player names
-MsgDlg::MsgDlg( QWidget *parent, const char *name,const char * /*sufi */ )
- : QDialog( parent, name,TRUE )
+MsgDlg::MsgDlg( TQWidget *parent, const char *name,const char * /*sufi */ )
+ : TQDialog( parent, name,TRUE )
{
setCaption(i18n("Send Message to Remote Player"));
setMinimumSize(400,160);
setMaximumSize(600,360);
resize( 400, 160 );
- QGroupBox* grp;
- grp = new QGroupBox(i18n("Enter Message"), this);
+ TQGroupBox* grp;
+ grp = new TQGroupBox(i18n("Enter Message"), this);
grp->resize(380,100);
grp->move(10,10);
- MultiLine = new QMultiLineEdit( grp, "MLineEdit" );
+ MultiLine = new TQMultiLineEdit( grp, "MLineEdit" );
MultiLine->setGeometry( 10, 20, 360, 70 );
- MultiLine->setText(QCString("") );
+ MultiLine->setText(TQCString("") );
- QPushButton *PushButton;
- PushButton = new QPushButton( i18n("Send" ), this, "PushButton_1" );
+ TQPushButton *PushButton;
+ PushButton = new TQPushButton( i18n("Send" ), this, "PushButton_1" );
PushButton->setGeometry( 20, 120, 65, 30 );
- connect( PushButton, SIGNAL(clicked()), SLOT(accept()) );
+ connect( PushButton, TQT_SIGNAL(clicked()), TQT_SLOT(accept()) );
PushButton->setAutoRepeat( FALSE );
PushButton = new KPushButton( KStdGuiItem::cancel(), this, "PushButton_2" );
PushButton->setGeometry( 305, 120, 65, 30 );
- connect( PushButton, SIGNAL(clicked()), SLOT(reject()) );
+ connect( PushButton, TQT_SIGNAL(clicked()), TQT_SLOT(reject()) );
PushButton->setAutoRepeat( FALSE );
}
-QString MsgDlg::GetMsg()
+TQString MsgDlg::GetMsg()
{
return MultiLine->text();
}
diff --git a/lskat/lskat/msgdlg.h b/lskat/lskat/msgdlg.h
index 614fa332..6612597d 100644
--- a/lskat/lskat/msgdlg.h
+++ b/lskat/lskat/msgdlg.h
@@ -16,22 +16,22 @@
***************************************************************************/
#ifndef __MSGDLG_H_
#define __MSGDLG_H_
-#include <qmultilineedit.h>
-#include <qstring.h>
-#include <qdialog.h>
+#include <tqmultilineedit.h>
+#include <tqstring.h>
+#include <tqdialog.h>
class MsgDlg : public QDialog
{
Q_OBJECT
public:
- MsgDlg (QWidget* parent = NULL,const char* name = NULL,const char *sufi=NULL);
- QString GetMsg();
+ MsgDlg (TQWidget* parent = NULL,const char* name = NULL,const char *sufi=NULL);
+ TQString GetMsg();
protected slots:
protected:
- QMultiLineEdit *MultiLine;
+ TQMultiLineEdit *MultiLine;
diff --git a/lskat/lskat/namedlg.cpp b/lskat/lskat/namedlg.cpp
index 478f5ea5..2004a9af 100644
--- a/lskat/lskat/namedlg.cpp
+++ b/lskat/lskat/namedlg.cpp
@@ -8,11 +8,11 @@
****************************************************************************/
#include "namedlg.h"
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qlayout.h>
-#include <qwhatsthis.h>
+#include <tqgroupbox.h>
+#include <tqlabel.h>
+#include <tqlineedit.h>
+#include <tqlayout.h>
+#include <tqwhatsthis.h>
#include <klocale.h>
@@ -25,16 +25,16 @@
* The dialog will by default be modeless, unless you set 'modal' to
* TRUE to construct a modal dialog.
*/
-NameDlg::NameDlg( QWidget *parent, const char *name,bool /* modal */, WFlags /* fl */ )
+NameDlg::NameDlg( TQWidget *parent, const char *name,bool /* modal */, WFlags /* fl */ )
: KDialogBase( Plain, i18n("Configure Names"), Ok|Cancel, Ok,
parent, name, true,true )
{
- QWidget *page = plainPage();
+ TQWidget *page = plainPage();
if ( !name ) setName( "NameDlg" );
resize( 252, 186 );
// setCaption( i18n( "Configure Names" ) );
- vbox = new QVBoxLayout( page,spacingHint() );
+ vbox = new TQVBoxLayout( page,spacingHint() );
vbox->setSpacing( 6 );
vbox->setMargin( 11 );
@@ -42,12 +42,12 @@ NameDlg::NameDlg( QWidget *parent, const char *name,bool /* modal */, WFlags /*
hbox->setSpacing( 6 );
hbox->setMargin( 0 );
- player_names = new QGroupBox( page, "player_names" );
+ player_names = new TQGroupBox( page, "player_names" );
player_names->setTitle(i18n("Player Names") );
player_names->setColumnLayout(0, Qt::Vertical );
player_names->layout()->setSpacing( 0 );
player_names->layout()->setMargin( 0 );
- vbox_2 = new QVBoxLayout( player_names->layout() );
+ vbox_2 = new TQVBoxLayout( player_names->layout() );
vbox_2->setAlignment( Qt::AlignTop );
vbox_2->setSpacing( 6 );
vbox_2->setMargin( 11 );
@@ -60,13 +60,13 @@ NameDlg::NameDlg( QWidget *parent, const char *name,bool /* modal */, WFlags /*
hbox_2->setSpacing( 6 );
hbox_2->setMargin( 0 );
- text_player1 = new QLabel( player_names, "text_player1" );
+ text_player1 = new TQLabel( player_names, "text_player1" );
text_player1->setText( i18n("Player 1:" ) );
hbox_2->addWidget( text_player1 );
- edit_player1 = new QLineEdit( player_names, "edit_player1" );
+ edit_player1 = new TQLineEdit( player_names, "edit_player1" );
edit_player1->setMaxLength( NAME_MAX_LEN );
- QWhatsThis::add( edit_player1, i18n( "Enter a player's name" ) );
+ TQWhatsThis::add( edit_player1, i18n( "Enter a player's name" ) );
hbox_2->addWidget( edit_player1 );
vbox_3->addLayout( hbox_2 );
@@ -75,31 +75,31 @@ NameDlg::NameDlg( QWidget *parent, const char *name,bool /* modal */, WFlags /*
hbox_3->setSpacing( 6 );
hbox_3->setMargin( 0 );
- text_player2 = new QLabel( player_names, "text_player2" );
+ text_player2 = new TQLabel( player_names, "text_player2" );
text_player2->setText( i18n("Player 2:" ) );
hbox_3->addWidget( text_player2 );
- edit_player2 = new QLineEdit( player_names, "edit_player2" );
+ edit_player2 = new TQLineEdit( player_names, "edit_player2" );
edit_player2->setMaxLength( NAME_MAX_LEN );
- QWhatsThis::add( edit_player2, i18n( "Enter a player's name" ) );
+ TQWhatsThis::add( edit_player2, i18n( "Enter a player's name" ) );
hbox_3->addWidget( edit_player2 );
vbox_3->addLayout( hbox_3 );
vbox_2->addLayout( vbox_3 );
// left
- QSpacerItem* spacer_3 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQSpacerItem* spacer_3 = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
hbox->addItem( spacer_3 );
hbox->addWidget( player_names );
- QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
hbox->addItem( spacer );
// top
- QSpacerItem* spacer_4 = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ TQSpacerItem* spacer_4 = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
vbox->addItem( spacer_4 );
vbox->addLayout( hbox );
- QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ TQSpacerItem* spacer_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
vbox->addItem( spacer_2 );
}
@@ -113,12 +113,12 @@ NameDlg::~NameDlg()
}
// In and output the name strings
-void NameDlg::SetNames(QString n1, QString n2)
+void NameDlg::SetNames(TQString n1, TQString n2)
{
edit_player1->setText( n1 );
edit_player2->setText( n2 );
}
-void NameDlg::GetNames(QString &n1, QString &n2)
+void NameDlg::GetNames(TQString &n1, TQString &n2)
{
n1=edit_player1->text( );
n1.truncate(NAME_MAX_LEN);
diff --git a/lskat/lskat/namedlg.h b/lskat/lskat/namedlg.h
index c5d3391a..000de21e 100644
--- a/lskat/lskat/namedlg.h
+++ b/lskat/lskat/namedlg.h
@@ -23,27 +23,27 @@ class NameDlg : public KDialogBase
Q_OBJECT
public:
- NameDlg( QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 );
+ NameDlg( TQWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0 );
~NameDlg();
- void SetNames(QString n1,QString n2);
- void GetNames(QString &n1,QString &n2);
+ void SetNames(TQString n1,TQString n2);
+ void GetNames(TQString &n1,TQString &n2);
- QGroupBox* player_names;
- QLabel* text_player1;
- QLineEdit* edit_player1;
- QLabel* text_player2;
- QLineEdit* edit_player2;
- QPushButton* PushButton1;
- QPushButton* PushButton2;
+ TQGroupBox* player_names;
+ TQLabel* text_player1;
+ TQLineEdit* edit_player1;
+ TQLabel* text_player2;
+ TQLineEdit* edit_player2;
+ TQPushButton* PushButton1;
+ TQPushButton* PushButton2;
protected:
- QHBoxLayout* hbox;
- QHBoxLayout* hbox_2;
- QHBoxLayout* hbox_3;
- QHBoxLayout* hbox_4;
- QVBoxLayout* vbox;
- QVBoxLayout* vbox_2;
- QVBoxLayout* vbox_3;
+ TQHBoxLayout* hbox;
+ TQHBoxLayout* hbox_2;
+ TQHBoxLayout* hbox_3;
+ TQHBoxLayout* hbox_4;
+ TQVBoxLayout* vbox;
+ TQVBoxLayout* vbox_2;
+ TQVBoxLayout* vbox_3;
};
#endif // NAMEDLG_H
diff --git a/lskat/lskat/networkdlg.cpp b/lskat/lskat/networkdlg.cpp
index f43a1fd9..16e1716a 100644
--- a/lskat/lskat/networkdlg.cpp
+++ b/lskat/lskat/networkdlg.cpp
@@ -16,20 +16,20 @@
#include "networkdlg.h"
-#include <qspinbox.h>
-#include <qlineedit.h>
-#include <qcombobox.h>
-#include <qbuttongroup.h>
-#include <qwidgetstack.h>
+#include <tqspinbox.h>
+#include <tqlineedit.h>
+#include <tqcombobox.h>
+#include <tqbuttongroup.h>
+#include <tqwidgetstack.h>
extern const char* LSKAT_SERVICE;
// Create the dialog
-NetworkDlg::NetworkDlg( QWidget *parent, const char *name )
+NetworkDlg::NetworkDlg( TQWidget *parent, const char *name )
: NetworkDlgBase( parent, name, TRUE )
{
- browser = new DNSSD::ServiceBrowser(QString::fromLatin1(LSKAT_SERVICE));
- connect(browser,SIGNAL(finished()),SLOT(gamesFound()));
+ browser = new DNSSD::ServiceBrowser(TQString::fromLatin1(LSKAT_SERVICE));
+ connect(browser,TQT_SIGNAL(finished()),TQT_SLOT(gamesFound()));
browser->startBrowse();
}
@@ -38,16 +38,16 @@ NetworkDlg::~NetworkDlg()
delete browser;
}
-void NetworkDlg::SetHost(const QString& host)
+void NetworkDlg::SetHost(const TQString& host)
{
hostname->setText(host);
}
-void NetworkDlg::SetName(const QString& name)
+void NetworkDlg::SetName(const TQString& name)
{
serverName->setText(name);
}
-QString NetworkDlg::QueryName() const
+TQString NetworkDlg::QueryName() const
{
return serverName->text();
}
@@ -62,9 +62,9 @@ void NetworkDlg::gamesFound()
bool autoselect=false;
if (!clientName->count() && group->selectedId()==1) autoselect=true;
clientName->clear();
- QStringList names;
- QValueList<DNSSD::RemoteService::Ptr>::ConstIterator itEnd = browser->services().end();
- for (QValueList<DNSSD::RemoteService::Ptr>::ConstIterator it = browser->services().begin();
+ TQStringList names;
+ TQValueList<DNSSD::RemoteService::Ptr>::ConstIterator itEnd = browser->services().end();
+ for (TQValueList<DNSSD::RemoteService::Ptr>::ConstIterator it = browser->services().begin();
it!=itEnd; ++it) names << (*it)->serviceName();
clientName->insertStringList(names);
if (autoselect && clientName->count()) gameSelected(0);
@@ -84,7 +84,7 @@ unsigned short NetworkDlg::QueryPort() const
return port->value();
}
-QString NetworkDlg::QueryHost() const
+TQString NetworkDlg::QueryHost() const
{
return hostname->text();
}
@@ -97,7 +97,7 @@ void NetworkDlg::toggleServerClient()
hostname->setEnabled(true);
}
else {
- hostname->setText(QString::null);
+ hostname->setText(TQString::null);
hostname->setEnabled(false);
}
}
diff --git a/lskat/lskat/networkdlg.h b/lskat/lskat/networkdlg.h
index fb180eeb..6efccd2f 100644
--- a/lskat/lskat/networkdlg.h
+++ b/lskat/lskat/networkdlg.h
@@ -17,7 +17,7 @@
#ifndef NETWORKDLG_H
#define NETWORKDLG_H
-#include <qstring.h>
+#include <tqstring.h>
#include <dnssd/servicebrowser.h>
#include "networkdlgbase.h"
@@ -27,14 +27,14 @@ class NetworkDlg : public NetworkDlgBase
Q_OBJECT
public:
- NetworkDlg(QWidget* parent=NULL, const char* name=NULL);
+ NetworkDlg(TQWidget* parent=NULL, const char* name=NULL);
~NetworkDlg();
- void SetName(const QString& name);
- void SetHost(const QString& host);
+ void SetName(const TQString& name);
+ void SetHost(const TQString& host);
void SetPort(unsigned short port);
- QString QueryName() const;
+ TQString QueryName() const;
unsigned short QueryPort() const;
- QString QueryHost() const;
+ TQString QueryHost() const;
protected:
virtual void toggleServerClient();
virtual void gameSelected(int nr);
diff --git a/lskat/lskatproc/KChildConnect.cpp b/lskat/lskatproc/KChildConnect.cpp
index 0308a3f0..6ea4b973 100644
--- a/lskat/lskatproc/KChildConnect.cpp
+++ b/lskat/lskatproc/KChildConnect.cpp
@@ -20,7 +20,7 @@
#include "KChildConnect.moc"
KChildConnect::KChildConnect()
- : QObject(0,0)
+ : TQObject(0,0)
{
input_pending=false;
inputbuffer="";
@@ -38,14 +38,14 @@ KR_STATUS KChildConnect::QueryStatus()
// Communication with process
bool KChildConnect::SendMsg(KEMessage *msg)
{
- QString sendstring=msg->ToString();
+ TQString sendstring=msg->ToString();
// Debug only
- if (msg->HasKey(QCString("KLogSendMsg")))
+ if (msg->HasKey(TQCString("KLogSendMsg")))
{
char *p;
int size;
FILE *fp;
- msg->GetData(QCString("KLogSendMsg"),p,size);
+ msg->GetData(TQCString("KLogSendMsg"),p,size);
if (p && (fp=fopen(p,"a")) )
{
fprintf(fp,"------------------------------------\n");
@@ -58,7 +58,7 @@ bool KChildConnect::SendMsg(KEMessage *msg)
}
// Send string to parent
-bool KChildConnect::Send(QString str)
+bool KChildConnect::Send(TQString str)
{
if (!str || str.length()<1) return true; // no need to send crap
printf("%s",str.latin1());
@@ -66,11 +66,11 @@ bool KChildConnect::Send(QString str)
return true;
}
-void KChildConnect::Receive(QString input)
+void KChildConnect::Receive(TQString input)
{
// Cut out CR
int len,pos;
- QString tmp;
+ TQString tmp;
// Call us recursive until there are no CR left
@@ -86,14 +86,14 @@ void KChildConnect::Receive(QString input)
}
// printf(" ---> KChildConnect::Receive: '%s'\n",(const char *)input);
- if (input==QString(KEMESSAGE_HEAD) && !input_pending)
+ if (input==TQString(KEMESSAGE_HEAD) && !input_pending)
{
input_pending=true;
inputcache.clear();
return ;
}
if (!input_pending) return ; // ignore
- if (input!=QString(KEMESSAGE_TAIL))
+ if (input!=TQString(KEMESSAGE_TAIL))
{
inputcache.append(input.latin1());
return;
@@ -104,7 +104,7 @@ void KChildConnect::Receive(QString input)
char *it;
for (it=inputcache.first();it!=0;it=inputcache.next())
{
- msg->AddString(QCString(it));
+ msg->AddString(TQCString(it));
}
// printf("+- CHILDprocess:: GOT MESSAGE::Emmiting slotReceiveMsg\n");
diff --git a/lskat/lskatproc/KChildConnect.h b/lskat/lskatproc/KChildConnect.h
index 9cad1a5d..37339218 100644
--- a/lskat/lskatproc/KChildConnect.h
+++ b/lskat/lskatproc/KChildConnect.h
@@ -9,8 +9,8 @@
#ifndef _KCHILDCONNECT_H_
#define _KCHILDCONNECT_H_
-#include <qobject.h>
-#include <qstrlist.h>
+#include <tqobject.h>
+#include <tqstrlist.h>
#include "KEMessage.h"
@@ -19,20 +19,20 @@ class KChildConnect: public QObject
Q_OBJECT
protected:
- QStrList inputcache;
+ TQStrList inputcache;
bool input_pending;
- QString inputbuffer;
+ TQString inputbuffer;
int ID;
public:
KChildConnect();
~KChildConnect();
- void Receive(QString input);
+ void Receive(TQString input);
int QueryID();
void SetID(int id);
virtual bool SendMsg(KEMessage *msg);
- virtual bool Send(QString str);
+ virtual bool Send(TQString str);
virtual KR_STATUS QueryStatus();
public slots:
diff --git a/lskat/lskatproc/KEMessage.cpp b/lskat/lskatproc/KEMessage.cpp
index db598573..ce8985f3 100644
--- a/lskat/lskatproc/KEMessage.cpp
+++ b/lskat/lskatproc/KEMessage.cpp
@@ -19,7 +19,7 @@
#include <stdlib.h>
#include "KEMessage.h"
-void KEMessage::AddEntry(QString key,KMessageEntry *entry)
+void KEMessage::AddEntry(TQString key,KMessageEntry *entry)
{
// printf(" AddingEntry: %s with data field %p\n",(char *)key,entry->QueryData());
if (!entry) return ;
@@ -27,7 +27,7 @@ void KEMessage::AddEntry(QString key,KMessageEntry *entry)
keys.append(key.latin1());
}
-void KEMessage::AddDataType(QString key,int size,const char *data,KGM_TYPE type)
+void KEMessage::AddDataType(TQString key,int size,const char *data,KGM_TYPE type)
{
// printf("AddDataType for %s size=%d\n",(const char *)key,size);
if (size<=0) return ;
@@ -37,28 +37,28 @@ void KEMessage::AddDataType(QString key,int size,const char *data,KGM_TYPE type)
AddEntry(key,entry);
}
-void KEMessage::AddData(QString key,short data)
+void KEMessage::AddData(TQString key,short data)
{
AddDataType(key,sizeof(short),(char *)&data,KGM_TYPE_SHORT);
}
-void KEMessage::AddData(QString key,long data)
+void KEMessage::AddData(TQString key,long data)
{
AddDataType(key,sizeof(long),(char *)&data,KGM_TYPE_LONG);
}
-void KEMessage::AddData(QString key,float data)
+void KEMessage::AddData(TQString key,float data)
{
AddDataType(key,sizeof(float),(char *)&data,KGM_TYPE_FLOAT);
}
-void KEMessage::AddData(QString key,const char *data,int size)
+void KEMessage::AddData(TQString key,const char *data,int size)
{
if (size<0) size=strlen(data)+1; // +1 for 0 Byte
AddDataType(key,size,data,KGM_TYPE_DATA);
}
-KGM_TYPE KEMessage::QueryType(QString key)
+KGM_TYPE KEMessage::QueryType(TQString key)
{
KMessageEntry *entry;
entry=dict.find(key);
@@ -66,7 +66,7 @@ KGM_TYPE KEMessage::QueryType(QString key)
return entry->QueryType();
}
-bool KEMessage::HasKey(QString key)
+bool KEMessage::HasKey(TQString key)
{
KMessageEntry *entry;
entry=dict.find(key);
@@ -74,7 +74,7 @@ bool KEMessage::HasKey(QString key)
return true;
}
-bool KEMessage::GetData(QString key,short &s)
+bool KEMessage::GetData(TQString key,short &s)
{
short *result;
KMessageEntry *entry;
@@ -87,7 +87,7 @@ bool KEMessage::GetData(QString key,short &s)
return true;
}
-bool KEMessage::GetData(QString key,long &l)
+bool KEMessage::GetData(TQString key,long &l)
{
long *result;
KMessageEntry *entry;
@@ -99,7 +99,7 @@ bool KEMessage::GetData(QString key,long &l)
return true;
}
-bool KEMessage::GetData(QString key,float &f)
+bool KEMessage::GetData(TQString key,float &f)
{
float *result;
KMessageEntry *entry;
@@ -112,7 +112,7 @@ bool KEMessage::GetData(QString key,float &f)
return true;
}
-bool KEMessage::GetData(QString key,char * &c,int &size)
+bool KEMessage::GetData(TQString key,char * &c,int &size)
{
KMessageEntry *entry;
entry=dict.find(key);
@@ -123,13 +123,13 @@ bool KEMessage::GetData(QString key,char * &c,int &size)
return true;
}
-QString KEMessage::EntryToString(char *key,KMessageEntry *entry)
+TQString KEMessage::EntryToString(char *key,KMessageEntry *entry)
{
- QString s,tmp;
+ TQString s,tmp;
int size,i;
KGM_TYPE type;
char *data;
- s=QCString("");
+ s=TQCString("");
if (!entry) return s;
size=entry->QuerySize();
type=entry->QueryType();
@@ -142,7 +142,7 @@ QString KEMessage::EntryToString(char *key,KMessageEntry *entry)
size,KEMESSAGE_SEP,
(int)type,KEMESSAGE_SEP);
*/
- tmp=QCString(key);
+ tmp=TQCString(key);
s+=tmp;
s+=KEMESSAGE_SEP;
tmp.sprintf("%d",size);
@@ -168,31 +168,31 @@ QString KEMessage::EntryToString(char *key,KMessageEntry *entry)
return s;
}
-QString KEMessage::StringToEntry(QString str,KMessageEntry *entry)
+TQString KEMessage::StringToEntry(TQString str,KMessageEntry *entry)
{
int pos,oldpos,cnt,len;
- QString key,size,type,data;
+ TQString key,size,type,data;
const char *p;
char *q;
char c;
len=KEMESSAGE_SEP.length();
- if (!entry) return QString();
+ if (!entry) return TQString();
pos=str.find(KEMESSAGE_SEP,0);
- if (pos<0) return QString(); // wrong format
+ if (pos<0) return TQString(); // wrong format
key=str.left(pos);
oldpos=pos;
pos=str.find(KEMESSAGE_SEP,oldpos+len);
- if (pos<0) return QString(); // wrong format
+ if (pos<0) return TQString(); // wrong format
size=str.mid(oldpos+len,pos-oldpos-len);
oldpos=pos;
pos=str.find(KEMESSAGE_SEP,oldpos+len);
- if (pos<0) return QString(); // wrong format
+ if (pos<0) return TQString(); // wrong format
type=str.mid(oldpos+len,pos-oldpos-len);
@@ -205,10 +205,10 @@ QString KEMessage::StringToEntry(QString str,KMessageEntry *entry)
// I hope this works with unicode strings as well
p=data.latin1();
q=(char *)calloc(data.length()/2,sizeof(char));
- if (!q) return QString();
+ if (!q) return TQString();
for(pos=0;pos<cnt;pos++)
{
- if (pos*2+1>(int)data.length()) return QString(); // SEVERE ERROR
+ if (pos*2+1>(int)data.length()) return TQString(); // SEVERE ERROR
c=*(p+2*pos)-'a' | ((*(p+2*pos+1)-'a')<<4);
q[pos]=c;
}
@@ -218,35 +218,35 @@ QString KEMessage::StringToEntry(QString str,KMessageEntry *entry)
return key;
}
-QString KEMessage::ToString()
+TQString KEMessage::ToString()
{
- QString s;
+ TQString s;
KMessageEntry *entry;
char *it;
s=KEMESSAGE_HEAD+KEMESSAGE_CR;
for (it=keys.first();it!=0;it=keys.next())
{
- entry=dict.find(QCString(it));
+ entry=dict.find(TQCString(it));
s+=EntryToString(it,entry);
}
s+=KEMESSAGE_TAIL+KEMESSAGE_CR;
return s;
}
-bool KEMessage::AddString(QString s)
+bool KEMessage::AddString(TQString s)
{
// break s into key,size and data
- QString key;
+ TQString key;
KMessageEntry *entry=new KMessageEntry;
key=StringToEntry(s,entry);
if (!key) return false;
AddEntry(key,entry);
return true;
}
-bool KEMessage::AddStringMsg(QString str)
+bool KEMessage::AddStringMsg(TQString str)
{
bool result;
- QString data;
+ TQString data;
int pos,oldpos,len;
len=KEMESSAGE_CR.length();
@@ -277,7 +277,7 @@ void KEMessage::RemoveAll()
dict.clear();
}
-void KEMessage::Remove(QString key)
+void KEMessage::Remove(TQString key)
{
keys.remove(key.latin1());
dict.remove(key);
@@ -287,7 +287,7 @@ uint KEMessage::QueryNumberOfKeys()
{
return keys.count();
}
-QStrList *KEMessage::QueryKeys()
+TQStrList *KEMessage::QueryKeys()
{
return &keys;
}
@@ -315,10 +315,10 @@ KEMessage &KEMessage::operator=(KEMessage &msg)
// printf("Assigning = KEMessage from %p to %p\n",&msg,this);
for (it=msg.keys.first();it!=0;it=msg.keys.next())
{
- entry=msg.dict.find(QCString(it));
+ entry=msg.dict.find(TQCString(it));
newentry=new KMessageEntry;
*newentry=*entry;
- AddEntry(QCString(it),newentry);
+ AddEntry(TQCString(it),newentry);
}
// return *newmsg;
diff --git a/lskat/lskatproc/KEMessage.h b/lskat/lskatproc/KEMessage.h
index 0a1913cc..9e4d6912 100644
--- a/lskat/lskatproc/KEMessage.h
+++ b/lskat/lskatproc/KEMessage.h
@@ -18,44 +18,44 @@
#define _KEMESSAGE_H_
#include <string.h>
-#include <qstring.h>
-#include <qstrlist.h>
-#include <qdict.h>
+#include <tqstring.h>
+#include <tqstrlist.h>
+#include <tqdict.h>
#include "KMessageEntry.h"
-#define KEMESSAGE_HEAD QString(QCString("BEGIN_V1000"))
-#define KEMESSAGE_TAIL QString(QCString("END_V1000"))
-#define KEMESSAGE_CR QString(QCString("\n"))
-#define KEMESSAGE_SEP QString(QCString(":::"))
+#define KEMESSAGE_HEAD TQString(TQCString("BEGIN_V1000"))
+#define KEMESSAGE_TAIL TQString(TQCString("END_V1000"))
+#define KEMESSAGE_CR TQString(TQCString("\n"))
+#define KEMESSAGE_SEP TQString(TQCString(":::"))
class KEMessage
{
private:
- QStrList keys;
- QDict<KMessageEntry> dict;
+ TQStrList keys;
+ TQDict<KMessageEntry> dict;
protected:
- void AddEntry(QString key,KMessageEntry *entry);
+ void AddEntry(TQString key,KMessageEntry *entry);
public:
- QStrList *QueryKeys();
+ TQStrList *QueryKeys();
uint QueryNumberOfKeys();
- void AddDataType(QString key,int size,const char *data,KGM_TYPE type);
- void AddData(QString key,short data);
- void AddData(QString key,long data);
- void AddData(QString key,float data);
- void AddData(QString key,const char *data,int size=-1);
- bool GetData(QString key,short &s);
- bool GetData(QString key,long &l);
- bool GetData(QString key,float &f);
- bool GetData(QString key,char * &c,int &size);
- bool HasKey(QString key);
- void Remove(QString key);
- KGM_TYPE QueryType(QString key);
- QString ToString();
- QString EntryToString(char *key,KMessageEntry *entry);
- QString StringToEntry(QString str,KMessageEntry *entry);
- bool AddString(QString s);
- bool AddStringMsg(QString str);
+ void AddDataType(TQString key,int size,const char *data,KGM_TYPE type);
+ void AddData(TQString key,short data);
+ void AddData(TQString key,long data);
+ void AddData(TQString key,float data);
+ void AddData(TQString key,const char *data,int size=-1);
+ bool GetData(TQString key,short &s);
+ bool GetData(TQString key,long &l);
+ bool GetData(TQString key,float &f);
+ bool GetData(TQString key,char * &c,int &size);
+ bool HasKey(TQString key);
+ void Remove(TQString key);
+ KGM_TYPE QueryType(TQString key);
+ TQString ToString();
+ TQString EntryToString(char *key,KMessageEntry *entry);
+ TQString StringToEntry(TQString str,KMessageEntry *entry);
+ bool AddString(TQString s);
+ bool AddStringMsg(TQString str);
void RemoveAll();
~KEMessage();
KEMessage();
diff --git a/lskat/lskatproc/KInputChildProcess.cpp b/lskat/lskatproc/KInputChildProcess.cpp
index a821aa7a..13e00b93 100644
--- a/lskat/lskatproc/KInputChildProcess.cpp
+++ b/lskat/lskatproc/KInputChildProcess.cpp
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <qstring.h>
+#include <tqstring.h>
#include "KInputChildProcess.h"
#include "KInputChildProcess.moc"
@@ -21,7 +21,7 @@ KInputChildProcess::~KInputChildProcess()
delete childConnect;
}
KInputChildProcess::KInputChildProcess(int size_buffer)
- : QObject(0,0)
+ : TQObject(0,0)
{
buffersize=size_buffer;
if (buffersize<1) buffersize=1024;
@@ -32,12 +32,12 @@ KInputChildProcess::KInputChildProcess(int size_buffer)
bool KInputChildProcess::exec()
{
int pos;
- QString s;
+ TQString s;
childConnect=new KChildConnect;
if (!childConnect) return false;
- connect(childConnect,SIGNAL(signalReceiveMsg(KEMessage *,int)),
- this,SLOT(slotReceiveMsg(KEMessage *,int)));
+ connect(childConnect,TQT_SIGNAL(signalReceiveMsg(KEMessage *,int)),
+ this,TQT_SLOT(slotReceiveMsg(KEMessage *,int)));
do
{
// Wait for input
diff --git a/lskat/lskatproc/KInputChildProcess.h b/lskat/lskatproc/KInputChildProcess.h
index b4694df5..2f964e71 100644
--- a/lskat/lskatproc/KInputChildProcess.h
+++ b/lskat/lskatproc/KInputChildProcess.h
@@ -17,7 +17,7 @@
#ifndef _KINPUTCHILDPROCESS_H_
#define _KINPUTCHILDPROCESS_H_
-#include <qobject.h>
+#include <tqobject.h>
#include "KEMessage.h"
#include "KChildConnect.h"
@@ -28,7 +28,7 @@ class KInputChildProcess : public QObject
private:
char *buffer;
- QString inputbuffer;
+ TQString inputbuffer;
int buffersize;
bool terminateChild;
protected:
diff --git a/lskat/lskatproc/lskatproc.cpp b/lskat/lskatproc/lskatproc.cpp
index c1fdcfba..7f40bd69 100644
--- a/lskat/lskatproc/lskatproc.cpp
+++ b/lskat/lskatproc/lskatproc.cpp
@@ -379,17 +379,17 @@ short x,y;
SendDebug("Receiv Msg");
// end of process
- if (msg->HasKey(QCString("Terminate")))
+ if (msg->HasKey(TQCString("Terminate")))
{
Terminate();
}
// Init of process
- if (msg->HasKey(QCString("Init")))
+ if (msg->HasKey(TQCString("Init")))
{
// No init necessary
}
// Make a move
- if (msg->HasKey(QCString("Cards")))
+ if (msg->HasKey(TQCString("Cards")))
{
SendDebug("Process HasKey(Cards)");
// new game object
@@ -422,9 +422,9 @@ short x,y;
// report move
msg->RemoveAll();
- msg->AddData(QCString("Move"),game.currentplayer);
- msg->AddData(QCString("MoveX"),x);
- msg->AddData(QCString("MoveY"),y);
+ msg->AddData(TQCString("Move"),game.currentplayer);
+ msg->AddData(TQCString("MoveX"),x);
+ msg->AddData(TQCString("MoveY"),y);
//timee=time(0);
// Sleep a minimum amount to slow down moves
@@ -451,29 +451,29 @@ int lgame::ExtractGame(KEMessage *msg)
char *p;
int size;
- msg->GetData(QCString("Startplayer"),startplayer);
- msg->GetData(QCString("CurrentPlayer"),currentplayer);
- msg->GetData(QCString("Cards"),p,size);
- msg->GetData(QCString("Level"),level);
+ msg->GetData(TQCString("Startplayer"),startplayer);
+ msg->GetData(TQCString("CurrentPlayer"),currentplayer);
+ msg->GetData(TQCString("Cards"),p,size);
+ msg->GetData(TQCString("Level"),level);
level--; // start with level 0
for (i=0;i<NO_OF_CARDS;i++)
{
card[i]=((int *)p)[i];
}
- msg->GetData(QCString("Height"),p,size);
+ msg->GetData(TQCString("Height"),p,size);
for (i=0;i<NO_OF_TILES;i++)
{
cardheight[i]=((int *)p)[i];
}
- msg->GetData(QCString("Trump"),tmp);
+ msg->GetData(TQCString("Trump"),tmp);
trump=(CCOLOUR)tmp;
short mm;
- msg->GetData(QCString("CurrentMove"),mm);
+ msg->GetData(TQCString("CurrentMove"),mm);
curmove[1-currentplayer]=(int)mm;
curmove[currentplayer]=-1;
- msg->GetData(QCString("No"),movenumber);
- msg->GetData(QCString("Sc1"),score[0]);
- msg->GetData(QCString("Sc2"),score[1]);
+ msg->GetData(TQCString("No"),movenumber);
+ msg->GetData(TQCString("Sc1"),score[0]);
+ msg->GetData(TQCString("Sc2"),score[1]);
return 1;
}
@@ -586,7 +586,7 @@ int lskatproc::GetComputerMove(lgame game,short &x,short &y,int rek)
void lskatproc::SendDebug(const char *s)
{
KEMessage *msg=new KEMessage;
- msg->AddData(QCString("Debug"),s);
+ msg->AddData(TQCString("Debug"),s);
// msg->AddData("KLogSendMsg","debug.log");
// DEBUG
// SendMsg(msg);