Go to the documentation of this file.00001
00028 #ifndef GLOBALS_H
00029 #define GLOBALS_H
00030
00031
00032 #include <QtCore>
00033 #if QT_VERSION < 0x040500
00034 #error You are using Qt version < 4.5 but minimum required version is 4.5.0. Compilation aborted.
00035 #endif
00036 #if defined(Q_WS_WINCE_WM) || defined(Q_WS_S60) || defined(Q_WS_MAEMO_5) || defined(Q_WS_SIMULATOR)
00037
00038 #define HANDHELD
00039 #define QT_NO_STATUSTIP
00040 #endif
00041 #include <QtGui>
00042 #if defined(QT_NO_SVG) && !defined(NOSVG)
00043 #define NOSVG
00044 #endif
00045 #if !defined(NOSVG)
00046 #include <QtSvg>
00047 #endif // NOSVG
00048
00049 #ifndef HANDHELD
00050 #include "qttoolbardialog.h"
00051 #endif
00052
00053
00054 #include "version.h"
00055
00056 #include "os.h"
00057
00058 #include "defaults.h"
00059
00060 #include "tspsolver.h"
00061 #ifdef Q_WS_WIN32
00062
00063 #include "qtwin.h"
00064 #endif // Q_WS_WIN32
00065
00066
00068 #define MAX_NUM_CITIES 50
00069
00070 #define MAX_RAND_VALUE 1000
00071
00072
00077 #ifndef PATH_L10N
00078 #define PATH_L10N "l10n"
00079 #endif // PATH_L10N
00080
00084 #ifndef PATH_DOCS
00085 #define PATH_DOCS "help"
00086 #endif // PATH_DOCS
00087
00089 #define TSPT quint32(0x54535054)
00090
00091 #define TSPT_VERSION quint8(1)
00092
00093 #define TSPT_META_VERSION quint8(1)
00094
00095 #define TSPT_META_SIZE 2
00096
00097 #define ZKT quint16(0x5A4B)
00098
00099 #define ZKT_VERSION quint8(1)
00100
00102 #define INFSTR "---"
00103
00104
00110 inline bool isInteger(double x)
00111 {
00112 double i;
00113 return (modf(x, &i) == 0.0);
00114 }
00115
00122 inline bool hasUpdater()
00123 {
00124 #ifdef Q_WS_WIN32
00125 return QFile::exists("updater/Update.exe");
00126 #else // Q_WS_WIN32
00127 return false;
00128 #endif // Q_WS_WIN32
00129 }
00130
00131 #ifdef Q_WS_WIN32
00132
00139 void toggleStyle(QWidget *widget, bool enable);
00140 #endif // Q_WS_WIN32
00141
00142 #ifndef DOXYGEN_EXCLUDE
00143
00144 #ifdef HANDHELD
00145 #define ICON_SIZE "32x32"
00146 #define ICON_FORMAT "png"
00147 #else
00148 #define ICON_SIZE "128x128"
00149 #define ICON_FORMAT "png"
00150 #endif
00151
00152 #if QT_VERSION >= 0x040600
00153 #define GET_ICON(x) QIcon::fromTheme(x, QIcon(":/images/icons/"ICON_SIZE"/"x"."ICON_FORMAT))
00154 #else
00155 #define GET_ICON(x) QIcon(":/images/icons/"ICON_SIZE"/"x"."ICON_FORMAT)
00156 #endif
00157
00158
00159
00160 #if DEF_NUM_CITIES > MAX_NUM_CITIES
00161 #undef DEF_NUM_CITIES
00162 #define DEF_NUM_CITIES MAX_NUM_CITIES
00163 #endif
00164
00165 #if DEF_RAND_MAX > MAX_RAND_VALUE
00166 #undef DEF_RAND_MAX
00167 #define DEF_RAND_MAX MAX_RAND_VALUE
00168 #endif
00169
00170 #if DEF_RAND_MIN > DEF_RAND_MAX
00171 #undef DEF_RAND_MIN
00172 #define DEF_RAND_MIN DEF_RAND_MAX
00173 #endif
00174
00175 #endif // DOXYGEN_EXCLUDE
00176
00177 #endif // GLOBALS_H