Skip to content

Commit

Permalink
Rebase & remove from implementation files
Browse files Browse the repository at this point in the history
  • Loading branch information
Adlai Holler committed Jun 18, 2018
1 parent 076870a commit 4dc331e
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 43 deletions.
36 changes: 18 additions & 18 deletions Source/ASDisplayNodeExtras.mm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#import <queue>
#import <AsyncDisplayKit/ASRunLoopQueue.h>

AS_EXTERN void ASPerformMainThreadDeallocation(id _Nullable __strong * _Nonnull objectPtr) {
void ASPerformMainThreadDeallocation(id _Nullable __strong * _Nonnull objectPtr) {
/**
* UIKit components must be deallocated on the main thread. We use this shared
* run loop queue to gradually deallocate them across many turns of the main run loop.
Expand All @@ -48,7 +48,7 @@ AS_EXTERN void ASPerformMainThreadDeallocation(id _Nullable __strong * _Nonnull
}
}

AS_EXTERN void _ASSetDebugNames(Class _Nonnull owningClass, NSString * _Nonnull names, ASDisplayNode * _Nullable object, ...)
void _ASSetDebugNames(Class _Nonnull owningClass, NSString * _Nonnull names, ASDisplayNode * _Nullable object, ...)
{
NSString *owningClassName = NSStringFromClass(owningClass);
NSArray *nameArray = [names componentsSeparatedByString:@", "];
Expand All @@ -66,7 +66,7 @@ AS_EXTERN void _ASSetDebugNames(Class _Nonnull owningClass, NSString * _Nonnull
va_end(args);
}

AS_EXTERN ASInterfaceState ASInterfaceStateForDisplayNode(ASDisplayNode *displayNode, UIWindow *window)
ASInterfaceState ASInterfaceStateForDisplayNode(ASDisplayNode *displayNode, UIWindow *window)
{
ASDisplayNodeCAssert(![displayNode isLayerBacked], @"displayNode must not be layer backed as it may have a nil window");
if (displayNode && [displayNode supportsRangeManagedInterfaceState]) {
Expand All @@ -81,17 +81,17 @@ AS_EXTERN ASInterfaceState ASInterfaceStateForDisplayNode(ASDisplayNode *display
}
}

AS_EXTERN ASDisplayNode *ASLayerToDisplayNode(CALayer *layer)
ASDisplayNode *ASLayerToDisplayNode(CALayer *layer)
{
return layer.asyncdisplaykit_node;
}

AS_EXTERN ASDisplayNode *ASViewToDisplayNode(UIView *view)
ASDisplayNode *ASViewToDisplayNode(UIView *view)
{
return view.asyncdisplaykit_node;
}

AS_EXTERN void ASDisplayNodePerformBlockOnEveryNode(CALayer * _Nullable layer, ASDisplayNode * _Nullable node, BOOL traverseSublayers, void(^block)(ASDisplayNode *node))
void ASDisplayNodePerformBlockOnEveryNode(CALayer * _Nullable layer, ASDisplayNode * _Nullable node, BOOL traverseSublayers, void(^block)(ASDisplayNode *node))
{
if (!node) {
ASDisplayNodeCAssertNotNil(layer, @"Cannot recursively perform with nil node and nil layer");
Expand Down Expand Up @@ -119,7 +119,7 @@ AS_EXTERN void ASDisplayNodePerformBlockOnEveryNode(CALayer * _Nullable layer, A
}
}

AS_EXTERN void ASDisplayNodePerformBlockOnEveryNodeBFS(ASDisplayNode *node, void(^block)(ASDisplayNode *node))
void ASDisplayNodePerformBlockOnEveryNodeBFS(ASDisplayNode *node, void(^block)(ASDisplayNode *node))
{
// Queue used to keep track of subnodes while traversing this layout in a BFS fashion.
std::queue<ASDisplayNode *> queue;
Expand All @@ -138,7 +138,7 @@ AS_EXTERN void ASDisplayNodePerformBlockOnEveryNodeBFS(ASDisplayNode *node, void
}
}

AS_EXTERN void ASDisplayNodePerformBlockOnEverySubnode(ASDisplayNode *node, BOOL traverseSublayers, void(^block)(ASDisplayNode *node))
void ASDisplayNodePerformBlockOnEverySubnode(ASDisplayNode *node, BOOL traverseSublayers, void(^block)(ASDisplayNode *node))
{
for (ASDisplayNode *subnode in node.subnodes) {
ASDisplayNodePerformBlockOnEveryNode(nil, subnode, YES, block);
Expand Down Expand Up @@ -176,7 +176,7 @@ static void _ASCollectDisplayNodes(NSMutableArray *array, CALayer *layer)
_ASCollectDisplayNodes(array, sublayer);
}

AS_EXTERN NSArray<ASDisplayNode *> *ASCollectDisplayNodes(ASDisplayNode *node)
NSArray<ASDisplayNode *> *ASCollectDisplayNodes(ASDisplayNode *node)
{
NSMutableArray *list = [[NSMutableArray alloc] init];
for (CALayer *sublayer in node.layer.sublayers) {
Expand All @@ -201,14 +201,14 @@ static void _ASDisplayNodeFindAllSubnodes(NSMutableArray *array, ASDisplayNode *
}
}

AS_EXTERN NSArray<ASDisplayNode *> *ASDisplayNodeFindAllSubnodes(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node))
NSArray<ASDisplayNode *> *ASDisplayNodeFindAllSubnodes(ASDisplayNode *start, BOOL (^block)(ASDisplayNode *node))
{
NSMutableArray *list = [[NSMutableArray alloc] init];
_ASDisplayNodeFindAllSubnodes(list, start, block);
return list;
}

AS_EXTERN NSArray<__kindof ASDisplayNode *> *ASDisplayNodeFindAllSubnodesOfClass(ASDisplayNode *start, Class c)
NSArray<__kindof ASDisplayNode *> *ASDisplayNodeFindAllSubnodesOfClass(ASDisplayNode *start, Class c)
{
return ASDisplayNodeFindAllSubnodes(start, ^(ASDisplayNode *n) {
return [n isKindOfClass:c];
Expand All @@ -232,17 +232,17 @@ static void _ASDisplayNodeFindAllSubnodes(NSMutableArray *array, ASDisplayNode *
return nil;
}

AS_EXTERN __kindof ASDisplayNode *ASDisplayNodeFindFirstNode(ASDisplayNode *startNode, BOOL (^block)(ASDisplayNode *node))
__kindof ASDisplayNode *ASDisplayNodeFindFirstNode(ASDisplayNode *startNode, BOOL (^block)(ASDisplayNode *node))
{
return _ASDisplayNodeFindFirstNode(startNode, YES, block);
}

AS_EXTERN __kindof ASDisplayNode *ASDisplayNodeFindFirstSubnode(ASDisplayNode *startNode, BOOL (^block)(ASDisplayNode *node))
__kindof ASDisplayNode *ASDisplayNodeFindFirstSubnode(ASDisplayNode *startNode, BOOL (^block)(ASDisplayNode *node))
{
return _ASDisplayNodeFindFirstNode(startNode, NO, block);
}

AS_EXTERN __kindof ASDisplayNode *ASDisplayNodeFindFirstSubnodeOfClass(ASDisplayNode *start, Class c)
__kindof ASDisplayNode *ASDisplayNodeFindFirstSubnodeOfClass(ASDisplayNode *start, Class c)
{
return ASDisplayNodeFindFirstSubnode(start, ^(ASDisplayNode *n) {
return [n isKindOfClass:c];
Expand All @@ -262,7 +262,7 @@ static inline BOOL _ASDisplayNodeIsAncestorOfDisplayNode(ASDisplayNode *possible
return NO;
}

AS_EXTERN UIWindow * _Nullable ASFindWindowOfLayer(CALayer *layer)
UIWindow * _Nullable ASFindWindowOfLayer(CALayer *layer)
{
UIView *view = ASFindClosestViewOfLayer(layer);
if (UIWindow *window = ASDynamicCast(view, UIWindow)) {
Expand All @@ -272,7 +272,7 @@ static inline BOOL _ASDisplayNodeIsAncestorOfDisplayNode(ASDisplayNode *possible
}
}

AS_EXTERN UIView * _Nullable ASFindClosestViewOfLayer(CALayer *layer)
UIView * _Nullable ASFindClosestViewOfLayer(CALayer *layer)
{
while (layer != nil) {
if (UIView *view = ASDynamicCast(layer.delegate, UIView)) {
Expand All @@ -283,7 +283,7 @@ static inline BOOL _ASDisplayNodeIsAncestorOfDisplayNode(ASDisplayNode *possible
return nil;
}

AS_EXTERN ASDisplayNode *ASDisplayNodeFindClosestCommonAncestor(ASDisplayNode *node1, ASDisplayNode *node2)
ASDisplayNode *ASDisplayNodeFindClosestCommonAncestor(ASDisplayNode *node1, ASDisplayNode *node2)
{
ASDisplayNode *possibleAncestor = node1;
while (possibleAncestor) {
Expand All @@ -297,7 +297,7 @@ static inline BOOL _ASDisplayNodeIsAncestorOfDisplayNode(ASDisplayNode *possible
return possibleAncestor;
}

AS_EXTERN ASDisplayNode *ASDisplayNodeUltimateParentOfNode(ASDisplayNode *node)
ASDisplayNode *ASDisplayNodeUltimateParentOfNode(ASDisplayNode *node)
{
// node <- supernode on each loop
// previous <- node on each loop where node is not nil
Expand Down
4 changes: 2 additions & 2 deletions Source/ASImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ - (NSDictionary *)debugLabelAttributes

#pragma mark - Extras

AS_EXTERN asimagenode_modification_block_t ASImageNodeRoundBorderModificationBlock(CGFloat borderWidth, UIColor *borderColor)
asimagenode_modification_block_t ASImageNodeRoundBorderModificationBlock(CGFloat borderWidth, UIColor *borderColor)
{
return ^(UIImage *originalImage) {
ASGraphicsBeginImageContextWithOptions(originalImage.size, NO, originalImage.scale);
Expand All @@ -755,7 +755,7 @@ AS_EXTERN asimagenode_modification_block_t ASImageNodeRoundBorderModificationBlo
};
}

AS_EXTERN asimagenode_modification_block_t ASImageNodeTintColorModificationBlock(UIColor *color)
asimagenode_modification_block_t ASImageNodeTintColorModificationBlock(UIColor *color)
{
return ^(UIImage *originalImage) {
ASGraphicsBeginImageContextWithOptions(originalImage.size, NO, originalImage.scale);
Expand Down
14 changes: 7 additions & 7 deletions Source/Details/ASAbstractLayoutController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

#include <vector>

AS_EXTERN ASRangeTuningParameters const ASRangeTuningParametersZero = {};
ASRangeTuningParameters const ASRangeTuningParametersZero = {};

AS_EXTERN BOOL ASRangeTuningParametersEqualToRangeTuningParameters(ASRangeTuningParameters lhs, ASRangeTuningParameters rhs)
BOOL ASRangeTuningParametersEqualToRangeTuningParameters(ASRangeTuningParameters lhs, ASRangeTuningParameters rhs)
{
return lhs.leadingBufferScreenfuls == rhs.leadingBufferScreenfuls && lhs.trailingBufferScreenfuls == rhs.trailingBufferScreenfuls;
}

AS_EXTERN ASDirectionalScreenfulBuffer ASDirectionalScreenfulBufferHorizontal(ASScrollDirection scrollDirection,
ASDirectionalScreenfulBuffer ASDirectionalScreenfulBufferHorizontal(ASScrollDirection scrollDirection,
ASRangeTuningParameters rangeTuningParameters)
{
ASDirectionalScreenfulBuffer horizontalBuffer = {0, 0};
Expand All @@ -41,7 +41,7 @@ AS_EXTERN ASDirectionalScreenfulBuffer ASDirectionalScreenfulBufferHorizontal(AS
return horizontalBuffer;
}

AS_EXTERN ASDirectionalScreenfulBuffer ASDirectionalScreenfulBufferVertical(ASScrollDirection scrollDirection,
ASDirectionalScreenfulBuffer ASDirectionalScreenfulBufferVertical(ASScrollDirection scrollDirection,
ASRangeTuningParameters rangeTuningParameters)
{
ASDirectionalScreenfulBuffer verticalBuffer = {0, 0};
Expand All @@ -54,7 +54,7 @@ AS_EXTERN ASDirectionalScreenfulBuffer ASDirectionalScreenfulBufferVertical(ASSc
return verticalBuffer;
}

AS_EXTERN CGRect CGRectExpandHorizontally(CGRect rect, ASDirectionalScreenfulBuffer buffer)
CGRect CGRectExpandHorizontally(CGRect rect, ASDirectionalScreenfulBuffer buffer)
{
CGFloat negativeDirectionWidth = buffer.negativeDirection * rect.size.width;
CGFloat positiveDirectionWidth = buffer.positiveDirection * rect.size.width;
Expand All @@ -63,7 +63,7 @@ AS_EXTERN CGRect CGRectExpandHorizontally(CGRect rect, ASDirectionalScreenfulBuf
return rect;
}

AS_EXTERN CGRect CGRectExpandVertically(CGRect rect, ASDirectionalScreenfulBuffer buffer)
CGRect CGRectExpandVertically(CGRect rect, ASDirectionalScreenfulBuffer buffer)
{
CGFloat negativeDirectionHeight = buffer.negativeDirection * rect.size.height;
CGFloat positiveDirectionHeight = buffer.positiveDirection * rect.size.height;
Expand All @@ -72,7 +72,7 @@ AS_EXTERN CGRect CGRectExpandVertically(CGRect rect, ASDirectionalScreenfulBuffe
return rect;
}

AS_EXTERN CGRect CGRectExpandToRangeWithScrollableDirections(CGRect rect, ASRangeTuningParameters tuningParameters,
CGRect CGRectExpandToRangeWithScrollableDirections(CGRect rect, ASRangeTuningParameters tuningParameters,
ASScrollDirection scrollableDirections, ASScrollDirection scrollDirection)
{
// Can scroll horizontally - expand the range appropriately
Expand Down
6 changes: 3 additions & 3 deletions Source/Details/ASGraphicsContext.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static size_t ASGraphicsGetAlignedBytesPerRow(size_t baseValue) {

#pragma mark - Graphics Contexts

AS_EXTERN void ASGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale)
void ASGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale)
{
if (!ASActivateExperimentalFeature(ASExperimentalGraphicsContexts)) {
UIGraphicsBeginImageContextWithOptions(size, opaque, scale);
Expand Down Expand Up @@ -106,7 +106,7 @@ AS_EXTERN void ASGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque,
CGContextRelease(context);
}

AS_EXTERN UIImage * _Nullable ASGraphicsGetImageAndEndCurrentContext() NS_RETURNS_RETAINED
UIImage * _Nullable ASGraphicsGetImageAndEndCurrentContext() NS_RETURNS_RETAINED
{
if (!ASActivateExperimentalFeature(ASExperimentalGraphicsContexts)) {
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
Expand Down Expand Up @@ -160,7 +160,7 @@ AS_EXTERN void ASGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque,
return result;
}

AS_EXTERN void ASGraphicsEndImageContext()
void ASGraphicsEndImageContext()
{
if (!ASActivateExperimentalFeature(ASExperimentalGraphicsContexts)) {
UIGraphicsEndImageContext();
Expand Down
12 changes: 6 additions & 6 deletions Source/Details/ASPageTable.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#import <AsyncDisplayKit/ASPageTable.h>

AS_EXTERN ASPageCoordinate ASPageCoordinateMake(uint16_t x, uint16_t y)
ASPageCoordinate ASPageCoordinateMake(uint16_t x, uint16_t y)
{
// Add 1 to the end result because 0 is not accepted by NSArray and NSMapTable.
// To avoid overflow after adding, x and y can't be UINT16_MAX (0xFFFF) **at the same time**.
Expand All @@ -22,29 +22,29 @@ AS_EXTERN ASPageCoordinate ASPageCoordinateMake(uint16_t x, uint16_t y)
return (x << 16) + y + 1;
}

AS_EXTERN ASPageCoordinate ASPageCoordinateForPageThatContainsPoint(CGPoint point, CGSize pageSize)
ASPageCoordinate ASPageCoordinateForPageThatContainsPoint(CGPoint point, CGSize pageSize)
{
return ASPageCoordinateMake((MAX(0.0, point.x) / pageSize.width), (MAX(0.0, point.y) / pageSize.height));
}

AS_EXTERN uint16_t ASPageCoordinateGetX(ASPageCoordinate pageCoordinate)
uint16_t ASPageCoordinateGetX(ASPageCoordinate pageCoordinate)
{
return (pageCoordinate - 1) >> 16;
}

AS_EXTERN uint16_t ASPageCoordinateGetY(ASPageCoordinate pageCoordinate)
uint16_t ASPageCoordinateGetY(ASPageCoordinate pageCoordinate)
{
return (pageCoordinate - 1) & ~(0xFFFF<<16);
}

AS_EXTERN CGRect ASPageCoordinateGetPageRect(ASPageCoordinate pageCoordinate, CGSize pageSize)
CGRect ASPageCoordinateGetPageRect(ASPageCoordinate pageCoordinate, CGSize pageSize)
{
CGFloat pageWidth = pageSize.width;
CGFloat pageHeight = pageSize.height;
return CGRectMake(ASPageCoordinateGetX(pageCoordinate) * pageWidth, ASPageCoordinateGetY(pageCoordinate) * pageHeight, pageWidth, pageHeight);
}

AS_EXTERN NSPointerArray *ASPageCoordinatesForPagesThatIntersectRect(CGRect rect, CGSize contentSize, CGSize pageSize)
NSPointerArray *ASPageCoordinatesForPagesThatIntersectRect(CGRect rect, CGSize contentSize, CGSize pageSize)
{
CGRect contentRect = CGRectMake(0.0, 0.0, contentSize.width, contentSize.height);
// Make sure the specified rect is within contentRect
Expand Down
2 changes: 1 addition & 1 deletion Source/Details/ASTraitCollection.m
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ ASPrimitiveContentSizeCategory ASPrimitiveContentSizeCategoryMake(UIContentSizeC

#pragma mark - ASPrimitiveTraitCollection

AS_EXTERN void ASTraitCollectionPropagateDown(id<ASLayoutElement> element, ASPrimitiveTraitCollection traitCollection) {
void ASTraitCollectionPropagateDown(id<ASLayoutElement> element, ASPrimitiveTraitCollection traitCollection) {
if (element) {
element.primitiveTraitCollection = traitCollection;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Layout/ASDimension.mm
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ ASSizeRange ASSizeRangeIntersect(ASSizeRange sizeRange, ASSizeRange otherSizeRan
#pragma mark - Yoga - ASEdgeInsets
ASEdgeInsets const ASEdgeInsetsZero = {};

AS_EXTERN ASEdgeInsets ASEdgeInsetsMake(UIEdgeInsets edgeInsets)
ASEdgeInsets ASEdgeInsetsMake(UIEdgeInsets edgeInsets)
{
ASEdgeInsets asEdgeInsets = ASEdgeInsetsZero;
asEdgeInsets.top = ASDimensionMake(edgeInsets.top);
Expand Down
2 changes: 1 addition & 1 deletion Source/Layout/ASLayout.mm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

CGPoint const ASPointNull = {NAN, NAN};

AS_EXTERN BOOL ASPointIsNull(CGPoint point)
BOOL ASPointIsNull(CGPoint point)
{
return isnan(point.x) && isnan(point.y);
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Layout/ASYogaUtilities.mm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ + (ASDisplayNode *)yogaHorizontalStack

@end

AS_EXTERN void ASDisplayNodePerformBlockOnEveryYogaChild(ASDisplayNode *node, void(^block)(ASDisplayNode *node))
void ASDisplayNodePerformBlockOnEveryYogaChild(ASDisplayNode *node, void(^block)(ASDisplayNode *node))
{
if (node == nil) {
return;
Expand Down
2 changes: 1 addition & 1 deletion Source/Private/ASCollectionLayoutDefines.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#import <AsyncDisplayKit/ASCollectionLayoutDefines.h>

AS_EXTERN ASSizeRange ASSizeRangeForCollectionLayoutThatFitsViewportSize(CGSize viewportSize, ASScrollDirection scrollableDirections)
ASSizeRange ASSizeRangeForCollectionLayoutThatFitsViewportSize(CGSize viewportSize, ASScrollDirection scrollableDirections)
{
ASSizeRange sizeRange = ASSizeRangeUnconstrained;
if (ASScrollDirectionContainsVerticalDirection(scrollableDirections) == NO) {
Expand Down
4 changes: 2 additions & 2 deletions Source/Private/_ASCoreAnimationExtras.mm
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
#import <AsyncDisplayKit/ASEqualityHelpers.h>
#import <AsyncDisplayKit/ASAssert.h>

AS_EXTERN void ASDisplayNodeSetupLayerContentsWithResizableImage(CALayer *layer, UIImage *image)
void ASDisplayNodeSetupLayerContentsWithResizableImage(CALayer *layer, UIImage *image)
{
ASDisplayNodeSetResizableContents(layer, image);
}

AS_EXTERN void ASDisplayNodeSetResizableContents(id<ASResizableContents> obj, UIImage *image)
void ASDisplayNodeSetResizableContents(id<ASResizableContents> obj, UIImage *image)
{
if (image) {
ASDisplayNodeCAssert(image.resizingMode == UIImageResizingModeStretch || UIEdgeInsetsEqualToEdgeInsets(image.capInsets, UIEdgeInsetsZero),
Expand Down

0 comments on commit 4dc331e

Please sign in to comment.