@@ -16,7 +16,7 @@ namespace {
1616
1717template <auto GetterT, auto SetterT, typename ValueT>
1818void updateStyle (YGNodeRef node, ValueT value) {
19- auto & style = resolveRef (node)->getStyle ();
19+ auto & style = resolveRef (node)->style ();
2020 if ((style.*GetterT)() != value) {
2121 (style.*SetterT)(value);
2222 resolveRef (node)->markDirtyAndPropagate ();
@@ -25,7 +25,7 @@ void updateStyle(YGNodeRef node, ValueT value) {
2525
2626template <auto GetterT, auto SetterT, typename IdxT, typename ValueT>
2727void updateStyle (YGNodeRef node, IdxT idx, ValueT value) {
28- auto & style = resolveRef (node)->getStyle ();
28+ auto & style = resolveRef (node)->style ();
2929 if ((style.*GetterT)(idx) != value) {
3030 (style.*SetterT)(idx, value);
3131 resolveRef (node)->markDirtyAndPropagate ();
@@ -40,8 +40,8 @@ void YGNodeCopyStyle(
4040 auto dstNode = resolveRef (dstNodeRef);
4141 auto srcNode = resolveRef (srcNodeRef);
4242
43- if (!(dstNode->getStyle () == srcNode->getStyle ())) {
44- dstNode->setStyle (srcNode->getStyle ());
43+ if (!(dstNode->style () == srcNode->style ())) {
44+ dstNode->setStyle (srcNode->style ());
4545 dstNode->markDirtyAndPropagate ();
4646 }
4747}
@@ -51,7 +51,7 @@ void YGNodeStyleSetDirection(const YGNodeRef node, const YGDirection value) {
5151}
5252
5353YGDirection YGNodeStyleGetDirection (const YGNodeConstRef node) {
54- return unscopedEnum (resolveRef (node)->getStyle ().direction ());
54+ return unscopedEnum (resolveRef (node)->style ().direction ());
5555}
5656
5757void YGNodeStyleSetFlexDirection (
@@ -62,7 +62,7 @@ void YGNodeStyleSetFlexDirection(
6262}
6363
6464YGFlexDirection YGNodeStyleGetFlexDirection (const YGNodeConstRef node) {
65- return unscopedEnum (resolveRef (node)->getStyle ().flexDirection ());
65+ return unscopedEnum (resolveRef (node)->style ().flexDirection ());
6666}
6767
6868void YGNodeStyleSetJustifyContent (
@@ -73,7 +73,7 @@ void YGNodeStyleSetJustifyContent(
7373}
7474
7575YGJustify YGNodeStyleGetJustifyContent (const YGNodeConstRef node) {
76- return unscopedEnum (resolveRef (node)->getStyle ().justifyContent ());
76+ return unscopedEnum (resolveRef (node)->style ().justifyContent ());
7777}
7878
7979void YGNodeStyleSetAlignContent (
@@ -84,7 +84,7 @@ void YGNodeStyleSetAlignContent(
8484}
8585
8686YGAlign YGNodeStyleGetAlignContent (const YGNodeConstRef node) {
87- return unscopedEnum (resolveRef (node)->getStyle ().alignContent ());
87+ return unscopedEnum (resolveRef (node)->style ().alignContent ());
8888}
8989
9090void YGNodeStyleSetAlignItems (const YGNodeRef node, const YGAlign alignItems) {
@@ -93,7 +93,7 @@ void YGNodeStyleSetAlignItems(const YGNodeRef node, const YGAlign alignItems) {
9393}
9494
9595YGAlign YGNodeStyleGetAlignItems (const YGNodeConstRef node) {
96- return unscopedEnum (resolveRef (node)->getStyle ().alignItems ());
96+ return unscopedEnum (resolveRef (node)->style ().alignItems ());
9797}
9898
9999void YGNodeStyleSetAlignSelf (const YGNodeRef node, const YGAlign alignSelf) {
@@ -102,7 +102,7 @@ void YGNodeStyleSetAlignSelf(const YGNodeRef node, const YGAlign alignSelf) {
102102}
103103
104104YGAlign YGNodeStyleGetAlignSelf (const YGNodeConstRef node) {
105- return unscopedEnum (resolveRef (node)->getStyle ().alignSelf ());
105+ return unscopedEnum (resolveRef (node)->style ().alignSelf ());
106106}
107107
108108void YGNodeStyleSetPositionType (
@@ -113,7 +113,7 @@ void YGNodeStyleSetPositionType(
113113}
114114
115115YGPositionType YGNodeStyleGetPositionType (const YGNodeConstRef node) {
116- return unscopedEnum (resolveRef (node)->getStyle ().positionType ());
116+ return unscopedEnum (resolveRef (node)->style ().positionType ());
117117}
118118
119119void YGNodeStyleSetFlexWrap (const YGNodeRef node, const YGWrap flexWrap) {
@@ -122,7 +122,7 @@ void YGNodeStyleSetFlexWrap(const YGNodeRef node, const YGWrap flexWrap) {
122122}
123123
124124YGWrap YGNodeStyleGetFlexWrap (const YGNodeConstRef node) {
125- return unscopedEnum (resolveRef (node)->getStyle ().flexWrap ());
125+ return unscopedEnum (resolveRef (node)->style ().flexWrap ());
126126}
127127
128128void YGNodeStyleSetOverflow (const YGNodeRef node, const YGOverflow overflow) {
@@ -131,15 +131,15 @@ void YGNodeStyleSetOverflow(const YGNodeRef node, const YGOverflow overflow) {
131131}
132132
133133YGOverflow YGNodeStyleGetOverflow (const YGNodeConstRef node) {
134- return unscopedEnum (resolveRef (node)->getStyle ().overflow ());
134+ return unscopedEnum (resolveRef (node)->style ().overflow ());
135135}
136136
137137void YGNodeStyleSetDisplay (const YGNodeRef node, const YGDisplay display) {
138138 updateStyle<&Style::display, &Style::setDisplay>(node, scopedEnum (display));
139139}
140140
141141YGDisplay YGNodeStyleGetDisplay (const YGNodeConstRef node) {
142- return unscopedEnum (resolveRef (node)->getStyle ().display ());
142+ return unscopedEnum (resolveRef (node)->style ().display ());
143143}
144144
145145void YGNodeStyleSetFlex (const YGNodeRef node, const float flex) {
@@ -148,9 +148,8 @@ void YGNodeStyleSetFlex(const YGNodeRef node, const float flex) {
148148
149149float YGNodeStyleGetFlex (const YGNodeConstRef nodeRef) {
150150 const auto node = resolveRef (nodeRef);
151- return node->getStyle ().flex ().isUndefined ()
152- ? YGUndefined
153- : node->getStyle ().flex ().unwrap ();
151+ return node->style ().flex ().isUndefined () ? YGUndefined
152+ : node->style ().flex ().unwrap ();
154153}
155154
156155void YGNodeStyleSetFlexGrow (const YGNodeRef node, const float flexGrow) {
@@ -160,9 +159,9 @@ void YGNodeStyleSetFlexGrow(const YGNodeRef node, const float flexGrow) {
160159
161160float YGNodeStyleGetFlexGrow (const YGNodeConstRef nodeRef) {
162161 const auto node = resolveRef (nodeRef);
163- return node->getStyle ().flexGrow ().isUndefined ()
162+ return node->style ().flexGrow ().isUndefined ()
164163 ? Style::DefaultFlexGrow
165- : node->getStyle ().flexGrow ().unwrap ();
164+ : node->style ().flexGrow ().unwrap ();
166165}
167166
168167void YGNodeStyleSetFlexShrink (const YGNodeRef node, const float flexShrink) {
@@ -172,10 +171,10 @@ void YGNodeStyleSetFlexShrink(const YGNodeRef node, const float flexShrink) {
172171
173172float YGNodeStyleGetFlexShrink (const YGNodeConstRef nodeRef) {
174173 const auto node = resolveRef (nodeRef);
175- return node->getStyle ().flexShrink ().isUndefined ()
174+ return node->style ().flexShrink ().isUndefined ()
176175 ? (node->getConfig ()->useWebDefaults () ? Style::WebDefaultFlexShrink
177176 : Style::DefaultFlexShrink)
178- : node->getStyle ().flexShrink ().unwrap ();
177+ : node->style ().flexShrink ().unwrap ();
179178}
180179
181180void YGNodeStyleSetFlexBasis (const YGNodeRef node, const float flexBasis) {
@@ -195,7 +194,7 @@ void YGNodeStyleSetFlexBasisAuto(const YGNodeRef node) {
195194}
196195
197196YGValue YGNodeStyleGetFlexBasis (const YGNodeConstRef node) {
198- return (YGValue)resolveRef (node)->getStyle ().flexBasis ();
197+ return (YGValue)resolveRef (node)->style ().flexBasis ();
199198}
200199
201200void YGNodeStyleSetPosition (YGNodeRef node, YGEdge edge, float points) {
@@ -209,7 +208,7 @@ void YGNodeStyleSetPositionPercent(YGNodeRef node, YGEdge edge, float percent) {
209208}
210209
211210YGValue YGNodeStyleGetPosition (YGNodeConstRef node, YGEdge edge) {
212- return (YGValue)resolveRef (node)->getStyle ().position (scopedEnum (edge));
211+ return (YGValue)resolveRef (node)->style ().position (scopedEnum (edge));
213212}
214213
215214void YGNodeStyleSetMargin (YGNodeRef node, YGEdge edge, float points) {
@@ -228,7 +227,7 @@ void YGNodeStyleSetMarginAuto(YGNodeRef node, YGEdge edge) {
228227}
229228
230229YGValue YGNodeStyleGetMargin (YGNodeConstRef node, YGEdge edge) {
231- return (YGValue)resolveRef (node)->getStyle ().margin (scopedEnum (edge));
230+ return (YGValue)resolveRef (node)->style ().margin (scopedEnum (edge));
232231}
233232
234233void YGNodeStyleSetPadding (YGNodeRef node, YGEdge edge, float points) {
@@ -242,7 +241,7 @@ void YGNodeStyleSetPaddingPercent(YGNodeRef node, YGEdge edge, float percent) {
242241}
243242
244243YGValue YGNodeStyleGetPadding (YGNodeConstRef node, YGEdge edge) {
245- return (YGValue)resolveRef (node)->getStyle ().padding (scopedEnum (edge));
244+ return (YGValue)resolveRef (node)->style ().padding (scopedEnum (edge));
246245}
247246
248247void YGNodeStyleSetBorder (
@@ -254,7 +253,7 @@ void YGNodeStyleSetBorder(
254253}
255254
256255float YGNodeStyleGetBorder (const YGNodeConstRef node, const YGEdge edge) {
257- auto border = resolveRef (node)->getStyle ().border (scopedEnum (edge));
256+ auto border = resolveRef (node)->style ().border (scopedEnum (edge));
258257 if (border.isUndefined () || border.isAuto ()) {
259258 return YGUndefined;
260259 }
@@ -271,7 +270,7 @@ void YGNodeStyleSetGap(
271270}
272271
273272float YGNodeStyleGetGap (const YGNodeConstRef node, const YGGutter gutter) {
274- auto gapLength = resolveRef (node)->getStyle ().gap (scopedEnum (gutter));
273+ auto gapLength = resolveRef (node)->style ().gap (scopedEnum (gutter));
275274 if (gapLength.isUndefined () || gapLength.isAuto ()) {
276275 return YGUndefined;
277276 }
@@ -285,7 +284,7 @@ void YGNodeStyleSetAspectRatio(const YGNodeRef node, const float aspectRatio) {
285284}
286285
287286float YGNodeStyleGetAspectRatio (const YGNodeConstRef node) {
288- const FloatOptional op = resolveRef (node)->getStyle ().aspectRatio ();
287+ const FloatOptional op = resolveRef (node)->style ().aspectRatio ();
289288 return op.isUndefined () ? YGUndefined : op.unwrap ();
290289}
291290
@@ -305,7 +304,7 @@ void YGNodeStyleSetWidthAuto(YGNodeRef node) {
305304}
306305
307306YGValue YGNodeStyleGetWidth (YGNodeConstRef node) {
308- return (YGValue)resolveRef (node)->getStyle ().dimension (Dimension::Width);
307+ return (YGValue)resolveRef (node)->style ().dimension (Dimension::Width);
309308}
310309
311310void YGNodeStyleSetHeight (YGNodeRef node, float points) {
@@ -324,7 +323,7 @@ void YGNodeStyleSetHeightAuto(YGNodeRef node) {
324323}
325324
326325YGValue YGNodeStyleGetHeight (YGNodeConstRef node) {
327- return (YGValue)resolveRef (node)->getStyle ().dimension (Dimension::Height);
326+ return (YGValue)resolveRef (node)->style ().dimension (Dimension::Height);
328327}
329328
330329void YGNodeStyleSetMinWidth (const YGNodeRef node, const float minWidth) {
@@ -338,7 +337,7 @@ void YGNodeStyleSetMinWidthPercent(const YGNodeRef node, const float minWidth) {
338337}
339338
340339YGValue YGNodeStyleGetMinWidth (const YGNodeConstRef node) {
341- return (YGValue)resolveRef (node)->getStyle ().minDimension (Dimension::Width);
340+ return (YGValue)resolveRef (node)->style ().minDimension (Dimension::Width);
342341}
343342
344343void YGNodeStyleSetMinHeight (const YGNodeRef node, const float minHeight) {
@@ -354,7 +353,7 @@ void YGNodeStyleSetMinHeightPercent(
354353}
355354
356355YGValue YGNodeStyleGetMinHeight (const YGNodeConstRef node) {
357- return (YGValue)resolveRef (node)->getStyle ().minDimension (Dimension::Height);
356+ return (YGValue)resolveRef (node)->style ().minDimension (Dimension::Height);
358357}
359358
360359void YGNodeStyleSetMaxWidth (const YGNodeRef node, const float maxWidth) {
@@ -368,7 +367,7 @@ void YGNodeStyleSetMaxWidthPercent(const YGNodeRef node, const float maxWidth) {
368367}
369368
370369YGValue YGNodeStyleGetMaxWidth (const YGNodeConstRef node) {
371- return (YGValue)resolveRef (node)->getStyle ().maxDimension (Dimension::Width);
370+ return (YGValue)resolveRef (node)->style ().maxDimension (Dimension::Width);
372371}
373372
374373void YGNodeStyleSetMaxHeight (const YGNodeRef node, const float maxHeight) {
@@ -384,5 +383,5 @@ void YGNodeStyleSetMaxHeightPercent(
384383}
385384
386385YGValue YGNodeStyleGetMaxHeight (const YGNodeConstRef node) {
387- return (YGValue)resolveRef (node)->getStyle ().maxDimension (Dimension::Height);
386+ return (YGValue)resolveRef (node)->style ().maxDimension (Dimension::Height);
388387}
0 commit comments