HikoGUI
A low latency retained GUI
|
#include <hikogui/GUI/widget_state.hpp>
Public Member Functions | |
constexpr | widget_state (widget_state const &) noexcept=default |
constexpr | widget_state (widget_state &&) noexcept=default |
constexpr widget_state & | operator= (widget_state const &) noexcept=default |
constexpr widget_state & | operator= (widget_state &&) noexcept=default |
constexpr widget_mode | mode () const noexcept |
Get the mode of a widget. | |
constexpr widget_state & | set_mode (widget_mode mode) noexcept |
Set the mode of a widget. | |
constexpr size_t | layer () const noexcept |
Get the layer of a widget. | |
constexpr widget_state & | set_layer (size_t layer) noexcept |
Set the layer of the widget. | |
constexpr widget_value | value () const noexcept |
Get the value of the widget. | |
constexpr widget_state & | set_value (widget_value value) noexcept |
Set the value of the widget. | |
constexpr widget_phase | phase () const noexcept |
Get the phase of the widget. | |
constexpr widget_state & | set_pressed (bool pressed) noexcept |
Set if the mouse/finger presses the widget. | |
constexpr widget_state & | set_hover (bool hover) noexcept |
Set if the mouse hovers over the widget. | |
constexpr widget_state & | set_active (bool active) noexcept |
Set if the window is active widget. | |
constexpr bool | focus () const noexcept |
Get if the window has keyboard focus. | |
constexpr widget_state & | set_focus (bool focus) noexcept |
Set if the window has keyboard focus. | |
template<std::integral T> requires (sizeof(T) >= 2) | |
constexpr | operator T () const noexcept |
Get the numeric value of the window state. | |
constexpr widget_state & | operator++ () noexcept |
Increment the widget-state. | |
Static Public Member Functions | |
static constexpr widget_state | begin () noexcept |
Start of the iteration of all possible widget states. | |
static constexpr widget_state | end () noexcept |
End of the iteration of all possible widget states. | |
static constexpr size_t | size () noexcept |
The number if possible widget states. | |
Friends | |
constexpr friend bool | operator== (widget_state const &lhs, widget_state const &rhs) noexcept |
constexpr friend bool | need_reconstrain (widget_state const &lhs, widget_state const &rhs) noexcept |
Check if the change in widget-state requires the widget to reconstrain. | |
constexpr friend bool | need_relayout (widget_state const &lhs, widget_state const &rhs) noexcept |
Check if the change in widget-state requires the widget to relayout. | |
constexpr friend bool | need_redraw (widget_state const &lhs, widget_state const &rhs) noexcept |
Check if the change in widget-state requires the widget to redraw. | |
The state the widget is in.
The numeric value of the state is used as an index into theme-values to select the appropriate visual style.
|
inlinestaticconstexprnoexcept |
Start of the iteration of all possible widget states.
|
inlinestaticconstexprnoexcept |
End of the iteration of all possible widget states.
|
inlineconstexprnoexcept |
Get if the window has keyboard focus.
|
inlineconstexprnoexcept |
Get the layer of a widget.
The layer between 0 and 3 is used to determine how to visual distinct widget at different nesting levels.
|
inlineconstexprnoexcept |
Get the mode of a widget.
|
inlineexplicitconstexprnoexcept |
Get the numeric value of the window state.
The numeric value is used for indexing into theme tables for quick lookup of, for example, the background color of the widget in a certain state.
|
inlineconstexprnoexcept |
Increment the widget-state.
This is used to iterate over each unique widget_state, to fill in the theme tables.
|
inlineconstexprnoexcept |
Get the phase of the widget.
|
inlineconstexprnoexcept |
Set if the window is active widget.
|
inlineconstexprnoexcept |
Set if the window has keyboard focus.
|
inlineconstexprnoexcept |
Set if the mouse hovers over the widget.
|
inlineconstexprnoexcept |
Set the layer of the widget.
layer | The layer is modulo 4. |
|
inlineconstexprnoexcept |
Set the mode of a widget.
|
inlineconstexprnoexcept |
Set if the mouse/finger presses the widget.
|
inlineconstexprnoexcept |
Set the value of the widget.
|
inlinestaticconstexprnoexcept |
The number if possible widget states.
|
inlineconstexprnoexcept |
Get the value of the widget.
|
friend |
Check if the change in widget-state requires the widget to reconstrain.
|
friend |
Check if the change in widget-state requires the widget to redraw.
|
friend |
Check if the change in widget-state requires the widget to relayout.