refactor(new_editor/app): reorganize host structure and add smoke test
This commit is contained in:
58
new_editor/app/Bootstrap/ApplicationLifecycle.cpp
Normal file
58
new_editor/app/Bootstrap/ApplicationLifecycle.cpp
Normal file
@@ -0,0 +1,58 @@
|
||||
#include "Bootstrap/Application.h"
|
||||
|
||||
#include "State/EditorContext.h"
|
||||
#include "Platform/Win32/EditorWindow.h"
|
||||
#include "Platform/Win32/EditorWindowManager.h"
|
||||
|
||||
namespace XCEngine::UI::Editor {
|
||||
|
||||
Application::Application()
|
||||
: m_editorContext(std::make_unique<App::EditorContext>()) {}
|
||||
|
||||
Application::~Application() = default;
|
||||
|
||||
App::EditorContext& Application::GetEditorContext() {
|
||||
return *m_editorContext;
|
||||
}
|
||||
|
||||
const App::EditorContext& Application::GetEditorContext() const {
|
||||
return *m_editorContext;
|
||||
}
|
||||
|
||||
bool Application::IsGlobalTabDragActive() const {
|
||||
return m_windowManager != nullptr && m_windowManager->IsGlobalTabDragActive();
|
||||
}
|
||||
|
||||
bool Application::OwnsActiveGlobalTabDrag(std::string_view windowId) const {
|
||||
return m_windowManager != nullptr &&
|
||||
m_windowManager->OwnsActiveGlobalTabDrag(windowId);
|
||||
}
|
||||
|
||||
void Application::EndGlobalTabDragSession() {
|
||||
if (m_windowManager != nullptr) {
|
||||
m_windowManager->EndGlobalTabDragSession();
|
||||
}
|
||||
}
|
||||
|
||||
void Application::HandleDestroyedWindow(HWND hwnd) {
|
||||
if (m_windowManager != nullptr) {
|
||||
m_windowManager->HandleDestroyedWindow(hwnd);
|
||||
}
|
||||
}
|
||||
|
||||
bool Application::HandleGlobalTabDragPointerMove(HWND hwnd) {
|
||||
return m_windowManager != nullptr &&
|
||||
m_windowManager->HandleGlobalTabDragPointerMove(hwnd);
|
||||
}
|
||||
|
||||
bool Application::HandleGlobalTabDragPointerButtonUp(HWND hwnd) {
|
||||
return m_windowManager != nullptr &&
|
||||
m_windowManager->HandleGlobalTabDragPointerButtonUp(hwnd);
|
||||
}
|
||||
|
||||
int RunXCUIEditorApp(HINSTANCE hInstance, int nCmdShow) {
|
||||
Application application;
|
||||
return application.Run(hInstance, nCmdShow);
|
||||
}
|
||||
|
||||
} // namespace XCEngine::UI::Editor
|
||||
Reference in New Issue
Block a user