From eb2ddf4c50c7c7f345c0871f8f6b376eb54346ef Mon Sep 17 00:00:00 2001 From: Gee Date: Mon, 24 Nov 2003 02:27:04 +0000 Subject: [PATCH] no message This was SVN commit r76. --- binaries/hello.xml | 13 - binaries/objects.dtd | 49 ---- source/gui/CGUIButtonBehavior.cpp | 60 ----- source/gui/CGUIButtonBehavior.h | 71 ------ source/gui/CGUIObject.cpp | 335 ------------------------ source/gui/CGUIObject.h | 405 ------------------------------ source/gui/CGUISettingsObject.cpp | 10 - source/gui/CGUISettingsObject.h | 124 --------- source/gui/hello.xml | 13 - source/gui/objects.dtd | 49 ---- source/gui/sprite1.xml | 9 - source/gui/sprites.dtd | 28 --- 12 files changed, 1166 deletions(-) delete mode 100755 binaries/hello.xml delete mode 100755 binaries/objects.dtd delete mode 100755 source/gui/CGUIButtonBehavior.cpp delete mode 100755 source/gui/CGUIButtonBehavior.h delete mode 100755 source/gui/CGUIObject.cpp delete mode 100755 source/gui/CGUIObject.h delete mode 100755 source/gui/CGUISettingsObject.cpp delete mode 100755 source/gui/CGUISettingsObject.h delete mode 100755 source/gui/hello.xml delete mode 100755 source/gui/objects.dtd delete mode 100755 source/gui/sprite1.xml delete mode 100755 source/gui/sprites.dtd diff --git a/binaries/hello.xml b/binaries/hello.xml deleted file mode 100755 index 64a33749b2..0000000000 --- a/binaries/hello.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/binaries/objects.dtd b/binaries/objects.dtd deleted file mode 100755 index 1167920dd1..0000000000 --- a/binaries/objects.dtd +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/source/gui/CGUIButtonBehavior.cpp b/source/gui/CGUIButtonBehavior.cpp deleted file mode 100755 index 1193244f8b..0000000000 --- a/source/gui/CGUIButtonBehavior.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* -CGUIButtonBehavior -by Gustav Larsson -gee@pyro.nu -*/ - -//#include "stdafx." -#include "GUI.h" - -using namespace std; - -//------------------------------------------------------------------- -// Constructor / Destructor -//------------------------------------------------------------------- -CGUIButtonBehavior::CGUIButtonBehavior() : m_Pressed(false) -{ -} - -CGUIButtonBehavior::~CGUIButtonBehavior() -{ -} - -void CGUIButtonBehavior::HandleMessage(const EGUIMessage &Message) -{ - switch (Message) - { - case GUIM_POSTPROCESS: - // Check if button has been pressed - if (m_Pressed) - { - // Now check if mouse is released, that means - // it's released outside, since GUIM_MOUSE_RELEASE_LEFT - // would've handled m_Pressed and reset it already - - // Get input structure -/// if (GetGUI()->GetInput()->mRelease(NEMM_BUTTON1)) - { - // Reset - m_Pressed = false; - } - } - break; - - case GUIM_MOUSE_PRESS_LEFT: - m_Pressed = true; - break; - - case GUIM_MOUSE_RELEASE_LEFT: - if (m_Pressed) - { - m_Pressed = false; - // BUTTON WAS CLICKED - HandleMessage(GUIM_PRESSED); - } - break; - - default: - break; - } -} diff --git a/source/gui/CGUIButtonBehavior.h b/source/gui/CGUIButtonBehavior.h deleted file mode 100755 index 45e66111c7..0000000000 --- a/source/gui/CGUIButtonBehavior.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -GUI Object - Button -by Gustav Larsson -gee@pyro.nu - ---Overview-- - - Interface class that enhance the CGUIObject with - buttony behavior (click and release to click a button), - and the GUI message GUIM_PRESSED. - When creating a class with extended settings and - buttony behavior, just do a multiple inheritance. - ---More info-- - - Check GUI.h - -*/ - -#ifndef CGUIButtonBehavior_H -#define CGUIButtonBehavior_H - -//-------------------------------------------------------- -// Includes / Compiler directives -//-------------------------------------------------------- -#include "GUI.h" - -//-------------------------------------------------------- -// Macros -//-------------------------------------------------------- - -//-------------------------------------------------------- -// Types -//-------------------------------------------------------- - -//-------------------------------------------------------- -// Declarations -//-------------------------------------------------------- - -/** - * @author Gustav Larsson - * - * Appends button behaviours to the CGUIObject. - * Can be used with multiple inheritance alongside - * CGUISettingsObject and such. - * - * @see CGUIObject - */ -class CGUIButtonBehavior : virtual public CGUIObject -{ -public: - CGUIButtonBehavior(); - virtual ~CGUIButtonBehavior(); - - /** - * @see CGUIObject#HandleMessage() - */ - virtual void HandleMessage(const EGUIMessage &Message); - -protected: - /** - * Everybody knows how a button works, you don't simply press it, - * you have to first press the button, and then release it... - * in between those two steps you can actually leave the button - * area, as long as you release it within the button area... Anyway - * this lets us know we are done with step one (clicking). - */ - bool m_Pressed; -}; - -#endif \ No newline at end of file diff --git a/source/gui/CGUIObject.cpp b/source/gui/CGUIObject.cpp deleted file mode 100755 index 60889b4eb6..0000000000 --- a/source/gui/CGUIObject.cpp +++ /dev/null @@ -1,335 +0,0 @@ -/* -CGUIObject -by Gustav Larsson -gee@pyro.nu -*/ - -//#include "stdafx." -#include "GUI.h" - -///// janwas: again, including etiquette? -#include "../ps/Parser.h" -#include -///// - -using namespace std; - -// Offsets -map_Settings CGUIObject::m_SettingsInfo; - -//------------------------------------------------------------------- -// Implementation Macros -//------------------------------------------------------------------- -#define _GUI_ADD_OFFSET(type, str, var) \ - SettingsInfo[str].m_Offset = offsetof(CGUIObject, m_BaseSettings) + offsetof(SGUIBaseSettings,var); \ - SettingsInfo[str].m_Type = type; - -//------------------------------------------------------------------- -// Constructor / Destructor -//------------------------------------------------------------------- -CGUIObject::CGUIObject() : - m_pGUI(NULL), - m_pParent(NULL), - m_MouseHovering(false) -{ - // Default values of base settings ! - m_BaseSettings.m_Enabled = true; - m_BaseSettings.m_Hidden = false; - m_BaseSettings.m_Style = "null"; - m_BaseSettings.m_Z = 0.f; - - // Static! Only done once - if (m_SettingsInfo.empty()) - { - SetupBaseSettingsInfo(m_SettingsInfo); - } -} - -CGUIObject::~CGUIObject() -{ -} - -//------------------------------------------------------------------- -// Functions -//------------------------------------------------------------------- -void CGUIObject::SetBaseSettings(const SGUIBaseSettings &Set) -{ - m_BaseSettings = Set; - CheckSettingsValidity(); -} - -void CGUIObject::AddChild(CGUIObject *pChild) -{ - // -// assert(pChild); - - pChild->SetParent(this); - - m_Children.push_back(pChild); - - // If this (not the child) object is already attached - // to a CGUI, it pGUI pointer will be non-null. - // This will mean we'll have to check if we're using - // names already used. - if (pChild->GetGUI()) - { - try - { - // Atomic function, if it fails it won't - // have changed anything - //UpdateObjects(); - pChild->GetGUI()->UpdateObjects(); - } - catch (PS_RESULT e) - { - // If anything went wrong, reverse what we did and throw - // an exception telling it never added a child - m_Children.erase( m_Children.end()-1 ); - - // We'll throw the same exception for easier - // error handling - throw e; - } - } - // else do nothing -} - -void CGUIObject::AddToPointersMap(map_pObjects &ObjectMap) -{ - // Just don't do anything about the top node - if (m_pParent == NULL) - return; - - // Now actually add this one - // notice we won't add it if it's doesn't have any parent - // (i.e. being the base object) - if (m_Name == string()) - { - throw PS_NEEDS_NAME; - } - if (ObjectMap.count(m_Name) > 0) - { - throw PS_NAME_AMBIGUITY; - } - else - { - ObjectMap[m_Name] = this; - } -} - -void CGUIObject::Destroy() -{ - // Is there anything besides the children to destroy? -} - -void CGUIObject::SetupBaseSettingsInfo(map_Settings &SettingsInfo) -{ - SettingsInfo["hejsan"].m_Offset = 0; - - - _GUI_ADD_OFFSET("bool", "enabled", m_Enabled) - _GUI_ADD_OFFSET("bool", "hidden", m_Hidden) - _GUI_ADD_OFFSET("rect", "size1024", m_Size) - _GUI_ADD_OFFSET("string", "style", m_Style) - _GUI_ADD_OFFSET("float", "z", m_Z) - _GUI_ADD_OFFSET("string", "caption", m_Caption) -} - -bool CGUIObject::MouseOver() -{ - if(!GetGUI()) - throw PS_NEEDS_PGUI; - - u16 mouse_x = GetMouseX(), - mouse_y = GetMouseY(); - - return (mouse_x >= m_BaseSettings.m_Size.left && - mouse_x <= m_BaseSettings.m_Size.right && - mouse_y >= m_BaseSettings.m_Size.bottom && - mouse_y <= m_BaseSettings.m_Size.top); -} - -u16 CGUIObject::GetMouseX() const -{ - return ((GetGUI())?(GetGUI()->m_MouseX):0); -} - -u16 CGUIObject::GetMouseY() const -{ - return ((GetGUI())?(GetGUI()->m_MouseY):0); -} - -void CGUIObject::UpdateMouseOver(CGUIObject * const &pMouseOver) -{ - // Check if this is the object being hovered. - if (pMouseOver == this) - { - if (!m_MouseHovering) - { - // It wasn't hovering, so that must mean it just entered - HandleMessage(GUIM_MOUSE_ENTER); - } - - // Either way, set to true - m_MouseHovering = true; - - // call mouse over - HandleMessage(GUIM_MOUSE_OVER); - } - else // Some other object (or none) is hovered - { - if (m_MouseHovering) - { - m_MouseHovering = false; - HandleMessage(GUIM_MOUSE_LEAVE); - } - } -} - -bool CGUIObject::SettingExists(const CStr &Setting) const -{ - // Because GetOffsets will direct dynamically defined - // classes with polymorifsm to respective m_SettingsInfo - // we need to make no further updates on this function - // in derived classes. - return (GetSettingsInfo().count(Setting) == 1)?true:false; -} - -void CGUIObject::SetSetting(const CStr &Setting, const CStr &Value) -{ - if (!SettingExists(Setting)) - { - throw PS_FAIL; - } - - // Get setting - SGUISetting set = GetSettingsInfo()[Setting]; - - if (set.m_Type == CStr(_T("string"))) - { - GUI::SetSetting(this, Setting, Value); - } - else - if (set.m_Type == CStr(_T("float"))) - { - // Use the parser to parse the values -/* CParser parser; - parser.InputTaskType("", "_$value_"); - - CParserLine line; - line.ParseString(parser, Value); - if (!line.m_ParseOK) - { - // ERROR! - throw PS_FAIL; - } - - float value; - if (!line.GetArgFloat(0, value)) - { - // ERROR! - throw PS_FAIL; - } - - // Finally the rectangle values - GUI::SetSetting(this, Setting, value); -*/ - GUI::SetSetting(this, Setting, Value.ToFloat() ); - } - else - if (set.m_Type == CStr(_T("rect"))) - { - // TEMP - GUI::SetSetting(this, Setting, CRect(100,100,200,200)); - - // Use the parser to parse the values - /* CParser parser; - parser.InputTaskType("", "_$value_$value_$value_$value_"); - - // TODO Gee string really? - string str = Value; - - CParserLine line; - line.ParseString(parser, Value); - if (!line.m_ParseOK) - { - // ERROR! - throw PS_FAIL; - } - int values[4]; - for (int i=0; i<4; ++i) - { - if (!line.GetArgInt(i, values[i])) - { - // ERROR! - throw PS_FAIL; - } - } - - // Finally the rectangle values - CRect rect(values[0], values[1], values[2], values[3]); - GUI::SetSetting(this, Setting, rect); - */} - else - { - throw PS_FAIL; - } -} - -void CGUIObject::ChooseMouseOverAndClosest(CGUIObject* &pObject) -{ - if (MouseOver()) - { - // Check if we've got competition at all - if (pObject == NULL) - { - pObject = this; - return; - } - - // Or if it's closer - if (GetBaseSettings().m_Z >= pObject->GetBaseSettings().m_Z) - { - pObject = this; - return; - } - } -} - -CGUIObject *CGUIObject::GetParent() -{ - // Important, we're not using GetParent() for these - // checks, that could screw it up - if (m_pParent) - { - if (m_pParent->m_pParent == NULL) - return NULL; - } - - return m_pParent; -} - -// GeeTODO keep this function and all??? -void CGUIObject::CheckSettingsValidity() -{ - // If we hide an object, reset many of its parts - if (GetBaseSettings().m_Hidden) - { - // Simulate that no object is hovered for this object and all its children - // why? because it's - try - { - GUI::RecurseObject(0, this, &CGUIObject::UpdateMouseOver, NULL); - } - catch (...) {} - } - - try - { - // Send message to myself - HandleMessage(GUIM_SETTINGS_UPDATED); - } - catch (...) - { - } -} \ No newline at end of file diff --git a/source/gui/CGUIObject.h b/source/gui/CGUIObject.h deleted file mode 100755 index 518c573962..0000000000 --- a/source/gui/CGUIObject.h +++ /dev/null @@ -1,405 +0,0 @@ -/* -The base class of an object -by Gustav Larsson -gee@pyro.nu - ---Overview-- - - All objects are derived from this class, it's an ADT - so it can't be used per se - - Also contains a Dummy object which is used for - completely blank objects. - ---Usage-- - - Write about how to use it here - ---Examples-- - - Provide examples of how to use this code, if necessary - ---More info-- - - Check GUI.h - -*/ - -#ifndef CGUIObject_H -#define CGUIObject_H - -//-------------------------------------------------------- -// Includes / Compiler directives -//-------------------------------------------------------- -#include "GUI.h" -#include -#include - -struct SGUISetting; -class CGUI; - -//-------------------------------------------------------- -// Macros -//-------------------------------------------------------- - -//-------------------------------------------------------- -// Types -//-------------------------------------------------------- - -// Map with pointers -typedef std::map map_Settings; -typedef std::vector vector_pObjects; - -//-------------------------------------------------------- -// Error declarations -//-------------------------------------------------------- - -//-------------------------------------------------------- -// Declarations -//-------------------------------------------------------- - -// TEMP -struct CRect -{ - CRect() {} - CRect(int _l, int _b, int _r, int _t) : - top(_t), - bottom(_b), - right(_r), - left(_l) {} - int bottom, top, left, right; - - bool operator ==(const CRect &rect) const - { - return (bottom==rect.bottom) && - (top==rect.top) && - (left==rect.left) && - (right==rect.right); - } - - bool operator !=(const CRect &rect) const - { - return !(*this==rect); - } -}; - -// TEMP -struct CColor -{ - float r, g, b, a; -}; - -// Text alignments -enum EAlign { EAlign_Left, EAlign_Right, EAlign_Center }; -enum EValign { EValign_Top, EValign_Bottom, EValign_Center }; - -/** - * @author Gustav Larsson - * - * Stores the information where to find a variable - * in a GUI-Object object, also what type it is. - */ -struct SGUISetting -{ - size_t m_Offset; // The offset from CGUIObject to the variable (not from SGUIBaseSettings or similar) - CStr m_Type; // "string" or maybe "int" -}; - -/** - * @author Gustav Larsson - * - * Base settings, all objects possess these settings - * in their m_BaseSettings - * Instructions can be found in the documentations. - */ -struct SGUIBaseSettings -{ - bool m_Hidden; - bool m_Enabled; - bool m_Absolute; - CRect m_Size; - CStr m_Style; - float m_Z; - CStr m_Caption; // Is usually set within an XML element and not in the attributes -}; - -////////////////////////////////////////////////////////// - -/** - * @author Gustav Larsson - * - * GUI object such as a button or an input-box. - * Abstract data type ! - */ -class CGUIObject -{ - friend class CGUI; - friend class GUI; - -public: - CGUIObject(); - virtual ~CGUIObject(); - - /** - * Get offsets - * - * @return Retrieves settings info - */ - virtual map_Settings GetSettingsInfo() const { return m_SettingsInfo; } - - /** - * Checks if mouse is hovering this object. - * The mouse position is cached in CGUI. - * - * This function checks if the mouse is hovering the - * rectangle that the base setting "size" makes. - * Although it is virtual, so one could derive - * an object from CButton, which changes only this - * to checking the circle that "size" makes. - * - * @return true if mouse is hovering - */ - virtual bool MouseOver(); - - //-------------------------------------------------------- - /** @name Leaf Functions */ - //-------------------------------------------------------- - //@{ - - /// Get object name, name is unique - CStr GetName() const { return m_Name; } - - /// Get object name - void SetName(const CStr &Name) { m_Name = Name; } - - /** - * Adds object and its children to the map, it's name being the - * first part, and the second being itself. - * - * @param ObjectMap Adds this to the map_pObjects. - * - * @throws PS_NEEDS_NAME Name is missing - * @throws PS_NAME_AMBIGUITY Name is already taken - */ - void AddToPointersMap(map_pObjects &ObjectMap); - - /** - * Notice nothing will be returned or thrown if the child hasn't - * been inputted into the GUI yet. This is because that's were - * all is checked. Now we're just linking two objects, but - * it's when we're inputting them into the GUI we'll check - * validity! Notice also when adding it to the GUI this function - * will inevitably have been called by CGUI::AddObject which - * will catch the throw and return the error code. - * i.e. The user will never put in the situation wherein a throw - * must be caught, the GUI's internal error handling will be - * completely transparent to the interfacially sequential model. - * - * @param pChild Child to add - * - * @throws PS_RESULT from CGUI::UpdateObjects(). - */ - void AddChild(CGUIObject *pChild); - - //@} - //-------------------------------------------------------- - /** @name Iterate */ - //-------------------------------------------------------- - //@{ - - vector_pObjects::iterator ChildrenItBegin() { return m_Children.begin(); } - vector_pObjects::iterator ChildrenItEnd() { return m_Children.end(); } - - //@} - //-------------------------------------------------------- - /** @name Settings Management */ - //-------------------------------------------------------- - //@{ - - SGUIBaseSettings GetBaseSettings() const { return m_BaseSettings; } - void SetBaseSettings(const SGUIBaseSettings &Set); - - /** - * Checks if settings exists, only available for derived - * classes that has this set up, that's why the base - * class just returns false - * - * @param Setting setting name - * @return True if settings exist. - */ - bool SettingExists(const CStr &Setting) const; - - /** - * Should be called every time the settings has been updated - * will also send a message GUIM_SETTINGS_UPDATED, so that - * if a derived object wants to add things to be updated, - * they add it in that message part, this is a better solution - * than making this virtual, since the updates that the base - * class does, are the most essential. - * This is not private since there should be no harm in - * checking validity. - * - * @throws GeeTODO not quite settled yet. - */ - void CheckSettingsValidity(); - - /** - * Sets up a map_size_t to include the variables in m_BaseSettings - * - * @param SettingsInfo Pointers that should be filled with base variables - */ - void SetupBaseSettingsInfo(map_Settings &SettingsInfo); - - /** - * Set a setting by string, regardless of what type it is. - * - * example a CRect(10,10,20,20) would be "10 10 20 20" - * - * @param Setting Setting by name - * @param Value Value to set to - */ - void SetSetting(const CStr &Setting, const CStr &Value); - - //@} -protected: - //-------------------------------------------------------- - /** @name Called by CGUI and friends - * - * Methods that the CGUI will call using - * its friendship, these should not - * be called by user. - * These functions' security are a lot - * what constitutes the GUI's - */ - //-------------------------------------------------------- - //@{ - - /** - * Calls Destroy on all children, and deallocates all memory. - * BIG TODO Should it destroy it's children? - */ - virtual void Destroy(); - - /** - * This function is called with different messages - * for instance when the mouse enters the object. - * - * @param Message EGUIMessage - */ - virtual void HandleMessage(const EGUIMessage &Message)=0; - - /** - * Draws the object. - * - * @throws PS_RESULT if any. But this will mostlikely be - * very rare since if an object is drawn unsuccessfully - * it'll probably only output in the Error log, and not - * disrupt the whole GUI drawing. - */ - virtual void Draw()=0; - - // This is done internally - CGUI *GetGUI() { return m_pGUI; } - const CGUI *GetGUI() const { return m_pGUI; } - void SetGUI(CGUI * const &pGUI) { m_pGUI = pGUI; } - - // Set parent - void SetParent(CGUIObject *pParent) { m_pParent = pParent; } - - /** - * NOTE! This will not just return m_pParent, when that is - * need use it! There is one exception to it, when the parent is - * the top-node (the object that isn't a real object), this - * will return NULL, so that the top-node's children are - * seemingly parentless. - * - * @return Pointer to parent - */ - CGUIObject *GetParent(); - - // Get cached mouse x/y from CGUI - u16 GetMouseX() const; - u16 GetMouseY() const; - - //@} -private: - //-------------------------------------------------------- - /** @name Internal functions */ - //-------------------------------------------------------- - //@{ - - /** - * Inputs a reference pointer, checks if the new inputted object - * if hovered, if so, then check if this's Z value is greater - * than the inputted object... If so then the object is closer - * and we'll replace the pointer with this. - * Also Notice input can be NULL, which means the Z value demand - * is out. NOTICE you can't input NULL as const so you'll have - * to set an object to NULL. - * - * @param pObject Object pointer, can be either the old one, or - * the new one. - */ - void ChooseMouseOverAndClosest(CGUIObject* &pObject); - - /** - * Inputes the object that is currently hovered, this function - * updates this object accordingly (i.e. if it's the object - * being inputted one thing happens, and not, another). - * - * @param pMouseOver Object that is currently hovered, - * can OF COURSE be NULL too! - */ - void UpdateMouseOver(CGUIObject * const &pMouseOver); - - //@} - - // Variables - -protected: - /// Name of object - CStr m_Name; - - /// Constructed on the heap, will be destroyed along with the the object TODO Really? - vector_pObjects m_Children; - - /// Pointer to parent - CGUIObject *m_pParent; - - /// Base settings - SGUIBaseSettings m_BaseSettings; - - // More variables - - /// Is mouse hovering the object? used with the function MouseOver() - bool m_MouseHovering; - - /** - * Tells us where a variable by a string name is - * located hardcoded, in order to acquire a pointer - * for that variable... Say "frozen" gives - * the offset from CGUIObject to m_Frozen. - * note! NOT from SGUIBaseSettings to - * m_Frozen! - */ - static map_Settings m_SettingsInfo; - -private: - /// An object can't function stand alone - CGUI *m_pGUI; -}; - - -/** - * @author Gustav Larsson - * - * Dummy object used primarily for the root object - * which isn't a *real* object in the GUI. - */ -class CGUIDummyObject : public CGUIObject -{ - virtual void HandleMessage(const EGUIMessage &Message) {} - virtual void Draw() {} -}; - -#endif \ No newline at end of file diff --git a/source/gui/CGUISettingsObject.cpp b/source/gui/CGUISettingsObject.cpp deleted file mode 100755 index db19607103..0000000000 --- a/source/gui/CGUISettingsObject.cpp +++ /dev/null @@ -1,10 +0,0 @@ -/* -CGUISettingsObject -by Gustav Larsson -gee@pyro.nu -*/ - -//#include "stdafx.h" -#include "GUI.h" - -using namespace std; \ No newline at end of file diff --git a/source/gui/CGUISettingsObject.h b/source/gui/CGUISettingsObject.h deleted file mode 100755 index 876ca1da42..0000000000 --- a/source/gui/CGUISettingsObject.h +++ /dev/null @@ -1,124 +0,0 @@ -/* -Object with settings -by Gustav Larsson -gee@pyro.nu - ---Overview-- - - Generic object that stores a struct with settings - ---Usage-- - - If an object wants settings with a standard, - it will use this as a middle step instead of being - directly derived from CGUIObject - ---Examples-- - - instead of: - - class CButton : public CGUIObject - - you go: - - class CButton : public CGUISettingsObject - - and SButtonSettings will be included as m_Settings with - all gets and sets set up - ---More info-- - - Check GUI.h - -*/ - -#ifndef CGUISettingsObject_H -#define CGUISettingsObject_H - -//-------------------------------------------------------- -// Includes / Compiler directives -//-------------------------------------------------------- -#include "GUI.h" - -//-------------------------------------------------------- -// Macros -//-------------------------------------------------------- - -//-------------------------------------------------------- -// Types -//-------------------------------------------------------- - -//-------------------------------------------------------- -// Error declarations -//-------------------------------------------------------- - -//-------------------------------------------------------- -// Declarations -//-------------------------------------------------------- - -/** - * @author Gustav Larsson - * - * Appends more settings to the CGUIObject. - * Can be used with multiple inheritance. - * - * @see CGUIObject - */ -template -class CGUISettingsObject : virtual public CGUIObject -{ -public: - CGUISettingsObject() {} - virtual ~CGUISettingsObject() {} - - /** - * Get Offsets, important to include so it returns this - * m_Offsets and not CGUIObject::m_SettingsInfo - * - * @return Settings infos - */ - virtual map_Settings GetSettingsInfo() const { return m_SettingsInfo; } - - /** - * @return Returns a copy of m_Settings - */ - SETTINGS GetSettings() const { return m_Settings; } - - /// Sets settings - void SetSettings(const SETTINGS &Set) - { - m_Settings = Set; - - //CheckSettingsValidity(); - // Since that function out-commented above really - // does just update the base settings, we'll call - // the message immediately instead - try - { - HandleMessage(GUIM_SETTINGS_UPDATED); - } - catch (...) { } - } - -protected: - /// Settings struct - SETTINGS m_Settings; - - /** - * Offset database
- * tells us where a variable by a string name is - * located hardcoded, in order to acquire a pointer - * for that variable... Say "frozen" gives - * the offset from CGUIObject to m_Frozen. - * - * note! _NOT_ from SGUIBaseSettings to m_Frozen! - * - * Note that it's imperative that this m_SettingsInfo includes - * all offsets of m_BaseSettings too, because when - * using this class, this m_SettingsInfo will be the only - * one used. - */ - static map_Settings m_SettingsInfo; -}; - -#endif \ No newline at end of file diff --git a/source/gui/hello.xml b/source/gui/hello.xml deleted file mode 100755 index 64a33749b2..0000000000 --- a/source/gui/hello.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/source/gui/objects.dtd b/source/gui/objects.dtd deleted file mode 100755 index 1167920dd1..0000000000 --- a/source/gui/objects.dtd +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/source/gui/sprite1.xml b/source/gui/sprite1.xml deleted file mode 100755 index 20d0a69238..0000000000 --- a/source/gui/sprite1.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/source/gui/sprites.dtd b/source/gui/sprites.dtd deleted file mode 100755 index 4dd73bc7f2..0000000000 --- a/source/gui/sprites.dtd +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file