2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
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"
|
2016-03-12 04:58:56 +00:00
|
|
|
#include "IOStreams.hpp"
|
2016-03-11 00:23:16 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
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;
|
2016-03-12 04:58:56 +00:00
|
|
|
class CGuiWidget;
|
|
|
|
class CGuiFrame;
|
2016-03-21 05:02:56 +00:00
|
|
|
class CTextParser;
|
2016-03-21 22:01:19 +00:00
|
|
|
class CTextExecuteBuffer;
|
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; }
|
|
|
|
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;
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|