127 lines
3.7 KiB
C++
127 lines
3.7 KiB
C++
#pragma once
|
|
|
|
#include "Windowing/Frame/EditorWindowTransferRequests.h"
|
|
#include "Windowing/Host/EditorWindowContentBindings.h"
|
|
|
|
#include <XCEditor/Foundation/UIEditorTextMeasurement.h>
|
|
|
|
#include <filesystem>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
namespace XCEngine::Rendering {
|
|
|
|
class RenderContext;
|
|
|
|
} // namespace XCEngine::Rendering
|
|
|
|
namespace XCEngine::UI {
|
|
|
|
class UIDrawData;
|
|
class UIDrawList;
|
|
|
|
struct UIInputEvent;
|
|
struct UIPoint;
|
|
struct UIRect;
|
|
struct UISize;
|
|
|
|
} // namespace XCEngine::UI
|
|
|
|
namespace XCEngine::UI::Editor {
|
|
struct UIEditorShellInteractionFrame;
|
|
struct UIEditorShellInteractionState;
|
|
|
|
} // namespace XCEngine::UI::Editor
|
|
|
|
namespace XCEngine::UI::Editor::Rendering::Host {
|
|
|
|
class UiTextureHost;
|
|
class ViewportRenderHost;
|
|
|
|
} // namespace XCEngine::UI::Editor::Rendering::Host
|
|
|
|
namespace XCEngine::UI::Editor::App {
|
|
|
|
class EditorContext;
|
|
|
|
struct EditorWindowContentCapabilities {
|
|
bool workspace = false;
|
|
bool dockHost = false;
|
|
bool inputFeedback = false;
|
|
bool titleBar = false;
|
|
bool viewportRendering = false;
|
|
bool utilityPanel = false;
|
|
};
|
|
|
|
struct EditorWindowContentInitializationContext {
|
|
const std::filesystem::path& repoRoot;
|
|
EditorContext& editorContext;
|
|
Rendering::Host::UiTextureHost& textureHost;
|
|
UIEditorTextMeasurer& textMeasurer;
|
|
Rendering::Host::ViewportRenderHost& viewportRenderer;
|
|
};
|
|
|
|
struct EditorWindowContentFrameContext {
|
|
EditorContext& editorContext;
|
|
const ::XCEngine::UI::UIRect& bounds;
|
|
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents;
|
|
std::optional<EditorWindowScreenPoint> cursorScreenPoint = {};
|
|
std::string_view captureStatusText;
|
|
bool primary = false;
|
|
bool globalTabDragActive = false;
|
|
bool useDetachedTitleBarTabStrip = false;
|
|
};
|
|
|
|
class EditorWindowContentController {
|
|
public:
|
|
virtual ~EditorWindowContentController() = default;
|
|
|
|
virtual EditorWindowContentCapabilities GetCapabilities() const {
|
|
return {};
|
|
}
|
|
|
|
virtual EditorWindowWorkspaceBinding* TryGetWorkspaceBinding() {
|
|
return nullptr;
|
|
}
|
|
virtual const EditorWindowWorkspaceBinding* TryGetWorkspaceBinding() const {
|
|
return nullptr;
|
|
}
|
|
virtual EditorWindowDockHostBinding* TryGetDockHostBinding() {
|
|
return nullptr;
|
|
}
|
|
virtual const EditorWindowDockHostBinding* TryGetDockHostBinding() const {
|
|
return nullptr;
|
|
}
|
|
virtual const EditorWindowInputFeedbackBinding* TryGetInputFeedbackBinding() const {
|
|
return nullptr;
|
|
}
|
|
virtual const EditorWindowTitleBarBinding* TryGetTitleBarBinding() const {
|
|
return nullptr;
|
|
}
|
|
|
|
virtual void Initialize(const EditorWindowContentInitializationContext&) {}
|
|
virtual void PrepareEditorContext(EditorContext& context, UIEditorTextMeasurer& textMeasurer);
|
|
virtual bool IsEditorContextValid(const EditorContext& context) const;
|
|
virtual void AppendInvalidFrame(
|
|
const EditorContext& context,
|
|
::XCEngine::UI::UIDrawList& drawList) const;
|
|
virtual void NotifyStartupCaptureRequested(EditorContext& context);
|
|
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 ::XCEngine::UI::UISize ResolveMinimumOuterSize() const = 0;
|
|
};
|
|
|
|
} // namespace XCEngine::UI::Editor::App
|