150 lines
4.2 KiB
C++
150 lines
4.2 KiB
C++
#pragma once
|
|
|
|
#include "Platform/Win32/EditorWindowTransferRequests.h"
|
|
|
|
#include <XCEditor/Docking/UIEditorDockHostTransfer.h>
|
|
#include <XCEditor/Foundation/UIEditorTextMeasurement.h>
|
|
|
|
#include <cstdint>
|
|
#include <filesystem>
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
namespace XCEngine::Rendering {
|
|
|
|
class RenderContext;
|
|
|
|
} // namespace XCEngine::Rendering
|
|
|
|
namespace XCEngine::UI {
|
|
|
|
class UIDrawData;
|
|
|
|
struct UIInputEvent;
|
|
struct UIPoint;
|
|
struct UIRect;
|
|
struct UISize;
|
|
|
|
} // namespace XCEngine::UI
|
|
|
|
namespace XCEngine::UI::Editor {
|
|
|
|
class UIEditorWorkspaceController;
|
|
|
|
struct UIEditorShellInteractionFrame;
|
|
struct UIEditorShellInteractionState;
|
|
|
|
namespace Widgets {
|
|
struct UIEditorDockHostDropPreviewState;
|
|
}
|
|
|
|
} // namespace XCEngine::UI::Editor
|
|
|
|
namespace XCEngine::UI::Editor::Ports {
|
|
|
|
class TexturePort;
|
|
class ViewportRenderPort;
|
|
|
|
} // namespace XCEngine::UI::Editor::Ports
|
|
|
|
namespace XCEngine::UI::Editor::App {
|
|
|
|
class EditorContext;
|
|
|
|
enum class EditorWindowContentCursorKind : std::uint8_t {
|
|
Arrow = 0,
|
|
ResizeEW,
|
|
ResizeNS,
|
|
};
|
|
|
|
struct EditorWindowContentInitializationContext {
|
|
const std::filesystem::path& repoRoot;
|
|
EditorContext& editorContext;
|
|
Ports::TexturePort& textureHost;
|
|
UIEditorTextMeasurer& textMeasurer;
|
|
Ports::ViewportRenderPort& viewportRenderer;
|
|
};
|
|
|
|
struct EditorWindowContentFrameContext {
|
|
EditorContext& editorContext;
|
|
const ::XCEngine::UI::UIRect& bounds;
|
|
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents;
|
|
std::string_view captureStatusText;
|
|
bool primary = false;
|
|
bool globalTabDragActive = false;
|
|
bool useDetachedTitleBarTabStrip = false;
|
|
};
|
|
|
|
class EditorWindowContentController {
|
|
public:
|
|
virtual ~EditorWindowContentController() = default;
|
|
|
|
virtual const UIEditorWorkspaceController* TryGetWorkspaceController() const {
|
|
return nullptr;
|
|
}
|
|
virtual UIEditorWorkspaceController* TryGetMutableWorkspaceController() {
|
|
return nullptr;
|
|
}
|
|
virtual void ReplaceWorkspaceController(UIEditorWorkspaceController workspaceController) = 0;
|
|
|
|
virtual void Initialize(const EditorWindowContentInitializationContext&) {}
|
|
virtual void Shutdown() {}
|
|
virtual void ResetInteractionState() {}
|
|
virtual void SetViewportSurfacePresentationEnabled(bool) {}
|
|
|
|
virtual EditorWindowFrameTransferRequests UpdateAndAppend(
|
|
const EditorWindowContentFrameContext& context,
|
|
::XCEngine::UI::UIDrawData& drawData) = 0;
|
|
virtual void RenderRequestedViewports(const ::XCEngine::Rendering::RenderContext&) {}
|
|
|
|
virtual const UIEditorShellInteractionFrame& GetShellFrame() const = 0;
|
|
virtual const UIEditorShellInteractionState& GetShellInteractionState() const = 0;
|
|
|
|
virtual void SetExternalDockHostDropPreview(
|
|
const Widgets::UIEditorDockHostDropPreviewState&) {}
|
|
virtual void ClearExternalDockHostDropPreview() {}
|
|
|
|
virtual bool TryResolveDockTabDragHotspot(
|
|
std::string_view,
|
|
std::string_view,
|
|
const ::XCEngine::UI::UIPoint&,
|
|
::XCEngine::UI::UIPoint&) const {
|
|
return false;
|
|
}
|
|
virtual UIEditorDockHostTabDropTarget ResolveDockTabDropTarget(
|
|
const ::XCEngine::UI::UIPoint&) const {
|
|
return {};
|
|
}
|
|
|
|
virtual bool HasHostedContentCapture() const {
|
|
return false;
|
|
}
|
|
virtual bool HasShellInteractiveCapture() const {
|
|
return false;
|
|
}
|
|
virtual bool HasInteractiveCapture() const {
|
|
return false;
|
|
}
|
|
virtual EditorWindowContentCursorKind GetHostedContentCursorKind() const {
|
|
return EditorWindowContentCursorKind::Arrow;
|
|
}
|
|
virtual EditorWindowContentCursorKind GetDockCursorKind() const {
|
|
return EditorWindowContentCursorKind::Arrow;
|
|
}
|
|
|
|
virtual ::XCEngine::UI::UISize ResolveMinimumOuterSize() const = 0;
|
|
virtual bool ShouldUseDetachedTitleBarTabStrip() const {
|
|
return false;
|
|
}
|
|
virtual std::string ResolveTabStripTitleText(std::string_view fallbackTitle) const {
|
|
return std::string(fallbackTitle);
|
|
}
|
|
virtual std::string ResolveDetachedWindowTitleText(
|
|
std::string_view fallbackWindowTitle) const {
|
|
return std::string(fallbackWindowTitle);
|
|
}
|
|
};
|
|
|
|
} // namespace XCEngine::UI::Editor::App
|