11#include "gui_window_size.hpp"
12#include "../layout/box_shape.hpp"
13#include "../geometry/module.hpp"
14#include "../unicode/module.hpp"
15#include "../font/module.hpp"
16#include "../GFX/module.hpp"
17#include "../chrono.hpp"
18#include "../utility/module.hpp"
20namespace hi {
inline namespace v1 {
74 gui_window_size window_size_state = gui_window_size::normal;
105 [[nodiscard]] constexpr
bool empty() const noexcept
111 [[nodiscard]]
constexpr explicit operator bool() const noexcept
116 [[nodiscard]]
constexpr translate3 to_window3() const noexcept
126 [[nodiscard]]
constexpr bool contains(point3i mouse_position)
const noexcept
131 [[nodiscard]]
constexpr aarectanglei rectangle() const noexcept
133 return shape.rectangle;
160 [[nodiscard]]
constexpr int width() const noexcept
162 return shape.width();
165 [[nodiscard]]
constexpr int height() const noexcept
167 return shape.height();
170 [[nodiscard]]
constexpr extent2i size() const noexcept
179 gui_window_size window_size_state,
180 hi::subpixel_orientation subpixel_orientation,
188 window_size_state(window_size_state),
208 if (child_shape.baseline) {
209 r.
shape.baseline = *child_shape.baseline - child_shape.y();
211 }
else if (r.
shape.baseline) {
213 *r.
shape.baseline -= child_shape.y();
216 if (child_shape.centerline) {
217 r.
shape.centerline = *child_shape.centerline - child_shape.x();
219 }
else if (r.
shape.centerline) {
221 *r.
shape.centerline -= child_shape.x();
224 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:183
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:265
The layout of a widget.
Definition widget_layout.hpp:37
extent2i window_size
Size of the window.
Definition widget_layout.hpp:68
utc_nanoseconds display_time_point
The layout created for displaying at this time point.
Definition widget_layout.hpp:96
constexpr widget_layout override_clip(aarectanglei new_clipping_rectangle) const noexcept
Override e context with the new clipping rectangle.
Definition widget_layout.hpp:249
translate2i to_parent
This matrix transforms local coordinates to the coordinates of the parent widget.
Definition widget_layout.hpp:52
translate2i from_parent
This matrix transforms parent widget's coordinates to local coordinates.
Definition widget_layout.hpp:56
translate2i from_window
This matrix transforms window coordinates to local coordinates.
Definition widget_layout.hpp:64
constexpr bool contains(point3i mouse_position) const noexcept
Check if the mouse position is inside the widget.
Definition widget_layout.hpp:126
float elevation
The elevation of the widget above the window.
Definition widget_layout.hpp:72
extent2 sub_pixel_size
The size of a sub-pixel.
Definition widget_layout.hpp:92
constexpr aarectanglei rectangle_on_window() const noexcept
Get the rectangle in window coordinate system.
Definition widget_layout.hpp:138
static constexpr int redraw_overhang
The amount of pixels that the redraw request will overhang the widget.
Definition widget_layout.hpp:43
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:203
constexpr aarectanglei clipping_rectangle_on_window() const noexcept
Get the clipping rectangle in window coordinate system.
Definition widget_layout.hpp:145
box_shape shape
Shape of the widget.
Definition widget_layout.hpp:48
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:177
translate2i to_window
This matrix transforms local coordinates to window coordinates.
Definition widget_layout.hpp:60
constexpr aarectanglei clipping_rectangle_on_window(aarectanglei narrow_clipping_rectangle) const noexcept
Get the clipping rectangle in window coordinate system.
Definition widget_layout.hpp:155
aarectanglei clipping_rectangle
The clipping rectangle.
Definition widget_layout.hpp:86
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:239
Definition box_shape.hpp:15