46 explicit Px (
float p) : pixels (
static_cast<long double> (p)) { }
47 explicit Px (
int p) : pixels (
static_cast<long double> (p)) { }
48 explicit constexpr Px (
long double p) : pixels (p) {}
49 explicit constexpr Px (
unsigned long long p) : pixels (
static_cast<long double> (p)) {}
57 explicit Fr (
int f) : fraction (
static_cast<unsigned long long> (f)) {}
58 explicit constexpr Fr (
unsigned long long p) : fraction (p) {}
60 unsigned long long fraction;
82 bool isAuto()
const noexcept {
return hasKeyword; }
83 bool isFractional()
const noexcept {
return isFraction; }
84 bool isPixels()
const noexcept {
return ! isFraction; }
85 const String& getStartLineName()
const noexcept {
return startLineName; }
86 const String& getEndLineName()
const noexcept {
return endLineName; }
89 float getSize() const noexcept {
return size; }
93 float getAbsoluteSize (
float relativeFractionalUnit)
const;
96 bool isFraction =
false;
97 bool hasKeyword =
false;
99 String startLineName, endLineName;
198 void setGap (
Px sizeInPixels)
noexcept { rowGap = columnGap = sizeInPixels; }
219constexpr Grid::Px
operator""_px (
long double px) {
return Grid::Px {
px }; }
220constexpr Grid::Px
operator""_px (
unsigned long long px) {
return Grid::Px {
px }; }
221constexpr Grid::Fr
operator""_fr (
unsigned long long fr) {
return Grid::Fr {
fr }; }
Holds a resizable array of primitive or copy-by-value objects.
int size() const noexcept
Returns the current number of elements in the array.
Container that handles geometry for grid layouts (fixed columns and rows) using a set of declarative ...
TrackInfo autoColumns
The column track for auto dimension.
Grid()=default
Creates an empty Grid container with default parameters.
JustifyItems
Possible values for the justifyItems property.
TrackInfo autoRows
The row track for auto dimension.
Array< TrackInfo > templateRows
The set of row tracks to lay out.
void setGap(Px sizeInPixels) noexcept
Sets the gap between rows and columns in pixels.
JustifyContent
Possible values for the justifyContent property.
int getNumberOfColumns() const noexcept
Returns the number of columns.
StringArray templateAreas
Template areas.
AlignContent
Possible values for the alignContent property.
Array< TrackInfo > templateColumns
The set of column tracks to lay out.
AlignItems
Possible values for the alignItems property.
AutoFlow
Possible values for the autoFlow property.
Array< GridItem > items
The set of items to lay-out.
int getNumberOfRows() const noexcept
Returns the number of rows.
Manages a rectangle and allows geometric operations to be performed on it.
A special array for holding a list of strings.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
A fractional ratio integer.
float getSize() const noexcept
Get the track's size - which might mean an absolute pixels value or a fractional ratio.