Refactor XCUI editor module layout
This commit is contained in:
88
new_editor/include/XCEditor/Shell/UIEditorPanelContentHost.h
Normal file
88
new_editor/include/XCEditor/Shell/UIEditorPanelContentHost.h
Normal file
@@ -0,0 +1,88 @@
|
||||
#pragma once
|
||||
|
||||
#include <XCEditor/Shell/UIEditorPanelRegistry.h>
|
||||
#include <XCEditor/Shell/UIEditorDockHost.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
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<UIEditorPanelContentHostMountRequest> mountRequests = {};
|
||||
};
|
||||
|
||||
struct UIEditorPanelContentHostPanelState {
|
||||
std::string panelId = {};
|
||||
UIEditorPanelPresentationKind kind = UIEditorPanelPresentationKind::Placeholder;
|
||||
bool mounted = false;
|
||||
::XCEngine::UI::UIRect bounds = {};
|
||||
};
|
||||
|
||||
struct UIEditorPanelContentHostState {
|
||||
std::vector<UIEditorPanelContentHostPanelState> panelStates = {};
|
||||
};
|
||||
|
||||
struct UIEditorPanelContentHostEvent {
|
||||
UIEditorPanelContentHostEventKind kind = UIEditorPanelContentHostEventKind::Mounted;
|
||||
std::string panelId = {};
|
||||
UIEditorPanelPresentationKind presentationKind = UIEditorPanelPresentationKind::Placeholder;
|
||||
::XCEngine::UI::UIRect bounds = {};
|
||||
};
|
||||
|
||||
struct UIEditorPanelContentHostFrame {
|
||||
std::vector<UIEditorPanelContentHostPanelState> panelStates = {};
|
||||
std::vector<UIEditorPanelContentHostEvent> 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<UIEditorPanelContentHostBinding>& bindings);
|
||||
|
||||
UIEditorPanelContentHostFrame UpdateUIEditorPanelContentHost(
|
||||
UIEditorPanelContentHostState& state,
|
||||
const UIEditorPanelContentHostRequest& request,
|
||||
const UIEditorPanelRegistry& panelRegistry,
|
||||
const std::vector<UIEditorPanelContentHostBinding>& bindings);
|
||||
|
||||
std::vector<std::string> CollectMountedUIEditorPanelContentHostPanelIds(
|
||||
const UIEditorPanelContentHostFrame& frame);
|
||||
|
||||
} // namespace XCEngine::UI::Editor
|
||||
Reference in New Issue
Block a user