Refactor new editor boundaries and test ownership
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <XCEditor/Panels/UIEditorPanelContentHost.h>
|
||||
#include <XCEditor/Panels/UIEditorPanelRegistry.h>
|
||||
#include <XCEditor/Viewport/UIEditorViewportShell.h>
|
||||
#include <XCEditor/Workspace/UIEditorWorkspaceInputOwner.h>
|
||||
#include <XCEditor/Workspace/UIEditorWorkspaceSession.h>
|
||||
#include <XCEditor/Docking/UIEditorDockHost.h>
|
||||
|
||||
@@ -95,7 +96,8 @@ UIEditorWorkspaceComposeFrame UpdateUIEditorWorkspaceCompose(
|
||||
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents,
|
||||
const Widgets::UIEditorDockHostState& dockHostState = {},
|
||||
const Widgets::UIEditorDockHostMetrics& dockHostMetrics = {},
|
||||
const Widgets::UIEditorViewportSlotMetrics& viewportMetrics = {});
|
||||
const Widgets::UIEditorViewportSlotMetrics& viewportMetrics = {},
|
||||
const UIEditorWorkspaceInputOwner* inputOwner = nullptr);
|
||||
|
||||
std::vector<std::string> CollectUIEditorWorkspaceComposeExternalBodyPanelIds(
|
||||
const UIEditorWorkspaceComposeFrame& frame);
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#include <XCEditor/Panels/UIEditorPanelContentHost.h>
|
||||
#include <XCEditor/Docking/UIEditorDockHost.h>
|
||||
|
||||
#include <XCEngine/UI/Types.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace XCEngine::UI::Editor {
|
||||
|
||||
enum class UIEditorWorkspaceInputOwnerKind : std::uint8_t {
|
||||
None = 0,
|
||||
DockHost,
|
||||
HostedPanel,
|
||||
Viewport
|
||||
};
|
||||
|
||||
struct UIEditorWorkspaceInputOwner {
|
||||
UIEditorWorkspaceInputOwnerKind kind = UIEditorWorkspaceInputOwnerKind::None;
|
||||
std::string panelId = {};
|
||||
};
|
||||
|
||||
std::string_view GetUIEditorWorkspaceInputOwnerKindName(
|
||||
UIEditorWorkspaceInputOwnerKind kind);
|
||||
|
||||
bool AreUIEditorWorkspaceInputOwnersEquivalent(
|
||||
const UIEditorWorkspaceInputOwner& lhs,
|
||||
const UIEditorWorkspaceInputOwner& rhs);
|
||||
|
||||
bool IsUIEditorWorkspaceDockHostInputOwner(
|
||||
const UIEditorWorkspaceInputOwner& owner);
|
||||
|
||||
bool IsUIEditorWorkspaceHostedPanelInputOwner(
|
||||
const UIEditorWorkspaceInputOwner& owner,
|
||||
std::string_view panelId = {});
|
||||
|
||||
bool IsUIEditorWorkspaceViewportInputOwner(
|
||||
const UIEditorWorkspaceInputOwner& owner,
|
||||
std::string_view panelId = {});
|
||||
|
||||
UIEditorWorkspaceInputOwner ResolveUIEditorWorkspacePointerInputOwner(
|
||||
const Widgets::UIEditorDockHostLayout& dockHostLayout,
|
||||
const UIEditorPanelContentHostFrame& contentHostFrame,
|
||||
const ::XCEngine::UI::UIPoint& pointerPosition);
|
||||
|
||||
UIEditorWorkspaceInputOwner NormalizeUIEditorWorkspaceInputOwner(
|
||||
UIEditorWorkspaceInputOwner owner,
|
||||
const Widgets::UIEditorDockHostLayout& dockHostLayout,
|
||||
const UIEditorPanelContentHostFrame& contentHostFrame);
|
||||
|
||||
} // namespace XCEngine::UI::Editor
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <XCEditor/Docking/UIEditorDockHostInteraction.h>
|
||||
#include <XCEditor/Workspace/UIEditorWorkspaceCompose.h>
|
||||
#include <XCEditor/Workspace/UIEditorWorkspaceInputOwner.h>
|
||||
|
||||
#include <XCEngine/UI/Types.h>
|
||||
|
||||
@@ -17,6 +18,7 @@ struct UIEditorWorkspaceInteractionModel {
|
||||
struct UIEditorWorkspaceInteractionState {
|
||||
UIEditorDockHostInteractionState dockHostInteractionState = {};
|
||||
UIEditorWorkspaceComposeState composeState = {};
|
||||
UIEditorWorkspaceInputOwner inputOwner = {};
|
||||
};
|
||||
|
||||
struct UIEditorWorkspaceInteractionResult {
|
||||
@@ -33,6 +35,9 @@ struct UIEditorWorkspaceInteractionFrame {
|
||||
UIEditorDockHostInteractionFrame dockHostFrame = {};
|
||||
UIEditorWorkspaceComposeFrame composeFrame = {};
|
||||
UIEditorWorkspaceInteractionResult result = {};
|
||||
UIEditorWorkspaceInputOwner previousInputOwner = {};
|
||||
UIEditorWorkspaceInputOwner inputOwner = {};
|
||||
bool inputOwnerChanged = false;
|
||||
};
|
||||
|
||||
UIEditorWorkspaceInteractionFrame UpdateUIEditorWorkspaceInteraction(
|
||||
|
||||
Reference in New Issue
Block a user