HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes
v1::gui_system Class Reference

#include <hikogui/GUI/gui_system.hpp>

Inheritance diagram for v1::gui_system:
v1::gui_system_win32

Public Member Functions

 gui_system (const gui_system &)=delete
 
gui_systemoperator= (const gui_system &)=delete
 
 gui_system (gui_system &&)=delete
 
gui_systemoperator= (gui_system &&)=delete
 
virtual void init () noexcept
 Initialize after construction.
 
virtual void deinit () noexcept
 
void set_delegate (std::weak_ptr< gui_system_delegate > delegate) noexcept
 
std::shared_ptr< gui_windowadd_window (std::shared_ptr< gui_window > window)
 
std::shared_ptr< gui_windowmake_window_with_widget (std::unique_ptr< widget_intf > widget)
 Create a new window with the specified managing widget.
 
template<std::derived_from< widget_intf > Widget, typename... Args>
std::pair< std::shared_ptr< gui_window >, Widget & > make_window (Args &&...args)
 Create a new window.
 
void request_reconstrain () noexcept
 Request all windows to constrain.
 

Static Public Member Functions

static std::unique_ptr< gui_systemmake_unique (std::weak_ptr< gui_system_delegate > delegate={}) noexcept
 Make a gui_system instance.
 

Data Fields

std::unique_ptr< gfx_systemgfx
 
std::unique_ptr< hi::theme_book > theme_book
 
std::unique_ptr< hi::keyboard_bindings > keyboard_bindings
 
thread_id const thread_id
 
observer< std::stringselected_theme = "default"
 The name of the selected theme.
 

Static Public Attributes

static os_handle instance
 

Detailed Description

Graphics system.

Member Function Documentation

◆ init()

virtual void v1::gui_system::init ( )
inlinevirtualnoexcept

Initialize after construction.

Call this function directly after the constructor on the same thread.

◆ make_unique()

static std::unique_ptr< gui_system > v1::gui_system::make_unique ( std::weak_ptr< gui_system_delegate > delegate = {})
staticnoexcept

Make a gui_system instance.

This will instantiate a gui_system instance appropriate for the current operating system.

Parameters
delegateAn optional delegate.
Returns
A unique pointer to a gui_system instance.

◆ make_window()

template<std::derived_from< widget_intf > Widget, typename... Args>
std::pair< std::shared_ptr< gui_window >, Widget & > v1::gui_system::make_window ( Args &&... args)
inline

Create a new window.

Template Parameters
WidgetThe type of widget to create to manage the window.
Parameters
argsThe arguments that are forwarded to the constructor of the managing widget that is created.
Returns
A owning pointer to the new window. releasing the pointer will close the window.

◆ make_window_with_widget()

std::shared_ptr< gui_window > v1::gui_system::make_window_with_widget ( std::unique_ptr< widget_intf > widget)
inline

Create a new window with the specified managing widget.

Parameters
widgetThe widget that manages the window.
Returns
A owning pointer to the new window. releasing the pointer will close the window.

◆ request_reconstrain()

void v1::gui_system::request_reconstrain ( )
noexcept

Request all windows to constrain.

Field Documentation

◆ selected_theme

observer<std::string> v1::gui_system::selected_theme = "default"

The name of the selected theme.


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