Crazy Eddie's GUI System  0.8.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CEGUI::ImageManager Class Reference
+ Inheritance diagram for CEGUI::ImageManager:
+ Collaboration diagram for CEGUI::ImageManager:

Public Types

typedef std::pair< Image
*, ImageFactory * > 
ImagePair
 One entry in the image container.
 
typedef std::map< String,
ImagePair,
StringFastLessCompare
CEGUI_MAP_ALLOC(String, Image *)> 
ImageMap
 container type used to hold the images.
 
typedef ConstMapIterator
< ImageMap
ImageIterator
 ConstBaseIterator type definition.
 

Public Member Functions

template<typename T >
void addImageType (const String &name)
 Register an Image subclass with the system and associate it with the identifier name. More...
 
void removeImageType (const String &name)
 Unregister the Image subclass that was registered under the identifier name. More...
 
bool isImageTypeAvailable (const String &name) const
 Return whether an Image subclass has been registered using the identifier name. More...
 
Imagecreate (const String &type, const String &name)
 Create an instance of Image subclass registered for identifier type using the name name. More...
 
Imagecreate (const XMLAttributes &attributes)
 
void destroy (Image &image)
 
void destroy (const String &name)
 
void destroyAll ()
 
Imageget (const String &name) const
 
bool isDefined (const String &name) const
 
uint getImageCount () const
 
void loadImageset (const String &filename, const String &resource_group="")
 
void loadImagesetFromString (const String &source)
 
void destroyImageCollection (const String &prefix, const bool delete_texture=true)
 
void addFromImageFile (const String &name, const String &filename, const String &resource_group="")
 
void notifyDisplaySizeChanged (const Sizef &size)
 Notify the ImageManager that the display size may have changed. More...
 
const StringgetSchemaName () const
 Retrieves the schema file name to use with resources handled by this handler.
 
const StringgetDefaultResourceGroup () const
 Retrieves the default resource group to be used when handling files.
 
ImageIterator getIterator () const
 Return a ImageManager::ImageIterator object to iterate over the available Image objects.
 
- Public Member Functions inherited from CEGUI::ChainedXMLHandler
void elementStart (const String &element, const XMLAttributes &attributes)
 Method called to notify the handler at the start of each XML element encountered. More...
 
void elementEnd (const String &element)
 Method called to notify the handler at the end of each XML element encountered. More...
 
bool completed () const
 returns whether this chained handler has completed.
 
- Public Member Functions inherited from CEGUI::XMLHandler
 XMLHandler (void)
 XMLHandler base class constructor.
 
virtual ~XMLHandler (void)
 XMLHandler base class destructor.
 
void handleContainer (const RawDataContainer &source)
 Takes given RawDataContainer containing XML and handles it. More...
 
void handleFile (const String &fileName, const String &resourceGroup)
 Takes given file containing XML and handles it. More...
 
void handleString (const String &source)
 Takes given string containing XML source and handles it. More...
 
virtual void text (const String &text)
 Method called to notify text node, several successiv text node are agregated. More...
 

Static Public Member Functions

static void setImagesetDefaultResourceGroup (const String &resourceGroup)
 Sets the default resource group to be used when loading imageset data. More...
 
static const StringgetImagesetDefaultResourceGroup ()
 Returns the default resource group currently set for Imagesets. More...
 
- Static Public Member Functions inherited from CEGUI::Singleton< ImageManager >
static ImageManagergetSingleton (void)
 
static ImageManagergetSingletonPtr (void)
 

Additional Inherited Members

- Protected Member Functions inherited from CEGUI::ChainedXMLHandler
void cleanupChainedHandler ()
 clean up any chained handler.
 
- Protected Attributes inherited from CEGUI::ChainedXMLHandler
ChainedXMLHandlerd_chainedHandler
 chained xml handler object.
 
bool d_completed
 is the chained handler completed.
 
bool d_deleteChaniedHandler
 should the chained handler be deleted by us?
 
- Static Protected Attributes inherited from CEGUI::Singleton< ImageManager >
static ImageManagerms_Singleton
 

Member Function Documentation

template<typename T >
void CEGUI::ImageManager::addImageType ( const String name)

Register an Image subclass with the system and associate it with the identifier name.

This registers a subclass of the Image class, such that instances of
that subclass can subsequently be created by using the identifier
\a name.
Template Parameters
TThe Image subclass to be instantiated when an Image is created using the type identifier name.
Parameters
nameString object describing the identifier that the Image subclass will be registered under.
Exceptions
AlreadyExistsExceptionthrown if an Image subclass is already registered using name.

References isImageTypeAvailable().

Image& CEGUI::ImageManager::create ( const String type,
const String name 
)

Create an instance of Image subclass registered for identifier type using the name name.

Parameters
typeString object describing the identifier of the Image subclass that is to be created.
nameString object describing the name that the newly created instance will be created with. This name must be unique within the system.
Exceptions
UnknownObjectExceptionthrown if no Image subclass has been registered using identifier type.
AlreadyExistsExceptionthrown if an Image instance named name already exists.
static const String& CEGUI::ImageManager::getImagesetDefaultResourceGroup ( )
inlinestatic

Returns the default resource group currently set for Imagesets.

Returns
String describing the default resource group identifier that will be used when loading Imageset data.
bool CEGUI::ImageManager::isImageTypeAvailable ( const String name) const

Return whether an Image subclass has been registered using the identifier name.

Parameters
nameString object describing the identifier to test for.
Returns
  • true if an Image subclass is registered using the identifier name.
  • false if no Image subclass is registered using the identifier name.

Referenced by addImageType().

void CEGUI::ImageManager::notifyDisplaySizeChanged ( const Sizef size)

Notify the ImageManager that the display size may have changed.

Parameters
sizeSize object describing the display resolution
void CEGUI::ImageManager::removeImageType ( const String name)

Unregister the Image subclass that was registered under the identifier name.

Parameters
nameString object describing the identifier of the Image subclass that is to be unregistered. If no such identifier is known within the system, no action is taken.
Note
You should avoid removing Image subclass types that are still in use. Internally a factory system is employed for the creation and deletion of Image based objects; if an Image subclass - and therefore it's factory - is removed while instances of that class are still active, it will not be possible to safely delete those instances.
static void CEGUI::ImageManager::setImagesetDefaultResourceGroup ( const String resourceGroup)
inlinestatic

Sets the default resource group to be used when loading imageset data.

Parameters
resourceGroupString describing the default resource group identifier to be used.