Files
XCEngine/new_editor/app/Platform/Win32/EditorWindowState.h

83 lines
2.2 KiB
C++

#pragma once
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include "Composition/EditorShellRuntime.h"
#include <Platform/Win32/BorderlessWindowChrome.h>
#include <Platform/Win32/HostRuntimeState.h>
#include <Platform/Win32/InputModifierTracker.h>
#include <Rendering/D3D12/D3D12WindowRenderLoop.h>
#include <Rendering/D3D12/D3D12WindowRenderer.h>
#include <Rendering/Native/AutoScreenshot.h>
#include <Rendering/Native/NativeRenderer.h>
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
#include <XCEngine/UI/Types.h>
#include <windows.h>
#include <optional>
#include <string>
#include <vector>
namespace XCEngine::UI::Editor::App {
struct EditorWindowWindowState {
HWND hwnd = nullptr;
std::string windowId = {};
std::wstring title = {};
std::string titleText = {};
bool primary = false;
bool closing = false;
};
struct EditorWindowRenderState {
Host::NativeRenderer renderer = {};
Host::D3D12WindowRenderer windowRenderer = {};
Host::D3D12WindowRenderLoop windowRenderLoop = {};
Host::AutoScreenshotController autoScreenshot = {};
::XCEngine::UI::UITextureHandle titleBarLogoIcon = {};
bool ready = false;
};
struct EditorWindowInputState {
Host::InputModifierTracker modifierTracker = {};
std::vector<::XCEngine::UI::UIInputEvent> pendingEvents = {};
bool trackingMouseLeave = false;
};
struct EditorWindowCompositionState {
UIEditorWorkspaceController workspaceController = {};
EditorShellRuntime shellRuntime = {};
};
struct EditorWindowChromeRuntimeState {
Host::BorderlessWindowChromeState chromeState = {};
Host::HostRuntimeState runtime = {};
};
struct EditorWindowPanelTransferRequest {
std::string nodeId = {};
std::string panelId = {};
POINT screenPoint = {};
bool IsValid() const {
return !nodeId.empty() && !panelId.empty();
}
};
struct EditorWindowFrameTransferRequests {
std::optional<EditorWindowPanelTransferRequest> beginGlobalTabDrag = {};
std::optional<EditorWindowPanelTransferRequest> detachPanel = {};
bool HasPendingRequests() const {
return beginGlobalTabDrag.has_value() || detachPanel.has_value();
}
};
} // namespace XCEngine::UI::Editor::App