metaforce/Runtime/GuiSys/CGuiSys.hpp

65 lines
1.5 KiB
C++
Raw Normal View History

2016-03-10 03:47:37 +00:00
#ifndef __URDE_CGUISYS_HPP__
#define __URDE_CGUISYS_HPP__
2015-08-18 05:54:43 +00:00
2016-03-11 00:23:16 +00:00
#include "hecl/hecl.hpp"
#include <unordered_map>
#include <vector>
#include <stack>
#include "CSaveableState.hpp"
#include "IOStreams.hpp"
2016-03-11 00:23:16 +00:00
2016-03-04 23:04:53 +00:00
namespace urde
2015-08-18 05:54:43 +00:00
{
2016-03-11 00:23:16 +00:00
class CGuiObject;
class CVParamTransfer;
2016-04-03 05:25:34 +00:00
struct SObjectTag;
2016-03-11 00:23:16 +00:00
class IFactory;
class CSimplePool;
class CGuiWidget;
class CGuiFrame;
class CTextParser;
2016-03-21 22:01:19 +00:00
class CTextExecuteBuffer;
2016-03-11 00:23:16 +00:00
2015-08-18 05:54:43 +00:00
class CGuiSys
{
2016-03-11 22:50:15 +00:00
friend class CGuiFrame;
2016-03-11 00:23:16 +00:00
public:
enum class EUsageMode
{
Zero,
One,
Two
2016-03-11 00:23:16 +00:00
};
private:
IFactory& x0_resFactory;
CSimplePool& x4_resStore;
EUsageMode x8_mode;
std::unique_ptr<CTextExecuteBuffer> xc_textExecuteBuf;
std::unique_ptr<CTextParser> x10_textParser;
2017-01-30 04:16:20 +00:00
std::unordered_set<CGuiFrame*> m_registeredFrames;
2016-03-11 00:23:16 +00:00
static std::shared_ptr<CGuiWidget> CreateWidgetInGame(FourCC type, CInputStream& in,
CGuiFrame* frame, CSimplePool* sp);
2016-03-11 00:23:16 +00:00
public:
CGuiSys(IFactory& resFactory, CSimplePool& resStore, EUsageMode mode);
CSimplePool& GetResStore() {return x4_resStore;}
EUsageMode GetUsageMode() const {return x8_mode;}
2017-01-30 04:16:20 +00:00
void OnViewportResize();
static void ViewportResizeFrame(CGuiFrame* frame);
2016-03-11 00:23:16 +00:00
};
2016-03-19 03:58:01 +00:00
/** Global GuiSys instance */
extern CGuiSys* g_GuiSys;
2016-03-21 22:01:19 +00:00
/** Global CTextExecuteBuffer instance */
extern CTextExecuteBuffer* g_TextExecuteBuf;
/** Global CTextParser instance */
extern CTextParser* g_TextParser;
2015-08-18 05:54:43 +00:00
}
2016-03-10 03:47:37 +00:00
#endif // __URDE_CGUISYS_HPP__