Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

paragui.h

Go to the documentation of this file.
00001 /*
00002     ParaGUI - crossplatform widgetset
00003     Copyright (C) 2000,2001,2002  Alexander Pipelka
00004  
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009  
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014  
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  
00019     Alexander Pipelka
00020     pipelka@teleweb.at
00021  
00022     Last Update:      $Author: mbickel $
00023     Update Date:      $Date: 2008-02-01 12:19:52 $
00024     Source File:      $Source: /home/cvspsrv/cvsroot/games/asc/source/libs/paragui/include/paragui.h,v $
00025     CVS/RCS Revision: $Revision: 1.3 $
00026     Status:           $State: Exp $
00027 */
00028 
00040 #ifndef PARAGUI_H
00041 #define PARAGUI_H
00042 
00043 //
00044 // SDL includes
00045 //
00046 #include "SDL.h"
00047 #include "SDL_thread.h"
00048 
00049 //
00050 // undefine PACKAGE, VERSION (collision with others)
00051 //
00052 #undef PACKAGE
00053 #undef VERSION
00054 
00055 #define PG_VERSIONNUM(X, Y, Z) ((X)*10000 + (Y)*100 + (Z))
00056 
00057 //
00058 // include system configuration
00059 //
00060 
00061 // WIN32
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 // MacOS
00067 #elif defined(__MACOS__)
00068         #include "paraconfig_macos.h"
00069         #define DLLLOCAL
00070 
00071 // GNU GCC
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 // STL map / hash_map
00086 //
00087 #if defined(HAVE_HASH_MAP) && 0 
00088    // we are deactivating usage of HASH_MAP for compatibility reasons
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 // Modelled after g++ stdc++ v3
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 // Replacement for strdup
00129 //
00130 #ifndef HAVE_STRDUP
00131 extern "C" {
00132         char* strdup(const char* s);
00133 }
00134 #endif
00135 
00136 //
00137 // Replacement for fnmatch
00138 //
00139 #ifndef HAVE_FNMATCH
00140 extern "C" {
00141         /* Bits set in the FLAGS argument to `fnmatch'.  */
00142 #define FNM_PATHNAME    (1 << 0) /* No wildcard can ever match `/'.  */
00143         #define FNM_NOESCAPE    (1 << 1) /* Backslashes don't quote special chars.  */
00144         #define FNM_PERIOD      (1 << 2) /* Leading `.' is matched only explicitly.  */
00145         #define __FNM_FLAGS     (FNM_PATHNAME|FNM_NOESCAPE|FNM_PERIOD)
00146 
00147         /* Value returned by `fnmatch' if STRING does not match PATTERN.  */
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

Generated on Tue Jun 24 01:27:46 2008 for Advanced Strategic Command by  doxygen 1.4.2