From 0d94b7b0511c14817f5f5e96079beb19d7ec75e3 Mon Sep 17 00:00:00 2001 From: Riya54671 Date: Wed, 2 Oct 2024 22:54:44 +0530 Subject: [PATCH] Update window.hpp --- main/gui/include/window.hpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/main/gui/include/window.hpp b/main/gui/include/window.hpp index 34aa08d661595..4664a079b83ef 100644 --- a/main/gui/include/window.hpp +++ b/main/gui/include/window.hpp @@ -5,12 +5,11 @@ #include #include #include +#include // Add this for std::mutex -#include +#include // Ensure that this includes necessary types (ImGuiExt::Texture, etc.) struct GLFWwindow; -struct ImGuiSettingsHandler; - namespace hex { @@ -21,6 +20,14 @@ namespace hex { Window(); ~Window(); + // Delete copy constructor and copy assignment operator to prevent accidental copies + Window(const Window&) = delete; + Window& operator=(const Window&) = delete; + + // Implement move constructor and move assignment operator if needed + Window(Window&&) noexcept = default; + Window& operator=(Window&&) noexcept = default; + void loop(); void fullFrame(); @@ -46,9 +53,9 @@ namespace hex { void registerEventHandlers(); - GLFWwindow *m_window = nullptr; + std::unique_ptr m_window = nullptr; // Use std::unique_ptr for memory safety - std::string m_windowTitle, m_windowTitleFull; + std::string m_windowTitle; double m_lastStartFrameTime = 0; double m_lastFrameTime = 0; @@ -63,8 +70,11 @@ namespace hex { ImGuiExt::ImHexCustomData m_imguiCustomData; - u32 m_searchBarPosition = 0; + // Define constant for search bar position if needed + static constexpr u32 kDefaultSearchBarPosition = 0; + u32 m_searchBarPosition = kDefaultSearchBarPosition; + bool m_emergencyPopupOpen = false; }; -} \ No newline at end of file +}