29 #ifndef _CEGUIWindowFactoryManager_h_
30 #define _CEGUIWindowFactoryManager_h_
32 #include "CEGUI/Base.h"
33 #include "CEGUI/String.h"
34 #include "CEGUI/Singleton.h"
35 #include "CEGUI/Logger.h"
36 #include "CEGUI/IteratorBase.h"
37 #include "CEGUI/WindowFactory.h"
38 #include "CEGUI/TplWindowFactory.h"
39 #include "CEGUI/Exceptions.h"
44 # pragma warning(push)
45 # pragma warning(disable : 4275)
46 # pragma warning(disable : 4251)
107 const String& getActiveTarget(
void)
const;
116 uint getStackedTargetCount(
void)
const;
122 typedef std::vector<
String
123 CEGUI_VECTOR_ALLOC(
String)> TargetTypeStack;
125 TargetTypeStack d_targetStack;
145 Logger::getSingleton().logEvent(
"CEGUI::WindowFactoryManager singleton destroyed");
180 template <
typename T>
181 static void addFactory();
197 template <
typename T>
198 static void addWindowType();
214 void removeFactory(
const String& name);
241 void removeAllFactories(
void);
273 bool isFactoryPresent(
const String& name)
const;
301 void addWindowTypeAlias(
const String& aliasName,
const String& targetType);
321 void removeWindowTypeAlias(
const String& aliasName,
const String& targetType);
327 void removeAllWindowTypeAliases();
360 void addFalagardWindowMapping(
const String& newType,
373 void removeFalagardWindowMapping(
const String& type);
379 void removeAllFalagardWindowMappings();
392 bool isFalagardMappedType(
const String& type)
const;
406 const String& getMappedLookForType(
const String& type)
const;
420 const String& getMappedRendererForType(
const String& type)
const;
440 String getDereferencedAliasType(
const String& type)
const;
454 const FalagardWindowMapping& getFalagardMappingForType(
const String& type)
const;
463 CEGUI_MAP_ALLOC(
String, AliasTargetStack)> TypeAliasRegistry;
465 CEGUI_MAP_ALLOC(
String, FalagardWindowMapping)> FalagardMapRegistry;
470 WindowFactoryRegistry d_factoryRegistry;
471 TypeAliasRegistry d_aliasRegistry;
472 FalagardMapRegistry d_falagardRegistry;
474 static OwnedWindowFactoryList d_ownedFactories;
488 WindowFactoryIterator getIterator(
void)
const;
495 TypeAliasIterator getAliasIterator(
void)
const;
502 FalagardMappingIterator getFalagardMappingIterator()
const;
506 template <
typename T>
510 WindowFactory* factory = CEGUI_NEW_AO T;
513 if (WindowFactoryManager::getSingletonPtr())
515 Logger::getSingleton().logEvent(
"Created WindowFactory for '" +
516 factory->getTypeName() +
521 WindowFactoryManager::getSingleton().addFactory(factory);
523 CEGUI_CATCH (Exception&)
525 Logger::getSingleton().logEvent(
"Deleted WindowFactory for '" +
526 factory->getTypeName() +
529 CEGUI_DELETE_AO factory;
534 d_ownedFactories.push_back(factory);
538 template <
typename T>
541 WindowFactoryManager::addFactory<TplWindowFactory<T> >();
549 #if defined(_MSC_VER)
550 # pragma warning(pop)
553 #endif // end of guard _CEGUIWindowFactoryManager_h_