55 virtual bool Draw(ImGuiIO& io) = 0;
74 virtual void OnShow() = 0;
93 void OnShow()
override {}
122 REX_SETTING(std::string, driver,
"sdl3",
123 "UI driver, none for headless in an app that does not require a UI", kStartupOnly);
124 REX_SETTING(std::string, title,
"",
"Window title, the app name when empty");
125 REX_SETTING(i32, window_width, 0,
"Window width, 0 for the video mode width",
Range{0, 16384});
126 REX_SETTING(i32, window_height, 0,
"Window height, 0 for the video mode height",
Range{0, 16384});
127 REX_SETTING(
bool, fullscreen,
true,
"Fullscreen");
128 REX_SETTING(
bool, fullscreen_exclusive,
false,
"Exclusive fullscreen");
129 REX_SETTING(i32, monitor, 0,
"Display to open on",
Range{0, 16});
130 REX_SETTING(i32, min_width, 0,
"Smallest window width",
Range{0, 16384});
131 REX_SETTING(i32, min_height, 0,
"Smallest window height",
Range{0, 16384});
132 REX_SETTING(std::string, aspect_ratio,
"stretch",
"Window shape",
133 Allowed(
"stretch",
"4:3",
"5:4",
"3:2",
"16:10",
"16:9",
"21:9",
"32:9"));
134 REX_SETTING(std::string, resolution,
"",
135 "Video mode preset or WxH, empty to use the ui.video_mode_* settings");
136 REX_SETTING(i32, video_mode_width, 1280,
"Video mode width the title sees",
Range{640, 4095},
138 REX_SETTING(i32, video_mode_height, 720,
"Video mode height the title sees",
Range{480, 4095},
140 REX_SETTING(f64, video_mode_refresh_rate, 60.0,
"Refresh rate the title sees",
Range{24.0, 240.0},
142 REX_SETTING(f64, cursor_timeout, 0.0,
"Seconds before an idle cursor hides, 0 never hides",
163 virtual
bool IsHeadless() const = 0;
166 virtual
bool HasWindow() const = 0;
173 virtual
bool IsFocused() const = 0;
176 virtual
VideoMode GetVideoMode() const = 0;
184 virtual
void RaiseWindow() = 0;
187 virtual
bool IsUIThread() const = 0;
208 virtual ImFontAtlas& GetFonts() = 0;
213 virtual ImGuiStyle& GetImGuiStyle() = 0;
218 virtual ImGuiIO& GetImGuiIO() = 0;
223 virtual ui::
Style& GetStyle() = 0;
230 [[nodiscard]] virtual
Result<
void> AddOverlays(std::span<const
OverlayConfig> overlays) = 0;
232 virtual
void ShowOverlay(std::string_view name,
bool visible) = 0;
234 virtual
void ToggleOverlay(std::string_view name) = 0;
239 [[nodiscard]] virtual
Result<ui::
IDialog*> GetOverlay(std::string_view name) = 0;
242 virtual
bool IsAnyOverlayVisible() const = 0;
256 virtual
void AddDialog(std::unique_ptr<ui::
IDialog> dialog) = 0;
259 virtual
bool HasDialogs() const = 0;
273 virtual
void ShowMessage(
MessageType type, std::string_view heading, std::string_view body) = 0;
289 [[nodiscard]] virtual
Result<std::vector<std::filesystem::path>> ShowFileDialog(
303 virtual
void CancelPrompts() = 0;
308 virtual std::vector<ui::
Monitor> GetDisplays() = 0;
315 virtual std::vector<ui::
HostLocale> GetPreferredLocales() = 0;
Definition overlay_renderer.h:18
SettingOwner(std::string_view scope)
Definition ui_system.h:85
bool NeedsContinuousPaint() const override
Definition ui_system.h:89
void OnClose() override
Definition ui_system.h:87
bool WantsExclusiveInput() const override
Definition ui_system.h:91
bool OnToggle() override
Definition ui_system.h:95
Definition ui_system.h:47
virtual bool Draw(ImGuiIO &io)=0
virtual bool OnToggle()=0
virtual bool WantsExclusiveInput() const =0
virtual bool NeedsContinuousPaint() const =0
Definition ui_event.h:184
Definition ui_system.h:154
Definition ui_system.h:118
Interfaces, factory and module declaration.
#define REX_DECLARE_INTERFACE(Name, version)
Definition module.h:114
typename detail::MoveOnlyFunctionFor< Signature >::type MoveOnlyFunction
Definition utility.h:254
std::expected< T, Error > Result
Definition result.h:98
MessageType
Definition process.h:182
Typed settings and the owners that declare them.
The registry of every registered setting.
Definition input_keys.h:554
Definition native_window.h:17
Definition ui_system.h:111
std::unique_ptr< ui::IDialog >(*) create(IUISystem &ui)
Definition ui_system.h:115
std::string_view name
Definition ui_system.h:112
KeyChord default_key
Definition ui_system.h:113
Integer types, byte order wrappers and size literals.
Move only function, const propagating pointer and scope guard.