new_editor: stabilize resize lifecycle groundwork

This commit is contained in:
2026-04-23 00:36:28 +08:00
parent c10367a42e
commit 03e0b362f7
19 changed files with 439 additions and 161 deletions

View File

@@ -6,17 +6,48 @@
#include <windows.h>
#include <cstdint>
#include <string>
#include <string_view>
namespace XCEngine::UI::Editor::App {
enum class EditorWindowLifecycleState : std::uint8_t {
PendingNativeCreate = 0,
NativeAttached,
Initializing,
Running,
Closing,
Destroyed,
};
inline std::string_view GetEditorWindowLifecycleStateName(
EditorWindowLifecycleState state) {
switch (state) {
case EditorWindowLifecycleState::PendingNativeCreate:
return "PendingNativeCreate";
case EditorWindowLifecycleState::NativeAttached:
return "NativeAttached";
case EditorWindowLifecycleState::Initializing:
return "Initializing";
case EditorWindowLifecycleState::Running:
return "Running";
case EditorWindowLifecycleState::Closing:
return "Closing";
case EditorWindowLifecycleState::Destroyed:
return "Destroyed";
}
return "Unknown";
}
struct EditorWindowWindowState {
HWND hwnd = nullptr;
std::string windowId = {};
std::wstring title = {};
std::string titleText = {};
bool primary = false;
bool closing = false;
EditorWindowLifecycleState lifecycle = EditorWindowLifecycleState::PendingNativeCreate;
};
struct EditorWindowState {