00001 /*********************************************************************** 00002 filename: CEGUIBase.h 00003 created: 20/2/2004 00004 author: Paul D Turner 00005 00006 purpose: Base include used within the system 00007 This contains various lower level bits required 00008 by other parts of the system. All other library 00009 headers will include this file. 00010 *************************************************************************/ 00011 /*************************************************************************** 00012 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team 00013 * 00014 * Permission is hereby granted, free of charge, to any person obtaining 00015 * a copy of this software and associated documentation files (the 00016 * "Software"), to deal in the Software without restriction, including 00017 * without limitation the rights to use, copy, modify, merge, publish, 00018 * distribute, sublicense, and/or sell copies of the Software, and to 00019 * permit persons to whom the Software is furnished to do so, subject to 00020 * the following conditions: 00021 * 00022 * The above copyright notice and this permission notice shall be 00023 * included in all copies or substantial portions of the Software. 00024 * 00025 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00026 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00027 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00028 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 00029 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00030 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00031 * OTHER DEALINGS IN THE SOFTWARE. 00032 ***************************************************************************/ 00033 #ifndef _CEGUIBase_h_ 00034 #define _CEGUIBase_h_ 00035 00036 #include <cassert> 00037 00038 // bring in configuration options 00039 #include "CEGUIConfig.h" 00040 00041 // add CEGUI version defines 00042 #include "CEGUIVersion.h" 00043 00044 /************************************************************************* 00045 Dynamic Library import / export control conditional 00046 (Define CEGUIBASE_EXPORTS to export symbols, else they are imported) 00047 *************************************************************************/ 00048 #if defined( __WIN32__ ) || defined( _WIN32 ) 00049 # ifdef CEGUIBASE_EXPORTS 00050 # define CEGUIEXPORT __declspec(dllexport) 00051 # else 00052 # define CEGUIEXPORT __declspec(dllimport) 00053 # endif 00054 # define CEGUIPRIVATE 00055 #else 00056 # define CEGUIEXPORT 00057 # define CEGUIPRIVATE 00058 #endif 00059 00060 00061 // totally kill this warning (debug info truncated to 255 chars etc...) on <= VC6 00062 #if defined(_MSC_VER) && (_MSC_VER <= 1200) 00063 # pragma warning(disable : 4786) 00064 #endif 00065 00066 00067 // Detect macros for min / max and undefine (with a warning where possible) 00068 #if defined(max) 00069 # if defined(_MSC_VER) 00070 # pragma message("Macro definition of max detected - undefining") 00071 # elif defined (__GNUC__) 00072 # warning ("Macro definition of max detected - undefining") 00073 # endif 00074 # undef max 00075 #endif 00076 #if defined(min) 00077 # if defined(_MSC_VER) 00078 # pragma message("Macro definition of min detected - undefining") 00079 # elif defined (__GNUC__) 00080 # warning ("Macro definition of min detected - undefining") 00081 # endif 00082 # undef min 00083 #endif 00084 00085 00086 // include this to see if it defines _STLPORT_VERION 00087 # include <string> 00088 00089 // fix to undefine _STLP_DEBUG if STLport is not actually being used 00090 // (resolves some unresolved externals concerning boost) 00091 #if defined(_STLP_DEBUG) && defined(_MSC_VER) && (_MSC_VER >= 1200) 00092 # if !defined(_STLPORT_VERSION) 00093 # undef _STLP_DEBUG 00094 # endif 00095 #endif 00096 00097 00098 // The following defines macros used within CEGUI for std::min/std::max 00099 // usage, and is done as a compatibility measure for VC6 with native STL. 00100 #if defined(_MSC_VER) && (_MSC_VER <= 1200) && !defined(_STLPORT_VERSION) 00101 # define ceguimin std::_cpp_min 00102 # define ceguimax std::_cpp_max 00103 #else 00104 # define ceguimin std::min 00105 # define ceguimax std::max 00106 #endif 00107 00108 00109 /************************************************************************* 00110 Documentation for the CEGUI namespace itself 00111 *************************************************************************/ 00119 namespace CEGUI 00120 { 00121 00122 /************************************************************************* 00123 Simplification of some 'unsigned' types 00124 *************************************************************************/ 00125 typedef unsigned long ulong; 00126 typedef unsigned short ushort; 00127 typedef unsigned int uint; 00128 typedef unsigned char uchar; 00129 00130 typedef unsigned int uint32; 00131 typedef unsigned short uint16; 00132 typedef unsigned char uint8; 00133 00134 00135 /************************************************************************* 00136 System wide constants 00137 *************************************************************************/ 00138 static const float DefaultNativeHorzRes = 640.0f; 00139 static const float DefaultNativeVertRes = 480.0f; 00140 00141 00142 /************************************************************************* 00143 Additional typedefs 00144 *************************************************************************/ 00145 typedef std::ostream OutStream; 00146 } // end of CEGUI namespace section 00147 00148 00150 // Comment this line to remove the alignment of elements to pixel 00151 // boundaries. This may give you a performance boost at the expense 00152 // of visual quality 00154 #define CEGUI_ALIGN_ELEMENTS_TO_PIXELS 1 00155 00169 #if defined(CEGUI_ALIGN_ELEMENTS_TO_PIXELS) 00170 # define PixelAligned(x) ( (float)(int)(( x ) + 0.5f) ) 00171 #else 00172 # define PixelAligned(x) ( x ) 00173 #endif 00174 00175 00176 /************************************************************************* 00177 Bring in forward references to all GUI base system classes 00178 *************************************************************************/ 00179 #include "CEGUIForwardRefs.h" 00180 00181 00182 #endif // end of guard _CEGUIBase_h_