00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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
00036 #if defined(_MSC_VER)
00037 # pragma warning(push)
00038 # pragma warning(disable : 4275)
00039 # pragma warning(disable : 4251)
00040 #endif
00041
00042
00043
00044 namespace CEGUI
00045 {
00055 class CEGUIBASE_API WindowManager : public Singleton <WindowManager>
00056 {
00057 public:
00079 typedef bool PropertyCallback(Window* window, String& propname, String& propvalue, void* userdata);
00080
00081
00082
00083
00092 WindowManager(void) { Logger::getSingleton().logEvent((utf8*)"CEGUI::WindowManager singleton created"); }
00093
00094
00102 ~WindowManager(void);
00103
00104
00112 static WindowManager& getSingleton(void);
00113
00114
00122 static WindowManager* getSingletonPtr(void);
00123
00124
00125
00126
00127
00145 Window* createWindow(const String& type, const String& name);
00146
00147
00160 void destroyWindow(Window* window);
00161
00162
00175 void destroyWindow(const String& window);
00176
00177
00190 Window* getWindow(const String& name) const;
00191
00192
00203 bool isWindowPresent(const String& name) const;
00204
00205
00215 void destroyAllWindows(void);
00216
00217
00246 Window* loadWindowLayout(const String& filename, const String& name_prefix = "", const String& resourceGroup = "", PropertyCallback* callback = NULL, void* userdata = NULL);
00247
00248
00249 private:
00250
00251
00252
00253 static const char GUILayoutSchemaName[];
00254
00255
00256
00257
00258
00259 typedef std::map<String, Window*> WindowRegistry;
00260
00261 WindowRegistry d_windowRegistry;
00262
00263
00264 public:
00265
00266
00267
00268 typedef ConstBaseIterator<WindowRegistry> WindowIterator;
00269
00274 WindowIterator getIterator(void) const;
00275 };
00276
00277 }
00278
00279 #if defined(_MSC_VER)
00280 # pragma warning(pop)
00281 #endif
00282
00283 #endif // end of guard _CEGUIWindowManager_h_