-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathroot.hpp
86 lines (62 loc) · 1.78 KB
/
root.hpp
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#pragma once
#include <queue>
#include <string>
#include <frontend/applet.hpp>
#include "ThemeManager.hpp"
#include "file_host.hpp"
#include <frontend/UpdaterView.hpp>
#include <frontend/widgets/theme_editor.hpp>
#include <frontend/editors/MkwDebug.hpp>
#include <frontend/DiscordRPCManager.hpp>
namespace riistudio::frontend {
class RootWindow final : public Applet {
public:
static RootWindow* spInstance;
FileHost mFileHost;
RootWindow();
RootWindow(const RootWindow&) = delete;
RootWindow(RootWindow&&) = delete;
~RootWindow();
void draw() override;
void drawStatusBar();
void drawMenuBar();
void drawLangMenu();
void drawSettingsMenu();
void drawFileMenu();
void onFileOpen(FileData data, OpenFilePolicy policy);
void vdropDirect(std::unique_ptr<uint8_t[]> data, std::size_t len,
const std::string& name) override {
mFileHost.dropDirect(std::move(data), len, name);
}
void saveButton();
void saveAsButton();
private:
bool shouldClose() override;
bool vsync = true;
bool bDemo = false;
ThemeData mThemeData;
// std::queue<std::string> mAttachEditorsQueue;
ThemeManager mTheme;
bool mThemeUpdated = true;
// Hack...
bool mWantFile = false;
bool mGotFile = false;
FileData mReqData;
UpdaterView mUpdater;
bool mCheckUpdate = true;
DiscordRPCManager mDiscordRpc;
bool mShowMkwDebug = false;
MkwDebug mMkwDebugWindow;
bool mShowSettings = false;
public:
void requestFile() { mWantFile = true; }
FileData* getFile() {
if (!mGotFile)
return nullptr;
return &mReqData;
}
void endRequestFile() { mWantFile = false; }
void setForceUpdate(bool update) { mUpdater.SetForceUpdate(update); }
void setCheckUpdate(bool update) { mCheckUpdate = update; }
};
} // namespace riistudio::frontend