refactor editor ui host and shell asset layout

This commit is contained in:
2026-04-10 01:59:15 +08:00
parent b5ba985831
commit 899442c64d
54 changed files with 150 additions and 153 deletions

View File

@@ -4,15 +4,11 @@
#define NOMINMAX
#endif
#include "Host/AutoScreenshot.h"
#include "Host/InputModifierTracker.h"
#include "Host/NativeRenderer.h"
#include <Host/AutoScreenshot.h>
#include <Host/InputModifierTracker.h>
#include <Host/NativeRenderer.h>
#include "Shell/EditorShellAsset.h"
#include <XCEditor/Shell/UIEditorShellInteraction.h>
#include <XCEditor/Foundation/UIEditorShortcutManager.h>
#include <XCEditor/Shell/UIEditorWorkspaceController.h>
#include <XCEditor/Shell/UIEditorStructuredShell.h>
#include <XCEngine/UI/Runtime/UIScreenDocumentHost.h>
#include <XCEngine/UI/Runtime/UIScreenPlayer.h>
@@ -28,44 +24,6 @@
namespace XCEngine::UI::Editor {
struct StructuredEditorShellBinding {
::XCEngine::UI::Runtime::UIScreenAsset screenAsset = {};
UIEditorWorkspaceController workspaceController = {};
UIEditorShellInteractionDefinition shellDefinition = {};
UIEditorShortcutManager shortcutManager = {};
EditorShellAssetValidationResult assetValidation = {};
[[nodiscard]] bool IsValid() const {
return assetValidation.IsValid();
}
};
inline UIEditorShortcutManager BuildStructuredEditorShortcutManager(
const EditorShellAsset& asset) {
return BuildEditorShellShortcutManager(asset);
}
inline StructuredEditorShellBinding BuildStructuredEditorShellBinding(
const EditorShellAsset& asset) {
StructuredEditorShellBinding binding = {};
binding.screenAsset.screenId = asset.screenId;
binding.screenAsset.documentPath = asset.documentPath.string();
binding.workspaceController =
UIEditorWorkspaceController(asset.panelRegistry, asset.workspace, asset.workspaceSession);
binding.shellDefinition = asset.shellDefinition;
binding.shortcutManager = BuildStructuredEditorShortcutManager(asset);
binding.assetValidation = ValidateEditorShellAsset(asset);
return binding;
}
inline UIEditorShellInteractionServices BuildStructuredEditorShellServices(
const StructuredEditorShellBinding& binding) {
UIEditorShellInteractionServices services = {};
services.commandDispatcher = &binding.shortcutManager.GetCommandDispatcher();
services.shortcutManager = &binding.shortcutManager;
return services;
}
class Application {
public:
Application();