Files
XCEngine/editor/app/Windowing/Frame/EditorWindowTransferRequests.h

76 lines
2.0 KiB
C++

#pragma once
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include "Windowing/EditorWindowShared.h"
#include "UtilityWindows/EditorUtilityWindowKind.h"
#include <XCEditor/Workspace/UIEditorWindowWorkspaceModel.h>
#include <optional>
#include <string>
namespace XCEngine::UI::Editor::App {
struct EditorWindowPanelTransferRequest {
std::string nodeId = {};
std::string panelId = {};
EditorWindowScreenPoint screenPoint = {};
bool IsValid() const {
return !nodeId.empty() && !panelId.empty();
}
};
struct EditorWindowWorkspaceMutationRequest {
XCEngine::UI::Editor::UIEditorWindowWorkspaceState windowState = {};
bool IsValid() const {
return !windowState.windowId.empty();
}
};
struct EditorWindowOpenUtilityWindowRequest {
EditorUtilityWindowKind kind = EditorUtilityWindowKind::None;
EditorWindowScreenPoint screenPoint = {};
bool useCursorPlacement = false;
bool IsValid() const {
return kind != EditorUtilityWindowKind::None;
}
};
struct EditorWorkspaceWindowFrameTransferRequests {
std::optional<EditorWindowWorkspaceMutationRequest> workspaceMutation = {};
std::optional<EditorWindowPanelTransferRequest> beginGlobalTabDrag = {};
std::optional<EditorWindowPanelTransferRequest> detachPanel = {};
bool HasPendingRequests() const {
return workspaceMutation.has_value() ||
beginGlobalTabDrag.has_value() ||
detachPanel.has_value();
}
};
struct EditorUtilityWindowFrameTransferRequests {
std::optional<EditorWindowOpenUtilityWindowRequest> openUtilityWindow = {};
bool HasPendingRequests() const {
return openUtilityWindow.has_value();
}
};
struct EditorWindowFrameTransferRequests {
EditorWorkspaceWindowFrameTransferRequests workspace = {};
EditorUtilityWindowFrameTransferRequests utility = {};
bool HasPendingRequests() const {
return workspace.HasPendingRequests() ||
utility.HasPendingRequests();
}
};
} // namespace XCEngine::UI::Editor::App