Caelum
CaelumPlugin.h
1 /*
2 This file is part of Caelum.
3 See http://www.ogre3d.org/wiki/index.php/Caelum
4 
5 Copyright (c) 2008 Caelum team. See Contributors.txt for details.
6 
7 Caelum is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published
9 by the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Caelum is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License
18 along with Caelum. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef CAELUM__CAELUM_PLUGIN_H
22 #define CAELUM__CAELUM_PLUGIN_H
23 
24 #include "CaelumPrerequisites.h"
25 #include "CaelumScriptTranslator.h"
26 #include "TypeDescriptor.h"
27 #include "OgrePlugin.h"
28 
29 namespace Caelum
30 {
37  class CAELUM_EXPORT CaelumPlugin: public Ogre::Singleton<CaelumPlugin>, public Ogre::Plugin
38  {
39  public:
41  static CaelumPlugin& getSingleton(void);
43  static CaelumPlugin* getSingletonPtr(void);
44 
45  CaelumPlugin();
46  ~CaelumPlugin();
47 
48  virtual void install ();
49  virtual void initialise ();
50  virtual void shutdown ();
51  virtual void uninstall ();
52 
53  static const Ogre::String CAELUM_PLUGIN_NAME;
54  virtual const String& getName () const;
55 
56  // Determine if the plugin was installed (if install was called).
57  inline bool isInstalled () const { return mIsInstalled; }
58 
59  private:
60  bool mIsInstalled;
61 
62 #if CAELUM_TYPE_DESCRIPTORS
63  public:
65  CaelumDefaultTypeDescriptorData* getTypeDescriptorData () { return &mTypeDescriptorData; }
66 
67  private:
68  CaelumDefaultTypeDescriptorData mTypeDescriptorData;
69 #endif
70 
71 #if CAELUM_SCRIPT_SUPPORT
72  public:
80  void loadCaelumSystemFromScript (
81  CaelumSystem* sys,
82  const Ogre::String& objectName,
83  const Ogre::String& scriptFileGroup = Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME
84  );
85 
87  PropScriptResourceManager* getPropScriptResourceManager () { return &mPropScriptResourceManager; }
88  CaelumScriptTranslatorManager* getScriptTranslatorManager () { return &mScriptTranslatorManager; }
89 
90  private:
91  PropScriptResourceManager mPropScriptResourceManager;
92  CaelumScriptTranslatorManager mScriptTranslatorManager;
93 #endif
94  };
95 }
96 
97 #endif // CAELUM__CAELUM_PLUGIN_H
PropScriptResourceManager * getPropScriptResourceManager()
Definition: CaelumPlugin.h:87
CaelumDefaultTypeDescriptorData * getTypeDescriptorData()
Get default type descriptor data for caelum components.
Definition: CaelumPlugin.h:65
This is the "root class" of caelum.
Definition: CaelumSystem.h:113
Implement an Ogre::Plugin for Caelum.
Definition: CaelumPlugin.h:37
Standard type descriptors for caelum components.
Caelum namespace.
Definition: Astronomy.cpp:24