Crazy Eddies GUI System: CEGUIBase.h Source File

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

# CEGUIBase.h

    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     Crazy Eddie's GUI System (http://www.cegui.org.uk)
    00013     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
    00014
    00015     This library is free software; you can redistribute it and/or
    00016     modify it under the terms of the GNU Lesser General Public
    00017     License as published by the Free Software Foundation; either
    00018     version 2.1 of the License, or (at your option) any later version.
    00019
    00020     This library is distributed in the hope that it will be useful,
    00021     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00022     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00023     Lesser General Public License for more details.
    00024
    00025     You should have received a copy of the GNU Lesser General Public
    00026     License along with this library; if not, write to the Free Software
    00027     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00028 *************************************************************************/
    00029 #ifndef _CEGUIBase_h_
    00030 #define _CEGUIBase_h_
    00031
    00032 #include <cassert>
    00033
    00034 // bring in configuration options
    00035 #include "CEGUIConfig.h"
    00036
    00037 // add CEGUI version defines
    00038 #include "CEGUIVersion.h"
    00039
    00040 /*************************************************************************
    00041         Dynamic Library import / export control conditional
    00042         (Define CEGUIBASE_EXPORTS to export symbols, else they are imported)
    00043 *************************************************************************/
    00044 #if defined( __WIN32__ ) || defined( _WIN32 )
    00045 #   ifdef CEGUIBASE_EXPORTS
    00046 #       define CEGUIEXPORT __declspec(dllexport)
    00047 #   else
    00048 #       define CEGUIEXPORT __declspec(dllimport)
    00049 #   endif
    00050 #       define CEGUIPRIVATE
    00051 #else
    00052 #       define CEGUIEXPORT
    00053 #       define CEGUIPRIVATE
    00054 #endif
    00055
    00056
    00057 // totally kill this warning (debug info truncated to 255 chars etc...) on <= VC6
    00058 #if defined(_MSC_VER) && (_MSC_VER <= 1200)
    00059 #   pragma warning(disable : 4786)
    00060 #endif
    00061
    00062
    00063 // Detect macros for min / max and undefine (with a warning where possible)
    00064 #if defined(max)
    00065 #   if defined(_MSC_VER)
    00066 #       pragma message("Macro defintion of max detected - undefining")
    00067 #   elif defined (__GNUC__)
    00068 #       warning ("Macro defintion of max detected - undefining")
    00069 #   endif
    00070 #   undef max
    00071 #endif
    00072 #if defined(min)
    00073 #   if defined(_MSC_VER)
    00074 #       pragma message("Macro defintion of min detected - undefining")
    00075 #   elif defined (__GNUC__)
    00076 #       warning ("Macro defintion of min detected - undefining")
    00077 #   endif
    00078 #   undef min
    00079 #endif
    00080
    00081
    00082 // include this to see if it defines _STLPORT_VERION
    00083 #       include <string>
    00084
    00085 // fix to undefine _STLP_DEBUG if STLport is not actually being used
    00086 // (resolves some unresolved externals concerning boost)
    00087 #if defined(_STLP_DEBUG) && defined(_MSC_VER) && (_MSC_VER >= 1200)
    00088 #       if !defined(_STLPORT_VERSION)
    00089 #               undef _STLP_DEBUG
    00090 #       endif
    00091 #endif
    00092
    00093
    00094 // The following defines macros used within CEGUI for std::min/std::max
    00095 // usage, and is done as a compatibility measure for VC6 with native STL.
    00096 #if defined(_MSC_VER) && (_MSC_VER <= 1200) && !defined(_STLPORT_VERSION)
    00097 #    define ceguimin    std::_cpp_min
    00098 #    define ceguimax    std::_cpp_max
    00099 #else
    00100 #    define ceguimin    std::min
    00101 #    define ceguimax    std::max
    00102 #endif
    00103
    00104
    00105 /*************************************************************************
    00106         Documentation for the CEGUI namespace itself
    00107 *************************************************************************/
    00115 namespace CEGUI
    00116 {
    00117
    00118 /*************************************************************************
    00119         Simplification of some 'unsigned' types
    00120 *************************************************************************/
    00121 typedef unsigned long   ulong;
    00122 typedef unsigned short  ushort;
    00123 typedef unsigned int    uint;
    00124 typedef unsigned char   uchar;
    00125
    00126 typedef unsigned int    uint32;
    00127 typedef unsigned short  uint16;
    00128 typedef unsigned char   uint8;
    00129
    00130
    00131 /*************************************************************************
    00132         System wide constants
    00133 *************************************************************************/
    00134 static const float              DefaultNativeHorzRes    = 640.0f;
    00135 static const float              DefaultNativeVertRes    = 480.0f;
    00136
    00137
    00138 /*************************************************************************
    00139     Additional typedefs
    00140 *************************************************************************/
    00141 typedef std::ostream OutStream;
    00142 }  // end of CEGUI namespace section
    00143
    00144
    00158 #if defined(CEGUI_ALIGN_ELEMENTS_TO_PIXELS)
    00159 #       define PixelAligned(x)  ( (float)(int)(( x ) + 0.5f) )
    00160 #else
    00161 #       define PixelAligned(x)  ( x )
    00162 #endif
    00163
    00164
    00165 /*************************************************************************
    00166         Bring in forward references to all GUI base system classes
    00167 *************************************************************************/
    00168 #include "CEGUIForwardRefs.h"
    00169
    00170
    00171 #endif  // end of guard _CEGUIBase_h_