2020-11-10 15:26:38 +01:00
|
|
|
#pragma once
|
|
|
|
|
2020-12-11 14:24:42 +01:00
|
|
|
#include <filesystem>
|
2020-11-10 15:26:38 +01:00
|
|
|
#include <memory>
|
2021-02-01 19:03:45 +01:00
|
|
|
#include <string>
|
2020-11-10 15:26:38 +01:00
|
|
|
#include <vector>
|
|
|
|
|
2021-01-13 17:28:27 +01:00
|
|
|
#include <hex/helpers/utils.hpp>
|
|
|
|
#include <hex/views/view.hpp>
|
2020-11-10 15:26:38 +01:00
|
|
|
|
|
|
|
struct GLFWwindow;
|
2020-11-23 23:57:19 +01:00
|
|
|
struct ImGuiSettingsHandler;
|
2020-11-10 15:26:38 +01:00
|
|
|
|
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
class Window {
|
|
|
|
public:
|
2021-01-12 16:50:15 +01:00
|
|
|
Window(int &argc, char **&argv);
|
2020-11-10 15:26:38 +01:00
|
|
|
~Window();
|
|
|
|
|
|
|
|
void loop();
|
|
|
|
|
2020-11-23 23:57:19 +01:00
|
|
|
friend void *ImHexSettingsHandler_ReadOpenFn(ImGuiContext *ctx, ImGuiSettingsHandler *, const char *);
|
|
|
|
friend void ImHexSettingsHandler_ReadLine(ImGuiContext*, ImGuiSettingsHandler *handler, void *, const char* line);
|
|
|
|
friend void ImHexSettingsHandler_ApplyAll(ImGuiContext *ctx, ImGuiSettingsHandler *handler);
|
|
|
|
friend void ImHexSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandler *handler, ImGuiTextBuffer *buf);
|
2020-11-15 15:49:21 +01:00
|
|
|
|
2020-12-11 14:24:42 +01:00
|
|
|
bool setFont(const std::filesystem::path &font_path);
|
|
|
|
|
2021-01-12 16:50:15 +01:00
|
|
|
void initPlugins();
|
|
|
|
void deinitPlugins();
|
2020-11-10 15:26:38 +01:00
|
|
|
private:
|
|
|
|
void frameBegin();
|
|
|
|
void frameEnd();
|
|
|
|
|
2021-01-27 01:10:13 +01:00
|
|
|
void drawWelcomeScreen();
|
2021-02-21 13:49:03 +01:00
|
|
|
void resetLayout();
|
2021-01-27 01:10:13 +01:00
|
|
|
|
2020-11-10 15:26:38 +01:00
|
|
|
void initGLFW();
|
|
|
|
void initImGui();
|
|
|
|
void deinitGLFW();
|
|
|
|
void deinitImGui();
|
|
|
|
|
2021-01-27 14:26:24 +01:00
|
|
|
GLFWwindow* m_window = nullptr;
|
2020-11-23 23:57:19 +01:00
|
|
|
|
|
|
|
float m_globalScale = 1.0f, m_fontScale = 1.0f;
|
2020-11-11 09:22:55 +01:00
|
|
|
bool m_fpsVisible = false;
|
2020-11-23 22:23:06 +01:00
|
|
|
bool m_demoWindowOpen = false;
|
2021-02-21 13:49:03 +01:00
|
|
|
bool m_layoutConfigured = false;
|
2020-11-11 14:41:44 +01:00
|
|
|
|
|
|
|
static inline std::tuple<int, int> s_currShortcut = { -1, -1 };
|
2021-02-01 19:03:45 +01:00
|
|
|
|
|
|
|
std::list<std::string> m_recentFiles;
|
2020-11-10 15:26:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|