00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://www.ogre3d.org/ 00006 00007 Copyright © 2000-2002 The OGRE Team 00008 Also see acknowledgements in Readme.html 00009 00010 This program is free software; you can redistribute it and/or modify it under 00011 the terms of the GNU Lesser General Public License as published by the Free Software 00012 Foundation; either version 2 of the License, or (at your option) any later 00013 version. 00014 00015 This program is distributed in the hope that it will be useful, but WITHOUT 00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License along with 00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00022 http://www.gnu.org/copyleft/lesser.txt. 00023 ----------------------------------------------------------------------------- 00024 */ 00025 00026 #ifndef __GuiManager_H__ 00027 #define __GuiManager_H__ 00028 00029 #include "OgrePrerequisites.h" 00030 #include "OgreSingleton.h" 00031 00032 namespace Ogre { 00033 00039 class _OgreExport GuiManager : public Singleton<GuiManager> 00040 { 00041 public: 00042 GuiManager(); 00043 virtual ~GuiManager(); 00051 GuiElement* createGuiElement(const String& typeName, const String& instanceName, bool isTemplate = false); 00052 00054 GuiElement* getGuiElement(const String& name, bool isTemplate = false); 00055 00061 void destroyGuiElement(const String& instanceName, bool isTemplate = false); 00062 00068 void destroyGuiElement(GuiElement* pInstance, bool isTemplate = false); 00069 00075 void destroyAllGuiElements(bool isTemplate = false); 00076 00077 00078 00079 00085 void addGuiElementFactory(GuiElementFactory* elemFactory); 00086 00098 static GuiManager& getSingleton(void); 00099 00100 GuiElement* createGuiElementFromTemplate(const String& templateName, const String& typeName, const String& instanceName, bool isTemplate = false); 00101 00102 GuiElement* createGuiElementFromFactory(const String& typeName, const String& instanceName); 00103 protected: 00104 typedef std::map<String, GuiElementFactory*> FactoryMap; 00105 FactoryMap mFactories; 00106 00107 typedef std::map<String, GuiElement*> ElementMap; 00108 ElementMap mInstances; 00109 ElementMap mTemplates; 00110 00111 00112 00113 ElementMap& getElementMap(bool isTemplate); 00114 00115 GuiElement* createGuiElementImpl(const String& typeName, const String& instanceName, ElementMap& elementMap); 00116 00117 GuiElement* getGuiElementImpl(const String& name, ElementMap& elementMap); 00118 00119 void destroyGuiElementImpl(const String& instanceName, ElementMap& elementMap); 00120 00121 void destroyGuiElementImpl(GuiElement* pInstance, ElementMap& elementMap); 00122 00123 void destroyAllGuiElementsImpl(ElementMap& elementMap); 00124 00125 }; 00126 00127 00128 00129 } 00130 00131 00132 00133 00134 #endif
Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:10:13 2004