HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Static Public Member Functions
v1::os_settings Class Reference

Static Public Member Functions

static device_type device_type () noexcept
 Get the device this application is running on.
 
static std::vector< language_tag > language_tags () noexcept
 Get the language tags for the configured languages.
 
static std::locale locale () noexcept
 Get the current local.
 
static bool left_to_right () noexcept
 Check if the configured writing direction is left-to-right.
 
static hi::alignment alignment (hi::alignment rhs) noexcept
 Get the alignment based on the writing direction.
 
static hi::horizontal_alignment alignment (hi::horizontal_alignment rhs) noexcept
 Get the alignment based on the writing direction.
 
static hi::theme_mode theme_mode () noexcept
 Get the configured light/dark theme mode.
 
static hi::subpixel_orientation subpixel_orientation () noexcept
 Get the configured light/dark theme mode.
 
static bool uniform_HDR () noexcept
 Whether SDR and HDR application can coexists on the same display.
 
static std::chrono::milliseconds double_click_interval () noexcept
 Get the mouse double click interval.
 
static float double_click_distance () noexcept
 Get the distance from the previous mouse position to detect double click.
 
static std::chrono::milliseconds keyboard_repeat_delay () noexcept
 Get the delay before the keyboard starts repeating.
 
static std::chrono::milliseconds keyboard_repeat_interval () noexcept
 Get the keyboard repeat interval.
 
static std::chrono::milliseconds cursor_blink_delay () noexcept
 Get the cursor blink delay.
 
static std::chrono::milliseconds cursor_blink_interval () noexcept
 Get the cursor blink interval.
 
static float minimum_window_width () noexcept
 The minimum width a window is allowed to be.
 
static float minimum_window_height () noexcept
 The minimum height a window is allowed to be.
 
static float maximum_window_width () noexcept
 The maximum width a window is allowed to be.
 
static float maximum_window_height () noexcept
 The maximum height a window is allowed to be.
 
static aarectangle primary_monitor_rectangle () noexcept
 Get the rectangle of the primary monitor.
 
static uintptr_t primary_monitor_id () noexcept
 Get an opaque id of the primary monitor.
 
static aarectangle desktop_rectangle () noexcept
 Get the rectangle describing the desktop.
 
static hi::policy policy () noexcept
 Get the global performance policy.
 
static hi::policy gpu_policy () noexcept
 Get the policy for selecting a GPU.
 
static std::vector< uuidpreferred_gpus (hi::policy performance_policy) noexcept
 Get a list of GPUs ordered best to worst.
 
template<forward_of< void()> Func>
static callback< void()> subscribe (Func &&func, callback_flags flags=callback_flags::synchronous) noexcept
 
static bool start_subsystem () noexcept
 Get the global os_settings instance.
 
static void gather () noexcept
 Gather the settings from the operating system now.
 

Member Function Documentation

◆ alignment() [1/2]

static hi::alignment v1::os_settings::alignment ( hi::alignment rhs)
inlinestaticnoexcept

Get the alignment based on the writing direction.

Parameters
rhsThe alignment that may need to be flipped to match the writing direction.
Return values
Thealignment, possibly flipped.

◆ alignment() [2/2]

static hi::horizontal_alignment v1::os_settings::alignment ( hi::horizontal_alignment rhs)
inlinestaticnoexcept

Get the alignment based on the writing direction.

Parameters
rhsThe alignment that may need to be flipped to match the writing direction.
Return values
Thealignment, possibly flipped.

◆ cursor_blink_delay()

static std::chrono::milliseconds v1::os_settings::cursor_blink_delay ( )
inlinestaticnoexcept

Get the cursor blink delay.

Note
This delay is used to determine when to blink after cursor movement.

◆ cursor_blink_interval()

static std::chrono::milliseconds v1::os_settings::cursor_blink_interval ( )
inlinestaticnoexcept

Get the cursor blink interval.

Note
The interval is the complete period of the cursor blink, from on-to-on.
Returns
The cursor blink interval, or std::chrono::milliseconds::max() when blinking is turned off.

◆ desktop_rectangle()

static aarectangle v1::os_settings::desktop_rectangle ( )
inlinestaticnoexcept

Get the rectangle describing the desktop.

Returns
The bounding rectangle around the desktop. With the origin being equal to the origin of the primary monitor.

◆ device_type()

static device_type v1::os_settings::device_type ( )
inlinestaticnoexcept

Get the device this application is running on.

This is used to detect the viewing distance from the screen and combined with the screen's DPI to determine how device independent pixels (dips) are scaled.

If you need to know how to layout the application based on the device type use device_mode(); as some operating systems allow emulation or switching of device-mode during run-time.

◆ double_click_distance()

static float v1::os_settings::double_click_distance ( )
inlinestaticnoexcept

Get the distance from the previous mouse position to detect double click.

◆ double_click_interval()

static std::chrono::milliseconds v1::os_settings::double_click_interval ( )
inlinestaticnoexcept

Get the mouse double click interval.

◆ gather()

static void v1::os_settings::gather ( )
inlinestaticnoexcept

Gather the settings from the operating system now.

◆ gpu_policy()

static hi::policy v1::os_settings::gpu_policy ( )
inlinestaticnoexcept

Get the policy for selecting a GPU.

Returns
The performance policy for selecting a GPU.

◆ keyboard_repeat_delay()

static std::chrono::milliseconds v1::os_settings::keyboard_repeat_delay ( )
inlinestaticnoexcept

Get the delay before the keyboard starts repeating.

Note
Also used to determine the scroll delay when selecting text.

◆ keyboard_repeat_interval()

static std::chrono::milliseconds v1::os_settings::keyboard_repeat_interval ( )
inlinestaticnoexcept

Get the keyboard repeat interval.

Note
Also used to determine the scroll speed when selecting text.

◆ language_tags()

static std::vector< language_tag > v1::os_settings::language_tags ( )
inlinestaticnoexcept

Get the language tags for the configured languages.

Returns
A list of language tags in order of priority.

◆ left_to_right()

static bool v1::os_settings::left_to_right ( )
inlinestaticnoexcept

Check if the configured writing direction is left-to-right.

Return values
trueIf the writing direction is left-to-right.

◆ locale()

static std::locale v1::os_settings::locale ( )
inlinestaticnoexcept

Get the current local.

Returns
The current locale.

◆ maximum_window_height()

static float v1::os_settings::maximum_window_height ( )
inlinestaticnoexcept

The maximum height a window is allowed to be.

Returns
The maximum window height.

◆ maximum_window_width()

static float v1::os_settings::maximum_window_width ( )
inlinestaticnoexcept

The maximum width a window is allowed to be.

Returns
The maximum window width.

◆ minimum_window_height()

static float v1::os_settings::minimum_window_height ( )
inlinestaticnoexcept

The minimum height a window is allowed to be.

Returns
The minimum window height.

◆ minimum_window_width()

static float v1::os_settings::minimum_window_width ( )
inlinestaticnoexcept

The minimum width a window is allowed to be.

Returns
The minimum window width.

◆ policy()

static hi::policy v1::os_settings::policy ( )
inlinestaticnoexcept

Get the global performance policy.

Returns
The performance policy selected by the operating system.

◆ preferred_gpus()

std::vector< uuid > hi::v1::os_settings::preferred_gpus ( hi::policy performance_policy)
inlinestaticnoexcept

Get a list of GPUs ordered best to worst.

The performance policy is calculated from several sources, in order from high priority to low priority:

  1. os_settings::gpu_policy() if not policy::unspecified.
  2. performance_policy argument if not policy::unspecified.
  3. os_settings::policy()

On win32 the GPU identifiers returned are LUIDs which are smaller then UUIDs. Vulkan specifically includes VkPhysicalDeviceIDProperties::deviceLUID to match with these return values.

On other operating systems the return value here is a UUID which will match with VkPhysicalDeviceIDProperties::deviceUUID.

Use VkPhysicalDeviceIDProperties::deviceLUIDValid to know which one to match and VK_LUID_SIZE for the size of the comparison.

Parameters
performance_policyThe performance policy of the application.
Returns
A list of GPU identifiers ordered best to worst.

◆ primary_monitor_id()

static uintptr_t v1::os_settings::primary_monitor_id ( )
inlinestaticnoexcept

Get an opaque id of the primary monitor.

◆ primary_monitor_rectangle()

static aarectangle v1::os_settings::primary_monitor_rectangle ( )
inlinestaticnoexcept

Get the rectangle of the primary monitor.

Returns
The rectangle describing the size and location inside the desktop.

◆ start_subsystem()

static bool v1::os_settings::start_subsystem ( )
inlinestaticnoexcept

Get the global os_settings instance.

Returns
True on success.

◆ subpixel_orientation()

static hi::subpixel_orientation v1::os_settings::subpixel_orientation ( )
inlinestaticnoexcept

Get the configured light/dark theme mode.

◆ theme_mode()

static hi::theme_mode v1::os_settings::theme_mode ( )
inlinestaticnoexcept

Get the configured light/dark theme mode.

◆ uniform_HDR()

static bool v1::os_settings::uniform_HDR ( )
inlinestaticnoexcept

Whether SDR and HDR application can coexists on the same display.

Microsoft Windows 10 and at least early versions of Windows 11 will have set this to false, because if an application opens a HDR surface it will switch the display mode to HDR, this switching may cause a significant change in color and brightness of the display, including other (SDR) applications that where already running. This would be surprising for most users and we can not expect users to have calibrated colors to match HDR with SDR.


The documentation for this class was generated from the following files: