-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathui_main.h
72 lines (58 loc) · 1.83 KB
/
ui_main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// DyLua: SimpleGraphic
// (c) David Gowor, 2014
//
// UI Main Header
//
// =======
// Classes
// =======
struct ui_expectationFailed_s {};
// UI Manager
class ui_main_c: public ui_IMain {
public:
// Interface
void Init(int argc, char** argv);
void Frame();
void Shutdown();
void KeyEvent(int key, int type);
bool CanExit();
// Encapsulated
ui_main_c(sys_IMain* sysHnd, core_IMain* coreHnd);
sys_IMain* sys = nullptr;
core_IMain* core = nullptr;
r_IRenderer* renderer = nullptr;
ui_IConsole* conUI = nullptr;
ui_IDebug* debug = nullptr;
dword subScriptSize = 0;
ui_ISubScript** subScriptList = nullptr;
std::optional<sol::state> solState;
lua_State* L = nullptr;
std::filesystem::path scriptName;
std::filesystem::path scriptCfg;
std::filesystem::path scriptPath;
std::filesystem::path scriptWorkDir;
int scriptArgc = 0;
char** scriptArgv = nullptr;
bool restartFlag = false;
bool didExit = false;
bool renderEnable = false;
int cursorX = 0;
int cursorY = 0;
int framesSinceWindowHidden = 0;
volatile bool inLua = false;
int ioOpenf = LUA_NOREF;
static int InitAPI(lua_State* L);
void RenderInit(r_featureFlag_e features);
void ScriptInit();
void ScriptShutdown();
void LAssert(lua_State* L, int cond, const char* fmt, ...); // Non-local return to Lua code on failure
void LExpect(lua_State* L, int cond, const char* fmt, ...); // Throws ui_expectationFailed_s on failure, message on Lua stack
int IsUserData(lua_State* L, int index, const char* metaName);
int PushCallback(const char* name);
void PCall(int narg, int nret);
void DoError(const char* msg, const char* error);
void CallKeyHandler(const char* hname, int key, bool dblclk);
const char* NameForKey(int key);
int KeyForName(const char* name);
enum { REGISTRY_KEY = 1 };
};