HikoGUI
A low latency retained GUI
|
Public Member Functions | |
gui_window (gui_window const &)=delete | |
gui_window & | operator= (gui_window const &)=delete |
gui_window (gui_window &&)=delete | |
gui_window & | operator= (gui_window &&)=delete |
gui_window (std::unique_ptr< widget_intf > widget) noexcept | |
template<typename Widget > | |
Widget & | widget () const noexcept |
void | set_title (label title) noexcept |
void | render (utc_nanoseconds display_time_point) |
Update window. | |
void | set_cursor (mouse_cursor cursor) noexcept |
Set the mouse cursor icon. | |
void | close_window () |
Ask the operating system to close this window. | |
void | set_size_state (gui_window_size state) noexcept |
Set the size-state of the window. | |
aarectangle | workspace_rectangle () const noexcept |
The rectangle of the workspace of the screen where the window is currently located. | |
aarectangle | fullscreen_rectangle () const noexcept |
The rectangle of the screen where the window is currently located. | |
gui_window_size | size_state () const noexcept |
Get the size-state of the window. | |
hi::subpixel_orientation | subpixel_orientation () const noexcept |
void | open_system_menu () |
Open the system menu of the window. | |
void | set_window_size (extent2 new_extent) |
Ask the operating system to set the size of this window. | |
void | update_mouse_target (widget_id new_target_id, point2 position={}) noexcept |
void | update_keyboard_target (widget_id new_target_id, keyboard_focus_group group=keyboard_focus_group::normal) noexcept |
Change the keyboard focus to the given widget. | |
void | update_keyboard_target (widget_id start_widget, keyboard_focus_group group, keyboard_focus_direction direction) noexcept |
Change the keyboard focus to the previous or next widget from the given widget. | |
void | update_keyboard_target (keyboard_focus_group group, keyboard_focus_direction direction) noexcept |
Change the keyboard focus to the given, previous or next widget. | |
std::optional< gstring > | get_text_from_clipboard () const noexcept |
Get text from the clipboard. | |
void | put_text_on_clipboard (gstring_view text) const noexcept |
Put text on the clipboard. | |
translate2 | window_to_screen () const noexcept |
translate2 | screen_to_window () const noexcept |
bool | process_event (gui_event event) noexcept |
Process the event. | |
Data Fields | |
HWND | win32Window = nullptr |
std::unique_ptr< gfx_surface > | surface |
aarectangle | rectangle |
The current rectangle of the window relative to the screen. | |
mouse_cursor | current_mouse_cursor = mouse_cursor::None |
The current cursor. | |
bool | resizing = false |
hi::pixel_density | pixel_density = {pixels_per_inch(96.0f), device_type::desktop} |
Pixel density of the screen where the window is located. | |
hi::theme | theme = {} |
Theme to use to draw the widgets on this window. | |
extent2 | widget_size |
The size of the widget. | |
notifier< void()> | closing |
Notifier used when the window is closing. | |
|
inline |
Ask the operating system to close this window.
|
inlinenoexcept |
The rectangle of the screen where the window is currently located.
|
inlinenoexcept |
Get text from the clipboard.
empty | When the clipboard is locked by another application, on error, if the data on the clipboard can not be converted to text or if the clipboard is empty. |
|
inline |
Open the system menu of the window.
On windows 10 this is activated by pressing Alt followed by Spacebar.
|
inlinenoexcept |
Process the event.
This is called by the event handler to start processing events. The events are translated and then uses send_event_to_widget()
to send the events to the widgets in some priority ordering.
It may also be called from within the event_handle()
of widgets.
|
inlinenoexcept |
Put text on the clipboard.
text | The text to place on the clipboard. |
|
inline |
Update window.
This will update animations and redraw all widgets managed by this window.
|
inlinenoexcept |
Set the mouse cursor icon.
|
inlinenoexcept |
Set the size-state of the window.
This function is used to change the size of the window to one of the predefined states: normal, minimized, maximized or full-screen.
|
inline |
Ask the operating system to set the size of this window.
|
inlinenoexcept |
Get the size-state of the window.
|
inlinenoexcept |
Change the keyboard focus to the given, previous or next widget.
This function will find the closest widget from the current widget which belongs to the given group; if none is found, or if the original selected widget is found, then no widget will be in focus.
group | The group the widget must belong to. |
direction | The direction to search in, or current to select the current widget. |
|
inlinenoexcept |
Change the keyboard focus to the given widget.
If the group of the widget is incorrect then no widget will be in focus.
widget | The new widget to focus, or empty to remove all keyboard focus. |
group | The group the widget must belong to. |
|
inlinenoexcept |
Change the keyboard focus to the previous or next widget from the given widget.
This function will find the closest widget from the given widget which belongs to the given group; if none is found, or if the original selected widget is found, then no widget will be in focus.
start_widget | The widget to use as the start point for a new widget to select. |
group | The group the widget must belong to. |
direction | The direction to search in, or current to select the current widget. |
|
inlinenoexcept |
The rectangle of the workspace of the screen where the window is currently located.
notifier<void()> v1::gui_window::closing |
Notifier used when the window is closing.
It is expected that after notifying these callbacks the instance of this class is destroyed.
mouse_cursor v1::gui_window::current_mouse_cursor = mouse_cursor::None |
The current cursor.
Used for optimizing when the operating system cursor is updated. Set to mouse_cursor::None at the start (for the wait icon) and when the operating system is going to display another icon to make sure when it comes back in the application the cursor will be updated correctly.
hi::pixel_density v1::gui_window::pixel_density = {pixels_per_inch(96.0f), device_type::desktop} |
Pixel density of the screen where the window is located.
If the window is located on multiple screens then one of the screens is used as the source for the pixel-density.
aarectangle v1::gui_window::rectangle |
The current rectangle of the window relative to the screen.
The screen rectangle is set by the operating system event loop.
This rectangle is used by the operating system event loop hit-testing to determine the position of screen coordinates to window coordinates.
The size of this rectangle is used to laying out widgets and setting the size of the gfx_surface during rendering.
bool v1::gui_window::resizing = false |
The window is currently being resized by the user. We can disable expensive redraws during rendering until this is false again.
hi::theme v1::gui_window::theme = {} |
Theme to use to draw the widgets on this window.
The sizes and colors of the theme have already been adjusted to the window's state and ppi.
extent2 v1::gui_window::widget_size |
The size of the widget.