metaforce/Runtime/GuiSys/CGuiSys.hpp

62 lines
1.5 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2015-08-18 05:54:43 +00:00
#include <memory>
2016-03-11 00:23:16 +00:00
#include <stack>
#include <unordered_set>
#include <vector>
#include "Runtime/IOStreams.hpp"
#include "Runtime/GuiSys/CSaveableState.hpp"
#include <hecl/hecl.hpp>
2016-03-11 00:23:16 +00:00
2021-04-10 08:42:06 +00:00
namespace metaforce {
class CGuiFrame;
2016-03-11 00:23:16 +00:00
class CGuiObject;
class CGuiWidget;
class CSimplePool;
2016-03-21 22:01:19 +00:00
class CTextExecuteBuffer;
class CTextParser;
class CVParamTransfer;
class IFactory;
struct SObjectTag;
2016-03-11 00:23:16 +00:00
2018-12-08 05:30:43 +00:00
class CGuiSys {
friend class CGuiFrame;
2016-03-11 00:23:16 +00:00
public:
2018-12-08 05:30:43 +00:00
enum class EUsageMode { Zero, One, Two };
2016-03-11 00:23:16 +00:00
private:
2018-12-08 05:30:43 +00:00
IFactory& x0_resFactory;
CSimplePool& x4_resStore;
EUsageMode x8_mode;
std::unique_ptr<CTextExecuteBuffer> xc_textExecuteBuf;
std::unique_ptr<CTextParser> x10_textParser;
std::unordered_set<CGuiFrame*> m_registeredFrames;
static std::shared_ptr<CGuiWidget> CreateWidgetInGame(FourCC type, CInputStream& in, CGuiFrame* frame,
CSimplePool* sp);
2016-03-11 00:23:16 +00:00
public:
2018-12-08 05:30:43 +00:00
CGuiSys(IFactory& resFactory, CSimplePool& resStore, EUsageMode mode);
2018-12-08 05:30:43 +00:00
CSimplePool& GetResStore() { return x4_resStore; }
const CSimplePool& GetResStore() const { return x4_resStore; }
2018-12-08 05:30:43 +00:00
EUsageMode GetUsageMode() const { return x8_mode; }
2017-01-30 04:16:20 +00:00
2018-12-08 05:30:43 +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;
2021-04-10 08:42:06 +00:00
} // namespace metaforce