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>
|
2021-09-26 21:18:25 +02:00
|
|
|
#include <list>
|
2020-11-10 15:26:38 +01:00
|
|
|
#include <vector>
|
|
|
|
|
2021-01-13 17:28:27 +01:00
|
|
|
#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
|
|
|
|
2021-08-18 22:36:46 +02:00
|
|
|
|
2020-11-10 15:26:38 +01:00
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
class Window {
|
|
|
|
public:
|
2021-04-20 21:46:48 +02:00
|
|
|
Window();
|
2020-11-10 15:26:38 +01:00
|
|
|
~Window();
|
|
|
|
|
|
|
|
void loop();
|
|
|
|
|
2021-08-22 20:24:42 +02:00
|
|
|
static void initNative();
|
2021-08-17 22:54:09 +02:00
|
|
|
|
2020-11-10 15:26:38 +01:00
|
|
|
private:
|
2021-08-18 22:36:46 +02:00
|
|
|
void setupNativeWindow();
|
2021-12-10 16:09:55 +01:00
|
|
|
void beginNativeWindowFrame();
|
|
|
|
void endNativeWindowFrame();
|
2021-08-18 22:36:46 +02:00
|
|
|
void drawTitleBar();
|
|
|
|
|
2020-11-10 15:26:38 +01:00
|
|
|
void frameBegin();
|
2021-06-07 18:14:40 +02:00
|
|
|
void frame();
|
2020-11-10 15:26:38 +01:00
|
|
|
void frameEnd();
|
|
|
|
|
2021-01-27 01:10:13 +01:00
|
|
|
void drawWelcomeScreen();
|
2022-01-18 00:10:10 +01:00
|
|
|
void resetLayout() const;
|
2021-01-27 01:10:13 +01:00
|
|
|
|
2020-11-10 15:26:38 +01:00
|
|
|
void initGLFW();
|
|
|
|
void initImGui();
|
2022-01-18 00:10:10 +01:00
|
|
|
void exitGLFW();
|
|
|
|
void exitImGui();
|
2020-11-10 15:26:38 +01:00
|
|
|
|
2021-08-22 20:24:42 +02:00
|
|
|
friend void *ImHexSettingsHandler_ReadOpenFn(ImGuiContext *ctx, ImGuiSettingsHandler *, const char *);
|
|
|
|
friend void ImHexSettingsHandler_ReadLine(ImGuiContext*, ImGuiSettingsHandler *handler, void *, const char* line);
|
|
|
|
friend void ImHexSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandler *handler, ImGuiTextBuffer *buf);
|
|
|
|
|
2021-01-27 14:26:24 +01:00
|
|
|
GLFWwindow* m_window = nullptr;
|
2020-11-23 23:57:19 +01:00
|
|
|
|
2021-04-21 23:31:51 +02:00
|
|
|
double m_targetFps = 60.0;
|
2021-02-21 13:49:03 +01:00
|
|
|
bool m_layoutConfigured = false;
|
2020-11-11 14:41:44 +01:00
|
|
|
|
2021-08-18 22:36:46 +02:00
|
|
|
std::string m_windowTitle;
|
|
|
|
|
2021-03-06 13:09:20 +01:00
|
|
|
double m_lastFrameTime;
|
|
|
|
|
2021-04-18 20:24:42 +02:00
|
|
|
std::string m_availableUpdate;
|
2021-07-29 00:39:58 +02:00
|
|
|
|
2021-08-22 21:11:01 +02:00
|
|
|
bool m_showTipOfTheDay;
|
|
|
|
std::string m_tipOfTheDay;
|
|
|
|
|
2021-12-15 00:21:34 +01:00
|
|
|
ImGui::Texture m_bannerTexture = { 0 };
|
|
|
|
ImGui::Texture m_logoTexture = { 0 };
|
2021-08-18 22:36:46 +02:00
|
|
|
|
2022-01-13 14:33:30 +01:00
|
|
|
fs::path m_safetyBackupPath;
|
2021-09-26 21:18:25 +02:00
|
|
|
|
|
|
|
std::list<std::string> m_popupsToOpen;
|
2021-12-23 15:11:38 +01:00
|
|
|
std::vector<int> m_pressedKeys;
|
2020-11-10 15:26:38 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|