#pragma once #include #include #include #include #include #include #include #include #include namespace XCEngine::UI::Editor { struct UIEditorShellInteractionDefinition { UIEditorMenuModel menuModel = {}; std::vector statusSegments = {}; std::vector workspacePresentations = {}; }; struct UIEditorShellInteractionModel { UIEditorResolvedMenuModel resolvedMenuModel = {}; std::vector statusSegments = {}; std::vector workspacePresentations = {}; }; struct UIEditorShellInteractionState { UIEditorShellComposeState composeState = {}; UIEditorMenuSession menuSession = {}; UIEditorWorkspaceInteractionState workspaceInteractionState = {}; ::XCEngine::UI::UIPoint pointerPosition = {}; bool focused = false; bool hasPointerPosition = false; }; struct UIEditorShellInteractionMetrics { UIEditorShellComposeMetrics shellMetrics = {}; Widgets::UIEditorMenuPopupMetrics popupMetrics = {}; }; struct UIEditorShellInteractionPalette { UIEditorShellComposePalette shellPalette = {}; Widgets::UIEditorMenuPopupPalette popupPalette = {}; }; struct UIEditorShellInteractionServices { const UIEditorCommandDispatcher* commandDispatcher = nullptr; const UIEditorShortcutManager* shortcutManager = nullptr; }; struct UIEditorShellInteractionMenuButtonRequest { std::string menuId = {}; std::string label = {}; std::string popupId = {}; ::XCEngine::UI::UIRect rect = {}; ::XCEngine::UI::UIInputPath path = {}; bool enabled = true; }; struct UIEditorShellInteractionPopupItemRequest { std::string popupId = {}; std::string menuId = {}; std::string itemId = {}; std::string label = {}; std::string commandId = {}; std::string childPopupId = {}; ::XCEngine::UI::UIRect rect = {}; ::XCEngine::UI::UIInputPath path = {}; UIEditorMenuItemKind kind = UIEditorMenuItemKind::Command; bool enabled = false; bool checked = false; bool hasSubmenu = false; }; struct UIEditorShellInteractionPopupRequest { std::string popupId = {}; std::string menuId = {}; std::string sourceItemId = {}; ::XCEngine::UI::Widgets::UIPopupOverlayEntry overlayEntry = {}; ::XCEngine::UI::Widgets::UIPopupPlacementResult placement = {}; Widgets::UIEditorMenuPopupLayout layout = {}; std::vector resolvedItems = {}; std::vector widgetItems = {}; std::vector itemRequests = {}; }; struct UIEditorShellInteractionRequest { UIEditorShellComposeRequest shellRequest = {}; std::vector menuBarItems = {}; std::vector menuButtons = {}; std::vector popupRequests = {}; }; struct UIEditorShellInteractionResult { bool consumed = false; bool menuModal = false; bool workspaceInputSuppressed = false; bool requestPointerCapture = false; bool releasePointerCapture = false; bool viewportInteractionChanged = false; bool commandTriggered = false; bool commandDispatched = false; std::string menuId = {}; std::string popupId = {}; std::string itemId = {}; std::string commandId = {}; std::string viewportPanelId = {}; UIEditorViewportInputBridgeFrame viewportInputFrame = {}; UIEditorMenuSessionMutationResult menuMutation = {}; UIEditorCommandDispatchResult commandDispatchResult = {}; UIEditorWorkspaceInteractionResult workspaceResult = {}; }; struct UIEditorShellInteractionPopupFrame { std::string popupId = {}; Widgets::UIEditorMenuPopupState popupState = {}; }; struct UIEditorShellInteractionFrame { UIEditorShellInteractionModel model = {}; UIEditorShellInteractionRequest request = {}; UIEditorShellComposeFrame shellFrame = {}; UIEditorWorkspaceInteractionFrame workspaceInteractionFrame = {}; std::vector popupFrames = {}; UIEditorShellInteractionResult result = {}; std::string openRootMenuId = {}; std::string hoveredMenuId = {}; std::string hoveredPopupId = {}; std::string hoveredItemId = {}; bool focused = false; }; UIEditorShellInteractionModel ResolveUIEditorShellInteractionModel( const UIEditorWorkspaceController& controller, const UIEditorShellInteractionDefinition& definition, const UIEditorShellInteractionServices& services = {}); UIEditorShellInteractionRequest ResolveUIEditorShellInteractionRequest( const ::XCEngine::UI::UIRect& bounds, const UIEditorWorkspaceController& controller, const UIEditorShellInteractionModel& model, const UIEditorShellInteractionState& state = {}, const UIEditorShellInteractionMetrics& metrics = {}, const UIEditorShellInteractionServices& services = {}); UIEditorShellInteractionFrame UpdateUIEditorShellInteraction( UIEditorShellInteractionState& state, UIEditorWorkspaceController& controller, const ::XCEngine::UI::UIRect& bounds, const UIEditorShellInteractionModel& model, const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents, const UIEditorShellInteractionServices& services = {}, const UIEditorShellInteractionMetrics& metrics = {}); UIEditorShellInteractionRequest ResolveUIEditorShellInteractionRequest( const ::XCEngine::UI::UIRect& bounds, const UIEditorWorkspaceController& controller, const UIEditorShellInteractionDefinition& definition, const UIEditorShellInteractionState& state = {}, const UIEditorShellInteractionMetrics& metrics = {}, const UIEditorShellInteractionServices& services = {}); UIEditorShellInteractionFrame UpdateUIEditorShellInteraction( UIEditorShellInteractionState& state, UIEditorWorkspaceController& controller, const ::XCEngine::UI::UIRect& bounds, const UIEditorShellInteractionDefinition& definition, const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents, const UIEditorShellInteractionServices& services = {}, const UIEditorShellInteractionMetrics& metrics = {}); void AppendUIEditorShellInteraction( ::XCEngine::UI::UIDrawList& drawList, const UIEditorShellInteractionFrame& frame, const UIEditorShellInteractionModel& model, const UIEditorShellInteractionState& state, const UIEditorShellInteractionPalette& palette = {}, const UIEditorShellInteractionMetrics& metrics = {}); void AppendUIEditorShellInteraction( ::XCEngine::UI::UIDrawList& drawList, const UIEditorShellInteractionFrame& frame, const UIEditorShellInteractionState& state, const UIEditorShellInteractionPalette& palette = {}, const UIEditorShellInteractionMetrics& metrics = {}); } // namespace XCEngine::UI::Editor