HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Namespaces | Data Structures | Concepts | Typedefs | Enumerations | Functions | Variables
hi::v1 Namespace Reference

The HikoGUI API version 1. More...

Namespaces

namespace  geo
 HikoGUI geometry types.
 

Data Structures

class  abstract_button_widget
 Base class for implementing button widgets. More...
 
class  audio_device_widget
 Audio device configuration widget. More...
 
struct  box_constraints
 2D constraints. More...
 
struct  box_shape
 
class  button_delegate
 A button delegate controls the state of a button widget. More...
 
class  cache
 
class  cancel_error
 Cancel error is caused by user pressing cancel. More...
 
struct  char_converter
 A converter between character encodings. More...
 
struct  char_map
 Character encoder/decoder template. More...
 
struct  char_map<"ascii">
 ASCII (7-bit) character map. More...
 
struct  char_map<"cp-1252">
 CP-1252 / Windows-1252 character map. More...
 
struct  char_map<"iso-8859-1">
 ISO-8859-1 / Latin-1 character map. More...
 
struct  char_map<"utf-16">
 Unicode UTF-16 encoding. More...
 
struct  char_map<"utf-32">
 Unicode UTF-32 encoding. More...
 
struct  char_map<"utf-8">
 Unicode UTF-8 encoding. More...
 
class  checkbox_widget
 A GUI widget that permits the user to make a binary choice. More...
 
class  circle
 A type defining a 2D circle. More...
 
class  color
 This is a RGBA floating point color. More...
 
class  const_resource_view
 A read-only view of a resource. More...
 
struct  convertible_to_any
 A type that can be implicitly converted to any type. More...
 
class  corner_radii
 The 4 radii of the corners of a quad or rectangle. More...
 
class  cpu_id
 
class  dead_lock_detector
 Dead lock detector. More...
 
class  default_radio_button_delegate
 A default radio button delegate. More...
 
class  default_selection_delegate
 A delegate that control the state of a selection_widget. More...
 
class  default_tab_delegate
 A delegate that control the state of a tab_widget. More...
 
class  default_text_delegate
 A default text delegate. More...
 
class  default_text_delegate< char const * >
 A default text delegate specialization for std::string. More...
 
class  default_text_delegate< gstring >
 A default text delegate specialization for gstring. More...
 
class  default_text_delegate< std::string >
 A default text delegate specialization for std::string. More...
 
class  default_text_delegate< text >
 A default text delegate specialization for text. More...
 
class  default_text_delegate< translate >
 A default text delegate specialization for translate. More...
 
class  default_text_field_delegate
 A default text delegate. More...
 
class  default_text_field_delegate< T >
 A default text delegate specialization for std::integral<T>. More...
 
class  default_toggle_button_delegate
 A default toggle button delegate. More...
 
struct  draw_attributes
 The draw attributes used to draw shaped into the draw context. More...
 
class  draw_context
 Draw context for drawing using the HikoGUI shaders. More...
 
class  file
 A File object. More...
 
class  file_view
 Map a file into virtual memory. More...
 
class  font_char_map
 Character map of a font. More...
 
class  glob_pattern
 A glob pattern. More...
 
class  grid_layout
 Grid layout algorithm. More...
 
class  grid_widget
 A GUI widget that lays out child-widgets in a grid with variable sized cells. More...
 
class  gui_error
 
class  gui_event
 A user interface event. More...
 
class  icon_widget
 An simple GUI widget that displays an icon. More...
 
struct  interval
 
class  io_error
 Exception thrown during I/O on an error. More...
 
class  key_error
 
struct  keyboard_target_data
 
class  label_widget
 The GUI widget displays and lays out text together with an icon. More...
 
class  lean_vector
 Lean-vector with (SVO) short-vector-optimization. More...
 
struct  lexer_config
 
class  line_segment
 Line segment. More...
 
class  log
 
class  lookahead_iterator
 Lookahead iterator. More...
 
class  menu_button_widget
 A button that is part of a menu. More...
 
class  momentary_button_widget
 A momentary button widget. More...
 
struct  mouse_event_data
 Information for a mouse event. More...
 
struct  native_simd
 A native-SIMD type. More...
 
class  not_found_error
 Exception thrown when an item was not found. More...
 
struct  number_of_data_members
 
class  operation_error
 Exception thrown during execution of a dynamic operation. More...
 
class  os_error
 Exception thrown during an operating system call. More...
 
struct  otype_fbyte_buf_t
 Open-type for 8 signed integer that must be scaled by the EM-scale. More...
 
struct  otype_fixed15_16_buf_t
 Open-type 16.16 signed fixed point, range between -32768.0 and 32767.999. More...
 
struct  otype_fixed1_14_buf_t
 Open-type 16-bit signed fraction, range between -2.0 and 1.999. More...
 
struct  otype_fuword_buf_t
 Open-type for 16 unsigned integer that must be scaled by the EM-scale. More...
 
struct  otype_fword_buf_t
 Open-type for 16 signed integer that must be scaled by the EM-scale. More...
 
class  overlay_widget
 A GUI widget which may exist anywhere on a window overlaid above any other widget. More...
 
struct  override_t
 Tag used for special functions or constructions to do a override compared to another function of the same na,e. More...
 
class  parse_error
 Exception thrown during parsing on an error. More...
 
class  pixmap
 A 2D pixel-based image. More...
 
class  pixmap_span
 A non-owning 2D pixel-based image. More...
 
class  quad_color
 A color for each corner of a quad. More...
 
class  radio_button_widget
 A graphical control element that allows the user to choose only one of a predefined set of mutually exclusive options. More...
 
class  row_column_layout
 
class  row_column_widget
 A row/column widget lays out child widgets along a row or column. More...
 
class  scroll_aperture_widget
 A scroll aperture widget. More...
 
class  scroll_bar_widget
 Scroll bar widget This widget is used in a pair of a vertical and horizontal scrollbar as a child of the scroll_widget. More...
 
class  scroll_widget
 The scroll widget allows a content widget to be shown in less space than is required. More...
 
class  selection_delegate
 A delegate that controls the state of a selection_widget. More...
 
class  selection_widget
 A graphical control element that allows the user to choose only one of a predefined set of mutually exclusive options. More...
 
class  spacer_widget
 This GUI widget is used as a spacer between other widget for layout purposes. More...
 
class  system_menu_widget
 The system menu widget. More...
 
class  tab_delegate
 A delegate that controls the state of a tab_widget. More...
 
class  tab_widget
 A graphical element that shows only one of a predefined set of mutually exclusive child widgets. More...
 
class  text_delegate
 A delegate that controls the state of a text_widget. More...
 
class  text_field_delegate
 A delegate that controls the state of a text_field_widget. More...
 
class  text_field_widget
 A single line text field. More...
 
class  text_widget
 A text widget. More...
 
struct  three_way_comparison
 A functor to safely compare two arithmetic values. More...
 
struct  three_way_comparison< Lhs, Rhs >
 
class  toggle_widget
 A GUI widget that permits the user to make a binary choice. More...
 
class  toolbar_button_widget
 A momentary button used as a child in the toolbar. More...
 
class  toolbar_tab_button_widget
 A graphical control element that allows the user to choose only one of a predefined set of mutually exclusive views of a tab_widget. More...
 
class  toolbar_widget
 A toolbar widget is located at the top of a window and lays out its children horizontally. More...
 
class  unfair_mutex_impl
 An unfair mutex This is a fast implementation of a mutex which does not fairly arbitrate between multiple blocking threads. More...
 
class  unfair_recursive_mutex
 An unfair recursive-mutex This is a fast implementation of a recursive-mutex which does not fairly arbitrate between multiple blocking threads. More...
 
struct  unusable_t
 A type that can not be constructed, copied, moved or destructed. More...
 
class  URI
 A Uniform Resource Identifier. More...
 
class  uri_error
 
class  URL
 Universal Resource Locator. More...
 
class  url_error
 
class  widget
 An interactive graphical object as part of the user-interface. More...
 
class  widget_layout
 The layout of a widget. More...
 
class  window_traffic_lights_widget
 Window control button widget. More...
 
class  window_widget
 The top-level window widget. More...
 

Concepts

concept  dsp_argument
 
concept  draw_attribute
 
concept  draw_quad_shape
 
concept  bound_check_range_helper
 
concept  button_widget_attribute
 
concept  icon_widget_attribute
 
concept  label_widget_attribute
 
concept  selection_widget_attribute
 
concept  text_field_widget_attribute
 
concept  text_widget_attribute
 

Typedefs

using thread_id = uint32_t
 
using unfair_mutex = unfair_mutex_impl<true>
 
using aarectangle = geo::axis_aligned_rectangle<float>
 
using aarectanglei = geo::axis_aligned_rectangle<int>
 
using extent2 = geo::extent<float, 2>
 A 2D extent.
 
using extent3 = geo::extent<float, 3>
 A 3D extent.
 
using extent2i = geo::extent<int, 2>
 A 2D extent.
 
using extent3i = geo::extent<int, 3>
 A 3D extent.
 
using identity2 = geo::identity
 2D identity transform.
 
using identity3 = geo::identity
 2D identity transform.
 
using lookat3 = geo::lookat
 
using margins = geo::margins<float>
 
using marginsi = geo::margins<int>
 
using matrix2 = geo::matrix<2>
 A 2D homogenious transformation matrix.
 
using matrix3 = geo::matrix<3>
 A 3D homogenious transformation matrix.
 
using perspective3 = geo::perspective
 
using widget_id = tagged_id<uint32_t, "widget">
 
template<typename T >
using row_layout = row_column_layout<axis::x, T>
 
template<typename T >
using column_layout = row_column_layout<axis::y, T>
 
using ssize_t = std::ptrdiff_t
 Signed size/index into an array.
 
using row_widget = row_column_widget<axis::x>
 Lays out children in a row.
 
using column_widget = row_column_widget<axis::y>
 Lays out children in a column.
 
using vertical_scroll_widget = scroll_widget<axis::vertical>
 Vertical scroll widget.
 
using horizontal_scroll_widget = scroll_widget<axis::horizontal>
 Horizontal scroll widget.
 

Enumerations

enum class  semantic_color : unsigned char {
  blue , green , indigo , orange ,
  pink , purple , red , teal ,
  yellow , gray , gray2 , gray3 ,
  gray4 , gray5 , gray6 , foreground ,
  border , fill , accent , text_select ,
  primary_cursor , secondary_cursor
}
 Semantic colors. More...
 
enum class  global_state_type : uint64_t {
  log_debug = 0x01 , log_info = 0x02 , log_statistics = 0x04 , log_trace = 0x08 ,
  log_audit = 0x10 , log_warning = 0x20 , log_error = 0x40 , log_fatal = 0x80 ,
  log_mask = log_debug | log_info | log_statistics | log_trace | log_audit | log_warning | log_error | log_fatal , log_level_default = log_audit | log_error | log_fatal , log_level_fatal = log_audit | log_fatal , log_level_error = log_trace | log_error | log_level_fatal ,
  log_level_warning = log_warning | log_level_error , log_level_info = log_info | log_statistics | log_level_warning , log_level_debug = log_debug | log_level_info , log_is_running = 0x1'00 ,
  time_stamp_utc_is_running = 0x2'00 , system_is_running = 0x1'000000'00 , system_is_shutting_down = 0x2'000000'00 , system_mask = system_is_running | system_is_shutting_down
}
 The flag-type used for global state. More...
 
enum class  seek_whence { seek_whence::begin , seek_whence::current , seek_whence::end }
 The position in the file to seek from. More...
 
enum class  access_mode {
  access_mode::read = 0x1 , access_mode::write = 0x2 , access_mode::rename = 0x4 , access_mode::read_lock = 0x10 ,
  access_mode::write_lock = 0x20 , access_mode::open = 0x100 , access_mode::create = 0x200 , access_mode::truncate = 0x400 ,
  access_mode::random = 0x1000 , access_mode::sequential = 0x2000 , access_mode::no_reuse = 0x4000 , access_mode::write_through = 0x8000 ,
  access_mode::create_directories = 0x10000 , access_mode::open_for_read = open | read , access_mode::open_for_read_and_write = open | read | write , truncate_or_create_for_write = create_directories | open | create | truncate | write
}
 The mode in which way to open a file. More...
 
enum class  path_location {
  path_location::resource_dirs , path_location::executable_file , path_location::executable_dir , path_location::library_file ,
  path_location::library_dir , path_location::data_dir , path_location::log_dir , path_location::preferences_file ,
  path_location::system_font_dirs , path_location::font_dirs , path_location::theme_dirs
}
 File and Directory locations. More...
 
enum class  axis : unsigned char {
  none = 0 , x = 1 , y = 2 , z = 4 ,
  both = x | y , all = x | y | z , horizontal = x , vertical = y
}
 An enumeration of the 3 axis for 3D geometry. More...
 
enum class  line_end_cap { line_end_cap::flat , line_end_cap::round }
 The way two lines should be joined. More...
 
enum class  line_join_style { line_join_style::none , line_join_style::bevel , line_join_style::miter , line_join_style::round }
 The way two lines should be joined. More...
 
enum class  border_side { on , inside , outside }
 The side where the border is drawn. More...
 
enum class  gui_event_type {
  none , keyboard_down , keyboard_up , keyboard_grapheme ,
  keyboard_partial_grapheme , keyboard_enter , keyboard_exit , mouse_move ,
  mouse_drag , mouse_down , mouse_up , mouse_wheel ,
  mouse_enter , mouse_exit , mouse_exit_window , gui_event_type::window_redraw ,
  gui_event_type::window_relayout , gui_event_type::window_reconstrain , gui_event_type::window_resize , gui_event_type::window_minimize ,
  gui_event_type::window_maximize , gui_event_type::window_normalize , gui_event_type::window_close , gui_event_type::window_open_sysmenu ,
  gui_event_type::window_set_keyboard_target , gui_event_type::window_set_clipboard , text_cursor_left_char , text_cursor_right_char ,
  text_cursor_down_char , text_cursor_up_char , text_cursor_left_word , text_cursor_right_word ,
  text_cursor_begin_line , text_cursor_end_line , text_cursor_begin_sentence , text_cursor_end_sentence ,
  text_cursor_begin_document , text_cursor_end_document , text_select_left_char , text_select_right_char ,
  text_select_down_char , text_select_up_char , text_select_word , text_select_left_word ,
  text_select_right_word , text_select_begin_line , text_select_end_line , text_select_begin_sentence ,
  text_select_end_sentence , text_select_document , text_select_begin_document , text_select_end_document ,
  text_delete_char_prev , text_delete_char_next , text_delete_word_prev , text_delete_word_next ,
  text_swap_chars , text_edit_paste , text_edit_copy , text_edit_cut ,
  text_undo , text_redo , text_insert_line , text_insert_line_up ,
  text_insert_line_down , text_mode_insert , gui_widget_next , gui_widget_prev ,
  gui_menu_next , gui_menu_prev , gui_toolbar_open , gui_toolbar_next ,
  gui_toolbar_prev , gui_activate , gui_activate_next , gui_cancel
}
 GUI event type. More...
 
enum class  gui_event_variant {
  gui_event_variant::other , gui_event_variant::mouse , gui_event_variant::keyboard , gui_event_variant::keyboard_target ,
  gui_event_variant::grapheme , gui_event_variant::rectangle , gui_event_variant::clipboard_data
}
 A granular gui event type. More...
 
enum class  button_state { button_state::off , button_state::on , button_state::other }
 The state of a button. More...
 
enum class  widget_mode {
  widget_mode::collapse , widget_mode::invisible , widget_mode::disabled , widget_mode::display ,
  widget_mode::select , widget_mode::partial , widget_mode::enabled
}
 The mode that the widget is operating at. More...
 

Functions

char32_t random_char () noexcept
 
constexpr std::u32string to_u32string (std::u32string_view rhs) noexcept
 Identity conversion from UTF-32 to UTF-32.
 
constexpr std::u32string to_u32string (std::u16string_view rhs) noexcept
 Conversion from UTF-16 to UTF-32.
 
constexpr std::u32string to_u32string (std::u8string_view rhs) noexcept
 Conversion from UTF-8 to UTF-32.
 
constexpr std::u32string to_u32string (std::wstring_view rhs) noexcept
 Conversion from wide-string (UTF-16/32) to UTF-32.
 
constexpr std::u32string to_u32string (std::string_view rhs) noexcept
 Conversion from UTF-8 to UTF-32.
 
constexpr std::u16string to_u16string (std::u32string_view rhs) noexcept
 Conversion from UTF-32 to UTF-16.
 
constexpr std::u16string to_u16string (std::u16string_view rhs) noexcept
 Identity conversion from UTF-16 to UTF-16.
 
constexpr std::u16string to_u16string (std::u8string_view rhs) noexcept
 Conversion from UTF-8 to UTF-16.
 
constexpr std::u16string to_u16string (std::wstring_view rhs) noexcept
 Conversion from wide-string (UTF-16/32) to UTF-16.
 
constexpr std::u16string to_u16string (std::string_view rhs) noexcept
 Conversion from UTF-8 to UTF-16.
 
constexpr std::u8string to_u8string (std::u32string_view rhs) noexcept
 Conversion from UTF-32 to UTF-8.
 
constexpr std::u8string to_u8string (std::u16string_view rhs) noexcept
 Conversion from UTF-16 to UTF-8.
 
constexpr std::u8string to_u8string (std::u8string_view rhs) noexcept
 Identity conversion from UTF-8 to UTF-8.
 
constexpr std::u8string to_u8string (std::wstring_view rhs) noexcept
 Conversion from wide-string (UTF-16/32) to UTF-8.
 
constexpr std::u8string to_u8string (std::string_view rhs) noexcept
 Conversion from UTF-8 to UTF-8.
 
constexpr std::wstring to_wstring (std::u32string_view rhs) noexcept
 Conversion from UTF-32 to wide-string (UTF-16/32).
 
constexpr std::wstring to_wstring (std::u16string_view rhs) noexcept
 Conversion from UTF-16 to wide-string (UTF-16/32).
 
constexpr std::wstring to_wstring (std::u8string_view rhs) noexcept
 Conversion from UTF-8 to wide-string (UTF-16/32).
 
constexpr std::wstring to_wstring (std::wstring_view rhs) noexcept
 Identity conversion from wide-string (UTF-16/32) to wide-string (UTF-16/32).
 
constexpr std::wstring to_wstring (std::string_view rhs) noexcept
 Conversion from UTF-8 to wide-string (UTF-16/32).
 
constexpr std::string to_string (std::u32string_view rhs) noexcept
 Conversion from UTF-32 to UTF-8.
 
constexpr std::string to_string (std::u16string_view rhs) noexcept
 Conversion from UTF-16 to UTF-8.
 
constexpr std::string to_string (std::u8string_view rhs) noexcept
 Identity conversion from UTF-8 to UTF-8.
 
constexpr std::string to_string (std::wstring_view rhs) noexcept
 Conversion from wide-string (UTF-16/32) to UTF-8.
 
constexpr std::string to_string (std::string_view rhs) noexcept
 Conversion from UTF-8 to UTF-8.
 
constexpr matrix3 color_primaries_to_RGBtoXYZ (float wx, float wy, float rx, float ry, float gx, float gy, float bx, float by) noexcept
 Create a color space conversion matrix.
 
float Rec2100_linear_to_gamma (float L) noexcept
 Rec.2100 linear to gamma transfer function.
 
float Rec2100_gamma_to_linear (float N) noexcept
 Rec.2100 gamma to linear transfer function.
 
std::string_view to_string (semantic_color rhs) noexcept
 Convert a semantic color to a string.
 
semantic_color semantic_color_from_string (std::string_view str)
 Convert a string to a semantic color.
 
float sRGB_linear_to_gamma (float u) noexcept
 sRGB linear to gamma transfer function.
 
float sRGB_gamma_to_linear (float u) noexcept
 sRGB gamma to linear transfer function.
 
uint8_t sRGB_linear16_to_gamma8 (float16 u) noexcept
 sRGB linear float-16 to gamma transfer function.
 
float16 sRGB_gamma8_to_linear16 (uint8_t u) noexcept
 sRGB gamma to linear float-16 transfer function.
 
color color_from_sRGB (float r, float g, float b, float a) noexcept
 Convert gama corrected sRGB color to the linear color.
 
color color_from_sRGB (uint8_t r, uint8_t g, uint8_t b, uint8_t a) noexcept
 Convert gama corrected sRGB color to the linear color.
 
color color_from_sRGB (std::string_view str)
 
constexpr global_state_type operator| (global_state_type lhs, global_state_type rhs) noexcept
 
constexpr global_state_type operator& (global_state_type lhs, global_state_type rhs) noexcept
 
constexpr global_state_type operator~ (global_state_type rhs) noexcept
 
constexpr bool to_bool (global_state_type rhs) noexcept
 
constexpr bool is_system_running (global_state_type rhs) noexcept
 
constexpr bool is_system_shutting_down (global_state_type rhs) noexcept
 
bool is_system_running () noexcept
 Check if the HikoGUI system is running.
 
bool is_system_shutting_down () noexcept
 Check if the HikoGUI system is being shut down.
 
void set_log_level (global_state_type log_level) noexcept
 Set the logging level.
 
bool global_state_disable (global_state_type subsystem, std::memory_order order=std::memory_order::seq_cst) noexcept
 Disable a subsystem.
 
bool global_state_enable (global_state_type subsystem, std::memory_order order=std::memory_order::seq_cst) noexcept
 Enable a subsystem.
 
template<typename T >
requires (is_atomic_v<T>)
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.
 
bool start_subsystem (global_state_type state_bit, bool(*init_function)(), void(*deinit_function)())
 Start a sub-system.
 
template<typename T >
requires (is_atomic_v<T>)
T::value_type start_subsystem_or_terminate (T &check_variable, typename T::value_type off_value, typename T::value_type(*init_function)(), void(*deinit_function)())
 Start a sub-system.
 
void stop_subsystem (void(*deinit_function)())
 Stop a sub-system.
 
void start_system () noexcept
 Start the system.
 
void shutdown_system () noexcept
 Shutdown the system.
 
thread_id current_thread_id () noexcept
 Get the current thread id.
 
void set_thread_name (std::string_view name) noexcept
 Set the name of the current thread.
 
std::string get_thread_name (thread_id id) noexcept
 Get the thread name of a thread id.
 
std::vector< bool > process_affinity_mask ()
 Get the current process CPU affinity mask.
 
std::vector< bool > set_thread_affinity_mask (std::vector< bool > const &mask)
 Set the current thread CPU affinity mask.
 
std::vector< bool > set_thread_affinity (std::size_t cpu_id)
 Set the current thread CPU affinity to a single CPU.
 
std::size_t advance_thread_affinity (std::size_t &cpu) noexcept
 Advance thread affinity to the next CPU.
 
std::size_t current_cpu_id () noexcept
 Get the current CPU id.
 
template<typename T , typename Op >
void dsp_visit (std::span< T > r, std::span< T const > a, std::span< T const > b, Op op) noexcept
 
template<typename T , typename Op >
void dsp_visit (std::span< T > r, std::span< T const > a, T b, Op op) noexcept
 
template<typename T , typename Op >
void dsp_visit (std::span< float > r, float a, Op op) noexcept
 
void dsp_add (dsp_argument auto... args) noexcept
 
void dsp_sub (dsp-argument auto... args) noexcept
 
void dsp_mul (dsp-argument auto... args) noexcept
 
constexpr access_mode operator| (access_mode const &lhs, access_mode const &rhs) noexcept
 
constexpr access_mode operator& (access_mode const &lhs, access_mode const &rhs) noexcept
 
constexpr bool to_bool (access_mode const &rhs) noexcept
 
generator< std::filesystem::path > glob (glob_pattern pattern)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (std::string_view pattern)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (std::string pattern)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (char const *pattern)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (std::filesystem::path pattern)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (path_location location, std::filesystem::path ref)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (path_location location, std::string_view ref)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (path_location location, std::string ref)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > glob (path_location location, char const *ref)
 Find paths on the filesystem that match the glob pattern.
 
generator< std::filesystem::path > get_paths (path_location location)
 Get a set of paths.
 
std::optional< std::filesystem::path > find_path (path_location location, std::filesystem::path const &ref) noexcept
 Find a path.
 
std::filesystem::path get_path (path_location location)
 Get the single and only path.
 
std::span< std::byte const > otype_cmap_find (std::span< std::byte const > bytes, uint16_t platform_id, uint16_t platform_specific_id)
 
font_char_map otype_cmap_parse_map_4 (std::span< std::byte const > over_sized_bytes)
 
font_char_map otype_cmap_parse_map_6 (std::span< std::byte const > over_sized_bytes)
 
font_char_map otype_cmap_parse_map_12 (std::span< std::byte const > over_sized_bytes)
 
font_char_map otype_cmap_parse_map (std::span< std::byte const > bytes)
 
font_char_map otype_cmap_parse (std::span< std::byte const > bytes)
 
auto otype_head_parse (std::span< std::byte const > bytes)
 
auto otype_hhea_parse (std::span< std::byte const > bytes, float em_scale)
 
auto otype_hmtx_get (std::span< std::byte const > bytes, hi::glyph_id glyph_id, uint16_t num_horizontal_metrics, float em_scale)
 
std::optional< float > otype_kern_sub0_find (size_t &offset, std::span< std::byte const > bytes, glyph_id first_glyph_id, glyph_id second_glyph_id, float em_scale)
 
vector2 otype_kern_v0_find (std::span< std::byte const > bytes, glyph_id first_glyph_id, glyph_id second_glyph_id, float em_scale)
 'kern' version 0 find.
 
vector2 otype_kern_v1_find (std::span< std::byte const > bytes, glyph_id first_glyph_id, glyph_id second_glyph_id, float em_scale)
 
vector2 otype_kern_find (std::span< std::byte const > bytes, glyph_id first_glyph_id, glyph_id second_glyph_id, float em_scale)
 
std::pair< size_t, size_t > otype_loca16_get (std::span< std::byte const > bytes, hi::glyph_id glyph_id)
 
std::pair< size_t, size_t > otype_loca32_get (std::span< std::byte const > bytes, hi::glyph_id glyph_id)
 
std::pair< size_t, size_t > otype_loca_get (std::span< std::byte const > loca_bytes, hi::glyph_id glyph_id, bool loca_is_offset32)
 
std::span< std::byte const > otype_loca_get (std::span< std::byte const > loca_bytes, std::span< std::byte const > glyf_bytes, hi::glyph_id glyph_id, bool loca_is_offset32)
 
auto otype_maxp_parse (std::span< std::byte const > bytes)
 
std::optional< std::stringotype_name_search (std::span< std::byte const > bytes, uint16_t name_id, language_tag language=language_tag{"en"})
 Get a name from the name table.
 
auto otype_name_get_family (std::span< std::byte const > bytes)
 
auto otype_parse_os2 (std::span< std::byte const > bytes, float em_scale)
 
template<fixed_string Name>
std::span< std::byte const > otype_sfnt_search (std::span< std::byte const > bytes)
 
std::optional< std::stringotype_get_string (std::span< std::byte const > bytes, uint16_t platform_id, uint16_t platform_specific_id)
 
constexpr axis operator& (axis const &lhs, axis const &rhs) noexcept
 AND the axis.
 
constexpr axis operator| (axis const &lhs, axis const &rhs) noexcept
 OR the axis.
 
constexpr bool to_bool (axis const &rhs) noexcept
 Check if any of the axis are set.
 
aarectangle fit (aarectangle const &bounds, aarectangle const &rectangle) noexcept
 Make a rectangle fit inside bounds.
 
aarectanglei fit (aarectanglei const &bounds, aarectanglei const &rectangle) noexcept
 Make a rectangle fit inside bounds.
 
template<>
constexpr aarectanglei narrow_cast (aarectangle const &rhs) noexcept
 
template<>
constexpr aarectangle narrow_cast (aarectanglei const &rhs) noexcept
 
template<>
constexpr extent2i narrow_cast (extent2 const &rhs) noexcept
 
template<>
constexpr extent2 narrow_cast (extent2i const &rhs) noexcept
 
template<>
constexpr marginsi narrow_cast (margins const &rhs) noexcept
 
template<>
constexpr margins narrow_cast (marginsi const &rhs) noexcept
 
std::string_view to_string (gui_event_type rhs) noexcept
 Convert a GUI event type to a string.
 
constexpr gui_event_type to_gui_event_type (std::string_view name) noexcept
 Convert a name to a GUI event type.
 
constexpr gui_event_variant to_gui_event_variant (gui_event_type type) noexcept
 Convert a gui event type, to an gui event variant.
 
template<typename T , typename Allocator = std::allocator<std::remove_const_t<T>>>
 pixmap (pixmap_span< T > const &other, Allocator allocator=std::allocator{}) -> pixmap< std::remove_const_t< T > >
 
template<typename T , typename Allocator >
 pixmap_span (pixmap< T, Allocator > const &other) -> pixmap_span< T const >
 
template<typename T , typename Allocator >
 pixmap_span (pixmap< T, Allocator > &other) -> pixmap_span< T >
 
template<std::input_iterator It, std::input_iterator ItEnd>
 lean_vector (It first, ItEnd last) -> lean_vector< typename std::iterator_traits< It >::value_type >
 
template<size_t LookaheadCount, typename Iterator >
auto make_lookahead_iterator (Iterator &&it) noexcept
 
template<typename Functor >
void process_call (Functor &&functor, std::string_view data)
 Call a function in a new process.
 
template<size_t Index, typename Type >
constexpr decltype(auto) get_data_member (Type &&rhs) noexcept
 
template<typename T >
constexpr auto type_name () noexcept
 
void terminate_handler () noexcept
 The HikoGUI terminate handler.
 
constexpr bool is_Pattern_White_Space (char32_t c) noexcept
 Check if a character has Pattern_White_Space property.
 
constexpr bool is_Pattern_Syntax (char32_t c) noexcept
 Check if a character has Pattern_Syntax property.
 
constexpr bool is_Other_ID_Start (char32_t c) noexcept
 Check if a character has Other_ID_Start property.
 
constexpr bool is_Other_ID_Continue (char32_t c) noexcept
 Check if a character has Other_ID_Continue property.
 
constexpr bool is_ID_Start (char32_t c) noexcept
 Check if this character starts an Annex #31 Identifier.
 
constexpr bool is_ID_Continue (char32_t c) noexcept
 Check if this character continues an Annex #31 Identifier.
 
constexpr bool bound_check (std::unsigned_integral auto index, std::unsigned_integral auto upper) noexcept
 Check if an unsigned index is less than the bound.
 
constexpr bool bound_check (std::integral auto index, std::integral auto lower, std::integral auto upper) noexcept
 Check if an index is between the lower (inclusive) and upper (exclusive).
 
constexpr bool bound_check (std::integral auto index, bound_check_range_helper auto &&range) noexcept
 Check if an index is within a range.
 
constexpr unsigned long long from_string_literal (std::string_view str)
 
template<std::integral T>
std::string to_string (T const &value) noexcept
 Convert integer to string.
 
template<std::integral T>
from_string (std::string_view str, int base=10)
 Convert a string to an integer.
 
template<std::floating_point T>
from_string (std::string_view str)
 Convert a string to an floating point.
 
template<arithmetic Lhs, arithmetic Rhs>
constexpr auto three_way_compare (Lhs const &lhs, Rhs const &rhs) noexcept
 Safely compare two arithmetic values to each other.
 
void prepare_debug_break () noexcept
 Prepare for breaking in the debugger.
 
std::string get_last_error_message () noexcept
 Get the OS error message from the last error received on this thread.
 
constexpr std::size_t operator""_uz (unsigned long long lhs) noexcept
 
constexpr std::size_t operator""_zu (unsigned long long lhs) noexcept
 
constexpr std::ptrdiff_t operator""_z (unsigned long long lhs) noexcept
 
template<typename T , typename U >
bool compare_store (T &lhs, U &&rhs) noexcept
 Compare then store if there was a change.
 
template<typename T , typename U >
bool compare_store (std::atomic< T > &lhs, U &&rhs) noexcept
 Compare then store if there was a change.
 
template<class T , class U >
constexpr auto && forward_like (U &&x) noexcept
 
std::wstring win32_string_to_wstring (std::string_view s)
 Convert a UTF-8 std::string to a win32-API compatible std::wstring.
 
std::string win32_wstring_to_string (std::wstring_view s)
 Convert a win32-API compatible std::wstring to a UTF-8 std::string.
 
std::shared_ptr< button_delegatemake_default_radio_button_delegate (auto &&value, auto &&on_value) noexcept
 Make a shared pointer to a radio-button delegate.
 
std::shared_ptr< button_delegatemake_default_toggle_button_delegate (auto &&value, auto &&...args) noexcept
 Make a shared pointer to a toggle-button delegate.
 
std::shared_ptr< selection_delegatemake_default_selection_delegate (auto &&value, auto &&options, auto &&...off_value) noexcept
 Create a shared pointer to a default selection delegate.
 
std::shared_ptr< tab_delegatemake_default_tab_delegate (auto &&value) noexcept
 Create a shared pointer to a default tab delegate.
 
std::shared_ptr< text_delegatemake_default_text_delegate (auto &&value) noexcept
 Create a shared pointer to a default text delegate.
 
std::shared_ptr< text_field_delegatemake_default_text_field_delegate (auto &&value) noexcept
 Create a shared pointer to a default text delegate.
 
widgetget_if (widget *start, widget_id id, bool include_invisible) noexcept
 
widgetget (widget &start, widget_id id, bool include_invisible)
 

Variables

constexpr matrix3 Rec2020_to_XYZ = color_primaries_to_RGBtoXYZ(0.3127f, 0.3290f, 0.708f, 0.292f, 0.170f, 0.797f, 0.131f, 0.046f)
 Rec.2020 to XYZ color space conversion matrix.
 
constexpr matrix3 XYZ_to_Rec2020 = ~Rec2020_to_XYZ
 XYZ to Rec.2020 color space conversion matrix.
 
constexpr matrix3 Rec2100_to_XYZ = Rec2020_to_XYZ
 Rec.2100 to XYZ color space conversion matrix.
 
constexpr matrix3 XYZ_to_Rec2100 = XYZ_to_Rec2020
 XYZ to Rec.2100 color space conversion matrix.
 
constexpr auto semantic_color_metadata
 
constexpr matrix3 sRGB_to_XYZ
 Matrix to convert sRGB to XYZ.
 
constexpr matrix3 XYZ_to_sRGB
 Matrix to convert XYZ to sRGB.
 
std::atomic< global_state_typeglobal_state = global_state_type::log_level_default
 The global state of the hikogui framework.
 
constexpr std::size_t maximum_num_cpus = 64
 
constexpr auto gui_event_type_metadata
 
template<lexer_config Config>
constexpr auto lexer = detail::lexer<Config>()
 
log log_global
 
template<typename T >
constexpr size_t number_of_data_members_v = number_of_data_members<T>::value
 
std::terminate_handler old_terminate_handler
 The old terminate handler.
 
std::atomic< char const * > terminate_message = nullptr
 Message to show when the application is terminated.
 

Detailed Description

The HikoGUI API version 1.

Typedef Documentation

◆ matrix2

A 2D homogenious transformation matrix.

◆ matrix3

A 3D homogenious transformation matrix.

◆ ssize_t

Signed size/index into an array.

Enumeration Type Documentation

◆ border_side

enum class hi::v1::border_side
strong

The side where the border is drawn.

Enumerator
on 

The border is drawn on the edge of a quad.

inside 

The border is drawn inside the edge of a quad.

outside 

The border is drawn outside the edge of a quad.

Function Documentation

◆ bound_check() [1/3]

constexpr bool hi::v1::bound_check ( std::integral auto index,
bound_check_range_helper auto && range )
constexprnoexcept

Check if an index is within a range.

Parameters
indexThe index to check.
rangeThe range object, such as a vector or array, which has a std::ranges::size().
Returns
true If index natural and below the size of the array.

◆ bound_check() [2/3]

constexpr bool hi::v1::bound_check ( std::integral auto index,
std::integral auto lower,
std::integral auto upper )
constexprnoexcept

Check if an index is between the lower (inclusive) and upper (exclusive).

Note
It is undefined behavior when upper is lower than lower.
Parameters
indexThe index to check.
lowerThe lower bound.
upperThe upper bound.
Returns
true If index is greater or equal to lower bound and index is less than upper bound.

◆ bound_check() [3/3]

constexpr bool hi::v1::bound_check ( std::unsigned_integral auto index,
std::unsigned_integral auto upper )
constexprnoexcept

Check if an unsigned index is less than the bound.

Parameters
indexThe unsigned index to check.
upperThe upper bound.
Returns
true If index is less than the upper bound.

◆ compare_store() [1/2]

template<typename T , typename U >
bool hi::v1::compare_store ( std::atomic< T > & lhs,
U && rhs )
noexcept

Compare then store if there was a change.

Note
This atomic version does an lhs.exchange(rhs, std::memory_order_relaxed)
Returns
true if a store was executed.

◆ compare_store() [2/2]

template<typename T , typename U >
bool hi::v1::compare_store ( T & lhs,
U && rhs )
noexcept

Compare then store if there was a change.

Returns
true if a store was executed.

◆ fit() [1/2]

aarectangle hi::v1::fit ( aarectangle const & bounds,
aarectangle const & rectangle )
noexcept

Make a rectangle fit inside bounds.

This algorithm will try to first move the rectangle and resist resizing it.

Parameters
boundsThe bounding box.
rectangleThe rectangle to fit inside the bounds.
Returns
A rectangle that fits inside the bounds

◆ fit() [2/2]

aarectanglei hi::v1::fit ( aarectanglei const & bounds,
aarectanglei const & rectangle )
noexcept

Make a rectangle fit inside bounds.

This algorithm will try to first move the rectangle and resist resizing it.

Parameters
boundsThe bounding box.
rectangleThe rectangle to fit inside the bounds.
Returns
A rectangle that fits inside the bounds

◆ from_string() [1/2]

template<std::floating_point T>
T hi::v1::from_string ( std::string_view str)

Convert a string to an floating point.

This function bypasses std::locale

Template Parameters
TThe integer type.
Parameters
strThe string is an integer.
Returns
The integer converted from a string.

◆ from_string() [2/2]

template<std::integral T>
T hi::v1::from_string ( std::string_view str,
int base = 10 )

Convert a string to an integer.

This function bypasses std::locale

Template Parameters
TThe integer type.
Parameters
strThe string is an integer.
baseThe base radix of the string encoded integer.
Returns
The integer converted from a string.

◆ get_last_error_message()

std::string hi::v1::get_last_error_message ( )
noexcept

Get the OS error message from the last error received on this thread.

◆ is_ID_Continue()

constexpr bool hi::v1::is_ID_Continue ( char32_t c)
constexprnoexcept

Check if this character continues an Annex #31 Identifier.

◆ is_ID_Start()

constexpr bool hi::v1::is_ID_Start ( char32_t c)
constexprnoexcept

Check if this character starts an Annex #31 Identifier.

◆ is_Other_ID_Continue()

constexpr bool hi::v1::is_Other_ID_Continue ( char32_t c)
constexprnoexcept

Check if a character has Other_ID_Continue property.

According to annex31 this list will never change

◆ is_Other_ID_Start()

constexpr bool hi::v1::is_Other_ID_Start ( char32_t c)
constexprnoexcept

Check if a character has Other_ID_Start property.

According to annex31 this list will never change

◆ is_Pattern_Syntax()

constexpr bool hi::v1::is_Pattern_Syntax ( char32_t c)
constexprnoexcept

Check if a character has Pattern_Syntax property.

According to annex31 this list will never change

◆ is_Pattern_White_Space()

constexpr bool hi::v1::is_Pattern_White_Space ( char32_t c)
constexprnoexcept

Check if a character has Pattern_White_Space property.

According to annex31 this list will never change

◆ otype_kern_v0_find()

vector2 hi::v1::otype_kern_v0_find ( std::span< std::byte const > bytes,
glyph_id first_glyph_id,
glyph_id second_glyph_id,
float em_scale )
inline

'kern' version 0 find.

'kern' version 0 is used by Microsoft and is not in use anymore by Apple. However it is part of open-type.

◆ otype_name_search()

std::optional< std::string > hi::v1::otype_name_search ( std::span< std::byte const > bytes,
uint16_t name_id,
language_tag language = language_tag{"en"} )
inline

Get a name from the name table.

Parameters
bytesThe bytes of the name table.
name_idThe name to find a string for.
languageThe language to find the string for (default "en").
Returns
The string of the name was found, or std::nullopt if not found.

◆ prepare_debug_break()

void hi::v1::prepare_debug_break ( )
noexcept

Prepare for breaking in the debugger.

This will check if a debugger exists and potentially launch the Just-In-Time debugger if one is configured. This function may terminate the application if no debugger is found.

It does not do the actual breaking.

◆ process_call()

template<typename Functor >
void hi::v1::process_call ( Functor && functor,
std::string_view data )

Call a function in a new process.

Parameters
functorA functor void(std::string_view) to call in a different process. You can pass for example a non-capturing lambda
dataData to pass to the functor.

◆ terminate_handler()

void hi::v1::terminate_handler ( )
noexcept

The HikoGUI terminate handler.

This handler will print an error message on the console or pop-up a dialogue box.

Note
Use hi_set_terminate_message() to set a message.

◆ three_way_compare()

template<arithmetic Lhs, arithmetic Rhs>
constexpr auto hi::v1::three_way_compare ( Lhs const & lhs,
Rhs const & rhs )
constexprnoexcept

Safely compare two arithmetic values to each other.

Parameters
lhsThe left-hand-side arithmetic value.
rhsThe right-hand-side arithmetic value.
Returns
A std::strong_ordering or std::weak_ordering of the lhs and rhs.

◆ to_gui_event_type()

constexpr gui_event_type hi::v1::to_gui_event_type ( std::string_view name)
constexprnoexcept

Convert a name to a GUI event type.

◆ to_string() [1/2]

std::string_view hi::v1::to_string ( gui_event_type rhs)
inlinenoexcept

Convert a GUI event type to a string.

◆ to_string() [2/2]

template<std::integral T>
std::string hi::v1::to_string ( T const & value)
noexcept

Convert integer to string.

Convert floating point to string.

This function bypasses std::locale.

Parameters
valueThe signed or unsigned integer value.
Returns
The integer converted to a decimal string.

◆ win32_string_to_wstring()

std::wstring hi::v1::win32_string_to_wstring ( std::string_view s)
inline

Convert a UTF-8 std::string to a win32-API compatible std::wstring.

◆ win32_wstring_to_string()

std::string hi::v1::win32_wstring_to_string ( std::wstring_view s)
inline

Convert a win32-API compatible std::wstring to a UTF-8 std::string.

Variable Documentation

◆ old_terminate_handler

std::terminate_handler hi::v1::old_terminate_handler
inline

The old terminate handler.

This is the handler returned by std::set_terminate().

◆ semantic_color_metadata

constexpr auto hi::v1::semantic_color_metadata
constexpr
Initial value:
= enum_metadata{
semantic_color::blue, "blue",
semantic_color::green, "green",
semantic_color::indigo, "indigo",
semantic_color::orange, "orange",
semantic_color::pink, "pink",
semantic_color::purple, "purple",
semantic_color::red, "red",
semantic_color::teal, "teal",
semantic_color::yellow, "yellow",
semantic_color::gray, "gray",
semantic_color::gray2, "gray2",
semantic_color::gray3, "gray3",
semantic_color::gray4, "gray4",
semantic_color::gray5, "gray5",
semantic_color::gray6, "gray6",
semantic_color::foreground, "foreground",
semantic_color::border, "border",
semantic_color::fill, "fill",
semantic_color::accent, "accent",
semantic_color::text_select, "text-select",
semantic_color::primary_cursor, "primary-cursor",
semantic_color::secondary_cursor, "secondary-cursor",
}

◆ terminate_message

std::atomic<char const *> hi::v1::terminate_message = nullptr
inline

Message to show when the application is terminated.