Use fbsource clang-format config

Summary:
This mirrors the clang-format config used by fbsource to Yoga.

They are pretty similar, except for an annoying habit where Yoga's previous forced small functions in headers to be a a single line, so you would get a combination of multiline and single line functions next to each other which are hard to read. That is what motivated this change.

It also enforces header ordering (yay). I don't think we have any side-effect causing headers, so this should be safe.

Reviewed By: yungsters

Differential Revision: D49248994

fbshipit-source-id: 66998395e7c0158ff9d9fb1bee44e8401bdd8f21
This commit is contained in:
Nick Gerleman
2023-09-13 20:12:55 -07:00
committed by Facebook GitHub Bot
parent 9d21e3e300
commit f9c2c27d33
51 changed files with 522 additions and 470 deletions

View File

@@ -5,8 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
#include <yoga/Yoga.h>
#include <yoga/Yoga-internal.h>
#include <yoga/Yoga.h>
#include <yoga/algorithm/Cache.h>
#include <yoga/algorithm/CalculateLayout.h>

View File

@@ -71,10 +71,8 @@ YG_EXPORT YGNodeRef YGNodeGetChild(YGNodeRef node, size_t index);
YG_EXPORT YGNodeRef YGNodeGetOwner(YGNodeRef node);
YG_EXPORT YGNodeRef YGNodeGetParent(YGNodeRef node);
YG_EXPORT size_t YGNodeGetChildCount(YGNodeConstRef node);
YG_EXPORT void YGNodeSetChildren(
YGNodeRef owner,
const YGNodeRef* children,
size_t count);
YG_EXPORT void
YGNodeSetChildren(YGNodeRef owner, const YGNodeRef* children, size_t count);
YG_EXPORT void YGNodeSetIsReferenceBaseline(
YGNodeRef node,
@@ -197,41 +195,29 @@ YG_EXPORT void YGNodeStyleSetFlexBasisPercent(YGNodeRef node, float flexBasis);
YG_EXPORT void YGNodeStyleSetFlexBasisAuto(YGNodeRef node);
YG_EXPORT YGValue YGNodeStyleGetFlexBasis(YGNodeConstRef node);
YG_EXPORT void YGNodeStyleSetPosition(
YGNodeRef node,
YGEdge edge,
float position);
YG_EXPORT void YGNodeStyleSetPositionPercent(
YGNodeRef node,
YGEdge edge,
float position);
YG_EXPORT void
YGNodeStyleSetPosition(YGNodeRef node, YGEdge edge, float position);
YG_EXPORT void
YGNodeStyleSetPositionPercent(YGNodeRef node, YGEdge edge, float position);
YG_EXPORT YGValue YGNodeStyleGetPosition(YGNodeConstRef node, YGEdge edge);
YG_EXPORT void YGNodeStyleSetMargin(YGNodeRef node, YGEdge edge, float margin);
YG_EXPORT void YGNodeStyleSetMarginPercent(
YGNodeRef node,
YGEdge edge,
float margin);
YG_EXPORT void
YGNodeStyleSetMarginPercent(YGNodeRef node, YGEdge edge, float margin);
YG_EXPORT void YGNodeStyleSetMarginAuto(YGNodeRef node, YGEdge edge);
YG_EXPORT YGValue YGNodeStyleGetMargin(YGNodeConstRef node, YGEdge edge);
YG_EXPORT void YGNodeStyleSetPadding(
YGNodeRef node,
YGEdge edge,
float padding);
YG_EXPORT void YGNodeStyleSetPaddingPercent(
YGNodeRef node,
YGEdge edge,
float padding);
YG_EXPORT void
YGNodeStyleSetPadding(YGNodeRef node, YGEdge edge, float padding);
YG_EXPORT void
YGNodeStyleSetPaddingPercent(YGNodeRef node, YGEdge edge, float padding);
YG_EXPORT YGValue YGNodeStyleGetPadding(YGNodeConstRef node, YGEdge edge);
YG_EXPORT void YGNodeStyleSetBorder(YGNodeRef node, YGEdge edge, float border);
YG_EXPORT float YGNodeStyleGetBorder(YGNodeConstRef node, YGEdge edge);
YG_EXPORT void YGNodeStyleSetGap(
YGNodeRef node,
YGGutter gutter,
float gapLength);
YG_EXPORT void
YGNodeStyleSetGap(YGNodeRef node, YGGutter gutter, float gapLength);
YG_EXPORT float YGNodeStyleGetGap(YGNodeConstRef node, YGGutter gutter);
YG_EXPORT void YGNodeStyleSetWidth(YGNodeRef node, float width);

View File

@@ -16,7 +16,6 @@ namespace facebook::yoga {
float calculateBaseline(const yoga::Node* node) {
if (node->hasBaselineFunc()) {
Event::publish<Event::NodeBaselineStart>(node);
const float baseline = node->baseline(

View File

@@ -2603,7 +2603,6 @@ bool calculateLayoutInternal(
layout->lastOwnerDirection = ownerDirection;
if (cachedResults == nullptr) {
layoutMarkerData.maxMeasureCache = std::max(
layoutMarkerData.maxMeasureCache,
layout->nextCachedMeasurementsIndex + 1u);
@@ -2741,7 +2740,7 @@ void calculateLayout(
if (node->getConfig()->shouldPrintTree()) {
YGNodePrint(
node,
(YGPrintOptions) (YGPrintOptionsLayout | YGPrintOptionsChildren | YGPrintOptionsStyle));
(YGPrintOptions)(YGPrintOptionsLayout | YGPrintOptionsChildren | YGPrintOptionsStyle));
}
#endif
}

View File

@@ -59,7 +59,7 @@ float roundValueToPixelGrid(
}
return (std::isnan(scaledValue) || std::isnan(pointScaleFactor))
? YGUndefined
: (float) (scaledValue / pointScaleFactor);
: (float)(scaledValue / pointScaleFactor);
}
void roundLayoutResultsToPixelGrid(

View File

@@ -26,7 +26,7 @@ inline FloatOptional resolveValue(const YGValue value, const float ownerSize) {
}
inline FloatOptional resolveValue(CompactValue value, float ownerSize) {
return resolveValue((YGValue) value, ownerSize);
return resolveValue((YGValue)value, ownerSize);
}
} // namespace facebook::yoga

View File

@@ -7,8 +7,8 @@
#pragma once
#include <bitset>
#include <yoga/YGEnums.h>
#include <bitset>
namespace facebook::yoga {

View File

@@ -8,8 +8,8 @@
#pragma once
#include <bitset>
#include <cstdio>
#include <cstdint>
#include <cstdio>
#include <yoga/YGEnums.h>

View File

@@ -34,7 +34,7 @@ struct ConfigFlags {
#pragma pack(pop)
class YG_EXPORT Config : public ::YGConfig {
public:
public:
Config(YGLogger logger);
void setUseWebDefaults(bool useWebDefaults);
@@ -69,14 +69,12 @@ public:
va_list args) const;
void setCloneNodeCallback(YGCloneNodeFunc cloneNode);
YGNodeRef cloneNode(
YGNodeConstRef node,
YGNodeConstRef owner,
size_t childIndex) const;
YGNodeRef
cloneNode(YGNodeConstRef node, YGNodeConstRef owner, size_t childIndex) const;
static const Config& getDefault();
private:
private:
YGCloneNodeFunc cloneNodeCallback_;
YGLogger logger_;

View File

@@ -8,8 +8,8 @@
#pragma once
#include <yoga/Yoga.h>
#include <yoga/node/Node.h>
#include <yoga/config/Config.h>
#include <yoga/node/Node.h>
namespace facebook::yoga {

View File

@@ -10,8 +10,8 @@
#include <yoga/Yoga.h>
#include <yoga/YGEnums.h>
#include <yoga/node/Node.h>
#include <yoga/config/Config.h>
#include <yoga/node/Node.h>
namespace facebook::yoga {

View File

@@ -9,10 +9,10 @@
#include <yoga/Yoga.h>
#include <stdint.h>
#include <array>
#include <functional>
#include <vector>
#include <array>
#include <stdint.h>
namespace facebook::yoga {
@@ -70,7 +70,7 @@ struct YG_EXPORT Event {
class Data {
const void* data_;
public:
public:
template <Type E>
Data(const TypedData<E>& data) : data_{&data} {}
@@ -89,7 +89,7 @@ struct YG_EXPORT Event {
publish(node, E, Data{eventData});
}
private:
private:
static void publish(YGNodeConstRef, Type, const Data&);
};

View File

@@ -10,8 +10,8 @@
#include <array>
#include <yoga/bits/NumericBitfield.h>
#include <yoga/numeric/FloatOptional.h>
#include <yoga/node/CachedMeasurement.h>
#include <yoga/numeric/FloatOptional.h>
namespace facebook::yoga {
@@ -34,10 +34,10 @@ struct LayoutResults {
std::array<float, 4> border = {};
std::array<float, 4> padding = {};
private:
private:
LayoutResultFlags flags_{};
public:
public:
uint32_t computedFlexBasisGeneration = 0;
FloatOptional computedFlexBasis = {};
@@ -60,11 +60,17 @@ public:
flags_.direction = static_cast<uint32_t>(direction) & 0x03;
}
bool hadOverflow() const { return flags_.hadOverflow; }
void setHadOverflow(bool hadOverflow) { flags_.hadOverflow = hadOverflow; }
bool hadOverflow() const {
return flags_.hadOverflow;
}
void setHadOverflow(bool hadOverflow) {
flags_.hadOverflow = hadOverflow;
}
bool operator==(LayoutResults layout) const;
bool operator!=(LayoutResults layout) const { return !(*this == layout); }
bool operator!=(LayoutResults layout) const {
return !(*this == layout);
}
};
} // namespace facebook::yoga

View File

@@ -7,8 +7,8 @@
#pragma once
#include <cstdint>
#include <stdio.h>
#include <cstdint>
#include <vector>
#include <yoga/Yoga.h>
@@ -34,7 +34,7 @@ struct NodeFlags {
#pragma pack(pop)
class YG_EXPORT Node : public ::YGNode {
private:
private:
void* context_ = nullptr;
NodeFlags flags_ = {};
YGMeasureFunc measureFunc_ = {nullptr};
@@ -66,7 +66,7 @@ private:
// DO NOT CHANGE THE VISIBILITY OF THIS METHOD!
Node& operator=(Node&&) = default;
public:
public:
Node();
explicit Node(const Config* config);
~Node() = default; // cleanup of owner/children relationships in YGNodeFree
@@ -82,60 +82,98 @@ public:
Node& operator=(const Node&) = delete;
// Getters
void* getContext() const { return context_; }
void* getContext() const {
return context_;
}
void print();
bool getHasNewLayout() const { return flags_.hasNewLayout; }
bool getHasNewLayout() const {
return flags_.hasNewLayout;
}
YGNodeType getNodeType() const {
return static_cast<YGNodeType>(flags_.nodeType);
}
bool hasMeasureFunc() const noexcept { return measureFunc_ != nullptr; }
bool hasMeasureFunc() const noexcept {
return measureFunc_ != nullptr;
}
YGSize measure(float, YGMeasureMode, float, YGMeasureMode);
bool hasBaselineFunc() const noexcept { return baselineFunc_ != nullptr; }
bool hasBaselineFunc() const noexcept {
return baselineFunc_ != nullptr;
}
float baseline(float width, float height) const;
bool hasErrata(YGErrata errata) const { return config_->hasErrata(errata); }
bool hasErrata(YGErrata errata) const {
return config_->hasErrata(errata);
}
YGDirtiedFunc getDirtiedFunc() const { return dirtiedFunc_; }
YGDirtiedFunc getDirtiedFunc() const {
return dirtiedFunc_;
}
// For Performance reasons passing as reference.
Style& getStyle() { return style_; }
Style& getStyle() {
return style_;
}
const Style& getStyle() const { return style_; }
const Style& getStyle() const {
return style_;
}
// For Performance reasons passing as reference.
LayoutResults& getLayout() { return layout_; }
LayoutResults& getLayout() {
return layout_;
}
const LayoutResults& getLayout() const { return layout_; }
const LayoutResults& getLayout() const {
return layout_;
}
size_t getLineIndex() const { return lineIndex_; }
size_t getLineIndex() const {
return lineIndex_;
}
bool isReferenceBaseline() const { return flags_.isReferenceBaseline; }
bool isReferenceBaseline() const {
return flags_.isReferenceBaseline;
}
// returns the Node that owns this Node. An owner is used to identify
// the YogaTree that a Node belongs to. This method will return the parent
// of the Node when a Node only belongs to one YogaTree or nullptr when
// the Node is shared between two or more YogaTrees.
Node* getOwner() const { return owner_; }
Node* getOwner() const {
return owner_;
}
// Deprecated, use getOwner() instead.
Node* getParent() const { return getOwner(); }
Node* getParent() const {
return getOwner();
}
const std::vector<Node*>& getChildren() const { return children_; }
const std::vector<Node*>& getChildren() const {
return children_;
}
Node* getChild(size_t index) const { return children_.at(index); }
Node* getChild(size_t index) const {
return children_.at(index);
}
size_t getChildCount() const { return children_.size(); }
size_t getChildCount() const {
return children_.size();
}
const Config* getConfig() const { return config_; }
const Config* getConfig() const {
return config_;
}
bool isDirty() const { return flags_.isDirty; }
bool isDirty() const {
return flags_.isDirty;
}
std::array<YGValue, 2> getResolvedDimensions() const {
return resolvedDimensions_;
@@ -200,9 +238,13 @@ public:
const;
// Setters
void setContext(void* context) { context_ = context; }
void setContext(void* context) {
context_ = context;
}
void setPrintFunc(YGPrintFunc printFunc) { printFunc_ = printFunc; }
void setPrintFunc(YGPrintFunc printFunc) {
printFunc_ = printFunc;
}
void setHasNewLayout(bool hasNewLayout) {
flags_.hasNewLayout = hasNewLayout;
@@ -218,21 +260,33 @@ public:
baselineFunc_ = baseLineFunc;
}
void setDirtiedFunc(YGDirtiedFunc dirtiedFunc) { dirtiedFunc_ = dirtiedFunc; }
void setDirtiedFunc(YGDirtiedFunc dirtiedFunc) {
dirtiedFunc_ = dirtiedFunc;
}
void setStyle(const Style& style) { style_ = style; }
void setStyle(const Style& style) {
style_ = style;
}
void setLayout(const LayoutResults& layout) { layout_ = layout; }
void setLayout(const LayoutResults& layout) {
layout_ = layout;
}
void setLineIndex(size_t lineIndex) { lineIndex_ = lineIndex; }
void setLineIndex(size_t lineIndex) {
lineIndex_ = lineIndex;
}
void setIsReferenceBaseline(bool isReferenceBaseline) {
flags_.isReferenceBaseline = isReferenceBaseline;
}
void setOwner(Node* owner) { owner_ = owner; }
void setOwner(Node* owner) {
owner_ = owner;
}
void setChildren(const std::vector<Node*>& children) { children_ = children; }
void setChildren(const std::vector<Node*>& children) {
children_ = children;
}
// TODO: rvalue override for setChildren

View File

@@ -75,7 +75,7 @@ inline bool inexactEquals(const YGValue& a, const YGValue& b) {
}
inline bool inexactEquals(CompactValue a, CompactValue b) {
return inexactEquals((YGValue) a, (YGValue) b);
return inexactEquals((YGValue)a, (YGValue)b);
}
template <std::size_t Size, typename ElementT>

View File

@@ -13,17 +13,21 @@
namespace facebook::yoga {
struct FloatOptional {
private:
private:
float value_ = std::numeric_limits<float>::quiet_NaN();
public:
public:
explicit constexpr FloatOptional(float value) : value_(value) {}
constexpr FloatOptional() = default;
// returns the wrapped value, or a value x with YGIsUndefined(x) == true
constexpr float unwrap() const { return value_; }
constexpr float unwrap() const {
return value_;
}
bool isUndefined() const { return std::isnan(value_); }
bool isUndefined() const {
return std::isnan(value_);
}
};
// operators take FloatOptional by value, as it is a 32bit value

View File

@@ -44,7 +44,7 @@ namespace facebook::yoga {
class YG_EXPORT CompactValue {
friend constexpr bool operator==(CompactValue, CompactValue) noexcept;
public:
public:
static constexpr auto LOWER_BOUND = 1.08420217e-19f;
static constexpr auto UPPER_BOUND_POINT = 36893485948395847680.0f;
static constexpr auto UPPER_BOUND_PERCENT = 18446742974197923840.0f;
@@ -136,9 +136,11 @@ public:
repr_ != ZERO_BITS_PERCENT && std::isnan(yoga::bit_cast<float>(repr_)));
}
bool isAuto() const noexcept { return repr_ == AUTO_BITS; }
bool isAuto() const noexcept {
return repr_ == AUTO_BITS;
}
private:
private:
uint32_t repr_;
static constexpr uint32_t BIAS = 0x20000000;
@@ -152,7 +154,9 @@ private:
constexpr CompactValue(uint32_t data) noexcept : repr_(data) {}
VISIBLE_FOR_TESTING uint32_t repr() { return repr_; }
VISIBLE_FOR_TESTING uint32_t repr() {
return repr_;
}
};
template <>

View File

@@ -5,8 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
#include <yoga/style/Style.h>
#include <yoga/numeric/Comparison.h>
#include <yoga/style/Style.h>
namespace facebook::yoga {

View File

@@ -24,7 +24,7 @@ class YG_EXPORT Style {
template <typename Enum>
using Values = std::array<CompactValue, enums::count<Enum>()>;
public:
public:
using Dimensions = Values<YGDimension>;
using Edges = Values<YGEdge>;
using Gutters = Values<YGGutter>;
@@ -37,7 +37,9 @@ public:
struct BitfieldRef {
Style& style;
uint8_t offset;
operator T() const { return getEnumData<T>(style.flags, offset); }
operator T() const {
return getEnumData<T>(style.flags, offset);
}
BitfieldRef<T>& operator=(T x) {
setEnumData<T>(style.flags, offset, x);
return *this;
@@ -47,7 +49,9 @@ public:
template <typename T, T Style::*Prop>
struct Ref {
Style& style;
operator T() const { return style.*Prop; }
operator T() const {
return style.*Prop;
}
Ref<T, Prop>& operator=(T value) {
style.*Prop = value;
return *this;
@@ -59,8 +63,12 @@ public:
struct Ref {
Style& style;
Idx idx;
operator CompactValue() const { return (style.*Prop)[idx]; }
operator YGValue() const { return (style.*Prop)[idx]; }
operator CompactValue() const {
return (style.*Prop)[idx];
}
operator YGValue() const {
return (style.*Prop)[idx];
}
Ref& operator=(CompactValue value) {
(style.*Prop)[idx] = value;
return *this;
@@ -72,9 +80,15 @@ public:
style.*Prop = values;
return *this;
}
operator const Values<Idx>&() const { return style.*Prop; }
Ref operator[](Idx idx) { return {style, idx}; }
CompactValue operator[](Idx idx) const { return (style.*Prop)[idx]; }
operator const Values<Idx>&() const {
return style.*Prop;
}
Ref operator[](Idx idx) {
return {style, idx};
}
CompactValue operator[](Idx idx) const {
return (style.*Prop)[idx];
}
};
Style() {
@@ -83,7 +97,7 @@ public:
}
~Style() = default;
private:
private:
static constexpr uint8_t directionOffset = 0;
static constexpr uint8_t flexdirectionOffset =
directionOffset + minimumBitCount<YGDirection>();
@@ -121,14 +135,16 @@ private:
// Yoga specific properties, not compatible with flexbox specification
FloatOptional aspectRatio_ = {};
public:
public:
// for library users needing a type
using ValueRepr = std::remove_reference<decltype(margin_[0])>::type;
YGDirection direction() const {
return getEnumData<YGDirection>(flags, directionOffset);
}
BitfieldRef<YGDirection> direction() { return {*this, directionOffset}; }
BitfieldRef<YGDirection> direction() {
return {*this, directionOffset};
}
YGFlexDirection flexDirection() const {
return getEnumData<YGFlexDirection>(flags, flexdirectionOffset);
@@ -147,17 +163,23 @@ public:
YGAlign alignContent() const {
return getEnumData<YGAlign>(flags, alignContentOffset);
}
BitfieldRef<YGAlign> alignContent() { return {*this, alignContentOffset}; }
BitfieldRef<YGAlign> alignContent() {
return {*this, alignContentOffset};
}
YGAlign alignItems() const {
return getEnumData<YGAlign>(flags, alignItemsOffset);
}
BitfieldRef<YGAlign> alignItems() { return {*this, alignItemsOffset}; }
BitfieldRef<YGAlign> alignItems() {
return {*this, alignItemsOffset};
}
YGAlign alignSelf() const {
return getEnumData<YGAlign>(flags, alignSelfOffset);
}
BitfieldRef<YGAlign> alignSelf() { return {*this, alignSelfOffset}; }
BitfieldRef<YGAlign> alignSelf() {
return {*this, alignSelfOffset};
}
YGPositionType positionType() const {
return getEnumData<YGPositionType>(flags, positionTypeOffset);
@@ -166,62 +188,118 @@ public:
return {*this, positionTypeOffset};
}
YGWrap flexWrap() const { return getEnumData<YGWrap>(flags, flexWrapOffset); }
BitfieldRef<YGWrap> flexWrap() { return {*this, flexWrapOffset}; }
YGWrap flexWrap() const {
return getEnumData<YGWrap>(flags, flexWrapOffset);
}
BitfieldRef<YGWrap> flexWrap() {
return {*this, flexWrapOffset};
}
YGOverflow overflow() const {
return getEnumData<YGOverflow>(flags, overflowOffset);
}
BitfieldRef<YGOverflow> overflow() { return {*this, overflowOffset}; }
BitfieldRef<YGOverflow> overflow() {
return {*this, overflowOffset};
}
YGDisplay display() const {
return getEnumData<YGDisplay>(flags, displayOffset);
}
BitfieldRef<YGDisplay> display() { return {*this, displayOffset}; }
BitfieldRef<YGDisplay> display() {
return {*this, displayOffset};
}
FloatOptional flex() const { return flex_; }
Ref<FloatOptional, &Style::flex_> flex() { return {*this}; }
FloatOptional flex() const {
return flex_;
}
Ref<FloatOptional, &Style::flex_> flex() {
return {*this};
}
FloatOptional flexGrow() const { return flexGrow_; }
Ref<FloatOptional, &Style::flexGrow_> flexGrow() { return {*this}; }
FloatOptional flexGrow() const {
return flexGrow_;
}
Ref<FloatOptional, &Style::flexGrow_> flexGrow() {
return {*this};
}
FloatOptional flexShrink() const { return flexShrink_; }
Ref<FloatOptional, &Style::flexShrink_> flexShrink() { return {*this}; }
FloatOptional flexShrink() const {
return flexShrink_;
}
Ref<FloatOptional, &Style::flexShrink_> flexShrink() {
return {*this};
}
CompactValue flexBasis() const { return flexBasis_; }
Ref<CompactValue, &Style::flexBasis_> flexBasis() { return {*this}; }
CompactValue flexBasis() const {
return flexBasis_;
}
Ref<CompactValue, &Style::flexBasis_> flexBasis() {
return {*this};
}
const Edges& margin() const { return margin_; }
IdxRef<YGEdge, &Style::margin_> margin() { return {*this}; }
const Edges& margin() const {
return margin_;
}
IdxRef<YGEdge, &Style::margin_> margin() {
return {*this};
}
const Edges& position() const { return position_; }
IdxRef<YGEdge, &Style::position_> position() { return {*this}; }
const Edges& position() const {
return position_;
}
IdxRef<YGEdge, &Style::position_> position() {
return {*this};
}
const Edges& padding() const { return padding_; }
IdxRef<YGEdge, &Style::padding_> padding() { return {*this}; }
const Edges& padding() const {
return padding_;
}
IdxRef<YGEdge, &Style::padding_> padding() {
return {*this};
}
const Edges& border() const { return border_; }
IdxRef<YGEdge, &Style::border_> border() { return {*this}; }
const Edges& border() const {
return border_;
}
IdxRef<YGEdge, &Style::border_> border() {
return {*this};
}
const Gutters& gap() const { return gap_; }
IdxRef<YGGutter, &Style::gap_> gap() { return {*this}; }
const Gutters& gap() const {
return gap_;
}
IdxRef<YGGutter, &Style::gap_> gap() {
return {*this};
}
const Dimensions& dimensions() const { return dimensions_; }
IdxRef<YGDimension, &Style::dimensions_> dimensions() { return {*this}; }
const Dimensions& dimensions() const {
return dimensions_;
}
IdxRef<YGDimension, &Style::dimensions_> dimensions() {
return {*this};
}
const Dimensions& minDimensions() const { return minDimensions_; }
const Dimensions& minDimensions() const {
return minDimensions_;
}
IdxRef<YGDimension, &Style::minDimensions_> minDimensions() {
return {*this};
}
const Dimensions& maxDimensions() const { return maxDimensions_; }
const Dimensions& maxDimensions() const {
return maxDimensions_;
}
IdxRef<YGDimension, &Style::maxDimensions_> maxDimensions() {
return {*this};
}
// Yoga specific properties, not compatible with flexbox specification
FloatOptional aspectRatio() const { return aspectRatio_; }
Ref<FloatOptional, &Style::aspectRatio_> aspectRatio() { return {*this}; }
FloatOptional aspectRatio() const {
return aspectRatio_;
}
Ref<FloatOptional, &Style::aspectRatio_> aspectRatio() {
return {*this};
}
};
YG_EXPORT bool operator==(const Style& lhs, const Style& rhs);