#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; void EditorStandaloneUtilityWindowContentController::ReplaceWorkspaceController( UIEditorWorkspaceController) {} void EditorStandaloneUtilityWindowContentController::Shutdown() { OnShutdown(); m_shellInteractionState = {}; m_shellFrame = {}; m_windowFocused = false; } void EditorStandaloneUtilityWindowContentController::ResetInteractionState() { OnResetInteractionState(); } 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); } const UIEditorShellInteractionFrame& EditorStandaloneUtilityWindowContentController::GetShellFrame() const { return m_shellFrame; } const UIEditorShellInteractionState& EditorStandaloneUtilityWindowContentController::GetShellInteractionState() const { return m_shellInteractionState; } ::XCEngine::UI::UISize EditorStandaloneUtilityWindowContentController::ResolveMinimumOuterSize() const { return m_minimumOuterSize; } void EditorStandaloneUtilityWindowContentController::OnShutdown() {} void EditorStandaloneUtilityWindowContentController::OnResetInteractionState() {} } // namespace XCEngine::UI::Editor::App