11#include "gui_window_size.hpp"
12#include "../layout/layout.hpp"
13#include "../geometry/geometry.hpp"
14#include "../time/time.hpp"
15#include "../utility/utility.hpp"
16#include "../settings/settings.hpp"
17#include "../macros.hpp"
19hi_export_module(hikogui.GUI : widget_layout);
21hi_export
namespace hi {
inline namespace v1 {
143 hi::subpixel_orientation subpixel_orientation,
158 [[nodiscard]]
constexpr bool empty() const noexcept
164 [[nodiscard]]
constexpr explicit operator bool() const noexcept
169 [[nodiscard]]
constexpr translate3 to_window3() const noexcept
179 [[nodiscard]]
constexpr bool contains(point3 mouse_position)
const noexcept
186 return shape.rectangle;
213 [[nodiscard]]
constexpr float width() const noexcept
215 return shape.width();
218 [[nodiscard]]
constexpr float height() const noexcept
220 return shape.height();
223 [[nodiscard]]
constexpr extent2 size() const noexcept
235 [[nodiscard]]
constexpr widget_layout
241 if (child_shape.baseline) {
242 r.
shape.baseline = *child_shape.baseline - child_shape.y();
244 }
else if (r.
shape.baseline) {
246 *r.
shape.baseline -= child_shape.y();
249 if (child_shape.centerline) {
250 r.
shape.centerline = *child_shape.centerline - child_shape.x();
252 }
else if (r.
shape.centerline) {
254 *r.
shape.centerline -= child_shape.x();
The HikoGUI namespace.
Definition array_generic.hpp:20
transform_command
Definition widget_layout.hpp:23
@ overlay
The child widget increases the elevation by 20 and resets the layer.
@ menu_item
The child widget increments to the next elevation but layer stays the same.
@ increment
The child widget increments to the next elevation and layer.
@ level
The child widget stays at the same elevation and layer.
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
Class which represents an axis-aligned rectangle.
Definition aarectangle.hpp:33
constexpr extent2 size() const noexcept
Get size of the rectangle.
Definition aarectangle.hpp:186
constexpr bool contains(point2 const &rhs) const noexcept
Check if a 2D coordinate is inside the rectangle.
Definition aarectangle.hpp:268
A high-level geometric extent.
Definition extent2.hpp:32
A rectangle / parallelogram in 3D space.
Definition rectangle.hpp:25
Definition translate2.hpp:18
The layout of a widget.
Definition widget_layout.hpp:56
translate2 to_parent
This matrix transforms local coordinates to the coordinates of the parent widget.
Definition widget_layout.hpp:71
utc_nanoseconds display_time_point
The layout created for displaying at this time point.
Definition widget_layout.hpp:129
constexpr widget_layout transform(box_shape const &child_shape, aarectangle new_clipping_rectangle) const noexcept
Create a new widget_layout for the child widget.
Definition widget_layout.hpp:305
constexpr aarectangle clipping_rectangle_on_window() const noexcept
Get the clipping rectangle in window coordinate system.
Definition widget_layout.hpp:198
translate2 from_parent
This matrix transforms parent widget's coordinates to local coordinates.
Definition widget_layout.hpp:75
aarectangle clipping_rectangle
The clipping rectangle.
Definition widget_layout.hpp:119
constexpr bool contains(point3 mouse_position) const noexcept
Check if the mouse position is inside the widget.
Definition widget_layout.hpp:179
float elevation
The elevation of the widget above the window.
Definition widget_layout.hpp:95
constexpr aarectangle clipping_rectangle_on_window(aarectangle narrow_clipping_rectangle) const noexcept
Get the clipping rectangle in window coordinate system.
Definition widget_layout.hpp:208
translate2 to_window
This matrix transforms local coordinates to window coordinates.
Definition widget_layout.hpp:79
int layer
The number of visible layers above the window.
Definition widget_layout.hpp:107
extent2 sub_pixel_size
The size of a sub-pixel.
Definition widget_layout.hpp:125
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.
Definition widget_layout.hpp:293
static constexpr int redraw_overhang
The amount of pixels that the redraw request will overhang the widget.
Definition widget_layout.hpp:62
translate2 from_window
This matrix transforms window coordinates to local coordinates.
Definition widget_layout.hpp:83
constexpr widget_layout override_clip(aarectangle new_clipping_rectangle) const noexcept
Override e context with the new clipping rectangle.
Definition widget_layout.hpp:315
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.
Definition widget_layout.hpp:236
extent2 window_size
Size of the window.
Definition widget_layout.hpp:87
box_shape shape
Shape of the widget.
Definition widget_layout.hpp:67
constexpr aarectangle rectangle_on_window() const noexcept
Get the rectangle in window coordinate system.
Definition widget_layout.hpp:191
gui_window_size window_size_state
The size state of the window.
Definition widget_layout.hpp:91
Definition box_shape.hpp:18