59 lines
1.6 KiB
C++
59 lines
1.6 KiB
C++
#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
|