86 lines
3.3 KiB
C++
86 lines
3.3 KiB
C++
#pragma once
|
|
|
|
#include "Platform/Win32/EditorWindowContentController.h"
|
|
|
|
#include <XCEditor/Shell/UIEditorShellInteraction.h>
|
|
|
|
#include <XCEngine/UI/Types.h>
|
|
|
|
#include <memory>
|
|
|
|
namespace XCEngine::UI::Editor::App {
|
|
|
|
struct EditorStandaloneUtilityWindowFrameContext {
|
|
EditorContext& editorContext;
|
|
const ::XCEngine::UI::UIRect& bounds;
|
|
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents;
|
|
bool focused = false;
|
|
bool focusGained = false;
|
|
bool focusLost = false;
|
|
};
|
|
|
|
class EditorStandaloneUtilityWindowContentController
|
|
: public EditorWindowContentController {
|
|
public:
|
|
explicit EditorStandaloneUtilityWindowContentController(
|
|
const ::XCEngine::UI::UISize& minimumOuterSize);
|
|
~EditorStandaloneUtilityWindowContentController() override;
|
|
|
|
const UIEditorWorkspaceController* TryGetWorkspaceController() const override;
|
|
UIEditorWorkspaceController* TryGetMutableWorkspaceController() override;
|
|
void ReplaceWorkspaceController(UIEditorWorkspaceController workspaceController) override;
|
|
|
|
void Initialize(const EditorWindowContentInitializationContext& context) override;
|
|
void Shutdown() override;
|
|
void ResetInteractionState() override;
|
|
void SetViewportSurfacePresentationEnabled(bool enabled) override;
|
|
|
|
EditorWindowFrameTransferRequests UpdateAndAppend(
|
|
const EditorWindowContentFrameContext& context,
|
|
::XCEngine::UI::UIDrawData& drawData) override;
|
|
void RenderRequestedViewports(
|
|
const ::XCEngine::Rendering::RenderContext& renderContext) override;
|
|
|
|
const UIEditorShellInteractionFrame& GetShellFrame() const override;
|
|
const UIEditorShellInteractionState& GetShellInteractionState() const override;
|
|
|
|
void SetExternalDockHostDropPreview(
|
|
const Widgets::UIEditorDockHostDropPreviewState& preview) override;
|
|
void ClearExternalDockHostDropPreview() override;
|
|
|
|
bool TryResolveDockTabDragHotspot(
|
|
std::string_view nodeId,
|
|
std::string_view panelId,
|
|
const ::XCEngine::UI::UIPoint& point,
|
|
::XCEngine::UI::UIPoint& outHotspot) const override;
|
|
UIEditorDockHostTabDropTarget ResolveDockTabDropTarget(
|
|
const ::XCEngine::UI::UIPoint& point) const override;
|
|
|
|
bool HasHostedContentCapture() const override;
|
|
bool HasShellInteractiveCapture() const override;
|
|
bool HasInteractiveCapture() const override;
|
|
EditorWindowContentCursorKind GetHostedContentCursorKind() const override;
|
|
EditorWindowContentCursorKind GetDockCursorKind() const override;
|
|
|
|
::XCEngine::UI::UISize ResolveMinimumOuterSize() const override;
|
|
bool ShouldUseDetachedTitleBarTabStrip() const override;
|
|
std::string ResolveTabStripTitleText(std::string_view fallbackTitle) const override;
|
|
std::string ResolveDetachedWindowTitleText(
|
|
std::string_view fallbackWindowTitle) const override;
|
|
|
|
protected:
|
|
virtual void OnShutdown();
|
|
virtual void OnResetInteractionState();
|
|
virtual EditorWindowFrameTransferRequests UpdateStandaloneContent(
|
|
const EditorStandaloneUtilityWindowFrameContext& context,
|
|
::XCEngine::UI::UIDrawData& drawData) = 0;
|
|
|
|
private:
|
|
::XCEngine::UI::UISize m_minimumOuterSize = {};
|
|
UIEditorShellInteractionState m_shellInteractionState = {};
|
|
UIEditorShellInteractionFrame m_shellFrame = {};
|
|
bool m_windowFocused = true;
|
|
};
|
|
|
|
} // namespace XCEngine::UI::Editor::App
|