关键节点
This commit is contained in:
47
editor/app/Platform/Win32/Windowing/EditorWindowSession.h
Normal file
47
editor/app/Platform/Win32/Windowing/EditorWindowSession.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
|
||||
#include "Platform/Win32/Windowing/EditorWindowState.h"
|
||||
#include "Platform/Win32/Windowing/EditorWindowTransferRequests.h"
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
class EditorWindowSession final {
|
||||
public:
|
||||
EditorWindowSession(std::string windowId, std::wstring title, bool primary);
|
||||
|
||||
std::string_view GetWindowId() const;
|
||||
HWND GetHwnd() const;
|
||||
bool HasHwnd() const;
|
||||
EditorWindowLifecycleState GetLifecycleState() const;
|
||||
bool IsPrimary() const;
|
||||
bool IsClosing() const;
|
||||
bool IsDestroyed() const;
|
||||
const std::wstring& GetTitle() const;
|
||||
std::string_view GetCachedTitleText() const;
|
||||
|
||||
void AttachHwnd(HWND hwnd);
|
||||
void MarkNativeAttached();
|
||||
void MarkInitializing();
|
||||
void MarkRunning();
|
||||
void MarkDestroyed();
|
||||
void MarkClosing();
|
||||
void SetPrimary(bool primary);
|
||||
void SetTitle(std::wstring title);
|
||||
|
||||
void QueueCompletedImmediateFrame(
|
||||
EditorWindowFrameTransferRequests transferRequests);
|
||||
bool HasQueuedCompletedImmediateFrame() const;
|
||||
EditorWindowFrameTransferRequests ConsumeQueuedCompletedImmediateFrameTransferRequests();
|
||||
|
||||
private:
|
||||
void UpdateCachedTitleText();
|
||||
|
||||
EditorWindowState m_state = {};
|
||||
EditorWindowFrameTransferRequests m_queuedImmediateFrameTransferRequests = {};
|
||||
bool m_hasQueuedCompletedImmediateFrame = false;
|
||||
};
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
Reference in New Issue
Block a user