11#include "gui_window_size.hpp"
12#include "../layout/module.hpp"
13#include "../geometry/module.hpp"
14#include "../time/module.hpp"
15#include "../utility/utility.hpp"
16#include "../settings/settings.hpp"
17#include "../macros.hpp"
21namespace hi {
inline namespace v1 {
110 constexpr widget_layout(
113 hi::subpixel_orientation subpixel_orientation,
128 [[nodiscard]]
constexpr bool empty() const noexcept
134 [[nodiscard]]
constexpr explicit operator bool() const noexcept
139 [[nodiscard]]
constexpr translate3 to_window3() const noexcept
149 [[nodiscard]]
constexpr bool contains(point3 mouse_position)
const noexcept
151 return rectangle().contains(mouse_position) and
clipping_rectangle.contains(mouse_position);
156 return shape.rectangle;
183 [[nodiscard]]
constexpr float width() const noexcept
185 return shape.width();
188 [[nodiscard]]
constexpr float height() const noexcept
190 return shape.height();
193 [[nodiscard]]
constexpr extent2 size() const noexcept
205 [[nodiscard]]
constexpr widget_layout
208 widget_layout r = *
this;
211 if (child_shape.baseline) {
212 r.
shape.baseline = *child_shape.baseline - child_shape.y();
214 }
else if (r.
shape.baseline) {
216 *r.
shape.baseline -= child_shape.y();
219 if (child_shape.centerline) {
220 r.
shape.centerline = *child_shape.centerline - child_shape.x();
222 }
else if (r.
shape.centerline) {
224 *r.
shape.centerline -= child_shape.x();
242 [[nodiscard]]
constexpr widget_layout
transform(
box_shape const& child_shape,
float child_elevation = 1.0f) const noexcept
255 r.clipping_rectangle = new_clipping_rectangle;
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
The HikoGUI API version 1.
Definition lookahead_iterator.hpp:6
Class which represents an axis-aligned rectangle.
Definition aarectangle.hpp:29
A high-level geometric extent.
Definition extent2.hpp:29
A rectangle / parallelogram in 3D space.
Definition rectangle.hpp:21
Definition translate2.hpp:14
The layout of a widget.
Definition widget_layout.hpp:38
translate2 to_parent
This matrix transforms local coordinates to the coordinates of the parent widget.
Definition widget_layout.hpp:53
utc_nanoseconds display_time_point
The layout created for displaying at this time point.
Definition widget_layout.hpp:99
constexpr aarectangle clipping_rectangle_on_window() const noexcept
Get the clipping rectangle in window coordinate system.
Definition widget_layout.hpp:168
translate2 from_parent
This matrix transforms parent widget's coordinates to local coordinates.
Definition widget_layout.hpp:57
aarectangle clipping_rectangle
The clipping rectangle.
Definition widget_layout.hpp:89
constexpr bool contains(point3 mouse_position) const noexcept
Check if the mouse position is inside the widget.
Definition widget_layout.hpp:149
float elevation
The elevation of the widget above the window.
Definition widget_layout.hpp:77
constexpr aarectangle clipping_rectangle_on_window(aarectangle narrow_clipping_rectangle) const noexcept
Get the clipping rectangle in window coordinate system.
Definition widget_layout.hpp:178
translate2 to_window
This matrix transforms local coordinates to window coordinates.
Definition widget_layout.hpp:61
extent2 sub_pixel_size
The size of a sub-pixel.
Definition widget_layout.hpp:95
static constexpr int redraw_overhang
The amount of pixels that the redraw request will overhang the widget.
Definition widget_layout.hpp:44
translate2 from_window
This matrix transforms window coordinates to local coordinates.
Definition widget_layout.hpp:65
constexpr widget_layout override_clip(aarectangle new_clipping_rectangle) const noexcept
Override e context with the new clipping rectangle.
Definition widget_layout.hpp:252
extent2 window_size
Size of the window.
Definition widget_layout.hpp:69
box_shape shape
Shape of the widget.
Definition widget_layout.hpp:49
constexpr aarectangle rectangle_on_window() const noexcept
Get the rectangle in window coordinate system.
Definition widget_layout.hpp:161
gui_window_size window_size_state
The size state of the window.
Definition widget_layout.hpp:73
constexpr widget_layout transform(box_shape const &child_shape, float child_elevation, aarectangle new_clipping_rectangle) const noexcept
Create a new widget_layout for the child widget.
Definition widget_layout.hpp:206
constexpr widget_layout transform(box_shape const &child_shape, float child_elevation=1.0f) const noexcept
Create a new widget_layout for the child widget.
Definition widget_layout.hpp:242
Definition box_shape.hpp:18