Files
XCEngine/new_editor/include/XCEditor/Shell/UIEditorPanelContentHost.h

89 lines
2.9 KiB
C++

#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