Crazy Eddie's GUI System  0.8.4
CEGUI::ImageManager Class Reference
+ Inheritance diagram for CEGUI::ImageManager:
+ Collaboration diagram for CEGUI::ImageManager:

List of all members.

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.
void removeImageType (const String &name)
 Unregister the Image subclass that was registered under the identifier name.
bool isImageTypeAvailable (const String &name) const
 Return whether an Image subclass has been registered using the identifier name.
Imagecreate (const String &type, const String &name)
 Create an instance of Image subclass registered for identifier type using the name name.
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.
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.

Static Public Member Functions

static void setImagesetDefaultResourceGroup (const String &resourceGroup)
 Sets the default resource group to be used when loading imageset data.
static const StringgetImagesetDefaultResourceGroup ()
 Returns the default resource group currently set for Imagesets.

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 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.

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().

Notify the ImageManager that the display size may have changed.

Parameters:
sizeSize object describing the display resolution

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) [inline, static]

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

Parameters:
resourceGroupString describing the default resource group identifier to be used.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends