Files
XCEngine/new_editor/app/Composition/EditorShellRuntime.h

110 lines
3.9 KiB
C++

#pragma once
#include "Composition/EditorShellPointerInteraction.h"
#include "Composition/EditorShellVariant.h"
#include "Features/Console/ConsolePanel.h"
#include "Features/Hierarchy/HierarchyPanel.h"
#include "Features/Inspector/InspectorPanel.h"
#include "Features/Project/ProjectPanel.h"
#include "Features/Scene/SceneEditCommandRoute.h"
#include "Features/Scene/SceneViewportController.h"
#include "Rendering/Assets/BuiltInIcons.h"
#include "Rendering/Viewport/ViewportHostService.h"
#include "Composition/WorkspaceEventSync.h"
#include <XCEditor/Shell/UIEditorShellInteraction.h>
#include <XCEditor/Foundation/UIEditorTextMeasurement.h>
#include <XCEditor/Workspace/UIEditorWorkspaceLayoutPersistence.h>
#include <XCEditor/Workspace/UIEditorWorkspaceSplitterDragCorrection.h>
#include <XCEngine/UI/DrawData.h>
#include <filesystem>
#include <string_view>
#include <vector>
namespace XCEngine::UI::Editor::App {
class EditorContext;
} // namespace XCEngine::UI::Editor::App
namespace XCEngine::UI::Editor::Host {
class TextureHost;
class ViewportRenderHost;
} // namespace XCEngine::UI::Editor::Host
namespace XCEngine::Rendering {
class RenderContext;
} // namespace XCEngine::Rendering
namespace XCEngine::UI::Editor::App {
class EditorShellRuntime {
public:
void Initialize(
const std::filesystem::path& repoRoot,
Host::TextureHost& textureHost,
UIEditorTextMeasurer& textMeasurer);
void Shutdown();
void ResetInteractionState();
void AttachViewportWindowRenderer(Host::ViewportRenderHost& renderer);
void DetachViewportWindowRenderer();
void SetViewportSurfacePresentationEnabled(bool enabled);
void Update(
EditorContext& context,
UIEditorWorkspaceController& workspaceController,
const ::XCEngine::UI::UIRect& bounds,
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents,
std::string_view captureText,
EditorShellVariant shellVariant = EditorShellVariant::Primary,
bool useDetachedTitleBarTabStrip = false,
float detachedTitleBarTabHeight = 0.0f);
void RenderRequestedViewports(
const ::XCEngine::Rendering::RenderContext& renderContext);
void Append(::XCEngine::UI::UIDrawList& drawList) const;
const UIEditorShellInteractionFrame& GetShellFrame() const;
const UIEditorShellInteractionState& GetShellInteractionState() const;
const std::vector<WorkspaceTraceEntry>& GetTraceEntries() const;
const std::vector<HierarchyPanel::Event>& GetHierarchyPanelEvents() const;
const std::vector<ProjectPanel::Event>& GetProjectPanelEvents() const;
const std::string& GetBuiltInIconError() const;
void SetExternalDockHostDropPreview(
const Widgets::UIEditorDockHostDropPreviewState& preview);
void ClearExternalDockHostDropPreview();
ProjectPanel::CursorKind GetHostedContentCursorKind() const;
Widgets::UIEditorDockHostCursorKind GetDockCursorKind() const;
EditorShellPointerOwner GetPointerOwner() const;
bool WantsHostPointerCapture() const;
bool WantsHostPointerRelease() const;
bool HasHostedContentCapture() const;
bool HasShellInteractiveCapture() const;
bool HasInteractiveCapture() const;
private:
ViewportHostService m_viewportHostService = {};
BuiltInIcons m_builtInIcons = {};
Host::TextureHost* m_textureHost = nullptr;
ConsolePanel m_consolePanel = {};
HierarchyPanel m_hierarchyPanel = {};
InspectorPanel m_inspectorPanel = {};
ProjectPanel m_projectPanel = {};
SceneEditCommandRoute m_sceneEditCommandRoute = {};
SceneViewportController m_sceneViewportController = {};
UIEditorShellInteractionState m_shellInteractionState = {};
UIEditorShellInteractionFrame m_shellFrame = {};
std::vector<WorkspaceTraceEntry> m_traceEntries = {};
UIEditorWorkspaceSplitterDragCorrectionState m_splitterDragCorrectionState = {};
};
} // namespace XCEngine::UI::Editor::App