00001
00028 #ifndef GLOBALS_H
00029 #define GLOBALS_H
00030
00031
00032 #include <QtCore>
00033 #include <QtGui>
00034 #if !defined(NOSVG) && (QT_VERSION >= 0x040500)
00035 #include <QtSvg>
00036 #endif // NOSVG && QT_VERSION >= 0x040500
00037
00038
00039 #include "version.h"
00040
00041 #include "os.h"
00042
00043 #include "defaults.h"
00044
00045 #include "tspsolver.h"
00046 #ifdef Q_OS_WIN32
00047
00048 #include "qtwin.h"
00049 #endif // Q_OS_WIN32
00050
00051
00053 #define MAX_NUM_CITIES 50
00055 #define MAX_RAND_VALUE 1000
00056
00057
00062 #ifndef PATH_L10N
00063 #define PATH_L10N "l10n"
00064 #endif // PATH_L10N
00065
00069 #ifndef PATH_DOCS
00070 #define PATH_DOCS "help"
00071 #endif // PATH_DOCS
00072
00074 #define TSPT quint32(0x54535054)
00076 #define TSPT_VERSION quint8(1)
00078 #define TSPT_META_VERSION quint8(1)
00080 #define TSPT_META_SIZE 2
00082 #define ZKT quint16(0x5A4B)
00084 #define ZKT_VERSION quint8(1)
00085
00087 #define INFSTR "---"
00088
00089
00095 inline bool isInteger(double x)
00096 {
00097 double i;
00098 return (modf(x, &i) == 0.0);
00099 }
00100
00101 #ifdef Q_OS_WIN32
00102
00109 void toggleStyle(QWidget *widget, bool enable);
00110 #endif // Q_OS_WIN32
00111
00112 #if defined(Q_OS_WINCE_WM) || defined(Q_OS_SYMBIAN)
00114 #define HANDHELD
00115 #endif
00116
00117
00118
00119 #if DEF_NUM_CITIES > MAX_NUM_CITIES
00120 #undef DEF_NUM_CITIES
00121 #define DEF_NUM_CITIES MAX_NUM_CITIES
00122 #endif
00123
00124 #if DEF_RAND_MAX > MAX_RAND_VALUE
00125 #undef DEF_RAND_MAX
00126 #define DEF_RAND_MAX MAX_RAND_VALUE
00127 #endif
00128
00129 #if DEF_RAND_MIN > DEF_RAND_MAX
00130 #undef DEF_RAND_MIN
00131 #define DEF_RAND_MIN DEF_RAND_MAX
00132 #endif
00133
00134 #endif // GLOBALS_H