7#include "i18n/language_tag.hpp"
8#include "i18n/language.hpp"
9#include "GUI/theme_mode.hpp"
11#include "geometry/extent.hpp"
12#include "geometry/axis_aligned_rectangle.hpp"
13#include "unfair_mutex.hpp"
14#include "subsystem.hpp"
16#include "notifier.hpp"
20namespace hi::inline
v1 {
25 using callback_token = notifier_type::callback_token;
26 using callback_proto = notifier_type::callback_proto;
35 hilet lock = std::scoped_lock(_mutex);
36 return _language_tags;
47 hilet lock = std::scoped_lock(_mutex);
60 return _writing_direction.load(std::memory_order_relaxed);
65 [[nodiscard]]
static hi::theme_mode
theme_mode() noexcept
68 return _theme_mode.load(std::memory_order_relaxed);
76 return _subpixel_orientation.load(std::memory_order_relaxed);
100 return _double_click_interval.load(std::memory_order_relaxed);
108 return _double_click_distance.load(std::memory_order_relaxed);
118 return _keyboard_repeat_delay.load(std::memory_order_relaxed);
128 return _keyboard_repeat_interval.load(std::memory_order_relaxed);
138 return _cursor_blink_delay.load(std::memory_order_relaxed);
149 return _cursor_blink_interval.load(std::memory_order_relaxed);
157 hilet lock = std::scoped_lock(_mutex);
158 return _minimum_window_size;
166 hilet lock = std::scoped_lock(_mutex);
167 return _maximum_window_size;
177 hilet lock = std::scoped_lock(_mutex);
178 return _primary_monitor_rectangle;
186 return _primary_monitor_id.load(std::memory_order::relaxed);
196 hilet lock = std::scoped_lock(_mutex);
197 return _desktop_rectangle;
207 hilet lock = std::scoped_lock(_mutex);
208 return _notifier.subscribe(
hi_forward(callback), flags);
218 static inline utc_nanoseconds _gather_last_time;
220 static inline notifier_type _notifier;
234 static inline extent2 _minimum_window_size = extent2{40.0f, 25.0f};
235 static inline extent2 _maximum_window_size = extent2{1920.0f, 1080.0f};
237 static inline aarectangle _primary_monitor_rectangle = aarectangle{0.0, 0.0, 1920.0f, 1080.0f};
238 static inline aarectangle _desktop_rectangle = aarectangle{0.0, 0.0, 1920.0f, 1080.0f};
244 static bool start_subsystem() noexcept
246 return hi::start_subsystem(_started,
false, subsystem_init, subsystem_deinit);
249 [[nodiscard]]
static bool subsystem_init() noexcept;
250 static
void subsystem_deinit() noexcept;
252 [[nodiscard]] static
std::vector<language_tag> gather_languages();
253 [[nodiscard]] static
hi::theme_mode gather_theme_mode();
254 [[nodiscard]] static
hi::subpixel_orientation gather_subpixel_orientation();
255 [[nodiscard]] static
bool gather_uniform_HDR();
256 [[nodiscard]] static
std::chrono::milliseconds gather_double_click_interval();
257 [[nodiscard]] static
float gather_double_click_distance();
258 [[nodiscard]] static
std::chrono::milliseconds gather_keyboard_repeat_delay();
259 [[nodiscard]] static
std::chrono::milliseconds gather_keyboard_repeat_interval();
260 [[nodiscard]] static
std::chrono::milliseconds gather_cursor_blink_interval();
261 [[nodiscard]] static
std::chrono::milliseconds gather_cursor_blink_delay();
262 [[nodiscard]] static extent2 gather_minimum_window_size();
263 [[nodiscard]] static extent2 gather_maximum_window_size();
264 [[nodiscard]] static uintptr_t gather_primary_monitor_id();
265 [[nodiscard]] static aarectangle gather_primary_monitor_rectangle();
266 [[nodiscard]] static aarectangle gather_desktop_rectangle();
#define hi_axiom(expression)
Specify an axiom; an expression that is true.
Definition assert.hpp:133
#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
DOXYGEN BUG.
Definition algorithm.hpp:15
callback_flags
Definition callback_flags.hpp:12
unicode_bidi_class
Bidirectional class Unicode Standard Annex #9: https://unicode.org/reports/tr9/.
Definition unicode_bidi_class.hpp:17
The HikoGUI namespace.
Definition ascii.hpp:19
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:20
A notifier which can be used to call a set of registered callbacks.
Definition notifier.hpp:26
Definition os_settings.hpp:22
static std::chrono::milliseconds keyboard_repeat_delay() noexcept
Get the delay before the keyboard starts repeating.
Definition os_settings.hpp:115
static unicode_bidi_class writing_direction() noexcept
Get the configured writing direction.
Definition os_settings.hpp:57
static aarectangle primary_monitor_rectangle() noexcept
Get the rectangle of the primary monitor.
Definition os_settings.hpp:174
static std::chrono::milliseconds keyboard_repeat_interval() noexcept
Get the keyboard repeat interval.
Definition os_settings.hpp:125
static extent2 maximum_window_size() noexcept
Get the maximum window size supported by the operating system.
Definition os_settings.hpp:163
static extent2 minimum_window_size() noexcept
Get the minimum window size supported by the operating system.
Definition os_settings.hpp:154
static std::vector< language * > languages() noexcept
Get the configured languages.
Definition os_settings.hpp:44
static hi::subpixel_orientation subpixel_orientation() noexcept
Get the configured light/dark theme mode.
Definition os_settings.hpp:73
static std::chrono::milliseconds cursor_blink_delay() noexcept
Get the cursor blink delay.
Definition os_settings.hpp:135
static aarectangle desktop_rectangle() noexcept
Get the rectangle describing the desktop.
Definition os_settings.hpp:193
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:105
static uintptr_t primary_monitor_id() noexcept
Get an opaque id of the primary monitor.
Definition os_settings.hpp:183
static std::chrono::milliseconds double_click_interval() noexcept
Get the mouse double click interval.
Definition os_settings.hpp:97
static bool uniform_HDR() noexcept
Whether SDR and HDR application can coexists on the same display.
Definition os_settings.hpp:89
static std::vector< language_tag > language_tags() noexcept
Get the language tags for the configured languages.
Definition os_settings.hpp:32
static hi::theme_mode theme_mode() noexcept
Get the configured light/dark theme mode.
Definition os_settings.hpp:65
static std::chrono::milliseconds cursor_blink_interval() noexcept
Get the cursor blink interval.
Definition os_settings.hpp:146
True if T is a forwarded type of Forward.
Definition concepts.hpp:130