00001
00028 #ifndef GLOBALS_H
00029 #define GLOBALS_H
00030
00031
00032 #include <QtCore>
00033 #include <QtGui>
00034
00035
00036 #include "version.h"
00037
00038 #include "os.h"
00039
00040 #include "defaults.h"
00041 #ifdef Q_OS_WIN32
00042
00043 #include "qtwin.h"
00044 #endif // Q_OS_WIN32
00045
00046
00048 #define MAX_NUM_CITIES 50
00050 #define MAX_RAND_VALUE 1000
00051
00052
00057 #ifndef PATH_L10N
00058 #define PATH_L10N "l10n"
00059 #endif // PATH_L10N
00060
00064 #ifndef PATH_DOCS
00065 #define PATH_DOCS "help"
00066 #endif // PATH_DOCS
00067
00069 #define TSPT quint32(0x54535054)
00071 #define TSPT_VERSION quint8(1)
00073 #define TSPT_META_VERSION quint8(1)
00075 #define TSPT_META_SIZE 2
00077 #define ZKT quint16(0x5A4B)
00079 #define ZKT_VERSION quint8(1)
00080
00088 #ifdef INFINITY
00089 #undef INFINITY
00090 #endif
00091 #define INFINITY 1.7E+308
00093 #define INFSTR "---"
00094
00095
00101 inline bool isInteger(double x)
00102 {
00103 double i;
00104 return (modf(x, &i) == 0.0);
00105 }
00106
00107
00108
00109 #if DEF_NUM_CITIES > MAX_NUM_CITIES
00110 #undef DEF_NUM_CITIES
00111 #define DEF_NUM_CITIES MAX_NUM_CITIES
00112 #endif
00113
00114 #if DEF_RAND_MAX > MAX_RAND_VALUE
00115 #undef DEF_RAND_MAX
00116 #define DEF_RAND_MAX MAX_RAND_VALUE
00117 #endif
00118
00119 #if DEF_RAND_MIN > DEF_RAND_MAX
00120 #undef DEF_RAND_MIN
00121 #define DEF_RAND_MIN DEF_RAND_MAX
00122 #endif
00123
00124 #endif // GLOBALS_H