#pragma once #include "Panels/EditorPanelServices.h" #include "Windowing/EditorFrameServices.h" #include "EditorSceneRuntime.h" #include "Project/EditorProjectRuntime.h" #include "UtilityWindows/EditorUtilityWindowRuntime.h" #include "Commands/EditorHostCommandBridge.h" #include "State/EditorColorPickerToolState.h" #include "State/EditorCommandFocusService.h" #include "State/EditorSelectionService.h" #include "State/EditorSession.h" #include "State/EditorUtilityWindowRequestState.h" #include #include #include #include #include #include #include #include #include namespace XCEngine::UI::Editor::System { class SystemInteractionService; } namespace XCEngine::UI::Editor::App { class EditorEditCommandRoute; class EditorContext : public EditorFrameServices { public: bool Initialize(const std::filesystem::path& repoRoot); void AttachTextMeasurer(const UIEditorTextMeasurer& textMeasurer) override; void SetSystemInteractionHost(System::SystemInteractionService* systemInteractionHost); void BindEditCommandRoutes( EditorEditCommandRoute* hierarchyRoute, EditorEditCommandRoute* projectRoute, EditorEditCommandRoute* sceneRoute, EditorEditCommandRoute* inspectorRoute = nullptr) override; void SetExitRequestHandler(std::function handler); void SyncSessionFromWorkspace( const UIEditorWorkspaceController& workspaceController) override; bool IsValid() const override; const std::string& GetValidationMessage() const override; 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; EditorColorPickerToolState& GetColorPickerToolState(); const EditorColorPickerToolState& GetColorPickerToolState() const; void RequestOpenUtilityWindow(EditorUtilityWindowKind kind); std::optional ConsumeOpenUtilityWindowRequest() override; void SetSelection(EditorSelectionState selection); void ClearSelection(); void SyncSessionFromSelectionService(); void SyncSessionFromCommandFocusService() override; System::SystemInteractionService* GetSystemInteractionHost(); const System::SystemInteractionService* GetSystemInteractionHost() const; UIEditorWorkspaceController BuildWorkspaceController() const; const UIEditorShellInteractionServices& GetShellServices() const override; EditorPanelServices BuildPanelServices() override; UIEditorShellInteractionDefinition BuildShellDefinition( const UIEditorWorkspaceController& workspaceController, std::string_view captureText, EditorShellVariant variant = EditorShellVariant::Primary) const override; void SetReadyStatus(); void SetStatus(std::string status, std::string message) override; void UpdateStatusFromShellResult( const UIEditorWorkspaceController& workspaceController, const UIEditorShellInteractionResult& result) override; std::string DescribeWorkspaceState( const UIEditorWorkspaceController& workspaceController, const UIEditorShellInteractionState& interactionState) const override; std::vector SyncWorkspacePanelFrameEvents( const std::vector& panelEvents) override; 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 = {}; EditorColorPickerToolState m_colorPickerToolState = {}; EditorUtilityWindowRequestState m_utilityWindowRequestState = {}; EditorHostCommandBridge m_hostCommandBridge = {}; System::SystemInteractionService* m_systemInteractionHost = nullptr; std::string m_lastStatus = {}; std::string m_lastMessage = {}; }; } // namespace XCEngine::UI::Editor::App