diff --git a/Yoga.podspec b/Yoga.podspec index 2b09977d..69c8c2a3 100644 --- a/Yoga.podspec +++ b/Yoga.podspec @@ -5,7 +5,7 @@ Pod::Spec.new do |spec| spec.name = 'Yoga' - spec.version = '1.14.0' + spec.version = '1.14.1' spec.license = { :type => 'MIT', :file => "LICENSE" } spec.homepage = 'https://yogalayout.com/' spec.documentation_url = 'https://yogalayout.com/docs' @@ -18,8 +18,8 @@ Pod::Spec.new do |spec| :git => 'https://github.com/facebook/yoga.git', :tag => spec.version.to_s, } - spec.platforms = { :ios => "8.0", :osx => "10.7", :tvos => "10.0", :watchos => "2.0" } - spec.module_name = 'yoga' + spec.platforms = { :ios => "8.0", :osx => "10.7", :tvos => "9.0", :watchos => "2.0" } + spec.module_name = 'Yoga' spec.requires_arc = false spec.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' @@ -33,6 +33,6 @@ Pod::Spec.new do |spec| '-fPIC' ] spec.source_files = 'yoga/**/*.{c,h,cpp}' - spec.public_header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGNode,YGStyle,YGValue}.h' - + spec.public_header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGValue}.h' + spec.static_framework = true end diff --git a/YogaKit.podspec b/YogaKit.podspec index 4fee15ec..5e7562e8 100644 --- a/YogaKit.podspec +++ b/YogaKit.podspec @@ -5,7 +5,7 @@ podspec = Pod::Spec.new do |spec| spec.name = 'YogaKit' - spec.version = '1.18.1' + spec.version = '1.18.2' spec.license = { :type => 'MIT', :file => "LICENSE" } spec.homepage = 'https://facebook.github.io/yoga/' spec.documentation_url = 'https://facebook.github.io/yoga/docs/' @@ -19,19 +19,18 @@ podspec = Pod::Spec.new do |spec| :tag => "1.18.0", } - spec.platform = :ios - spec.ios.deployment_target = '8.0' - spec.ios.frameworks = 'UIKit' + spec.platforms = { :ios => "8.0", :osx => "10.9", :tvos => "9.0" } spec.module_name = 'YogaKit' - spec.dependency 'Yoga', '~> 1.14' + spec.dependency 'Yoga', '~> 1.14.1' # Fixes the bug related the xcode 11 not able to find swift related frameworks. # https://github.com/Carthage/Carthage/issues/2825 # https://twitter.com/krzyzanowskim/status/1151549874653081601?s=21 spec.pod_target_xcconfig = {"LD_VERIFY_BITCODE": "NO"} spec.source_files = 'YogaKit/Source/*.{h,m,swift}' - spec.public_header_files = 'YogaKit/Source/{YGLayout,UIView+Yoga}.h' + spec.public_header_files = 'YogaKit/Source/{YGLayout,UIView+Yoga,YogaKit}.h' spec.private_header_files = 'YogaKit/Source/YGLayout+Private.h' spec.swift_version = '5.1' + spec.static_framework = true end # See https://github.com/facebook/yoga/pull/366 diff --git a/YogaKit.xcodeproj b/YogaKit.xcodeproj new file mode 120000 index 00000000..c6fba3de --- /dev/null +++ b/YogaKit.xcodeproj @@ -0,0 +1 @@ +YogaKit/YogaKit.xcodeproj \ No newline at end of file diff --git a/YogaKit/Source/UIView+Yoga.h b/YogaKit/Source/UIView+Yoga.h index 4c85dcc4..94d5fa72 100644 --- a/YogaKit/Source/UIView+Yoga.h +++ b/YogaKit/Source/UIView+Yoga.h @@ -5,7 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -#import #import "YGLayout.h" NS_ASSUME_NONNULL_BEGIN @@ -34,4 +33,9 @@ typedef void (^YGLayoutConfigurationBlock)(YGLayout* layout); @end + +@interface UIView (YogaKitAutoApplyLayout) + +@end + NS_ASSUME_NONNULL_END diff --git a/YogaKit/Source/UIView+Yoga.m b/YogaKit/Source/UIView+Yoga.m index e472c9c7..3efd2722 100644 --- a/YogaKit/Source/UIView+Yoga.m +++ b/YogaKit/Source/UIView+Yoga.m @@ -35,3 +35,116 @@ static const void* kYGYogaAssociatedKey = &kYGYogaAssociatedKey; } @end + + +static const void* kYGBoundsSizeAssociatedKey = &kYGBoundsSizeAssociatedKey; +static void YogaSwizzleInstanceMethod(Class cls, SEL originalSelector, SEL swizzledSelector); + +@implementation UIView (YogaKitAutoApplyLayout) + ++ (void)load { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + YogaSwizzleInstanceMethod(self, @selector(initWithFrame:), @selector(_yoga_initWithFrame:)); + YogaSwizzleInstanceMethod(self, @selector(setFrame:), @selector(_yoga_setFrame:)); + YogaSwizzleInstanceMethod(self, @selector(setBounds:), @selector(_yoga_setBounds:)); +#if TARGET_OS_OSX + YogaSwizzleInstanceMethod(self, @selector(setFrameSize:), @selector(_yoga_setFrameSize:)); + YogaSwizzleInstanceMethod(self, @selector(setBoundsSize:), @selector(_yoga_setBoundsSize:)); +#endif + }); +} + +- (CGSize)_yoga_boundsSize { + NSValue *value = (NSValue *)objc_getAssociatedObject(self, kYGBoundsSizeAssociatedKey); + + return value ? +#if TARGET_OS_OSX + value.sizeValue +#else + value.CGSizeValue +#endif + : CGSizeMake(YGUndefined, YGUndefined); +} + +- (void)set_yoga_boundsSize:(CGSize)size { + objc_setAssociatedObject(self, + kYGBoundsSizeAssociatedKey, +#if TARGET_OS_OSX + [NSValue valueWithSize:size] +#else + [NSValue valueWithCGSize:size] +#endif + , OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +- (instancetype)_yoga_initWithFrame:(CGRect)frame { + id _self = [self _yoga_initWithFrame:frame]; + if (_self) { + [self _yoga_applyLayout]; + } + + return _self; +} + +- (void)_yoga_setFrame:(CGRect)frame { + [self _yoga_setFrame:frame]; + + [self _yoga_applyLayout]; +} + +- (void)_yoga_setBounds:(CGRect)bounds { + [self _yoga_setBounds:bounds]; + + [self _yoga_applyLayout]; +} + +#if TARGET_OS_OSX +- (void)_yoga_setFrameSize:(NSSize)newSize { + [self _yoga_setFrameSize:newSize]; + + [self _yoga_applyLayout]; +} + +- (void)_yoga_setBoundsSize:(NSSize)newSize { + [self _yoga_setBoundsSize:newSize]; + + [self _yoga_applyLayout]; +} +#endif + +- (void)_yoga_applyLayout { + if (self.isYogaEnabled && self.yoga.isEnabled) { + CGSize size = self.bounds.size; + CGSize prev = self._yoga_boundsSize; + if (!CGSizeEqualToSize(size, prev)) { + self._yoga_boundsSize = size; + [self.yoga applyLayoutPreservingOrigin:YES]; + } + } +} + +@end + + +static void YogaSwizzleInstanceMethod(Class cls, SEL originalSelector, SEL swizzledSelector) { + if (!cls || !originalSelector || !swizzledSelector) { + return; + } + + Method originalMethod = class_getInstanceMethod(cls, originalSelector); + Method swizzledMethod = class_getInstanceMethod(cls, swizzledSelector); + if (!originalMethod || !swizzledMethod) { + return; + } + + IMP swizzledIMP = method_getImplementation(swizzledMethod); + if (class_addMethod(cls, originalSelector, swizzledIMP, method_getTypeEncoding(swizzledMethod))) { + class_replaceMethod(cls, + swizzledSelector, + method_getImplementation(originalMethod), + method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, swizzledMethod); + } +} diff --git a/YogaKit/Source/YGLayout.h b/YogaKit/Source/YGLayout.h index 5a60f95e..2e13b024 100644 --- a/YogaKit/Source/YGLayout.h +++ b/YogaKit/Source/YGLayout.h @@ -5,7 +5,14 @@ * LICENSE file in the root directory of this source tree. */ +#import +#if TARGET_OS_OSX +#import +#define UIView NSView +#else #import +#endif + #import #import #import diff --git a/YogaKit/Source/YGLayout.m b/YogaKit/Source/YGLayout.m index 4a95a5ca..acdbf77a 100644 --- a/YogaKit/Source/YGLayout.m +++ b/YogaKit/Source/YGLayout.m @@ -149,19 +149,44 @@ lowercased_name, capitalized_name, capitalized_name, YGEdgeAll) YGValue YGPointValue(CGFloat value) { - return (YGValue){.value = value, .unit = YGUnitPoint}; + return (YGValue){.value = (YGFloat)value, .unit = YGUnitPoint}; } YGValue YGPercentValue(CGFloat value) { - return (YGValue){.value = value, .unit = YGUnitPercent}; + return (YGValue){.value = (YGFloat)value, .unit = YGUnitPercent}; } -static YGConfigRef globalConfig; +static CGFloat YGScaleFactor() { + static CGFloat scale; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^() { +#if TARGET_OS_OSX + scale = [NSScreen mainScreen].backingScaleFactor; +#else + scale = [UIScreen mainScreen].scale; +#endif + }); + + return scale; +} + +static YGConfigRef YGGlobalConfig() { + static YGConfigRef globalConfig; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^() { + globalConfig = YGConfigNew(); + YGConfigSetExperimentalFeatureEnabled(globalConfig, YGExperimentalFeatureWebFlexBasis, true); + YGConfigSetPointScaleFactor(globalConfig, YGScaleFactor()); + }); + + return globalConfig; +} @interface YGLayout () @property(nonatomic, weak, readonly) UIView* view; @property(nonatomic, assign, readonly) BOOL isUIView; +@property(nonatomic, assign) BOOL isApplingLayout; @end @@ -171,17 +196,10 @@ static YGConfigRef globalConfig; @synthesize isIncludedInLayout = _isIncludedInLayout; @synthesize node = _node; -+ (void)initialize { - globalConfig = YGConfigNew(); - YGConfigSetExperimentalFeatureEnabled( - globalConfig, YGExperimentalFeatureWebFlexBasis, true); - YGConfigSetPointScaleFactor(globalConfig, [UIScreen mainScreen].scale); -} - - (instancetype)initWithView:(UIView*)view { if (self = [super init]) { _view = view; - _node = YGNodeNewWithConfig(globalConfig); + _node = YGNodeNewWithConfig(YGGlobalConfig()); YGNodeSetContext(_node, (__bridge void*)view); _isEnabled = NO; _isIncludedInLayout = YES; @@ -225,9 +243,11 @@ static YGConfigRef globalConfig; @"This method must be called on the main thread."); if (self.isEnabled) { for (UIView* subview in self.view.subviews) { - YGLayout* const yoga = subview.yoga; - if (yoga.isEnabled && yoga.isIncludedInLayout) { - return NO; + if (subview.isYogaEnabled) { + YGLayout* const yoga = subview.yoga; + if (yoga.isEnabled && yoga.isIncludedInLayout) { + return NO; + } } } } @@ -292,11 +312,19 @@ YG_PROPERTY(CGFloat, aspectRatio, AspectRatio) } - (void)applyLayout { + if (self.isApplingLayout) { + return; + } + [self calculateLayoutWithSize:self.view.bounds.size]; YGApplyLayoutToViewHierarchy(self.view, NO); } - (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin { + if (self.isApplingLayout) { + return; + } + [self calculateLayoutWithSize:self.view.bounds.size]; YGApplyLayoutToViewHierarchy(self.view, preserveOrigin); } @@ -304,6 +332,10 @@ YG_PROPERTY(CGFloat, aspectRatio, AspectRatio) - (void)applyLayoutPreservingOrigin:(BOOL)preserveOrigin dimensionFlexibility: (YGDimensionFlexibility)dimensionFlexibility { + if (self.isApplingLayout) { + return; + } + CGSize size = self.view.bounds.size; if (dimensionFlexibility & YGDimensionFlexibilityFlexibleWidth) { size.width = YGUndefined; @@ -343,9 +375,9 @@ YG_PROPERTY(CGFloat, aspectRatio, AspectRatio) static YGSize YGMeasureView( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { const CGFloat constrainedWidth = (widthMode == YGMeasureModeUndefined) ? CGFLOAT_MAX : width; @@ -362,16 +394,24 @@ static YGSize YGMeasureView( // // See https://github.com/facebook/yoga/issues/606 for more information. if (!view.yoga.isUIView || [view.subviews count] > 0) { +#if TARGET_OS_OSX + CGSize fittingSize = view.fittingSize; + sizeThatFits = (CGSize){ + .width = MIN(constrainedWidth, fittingSize.width), + .height = MIN(constrainedHeight, fittingSize.height) + }; +#else sizeThatFits = [view sizeThatFits:(CGSize){ .width = constrainedWidth, .height = constrainedHeight, }]; +#endif } return (YGSize){ - .width = YGSanitizeMeasurement( + .width = (YGFloat)YGSanitizeMeasurement( constrainedWidth, sizeThatFits.width, widthMode), - .height = YGSanitizeMeasurement( + .height = (YGFloat)YGSanitizeMeasurement( constrainedHeight, sizeThatFits.height, heightMode), }; } @@ -422,7 +462,7 @@ static void YGAttachNodesFromViewHierachy(UIView* const view) { NSMutableArray* subviewsToInclude = [[NSMutableArray alloc] initWithCapacity:view.subviews.count]; for (UIView* subview in view.subviews) { - if (subview.yoga.isEnabled && subview.yoga.isIncludedInLayout) { + if (subview.isYogaEnabled && subview.yoga.isEnabled && subview.yoga.isIncludedInLayout) { [subviewsToInclude addObject:subview]; } } @@ -448,14 +488,9 @@ static void YGRemoveAllChildren(const YGNodeRef node) { YGNodeRemoveAllChildren(node); } -static CGFloat YGRoundPixelValue(CGFloat value) { - static CGFloat scale; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^() { - scale = [UIScreen mainScreen].scale; - }); - - return roundf(value * scale) / scale; +static inline CGSize YGAlignPixelSize(CGSize s) { + CGFloat scale = YGScaleFactor(); + return (CGSize) { .width = ceil(s.width * scale) / scale, .height = ceil(s.height * scale) / scale }; } static void YGApplyLayoutToViewHierarchy(UIView* view, BOOL preserveOrigin) { @@ -463,44 +498,78 @@ static void YGApplyLayoutToViewHierarchy(UIView* view, BOOL preserveOrigin) { [NSThread isMainThread], @"Framesetting should only be done on the main thread."); + if (!view.isYogaEnabled || !view.yoga.isEnabled) { + return; + } + const YGLayout* yoga = view.yoga; + if (yoga.isApplingLayout) { + return; + } + if (!yoga.isIncludedInLayout) { return; } + yoga.isApplingLayout = YES; + YGNodeRef node = yoga.node; - const CGPoint topLeft = { - YGNodeLayoutGetLeft(node), - YGNodeLayoutGetTop(node), - }; + + const CGPoint topLeft = (view.superview.isYogaEnabled && view.superview.yoga.isEnabled) ? (CGPoint) { + .x = YGNodeLayoutGetLeft(node), + .y = YGNodeLayoutGetTop(node) + } : CGPointZero; const CGPoint bottomRight = { - topLeft.x + YGNodeLayoutGetWidth(node), - topLeft.y + YGNodeLayoutGetHeight(node), + .x = (CGFloat)(topLeft.x + YGNodeLayoutGetWidth(node)), + .y = (CGFloat)(topLeft.y + YGNodeLayoutGetHeight(node)), }; +#if TARGET_OS_OSX const CGPoint origin = preserveOrigin ? view.frame.origin : CGPointZero; - view.frame = (CGRect){ - .origin = - { - .x = YGRoundPixelValue(topLeft.x + origin.x), - .y = YGRoundPixelValue(topLeft.y + origin.y), - }, - .size = - { - .width = YGRoundPixelValue(bottomRight.x) - - YGRoundPixelValue(topLeft.x), - .height = YGRoundPixelValue(bottomRight.y) - - YGRoundPixelValue(topLeft.y), - }, +#else + // use bounds/center and not frame if non-identity transform. + const CGPoint origin = preserveOrigin ? (CGPoint) { + .x = (CGFloat)(view.center.x - CGRectGetWidth(view.bounds) * 0.5), + .y = (CGFloat)(view.center.y - CGRectGetHeight(view.bounds) * 0.5) + } + : CGPointZero; +#endif + + CGRect frame = (CGRect) { + .origin = (CGPoint) { .x = topLeft.x + origin.x, .y = topLeft.y + origin.y, }, + .size = (CGSize) { .width = MAX(bottomRight.x - topLeft.x, 0), .height = MAX(bottomRight.y - topLeft.y, 0), } }; +#if TARGET_OS_OSX + if (!view.superview.isFlipped && view.superview.isYogaEnabled && view.superview.yoga.isEnabled) { + frame.origin.y = (CGFloat)(YGNodeLayoutGetHeight(view.superview.yoga.node) - CGRectGetMaxY(frame)); + } + + view.frame = (CGRect) { + .origin = frame.origin, + .size = YGAlignPixelSize(frame.size) + }; +#else + view.bounds = (CGRect) { + .origin = view.bounds.origin, + .size = YGAlignPixelSize(frame.size) + }; + + view.center = (CGPoint) { + .x = CGRectGetMidX(frame), + .y = CGRectGetMidY(frame) + }; +#endif + if (!yoga.isLeaf) { for (NSUInteger i = 0; i < view.subviews.count; i++) { YGApplyLayoutToViewHierarchy(view.subviews[i], NO); } } + + yoga.isApplingLayout = NO; } @end diff --git a/YogaKit/Source/YGLayoutExtensions.swift b/YogaKit/Source/YGLayoutExtensions.swift index 2157c0ff..5960f3d8 100644 --- a/YogaKit/Source/YGLayoutExtensions.swift +++ b/YogaKit/Source/YGLayoutExtensions.swift @@ -5,41 +5,41 @@ * LICENSE file in the root directory of this source tree. */ -import yoga; +import Yoga postfix operator % extension Int { public static postfix func %(value: Int) -> YGValue { - return YGValue(value: Float(value), unit: .percent) + return YGValue(value: YGFloat(value), unit: .percent) } } extension Float { public static postfix func %(value: Float) -> YGValue { - return YGValue(value: value, unit: .percent) + return YGValue(value: YGFloat(value), unit: .percent) } } extension CGFloat { public static postfix func %(value: CGFloat) -> YGValue { - return YGValue(value: Float(value), unit: .percent) + return YGValue(value: YGFloat(value), unit: .percent) } } extension YGValue : ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral { public init(integerLiteral value: Int) { - self = YGValue(value: Float(value), unit: .point) + self = YGValue(value: YGFloat(value), unit: .point) } public init(floatLiteral value: Float) { - self = YGValue(value: value, unit: .point) + self = YGValue(value: YGFloat(value), unit: .point) } public init(_ value: Float) { - self = YGValue(value: value, unit: .point) + self = YGValue(value: YGFloat(value), unit: .point) } public init(_ value: CGFloat) { - self = YGValue(value: Float(value), unit: .point) + self = YGValue(value: YGFloat(value), unit: .point) } } diff --git a/YogaKit/Source/YogaKit.h b/YogaKit/Source/YogaKit.h new file mode 100644 index 00000000..d0b107ff --- /dev/null +++ b/YogaKit/Source/YogaKit.h @@ -0,0 +1,10 @@ +// +// YogaKit.h +// YogaKit +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import "YGLayout.h" +#import "UIView+Yoga.h" diff --git a/YogaKit/Tests/Info.plist b/YogaKit/Tests/Info.plist index c317ef52..64d65ca4 100644 --- a/YogaKit/Tests/Info.plist +++ b/YogaKit/Tests/Info.plist @@ -3,19 +3,19 @@ CFBundleDevelopmentRegion - en + $(DEVELOPMENT_LANGUAGE) CFBundleExecutable - ${EXECUTABLE_NAME} + $(EXECUTABLE_NAME) CFBundleIdentifier - com.facebook.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 + CFBundleName + $(PRODUCT_NAME) CFBundlePackageType - BNDL + $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString 1.0 - CFBundleSignature - ???? CFBundleVersion 1 diff --git a/YogaKit/Tests/YogaKitTests.m b/YogaKit/Tests/YogaKitTests.m index 29b02be6..11724826 100644 --- a/YogaKit/Tests/YogaKitTests.m +++ b/YogaKit/Tests/YogaKitTests.m @@ -265,16 +265,28 @@ subview1.yoga.flexGrow = 1; [container addSubview:subview1]; + UIView *leafView = [[UIView alloc] init]; + leafView.yoga.isEnabled = YES; + [subview1 addSubview:leafView]; + UIView* subview2 = [[UIView alloc] initWithFrame:CGRectZero]; subview2.yoga.isEnabled = YES; subview2.yoga.flexGrow = 1; [container addSubview:subview2]; + leafView = [[UIView alloc] init]; + leafView.yoga.isEnabled = YES; + [subview2 addSubview:leafView]; + UIView* subview3 = [[UIView alloc] initWithFrame:CGRectZero]; subview3.yoga.isEnabled = YES; subview3.yoga.flexGrow = 1; [container addSubview:subview3]; + leafView = [[UIView alloc] init]; + leafView.yoga.isEnabled = YES; + [subview3 addSubview:leafView]; + [container.yoga applyLayoutPreservingOrigin:YES]; XCTAssertEqualWithAccuracy( diff --git a/YogaKit/Tests/dummy.swift b/YogaKit/Tests/dummy.swift new file mode 100644 index 00000000..3fcf602f --- /dev/null +++ b/YogaKit/Tests/dummy.swift @@ -0,0 +1,2 @@ +class YogaKitTestsDummy { +} diff --git a/YogaKit/Yoga-umbrella.h b/YogaKit/Yoga-umbrella.h new file mode 100644 index 00000000..65171543 --- /dev/null +++ b/YogaKit/Yoga-umbrella.h @@ -0,0 +1,9 @@ +#ifdef __OBJC__ +#import +#import +#endif + +#import "YGEnums.h" +#import "YGMacros.h" +#import "YGValue.h" +#import "Yoga.h" diff --git a/YogaKit/Yoga.modulemap b/YogaKit/Yoga.modulemap new file mode 100644 index 00000000..6f06443c --- /dev/null +++ b/YogaKit/Yoga.modulemap @@ -0,0 +1,6 @@ +framework module Yoga [system][extern_c] { + umbrella header "Yoga-umbrella.h" + + export * + module * { export * } +} diff --git a/YogaKit/YogaKit.xcodeproj/project.pbxproj b/YogaKit/YogaKit.xcodeproj/project.pbxproj new file mode 100644 index 00000000..a1c4ed66 --- /dev/null +++ b/YogaKit/YogaKit.xcodeproj/project.pbxproj @@ -0,0 +1,826 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 52; + objects = { + +/* Begin PBXBuildFile section */ + 153B526524E6AD8D008156D3 /* YogaKitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 153B526324E6AD8D008156D3 /* YogaKitTests.m */; }; + 153B526B24E6ADFA008156D3 /* Yoga.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15865FFE24E58BD800345BD7 /* Yoga.framework */; platformFilter = ios; }; + 153B526C24E6ADFA008156D3 /* YogaKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15865F5424E5834E00345BD7 /* YogaKit.framework */; platformFilter = ios; }; + 153B526E24E6AECF008156D3 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 153B526D24E6AECF008156D3 /* libc++.tbd */; platformFilter = ios; }; + 153D326F24E654A300EDDBEA /* Yoga-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 153D326E24E6549A00EDDBEA /* Yoga-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 153D327124E654EF00EDDBEA /* YGLayoutExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 153D327024E654EF00EDDBEA /* YGLayoutExtensions.swift */; }; + 154A6EF524E6B1260091264C /* dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 154A6EF424E6B1260091264C /* dummy.swift */; }; + 15865F6624E583F000345BD7 /* YGLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 15865F5F24E583F000345BD7 /* YGLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 15865F6724E583F000345BD7 /* UIView+Yoga.h in Headers */ = {isa = PBXBuildFile; fileRef = 15865F6024E583F000345BD7 /* UIView+Yoga.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 15865F6824E583F000345BD7 /* YGLayout+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 15865F6124E583F000345BD7 /* YGLayout+Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 15865F6924E583F000345BD7 /* YGLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 15865F6224E583F000345BD7 /* YGLayout.m */; }; + 15865F6A24E583F000345BD7 /* UIView+Yoga.m in Sources */ = {isa = PBXBuildFile; fileRef = 15865F6324E583F000345BD7 /* UIView+Yoga.m */; }; + 15865F6C24E583F000345BD7 /* YogaKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 15865F6524E583F000345BD7 /* YogaKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1586600824E58C0F00345BD7 /* Yoga.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15865FFE24E58BD800345BD7 /* Yoga.framework */; }; + 1586602924E58C3700345BD7 /* Utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1586600924E58C3600345BD7 /* Utils.cpp */; }; + 1586602A24E58C3700345BD7 /* experiments.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1586600B24E58C3600345BD7 /* experiments.cpp */; }; + 1586602B24E58C3700345BD7 /* experiments-inl.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586600C24E58C3600345BD7 /* experiments-inl.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586602C24E58C3700345BD7 /* experiments.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586600D24E58C3600345BD7 /* experiments.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586602D24E58C3700345BD7 /* YGStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1586600E24E58C3600345BD7 /* YGStyle.cpp */; }; + 1586602E24E58C3700345BD7 /* YGNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1586600F24E58C3600345BD7 /* YGNode.cpp */; }; + 1586602F24E58C3700345BD7 /* YGConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1586601024E58C3600345BD7 /* YGConfig.cpp */; }; + 1586603024E58C3700345BD7 /* Utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586601124E58C3600345BD7 /* Utils.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586603124E58C3700345BD7 /* BitUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586601224E58C3600345BD7 /* BitUtils.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586603224E58C3700345BD7 /* CompactValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586601324E58C3600345BD7 /* CompactValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586603324E58C3700345BD7 /* YGValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1586601424E58C3700345BD7 /* YGValue.cpp */; }; + 1586603424E58C3700345BD7 /* YGLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1586601524E58C3700345BD7 /* YGLayout.cpp */; }; + 1586603524E58C3700345BD7 /* log.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586601624E58C3700345BD7 /* log.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586603624E58C3700345BD7 /* YGNodePrint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1586601724E58C3700345BD7 /* YGNodePrint.cpp */; }; + 1586603724E58C3700345BD7 /* event.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586601924E58C3700345BD7 /* event.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586603824E58C3700345BD7 /* event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1586601A24E58C3700345BD7 /* event.cpp */; }; + 1586603924E58C3700345BD7 /* YGNodePrint.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586601B24E58C3700345BD7 /* YGNodePrint.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586603A24E58C3700345BD7 /* Yoga.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586601C24E58C3700345BD7 /* Yoga.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1586603B24E58C3700345BD7 /* YGFloatOptional.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586601D24E58C3700345BD7 /* YGFloatOptional.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586603C24E58C3700345BD7 /* YGConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586601E24E58C3700345BD7 /* YGConfig.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586603D24E58C3700345BD7 /* YGMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586601F24E58C3700345BD7 /* YGMacros.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1586603E24E58C3700345BD7 /* YGEnums.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586602024E58C3700345BD7 /* YGEnums.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1586603F24E58C3700345BD7 /* log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1586602124E58C3700345BD7 /* log.cpp */; }; + 1586604024E58C3700345BD7 /* YGStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586602224E58C3700345BD7 /* YGStyle.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586604124E58C3700345BD7 /* Yoga.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1586602324E58C3700345BD7 /* Yoga.cpp */; }; + 1586604224E58C3700345BD7 /* Yoga-internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586602424E58C3700345BD7 /* Yoga-internal.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586604324E58C3700345BD7 /* YGValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586602524E58C3700345BD7 /* YGValue.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1586604424E58C3700345BD7 /* YGLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586602624E58C3700345BD7 /* YGLayout.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586604524E58C3700345BD7 /* YGNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1586602724E58C3700345BD7 /* YGNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 1586604624E58C3700345BD7 /* YGEnums.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1586602824E58C3700345BD7 /* YGEnums.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 153B526724E6ADF4008156D3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15865F4B24E5834E00345BD7 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 15865FFD24E58BD800345BD7; + remoteInfo = Yoga; + }; + 153B526924E6ADF4008156D3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15865F4B24E5834E00345BD7 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 15865F5324E5834E00345BD7; + remoteInfo = YogaKit; + }; + 1586600624E58C0900345BD7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 15865F4B24E5834E00345BD7 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 15865FFD24E58BD800345BD7; + remoteInfo = Yoga; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 153B525B24E6AD6B008156D3 /* YogaKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YogaKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 153B526324E6AD8D008156D3 /* YogaKitTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = YogaKitTests.m; path = Tests/YogaKitTests.m; sourceTree = SOURCE_ROOT; }; + 153B526424E6AD8D008156D3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; name = Info.plist; path = Tests/Info.plist; sourceTree = SOURCE_ROOT; }; + 153B526D24E6AECF008156D3 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; + 153D326D24E6549A00EDDBEA /* Yoga.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = Yoga.modulemap; sourceTree = ""; }; + 153D326E24E6549A00EDDBEA /* Yoga-umbrella.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Yoga-umbrella.h"; sourceTree = ""; }; + 153D327024E654EF00EDDBEA /* YGLayoutExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YGLayoutExtensions.swift; sourceTree = ""; }; + 154A6EF424E6B1260091264C /* dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = dummy.swift; path = Tests/dummy.swift; sourceTree = SOURCE_ROOT; }; + 15865F5424E5834E00345BD7 /* YogaKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = YogaKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 15865F5F24E583F000345BD7 /* YGLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGLayout.h; sourceTree = ""; }; + 15865F6024E583F000345BD7 /* UIView+Yoga.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Yoga.h"; sourceTree = ""; }; + 15865F6124E583F000345BD7 /* YGLayout+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "YGLayout+Private.h"; sourceTree = ""; }; + 15865F6224E583F000345BD7 /* YGLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YGLayout.m; sourceTree = ""; }; + 15865F6324E583F000345BD7 /* UIView+Yoga.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Yoga.m"; sourceTree = ""; }; + 15865F6524E583F000345BD7 /* YogaKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YogaKit.h; sourceTree = ""; }; + 15865FFE24E58BD800345BD7 /* Yoga.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Yoga.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 1586600924E58C3600345BD7 /* Utils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Utils.cpp; sourceTree = ""; }; + 1586600B24E58C3600345BD7 /* experiments.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = experiments.cpp; sourceTree = ""; }; + 1586600C24E58C3600345BD7 /* experiments-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "experiments-inl.h"; sourceTree = ""; }; + 1586600D24E58C3600345BD7 /* experiments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = experiments.h; sourceTree = ""; }; + 1586600E24E58C3600345BD7 /* YGStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGStyle.cpp; sourceTree = ""; }; + 1586600F24E58C3600345BD7 /* YGNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGNode.cpp; sourceTree = ""; }; + 1586601024E58C3600345BD7 /* YGConfig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGConfig.cpp; sourceTree = ""; }; + 1586601124E58C3600345BD7 /* Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utils.h; sourceTree = ""; }; + 1586601224E58C3600345BD7 /* BitUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitUtils.h; sourceTree = ""; }; + 1586601324E58C3600345BD7 /* CompactValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompactValue.h; sourceTree = ""; }; + 1586601424E58C3700345BD7 /* YGValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGValue.cpp; sourceTree = ""; }; + 1586601524E58C3700345BD7 /* YGLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGLayout.cpp; sourceTree = ""; }; + 1586601624E58C3700345BD7 /* log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = log.h; sourceTree = ""; }; + 1586601724E58C3700345BD7 /* YGNodePrint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGNodePrint.cpp; sourceTree = ""; }; + 1586601924E58C3700345BD7 /* event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = event.h; sourceTree = ""; }; + 1586601A24E58C3700345BD7 /* event.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = event.cpp; sourceTree = ""; }; + 1586601B24E58C3700345BD7 /* YGNodePrint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGNodePrint.h; sourceTree = ""; }; + 1586601C24E58C3700345BD7 /* Yoga.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Yoga.h; sourceTree = ""; }; + 1586601D24E58C3700345BD7 /* YGFloatOptional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGFloatOptional.h; sourceTree = ""; }; + 1586601E24E58C3700345BD7 /* YGConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGConfig.h; sourceTree = ""; }; + 1586601F24E58C3700345BD7 /* YGMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGMacros.h; sourceTree = ""; }; + 1586602024E58C3700345BD7 /* YGEnums.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGEnums.h; sourceTree = ""; }; + 1586602124E58C3700345BD7 /* log.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = log.cpp; sourceTree = ""; }; + 1586602224E58C3700345BD7 /* YGStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGStyle.h; sourceTree = ""; }; + 1586602324E58C3700345BD7 /* Yoga.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Yoga.cpp; sourceTree = ""; }; + 1586602424E58C3700345BD7 /* Yoga-internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Yoga-internal.h"; sourceTree = ""; }; + 1586602524E58C3700345BD7 /* YGValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGValue.h; sourceTree = ""; }; + 1586602624E58C3700345BD7 /* YGLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGLayout.h; sourceTree = ""; }; + 1586602724E58C3700345BD7 /* YGNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YGNode.h; sourceTree = ""; }; + 1586602824E58C3700345BD7 /* YGEnums.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YGEnums.cpp; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 153B525824E6AD6B008156D3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 153B526E24E6AECF008156D3 /* libc++.tbd in Frameworks */, + 153B526B24E6ADFA008156D3 /* Yoga.framework in Frameworks */, + 153B526C24E6ADFA008156D3 /* YogaKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 15865F5124E5834E00345BD7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1586600824E58C0F00345BD7 /* Yoga.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 15865FFB24E58BD800345BD7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 153B525C24E6AD6B008156D3 /* YogaKitTests */ = { + isa = PBXGroup; + children = ( + 153B526424E6AD8D008156D3 /* Info.plist */, + 153B526324E6AD8D008156D3 /* YogaKitTests.m */, + 154A6EF424E6B1260091264C /* dummy.swift */, + ); + path = YogaKitTests; + sourceTree = ""; + }; + 153D326C24E6545A00EDDBEA /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 153D326E24E6549A00EDDBEA /* Yoga-umbrella.h */, + 153D326D24E6549A00EDDBEA /* Yoga.modulemap */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 15865F4A24E5834E00345BD7 = { + isa = PBXGroup; + children = ( + 15865F5624E5834E00345BD7 /* YogaKit */, + 15865FFF24E58BD800345BD7 /* Yoga */, + 153D326C24E6545A00EDDBEA /* Supporting Files */, + 153B525C24E6AD6B008156D3 /* YogaKitTests */, + 15865F5524E5834E00345BD7 /* Products */, + 15865FB824E584FF00345BD7 /* Frameworks */, + ); + sourceTree = ""; + }; + 15865F5524E5834E00345BD7 /* Products */ = { + isa = PBXGroup; + children = ( + 15865F5424E5834E00345BD7 /* YogaKit.framework */, + 15865FFE24E58BD800345BD7 /* Yoga.framework */, + 153B525B24E6AD6B008156D3 /* YogaKitTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 15865F5624E5834E00345BD7 /* YogaKit */ = { + isa = PBXGroup; + children = ( + 153D327024E654EF00EDDBEA /* YGLayoutExtensions.swift */, + 15865F6024E583F000345BD7 /* UIView+Yoga.h */, + 15865F6324E583F000345BD7 /* UIView+Yoga.m */, + 15865F5F24E583F000345BD7 /* YGLayout.h */, + 15865F6224E583F000345BD7 /* YGLayout.m */, + 15865F6124E583F000345BD7 /* YGLayout+Private.h */, + 15865F6524E583F000345BD7 /* YogaKit.h */, + ); + name = YogaKit; + path = Source; + sourceTree = ""; + }; + 15865FB824E584FF00345BD7 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 153B526D24E6AECF008156D3 /* libc++.tbd */, + ); + name = Frameworks; + sourceTree = ""; + }; + 15865FFF24E58BD800345BD7 /* Yoga */ = { + isa = PBXGroup; + children = ( + 1586601224E58C3600345BD7 /* BitUtils.h */, + 1586601324E58C3600345BD7 /* CompactValue.h */, + 1586601824E58C3700345BD7 /* event */, + 1586600A24E58C3600345BD7 /* internal */, + 1586602124E58C3700345BD7 /* log.cpp */, + 1586601624E58C3700345BD7 /* log.h */, + 1586600924E58C3600345BD7 /* Utils.cpp */, + 1586601124E58C3600345BD7 /* Utils.h */, + 1586601024E58C3600345BD7 /* YGConfig.cpp */, + 1586601E24E58C3700345BD7 /* YGConfig.h */, + 1586602824E58C3700345BD7 /* YGEnums.cpp */, + 1586602024E58C3700345BD7 /* YGEnums.h */, + 1586601D24E58C3700345BD7 /* YGFloatOptional.h */, + 1586601524E58C3700345BD7 /* YGLayout.cpp */, + 1586602624E58C3700345BD7 /* YGLayout.h */, + 1586601F24E58C3700345BD7 /* YGMacros.h */, + 1586600F24E58C3600345BD7 /* YGNode.cpp */, + 1586602724E58C3700345BD7 /* YGNode.h */, + 1586601724E58C3700345BD7 /* YGNodePrint.cpp */, + 1586601B24E58C3700345BD7 /* YGNodePrint.h */, + 1586600E24E58C3600345BD7 /* YGStyle.cpp */, + 1586602224E58C3700345BD7 /* YGStyle.h */, + 1586601424E58C3700345BD7 /* YGValue.cpp */, + 1586602524E58C3700345BD7 /* YGValue.h */, + 1586602424E58C3700345BD7 /* Yoga-internal.h */, + 1586602324E58C3700345BD7 /* Yoga.cpp */, + 1586601C24E58C3700345BD7 /* Yoga.h */, + ); + name = Yoga; + path = ../yoga; + sourceTree = ""; + }; + 1586600A24E58C3600345BD7 /* internal */ = { + isa = PBXGroup; + children = ( + 1586600B24E58C3600345BD7 /* experiments.cpp */, + 1586600C24E58C3600345BD7 /* experiments-inl.h */, + 1586600D24E58C3600345BD7 /* experiments.h */, + ); + path = internal; + sourceTree = ""; + }; + 1586601824E58C3700345BD7 /* event */ = { + isa = PBXGroup; + children = ( + 1586601924E58C3700345BD7 /* event.h */, + 1586601A24E58C3700345BD7 /* event.cpp */, + ); + path = event; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 15865F4F24E5834E00345BD7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 15865F6624E583F000345BD7 /* YGLayout.h in Headers */, + 15865F6724E583F000345BD7 /* UIView+Yoga.h in Headers */, + 15865F6C24E583F000345BD7 /* YogaKit.h in Headers */, + 15865F6824E583F000345BD7 /* YGLayout+Private.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 15865FF924E58BD800345BD7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 1586603E24E58C3700345BD7 /* YGEnums.h in Headers */, + 1586603A24E58C3700345BD7 /* Yoga.h in Headers */, + 1586603D24E58C3700345BD7 /* YGMacros.h in Headers */, + 1586604324E58C3700345BD7 /* YGValue.h in Headers */, + 153D326F24E654A300EDDBEA /* Yoga-umbrella.h in Headers */, + 1586604524E58C3700345BD7 /* YGNode.h in Headers */, + 1586604024E58C3700345BD7 /* YGStyle.h in Headers */, + 1586603124E58C3700345BD7 /* BitUtils.h in Headers */, + 1586603024E58C3700345BD7 /* Utils.h in Headers */, + 1586602B24E58C3700345BD7 /* experiments-inl.h in Headers */, + 1586603724E58C3700345BD7 /* event.h in Headers */, + 1586603524E58C3700345BD7 /* log.h in Headers */, + 1586603224E58C3700345BD7 /* CompactValue.h in Headers */, + 1586603924E58C3700345BD7 /* YGNodePrint.h in Headers */, + 1586604224E58C3700345BD7 /* Yoga-internal.h in Headers */, + 1586603C24E58C3700345BD7 /* YGConfig.h in Headers */, + 1586604424E58C3700345BD7 /* YGLayout.h in Headers */, + 1586602C24E58C3700345BD7 /* experiments.h in Headers */, + 1586603B24E58C3700345BD7 /* YGFloatOptional.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 153B525A24E6AD6B008156D3 /* YogaKitTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 153B526024E6AD6B008156D3 /* Build configuration list for PBXNativeTarget "YogaKitTests" */; + buildPhases = ( + 153B525724E6AD6B008156D3 /* Sources */, + 153B525824E6AD6B008156D3 /* Frameworks */, + 153B525924E6AD6B008156D3 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 153B526824E6ADF4008156D3 /* PBXTargetDependency */, + 153B526A24E6ADF4008156D3 /* PBXTargetDependency */, + ); + name = YogaKitTests; + productName = YogaKitTests; + productReference = 153B525B24E6AD6B008156D3 /* YogaKitTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 15865F5324E5834E00345BD7 /* YogaKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 15865F5C24E5834E00345BD7 /* Build configuration list for PBXNativeTarget "YogaKit" */; + buildPhases = ( + 15865F4F24E5834E00345BD7 /* Headers */, + 15865F5024E5834E00345BD7 /* Sources */, + 15865F5124E5834E00345BD7 /* Frameworks */, + 15865F5224E5834E00345BD7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 1586600724E58C0900345BD7 /* PBXTargetDependency */, + ); + name = YogaKit; + productName = YogaKit; + productReference = 15865F5424E5834E00345BD7 /* YogaKit.framework */; + productType = "com.apple.product-type.framework"; + }; + 15865FFD24E58BD800345BD7 /* Yoga */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1586600324E58BD800345BD7 /* Build configuration list for PBXNativeTarget "Yoga" */; + buildPhases = ( + 15865FF924E58BD800345BD7 /* Headers */, + 15865FFA24E58BD800345BD7 /* Sources */, + 15865FFB24E58BD800345BD7 /* Frameworks */, + 15865FFC24E58BD800345BD7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Yoga; + productName = Yoga; + productReference = 15865FFE24E58BD800345BD7 /* Yoga.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 15865F4B24E5834E00345BD7 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1160; + ORGANIZATIONNAME = facebook; + TargetAttributes = { + 153B525A24E6AD6B008156D3 = { + CreatedOnToolsVersion = 11.6; + LastSwiftMigration = 1160; + }; + 15865F5324E5834E00345BD7 = { + CreatedOnToolsVersion = 11.6; + LastSwiftMigration = 1160; + }; + 15865FFD24E58BD800345BD7 = { + CreatedOnToolsVersion = 11.6; + }; + }; + }; + buildConfigurationList = 15865F4E24E5834E00345BD7 /* Build configuration list for PBXProject "YogaKit" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 15865F4A24E5834E00345BD7; + productRefGroup = 15865F5524E5834E00345BD7 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 15865F5324E5834E00345BD7 /* YogaKit */, + 15865FFD24E58BD800345BD7 /* Yoga */, + 153B525A24E6AD6B008156D3 /* YogaKitTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 153B525924E6AD6B008156D3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 15865F5224E5834E00345BD7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 15865FFC24E58BD800345BD7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 153B525724E6AD6B008156D3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 154A6EF524E6B1260091264C /* dummy.swift in Sources */, + 153B526524E6AD8D008156D3 /* YogaKitTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 15865F5024E5834E00345BD7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 153D327124E654EF00EDDBEA /* YGLayoutExtensions.swift in Sources */, + 15865F6A24E583F000345BD7 /* UIView+Yoga.m in Sources */, + 15865F6924E583F000345BD7 /* YGLayout.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 15865FFA24E58BD800345BD7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1586602A24E58C3700345BD7 /* experiments.cpp in Sources */, + 1586602F24E58C3700345BD7 /* YGConfig.cpp in Sources */, + 1586602E24E58C3700345BD7 /* YGNode.cpp in Sources */, + 1586603624E58C3700345BD7 /* YGNodePrint.cpp in Sources */, + 1586604624E58C3700345BD7 /* YGEnums.cpp in Sources */, + 1586602D24E58C3700345BD7 /* YGStyle.cpp in Sources */, + 1586604124E58C3700345BD7 /* Yoga.cpp in Sources */, + 1586602924E58C3700345BD7 /* Utils.cpp in Sources */, + 1586603424E58C3700345BD7 /* YGLayout.cpp in Sources */, + 1586603824E58C3700345BD7 /* event.cpp in Sources */, + 1586603F24E58C3700345BD7 /* log.cpp in Sources */, + 1586603324E58C3700345BD7 /* YGValue.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 153B526824E6ADF4008156D3 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + platformFilter = ios; + target = 15865FFD24E58BD800345BD7 /* Yoga */; + targetProxy = 153B526724E6ADF4008156D3 /* PBXContainerItemProxy */; + }; + 153B526A24E6ADF4008156D3 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + platformFilter = ios; + target = 15865F5324E5834E00345BD7 /* YogaKit */; + targetProxy = 153B526924E6ADF4008156D3 /* PBXContainerItemProxy */; + }; + 1586600724E58C0900345BD7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 15865FFD24E58BD800345BD7 /* Yoga */; + targetProxy = 1586600624E58C0900345BD7 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 153B526124E6AD6B008156D3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "${SRCROOT}/Tests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 153B526224E6AD6B008156D3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "${SRCROOT}/Tests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 15865F5A24E5834E00345BD7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + "ARCHS[sdk=appletvos*]" = arm64; + "ARCHS[sdk=appletvsimulator*]" = x86_64; + "ARCHS[sdk=iphoneos*]" = ( + arm64, + armv7, + ); + "ARCHS[sdk=iphonesimulator*]" = ( + i386, + x86_64, + ); + "ARCHS[sdk=macosx*]" = x86_64; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,3,6"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALID_ARCHS = "i386 x86_64 arm64 armv7 arm64e armv7s"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Debug; + }; + 15865F5B24E5834E00345BD7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + "ARCHS[sdk=appletvos*]" = arm64; + "ARCHS[sdk=iphoneos*]" = ( + arm64, + armv7, + ); + "ARCHS[sdk=macosx*]" = x86_64; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx appletvsimulator appletvos"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,3,6"; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + VALID_ARCHS = "i386 x86_64 arm64 armv7 arm64e armv7s"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 2.0; + }; + name = Release; + }; + 15865F5D24E5834E00345BD7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MACH_O_TYPE = staticlib; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKit; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 15865F5E24E5834E00345BD7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_INPUT_FILETYPE = sourcecode.cpp.objcpp; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MACH_O_TYPE = staticlib; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKit; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 1586600424E58BD800345BD7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_INPUT_FILETYPE = sourcecode.cpp.cpp; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "${SRCROOT}/Yoga.modulemap"; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.Yoga; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 1586600524E58BD800345BD7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_INPUT_FILETYPE = sourcecode.cpp.cpp; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "${SRCROOT}/Yoga.modulemap"; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.Yoga; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 153B526024E6AD6B008156D3 /* Build configuration list for PBXNativeTarget "YogaKitTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 153B526124E6AD6B008156D3 /* Debug */, + 153B526224E6AD6B008156D3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 15865F4E24E5834E00345BD7 /* Build configuration list for PBXProject "YogaKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 15865F5A24E5834E00345BD7 /* Debug */, + 15865F5B24E5834E00345BD7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 15865F5C24E5834E00345BD7 /* Build configuration list for PBXNativeTarget "YogaKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 15865F5D24E5834E00345BD7 /* Debug */, + 15865F5E24E5834E00345BD7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1586600324E58BD800345BD7 /* Build configuration list for PBXNativeTarget "Yoga" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1586600424E58BD800345BD7 /* Debug */, + 1586600524E58BD800345BD7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 15865F4B24E5834E00345BD7 /* Project object */; +} diff --git a/YogaKit/YogaKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/YogaKit/YogaKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..98dd3194 --- /dev/null +++ b/YogaKit/YogaKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/YogaKit/YogaKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/YogaKit/YogaKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/YogaKit/YogaKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/YogaKit/YogaKit.xcodeproj/xcshareddata/xcschemes/Yoga.xcscheme b/YogaKit/YogaKit.xcodeproj/xcshareddata/xcschemes/Yoga.xcscheme new file mode 100644 index 00000000..fa3888ce --- /dev/null +++ b/YogaKit/YogaKit.xcodeproj/xcshareddata/xcschemes/Yoga.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YogaKit/YogaKit.xcodeproj/xcshareddata/xcschemes/YogaKit.xcscheme b/YogaKit/YogaKit.xcodeproj/xcshareddata/xcschemes/YogaKit.xcscheme new file mode 100644 index 00000000..a170deef --- /dev/null +++ b/YogaKit/YogaKit.xcodeproj/xcshareddata/xcschemes/YogaKit.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YogaKit/YogaKitSample/Podfile b/YogaKit/YogaKitSample/Podfile index ab7eca4d..78d33ffb 100644 --- a/YogaKit/YogaKitSample/Podfile +++ b/YogaKit/YogaKitSample/Podfile @@ -1,6 +1,21 @@ + use_frameworks! target 'YogaKitSample' do - pod 'YogaKit', :path => '../../YogaKit.podspec' - pod 'IGListKit', '~> 2.1.0' + platform :ios, '9.0' + pod 'Yoga', :path => '../../Yoga.podspec' + pod 'YogaKit', :path => '../../YogaKit.podspec' + pod 'IGListKit', '~> 4.0.0' +end + +target 'YogaKitTVSample' do + platform :tvos, '9.0' + pod 'Yoga', :path => '../../Yoga.podspec' + pod 'YogaKit', :path => '../../YogaKit.podspec' +end + +target 'YogaKitOSXSample' do + platform :osx, '10.10' + pod 'Yoga', :path => '../../Yoga.podspec' + pod 'YogaKit', :path => '../../YogaKit.podspec' end diff --git a/YogaKit/YogaKitSample/Podfile.lock b/YogaKit/YogaKitSample/Podfile.lock index 8600fade..0d33f706 100644 --- a/YogaKit/YogaKitSample/Podfile.lock +++ b/YogaKit/YogaKitSample/Podfile.lock @@ -1,26 +1,33 @@ PODS: - - IGListKit (2.1.0): - - IGListKit/Default (= 2.1.0) - - IGListKit/Default (2.1.0): - - IGListKit/Diffing - - IGListKit/Diffing (2.1.0) - - Yoga (1.7.0) - - YogaKit (1.7.0): - - Yoga (~> 1.7) + - IGListDiffKit (4.0.0) + - IGListKit (4.0.0): + - IGListDiffKit (= 4.0.0) + - Yoga (1.14.1) + - YogaKit (1.18.2): + - Yoga (~> 1.14.1) DEPENDENCIES: - - IGListKit (~> 2.1.0) + - IGListKit (~> 4.0.0) + - Yoga (from `../../Yoga.podspec`) - YogaKit (from `../../YogaKit.podspec`) +SPEC REPOS: + trunk: + - IGListDiffKit + - IGListKit + EXTERNAL SOURCES: + Yoga: + :path: "../../Yoga.podspec" YogaKit: - :path: ../../YogaKit.podspec + :path: "../../YogaKit.podspec" SPEC CHECKSUMS: - IGListKit: b826c68ef7a4ae1626c09d4d3e1ea7a169e6c36e - Yoga: 2ed1d7accfef3610a67f58c0cf101a0662137f2c - YogaKit: 31576530e8fcae3175469719ec3212397403330b + IGListDiffKit: 665d6cf43ce726e676013db9c7d6c4294259b6b2 + IGListKit: fd5a5d21935298f5849fa49d426843cff97b77c7 + Yoga: 21a6025b8ce1624d5bf5202b1af67cd43da8edfc + YogaKit: c404496039efd6abb76408c15804180a247908f5 -PODFILE CHECKSUM: 216f8e7127767709e0e43f3711208d238fa5c404 +PODFILE CHECKSUM: e8d71f0fe05bb5e3cfd81b54d07bd1a904e18968 -COCOAPODS: 1.1.1 +COCOAPODS: 1.9.3 diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.h b/YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.h new file mode 100644 index 00000000..510a4367 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// YogaKitOSXSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import + +@interface AppDelegate : NSObject + + +@end + diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.m b/YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.m new file mode 100644 index 00000000..432e97ca --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/AppDelegate.m @@ -0,0 +1,27 @@ +// +// AppDelegate.m +// YogaKitOSXSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + // Insert code here to initialize your application +} + + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + // Insert code here to tear down your application +} + + +@end diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/AppIcon.appiconset/Contents.json b/YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..3f00db43 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/Contents.json b/YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/Base.lproj/Main.storyboard b/YogaKit/YogaKitSample/YogaKitOSXSample/Base.lproj/Main.storyboard new file mode 100644 index 00000000..bb2a5d88 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/Base.lproj/Main.storyboard @@ -0,0 +1,717 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/Info.plist b/YogaKit/YogaKitSample/YogaKitOSXSample/Info.plist new file mode 100644 index 00000000..78974b6a --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2020 facebook. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + NSSupportsAutomaticTermination + + NSSupportsSuddenTermination + + + diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.h b/YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.h new file mode 100644 index 00000000..1f71695e --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// YogaKitOSXSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import + +@interface ViewController : NSViewController + + +@end + diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.m b/YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.m new file mode 100644 index 00000000..3f9f685b --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/ViewController.m @@ -0,0 +1,68 @@ +// +// ViewController.m +// YogaKitOSXSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import "ViewController.h" +@import YogaKit; + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + NSView *root = self.view; + root.wantsLayer = YES; + root.layer.backgroundColor = NSColor.whiteColor.CGColor; + [root configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { + layout.isEnabled = YES; + layout.alignItems = YGAlignCenter; + layout.justifyContent = YGJustifyCenter; + }]; + + NSView *child1 = [[NSView alloc] init]; + child1.wantsLayer = YES; + child1.layer.backgroundColor = NSColor.blueColor.CGColor; + [child1 configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { + layout.isEnabled = YES; + layout.width = YGPointValue(100); + layout.height = YGPointValue(10); + layout.marginBottom = YGPointValue(25); + }]; + [root addSubview:child1]; + + NSView *child2 = [[NSView alloc] init]; + child2.wantsLayer = YES; + child2.layer.backgroundColor = NSColor.greenColor.CGColor; + [child2 configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { + layout.isEnabled = YES; + layout.alignSelf = YGAlignFlexEnd; + layout.width = YGPointValue(200); + layout.height = YGPointValue(200); + }]; + [root addSubview:child2]; + + NSView *child3 = [[NSView alloc] init]; + child3.wantsLayer = YES; + child3.layer.backgroundColor = NSColor.yellowColor.CGColor; + [child3 configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { + layout.isEnabled = YES; + layout.alignSelf = YGAlignFlexStart; + layout.width = YGPointValue(100); + layout.height = YGPointValue(100); + }]; + [root addSubview:child3]; +} + + +- (void)setRepresentedObject:(id)representedObject { + [super setRepresentedObject:representedObject]; + + // Update the view, if already loaded. +} + + +@end diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/YogaKitOSXSample.entitlements b/YogaKit/YogaKitSample/YogaKitOSXSample/YogaKitOSXSample.entitlements new file mode 100644 index 00000000..f2ef3ae0 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/YogaKitOSXSample.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/dummy.swift b/YogaKit/YogaKitSample/YogaKitOSXSample/dummy.swift new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/dummy.swift @@ -0,0 +1 @@ + diff --git a/YogaKit/YogaKitSample/YogaKitOSXSample/main.m b/YogaKit/YogaKitSample/YogaKitOSXSample/main.m new file mode 100644 index 00000000..65e2f523 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitOSXSample/main.m @@ -0,0 +1,16 @@ +// +// main.m +// YogaKitOSXSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) { + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + } + return NSApplicationMain(argc, argv); +} diff --git a/YogaKit/YogaKitSample/YogaKitSample.xcodeproj/project.pbxproj b/YogaKit/YogaKitSample/YogaKitSample.xcodeproj/project.pbxproj index 01b15da3..90b1f9c6 100644 --- a/YogaKit/YogaKitSample/YogaKitSample.xcodeproj/project.pbxproj +++ b/YogaKit/YogaKitSample/YogaKitSample.xcodeproj/project.pbxproj @@ -1,10 +1,3 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - // !$*UTF8*$! { archiveVersion = 1; @@ -17,24 +10,32 @@ 13687D531DF8748400E7C260 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13687D521DF8748400E7C260 /* Assets.xcassets */; }; 13687D851DF87D1E00E7C260 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 13687D841DF87D1E00E7C260 /* UIKit.framework */; }; 13687D871DF87D2400E7C260 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 13687D861DF87D2400E7C260 /* Foundation.framework */; }; + 15865F3524E56F7800345BD7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 15865F3424E56F7800345BD7 /* AppDelegate.m */; }; + 15865F3824E56F7800345BD7 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 15865F3724E56F7800345BD7 /* ViewController.m */; }; + 15865F3A24E56F7800345BD7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 15865F3924E56F7800345BD7 /* Assets.xcassets */; }; + 15865F3D24E56F7800345BD7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 15865F3B24E56F7800345BD7 /* Main.storyboard */; }; + 15865F4024E56F7800345BD7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 15865F3F24E56F7800345BD7 /* main.m */; }; + 15865F4624E5747800345BD7 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 15865F4524E5747800345BD7 /* libc++.tbd */; }; + 15865F4824E5748900345BD7 /* dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15865F4724E5748900345BD7 /* dummy.swift */; }; + 1593D6D3BEDCC3E520D136F4 /* Pods_YogaKitOSXSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C318BAE128876A3592EA4EE7 /* Pods_YogaKitOSXSample.framework */; }; 15A7CB5995C9DAB1C8803834 /* Pods_YogaKitSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C80A931E90C7F3088CB86822 /* Pods_YogaKitSample.framework */; }; + 15E1C33C24E568410086A4E6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 15E1C33B24E568410086A4E6 /* AppDelegate.m */; }; + 15E1C33F24E568410086A4E6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 15E1C33E24E568410086A4E6 /* ViewController.m */; }; + 15E1C34224E568410086A4E6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 15E1C34024E568410086A4E6 /* Main.storyboard */; }; + 15E1C34424E568420086A4E6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 15E1C34324E568420086A4E6 /* Assets.xcassets */; }; + 15E1C34724E568420086A4E6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 15E1C34524E568420086A4E6 /* LaunchScreen.storyboard */; }; + 15E1C34A24E568420086A4E6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 15E1C34924E568420086A4E6 /* main.m */; }; + 15E1C34F24E56A8A0086A4E6 /* dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15E1C34E24E56A8A0086A4E6 /* dummy.swift */; }; + 15E1C35124E56AB60086A4E6 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 15E1C35024E56AB60086A4E6 /* libc++.tbd */; }; + 15F7301F24E7C097000108AD /* AutoLayoutMixedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15F7301E24E7C097000108AD /* AutoLayoutMixedViewController.swift */; }; 40BD9F461E477A09002790A9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40BD9F451E477A09002790A9 /* AppDelegate.swift */; }; 40BD9F4B1E47850C002790A9 /* BasicViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40BD9F4A1E47850C002790A9 /* BasicViewController.swift */; }; 40BD9F501E479079002790A9 /* SingleLabelCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40BD9F4F1E479079002790A9 /* SingleLabelCollectionCell.swift */; }; 40BD9F521E479173002790A9 /* LayoutInclusionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40BD9F511E479173002790A9 /* LayoutInclusionViewController.swift */; }; 638A94481E1F06D100A726AD /* ExamplesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 638A94471E1F06D100A726AD /* ExamplesViewController.swift */; }; + FF76EAD6A7089159C35EED45 /* Pods_YogaKitTVSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8925233409AB43504C102C31 /* Pods_YogaKitTVSample.framework */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 638A94541E215CC800A726AD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 13687D3B1DF8748300E7C260 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 13687D421DF8748300E7C260; - remoteInfo = YogaKitSample; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXCopyFilesBuildPhase section */ 13687D771DF878A000E7C260 /* yoga */ = { isa = PBXCopyFilesBuildPhase; @@ -59,20 +60,54 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 130B3C3D7B95A7F1337972B2 /* Pods-YogaKitOSXSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitOSXSample.release.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitOSXSample/Pods-YogaKitOSXSample.release.xcconfig"; sourceTree = ""; }; 13687D431DF8748400E7C260 /* YogaKitSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YogaKitSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13687D521DF8748400E7C260 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 13687D571DF8748400E7C260 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 13687D841DF87D1E00E7C260 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 13687D861DF87D2400E7C260 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 15865F3124E56F7800345BD7 /* YogaKitOSXSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YogaKitOSXSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 15865F3324E56F7800345BD7 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 15865F3424E56F7800345BD7 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 15865F3624E56F7800345BD7 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 15865F3724E56F7800345BD7 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 15865F3924E56F7800345BD7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 15865F3C24E56F7800345BD7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 15865F3E24E56F7800345BD7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 15865F3F24E56F7800345BD7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 15865F4124E56F7800345BD7 /* YogaKitOSXSample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = YogaKitOSXSample.entitlements; sourceTree = ""; }; + 15865F4524E5747800345BD7 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libc++.tbd"; sourceTree = DEVELOPER_DIR; }; + 15865F4724E5748900345BD7 /* dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dummy.swift; sourceTree = ""; }; + 15865F4924E577BE00345BD7 /* YogaKitSample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = YogaKitSample.entitlements; sourceTree = ""; }; + 15E1C33824E568410086A4E6 /* YogaKitTVSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YogaKitTVSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 15E1C33A24E568410086A4E6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 15E1C33B24E568410086A4E6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 15E1C33D24E568410086A4E6 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 15E1C33E24E568410086A4E6 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 15E1C34124E568410086A4E6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 15E1C34324E568420086A4E6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 15E1C34624E568420086A4E6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 15E1C34824E568420086A4E6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 15E1C34924E568420086A4E6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 15E1C34E24E56A8A0086A4E6 /* dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = dummy.swift; sourceTree = ""; }; + 15E1C35024E56AB60086A4E6 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS13.4.sdk/usr/lib/libc++.tbd"; sourceTree = DEVELOPER_DIR; }; + 15F7301E24E7C097000108AD /* AutoLayoutMixedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoLayoutMixedViewController.swift; sourceTree = ""; }; 1D2FF4D5FCA6A8C54A4074A3 /* Pods-YogaKitSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitSample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample.debug.xcconfig"; sourceTree = ""; }; 40BD9F451E477A09002790A9 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40BD9F4A1E47850C002790A9 /* BasicViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = BasicViewController.swift; path = ViewControllers/BasicViewController.swift; sourceTree = ""; }; 40BD9F4F1E479079002790A9 /* SingleLabelCollectionCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SingleLabelCollectionCell.swift; path = Views/SingleLabelCollectionCell.swift; sourceTree = ""; }; 40BD9F511E479173002790A9 /* LayoutInclusionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LayoutInclusionViewController.swift; path = ViewControllers/LayoutInclusionViewController.swift; sourceTree = ""; }; + 4BB0C63590A97352D30E310E /* Pods_YogaKitSampleTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_YogaKitSampleTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 51E1DF9045F526AA9E84841F /* Pods-YogaKitTVSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitTVSample.release.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitTVSample/Pods-YogaKitTVSample.release.xcconfig"; sourceTree = ""; }; + 5D4F0C780E18ECECE25B2319 /* Pods-YogaKitTVSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitTVSample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitTVSample/Pods-YogaKitTVSample.debug.xcconfig"; sourceTree = ""; }; 638A94471E1F06D100A726AD /* ExamplesViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExamplesViewController.swift; sourceTree = ""; }; - 638A944F1E215CC800A726AD /* YogaKitSampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = YogaKitSampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D7F92331FB484D6ED42C5E9 /* Pods-YogaKitOSXSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitOSXSample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitOSXSample/Pods-YogaKitOSXSample.debug.xcconfig"; sourceTree = ""; }; 82F0896A88112E957EF37C7F /* Pods-YogaKitSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitSample.release.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample.release.xcconfig"; sourceTree = ""; }; + 8925233409AB43504C102C31 /* Pods_YogaKitTVSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_YogaKitTVSample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A26128CF4F9CAE93983FF74F /* Pods-YogaKitSampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitSampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitSampleTests/Pods-YogaKitSampleTests.debug.xcconfig"; sourceTree = ""; }; + C318BAE128876A3592EA4EE7 /* Pods_YogaKitOSXSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_YogaKitOSXSample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C80A931E90C7F3088CB86822 /* Pods_YogaKitSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_YogaKitSample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FF607399A6E2DE06593D1FA8 /* Pods-YogaKitSampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YogaKitSampleTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-YogaKitSampleTests/Pods-YogaKitSampleTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -86,10 +121,21 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 638A944C1E215CC800A726AD /* Frameworks */ = { + 15865F2E24E56F7800345BD7 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 15865F4624E5747800345BD7 /* libc++.tbd in Frameworks */, + 1593D6D3BEDCC3E520D136F4 /* Pods_YogaKitOSXSample.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 15E1C33524E568410086A4E6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 15E1C35124E56AB60086A4E6 /* libc++.tbd in Frameworks */, + FF76EAD6A7089159C35EED45 /* Pods_YogaKitTVSample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -100,6 +146,8 @@ isa = PBXGroup; children = ( 13687D451DF8748400E7C260 /* YogaKitSample */, + 15E1C33924E568410086A4E6 /* YogaKitTVSample */, + 15865F3224E56F7800345BD7 /* YogaKitOSXSample */, 13687D441DF8748400E7C260 /* Products */, 13687D831DF87D1E00E7C260 /* Frameworks */, E1C759E3C8E84821213ECE8D /* Pods */, @@ -110,7 +158,8 @@ isa = PBXGroup; children = ( 13687D431DF8748400E7C260 /* YogaKitSample.app */, - 638A944F1E215CC800A726AD /* YogaKitSampleTests.xctest */, + 15E1C33824E568410086A4E6 /* YogaKitTVSample.app */, + 15865F3124E56F7800345BD7 /* YogaKitOSXSample.app */, ); name = Products; sourceTree = ""; @@ -118,6 +167,7 @@ 13687D451DF8748400E7C260 /* YogaKitSample */ = { isa = PBXGroup; children = ( + 15865F4924E577BE00345BD7 /* YogaKitSample.entitlements */, 40BD9F4E1E47902F002790A9 /* Views */, 40BD9F481E4784B3002790A9 /* ViewControllers */, 638A94471E1F06D100A726AD /* ExamplesViewController.swift */, @@ -131,18 +181,58 @@ 13687D831DF87D1E00E7C260 /* Frameworks */ = { isa = PBXGroup; children = ( + 15E1C35024E56AB60086A4E6 /* libc++.tbd */, + 15865F4524E5747800345BD7 /* libc++.tbd */, 13687D861DF87D2400E7C260 /* Foundation.framework */, 13687D841DF87D1E00E7C260 /* UIKit.framework */, C80A931E90C7F3088CB86822 /* Pods_YogaKitSample.framework */, + 4BB0C63590A97352D30E310E /* Pods_YogaKitSampleTests.framework */, + 8925233409AB43504C102C31 /* Pods_YogaKitTVSample.framework */, + C318BAE128876A3592EA4EE7 /* Pods_YogaKitOSXSample.framework */, ); name = Frameworks; sourceTree = ""; }; + 15865F3224E56F7800345BD7 /* YogaKitOSXSample */ = { + isa = PBXGroup; + children = ( + 15865F3324E56F7800345BD7 /* AppDelegate.h */, + 15865F3424E56F7800345BD7 /* AppDelegate.m */, + 15865F3624E56F7800345BD7 /* ViewController.h */, + 15865F3724E56F7800345BD7 /* ViewController.m */, + 15865F3924E56F7800345BD7 /* Assets.xcassets */, + 15865F3B24E56F7800345BD7 /* Main.storyboard */, + 15865F3E24E56F7800345BD7 /* Info.plist */, + 15865F3F24E56F7800345BD7 /* main.m */, + 15865F4724E5748900345BD7 /* dummy.swift */, + 15865F4124E56F7800345BD7 /* YogaKitOSXSample.entitlements */, + ); + path = YogaKitOSXSample; + sourceTree = ""; + }; + 15E1C33924E568410086A4E6 /* YogaKitTVSample */ = { + isa = PBXGroup; + children = ( + 15E1C33A24E568410086A4E6 /* AppDelegate.h */, + 15E1C33B24E568410086A4E6 /* AppDelegate.m */, + 15E1C33D24E568410086A4E6 /* ViewController.h */, + 15E1C33E24E568410086A4E6 /* ViewController.m */, + 15E1C34024E568410086A4E6 /* Main.storyboard */, + 15E1C34324E568420086A4E6 /* Assets.xcassets */, + 15E1C34524E568420086A4E6 /* LaunchScreen.storyboard */, + 15E1C34824E568420086A4E6 /* Info.plist */, + 15E1C34924E568420086A4E6 /* main.m */, + 15E1C34E24E56A8A0086A4E6 /* dummy.swift */, + ); + path = YogaKitTVSample; + sourceTree = ""; + }; 40BD9F481E4784B3002790A9 /* ViewControllers */ = { isa = PBXGroup; children = ( 40BD9F4A1E47850C002790A9 /* BasicViewController.swift */, 40BD9F511E479173002790A9 /* LayoutInclusionViewController.swift */, + 15F7301E24E7C097000108AD /* AutoLayoutMixedViewController.swift */, ); name = ViewControllers; sourceTree = ""; @@ -160,6 +250,12 @@ children = ( 1D2FF4D5FCA6A8C54A4074A3 /* Pods-YogaKitSample.debug.xcconfig */, 82F0896A88112E957EF37C7F /* Pods-YogaKitSample.release.xcconfig */, + A26128CF4F9CAE93983FF74F /* Pods-YogaKitSampleTests.debug.xcconfig */, + FF607399A6E2DE06593D1FA8 /* Pods-YogaKitSampleTests.release.xcconfig */, + 5D4F0C780E18ECECE25B2319 /* Pods-YogaKitTVSample.debug.xcconfig */, + 51E1DF9045F526AA9E84841F /* Pods-YogaKitTVSample.release.xcconfig */, + 6D7F92331FB484D6ED42C5E9 /* Pods-YogaKitOSXSample.debug.xcconfig */, + 130B3C3D7B95A7F1337972B2 /* Pods-YogaKitOSXSample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -178,7 +274,6 @@ 13687D401DF8748300E7C260 /* Frameworks */, 13687D411DF8748300E7C260 /* Resources */, FA2FB9DD6471BDD3FBCE503B /* [CP] Embed Pods Frameworks */, - 6E01EB987F1564F3D71EBE5A /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -189,23 +284,41 @@ productReference = 13687D431DF8748400E7C260 /* YogaKitSample.app */; productType = "com.apple.product-type.application"; }; - 638A944E1E215CC800A726AD /* YogaKitSampleTests */ = { + 15865F3024E56F7800345BD7 /* YogaKitOSXSample */ = { isa = PBXNativeTarget; - buildConfigurationList = 638A94561E215CC800A726AD /* Build configuration list for PBXNativeTarget "YogaKitSampleTests" */; + buildConfigurationList = 15865F4424E56F7800345BD7 /* Build configuration list for PBXNativeTarget "YogaKitOSXSample" */; buildPhases = ( - 638A944B1E215CC800A726AD /* Sources */, - 638A944C1E215CC800A726AD /* Frameworks */, - 638A944D1E215CC800A726AD /* Resources */, + 48411F57309F483CDA923BEA /* [CP] Check Pods Manifest.lock */, + 15865F2D24E56F7800345BD7 /* Sources */, + 15865F2E24E56F7800345BD7 /* Frameworks */, + 15865F2F24E56F7800345BD7 /* Resources */, ); buildRules = ( ); dependencies = ( - 638A94551E215CC800A726AD /* PBXTargetDependency */, ); - name = YogaKitSampleTests; - productName = YogaKitSampleTests; - productReference = 638A944F1E215CC800A726AD /* YogaKitSampleTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; + name = YogaKitOSXSample; + productName = YogaKitOSXSample; + productReference = 15865F3124E56F7800345BD7 /* YogaKitOSXSample.app */; + productType = "com.apple.product-type.application"; + }; + 15E1C33724E568410086A4E6 /* YogaKitTVSample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 15E1C34D24E568420086A4E6 /* Build configuration list for PBXNativeTarget "YogaKitTVSample" */; + buildPhases = ( + EEAEE027484A739D2AFF1F33 /* [CP] Check Pods Manifest.lock */, + 15E1C33424E568410086A4E6 /* Sources */, + 15E1C33524E568410086A4E6 /* Frameworks */, + 15E1C33624E568410086A4E6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = YogaKitTVSample; + productName = YogaKitTVSample; + productReference = 15E1C33824E568410086A4E6 /* YogaKitTVSample.app */; + productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -221,10 +334,15 @@ LastSwiftMigration = 0820; ProvisioningStyle = Automatic; }; - 638A944E1E215CC800A726AD = { - CreatedOnToolsVersion = 8.2.1; + 15865F3024E56F7800345BD7 = { + CreatedOnToolsVersion = 11.6; + LastSwiftMigration = 1160; + ProvisioningStyle = Automatic; + }; + 15E1C33724E568410086A4E6 = { + CreatedOnToolsVersion = 11.6; + LastSwiftMigration = 1160; ProvisioningStyle = Automatic; - TestTargetID = 13687D421DF8748300E7C260; }; }; }; @@ -233,6 +351,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -242,7 +361,8 @@ projectRoot = ""; targets = ( 13687D421DF8748300E7C260 /* YogaKitSample */, - 638A944E1E215CC800A726AD /* YogaKitSampleTests */, + 15E1C33724E568410086A4E6 /* YogaKitTVSample */, + 15865F3024E56F7800345BD7 /* YogaKitOSXSample */, ); }; /* End PBXProject section */ @@ -256,44 +376,88 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 638A944D1E215CC800A726AD /* Resources */ = { + 15865F2F24E56F7800345BD7 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 15865F3A24E56F7800345BD7 /* Assets.xcassets in Resources */, + 15865F3D24E56F7800345BD7 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 15E1C33624E568410086A4E6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 15E1C34724E568420086A4E6 /* LaunchScreen.storyboard in Resources */, + 15E1C34424E568420086A4E6 /* Assets.xcassets in Resources */, + 15E1C34224E568410086A4E6 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 48411F57309F483CDA923BEA /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-YogaKitOSXSample-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 513B543F92B2E4F4D1EE1CE7 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-YogaKitSample-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 6E01EB987F1564F3D71EBE5A /* [CP] Copy Pods Resources */ = { + EEAEE027484A739D2AFF1F33 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputPaths = ( + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = "[CP] Copy Pods Resources"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-YogaKitTVSample-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; FA2FB9DD6471BDD3FBCE503B /* [CP] Embed Pods Frameworks */ = { @@ -302,13 +466,18 @@ files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/IGListDiffKit/IGListDiffKit.framework", + "${BUILT_PRODUCTS_DIR}/IGListKit/IGListKit.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/IGListDiffKit.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/IGListKit.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-YogaKitSample/Pods-YogaKitSample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -323,25 +492,60 @@ 638A94481E1F06D100A726AD /* ExamplesViewController.swift in Sources */, 40BD9F4B1E47850C002790A9 /* BasicViewController.swift in Sources */, 40BD9F461E477A09002790A9 /* AppDelegate.swift in Sources */, + 15F7301F24E7C097000108AD /* AutoLayoutMixedViewController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 638A944B1E215CC800A726AD /* Sources */ = { + 15865F2D24E56F7800345BD7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 15865F3824E56F7800345BD7 /* ViewController.m in Sources */, + 15865F4024E56F7800345BD7 /* main.m in Sources */, + 15865F4824E5748900345BD7 /* dummy.swift in Sources */, + 15865F3524E56F7800345BD7 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 15E1C33424E568410086A4E6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 15E1C33F24E568410086A4E6 /* ViewController.m in Sources */, + 15E1C34A24E568420086A4E6 /* main.m in Sources */, + 15E1C34F24E56A8A0086A4E6 /* dummy.swift in Sources */, + 15E1C33C24E568410086A4E6 /* AppDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 638A94551E215CC800A726AD /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 13687D421DF8748300E7C260 /* YogaKitSample */; - targetProxy = 638A94541E215CC800A726AD /* PBXContainerItemProxy */; +/* Begin PBXVariantGroup section */ + 15865F3B24E56F7800345BD7 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 15865F3C24E56F7800345BD7 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; }; -/* End PBXTargetDependency section */ + 15E1C34024E568410086A4E6 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 15E1C34124E568410086A4E6 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 15E1C34524E568420086A4E6 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 15E1C34624E568420086A4E6 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 13687D581DF8748400E7C260 /* Debug */ = { @@ -440,13 +644,18 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = YogaKitSample/YogaKitSample.entitlements; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = YogaKitSample/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSample; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = NO; SWIFT_INSTALL_OBJC_HEADER = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; @@ -456,40 +665,151 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = YogaKitSample/YogaKitSample.entitlements; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = YogaKitSample/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSample; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = NO; SWIFT_INSTALL_OBJC_HEADER = NO; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; - 638A94571E215CC800A726AD /* Debug */ = { + 15865F4224E56F7800345BD7 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 6D7F92331FB484D6ED42C5E9 /* Pods-YogaKitOSXSample.debug.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = YogaKitSampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSampleTests; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = YogaKitOSXSample/YogaKitOSXSample.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = YogaKitOSXSample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitOSXSample; PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YogaKitSample.app/YogaKitSample"; + SDKROOT = macosx; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; }; name = Debug; }; - 638A94581E215CC800A726AD /* Release */ = { + 15865F4324E56F7800345BD7 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 130B3C3D7B95A7F1337972B2 /* Pods-YogaKitOSXSample.release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - BUNDLE_LOADER = "$(TEST_HOST)"; - INFOPLIST_FILE = YogaKitSampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.2; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitSampleTests; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = YogaKitOSXSample/YogaKitOSXSample.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = YogaKitOSXSample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitOSXSample; PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/YogaKitSample.app/YogaKitSample"; + SDKROOT = macosx; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 15E1C34B24E568420086A4E6 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5D4F0C780E18ECECE25B2319 /* Pods-YogaKitTVSample.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = YogaKitTVSample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitTVSample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.0; + }; + name = Debug; + }; + 15E1C34C24E568420086A4E6 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 51E1DF9045F526AA9E84841F /* Pods-YogaKitTVSample.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = YogaKitTVSample/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.facebook.YogaKitTVSample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; }; @@ -514,11 +834,20 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 638A94561E215CC800A726AD /* Build configuration list for PBXNativeTarget "YogaKitSampleTests" */ = { + 15865F4424E56F7800345BD7 /* Build configuration list for PBXNativeTarget "YogaKitOSXSample" */ = { isa = XCConfigurationList; buildConfigurations = ( - 638A94571E215CC800A726AD /* Debug */, - 638A94581E215CC800A726AD /* Release */, + 15865F4224E56F7800345BD7 /* Debug */, + 15865F4324E56F7800345BD7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 15E1C34D24E568420086A4E6 /* Build configuration list for PBXNativeTarget "YogaKitTVSample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 15E1C34B24E568420086A4E6 /* Debug */, + 15E1C34C24E568420086A4E6 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/YogaKit/YogaKitSample/YogaKitSample/AutoLayoutMixedViewController.swift b/YogaKit/YogaKitSample/YogaKitSample/AutoLayoutMixedViewController.swift new file mode 100644 index 00000000..e7a40fb8 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitSample/AutoLayoutMixedViewController.swift @@ -0,0 +1,74 @@ +// +// AutoLayoutMixedViewController.swift +// YogaKitSample +// +// Created by lvv on 2020/8/15. +// Copyright © 2020 facebook. All rights reserved. +// + +import UIKit +import YogaKit + +class AutoLayoutMixedViewController : UIViewController { + override func viewDidLoad() { + super.viewDidLoad() + + view.configureLayout { (layout) in + layout.isEnabled = true + layout.alignItems = .center + layout.justifyContent = .center + } + + let container = UIView() + container.backgroundColor = .orange + container.configureLayout { (layout) in + layout.isEnabled = true + + layout.paddingTop = 20 + layout.paddingLeft = 20 + layout.paddingBottom = 20 + layout.paddingRight = 70 + + layout.width = 100% + } + view.addSubview(container) + + let subView1 = UIView() + subView1.backgroundColor = .red + subView1.configureLayout { (layout) in + layout.isEnabled = true + layout.height = 30; + } + container.addSubview(subView1) + + let subView2 = UIView() + subView2.backgroundColor = .yellow + subView2.configureLayout { (layout) in + layout.isEnabled = true + layout.marginTop = 25 + layout.height = 10; + } + container.addSubview(subView2) + + let subView3 = UIView() + subView3.backgroundColor = .blue + subView3.configureLayout { (layout) in + layout.isEnabled = true + layout.marginTop = 25 + layout.height = 20; + } + container.addSubview(subView3) + + let subView4 = UIView() + subView4.backgroundColor = .green + subView4.translatesAutoresizingMaskIntoConstraints = false + container.addSubview(subView4) + + container.addConstraints([ + NSLayoutConstraint(item: subView4, attribute: .right, relatedBy: .equal, toItem: container, attribute: .right, multiplier: 1, constant: -10), + NSLayoutConstraint(item: subView4, attribute: .centerY, relatedBy: .equal, toItem: container, attribute: .centerY, multiplier: 1, constant: 0), + NSLayoutConstraint(item: subView4, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: 50), + NSLayoutConstraint(item: subView4, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1, constant: 50) + ]) + } +} diff --git a/YogaKit/YogaKitSample/YogaKitSample/ExamplesViewController.swift b/YogaKit/YogaKitSample/YogaKitSample/ExamplesViewController.swift index c46f0dd6..612c88b6 100644 --- a/YogaKit/YogaKitSample/YogaKitSample/ExamplesViewController.swift +++ b/YogaKit/YogaKitSample/YogaKitSample/ExamplesViewController.swift @@ -18,12 +18,12 @@ private final class ExampleModel { } } -extension ExampleModel: IGListDiffable { +extension ExampleModel: ListDiffable { fileprivate func diffIdentifier() -> NSObjectProtocol { return title as NSString } - fileprivate func isEqual(toDiffableObject object: IGListDiffable?) -> Bool { + fileprivate func isEqual(toDiffableObject object: ListDiffable?) -> Bool { guard let otherObj = object as? ExampleModel else { return false } return (title == otherObj.title) && @@ -31,22 +31,24 @@ extension ExampleModel: IGListDiffable { } } -final class ExamplesViewController: UIViewController, IGListAdapterDataSource, IGListSingleSectionControllerDelegate { - private lazy var adapter: IGListAdapter = { - return IGListAdapter(updater: IGListAdapterUpdater(), viewController: self, workingRangeSize: 0) +final class ExamplesViewController: UIViewController, ListAdapterDataSource, ListSingleSectionControllerDelegate { + private lazy var adapter: ListAdapter = { + return ListAdapter(updater: ListAdapterUpdater(), viewController: self, workingRangeSize: 0) }() - private let collectionView = IGListCollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout()) + private let collectionView = ListCollectionView(frame: .zero) // Update this to array to create more examples. private let models: [ExampleModel] = [ExampleModel(title: "Basic Layout", controllerClass: BasicViewController.self), - ExampleModel(title: "Exclude Views in Layout", controllerClass: LayoutInclusionViewController.self)] + ExampleModel(title: "Exclude Views in Layout", controllerClass: LayoutInclusionViewController.self), + ExampleModel(title: "AutoLayout Mixed", controllerClass: AutoLayoutMixedViewController.self)] //MARK: UIViewController override func viewDidLoad() { super.viewDidLoad() title = "Examples" + collectionView.backgroundColor = .clear view.addSubview(collectionView) adapter.collectionView = collectionView adapter.dataSource = self @@ -59,16 +61,16 @@ final class ExamplesViewController: UIViewController, IGListAdapterDataSource, I //MARK: IGListAdapterDataSource - func objects(for listAdapter: IGListAdapter) -> [IGListDiffable] { - return models as [IGListDiffable] + func objects(for listAdapter: ListAdapter) -> [ListDiffable] { + return models as [ListDiffable] } - func listAdapter(_ listAdapter: IGListAdapter, sectionControllerFor object: Any) -> IGListSectionController { - let sizeBlock: IGListSingleSectionCellSizeBlock = { (model, context) in + func listAdapter(_ listAdapter: ListAdapter, sectionControllerFor object: Any) -> ListSectionController { + let sizeBlock: ListSingleSectionCellSizeBlock = { (model, context) in return CGSize(width: (context?.containerSize.width)!, height: 75.0) } - let configureBlock: IGListSingleSectionCellConfigureBlock = { (model, cell) in + let configureBlock: ListSingleSectionCellConfigureBlock = { (model, cell) in guard let m = model as? ExampleModel, let c = cell as? SingleLabelCollectionCell else { return } @@ -76,18 +78,18 @@ final class ExamplesViewController: UIViewController, IGListAdapterDataSource, I c.label.text = m.title } - let sectionController = IGListSingleSectionController(cellClass: SingleLabelCollectionCell.self, + let sectionController = ListSingleSectionController(cellClass: SingleLabelCollectionCell.self, configureBlock: configureBlock, sizeBlock: sizeBlock) sectionController.selectionDelegate = self return sectionController } - func emptyView(for listAdapter: IGListAdapter) -> UIView? { return nil } + func emptyView(for listAdapter: ListAdapter) -> UIView? { return nil } //MARK: IGListSingleSectionControllerDelegate - func didSelect(_ sectionController: IGListSingleSectionController) { + func didSelect(_ sectionController: ListSingleSectionController, with object: Any) { let section = adapter.section(for: sectionController) let model = models[section] diff --git a/YogaKit/YogaKitSample/YogaKitSample/Info.plist b/YogaKit/YogaKitSample/YogaKitSample/Info.plist index 22ca2cd4..c15be7ff 100644 --- a/YogaKit/YogaKitSample/YogaKitSample/Info.plist +++ b/YogaKit/YogaKitSample/YogaKitSample/Info.plist @@ -32,5 +32,7 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + UIUserInterfaceStyle + Light diff --git a/YogaKit/YogaKitSample/YogaKitSample/ViewControllers/BasicViewController.swift b/YogaKit/YogaKitSample/YogaKitSample/ViewControllers/BasicViewController.swift index 07059f1f..cd170335 100644 --- a/YogaKit/YogaKitSample/YogaKitSample/ViewControllers/BasicViewController.swift +++ b/YogaKit/YogaKitSample/YogaKitSample/ViewControllers/BasicViewController.swift @@ -10,14 +10,11 @@ import YogaKit final class BasicViewController: UIViewController { override func viewDidLoad() { - let containerSize = self.view.bounds.size let root = self.view! root.backgroundColor = .white root.configureLayout { (layout) in layout.isEnabled = true - layout.width = YGValue(containerSize.width) - layout.height = YGValue(containerSize.height) layout.alignItems = .center layout.justifyContent = .center } @@ -32,22 +29,24 @@ final class BasicViewController: UIViewController { } root.addSubview(child1) - let child2 = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200)) + let child2 = UIView() child2.backgroundColor = .green child2.configureLayout { (layout) in layout.isEnabled = true layout.alignSelf = .flexEnd + layout.width = 200 + layout.height = 200 } root.addSubview(child2) - let child3 = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) + let child3 = UIView() child3.backgroundColor = .yellow child3.configureLayout { (layout) in layout.isEnabled = true layout.alignSelf = .flexStart + layout.width = 100 + layout.height = 100 } root.addSubview(child3) - - root.yoga.applyLayout(preservingOrigin: true) } } diff --git a/YogaKit/YogaKitSample/YogaKitSample/ViewControllers/LayoutInclusionViewController.swift b/YogaKit/YogaKitSample/YogaKitSample/ViewControllers/LayoutInclusionViewController.swift index 897b8590..ced3693f 100644 --- a/YogaKit/YogaKitSample/YogaKitSample/ViewControllers/LayoutInclusionViewController.swift +++ b/YogaKit/YogaKitSample/YogaKitSample/ViewControllers/LayoutInclusionViewController.swift @@ -51,9 +51,9 @@ final class LayoutInclusionViewController: UIViewController { } contentView.addSubview(disappearingView) - button.setTitle("Add Blue View", for: UIControlState.selected) - button.setTitle("Remove Blue View", for: UIControlState.normal) - button.addTarget(self, action: #selector(buttonWasTapped), for: UIControlEvents.touchUpInside) + button.setTitle("Add Blue View", for: .selected) + button.setTitle("Remove Blue View", for: .normal) + button.addTarget(self, action: #selector(buttonWasTapped), for: UIControl.Event.touchUpInside) button.configureLayout { (layout) in layout.isEnabled = true layout.height = 300 @@ -61,12 +61,10 @@ final class LayoutInclusionViewController: UIViewController { layout.alignSelf = .center } root.addSubview(button) - - root.yoga.applyLayout(preservingOrigin: false) } // MARK - UIButton Action - func buttonWasTapped() { + @objc func buttonWasTapped() { button.isSelected = !button.isSelected button.isUserInteractionEnabled = false diff --git a/YogaKit/YogaKitSample/YogaKitSample/Views/SingleLabelCollectionCell.swift b/YogaKit/YogaKitSample/YogaKitSample/Views/SingleLabelCollectionCell.swift index 50fa9042..19ec7006 100644 --- a/YogaKit/YogaKitSample/YogaKitSample/Views/SingleLabelCollectionCell.swift +++ b/YogaKit/YogaKitSample/YogaKitSample/Views/SingleLabelCollectionCell.swift @@ -42,7 +42,6 @@ final class SingleLabelCollectionCell: UICollectionViewCell { override func layoutSubviews() { super.layoutSubviews() - contentView.yoga.applyLayout(preservingOrigin: false) label.frame = contentView.bounds } } diff --git a/YogaKit/YogaKitSample/YogaKitSample/YogaKitSample.entitlements b/YogaKit/YogaKitSample/YogaKitSample/YogaKitSample.entitlements new file mode 100644 index 00000000..ee95ab7e --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitSample/YogaKitSample.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + + diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/AppDelegate.h b/YogaKit/YogaKitSample/YogaKitTVSample/AppDelegate.h new file mode 100644 index 00000000..b933a6ed --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// YogaKitTVSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/AppDelegate.m b/YogaKit/YogaKitSample/YogaKitTVSample/AppDelegate.m new file mode 100644 index 00000000..04938d79 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/AppDelegate.m @@ -0,0 +1,45 @@ +// +// AppDelegate.m +// YogaKitTVSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. +} + + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. +} + + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + + +@end diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 00000000..2e003356 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json new file mode 100644 index 00000000..de59d885 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 00000000..2e003356 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 00000000..2e003356 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,11 @@ +{ + "images" : [ + { + "idiom" : "tv" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 00000000..795cce17 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json new file mode 100644 index 00000000..de59d885 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json @@ -0,0 +1,17 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + }, + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Middle.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ] +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 00000000..795cce17 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 00000000..795cce17 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json new file mode 100644 index 00000000..f47ba43d --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json @@ -0,0 +1,32 @@ +{ + "assets" : [ + { + "filename" : "App Icon - App Store.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "1280x768" + }, + { + "filename" : "App Icon.imagestack", + "idiom" : "tv", + "role" : "primary-app-icon", + "size" : "400x240" + }, + { + "filename" : "Top Shelf Image Wide.imageset", + "idiom" : "tv", + "role" : "top-shelf-image-wide", + "size" : "2320x720" + }, + { + "filename" : "Top Shelf Image.imageset", + "idiom" : "tv", + "role" : "top-shelf-image", + "size" : "1920x720" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json new file mode 100644 index 00000000..b65f0cdd --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json @@ -0,0 +1,24 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + }, + { + "idiom" : "tv-marketing", + "scale" : "1x" + }, + { + "idiom" : "tv-marketing", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json new file mode 100644 index 00000000..b65f0cdd --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json @@ -0,0 +1,24 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + }, + { + "idiom" : "tv-marketing", + "scale" : "1x" + }, + { + "idiom" : "tv-marketing", + "scale" : "2x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/Contents.json b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Base.lproj/LaunchScreen.storyboard b/YogaKit/YogaKitSample/YogaKitTVSample/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..660ba53d --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Base.lproj/Main.storyboard b/YogaKit/YogaKitSample/YogaKitTVSample/Base.lproj/Main.storyboard new file mode 100644 index 00000000..a5c40f19 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Base.lproj/Main.storyboard @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/Info.plist b/YogaKit/YogaKitSample/YogaKitTVSample/Info.plist new file mode 100644 index 00000000..25869efc --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/Info.plist @@ -0,0 +1,34 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + arm64 + + UIUserInterfaceStyle + Automatic + + diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/ViewController.h b/YogaKit/YogaKitSample/YogaKitTVSample/ViewController.h new file mode 100644 index 00000000..beebe657 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// YogaKitTVSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/ViewController.m b/YogaKit/YogaKitSample/YogaKitTVSample/ViewController.m new file mode 100644 index 00000000..ec5b6382 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/ViewController.m @@ -0,0 +1,60 @@ +// +// ViewController.m +// YogaKitTVSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import "ViewController.h" +@import YogaKit; + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + UIView *root = self.view; + root.backgroundColor = UIColor.whiteColor; + [root configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { + layout.isEnabled = YES; + layout.alignItems = YGAlignCenter; + layout.justifyContent = YGJustifyCenter; + }]; + + UIView *child1 = [[UIView alloc] init]; + child1.backgroundColor = UIColor.blueColor; + [child1 configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { + layout.isEnabled = YES; + layout.width = YGPointValue(100); + layout.height = YGPointValue(10); + layout.marginBottom = YGPointValue(25); + }]; + [root addSubview:child1]; + + UIView *child2 = [[UIView alloc] init]; + child2.backgroundColor = UIColor.greenColor; + [child2 configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { + layout.isEnabled = YES; + layout.alignSelf = YGAlignFlexEnd; + layout.width = YGPointValue(200); + layout.height = YGPointValue(200); + }]; + [root addSubview:child2]; + + UIView *child3 = [[UIView alloc] init]; + child3.backgroundColor = UIColor.yellowColor; + [child3 configureLayoutWithBlock:^(YGLayout * _Nonnull layout) { + layout.isEnabled = YES; + layout.alignSelf = YGAlignFlexStart; + layout.width = YGPointValue(100); + layout.height = YGPointValue(100); + }]; + [root addSubview:child3]; +} + +@end diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/dummy.swift b/YogaKit/YogaKitSample/YogaKitTVSample/dummy.swift new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/dummy.swift @@ -0,0 +1 @@ + diff --git a/YogaKit/YogaKitSample/YogaKitTVSample/main.m b/YogaKit/YogaKitSample/YogaKitTVSample/main.m new file mode 100644 index 00000000..fd154fab --- /dev/null +++ b/YogaKit/YogaKitSample/YogaKitTVSample/main.m @@ -0,0 +1,19 @@ +// +// main.m +// YogaKitTVSample +// +// Created by lvv on 2020/8/13. +// Copyright © 2020 facebook. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} diff --git a/YogaKit/yoga b/YogaKit/yoga new file mode 120000 index 00000000..18cce15d --- /dev/null +++ b/YogaKit/yoga @@ -0,0 +1 @@ +../yoga \ No newline at end of file diff --git a/java/jni/YGJNIVanilla.cpp b/java/jni/YGJNIVanilla.cpp index 65343821..fdd95a52 100644 --- a/java/jni/YGJNIVanilla.cpp +++ b/java/jni/YGJNIVanilla.cpp @@ -646,9 +646,9 @@ static void YGTransferLayoutDirection(YGNodeRef node, jobject javaNode) { static YGSize YGJNIMeasureFunc( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode, void* layoutContext) { if (auto obj = YGNodeJobject(node, layoutContext)) { @@ -694,10 +694,10 @@ static void jni_YGNodeSetHasMeasureFuncJNI( ->setMeasureFunc(hasMeasureFunc ? YGJNIMeasureFunc : nullptr); } -static float YGJNIBaselineFunc( +static YGFloat YGJNIBaselineFunc( YGNodeRef node, - float width, - float height, + YGFloat width, + YGFloat height, void* layoutContext) { if (auto obj = YGNodeJobject(node, layoutContext)) { JNIEnv* env = getCurrentEnv(); diff --git a/tests/EventsTest.cpp b/tests/EventsTest.cpp index cf887b2d..108e3377 100644 --- a/tests/EventsTest.cpp +++ b/tests/EventsTest.cpp @@ -251,7 +251,7 @@ TEST_F(EventTest, layout_events_has_max_measure_cache) { TEST_F(EventTest, measure_functions_get_wrapped) { auto root = YGNodeNew(); YGNodeSetMeasureFunc( - root, [](YGNodeRef, float, YGMeasureMode, float, YGMeasureMode) { + root, [](YGNodeRef, YGFloat, YGMeasureMode, YGFloat, YGMeasureMode) { return YGSize{}; }); @@ -269,7 +269,7 @@ TEST_F(EventTest, baseline_functions_get_wrapped) { auto child = YGNodeNew(); YGNodeInsertChild(root, child, 0); - YGNodeSetBaselineFunc(child, [](YGNodeRef, float, float) { return 0.0f; }); + YGNodeSetBaselineFunc(child, [](YGNodeRef, YGFloat, YGFloat) { return 0.0; }); YGNodeStyleSetFlexDirection(root, YGFlexDirectionRow); YGNodeStyleSetAlignItems(root, YGAlignBaseline); diff --git a/tests/YGAlignBaselineTest.cpp b/tests/YGAlignBaselineTest.cpp index 35abfe76..2f7903c5 100644 --- a/tests/YGAlignBaselineTest.cpp +++ b/tests/YGAlignBaselineTest.cpp @@ -9,18 +9,18 @@ #include #include -static float _baselineFunc( +static YGFloat _baselineFunc( YGNodeRef node, - const float width, - const float height) { + const YGFloat width, + const YGFloat height) { return height / 2; } static YGSize _measure1( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ .width = 42, @@ -30,9 +30,9 @@ static YGSize _measure1( static YGSize _measure2( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ .width = 279, diff --git a/tests/YGAspectRatioTest.cpp b/tests/YGAspectRatioTest.cpp index a1c31ecd..91d2ba7e 100644 --- a/tests/YGAspectRatioTest.cpp +++ b/tests/YGAspectRatioTest.cpp @@ -11,9 +11,9 @@ static YGSize _measure( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ .width = widthMode == YGMeasureModeExactly ? width : 50, diff --git a/tests/YGBaselineFuncTest.cpp b/tests/YGBaselineFuncTest.cpp index eb15185e..64c01359 100644 --- a/tests/YGBaselineFuncTest.cpp +++ b/tests/YGBaselineFuncTest.cpp @@ -9,8 +9,8 @@ #include #include -static float _baseline(YGNodeRef node, const float width, const float height) { - float* baseline = (float*) node->getContext(); +static YGFloat _baseline(YGNodeRef node, const YGFloat width, const YGFloat height) { + YGFloat* baseline = (YGFloat*) node->getContext(); return *baseline; } @@ -31,7 +31,7 @@ TEST(YogaTest, align_baseline_customer_func) { YGNodeStyleSetHeight(root_child1, 20); YGNodeInsertChild(root, root_child1, 1); - float baselineValue = 10; + YGFloat baselineValue = 10; const YGNodeRef root_child1_child0 = YGNodeNew(); root_child1_child0->setContext(&baselineValue); YGNodeStyleSetWidth(root_child1_child0, 50); diff --git a/tests/YGMeasureCacheTest.cpp b/tests/YGMeasureCacheTest.cpp index 60ad6f47..9efc78b1 100644 --- a/tests/YGMeasureCacheTest.cpp +++ b/tests/YGMeasureCacheTest.cpp @@ -11,9 +11,9 @@ static YGSize _measureMax( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { int* measureCount = (int*) node->getContext(); (*measureCount)++; @@ -26,9 +26,9 @@ static YGSize _measureMax( static YGSize _measureMin( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { int* measureCount = (int*) node->getContext(); *measureCount = *measureCount + 1; @@ -46,9 +46,9 @@ static YGSize _measureMin( static YGSize _measure_84_49( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { int* measureCount = (int*) node->getContext(); if (measureCount) { diff --git a/tests/YGMeasureModeTest.cpp b/tests/YGMeasureModeTest.cpp index 6ed7b2c0..6a12b1c2 100644 --- a/tests/YGMeasureModeTest.cpp +++ b/tests/YGMeasureModeTest.cpp @@ -10,9 +10,9 @@ #include struct _MeasureConstraint { - float width; + YGFloat width; YGMeasureMode widthMode; - float height; + YGFloat height; YGMeasureMode heightMode; }; @@ -23,9 +23,9 @@ struct _MeasureConstraintList { static YGSize _measure( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { struct _MeasureConstraintList* constraintList = (struct _MeasureConstraintList*) node->getContext(); diff --git a/tests/YGMeasureTest.cpp b/tests/YGMeasureTest.cpp index e47607d4..a375305a 100644 --- a/tests/YGMeasureTest.cpp +++ b/tests/YGMeasureTest.cpp @@ -11,9 +11,9 @@ static YGSize _measure( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { int* measureCount = (int*) node->getContext(); if (measureCount) { @@ -28,9 +28,9 @@ static YGSize _measure( static YGSize _simulate_wrapping_text( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { if (widthMode == YGMeasureModeUndefined || width >= 68) { return YGSize{.width = 68, .height = 16}; @@ -44,9 +44,9 @@ static YGSize _simulate_wrapping_text( static YGSize _measure_assert_negative( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { EXPECT_GE(width, 0); EXPECT_GE(height, 0); @@ -643,9 +643,9 @@ TEST(YogaTest, cant_call_negative_measure_horizontal) { static YGSize _measure_90_10( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ @@ -656,9 +656,9 @@ static YGSize _measure_90_10( static YGSize _measure_100_100( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ diff --git a/tests/YGMinMaxDimensionTest.cpp b/tests/YGMinMaxDimensionTest.cpp index 621aff4d..2090cfff 100644 --- a/tests/YGMinMaxDimensionTest.cpp +++ b/tests/YGMinMaxDimensionTest.cpp @@ -1298,9 +1298,9 @@ TEST(YogaTest, min_max_percent_no_width_height) { static YGSize _measureCk_test_label_shrink_based_on_height( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { if (heightMode == YGMeasureModeAtMost) { diff --git a/tests/YGNodeCallbackTest.cpp b/tests/YGNodeCallbackTest.cpp index 5e765a0d..b609fd60 100644 --- a/tests/YGNodeCallbackTest.cpp +++ b/tests/YGNodeCallbackTest.cpp @@ -22,7 +22,7 @@ TEST(YGNode, hasMeasureFunc_initial) { TEST(YGNode, hasMeasureFunc_with_measure_fn) { auto n = YGNode{}; - n.setMeasureFunc([](YGNode*, float, YGMeasureMode, float, YGMeasureMode) { + n.setMeasureFunc([](YGNode*, YGFloat, YGMeasureMode, YGFloat, YGMeasureMode) { return YGSize{}; }); ASSERT_TRUE(n.hasMeasureFunc()); @@ -32,7 +32,7 @@ TEST(YGNode, measure_with_measure_fn) { auto n = YGNode{}; n.setMeasureFunc( - [](YGNode*, float w, YGMeasureMode wm, float h, YGMeasureMode hm) { + [](YGNode*, YGFloat w, YGMeasureMode wm, YGFloat h, YGMeasureMode hm) { return YGSize{w * wm, h / hm}; }); @@ -44,7 +44,7 @@ TEST(YGNode, measure_with_measure_fn) { TEST(YGNode, measure_with_context_measure_fn) { auto n = YGNode{}; n.setMeasureFunc( - [](YGNode*, float, YGMeasureMode, float, YGMeasureMode, void* ctx) { + [](YGNode*, YGFloat, YGMeasureMode, YGFloat, YGMeasureMode, void* ctx) { return *(YGSize*) ctx; }); @@ -57,11 +57,11 @@ TEST(YGNode, measure_with_context_measure_fn) { TEST(YGNode, switching_measure_fn_types) { auto n = YGNode{}; n.setMeasureFunc( - [](YGNode*, float, YGMeasureMode, float, YGMeasureMode, void*) { + [](YGNode*, YGFloat, YGMeasureMode, YGFloat, YGMeasureMode, void*) { return YGSize{}; }); n.setMeasureFunc( - [](YGNode*, float w, YGMeasureMode wm, float h, YGMeasureMode hm) { + [](YGNode*, YGFloat w, YGMeasureMode wm, YGFloat h, YGMeasureMode hm) { return YGSize{w * wm, h / hm}; }); @@ -72,7 +72,7 @@ TEST(YGNode, switching_measure_fn_types) { TEST(YGNode, hasMeasureFunc_after_unset) { auto n = YGNode{}; - n.setMeasureFunc([](YGNode*, float, YGMeasureMode, float, YGMeasureMode) { + n.setMeasureFunc([](YGNode*, YGFloat, YGMeasureMode, YGFloat, YGMeasureMode) { return YGSize{}; }); @@ -83,7 +83,7 @@ TEST(YGNode, hasMeasureFunc_after_unset) { TEST(YGNode, hasMeasureFunc_after_unset_context) { auto n = YGNode{}; n.setMeasureFunc( - [](YGNode*, float, YGMeasureMode, float, YGMeasureMode, void*) { + [](YGNode*, YGFloat, YGMeasureMode, YGFloat, YGMeasureMode, void*) { return YGSize{}; }); @@ -98,20 +98,20 @@ TEST(YGNode, hasBaselineFunc_initial) { TEST(YGNode, hasBaselineFunc_with_baseline_fn) { auto n = YGNode{}; - n.setBaselineFunc([](YGNode*, float, float) { return 0.0f; }); + n.setBaselineFunc([](YGNode*, YGFloat, YGFloat) { return 0.0; }); ASSERT_TRUE(n.hasBaselineFunc()); } TEST(YGNode, baseline_with_baseline_fn) { auto n = YGNode{}; - n.setBaselineFunc([](YGNode*, float w, float h) { return w + h; }); + n.setBaselineFunc([](YGNode*, YGFloat w, YGFloat h) { return w + h; }); ASSERT_EQ(n.baseline(1.25f, 2.5f, nullptr), 3.75f); } TEST(YGNode, baseline_with_context_baseline_fn) { auto n = YGNode{}; - n.setBaselineFunc([](YGNode*, float w, float h, void* ctx) { + n.setBaselineFunc([](YGNode*, YGFloat w, YGFloat h, void* ctx) { return w + h + *(float*) ctx; }); @@ -121,7 +121,7 @@ TEST(YGNode, baseline_with_context_baseline_fn) { TEST(YGNode, hasBaselineFunc_after_unset) { auto n = YGNode{}; - n.setBaselineFunc([](YGNode*, float, float) { return 0.0f; }); + n.setBaselineFunc([](YGNode*, YGFloat, YGFloat) { return 0.0; }); n.setBaselineFunc(nullptr); ASSERT_FALSE(n.hasBaselineFunc()); @@ -129,7 +129,7 @@ TEST(YGNode, hasBaselineFunc_after_unset) { TEST(YGNode, hasBaselineFunc_after_unset_context) { auto n = YGNode{}; - n.setBaselineFunc([](YGNode*, float, float, void*) { return 0.0f; }); + n.setBaselineFunc([](YGNode*, YGFloat, YGFloat, void*) { return 0.0; }); n.setMeasureFunc(nullptr); ASSERT_FALSE(n.hasMeasureFunc()); @@ -137,8 +137,8 @@ TEST(YGNode, hasBaselineFunc_after_unset_context) { TEST(YGNode, switching_baseline_fn_types) { auto n = YGNode{}; - n.setBaselineFunc([](YGNode*, float, float, void*) { return 0.0f; }); - n.setBaselineFunc([](YGNode*, float, float) { return 1.0f; }); + n.setBaselineFunc([](YGNode*, YGFloat, YGFloat, void*) { return 0.0; }); + n.setBaselineFunc([](YGNode*, YGFloat, YGFloat) { return 1.0; }); ASSERT_EQ(n.baseline(1, 2, nullptr), 1.0f); } diff --git a/tests/YGPercentageTest.cpp b/tests/YGPercentageTest.cpp index 805df24b..276e2299 100644 --- a/tests/YGPercentageTest.cpp +++ b/tests/YGPercentageTest.cpp @@ -1196,9 +1196,9 @@ TEST(YogaTest, percent_absolute_position) { static YGSize _measureCk_test_label_shrink_based_on_height( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { if (heightMode == YGMeasureModeAtMost) { diff --git a/tests/YGRoundingFunctionTest.cpp b/tests/YGRoundingFunctionTest.cpp index 21daeac6..91e4aa5c 100644 --- a/tests/YGRoundingFunctionTest.cpp +++ b/tests/YGRoundingFunctionTest.cpp @@ -44,9 +44,9 @@ TEST(YogaTest, rounding_value) { static YGSize measureText( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return (YGSize){.width = 10, .height = 10}; } diff --git a/tests/YGRoundingMeasureFuncTest.cpp b/tests/YGRoundingMeasureFuncTest.cpp index 822e3701..3005f62a 100644 --- a/tests/YGRoundingMeasureFuncTest.cpp +++ b/tests/YGRoundingMeasureFuncTest.cpp @@ -11,9 +11,9 @@ static YGSize _measureFloor( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ width = 10.2f, @@ -23,9 +23,9 @@ static YGSize _measureFloor( static YGSize _measureCeil( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ width = 10.5f, @@ -35,9 +35,9 @@ static YGSize _measureCeil( static YGSize _measureFractial( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode) { return YGSize{ width = 0.5f, diff --git a/yoga/CompactValue.h b/yoga/CompactValue.h index be933a16..bfb0583e 100644 --- a/yoga/CompactValue.h +++ b/yoga/CompactValue.h @@ -112,9 +112,9 @@ public: case AUTO_BITS: return YGValueAuto; case ZERO_BITS_POINT: - return YGValue{0.0f, YGUnitPoint}; + return YGValue{0.0, YGUnitPoint}; case ZERO_BITS_PERCENT: - return YGValue{0.0f, YGUnitPercent}; + return YGValue{0.0, YGUnitPercent}; } if (std::isnan(payload_.value)) { diff --git a/yoga/Utils.cpp b/yoga/Utils.cpp index edb198d2..f9c1dc6b 100644 --- a/yoga/Utils.cpp +++ b/yoga/Utils.cpp @@ -18,16 +18,16 @@ YGFlexDirection YGFlexDirectionCross( : YGFlexDirectionColumn; } -float YGFloatMax(const float a, const float b) { +YGFloat YGFloatMax(const YGFloat a, const YGFloat b) { if (!yoga::isUndefined(a) && !yoga::isUndefined(b)) { - return fmaxf(a, b); + return fmax(a, b); } return yoga::isUndefined(a) ? b : a; } -float YGFloatMin(const float a, const float b) { +YGFloat YGFloatMin(const YGFloat a, const YGFloat b) { if (!yoga::isUndefined(a) && !yoga::isUndefined(b)) { - return fminf(a, b); + return fmin(a, b); } return yoga::isUndefined(a) ? b : a; @@ -46,7 +46,7 @@ bool YGValueEqual(const YGValue& a, const YGValue& b) { return fabs(a.value - b.value) < 0.0001f; } -bool YGFloatsEqual(const float a, const float b) { +bool YGFloatsEqual(const YGFloat a, const YGFloat b) { if (!yoga::isUndefined(a) && !yoga::isUndefined(b)) { return fabs(a - b) < 0.0001f; } @@ -60,7 +60,7 @@ bool YGDoubleEqual(const double a, const double b) { return yoga::isUndefined(a) && yoga::isUndefined(b); } -float YGFloatSanitize(const float val) { +YGFloat YGFloatSanitize(const YGFloat val) { return yoga::isUndefined(val) ? 0 : val; } diff --git a/yoga/Utils.h b/yoga/Utils.h index 57e1d45d..3cc4f181 100644 --- a/yoga/Utils.h +++ b/yoga/Utils.h @@ -38,19 +38,19 @@ struct YGCollectFlexItemsRowValues { uint32_t itemsOnLine; - float sizeConsumedOnCurrentLine; - float totalFlexGrowFactors; - float totalFlexShrinkScaledFactors; + YGFloat sizeConsumedOnCurrentLine; + YGFloat totalFlexGrowFactors; + YGFloat totalFlexShrinkScaledFactors; uint32_t endOfLineIndex; std::vector relativeChildren; - float remainingFreeSpace; + YGFloat remainingFreeSpace; // The size of the mainDim for the row after considering size, padding, margin // and border of flex items. This is used to calculate maxLineDim after going // through all the rows to decide on the main axis size of owner. - float mainDim; + YGFloat mainDim; // The size of the crossDim for the row after considering size, padding, // margin and border of flex items. Used for calculating containers crossSize. - float crossDim; + YGFloat crossDim; }; bool YGValueEqual(const YGValue& a, const YGValue& b); @@ -60,27 +60,27 @@ inline bool YGValueEqual( return YGValueEqual((YGValue) a, (YGValue) b); } -// This custom float equality function returns true if either absolute +// This custom YGFloat equality function returns true if either absolute // difference between two floats is less than 0.0001f or both are undefined. -bool YGFloatsEqual(const float a, const float b); +bool YGFloatsEqual(const YGFloat a, const YGFloat b); bool YGDoubleEqual(const double a, const double b); -float YGFloatMax(const float a, const float b); +YGFloat YGFloatMax(const YGFloat a, const YGFloat b); YGFloatOptional YGFloatOptionalMax( const YGFloatOptional op1, const YGFloatOptional op2); -float YGFloatMin(const float a, const float b); +YGFloat YGFloatMin(const YGFloat a, const YGFloat b); -// This custom float comparison function compares the array of float with -// YGFloatsEqual, as the default float comparison operator will not work(Look +// This custom YGFloat comparison function compares the array of YGFloat with +// YGFloatsEqual, as the default YGFloat comparison operator will not work(Look // at the comments of YGFloatsEqual function). template bool YGFloatArrayEqual( - const std::array& val1, - const std::array& val2) { + const std::array& val1, + const std::array& val2) { bool areEqual = true; for (std::size_t i = 0; i < size && areEqual; ++i) { areEqual = YGFloatsEqual(val1[i], val2[i]); @@ -89,7 +89,7 @@ bool YGFloatArrayEqual( } // This function returns 0 if YGFloatIsUndefined(val) is true and val otherwise -float YGFloatSanitize(const float val); +YGFloat YGFloatSanitize(const YGFloat val); YGFlexDirection YGFlexDirectionCross( const YGFlexDirection flexDirection, @@ -102,7 +102,7 @@ inline bool YGFlexDirectionIsRow(const YGFlexDirection flexDirection) { inline YGFloatOptional YGResolveValue( const YGValue value, - const float ownerSize) { + const YGFloat ownerSize) { switch (value.unit) { case YGUnitPoint: return YGFloatOptional{value.value}; @@ -115,7 +115,7 @@ inline YGFloatOptional YGResolveValue( inline YGFloatOptional YGResolveValue( yoga::detail::CompactValue value, - float ownerSize) { + YGFloat ownerSize) { return YGResolveValue((YGValue) value, ownerSize); } @@ -140,7 +140,7 @@ inline YGFlexDirection YGResolveFlexDirection( inline YGFloatOptional YGResolveValueMargin( yoga::detail::CompactValue value, - const float ownerSize) { + const YGFloat ownerSize) { return value.isAuto() ? YGFloatOptional{0} : YGResolveValue(value, ownerSize); } diff --git a/yoga/YGConfig.h b/yoga/YGConfig.h index e87d6758..1154a002 100644 --- a/yoga/YGConfig.h +++ b/yoga/YGConfig.h @@ -40,7 +40,7 @@ public: bool useLegacyStretchBehaviour = false; bool shouldDiffLayoutWithoutLegacyStretchBehaviour = false; bool printTree = false; - float pointScaleFactor = 1.0f; + YGFloat pointScaleFactor = 1.0f; std::array()> experimentalFeatures = {}; void* context = nullptr; diff --git a/yoga/YGEnums.h b/yoga/YGEnums.h index 3dc458dc..8aa9c9a5 100644 --- a/yoga/YGEnums.h +++ b/yoga/YGEnums.h @@ -10,6 +10,7 @@ #include "YGMacros.h" #ifdef __cplusplus +YG_EXTERN_CXX_BEGIN namespace facebook { namespace yoga { namespace enums { @@ -27,6 +28,7 @@ constexpr int n() { } // namespace enums } // namespace yoga } // namespace facebook +YG_EXTERN_C_END #endif #define YG_ENUM_DECL(NAME, ...) \ @@ -37,6 +39,7 @@ constexpr int n() { #define YG_ENUM_SEQ_DECL(NAME, ...) \ YG_ENUM_DECL(NAME, __VA_ARGS__) \ YG_EXTERN_C_END \ + YG_EXTERN_CXX_BEGIN \ namespace facebook { \ namespace yoga { \ namespace enums { \ @@ -47,6 +50,7 @@ constexpr int n() { } \ } \ } \ + YG_EXTERN_C_END \ YG_EXTERN_C_BEGIN #else #define YG_ENUM_SEQ_DECL YG_ENUM_DECL diff --git a/yoga/YGFloatOptional.h b/yoga/YGFloatOptional.h index e4cf0284..f7dfed5a 100644 --- a/yoga/YGFloatOptional.h +++ b/yoga/YGFloatOptional.h @@ -13,14 +13,14 @@ struct YGFloatOptional { private: - float value_ = std::numeric_limits::quiet_NaN(); + YGFloat value_ = std::numeric_limits::quiet_NaN(); public: - explicit constexpr YGFloatOptional(float value) : value_(value) {} + explicit constexpr YGFloatOptional(YGFloat value) : value_(value) {} constexpr YGFloatOptional() = default; // returns the wrapped value, or a value x with YGIsUndefined(x) == true - constexpr float unwrap() const { return value_; } + constexpr YGFloat unwrap() const { return value_; } bool isUndefined() const { return std::isnan(value_); } }; @@ -35,17 +35,17 @@ inline bool operator!=(YGFloatOptional lhs, YGFloatOptional rhs) { return !(lhs == rhs); } -inline bool operator==(YGFloatOptional lhs, float rhs) { +inline bool operator==(YGFloatOptional lhs, YGFloat rhs) { return lhs == YGFloatOptional{rhs}; } -inline bool operator!=(YGFloatOptional lhs, float rhs) { +inline bool operator!=(YGFloatOptional lhs, YGFloat rhs) { return !(lhs == rhs); } -inline bool operator==(float lhs, YGFloatOptional rhs) { +inline bool operator==(YGFloat lhs, YGFloatOptional rhs) { return rhs == lhs; } -inline bool operator!=(float lhs, YGFloatOptional rhs) { +inline bool operator!=(YGFloat lhs, YGFloatOptional rhs) { return !(lhs == rhs); } diff --git a/yoga/YGLayout.h b/yoga/YGLayout.h index b7604d8e..1311cf3a 100644 --- a/yoga/YGLayout.h +++ b/yoga/YGLayout.h @@ -13,11 +13,11 @@ using namespace facebook::yoga; struct YGLayout { - std::array position = {}; - std::array dimensions = {{YGUndefined, YGUndefined}}; - std::array margin = {}; - std::array border = {}; - std::array padding = {}; + std::array position = {}; + std::array dimensions = {{YGUndefined, YGUndefined}}; + std::array margin = {}; + std::array border = {}; + std::array padding = {}; private: static constexpr size_t directionOffset = 0; @@ -41,7 +41,7 @@ public: uint32_t nextCachedMeasurementsIndex = 0; std::array cachedMeasurements = {}; - std::array measuredDimensions = {{YGUndefined, YGUndefined}}; + std::array measuredDimensions = {{YGUndefined, YGUndefined}}; YGCachedMeasurement cachedLayout = YGCachedMeasurement(); diff --git a/yoga/YGMacros.h b/yoga/YGMacros.h index c6917f1b..81ce8142 100644 --- a/yoga/YGMacros.h +++ b/yoga/YGMacros.h @@ -7,10 +7,27 @@ #pragma once +#if defined(__LP64__) && __LP64__ +# define YGFLOAT_TYPE double +# define YGFLOAT_IS_DOUBLE 1 +# define YGFLOAT_MIN DBL_MIN +# define YGFLOAT_MAX DBL_MAX +#else +# define YGFLOAT_TYPE float +# define YGFLOAT_IS_DOUBLE 0 +# define YGFLOAT_MIN FLT_MIN +# define YGFLOAT_MAX FLT_MAX +#endif + +typedef YGFLOAT_TYPE YGFloat; +#define YGFLOAT_DEFINED 1 + #ifdef __cplusplus +#define YG_EXTERN_CXX_BEGIN extern "C++" { #define YG_EXTERN_C_BEGIN extern "C" { #define YG_EXTERN_C_END } #else +#define YG_EXTERN_CXX_BEGIN #define YG_EXTERN_C_BEGIN #define YG_EXTERN_C_END #endif diff --git a/yoga/YGNode.cpp b/yoga/YGNode.cpp index 1ee1bde6..b4fa4947 100644 --- a/yoga/YGNode.cpp +++ b/yoga/YGNode.cpp @@ -52,7 +52,7 @@ void YGNode::print(void* printContext) { YGFloatOptional YGNode::getLeadingPosition( const YGFlexDirection axis, - const float axisSize) const { + const YGFloat axisSize) const { if (YGFlexDirectionIsRow(axis)) { auto leadingPosition = YGComputedEdgeValue( style_.position(), YGEdgeStart, CompactValue::ofUndefined()); @@ -71,7 +71,7 @@ YGFloatOptional YGNode::getLeadingPosition( YGFloatOptional YGNode::getTrailingPosition( const YGFlexDirection axis, - const float axisSize) const { + const YGFloat axisSize) const { if (YGFlexDirectionIsRow(axis)) { auto trailingPosition = YGComputedEdgeValue( style_.position(), YGEdgeEnd, CompactValue::ofUndefined()); @@ -110,7 +110,7 @@ bool YGNode::isTrailingPosDefined(const YGFlexDirection axis) const { YGFloatOptional YGNode::getLeadingMargin( const YGFlexDirection axis, - const float widthSize) const { + const YGFloat widthSize) const { if (YGFlexDirectionIsRow(axis) && !style_.margin()[YGEdgeStart].isUndefined()) { return YGResolveValueMargin(style_.margin()[YGEdgeStart], widthSize); @@ -124,7 +124,7 @@ YGFloatOptional YGNode::getLeadingMargin( YGFloatOptional YGNode::getTrailingMargin( const YGFlexDirection axis, - const float widthSize) const { + const YGFloat widthSize) const { if (YGFlexDirectionIsRow(axis) && !style_.margin()[YGEdgeEnd].isUndefined()) { return YGResolveValueMargin(style_.margin()[YGEdgeEnd], widthSize); } @@ -137,14 +137,14 @@ YGFloatOptional YGNode::getTrailingMargin( YGFloatOptional YGNode::getMarginForAxis( const YGFlexDirection axis, - const float widthSize) const { + const YGFloat widthSize) const { return getLeadingMargin(axis, widthSize) + getTrailingMargin(axis, widthSize); } YGSize YGNode::measure( - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode, void* layoutContext) { @@ -154,7 +154,7 @@ YGSize YGNode::measure( : measure_.noContext(this, width, widthMode, height, heightMode); } -float YGNode::baseline(float width, float height, void* layoutContext) { +YGFloat YGNode::baseline(YGFloat width, YGFloat height, void* layoutContext) { return facebook::yoga::detail::getBooleanData(flags, baselineUsesContext_) ? baseline_.withContext(this, width, height, layoutContext) : baseline_.noContext(this, width, height); @@ -235,15 +235,15 @@ void YGNode::setLayoutDirection(YGDirection direction) { layout_.setDirection(direction); } -void YGNode::setLayoutMargin(float margin, int index) { +void YGNode::setLayoutMargin(YGFloat margin, int index) { layout_.margin[index] = margin; } -void YGNode::setLayoutBorder(float border, int index) { +void YGNode::setLayoutBorder(YGFloat border, int index) { layout_.border[index] = border; } -void YGNode::setLayoutPadding(float padding, int index) { +void YGNode::setLayoutPadding(YGFloat padding, int index) { layout_.padding[index] = padding; } @@ -256,7 +256,7 @@ void YGNode::setLayoutComputedFlexBasis( layout_.computedFlexBasis = computedFlexBasis; } -void YGNode::setLayoutPosition(float position, int index) { +void YGNode::setLayoutPosition(YGFloat position, int index) { layout_.position[index] = position; } @@ -265,7 +265,7 @@ void YGNode::setLayoutComputedFlexBasisGeneration( layout_.computedFlexBasisGeneration = computedFlexBasisGeneration; } -void YGNode::setLayoutMeasuredDimension(float measuredDimension, int index) { +void YGNode::setLayoutMeasuredDimension(YGFloat measuredDimension, int index) { layout_.measuredDimensions[index] = measuredDimension; } @@ -273,7 +273,7 @@ void YGNode::setLayoutHadOverflow(bool hadOverflow) { layout_.setHadOverflow(hadOverflow); } -void YGNode::setLayoutDimension(float dimension, int index) { +void YGNode::setLayoutDimension(YGFloat dimension, int index) { layout_.dimensions[index] = dimension; } @@ -281,7 +281,7 @@ void YGNode::setLayoutDimension(float dimension, int index) { // -right depending on which is defined. YGFloatOptional YGNode::relativePosition( const YGFlexDirection axis, - const float axisSize) const { + const YGFloat axisSize) const { if (isLeadingPositionDefined(axis)) { return getLeadingPosition(axis, axisSize); } @@ -295,9 +295,9 @@ YGFloatOptional YGNode::relativePosition( void YGNode::setPosition( const YGDirection direction, - const float mainSize, - const float crossSize, - const float ownerWidth) { + const YGFloat mainSize, + const YGFloat crossSize, + const YGFloat ownerWidth) { /* Root nodes should be always layouted as LTR, so we don't return negative * values. */ const YGDirection directionRespectingRoot = @@ -411,7 +411,7 @@ void YGNode::markDirtyAndPropogateDownwards() { }); } -float YGNode::resolveFlexGrow() const { +YGFloat YGNode::resolveFlexGrow() const { // Root nodes flexGrow should always be 0 if (owner_ == nullptr) { return 0.0; @@ -425,7 +425,7 @@ float YGNode::resolveFlexGrow() const { return kDefaultFlexGrow; } -float YGNode::resolveFlexShrink() const { +YGFloat YGNode::resolveFlexShrink() const { if (owner_ == nullptr) { return 0.0; } @@ -447,7 +447,7 @@ bool YGNode::isNodeFlexible() { (resolveFlexGrow() != 0 || resolveFlexShrink() != 0)); } -float YGNode::getLeadingBorder(const YGFlexDirection axis) const { +YGFloat YGNode::getLeadingBorder(const YGFlexDirection axis) const { YGValue leadingBorder; if (YGFlexDirectionIsRow(axis) && !style_.border()[YGEdgeStart].isUndefined()) { @@ -462,7 +462,7 @@ float YGNode::getLeadingBorder(const YGFlexDirection axis) const { return YGFloatMax(leadingBorder.value, 0.0f); } -float YGNode::getTrailingBorder(const YGFlexDirection flexDirection) const { +YGFloat YGNode::getTrailingBorder(const YGFlexDirection flexDirection) const { YGValue trailingBorder; if (YGFlexDirectionIsRow(flexDirection) && !style_.border()[YGEdgeEnd].isUndefined()) { @@ -479,7 +479,7 @@ float YGNode::getTrailingBorder(const YGFlexDirection flexDirection) const { YGFloatOptional YGNode::getLeadingPadding( const YGFlexDirection axis, - const float widthSize) const { + const YGFloat widthSize) const { const YGFloatOptional paddingEdgeStart = YGResolveValue(style_.padding()[YGEdgeStart], widthSize); if (YGFlexDirectionIsRow(axis) && @@ -497,7 +497,7 @@ YGFloatOptional YGNode::getLeadingPadding( YGFloatOptional YGNode::getTrailingPadding( const YGFlexDirection axis, - const float widthSize) const { + const YGFloat widthSize) const { const YGFloatOptional paddingEdgeEnd = YGResolveValue(style_.padding()[YGEdgeEnd], widthSize); if (YGFlexDirectionIsRow(axis) && paddingEdgeEnd >= YGFloatOptional{0.0f}) { @@ -514,14 +514,14 @@ YGFloatOptional YGNode::getTrailingPadding( YGFloatOptional YGNode::getLeadingPaddingAndBorder( const YGFlexDirection axis, - const float widthSize) const { + const YGFloat widthSize) const { return getLeadingPadding(axis, widthSize) + YGFloatOptional(getLeadingBorder(axis)); } YGFloatOptional YGNode::getTrailingPaddingAndBorder( const YGFlexDirection axis, - const float widthSize) const { + const YGFloat widthSize) const { return getTrailingPadding(axis, widthSize) + YGFloatOptional(getTrailingBorder(axis)); } diff --git a/yoga/YGNode.h b/yoga/YGNode.h index 63d98fe3..b2fb9347 100644 --- a/yoga/YGNode.h +++ b/yoga/YGNode.h @@ -23,8 +23,8 @@ YGConfigRef YGConfigGetDefault(); struct YOGA_EXPORT YGNode { using MeasureWithContextFn = - YGSize (*)(YGNode*, float, YGMeasureMode, float, YGMeasureMode, void*); - using BaselineWithContextFn = float (*)(YGNode*, float, float, void*); + YGSize (*)(YGNode*, YGFloat, YGMeasureMode, YGFloat, YGMeasureMode, void*); + using BaselineWithContextFn = YGFloat (*)(YGNode*, YGFloat, YGFloat, void*); using PrintWithContextFn = void (*)(YGNode*, void*); private: @@ -64,7 +64,7 @@ private: YGFloatOptional relativePosition( const YGFlexDirection axis, - const float axisSize) const; + const YGFloat axisSize) const; void setMeasureFunc(decltype(measure_)); void setBaselineFunc(decltype(baseline_)); @@ -124,13 +124,13 @@ public: bool hasMeasureFunc() const noexcept { return measure_.noContext != nullptr; } - YGSize measure(float, YGMeasureMode, float, YGMeasureMode, void*); + YGSize measure(YGFloat, YGMeasureMode, YGFloat, YGMeasureMode, void*); bool hasBaselineFunc() const noexcept { return baseline_.noContext != nullptr; } - float baseline(float width, float height, void* layoutContext); + YGFloat baseline(YGFloat width, YGFloat height, void* layoutContext); YGDirtiedFunc getDirtied() const { return dirtied_; } @@ -196,35 +196,35 @@ public: // Methods related to positions, margin, padding and border YGFloatOptional getLeadingPosition( const YGFlexDirection axis, - const float axisSize) const; + const YGFloat axisSize) const; bool isLeadingPositionDefined(const YGFlexDirection axis) const; bool isTrailingPosDefined(const YGFlexDirection axis) const; YGFloatOptional getTrailingPosition( const YGFlexDirection axis, - const float axisSize) const; + const YGFloat axisSize) const; YGFloatOptional getLeadingMargin( const YGFlexDirection axis, - const float widthSize) const; + const YGFloat widthSize) const; YGFloatOptional getTrailingMargin( const YGFlexDirection axis, - const float widthSize) const; - float getLeadingBorder(const YGFlexDirection flexDirection) const; - float getTrailingBorder(const YGFlexDirection flexDirection) const; + const YGFloat widthSize) const; + YGFloat getLeadingBorder(const YGFlexDirection flexDirection) const; + YGFloat getTrailingBorder(const YGFlexDirection flexDirection) const; YGFloatOptional getLeadingPadding( const YGFlexDirection axis, - const float widthSize) const; + const YGFloat widthSize) const; YGFloatOptional getTrailingPadding( const YGFlexDirection axis, - const float widthSize) const; + const YGFloat widthSize) const; YGFloatOptional getLeadingPaddingAndBorder( const YGFlexDirection axis, - const float widthSize) const; + const YGFloat widthSize) const; YGFloatOptional getTrailingPaddingAndBorder( const YGFlexDirection axis, - const float widthSize) const; + const YGFloat widthSize) const; YGFloatOptional getMarginForAxis( const YGFlexDirection axis, - const float widthSize) const; + const YGFloat widthSize) const; // Setters void setContext(void* context) { context_ = context; } @@ -292,19 +292,19 @@ public: void setLayoutComputedFlexBasis(const YGFloatOptional computedFlexBasis); void setLayoutComputedFlexBasisGeneration( uint32_t computedFlexBasisGeneration); - void setLayoutMeasuredDimension(float measuredDimension, int index); + void setLayoutMeasuredDimension(YGFloat measuredDimension, int index); void setLayoutHadOverflow(bool hadOverflow); - void setLayoutDimension(float dimension, int index); + void setLayoutDimension(YGFloat dimension, int index); void setLayoutDirection(YGDirection direction); - void setLayoutMargin(float margin, int index); - void setLayoutBorder(float border, int index); - void setLayoutPadding(float padding, int index); - void setLayoutPosition(float position, int index); + void setLayoutMargin(YGFloat margin, int index); + void setLayoutBorder(YGFloat border, int index); + void setLayoutPadding(YGFloat padding, int index); + void setLayoutPosition(YGFloat position, int index); void setPosition( const YGDirection direction, - const float mainSize, - const float crossSize, - const float ownerWidth); + const YGFloat mainSize, + const YGFloat crossSize, + const YGFloat ownerWidth); void setLayoutDoesLegacyFlagAffectsLayout(bool doesLegacyFlagAffectsLayout); void setLayoutDidUseLegacyFlag(bool didUseLegacyFlag); void markDirtyAndPropogateDownwards(); @@ -326,8 +326,8 @@ public: void cloneChildrenIfNeeded(void*); void markDirtyAndPropogate(); - float resolveFlexGrow() const; - float resolveFlexShrink() const; + YGFloat resolveFlexGrow() const; + YGFloat resolveFlexShrink() const; bool isNodeFlexible(); bool didUseLegacyFlag(); bool isLayoutTreeEqualToNode(const YGNode& node) const; diff --git a/yoga/YGValue.h b/yoga/YGValue.h index a2000978..e118211e 100644 --- a/yoga/YGValue.h +++ b/yoga/YGValue.h @@ -15,22 +15,24 @@ #define COMPILING_WITH_CLANG_ON_WINDOWS #endif #if defined(COMPILING_WITH_CLANG_ON_WINDOWS) +YG_EXTERN_CXX_BEGIN #include -constexpr float YGUndefined = std::numeric_limits::quiet_NaN(); +constexpr YGFloat YGUndefined = std::numeric_limits::quiet_NaN(); +YG_EXTERN_C_END #else YG_EXTERN_C_BEGIN // Not defined in MSVC++ #ifndef NAN static const uint32_t __nan = 0x7fc00000; -#define NAN (*(const float*) __nan) +#define NAN (*(const YGFloat*) __nan) #endif #define YGUndefined NAN #endif typedef struct YGValue { - float value; + YGFloat value; YGUnit unit; } YGValue; @@ -44,6 +46,7 @@ YG_EXTERN_C_END #undef COMPILING_WITH_CLANG_ON_WINDOWS #ifdef __cplusplus +YG_EXTERN_CXX_BEGIN inline bool operator==(const YGValue& lhs, const YGValue& rhs) { if (lhs.unit != rhs.unit) { @@ -75,14 +78,14 @@ namespace yoga { namespace literals { inline YGValue operator"" _pt(long double value) { - return YGValue{static_cast(value), YGUnitPoint}; + return YGValue{static_cast(value), YGUnitPoint}; } inline YGValue operator"" _pt(unsigned long long value) { return operator"" _pt(static_cast(value)); } inline YGValue operator"" _percent(long double value) { - return YGValue{static_cast(value), YGUnitPercent}; + return YGValue{static_cast(value), YGUnitPercent}; } inline YGValue operator"" _percent(unsigned long long value) { return operator"" _percent(static_cast(value)); @@ -92,4 +95,5 @@ inline YGValue operator"" _percent(unsigned long long value) { } // namespace yoga } // namespace facebook +YG_EXTERN_C_END #endif diff --git a/yoga/Yoga-internal.h b/yoga/Yoga-internal.h index 1a22f24c..067fa965 100644 --- a/yoga/Yoga-internal.h +++ b/yoga/Yoga-internal.h @@ -19,8 +19,8 @@ YG_EXTERN_C_BEGIN void YGNodeCalculateLayoutWithContext( YGNodeRef node, - float availableWidth, - float availableHeight, + YGFloat availableWidth, + YGFloat availableHeight, YGDirection ownerDirection, void* layoutContext); @@ -29,7 +29,7 @@ YG_EXTERN_C_END namespace facebook { namespace yoga { -inline bool isUndefined(float value) { +inline bool isUndefined(YGFloat value) { return std::isnan(value); } @@ -45,13 +45,13 @@ extern const YGValue YGValueAuto; extern const YGValue YGValueZero; struct YGCachedMeasurement { - float availableWidth; - float availableHeight; + YGFloat availableWidth; + YGFloat availableHeight; YGMeasureMode widthMeasureMode; YGMeasureMode heightMeasureMode; - float computedWidth; - float computedHeight; + YGFloat computedWidth; + YGFloat computedHeight; YGCachedMeasurement() : availableWidth(-1), @@ -139,11 +139,11 @@ public: } // namespace yoga } // namespace facebook -static const float kDefaultFlexGrow = 0.0f; -static const float kDefaultFlexShrink = 0.0f; -static const float kWebDefaultFlexShrink = 1.0f; +static const YGFloat kDefaultFlexGrow = 0.0f; +static const YGFloat kDefaultFlexShrink = 0.0f; +static const YGFloat kWebDefaultFlexShrink = 1.0f; -extern bool YGFloatsEqual(const float a, const float b); +extern bool YGFloatsEqual(const YGFloat a, const YGFloat b); extern facebook::yoga::detail::CompactValue YGComputedEdgeValue( const facebook::yoga::detail::Values< facebook::yoga::enums::count()>& edges, diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index 97e64075..21cc1e57 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -22,7 +22,7 @@ /* define fmaxf if < VC12 */ #if _MSC_VER < 1800 -__forceinline const float fmaxf(const float a, const float b) { +__forceinline const YGFloat fmax(const YGFloat a, const YGFloat b) { return (a > b) ? a : b; } #endif @@ -106,7 +106,7 @@ static int YGDefaultLog( #undef YG_UNUSED #endif -YOGA_EXPORT bool YGFloatIsUndefined(const float value) { +YOGA_EXPORT bool YGFloatIsUndefined(const YGFloat value) { return facebook::yoga::isUndefined(value); } @@ -525,13 +525,13 @@ YOGA_EXPORT void YGNodeCopyStyle( } } -YOGA_EXPORT float YGNodeStyleGetFlexGrow(const YGNodeConstRef node) { +YOGA_EXPORT YGFloat YGNodeStyleGetFlexGrow(const YGNodeConstRef node) { return node->getStyle().flexGrow().isUndefined() ? kDefaultFlexGrow : node->getStyle().flexGrow().unwrap(); } -YOGA_EXPORT float YGNodeStyleGetFlexShrink(const YGNodeConstRef node) { +YOGA_EXPORT YGFloat YGNodeStyleGetFlexShrink(const YGNodeConstRef node) { return node->getStyle().flexShrink().isUndefined() ? (node->getConfig()->useWebDefaults ? kWebDefaultFlexShrink : kDefaultFlexShrink) @@ -681,12 +681,12 @@ YOGA_EXPORT YGDisplay YGNodeStyleGetDisplay(const YGNodeConstRef node) { } // TODO(T26792433): Change the API to accept YGFloatOptional. -YOGA_EXPORT void YGNodeStyleSetFlex(const YGNodeRef node, const float flex) { +YOGA_EXPORT void YGNodeStyleSetFlex(const YGNodeRef node, const YGFloat flex) { updateStyle(node, &YGStyle::flex, YGFloatOptional{flex}); } // TODO(T26792433): Change the API to accept YGFloatOptional. -YOGA_EXPORT float YGNodeStyleGetFlex(const YGNodeConstRef node) { +YOGA_EXPORT YGFloat YGNodeStyleGetFlex(const YGNodeConstRef node) { return node->getStyle().flex().isUndefined() ? YGUndefined : node->getStyle().flex().unwrap(); @@ -695,7 +695,7 @@ YOGA_EXPORT float YGNodeStyleGetFlex(const YGNodeConstRef node) { // TODO(T26792433): Change the API to accept YGFloatOptional. YOGA_EXPORT void YGNodeStyleSetFlexGrow( const YGNodeRef node, - const float flexGrow) { + const YGFloat flexGrow) { updateStyle( node, &YGStyle::flexGrow, YGFloatOptional{flexGrow}); } @@ -703,7 +703,7 @@ YOGA_EXPORT void YGNodeStyleSetFlexGrow( // TODO(T26792433): Change the API to accept YGFloatOptional. YOGA_EXPORT void YGNodeStyleSetFlexShrink( const YGNodeRef node, - const float flexShrink) { + const YGFloat flexShrink) { updateStyle( node, &YGStyle::flexShrink, YGFloatOptional{flexShrink}); } @@ -719,14 +719,14 @@ YOGA_EXPORT YGValue YGNodeStyleGetFlexBasis(const YGNodeConstRef node) { YOGA_EXPORT void YGNodeStyleSetFlexBasis( const YGNodeRef node, - const float flexBasis) { + const YGFloat flexBasis) { auto value = detail::CompactValue::ofMaybe(flexBasis); updateStyle(node, &YGStyle::flexBasis, value); } YOGA_EXPORT void YGNodeStyleSetFlexBasisPercent( const YGNodeRef node, - const float flexBasisPercent) { + const YGFloat flexBasisPercent) { auto value = detail::CompactValue::ofMaybe(flexBasisPercent); updateStyle(node, &YGStyle::flexBasis, value); } @@ -739,7 +739,7 @@ YOGA_EXPORT void YGNodeStyleSetFlexBasisAuto(const YGNodeRef node) { YOGA_EXPORT void YGNodeStyleSetPosition( YGNodeRef node, YGEdge edge, - float points) { + YGFloat points) { auto value = detail::CompactValue::ofMaybe(points); updateIndexedStyleProp( node, &YGStyle::position, edge, value); @@ -747,7 +747,7 @@ YOGA_EXPORT void YGNodeStyleSetPosition( YOGA_EXPORT void YGNodeStyleSetPositionPercent( YGNodeRef node, YGEdge edge, - float percent) { + YGFloat percent) { auto value = detail::CompactValue::ofMaybe(percent); updateIndexedStyleProp( node, &YGStyle::position, edge, value); @@ -759,7 +759,7 @@ YOGA_EXPORT YGValue YGNodeStyleGetPosition(YGNodeConstRef node, YGEdge edge) { YOGA_EXPORT void YGNodeStyleSetMargin( YGNodeRef node, YGEdge edge, - float points) { + YGFloat points) { auto value = detail::CompactValue::ofMaybe(points); updateIndexedStyleProp( node, &YGStyle::margin, edge, value); @@ -767,7 +767,7 @@ YOGA_EXPORT void YGNodeStyleSetMargin( YOGA_EXPORT void YGNodeStyleSetMarginPercent( YGNodeRef node, YGEdge edge, - float percent) { + YGFloat percent) { auto value = detail::CompactValue::ofMaybe(percent); updateIndexedStyleProp( node, &YGStyle::margin, edge, value); @@ -783,7 +783,7 @@ YOGA_EXPORT YGValue YGNodeStyleGetMargin(YGNodeConstRef node, YGEdge edge) { YOGA_EXPORT void YGNodeStyleSetPadding( YGNodeRef node, YGEdge edge, - float points) { + YGFloat points) { auto value = detail::CompactValue::ofMaybe(points); updateIndexedStyleProp( node, &YGStyle::padding, edge, value); @@ -791,7 +791,7 @@ YOGA_EXPORT void YGNodeStyleSetPadding( YOGA_EXPORT void YGNodeStyleSetPaddingPercent( YGNodeRef node, YGEdge edge, - float percent) { + YGFloat percent) { auto value = detail::CompactValue::ofMaybe(percent); updateIndexedStyleProp( node, &YGStyle::padding, edge, value); @@ -804,13 +804,13 @@ YOGA_EXPORT YGValue YGNodeStyleGetPadding(YGNodeConstRef node, YGEdge edge) { YOGA_EXPORT void YGNodeStyleSetBorder( const YGNodeRef node, const YGEdge edge, - const float border) { + const YGFloat border) { auto value = detail::CompactValue::ofMaybe(border); updateIndexedStyleProp( node, &YGStyle::border, edge, value); } -YOGA_EXPORT float YGNodeStyleGetBorder( +YOGA_EXPORT YGFloat YGNodeStyleGetBorder( const YGNodeConstRef node, const YGEdge edge) { auto border = node->getStyle().border()[edge]; @@ -826,7 +826,7 @@ YOGA_EXPORT float YGNodeStyleGetBorder( // Yoga specific properties, not compatible with flexbox specification // TODO(T26792433): Change the API to accept YGFloatOptional. -YOGA_EXPORT float YGNodeStyleGetAspectRatio(const YGNodeConstRef node) { +YOGA_EXPORT YGFloat YGNodeStyleGetAspectRatio(const YGNodeConstRef node) { const YGFloatOptional op = node->getStyle().aspectRatio(); return op.isUndefined() ? YGUndefined : op.unwrap(); } @@ -834,17 +834,17 @@ YOGA_EXPORT float YGNodeStyleGetAspectRatio(const YGNodeConstRef node) { // TODO(T26792433): Change the API to accept YGFloatOptional. YOGA_EXPORT void YGNodeStyleSetAspectRatio( const YGNodeRef node, - const float aspectRatio) { + const YGFloat aspectRatio) { updateStyle( node, &YGStyle::aspectRatio, YGFloatOptional{aspectRatio}); } -YOGA_EXPORT void YGNodeStyleSetWidth(YGNodeRef node, float points) { +YOGA_EXPORT void YGNodeStyleSetWidth(YGNodeRef node, YGFloat points) { auto value = detail::CompactValue::ofMaybe(points); updateIndexedStyleProp( node, &YGStyle::dimensions, YGDimensionWidth, value); } -YOGA_EXPORT void YGNodeStyleSetWidthPercent(YGNodeRef node, float percent) { +YOGA_EXPORT void YGNodeStyleSetWidthPercent(YGNodeRef node, YGFloat percent) { auto value = detail::CompactValue::ofMaybe(percent); updateIndexedStyleProp( node, &YGStyle::dimensions, YGDimensionWidth, value); @@ -860,12 +860,12 @@ YOGA_EXPORT YGValue YGNodeStyleGetWidth(YGNodeConstRef node) { return node->getStyle().dimensions()[YGDimensionWidth]; } -YOGA_EXPORT void YGNodeStyleSetHeight(YGNodeRef node, float points) { +YOGA_EXPORT void YGNodeStyleSetHeight(YGNodeRef node, YGFloat points) { auto value = detail::CompactValue::ofMaybe(points); updateIndexedStyleProp( node, &YGStyle::dimensions, YGDimensionHeight, value); } -YOGA_EXPORT void YGNodeStyleSetHeightPercent(YGNodeRef node, float percent) { +YOGA_EXPORT void YGNodeStyleSetHeightPercent(YGNodeRef node, YGFloat percent) { auto value = detail::CompactValue::ofMaybe(percent); updateIndexedStyleProp( node, &YGStyle::dimensions, YGDimensionHeight, value); @@ -883,14 +883,14 @@ YOGA_EXPORT YGValue YGNodeStyleGetHeight(YGNodeConstRef node) { YOGA_EXPORT void YGNodeStyleSetMinWidth( const YGNodeRef node, - const float minWidth) { + const YGFloat minWidth) { auto value = detail::CompactValue::ofMaybe(minWidth); updateIndexedStyleProp( node, &YGStyle::minDimensions, YGDimensionWidth, value); } YOGA_EXPORT void YGNodeStyleSetMinWidthPercent( const YGNodeRef node, - const float minWidth) { + const YGFloat minWidth) { auto value = detail::CompactValue::ofMaybe(minWidth); updateIndexedStyleProp( node, &YGStyle::minDimensions, YGDimensionWidth, value); @@ -901,14 +901,14 @@ YOGA_EXPORT YGValue YGNodeStyleGetMinWidth(const YGNodeConstRef node) { YOGA_EXPORT void YGNodeStyleSetMinHeight( const YGNodeRef node, - const float minHeight) { + const YGFloat minHeight) { auto value = detail::CompactValue::ofMaybe(minHeight); updateIndexedStyleProp( node, &YGStyle::minDimensions, YGDimensionHeight, value); } YOGA_EXPORT void YGNodeStyleSetMinHeightPercent( const YGNodeRef node, - const float minHeight) { + const YGFloat minHeight) { auto value = detail::CompactValue::ofMaybe(minHeight); updateIndexedStyleProp( node, &YGStyle::minDimensions, YGDimensionHeight, value); @@ -919,14 +919,14 @@ YOGA_EXPORT YGValue YGNodeStyleGetMinHeight(const YGNodeConstRef node) { YOGA_EXPORT void YGNodeStyleSetMaxWidth( const YGNodeRef node, - const float maxWidth) { + const YGFloat maxWidth) { auto value = detail::CompactValue::ofMaybe(maxWidth); updateIndexedStyleProp( node, &YGStyle::maxDimensions, YGDimensionWidth, value); } YOGA_EXPORT void YGNodeStyleSetMaxWidthPercent( const YGNodeRef node, - const float maxWidth) { + const YGFloat maxWidth) { auto value = detail::CompactValue::ofMaybe(maxWidth); updateIndexedStyleProp( node, &YGStyle::maxDimensions, YGDimensionWidth, value); @@ -937,14 +937,14 @@ YOGA_EXPORT YGValue YGNodeStyleGetMaxWidth(const YGNodeConstRef node) { YOGA_EXPORT void YGNodeStyleSetMaxHeight( const YGNodeRef node, - const float maxHeight) { + const YGFloat maxHeight) { auto value = detail::CompactValue::ofMaybe(maxHeight); updateIndexedStyleProp( node, &YGStyle::maxDimensions, YGDimensionHeight, value); } YOGA_EXPORT void YGNodeStyleSetMaxHeightPercent( const YGNodeRef node, - const float maxHeight) { + const YGFloat maxHeight) { auto value = detail::CompactValue::ofMaybe(maxHeight); updateIndexedStyleProp( node, &YGStyle::maxDimensions, YGDimensionHeight, value); @@ -985,18 +985,18 @@ YOGA_EXPORT YGValue YGNodeStyleGetMaxHeight(const YGNodeConstRef node) { return node->getLayout().instanceName[edge]; \ } -YG_NODE_LAYOUT_PROPERTY_IMPL(float, Left, position[YGEdgeLeft]); -YG_NODE_LAYOUT_PROPERTY_IMPL(float, Top, position[YGEdgeTop]); -YG_NODE_LAYOUT_PROPERTY_IMPL(float, Right, position[YGEdgeRight]); -YG_NODE_LAYOUT_PROPERTY_IMPL(float, Bottom, position[YGEdgeBottom]); -YG_NODE_LAYOUT_PROPERTY_IMPL(float, Width, dimensions[YGDimensionWidth]); -YG_NODE_LAYOUT_PROPERTY_IMPL(float, Height, dimensions[YGDimensionHeight]); +YG_NODE_LAYOUT_PROPERTY_IMPL(YGFloat, Left, position[YGEdgeLeft]); +YG_NODE_LAYOUT_PROPERTY_IMPL(YGFloat, Top, position[YGEdgeTop]); +YG_NODE_LAYOUT_PROPERTY_IMPL(YGFloat, Right, position[YGEdgeRight]); +YG_NODE_LAYOUT_PROPERTY_IMPL(YGFloat, Bottom, position[YGEdgeBottom]); +YG_NODE_LAYOUT_PROPERTY_IMPL(YGFloat, Width, dimensions[YGDimensionWidth]); +YG_NODE_LAYOUT_PROPERTY_IMPL(YGFloat, Height, dimensions[YGDimensionHeight]); YG_NODE_LAYOUT_PROPERTY_IMPL(YGDirection, Direction, direction()); YG_NODE_LAYOUT_PROPERTY_IMPL(bool, HadOverflow, hadOverflow()); -YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(float, Margin, margin); -YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(float, Border, border); -YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(float, Padding, padding); +YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(YGFloat, Margin, margin); +YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(YGFloat, Border, border); +YG_NODE_LAYOUT_RESOLVED_PROPERTY_IMPL(YGFloat, Padding, padding); YOGA_EXPORT bool YGNodeLayoutGetDidLegacyStretchFlagAffectLayout( const YGNodeRef node) { @@ -1007,13 +1007,13 @@ std::atomic gCurrentGenerationCount(0); bool YGLayoutNodeInternal( const YGNodeRef node, - const float availableWidth, - const float availableHeight, + const YGFloat availableWidth, + const YGFloat availableHeight, const YGDirection ownerDirection, const YGMeasureMode widthMeasureMode, const YGMeasureMode heightMeasureMode, - const float ownerWidth, - const float ownerHeight, + const YGFloat ownerWidth, + const YGFloat ownerHeight, const bool performLayout, const LayoutPassReason reason, const YGConfigRef config, @@ -1053,10 +1053,10 @@ static const std::array pos = {{ static const std::array dim = { {YGDimensionHeight, YGDimensionHeight, YGDimensionWidth, YGDimensionWidth}}; -static inline float YGNodePaddingAndBorderForAxis( +static inline YGFloat YGNodePaddingAndBorderForAxis( const YGNodeConstRef node, const YGFlexDirection axis, - const float widthSize) { + const YGFloat widthSize) { return (node->getLeadingPaddingAndBorder(axis, widthSize) + node->getTrailingPaddingAndBorder(axis, widthSize)) .unwrap(); @@ -1073,12 +1073,12 @@ static inline YGAlign YGNodeAlignItem(const YGNode* node, const YGNode* child) { return align; } -static float YGBaseline(const YGNodeRef node, void* layoutContext) { +static YGFloat YGBaseline(const YGNodeRef node, void* layoutContext) { if (node->hasBaselineFunc()) { Event::publish(node); - const float baseline = node->baseline( + const YGFloat baseline = node->baseline( node->getLayout().measuredDimensions[YGDimensionWidth], node->getLayout().measuredDimensions[YGDimensionHeight], layoutContext); @@ -1117,7 +1117,7 @@ static float YGBaseline(const YGNodeRef node, void* layoutContext) { return node->getLayout().measuredDimensions[YGDimensionHeight]; } - const float baseline = YGBaseline(baselineChild, layoutContext); + const YGFloat baseline = YGBaseline(baselineChild, layoutContext); return baseline + baselineChild->getLayout().position[YGEdgeTop]; } @@ -1140,10 +1140,10 @@ static bool YGIsBaselineLayout(const YGNodeRef node) { return false; } -static inline float YGNodeDimWithMargin( +static inline YGFloat YGNodeDimWithMargin( const YGNodeRef node, const YGFlexDirection axis, - const float widthSize) { + const YGFloat widthSize) { return node->getLayout().measuredDimensions[dim[axis]] + (node->getLeadingMargin(axis, widthSize) + node->getTrailingMargin(axis, widthSize)) @@ -1153,7 +1153,7 @@ static inline float YGNodeDimWithMargin( static inline bool YGNodeIsStyleDimDefined( const YGNodeRef node, const YGFlexDirection axis, - const float ownerSize) { + const YGFloat ownerSize) { bool isUndefined = YGFloatIsUndefined(node->getResolvedDimension(dim[axis]).value); return !( @@ -1170,7 +1170,7 @@ static inline bool YGNodeIsStyleDimDefined( static inline bool YGNodeIsLayoutDimDefined( const YGNodeRef node, const YGFlexDirection axis) { - const float value = node->getLayout().measuredDimensions[dim[axis]]; + const YGFloat value = node->getLayout().measuredDimensions[dim[axis]]; return !YGFloatIsUndefined(value) && value >= 0.0f; } @@ -1178,7 +1178,7 @@ static YGFloatOptional YGNodeBoundAxisWithinMinAndMax( const YGNodeConstRef node, const YGFlexDirection axis, const YGFloatOptional value, - const float axisSize) { + const YGFloat axisSize) { YGFloatOptional min; YGFloatOptional max; @@ -1207,12 +1207,12 @@ static YGFloatOptional YGNodeBoundAxisWithinMinAndMax( // Like YGNodeBoundAxisWithinMinAndMax but also ensures that the value doesn't // go below the padding and border amount. -static inline float YGNodeBoundAxis( +static inline YGFloat YGNodeBoundAxis( const YGNodeRef node, const YGFlexDirection axis, - const float value, - const float axisSize, - const float widthSize) { + const YGFloat value, + const YGFloat axisSize, + const YGFloat widthSize) { return YGFloatMax( YGNodeBoundAxisWithinMinAndMax( node, axis, YGFloatOptional{value}, axisSize) @@ -1224,7 +1224,7 @@ static void YGNodeSetChildTrailingPosition( const YGNodeRef node, const YGNodeRef child, const YGFlexDirection axis) { - const float size = child->getLayout().measuredDimensions[dim[axis]]; + const YGFloat size = child->getLayout().measuredDimensions[dim[axis]]; child->setLayoutPosition( node->getLayout().measuredDimensions[dim[axis]] - size - child->getLayout().position[pos[axis]], @@ -1234,10 +1234,10 @@ static void YGNodeSetChildTrailingPosition( static void YGConstrainMaxSizeForMode( const YGNodeConstRef node, const enum YGFlexDirection axis, - const float ownerAxisSize, - const float ownerWidth, + const YGFloat ownerAxisSize, + const YGFloat ownerWidth, YGMeasureMode* mode, - float* size) { + YGFloat* size) { const YGFloatOptional maxSize = YGResolveValue( node->getStyle().maxDimensions()[dim[axis]], ownerAxisSize) + @@ -1261,11 +1261,11 @@ static void YGConstrainMaxSizeForMode( static void YGNodeComputeFlexBasisForChild( const YGNodeRef node, const YGNodeRef child, - const float width, + const YGFloat width, const YGMeasureMode widthMode, - const float height, - const float ownerWidth, - const float ownerHeight, + const YGFloat height, + const YGFloat ownerWidth, + const YGFloat ownerHeight, const YGMeasureMode heightMode, const YGDirection direction, const YGConfigRef config, @@ -1276,11 +1276,11 @@ static void YGNodeComputeFlexBasisForChild( const YGFlexDirection mainAxis = YGResolveFlexDirection(node->getStyle().flexDirection(), direction); const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis); - const float mainAxisSize = isMainAxisRow ? width : height; - const float mainAxisownerSize = isMainAxisRow ? ownerWidth : ownerHeight; + const YGFloat mainAxisSize = isMainAxisRow ? width : height; + const YGFloat mainAxisownerSize = isMainAxisRow ? ownerWidth : ownerHeight; - float childWidth; - float childHeight; + YGFloat childWidth; + YGFloat childHeight; YGMeasureMode childWidthMeasureMode; YGMeasureMode childHeightMeasureMode; @@ -1460,9 +1460,9 @@ static void YGNodeComputeFlexBasisForChild( static void YGNodeAbsoluteLayoutChild( const YGNodeRef node, const YGNodeRef child, - const float width, + const YGFloat width, const YGMeasureMode widthMode, - const float height, + const YGFloat height, const YGDirection direction, const YGConfigRef config, LayoutData& layoutMarkerData, @@ -1474,8 +1474,8 @@ static void YGNodeAbsoluteLayoutChild( const YGFlexDirection crossAxis = YGFlexDirectionCross(mainAxis, direction); const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis); - float childWidth = YGUndefined; - float childHeight = YGUndefined; + YGFloat childWidth = YGUndefined; + YGFloat childHeight = YGUndefined; YGMeasureMode childWidthMeasureMode = YGMeasureModeUndefined; YGMeasureMode childHeightMeasureMode = YGMeasureModeUndefined; @@ -1660,12 +1660,12 @@ static void YGNodeAbsoluteLayoutChild( static void YGNodeWithMeasureFuncSetMeasuredDimensions( const YGNodeRef node, - float availableWidth, - float availableHeight, + YGFloat availableWidth, + YGFloat availableHeight, const YGMeasureMode widthMeasureMode, const YGMeasureMode heightMeasureMode, - const float ownerWidth, - const float ownerHeight, + const YGFloat ownerWidth, + const YGFloat ownerHeight, LayoutData& layoutMarkerData, void* const layoutContext, const LayoutPassReason reason) { @@ -1681,20 +1681,20 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( availableHeight = YGUndefined; } - const float paddingAndBorderAxisRow = + const YGFloat paddingAndBorderAxisRow = YGNodePaddingAndBorderForAxis(node, YGFlexDirectionRow, ownerWidth); - const float paddingAndBorderAxisColumn = + const YGFloat paddingAndBorderAxisColumn = YGNodePaddingAndBorderForAxis(node, YGFlexDirectionColumn, ownerWidth); - const float marginAxisRow = + const YGFloat marginAxisRow = node->getMarginForAxis(YGFlexDirectionRow, ownerWidth).unwrap(); - const float marginAxisColumn = + const YGFloat marginAxisColumn = node->getMarginForAxis(YGFlexDirectionColumn, ownerWidth).unwrap(); // We want to make sure we don't call measure with negative size - const float innerWidth = YGFloatIsUndefined(availableWidth) + const YGFloat innerWidth = YGFloatIsUndefined(availableWidth) ? availableWidth : YGFloatMax(0, availableWidth - marginAxisRow - paddingAndBorderAxisRow); - const float innerHeight = YGFloatIsUndefined(availableHeight) + const YGFloat innerHeight = YGFloatIsUndefined(availableHeight) ? availableHeight : YGFloatMax( 0, availableHeight - marginAxisColumn - paddingAndBorderAxisColumn); @@ -1774,19 +1774,19 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions( // or the minimum size as indicated by the padding and border sizes. static void YGNodeEmptyContainerSetMeasuredDimensions( const YGNodeRef node, - const float availableWidth, - const float availableHeight, + const YGFloat availableWidth, + const YGFloat availableHeight, const YGMeasureMode widthMeasureMode, const YGMeasureMode heightMeasureMode, - const float ownerWidth, - const float ownerHeight) { - const float paddingAndBorderAxisRow = + const YGFloat ownerWidth, + const YGFloat ownerHeight) { + const YGFloat paddingAndBorderAxisRow = YGNodePaddingAndBorderForAxis(node, YGFlexDirectionRow, ownerWidth); - const float paddingAndBorderAxisColumn = + const YGFloat paddingAndBorderAxisColumn = YGNodePaddingAndBorderForAxis(node, YGFlexDirectionColumn, ownerWidth); - const float marginAxisRow = + const YGFloat marginAxisRow = node->getMarginForAxis(YGFlexDirectionRow, ownerWidth).unwrap(); - const float marginAxisColumn = + const YGFloat marginAxisColumn = node->getMarginForAxis(YGFlexDirectionColumn, ownerWidth).unwrap(); node->setLayoutMeasuredDimension( @@ -1816,12 +1816,12 @@ static void YGNodeEmptyContainerSetMeasuredDimensions( static bool YGNodeFixedSizeSetMeasuredDimensions( const YGNodeRef node, - const float availableWidth, - const float availableHeight, + const YGFloat availableWidth, + const YGFloat availableHeight, const YGMeasureMode widthMeasureMode, const YGMeasureMode heightMeasureMode, - const float ownerWidth, - const float ownerHeight) { + const YGFloat ownerWidth, + const YGFloat ownerHeight) { if ((!YGFloatIsUndefined(availableWidth) && widthMeasureMode == YGMeasureModeAtMost && availableWidth <= 0.0f) || (!YGFloatIsUndefined(availableHeight) && @@ -1876,23 +1876,23 @@ static void YGZeroOutLayoutRecursivly( YGZeroOutLayoutRecursivly, layoutContext); } -static float YGNodeCalculateAvailableInnerDim( +static YGFloat YGNodeCalculateAvailableInnerDim( const YGNodeConstRef node, YGFlexDirection axis, - float availableDim, - float ownerDim, - float ownerDimForMarginPadding) { + YGFloat availableDim, + YGFloat ownerDim, + YGFloat ownerDimForMarginPadding) { YGFlexDirection direction = YGFlexDirectionIsRow(axis) ? YGFlexDirectionRow : YGFlexDirectionColumn; YGDimension dimension = YGFlexDirectionIsRow(axis) ? YGDimensionWidth : YGDimensionHeight; - const float margin = + const YGFloat margin = node->getMarginForAxis(direction, ownerDimForMarginPadding).unwrap(); - const float paddingAndBorder = + const YGFloat paddingAndBorder = YGNodePaddingAndBorderForAxis(node, direction, ownerDimForMarginPadding); - float availableInnerDim = availableDim - margin - paddingAndBorder; + YGFloat availableInnerDim = availableDim - margin - paddingAndBorder; // Max dimension overrides predefined dimension value; Min dimension in turn // overrides both of the above if (!YGFloatIsUndefined(availableInnerDim)) { @@ -1900,14 +1900,14 @@ static float YGNodeCalculateAvailableInnerDim( // constraints const YGFloatOptional minDimensionOptional = YGResolveValue(node->getStyle().minDimensions()[dimension], ownerDim); - const float minInnerDim = minDimensionOptional.isUndefined() + const YGFloat minInnerDim = minDimensionOptional.isUndefined() ? 0.0f : minDimensionOptional.unwrap() - paddingAndBorder; const YGFloatOptional maxDimensionOptional = YGResolveValue(node->getStyle().maxDimensions()[dimension], ownerDim); - const float maxInnerDim = maxDimensionOptional.isUndefined() + const YGFloat maxInnerDim = maxDimensionOptional.isUndefined() ? FLT_MAX : maxDimensionOptional.unwrap() - paddingAndBorder; availableInnerDim = @@ -1917,10 +1917,10 @@ static float YGNodeCalculateAvailableInnerDim( return availableInnerDim; } -static float YGNodeComputeFlexBasisForChildren( +static YGFloat YGNodeComputeFlexBasisForChildren( const YGNodeRef node, - const float availableInnerWidth, - const float availableInnerHeight, + const YGFloat availableInnerWidth, + const YGFloat availableInnerHeight, YGMeasureMode widthMeasureMode, YGMeasureMode heightMeasureMode, YGDirection direction, @@ -1931,7 +1931,7 @@ static float YGNodeComputeFlexBasisForChildren( void* const layoutContext, const uint32_t depth, const uint32_t generationCount) { - float totalOuterFlexBasis = 0.0f; + YGFloat totalOuterFlexBasis = 0.0f; YGNodeRef singleFlexChild = nullptr; const YGVector& children = node->getChildren(); YGMeasureMode measureModeMainDim = @@ -1967,10 +1967,10 @@ static float YGNodeComputeFlexBasisForChildren( if (performLayout) { // Set the initial position (relative to the owner). const YGDirection childDirection = child->resolveDirection(direction); - const float mainDim = YGFlexDirectionIsRow(mainAxis) + const YGFloat mainDim = YGFlexDirectionIsRow(mainAxis) ? availableInnerWidth : availableInnerHeight; - const float crossDim = YGFlexDirectionIsRow(mainAxis) + const YGFloat crossDim = YGFlexDirectionIsRow(mainAxis) ? availableInnerHeight : availableInnerWidth; child->setPosition( @@ -2017,15 +2017,15 @@ static float YGNodeComputeFlexBasisForChildren( static YGCollectFlexItemsRowValues YGCalculateCollectFlexItemsRowValues( const YGNodeRef& node, const YGDirection ownerDirection, - const float mainAxisownerSize, - const float availableInnerWidth, - const float availableInnerMainDim, + const YGFloat mainAxisownerSize, + const YGFloat availableInnerWidth, + const YGFloat availableInnerMainDim, const uint32_t startOfLineIndex, const uint32_t lineCount) { YGCollectFlexItemsRowValues flexAlgoRowMeasurement = {}; flexAlgoRowMeasurement.relativeChildren.reserve(node->getChildren().size()); - float sizeConsumedOnCurrentLineIncludingMinConstraint = 0; + YGFloat sizeConsumedOnCurrentLineIncludingMinConstraint = 0; const YGFlexDirection mainAxis = YGResolveFlexDirection( node->getStyle().flexDirection(), node->resolveDirection(ownerDirection)); const bool isNodeFlexWrap = node->getStyle().flexWrap() != YGWrapNoWrap; @@ -2039,9 +2039,9 @@ static YGCollectFlexItemsRowValues YGCalculateCollectFlexItemsRowValues( continue; } child->setLineIndex(lineCount); - const float childMarginMainAxis = + const YGFloat childMarginMainAxis = child->getMarginForAxis(mainAxis, availableInnerWidth).unwrap(); - const float flexBasisWithMinAndMaxConstraints = + const YGFloat flexBasisWithMinAndMaxConstraints = YGNodeBoundAxisWithinMinAndMax( child, mainAxis, @@ -2097,16 +2097,16 @@ static YGCollectFlexItemsRowValues YGCalculateCollectFlexItemsRowValues( // of the flex items abide the min and max constraints. At the end of this // function the child nodes would have proper size. Prior using this function // please ensure that YGDistributeFreeSpaceFirstPass is called. -static float YGDistributeFreeSpaceSecondPass( +static YGFloat YGDistributeFreeSpaceSecondPass( YGCollectFlexItemsRowValues& collectedFlexItemsValues, const YGNodeRef node, const YGFlexDirection mainAxis, const YGFlexDirection crossAxis, - const float mainAxisownerSize, - const float availableInnerMainDim, - const float availableInnerCrossDim, - const float availableInnerWidth, - const float availableInnerHeight, + const YGFloat mainAxisownerSize, + const YGFloat availableInnerMainDim, + const YGFloat availableInnerCrossDim, + const YGFloat availableInnerWidth, + const YGFloat availableInnerHeight, const bool flexBasisOverflows, const YGMeasureMode measureModeCrossDim, const bool performLayout, @@ -2115,10 +2115,10 @@ static float YGDistributeFreeSpaceSecondPass( void* const layoutContext, const uint32_t depth, const uint32_t generationCount) { - float childFlexBasis = 0; - float flexShrinkScaledFactor = 0; - float flexGrowFactor = 0; - float deltaFreeSpace = 0; + YGFloat childFlexBasis = 0; + YGFloat flexShrinkScaledFactor = 0; + YGFloat flexGrowFactor = 0; + YGFloat deltaFreeSpace = 0; const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis); const bool isNodeFlexWrap = node->getStyle().flexWrap() != YGWrapNoWrap; @@ -2129,7 +2129,7 @@ static float YGDistributeFreeSpaceSecondPass( currentRelativeChild->getLayout().computedFlexBasis, mainAxisownerSize) .unwrap(); - float updatedMainSize = childFlexBasis; + YGFloat updatedMainSize = childFlexBasis; if (!YGFloatIsUndefined(collectedFlexItemsValues.remainingFreeSpace) && collectedFlexItemsValues.remainingFreeSpace < 0) { @@ -2137,7 +2137,7 @@ static float YGDistributeFreeSpaceSecondPass( -currentRelativeChild->resolveFlexShrink() * childFlexBasis; // Is this child able to shrink? if (flexShrinkScaledFactor != 0) { - float childSize; + YGFloat childSize; if (!YGFloatIsUndefined( collectedFlexItemsValues.totalFlexShrinkScaledFactors) && @@ -2178,15 +2178,15 @@ static float YGDistributeFreeSpaceSecondPass( deltaFreeSpace += updatedMainSize - childFlexBasis; - const float marginMain = + const YGFloat marginMain = currentRelativeChild->getMarginForAxis(mainAxis, availableInnerWidth) .unwrap(); - const float marginCross = + const YGFloat marginCross = currentRelativeChild->getMarginForAxis(crossAxis, availableInnerWidth) .unwrap(); - float childCrossSize; - float childMainSize = updatedMainSize + marginMain; + YGFloat childCrossSize; + YGFloat childMainSize = updatedMainSize + marginMain; YGMeasureMode childCrossMeasureMode; YGMeasureMode childMainMeasureMode = YGMeasureModeExactly; @@ -2257,8 +2257,8 @@ static float YGDistributeFreeSpaceSecondPass( YGUnitAuto && currentRelativeChild->marginTrailingValue(crossAxis).unit != YGUnitAuto; - const float childWidth = isMainAxisRow ? childMainSize : childCrossSize; - const float childHeight = !isMainAxisRow ? childMainSize : childCrossSize; + const YGFloat childWidth = isMainAxisRow ? childMainSize : childCrossSize; + const YGFloat childHeight = !isMainAxisRow ? childMainSize : childCrossSize; const YGMeasureMode childWidthMeasureMode = isMainAxisRow ? childMainMeasureMode : childCrossMeasureMode; @@ -2298,17 +2298,17 @@ static float YGDistributeFreeSpaceSecondPass( static void YGDistributeFreeSpaceFirstPass( YGCollectFlexItemsRowValues& collectedFlexItemsValues, const YGFlexDirection mainAxis, - const float mainAxisownerSize, - const float availableInnerMainDim, - const float availableInnerWidth) { - float flexShrinkScaledFactor = 0; - float flexGrowFactor = 0; - float baseMainSize = 0; - float boundMainSize = 0; - float deltaFreeSpace = 0; + const YGFloat mainAxisownerSize, + const YGFloat availableInnerMainDim, + const YGFloat availableInnerWidth) { + YGFloat flexShrinkScaledFactor = 0; + YGFloat flexGrowFactor = 0; + YGFloat baseMainSize = 0; + YGFloat boundMainSize = 0; + YGFloat deltaFreeSpace = 0; for (auto currentRelativeChild : collectedFlexItemsValues.relativeChildren) { - float childFlexBasis = + YGFloat childFlexBasis = YGNodeBoundAxisWithinMinAndMax( currentRelativeChild, mainAxis, @@ -2406,11 +2406,11 @@ static void YGResolveFlexibleLength( YGCollectFlexItemsRowValues& collectedFlexItemsValues, const YGFlexDirection mainAxis, const YGFlexDirection crossAxis, - const float mainAxisownerSize, - const float availableInnerMainDim, - const float availableInnerCrossDim, - const float availableInnerWidth, - const float availableInnerHeight, + const YGFloat mainAxisownerSize, + const YGFloat availableInnerMainDim, + const YGFloat availableInnerCrossDim, + const YGFloat availableInnerWidth, + const YGFloat availableInnerHeight, const bool flexBasisOverflows, const YGMeasureMode measureModeCrossDim, const bool performLayout, @@ -2419,7 +2419,7 @@ static void YGResolveFlexibleLength( void* const layoutContext, const uint32_t depth, const uint32_t generationCount) { - const float originalFreeSpace = collectedFlexItemsValues.remainingFreeSpace; + const YGFloat originalFreeSpace = collectedFlexItemsValues.remainingFreeSpace; // First pass: detect the flex items whose min/max constraints trigger YGDistributeFreeSpaceFirstPass( collectedFlexItemsValues, @@ -2429,7 +2429,7 @@ static void YGResolveFlexibleLength( availableInnerWidth); // Second pass: resolve the sizes of the flexible items - const float distributedFreeSpace = YGDistributeFreeSpaceSecondPass( + const YGFloat distributedFreeSpace = YGDistributeFreeSpaceSecondPass( collectedFlexItemsValues, node, mainAxis, @@ -2460,17 +2460,17 @@ static void YGJustifyMainAxis( const YGFlexDirection crossAxis, const YGMeasureMode measureModeMainDim, const YGMeasureMode measureModeCrossDim, - const float mainAxisownerSize, - const float ownerWidth, - const float availableInnerMainDim, - const float availableInnerCrossDim, - const float availableInnerWidth, + const YGFloat mainAxisownerSize, + const YGFloat ownerWidth, + const YGFloat availableInnerMainDim, + const YGFloat availableInnerCrossDim, + const YGFloat availableInnerWidth, const bool performLayout, void* const layoutContext) { const auto& style = node->getStyle(); - const float leadingPaddingAndBorderMain = + const YGFloat leadingPaddingAndBorderMain = node->getLeadingPaddingAndBorder(mainAxis, ownerWidth).unwrap(); - const float trailingPaddingAndBorderMain = + const YGFloat trailingPaddingAndBorderMain = node->getTrailingPaddingAndBorder(mainAxis, ownerWidth).unwrap(); // If we are using "at most" rules in the main axis, make sure that // remainingFreeSpace is 0 when min main dimension is not given @@ -2486,12 +2486,12 @@ static void YGJustifyMainAxis( // `minAvailableMainDim` denotes minimum available space in which child // can be laid out, it will exclude space consumed by padding and border. - const float minAvailableMainDim = + const YGFloat minAvailableMainDim = YGResolveValue( style.minDimensions()[dim[mainAxis]], mainAxisownerSize) .unwrap() - leadingPaddingAndBorderMain - trailingPaddingAndBorderMain; - const float occupiedSpaceByChildNodes = + const YGFloat occupiedSpaceByChildNodes = availableInnerMainDim - collectedFlexItemsValues.remainingFreeSpace; collectedFlexItemsValues.remainingFreeSpace = YGFloatMax(0, minAvailableMainDim - occupiedSpaceByChildNodes); @@ -2518,8 +2518,8 @@ static void YGJustifyMainAxis( // In order to position the elements in the main axis, we have two controls. // The space between the beginning and the first element and the space between // each two elements. - float leadingMainDim = 0; - float betweenMainDim = 0; + YGFloat leadingMainDim = 0; + YGFloat betweenMainDim = 0; const YGJustify justifyContent = node->getStyle().justifyContent(); if (numberOfAutoMarginsOnCurrentLine == 0) { @@ -2560,8 +2560,8 @@ static void YGJustifyMainAxis( leadingPaddingAndBorderMain + leadingMainDim; collectedFlexItemsValues.crossDim = 0; - float maxAscentForCurrentLine = 0; - float maxDescentForCurrentLine = 0; + YGFloat maxAscentForCurrentLine = 0; + YGFloat maxDescentForCurrentLine = 0; bool isNodeBaselineLayout = YGIsBaselineLayout(node); for (uint32_t i = startOfLineIndex; i < collectedFlexItemsValues.endOfLineIndex; @@ -2627,12 +2627,12 @@ static void YGJustifyMainAxis( if (isNodeBaselineLayout) { // If the child is baseline aligned then the cross dimension is // calculated by adding maxAscent and maxDescent from the baseline. - const float ascent = YGBaseline(child, layoutContext) + + const YGFloat ascent = YGBaseline(child, layoutContext) + child ->getLeadingMargin( YGFlexDirectionColumn, availableInnerWidth) .unwrap(); - const float descent = + const YGFloat descent = child->getLayout().measuredDimensions[YGDimensionHeight] + child ->getMarginForAxis( @@ -2736,13 +2736,13 @@ static void YGJustifyMainAxis( // static void YGNodelayoutImpl( const YGNodeRef node, - const float availableWidth, - const float availableHeight, + const YGFloat availableWidth, + const YGFloat availableHeight, const YGDirection ownerDirection, const YGMeasureMode widthMeasureMode, const YGMeasureMode heightMeasureMode, - const float ownerWidth, - const float ownerHeight, + const YGFloat ownerWidth, + const YGFloat ownerHeight, const bool performLayout, const YGConfigRef config, LayoutData& layoutMarkerData, @@ -2863,14 +2863,14 @@ static void YGNodelayoutImpl( const bool isMainAxisRow = YGFlexDirectionIsRow(mainAxis); const bool isNodeFlexWrap = node->getStyle().flexWrap() != YGWrapNoWrap; - const float mainAxisownerSize = isMainAxisRow ? ownerWidth : ownerHeight; - const float crossAxisownerSize = isMainAxisRow ? ownerHeight : ownerWidth; + const YGFloat mainAxisownerSize = isMainAxisRow ? ownerWidth : ownerHeight; + const YGFloat crossAxisownerSize = isMainAxisRow ? ownerHeight : ownerWidth; - const float leadingPaddingAndBorderCross = + const YGFloat leadingPaddingAndBorderCross = node->getLeadingPaddingAndBorder(crossAxis, ownerWidth).unwrap(); - const float paddingAndBorderAxisMain = + const YGFloat paddingAndBorderAxisMain = YGNodePaddingAndBorderForAxis(node, mainAxis, ownerWidth); - const float paddingAndBorderAxisCross = + const YGFloat paddingAndBorderAxisCross = YGNodePaddingAndBorderForAxis(node, crossAxis, ownerWidth); YGMeasureMode measureModeMainDim = @@ -2878,49 +2878,49 @@ static void YGNodelayoutImpl( YGMeasureMode measureModeCrossDim = isMainAxisRow ? heightMeasureMode : widthMeasureMode; - const float paddingAndBorderAxisRow = + const YGFloat paddingAndBorderAxisRow = isMainAxisRow ? paddingAndBorderAxisMain : paddingAndBorderAxisCross; - const float paddingAndBorderAxisColumn = + const YGFloat paddingAndBorderAxisColumn = isMainAxisRow ? paddingAndBorderAxisCross : paddingAndBorderAxisMain; - const float marginAxisRow = + const YGFloat marginAxisRow = node->getMarginForAxis(YGFlexDirectionRow, ownerWidth).unwrap(); - const float marginAxisColumn = + const YGFloat marginAxisColumn = node->getMarginForAxis(YGFlexDirectionColumn, ownerWidth).unwrap(); const auto& minDimensions = node->getStyle().minDimensions(); const auto& maxDimensions = node->getStyle().maxDimensions(); - const float minInnerWidth = + const YGFloat minInnerWidth = YGResolveValue(minDimensions[YGDimensionWidth], ownerWidth).unwrap() - paddingAndBorderAxisRow; - const float maxInnerWidth = + const YGFloat maxInnerWidth = YGResolveValue(maxDimensions[YGDimensionWidth], ownerWidth).unwrap() - paddingAndBorderAxisRow; - const float minInnerHeight = + const YGFloat minInnerHeight = YGResolveValue(minDimensions[YGDimensionHeight], ownerHeight).unwrap() - paddingAndBorderAxisColumn; - const float maxInnerHeight = + const YGFloat maxInnerHeight = YGResolveValue(maxDimensions[YGDimensionHeight], ownerHeight).unwrap() - paddingAndBorderAxisColumn; - const float minInnerMainDim = isMainAxisRow ? minInnerWidth : minInnerHeight; - const float maxInnerMainDim = isMainAxisRow ? maxInnerWidth : maxInnerHeight; + const YGFloat minInnerMainDim = isMainAxisRow ? minInnerWidth : minInnerHeight; + const YGFloat maxInnerMainDim = isMainAxisRow ? maxInnerWidth : maxInnerHeight; // STEP 2: DETERMINE AVAILABLE SIZE IN MAIN AND CROSS DIRECTIONS - float availableInnerWidth = YGNodeCalculateAvailableInnerDim( + YGFloat availableInnerWidth = YGNodeCalculateAvailableInnerDim( node, YGFlexDirectionRow, availableWidth, ownerWidth, ownerWidth); - float availableInnerHeight = YGNodeCalculateAvailableInnerDim( + YGFloat availableInnerHeight = YGNodeCalculateAvailableInnerDim( node, YGFlexDirectionColumn, availableHeight, ownerHeight, ownerWidth); - float availableInnerMainDim = + YGFloat availableInnerMainDim = isMainAxisRow ? availableInnerWidth : availableInnerHeight; - const float availableInnerCrossDim = + const YGFloat availableInnerCrossDim = isMainAxisRow ? availableInnerHeight : availableInnerWidth; // STEP 3: DETERMINE FLEX BASIS FOR EACH ITEM - float totalOuterFlexBasis = YGNodeComputeFlexBasisForChildren( + YGFloat totalOuterFlexBasis = YGNodeComputeFlexBasisForChildren( node, availableInnerWidth, availableInnerHeight, @@ -2952,10 +2952,10 @@ static void YGNodelayoutImpl( uint32_t lineCount = 0; // Accumulated cross dimensions of all lines so far. - float totalLineCrossDim = 0; + YGFloat totalLineCrossDim = 0; // Max main dimension of all the lines. - float maxLineMainDim = 0; + YGFloat maxLineMainDim = 0; YGCollectFlexItemsRowValues collectedFlexItemsValues; for (; endOfLineIndex < childCount; lineCount++, startOfLineIndex = endOfLineIndex) { @@ -3073,7 +3073,7 @@ static void YGNodelayoutImpl( performLayout, layoutContext); - float containerCrossAxis = availableInnerCrossDim; + YGFloat containerCrossAxis = availableInnerCrossDim; if (measureModeCrossDim == YGMeasureModeUndefined || measureModeCrossDim == YGMeasureModeAtMost) { // Compute the cross axis from the max cross dimension of the children. @@ -3136,7 +3136,7 @@ static void YGNodelayoutImpl( pos[crossAxis]); } } else { - float leadingCrossDim = leadingPaddingAndBorderCross; + YGFloat leadingCrossDim = leadingPaddingAndBorderCross; // For a relative children, we're either using alignItems (owner) or // alignSelf (child) in order to determine the position in the cross @@ -3153,10 +3153,10 @@ static void YGNodelayoutImpl( // no need to stretch. if (!YGNodeIsStyleDimDefined( child, crossAxis, availableInnerCrossDim)) { - float childMainSize = + YGFloat childMainSize = child->getLayout().measuredDimensions[dim[mainAxis]]; const auto& childStyle = child->getStyle(); - float childCrossSize = !childStyle.aspectRatio().isUndefined() + YGFloat childCrossSize = !childStyle.aspectRatio().isUndefined() ? child->getMarginForAxis(crossAxis, availableInnerWidth) .unwrap() + (isMainAxisRow @@ -3185,9 +3185,9 @@ static void YGNodelayoutImpl( &childCrossMeasureMode, &childCrossSize); - const float childWidth = + const YGFloat childWidth = isMainAxisRow ? childMainSize : childCrossSize; - const float childHeight = + const YGFloat childHeight = !isMainAxisRow ? childMainSize : childCrossSize; auto alignContent = node->getStyle().alignContent(); @@ -3222,7 +3222,7 @@ static void YGNodelayoutImpl( generationCount); } } else { - const float remainingCrossDim = containerCrossAxis - + const YGFloat remainingCrossDim = containerCrossAxis - YGNodeDimWithMargin(child, crossAxis, availableInnerWidth); if (child->marginLeadingValue(crossAxis).unit == YGUnitAuto && @@ -3259,10 +3259,10 @@ static void YGNodelayoutImpl( // STEP 8: MULTI-LINE CONTENT ALIGNMENT // currentLead stores the size of the cross dim if (performLayout && (isNodeFlexWrap || YGIsBaselineLayout(node))) { - float crossDimLead = 0; - float currentLead = leadingPaddingAndBorderCross; + YGFloat crossDimLead = 0; + YGFloat currentLead = leadingPaddingAndBorderCross; if (!YGFloatIsUndefined(availableInnerCrossDim)) { - const float remainingAlignContentDim = + const YGFloat remainingAlignContentDim = availableInnerCrossDim - totalLineCrossDim; switch (node->getStyle().alignContent()) { case YGAlignFlexEnd: @@ -3303,9 +3303,9 @@ static void YGNodelayoutImpl( uint32_t ii; // compute the line's height and find the endIndex - float lineHeight = 0; - float maxAscentForCurrentLine = 0; - float maxDescentForCurrentLine = 0; + YGFloat lineHeight = 0; + YGFloat maxAscentForCurrentLine = 0; + YGFloat maxDescentForCurrentLine = 0; for (ii = startIndex; ii < childCount; ii++) { const YGNodeRef child = node->getChild(ii); if (child->getStyle().display() == YGDisplayNone) { @@ -3323,12 +3323,12 @@ static void YGNodelayoutImpl( .unwrap()); } if (YGNodeAlignItem(node, child) == YGAlignBaseline) { - const float ascent = YGBaseline(child, layoutContext) + + const YGFloat ascent = YGBaseline(child, layoutContext) + child ->getLeadingMargin( YGFlexDirectionColumn, availableInnerWidth) .unwrap(); - const float descent = + const YGFloat descent = child->getLayout().measuredDimensions[YGDimensionHeight] + child ->getMarginForAxis( @@ -3373,7 +3373,7 @@ static void YGNodelayoutImpl( break; } case YGAlignCenter: { - float childHeight = + YGFloat childHeight = child->getLayout().measuredDimensions[dim[crossAxis]]; child->setLayoutPosition( @@ -3392,14 +3392,14 @@ static void YGNodelayoutImpl( // measured with the owners height yet. if (!YGNodeIsStyleDimDefined( child, crossAxis, availableInnerCrossDim)) { - const float childWidth = isMainAxisRow + const YGFloat childWidth = isMainAxisRow ? (child->getLayout() .measuredDimensions[YGDimensionWidth] + child->getMarginForAxis(mainAxis, availableInnerWidth) .unwrap()) : lineHeight; - const float childHeight = !isMainAxisRow + const YGFloat childHeight = !isMainAxisRow ? (child->getLayout() .measuredDimensions[YGDimensionHeight] + child->getMarginForAxis(crossAxis, availableInnerWidth) @@ -3631,17 +3631,17 @@ static const char* YGMeasureModeName( static inline bool YGMeasureModeSizeIsExactAndMatchesOldMeasuredSize( YGMeasureMode sizeMode, - float size, - float lastComputedSize) { + YGFloat size, + YGFloat lastComputedSize) { return sizeMode == YGMeasureModeExactly && YGFloatsEqual(size, lastComputedSize); } static inline bool YGMeasureModeOldSizeIsUnspecifiedAndStillFits( YGMeasureMode sizeMode, - float size, + YGFloat size, YGMeasureMode lastSizeMode, - float lastComputedSize) { + YGFloat lastComputedSize) { return sizeMode == YGMeasureModeAtMost && lastSizeMode == YGMeasureModeUndefined && (size >= lastComputedSize || YGFloatsEqual(size, lastComputedSize)); @@ -3649,10 +3649,10 @@ static inline bool YGMeasureModeOldSizeIsUnspecifiedAndStillFits( static inline bool YGMeasureModeNewMeasureSizeIsStricterAndStillValid( YGMeasureMode sizeMode, - float size, + YGFloat size, YGMeasureMode lastSizeMode, - float lastSize, - float lastComputedSize) { + YGFloat lastSize, + YGFloat lastComputedSize) { return lastSizeMode == YGMeasureModeAtMost && sizeMode == YGMeasureModeAtMost && !YGFloatIsUndefined(lastSize) && !YGFloatIsUndefined(size) && !YGFloatIsUndefined(lastComputedSize) && @@ -3660,7 +3660,7 @@ static inline bool YGMeasureModeNewMeasureSizeIsStricterAndStillValid( (lastComputedSize <= size || YGFloatsEqual(size, lastComputedSize)); } -YOGA_EXPORT float YGRoundValueToPixelGrid( +YOGA_EXPORT YGFloat YGRoundValueToPixelGrid( const double value, const double pointScaleFactor, const bool forceCeil, @@ -3681,8 +3681,8 @@ YOGA_EXPORT float YGRoundValueToPixelGrid( // negative number. For example, `fmodf(-2.2) = -0.2`. However, we want // `fractial` to be the number such that subtracting it from `value` will // give us `floor(value)`. In the case of negative numbers, adding 1 to - // `fmodf(value)` gives us this. Let's continue the example from above: - // - fractial = fmodf(-2.2) = -0.2 + // `fmod(value)` gives us this. Let's continue the example from above: + // - fractial = fmod(-2.2) = -0.2 // - Add 1 to the fraction: fractial2 = fractial + 1 = -0.2 + 1 = 0.8 // - Finding the `floor`: -2.2 - fractial2 = -2.2 - 0.8 = -3 ++fractial; @@ -3713,17 +3713,17 @@ YOGA_EXPORT float YGRoundValueToPixelGrid( YOGA_EXPORT bool YGNodeCanUseCachedMeasurement( const YGMeasureMode widthMode, - const float width, + const YGFloat width, const YGMeasureMode heightMode, - const float height, + const YGFloat height, const YGMeasureMode lastWidthMode, - const float lastWidth, + const YGFloat lastWidth, const YGMeasureMode lastHeightMode, - const float lastHeight, - const float lastComputedWidth, - const float lastComputedHeight, - const float marginRow, - const float marginColumn, + const YGFloat lastHeight, + const YGFloat lastComputedWidth, + const YGFloat lastComputedHeight, + const YGFloat marginRow, + const YGFloat marginColumn, const YGConfigRef config) { if ((!YGFloatIsUndefined(lastComputedHeight) && lastComputedHeight < 0) || (!YGFloatIsUndefined(lastComputedWidth) && lastComputedWidth < 0)) { @@ -3731,17 +3731,17 @@ YOGA_EXPORT bool YGNodeCanUseCachedMeasurement( } bool useRoundedComparison = config != nullptr && config->pointScaleFactor != 0; - const float effectiveWidth = useRoundedComparison + const YGFloat effectiveWidth = useRoundedComparison ? YGRoundValueToPixelGrid(width, config->pointScaleFactor, false, false) : width; - const float effectiveHeight = useRoundedComparison + const YGFloat effectiveHeight = useRoundedComparison ? YGRoundValueToPixelGrid(height, config->pointScaleFactor, false, false) : height; - const float effectiveLastWidth = useRoundedComparison + const YGFloat effectiveLastWidth = useRoundedComparison ? YGRoundValueToPixelGrid( lastWidth, config->pointScaleFactor, false, false) : lastWidth; - const float effectiveLastHeight = useRoundedComparison + const YGFloat effectiveLastHeight = useRoundedComparison ? YGRoundValueToPixelGrid( lastHeight, config->pointScaleFactor, false, false) : lastHeight; @@ -3793,13 +3793,13 @@ YOGA_EXPORT bool YGNodeCanUseCachedMeasurement( // bool YGLayoutNodeInternal( const YGNodeRef node, - const float availableWidth, - const float availableHeight, + const YGFloat availableWidth, + const YGFloat availableHeight, const YGDirection ownerDirection, const YGMeasureMode widthMeasureMode, const YGMeasureMode heightMeasureMode, - const float ownerWidth, - const float ownerHeight, + const YGFloat ownerWidth, + const YGFloat ownerHeight, const bool performLayout, const LayoutPassReason reason, const YGConfigRef config, @@ -3837,9 +3837,9 @@ bool YGLayoutNodeInternal( // they are the most expensive to measure, so it's worth avoiding redundant // measurements if at all possible. if (node->hasMeasureFunc()) { - const float marginAxisRow = + const YGFloat marginAxisRow = node->getMarginForAxis(YGFlexDirectionRow, ownerWidth).unwrap(); - const float marginAxisColumn = + const YGFloat marginAxisColumn = node->getMarginForAxis(YGFlexDirectionColumn, ownerWidth).unwrap(); // First, try to use the layout cache. @@ -4061,7 +4061,7 @@ bool YGLayoutNodeInternal( YOGA_EXPORT void YGConfigSetPointScaleFactor( const YGConfigRef config, - const float pixelsInPoint) { + const YGFloat pixelsInPoint) { YGAssertWithConfig( config, pixelsInPoint >= 0.0f, @@ -4158,8 +4158,8 @@ static void unsetUseLegacyFlagRecursively(YGNodeRef node) { YOGA_EXPORT void YGNodeCalculateLayoutWithContext( const YGNodeRef node, - const float ownerWidth, - const float ownerHeight, + const YGFloat ownerWidth, + const YGFloat ownerHeight, const YGDirection ownerDirection, void* layoutContext) { @@ -4171,7 +4171,7 @@ YOGA_EXPORT void YGNodeCalculateLayoutWithContext( // the input parameters don't change. gCurrentGenerationCount.fetch_add(1, std::memory_order_relaxed); node->resolveDimension(); - float width = YGUndefined; + YGFloat width = YGUndefined; YGMeasureMode widthMeasureMode = YGMeasureModeUndefined; const auto& maxDimensions = node->getStyle().maxDimensions(); if (YGNodeIsStyleDimDefined(node, YGFlexDirectionRow, ownerWidth)) { @@ -4192,7 +4192,7 @@ YOGA_EXPORT void YGNodeCalculateLayoutWithContext( : YGMeasureModeExactly; } - float height = YGUndefined; + YGFloat height = YGUndefined; YGMeasureMode heightMeasureMode = YGMeasureModeUndefined; if (YGNodeIsStyleDimDefined(node, YGFlexDirectionColumn, ownerHeight)) { height = (YGResolveValue( @@ -4310,8 +4310,8 @@ YOGA_EXPORT void YGNodeCalculateLayoutWithContext( YOGA_EXPORT void YGNodeCalculateLayout( const YGNodeRef node, - const float ownerWidth, - const float ownerHeight, + const YGFloat ownerWidth, + const YGFloat ownerHeight, const YGDirection ownerDirection) { YGNodeCalculateLayoutWithContext( node, ownerWidth, ownerHeight, ownerDirection, nullptr); diff --git a/yoga/Yoga.h b/yoga/Yoga.h index 87901a28..c4d5cf8f 100644 --- a/yoga/Yoga.h +++ b/yoga/Yoga.h @@ -25,8 +25,8 @@ YG_EXTERN_C_BEGIN typedef struct YGSize { - float width; - float height; + YGFloat width; + YGFloat height; } YGSize; typedef struct YGConfig* YGConfigRef; @@ -36,11 +36,11 @@ typedef const struct YGNode* YGNodeConstRef; typedef YGSize (*YGMeasureFunc)( YGNodeRef node, - float width, + YGFloat width, YGMeasureMode widthMode, - float height, + YGFloat height, YGMeasureMode heightMode); -typedef float (*YGBaselineFunc)(YGNodeRef node, float width, float height); +typedef YGFloat (*YGBaselineFunc)(YGNodeRef node, YGFloat width, YGFloat height); typedef void (*YGDirtiedFunc)(YGNodeRef node); typedef void (*YGPrintFunc)(YGNodeRef node); typedef void (*YGNodeCleanupFunc)(YGNodeRef node); @@ -93,8 +93,8 @@ WIN_EXPORT bool YGNodeIsReferenceBaseline(YGNodeRef node); WIN_EXPORT void YGNodeCalculateLayout( YGNodeRef node, - float availableWidth, - float availableHeight, + YGFloat availableWidth, + YGFloat availableHeight, YGDirection ownerDirection); // Mark a node as dirty. Only valid for nodes with a custom measure function @@ -113,21 +113,21 @@ WIN_EXPORT void YGNodeMarkDirtyAndPropogateToDescendants(YGNodeRef node); WIN_EXPORT void YGNodePrint(YGNodeRef node, YGPrintOptions options); -WIN_EXPORT bool YGFloatIsUndefined(float value); +WIN_EXPORT bool YGFloatIsUndefined(YGFloat value); WIN_EXPORT bool YGNodeCanUseCachedMeasurement( YGMeasureMode widthMode, - float width, + YGFloat width, YGMeasureMode heightMode, - float height, + YGFloat height, YGMeasureMode lastWidthMode, - float lastWidth, + YGFloat lastWidth, YGMeasureMode lastHeightMode, - float lastHeight, - float lastComputedWidth, - float lastComputedHeight, - float marginRow, - float marginColumn, + YGFloat lastHeight, + YGFloat lastComputedWidth, + YGFloat lastComputedHeight, + YGFloat marginRow, + YGFloat marginColumn, YGConfigRef config); WIN_EXPORT void YGNodeCopyStyle(YGNodeRef dstNode, YGNodeRef srcNode); @@ -187,75 +187,75 @@ WIN_EXPORT YGOverflow YGNodeStyleGetOverflow(YGNodeConstRef node); WIN_EXPORT void YGNodeStyleSetDisplay(YGNodeRef node, YGDisplay display); WIN_EXPORT YGDisplay YGNodeStyleGetDisplay(YGNodeConstRef node); -WIN_EXPORT void YGNodeStyleSetFlex(YGNodeRef node, float flex); -WIN_EXPORT float YGNodeStyleGetFlex(YGNodeConstRef node); +WIN_EXPORT void YGNodeStyleSetFlex(YGNodeRef node, YGFloat flex); +WIN_EXPORT YGFloat YGNodeStyleGetFlex(YGNodeConstRef node); -WIN_EXPORT void YGNodeStyleSetFlexGrow(YGNodeRef node, float flexGrow); -WIN_EXPORT float YGNodeStyleGetFlexGrow(YGNodeConstRef node); +WIN_EXPORT void YGNodeStyleSetFlexGrow(YGNodeRef node, YGFloat flexGrow); +WIN_EXPORT YGFloat YGNodeStyleGetFlexGrow(YGNodeConstRef node); -WIN_EXPORT void YGNodeStyleSetFlexShrink(YGNodeRef node, float flexShrink); -WIN_EXPORT float YGNodeStyleGetFlexShrink(YGNodeConstRef node); +WIN_EXPORT void YGNodeStyleSetFlexShrink(YGNodeRef node, YGFloat flexShrink); +WIN_EXPORT YGFloat YGNodeStyleGetFlexShrink(YGNodeConstRef node); -WIN_EXPORT void YGNodeStyleSetFlexBasis(YGNodeRef node, float flexBasis); -WIN_EXPORT void YGNodeStyleSetFlexBasisPercent(YGNodeRef node, float flexBasis); +WIN_EXPORT void YGNodeStyleSetFlexBasis(YGNodeRef node, YGFloat flexBasis); +WIN_EXPORT void YGNodeStyleSetFlexBasisPercent(YGNodeRef node, YGFloat flexBasis); WIN_EXPORT void YGNodeStyleSetFlexBasisAuto(YGNodeRef node); WIN_EXPORT YGValue YGNodeStyleGetFlexBasis(YGNodeConstRef node); WIN_EXPORT void YGNodeStyleSetPosition( YGNodeRef node, YGEdge edge, - float position); + YGFloat position); WIN_EXPORT void YGNodeStyleSetPositionPercent( YGNodeRef node, YGEdge edge, - float position); + YGFloat position); 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, YGFloat margin); WIN_EXPORT void YGNodeStyleSetMarginPercent( YGNodeRef node, YGEdge edge, - float margin); + YGFloat margin); WIN_EXPORT void YGNodeStyleSetMarginAuto(YGNodeRef node, YGEdge edge); WIN_EXPORT YGValue YGNodeStyleGetMargin(YGNodeConstRef node, YGEdge edge); WIN_EXPORT void YGNodeStyleSetPadding( YGNodeRef node, YGEdge edge, - float padding); + YGFloat padding); WIN_EXPORT void YGNodeStyleSetPaddingPercent( YGNodeRef node, YGEdge edge, - float padding); + YGFloat padding); WIN_EXPORT YGValue YGNodeStyleGetPadding(YGNodeConstRef node, YGEdge edge); -WIN_EXPORT void YGNodeStyleSetBorder(YGNodeRef node, YGEdge edge, float border); -WIN_EXPORT float YGNodeStyleGetBorder(YGNodeConstRef node, YGEdge edge); +WIN_EXPORT void YGNodeStyleSetBorder(YGNodeRef node, YGEdge edge, YGFloat border); +WIN_EXPORT YGFloat YGNodeStyleGetBorder(YGNodeConstRef node, YGEdge edge); -WIN_EXPORT void YGNodeStyleSetWidth(YGNodeRef node, float width); -WIN_EXPORT void YGNodeStyleSetWidthPercent(YGNodeRef node, float width); +WIN_EXPORT void YGNodeStyleSetWidth(YGNodeRef node, YGFloat width); +WIN_EXPORT void YGNodeStyleSetWidthPercent(YGNodeRef node, YGFloat width); WIN_EXPORT void YGNodeStyleSetWidthAuto(YGNodeRef node); WIN_EXPORT YGValue YGNodeStyleGetWidth(YGNodeConstRef node); -WIN_EXPORT void YGNodeStyleSetHeight(YGNodeRef node, float height); -WIN_EXPORT void YGNodeStyleSetHeightPercent(YGNodeRef node, float height); +WIN_EXPORT void YGNodeStyleSetHeight(YGNodeRef node, YGFloat height); +WIN_EXPORT void YGNodeStyleSetHeightPercent(YGNodeRef node, YGFloat height); WIN_EXPORT void YGNodeStyleSetHeightAuto(YGNodeRef node); WIN_EXPORT YGValue YGNodeStyleGetHeight(YGNodeConstRef node); -WIN_EXPORT void YGNodeStyleSetMinWidth(YGNodeRef node, float minWidth); -WIN_EXPORT void YGNodeStyleSetMinWidthPercent(YGNodeRef node, float minWidth); +WIN_EXPORT void YGNodeStyleSetMinWidth(YGNodeRef node, YGFloat minWidth); +WIN_EXPORT void YGNodeStyleSetMinWidthPercent(YGNodeRef node, YGFloat minWidth); WIN_EXPORT YGValue YGNodeStyleGetMinWidth(YGNodeConstRef node); -WIN_EXPORT void YGNodeStyleSetMinHeight(YGNodeRef node, float minHeight); -WIN_EXPORT void YGNodeStyleSetMinHeightPercent(YGNodeRef node, float minHeight); +WIN_EXPORT void YGNodeStyleSetMinHeight(YGNodeRef node, YGFloat minHeight); +WIN_EXPORT void YGNodeStyleSetMinHeightPercent(YGNodeRef node, YGFloat minHeight); WIN_EXPORT YGValue YGNodeStyleGetMinHeight(YGNodeConstRef node); -WIN_EXPORT void YGNodeStyleSetMaxWidth(YGNodeRef node, float maxWidth); -WIN_EXPORT void YGNodeStyleSetMaxWidthPercent(YGNodeRef node, float maxWidth); +WIN_EXPORT void YGNodeStyleSetMaxWidth(YGNodeRef node, YGFloat maxWidth); +WIN_EXPORT void YGNodeStyleSetMaxWidthPercent(YGNodeRef node, YGFloat maxWidth); WIN_EXPORT YGValue YGNodeStyleGetMaxWidth(YGNodeConstRef node); -WIN_EXPORT void YGNodeStyleSetMaxHeight(YGNodeRef node, float maxHeight); -WIN_EXPORT void YGNodeStyleSetMaxHeightPercent(YGNodeRef node, float maxHeight); +WIN_EXPORT void YGNodeStyleSetMaxHeight(YGNodeRef node, YGFloat maxHeight); +WIN_EXPORT void YGNodeStyleSetMaxHeightPercent(YGNodeRef node, YGFloat maxHeight); WIN_EXPORT YGValue YGNodeStyleGetMaxHeight(YGNodeConstRef node); // Yoga specific properties, not compatible with flexbox specification Aspect @@ -273,15 +273,15 @@ WIN_EXPORT YGValue YGNodeStyleGetMaxHeight(YGNodeConstRef node); // - On a node with flex grow/shrink aspect ratio controls the size of the node // in the cross axis if unset // - Aspect ratio takes min/max dimensions into account -WIN_EXPORT void YGNodeStyleSetAspectRatio(YGNodeRef node, float aspectRatio); -WIN_EXPORT float YGNodeStyleGetAspectRatio(YGNodeConstRef node); +WIN_EXPORT void YGNodeStyleSetAspectRatio(YGNodeRef node, YGFloat aspectRatio); +WIN_EXPORT YGFloat YGNodeStyleGetAspectRatio(YGNodeConstRef node); -WIN_EXPORT float YGNodeLayoutGetLeft(YGNodeRef node); -WIN_EXPORT float YGNodeLayoutGetTop(YGNodeRef node); -WIN_EXPORT float YGNodeLayoutGetRight(YGNodeRef node); -WIN_EXPORT float YGNodeLayoutGetBottom(YGNodeRef node); -WIN_EXPORT float YGNodeLayoutGetWidth(YGNodeRef node); -WIN_EXPORT float YGNodeLayoutGetHeight(YGNodeRef node); +WIN_EXPORT YGFloat YGNodeLayoutGetLeft(YGNodeRef node); +WIN_EXPORT YGFloat YGNodeLayoutGetTop(YGNodeRef node); +WIN_EXPORT YGFloat YGNodeLayoutGetRight(YGNodeRef node); +WIN_EXPORT YGFloat YGNodeLayoutGetBottom(YGNodeRef node); +WIN_EXPORT YGFloat YGNodeLayoutGetWidth(YGNodeRef node); +WIN_EXPORT YGFloat YGNodeLayoutGetHeight(YGNodeRef node); WIN_EXPORT YGDirection YGNodeLayoutGetDirection(YGNodeRef node); WIN_EXPORT bool YGNodeLayoutGetHadOverflow(YGNodeRef node); bool YGNodeLayoutGetDidLegacyStretchFlagAffectLayout(YGNodeRef node); @@ -290,9 +290,9 @@ bool YGNodeLayoutGetDidLegacyStretchFlagAffectLayout(YGNodeRef node); // set using point values then the returned value will be the same as // YGNodeStyleGetXXX. However if they were set using a percentage value then the // returned value is the computed value used during layout. -WIN_EXPORT float YGNodeLayoutGetMargin(YGNodeRef node, YGEdge edge); -WIN_EXPORT float YGNodeLayoutGetBorder(YGNodeRef node, YGEdge edge); -WIN_EXPORT float YGNodeLayoutGetPadding(YGNodeRef node, YGEdge edge); +WIN_EXPORT YGFloat YGNodeLayoutGetMargin(YGNodeRef node, YGEdge edge); +WIN_EXPORT YGFloat YGNodeLayoutGetBorder(YGNodeRef node, YGEdge edge); +WIN_EXPORT YGFloat YGNodeLayoutGetPadding(YGNodeRef node, YGEdge edge); WIN_EXPORT void YGConfigSetLogger(YGConfigRef config, YGLogger logger); WIN_EXPORT void YGAssert(bool condition, const char* message); @@ -308,7 +308,7 @@ WIN_EXPORT void YGAssertWithConfig( // want to avoid rounding - set PointScaleFactor to 0 WIN_EXPORT void YGConfigSetPointScaleFactor( YGConfigRef config, - float pixelsInPoint); + YGFloat pixelsInPoint); void YGConfigSetShouldDiffLayoutWithoutLegacyStretchBehaviour( YGConfigRef config, bool shouldDiffLayout); @@ -351,7 +351,7 @@ WIN_EXPORT YGConfigRef YGConfigGetDefault(void); WIN_EXPORT void YGConfigSetContext(YGConfigRef config, void* context); WIN_EXPORT void* YGConfigGetContext(YGConfigRef config); -WIN_EXPORT float YGRoundValueToPixelGrid( +WIN_EXPORT YGFloat YGRoundValueToPixelGrid( double value, double pointScaleFactor, bool forceCeil, @@ -360,6 +360,7 @@ WIN_EXPORT float YGRoundValueToPixelGrid( YG_EXTERN_C_END #ifdef __cplusplus +YG_EXTERN_CXX_BEGIN #include #include @@ -371,4 +372,5 @@ void YGTraversePreOrder( void YGNodeSetChildren(YGNodeRef owner, const std::vector& children); +YG_EXTERN_C_END #endif diff --git a/yoga/event/event.h b/yoga/event/event.h index 404ec376..c7ce6219 100644 --- a/yoga/event/event.h +++ b/yoga/event/event.h @@ -127,12 +127,12 @@ struct Event::TypedData { template <> struct Event::TypedData { void* layoutContext; - float width; + YGFloat width; YGMeasureMode widthMeasureMode; - float height; + YGFloat height; YGMeasureMode heightMeasureMode; - float measuredWidth; - float measuredHeight; + YGFloat measuredWidth; + YGFloat measuredHeight; const LayoutPassReason reason; };