Changeset View
Changeset View
Standalone View
Standalone View
source/gui/ObjectBases/IGUIObject.h
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | public: | ||||
/// Get object name | /// Get object name | ||||
void SetName(const CStr& Name) { m_Name = Name; } | void SetName(const CStr& Name) { m_Name = Name; } | ||||
// Get Presentable name. | // Get Presentable name. | ||||
// Will change all internally set names to something like "<unnamed object>" | // Will change all internally set names to something like "<unnamed object>" | ||||
CStr GetPresentableName() const; | CStr GetPresentableName() const; | ||||
/** | /** | ||||
* Builds the object hierarchy with references. | * Create a child object from the given definition. | ||||
* @return nullptr on failure. | |||||
*/ | */ | ||||
void AddChild(IGUIObject& pChild); | IGUIObject* CreateChild(JS::HandleValue); | ||||
/** | |||||
* Remove a child & delete it. | |||||
* @return whether the child was deleted. | |||||
*/ | |||||
bool DeleteChild(IGUIObject* child); | |||||
/** | /** | ||||
* Return all child objects of the current object. | * Return all child objects of the current object. | ||||
*/ | */ | ||||
const std::vector<IGUIObject*>& GetChildren() const { return m_Children; } | const std::vector<IGUIObject*>& GetChildren() const { return m_Children; } | ||||
//@} | //@} | ||||
//-------------------------------------------------------- | //-------------------------------------------------------- | ||||
▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | public: | ||||
//@} | //@} | ||||
protected: | protected: | ||||
//-------------------------------------------------------- | //-------------------------------------------------------- | ||||
/** @name Called by CGUI and friends | /** @name Called by CGUI and friends | ||||
* | * | ||||
* Methods that the CGUI will call using | * Methods that the CGUI will call using | ||||
* its friendship, these should not | * its friendship, these should not | ||||
* be called by user. | * be called by user. | ||||
* These functions' security are a lot | * TODO: this comment is old and the following interface should be cleaned up. | ||||
* what constitutes the GUI's | |||||
*/ | */ | ||||
//-------------------------------------------------------- | //-------------------------------------------------------- | ||||
//@{ | //@{ | ||||
public: | public: | ||||
/** | /** | ||||
* Called on every GUI tick unless the object or one of its parent is hidden/ghost. | * Called on every GUI tick unless the object or one of its parent is hidden/ghost. | ||||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | protected: | ||||
* defined relative, then it will check its parent's Z value and add | * defined relative, then it will check its parent's Z value and add | ||||
* the relativity. | * the relativity. | ||||
* | * | ||||
* @return Actual Z value on the screen. | * @return Actual Z value on the screen. | ||||
*/ | */ | ||||
virtual float GetBufferedZ() const; | virtual float GetBufferedZ() const; | ||||
/** | /** | ||||
* Add an object to the hierarchy. | |||||
*/ | |||||
void RegisterChild(IGUIObject* child); | |||||
/** | |||||
* Remove an object from the hierarchy. | |||||
*/ | |||||
void UnregisterChild(IGUIObject* child); | |||||
/** | |||||
* Set parent of this object | * Set parent of this object | ||||
*/ | */ | ||||
void SetParent(IGUIObject* pParent) { m_pParent = pParent; } | void SetParent(IGUIObject* pParent) { m_pParent = pParent; } | ||||
public: | public: | ||||
CGUI& GetGUI() { return m_pGUI; } | CGUI& GetGUI() { return m_pGUI; } | ||||
const CGUI& GetGUI() const { return m_pGUI; } | const CGUI& GetGUI() const { return m_pGUI; } | ||||
Show All 28 Lines | protected: | ||||
/** | /** | ||||
* Handle additional children to the \<object\>-tag. In IGUIObject, this function does | * Handle additional children to the \<object\>-tag. In IGUIObject, this function does | ||||
* nothing. In CList and CDropDown, it handles the \<item\>, used to build the data. | * nothing. In CList and CDropDown, it handles the \<item\>, used to build the data. | ||||
* | * | ||||
* Returning false means the object doesn't recognize the child. Should be reported. | * Returning false means the object doesn't recognize the child. Should be reported. | ||||
* Notice 'false' is default, because an object not using this function, should not | * Notice 'false' is default, because an object not using this function, should not | ||||
* have any additional children (and this function should never be called). | * have any additional children (and this function should never be called). | ||||
*/ | */ | ||||
virtual bool HandleAdditionalChildren(const XMBElement& UNUSED(child), CXeromyces* UNUSED(pFile)) | virtual bool HandleAdditionalChildren(const XMBFile& UNUSED(file), const XMBElement& UNUSED(child)) | ||||
{ | { | ||||
return false; | return false; | ||||
} | } | ||||
/** | /** | ||||
* Allow the GUI object to process after all child items were handled. | * Allow the GUI object to process after all child items were handled. | ||||
* Useful to avoid iterator invalidation with push_back calls. | * Useful to avoid iterator invalidation with push_back calls. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 171 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator