88 lines
3.3 KiB
C++
88 lines
3.3 KiB
C++
#pragma once
|
|
|
|
#include "Composition/EditorShellVariant.h"
|
|
#include "Project/EditorProjectRuntime.h"
|
|
#include "Scene/EditorSceneRuntime.h"
|
|
|
|
#include "Commands/EditorHostCommandBridge.h"
|
|
#include "State/EditorCommandFocusService.h"
|
|
#include "State/EditorSelectionService.h"
|
|
#include "State/EditorSession.h"
|
|
#include <XCEditor/Foundation/UIEditorShortcutManager.h>
|
|
#include <XCEditor/Shell/UIEditorShellAsset.h>
|
|
#include <XCEditor/Shell/UIEditorShellInteraction.h>
|
|
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
|
|
|
|
#include <filesystem>
|
|
#include <functional>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
namespace XCEngine::UI::Editor::App {
|
|
|
|
class EditorEditCommandRoute;
|
|
|
|
class EditorContext {
|
|
public:
|
|
bool Initialize(const std::filesystem::path& repoRoot);
|
|
void AttachTextMeasurer(const UIEditorTextMeasurer& textMeasurer);
|
|
void BindEditCommandRoutes(
|
|
EditorEditCommandRoute* hierarchyRoute,
|
|
EditorEditCommandRoute* projectRoute,
|
|
EditorEditCommandRoute* sceneRoute,
|
|
EditorEditCommandRoute* inspectorRoute = nullptr);
|
|
void SetExitRequestHandler(std::function<void()> handler);
|
|
void SyncSessionFromWorkspace(const UIEditorWorkspaceController& workspaceController);
|
|
|
|
bool IsValid() const;
|
|
const std::string& GetValidationMessage() const;
|
|
const EditorShellAsset& GetShellAsset() const;
|
|
const EditorSession& GetSession() const;
|
|
EditorCommandFocusService& GetCommandFocusService();
|
|
const EditorCommandFocusService& GetCommandFocusService() const;
|
|
EditorProjectRuntime& GetProjectRuntime();
|
|
const EditorProjectRuntime& GetProjectRuntime() const;
|
|
EditorSceneRuntime& GetSceneRuntime();
|
|
const EditorSceneRuntime& GetSceneRuntime() const;
|
|
void SetSelection(EditorSelectionState selection);
|
|
void ClearSelection();
|
|
void SyncSessionFromSelectionService();
|
|
void SyncSessionFromCommandFocusService();
|
|
|
|
UIEditorWorkspaceController BuildWorkspaceController() const;
|
|
const UIEditorShellInteractionServices& GetShellServices() const;
|
|
|
|
UIEditorShellInteractionDefinition BuildShellDefinition(
|
|
const UIEditorWorkspaceController& workspaceController,
|
|
std::string_view captureText,
|
|
EditorShellVariant variant = EditorShellVariant::Primary) const;
|
|
|
|
void SetReadyStatus();
|
|
void SetStatus(std::string status, std::string message);
|
|
void UpdateStatusFromShellResult(
|
|
const UIEditorWorkspaceController& workspaceController,
|
|
const UIEditorShellInteractionResult& result);
|
|
std::string DescribeWorkspaceState(
|
|
const UIEditorWorkspaceController& workspaceController,
|
|
const UIEditorShellInteractionState& interactionState) const;
|
|
|
|
private:
|
|
void AppendConsoleEntry(std::string channel, std::string message);
|
|
|
|
EditorShellAsset m_shellAsset = {};
|
|
EditorShellAssetValidationResult m_shellValidation = {};
|
|
UIEditorShortcutManager m_shortcutManager = {};
|
|
UIEditorShellInteractionServices m_shellServices = {};
|
|
EditorSession m_session = {};
|
|
EditorCommandFocusService m_commandFocusService = {};
|
|
EditorSelectionService m_selectionService = {};
|
|
EditorProjectRuntime m_projectRuntime = {};
|
|
EditorSceneRuntime m_sceneRuntime = {};
|
|
EditorHostCommandBridge m_hostCommandBridge = {};
|
|
std::string m_lastStatus = {};
|
|
std::string m_lastMessage = {};
|
|
};
|
|
|
|
} // namespace XCEngine::UI::Editor::App
|
|
|