58 lines
1.3 KiB
C++
58 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#ifndef NOMINMAX
|
|
#define NOMINMAX
|
|
#endif
|
|
|
|
#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;
|
|
EditorWindowLifecycleState lifecycle = EditorWindowLifecycleState::PendingNativeCreate;
|
|
};
|
|
|
|
struct EditorWindowState {
|
|
EditorWindowWindowState window = {};
|
|
};
|
|
|
|
} // namespace XCEngine::UI::Editor::App
|