29 #ifndef _CEGUISystem_h_
30 #define _CEGUISystem_h_
32 #include "CEGUI/Base.h"
33 #include "CEGUI/String.h"
34 #include "CEGUI/Singleton.h"
35 #include "CEGUI/EventSet.h"
36 #include "CEGUI/Renderer.h"
37 #include "CEGUI/InputEvent.h"
38 #include "CEGUI/ResourceProvider.h"
41 #if defined(__WIN32__) || defined(_WIN32)
42 # include "CEGUI/Win32StringTranscoder.h"
44 # include "CEGUI/IconvStringTranscoder.h"
48 # pragma warning(push)
49 # pragma warning(disable : 4275)
50 # pragma warning(disable : 4251)
65 class CEGUIEXPORT System :
66 public Singleton<System>,
68 public AllocatedObject<System>
71 static const String EventNamespace;
82 static const String EventDisplaySizeChanged;
86 static const String EventRenderedStringParserChanged;
128 const String& configFile =
"",
129 const String& logFile =
"CEGUI.log",
130 const int abi = CEGUI_VERSION_ABI);
133 static void destroy();
143 static unsigned int getMajorVersion();
153 static unsigned int getMinorVersion();
163 static unsigned int getPatchVersion();
173 static const String& getVersion();
183 static const String& getVerboseVersion();
192 Renderer* getRenderer(
void)
const {
return d_renderer;}
202 static System& getSingleton(
void);
212 static System* getSingletonPtr(
void);
218 Clipboard* getClipboard()
const {
return d_clipboard;}
220 GUIContext& getDefaultGUIContext()
const;
228 void renderAllGUIContexts();
238 ScriptModule* getScriptingModule(
void)
const;
250 void setScriptingModule(ScriptModule* scriptModule);
259 ResourceProvider* getResourceProvider(
void)
const;
271 void executeScriptFile(
const String& filename,
const String& resourceGroup =
"")
const;
285 int executeScriptGlobal(
const String& function_name)
const;
298 void executeScriptString(
const String& str)
const;
313 void setXMLParser(
const String& parserName);
332 void setXMLParser(XMLParser* parser);
338 XMLParser* getXMLParser(
void)
const {
return d_xmlParser; }
385 static void setDefaultXMLParserName(
const String& parserName);
396 static const String getDefaultXMLParserName();
402 ImageCodec& getImageCodec()
const;
408 void setImageCodec(
const String& codecName);
420 void setImageCodec(ImageCodec& codec);
426 static void setDefaultImageCodecName(
const String& codecName);
432 static const String& getDefaultImageCodecName();
451 void notifyDisplaySizeChanged(
const Sizef& new_size);
466 RenderedStringParser* getDefaultCustomRenderedStringParser()
const;
482 void setDefaultCustomRenderedStringParser(RenderedStringParser* parser);
494 void invalidateAllCachedRendering();
509 RegexMatcher* createRegexMatcher()
const;
512 void destroyRegexMatcher(RegexMatcher* rm)
const;
515 bool injectTimePulse(
float timeElapsed);
517 GUIContext& createGUIContext(RenderTarget& rt);
518 void destroyGUIContext(GUIContext& context);
528 void addStandardWindowFactories();
531 static const StringTranscoder& getStringTranscoder();
534 static void performVersionTest(
const int expected,
const int received,
539 System(
const System& obj);
540 System& operator=(
const System& obj);
575 System(Renderer& renderer, ResourceProvider* resourceProvider,
576 XMLParser* xmlParser, ImageCodec* imageCodec,
577 ScriptModule* scriptModule,
const String& configFile,
578 const String& logFile);
587 void outputLogHeader();
590 void createSingletons();
593 void destroySingletons();
596 void setupXMLParser();
599 void cleanupXMLParser();
602 void setupImageCodec(
const String& codecName);
605 void cleanupImageCodec();
608 void invalidateAllWindows();
613 Renderer* d_renderer;
614 ResourceProvider* d_resourceProvider;
615 bool d_ourResourceProvider;
617 Clipboard* d_clipboard;
620 ScriptModule* d_scriptModule;
621 String d_termScriptName;
623 XMLParser* d_xmlParser;
625 DynamicModule* d_parserModule;
627 static String d_defaultXMLParserName;
630 ImageCodec* d_imageCodec;
632 bool d_ourImageCodec;
636 DynamicModule* d_imageCodecModule;
638 static String d_defaultImageCodecName;
642 RenderedStringParser* d_customRenderedStringParser;
644 typedef std::vector<GUIContext* CEGUI_VECTOR_ALLOC(GUIContext*)> GUIContextCollection;
645 GUIContextCollection d_guiContexts;
647 #if defined(__WIN32__) || defined(_WIN32)
648 static const Win32StringTranscoder d_stringTranscoder;
650 static const IconvStringTranscoder d_stringTranscoder;
657 #if defined(_MSC_VER)
658 # pragma warning(pop)
661 #endif // end of guard _CEGUISystem_h_