Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/CGUI.h
Show All 18 Lines | |||||
* This is the top class of the whole GUI, all objects | * This is the top class of the whole GUI, all objects | ||||
* and settings are stored within this class. | * and settings are stored within this class. | ||||
*/ | */ | ||||
#ifndef INCLUDED_CGUI | #ifndef INCLUDED_CGUI | ||||
#define INCLUDED_CGUI | #define INCLUDED_CGUI | ||||
#include "gui/GUITooltip.h" | #include "gui/GUITooltip.h" | ||||
#include "gui/ObjectTypes/CGUIDummyObject.h" | |||||
#include "gui/SettingTypes/CGUIColor.h" | #include "gui/SettingTypes/CGUIColor.h" | ||||
#include "gui/SGUIIcon.h" | #include "gui/SGUIIcon.h" | ||||
#include "gui/SGUIStyle.h" | #include "gui/SGUIStyle.h" | ||||
#include "lib/input.h" | #include "lib/input.h" | ||||
#include "ps/Shapes.h" | #include "ps/Shapes.h" | ||||
#include "ps/XML/Xeromyces.h" | #include "ps/XML/Xeromyces.h" | ||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
#include <map> | #include <map> | ||||
#include <set> | #include <set> | ||||
#include <unordered_map> | #include <unordered_map> | ||||
#include <unordered_set> | #include <unordered_set> | ||||
#include <vector> | #include <vector> | ||||
extern const double SELECT_DBLCLICK_RATE; | extern const double SELECT_DBLCLICK_RATE; | ||||
class CGUISpriteInstance; | class CGUISpriteInstance; | ||||
class CGUISprite; | class CGUISprite; | ||||
class IGUIObject; | class IGUIObject; | ||||
struct SGUIImageEffects; | struct SGUIImageEffects; | ||||
struct SGUIScrollBarStyle; | struct SGUIScrollBarStyle; | ||||
namespace js { class BaseProxyHandler; } | namespace js { class BaseProxyHandler; } | ||||
using map_pObjects = std::map<CStr, IGUIObject*>; | |||||
/** | /** | ||||
* The main object that represents a whole GUI page. | * The main object that represents a whole GUI page. | ||||
*/ | */ | ||||
class CGUI | class CGUI | ||||
{ | { | ||||
NONCOPYABLE(CGUI); | NONCOPYABLE(CGUI); | ||||
private: | private: | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | public: | ||||
* Allows the JS side to add or remove global hotkeys. | * Allows the JS side to add or remove global hotkeys. | ||||
*/ | */ | ||||
void SetGlobalHotkey(const CStr& hotkeyTag, const CStr& eventName, JS::HandleValue function); | void SetGlobalHotkey(const CStr& hotkeyTag, const CStr& eventName, JS::HandleValue function); | ||||
void UnsetGlobalHotkey(const CStr& hotkeyTag, const CStr& eventName); | void UnsetGlobalHotkey(const CStr& hotkeyTag, const CStr& eventName); | ||||
/** | /** | ||||
* Return the object which is an ancestor of every other GUI object. | * Return the object which is an ancestor of every other GUI object. | ||||
*/ | */ | ||||
CGUIDummyObject& GetBaseObject() { return m_BaseObject; }; | IGUIObject* GetBaseObject(); | ||||
/** | /** | ||||
* Checks if object exists and return true or false accordingly | * Checks if object exists and return true or false accordingly | ||||
* | * | ||||
* @param Name String name of object | * @param Name String name of object | ||||
* @return true if object exists | * @return true if object exists | ||||
*/ | */ | ||||
bool ObjectExists(const CStr& Name) const; | bool ObjectExists(const CStr& Name) const; | ||||
▲ Show 20 Lines • Show All 407 Lines • ▼ Show 20 Lines | private: | ||||
/** @name Objects */ | /** @name Objects */ | ||||
//-------------------------------------------------------- | //-------------------------------------------------------- | ||||
//@{ | //@{ | ||||
/** | /** | ||||
* Base Object, all its children are considered parentless | * Base Object, all its children are considered parentless | ||||
* because this is not a real object per se. | * because this is not a real object per se. | ||||
*/ | */ | ||||
CGUIDummyObject m_BaseObject; | std::unique_ptr<IGUIObject> m_BaseObject; | ||||
/** | /** | ||||
* Focused object! | * Focused object! | ||||
* Say an input box that is selected. That one is focused. | * Say an input box that is selected. That one is focused. | ||||
* There can only be one focused object. | * There can only be one focused object. | ||||
*/ | */ | ||||
IGUIObject* m_FocusedObject; | IGUIObject* m_FocusedObject; | ||||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator