7#include "theme_mode.hpp"
8#include "subpixel_orientation.hpp"
9#include "../i18n/module.hpp"
10#include "../geometry/module.hpp"
11#include "../utility/module.hpp"
12#include "../numeric/module.hpp"
13#include "../observer/module.hpp"
18namespace hi::inline
v1 {
23 using callback_token = notifier_type::callback_token;
24 using callback_proto = notifier_type::callback_proto;
32 hi_axiom(_populated.load(std::memory_order::acquire));
33 hilet lock = std::scoped_lock(_mutex);
34 return _language_tags;
43 hi_axiom(_populated.load(std::memory_order::acquire));
44 return _left_to_right.load(std::memory_order::relaxed);
49 [[nodiscard]]
static hi::theme_mode
theme_mode() noexcept
51 hi_axiom(_populated.load(std::memory_order::acquire));
52 return _theme_mode.load(std::memory_order::relaxed);
59 hi_axiom(_populated.load(std::memory_order::acquire));
60 return _subpixel_orientation.load(std::memory_order::relaxed);
75 hi_axiom(_populated.load(std::memory_order::acquire));
76 return _uniform_HDR.load(std::memory_order::relaxed);
83 hi_axiom(_populated.load(std::memory_order::acquire));
84 return _double_click_interval.load(std::memory_order::relaxed);
91 hi_axiom(_populated.load(std::memory_order::acquire));
92 return _double_click_distance.load(std::memory_order::relaxed);
101 hi_axiom(_populated.load(std::memory_order::acquire));
102 return _keyboard_repeat_delay.load(std::memory_order::relaxed);
111 hi_axiom(_populated.load(std::memory_order::acquire));
112 return _keyboard_repeat_interval.load(std::memory_order::relaxed);
121 hi_axiom(_populated.load(std::memory_order::acquire));
122 return _cursor_blink_delay.load(std::memory_order::relaxed);
132 hi_axiom(_populated.load(std::memory_order::acquire));
133 return _cursor_blink_interval.load(std::memory_order::relaxed);
142 hi_axiom(_populated.load(std::memory_order::acquire));
143 return _minimum_window_width.load(std::memory_order::relaxed);
152 hi_axiom(_populated.load(std::memory_order::acquire));
153 return _minimum_window_height.load(std::memory_order::relaxed);
162 hi_axiom(_populated.load(std::memory_order::acquire));
163 return _maximum_window_width.load(std::memory_order::relaxed);
172 hi_axiom(_populated.load(std::memory_order::acquire));
173 return _maximum_window_height.load(std::memory_order::relaxed);
182 hi_axiom(_populated.load(std::memory_order::acquire));
183 hilet lock = std::scoped_lock(_mutex);
184 return _primary_monitor_rectangle;
191 hi_axiom(_populated.load(std::memory_order::acquire));
192 return _primary_monitor_id.load(std::memory_order::relaxed);
201 hi_axiom(_populated.load(std::memory_order::acquire));
202 hilet lock = std::scoped_lock(_mutex);
203 return _desktop_rectangle;
212 return policy::unspecified;
221 hi_axiom(_populated.load(std::memory_order::acquire));
222 return _gpu_policy.load(std::memory_order::relaxed);
252 [[nodiscard]] static callback_token
255 hilet lock = std::scoped_lock(_mutex);
256 return _notifier.subscribe(
hi_forward(callback), flags);
274 static inline unfair_mutex _mutex;
276 static inline utc_nanoseconds _gather_last_time;
278 static inline notifier_type _notifier;
296 static inline aarectangle _primary_monitor_rectangle = aarectangle{0.0f, 0.0f, 1920.0f, 1080.0f};
297 static inline aarectangle _desktop_rectangle = aarectangle{0.0f, 0.0f, 1920.0f, 1080.0f};
300 [[nodiscard]]
static bool subsystem_init() noexcept;
301 static
void subsystem_deinit() noexcept;
303 [[nodiscard]] static
std::vector<language_tag> gather_languages();
304 [[nodiscard]] static
hi::theme_mode gather_theme_mode();
305 [[nodiscard]] static
hi::subpixel_orientation gather_subpixel_orientation();
306 [[nodiscard]] static
bool gather_uniform_HDR();
307 [[nodiscard]] static
std::chrono::milliseconds gather_double_click_interval();
308 [[nodiscard]] static
float gather_double_click_distance();
309 [[nodiscard]] static
std::chrono::milliseconds gather_keyboard_repeat_delay();
310 [[nodiscard]] static
std::chrono::milliseconds gather_keyboard_repeat_interval();
311 [[nodiscard]] static
std::chrono::milliseconds gather_cursor_blink_interval();
312 [[nodiscard]] static
std::chrono::milliseconds gather_cursor_blink_delay();
313 [[nodiscard]] static
float gather_minimum_window_width();
314 [[nodiscard]] static
float gather_minimum_window_height();
315 [[nodiscard]] static
float gather_maximum_window_width();
316 [[nodiscard]] static
float gather_maximum_window_height();
317 [[nodiscard]] static uintptr_t gather_primary_monitor_id();
318 [[nodiscard]] static aarectangle gather_primary_monitor_rectangle();
319 [[nodiscard]] static aarectangle gather_desktop_rectangle();
320 [[nodiscard]] static
hi::policy gather_gpu_policy();
#define hi_axiom(expression,...)
Specify an axiom; an expression that is true.
Definition assert.hpp:253
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
#define hi_forward(x)
Forward a value, based on the decltype of the value.
Definition utility.hpp:29
T::value_type start_subsystem(T &check_variable, typename T::value_type off_value, typename T::value_type(*init_function)(), void(*deinit_function)())
Start a sub-system.
Definition subsystem.hpp:113
DOXYGEN BUG.
Definition algorithm.hpp:13
callback_flags
Definition callback_flags.hpp:11
geometry/margins.hpp
Definition cache.hpp:11
policy
The performance policy to use.
Definition policy.hpp:15
A notifier which can be used to call a set of registered callbacks.
Definition notifier.hpp:25
Definition os_settings.hpp:20
static std::chrono::milliseconds keyboard_repeat_delay() noexcept
Get the delay before the keyboard starts repeating.
Definition os_settings.hpp:99
static aarectangle primary_monitor_rectangle() noexcept
Get the rectangle of the primary monitor.
Definition os_settings.hpp:180
static bool start_subsystem() noexcept
Get the global os_settings instance.
Definition os_settings.hpp:263
static float maximum_window_height() noexcept
The maximum height a window is allowed to be.
Definition os_settings.hpp:170
static std::chrono::milliseconds keyboard_repeat_interval() noexcept
Get the keyboard repeat interval.
Definition os_settings.hpp:109
static hi::subpixel_orientation subpixel_orientation() noexcept
Get the configured light/dark theme mode.
Definition os_settings.hpp:57
static std::chrono::milliseconds cursor_blink_delay() noexcept
Get the cursor blink delay.
Definition os_settings.hpp:119
static aarectangle desktop_rectangle() noexcept
Get the rectangle describing the desktop.
Definition os_settings.hpp:199
static void gather() noexcept
Gather the settings from the operating system now.
static float double_click_distance() noexcept
Get the distance from the previous mouse position to detect double click.
Definition os_settings.hpp:89
static uintptr_t primary_monitor_id() noexcept
Get an opaque id of the primary monitor.
Definition os_settings.hpp:189
static hi::policy policy() noexcept
Get the global performance policy.
Definition os_settings.hpp:210
static std::vector< uuid > preferred_gpus(hi::policy performance_policy) noexcept
Get a list of GPUs ordered best to worst.
static float minimum_window_width() noexcept
The minimum width a window is allowed to be.
Definition os_settings.hpp:140
static float maximum_window_width() noexcept
The maximum width a window is allowed to be.
Definition os_settings.hpp:160
static bool left_to_right() noexcept
Check if the configured writing direction is left-to-right.
Definition os_settings.hpp:41
static float minimum_window_height() noexcept
The minimum height a window is allowed to be.
Definition os_settings.hpp:150
static std::chrono::milliseconds double_click_interval() noexcept
Get the mouse double click interval.
Definition os_settings.hpp:81
static bool uniform_HDR() noexcept
Whether SDR and HDR application can coexists on the same display.
Definition os_settings.hpp:73
static hi::policy gpu_policy() noexcept
Get the policy for selecting a GPU.
Definition os_settings.hpp:219
static std::vector< language_tag > language_tags() noexcept
Get the language tags for the configured languages.
Definition os_settings.hpp:30
static hi::theme_mode theme_mode() noexcept
Get the configured light/dark theme mode.
Definition os_settings.hpp:49
static std::chrono::milliseconds cursor_blink_interval() noexcept
Get the cursor blink interval.
Definition os_settings.hpp:130
True if T is a forwarded type of Forward.
Definition concepts.hpp:130