Files
XCEngine/editor/app/Bootstrap/Application.h

67 lines
1.8 KiB
C
Raw Normal View History

#pragma once
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#include <chrono>
#include <filesystem>
#include <memory>
namespace XCEngine::UI::Editor {
namespace App {
class EditorContext;
class EditorWindowSystem;
2026-04-25 16:46:01 +08:00
class EditorWindowManager;
}
namespace System {
class SystemInteractionService;
}
}
namespace XCEngine::UI::Editor {
class Application final {
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);
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);
HINSTANCE m_hInstance = nullptr;
ATOM m_windowClassAtom = 0;
std::filesystem::path m_repoRoot = {};
std::chrono::steady_clock::time_point m_smokeTestStartTime = {};
std::chrono::milliseconds m_smokeTestDuration = std::chrono::milliseconds::zero();
std::unique_ptr<App::EditorContext> m_editorContext = {};
std::unique_ptr<App::EditorWindowSystem> m_windowSystem = {};
2026-04-25 16:46:01 +08:00
std::unique_ptr<App::EditorWindowManager> m_windowManager = {};
std::unique_ptr<System::SystemInteractionService> m_systemInteractionHost = {};
int m_smokeTestFrameLimit = 0;
int m_smokeTestRenderedFrameCount = 0;
bool m_smokeTestEnabled = false;
bool m_smokeTestCloseRequested = false;
};
int RunXCUIEditorApp(HINSTANCE hInstance, int nCmdShow);
} // namespace XCEngine::UI::Editor