Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/GUIManager.h
Show All 18 Lines | |||||
#define INCLUDED_GUIMANAGER | #define INCLUDED_GUIMANAGER | ||||
#include "lib/file/vfs/vfs_path.h" | #include "lib/file/vfs/vfs_path.h" | ||||
#include "lib/input.h" | #include "lib/input.h" | ||||
#include "ps/CStr.h" | #include "ps/CStr.h" | ||||
#include "ps/TemplateLoader.h" | #include "ps/TemplateLoader.h" | ||||
#include "scriptinterface/StructuredClone.h" | #include "scriptinterface/StructuredClone.h" | ||||
#include <deque> | |||||
#include <string> | #include <string> | ||||
#include <unordered_set> | #include <unordered_set> | ||||
class CGUI; | class CGUI; | ||||
/** | /** | ||||
* External interface to the GUI system. | * External interface to the GUI system. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 127 Lines • ▼ Show 20 Lines | private: | ||||
const static CStr EventNameWindowResized; | const static CStr EventNameWindowResized; | ||||
std::shared_ptr<CGUI> top() const; | std::shared_ptr<CGUI> top() const; | ||||
std::shared_ptr<ScriptContext> m_ScriptContext; | std::shared_ptr<ScriptContext> m_ScriptContext; | ||||
std::shared_ptr<ScriptInterface> m_ScriptInterface; | std::shared_ptr<ScriptInterface> m_ScriptInterface; | ||||
using PageStackType = std::vector<SGUIPage>; | /** | ||||
* The page stack must not move pointers on push/pop, or pushing a page in a page's init method | |||||
* may crash (as the pusher page will suddenly have moved, and the stack will be confused). | |||||
* Therefore use std::deque over std::vector. | |||||
*/ | |||||
using PageStackType = std::deque<SGUIPage>; | |||||
PageStackType m_PageStack; | PageStackType m_PageStack; | ||||
CTemplateLoader m_TemplateLoader; | CTemplateLoader m_TemplateLoader; | ||||
}; | }; | ||||
extern CGUIManager* g_GUI; | extern CGUIManager* g_GUI; | ||||
extern InReaction gui_handler(const SDL_Event_* ev); | extern InReaction gui_handler(const SDL_Event_* ev); | ||||
#endif // INCLUDED_GUIMANAGER | #endif // INCLUDED_GUIMANAGER |
Wildfire Games · Phabricator