Refactor editor panel services boundary

This commit is contained in:
2026-04-27 16:22:46 +08:00
parent 048ca7b362
commit 9f299ab6e3
17 changed files with 228 additions and 123 deletions

View File

@@ -14,6 +14,15 @@ using ::XCEngine::UI::Editor::BuildEditorShellShortcutManager;
using ::XCEngine::UI::Editor::UIEditorWorkspacePanelPresentationModel;
using ::XCEngine::UI::Editor::AppendUIEditorRuntimeTrace;
void RequestEditorContextUtilityWindow(
void* requester,
EditorUtilityWindowKind kind) {
auto* context = static_cast<EditorContext*>(requester);
if (context != nullptr) {
context->RequestOpenUtilityWindow(kind);
}
}
std::string ComposeStatusText(
std::string_view status,
std::string_view message) {
@@ -213,6 +222,20 @@ const UIEditorShellInteractionServices& EditorContext::GetShellServices() const
return m_shellServices;
}
EditorPanelServices EditorContext::BuildPanelServices() {
return EditorPanelServices{
.session = m_session,
.projectRuntime = m_projectRuntime,
.sceneRuntime = m_sceneRuntime,
.commandFocusService = m_commandFocusService,
.colorPickerToolState = m_colorPickerToolState,
.systemInteractionHost = m_systemInteractionHost,
.textMeasurer = m_shellServices.textMeasurer,
.utilityWindowRequester = this,
.requestUtilityWindow = RequestEditorContextUtilityWindow,
};
}
UIEditorShellInteractionDefinition EditorContext::BuildShellDefinition(
const UIEditorWorkspaceController& workspaceController,
std::string_view captureText,