#include "Platform/Win32/EditorStandaloneUtilityWindowContentController.h" #include namespace XCEngine::UI::Editor::App { using ::XCEngine::UI::UIInputEvent; using ::XCEngine::UI::UIInputEventType; EditorStandaloneUtilityWindowContentController:: EditorStandaloneUtilityWindowContentController( const ::XCEngine::UI::UISize& minimumOuterSize) : m_minimumOuterSize(minimumOuterSize) {} EditorStandaloneUtilityWindowContentController:: ~EditorStandaloneUtilityWindowContentController() = default; const UIEditorWorkspaceController* EditorStandaloneUtilityWindowContentController::TryGetWorkspaceController() const { return nullptr; } UIEditorWorkspaceController* EditorStandaloneUtilityWindowContentController::TryGetMutableWorkspaceController() { return nullptr; } void EditorStandaloneUtilityWindowContentController::ReplaceWorkspaceController( UIEditorWorkspaceController) {} void EditorStandaloneUtilityWindowContentController::Initialize( const EditorWindowContentInitializationContext&) {} void EditorStandaloneUtilityWindowContentController::Shutdown() { OnShutdown(); m_shellInteractionState = {}; m_shellFrame = {}; m_windowFocused = false; } void EditorStandaloneUtilityWindowContentController::ResetInteractionState() { OnResetInteractionState(); } void EditorStandaloneUtilityWindowContentController::SetViewportSurfacePresentationEnabled(bool) {} EditorWindowFrameTransferRequests EditorStandaloneUtilityWindowContentController::UpdateAndAppend( const EditorWindowContentFrameContext& context, ::XCEngine::UI::UIDrawData& drawData) { bool focusGained = false; bool focusLost = false; for (const UIInputEvent& event : context.inputEvents) { if (event.type == UIInputEventType::FocusGained) { m_windowFocused = true; focusGained = true; } else if (event.type == UIInputEventType::FocusLost) { m_windowFocused = false; focusLost = true; } } m_shellInteractionState.focused = m_windowFocused; m_shellFrame.focused = m_windowFocused; return UpdateStandaloneContent( EditorStandaloneUtilityWindowFrameContext{ .editorContext = context.editorContext, .bounds = context.bounds, .inputEvents = context.inputEvents, .focused = m_windowFocused, .focusGained = focusGained, .focusLost = focusLost, }, drawData); } void EditorStandaloneUtilityWindowContentController::RenderRequestedViewports( const ::XCEngine::Rendering::RenderContext&) {} const UIEditorShellInteractionFrame& EditorStandaloneUtilityWindowContentController::GetShellFrame() const { return m_shellFrame; } const UIEditorShellInteractionState& EditorStandaloneUtilityWindowContentController::GetShellInteractionState() const { return m_shellInteractionState; } void EditorStandaloneUtilityWindowContentController::SetExternalDockHostDropPreview( const Widgets::UIEditorDockHostDropPreviewState&) {} void EditorStandaloneUtilityWindowContentController::ClearExternalDockHostDropPreview() {} bool EditorStandaloneUtilityWindowContentController::TryResolveDockTabDragHotspot( std::string_view, std::string_view, const ::XCEngine::UI::UIPoint&, ::XCEngine::UI::UIPoint&) const { return false; } UIEditorDockHostTabDropTarget EditorStandaloneUtilityWindowContentController::ResolveDockTabDropTarget( const ::XCEngine::UI::UIPoint&) const { return {}; } bool EditorStandaloneUtilityWindowContentController::HasHostedContentCapture() const { return false; } bool EditorStandaloneUtilityWindowContentController::HasShellInteractiveCapture() const { return false; } bool EditorStandaloneUtilityWindowContentController::HasInteractiveCapture() const { return false; } EditorWindowContentCursorKind EditorStandaloneUtilityWindowContentController::GetHostedContentCursorKind() const { return EditorWindowContentCursorKind::Arrow; } EditorWindowContentCursorKind EditorStandaloneUtilityWindowContentController::GetDockCursorKind() const { return EditorWindowContentCursorKind::Arrow; } ::XCEngine::UI::UISize EditorStandaloneUtilityWindowContentController::ResolveMinimumOuterSize() const { return m_minimumOuterSize; } bool EditorStandaloneUtilityWindowContentController::ShouldUseDetachedTitleBarTabStrip() const { return false; } std::string EditorStandaloneUtilityWindowContentController::ResolveTabStripTitleText( std::string_view fallbackTitle) const { return std::string(fallbackTitle); } std::string EditorStandaloneUtilityWindowContentController::ResolveDetachedWindowTitleText( std::string_view fallbackWindowTitle) const { return std::string(fallbackWindowTitle); } void EditorStandaloneUtilityWindowContentController::OnShutdown() {} void EditorStandaloneUtilityWindowContentController::OnResetInteractionState() {} } // namespace XCEngine::UI::Editor::App