00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00040 #ifndef PARAGUI_H
00041 #define PARAGUI_H
00042
00043
00044
00045
00046 #include "SDL.h"
00047 #include "SDL_thread.h"
00048
00049
00050
00051
00052 #undef PACKAGE
00053 #undef VERSION
00054
00055 #define PG_VERSIONNUM(X, Y, Z) ((X)*10000 + (Y)*100 + (Z))
00056
00057
00058
00059
00060
00061
00062 #if (defined(WIN32) || defined(__WIN32__)) && (defined(__MINGW32__) || defined(_MSC_VER) || defined(__BCPLUSPLUS__) || defined(__MWERKS__))
00063 #include "paraconfig_win32.h"
00064 #define DLLLOCAL
00065
00066
00067 #elif defined(__MACOS__)
00068 #include "paraconfig_macos.h"
00069 #define DLLLOCAL
00070
00071
00072 #else
00073 #include "paraconfig_gnu.h"
00074 #if PG_VERSIONNUM(__GNUC__, __GNUC_MINOR__, 0) >= PG_VERSIONNUM(4, 0, 0)
00075 #undef DECLSPEC
00076 #define DECLSPEC __attribute__ ((visibility("default")))
00077 #define DLLLOCAL __attribute__ ((visibility("hidden")))
00078 #else
00079 #define DECLSPEC
00080 #define DLLLOCAL
00081 #endif
00082 #endif
00083
00084
00085
00086
00087 #if defined(HAVE_HASH_MAP) && 0
00088
00089 #define HASH_MAP_INC <hash_map>
00090 #define MAP_INC <hash_map>
00091 #define STL_MAP std::hash_map
00092 #elif defined(HAVE_EXT_HASH_MAP) && 0
00093 #define HASH_MAP_INC <ext/hash_map>
00094 #define MAP_INC <ext/hash_map>
00095 #if PG_VERSIONNUM(__GNUC__, __GNUC_MINOR__, 0) >= PG_VERSIONNUM(3, 1, 0)
00096 #define STL_MAP __gnu_cxx::hash_map
00097 #else
00098 #define STL_MAP std::hash_map
00099 #endif
00100 #else
00101 #define MAP_INC <map>
00102 #define STL_MAP std::map
00103 #endif
00104
00105
00106
00107
00108
00109 #if defined(EXCEPTIONS_ENABLED) || defined(__EXCEPTIONS)
00110 #define PG_TRY try
00111 #define PG_CATCH_ALL catch(...)
00112 #define PG_THROW(_ex_) throw _ex_
00113 #define PG_RETHROW throw
00114 #define PG_NOTHROW throw()
00115 #define PG_UNWIND(action) catch(...) {action; throw;}
00116 #define PG_CATCH(_ex_, _name_) catch(_ex_& _name_)
00117 #else
00118 #define PG_TRY
00119 #define PG_CATCH_ALL if (false)
00120 #define PG_THROW(_ex_)
00121 #define PG_RETHROW
00122 #define PG_NOTHROW
00123 #define PG_UNWIND
00124 #define PG_CATCH(_ex_, _name_) if (false)
00125 #endif
00126
00127
00128
00129
00130 #ifndef HAVE_STRDUP
00131 extern "C" {
00132 char* strdup(const char* s);
00133 }
00134 #endif
00135
00136
00137
00138
00139 #ifndef HAVE_FNMATCH
00140 extern "C" {
00141
00142 #define FNM_PATHNAME (1 << 0)
00143 #define FNM_NOESCAPE (1 << 1)
00144 #define FNM_PERIOD (1 << 2)
00145 #define __FNM_FLAGS (FNM_PATHNAME|FNM_NOESCAPE|FNM_PERIOD)
00146
00147
00148 #define FNM_NOMATCH 1
00149
00150 int fnmatch(const char *, const char *, int);
00151 }
00152 #else
00153 #include <fnmatch.h>
00154 #endif
00155
00160 #define PG_WIDGETID_INTERNAL 10000
00161
00165 #define PG_MAX(a, b) ((a<b) ? b : a)
00166
00170 #define PG_MIN(a, b) ((a<b) ? a : b)
00171
00172 #include <string>
00173
00174 static const std::string PG_NULLSTR = "";
00175
00176 #endif // PARAGUI_H