Introduce YGNodeConstRef

Summary:
@public

Introduces `YGNodeConstRef` as `const YGNode*`, i.e. a pointer to a constant `YGNode`.
We also use it for all style getters, which will avoid casts to `const YGNode*` in diffs up the stack.

We should use this pointer type for all functions that do not modify the underlying node.

Reviewed By: SidharthGuglani

Differential Revision: D14999095

fbshipit-source-id: 61cc53bb35e787a12ae12e70438d84c0a4983752
This commit is contained in:
David Aurelio
2019-04-23 10:07:09 -07:00
committed by Facebook Github Bot
parent dee93017f7
commit e5d3baca81
2 changed files with 72 additions and 80 deletions

View File

@@ -522,15 +522,13 @@ void YGNodeCopyStyle(const YGNodeRef dstNode, const YGNodeRef srcNode) {
} }
} }
float YGNodeStyleGetFlexGrow(const YGNodeRef n) { float YGNodeStyleGetFlexGrow(const YGNodeConstRef node) {
const YGNode* node = n;
return node->getStyle().flexGrow().isUndefined() return node->getStyle().flexGrow().isUndefined()
? kDefaultFlexGrow ? kDefaultFlexGrow
: node->getStyle().flexGrow().unwrap(); : node->getStyle().flexGrow().unwrap();
} }
float YGNodeStyleGetFlexShrink(const YGNodeRef n) { float YGNodeStyleGetFlexShrink(const YGNodeConstRef node) {
const YGNode* node = n;
return node->getStyle().flexShrink().isUndefined() return node->getStyle().flexShrink().isUndefined()
? (node->getConfig()->useWebDefaults ? kWebDefaultFlexShrink ? (node->getConfig()->useWebDefaults ? kWebDefaultFlexShrink
: kDefaultFlexShrink) : kDefaultFlexShrink)
@@ -597,7 +595,7 @@ void updateDimensionProp(
void YGNodeStyleSetDirection(const YGNodeRef node, const YGDirection value) { void YGNodeStyleSetDirection(const YGNodeRef node, const YGDirection value) {
updateStyle<YGDirection, &YGStyle::direction>(node, value); updateStyle<YGDirection, &YGStyle::direction>(node, value);
} }
YGDirection YGNodeStyleGetDirection(const YGNodeRef node) { YGDirection YGNodeStyleGetDirection(const YGNodeConstRef node) {
return node->getStyle().direction(); return node->getStyle().direction();
} }
@@ -606,7 +604,7 @@ void YGNodeStyleSetFlexDirection(
const YGFlexDirection flexDirection) { const YGFlexDirection flexDirection) {
updateStyle<YGFlexDirection, &YGStyle::flexDirection>(node, flexDirection); updateStyle<YGFlexDirection, &YGStyle::flexDirection>(node, flexDirection);
} }
YGFlexDirection YGNodeStyleGetFlexDirection(const YGNodeRef node) { YGFlexDirection YGNodeStyleGetFlexDirection(const YGNodeConstRef node) {
return node->getStyle().flexDirection(); return node->getStyle().flexDirection();
} }
@@ -615,7 +613,7 @@ void YGNodeStyleSetJustifyContent(
const YGJustify justifyContent) { const YGJustify justifyContent) {
updateStyle<YGJustify, &YGStyle::justifyContent>(node, justifyContent); updateStyle<YGJustify, &YGStyle::justifyContent>(node, justifyContent);
} }
YGJustify YGNodeStyleGetJustifyContent(const YGNodeRef node) { YGJustify YGNodeStyleGetJustifyContent(const YGNodeConstRef node) {
return node->getStyle().justifyContent(); return node->getStyle().justifyContent();
} }
@@ -624,21 +622,21 @@ void YGNodeStyleSetAlignContent(
const YGAlign alignContent) { const YGAlign alignContent) {
updateStyle<YGAlign, &YGStyle::alignContent>(node, alignContent); updateStyle<YGAlign, &YGStyle::alignContent>(node, alignContent);
} }
YGAlign YGNodeStyleGetAlignContent(const YGNodeRef node) { YGAlign YGNodeStyleGetAlignContent(const YGNodeConstRef node) {
return node->getStyle().alignContent(); return node->getStyle().alignContent();
} }
void YGNodeStyleSetAlignItems(const YGNodeRef node, const YGAlign alignItems) { void YGNodeStyleSetAlignItems(const YGNodeRef node, const YGAlign alignItems) {
updateStyle<YGAlign, &YGStyle::alignItems>(node, alignItems); updateStyle<YGAlign, &YGStyle::alignItems>(node, alignItems);
} }
YGAlign YGNodeStyleGetAlignItems(const YGNodeRef node) { YGAlign YGNodeStyleGetAlignItems(const YGNodeConstRef node) {
return node->getStyle().alignItems(); return node->getStyle().alignItems();
} }
void YGNodeStyleSetAlignSelf(const YGNodeRef node, const YGAlign alignSelf) { void YGNodeStyleSetAlignSelf(const YGNodeRef node, const YGAlign alignSelf) {
updateStyle<YGAlign, &YGStyle::alignSelf>(node, alignSelf); updateStyle<YGAlign, &YGStyle::alignSelf>(node, alignSelf);
} }
YGAlign YGNodeStyleGetAlignSelf(const YGNodeRef node) { YGAlign YGNodeStyleGetAlignSelf(const YGNodeConstRef node) {
return node->getStyle().alignSelf(); return node->getStyle().alignSelf();
} }
@@ -647,28 +645,28 @@ void YGNodeStyleSetPositionType(
const YGPositionType positionType) { const YGPositionType positionType) {
updateStyle<YGPositionType, &YGStyle::positionType>(node, positionType); updateStyle<YGPositionType, &YGStyle::positionType>(node, positionType);
} }
YGPositionType YGNodeStyleGetPositionType(const YGNodeRef node) { YGPositionType YGNodeStyleGetPositionType(const YGNodeConstRef node) {
return node->getStyle().positionType(); return node->getStyle().positionType();
} }
void YGNodeStyleSetFlexWrap(const YGNodeRef node, const YGWrap flexWrap) { void YGNodeStyleSetFlexWrap(const YGNodeRef node, const YGWrap flexWrap) {
updateStyle<YGWrap, &YGStyle::flexWrap>(node, flexWrap); updateStyle<YGWrap, &YGStyle::flexWrap>(node, flexWrap);
} }
YGWrap YGNodeStyleGetFlexWrap(const YGNodeRef node) { YGWrap YGNodeStyleGetFlexWrap(const YGNodeConstRef node) {
return node->getStyle().flexWrap(); return node->getStyle().flexWrap();
} }
void YGNodeStyleSetOverflow(const YGNodeRef node, const YGOverflow overflow) { void YGNodeStyleSetOverflow(const YGNodeRef node, const YGOverflow overflow) {
updateStyle<YGOverflow, &YGStyle::overflow>(node, overflow); updateStyle<YGOverflow, &YGStyle::overflow>(node, overflow);
} }
YGOverflow YGNodeStyleGetOverflow(const YGNodeRef node) { YGOverflow YGNodeStyleGetOverflow(const YGNodeConstRef node) {
return node->getStyle().overflow(); return node->getStyle().overflow();
} }
void YGNodeStyleSetDisplay(const YGNodeRef node, const YGDisplay display) { void YGNodeStyleSetDisplay(const YGNodeRef node, const YGDisplay display) {
updateStyle<YGDisplay, &YGStyle::display>(node, display); updateStyle<YGDisplay, &YGStyle::display>(node, display);
} }
YGDisplay YGNodeStyleGetDisplay(const YGNodeRef node) { YGDisplay YGNodeStyleGetDisplay(const YGNodeConstRef node) {
return node->getStyle().display(); return node->getStyle().display();
} }
@@ -678,9 +676,10 @@ void YGNodeStyleSetFlex(const YGNodeRef node, const float flex) {
} }
// TODO(T26792433): Change the API to accept YGFloatOptional. // TODO(T26792433): Change the API to accept YGFloatOptional.
float YGNodeStyleGetFlex(const YGNodeRef node) { float YGNodeStyleGetFlex(const YGNodeConstRef node) {
const auto& style = node->getStyle(); return node->getStyle().flex().isUndefined()
return style.flex().isUndefined() ? YGUndefined : style.flex().unwrap(); ? YGUndefined
: node->getStyle().flex().unwrap();
} }
// TODO(T26792433): Change the API to accept YGFloatOptional. // TODO(T26792433): Change the API to accept YGFloatOptional.
@@ -695,8 +694,13 @@ void YGNodeStyleSetFlexShrink(const YGNodeRef node, const float flexShrink) {
node, YGFloatOptional{flexShrink}); node, YGFloatOptional{flexShrink});
} }
YGValue YGNodeStyleGetFlexBasis(const YGNodeRef node) { YGValue YGNodeStyleGetFlexBasis(const YGNodeConstRef node) {
return static_cast<const YGNode*>(node)->getStyle().flexBasis(); YGValue flexBasis = node->getStyle().flexBasis();
if (flexBasis.unit == YGUnitUndefined || flexBasis.unit == YGUnitAuto) {
// TODO(T26792433): Get rid off the use of YGUndefined at client side
flexBasis.value = YGUndefined;
}
return flexBasis;
} }
void YGNodeStyleSetFlexBasis(const YGNodeRef node, const float flexBasis) { void YGNodeStyleSetFlexBasis(const YGNodeRef node, const float flexBasis) {
@@ -724,8 +728,8 @@ void YGNodeStyleSetPositionPercent(YGNodeRef node, YGEdge edge, float percent) {
auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(percent); auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(percent);
updateEdgeProp<&YGStyle::position>(node, edge, value); updateEdgeProp<&YGStyle::position>(node, edge, value);
} }
YGValue YGNodeStyleGetPosition(YGNodeRef node, YGEdge edge) { YGValue YGNodeStyleGetPosition(YGNodeConstRef node, YGEdge edge) {
return static_cast<const YGNode*>(node)->getStyle().position()[edge]; return node->getStyle().position()[edge];
} }
void YGNodeStyleSetMargin(YGNodeRef node, YGEdge edge, float points) { void YGNodeStyleSetMargin(YGNodeRef node, YGEdge edge, float points) {
@@ -739,8 +743,8 @@ void YGNodeStyleSetMarginPercent(YGNodeRef node, YGEdge edge, float percent) {
void YGNodeStyleSetMarginAuto(YGNodeRef node, YGEdge edge) { void YGNodeStyleSetMarginAuto(YGNodeRef node, YGEdge edge) {
updateEdgeProp<&YGStyle::margin>(node, edge, detail::CompactValue::ofAuto()); updateEdgeProp<&YGStyle::margin>(node, edge, detail::CompactValue::ofAuto());
} }
YGValue YGNodeStyleGetMargin(YGNodeRef node, YGEdge edge) { YGValue YGNodeStyleGetMargin(YGNodeConstRef node, YGEdge edge) {
return static_cast<const YGNode*>(node)->getStyle().margin()[edge]; return node->getStyle().margin()[edge];
} }
void YGNodeStyleSetPadding(YGNodeRef node, YGEdge edge, float points) { void YGNodeStyleSetPadding(YGNodeRef node, YGEdge edge, float points) {
@@ -751,8 +755,8 @@ void YGNodeStyleSetPaddingPercent(YGNodeRef node, YGEdge edge, float percent) {
auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(percent); auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(percent);
updateEdgeProp<&YGStyle::padding>(node, edge, value); updateEdgeProp<&YGStyle::padding>(node, edge, value);
} }
YGValue YGNodeStyleGetPadding(YGNodeRef node, YGEdge edge) { YGValue YGNodeStyleGetPadding(YGNodeConstRef node, YGEdge edge) {
return static_cast<const YGNode*>(node)->getStyle().padding()[edge]; return node->getStyle().padding()[edge];
} }
// TODO(T26792433): Change the API to accept YGFloatOptional. // TODO(T26792433): Change the API to accept YGFloatOptional.
@@ -764,22 +768,21 @@ void YGNodeStyleSetBorder(
updateEdgeProp<&YGStyle::border>(node, edge, value); updateEdgeProp<&YGStyle::border>(node, edge, value);
} }
float YGNodeStyleGetBorder(const YGNodeRef node, const YGEdge edge) { float YGNodeStyleGetBorder(const YGNodeConstRef node, const YGEdge edge) {
const auto& style = node->getStyle(); auto border = node->getStyle().border()[edge];
if (style.border()[edge].isUndefined() || style.border()[edge].isAuto()) { if (border.isUndefined() || border.isAuto()) {
// TODO(T26792433): Rather than returning YGUndefined, change the api to // TODO(T26792433): Rather than returning YGUndefined, change the api to
// return YGFloatOptional. // return YGFloatOptional.
return YGUndefined; return YGUndefined;
} }
auto border = (YGValue) style.border()[edge]; return static_cast<YGValue>(border).value;
return border.value;
} }
// Yoga specific properties, not compatible with flexbox specification // Yoga specific properties, not compatible with flexbox specification
// TODO(T26792433): Change the API to accept YGFloatOptional. // TODO(T26792433): Change the API to accept YGFloatOptional.
float YGNodeStyleGetAspectRatio(const YGNodeRef node) { float YGNodeStyleGetAspectRatio(const YGNodeConstRef node) {
const YGFloatOptional op = node->getStyle().aspectRatio(); const YGFloatOptional op = node->getStyle().aspectRatio();
return op.isUndefined() ? YGUndefined : op.unwrap(); return op.isUndefined() ? YGUndefined : op.unwrap();
} }
@@ -802,10 +805,8 @@ void YGNodeStyleSetWidthAuto(YGNodeRef node) {
updateDimensionProp<&YGStyle::dimensions>( updateDimensionProp<&YGStyle::dimensions>(
node, YGDimensionWidth, detail::CompactValue::ofAuto()); node, YGDimensionWidth, detail::CompactValue::ofAuto());
} }
YGValue YGNodeStyleGetWidth(YGNodeRef node) { YGValue YGNodeStyleGetWidth(YGNodeConstRef node) {
return static_cast<const YGNode*>(node) return node->getStyle().dimensions()[YGDimensionWidth];
->getStyle()
.dimensions()[YGDimensionWidth];
} }
void YGNodeStyleSetHeight(YGNodeRef node, float points) { void YGNodeStyleSetHeight(YGNodeRef node, float points) {
@@ -820,10 +821,8 @@ void YGNodeStyleSetHeightAuto(YGNodeRef node) {
updateDimensionProp<&YGStyle::dimensions>( updateDimensionProp<&YGStyle::dimensions>(
node, YGDimensionHeight, detail::CompactValue::ofAuto()); node, YGDimensionHeight, detail::CompactValue::ofAuto());
} }
YGValue YGNodeStyleGetHeight(YGNodeRef node) { YGValue YGNodeStyleGetHeight(YGNodeConstRef node) {
return static_cast<const YGNode*>(node) return node->getStyle().dimensions()[YGDimensionHeight];
->getStyle()
.dimensions()[YGDimensionHeight];
} }
void YGNodeStyleSetMinWidth(const YGNodeRef node, const float minWidth) { void YGNodeStyleSetMinWidth(const YGNodeRef node, const float minWidth) {
@@ -834,10 +833,8 @@ void YGNodeStyleSetMinWidthPercent(const YGNodeRef node, const float minWidth) {
auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(minWidth); auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(minWidth);
updateDimensionProp<&YGStyle::minDimensions>(node, YGDimensionWidth, value); updateDimensionProp<&YGStyle::minDimensions>(node, YGDimensionWidth, value);
} }
YGValue YGNodeStyleGetMinWidth(const YGNodeRef node) { YGValue YGNodeStyleGetMinWidth(const YGNodeConstRef node) {
return static_cast<const YGNode*>(node) return node->getStyle().minDimensions()[YGDimensionWidth];
->getStyle()
.minDimensions()[YGDimensionWidth];
}; };
void YGNodeStyleSetMinHeight(const YGNodeRef node, const float minHeight) { void YGNodeStyleSetMinHeight(const YGNodeRef node, const float minHeight) {
@@ -850,10 +847,8 @@ void YGNodeStyleSetMinHeightPercent(
auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(minHeight); auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(minHeight);
updateDimensionProp<&YGStyle::minDimensions>(node, YGDimensionHeight, value); updateDimensionProp<&YGStyle::minDimensions>(node, YGDimensionHeight, value);
} }
YGValue YGNodeStyleGetMinHeight(const YGNodeRef node) { YGValue YGNodeStyleGetMinHeight(const YGNodeConstRef node) {
return static_cast<const YGNode*>(node) return node->getStyle().minDimensions()[YGDimensionHeight];
->getStyle()
.minDimensions()[YGDimensionHeight];
}; };
void YGNodeStyleSetMaxWidth(const YGNodeRef node, const float maxWidth) { void YGNodeStyleSetMaxWidth(const YGNodeRef node, const float maxWidth) {
@@ -864,10 +859,8 @@ void YGNodeStyleSetMaxWidthPercent(const YGNodeRef node, const float maxWidth) {
auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(maxWidth); auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(maxWidth);
updateDimensionProp<&YGStyle::maxDimensions>(node, YGDimensionWidth, value); updateDimensionProp<&YGStyle::maxDimensions>(node, YGDimensionWidth, value);
} }
YGValue YGNodeStyleGetMaxWidth(const YGNodeRef node) { YGValue YGNodeStyleGetMaxWidth(const YGNodeConstRef node) {
return static_cast<const YGNode*>(node) return node->getStyle().maxDimensions()[YGDimensionWidth];
->getStyle()
.maxDimensions()[YGDimensionWidth];
}; };
void YGNodeStyleSetMaxHeight(const YGNodeRef node, const float maxHeight) { void YGNodeStyleSetMaxHeight(const YGNodeRef node, const float maxHeight) {
@@ -880,10 +873,8 @@ void YGNodeStyleSetMaxHeightPercent(
auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(maxHeight); auto value = detail::CompactValue::ofMaybe<YGUnitPercent>(maxHeight);
updateDimensionProp<&YGStyle::maxDimensions>(node, YGDimensionHeight, value); updateDimensionProp<&YGStyle::maxDimensions>(node, YGDimensionHeight, value);
} }
YGValue YGNodeStyleGetMaxHeight(const YGNodeRef node) { YGValue YGNodeStyleGetMaxHeight(const YGNodeConstRef node) {
return static_cast<const YGNode*>(node) return node->getStyle().maxDimensions()[YGDimensionHeight];
->getStyle()
.maxDimensions()[YGDimensionHeight];
}; };
#define YG_NODE_LAYOUT_PROPERTY_IMPL(type, name, instanceName) \ #define YG_NODE_LAYOUT_PROPERTY_IMPL(type, name, instanceName) \

View File

@@ -31,6 +31,7 @@ typedef struct YGSize {
typedef struct YGConfig* YGConfigRef; typedef struct YGConfig* YGConfigRef;
typedef struct YGNode* YGNodeRef; typedef struct YGNode* YGNodeRef;
typedef const struct YGNode* YGNodeConstRef;
typedef YGSize (*YGMeasureFunc)( typedef YGSize (*YGMeasureFunc)(
YGNodeRef node, YGNodeRef node,
@@ -144,56 +145,56 @@ WIN_EXPORT bool YGNodeIsDirty(YGNodeRef node);
bool YGNodeLayoutGetDidUseLegacyFlag(YGNodeRef node); bool YGNodeLayoutGetDidUseLegacyFlag(YGNodeRef node);
WIN_EXPORT void YGNodeStyleSetDirection(YGNodeRef node, YGDirection direction); WIN_EXPORT void YGNodeStyleSetDirection(YGNodeRef node, YGDirection direction);
WIN_EXPORT YGDirection YGNodeStyleGetDirection(YGNodeRef node); WIN_EXPORT YGDirection YGNodeStyleGetDirection(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetFlexDirection( WIN_EXPORT void YGNodeStyleSetFlexDirection(
YGNodeRef node, YGNodeRef node,
YGFlexDirection flexDirection); YGFlexDirection flexDirection);
WIN_EXPORT YGFlexDirection YGNodeStyleGetFlexDirection(YGNodeRef node); WIN_EXPORT YGFlexDirection YGNodeStyleGetFlexDirection(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetJustifyContent( WIN_EXPORT void YGNodeStyleSetJustifyContent(
YGNodeRef node, YGNodeRef node,
YGJustify justifyContent); YGJustify justifyContent);
WIN_EXPORT YGJustify YGNodeStyleGetJustifyContent(YGNodeRef node); WIN_EXPORT YGJustify YGNodeStyleGetJustifyContent(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetAlignContent( WIN_EXPORT void YGNodeStyleSetAlignContent(
YGNodeRef node, YGNodeRef node,
YGAlign alignContent); YGAlign alignContent);
WIN_EXPORT YGAlign YGNodeStyleGetAlignContent(YGNodeRef node); WIN_EXPORT YGAlign YGNodeStyleGetAlignContent(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetAlignItems(YGNodeRef node, YGAlign alignItems); WIN_EXPORT void YGNodeStyleSetAlignItems(YGNodeRef node, YGAlign alignItems);
WIN_EXPORT YGAlign YGNodeStyleGetAlignItems(YGNodeRef node); WIN_EXPORT YGAlign YGNodeStyleGetAlignItems(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetAlignSelf(YGNodeRef node, YGAlign alignSelf); WIN_EXPORT void YGNodeStyleSetAlignSelf(YGNodeRef node, YGAlign alignSelf);
WIN_EXPORT YGAlign YGNodeStyleGetAlignSelf(YGNodeRef node); WIN_EXPORT YGAlign YGNodeStyleGetAlignSelf(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetPositionType( WIN_EXPORT void YGNodeStyleSetPositionType(
YGNodeRef node, YGNodeRef node,
YGPositionType positionType); YGPositionType positionType);
WIN_EXPORT YGPositionType YGNodeStyleGetPositionType(YGNodeRef node); WIN_EXPORT YGPositionType YGNodeStyleGetPositionType(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetFlexWrap(YGNodeRef node, YGWrap flexWrap); WIN_EXPORT void YGNodeStyleSetFlexWrap(YGNodeRef node, YGWrap flexWrap);
WIN_EXPORT YGWrap YGNodeStyleGetFlexWrap(YGNodeRef node); WIN_EXPORT YGWrap YGNodeStyleGetFlexWrap(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetOverflow(YGNodeRef node, YGOverflow overflow); WIN_EXPORT void YGNodeStyleSetOverflow(YGNodeRef node, YGOverflow overflow);
WIN_EXPORT YGOverflow YGNodeStyleGetOverflow(YGNodeRef node); WIN_EXPORT YGOverflow YGNodeStyleGetOverflow(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetDisplay(YGNodeRef node, YGDisplay display); WIN_EXPORT void YGNodeStyleSetDisplay(YGNodeRef node, YGDisplay display);
WIN_EXPORT YGDisplay YGNodeStyleGetDisplay(YGNodeRef node); WIN_EXPORT YGDisplay YGNodeStyleGetDisplay(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetFlex(YGNodeRef node, float flex); WIN_EXPORT void YGNodeStyleSetFlex(YGNodeRef node, float flex);
WIN_EXPORT float YGNodeStyleGetFlex(YGNodeRef node); WIN_EXPORT float YGNodeStyleGetFlex(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetFlexGrow(YGNodeRef node, float flexGrow); WIN_EXPORT void YGNodeStyleSetFlexGrow(YGNodeRef node, float flexGrow);
WIN_EXPORT float YGNodeStyleGetFlexGrow(YGNodeRef node); WIN_EXPORT float YGNodeStyleGetFlexGrow(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetFlexShrink(YGNodeRef node, float flexShrink); WIN_EXPORT void YGNodeStyleSetFlexShrink(YGNodeRef node, float flexShrink);
WIN_EXPORT float YGNodeStyleGetFlexShrink(YGNodeRef node); WIN_EXPORT float YGNodeStyleGetFlexShrink(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetFlexBasis(YGNodeRef node, float flexBasis); WIN_EXPORT void YGNodeStyleSetFlexBasis(YGNodeRef node, float flexBasis);
WIN_EXPORT void YGNodeStyleSetFlexBasisPercent(YGNodeRef node, float flexBasis); WIN_EXPORT void YGNodeStyleSetFlexBasisPercent(YGNodeRef node, float flexBasis);
WIN_EXPORT void YGNodeStyleSetFlexBasisAuto(YGNodeRef node); WIN_EXPORT void YGNodeStyleSetFlexBasisAuto(YGNodeRef node);
WIN_EXPORT YGValue YGNodeStyleGetFlexBasis(YGNodeRef node); WIN_EXPORT YGValue YGNodeStyleGetFlexBasis(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetPosition( WIN_EXPORT void YGNodeStyleSetPosition(
YGNodeRef node, YGNodeRef node,
@@ -203,7 +204,7 @@ WIN_EXPORT void YGNodeStyleSetPositionPercent(
YGNodeRef node, YGNodeRef node,
YGEdge edge, YGEdge edge,
float position); float position);
WIN_EXPORT YGValue YGNodeStyleGetPosition(YGNodeRef node, YGEdge edge); WIN_EXPORT YGValue YGNodeStyleGetPosition(YGNodeConstRef node, YGEdge edge);
WIN_EXPORT void YGNodeStyleSetMargin(YGNodeRef node, YGEdge edge, float margin); WIN_EXPORT void YGNodeStyleSetMargin(YGNodeRef node, YGEdge edge, float margin);
WIN_EXPORT void YGNodeStyleSetMarginPercent( WIN_EXPORT void YGNodeStyleSetMarginPercent(
@@ -211,7 +212,7 @@ WIN_EXPORT void YGNodeStyleSetMarginPercent(
YGEdge edge, YGEdge edge,
float margin); float margin);
WIN_EXPORT void YGNodeStyleSetMarginAuto(YGNodeRef node, YGEdge edge); WIN_EXPORT void YGNodeStyleSetMarginAuto(YGNodeRef node, YGEdge edge);
WIN_EXPORT YGValue YGNodeStyleGetMargin(YGNodeRef node, YGEdge edge); WIN_EXPORT YGValue YGNodeStyleGetMargin(YGNodeConstRef node, YGEdge edge);
WIN_EXPORT void YGNodeStyleSetPadding( WIN_EXPORT void YGNodeStyleSetPadding(
YGNodeRef node, YGNodeRef node,
@@ -221,36 +222,36 @@ WIN_EXPORT void YGNodeStyleSetPaddingPercent(
YGNodeRef node, YGNodeRef node,
YGEdge edge, YGEdge edge,
float padding); float padding);
WIN_EXPORT YGValue YGNodeStyleGetPadding(YGNodeRef node, YGEdge edge); WIN_EXPORT YGValue YGNodeStyleGetPadding(YGNodeConstRef node, YGEdge edge);
WIN_EXPORT void YGNodeStyleSetBorder(YGNodeRef node, YGEdge edge, float border); WIN_EXPORT void YGNodeStyleSetBorder(YGNodeRef node, YGEdge edge, float border);
WIN_EXPORT float YGNodeStyleGetBorder(YGNodeRef node, YGEdge edge); WIN_EXPORT float YGNodeStyleGetBorder(YGNodeConstRef node, YGEdge edge);
WIN_EXPORT void YGNodeStyleSetWidth(YGNodeRef node, float width); WIN_EXPORT void YGNodeStyleSetWidth(YGNodeRef node, float width);
WIN_EXPORT void YGNodeStyleSetWidthPercent(YGNodeRef node, float width); WIN_EXPORT void YGNodeStyleSetWidthPercent(YGNodeRef node, float width);
WIN_EXPORT void YGNodeStyleSetWidthAuto(YGNodeRef node); WIN_EXPORT void YGNodeStyleSetWidthAuto(YGNodeRef node);
WIN_EXPORT YGValue YGNodeStyleGetWidth(YGNodeRef node); WIN_EXPORT YGValue YGNodeStyleGetWidth(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetHeight(YGNodeRef node, float height); WIN_EXPORT void YGNodeStyleSetHeight(YGNodeRef node, float height);
WIN_EXPORT void YGNodeStyleSetHeightPercent(YGNodeRef node, float height); WIN_EXPORT void YGNodeStyleSetHeightPercent(YGNodeRef node, float height);
WIN_EXPORT void YGNodeStyleSetHeightAuto(YGNodeRef node); WIN_EXPORT void YGNodeStyleSetHeightAuto(YGNodeRef node);
WIN_EXPORT YGValue YGNodeStyleGetHeight(YGNodeRef node); WIN_EXPORT YGValue YGNodeStyleGetHeight(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetMinWidth(YGNodeRef node, float minWidth); WIN_EXPORT void YGNodeStyleSetMinWidth(YGNodeRef node, float minWidth);
WIN_EXPORT void YGNodeStyleSetMinWidthPercent(YGNodeRef node, float minWidth); WIN_EXPORT void YGNodeStyleSetMinWidthPercent(YGNodeRef node, float minWidth);
WIN_EXPORT YGValue YGNodeStyleGetMinWidth(YGNodeRef node); WIN_EXPORT YGValue YGNodeStyleGetMinWidth(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetMinHeight(YGNodeRef node, float minHeight); WIN_EXPORT void YGNodeStyleSetMinHeight(YGNodeRef node, float minHeight);
WIN_EXPORT void YGNodeStyleSetMinHeightPercent(YGNodeRef node, float minHeight); WIN_EXPORT void YGNodeStyleSetMinHeightPercent(YGNodeRef node, float minHeight);
WIN_EXPORT YGValue YGNodeStyleGetMinHeight(YGNodeRef node); WIN_EXPORT YGValue YGNodeStyleGetMinHeight(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetMaxWidth(YGNodeRef node, float maxWidth); WIN_EXPORT void YGNodeStyleSetMaxWidth(YGNodeRef node, float maxWidth);
WIN_EXPORT void YGNodeStyleSetMaxWidthPercent(YGNodeRef node, float maxWidth); WIN_EXPORT void YGNodeStyleSetMaxWidthPercent(YGNodeRef node, float maxWidth);
WIN_EXPORT YGValue YGNodeStyleGetMaxWidth(YGNodeRef node); WIN_EXPORT YGValue YGNodeStyleGetMaxWidth(YGNodeConstRef node);
WIN_EXPORT void YGNodeStyleSetMaxHeight(YGNodeRef node, float maxHeight); WIN_EXPORT void YGNodeStyleSetMaxHeight(YGNodeRef node, float maxHeight);
WIN_EXPORT void YGNodeStyleSetMaxHeightPercent(YGNodeRef node, float maxHeight); WIN_EXPORT void YGNodeStyleSetMaxHeightPercent(YGNodeRef node, float maxHeight);
WIN_EXPORT YGValue YGNodeStyleGetMaxHeight(YGNodeRef node); WIN_EXPORT YGValue YGNodeStyleGetMaxHeight(YGNodeConstRef node);
// Yoga specific properties, not compatible with flexbox specification Aspect // Yoga specific properties, not compatible with flexbox specification Aspect
// ratio control the size of the undefined dimension of a node. Aspect ratio is // ratio control the size of the undefined dimension of a node. Aspect ratio is
@@ -268,7 +269,7 @@ WIN_EXPORT YGValue YGNodeStyleGetMaxHeight(YGNodeRef node);
// in the cross axis if unset // in the cross axis if unset
// - Aspect ratio takes min/max dimensions into account // - Aspect ratio takes min/max dimensions into account
WIN_EXPORT void YGNodeStyleSetAspectRatio(YGNodeRef node, float aspectRatio); WIN_EXPORT void YGNodeStyleSetAspectRatio(YGNodeRef node, float aspectRatio);
WIN_EXPORT float YGNodeStyleGetAspectRatio(YGNodeRef node); WIN_EXPORT float YGNodeStyleGetAspectRatio(YGNodeConstRef node);
WIN_EXPORT float YGNodeLayoutGetLeft(YGNodeRef node); WIN_EXPORT float YGNodeLayoutGetLeft(YGNodeRef node);
WIN_EXPORT float YGNodeLayoutGetTop(YGNodeRef node); WIN_EXPORT float YGNodeLayoutGetTop(YGNodeRef node);