#pragma once #ifndef NOMINMAX #define NOMINMAX #endif #include #include #include #include #include #include namespace XCEngine::UI::Editor { class UIEditorWindowWorkspaceController; class UIEditorWorkspaceController; struct UIEditorWindowWorkspaceSet; struct UIEditorWindowWorkspaceState; } // namespace XCEngine::UI::Editor namespace XCEngine::UI::Editor::App { class EditorContext; class EditorWindow; struct EditorWindowPanelTransferRequest; struct EditorWindowFrameTransferRequests; struct EditorWindowHostConfig { HINSTANCE hInstance = nullptr; const wchar_t* windowClassName = L""; DWORD windowStyle = 0; const wchar_t* primaryWindowTitle = L""; void* windowUserData = nullptr; }; namespace Internal { class EditorWindowHostRuntime; class EditorWindowWorkspaceCoordinator; } class EditorWindowManager final { public: struct CreateParams { std::string windowId = {}; std::wstring title = {}; int initialX = CW_USEDEFAULT; int initialY = CW_USEDEFAULT; int initialWidth = 1540; int initialHeight = 940; int showCommand = SW_SHOW; bool primary = false; bool autoCaptureOnStartup = false; }; EditorWindowManager( EditorWindowHostConfig hostConfig, std::filesystem::path repoRoot, EditorContext& editorContext); ~EditorWindowManager(); EditorWindowManager(const EditorWindowManager&) = delete; EditorWindowManager& operator=(const EditorWindowManager&) = delete; EditorWindowManager(EditorWindowManager&&) = delete; EditorWindowManager& operator=(EditorWindowManager&&) = delete; EditorWindow* CreateEditorWindow( UIEditorWorkspaceController workspaceController, const CreateParams& params); void HandlePendingNativeWindowCreated(HWND hwnd); void Shutdown(); EditorWindow* FindWindow(HWND hwnd); const EditorWindow* FindWindow(HWND hwnd) const; EditorWindow* FindWindow(std::string_view windowId); const EditorWindow* FindWindow(std::string_view windowId) const; EditorWindow* FindPrimaryWindow(); const EditorWindow* FindPrimaryWindow() const; bool HasWindows() const; void DestroyClosedWindows(); void RenderAllWindows(); bool IsGlobalTabDragActive() const; bool OwnsActiveGlobalTabDrag(std::string_view windowId) const; void EndGlobalTabDragSession(); void HandleDestroyedWindow(HWND hwnd); void HandleWindowFrameTransferRequests( EditorWindow& sourceWindow, EditorWindowFrameTransferRequests&& transferRequests); bool HandleGlobalTabDragPointerMove(HWND hwnd); bool HandleGlobalTabDragPointerButtonUp(HWND hwnd); private: std::unique_ptr m_hostRuntime = {}; std::unique_ptr m_workspaceCoordinator = {}; }; } // namespace XCEngine::UI::Editor::App