[657] | 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 |
|
---|
| 38 | /*************************************************************************
|
---|
| 39 | Dynamic Library import / export control conditional
|
---|
| 40 | (Define CEGUIBASE_EXPORTS to export symbols, else they are imported)
|
---|
| 41 | *************************************************************************/
|
---|
| 42 | #if defined( __WIN32__ ) || defined( _WIN32 )
|
---|
| 43 | # ifdef CEGUIBASE_EXPORTS
|
---|
| 44 | # define CEGUIEXPORT __declspec(dllexport)
|
---|
| 45 | # else
|
---|
| 46 | # define CEGUIEXPORT __declspec(dllimport)
|
---|
| 47 | # endif
|
---|
| 48 | # define CEGUIPRIVATE
|
---|
| 49 | #else
|
---|
| 50 | # define CEGUIEXPORT
|
---|
| 51 | # define CEGUIPRIVATE
|
---|
| 52 | #endif
|
---|
| 53 |
|
---|
| 54 |
|
---|
| 55 | // totally kill this warning (debug info truncated to 255 chars etc...) on <= VC6
|
---|
| 56 | #if defined(_MSC_VER) && (_MSC_VER <= 1200)
|
---|
| 57 | # pragma warning(disable : 4786)
|
---|
| 58 | #endif
|
---|
| 59 |
|
---|
| 60 | // No thanks Bill.
|
---|
| 61 | #if defined( __WIN32__ ) || defined( _WIN32 )
|
---|
| 62 | # define NOMINMAX
|
---|
| 63 | #endif
|
---|
| 64 |
|
---|
| 65 |
|
---|
| 66 | // include this to see if it defines _STLPORT_VERION
|
---|
| 67 | # include <string>
|
---|
| 68 |
|
---|
| 69 | // fix to undefine _STLP_DEBUG if STLport is not actually being used
|
---|
| 70 | // (resolves some unresolved externals concerning boost)
|
---|
| 71 | #if defined(_STLP_DEBUG) && defined(_MSC_VER) && (_MSC_VER >= 1200)
|
---|
| 72 | # if !defined(_STLPORT_VERSION)
|
---|
| 73 | # undef _STLP_DEBUG
|
---|
| 74 | # endif
|
---|
| 75 | #endif
|
---|
| 76 |
|
---|
| 77 |
|
---|
| 78 | // The following defines macros used within CEGUI for std::min/std::max
|
---|
| 79 | // usage, and is done as a compatibility measure for VC6 with native STL.
|
---|
| 80 | #if defined(_MSC_VER) && (_MSC_VER <= 1200) && !defined(_STLPORT_VERSION)
|
---|
| 81 | # define ceguimin std::_cpp_min
|
---|
| 82 | # define ceguimax std::_cpp_max
|
---|
| 83 | #else
|
---|
| 84 | # define ceguimin std::min
|
---|
| 85 | # define ceguimax std::max
|
---|
| 86 | #endif
|
---|
| 87 |
|
---|
| 88 |
|
---|
| 89 | /*************************************************************************
|
---|
| 90 | Documentation for the CEGUI namespace itself
|
---|
| 91 | *************************************************************************/
|
---|
| 92 | /*!
|
---|
| 93 | \brief
|
---|
| 94 | Main namespace for Crazy Eddie's GUI Library
|
---|
| 95 |
|
---|
| 96 | The CEGUI namespace contains all the classes and other items that comprise the core
|
---|
| 97 | of Crazy Eddie's GUI system.
|
---|
| 98 | */
|
---|
| 99 | namespace CEGUI
|
---|
| 100 | {
|
---|
| 101 |
|
---|
| 102 | /*************************************************************************
|
---|
| 103 | Simplification of some 'unsigned' types
|
---|
| 104 | *************************************************************************/
|
---|
| 105 | typedef unsigned long ulong;
|
---|
| 106 | typedef unsigned short ushort;
|
---|
| 107 | typedef unsigned int uint;
|
---|
| 108 | typedef unsigned char uchar;
|
---|
| 109 |
|
---|
| 110 | typedef unsigned int uint32;
|
---|
| 111 | typedef unsigned short uint16;
|
---|
| 112 | typedef unsigned char uint8;
|
---|
| 113 |
|
---|
| 114 |
|
---|
| 115 | /*************************************************************************
|
---|
| 116 | System wide constants
|
---|
| 117 | *************************************************************************/
|
---|
| 118 | static const float DefaultNativeHorzRes = 640.0f; //!< Default native horizontal resolution (for fonts and imagesets)
|
---|
| 119 | static const float DefaultNativeVertRes = 480.0f; //!< Default native vertical resolution (for fonts and imagesets)
|
---|
| 120 |
|
---|
| 121 | } // end of CEGUI namespace section
|
---|
| 122 |
|
---|
| 123 |
|
---|
| 124 | /*!
|
---|
| 125 | \brief
|
---|
| 126 | Macro used to return a float value rounded to the nearest integer.
|
---|
| 127 |
|
---|
| 128 | This macro is used throughout the library to ensure that elements are
|
---|
| 129 | kept at integer pixel positions on the display.
|
---|
| 130 |
|
---|
| 131 | \param x
|
---|
| 132 | Expression to be rounded to nearest whole number
|
---|
| 133 |
|
---|
| 134 | \return
|
---|
| 135 | \a x after having been rounded
|
---|
| 136 | */
|
---|
| 137 | #if defined(CEGUI_ALIGN_ELEMENTS_TO_PIXELS)
|
---|
| 138 | # define PixelAligned(x) ( (float)(int)(( x ) + 0.5f) )
|
---|
| 139 | #else
|
---|
| 140 | # define PixelAligned(x) ( x )
|
---|
| 141 | #endif
|
---|
| 142 |
|
---|
| 143 |
|
---|
| 144 | /*************************************************************************
|
---|
| 145 | Bring in forward references to all GUI base system classes
|
---|
| 146 | *************************************************************************/
|
---|
| 147 | #include "CEGUIForwardRefs.h"
|
---|
| 148 |
|
---|
| 149 |
|
---|
| 150 | #endif // end of guard _CEGUIBase_h_
|
---|