50 #include <boost/unordered_set.hpp>
165 const CPos &pos,
const float &z,
const CRect &clipping);
260 const float &Width,
const float &BufferZone,
bool ObjectExists(const CStr &Name) const
Checks if object exists and return true or false accordingly.
void Xeromyces_ReadImage(XMBElement Element, CXeromyces *pFile, CGUISprite &parent)
Reads in the element <image> (the XMBElement) and stores the result within the CGUISprite.
std::map< CStr, CColor > m_PreDefinedColors
This is a bank of custom colors, it is simply a look up table that will return a color object when so...
void DrawSprite(const CGUISpriteInstance &Sprite, int CellID, const float &Z, const CRect &Rect, const CRect &Clipping=CRect())
Draw GUI Sprite.
void Xeromyces_ReadRootSprites(XMBElement Element, CXeromyces *pFile)
Reads in the root element <sprites> (the DOMElement).
Base class to only the class GUI.
std::map< CStr, CStrW > m_SettingsDefaults
void Xeromyces_ReadObject(XMBElement Element, CXeromyces *pFile, IGUIObject *pParent, const std::vector< std::pair< CStr, CStr > > &NameSubst, boost::unordered_set< VfsPath > &Paths)
Notice! Recursive function!
IGUIObject * m_FocusedObject
Focused object! Say an input box that is selected.
void Xeromyces_ReadScrollBarStyle(XMBElement Element, CXeromyces *pFile)
Reads in the element <scrollbar> (the XMBElement) and stores the result in m_ScrollBarStyles.
JSObject * m_ScriptObject
An JSObject* under which all GUI JavaScript things will be created, so that they can be garbage-colle...
bool IconExists(const CStr &str) const
Check if an icon exists.
IGUIObject * FindObjectUnderMouse() const
Returns the GUI object under the mouse, or NULL if none.
Base settings, all objects possess these settings in their m_BaseSettings Instructions can be found i...
void Xeromyces_ReadRootObjects(XMBElement Element, CXeromyces *pFile, boost::unordered_set< VfsPath > &Paths)
Reads in the root element <objects> (the DOMElement).
void Xeromyces_ReadRootSetup(XMBElement Element, CXeromyces *pFile)
Reads in the root element <setup> (the DOMElement).
std::map< CStr, std::vector< IGUIObject * > > m_HotkeyObjects
Map from hotkey names to objects that listen to the hotkey.
The main object that represents a whole GUI page.
void Destroy()
Clean up, call this to clean up all memory allocated within the GUI.
void TickObjects()
Performs processing that should happen every frame (including sending the "Tick" event to scripts) ...
std::map< CStr, CGUISprite > m_Sprites
Includes static functions that needs one template argument.
unsigned int m_MouseButtons
Indicates which buttons are pressed (bit 0 = LMB, bit 1 = RMB, bit 2 = MMB)
CPos m_MousePos
don't want to pass this around with the ChooseMouseOverAndClosest broadcast - we'd need to pack this ...
void Xeromyces_ReadRootStyles(XMBElement Element, CXeromyces *pFile)
Reads in the root element <styles> (the DOMElement).
JSObject * GetScriptObject()
Returns the JSObject* associated with the GUI.
IGUIObject * GetFocusedObject()
Get Focused Object.
static void ScriptingInit()
Initializes GUI script classes.
void UpdateObjects()
Updates the object pointers, needs to be called each time an object has been added or removed...
void Xeromyces_ReadScript(XMBElement Element, CXeromyces *pFile, boost::unordered_set< VfsPath > &Paths)
Reads in the element <script> (the XMBElement) and executes the script's code.
std::map< CStr, SGUIStyle > m_Styles
bool GetPreDefinedColor(const CStr &name, CColor &Output)
Get pre-defined color (if it exists) Returns false if it fails.
IGUIObject * ConstructObject(const CStr &str)
You input the name of the object type, and let's say you input "button", then it will construct a CGU...
void AddObjectType(const CStr &str, ConstructObjectFunction pFunc)
The GUI needs to have all object types inputted and their constructors.
int m_InternalNameNumber
Number of object that has been given name automatically.
std::map< CStr, SGUIIcon > m_Icons
Made to represent screen positions and delta values.
void Xeromyces_ReadColor(XMBElement Element, CXeromyces *pFile)
Reads in the element <color> (the XMBElement) and stores the result in m_PreDefinedColors.
std::map< CStr, IGUIObject * > map_pObjects
The GUI sprite, is actually several real sprites (images) like a collage.
IGUIObject * m_BaseObject
Base Object, all its children are considered parentless because this is not a real object per se...
void Xeromyces_ReadStyle(XMBElement Element, CXeromyces *pFile)
Reads in the element <style> (the XMBElement) and stores the result in m_Styles.
map_pObjects m_pAllObjects
Just pointers for fast name access, each object is really constructed within its parent for easy recu...
Wrapper class for OS paths used by the game.
void Initialize()
Initializes the GUI, needs to be called before the GUI is used.
void UpdateResolution()
Update Resolution, should be called every time the resolution of the OpenGL screen has been changed...
void DrawText(SGUIText &Text, const CColor &DefaultColor, const CPos &pos, const float &z, const CRect &clipping)
Draw a SGUIText object.
void LoadXmlFile(const VfsPath &Filename, boost::unordered_set< VfsPath > &Paths)
Load a GUI XML file into the GUI.
void Xeromyces_ReadEffects(XMBElement Element, CXeromyces *pFile, SGUIImageEffects &effects)
Reads in the element <effect> (the XMBElement) and stores the result within the SGUIImageEffects.
void AddObject(IGUIObject *pObject)
Adds an object to the GUI's object database Private, since you can only add objects through XML files...
void Xeromyces_ReadSprite(XMBElement Element, CXeromyces *pFile)
Reads in the element <sprite> (the XMBElement) and stores the result in a new CGUISprite.
std::map< CStr, SGUIScrollBarStyle > m_ScrollBarStyles
void SendEventToAll(const CStr &EventName)
Sends a specified script event to every object.
void Xeromyces_ReadIcon(XMBElement Element, CXeromyces *pFile)
Reads in the element <icon> (the XMBElement) and stores the result in m_Icons.
void Xeromyces_ReadTooltip(XMBElement Element, CXeromyces *pFile)
Reads in the element <tooltip> (the XMBElement) and stores the result as an object with the name __to...
std::map< CStr, ConstructObjectFunction > m_ObjectTypes
Function pointers to functions that constructs IGUIObjects by name...
IGUIObject * FindObjectByName(const CStr &Name) const
Returns the GUI object with the desired name, or NULL if no match is found,.
Contains a list of values for new defaults to objects.
String class, substitute for CStr, but that parses the tags and builds up a list of all text that wil...
SGUIText GenerateText(const CGUIString &Text, const CStrW &Font, const float &Width, const float &BufferZone, const IGUIObject *pObject=NULL)
Generate a SGUIText object from the inputted string.
void Xeromyces_ReadRepeat(XMBElement Element, CXeromyces *pFile, IGUIObject *pParent, boost::unordered_set< VfsPath > &Paths)
Reads in the element <repeat>, which repeats its child <object>s 'count' times, replacing the string "[n...
IGUIObject *(* ConstructObjectFunction)()
InReaction HandleEvent(const SDL_Event_ *ev)
The replacement of Process(), handles an SDL_Event_.
void SetFocusedObject(IGUIObject *pObject)
Change focus to new object.
SGUIIcon GetIcon(const CStr &str) const
Get Icon (a copy, can never be changed)
An SGUIText object is a parsed string, divided into text-rendering components.
void Draw()
Displays the whole GUI.
Rectangle class used for screen rectangles.