11#include "../layout/box_shape.hpp"
12#include "../geometry/module.hpp"
13#include "../unicode/unicode_bidi_class.hpp"
14#include "../font/module.hpp"
15#include "../GUI/gui_window_size.hpp"
16#include "../GUI/theme.hpp"
18#include "../chrono.hpp"
19#include "../utility/module.hpp"
21namespace hi {
inline namespace v1 {
75 gui_window_size window_size_state = gui_window_size::normal;
106 [[nodiscard]] constexpr
bool empty() const noexcept
112 [[nodiscard]]
constexpr explicit operator bool() const noexcept
117 [[nodiscard]]
constexpr translate3 to_window3() const noexcept
127 [[nodiscard]]
constexpr bool contains(point3i mouse_position)
const noexcept
132 [[nodiscard]]
constexpr aarectanglei rectangle() const noexcept
134 return shape.rectangle;
161 [[nodiscard]]
constexpr int width() const noexcept
163 return shape.width();
166 [[nodiscard]]
constexpr int height() const noexcept
168 return shape.height();
171 [[nodiscard]]
constexpr extent2i size() const noexcept
180 gui_window_size window_size_state,
181 hi::subpixel_orientation subpixel_orientation,
189 window_size_state(window_size_state),
209 if (child_shape.baseline) {
210 r.
shape.baseline = *child_shape.baseline - child_shape.y();
212 }
else if (r.
shape.baseline) {
214 *r.
shape.baseline -= child_shape.y();
217 if (child_shape.centerline) {
218 r.
shape.centerline = *child_shape.centerline - child_shape.x();
220 }
else if (r.
shape.centerline) {
222 *r.
shape.centerline -= child_shape.x();
225 r.
to_parent = translate2i{child_shape.x(), child_shape.y()};
geo::extent< int, 2 > extent2i
A 2D extent.
Definition extent.hpp:512
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
constexpr extent< value_type, 2 > size() const noexcept
Get size of the rectangle.
Definition axis_aligned_rectangle.hpp:182
constexpr bool contains(point< value_type, 2 > const &rhs) const noexcept
Check if a 2D coordinate is inside the rectangle.
Definition axis_aligned_rectangle.hpp:264
Definition box_shape.hpp:15
The layout of a widget.
Definition widget_layout.hpp:38
extent2i window_size
Size of the window.
Definition widget_layout.hpp:69
utc_nanoseconds display_time_point
The layout created for displaying at this time point.
Definition widget_layout.hpp:97
constexpr widget_layout override_clip(aarectanglei new_clipping_rectangle) const noexcept
Override e context with the new clipping rectangle.
Definition widget_layout.hpp:250
translate2i to_parent
This matrix transforms local coordinates to the coordinates of the parent widget.
Definition widget_layout.hpp:53
translate2i from_parent
This matrix transforms parent widget's coordinates to local coordinates.
Definition widget_layout.hpp:57
translate2i from_window
This matrix transforms window coordinates to local coordinates.
Definition widget_layout.hpp:65
constexpr bool contains(point3i mouse_position) const noexcept
Check if the mouse position is inside the widget.
Definition widget_layout.hpp:127
float elevation
The elevation of the widget above the window.
Definition widget_layout.hpp:73
extent2 sub_pixel_size
The size of a sub-pixel.
Definition widget_layout.hpp:93
constexpr aarectanglei rectangle_on_window() const noexcept
Get the rectangle in window coordinate system.
Definition widget_layout.hpp:139
static constexpr int redraw_overhang
The amount of pixels that the redraw request will overhang the widget.
Definition widget_layout.hpp:44
constexpr widget_layout transform(box_shape const &child_shape, float child_elevation, aarectanglei new_clipping_rectangle) const noexcept
Create a new widget_layout for the child widget.
Definition widget_layout.hpp:204
constexpr aarectanglei clipping_rectangle_on_window() const noexcept
Get the clipping rectangle in window coordinate system.
Definition widget_layout.hpp:146
box_shape shape
Shape of the widget.
Definition widget_layout.hpp:49
constexpr widget_layout(extent2i 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.
Definition widget_layout.hpp:178
translate2i to_window
This matrix transforms local coordinates to window coordinates.
Definition widget_layout.hpp:61
constexpr aarectanglei clipping_rectangle_on_window(aarectanglei narrow_clipping_rectangle) const noexcept
Get the clipping rectangle in window coordinate system.
Definition widget_layout.hpp:156
aarectanglei clipping_rectangle
The clipping rectangle.
Definition widget_layout.hpp:87
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:240