#pragma once #include #include #include #include #include #include namespace XCEngine::UI::Editor { enum class UIEditorPanelContentHostEventKind : std::uint8_t { Mounted = 0, Unmounted, BoundsChanged }; std::string_view GetUIEditorPanelContentHostEventKindName( UIEditorPanelContentHostEventKind kind); bool IsUIEditorPanelPresentationExternallyHosted(UIEditorPanelPresentationKind kind); struct UIEditorPanelContentHostBinding { std::string panelId = {}; UIEditorPanelPresentationKind kind = UIEditorPanelPresentationKind::Placeholder; }; struct UIEditorPanelContentHostMountRequest { std::string panelId = {}; UIEditorPanelPresentationKind kind = UIEditorPanelPresentationKind::Placeholder; ::XCEngine::UI::UIRect bounds = {}; }; struct UIEditorPanelContentHostRequest { std::vector mountRequests = {}; }; struct UIEditorPanelContentHostPanelState { std::string panelId = {}; UIEditorPanelPresentationKind kind = UIEditorPanelPresentationKind::Placeholder; bool mounted = false; ::XCEngine::UI::UIRect bounds = {}; }; struct UIEditorPanelContentHostState { std::vector panelStates = {}; }; struct UIEditorPanelContentHostEvent { UIEditorPanelContentHostEventKind kind = UIEditorPanelContentHostEventKind::Mounted; std::string panelId = {}; UIEditorPanelPresentationKind presentationKind = UIEditorPanelPresentationKind::Placeholder; ::XCEngine::UI::UIRect bounds = {}; }; struct UIEditorPanelContentHostFrame { std::vector panelStates = {}; std::vector events = {}; }; const UIEditorPanelContentHostMountRequest* FindUIEditorPanelContentHostMountRequest( const UIEditorPanelContentHostRequest& request, std::string_view panelId); const UIEditorPanelContentHostPanelState* FindUIEditorPanelContentHostPanelState( const UIEditorPanelContentHostState& state, std::string_view panelId); const UIEditorPanelContentHostPanelState* FindUIEditorPanelContentHostPanelState( const UIEditorPanelContentHostFrame& frame, std::string_view panelId); UIEditorPanelContentHostRequest ResolveUIEditorPanelContentHostRequest( const Widgets::UIEditorDockHostLayout& dockHostLayout, const UIEditorPanelRegistry& panelRegistry, const std::vector& bindings); UIEditorPanelContentHostFrame UpdateUIEditorPanelContentHost( UIEditorPanelContentHostState& state, const UIEditorPanelContentHostRequest& request, const UIEditorPanelRegistry& panelRegistry, const std::vector& bindings); std::vector CollectMountedUIEditorPanelContentHostPanelIds( const UIEditorPanelContentHostFrame& frame); } // namespace XCEngine::UI::Editor