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

CEGUI::WindowManager Class Reference

The WindowManager class describes an object that manages creation and lifetime of Window objects. More...

#include <CEGUIWindowManager.h>

Inheritance diagram for CEGUI::WindowManager:

Inheritance graph
[legend]
Collaboration diagram for CEGUI::WindowManager:

Collaboration graph
[legend]
List of all members.

Public Types

typedef bool PropertyCallback (Window *window, String &propname, String &propvalue, void *userdata)
 Function type that is used as a callback when loading layouts from XML; the function is called for each Property element encountered.
typedef ConstBaseIterator<
WindowRegistry > 
WindowIterator

Public Member Functions

 WindowManager (void)
 Constructs a new WindowManager object.
 ~WindowManager (void)
 Destructor for WindowManager objects.
WindowcreateWindow (const String &type, const String &name)
 Creates a new Window object of the specified type, and gives it the specified unique name.
void destroyWindow (Window *window)
 Destroy the specified Window object.
void destroyWindow (const String &window)
 Destroy the specified Window object.
WindowgetWindow (const String &name) const
 Return a pointer to the specified Window object.
bool isWindowPresent (const String &name) const
 Examines the list of Window objects to see if one exists with the given name.
void destroyAllWindows (void)
 Destroys all Window objects within the system.
WindowloadWindowLayout (const String &filename, const String &name_prefix="", const String &resourceGroup="", PropertyCallback *callback=NULL, void *userdata=NULL)
 Creates a set of windows (a Gui layout) from the information in the specified XML file.
WindowIterator getIterator (void) const
 Return a WindowManager::WindowIterator object to iterate over the currently defined Windows.

Static Public Member Functions

WindowManagergetSingleton (void)
 Return singleton WindowManager object.
WindowManagergetSingletonPtr (void)
 Return pointer to singleton WindowManager object.

Static Protected Attributes

WindowManagerms_Singleton = NULL

Detailed Description

The WindowManager class describes an object that manages creation and lifetime of Window objects.

The WindowManager is the means by which Window objects are created and destroyed. For each sub-class of Window that is to be created, there must exist a WindowFactory object which is registered with the WindowFactoryManager. Additionally, the WindowManager tracks every Window object created, and can be used to access those Window objects by name.

Definition at line 55 of file CEGUIWindowManager.h.


Member Typedef Documentation

typedef bool CEGUI::WindowManager::PropertyCallback(Window *window, String &propname, String &propvalue, void *userdata)
 

Function type that is used as a callback when loading layouts from XML; the function is called for each Property element encountered.

Parameters:
window Window object that the property is to be applied to.
propname String holding the name of the property that is being set.
propvalue String holding the new value that will be applied to the property specified by /a propname.
userdata Some client code supplied data.
Returns:
  • true if the property should be set.
  • false if the property should not be set,

Definition at line 79 of file CEGUIWindowManager.h.

typedef ConstBaseIterator<WindowRegistry> CEGUI::WindowManager::WindowIterator
 

Definition at line 268 of file CEGUIWindowManager.h.

Referenced by getIterator().


Constructor & Destructor Documentation

CEGUI::WindowManager::WindowManager void   )  [inline]
 

Constructs a new WindowManager object.

NB: Client code should not create WindowManager objects - they are of limited use to you! The intended pattern of access is to get a pointer to the GUI system's WindowManager via the System object, and use that.

Definition at line 92 of file CEGUIWindowManager.h.

References CEGUI::utf8.

CEGUI::WindowManager::~WindowManager void   ) 
 

Destructor for WindowManager objects.

This will properly destry all remaining Window objects. Note that WindowFactory objects will not be destroyed (since they are owned by whoever created them).

Definition at line 59 of file CEGUIWindowManager.cpp.

References destroyAllWindows(), and CEGUI::utf8.


Member Function Documentation

Window * CEGUI::WindowManager::createWindow const String type,
const String name
 

Creates a new Window object of the specified type, and gives it the specified unique name.

Parameters:
type String that describes the type of Window to be created. A valid WindowFactory for the specified type must be registered.
name String that holds a unique name that is to be given to the new window.
Returns:
Pointer to the newly created Window object.
Exceptions:
AlreadyExistsException A Window object with the name name already exists.
UnknownObjectException No WindowFactory is registered for type Window objects.
GenericException Some other error occurred (Exception message has details).

Definition at line 70 of file CEGUIWindowManager.cpp.

References CEGUI::WindowFactory::createWindow(), CEGUI::Informative, isWindowPresent(), and CEGUI::utf8.

void CEGUI::WindowManager::destroyAllWindows void   ) 
 

Destroys all Window objects within the system.

Returns:
Nothing.
Exceptions:
InvalidRequestException Thrown if the WindowFactory for any Window object type has been removed.

Definition at line 159 of file CEGUIWindowManager.cpp.

References CEGUI::String::begin(), and destroyWindow().

Referenced by ~WindowManager().

void CEGUI::WindowManager::destroyWindow const String window  ) 
 

Destroy the specified Window object.

Parameters:
window String containing the name of the Window object to be destroyed. If window is not recognised, nothing happens.
Returns:
Nothing.
Exceptions:
InvalidRequestException Can be thrown if the WindowFactory for window's object type was removed.

Definition at line 110 of file CEGUIWindowManager.cpp.

References CEGUI::WindowFactory::destroyWindow(), CEGUI::String::find(), CEGUI::Informative, and CEGUI::utf8.

void CEGUI::WindowManager::destroyWindow Window window  ) 
 

Destroy the specified Window object.

Parameters:
window Pointer to the Window object to be destroyed. If the window is null, or is not recognised, nothing happens.
Returns:
Nothing
Exceptions:
InvalidRequestException Can be thrown if the WindowFactory for window's object type was removed.

Definition at line 91 of file CEGUIWindowManager.cpp.

References CEGUI::Window::getName().

Referenced by destroyAllWindows().

WindowManager::WindowIterator CEGUI::WindowManager::getIterator void   )  const
 

Return a WindowManager::WindowIterator object to iterate over the currently defined Windows.

Definition at line 294 of file CEGUIWindowManager.cpp.

References WindowIterator.

WindowManager & CEGUI::WindowManager::getSingleton void   )  [static]
 

Return singleton WindowManager object.

Returns:
Singleton WindowManager object

Reimplemented from CEGUI::Singleton< WindowManager >.

Definition at line 278 of file CEGUIWindowManager.cpp.

WindowManager * CEGUI::WindowManager::getSingletonPtr void   )  [static]
 

Return pointer to singleton WindowManager object.

Returns:
Pointer to singleton WindowManager object

Reimplemented from CEGUI::Singleton< WindowManager >.

Definition at line 284 of file CEGUIWindowManager.cpp.

Window * CEGUI::WindowManager::getWindow const String name  )  const
 

Return a pointer to the specified Window object.

Parameters:
name String holding the name of the Window object to be returned.
Returns:
Pointer to the Window object with the name name.
Exceptions:
UnknownObjectException No Window object with a name matching name was found.

Definition at line 134 of file CEGUIWindowManager.cpp.

bool CEGUI::WindowManager::isWindowPresent const String name  )  const
 

Examines the list of Window objects to see if one exists with the given name.

Parameters:
name String holding the name of the Window object to look for.
Returns:
true if a Window object was found with a name matching name. false if no matching Window object was found.

Definition at line 150 of file CEGUIWindowManager.cpp.

Referenced by createWindow().

Window * CEGUI::WindowManager::loadWindowLayout const String filename,
const String name_prefix = "",
const String resourceGroup = "",
PropertyCallback callback = NULL,
void *  userdata = NULL
 

Creates a set of windows (a Gui layout) from the information in the specified XML file.

Parameters:
filename String object holding the filename of the XML file to be processed.
name_prefix String object holding the prefix that is to be used when creating the windows in the layout file, this function allows a layout to be loaded multiple times without having name clashes.
resourceGroup Resource group identifier to be passed to the resource provider when loading the layout file.
callback PropertyCallback function to be called for each Property element loaded from the layout. This is called prior to the property value being applied to the window enabling client code manipulation of properties.
userdata Client code data pointer passed to the PropertyCallback function.
Returns:
Pointer to the root Window object defined in the layout.
Exceptions:
FileIOException thrown if something goes wrong while processing the file filename.
InvalidRequestException thrown if filename appears to be invalid.

Definition at line 175 of file CEGUIWindowManager.cpp.

References CEGUI::String::empty(), CEGUI::DataContainer< T >::getDataPtr(), CEGUI::GUILayout_xmlHandler::getLayoutRootWindow(), CEGUI::DataContainer< T >::getSize(), CEGUI::Informative, CEGUI::Standard, and CEGUI::utf8.


Member Data Documentation

WindowManager * CEGUI::Singleton< WindowManager >::ms_Singleton = NULL [static, protected, inherited]
 

Definition at line 46 of file CEGUIWindowManager.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Feb 16 12:41:12 2005 for Crazy Eddies GUI System by  doxygen 1.3.9.1