#pragma once #include #include #include #include #include #include namespace XCEngine::UI::Editor { enum class UIEditorPanelHostLifecycleEventKind : std::uint8_t { Attached = 0, Detached, Shown, Hidden, Activated, Deactivated, FocusGained, FocusLost }; std::string_view GetUIEditorPanelHostLifecycleEventKindName( UIEditorPanelHostLifecycleEventKind kind); struct UIEditorPanelHostState { std::string panelId = {}; bool attached = false; bool visible = false; bool active = false; bool focused = false; }; struct UIEditorPanelHostLifecycleEvent { UIEditorPanelHostLifecycleEventKind kind = UIEditorPanelHostLifecycleEventKind::Attached; std::string panelId = {}; }; struct UIEditorPanelHostLifecycleState { std::vector panelStates = {}; }; struct UIEditorPanelHostLifecycleRequest { std::string focusedPanelId = {}; }; struct UIEditorPanelHostLifecycleFrame { std::vector panelStates = {}; std::vector events = {}; }; const UIEditorPanelHostState* FindUIEditorPanelHostState( const UIEditorPanelHostLifecycleState& state, std::string_view panelId); const UIEditorPanelHostState* FindUIEditorPanelHostState( const UIEditorPanelHostLifecycleFrame& frame, std::string_view panelId); UIEditorPanelHostLifecycleFrame UpdateUIEditorPanelHostLifecycle( UIEditorPanelHostLifecycleState& state, const UIEditorPanelRegistry& panelRegistry, const UIEditorWorkspaceModel& workspace, const UIEditorWorkspaceSession& session, const UIEditorPanelHostLifecycleRequest& request = {}); } // namespace XCEngine::UI::Editor