#pragma once #include #include #include #include #include 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 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 = BuildEditorShellShortcutManager(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; } } // namespace XCEngine::UI::Editor