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
00041
00043 #define DEF_RAND_MIN 1
00045 #define DEF_RAND_MAX 10
00047 #define DEF_NUM_CITIES 5
00048
00052 #ifdef Q_OS_WINCE
00053 #define DEF_USE_NATIVE_DIALOGS false
00054 #else
00055 #define DEF_USE_NATIVE_DIALOGS true
00056 #endif // Q_OS_WINCE
00058 #define DEF_AUTOSIZE true
00060 #define DEF_SAVEPOS false
00062 #define DEF_FRACTIONAL_RANDOM false
00064 #define DEF_SHOW_MATRIX true
00066 #define DEF_USE_SHOW_MATRIX_LIMIT true
00068 #define DEF_SHOW_MATRIX_LIMIT 15
00070 #define DEF_SCROLL_TO_END true
00072 #define DEF_FONT_FAMILY "Courier New"
00074 #define DEF_FONT_SIZE 10
00076 #define DEF_FONT_COLOR Qt::black
00077
00079 #define MAX_NUM_CITIES 50
00081 #define MAX_RAND_VALUE 1000
00082
00083
00092 #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
00093 #define PATH_I18N "/usr/share/tspsg/i18n"
00094 #define PATH_DOCS "/usr/share/doc/tspsg"
00095 #else
00096 #define PATH_I18N "i18n"
00097 #define PATH_DOCS "help"
00098 #endif // Q_OS_LINUX
00099
00101 #define TSPT quint32(0x54535054)
00103 #define TSPT_VERSION quint8(1)
00105 #define TSPT_META_VERSION quint8(1)
00107 #define TSPT_META_SIZE 2
00109 #define ZKT quint16(0x5A4B)
00111 #define ZKT_VERSION quint8(1)
00112
00120 #ifdef INFINITY
00121 #undef INFINITY
00122 #endif
00123 #define INFINITY 1.7E+308
00125 #define INFSTR "---"
00126
00127
00133 inline bool isInteger(double x)
00134 {
00135 double i;
00136 return (modf(x, &i) == 0.0);
00137 }
00138
00139
00140
00141 #if DEF_NUM_CITIES > MAX_NUM_CITIES
00142 #undef DEF_NUM_CITIES
00143 #define DEF_NUM_CITIES MAX_NUM_CITIES
00144 #endif
00145
00146 #if DEF_RAND_MAX > MAX_RAND_VALUE
00147 #undef DEF_RAND_MAX
00148 #define DEF_RAND_MAX MAX_RAND_VALUE
00149 #endif
00150
00151 #if DEF_RAND_MIN > DEF_RAND_MAX
00152 #undef DEF_RAND_MIN
00153 #define DEF_RAND_MIN DEF_RAND_MAX
00154 #endif
00155
00156 #endif // GLOBALS_H