Crazy Eddies GUI System  0.7.1
CEGUIBase.h
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  * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
13  *
14  * Permission is hereby granted, free of charge, to any person obtaining
15  * a copy of this software and associated documentation files (the
16  * "Software"), to deal in the Software without restriction, including
17  * without limitation the rights to use, copy, modify, merge, publish,
18  * distribute, sublicense, and/or sell copies of the Software, and to
19  * permit persons to whom the Software is furnished to do so, subject to
20  * the following conditions:
21  *
22  * The above copyright notice and this permission notice shall be
23  * included in all copies or substantial portions of the Software.
24  *
25  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
28  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
29  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
30  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
31  * OTHER DEALINGS IN THE SOFTWARE.
32  ***************************************************************************/
33 #ifndef _CEGUIBase_h_
34 #define _CEGUIBase_h_
35 
36 #include <cassert>
37 
38 // bring in configuration options
39 #include "CEGUIConfig.h"
40 
41 // add CEGUI version defines
42 #include "CEGUIVersion.h"
43 
44 /*************************************************************************
45  Dynamic Library import / export control conditional
46  (Define CEGUIBASE_EXPORTS to export symbols, else they are imported)
47 *************************************************************************/
48 #if (defined( __WIN32__ ) || defined( _WIN32 )) && !defined(CEGUI_STATIC)
49 # ifdef CEGUIBASE_EXPORTS
50 # define CEGUIEXPORT __declspec(dllexport)
51 # else
52 # define CEGUIEXPORT __declspec(dllimport)
53 # endif
54 # define CEGUIPRIVATE
55 #else
56 # define CEGUIEXPORT
57 # define CEGUIPRIVATE
58 #endif
59 
60 
61 // totally kill this warning (debug info truncated to 255 chars etc...) on <= VC6
62 #if defined(_MSC_VER) && (_MSC_VER <= 1200)
63 # pragma warning(disable : 4786)
64 #endif
65 
66 
67 // Detect macros for min / max and undefine (with a warning where possible)
68 #if defined(max)
69 # if defined(_MSC_VER)
70 # pragma message("Macro definition of max detected - undefining")
71 # elif defined (__GNUC__)
72 # warning ("Macro definition of max detected - undefining")
73 # endif
74 # undef max
75 #endif
76 #if defined(min)
77 # if defined(_MSC_VER)
78 # pragma message("Macro definition of min detected - undefining")
79 # elif defined (__GNUC__)
80 # warning ("Macro definition of min detected - undefining")
81 # endif
82 # undef min
83 #endif
84 
85 
86 // include this to see if it defines _STLPORT_VERION
87 # include <string>
88 
89 // fix to undefine _STLP_DEBUG if STLport is not actually being used
90 // (resolves some unresolved externals concerning boost)
91 #if defined(_STLP_DEBUG) && defined(_MSC_VER) && (_MSC_VER >= 1200)
92 # if !defined(_STLPORT_VERSION)
93 # undef _STLP_DEBUG
94 # endif
95 #endif
96 
97 
98 // The following defines macros used within CEGUI for std::min/std::max
99 // usage, and is done as a compatibility measure for VC6 with native STL.
100 #if defined(_MSC_VER) && (_MSC_VER <= 1200) && !defined(_STLPORT_VERSION)
101 # define ceguimin std::_cpp_min
102 # define ceguimax std::_cpp_max
103 #else
104 # define ceguimin std::min
105 # define ceguimax std::max
106 #endif
107 
108 /*************************************************************************
109  Documentation for the CEGUI namespace itself
110 *************************************************************************/
118 namespace CEGUI
119 {
120 
121 /*************************************************************************
122  Simplification of some 'unsigned' types
123 *************************************************************************/
124 typedef unsigned long ulong;
125 typedef unsigned short ushort;
126 typedef unsigned int uint;
127 typedef unsigned char uchar;
128 
129 typedef unsigned int uint32;
130 typedef unsigned short uint16;
131 typedef unsigned char uint8;
132 
133 
134 /*************************************************************************
135  System wide constants
136 *************************************************************************/
137 static const float DefaultNativeHorzRes = 640.0f;
138 static const float DefaultNativeVertRes = 480.0f;
139 
140 
141 /*************************************************************************
142  Additional typedefs
143 *************************************************************************/
144 typedef std::ostream OutStream;
145 } // end of CEGUI namespace section
146 
147 
149 // Comment this line to remove the alignment of elements to pixel
150 // boundaries. This may give you a performance boost at the expense
151 // of visual quality
153 #define CEGUI_ALIGN_ELEMENTS_TO_PIXELS 1
154 
168 #if defined(CEGUI_ALIGN_ELEMENTS_TO_PIXELS)
169 # define PixelAligned(x) ( (float)(int)(( x ) + (( x ) > 0.0f ? 0.5f : -0.5f)) )
170 #else
171 # define PixelAligned(x) ( x )
172 #endif
173 
174 
175 /*************************************************************************
176  Bring in forward references to all GUI base system classes
177 *************************************************************************/
178 #include "CEGUIForwardRefs.h"
179 
180 
181 #endif // end of guard _CEGUIBase_h_