HikoGUI
A low latency retained GUI
|
#include <hikogui/GUI/widget_layout.hpp>
Public Member Functions | |
constexpr | widget_layout (widget_layout const &) noexcept=default |
constexpr | widget_layout (widget_layout &&) noexcept=default |
constexpr widget_layout & | operator= (widget_layout const &) noexcept=default |
constexpr widget_layout & | operator= (widget_layout &&) noexcept=default |
constexpr | widget_layout (extent2 window_size, gui_window_size window_size_state, hi::subpixel_orientation subpixel_orientation, utc_nanoseconds display_time_point) noexcept |
Construct a widget_layout from inside the window. | |
constexpr bool | empty () const noexcept |
constexpr | operator bool () const noexcept |
constexpr translate3 | to_window3 () const noexcept |
constexpr bool | contains (point3 mouse_position) const noexcept |
Check if the mouse position is inside the widget. | |
constexpr aarectangle | rectangle () const noexcept |
constexpr aarectangle | rectangle_on_window () const noexcept |
Get the rectangle in window coordinate system. | |
constexpr aarectangle | clipping_rectangle_on_window () const noexcept |
Get the clipping rectangle in window coordinate system. | |
constexpr aarectangle | clipping_rectangle_on_window (aarectangle narrow_clipping_rectangle) const noexcept |
Get the clipping rectangle in window coordinate system. | |
constexpr float | width () const noexcept |
constexpr float | height () const noexcept |
constexpr extent2 | size () const noexcept |
constexpr widget_layout | transform (box_shape const &child_shape, transform_command command, aarectangle new_clipping_rectangle) const noexcept |
Create a new widget_layout for the child widget. | |
constexpr widget_layout | transform (box_shape const &child_shape, transform_command command=transform_command::increment) const noexcept |
Create a new widget_layout for the child widget. | |
constexpr widget_layout | transform (box_shape const &child_shape, aarectangle new_clipping_rectangle) const noexcept |
Create a new widget_layout for the child widget. | |
constexpr widget_layout | override_clip (aarectangle new_clipping_rectangle) const noexcept |
Override e context with the new clipping rectangle. | |
Data Fields | |
box_shape | shape |
Shape of the widget. | |
translate2 | to_parent = {} |
This matrix transforms local coordinates to the coordinates of the parent widget. | |
translate2 | from_parent = {} |
This matrix transforms parent widget's coordinates to local coordinates. | |
translate2 | to_window = {} |
This matrix transforms local coordinates to window coordinates. | |
translate2 | from_window = {} |
This matrix transforms window coordinates to local coordinates. | |
extent2 | window_size = {} |
Size of the window. | |
gui_window_size | window_size_state = gui_window_size::normal |
The size state of the window. | |
float | elevation = 0.0f |
The elevation of the widget above the window. | |
int | layer = 0 |
The number of visible layers above the window. | |
aarectangle | clipping_rectangle = {} |
The clipping rectangle. | |
extent2 | sub_pixel_size = {1.0f, 1.0f} |
The size of a sub-pixel. | |
utc_nanoseconds | display_time_point = {} |
The layout created for displaying at this time point. | |
Static Public Attributes | |
static constexpr int | redraw_overhang = 2 |
The amount of pixels that the redraw request will overhang the widget. | |
Friends | |
constexpr friend bool | operator== (widget_layout const &, widget_layout const &) noexcept=default |
The layout of a widget.
This object is created by a container to position a child-widget within it.
The layout includes:
|
inlineconstexprnoexcept |
Construct a widget_layout from inside the window.
|
inlineconstexprnoexcept |
Get the clipping rectangle in window coordinate system.
|
inlineconstexprnoexcept |
Get the clipping rectangle in window coordinate system.
narrow_clipping_rectangle | A clipping rectangle in local coordinate system that will be intersected with the layout's clipping rectangle. |
|
inlineconstexprnoexcept |
Check if the mouse position is inside the widget.
mouse_position | The mouse position in local coordinates. |
|
inlineconstexprnoexcept |
Override e context with the new clipping rectangle.
new_clipping_rectangle | The new clipping rectangle. |
|
inlineconstexprnoexcept |
Get the rectangle in window coordinate system.
|
inlineconstexprnoexcept |
Create a new widget_layout for the child widget.
child_shape | The location and size of the child widget, relative to the current widget. |
new_clipping_rectangle | The new clipping rectangle of the child widget, relative to the current widget. |
|
inlineconstexprnoexcept |
Create a new widget_layout for the child widget.
child_shape | The location and size of the child widget, relative to the current widget. |
command | Command to how the elevation and layer are transformed. |
new_clipping_rectangle | The new clipping rectangle of the child widget, relative to the current widget. |
|
inlineconstexprnoexcept |
Create a new widget_layout for the child widget.
child_shape | The location and size of the child widget, relative to the current widget. |
command | Command to how the elevation and layer are transformed. |
aarectangle hi::v1::widget_layout::clipping_rectangle = {} |
The clipping rectangle.
This is the rectangle that all drawing must be clipped to. This rectangle often includes the margin, as widget may draw in their own margin.
The clipping rectangle may be smaller than the widget, or even empty when the widget is scrolled outside of the aperture of a scroll widget.
utc_nanoseconds hi::v1::widget_layout::display_time_point = {} |
The layout created for displaying at this time point.
float hi::v1::widget_layout::elevation = 0.0f |
The elevation of the widget above the window.
translate2 hi::v1::widget_layout::from_parent = {} |
This matrix transforms parent widget's coordinates to local coordinates.
translate2 hi::v1::widget_layout::from_window = {} |
This matrix transforms window coordinates to local coordinates.
int hi::v1::widget_layout::layer = 0 |
The number of visible layers above the window.
The layer value is used to determine what colors are used for drawing the widget, in a nice step-pattern.
Layer is set as followed:
|
staticconstexpr |
The amount of pixels that the redraw request will overhang the widget.
Widgets are allowed to draw inside their margins, in most cases this will just be a border.
box_shape hi::v1::widget_layout::shape |
Shape of the widget.
Since a widget_layout is always in local coordinates, the left
and bottom
values are zero.
extent2 hi::v1::widget_layout::sub_pixel_size = {1.0f, 1.0f} |
The size of a sub-pixel.
translate2 hi::v1::widget_layout::to_parent = {} |
This matrix transforms local coordinates to the coordinates of the parent widget.
translate2 hi::v1::widget_layout::to_window = {} |
This matrix transforms local coordinates to window coordinates.
extent2 hi::v1::widget_layout::window_size = {} |
Size of the window.
gui_window_size hi::v1::widget_layout::window_size_state = gui_window_size::normal |
The size state of the window.