refactor(new_editor): continue architecture closeout
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
#include "Platform/Win32/EditorWindowManager.h"
|
||||
#include "Platform/Win32/WindowManager/Internal.h"
|
||||
|
||||
#include "State/EditorContext.h"
|
||||
#include "Platform/Win32/EditorWindow.h"
|
||||
|
||||
#include <XCEditor/Workspace/UIEditorWindowWorkspaceController.h>
|
||||
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
namespace XCEngine::UI::Editor::App::Internal {
|
||||
|
||||
std::wstring EditorWindowManager::BuildWindowTitle(
|
||||
std::wstring EditorWindowWorkspaceCoordinator::BuildWindowTitle(
|
||||
const UIEditorWorkspaceController& workspaceController) const {
|
||||
const std::string& activePanelId = workspaceController.GetWorkspace().activePanelId;
|
||||
if (const UIEditorPanelDescriptor* descriptor =
|
||||
@@ -23,7 +26,7 @@ std::wstring EditorWindowManager::BuildWindowTitle(
|
||||
return std::wstring(L"XCEngine Editor");
|
||||
}
|
||||
|
||||
RECT EditorWindowManager::BuildDetachedWindowRect(const POINT& screenPoint) const {
|
||||
RECT EditorWindowWorkspaceCoordinator::BuildDetachedWindowRect(const POINT& screenPoint) const {
|
||||
RECT rect = {
|
||||
screenPoint.x - 420,
|
||||
screenPoint.y - 24,
|
||||
@@ -47,7 +50,7 @@ RECT EditorWindowManager::BuildDetachedWindowRect(const POINT& screenPoint) cons
|
||||
return rect;
|
||||
}
|
||||
|
||||
bool EditorWindowManager::SynchronizeWindowsFromWindowSet(
|
||||
bool EditorWindowWorkspaceCoordinator::SynchronizeWindowsFromWindowSet(
|
||||
const UIEditorWindowWorkspaceSet& windowSet,
|
||||
std::string_view preferredNewWindowId,
|
||||
const POINT& preferredScreenPoint) {
|
||||
@@ -56,7 +59,7 @@ bool EditorWindowManager::SynchronizeWindowsFromWindowSet(
|
||||
|
||||
for (const UIEditorWindowWorkspaceState& entry : windowSet.windows) {
|
||||
windowIdsInSet.push_back(entry.windowId);
|
||||
if (EditorWindow* existingWindow = FindWindow(entry.windowId);
|
||||
if (EditorWindow* existingWindow = m_hostRuntime.FindWindow(entry.windowId);
|
||||
existingWindow != nullptr) {
|
||||
existingWindow->ReplaceWorkspaceController(BuildWorkspaceControllerForWindow(entry));
|
||||
existingWindow->ResetInteractionState();
|
||||
@@ -70,15 +73,15 @@ bool EditorWindowManager::SynchronizeWindowsFromWindowSet(
|
||||
continue;
|
||||
}
|
||||
|
||||
CreateParams createParams = {};
|
||||
EditorWindowHostRuntime::CreateParams createParams = {};
|
||||
createParams.windowId = entry.windowId;
|
||||
createParams.primary = entry.windowId == windowSet.primaryWindowId;
|
||||
createParams.title =
|
||||
createParams.primary
|
||||
? std::wstring(
|
||||
m_hostConfig.primaryWindowTitle != nullptr &&
|
||||
m_hostConfig.primaryWindowTitle[0] != L'\0'
|
||||
? m_hostConfig.primaryWindowTitle
|
||||
m_hostRuntime.GetHostConfig().primaryWindowTitle != nullptr &&
|
||||
m_hostRuntime.GetHostConfig().primaryWindowTitle[0] != L'\0'
|
||||
? m_hostRuntime.GetHostConfig().primaryWindowTitle
|
||||
: L"XCEngine Editor")
|
||||
: BuildWindowTitle(BuildWorkspaceControllerForWindow(entry));
|
||||
if (entry.windowId == preferredNewWindowId) {
|
||||
@@ -89,12 +92,12 @@ bool EditorWindowManager::SynchronizeWindowsFromWindowSet(
|
||||
createParams.initialHeight = detachedRect.bottom - detachedRect.top;
|
||||
}
|
||||
|
||||
if (CreateEditorWindow(BuildWorkspaceControllerForWindow(entry), createParams) == nullptr) {
|
||||
if (m_hostRuntime.CreateEditorWindow(BuildWorkspaceControllerForWindow(entry), createParams) == nullptr) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (const std::unique_ptr<EditorWindow>& window : m_windows) {
|
||||
for (const std::unique_ptr<EditorWindow>& window : m_hostRuntime.GetWindows()) {
|
||||
if (window == nullptr ||
|
||||
window->GetHwnd() == nullptr ||
|
||||
window->IsPrimary()) {
|
||||
@@ -114,7 +117,7 @@ bool EditorWindowManager::SynchronizeWindowsFromWindowSet(
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EditorWindowManager::SynchronizeWindowsFromController(
|
||||
bool EditorWindowWorkspaceCoordinator::SynchronizeWindowsFromController(
|
||||
const UIEditorWindowWorkspaceController& windowWorkspaceController,
|
||||
std::string_view preferredNewWindowId,
|
||||
const POINT& preferredScreenPoint) {
|
||||
@@ -124,4 +127,4 @@ bool EditorWindowManager::SynchronizeWindowsFromController(
|
||||
preferredScreenPoint);
|
||||
}
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
} // namespace XCEngine::UI::Editor::App::Internal
|
||||
|
||||
Reference in New Issue
Block a user