00001
00028 #ifndef GLOBALS_H
00029 #define GLOBALS_H
00030
00031
00032 #include <QtCore>
00033 #include <QtGui>
00034 #include <limits>
00035
00036
00037 #include "version.h"
00038
00039 #include "os.h"
00040
00041 #include "defaults.h"
00042 #ifdef Q_OS_WIN32
00043
00044 #include "qtwin.h"
00045 #endif // Q_OS_WIN32
00046
00047
00049 #define MAX_NUM_CITIES 50
00051 #define MAX_RAND_VALUE 1000
00052
00053
00058 #ifndef PATH_L10N
00059 #define PATH_L10N "l10n"
00060 #endif // PATH_L10N
00061
00065 #ifndef PATH_DOCS
00066 #define PATH_DOCS "help"
00067 #endif // PATH_DOCS
00068
00070 #define TSPT quint32(0x54535054)
00072 #define TSPT_VERSION quint8(1)
00074 #define TSPT_META_VERSION quint8(1)
00076 #define TSPT_META_SIZE 2
00078 #define ZKT quint16(0x5A4B)
00080 #define ZKT_VERSION quint8(1)
00081
00089 #ifdef INFINITY
00090 #undef INFINITY
00091 #endif
00092 #define INFINITY std::numeric_limits<double>::infinity()
00094 #define INFSTR "---"
00095
00096
00102 inline bool isInteger(double x)
00103 {
00104 double i;
00105 return (modf(x, &i) == 0.0);
00106 }
00107
00108 #ifdef Q_OS_WIN32
00109
00116 void toggleStyle(QWidget *widget, bool enable);
00117 #endif // Q_OS_WIN32
00118
00119 #if defined(Q_OS_WINCE_WM) || defined(Q_OS_SYMBIAN)
00121 #define HANDHELD
00122 #endif
00123
00124
00125
00126 #if DEF_NUM_CITIES > MAX_NUM_CITIES
00127 #undef DEF_NUM_CITIES
00128 #define DEF_NUM_CITIES MAX_NUM_CITIES
00129 #endif
00130
00131 #if DEF_RAND_MAX > MAX_RAND_VALUE
00132 #undef DEF_RAND_MAX
00133 #define DEF_RAND_MAX MAX_RAND_VALUE
00134 #endif
00135
00136 #if DEF_RAND_MIN > DEF_RAND_MAX
00137 #undef DEF_RAND_MIN
00138 #define DEF_RAND_MIN DEF_RAND_MAX
00139 #endif
00140
00141 #endif // GLOBALS_H