27 #ifndef _CEGUIImageManager_h_
28 #define _CEGUIImageManager_h_
30 #include "CEGUI/Singleton.h"
31 #include "CEGUI/ChainedXMLHandler.h"
32 #include "CEGUI/String.h"
33 #include "CEGUI/Size.h"
34 #include "CEGUI/ImageFactory.h"
35 #include "CEGUI/Logger.h"
36 #include "CEGUI/Exceptions.h"
37 #include "CEGUI/IteratorBase.h"
41 # pragma warning(push)
42 # pragma warning(disable : 4251)
78 void addImageType(
const String& name);
97 void removeImageType(
const String& name);
111 bool isImageTypeAvailable(
const String& name)
const;
136 void destroy(
Image& image);
137 void destroy(
const String& name);
141 bool isDefined(
const String& name)
const;
143 uint getImageCount()
const;
145 void loadImageset(
const String& filename,
const String& resource_group =
"");
146 void loadImagesetFromString(
const String& source);
148 void destroyImageCollection(
const String& prefix,
149 const bool delete_texture =
true);
151 void addFromImageFile(
const String& name,
153 const String& resource_group =
"");
162 void notifyDisplaySizeChanged(
const Sizef& size);
172 { d_imagesetDefaultResourceGroup = resourceGroup; }
183 {
return d_imagesetDefaultResourceGroup; }
186 const String& getSchemaName()
const;
187 const String& getDefaultResourceGroup()
const;
193 typedef std::map<
String, ImagePair,
205 ImageIterator getIterator()
const;
209 void elementStartLocal(
const String& element,
const XMLAttributes& attributes);
210 void elementEndLocal(
const String& element);
214 CEGUI_MAP_ALLOC(String, ImageFactory*)> ImageFactoryRegistry;
217 void destroy(ImageMap::iterator& iter);
223 void validateImagesetFileVersion(
const XMLAttributes& attrs);
226 static String d_imagesetDefaultResourceGroup;
229 ImageFactoryRegistry d_factories;
235 template <
typename T>
240 "Image type already exists: " + name));
244 Logger::getSingleton().logEvent(
245 "[CEGUI::ImageManager] Registered Image type: " + name);
251 #if defined(_MSC_VER)
252 # pragma warning(pop)
255 #endif // end of guard _CEGUIImageManager_h_
Functor that can be used as comparator in a std::map with String keys. It's faster than using the def...
Definition: String.h:5579
Definition: MemoryAllocatedObject.h:109
Templatised ImageFactory subclass used internally by the system.
Definition: ImageFactory.h:64
void addImageType(const String &name)
Register an Image subclass with the system and associate it with the identifier name.
Definition: ImageManager.h:236
Interface for Image.
Definition: Image.h:158
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
Exception class used when an attempt is made create a named object of a particular type when an objec...
Definition: Exceptions.h:483
static void setImagesetDefaultResourceGroup(const String &resourceGroup)
Sets the default resource group to be used when loading imageset data.
Definition: ImageManager.h:171
ConstMapIterator< ImageMap > ImageIterator
ConstBaseIterator type definition.
Definition: ImageManager.h:198
Definition: Singleton.h:55
Definition: ImageManager.h:48
Class representing a block of attributes associated with an XML element.
Definition: XMLAttributes.h:46
iterator class for maps
Definition: IteratorBase.h:196
std::map< String, ImagePair, StringFastLessCompare CEGUI_MAP_ALLOC(String, Image *)> ImageMap
container type used to hold the images.
Definition: ImageManager.h:195
std::pair< Image *, ImageFactory * > ImagePair
One entry in the image container.
Definition: ImageManager.h:190
bool isImageTypeAvailable(const String &name) const
Return whether an Image subclass has been registered using the identifier name.
static const String & getImagesetDefaultResourceGroup()
Returns the default resource group currently set for Imagesets.
Definition: ImageManager.h:182
Interface for factory objects that create instances of classes derived from the Image class...
Definition: ImageFactory.h:43
Abstract XMLHandler based class.
Definition: ChainedXMLHandler.h:36
String class used within the GUI system.
Definition: String.h:62