YGStyle: wrap all fields into accessors

Summary:
@public

In order to encapsulate property access on `YGStyle`, as a first measure we wrap all fields with accessors.

This will e.g. enable dynamic property storage and instrumentation in the future.

All accessors have a `const` version that allows direct access via `const&`. For mutation, bit fields are wrapped with a custom reference object.

This style allows for the least amount of changes in client code. Property access simply needs appended parens, eg `style.direction` becomes `style.direction`.

Reviewed By: shergin

Differential Revision: D14999096

fbshipit-source-id: fbf29f7ddab520513d4618f5e70094c4f6330b30
This commit is contained in:
David Aurelio
2019-04-23 08:12:35 -07:00
committed by Facebook Github Bot
parent af84193df4
commit 54af7fc645
16 changed files with 589 additions and 454 deletions
@@ -161,7 +161,7 @@ local_ref<JString> getPlatformComponentName(const ShadowView& shadowView) {
std::dynamic_pointer_cast<const ScrollViewProps>(shadowView.props);
if (newViewProps &&
newViewProps->yogaStyle.flexDirection == YGFlexDirectionRow) {
newViewProps->yogaStyle.flexDirection() == YGFlexDirectionRow) {
componentName = make_jstring("AndroidHorizontalScrollView");
} else {
componentName = make_jstring(shadowView.componentName);