Changeset View
Changeset View
Standalone View
Standalone View
source/gui/GUIManager.h
Show All 15 Lines | |||||
*/ | */ | ||||
#ifndef INCLUDED_GUIMANAGER | #ifndef INCLUDED_GUIMANAGER | ||||
#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 "scriptinterface/StructuredClone.h" | #include "scriptinterface/StructuredClone.h" | ||||
#include <deque> | #include <deque> | ||||
#include <string> | #include <string> | ||||
#include <unordered_set> | #include <unordered_set> | ||||
class CCanvas2D; | class CCanvas2D; | ||||
class CGUI; | class CGUI; | ||||
class CParamNode; | |||||
/** | /** | ||||
* External interface to the GUI system. | * External interface to the GUI system. | ||||
* | * | ||||
* The GUI consists of a set of pages. Each page is constructed from a | * The GUI consists of a set of pages. Each page is constructed from a | ||||
* series of XML files, and is independent from any other page. | * series of XML files, and is independent from any other page. | ||||
* Only one page is active at a time. All events and render requests etc | * Only one page is active at a time. All events and render requests etc | ||||
* will go to the active page. This lets the GUI switch between pre-game menu | * will go to the active page. This lets the GUI switch between pre-game menu | ||||
▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | private: | ||||
/** | /** | ||||
* The page stack must not move pointers on push/pop, or pushing a page in a page's init method | * 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). | * may crash (as the pusher page will suddenly have moved, and the stack will be confused). | ||||
* Therefore use std::deque over std::vector. | * Therefore use std::deque over std::vector. | ||||
*/ | */ | ||||
using PageStackType = std::deque<SGUIPage>; | using PageStackType = std::deque<SGUIPage>; | ||||
PageStackType m_PageStack; | PageStackType m_PageStack; | ||||
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