[692] | 1 | /************************************************************************
|
---|
| 2 | filename: CEGUIBase.h
|
---|
| 3 | created: 20/2/2004
|
---|
| 4 | author: Paul D Turner
|
---|
| 5 |
|
---|
| 6 | purpose: Base include used within the system
|
---|
| 7 | This contains various lower level bits required
|
---|
| 8 | by other parts of the system. All other library
|
---|
| 9 | headers will include this file.
|
---|
| 10 | *************************************************************************/
|
---|
| 11 | /*************************************************************************
|
---|
| 12 | Crazy Eddie's GUI System (http://www.cegui.org.uk)
|
---|
| 13 | Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
|
---|
| 14 |
|
---|
| 15 | This library is free software; you can redistribute it and/or
|
---|
| 16 | modify it under the terms of the GNU Lesser General Public
|
---|
| 17 | License as published by the Free Software Foundation; either
|
---|
| 18 | version 2.1 of the License, or (at your option) any later version.
|
---|
| 19 |
|
---|
| 20 | This library is distributed in the hope that it will be useful,
|
---|
| 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 23 | Lesser General Public License for more details.
|
---|
| 24 |
|
---|
| 25 | You should have received a copy of the GNU Lesser General Public
|
---|
| 26 | License along with this library; if not, write to the Free Software
|
---|
| 27 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
| 28 | *************************************************************************/
|
---|
| 29 | #ifndef _CEGUIBase_h_
|
---|
| 30 | #define _CEGUIBase_h_
|
---|
| 31 |
|
---|
| 32 | #include <cassert>
|
---|
| 33 |
|
---|
| 34 | // bring in configuration options
|
---|
| 35 | #include "CEGUIConfig.h"
|
---|
| 36 |
|
---|
| 37 | // add CEGUI version defines
|
---|
| 38 | #include "CEGUIVersion.h"
|
---|
| 39 |
|
---|
| 40 | /*************************************************************************
|
---|
| 41 | Dynamic Library import / export control conditional
|
---|
| 42 | (Define CEGUIBASE_EXPORTS to export symbols, else they are imported)
|
---|
| 43 | *************************************************************************/
|
---|
| 44 | #if defined( __WIN32__ ) || defined( _WIN32 )
|
---|
| 45 | # ifdef CEGUIBASE_EXPORTS
|
---|
| 46 | # define CEGUIEXPORT __declspec(dllexport)
|
---|
| 47 | # else
|
---|
| 48 | # define CEGUIEXPORT __declspec(dllimport)
|
---|
| 49 | # endif
|
---|
| 50 | # define CEGUIPRIVATE
|
---|
| 51 | #else
|
---|
| 52 | # define CEGUIEXPORT
|
---|
| 53 | # define CEGUIPRIVATE
|
---|
| 54 | #endif
|
---|
| 55 |
|
---|
| 56 |
|
---|
| 57 | // totally kill this warning (debug info truncated to 255 chars etc...) on <= VC6
|
---|
| 58 | #if defined(_MSC_VER) && (_MSC_VER <= 1200)
|
---|
| 59 | # pragma warning(disable : 4786)
|
---|
| 60 | #endif
|
---|
| 61 |
|
---|
| 62 |
|
---|
| 63 | // Detect macros for min / max and undefine (with a warning where possible)
|
---|
| 64 | #if defined(max)
|
---|
| 65 | # if defined(_MSC_VER)
|
---|
| 66 | # pragma message("Macro defintion of max detected - undefining")
|
---|
| 67 | # elif defined (__GNUC__)
|
---|
| 68 | # warning ("Macro defintion of max detected - undefining")
|
---|
| 69 | # endif
|
---|
| 70 | # undef max
|
---|
| 71 | #endif
|
---|
| 72 | #if defined(min)
|
---|
| 73 | # if defined(_MSC_VER)
|
---|
| 74 | # pragma message("Macro defintion of min detected - undefining")
|
---|
| 75 | # elif defined (__GNUC__)
|
---|
| 76 | # warning ("Macro defintion of min detected - undefining")
|
---|
| 77 | # endif
|
---|
| 78 | # undef min
|
---|
| 79 | #endif
|
---|
| 80 |
|
---|
| 81 |
|
---|
| 82 | // include this to see if it defines _STLPORT_VERION
|
---|
| 83 | # include <string>
|
---|
| 84 |
|
---|
| 85 | // fix to undefine _STLP_DEBUG if STLport is not actually being used
|
---|
| 86 | // (resolves some unresolved externals concerning boost)
|
---|
| 87 | #if defined(_STLP_DEBUG) && defined(_MSC_VER) && (_MSC_VER >= 1200)
|
---|
| 88 | # if !defined(_STLPORT_VERSION)
|
---|
| 89 | # undef _STLP_DEBUG
|
---|
| 90 | # endif
|
---|
| 91 | #endif
|
---|
| 92 |
|
---|
| 93 |
|
---|
| 94 | // The following defines macros used within CEGUI for std::min/std::max
|
---|
| 95 | // usage, and is done as a compatibility measure for VC6 with native STL.
|
---|
| 96 | #if defined(_MSC_VER) && (_MSC_VER <= 1200) && !defined(_STLPORT_VERSION)
|
---|
| 97 | # define ceguimin std::_cpp_min
|
---|
| 98 | # define ceguimax std::_cpp_max
|
---|
| 99 | #else
|
---|
| 100 | # define ceguimin std::min
|
---|
| 101 | # define ceguimax std::max
|
---|
| 102 | #endif
|
---|
| 103 |
|
---|
| 104 |
|
---|
| 105 | /*************************************************************************
|
---|
| 106 | Documentation for the CEGUI namespace itself
|
---|
| 107 | *************************************************************************/
|
---|
| 108 | /*!
|
---|
| 109 | \brief
|
---|
| 110 | Main namespace for Crazy Eddie's GUI Library
|
---|
| 111 |
|
---|
| 112 | The CEGUI namespace contains all the classes and other items that comprise the core
|
---|
| 113 | of Crazy Eddie's GUI system.
|
---|
| 114 | */
|
---|
| 115 | namespace CEGUI
|
---|
| 116 | {
|
---|
| 117 |
|
---|
| 118 | /*************************************************************************
|
---|
| 119 | Simplification of some 'unsigned' types
|
---|
| 120 | *************************************************************************/
|
---|
| 121 | typedef unsigned long ulong;
|
---|
| 122 | typedef unsigned short ushort;
|
---|
| 123 | typedef unsigned int uint;
|
---|
| 124 | typedef unsigned char uchar;
|
---|
| 125 |
|
---|
| 126 | typedef unsigned int uint32;
|
---|
| 127 | typedef unsigned short uint16;
|
---|
| 128 | typedef unsigned char uint8;
|
---|
| 129 |
|
---|
| 130 |
|
---|
| 131 | /*************************************************************************
|
---|
| 132 | System wide constants
|
---|
| 133 | *************************************************************************/
|
---|
| 134 | static const float DefaultNativeHorzRes = 640.0f; //!< Default native horizontal resolution (for fonts and imagesets)
|
---|
| 135 | static const float DefaultNativeVertRes = 480.0f; //!< Default native vertical resolution (for fonts and imagesets)
|
---|
| 136 |
|
---|
| 137 |
|
---|
| 138 | /*************************************************************************
|
---|
| 139 | Additional typedefs
|
---|
| 140 | *************************************************************************/
|
---|
| 141 | typedef std::ostream OutStream; //!< Output stream class.
|
---|
| 142 | } // end of CEGUI namespace section
|
---|
| 143 |
|
---|
| 144 |
|
---|
| 145 | /*!
|
---|
| 146 | \brief
|
---|
| 147 | Macro used to return a float value rounded to the nearest integer.
|
---|
| 148 |
|
---|
| 149 | This macro is used throughout the library to ensure that elements are
|
---|
| 150 | kept at integer pixel positions on the display.
|
---|
| 151 |
|
---|
| 152 | \param x
|
---|
| 153 | Expression to be rounded to nearest whole number
|
---|
| 154 |
|
---|
| 155 | \return
|
---|
| 156 | \a x after having been rounded
|
---|
| 157 | */
|
---|
| 158 | #if defined(CEGUI_ALIGN_ELEMENTS_TO_PIXELS)
|
---|
| 159 | # define PixelAligned(x) ( (float)(int)(( x ) + 0.5f) )
|
---|
| 160 | #else
|
---|
| 161 | # define PixelAligned(x) ( x )
|
---|
| 162 | #endif
|
---|
| 163 |
|
---|
| 164 |
|
---|
| 165 | /*************************************************************************
|
---|
| 166 | Bring in forward references to all GUI base system classes
|
---|
| 167 | *************************************************************************/
|
---|
| 168 | #include "CEGUIForwardRefs.h"
|
---|
| 169 |
|
---|
| 170 |
|
---|
| 171 | #endif // end of guard _CEGUIBase_h_
|
---|