11#include "../layout/box_shape.hpp"
14#include "../geometry/transform.hpp"
15#include "../geometry/translate.hpp"
16#include "../unicode/unicode_bidi_class.hpp"
17#include "../text/font_book.hpp"
18#include "../GUI/gui_window_size.hpp"
19#include "../GUI/theme.hpp"
21#include "../chrono.hpp"
24namespace hi {
inline namespace v1 {
78 gui_window_size window_size_state = gui_window_size::normal;
109 [[nodiscard]] constexpr
bool empty() const noexcept
115 [[nodiscard]]
constexpr explicit operator bool() const noexcept
120 [[nodiscard]]
constexpr translate3 to_window3() const noexcept
130 [[nodiscard]]
constexpr bool contains(point3i mouse_position)
const noexcept
135 [[nodiscard]]
constexpr aarectanglei rectangle() const noexcept
137 return shape.rectangle;
164 [[nodiscard]]
constexpr int width() const noexcept
166 return shape.width();
169 [[nodiscard]]
constexpr int height() const noexcept
171 return shape.height();
174 [[nodiscard]]
constexpr extent2i size() const noexcept
183 gui_window_size window_size_state,
184 hi::subpixel_orientation subpixel_orientation,
192 window_size_state(window_size_state),
212 if (child_shape.baseline) {
213 r.
shape.baseline = *child_shape.baseline - child_shape.y();
215 }
else if (r.
shape.baseline) {
217 *r.
shape.baseline -= child_shape.y();
220 if (child_shape.centerline) {
221 r.
shape.centerline = *child_shape.centerline - child_shape.x();
223 }
else if (r.
shape.centerline) {
225 *r.
shape.centerline -= child_shape.x();
228 r.
to_parent = translate2i{child_shape.x(), child_shape.y()};
Miscellaneous math functions.
Defines geo::matrix, matrix2 and matrix3.
geo::extent< int, 2 > extent2i
A 2D extent.
Definition extent.hpp:513
DOXYGEN BUG.
Definition algorithm.hpp:15
geometry/margins.hpp
Definition assert.hpp:18
constexpr extent< value_type, 2 > size() const noexcept
Get size of the rectangle.
Definition axis_aligned_rectangle.hpp:184
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:266
Definition box_shape.hpp:15
The layout of a widget.
Definition widget_layout.hpp:41
extent2i window_size
Size of the window.
Definition widget_layout.hpp:72
utc_nanoseconds display_time_point
The layout created for displaying at this time point.
Definition widget_layout.hpp:100
constexpr widget_layout override_clip(aarectanglei new_clipping_rectangle) const noexcept
Override e context with the new clipping rectangle.
Definition widget_layout.hpp:253
translate2i to_parent
This matrix transforms local coordinates to the coordinates of the parent widget.
Definition widget_layout.hpp:56
translate2i from_parent
This matrix transforms parent widget's coordinates to local coordinates.
Definition widget_layout.hpp:60
translate2i from_window
This matrix transforms window coordinates to local coordinates.
Definition widget_layout.hpp:68
constexpr bool contains(point3i mouse_position) const noexcept
Check if the mouse position is inside the widget.
Definition widget_layout.hpp:130
float elevation
The elevation of the widget above the window.
Definition widget_layout.hpp:76
extent2 sub_pixel_size
The size of a sub-pixel.
Definition widget_layout.hpp:96
constexpr aarectanglei rectangle_on_window() const noexcept
Get the rectangle in window coordinate system.
Definition widget_layout.hpp:142
static constexpr int redraw_overhang
The amount of pixels that the redraw request will overhang the widget.
Definition widget_layout.hpp:47
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:207
constexpr aarectanglei clipping_rectangle_on_window() const noexcept
Get the clipping rectangle in window coordinate system.
Definition widget_layout.hpp:149
box_shape shape
Shape of the widget.
Definition widget_layout.hpp:52
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:181
translate2i to_window
This matrix transforms local coordinates to window coordinates.
Definition widget_layout.hpp:64
constexpr aarectanglei clipping_rectangle_on_window(aarectanglei narrow_clipping_rectangle) const noexcept
Get the clipping rectangle in window coordinate system.
Definition widget_layout.hpp:159
aarectanglei clipping_rectangle
The clipping rectangle.
Definition widget_layout.hpp:90
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:243