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