Split Win32 main window session state
This commit is contained in:
47
src/platform_windows/windows_main_window_session.cpp
Normal file
47
src/platform_windows/windows_main_window_session.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
#include "pch.h"
|
||||
|
||||
#include "platform_windows/windows_main_window_session.h"
|
||||
|
||||
namespace pp::platform::windows {
|
||||
namespace {
|
||||
|
||||
struct RetainedMainWindowSessionState final {
|
||||
HWND handle{};
|
||||
wchar_t title[512]{};
|
||||
bool sandboxed = false;
|
||||
};
|
||||
|
||||
[[nodiscard]] RetainedMainWindowSessionState& retained_main_window_session_state() noexcept
|
||||
{
|
||||
static RetainedMainWindowSessionState state;
|
||||
return state;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HWND& retained_main_window_handle_ref() noexcept
|
||||
{
|
||||
return retained_main_window_session_state().handle;
|
||||
}
|
||||
|
||||
wchar_t* retained_main_window_title_buffer() noexcept
|
||||
{
|
||||
return retained_main_window_session_state().title;
|
||||
}
|
||||
|
||||
const wchar_t* retained_main_window_title() noexcept
|
||||
{
|
||||
return retained_main_window_session_state().title;
|
||||
}
|
||||
|
||||
bool retained_main_window_sandboxed() noexcept
|
||||
{
|
||||
return retained_main_window_session_state().sandboxed;
|
||||
}
|
||||
|
||||
void set_retained_main_window_sandboxed(bool sandboxed) noexcept
|
||||
{
|
||||
retained_main_window_session_state().sandboxed = sandboxed;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user