Inline YG_NODE_STYLE_PROPERTY_UNIT_IMPL
macro
Reviewed By: astreet Differential Revision: D8874733 fbshipit-source-id: 75c24b508f287f405fad09605f64d2bfb3ffa0a5
This commit is contained in:
committed by
Facebook Github Bot
parent
85031baaf2
commit
1d09227374
@@ -639,19 +639,6 @@ struct DimensionProp {
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
#define YG_NODE_STYLE_PROPERTY_SETTER_UNIT_IMPL( \
|
|
||||||
type, name, paramName, instanceName, dimension) \
|
|
||||||
void YGNodeStyleSet##name(const YGNodeRef node, const type paramName) { \
|
|
||||||
DimensionProp<&YGStyle::instanceName>::set<dimension, YGUnitPoint>( \
|
|
||||||
node, paramName); \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
void YGNodeStyleSet##name##Percent( \
|
|
||||||
const YGNodeRef node, const type paramName) { \
|
|
||||||
DimensionProp<&YGStyle::instanceName>::set<dimension, YGUnitPercent>( \
|
|
||||||
node, paramName); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define YG_NODE_STYLE_PROPERTY_SETTER_UNIT_AUTO_IMPL( \
|
#define YG_NODE_STYLE_PROPERTY_SETTER_UNIT_AUTO_IMPL( \
|
||||||
type, name, paramName, instanceName) \
|
type, name, paramName, instanceName) \
|
||||||
void YGNodeStyleSet##name(const YGNodeRef node, const type paramName) { \
|
void YGNodeStyleSet##name(const YGNodeRef node, const type paramName) { \
|
||||||
@@ -685,15 +672,6 @@ struct DimensionProp {
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YG_NODE_STYLE_PROPERTY_UNIT_IMPL( \
|
|
||||||
type, name, paramName, instanceName, dimension) \
|
|
||||||
YG_NODE_STYLE_PROPERTY_SETTER_UNIT_IMPL( \
|
|
||||||
float, name, paramName, instanceName, dimension) \
|
|
||||||
\
|
|
||||||
type YGNodeStyleGet##name(const YGNodeRef node) { \
|
|
||||||
return DimensionProp<&YGStyle::instanceName>::get<dimension>(node); \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define YG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL( \
|
#define YG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL( \
|
||||||
type, name, paramName, instanceName) \
|
type, name, paramName, instanceName) \
|
||||||
YG_NODE_STYLE_PROPERTY_SETTER_UNIT_AUTO_IMPL( \
|
YG_NODE_STYLE_PROPERTY_SETTER_UNIT_AUTO_IMPL( \
|
||||||
@@ -1000,30 +978,59 @@ YG_NODE_STYLE_PROPERTY_UNIT_AUTO_IMPL(
|
|||||||
Height,
|
Height,
|
||||||
height,
|
height,
|
||||||
dimensions[YGDimensionHeight]);
|
dimensions[YGDimensionHeight]);
|
||||||
YG_NODE_STYLE_PROPERTY_UNIT_IMPL(
|
|
||||||
YGValue,
|
void YGNodeStyleSetMinWidth(const YGNodeRef node, const float minWidth) {
|
||||||
MinWidth,
|
DimensionProp<&YGStyle::minDimensions>::set<YGDimensionWidth, YGUnitPoint>(
|
||||||
minWidth,
|
node, minWidth);
|
||||||
minDimensions,
|
}
|
||||||
YGDimensionWidth);
|
void YGNodeStyleSetMinWidthPercent(const YGNodeRef node, const float minWidth) {
|
||||||
YG_NODE_STYLE_PROPERTY_UNIT_IMPL(
|
DimensionProp<&YGStyle::minDimensions>::set<YGDimensionWidth, YGUnitPercent>(
|
||||||
YGValue,
|
node, minWidth);
|
||||||
MinHeight,
|
}
|
||||||
minHeight,
|
YGValue YGNodeStyleGetMinWidth(const YGNodeRef node) {
|
||||||
minDimensions,
|
return DimensionProp<&YGStyle::minDimensions>::get<YGDimensionWidth>(node);
|
||||||
YGDimensionHeight);
|
};
|
||||||
YG_NODE_STYLE_PROPERTY_UNIT_IMPL(
|
|
||||||
YGValue,
|
void YGNodeStyleSetMinHeight(const YGNodeRef node, const float minHeight) {
|
||||||
MaxWidth,
|
DimensionProp<&YGStyle::minDimensions>::set<YGDimensionHeight, YGUnitPoint>(
|
||||||
maxWidth,
|
node, minHeight);
|
||||||
maxDimensions,
|
}
|
||||||
YGDimensionWidth);
|
void YGNodeStyleSetMinHeightPercent(
|
||||||
YG_NODE_STYLE_PROPERTY_UNIT_IMPL(
|
const YGNodeRef node,
|
||||||
YGValue,
|
const float minHeight) {
|
||||||
MaxHeight,
|
DimensionProp<&YGStyle::minDimensions>::set<YGDimensionHeight, YGUnitPercent>(
|
||||||
maxHeight,
|
node, minHeight);
|
||||||
maxDimensions,
|
}
|
||||||
YGDimensionHeight);
|
YGValue YGNodeStyleGetMinHeight(const YGNodeRef node) {
|
||||||
|
return DimensionProp<&YGStyle::minDimensions>::get<YGDimensionHeight>(node);
|
||||||
|
};
|
||||||
|
|
||||||
|
void YGNodeStyleSetMaxWidth(const YGNodeRef node, const float maxWidth) {
|
||||||
|
DimensionProp<&YGStyle::maxDimensions>::set<YGDimensionWidth, YGUnitPoint>(
|
||||||
|
node, maxWidth);
|
||||||
|
}
|
||||||
|
void YGNodeStyleSetMaxWidthPercent(const YGNodeRef node, const float maxWidth) {
|
||||||
|
DimensionProp<&YGStyle::maxDimensions>::set<YGDimensionWidth, YGUnitPercent>(
|
||||||
|
node, maxWidth);
|
||||||
|
}
|
||||||
|
YGValue YGNodeStyleGetMaxWidth(const YGNodeRef node) {
|
||||||
|
return DimensionProp<&YGStyle::maxDimensions>::get<YGDimensionWidth>(node);
|
||||||
|
};
|
||||||
|
|
||||||
|
void YGNodeStyleSetMaxHeight(const YGNodeRef node, const float maxHeight) {
|
||||||
|
DimensionProp<&YGStyle::maxDimensions>::set<YGDimensionHeight, YGUnitPoint>(
|
||||||
|
node, maxHeight);
|
||||||
|
}
|
||||||
|
void YGNodeStyleSetMaxHeightPercent(
|
||||||
|
const YGNodeRef node,
|
||||||
|
const float maxHeight) {
|
||||||
|
DimensionProp<&YGStyle::maxDimensions>::set<YGDimensionHeight, YGUnitPercent>(
|
||||||
|
node, maxHeight);
|
||||||
|
}
|
||||||
|
YGValue YGNodeStyleGetMaxHeight(const YGNodeRef node) {
|
||||||
|
return DimensionProp<&YGStyle::maxDimensions>::get<YGDimensionHeight>(node);
|
||||||
|
};
|
||||||
|
|
||||||
YG_NODE_LAYOUT_PROPERTY_IMPL(float, Left, position[YGEdgeLeft]);
|
YG_NODE_LAYOUT_PROPERTY_IMPL(float, Left, position[YGEdgeLeft]);
|
||||||
YG_NODE_LAYOUT_PROPERTY_IMPL(float, Top, position[YGEdgeTop]);
|
YG_NODE_LAYOUT_PROPERTY_IMPL(float, Top, position[YGEdgeTop]);
|
||||||
YG_NODE_LAYOUT_PROPERTY_IMPL(float, Right, position[YGEdgeRight]);
|
YG_NODE_LAYOUT_PROPERTY_IMPL(float, Right, position[YGEdgeRight]);
|
||||||
|
Reference in New Issue
Block a user