summaryrefslogtreecommitdiffstats
path: root/libksirtet/lib/defines.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitc90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch)
tree6d8391395bce9eaea4ad78958617edb20c6a7573 /libksirtet/lib/defines.h
downloadtdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz
tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libksirtet/lib/defines.h')
-rw-r--r--libksirtet/lib/defines.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/libksirtet/lib/defines.h b/libksirtet/lib/defines.h
new file mode 100644
index 00000000..9015c6b1
--- /dev/null
+++ b/libksirtet/lib/defines.h
@@ -0,0 +1,35 @@
+#ifndef DEFINES_H
+#define DEFINES_H
+
+#include <kmessagebox.h>
+#include <kextsock.h>
+
+// constants
+#define TALKER_MAX_LENGTH 35
+#define NAME_MAX_LENGTH 15
+
+// config keys
+#define MP_GROUP "Multi-Players"
+#define MP_GAMETYPE "Game type"
+#define MP_PLAYER_NAME "Player name #%1"
+#define MP_PLAYER_TYPE "Player type #%1"
+#define MP_SERVER_ADDRESS "Server address"
+#define MP_PORT "Port"
+
+void errorBox(const QString &msg1, const QString &msg2, QWidget *parent);
+QString socketError(const KExtendedSocket *socket);
+bool checkSocket(int res, const KExtendedSocket *,
+ const QString &msg, QWidget *parent);
+
+#define R_ERROR_BOX(msg1, msg2) { \
+ errorBox(msg1, msg2, this); \
+ return; \
+}
+
+template <class Type>
+bool XOR(Type a, Type b)
+{
+ return ( (!a && b) || (a && !b) );
+}
+
+#endif // DEFINES_H