/* CGUI by Gustav Larsson gee@pyro.nu --Overview-- This is the top class of the whole GUI, all objects and settings are stored within this class. --More info-- Check GUI.h */ #ifndef CGUI_H #define CGUI_H //-------------------------------------------------------- // Includes / Compiler directives //-------------------------------------------------------- #include "GUI.h" #include #include #include #include "input.h" // JW: grr, classes suck in this case :P class XERCES_CPP_NAMESPACE::DOMElement; //-------------------------------------------------------- // Macros //-------------------------------------------------------- //-------------------------------------------------------- // Types //-------------------------------------------------------- //-------------------------------------------------------- // Error declarations //-------------------------------------------------------- //-------------------------------------------------------- // Declarations //-------------------------------------------------------- class CGUI { // Only CGUIObject's leaf functions uses CGUI // freely. friend class CGUIObject; private: // Private typedefs typedef CGUIObject *(*ConstructObjectFunction)(); public: CGUI(); ~CGUI(); // Initialize void Initialize(/*/*nemInput *pInput*/); // Process void Process(); // Draw void Draw(); // Shutdown void Destroy(); // Load a GUI XML file void LoadXMLFile(const CStr &Filename); // Checks if object exists and return true or false accordingly bool ObjectExists(const CStr &Name) const; // Get pInput /// CInput *GetInput() { return m_pInput; } // to add a type: // AddObjecType("button", &CButton::ConstructObject); void AddObjectType(const CStr &str, ConstructObjectFunction pFunc) { m_ObjectTypes[str] = pFunc; } private: void UpdateObjects(); // Adds an object to the GUI's object database // Private, you can only add objects through XML files. void AddObject(CGUIObject* pObject); // Report a XML parsing error void ReportParseError(const CStr &str, ...); // Construct an object CGUIObject *ConstructObject(const CStr &str); // // XML Reading Xerces C++ specific subroutines // /** Xerces_* functions tree ========================== (ReadRootObjects) | +- (ReadObject) | +- | +-Optional Type Extensions (CGUIObject::ReadExtendedElement) TODO | +-«object» *recursive* (ReadRootStyles) | +-