2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2015-08-18 05:54:43 +00:00
|
|
|
|
2019-09-22 21:52:05 +00:00
|
|
|
#include <memory>
|
2016-03-11 00:23:16 +00:00
|
|
|
#include <stack>
|
2019-09-22 21:52:05 +00:00
|
|
|
#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 {
|
2019-09-22 21:52:05 +00:00
|
|
|
class CGuiFrame;
|
2016-03-11 00:23:16 +00:00
|
|
|
class CGuiObject;
|
2016-03-12 04:58:56 +00:00
|
|
|
class CGuiWidget;
|
2019-09-22 21:52:05 +00:00
|
|
|
class CSimplePool;
|
2016-03-21 22:01:19 +00:00
|
|
|
class CTextExecuteBuffer;
|
2019-09-22 21:52:05 +00:00
|
|
|
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);
|
2016-03-12 04:58:56 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
CSimplePool& GetResStore() { return x4_resStore; }
|
2019-08-14 10:04:11 +00:00
|
|
|
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
|