7#include "gui_window_size.hpp"
8#include "mouse_cursor.hpp"
11#include "keyboard_focus_direction.hpp"
12#include "keyboard_focus_group.hpp"
15#include "../geometry/axis_aligned_rectangle.hpp"
19#include "../chrono.hpp"
21#include "../animator.hpp"
22#include <unordered_set>
26namespace hi::inline
v1 {
31class keyboard_bindings;
62 mouse_cursor current_mouse_cursor = mouse_cursor::None;
68 bool resizing =
false;
127 virtual
void render(utc_nanoseconds displayTimePoint);
133 [[nodiscard]] grid_widget& content() noexcept
137 return widget->content();
144 [[nodiscard]] toolbar_widget&
toolbar() noexcept
148 return widget->toolbar();
184 gui_window_size size_state() const noexcept
199 void update_mouse_target(
hi::widget const *new_target_widget,
point2 position = {})
noexcept;
243 virtual
void put_text_on_clipboard(
std::string_view
text) const noexcept = 0;
245 [[nodiscard]]
translate2 window_to_screen() const noexcept
250 [[nodiscard]]
translate2 screen_to_window() const noexcept
252 return ~window_to_screen();
275 gui_window_size _size_state = gui_window_size::normal;
288 utc_nanoseconds last_forced_redraw = {};
292 animator<float> _animated_active = _animation_duration;
297 virtual void create_window(extent2 new_size) = 0;
300 notifier<>::callback_token _setting_change_token;
301 observer<std::string>::callback_token _selected_theme_token;
307 hi::widget const *_mouse_target_widget =
nullptr;
312 hi::widget const *_keyboard_target_widget =
nullptr;
318 void remove_keyboard_and_mouse_target(
hi::widget const *sender)
noexcept
320 if (_mouse_target_widget == sender) {
321 _mouse_target_widget =
nullptr;
323 if (_keyboard_target_widget == sender) {
324 _keyboard_target_widget =
nullptr;
#define hi_axiom(expression)
Specify an axiom; an expression that is true.
Definition assert.hpp:133
#define hi_assert_not_null(x)
Assert if an expression is not nullptr.
Definition assert.hpp:118
Functionality for labels, text and icons.
Definition of GUI event types.
DOXYGEN BUG.
Definition algorithm.hpp:15
subpixel_orientation
The orientation of the RGB sub-pixels of and LCD/LED panel.
Definition subpixel_orientation.hpp:18
keyboard_focus_direction
The keyboard focus group used for finding a widget that will accept a particular focus.
Definition keyboard_focus_direction.hpp:11
unicode_bidi_class
Bidirectional class Unicode Standard Annex #9: https://unicode.org/reports/tr9/.
Definition unicode_bidi_class.hpp:17
keyboard_focus_group
The keyboard focus group used for finding a widget that will accept a particular focus.
Definition keyboard_focus_group.hpp:11
The HikoGUI namespace.
Definition ascii.hpp:19
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:20
A rectangle / parallelogram in 3D space.
Definition rectangle.hpp:20
Definition translate.hpp:15
Definition gfx_device.hpp:22
Graphics system.
Definition gui_system.hpp:30
Definition gui_window.hpp:38
hi::keyboard_bindings const & keyboard_bindings() const noexcept
Get the keyboard binding.
void update_keyboard_target(hi::widget const *widget, keyboard_focus_group group=keyboard_focus_group::normal) noexcept
Change the keyboard focus to the given widget.
virtual void set_cursor(mouse_cursor cursor)=0
Set the mouse cursor icon.
virtual void open_system_menu()=0
Open the system menu of the window.
void update_keyboard_target(keyboard_focus_group group, keyboard_focus_direction direction) noexcept
Change the keyboard focus to the given, previous or next widget.
void update_keyboard_target(hi::widget const *widget, keyboard_focus_group group, keyboard_focus_direction direction) noexcept
Change the keyboard focus to the previous or next widget from the given widget.
toolbar_widget & toolbar() noexcept
Get a reference to window's toolbar widget.
Definition gui_window.hpp:144
virtual void set_size_state(gui_window_size state) noexcept=0
Set the size-state of the window.
aarectangle rectangle
The current rectangle of the window relative to the screen.
Definition gui_window.hpp:53
extent2 widget_size
The size of the widget.
Definition gui_window.hpp:90
virtual std::optional< std::string > get_text_from_clipboard() const noexcept=0
Get text from the clipboard.
std::unique_ptr< window_widget > widget
The widget covering the complete window.
Definition gui_window.hpp:94
virtual void init()
2 phase constructor.
notifier< void()> closing
Notifier used when the window is closing.
Definition gui_window.hpp:99
virtual void close_window()=0
Ask the operating system to close this window.
virtual void set_window_size(extent2 extent)=0
Ask the operating system to set the size of this window.
virtual aarectangle workspace_rectangle() const noexcept=0
The rectangle of the workspace of the screen where the window is currently located.
bool process_event(gui_event const &event) noexcept
Process the event.
A variant of text.
Definition label.hpp:36
A label consisting of localizable text and an icon.
Definition label.hpp:124
A notifier which can be used to call a set of registered callbacks.
Definition notifier.hpp:26
An interactive graphical object as part of the user-interface.
Definition widget.hpp:45