#pragma once #ifndef NOMINMAX #define NOMINMAX #endif #include "Platform/Win32/WindowMessageHost.h" #include #include #include #include #include namespace XCEngine::UI::Editor { namespace App { class EditorContext; class EditorWindowManager; } } namespace XCEngine::UI::Editor { class Application final : public Host::WindowMessageHost { public: Application(); ~Application(); Application(const Application&) = delete; Application& operator=(const Application&) = delete; Application(Application&&) = delete; Application& operator=(Application&&) = delete; int Run(HINSTANCE hInstance, int nCmdShow); App::EditorContext& GetEditorContext() override; const App::EditorContext& GetEditorContext() const override; bool IsGlobalTabDragActive() const override; bool OwnsActiveGlobalTabDrag(std::string_view windowId) const override; void EndGlobalTabDragSession() override; void HandleDestroyedWindow(HWND hwnd) override; bool HandleGlobalTabDragPointerMove(HWND hwnd) override; bool HandleGlobalTabDragPointerButtonUp(HWND hwnd) override; private: static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); bool Initialize(HINSTANCE hInstance, int nCmdShow); void Shutdown(); bool RegisterWindowClass(); static std::filesystem::path ResolveRepoRootPath(); static LONG WINAPI HandleUnhandledException(EXCEPTION_POINTERS* exceptionInfo); void InitializeSmokeTestConfig(); void TickSmokeTest(); HINSTANCE m_hInstance = nullptr; ATOM m_windowClassAtom = 0; std::filesystem::path m_repoRoot = {}; std::unique_ptr m_editorContext = {}; std::unique_ptr m_windowManager = {}; bool m_smokeTestEnabled = false; int m_smokeTestFrameLimit = 0; int m_smokeTestRenderedFrames = 0; bool m_smokeTestCloseRequested = false; }; int RunXCUIEditorApp(HINSTANCE hInstance, int nCmdShow); } // namespace XCEngine::UI::Editor