Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CEGUIWindowManager.h

Go to the documentation of this file.
00001 /************************************************************************
00002         filename:       CEGUIWindowManager.h
00003         created:        21/2/2004
00004         author:         Paul D Turner
00005         
00006         purpose:        Defines the interface for the WindowManager object
00007 *************************************************************************/
00008 /*************************************************************************
00009     Crazy Eddie's GUI System (http://www.cegui.org.uk)
00010     Copyright (C)2004 - 2005 Paul D Turner (paul@cegui.org.uk)
00011 
00012     This library is free software; you can redistribute it and/or
00013     modify it under the terms of the GNU Lesser General Public
00014     License as published by the Free Software Foundation; either
00015     version 2.1 of the License, or (at your option) any later version.
00016 
00017     This library is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020     Lesser General Public License for more details.
00021 
00022     You should have received a copy of the GNU Lesser General Public
00023     License along with this library; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 *************************************************************************/
00026 #ifndef _CEGUIWindowManager_h_
00027 #define _CEGUIWindowManager_h_
00028 
00029 #include "CEGUIBase.h"
00030 #include "CEGUIString.h"
00031 #include "CEGUISingleton.h"
00032 #include "CEGUILogger.h"
00033 #include "CEGUIIteratorBase.h"
00034 #include <map>
00035 #include <vector>
00036 
00037 #if defined(_MSC_VER)
00038 #       pragma warning(push)
00039 #       pragma warning(disable : 4275)
00040 #       pragma warning(disable : 4251)
00041 #endif
00042 
00043 
00044 // Start of CEGUI namespace section
00045 namespace CEGUI
00046 {
00056 class CEGUIEXPORT WindowManager : public Singleton <WindowManager>
00057 {
00058 public:
00059     /*************************************************************************
00060         Public static data
00061     *************************************************************************/
00062     static const String GeneratedWindowNameBase;      
00063 
00085         typedef bool PropertyCallback(Window* window, String& propname, String& propvalue, void* userdata);
00086         
00087         /*************************************************************************
00088                 Construction and Destruction
00089         *************************************************************************/
00098         WindowManager(void);
00099 
00100 
00108         ~WindowManager(void);
00109 
00110 
00118         static  WindowManager&  getSingleton(void);
00119 
00120 
00128         static  WindowManager*  getSingletonPtr(void);
00129 
00130 
00131         /*************************************************************************
00132                 Window Related Methods
00133         *************************************************************************/
00152         Window* createWindow(const String& type, const String& name = "");
00153 
00154 
00167         void    destroyWindow(Window* window);
00168 
00169 
00182         void    destroyWindow(const String& window);
00183 
00184 
00197         Window* getWindow(const String& name) const;
00198 
00199 
00210         bool    isWindowPresent(const String& name) const;
00211 
00212 
00222         void    destroyAllWindows(void);
00223 
00224 
00255         Window* loadWindowLayout(const String& filename, const String& name_prefix = "", const String& resourceGroup = "", PropertyCallback* callback = NULL, void* userdata = NULL);
00256 
00265     bool isDeadPoolEmpty(void) const;
00266 
00278     void cleanDeadPool(void);
00279 
00297     void writeWindowLayoutToStream(const Window& window, OutStream& out_stream, bool writeParent = false) const;
00298 
00316     void writeWindowLayoutToStream(const String& window, OutStream& out_stream, bool writeParent = false) const;
00317 
00318 private:
00319     /*************************************************************************
00320         Implementation Methods
00321     *************************************************************************/
00326     String generateUniqueWindowName();
00327 
00328         /*************************************************************************
00329                 Implementation Constants
00330         *************************************************************************/
00331         static const char       GUILayoutSchemaName[];                  
00332 
00333 
00334         /*************************************************************************
00335                 Implementation Data
00336         *************************************************************************/
00337         typedef std::map<String, Window*>                       WindowRegistry;                         
00338     typedef std::vector<Window*>    WindowVector;   
00339 
00340         WindowRegistry                  d_windowRegistry;                       
00341     WindowVector    d_deathrow;     
00342 
00343     unsigned long   d_uid_counter;  
00344 
00345 public:
00346         /*************************************************************************
00347                 Iterator stuff
00348         *************************************************************************/
00349         typedef ConstBaseIterator<WindowRegistry>       WindowIterator;
00350 
00355         WindowIterator  getIterator(void) const;
00356 };
00357 
00358 } // End of  CEGUI namespace section
00359 
00360 #if defined(_MSC_VER)
00361 #       pragma warning(pop)
00362 #endif
00363 
00364 #endif  // end of guard _CEGUIWindowManager_h_

Generated on Wed Sep 7 09:56:35 2005 for Crazy Eddies GUI System by  doxygen 1.4.3