1 | /* |
---|
2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | * > www.orxonox.net < |
---|
4 | * |
---|
5 | * |
---|
6 | * License notice: |
---|
7 | * |
---|
8 | * This program is free software; you can redistribute it and/or |
---|
9 | * modify it under the terms of the GNU General Public License |
---|
10 | * as published by the Free Software Foundation; either version 2 |
---|
11 | * of the License, or (at your option) any later version. |
---|
12 | * |
---|
13 | * This program is distributed in the hope that it will be useful, |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | * GNU General Public License for more details. |
---|
17 | * |
---|
18 | * You should have received a copy of the GNU General Public License |
---|
19 | * along with this program; if not, write to the Free Software |
---|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
21 | * |
---|
22 | * Author: |
---|
23 | * Reto Grieder |
---|
24 | * Co-authors: |
---|
25 | * ... |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | /** |
---|
30 | @file |
---|
31 | @brief |
---|
32 | Shared library macros, enums, constants and forward declarations for the core library |
---|
33 | */ |
---|
34 | |
---|
35 | #ifndef _CorePrereqs_H__ |
---|
36 | #define _CorePrereqs_H__ |
---|
37 | |
---|
38 | #include "OrxonoxConfig.h" |
---|
39 | #include <boost/version.hpp> |
---|
40 | #include <string> |
---|
41 | |
---|
42 | //----------------------------------------------------------------------- |
---|
43 | // Shared library settings |
---|
44 | //----------------------------------------------------------------------- |
---|
45 | |
---|
46 | #if defined(ORXONOX_PLATFORM_WINDOWS) && !defined( CORE_STATIC_BUILD ) |
---|
47 | # ifdef CORE_SHARED_BUILD |
---|
48 | # define _CoreExport __declspec(dllexport) |
---|
49 | # else |
---|
50 | # if defined( __MINGW32__ ) |
---|
51 | # define _CoreExport |
---|
52 | # else |
---|
53 | # define _CoreExport __declspec(dllimport) |
---|
54 | # endif |
---|
55 | # endif |
---|
56 | # define _CorePrivate |
---|
57 | #elif defined (ORXONOX_GCC_VISIBILITY) |
---|
58 | # define _CoreExport __attribute__ ((visibility("default"))) |
---|
59 | # define _CorePrivate __attribute__ ((visibility("hidden"))) |
---|
60 | #else |
---|
61 | # define _CoreExport |
---|
62 | # define _CorePrivate |
---|
63 | #endif |
---|
64 | |
---|
65 | //----------------------------------------------------------------------- |
---|
66 | // Constants |
---|
67 | //----------------------------------------------------------------------- |
---|
68 | |
---|
69 | namespace orxonox |
---|
70 | { |
---|
71 | static constexpr uint32_t OBJECTID_UNKNOWN = static_cast<uint32_t>(-1); |
---|
72 | } |
---|
73 | |
---|
74 | //----------------------------------------------------------------------- |
---|
75 | // Enums |
---|
76 | //----------------------------------------------------------------------- |
---|
77 | |
---|
78 | namespace orxonox |
---|
79 | { |
---|
80 | namespace ScopeID |
---|
81 | { |
---|
82 | typedef int Value; |
---|
83 | |
---|
84 | //!A list of available scopes for the Scope template. |
---|
85 | static constexpr Value ROOT = 1; |
---|
86 | static constexpr Value GRAPHICS = 2; |
---|
87 | } |
---|
88 | |
---|
89 | namespace StaticInitialization |
---|
90 | { |
---|
91 | typedef int Type; |
---|
92 | |
---|
93 | static constexpr Type STATIC_INITIALIZATION_HANDLER = 1; |
---|
94 | static constexpr Type IDENTIFIER = 2; |
---|
95 | static constexpr Type SCOPED_SINGLETON_WRAPPER = 3; |
---|
96 | static constexpr Type COMMAND_LINE_ARGUMENT = 4; |
---|
97 | static constexpr Type CONSOLE_COMMAND = 5; |
---|
98 | } |
---|
99 | |
---|
100 | namespace XMLPort |
---|
101 | { |
---|
102 | enum Mode |
---|
103 | { |
---|
104 | NOP, |
---|
105 | LoadObject, |
---|
106 | SaveObject, |
---|
107 | ExpandObject |
---|
108 | }; |
---|
109 | } |
---|
110 | |
---|
111 | namespace ConfigFileType |
---|
112 | { |
---|
113 | enum Value |
---|
114 | { |
---|
115 | Settings, |
---|
116 | JoyStickCalibration, |
---|
117 | CommandHistory |
---|
118 | // Don't forget to adjust the array size in the ConfigFileManager when adding a new entry here! |
---|
119 | }; |
---|
120 | } |
---|
121 | |
---|
122 | namespace KeybindMode |
---|
123 | { |
---|
124 | enum Value |
---|
125 | { |
---|
126 | OnPress, |
---|
127 | OnHold, |
---|
128 | OnRelease, |
---|
129 | OnPressAndRelease, |
---|
130 | None |
---|
131 | }; |
---|
132 | }; |
---|
133 | } |
---|
134 | |
---|
135 | //----------------------------------------------------------------------- |
---|
136 | // Forward declarations |
---|
137 | //----------------------------------------------------------------------- |
---|
138 | |
---|
139 | namespace orxonox |
---|
140 | { |
---|
141 | typedef std::string LanguageEntryLabel; |
---|
142 | |
---|
143 | template <class T, class U> |
---|
144 | T orxonox_cast(U*); |
---|
145 | |
---|
146 | class ApplicationPaths; |
---|
147 | class BaseObject; |
---|
148 | template <class T> |
---|
149 | class ClassFactory; |
---|
150 | template <class T> |
---|
151 | class ClassFactoryWithContext; |
---|
152 | template <class T> |
---|
153 | class ClassIdentifier; |
---|
154 | class ClassTreeMask; |
---|
155 | class ClassTreeMaskIterator; |
---|
156 | class ClassTreeMaskNode; |
---|
157 | class ClassTreeMaskObjectIterator; |
---|
158 | class CommandLineParser; |
---|
159 | class CommandLineArgument; |
---|
160 | class ConfigFile; |
---|
161 | class ConfigFileEntry; |
---|
162 | class ConfigFileEntryComment; |
---|
163 | class ConfigFileEntryValue; |
---|
164 | class ConfigFileManager; |
---|
165 | class ConfigFileSection; |
---|
166 | class Configurable; |
---|
167 | class ConfigurablePaths; |
---|
168 | class ConfigValueContainer; |
---|
169 | class Context; |
---|
170 | class Core; |
---|
171 | class CoreConfig; |
---|
172 | class CoreStaticInitializationHandler; |
---|
173 | class Destroyable; |
---|
174 | class DestroyLaterManager; |
---|
175 | class DestructionListener; |
---|
176 | class DynLib; |
---|
177 | class DynLibManager; |
---|
178 | struct Event; |
---|
179 | class EventState; |
---|
180 | class Factory; |
---|
181 | class Game; |
---|
182 | class GameConfig; |
---|
183 | class GameState; |
---|
184 | struct GameStateInfo; |
---|
185 | struct GameStateTreeNode; |
---|
186 | class GraphicsManager; |
---|
187 | class GUIManager; |
---|
188 | class Identifiable; |
---|
189 | class Identifier; |
---|
190 | template <class T> |
---|
191 | class Iterator; |
---|
192 | class Language; |
---|
193 | class Listable; |
---|
194 | class Loader; |
---|
195 | class LuaFunctor; |
---|
196 | class LuaState; |
---|
197 | class MemoryArchive; |
---|
198 | class MemoryArchiveFactory; |
---|
199 | class ModuleInstance; |
---|
200 | class Namespace; |
---|
201 | class NamespaceNode; |
---|
202 | template <class T> |
---|
203 | class ObjectList; |
---|
204 | class ObjectListBase; |
---|
205 | class ObjectListBaseElement; |
---|
206 | template <class T> |
---|
207 | class ObjectListElement; |
---|
208 | template <class T> |
---|
209 | class ObjectListIterator; |
---|
210 | class OgreWindowEventListener; |
---|
211 | class OrxonoxClass; |
---|
212 | class OrxonoxInterface; |
---|
213 | class Plugin; |
---|
214 | class PluginManager; |
---|
215 | class PluginReference; |
---|
216 | struct ResourceInfo; |
---|
217 | template <ScopeID::Value> |
---|
218 | class Scope; |
---|
219 | class ScopeManager; |
---|
220 | class ScopedSingletonWrapper; |
---|
221 | class SettingsConfigFile; |
---|
222 | class StaticallyInitializedInstance; |
---|
223 | class StaticInitializationHandler; |
---|
224 | class StaticInitializationManager; |
---|
225 | template <class T> |
---|
226 | class StrongPtr; |
---|
227 | template <class T> |
---|
228 | class SubclassIdentifier; |
---|
229 | class Template; |
---|
230 | class Thread; |
---|
231 | class ThreadPool; |
---|
232 | class UpdateListener; |
---|
233 | class ViewportEventListener; |
---|
234 | template <class T> |
---|
235 | class WeakPtr; |
---|
236 | class WindowEventListener; |
---|
237 | class XMLFile; |
---|
238 | class XMLNameListener; |
---|
239 | template <class T, class O> |
---|
240 | class XMLPortClassObjectContainer; |
---|
241 | template <class T> |
---|
242 | class XMLPortClassParamContainer; |
---|
243 | class XMLPortObjectContainer; |
---|
244 | class XMLPortParamContainer; |
---|
245 | |
---|
246 | // Command |
---|
247 | class ArgumentCompleter; |
---|
248 | class ArgumentCompletionListElement; |
---|
249 | class CommandEvaluation; |
---|
250 | class ConsoleCommand; |
---|
251 | class ConsoleCommandManager; |
---|
252 | class Executor; |
---|
253 | template <class T> |
---|
254 | class ExecutorMember; |
---|
255 | class ExecutorStatic; |
---|
256 | class Functor; |
---|
257 | template <class O> |
---|
258 | class FunctorMember; |
---|
259 | typedef FunctorMember<void> FunctorStatic; |
---|
260 | template <class F, class O> |
---|
261 | class FunctorPointer; |
---|
262 | class IOConsole; |
---|
263 | class IRC; |
---|
264 | class Shell; |
---|
265 | class ShellListener; |
---|
266 | class TclBind; |
---|
267 | struct TclInterpreterBundle; |
---|
268 | template <class T> |
---|
269 | class TclThreadList; |
---|
270 | class TclThreadManager; |
---|
271 | |
---|
272 | // Input |
---|
273 | class BaseCommand; |
---|
274 | class BufferedParamCommand; |
---|
275 | class Button; |
---|
276 | class HalfAxis; |
---|
277 | class InputBuffer; |
---|
278 | class InputDevice; |
---|
279 | template <class Traits> |
---|
280 | class InputDeviceTemplated; |
---|
281 | class InputHandler; |
---|
282 | class InputManager; |
---|
283 | class InputState; |
---|
284 | struct InputStatePriority; |
---|
285 | class JoyStickQuantityListener; |
---|
286 | class JoyStick; |
---|
287 | class KeyBinder; |
---|
288 | class KeyBinderManager; |
---|
289 | class Keyboard; |
---|
290 | class KeyDetector; |
---|
291 | class KeyEvent; |
---|
292 | class Mouse; |
---|
293 | class ParamCommand; |
---|
294 | class SimpleCommand; |
---|
295 | } |
---|
296 | |
---|
297 | #include "command/FunctorPtr.h" |
---|
298 | #include "command/ExecutorPtr.h" |
---|
299 | |
---|
300 | // CppTcl |
---|
301 | namespace Tcl |
---|
302 | { |
---|
303 | class interpreter; |
---|
304 | class object; |
---|
305 | } |
---|
306 | |
---|
307 | // Boost |
---|
308 | namespace boost |
---|
309 | { |
---|
310 | #if (BOOST_VERSION < 104400) |
---|
311 | |
---|
312 | namespace filesystem |
---|
313 | { |
---|
314 | struct path_traits; |
---|
315 | template <class String, class Traits> class basic_path; |
---|
316 | typedef basic_path<std::string, path_traits> path; |
---|
317 | } |
---|
318 | |
---|
319 | #elif (BOOST_VERSION < 105000) |
---|
320 | |
---|
321 | # if BOOST_FILESYSTEM_VERSION == 2 |
---|
322 | namespace filesystem2 |
---|
323 | { |
---|
324 | struct path_traits; |
---|
325 | template <class String, class Traits> class basic_path; |
---|
326 | typedef basic_path<std::string, path_traits> path; |
---|
327 | } |
---|
328 | namespace filesystem |
---|
329 | { |
---|
330 | using filesystem2::basic_path; |
---|
331 | using filesystem2::path_traits; |
---|
332 | using filesystem2::path; |
---|
333 | } |
---|
334 | # elif BOOST_FILESYSTEM_VERSION == 3 |
---|
335 | namespace filesystem3 |
---|
336 | { |
---|
337 | class path; |
---|
338 | } |
---|
339 | namespace filesystem |
---|
340 | { |
---|
341 | using filesystem3::path; |
---|
342 | } |
---|
343 | # endif |
---|
344 | |
---|
345 | #else |
---|
346 | |
---|
347 | namespace filesystem |
---|
348 | { |
---|
349 | class path; |
---|
350 | } |
---|
351 | |
---|
352 | #endif |
---|
353 | |
---|
354 | class thread; |
---|
355 | class mutex; |
---|
356 | class shared_mutex; |
---|
357 | class condition_variable; |
---|
358 | } |
---|
359 | |
---|
360 | // Ogre |
---|
361 | namespace Ogre |
---|
362 | { |
---|
363 | class DataStream; |
---|
364 | template <class T> class SharedPtr; |
---|
365 | typedef SharedPtr<DataStream> DataStreamPtr; |
---|
366 | } |
---|
367 | namespace orxonox |
---|
368 | { |
---|
369 | // Import the Ogre::DataStream |
---|
370 | using Ogre::DataStream; |
---|
371 | using Ogre::DataStreamPtr; |
---|
372 | } |
---|
373 | |
---|
374 | // CEGUI |
---|
375 | namespace CEGUI |
---|
376 | { |
---|
377 | class DefaultLogger; |
---|
378 | class Logger; |
---|
379 | class LuaScriptModule; |
---|
380 | |
---|
381 | #if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7 |
---|
382 | class OgreCEGUIRenderer; |
---|
383 | class OgreCEGUIResourceProvider; |
---|
384 | class OgreCEGUITexture; |
---|
385 | #else |
---|
386 | class OgreRenderer; |
---|
387 | class OgreResourceProvider; |
---|
388 | class OgreImageCodec; |
---|
389 | #endif |
---|
390 | } |
---|
391 | |
---|
392 | // Lua |
---|
393 | struct lua_State; |
---|
394 | |
---|
395 | // TinyXML and TinyXML++ |
---|
396 | class TiXmlString; |
---|
397 | class TiXmlOutStream; |
---|
398 | class TiXmlNode; |
---|
399 | class TiXmlHandle; |
---|
400 | class TiXmlDocument; |
---|
401 | class TiXmlElement; |
---|
402 | class TiXmlComment; |
---|
403 | class TiXmlUnknown; |
---|
404 | class TiXmlAttribute; |
---|
405 | class TiXmlText; |
---|
406 | class TiXmlDeclaration; |
---|
407 | class TiXmlParsingData; |
---|
408 | namespace ticpp |
---|
409 | { |
---|
410 | class Document; |
---|
411 | class Element; |
---|
412 | class Declaration; |
---|
413 | class StylesheetReference; |
---|
414 | class Text; |
---|
415 | class Comment; |
---|
416 | class Attribute; |
---|
417 | } |
---|
418 | namespace orxonox |
---|
419 | { |
---|
420 | using ticpp::Element; |
---|
421 | } |
---|
422 | |
---|
423 | #endif /* _CorePrereqs_H__ */ |
---|