HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Static Public Attributes | Friends
v1::widget_layout Class Reference

Public Member Functions

constexpr widget_layout (widget_layout const &) noexcept=default
 
constexpr widget_layout (widget_layout &&) noexcept=default
 
constexpr widget_layoutoperator= (widget_layout const &) noexcept=default
 
constexpr widget_layoutoperator= (widget_layout &&) noexcept=default
 
constexpr bool contains (point3 mouse_position) const noexcept
 Check if the mouse position is inside the widget.
 
constexpr aarectangle rectangle () const noexcept
 
constexpr aarectangle window_clipping_rectangle () const noexcept
 Get the clipping rectangle in window coordinate system.
 
constexpr aarectangle window_clipping_rectangle (aarectangle narrow_clipping_rectangle) const noexcept
 Get the clipping rectangle in window coordinate system.
 
constexpr float width () const noexcept
 
constexpr float height () const noexcept
 
constexpr widget_layout (extent2 window_size, hi::subpixel_orientation subpixel_orientation, unicode_bidi_class writing_direction, utc_nanoseconds display_time_point) noexcept
 Construct a widget_layout from inside the window.
 
constexpr widget_layout transform (aarectangle const &child_rectangle, float elevation, aarectangle new_clipping_rectangle, widget_baseline new_baseline=widget_baseline{}) const noexcept
 Create a new widget_layout for the child widget.
 
constexpr widget_layout transform (aarectangle const &child_rectangle, float elevation=1.0f, widget_baseline new_baseline=widget_baseline{}) const noexcept
 Create a new widget_layout for the child widget.
 
constexpr widget_layout transform (aarectangle const &child_rectangle, widget_baseline new_baseline) const noexcept
 Create a new widget_layout for the child widget.
 
constexpr widget_layout override_clip (aarectangle new_clipping_rectangle) const noexcept
 Override e context with the new clipping rectangle.
 

Data Fields

matrix3 to_parent
 This matrix transforms local coordinates to the coordinates of the parent widget.
 
matrix3 from_parent
 This matrix transforms parent widget's coordinates to local coordinates.
 
matrix3 to_window
 This matrix transforms local coordinates to window coordinates.
 
matrix3 from_window
 This matrix transforms window coordinates to local coordinates.
 
extent2 size
 Size of the widget.
 
aarectangle clipping_rectangle
 The clipping rectangle.
 
extent2 sub_pixel_size
 The size of a sub-pixel.
 
unicode_bidi_class writing_direction
 The default writing direction.
 
utc_nanoseconds display_time_point
 The layout created for displaying at this time point.
 
float baseline
 The base-line in widget local y-coordinate.
 

Static Public Attributes

static constexpr float redraw_overhang = 2.0f
 The amount of pixels that the redraw request will overhang the widget.
 

Friends

constexpr friend bool operator== (widget_layout const &lhs, widget_layout const &rhs) noexcept
 

Constructor & Destructor Documentation

◆ widget_layout()

constexpr v1::widget_layout::widget_layout ( extent2 window_size,
hi::subpixel_orientation subpixel_orientation,
unicode_bidi_class writing_direction,
utc_nanoseconds display_time_point )
inlineconstexprnoexcept

Construct a widget_layout from inside the window.

Member Function Documentation

◆ contains()

constexpr bool v1::widget_layout::contains ( point3 mouse_position) const
inlineconstexprnoexcept

Check if the mouse position is inside the widget.

Parameters
mouse_positionThe mouse position in local coordinates.
Returns
True if the mouse position is on the widget and is not clipped.

◆ override_clip()

constexpr widget_layout v1::widget_layout::override_clip ( aarectangle new_clipping_rectangle) const
inlineconstexprnoexcept

Override e context with the new clipping rectangle.

Parameters
new_clipping_rectangleThe new clipping rectangle.
Returns
A new context that is clipped..

◆ transform() [1/3]

constexpr widget_layout v1::widget_layout::transform ( aarectangle const & child_rectangle,
float elevation,
aarectangle new_clipping_rectangle,
widget_baseline new_baseline = widget_baseline{} ) const
inlineconstexprnoexcept

Create a new widget_layout for the child widget.

Parameters
child_rectangleThe location and size of the child widget, relative to the current widget.
elevationThe elevation of the child widget, relative to the current widget.
new_clipping_rectangleThe new clipping rectangle of the child widget, relative to the current widget.
new_baselineThe baseline to use by the child widget.
Returns
A new widget_layout for use by the child widget.

◆ transform() [2/3]

constexpr widget_layout v1::widget_layout::transform ( aarectangle const & child_rectangle,
float elevation = 1.0f,
widget_baseline new_baseline = widget_baseline{} ) const
inlineconstexprnoexcept

Create a new widget_layout for the child widget.

Parameters
child_rectangleThe location and size of the child widget, relative to the current widget.
elevationThe relative elevation of the child widget compared to the current widget.
Returns
A new widget_layout for use by the child widget.

◆ transform() [3/3]

constexpr widget_layout v1::widget_layout::transform ( aarectangle const & child_rectangle,
widget_baseline new_baseline ) const
inlineconstexprnoexcept

Create a new widget_layout for the child widget.

Parameters
child_rectangleThe location and size of the child widget, relative to the current widget.
Returns
A new widget_layout for use by the child widget.

◆ window_clipping_rectangle() [1/2]

constexpr aarectangle v1::widget_layout::window_clipping_rectangle ( ) const
inlineconstexprnoexcept

Get the clipping rectangle in window coordinate system.

◆ window_clipping_rectangle() [2/2]

constexpr aarectangle v1::widget_layout::window_clipping_rectangle ( aarectangle narrow_clipping_rectangle) const
inlineconstexprnoexcept

Get the clipping rectangle in window coordinate system.

Parameters
narrow_clipping_rectangleA clipping rectangle in local coordinate system that will be intersected with the layout's clipping rectangle.

Field Documentation

◆ baseline

float v1::widget_layout::baseline

The base-line in widget local y-coordinate.

◆ clipping_rectangle

aarectangle v1::widget_layout::clipping_rectangle

The clipping rectangle.

This is the rectangle that all drawing must be clipped to. This rectangle often includes the margin, as widget may draw in their own margin.

The clipping rectangle may be smaller than the widget, or even empty when the widget is scrolled outside of the aperture of a scroll widget.

Note
widget's coordinate system.

◆ display_time_point

utc_nanoseconds v1::widget_layout::display_time_point

The layout created for displaying at this time point.

◆ from_parent

matrix3 v1::widget_layout::from_parent

This matrix transforms parent widget's coordinates to local coordinates.

◆ from_window

matrix3 v1::widget_layout::from_window

This matrix transforms window coordinates to local coordinates.

◆ redraw_overhang

constexpr float v1::widget_layout::redraw_overhang = 2.0f
staticconstexpr

The amount of pixels that the redraw request will overhang the widget.

Widgets are allowed to draw inside their margins, in most cases this will just be a border.

◆ size

extent2 v1::widget_layout::size

Size of the widget.

◆ sub_pixel_size

extent2 v1::widget_layout::sub_pixel_size

The size of a sub-pixel.

Note
the sub-pixel-size is represented in the widget's coordinate system.

◆ to_parent

matrix3 v1::widget_layout::to_parent

This matrix transforms local coordinates to the coordinates of the parent widget.

◆ to_window

matrix3 v1::widget_layout::to_window

This matrix transforms local coordinates to window coordinates.

◆ writing_direction

unicode_bidi_class v1::widget_layout::writing_direction

The default writing direction.

Note
Must be either L or R.

The documentation for this class was generated from the following file: