From af0de09d5275a84ecfe44d21d3fb3678fb18b696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=CC=8Avard=20Fossli?= Date: Fri, 16 May 2014 08:28:42 +0200 Subject: [PATCH] Fixing pods for demo --- AGGeometryKit+POP.podspec | 1 + Demo/Podfile | 4 +- Demo/Podfile.lock | 20 +- Demo/Pods/AGGeometryKit/LICENSE | 22 + Demo/Pods/AGGeometryKit/README.md | 138 + .../Pods/AGGeometryKit/Source/AGGeometryKit.h | 35 + .../AGGeometryKit/Source/AGKBitOperations.h | 73 + Demo/Pods/AGGeometryKit/Source/AGKCorner.h | 40 + Demo/Pods/AGGeometryKit/Source/AGKCorner.m | 55 + Demo/Pods/AGGeometryKit/Source/AGKLine.h | 32 + Demo/Pods/AGGeometryKit/Source/AGKLine.m | 69 + Demo/Pods/AGGeometryKit/Source/AGKMath.h | 80 + Demo/Pods/AGGeometryKit/Source/AGKMath.m | 294 ++ Demo/Pods/AGGeometryKit/Source/AGKQuad.h | 80 + Demo/Pods/AGGeometryKit/Source/AGKQuad.m | 442 ++ Demo/Pods/AGGeometryKit/Source/AGKVector3D.h | 52 + Demo/Pods/AGGeometryKit/Source/AGKVector3D.m | 124 + .../Categories/AGGeometryKitCategories.h | 32 + .../Source/Categories/CALayer+AGK+Methods.h | 41 + .../Source/Categories/CALayer+AGK+Methods.m | 123 + .../Categories/CALayer+AGK+Properties.h | 62 + .../Categories/CALayer+AGK+Properties.m | 248 + .../Source/Categories/CALayer+AGKQuad.h | 65 + .../Source/Categories/CALayer+AGKQuad.m | 177 + .../Source/Categories/NSValue+AGKQuad.h | 33 + .../Source/Categories/NSValue+AGKQuad.m | 54 + .../Source/Categories/UIBezierPath+AGKQuad.h | 31 + .../Source/Categories/UIBezierPath+AGKQuad.m | 43 + .../Categories/UIImage+AGK+CATransform3D.h | 30 + .../Categories/UIImage+AGK+CATransform3D.m | 38 + .../Source/Categories/UIImage+AGKQuad.h | 32 + .../Source/Categories/UIImage+AGKQuad.m | 43 + .../Categories/UIView+AGK+AngleConverter.h | 31 + .../Categories/UIView+AGK+AngleConverter.m | 60 + .../Source/Categories/UIView+AGK+Properties.h | 56 + .../Source/Categories/UIView+AGK+Properties.m | 225 + .../Source/Classes/AGGeometryKitClasses.h | 25 + .../AGKCALayerAnimationBlockDelegate.h | 36 + .../AGKCALayerAnimationBlockDelegate.m | 80 + .../Source/Classes/AGKTransformPixelMapper.h | 48 + .../Source/Classes/AGKTransformPixelMapper.m | 183 + .../AGGeometryKitCoreGraphics.h | 25 + .../CGGeometry+AGGeometryKit.h | 102 + .../CGGeometry+AGGeometryKit.m | 447 ++ .../CGImageRef+AGK+CATransform3D.h | 30 + .../CGImageRef+AGK+CATransform3D.m | 52 + .../AGGeometryKit/AGGeometryKit.h | 2 +- .../AGGeometryKit/AGGeometryKitCategories.h | 2 +- .../AGGeometryKit/AGGeometryKitClasses.h | 2 +- .../AGGeometryKit/AGGeometryKitCoreGraphics.h | 2 +- .../AGGeometryKit/AGKBitOperations.h | 2 +- .../AGKCALayerAnimationBlockDelegate.h | 2 +- .../BuildHeaders/AGGeometryKit/AGKCorner.h | 2 +- .../Pods/BuildHeaders/AGGeometryKit/AGKLine.h | 2 +- .../Pods/BuildHeaders/AGGeometryKit/AGKMath.h | 2 +- .../Pods/BuildHeaders/AGGeometryKit/AGKQuad.h | 2 +- .../AGGeometryKit/AGKTransformPixelMapper.h | 2 +- .../BuildHeaders/AGGeometryKit/AGKVector3D.h | 2 +- .../AGGeometryKit/CALayer+AGK+Methods.h | 2 +- .../AGGeometryKit/CALayer+AGK+Properties.h | 2 +- .../AGGeometryKit/CALayer+AGKQuad.h | 2 +- .../AGGeometryKit/CGGeometry+AGGeometryKit.h | 2 +- .../CGImageRef+AGK+CATransform3D.h | 2 +- .../AGGeometryKit/NSValue+AGKQuad.h | 2 +- .../AGGeometryKit/UIBezierPath+AGKQuad.h | 2 +- .../AGGeometryKit/UIImage+AGK+CATransform3D.h | 2 +- .../AGGeometryKit/UIImage+AGKQuad.h | 2 +- .../AGGeometryKit/UIView+AGK+AngleConverter.h | 2 +- .../AGGeometryKit/UIView+AGK+Properties.h | 2 +- Demo/Pods/BuildHeaders/pop/FloatConversion.h | 2 +- Demo/Pods/BuildHeaders/pop/POP.h | 2 +- Demo/Pods/BuildHeaders/pop/POPAction.h | 2 +- .../BuildHeaders/pop/POPAnimatableProperty.h | 2 +- Demo/Pods/BuildHeaders/pop/POPAnimation.h | 2 +- .../Pods/BuildHeaders/pop/POPAnimationEvent.h | 2 +- .../pop/POPAnimationEventInternal.h | 2 +- .../BuildHeaders/pop/POPAnimationExtras.h | 2 +- .../BuildHeaders/pop/POPAnimationInternal.h | 2 +- .../BuildHeaders/pop/POPAnimationPrivate.h | 2 +- .../BuildHeaders/pop/POPAnimationRuntime.h | 2 +- .../BuildHeaders/pop/POPAnimationTracer.h | 2 +- .../pop/POPAnimationTracerInternal.h | 2 +- Demo/Pods/BuildHeaders/pop/POPAnimator.h | 2 +- .../BuildHeaders/pop/POPAnimatorPrivate.h | 2 +- .../Pods/BuildHeaders/pop/POPBasicAnimation.h | 2 +- .../pop/POPBasicAnimationInternal.h | 2 +- Demo/Pods/BuildHeaders/pop/POPCGUtils.h | 2 +- .../BuildHeaders/pop/POPCustomAnimation.h | 2 +- .../Pods/BuildHeaders/pop/POPDecayAnimation.h | 2 +- .../pop/POPDecayAnimationInternal.h | 2 +- Demo/Pods/BuildHeaders/pop/POPDefines.h | 2 +- Demo/Pods/BuildHeaders/pop/POPGeometry.h | 2 +- Demo/Pods/BuildHeaders/pop/POPLayerExtras.h | 2 +- Demo/Pods/BuildHeaders/pop/POPMath.h | 2 +- .../BuildHeaders/pop/POPPropertyAnimation.h | 2 +- .../pop/POPPropertyAnimationInternal.h | 2 +- .../BuildHeaders/pop/POPSpringAnimation.h | 2 +- .../pop/POPSpringAnimationInternal.h | 2 +- Demo/Pods/BuildHeaders/pop/POPSpringSolver.h | 2 +- Demo/Pods/BuildHeaders/pop/POPVector.h | 2 +- .../BuildHeaders/pop/TransformationMatrix.h | 2 +- Demo/Pods/BuildHeaders/pop/UnitBezier.h | 2 +- .../Headers/AGGeometryKit/AGGeometryKit.h | 2 +- .../AGGeometryKit/AGGeometryKitCategories.h | 2 +- .../AGGeometryKit/AGGeometryKitClasses.h | 2 +- .../AGGeometryKit/AGGeometryKitCoreGraphics.h | 2 +- .../Headers/AGGeometryKit/AGKBitOperations.h | 2 +- .../AGKCALayerAnimationBlockDelegate.h | 2 +- Demo/Pods/Headers/AGGeometryKit/AGKCorner.h | 2 +- Demo/Pods/Headers/AGGeometryKit/AGKLine.h | 2 +- Demo/Pods/Headers/AGGeometryKit/AGKMath.h | 2 +- Demo/Pods/Headers/AGGeometryKit/AGKQuad.h | 2 +- .../AGGeometryKit/AGKTransformPixelMapper.h | 2 +- Demo/Pods/Headers/AGGeometryKit/AGKVector3D.h | 2 +- .../AGGeometryKit/CALayer+AGK+Methods.h | 2 +- .../AGGeometryKit/CALayer+AGK+Properties.h | 2 +- .../Headers/AGGeometryKit/CALayer+AGKQuad.h | 2 +- .../AGGeometryKit/CGGeometry+AGGeometryKit.h | 2 +- .../CGImageRef+AGK+CATransform3D.h | 2 +- .../Headers/AGGeometryKit/NSValue+AGKQuad.h | 2 +- .../AGGeometryKit/UIBezierPath+AGKQuad.h | 2 +- .../AGGeometryKit/UIImage+AGK+CATransform3D.h | 2 +- .../Headers/AGGeometryKit/UIImage+AGKQuad.h | 2 +- .../AGGeometryKit/UIView+AGK+AngleConverter.h | 2 +- .../AGGeometryKit/UIView+AGK+Properties.h | 2 +- Demo/Pods/Headers/pop/POP.h | 2 +- Demo/Pods/Headers/pop/POPAnimatableProperty.h | 2 +- Demo/Pods/Headers/pop/POPAnimation.h | 2 +- Demo/Pods/Headers/pop/POPAnimationEvent.h | 2 +- Demo/Pods/Headers/pop/POPAnimationExtras.h | 2 +- Demo/Pods/Headers/pop/POPAnimationTracer.h | 2 +- Demo/Pods/Headers/pop/POPAnimator.h | 2 +- Demo/Pods/Headers/pop/POPBasicAnimation.h | 2 +- Demo/Pods/Headers/pop/POPCustomAnimation.h | 2 +- Demo/Pods/Headers/pop/POPDecayAnimation.h | 2 +- Demo/Pods/Headers/pop/POPDefines.h | 2 +- Demo/Pods/Headers/pop/POPGeometry.h | 2 +- Demo/Pods/Headers/pop/POPPropertyAnimation.h | 2 +- Demo/Pods/Headers/pop/POPSpringAnimation.h | 2 +- .../Pods/Local Podspecs/AGGeometryKit.podspec | 30 - Demo/Pods/Local Podspecs/pop.podspec | 21 - Demo/Pods/Manifest.lock | 20 +- Demo/Pods/Pods-environment.h | 28 +- Demo/Pods/Pods.xcodeproj/project.pbxproj | 4012 ++++++++--------- .../xcschemes/Pods-AGGeometryKit.xcscheme | 59 - .../xcschemes/Pods-pop.xcscheme | 59 - .../xcschemes/Pods.xcscheme | 59 - .../xcschemes/xcschememanagement.plist | 42 - Demo/Pods/pop/LICENSE | 30 + Demo/Pods/pop/README.md | 165 + Demo/Pods/pop/pop/POP.h | 28 + Demo/Pods/pop/pop/POPAction.h | 66 + Demo/Pods/pop/pop/POPAnimatableProperty.h | 165 + Demo/Pods/pop/pop/POPAnimatableProperty.mm | 695 +++ Demo/Pods/pop/pop/POPAnimation.h | 134 + Demo/Pods/pop/pop/POPAnimation.mm | 228 + Demo/Pods/pop/pop/POPAnimationEvent.h | 68 + Demo/Pods/pop/pop/POPAnimationEvent.mm | 101 + Demo/Pods/pop/pop/POPAnimationEventInternal.h | 41 + Demo/Pods/pop/pop/POPAnimationExtras.h | 43 + Demo/Pods/pop/pop/POPAnimationExtras.mm | 117 + Demo/Pods/pop/pop/POPAnimationInternal.h | 485 ++ Demo/Pods/pop/pop/POPAnimationPrivate.h | 16 + Demo/Pods/pop/pop/POPAnimationRuntime.h | 102 + Demo/Pods/pop/pop/POPAnimationRuntime.mm | 271 ++ Demo/Pods/pop/pop/POPAnimationTracer.h | 60 + Demo/Pods/pop/pop/POPAnimationTracer.mm | 184 + .../Pods/pop/pop/POPAnimationTracerInternal.h | 91 + Demo/Pods/pop/pop/POPAnimator.h | 47 + Demo/Pods/pop/pop/POPAnimator.mm | 643 +++ Demo/Pods/pop/pop/POPAnimatorPrivate.h | 58 + Demo/Pods/pop/pop/POPBasicAnimation.h | 71 + Demo/Pods/pop/pop/POPBasicAnimation.mm | 90 + Demo/Pods/pop/pop/POPBasicAnimationInternal.h | 92 + Demo/Pods/pop/pop/POPCGUtils.h | 83 + Demo/Pods/pop/pop/POPCGUtils.mm | 96 + Demo/Pods/pop/pop/POPCustomAnimation.h | 46 + Demo/Pods/pop/pop/POPCustomAnimation.mm | 53 + Demo/Pods/pop/pop/POPDecayAnimation.h | 54 + Demo/Pods/pop/pop/POPDecayAnimation.mm | 126 + Demo/Pods/pop/pop/POPDecayAnimationInternal.h | 157 + Demo/Pods/pop/pop/POPDefines.h | 29 + Demo/Pods/pop/pop/POPGeometry.h | 53 + Demo/Pods/pop/pop/POPGeometry.mm | 67 + Demo/Pods/pop/pop/POPLayerExtras.h | 196 + Demo/Pods/pop/pop/POPLayerExtras.mm | 268 ++ Demo/Pods/pop/pop/POPMath.h | 56 + Demo/Pods/pop/pop/POPMath.mm | 82 + Demo/Pods/pop/pop/POPPropertyAnimation.h | 65 + Demo/Pods/pop/pop/POPPropertyAnimation.mm | 105 + .../pop/pop/POPPropertyAnimationInternal.h | 358 ++ Demo/Pods/pop/pop/POPSpringAnimation.h | 67 + Demo/Pods/pop/pop/POPSpringAnimation.mm | 164 + .../Pods/pop/pop/POPSpringAnimationInternal.h | 131 + Demo/Pods/pop/pop/POPSpringSolver.h | 190 + Demo/Pods/pop/pop/POPVector.h | 366 ++ Demo/Pods/pop/pop/POPVector.mm | 283 ++ Demo/Pods/pop/pop/WebCore/FloatConversion.h | 56 + .../pop/pop/WebCore/TransformationMatrix.cpp | 1072 +++++ .../pop/pop/WebCore/TransformationMatrix.h | 277 ++ Demo/Pods/pop/pop/WebCore/UnitBezier.h | 123 + 201 files changed, 14825 insertions(+), 2418 deletions(-) mode change 100755 => 100644 AGGeometryKit+POP.podspec create mode 100644 Demo/Pods/AGGeometryKit/LICENSE create mode 100644 Demo/Pods/AGGeometryKit/README.md create mode 100644 Demo/Pods/AGGeometryKit/Source/AGGeometryKit.h create mode 100644 Demo/Pods/AGGeometryKit/Source/AGKBitOperations.h create mode 100644 Demo/Pods/AGGeometryKit/Source/AGKCorner.h create mode 100644 Demo/Pods/AGGeometryKit/Source/AGKCorner.m create mode 100644 Demo/Pods/AGGeometryKit/Source/AGKLine.h create mode 100644 Demo/Pods/AGGeometryKit/Source/AGKLine.m create mode 100644 Demo/Pods/AGGeometryKit/Source/AGKMath.h create mode 100644 Demo/Pods/AGGeometryKit/Source/AGKMath.m create mode 100644 Demo/Pods/AGGeometryKit/Source/AGKQuad.h create mode 100644 Demo/Pods/AGGeometryKit/Source/AGKQuad.m create mode 100644 Demo/Pods/AGGeometryKit/Source/AGKVector3D.h create mode 100644 Demo/Pods/AGGeometryKit/Source/AGKVector3D.m create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/AGGeometryKitCategories.h create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Methods.h create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Methods.m create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Properties.h create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Properties.m create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGKQuad.h create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGKQuad.m create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/NSValue+AGKQuad.h create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/NSValue+AGKQuad.m create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/UIBezierPath+AGKQuad.h create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/UIBezierPath+AGKQuad.m create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGK+CATransform3D.h create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGK+CATransform3D.m create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGKQuad.h create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGKQuad.m create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+AngleConverter.h create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+AngleConverter.m create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+Properties.h create mode 100644 Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+Properties.m create mode 100644 Demo/Pods/AGGeometryKit/Source/Classes/AGGeometryKitClasses.h create mode 100644 Demo/Pods/AGGeometryKit/Source/Classes/AGKCALayerAnimationBlockDelegate.h create mode 100644 Demo/Pods/AGGeometryKit/Source/Classes/AGKCALayerAnimationBlockDelegate.m create mode 100755 Demo/Pods/AGGeometryKit/Source/Classes/AGKTransformPixelMapper.h create mode 100755 Demo/Pods/AGGeometryKit/Source/Classes/AGKTransformPixelMapper.m create mode 100644 Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/AGGeometryKitCoreGraphics.h create mode 100644 Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.h create mode 100644 Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.m create mode 100644 Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.h create mode 100644 Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.m delete mode 100755 Demo/Pods/Local Podspecs/AGGeometryKit.podspec delete mode 100644 Demo/Pods/Local Podspecs/pop.podspec delete mode 100644 Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/Pods-AGGeometryKit.xcscheme delete mode 100644 Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/Pods-pop.xcscheme delete mode 100644 Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/Pods.xcscheme delete mode 100644 Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 Demo/Pods/pop/LICENSE create mode 100644 Demo/Pods/pop/README.md create mode 100644 Demo/Pods/pop/pop/POP.h create mode 100644 Demo/Pods/pop/pop/POPAction.h create mode 100644 Demo/Pods/pop/pop/POPAnimatableProperty.h create mode 100644 Demo/Pods/pop/pop/POPAnimatableProperty.mm create mode 100644 Demo/Pods/pop/pop/POPAnimation.h create mode 100644 Demo/Pods/pop/pop/POPAnimation.mm create mode 100644 Demo/Pods/pop/pop/POPAnimationEvent.h create mode 100644 Demo/Pods/pop/pop/POPAnimationEvent.mm create mode 100644 Demo/Pods/pop/pop/POPAnimationEventInternal.h create mode 100644 Demo/Pods/pop/pop/POPAnimationExtras.h create mode 100644 Demo/Pods/pop/pop/POPAnimationExtras.mm create mode 100644 Demo/Pods/pop/pop/POPAnimationInternal.h create mode 100644 Demo/Pods/pop/pop/POPAnimationPrivate.h create mode 100644 Demo/Pods/pop/pop/POPAnimationRuntime.h create mode 100644 Demo/Pods/pop/pop/POPAnimationRuntime.mm create mode 100644 Demo/Pods/pop/pop/POPAnimationTracer.h create mode 100644 Demo/Pods/pop/pop/POPAnimationTracer.mm create mode 100644 Demo/Pods/pop/pop/POPAnimationTracerInternal.h create mode 100644 Demo/Pods/pop/pop/POPAnimator.h create mode 100644 Demo/Pods/pop/pop/POPAnimator.mm create mode 100644 Demo/Pods/pop/pop/POPAnimatorPrivate.h create mode 100644 Demo/Pods/pop/pop/POPBasicAnimation.h create mode 100644 Demo/Pods/pop/pop/POPBasicAnimation.mm create mode 100644 Demo/Pods/pop/pop/POPBasicAnimationInternal.h create mode 100644 Demo/Pods/pop/pop/POPCGUtils.h create mode 100644 Demo/Pods/pop/pop/POPCGUtils.mm create mode 100644 Demo/Pods/pop/pop/POPCustomAnimation.h create mode 100644 Demo/Pods/pop/pop/POPCustomAnimation.mm create mode 100644 Demo/Pods/pop/pop/POPDecayAnimation.h create mode 100644 Demo/Pods/pop/pop/POPDecayAnimation.mm create mode 100644 Demo/Pods/pop/pop/POPDecayAnimationInternal.h create mode 100644 Demo/Pods/pop/pop/POPDefines.h create mode 100644 Demo/Pods/pop/pop/POPGeometry.h create mode 100644 Demo/Pods/pop/pop/POPGeometry.mm create mode 100644 Demo/Pods/pop/pop/POPLayerExtras.h create mode 100644 Demo/Pods/pop/pop/POPLayerExtras.mm create mode 100644 Demo/Pods/pop/pop/POPMath.h create mode 100644 Demo/Pods/pop/pop/POPMath.mm create mode 100644 Demo/Pods/pop/pop/POPPropertyAnimation.h create mode 100644 Demo/Pods/pop/pop/POPPropertyAnimation.mm create mode 100644 Demo/Pods/pop/pop/POPPropertyAnimationInternal.h create mode 100644 Demo/Pods/pop/pop/POPSpringAnimation.h create mode 100644 Demo/Pods/pop/pop/POPSpringAnimation.mm create mode 100644 Demo/Pods/pop/pop/POPSpringAnimationInternal.h create mode 100644 Demo/Pods/pop/pop/POPSpringSolver.h create mode 100644 Demo/Pods/pop/pop/POPVector.h create mode 100644 Demo/Pods/pop/pop/POPVector.mm create mode 100644 Demo/Pods/pop/pop/WebCore/FloatConversion.h create mode 100644 Demo/Pods/pop/pop/WebCore/TransformationMatrix.cpp create mode 100644 Demo/Pods/pop/pop/WebCore/TransformationMatrix.h create mode 100644 Demo/Pods/pop/pop/WebCore/UnitBezier.h diff --git a/AGGeometryKit+POP.podspec b/AGGeometryKit+POP.podspec old mode 100755 new mode 100644 index e80edf9..424a34a --- a/AGGeometryKit+POP.podspec +++ b/AGGeometryKit+POP.podspec @@ -23,4 +23,5 @@ Pod::Spec.new do |s| ss.dependency 'pop', '~> 1.0.4' ss.dependency 'AGGeometryKit', '~> 1.0' end + end \ No newline at end of file diff --git a/Demo/Podfile b/Demo/Podfile index fed267c..bffdce6 100644 --- a/Demo/Podfile +++ b/Demo/Podfile @@ -1,4 +1,4 @@ platform :ios, '6.0' -pod 'AGGeometryKit', :path => '../../AGGeometryKit/AGGeometryKit.podspec' -pod 'pop', :path => '../../POP/pop.podspec' +pod 'pop', '~> 1.0.4' +pod 'AGGeometryKit', '~> 1.0.1' \ No newline at end of file diff --git a/Demo/Podfile.lock b/Demo/Podfile.lock index 11d3a76..f7c138a 100644 --- a/Demo/Podfile.lock +++ b/Demo/Podfile.lock @@ -1,25 +1,17 @@ PODS: - - AGGeometryKit (0.1.8.3): + - AGGeometryKit (1.0.1): - AGGeometryKit/Default - - AGGeometryKit/Core (0.1.8.3) - - AGGeometryKit/Default (0.1.8.3): + - AGGeometryKit/Core (1.0.1) + - AGGeometryKit/Default (1.0.1): - AGGeometryKit/Core - - AGGeometryKit/Dependencies - - AGGeometryKit/Dependencies (0.1.8.3) - pop (1.0.4) DEPENDENCIES: - - AGGeometryKit (from `../../AGGeometryKit/AGGeometryKit.podspec`) - - pop (from `../../POP/pop.podspec`) - -EXTERNAL SOURCES: - AGGeometryKit: - :path: ../../AGGeometryKit/AGGeometryKit.podspec - pop: - :path: ../../POP/pop.podspec + - AGGeometryKit (~> 1.0.1) + - pop (~> 1.0.4) SPEC CHECKSUMS: - AGGeometryKit: 5c60ef0435a4c4aeb2a59232f9709927976795d7 + AGGeometryKit: 995cf78e880fa0a88f109e0ac58041d3314d2315 pop: 63a4f5e8942077fed2efe195036ecc572c71c48c COCOAPODS: 0.32.1 diff --git a/Demo/Pods/AGGeometryKit/LICENSE b/Demo/Pods/AGGeometryKit/LICENSE new file mode 100644 index 0000000..56cca37 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/LICENSE @@ -0,0 +1,22 @@ + +Author: Håvard Fossli + +Copyright (c) 2013 Agens AS (http://agens.no/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/Demo/Pods/AGGeometryKit/README.md b/Demo/Pods/AGGeometryKit/README.md new file mode 100644 index 0000000..7d1c5fc --- /dev/null +++ b/Demo/Pods/AGGeometryKit/README.md @@ -0,0 +1,138 @@ +![# AGGeometryKit](/logo.png?raw=true "AGGeometryKit") + +Quadrilaterals on CALayer (control each corner point individually), CGGeometry-functions, UIView/CALayer properties and other invaluable tools. + + + +### Installation + +New-school: Use the cocoa pod named `AGGeometryKit`. +Old-school: Grab the files found in `Source`. + + + +## Demo + +[![Demo video](http://i.vimeocdn.com/video/475306257_800.jpg)](https://vimeo.com/95376358) +[See the video on vimeo ](https://vimeo.com/95376358) + +Used in conjunction with [POP](https://github.com/facebook/pop) this allows you to do really awesome stuff. Visit [AGGeometryKit+POP](https://github.com/hfossli/AGGeometryKit-Pop). + +[![Demo video](https://i.vimeocdn.com/video/475306176_800.jpg)](https://vimeo.com/95383807) +[See the video on vimeo ](https://vimeo.com/95383807) + + +## Quadrilaterals + +A quadrilateral is a polygon with four sides (or edges) and four vertices or corners. AGGeometryKit gives you lets you control each corner point individually. + +You can access `quadrilateral` as a property just like you would do with `frame`, `center` or `bounds`. The coordinates is in same coordinate system as `frame` and `position`. You can use the quadrilateral on any UIView or CALayer - even webviews - with just as good performance as you would have not using it. The underlying technology is CATransform3D. More about quadrilaterals: http://en.wikipedia.org/wiki/Quadrilateral + + UIView *view = ...; // create a view + [view.layer ensureAnchorPointIsSetToZero]; // set the anchor point to [0, 0] (this method keeps the same position) + + AGQuad quad = view.layer.quadrilateral; + quad.br.x += 20; // shift bottom right x-value with 20 pixels + quad.br.y += 50; // shift bottom right y-value with 50 pixels + + view.layer.quadrilateral = quad; // the quad is converted to CATransform3D and applied + + +## UIView and CALayer properties + +Example of some of the properties which is added to UIView and CALayer. Naming is done in same manner as `CGRectGetMaxX` for consistency. + + ... + @property (nonatomic, assign) CGPoint frameOrigin; + @property (nonatomic, assign) CGFloat frameMinX; + @property (nonatomic, assign) CGFloat frameMinY; + @property (nonatomic, assign) CGFloat frameMidX; + @property (nonatomic, assign) CGFloat frameMidY; + @property (nonatomic, assign) CGFloat frameMaxX; + @property (nonatomic, assign) CGFloat frameMaxY; + @property (nonatomic, assign) CGFloat frameWidth; + @property (nonatomic, assign) CGFloat frameHeight; + ... + + + + +## CGGeometry-additions + +Some of the most useful functions + + ... + CGRect CGRectInterpolate_AGK(CGRect rect1, CGRect rect2, CGFloat progress); + CGSize CGRectGapBetween_AGK(CGRect rect1, CGRect rect2); + CGPoint CGPointClamp_AGK(CGPoint p, CGFloat minX, CGFloat maxX, CGFloat minY, CGFloat maxY); + CGPoint CGPointAdd_AGK(CGPoint p1, CGPoint p2); + ... + + + + +## Math + +Some of the most useful functions + + ... + CGFloat AGKInterpolate(CGFloat startValue, CGFloat endValue, CGFloat progress); + CGFloat AGKRemapToZeroOne(CGFloat value, CGFloat startValue, CGFloat endValue); + CGFloat AGKRemap(CGFloat value, CGFloat oldStartValue, CGFloat oldEndValue, CGFloat newStartValue, CGFloat newEndValue); + CGFloat AGKRemapAndClamp(CGFloat value, CGFloat oldStartValue, CGFloat oldEndValue, CGFloat newStartValue, CGFloat newEndValue); + CGFloat AGKRemapToZeroOneAndClamp(CGFloat value, CGFloat oldStartValue, CGFloat oldEndValue); + CGFloat AGKClamp(CGFloat value, CGFloat min, CGFloat max); + + CGFloat AGKRadiansToDegrees(CGFloat radians); + CGFloat AGKDegreesToRadians(CGFloat degrees); + ... + + + +## Debugging quadrilaterals + +- anchorPoint must be {0, 0} always when using quadrilaterals +- the quadrilateral must be convex +- don't modify the frame, but instead use `layer.position` or `view.center` and `layer.bounds` or `view.bounds` +- quadrilateral can not be used in conjunction with other CATransform3D-things like perspective, scale, rotate etc +- remember the coordinate system for the `quadrilateral`-property is in the same coordinate as `frame` and `position` +- don't make your values too extreme - they might cause application crash. +- check if the autoresizing mask might be altering the frame (to be 100% sure it is good for debugging to turn off `autoresizesSubviews`) + +It can also be useful to create a representation of the quadrilateral you are trying to display using a UIBezierPath: + + UIView *quadPreview = [[UIView alloc] init]; + quadPreview.frame = quadView.frame; + quadPreview.layer.shadowPath = [UIBezierPath bezierPathWithAGQuad:quad].CGPath; + quadPreview.layer.shadowColor = [UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:0.5].CGColor; + quadPreview.layer.shadowOpacity = 1.0; + quadPreview.layer.shadowRadius = 0.0; + quadPreview.layer.shadowOffset = CGSizeZero; + quadPreview.backgroundColor = [UIColor clearColor]; + [quadView.superview addSubview:quadPreview]; + + + +## Useful links + +* Bartosz Ciechanowski created a [genie effect](https://github.com/Ciechan/BCGenieEffect/) around desember 2012 using quadrilaterals +* [Quadrilaterals on stackoverflow](http://stackoverflow.com/a/12820877/558816) +* Want to work with us? Visit [agens.no](http://agens.no/) + + + + + +## Keywords + +Convex quadrilateral, simple quadrilateral, tangential, kite, rhombus, square, trapezium, trapezoid, parallelogram, bicentric, cyclic + + + + +## Who's behind this? + +Agens.no a company situated in Oslo, Norway with some help from some very clever stackoverflow.com guys. + + +[![Agens | Digital craftsmanship](http://static.agens.no/images/agens_logo_w_slogan_avenir_small.png)](http://agens.no/) diff --git a/Demo/Pods/AGGeometryKit/Source/AGGeometryKit.h b/Demo/Pods/AGGeometryKit/Source/AGGeometryKit.h new file mode 100644 index 0000000..d819e69 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/AGGeometryKit.h @@ -0,0 +1,35 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// Agens Geometry Kit (AGK) + +#import "AGKBitOperations.h" +#import "AGKCorner.h" +#import "AGKLine.h" +#import "AGKMath.h" +#import "AGKQuad.h" +#import "AGKVector3D.h" + +#import "AGGeometryKitCategories.h" +#import "AGGeometryKitClasses.h" +#import "AGGeometryKitCoreGraphics.h" diff --git a/Demo/Pods/AGGeometryKit/Source/AGKBitOperations.h b/Demo/Pods/AGGeometryKit/Source/AGKBitOperations.h new file mode 100644 index 0000000..5d0272c --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/AGKBitOperations.h @@ -0,0 +1,73 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +// For general purpose + +#ifndef AGK_BIT_ENABLE +# define AGK_BIT_ENABLE(x, b) ((x) |= (b)) +#endif + +#ifndef AGK_BIT_CLEAR +# define AGK_BIT_CLEAR(x, b) ((x) &= ~(b)) +#endif + +#ifndef AGK_BIT_TEST_ENABLED +# define AGK_BIT_TEST_ENABLED(x, b) (((x) & (b)) != 0) +#endif + +#ifndef AGK_BIT_TEST_DISABLED +# define AGK_BIT_TEST_DISABLED(x, b) (((x) & (b)) == 0) +#endif + +#ifndef AGK_BIT_TEST_ALL_ENABLED +# define AGK_BIT_TEST_ALL_ENABLED(x, b) ({\ + __typeof__(b) __b = (b);\ + ((x) & __b) == __b;\ + }) +#endif + +// For NS_OPTION + +#ifndef NS_OPTION_ENABLE +# define NS_OPTION_ENABLE(x, b) ((x) |= (b)) +#endif + +#ifndef NS_OPTION_CLEAR +# define NS_OPTION_CLEAR(x, b) ((x) &= ~(b)) +#endif + +#ifndef NS_OPTION_ENABLED +# define NS_OPTION_ENABLED(x, b) (((x) & (b)) != 0) +#endif + +#ifndef NS_OPTION_DISABLED +# define NS_OPTION_DISABLED(x, b) (((x) & (b)) == 0) +#endif + +#ifndef NS_OPTION_ALL_ENABLED +# define NS_OPTION_ALL_ENABLED(x, b) ({\ + __typeof__(b) __b = (b);\ + ((x) & __b) == __b;\ + }) +#endif + diff --git a/Demo/Pods/AGGeometryKit/Source/AGKCorner.h b/Demo/Pods/AGGeometryKit/Source/AGKCorner.h new file mode 100644 index 0000000..6afcbf4 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/AGKCorner.h @@ -0,0 +1,40 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +typedef enum AGKSide { + AGKSideTop = 1 << 0, + AGKSideBottom = 1 << 1, + AGKSideLeft = 1 << 2, + AGKSideRight = 1 << 3, +} AGKSide; + +typedef enum { + AGKCornerTopLeft = AGKSideTop | AGKSideLeft, + AGKCornerTopRight = AGKSideTop | AGKSideRight, + AGKCornerBottomLeft = AGKSideBottom | AGKSideLeft, + AGKCornerBottomRight = AGKSideBottom | AGKSideRight, +} AGKCorner; + +BOOL AGKCornerIsOnSide(AGKCorner corner, AGKSide side); +CGPoint AGKCornerConvertToAnchorPoint(AGKCorner corner); +CGPoint AGKCornerConvertToPointForRect(AGKCorner corner, CGRect rect); \ No newline at end of file diff --git a/Demo/Pods/AGGeometryKit/Source/AGKCorner.m b/Demo/Pods/AGGeometryKit/Source/AGKCorner.m new file mode 100644 index 0000000..8368e06 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/AGKCorner.m @@ -0,0 +1,55 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "AGKCorner.h" +#import "CGGeometry+AGGeometryKit.h" + +BOOL AGKCornerIsOnSide(AGKCorner corner, AGKSide side) +{ + return (corner & side) == side; +} + +CGPoint AGKCornerConvertToAnchorPoint(AGKCorner corner) +{ + switch (corner) { + case AGKCornerTopLeft: + return CGPointMake(0, 0); + break; + case AGKCornerTopRight: + return CGPointMake(1, 0); + break; + case AGKCornerBottomLeft: + return CGPointMake(0, 1); + break; + case AGKCornerBottomRight: + return CGPointMake(1, 1); + break; + } +} + +CGPoint AGKCornerConvertToPointForRect(AGKCorner corner, CGRect rect) +{ + CGPoint anchor = AGKCornerConvertToAnchorPoint(corner); + CGPoint p = CGPointConvertFromAnchorPoint_AGK(anchor, rect); + return p; +} diff --git a/Demo/Pods/AGGeometryKit/Source/AGKLine.h b/Demo/Pods/AGGeometryKit/Source/AGKLine.h new file mode 100644 index 0000000..9919ccc --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/AGKLine.h @@ -0,0 +1,32 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +typedef union AGKLine { + struct { CGPoint start, end; }; + double v[2]; +} AGKLine; + +const AGKLine AGKLineZero; +AGKLine AGKLineMake(CGPoint start, CGPoint end); +double AGKLineLength(AGKLine l); +BOOL AGKLineIntersection(AGKLine l1, AGKLine l2, CGPoint *out_pointOfIntersection); diff --git a/Demo/Pods/AGGeometryKit/Source/AGKLine.m b/Demo/Pods/AGGeometryKit/Source/AGKLine.m new file mode 100644 index 0000000..20d1efa --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/AGKLine.m @@ -0,0 +1,69 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "AGKLine.h" +#import "CGGeometry+AGGeometryKit.h" + +const AGKLine AGKLineZero = (AGKLine){(CGPoint){0.0, 0.0}, (CGPoint){0.0, 0.0}}; + +AGKLine AGKLineMake(CGPoint start, CGPoint end) +{ + return (AGKLine){start, end}; +} + +double AGKLineLength(AGKLine l) +{ + return CGPointLengthBetween_AGK(l.start, l.end); +} + +BOOL AGKLineIntersection(AGKLine l1, AGKLine l2, CGPoint *out_pointOfIntersection) +{ + // http://stackoverflow.com/a/565282/202451 + + CGPoint p = l1.start; + CGPoint q = l2.start; + CGPoint r = CGPointSubtract_AGK(l1.end, l1.start); + CGPoint s = CGPointSubtract_AGK(l2.end, l2.start); + + double s_r_crossProduct = CGPointCrossProductZComponent_AGK(r, s); + double t = CGPointCrossProductZComponent_AGK(CGPointSubtract_AGK(q, p), s) / s_r_crossProduct; + double u = CGPointCrossProductZComponent_AGK(CGPointSubtract_AGK(q, p), r) / s_r_crossProduct; + + if(t < 0 || t > 1.0 || u < 0 || u > 1.0) + { + if(out_pointOfIntersection != NULL) + { + *out_pointOfIntersection = CGPointZero; + } + return NO; + } + else + { + if(out_pointOfIntersection != NULL) + { + CGPoint i = CGPointAdd_AGK(p, CGPointMultiply_AGK(r, t)); + *out_pointOfIntersection = i; + } + return YES; + } +} \ No newline at end of file diff --git a/Demo/Pods/AGGeometryKit/Source/AGKMath.h b/Demo/Pods/AGGeometryKit/Source/AGKMath.h new file mode 100644 index 0000000..32f80ac --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/AGKMath.h @@ -0,0 +1,80 @@ +// +// Authors: +// Håvard Fossli +// Marcus Eckert +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +#define AGK_CLAMP(x, low, high) ({\ + __typeof__(x) __x = (x); \ + __typeof__(low) __low = (low);\ + __typeof__(high) __high = (high);\ + __x > __high ? __high : (__x < __low ? __low : __x);\ + }) + +#define AGK_IS_WITHIN(x, low, high) ({\ + __typeof__(x) __x = (x); \ + __typeof__(low) __low = (low);\ + __typeof__(high) __high = (high);\ + __x <= __high && __x >= __low;\ + }) + +CGFloat AGKInterpolate(CGFloat startValue, CGFloat endValue, CGFloat progress); +CGFloat AGKRemapToZeroOne(CGFloat value, CGFloat startValue, CGFloat endValue); +CGFloat AGKRemap(CGFloat value, CGFloat oldStartValue, CGFloat oldEndValue, CGFloat newStartValue, CGFloat newEndValue); +CGFloat AGKRemapAndClamp(CGFloat value, CGFloat oldStartValue, CGFloat oldEndValue, CGFloat newStartValue, CGFloat newEndValue); +CGFloat AGKRemapToZeroOneAndClamp(CGFloat value, CGFloat oldStartValue, CGFloat oldEndValue); +CGFloat AGKClamp(CGFloat value, CGFloat min, CGFloat max); + +BOOL AGKIsWithin(CGFloat value, CGFloat min, CGFloat max); + +CGFloat AGKRadiansToDegrees(CGFloat radians); +CGFloat AGKDegreesToRadians(CGFloat degrees); + +CGFloat AGKMakeProgressPingPong(CGFloat progress); +CGFloat AGKMakeProgressPingPongSin(CGFloat progress); +CGFloat AGKBezierYForX(CGFloat x, CGPoint p0, CGPoint p1, CGPoint p2, CGPoint p3); +CGFloat AGKBezierZeroOneYForX(CGFloat x, CGPoint p1, CGPoint p2); +CGFloat AGKEaseInWithBezier(CGFloat progress); +CGFloat AGKEaseOutWithBezier(CGFloat progress); +CGFloat AGKEaseInOutWithBezier(CGFloat progress, CGFloat force); +CGFloat AGKEaseOutWithOverShoot(CGFloat progress, CGFloat overshoot); +CGFloat AGKEaseOutWithPower(CGFloat progress, CGFloat power); + +CGFloat AGKDelayedProgressForItems(NSUInteger index, + NSUInteger itemCount, + CGFloat overlap, + CGFloat overallProgress); + +CGFloat AGKEaseWithTwoBeziers(CGPoint tangent1, + CGPoint tangent2, + CGPoint pointOfConnection, + CGFloat x, + CGPoint tangent4, + CGFloat time, + CGFloat progress); + +CGFloat AGKMinInArray(CGFloat values[], NSUInteger numberOfValues, NSUInteger *out_index); +CGFloat AGKMaxInArray(CGFloat values[], NSUInteger numberOfValues, NSUInteger *out_index); + +double AGKFloatToDoubleZeroFill(float value); diff --git a/Demo/Pods/AGGeometryKit/Source/AGKMath.m b/Demo/Pods/AGGeometryKit/Source/AGKMath.m new file mode 100644 index 0000000..b5b7f38 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/AGKMath.m @@ -0,0 +1,294 @@ +// +// Authors: +// Håvard Fossli +// Marcus Eckert +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "AGKMath.h" + +CGFloat AGKInterpolate(CGFloat startValue, CGFloat endValue, CGFloat progress) +{ + return startValue + ((endValue - startValue) * progress); +} + +CGFloat AGKRemapToZeroOne(CGFloat value, CGFloat startValue, CGFloat endValue) +{ + CGFloat diff = endValue - startValue; + + if(diff != 0.0) + { + return (value - startValue) / diff; + } + else + { + return 0.0; + } +} + +CGFloat AGKRemap(CGFloat value, CGFloat oldStartValue, CGFloat oldEndValue, CGFloat newStartValue, CGFloat newEndValue) +{ + CGFloat p = AGKRemapToZeroOne(value, oldStartValue, oldEndValue); + return AGKInterpolate(newStartValue, newEndValue, p); +} + +CGFloat AGKRemapAndClamp(CGFloat value, CGFloat oldStartValue, CGFloat oldEndValue, CGFloat newStartValue, CGFloat newEndValue) +{ + CGFloat p = AGKRemapToZeroOne(value, oldStartValue, oldEndValue); + CGFloat remapped = AGKInterpolate(newStartValue, newEndValue, p); + return AGKClamp(remapped, newStartValue, newEndValue); +} + +CGFloat AGKRemapToZeroOneAndClamp(CGFloat value, CGFloat oldStartValue, CGFloat oldEndValue) +{ + CGFloat remapped = AGKRemapToZeroOne(value, oldStartValue, oldEndValue); + return AGKClamp(remapped, 0.0, 1.0); +} + +CGFloat AGKClamp(CGFloat value, CGFloat min, CGFloat max) +{ + if(value > max) + return max; + if(value < min) + return min; + return value; +} + +BOOL AGKIsWithin(CGFloat value, CGFloat min, CGFloat max) +{ + if(value >= max) + return NO; + if(value <= min) + return NO; + return YES; +} + +CGFloat AGKRadiansToDegrees(CGFloat radians) +{ + return radians * 180 / M_PI; +} + +CGFloat AGKDegreesToRadians(CGFloat degrees) +{ + return degrees * M_PI / 180; +} + +CGFloat AGKMakeProgressPingPong(CGFloat progress) +{ + CGFloat fac1 = AGKRemapToZeroOneAndClamp(progress, 0.0, 0.5); + CGFloat fac2 = 1.0 - AGKRemapToZeroOneAndClamp(progress, 0.5, 1.0); + + return fac2 != 1.0f ? fac2 : fac1; +} + +CGFloat AGKMakeProgressPingPongSin(CGFloat progress) +{ + // http://www.wolframalpha.com/input/?i=sin%28x*PI*2.0-PI*0.5%29*0.5%2B0.5 + return sinf(progress*M_PI*2.0-M_PI*0.5)*0.5+0.5; +} + +CGFloat AGKDelayedProgressForItems(NSUInteger index, + NSUInteger itemCount, + CGFloat overlap, + CGFloat overallProgress) +{ + CGFloat multi = (1.0f-overlap) * (itemCount-1.0f); + multi +=1.0f; + overallProgress *= multi; + + CGFloat min = (CGFloat)index*(1.0f-overlap); + CGFloat sFac = overallProgress-min; + + sFac = MIN(MAX(sFac, 0.0f), 1.0f); + + return sFac; +} + +static CGFloat AGKBezierSlope(CGFloat t, CGFloat A, CGFloat B, CGFloat C) +{ + CGFloat dtdx = 1.0/(3.0*A*t*t + 2.0*B*t + C); + return dtdx; +} + +static CGFloat AGKBezierXFromT(CGFloat t, CGFloat A, CGFloat B, CGFloat C, CGFloat D) +{ + CGFloat x = A*(t*t*t) + B*(t*t) + C*t + D; + return x; +} + +static CGFloat AGKBezierYFromT(CGFloat t, CGFloat E, CGFloat F, CGFloat G, CGFloat H) +{ + CGFloat y = E*(t*t*t) + F*(t*t) + G*t + H; + return y; +} + +CGFloat AGKBezierYForX(CGFloat x, CGPoint p0, CGPoint p1, CGPoint p2, CGPoint p3) +{ + CGFloat y0a = p0.y; // initial y + CGFloat x0a = p0.x; // initial x + CGFloat y1a = p1.y; // 1st influence y + CGFloat x1a = p1.x; // 1st influence x + CGFloat y2a = p2.y; // 2nd influence y + CGFloat x2a = p2.x; // 2nd influence x + CGFloat y3a = p3.y; // final y + CGFloat x3a = p3.x; // final x + + CGFloat A = x3a - 3*x2a + 3*x1a - x0a; + CGFloat B = 3*x2a - 6*x1a + 3*x0a; + CGFloat C = 3*x1a - 3*x0a; + CGFloat D = x0a; + + CGFloat E = y3a - 3*y2a + 3*y1a - y0a; + CGFloat F = 3*y2a - 6*y1a + 3*y0a; + CGFloat G = 3*y1a - 3*y0a; + CGFloat H = y0a; + + // Solve for t given x (using Newton-Raphelson), then solve for y given t. + // Assume for the first guess that t = x. + CGFloat currentt = x; + + for (NSUInteger i = 0; i < 5; i++) + { + CGFloat currentx = AGKBezierXFromT(currentt, A, B, C, D); + CGFloat currentslope = AGKBezierSlope(currentt, A, B, C); + currentt -= (currentx - x) * currentslope; + currentt = MIN(MAX(currentt, 0.0f),1.0f); + } + + return AGKBezierYFromT(currentt, E, F, G, H); +} + +CGFloat AGKBezierZeroOneYForX(CGFloat x, CGPoint p1, CGPoint p2) +{ + return AGKBezierYForX(x, CGPointZero, p1, p2, CGPointMake(1, 1)); +} + +CGFloat AGKEaseInWithBezier(CGFloat progress) +{ + return AGKBezierZeroOneYForX(progress, CGPointMake(0.9, 0.0), CGPointMake(0.8, 0.6)); +} + +CGFloat AGKEaseOutWithBezier(CGFloat progress) +{ + return AGKBezierZeroOneYForX(progress, CGPointMake(0.2f, 0.4f), CGPointMake(0.1f, 1.0f)); +} + +CGFloat AGKEaseInOutWithBezier(CGFloat progress, CGFloat force) +{ + return AGKBezierZeroOneYForX(progress, CGPointMake(force, 0.0f), CGPointMake(1.0f-force, 1.0f)); +} + +CGFloat AGKEaseOutWithOverShoot(CGFloat progress, CGFloat overshoot) +{ + // overshoot is 2.0 + // http://www.wolframalpha.com/input/?i=%28%28x-1%29*%28x-1%29*%28%282%2B1%29*%28x-1%29+%2B+2%29+%2B+1%29+from+0+to+1 + return ((progress-1.0)*(progress-1.0)*((overshoot+1.0)*(progress-1.0) + overshoot) + 1.0); +} + +CGFloat AGKEaseOutWithPower(CGFloat progress, CGFloat power) +{ + // power is 3.0 + // http://www.wolframalpha.com/input/?i=1.0-%281.0-x%29^3+from+0+to+1 + return 1.0f-powf(fabsf(1.0f-progress), power); +} + +CGFloat AGKEaseWithTwoBeziers(CGPoint tangent1, + CGPoint tangent2, + CGPoint pointOfConnection, + CGFloat x, + CGPoint tangent4, + CGFloat time, + CGFloat progress) +{ + CGFloat fac1 = AGKRemapToZeroOneAndClamp(progress, 0.0, time); + CGFloat fac2 = AGKRemapToZeroOneAndClamp(progress, time, 1.0); + + CGPoint tangent3 = CGPointMake(x, pointOfConnection.y+ (pointOfConnection.y-tangent2.y)); + + if (fac1 <= 1.0) + { + return AGKBezierYForX(fac1, + CGPointZero, + tangent1, + tangent2, + pointOfConnection); + } + else + { + return AGKBezierYForX(fac2, + CGPointMake(0.0, pointOfConnection.y), + tangent3, + tangent4, + CGPointMake(1.0, 1.0)); + } +} + +CGFloat AGKMinInArray(CGFloat values[], NSUInteger numberOfValues, NSUInteger *out_index) +{ + CGFloat lowest = values[0]; + unsigned int index = 0; + + for(int i = 1; i < numberOfValues; i++) + { + CGFloat value = values[i]; + if(value < lowest) + { + lowest = value; + index = i; + } + } + + if(out_index != NULL) + { + *out_index = index; + } + + return lowest; +} + +CGFloat AGKMaxInArray(CGFloat values[], NSUInteger numberOfValues, NSUInteger *out_index) +{ + CGFloat highest = values[0]; + unsigned int index = 0; + + for(int i = 1; i < numberOfValues; i++) + { + CGFloat value = values[i]; + if(value > highest) + { + highest = value; + index = i; + } + } + + if(out_index != NULL) + { + *out_index = index; + } + + return highest; +} + +double AGKFloatToDoubleZeroFill(float floatValue) +{ + double doubleValue = [[NSString stringWithFormat:@"%f", floatValue] doubleValue]; + return doubleValue; +} diff --git a/Demo/Pods/AGGeometryKit/Source/AGKQuad.h b/Demo/Pods/AGGeometryKit/Source/AGKQuad.h new file mode 100644 index 0000000..645fada --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/AGKQuad.h @@ -0,0 +1,80 @@ +// +// Author: Håvard Fossli +// Author: https://github.com/kennytm +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import "AGKCorner.h" + +/* + tl = top left + tr = top right + br = bottom right + bl = bottom left + */ + +typedef union AGKQuad { + struct { CGPoint tl, tr, br, bl; }; + CGPoint v[4]; +} AGKQuad; + +const AGKQuad AGKQuadZero; +BOOL AGKQuadEqual(AGKQuad q1, AGKQuad q2); +BOOL AGKQuadEqualWithAccuracy(AGKQuad q1, AGKQuad q2, CGFloat accuracy); +BOOL AGKQuadIsConvex(AGKQuad q); +BOOL AGKQuadContainsValidValues(AGKQuad q); +BOOL AGKQuadIsValid(AGKQuad q); +int AGKQuadCornerIndexForCorner(AGKCorner corner); +AGKCorner AGKQuadCornerForCornerIndex(int i); +AGKQuad AGKQuadMove(AGKQuad q, CGFloat x, CGFloat y); +AGKQuad AGKQuadInsetLeft(AGKQuad q, CGFloat inset); +AGKQuad AGKQuadInsetRight(AGKQuad q, CGFloat inset); +AGKQuad AGKQuadInsetTop(AGKQuad q, CGFloat inset); +AGKQuad AGKQuadInsetBottom(AGKQuad q, CGFloat inset); +AGKQuad AGKQuadMirror(AGKQuad q, BOOL x, BOOL y); +AGKQuad AGKQuadMake(CGPoint tl, CGPoint tr, CGPoint br, CGPoint bl); +AGKQuad AGKQuadMakeWithCGRect(CGRect rect); +AGKQuad AGKQuadMakeWithCGSize(CGSize size); +CGFloat AGKQuadGetSmallestX(AGKQuad q); +CGFloat AGKQuadGetBiggestX(AGKQuad q); +CGFloat AGKQuadGetSmallestY(AGKQuad q); +CGFloat AGKQuadGetBiggestY(AGKQuad q); +CGRect AGKQuadGetBoundingRect(AGKQuad q); +CGPoint AGKQuadGetCenter(AGKQuad q); +CGSize AGKQuadGetSize(AGKQuad q); +CGPoint AGKQuadGetPointForCorner(AGKQuad q, AGKCorner corner); +void AGKQuadGetXValues(AGKQuad q, CGFloat *out_values); +void AGKQuadGetYValues(AGKQuad q, CGFloat *out_values); +AGKQuad AGKQuadInterpolate(AGKQuad q1, AGKQuad q2, CGFloat progress); +AGKQuad AGKQuadApplyCGAffineTransform(AGKQuad q, CGAffineTransform t); +AGKQuad AGKQuadApplyCATransform3D(AGKQuad q, CATransform3D t); +NSString * NSStringFromAGKQuad(AGKQuad q); + +/** + * @discussion + * It is only possible to make 'convex quadrilateral' with transforms. + * So make sure your quadrilateral is convex. + * http://upload.wikimedia.org/wikipedia/commons/f/f1/Quadrilateral_hierarchy.png + */ +CATransform3D CATransform3DWithAGKQuadFromBounds(AGKQuad q, CGRect rect); +CATransform3D CATransform3DWithAGKQuadFromRect(AGKQuad q, CGRect rect); + diff --git a/Demo/Pods/AGGeometryKit/Source/AGKQuad.m b/Demo/Pods/AGGeometryKit/Source/AGKQuad.m new file mode 100644 index 0000000..7d85303 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/AGKQuad.m @@ -0,0 +1,442 @@ +// +// Author: Håvard Fossli +// Author: https://github.com/kennytm +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "AGKQuad.h" +#import "AGKMath.h" +#import "AGKLine.h" +#import "CGGeometry+AGGeometryKit.h" + +/* + + + REFERENCES FOR FURTHER STUDYING + http://pastebin.com/90De4QqT + http://stackoverflow.com/questions/9470493/transforming-a-rectangle-image-into-a-quadrilateral-using-a-catransform3d + http://stackoverflow.com/questions/9088882/return-catransform3d-to-map-quadrilateral-to-quadrilateral + + + */ + +static AGKCorner kAGKQuadCornersOrdered[4] = { + AGKCornerTopLeft, + AGKCornerTopRight, + AGKCornerBottomRight, + AGKCornerBottomLeft +}; + +const AGKQuad AGKQuadZero = { (CGPoint){0, 0}, (CGPoint){0, 0}, (CGPoint){0, 0}, (CGPoint){0, 0} }; + +BOOL AGKQuadEqual(AGKQuad q1, AGKQuad q2) +{ + for(int i = 0; i < 4; i++) + { + if(!CGPointEqualToPoint(q1.v[i], q2.v[i])) + { + return NO; + } + } + return YES; +} + +BOOL AGKQuadEqualWithAccuracy(AGKQuad q1, AGKQuad q2, CGFloat accuracy) +{ + for(int i = 0; i < 4; i++) + { + CGFloat xDiff = fabs(q1.v[i].x - q2.v[i].x); + CGFloat yDiff = fabs(q1.v[i].y - q2.v[i].y); + if(xDiff > accuracy || yDiff > accuracy) + { + return NO; + } + } + return YES; +} + +BOOL AGKQuadIsConvex(AGKQuad q) +{ + BOOL isConvex = AGKLineIntersection(AGKLineMake(q.bl, q.tr), AGKLineMake(q.br, q.tl), NULL); + return isConvex; +} + +BOOL AGKQuadContainsValidValues(AGKQuad q) +{ + for(int i = 0; i < 4; i++) + { + if(isnan(q.v[i].x) || isnan(q.v[i].y) || isinf(q.v[i].x) || isinf(q.v[i].y)) + { + return NO; + } + } + return YES; +} + +BOOL AGKQuadIsValid(AGKQuad q) +{ + return AGKQuadIsConvex(q) && AGKQuadContainsValidValues(q); +} + +int AGKQuadCornerIndexForCorner(AGKCorner corner) +{ + for(int i = 0; i < 4; i++) + { + if(kAGKQuadCornersOrdered[i] == corner) + { + return i; + } + } + return 0; +} + +AGKCorner AGKQuadCornerForCornerIndex(int i) +{ + return kAGKQuadCornersOrdered[i]; +} + +AGKQuad AGKQuadMove(AGKQuad q, CGFloat x, CGFloat y) +{ + q.tl.x += x; + q.tr.x += x; + q.bl.x += x; + q.br.x += x; + q.tl.y += y; + q.tr.y += y; + q.bl.y += y; + q.br.y += y; + return q; +} + +AGKQuad AGKQuadInsetLeft(AGKQuad q, CGFloat inset) +{ + q.tl.x += inset; + q.bl.x += inset; + return q; +} + +AGKQuad AGKQuadInsetRight(AGKQuad q, CGFloat inset) +{ + q.tr.x -= inset; + q.br.x -= inset; + return q; +} + +AGKQuad AGKQuadInsetTop(AGKQuad q, CGFloat inset) +{ + q.tl.y += inset; + q.tr.y += inset; + return q; +} + +AGKQuad AGKQuadInsetBottom(AGKQuad q, CGFloat inset) +{ + q.tl.y -= inset; + q.tr.y -= inset; + return q; +} + +AGKQuad AGKQuadMirror(AGKQuad q, BOOL x, BOOL y) +{ + AGKQuad mirroredQ; + if(x) + { + mirroredQ.tl.x = q.tr.x; + mirroredQ.tr.x = q.tl.x; + mirroredQ.bl.x = q.br.x; + mirroredQ.br.x = q.bl.x; + } + if(y) + { + mirroredQ.tl.y = q.tr.y; + mirroredQ.tr.y = q.tl.y; + mirroredQ.bl.y = q.br.y; + mirroredQ.br.y = q.bl.y; + } + return mirroredQ; +} + +AGKQuad AGKQuadMake(CGPoint tl, CGPoint tr, CGPoint br, CGPoint bl) +{ + return (AGKQuad){.tl = tl, .tr = tr, .br = br, .bl = bl}; +} + +AGKQuad AGKQuadMakeWithCGRect(CGRect rect) +{ + AGKQuad q; + q.tl.x = CGRectGetMinX(rect); + q.tl.y = CGRectGetMinY(rect); + q.tr.x = CGRectGetMaxX(rect); + q.tr.y = CGRectGetMinY(rect); + q.br.x = CGRectGetMaxX(rect); + q.br.y = CGRectGetMaxY(rect); + q.bl.x = CGRectGetMinX(rect); + q.bl.y = CGRectGetMaxY(rect); + return q; +} + +AGKQuad AGKQuadMakeWithCGSize(CGSize size) +{ + AGKQuad q = AGKQuadZero; + q.tr.x = size.width; + q.br.x = size.width; + q.bl.y = size.height; + q.br.y = size.height; + return q; +} + +CGFloat AGKQuadGetSmallestX(AGKQuad q) +{ + CGFloat values[4]; + AGKQuadGetXValues(q, values); + return AGKMinInArray(values, 4, NULL); +} + +CGFloat AGKQuadGetBiggestX(AGKQuad q) +{ + CGFloat values[4]; + AGKQuadGetXValues(q, values); + return AGKMaxInArray(values, 4, NULL); +} + +CGFloat AGKQuadGetSmallestY(AGKQuad q) +{ + CGFloat values[4]; + AGKQuadGetYValues(q, values); + return AGKMinInArray(values, 4, NULL); +} + +CGFloat AGKQuadGetBiggestY(AGKQuad q) +{ + CGFloat values[4]; + AGKQuadGetYValues(q, values); + return AGKMaxInArray(values, 4, NULL); +} + +CGRect AGKQuadGetBoundingRect(AGKQuad q) +{ + CGFloat xValues[4]; + CGFloat yValues[4]; + AGKQuadGetXValues(q, xValues); + AGKQuadGetYValues(q, yValues); + + CGFloat xmin = AGKMinInArray(xValues, 4, NULL); + CGFloat xmax = AGKMaxInArray(xValues, 4, NULL); + CGFloat ymin = AGKMinInArray(yValues, 4, NULL); + CGFloat ymax = AGKMaxInArray(yValues, 4, NULL); + + CGRect rect; + rect.origin.x = xmin; + rect.origin.y = ymin; + rect.size.width = xmax - xmin; + rect.size.height = ymax - ymin; + + return rect; +} + +CGPoint AGKQuadGetCenter(AGKQuad q) +{ + CGPoint center = CGPointZero; + AGKLineIntersection(AGKLineMake(q.bl, q.tr), AGKLineMake(q.br, q.tl), ¢er); + return center; +} + +CGSize AGKQuadGetSize(AGKQuad q) +{ + CGRect smallestRect = AGKQuadGetBoundingRect(q); + return smallestRect.size; +} + +CGPoint AGKQuadGetPointForCorner(AGKQuad q, AGKCorner corner) +{ + int index = AGKQuadCornerIndexForCorner(corner); + return q.v[index]; +} + +void AGKQuadGetXValues(AGKQuad q, CGFloat *out_values) +{ + for(int i = 0; i < 4; i++) + { + CGPoint p = q.v[i]; + out_values[i] = p.x; + } +} + +void AGKQuadGetYValues(AGKQuad q, CGFloat *out_values) +{ + for(int i = 0; i < 4; i++) + { + CGPoint p = q.v[i]; + out_values[i] = p.y; + } +} + +AGKQuad AGKQuadInterpolate(AGKQuad q1, AGKQuad q2, CGFloat progress) +{ + AGKQuad q; + for(int i = 0; i < 4; i++) + { + q.v[i] = CGPointInterpolate_AGK(q1.v[i], q2.v[i], progress); + } + return q; +} + +AGKQuad AGKQuadApplyCGAffineTransform(AGKQuad q, CGAffineTransform t) +{ + for(int i = 0; i < 4; i++) + { + q.v[i] = CGPointApplyAffineTransform(q.v[i], t); + } + return q; +} + +AGKQuad AGKQuadApplyCATransform3D(AGKQuad q, CATransform3D t) +{ + for(int i = 0; i < 4; i++) + { + q.v[i] = CGPointApplyCATransform3D_AGK(q.v[i], t, CGPointZero, CATransform3DIdentity); + } + return q; +} + +NSString * NSStringFromAGKQuad(AGKQuad q) +{ + return [NSString stringWithFormat: + @"AGKQuad {\n\t" + "tl: %@,\n\t" + "tr: %@,\n\t" + "br: %@,\n\t" + "bl: %@\n" + "}", + NSStringFromCGPoint(q.tl), + NSStringFromCGPoint(q.tr), + NSStringFromCGPoint(q.br), + NSStringFromCGPoint(q.bl) + ]; +} + + +// This have slightly less operations than CATransform3DWithAGKQuadFromRect since origin values at rect is omitted. +// We could of course use CGSize instead, but I don't know... +// Taken from https://github.com/Ciechan/BCGenieEffect/blob/master/UIView%2BGenie.m +// Which derives from http://stackoverflow.com/a/12820877/558816 + +CATransform3D CATransform3DWithAGKQuadFromBounds(AGKQuad q, CGRect rect) +{ + double W = AGKFloatToDoubleZeroFill(rect.size.width); + double H = AGKFloatToDoubleZeroFill(rect.size.height); + + double x1a = AGKFloatToDoubleZeroFill(q.tl.x); + double y1a = AGKFloatToDoubleZeroFill(q.tl.y); + + double x2a = AGKFloatToDoubleZeroFill(q.tr.x); + double y2a = AGKFloatToDoubleZeroFill(q.tr.y); + + double x3a = AGKFloatToDoubleZeroFill(q.bl.x); + double y3a = AGKFloatToDoubleZeroFill(q.bl.y); + + double x4a = AGKFloatToDoubleZeroFill(q.br.x); + double y4a = AGKFloatToDoubleZeroFill(q.br.y); + + double y21 = y2a - y1a; + double y32 = y3a - y2a; + double y43 = y4a - y3a; + double y14 = y1a - y4a; + double y31 = y3a - y1a; + double y42 = y4a - y2a; + + double a = -H*(x2a*x3a*y14 + x2a*x4a*y31 - x1a*x4a*y32 + x1a*x3a*y42); + double b = W*(x2a*x3a*y14 + x3a*x4a*y21 + x1a*x4a*y32 + x1a*x2a*y43); + double c = - H*W*x1a*(x4a*y32 - x3a*y42 + x2a*y43); + + double d = H*(-x4a*y21*y3a + x2a*y1a*y43 - x1a*y2a*y43 - x3a*y1a*y4a + x3a*y2a*y4a); + double e = W*(x4a*y2a*y31 - x3a*y1a*y42 - x2a*y31*y4a + x1a*y3a*y42); + double f = -(W*(x4a*(H*y1a*y32) - x3a*(H)*y1a*y42 + H*x2a*y1a*y43)); + + double g = H*(x3a*y21 - x4a*y21 + (-x1a + x2a)*y43); + double h = W*(-x2a*y31 + x4a*y31 + (x1a - x3a)*y42); + double i = H*(W*(-(x3a*y2a) + x4a*y2a + x2a*y3a - x4a*y3a - x2a*y4a + x3a*y4a)); + + const double kEpsilon = 0.0001; + + if(fabs(i) < kEpsilon) + { + i = kEpsilon* (i > 0 ? 1.0 : -1.0); + } + + CATransform3D transform = {a/i, d/i, 0, g/i, b/i, e/i, 0, h/i, 0, 0, 1, 0, c/i, f/i, 0, 1.0}; + + return transform; +} + +// Alterations should be updated to this post http://stackoverflow.com/a/12820877/558816 +// The algorithm originates from this post http://stackoverflow.com/a/2352402/202451 +// by https://github.com/kennytm + +CATransform3D CATransform3DWithAGKQuadFromRect(AGKQuad q, CGRect rect) +{ + double X = AGKFloatToDoubleZeroFill(rect.origin.x); + double Y = AGKFloatToDoubleZeroFill(rect.origin.y); + double W = AGKFloatToDoubleZeroFill(rect.size.width); + double H = AGKFloatToDoubleZeroFill(rect.size.height); + + double x1a = AGKFloatToDoubleZeroFill(q.tl.x); + double y1a = AGKFloatToDoubleZeroFill(q.tl.y); + + double x2a = AGKFloatToDoubleZeroFill(q.tr.x); + double y2a = AGKFloatToDoubleZeroFill(q.tr.y); + + double x3a = AGKFloatToDoubleZeroFill(q.bl.x); + double y3a = AGKFloatToDoubleZeroFill(q.bl.y); + + double x4a = AGKFloatToDoubleZeroFill(q.br.x); + double y4a = AGKFloatToDoubleZeroFill(q.br.y); + + double y21 = y2a - y1a; + double y32 = y3a - y2a; + double y43 = y4a - y3a; + double y14 = y1a - y4a; + double y31 = y3a - y1a; + double y42 = y4a - y2a; + + double a = -H*(x2a*x3a*y14 + x2a*x4a*y31 - x1a*x4a*y32 + x1a*x3a*y42); + double b = W*(x2a*x3a*y14 + x3a*x4a*y21 + x1a*x4a*y32 + x1a*x2a*y43); + double c = H*X*(x2a*x3a*y14 + x2a*x4a*y31 - x1a*x4a*y32 + x1a*x3a*y42) - H*W*x1a*(x4a*y32 - x3a*y42 + x2a*y43) - W*Y*(x2a*x3a*y14 + x3a*x4a*y21 + x1a*x4a*y32 + x1a*x2a*y43); + + double d = H*(-x4a*y21*y3a + x2a*y1a*y43 - x1a*y2a*y43 - x3a*y1a*y4a + x3a*y2a*y4a); + double e = W*(x4a*y2a*y31 - x3a*y1a*y42 - x2a*y31*y4a + x1a*y3a*y42); + double f = -(W*(x4a*(Y*y2a*y31 + H*y1a*y32) - x3a*(H + Y)*y1a*y42 + H*x2a*y1a*y43 + x2a*Y*(y1a - y3a)*y4a + x1a*Y*y3a*(-y2a + y4a)) - H*X*(x4a*y21*y3a - x2a*y1a*y43 + x3a*(y1a - y2a)*y4a + x1a*y2a*(-y3a + y4a))); + + double g = H*(x3a*y21 - x4a*y21 + (-x1a + x2a)*y43); + double h = W*(-x2a*y31 + x4a*y31 + (x1a - x3a)*y42); + double i = W*Y*(x2a*y31 - x4a*y31 - x1a*y42 + x3a*y42) + H*(X*(-(x3a*y21) + x4a*y21 + x1a*y43 - x2a*y43) + W*(-(x3a*y2a) + x4a*y2a + x2a*y3a - x4a*y3a - x2a*y4a + x3a*y4a)); + + const double kEpsilon = 0.0001; + + if(fabs(i) < kEpsilon) + { + i = kEpsilon* (i > 0 ? 1.0 : -1.0); + } + + CATransform3D transform = {a/i, d/i, 0, g/i, b/i, e/i, 0, h/i, 0, 0, 1, 0, c/i, f/i, 0, 1.0}; + + return transform; +} diff --git a/Demo/Pods/AGGeometryKit/Source/AGKVector3D.h b/Demo/Pods/AGGeometryKit/Source/AGKVector3D.h new file mode 100644 index 0000000..20b6b0b --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/AGKVector3D.h @@ -0,0 +1,52 @@ +// +// Authors: +// Håvard Fossli +// Marcus Eckert +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import +#import "GLKit/GLKVector3.h" + +struct AGKVector3D { + CGFloat x; + CGFloat y; + CGFloat z; +}; +typedef struct AGKVector3D AGKVector3D; + +const AGKVector3D AGKVector3DZero; + +AGKVector3D AGKVector3DMake(CGFloat x, CGFloat y, CGFloat z); +AGKVector3D AGKVector3DWithGLKVector3(GLKVector3); +CGFloat AGKVector3DGetLength(AGKVector3D v); +AGKVector3D AGKVector3DAdd(AGKVector3D v1, AGKVector3D v2); +AGKVector3D AGKVector3DSubtract(AGKVector3D v1, AGKVector3D v2); +AGKVector3D AGKVector3DNegate(AGKVector3D v); +AGKVector3D AGKVector3DNormalize(AGKVector3D v); +CGFloat AGKVector3DDotProduct(AGKVector3D v1, AGKVector3D v2); +AGKVector3D AGKVector3DCrossProduct(AGKVector3D v1, AGKVector3D v2); +AGKVector3D AGKVector3DGetTriangleNormal(AGKVector3D v1, AGKVector3D v2, AGKVector3D v3); +AGKVector3D AGKVector3DPositionFromTransform(CATransform3D m); +AGKVector3D AGKVector3DApplyTransform(AGKVector3D vector, CATransform3D m); +AGKVector3D AGKVector3DApplyTransformWithNoTranslate(AGKVector3D vector, CATransform3D m); + diff --git a/Demo/Pods/AGGeometryKit/Source/AGKVector3D.m b/Demo/Pods/AGGeometryKit/Source/AGKVector3D.m new file mode 100644 index 0000000..8357d0a --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/AGKVector3D.m @@ -0,0 +1,124 @@ +// +// Authors: +// Håvard Fossli +// Marcus Eckert +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "AGKVector3D.h" +#import + +AGKVector3D AGKVector3DMake(CGFloat x, CGFloat y, CGFloat z) +{ + AGKVector3D vector; + vector.x = x; + vector.y = y; + vector.z = z; + return vector; +} + +CGFloat AGKVector3DGetLength(AGKVector3D v) +{ + return sqrtf(v.x * v.x + v.y * v.y + v.z * v.z); +} + +AGKVector3D AGKVector3DAdd(AGKVector3D v1, AGKVector3D v2) +{ + return AGKVector3DMake(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z); +} + +AGKVector3D AGKVector3DSubtract(AGKVector3D v1, AGKVector3D v2) +{ + return AGKVector3DMake(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z); +} + +AGKVector3D AGKVector3DNegate(AGKVector3D v) +{ + return AGKVector3DMake(-v.x, -v.y, -v.z); +} + +AGKVector3D AGKVector3DNormalize(AGKVector3D v) +{ + CGFloat length = AGKVector3DGetLength(v); + if(length != 0.0) + { + v.x /= length; + v.y /= length; + v.z /= length; + } + return v; +} + +CGFloat AGKVector3DDotProduct(AGKVector3D v1, AGKVector3D v2) +{ + return (v1.x * v2.x + v1.y * v2.y + v1.z * v2.z); +} + +AGKVector3D AGKVector3DCrossProduct(AGKVector3D v1, AGKVector3D v2) +{ + return AGKVector3DMake(v1.y * v2.z - v1.z * v2.y, + v1.z * v2.x - v1.x * v2.z, + v1.x * v2.y - v1.y * v2.x); +} + +AGKVector3D AGKVector3DForGLKVector3(GLKVector3 vec) +{ +#if defined(__STRICT_ANSI__) + return AGKVector3DMake(vec.v[0], vec.v[1], vec.v[2]); +#else + return AGKVector3DMake(vec.x, vec.y, vec.z); +#endif +} + +AGKVector3D AGKVector3DGetTriangleNormal(AGKVector3D v1, AGKVector3D v2, AGKVector3D v3) +{ + AGKVector3D edge1 = AGKVector3DSubtract(v1, v2); + AGKVector3D edge2 = AGKVector3DSubtract(v1, v3); + AGKVector3D surfaceNormal = AGKVector3DCrossProduct(edge1, edge2); + return surfaceNormal; +} + +AGKVector3D AGKVector3DPositionFromTransform(CATransform3D m) +{ + return AGKVector3DMake(m.m41, m.m42, m.m43); +} + +AGKVector3D AGKVector3DApplyTransform(AGKVector3D vector, CATransform3D m) +{ + AGKVector3D p; + + p.x = (m.m11 * vector.x + m.m21 * vector.y + m.m31 * vector.z + m.m41); + p.y = (m.m12 * vector.x + m.m22 * vector.y + m.m32 * vector.z + m.m42); + p.z = (m.m13 * vector.x + m.m23 * vector.y + m.m33 * vector.z + m.m43); + + return p; +} + +AGKVector3D AGKVector3DApplyTransformWithNoTranslate(AGKVector3D vector, CATransform3D m) +{ + AGKVector3D p; + + p.x = (m.m11 * vector.x + m.m21 * vector.y + m.m31 * vector.z); + p.y = (m.m12 * vector.x + m.m22 * vector.y + m.m32 * vector.z); + p.z = (m.m13 * vector.x + m.m23 * vector.y + m.m33 * vector.z); + + return p; +} diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/AGGeometryKitCategories.h b/Demo/Pods/AGGeometryKit/Source/Categories/AGGeometryKitCategories.h new file mode 100644 index 0000000..2146dad --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/AGGeometryKitCategories.h @@ -0,0 +1,32 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "CALayer+AGKQuad.h" +#import "CALayer+AGK+Properties.h" +#import "CALayer+AGK+Methods.h" +#import "NSValue+AGKQuad.h" +#import "UIBezierPath+AGKQuad.h" +#import "UIImage+AGKQuad.h" +#import "UIImage+AGK+CATransform3D.h" +#import "UIView+AGK+AngleConverter.h" +#import "UIView+AGK+Properties.h" diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Methods.h b/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Methods.h new file mode 100644 index 0000000..83c4edb --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Methods.h @@ -0,0 +1,41 @@ +// +// Authors: +// Håvard Fossli +// Marcus Eckert +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +@interface CALayer (AGK_Methods) + +- (void)setNullAsActionForKeys:(NSArray *)keys; +- (void)removeAllSublayers; +- (void)ensureAnchorPointIsSetToZero; +- (void)ensureAnchorPointIs:(CGPoint)point; + +- (CATransform3D)transformToOffsetRotationWithVirtualAnchorPoint:(CGPoint)virtualAnchor; +- (void)applyTransformToOffsetRotationWithVirtualAnchorPoint:(CGPoint)virtualAnchor; +- (CGPoint)offsetForXRotation:(CGFloat)angle virtualAnchorPoint:(CGPoint)virtualAnchor; +- (CGPoint)offsetForYRotation:(CGFloat)angle virtualAnchorPoint:(CGPoint)virtualAnchor; + +@end + diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Methods.m b/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Methods.m new file mode 100644 index 0000000..1285dc3 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Methods.m @@ -0,0 +1,123 @@ +// +// Authors: +// Håvard Fossli +// Marcus Eckert +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "CALayer+AGK+Methods.h" +#import "CGGeometry+AGGeometryKit.h" +#import +#import "AGKVector3D.h" + +@implementation CALayer (AGK_Methods) + +- (void)setNullAsActionForKeys:(NSArray *)keys +{ + NSMutableDictionary *dict = [self.actions mutableCopy]; + + if(dict == nil) + { + dict = [NSMutableDictionary dictionaryWithCapacity:[keys count]]; + } + + for(NSString *key in keys) + { + dict[key] = [NSNull null]; + } + + self.actions = dict; +} + +- (void)removeAllSublayers +{ + for(CALayer *sublayer in self.sublayers) + { + [sublayer removeFromSuperlayer]; + } +} + +- (void)ensureAnchorPointIsSetToZero +{ + [self ensureAnchorPointIs:CGPointZero]; +} + +- (void)ensureAnchorPointIs:(CGPoint)point +{ + if(!CGPointEqualToPoint(self.anchorPoint, point)) + { + CGRect frame = self.frame; + self.anchorPoint = point; + self.frame = frame; + } +} + +- (CATransform3D)transformToOffsetRotationWithVirtualAnchorPoint:(CGPoint)virtualAnchor +{ + CGPoint anchorDiff = CGPointMake((virtualAnchor.x-self.anchorPoint.x)*-1.0f, + virtualAnchor.y-self.anchorPoint.y); + + if (CGPointEqualToPoint(anchorDiff, CGPointMake(0.0f, 0.0f))) + { + return self.transform; + } + + AGKVector3D vec3D = AGKVector3DMake(self.bounds.size.width*anchorDiff.x, + self.bounds.size.height*anchorDiff.y, 0.0f); + vec3D = AGKVector3DApplyTransformWithNoTranslate(vec3D, self.transform); + + CATransform3D translation = CATransform3DMakeTranslation(vec3D.x-anchorDiff.x*self.bounds.size.width, + vec3D.y-anchorDiff.y*self.bounds.size.height, vec3D.z); + + return CATransform3DConcat(self.transform, translation); +} + +- (void)applyTransformToOffsetRotationWithVirtualAnchorPoint:(CGPoint)virtualAnchor +{ + CATransform3D translate = [self transformToOffsetRotationWithVirtualAnchorPoint:virtualAnchor]; + self.transform = CATransform3DConcat(self.transform, translate); +} + +- (CGPoint)offsetForXRotation:(CGFloat)angle virtualAnchorPoint:(CGPoint)virtualAnchor +{ + CGPoint anchorDiff = CGPointMake(virtualAnchor.x-self.anchorPoint.x, + self.anchorPoint.y-virtualAnchor.y); + + CGPoint t; + t.x = (self.bounds.size.height-self.bounds.size.height*cosf(angle))*anchorDiff.y; + t.y = -self.bounds.size.height*anchorDiff.y*sinf(angle); + + return t; +} + +- (CGPoint)offsetForYRotation:(CGFloat)angle virtualAnchorPoint:(CGPoint)virtualAnchor +{ + CGPoint anchorDiff = CGPointMake(virtualAnchor.x-self.anchorPoint.x, + self.anchorPoint.y-virtualAnchor.y); + + CGPoint t; + t.x = (self.bounds.size.width-self.bounds.size.width*cosf(angle))*anchorDiff.x; + t.y = -self.bounds.size.width*anchorDiff.x*sinf(angle); + + return t; +} + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Properties.h b/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Properties.h new file mode 100644 index 0000000..8c2b0a7 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Properties.h @@ -0,0 +1,62 @@ +// +// Authors: +// Håvard Fossli +// Marcus Eckert +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +@interface CALayer (AGK_Properties) + +@property (nonatomic, assign) CGSize frameSize; +@property (nonatomic, readonly) CGSize frameSizeHalf; +@property (nonatomic, readonly) CGFloat frameWidthHalf; +@property (nonatomic, readonly) CGFloat frameHeightHalf; + +@property (nonatomic, assign) CGPoint frameOrigin; +@property (nonatomic, assign) CGFloat frameMinX; +@property (nonatomic, assign) CGFloat frameMinY; +@property (nonatomic, assign) CGFloat frameMidX; +@property (nonatomic, assign) CGFloat frameMidY; +@property (nonatomic, assign) CGFloat frameMaxX; +@property (nonatomic, assign) CGFloat frameMaxY; +@property (nonatomic, assign) CGFloat frameWidth; +@property (nonatomic, assign) CGFloat frameHeight; + +@property (nonatomic, assign) CGPoint boundsOrigin; +@property (nonatomic, assign) CGSize boundsSize; +@property (nonatomic, assign) CGFloat boundsWidth; +@property (nonatomic, assign) CGFloat boundsHeight; + +@property (nonatomic, readonly) CGPoint boundsCenter; +@property (nonatomic, readonly) CGSize boundsSizeHalf; +@property (nonatomic, readonly) CGFloat boundsWidthHalf; +@property (nonatomic, readonly) CGFloat boundsHeightHalf; + +@property (nonatomic, assign) CGFloat positionX; +@property (nonatomic, assign) CGFloat positionY; + +@property (nonatomic, assign) CGFloat anchorPointX; +@property (nonatomic, assign) CGFloat anchorPointY; + +@end + diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Properties.m b/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Properties.m new file mode 100644 index 0000000..1e815e5 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGK+Properties.m @@ -0,0 +1,248 @@ +// +// Authors: +// Håvard Fossli +// Marcus Eckert +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "CALayer+AGK+Properties.h" +#import "CGGeometry+AGGeometryKit.h" +#import +#import "AGKVector3D.h" + +@implementation CALayer (AGK_Properties) + +- (CGSize)frameSize +{ + return self.frame.size; +} + +- (void)setFrameSize:(CGSize)value +{ + self.frame = CGRectWithSize_AGK(self.frame, value); +} + +- (CGFloat)frameWidth +{ + return self.frame.size.width; +} + +- (void)setFrameWidth:(CGFloat)value +{ + self.frame = CGRectWithWidth_AGK(self.frame, value); +} + +- (CGFloat)frameHeight +{ + return self.frame.size.height; +} + +- (void)setFrameHeight:(CGFloat)value +{ + self.frame = CGRectWithHeight_AGK(self.frame, value); +} + +- (CGSize)frameSizeHalf +{ + return CGSizeHalf_AGK(self.frameSize); +} + +- (CGFloat)frameHeightHalf +{ + return self.frameHeight / 2.0; +} + +- (CGFloat)frameWidthHalf +{ + return self.frameWidth / 2.0; +} + +- (CGPoint)frameOrigin +{ + return self.frame.origin; +} + +- (void)setFrameOrigin:(CGPoint)value +{ + self.frame = CGRectWithOrigin_AGK(self.frame, value); +} + +- (CGFloat)frameMinX +{ + return CGRectGetMinX(self.frame); +} + +- (void)setFrameMinX:(CGFloat)value +{ + self.frame = CGRectWithOriginMinX_AGK(self.frame, value); +} + +- (CGFloat)frameMinY +{ + return CGRectGetMinY(self.frame); +} + +- (void)setFrameMinY:(CGFloat)value +{ + self.frame = CGRectWithOriginMinY_AGK(self.frame, value); +} + +- (CGFloat)frameMidX +{ + return CGRectGetMidX(self.frame); +} + +- (void)setFrameMidX:(CGFloat)value +{ + self.frame = CGRectWithOriginMidX_AGK(self.frame, value); +} + +- (CGFloat)frameMidY +{ + return CGRectGetMidY(self.frame); +} + +- (void)setFrameMidY:(CGFloat)value +{ + self.frame = CGRectWithOriginMidY_AGK(self.frame, value); +} + +- (CGFloat)frameMaxX +{ + return CGRectGetMaxX(self.frame); +} + +- (void)setFrameMaxX:(CGFloat)value +{ + self.frame = CGRectWithOriginMaxX_AGK(self.frame, value); +} + +- (CGFloat)frameMaxY +{ + return CGRectGetMaxY(self.frame); +} + +- (void)setFrameMaxY:(CGFloat)value +{ + self.frame = CGRectWithOriginMaxY_AGK(self.frame, value); +} + +- (CGPoint)boundsOrigin +{ + return self.bounds.origin; +} + +- (void)setBoundsOrigin:(CGPoint)value +{ + self.bounds = CGRectWithOrigin_AGK(self.bounds, value); +} + +- (CGSize)boundsSize +{ + return self.bounds.size; +} + +- (void)setBoundsSize:(CGSize)value +{ + self.bounds = CGRectWithSize_AGK(self.bounds, value); +} + +- (CGFloat)boundsWidth +{ + return self.bounds.size.width; +} + +- (void)setBoundsWidth:(CGFloat)value +{ + self.bounds = CGRectWithWidth_AGK(self.bounds, value); +} + +- (CGFloat)boundsHeight +{ + return self.bounds.size.height; +} + +- (void)setBoundsHeight:(CGFloat)value +{ + self.bounds = CGRectWithHeight_AGK(self.bounds, value); +} + +- (CGFloat)boundsHeightHalf +{ + return self.boundsHeight / 2.0; +} + +- (CGFloat)boundsWidthHalf +{ + return self.boundsWidth / 2.0; +} + +- (CGSize)boundsSizeHalf +{ + return CGSizeHalf_AGK(self.boundsSize); +} + +- (CGPoint)boundsCenter +{ + return CGPointMake(self.boundsWidthHalf, self.boundsHeightHalf); +} + +- (CGFloat)positionX +{ + return self.position.x; +} + +- (void)setPositionX:(CGFloat)value +{ + self.position = CGPointMake(value, self.position.y); +} + +- (CGFloat)positionY +{ + return self.position.y; +} + +- (void)setPositionY:(CGFloat)value +{ + self.position = CGPointMake(self.position.x, value); +} + +- (CGFloat)anchorPointX +{ + return self.anchorPoint.x; +} + +- (void)setAnchorPointX:(CGFloat)value +{ + self.anchorPoint = CGPointMake(value, self.anchorPoint.y); +} + +- (CGFloat)anchorPointY +{ + return self.anchorPoint.y; +} + +- (void)setAnchorPointY:(CGFloat)value +{ + self.anchorPoint = CGPointMake(self.anchorPoint.x, value); +} + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGKQuad.h b/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGKQuad.h new file mode 100644 index 0000000..ebcedd1 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGKQuad.h @@ -0,0 +1,65 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import "AGKQuad.h" + +@interface CALayer (AGKQuad) + +/** + * @property AGKQuad quadrilateral + * Updating this property will update property 'transform' unless it is set to AGKQuadZero + * @abstract + * If transform is set to CATransform3DIdentity the quad returned will be similar to frame. + * @discussion + * It is only possible to make convex transforms with quadrilaterals. + * So make sure your quadrilateral is convex by using `AGKQuadIsValid` + * http://upload.wikimedia.org/wikipedia/commons/f/f1/Quadrilateral_hierarchy.png + */ +@property (nonatomic, assign) AGKQuad quadrilateral; + +- (AGKQuad)convertAGKQuad:(AGKQuad)quad fromLayer:(CALayer *)l; +- (AGKQuad)convertAGKQuad:(AGKQuad)quad toLayer:(CALayer *)l; + + +// These animation methods are provided since you can't just interpolate +// between the CATransform3D's generated by the quadrilaterals. + +- (void)animateFromQuadrilateral:(AGKQuad)quad1 + toQuadrilateral:(AGKQuad)quad2 + forNumberOfFrames:(NSUInteger)numberOfFrames + duration:(NSTimeInterval)duration + delay:(NSTimeInterval)delay + animKey:(NSString *)animKey + easeFunction:(double(^)(double p))progressFunction + onComplete:(void(^)(BOOL finished))onComplete; + +- (void)animateFromPresentedStateToQuadrilateral:(AGKQuad)quad + forNumberOfFrames:(NSUInteger)numberOfFrames + duration:(NSTimeInterval)duration + delay:(NSTimeInterval)delay + animKey:(NSString *)animKey + easeFunction:(double(^)(double p))progressFunction + onComplete:(void(^)(BOOL finished))onComplete; + +@end \ No newline at end of file diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGKQuad.m b/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGKQuad.m new file mode 100644 index 0000000..6c7ead9 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/CALayer+AGKQuad.m @@ -0,0 +1,177 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "CALayer+AGKQuad.h" +#import "AGKCALayerAnimationBlockDelegate.h" +#import "CALayer+AGK+Methods.h" + +@implementation CALayer (AGKQuad) + +- (AGKQuad)quadrilateral +{ + if(!CGPointEqualToPoint(self.anchorPoint, CGPointZero)) + { + [NSException raise:NSInternalInconsistencyException format:@"When reading quadrilateral value from CALayer the anchor point must be [0.0, 0.0]. You may for convenience use `-[CALayer ensureAnchorPointIsSetToZero]`"]; + } + AGKQuad q = [self convertAGKQuad:AGKQuadMakeWithCGSize(self.bounds.size) toLayer:self.superlayer]; + return q; +} + +- (void)setQuadrilateral:(AGKQuad)quadrilateral +{ + if(!AGKQuadEqual(quadrilateral, AGKQuadZero) && AGKQuadIsValid(quadrilateral)) + { + AGKQuad innerQuadrilateral = AGKQuadMove(quadrilateral, -self.position.x, -self.position.y); + CATransform3D t = CATransform3DWithAGKQuadFromBounds(innerQuadrilateral, self.bounds); + + [self ensureAnchorPointIsSetToZero]; + self.transform = t; + } +} + +- (AGKQuad)convertAGKQuad:(AGKQuad)quad fromLayer:(CALayer *)l +{ + AGKQuad q; + q.tl = [self convertPoint:quad.tl fromLayer:l]; + q.tr = [self convertPoint:quad.tr fromLayer:l]; + q.br = [self convertPoint:quad.br fromLayer:l]; + q.bl = [self convertPoint:quad.bl fromLayer:l]; + return q; +} + +- (AGKQuad)convertAGKQuad:(AGKQuad)quad toLayer:(CALayer *)layer +{ + AGKQuad q = quad; + q.tl = [self convertPoint:quad.tl toLayer:layer]; + q.tr = [self convertPoint:quad.tr toLayer:layer]; + q.br = [self convertPoint:quad.br toLayer:layer]; + q.bl = [self convertPoint:quad.bl toLayer:layer]; + return q; +} + +#pragma mark - Animation + ++ (CAKeyframeAnimation *)animationBetweenQuadrilateral:(AGKQuad)quad1 + andQuadrilateral:(AGKQuad)quad2 + layerSize:(CGSize)layerSize + layerPosition:(CGPoint)layerPosition + forNumberOfFrames:(NSUInteger)numberOfFrames + delay:(NSTimeInterval)delay + duration:(NSTimeInterval)duration + easeFunction:(double(^)(double p))progressFunction + onStart:(void(^)(void))onStart + onComplete:(void(^)(BOOL finished))onComplete +{ + CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; + animation.duration = duration; + animation.repeatCount = 1; + animation.removedOnCompletion = NO; + animation.fillMode = kCAFillModeForwards; + animation.beginTime = CACurrentMediaTime() + delay; + + NSMutableArray *values = [NSMutableArray arrayWithCapacity:numberOfFrames]; + + for(int i = 0; i < numberOfFrames; i++) + { + double p = progressFunction((double)i / (double)numberOfFrames); + AGKQuad quad = AGKQuadInterpolate(quad1, quad2, p); + AGKQuad innerQuad = AGKQuadMove(quad, -layerPosition.x, -layerPosition.y); + CATransform3D transform = CATransform3DWithAGKQuadFromBounds(innerQuad, (CGRect){CGPointZero, layerSize}); + NSValue *value = [NSValue valueWithCATransform3D:transform]; + [values addObject:value]; + } + + animation.values = values; + animation.delegate = [AGKCALayerAnimationBlockDelegate newWithAnimationDidStart:onStart didStop:onComplete]; + + return animation; +} + +- (void)animateFromQuadrilateral:(AGKQuad)quad1 + toQuadrilateral:(AGKQuad)quad2 + forNumberOfFrames:(NSUInteger)numberOfFrames + duration:(NSTimeInterval)duration + delay:(NSTimeInterval)delay + animKey:(NSString *)animKey + easeFunction:(double(^)(double p))progressFunction + onComplete:(void(^)(BOOL finished))onComplete +{ + if(!CGPointEqualToPoint(self.anchorPoint, CGPointZero)) + { + [NSException raise:NSInternalInconsistencyException format:@"Before using any quadrilaterals the layers anchorPoint property must be {0, 0}. You may use the category method -[CALayer ensureAnchorPointIsSetToZero]"]; + } + + [CATransaction begin]; + + __weak __typeof__(self) wself = self; + + CAKeyframeAnimation *anim = [[self class] animationBetweenQuadrilateral:quad1 + andQuadrilateral:quad2 + layerSize:self.bounds.size + layerPosition:self.position + forNumberOfFrames:numberOfFrames + delay:delay + duration:duration + easeFunction:progressFunction + onStart:^{ + wself.quadrilateral = quad2; + } onComplete:^(BOOL finished) { + if(finished) + { + [wself removeAnimationForKey:animKey]; + } + if(onComplete) + { + onComplete(finished); + } + }]; + + anim.removedOnCompletion = NO; + + [self addAnimation:anim forKey:animKey]; + + [CATransaction commit]; +} + +- (void)animateFromPresentedStateToQuadrilateral:(AGKQuad)quad + forNumberOfFrames:(NSUInteger)numberOfFrames + duration:(NSTimeInterval)duration + delay:(NSTimeInterval)delay + animKey:(NSString *)animKey + easeFunction:(double(^)(double p))progressFunction + onComplete:(void(^)(BOOL finished))onComplete +{ + AGKQuad currentQuad = [(CALayer *)[self presentationLayer] quadrilateral]; + + [self animateFromQuadrilateral:currentQuad + toQuadrilateral:quad + forNumberOfFrames:numberOfFrames + duration:duration + delay:delay + animKey:animKey + easeFunction:progressFunction + onComplete:onComplete]; +} + + +@end \ No newline at end of file diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/NSValue+AGKQuad.h b/Demo/Pods/AGGeometryKit/Source/Categories/NSValue+AGKQuad.h new file mode 100644 index 0000000..b98a3d2 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/NSValue+AGKQuad.h @@ -0,0 +1,33 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import "AGKQuad.h" + +@interface NSValue (AGKQuad) + ++ (NSValue *)valueWithAGKQuad:(AGKQuad)q; +- (AGKQuad)AGKQuadValue; + +@end + diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/NSValue+AGKQuad.m b/Demo/Pods/AGGeometryKit/Source/Categories/NSValue+AGKQuad.m new file mode 100644 index 0000000..d43ef2d --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/NSValue+AGKQuad.m @@ -0,0 +1,54 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "NSValue+AGKQuad.h" + +@implementation NSValue (AGKQuad) + ++ (NSValue *)valueWithAGKQuad:(AGKQuad)q +{ + CGFloat values[8]; + for(int i = 0; i < 4; i++) + { + CGPoint p = q.v[i]; + values[(i*2)] = p.x; + values[(i*2)+1] = p.y; + } + NSValue *value = [NSValue value:&q withObjCType:@encode(CGFloat[8])]; + return value; +} + +- (AGKQuad)AGKQuadValue +{ + AGKQuad q = AGKQuadZero; + CGFloat values[8]; + [self getValue:values]; + for(int i = 0; i < 4; i++) + { + CGPoint p = CGPointMake(values[(i*2)], values[(i*2)+1]); + q.v[i] = p; + } + return q; +} + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/UIBezierPath+AGKQuad.h b/Demo/Pods/AGGeometryKit/Source/Categories/UIBezierPath+AGKQuad.h new file mode 100644 index 0000000..d06b283 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/UIBezierPath+AGKQuad.h @@ -0,0 +1,31 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import "AGKQuad.h" + +@interface UIBezierPath (AGKQuad) + ++ (UIBezierPath *)bezierPathWithAGKQuad:(AGKQuad)q; + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/UIBezierPath+AGKQuad.m b/Demo/Pods/AGGeometryKit/Source/Categories/UIBezierPath+AGKQuad.m new file mode 100644 index 0000000..c3dd79c --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/UIBezierPath+AGKQuad.m @@ -0,0 +1,43 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "UIBezierPath+AGKQuad.h" + +@implementation UIBezierPath (AGKQuad) + ++ (UIBezierPath *)bezierPathWithAGKQuad:(AGKQuad)q +{ + UIBezierPath *path = [UIBezierPath bezierPath]; + [path moveToPoint:q.v[0]]; + + for (int i = 1; i < 4; i++) + { + [path addLineToPoint:q.v[i]]; + } + + [path closePath]; + + return path; +} + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGK+CATransform3D.h b/Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGK+CATransform3D.h new file mode 100644 index 0000000..887a940 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGK+CATransform3D.h @@ -0,0 +1,30 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +@interface UIImage (CATransform3D) + +- (UIImage *)imageWithTransform:(CATransform3D)transform anchorPoint:(CGPoint)anchorPoint; + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGK+CATransform3D.m b/Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGK+CATransform3D.m new file mode 100644 index 0000000..12ec413 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGK+CATransform3D.m @@ -0,0 +1,38 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import "UIImage+AGK+CATransform3D.h" +#import "CGImageRef+AGK+CATransform3D.h" + +@implementation UIImage (CATransform3D) + +- (UIImage *)imageWithTransform:(CATransform3D)transform anchorPoint:(CGPoint)anchorPoint +{ + CGImageRef imageRef = CGImageDrawWithCATransform3D_AGK(self.CGImage, transform, anchorPoint, self.size, self.scale); + UIImage* image = [UIImage imageWithCGImage:imageRef]; + CGImageRelease(imageRef); + return image; +} + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGKQuad.h b/Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGKQuad.h new file mode 100644 index 0000000..4df2de4 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGKQuad.h @@ -0,0 +1,32 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import "AGKQuad.h" +#import "UIImage+AGK+CATransform3D.h" + +@interface UIImage (AGKQuad) + +- (UIImage *)imageWithQuad:(AGKQuad)quad scale:(CGFloat)scale; + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGKQuad.m b/Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGKQuad.m new file mode 100644 index 0000000..483d684 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/UIImage+AGKQuad.m @@ -0,0 +1,43 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "UIImage+AGKQuad.h" +#import "pthread.h" +#import +#import "CGImageRef+AGK+CATransform3D.h" +#import "UIImage+AGK+CATransform3D.h" + +@implementation UIImage (AGKQuad) + +- (UIImage *)imageWithQuad:(AGKQuad)quad scale:(CGFloat)scale +{ + AGKQuad scaledQuad = AGKQuadApplyCATransform3D(quad, CATransform3DMakeScale(scale, scale, 1.0)); + CATransform3D transform = CATransform3DWithAGKQuadFromBounds(scaledQuad, (CGRect){CGPointZero, self.size}); + CGImageRef imageRef = CGImageDrawWithCATransform3D_AGK(self.CGImage, transform, CGPointZero, self.size, 1.0); + UIImage* image = [UIImage imageWithCGImage:imageRef]; + CGImageRelease(imageRef); + return image; +} + + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+AngleConverter.h b/Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+AngleConverter.h new file mode 100644 index 0000000..462a587 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+AngleConverter.h @@ -0,0 +1,31 @@ +// +// Author: Odd Magne Hågensen +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +@interface UIView (AngleConverter) + +- (CGFloat)convertAngle:(CGFloat)angle toView:(UIView *)view; +- (CGFloat)convertAngleOfViewInRelationToView:(UIView *)view; + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+AngleConverter.m b/Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+AngleConverter.m new file mode 100644 index 0000000..ef9d3c7 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+AngleConverter.m @@ -0,0 +1,60 @@ +// +// Author: Odd Magne Hågensen +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "UIView+AGK+AngleConverter.h" +#import "CGGeometry+AGGeometryKit.h" + +@implementation UIView (AngleConverter) + +- (CGFloat)convertAngle:(CGFloat)angle toView:(UIView *)view +{ + CGPoint p1n = CGPointMake(0, 0); + CGPoint p2n = CGPointMake(0, 1000); + + CGPoint p1r = [self convertPoint:p1n toView:view]; + CGPoint p2r = [self convertPoint:p2n toView:view]; + + CGPoint v1 = CGPointMake(p2n.x - p1n.x, p2n.y - p1n.y); + CGPoint v2 = CGPointMake(p2r.x - p1r.x, p2r.y - p1r.y); + + CGPoint v1Normalized = CGPointNormalize_AGK(v1); + CGPoint v2Normalized = CGPointNormalize_AGK(v2); + + CGFloat crossZ = CGPointCrossProductZComponent_AGK(v1Normalized, v2Normalized); + CGFloat cosAngleInRelation = CGPointDotProduct_AGK(v1Normalized, v2Normalized); + CGFloat angleInRelation = acosf(cosAngleInRelation) + angle; + + if (crossZ > 0.0f) + { + angleInRelation = -angleInRelation; + } + + return angleInRelation; +} + +- (CGFloat)convertAngleOfViewInRelationToView:(UIView *)view +{ + return [self convertAngle:0.0 toView:view]; +} + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+Properties.h b/Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+Properties.h new file mode 100644 index 0000000..289f8ae --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+Properties.h @@ -0,0 +1,56 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +@interface UIView (AGGeometryKit) + +@property (nonatomic, assign) CGSize frameSize; +@property (nonatomic, readonly) CGSize frameSizeHalf; +@property (nonatomic, readonly) CGFloat frameWidthHalf; +@property (nonatomic, readonly) CGFloat frameHeightHalf; + +@property (nonatomic, assign) CGPoint frameOrigin; +@property (nonatomic, assign) CGFloat frameMinX; +@property (nonatomic, assign) CGFloat frameMinY; +@property (nonatomic, assign) CGFloat frameMidX; +@property (nonatomic, assign) CGFloat frameMidY; +@property (nonatomic, assign) CGFloat frameMaxX; +@property (nonatomic, assign) CGFloat frameMaxY; +@property (nonatomic, assign) CGFloat frameWidth; +@property (nonatomic, assign) CGFloat frameHeight; + +@property (nonatomic, assign) CGPoint boundsOrigin; +@property (nonatomic, assign) CGSize boundsSize; +@property (nonatomic, assign) CGFloat boundsWidth; +@property (nonatomic, assign) CGFloat boundsHeight; + +@property (nonatomic, readonly) CGPoint boundsCenter; +@property (nonatomic, readonly) CGSize boundsSizeHalf; +@property (nonatomic, readonly) CGFloat boundsWidthHalf; +@property (nonatomic, readonly) CGFloat boundsHeightHalf; + +@property (nonatomic, assign) CGFloat centerX; +@property (nonatomic, assign) CGFloat centerY; + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+Properties.m b/Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+Properties.m new file mode 100644 index 0000000..2d96ead --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Categories/UIView+AGK+Properties.m @@ -0,0 +1,225 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "UIView+AGK+Properties.h" +#import "CGGeometry+AGGeometryKit.h" + + +@implementation UIView (AGGeometryKit) + +- (CGSize)frameSize +{ + return self.frame.size; +} + +- (void)setFrameSize:(CGSize)value +{ + self.frame = CGRectWithSize_AGK(self.frame, value); +} + +- (CGFloat)frameWidth +{ + return self.frame.size.width; +} + +- (void)setFrameWidth:(CGFloat)value +{ + self.frame = CGRectWithWidth_AGK(self.frame, value); +} + +- (CGFloat)frameHeight +{ + return self.frame.size.height; +} + +- (void)setFrameHeight:(CGFloat)value +{ + self.frame = CGRectWithHeight_AGK(self.frame, value); +} + +- (CGSize)frameSizeHalf +{ + return CGSizeHalf_AGK(self.frameSize); +} + +- (CGFloat)frameHeightHalf +{ + return self.frameHeight / 2.0; +} + +- (CGFloat)frameWidthHalf +{ + return self.frameWidth / 2.0; +} + +- (CGPoint)frameOrigin +{ + return self.frame.origin; +} + +- (void)setFrameOrigin:(CGPoint)value +{ + self.frame = CGRectWithOrigin_AGK(self.frame, value); +} + +- (CGFloat)frameMinX +{ + return CGRectGetMinX(self.frame); +} + +- (void)setFrameMinX:(CGFloat)value +{ + self.frame = CGRectWithOriginMinX_AGK(self.frame, value); +} + +- (CGFloat)frameMinY +{ + return CGRectGetMinY(self.frame); +} + +- (void)setFrameMinY:(CGFloat)value +{ + self.frame = CGRectWithOriginMinY_AGK(self.frame, value); +} + +- (CGFloat)frameMidX +{ + return CGRectGetMidX(self.frame); +} + +- (void)setFrameMidX:(CGFloat)value +{ + self.frame = CGRectWithOriginMidX_AGK(self.frame, value); +} + +- (CGFloat)frameMidY +{ + return CGRectGetMidY(self.frame); +} + +- (void)setFrameMidY:(CGFloat)value +{ + self.frame = CGRectWithOriginMidY_AGK(self.frame, value); +} + +- (CGFloat)frameMaxX +{ + return CGRectGetMaxX(self.frame); +} + +- (void)setFrameMaxX:(CGFloat)value +{ + self.frame = CGRectWithOriginMaxX_AGK(self.frame, value); +} + +- (CGFloat)frameMaxY +{ + return CGRectGetMaxY(self.frame); +} + +- (void)setFrameMaxY:(CGFloat)value +{ + self.frame = CGRectWithOriginMaxY_AGK(self.frame, value); +} + +- (CGPoint)boundsOrigin +{ + return self.bounds.origin; +} + +- (void)setBoundsOrigin:(CGPoint)value +{ + self.bounds = CGRectWithOrigin_AGK(self.bounds, value); +} + +- (CGSize)boundsSize +{ + return self.bounds.size; +} + +- (void)setBoundsSize:(CGSize)value +{ + self.bounds = CGRectWithSize_AGK(self.bounds, value); +} + +- (CGFloat)boundsWidth +{ + return self.bounds.size.width; +} + +- (void)setBoundsWidth:(CGFloat)value +{ + self.bounds = CGRectWithWidth_AGK(self.bounds, value); +} + +- (CGFloat)boundsHeight +{ + return self.bounds.size.height; +} + +- (void)setBoundsHeight:(CGFloat)newHeight +{ + self.bounds = CGRectWithHeight_AGK(self.bounds, newHeight); +} + +- (CGFloat)boundsHeightHalf +{ + return self.boundsHeight / 2.0; +} + +- (CGFloat)boundsWidthHalf +{ + return self.boundsWidth / 2.0; +} + +- (CGSize)boundsSizeHalf +{ + return CGSizeHalf_AGK(self.boundsSize); +} + +- (CGPoint)boundsCenter +{ + return CGPointMake(self.boundsWidthHalf, self.boundsHeightHalf); +} + +- (CGFloat)centerX +{ + return self.center.x; +} + +- (void)setCenterX:(CGFloat)newX +{ + self.center = CGPointMake(newX, self.center.y); +} + +- (CGFloat)centerY +{ + return self.center.y; +} + +- (void)setCenterY:(CGFloat)newY +{ + self.center = CGPointMake(self.center.x, newY); +} + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Classes/AGGeometryKitClasses.h b/Demo/Pods/AGGeometryKit/Source/Classes/AGGeometryKitClasses.h new file mode 100644 index 0000000..3922fc7 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Classes/AGGeometryKitClasses.h @@ -0,0 +1,25 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "AGKCALayerAnimationBlockDelegate.h" +#import "AGKTransformPixelMapper.h" diff --git a/Demo/Pods/AGGeometryKit/Source/Classes/AGKCALayerAnimationBlockDelegate.h b/Demo/Pods/AGGeometryKit/Source/Classes/AGKCALayerAnimationBlockDelegate.h new file mode 100644 index 0000000..e030e24 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Classes/AGKCALayerAnimationBlockDelegate.h @@ -0,0 +1,36 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import + +@interface AGKCALayerAnimationBlockDelegate : NSObject + +@property (nonatomic, copy) void (^onStart)(); +@property (nonatomic, copy) void (^onStop)(BOOL completed); +@property (nonatomic, assign) BOOL autoRemoveBlocks; // defaults to YES - will clear blocks after calling onAnimationDidStop + ++ (instancetype)newWithAnimationDidStart:(void(^)(void))onStart didStop:(void(^)(BOOL completed))onStop; ++ (instancetype)newWithAnimationDidStop:(void(^)(BOOL completed))onStop; + +@end \ No newline at end of file diff --git a/Demo/Pods/AGGeometryKit/Source/Classes/AGKCALayerAnimationBlockDelegate.m b/Demo/Pods/AGGeometryKit/Source/Classes/AGKCALayerAnimationBlockDelegate.m new file mode 100644 index 0000000..84be265 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Classes/AGKCALayerAnimationBlockDelegate.m @@ -0,0 +1,80 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "AGKCALayerAnimationBlockDelegate.h" + +@interface AGKCALayerAnimationBlockDelegate () +@end + +@implementation AGKCALayerAnimationBlockDelegate + ++ (instancetype)newWithAnimationDidStart:(void(^)(void))onStart didStop:(void(^)(BOOL completed))onStop +{ + AGKCALayerAnimationBlockDelegate *instance = [[self alloc] init]; + instance.onStart = onStart; + instance.onStop = onStop; + return instance; +} + ++ (instancetype)newWithAnimationDidStop:(void(^)(BOOL completed))onStop +{ + AGKCALayerAnimationBlockDelegate *instance = [[self alloc] init]; + instance.onStop = onStop; + return instance; +} + +- (id)init +{ + self = [super init]; + if(self) + { + _autoRemoveBlocks = YES; + } + return self; +} + +- (void)animationDidStart:(CAAnimation *)anim +{ + if(self.onStart) + { + self.onStart(); + } + if(self.autoRemoveBlocks) + { + self.onStart = nil; + } +} + +- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag +{ + if(self.onStop) + { + self.onStop(flag); + } + if(self.autoRemoveBlocks) + { + self.onStop = nil; + } +} + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Classes/AGKTransformPixelMapper.h b/Demo/Pods/AGGeometryKit/Source/Classes/AGKTransformPixelMapper.h new file mode 100755 index 0000000..32ca306 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Classes/AGKTransformPixelMapper.h @@ -0,0 +1,48 @@ +// +// Author: Håvard Fossli +// Author: Marcos Fuentes http://stackoverflow.com/users/1637195/marcos-fuentes +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import + +@interface AGKTransformPixelMapper : NSObject + +@property (nonatomic, assign, readonly) CATransform3D transform; +@property (nonatomic, assign, readonly) double denominatorX; +@property (nonatomic, assign, readonly) double denominatorY; +@property (nonatomic, assign, readonly) double denominatorW; + +- (id)initWithTransform:(CATransform3D)t anchorPoint:(CGPoint)anchorPoint; +- (CGPoint)projectedPointForModelPoint:(CGPoint)point; + +- (void)mapBitmap:(in unsigned char *)input + to:(out unsigned char *)output + inSize:(CGSize)inSize + outSize:(CGSize)outSize + scale:(double)scale + bytesPerPixel:(size_t)bytesPerPixel + bytesPerRow:(size_t)bytesPerRow; + +- (CGImageRef)createMappedImageRefFrom:(CGImageRef)imageRef scale:(double)scale CF_RETURNS_RETAINED; + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/Classes/AGKTransformPixelMapper.m b/Demo/Pods/AGGeometryKit/Source/Classes/AGKTransformPixelMapper.m new file mode 100755 index 0000000..e58ab22 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/Classes/AGKTransformPixelMapper.m @@ -0,0 +1,183 @@ +// +// Author: Håvard Fossli +// Author: Marcos Fuentes http://stackoverflow.com/users/1637195/marcos-fuentes +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "AGKTransformPixelMapper.h" +#import +#import "CGGeometry+AGGeometryKit.h" + +@interface AGKTransformPixelMapper () + +@property (nonatomic, assign, readwrite) CATransform3D transform; +@property (nonatomic, assign, readwrite) CGPoint anchorPoint; +@property (nonatomic, assign, readwrite) double denominatorX; +@property (nonatomic, assign, readwrite) double denominatorY; +@property (nonatomic, assign, readwrite) double denominatorW; + +@end + + +// Code and algorithms derives from http://stackoverflow.com/a/13850972/202451 + +@implementation AGKTransformPixelMapper + +- (id)initWithTransform:(CATransform3D)t anchorPoint:(CGPoint)anchorPoint +{ + self = [self init]; + if(self) + { + + self.denominatorX = t.m12 * t.m21 - t.m11 * t.m22 + t.m14 * t.m22 * t.m41 - t.m12 * t.m24 * t.m41 - t.m14 * t.m21 * t.m42 + + t.m11 * t.m24 * t.m42; + + self.denominatorY = -t.m12 *t.m21 + t.m11 *t.m22 - t.m14 *t.m22 *t.m41 + t.m12 *t.m24 *t.m41 + t.m14 *t.m21 *t.m42 - + t.m11* t.m24 *t.m42; + + self.denominatorW = t.m12 *t.m21 - t.m11 *t.m22 + t.m14 *t.m22 *t.m41 - t.m12 *t.m24 *t.m41 - t.m14 *t.m21 *t.m42 + + t.m11 *t.m24 *t.m42; + + self.transform = t; + self.anchorPoint = anchorPoint; + } + return self; +} + +- (CGPoint)projectedPointForModelPoint:(CGPoint)point +{ + CATransform3D t = self.transform; + double x = point.x; + double y = point.y; + + double xp = (t.m22 *t.m41 - t.m21 *t.m42 - t.m22* x + t.m24 *t.m42 *x + t.m21* y - t.m24* t.m41* y) / self.denominatorX; + double yp = (-t.m11 *t.m42 + t.m12 * (t.m41 - x) + t.m14 *t.m42 *x + t.m11 *y - t.m14 *t.m41* y) / self.denominatorY; + double wp = (t.m12 *t.m21 - t.m11 *t.m22 + t.m14*t.m22* x - t.m12 *t.m24* x - t.m14 *t.m21* y + t.m11 *t.m24 *y) / self.denominatorW; + + CGPoint result = CGPointMake(xp/wp, yp/wp); + return result; +} + +- (void)mapBitmap:(in unsigned char *)input + to:(out unsigned char *)output + inSize:(CGSize)inSize + outSize:(CGSize)outSize + scale:(double)scale + bytesPerPixel:(size_t)bytesPerPixel + bytesPerRow:(size_t)bytesPerRow; +{ + int width = inSize.width; + int height = inSize.height; + + size_t bytesInTotal = height * bytesPerRow; + + for (size_t y = 0 ; y < height ; ++y) + for (size_t x = 0 ; x < width ; ++x) + { + size_t indexOutput = bytesPerPixel * x + bytesPerRow * y; + + CGPoint modelPoint = CGPointMake((x*2.0/scale - outSize.width/scale)/2.0, + (y*2.0/scale - outSize.height/scale)/2.0); + + CGPoint p = [self projectedPointForModelPoint:modelPoint]; + p.x *= scale; + p.y *= scale; + + size_t indexInput = bytesPerPixel*(size_t)p.x + (bytesPerRow*(size_t)p.y); + BOOL isOutOfBounds = p.x >= width || p.x < 0 || p.y >= height || p.y < 0 || indexInput > bytesInTotal; + + if (isOutOfBounds) + { + for(size_t j = 0; j < bytesPerPixel; j++) + { + output[indexOutput+j] = 0; + } + } + else + { + for(size_t j = 0; j < bytesPerPixel; j++) + { + output[indexOutput+j] = input[indexInput+j]; + } + } + } +} + +- (CGImageRef)createMappedImageRefFrom:(CGImageRef)imageRef scale:(double)scale +{ + size_t width = CGImageGetWidth(imageRef); + size_t height = CGImageGetHeight(imageRef); + + size_t bitsPerComponent = 8; + size_t bytesPerPixel = 4; + size_t bytesPerRow = CGImageGetBytesPerRow(imageRef); + size_t bytesInTotal = height * bytesPerRow; + + unsigned char *inputData = malloc(bytesInTotal); + unsigned char *outputData = malloc(bytesInTotal); + + // in case not every bit is drawn into outputData (this is necessary) + for (int ii = 0 ; ii < bytesInTotal; ++ii) + { + outputData[ii] = 0; + inputData[ii] = 0; + } + + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGContextRef context = CGBitmapContextCreate(inputData, + width, + height, + bitsPerComponent, + bytesPerRow, + colorSpace, + kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); + CGColorSpaceRelease(colorSpace); + CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); + CGContextRelease(context); + + [self mapBitmap:inputData + to:outputData + inSize:CGSizeMake(width, height) + outSize:CGSizeMake(width, height) + scale:scale + bytesPerPixel:bytesPerPixel + bytesPerRow:bytesPerRow]; + + CGContextRef ctx; + ctx = CGBitmapContextCreate(outputData, + width, + height, + bitsPerComponent, + CGImageGetBytesPerRow(imageRef), + CGImageGetColorSpace(imageRef), + (CGBitmapInfo) kCGImageAlphaPremultipliedLast + ); + + imageRef = CGBitmapContextCreateImage(ctx); + + CGContextRelease(ctx); + free(inputData); + free(outputData); + + return imageRef; +} + +@end diff --git a/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/AGGeometryKitCoreGraphics.h b/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/AGGeometryKitCoreGraphics.h new file mode 100644 index 0000000..0a052ef --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/AGGeometryKitCoreGraphics.h @@ -0,0 +1,25 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "CGGeometry+AGGeometryKit.h" +#import "CGImageRef+AGK+CATransform3D.h" diff --git a/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.h b/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.h new file mode 100644 index 0000000..4c19680 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.h @@ -0,0 +1,102 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import +#import + +// CGPoint + +BOOL CGPointGotAnyNanValues_AGK(CGPoint origin); +CGPoint CGPointModified_AGK(CGPoint point, CGPoint (^block)(CGPoint point)); + +CGPoint CGPointAdd_AGK(CGPoint p1, CGPoint p2); +CGPoint CGPointAddSize_AGK(CGPoint p, CGSize s); +CGPoint CGPointSubtract_AGK(CGPoint p1, CGPoint p2); +CGPoint CGPointMultiply_AGK(CGPoint p1, CGFloat factor); +CGPoint CGPointDivide_AGK(CGPoint p1, CGFloat factor); +CGPoint CGPointNormalize_AGK(CGPoint v); +CGFloat CGPointDotProduct_AGK(CGPoint p1, CGPoint p2); +CGFloat CGPointCrossProductZComponent_AGK(CGPoint v1, CGPoint v2); +CGFloat CGPointLength_AGK(CGPoint v); +CGFloat CGPointLengthBetween_AGK(CGPoint p1, CGPoint p2); + +CGPoint CGPointApplyCATransform3D_AGK(CGPoint point, + CATransform3D transform, + CGPoint anchorPoint, + CATransform3D parentSublayerTransform); + +CGPoint CGPointRotate_AGK(CGPoint point, CGFloat angle); +CGPoint CGPointRotateAroundOrigin_AGK(CGPoint point, CGFloat angle, CGPoint origin); +CGPoint CGPointRotate90DegreesCW_AGK(CGPoint point); +CGPoint CGPointRotate90DegreesCWAroundPoint_AGK(CGPoint point, CGPoint origin); +CGPoint CGPointRotate90DegreesCC_AGK(CGPoint point); +CGPoint CGPointRotate90DegreesCCAroundPoint_AGK(CGPoint point, CGPoint origin); + +CGPoint CGPointConvertFromAnchorPoint_AGK(CGPoint anchor, CGRect rect); +CGPoint CGPointConvertToAnchorPoint_AGK(CGPoint point, CGRect rect); + +CGPoint CGPointInterpolate_AGK(CGPoint point1, CGPoint point2, CGFloat progress); +CGPoint CGPointClamp_AGK(CGPoint p, CGFloat minX, CGFloat maxX, CGFloat minY, CGFloat maxY); + + +// CGSize + +BOOL CGSizeGotAnyNanValues_AGK(CGSize size); +CGSize CGSizeModified_AGK(CGSize size, CGSize (^block)(CGSize size)); + +CGSize CGSizeHalf_AGK(CGSize size); +CGSize CGSizeSwitchAxis_AGK(CGSize size); +double CGSizeAspectRatio_AGK(CGSize size); +CGSize CGSizeAdjustOuterSizeToFitInnerSize_AGK(CGSize outer, CGSize inner); +BOOL CGSizeAspectIsWiderThanCGSize_AGK(CGSize size1, CGSize size2); +CGFloat CGSizeScalarToAspectFit_AGK(CGSize sizeToFit, CGSize container); +CGFloat CGSizeScalarToAspectFill_AGK(CGSize sizeToFill, CGSize container); + +CGSize CGSizeInterpolate_AGK(CGSize size1, CGSize size2, CGFloat progress); +CGSize CGSizeClamp_AGK(CGSize s, CGFloat minWidth, CGFloat maxWidth, CGFloat minHeight, CGFloat maxHeight); + + +// CGRect + +BOOL CGRectGotAnyNanValues_AGK(CGRect rect); +CGRect CGRectModified_AGK(CGRect rect, CGRect (^block)(CGRect rect)); +CGSize CGRectGapBetween_AGK(CGRect rect1, CGRect rect2); +CGPoint CGRectGetMid_AGK(CGRect rect); + +CGRect CGRectSmallestWithCGPoints_AGK(CGPoint pointsArray[], int numberOfPoints); +CGRect CGRectMakeWithSize_AGK(CGSize size); +CGRect CGRectWithSize_AGK(CGRect rect, CGSize newSize); +CGRect CGRectWithWidth_AGK(CGRect rect, CGFloat newWidth); +CGRect CGRectWithHeight_AGK(CGRect rect, CGFloat newHeight); +CGRect CGRectWithOrigin_AGK(CGRect rect, CGPoint origin); +CGRect CGRectWithOriginMinX_AGK(CGRect rect, CGFloat value); +CGRect CGRectWithOriginMinY_AGK(CGRect rect, CGFloat value); +CGRect CGRectWithOriginMaxY_AGK(CGRect rect, CGFloat value); +CGRect CGRectWithOriginMaxX_AGK(CGRect rect, CGFloat value); +CGRect CGRectWithOriginMidX_AGK(CGRect rect, CGFloat value); +CGRect CGRectWithOriginMidY_AGK(CGRect rect, CGFloat value); +CGRect CGRectWithOriginMid_AGK(CGRect rect, CGPoint origin); + +CGRect CGRectInterpolate_AGK(CGRect rect1, CGRect rect2, CGFloat progress); + diff --git a/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.m b/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.m new file mode 100644 index 0000000..d3c44c2 --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.m @@ -0,0 +1,447 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "CGGeometry+AGGeometryKit.h" +#import +#import "GLKit/GLKMatrix3.h" +#import "GLKit/GLKVector3.h" +#import "AGKMath.h" +#import "pthread.h" + +// Usefull resources for further development: +// http://processingjs.nihongoresources.com/bezierinfo/ + +#pragma mark - CGPoint + +BOOL CGPointGotAnyNanValues_AGK(CGPoint origin) +{ + // which is better 'a == NAN' or 'a != a'? + return origin.x == NAN || origin.y == NAN; +} + +CGPoint CGPointModified_AGK(CGPoint point, CGPoint (^block)(CGPoint point)) +{ + return block(point); +} + +CGPoint CGPointAdd_AGK(CGPoint p1, CGPoint p2) +{ + return (CGPoint){p1.x + p2.x, p1.y + p2.y}; +} + +CGPoint CGPointAddSize_AGK(CGPoint p, CGSize s) +{ + return CGPointMake(p.x + s.width, p.y + s.height); +} + +CGPoint CGPointSubtract_AGK(CGPoint p1, CGPoint p2) +{ + return (CGPoint){p1.x - p2.x, p1.y - p2.y}; +} + +CGPoint CGPointMultiply_AGK(CGPoint p1, CGFloat factor) +{ + return (CGPoint){p1.x * factor, p1.y * factor}; +} + +CGPoint CGPointDivide_AGK(CGPoint p1, CGFloat factor) +{ + return (CGPoint){p1.x / factor, p1.y / factor}; +} + +CGPoint CGPointNormalize_AGK(CGPoint v) +{ + CGFloat length = CGPointLength_AGK(v); + if(length != 0.0) + { + v.x /= length; + v.y /= length; + } + return v; +} + +CGFloat CGPointDotProduct_AGK(CGPoint p1, CGPoint p2) +{ + return (p1.x * p2.x) + (p1.y * p2.y); +} + +CGFloat CGPointCrossProductZComponent_AGK(CGPoint v1, CGPoint v2) +{ + return v1.x * v2.y - v1.y * v2.x; +} + +CGFloat CGPointLength_AGK(CGPoint v) +{ + return sqrtf(v.x * v.x + v.y * v.y); +} + +CGFloat CGPointLengthBetween_AGK(CGPoint p1, CGPoint p2) +{ + CGPoint p = CGPointMake(p2.x - p1.x, p2.y - p1.y); + return sqrtf(powf(p.x, 2.0f) + powf(p.y, 2.0f)); +} + +CGPoint CGPointApplyCATransform3D_AGK(CGPoint point, + CATransform3D transform, + CGPoint anchorPoint, + CATransform3D parentSublayerTransform) +{ + // http://stackoverflow.com/a/15328910/202451 + + static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; + static CALayer *sublayer, *layer; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sublayer = [CALayer layer]; + layer = [CALayer layer]; + [layer addSublayer:sublayer]; + }); + + if(pthread_mutex_lock(&mtx)) + { + [NSException raise:NSInternalInconsistencyException format:@"pthread_mutex_lock failed"]; + } + + layer.sublayerTransform = parentSublayerTransform; + sublayer.transform = transform; + sublayer.anchorPoint = anchorPoint; + CGPoint retval = [sublayer convertPoint:point toLayer:layer]; + + if(pthread_mutex_unlock(&mtx) != 0) + { + [NSException raise:NSInternalInconsistencyException format:@"pthread_mutex_unlock failed"]; + } + + return retval; +} + +CGPoint CGPointRotate_AGK(CGPoint point, CGFloat angle) +{ + return CGPointRotateAroundOrigin_AGK(point, angle, CGPointZero); +} + +CGPoint CGPointRotateAroundOrigin_AGK(CGPoint point, CGFloat angle, CGPoint origin) +{ + point = CGPointSubtract_AGK(point, origin); + + CGFloat cosa = cosf(angle); + CGFloat sina = sinf(angle); + + CGPoint r; + r.x = point.x*cosa - point.y*sina; + r.y = point.x*sina + point.y*cosa; + + return CGPointAdd_AGK(r, origin); +} + +CGPoint CGPointRotate90DegreesCW_AGK(CGPoint point) +{ + return CGPointRotate90DegreesCWAroundPoint_AGK(point, CGPointZero); +} + +CGPoint CGPointRotate90DegreesCWAroundPoint_AGK(CGPoint point, CGPoint origin) +{ + point = CGPointSubtract_AGK(point, origin); + point = CGPointMake(point.y, -point.x); + return CGPointAdd_AGK(point, origin); +} + +CGPoint CGPointRotate90DegreesCC_AGK(CGPoint point) +{ + return CGPointRotate90DegreesCCAroundPoint_AGK(point, CGPointZero); +} + +CGPoint CGPointRotate90DegreesCCAroundPoint_AGK(CGPoint point, CGPoint origin) +{ + point = CGPointSubtract_AGK(point, origin); + point = CGPointMake(-point.y, point.x); + return CGPointAdd_AGK(point, origin); +} + +CGPoint CGPointConvertFromAnchorPoint_AGK(CGPoint anchor, CGRect rect) +{ + CGPoint point; + point.x = (anchor.x * rect.size.width) + rect.origin.x; + point.y = (anchor.y * rect.size.height) + rect.origin.y; + return point; +} + +CGPoint CGPointConvertToAnchorPoint_AGK(CGPoint point, CGRect rect) +{ + CGPoint anchor = CGPointZero; + CGPoint minPoint = CGPointMake(CGRectGetMinX(rect), CGRectGetMinY(rect)); + anchor.x = ((point.x - minPoint.x) / rect.size.width); + anchor.y = ((point.y - minPoint.y) / rect.size.height); + return anchor; +} + +CGPoint CGPointInterpolate_AGK(CGPoint point1, CGPoint point2, CGFloat progress) +{ + CGPoint result; + result.x = AGKInterpolate(point1.x, point2.x, progress); + result.y = AGKInterpolate(point1.y, point2.y, progress); + return result; +} + +CGPoint CGPointClamp_AGK(CGPoint p, CGFloat minX, CGFloat maxX, CGFloat minY, CGFloat maxY) +{ + CGPoint result; + result.x = AGKClamp(p.x, minX, maxX); + result.y = AGKClamp(p.y, minY, maxY); + return result; +} + + + + + +#pragma mark - +#pragma mark CGSize + +BOOL CGSizeGotAnyNanValues_AGK(CGSize size) +{ + // which is better 'a == NAN' or 'a != a'? + return size.width == NAN || size.height == NAN; +} + +CGSize CGSizeModified_AGK(CGSize size, CGSize (^block)(CGSize size)) +{ + return block(size); +} + +CGSize CGSizeHalf_AGK(CGSize size) +{ + return CGSizeMake(size.width / 2.0, size.height / 2.0); +} + +CGSize CGSizeSwitchAxis_AGK(CGSize size) +{ + return CGSizeMake(size.height, size.width); +} + +double CGSizeAspectRatio_AGK(CGSize size) +{ + return size.width / size.height; +} + +CGSize CGSizeAdjustOuterSizeToFitInnerSize_AGK(CGSize outer, CGSize inner) +{ + double outerAspect = outer.width / outer.height; + double innerAspect = inner.width / inner.height; + + if(outerAspect > innerAspect) // outer is wider + { + return CGSizeMake(inner.height * outerAspect, inner.height); + } + else // outer is thinner + { + return CGSizeMake(inner.width, inner.width * outerAspect); + } +} + +BOOL CGSizeAspectIsWiderThanCGSize_AGK(CGSize size1, CGSize size2) +{ + double aspect1 = CGSizeAspectRatio_AGK(size1); + double aspect2 = CGSizeAspectRatio_AGK(size2); + return aspect1 > aspect2; +} + +CGFloat CGSizeScalarToAspectFit_AGK(CGSize sizeToFit, CGSize container) +{ + CGSize sizeMultiplier = CGSizeMake(sizeToFit.width / container.width, + sizeToFit.height / container.height); + + return sizeMultiplier.width < sizeMultiplier.height ? sizeMultiplier.width : sizeMultiplier.height; +} + +CGFloat CGSizeScalarToAspectFill_AGK(CGSize sizeToFill, CGSize container) +{ + CGSize sizeMultiplier = CGSizeMake(sizeToFill.width / container.width, + sizeToFill.height / container.height); + + return sizeMultiplier.width > sizeMultiplier.height ? sizeMultiplier.width : sizeMultiplier.height; +} + +CGSize CGSizeInterpolate_AGK(CGSize size1, CGSize size2, CGFloat progress) +{ + CGSize result; + result.width = AGKInterpolate(size1.width, size2.width, progress); + result.height = AGKInterpolate(size1.height, size2.height, progress); + return result; +} + +CGSize CGSizeClamp_AGK(CGSize s, CGFloat minWidth, CGFloat maxWidth, CGFloat minHeight, CGFloat maxHeight) +{ + CGSize result; + result.width = AGKClamp(s.width, minWidth, maxWidth); + result.height = AGKClamp(s.height, minHeight, maxHeight); + return result; +} + + + + +#pragma mark - +#pragma mark CGRect + +BOOL CGRectGotAnyNanValues_AGK(CGRect rect) +{ + return CGSizeGotAnyNanValues_AGK(rect.size) || CGPointGotAnyNanValues_AGK(rect.origin); +} + +CGRect CGRectModified_AGK(CGRect rect, CGRect (^block)(CGRect rect)) +{ + return block(rect); +} + +CGSize CGRectGapBetween_AGK(CGRect rect1, CGRect rect2) +{ + if (CGRectIntersectsRect(rect1, rect2)) + { + return CGSizeMake(0, 0); + } + + CGRect mostLeft = rect1.origin.x < rect2.origin.x ? rect1 : rect2; + CGRect mostRight = rect2.origin.x < rect1.origin.x ? rect1 : rect2; + + CGFloat xDifference = mostLeft.origin.x == mostRight.origin.x ? 0 : mostRight.origin.x - (mostLeft.origin.x + mostLeft.size.width); + xDifference = MAX(0, xDifference); + + CGRect upper = rect1.origin.y < rect2.origin.y ? rect1 : rect2; + CGRect lower = rect2.origin.y < rect1.origin.y ? rect1 : rect2; + + CGFloat yDifference = upper.origin.y == lower.origin.y ? 0 : lower.origin.y - (upper.origin.y + upper.size.height); + yDifference = MAX(0, yDifference); + + return CGSizeMake(xDifference, yDifference); +} + +CGPoint CGRectGetMid_AGK(CGRect rect) +{ + return CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect)); +} + +CGRect CGRectSmallestWithCGPoints_AGK(CGPoint pointsArray[], int numberOfPoints) +{ + double greatestXValue = pointsArray[0].x; + double greatestYValue = pointsArray[0].y; + double smallestXValue = pointsArray[0].x; + double smallestYValue = pointsArray[0].y; + + for(int i = 1; i < numberOfPoints; i++) + { + CGPoint point = pointsArray[i]; + greatestXValue = MAX(greatestXValue, point.x); + greatestYValue = MAX(greatestYValue, point.y); + smallestXValue = MIN(smallestXValue, point.x); + smallestYValue = MIN(smallestYValue, point.y); + } + + CGRect rect; + rect.origin = CGPointMake(smallestXValue, smallestYValue); + rect.size.width = greatestXValue - smallestXValue; + rect.size.height = greatestYValue - smallestYValue; + + return rect; +} + +CGRect CGRectMakeWithSize_AGK(CGSize size) +{ + return (CGRect){CGPointZero, size}; +} + +CGRect CGRectWithSize_AGK(CGRect rect, CGSize newSize) +{ + rect.size = newSize; + return rect; +} + +CGRect CGRectWithWidth_AGK(CGRect rect, CGFloat newWidth) +{ + rect.size.width = newWidth; + return rect; +} + +CGRect CGRectWithHeight_AGK(CGRect rect, CGFloat newHeight) +{ + rect.size.height = newHeight; + return rect; +} + +CGRect CGRectWithOrigin_AGK(CGRect rect, CGPoint origin) +{ + rect.origin = origin; + return rect; +} + +CGRect CGRectWithOriginMinX_AGK(CGRect rect, CGFloat value) +{ + rect.origin.x = value; + return rect; +} + +CGRect CGRectWithOriginMinY_AGK(CGRect rect, CGFloat value) +{ + rect.origin.y = value; + return rect; +} + +CGRect CGRectWithOriginMaxY_AGK(CGRect rect, CGFloat value) +{ + rect.origin.y = value - rect.size.height; + return rect; +} + +CGRect CGRectWithOriginMaxX_AGK(CGRect rect, CGFloat value) +{ + rect.origin.x = value - rect.size.width; + return rect; +} + +CGRect CGRectWithOriginMidX_AGK(CGRect rect, CGFloat value) +{ + rect.origin.x = value - (rect.size.width / 2.0); + return rect; +} + +CGRect CGRectWithOriginMidY_AGK(CGRect rect, CGFloat value) +{ + rect.origin.y = value - (rect.size.height / 2.0); + return rect; +} + +CGRect CGRectWithOriginMid_AGK(CGRect rect, CGPoint origin) +{ + rect.origin.x = origin.x - (rect.size.width / 2.0); + rect.origin.y = origin.y - (rect.size.height / 2.0); + return rect; +} + +CGRect CGRectInterpolate_AGK(CGRect rect1, CGRect rect2, CGFloat progress) +{ + CGRect result; + result.origin = CGPointInterpolate_AGK(rect1.origin, rect2.origin, progress); + result.size = CGSizeInterpolate_AGK(rect1.size, rect2.size, progress); + return result; +} + diff --git a/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.h b/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.h new file mode 100644 index 0000000..cc813df --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.h @@ -0,0 +1,30 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +CGImageRef CGImageDrawWithCATransform3D_AGK(CGImageRef imageRef, + CATransform3D transform, + CGPoint anchorPoint, + CGSize size, + CGFloat scale) CF_RETURNS_RETAINED; \ No newline at end of file diff --git a/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.m b/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.m new file mode 100644 index 0000000..7a41d3b --- /dev/null +++ b/Demo/Pods/AGGeometryKit/Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.m @@ -0,0 +1,52 @@ +// +// Author: Håvard Fossli +// +// Copyright (c) 2013 Agens AS (http://agens.no/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import "CGImageRef+AGK+CATransform3D.h" +#import "AGKTransformPixelMapper.h" + +// Refactored and improved upon this answer +// http://stackoverflow.com/a/13850972/202451 + +CGImageRef CGImageDrawWithCATransform3D_AGK(CGImageRef imageRef, + CATransform3D transform, + CGPoint anchorPoint, + CGSize size, + CGFloat scale) +{ + CATransform3D translateDueToAnchor = CATransform3DMakeTranslation(size.width * (-anchorPoint.x), + size.height * (-anchorPoint.y), + 0); + + CATransform3D translateDueToDisposition = CATransform3DMakeTranslation(size.width * (-0.5 + anchorPoint.x), + size.height * (-0.5 + anchorPoint.y), + 0); + + transform = CATransform3DConcat(translateDueToAnchor, transform); + transform = CATransform3DConcat(transform, translateDueToDisposition); + + AGKTransformPixelMapper *mapper = [[AGKTransformPixelMapper alloc] initWithTransform:transform anchorPoint:anchorPoint]; + CGImageRef newImageRef = [mapper createMappedImageRefFrom:imageRef scale:scale]; + + return newImageRef; +} \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKit.h b/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKit.h index 87605df..7689902 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKit.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKit.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGGeometryKit.h \ No newline at end of file +../../AGGeometryKit/Source/AGGeometryKit.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKitCategories.h b/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKitCategories.h index ef2ec0b..5f89ff7 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKitCategories.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKitCategories.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/AGGeometryKitCategories.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/AGGeometryKitCategories.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKitClasses.h b/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKitClasses.h index 63b2829..f275bea 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKitClasses.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKitClasses.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Classes/AGGeometryKitClasses.h \ No newline at end of file +../../AGGeometryKit/Source/Classes/AGGeometryKitClasses.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKitCoreGraphics.h b/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKitCoreGraphics.h index 17dcf8c..4142795 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKitCoreGraphics.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/AGGeometryKitCoreGraphics.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/CoreGraphics_Extensions/AGGeometryKitCoreGraphics.h \ No newline at end of file +../../AGGeometryKit/Source/CoreGraphics_Extensions/AGGeometryKitCoreGraphics.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKBitOperations.h b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKBitOperations.h index dbb4b7a..63d4a69 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKBitOperations.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKBitOperations.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGKBitOperations.h \ No newline at end of file +../../AGGeometryKit/Source/AGKBitOperations.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKCALayerAnimationBlockDelegate.h b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKCALayerAnimationBlockDelegate.h index e94f543..7483293 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKCALayerAnimationBlockDelegate.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKCALayerAnimationBlockDelegate.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Classes/AGKCALayerAnimationBlockDelegate.h \ No newline at end of file +../../AGGeometryKit/Source/Classes/AGKCALayerAnimationBlockDelegate.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKCorner.h b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKCorner.h index 7c0ca56..8a8ecd1 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKCorner.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKCorner.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGKCorner.h \ No newline at end of file +../../AGGeometryKit/Source/AGKCorner.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKLine.h b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKLine.h index 37beed1..0886310 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKLine.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKLine.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGKLine.h \ No newline at end of file +../../AGGeometryKit/Source/AGKLine.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKMath.h b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKMath.h index b5f870b..ff06730 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKMath.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKMath.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGKMath.h \ No newline at end of file +../../AGGeometryKit/Source/AGKMath.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKQuad.h b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKQuad.h index 0f6ab81..52697fe 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKQuad.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKQuad.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGKQuad.h \ No newline at end of file +../../AGGeometryKit/Source/AGKQuad.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKTransformPixelMapper.h b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKTransformPixelMapper.h index 0643f26..187616a 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKTransformPixelMapper.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKTransformPixelMapper.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Classes/AGKTransformPixelMapper.h \ No newline at end of file +../../AGGeometryKit/Source/Classes/AGKTransformPixelMapper.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKVector3D.h b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKVector3D.h index 8e8d4b0..9720b01 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/AGKVector3D.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/AGKVector3D.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGKVector3D.h \ No newline at end of file +../../AGGeometryKit/Source/AGKVector3D.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/CALayer+AGK+Methods.h b/Demo/Pods/BuildHeaders/AGGeometryKit/CALayer+AGK+Methods.h index 9f763b8..56bdbfb 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/CALayer+AGK+Methods.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/CALayer+AGK+Methods.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/CALayer+AGK+Methods.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/CALayer+AGK+Methods.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/CALayer+AGK+Properties.h b/Demo/Pods/BuildHeaders/AGGeometryKit/CALayer+AGK+Properties.h index 36d2fcc..5f5b313 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/CALayer+AGK+Properties.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/CALayer+AGK+Properties.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/CALayer+AGK+Properties.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/CALayer+AGK+Properties.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/CALayer+AGKQuad.h b/Demo/Pods/BuildHeaders/AGGeometryKit/CALayer+AGKQuad.h index 51ff8ac..e09df2e 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/CALayer+AGKQuad.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/CALayer+AGKQuad.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/CALayer+AGKQuad.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/CALayer+AGKQuad.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/CGGeometry+AGGeometryKit.h b/Demo/Pods/BuildHeaders/AGGeometryKit/CGGeometry+AGGeometryKit.h index ffd6229..1e8ca8c 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/CGGeometry+AGGeometryKit.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/CGGeometry+AGGeometryKit.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.h \ No newline at end of file +../../AGGeometryKit/Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/CGImageRef+AGK+CATransform3D.h b/Demo/Pods/BuildHeaders/AGGeometryKit/CGImageRef+AGK+CATransform3D.h index 760f8bb..fdc5e00 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/CGImageRef+AGK+CATransform3D.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/CGImageRef+AGK+CATransform3D.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.h \ No newline at end of file +../../AGGeometryKit/Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/NSValue+AGKQuad.h b/Demo/Pods/BuildHeaders/AGGeometryKit/NSValue+AGKQuad.h index 68cf36d..39a3498 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/NSValue+AGKQuad.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/NSValue+AGKQuad.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/NSValue+AGKQuad.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/NSValue+AGKQuad.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/UIBezierPath+AGKQuad.h b/Demo/Pods/BuildHeaders/AGGeometryKit/UIBezierPath+AGKQuad.h index dd66bf7..c0ee74d 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/UIBezierPath+AGKQuad.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/UIBezierPath+AGKQuad.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/UIBezierPath+AGKQuad.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/UIBezierPath+AGKQuad.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/UIImage+AGK+CATransform3D.h b/Demo/Pods/BuildHeaders/AGGeometryKit/UIImage+AGK+CATransform3D.h index 7a34666..497914f 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/UIImage+AGK+CATransform3D.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/UIImage+AGK+CATransform3D.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/UIImage+AGK+CATransform3D.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/UIImage+AGK+CATransform3D.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/UIImage+AGKQuad.h b/Demo/Pods/BuildHeaders/AGGeometryKit/UIImage+AGKQuad.h index eff253c..491edc5 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/UIImage+AGKQuad.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/UIImage+AGKQuad.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/UIImage+AGKQuad.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/UIImage+AGKQuad.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/UIView+AGK+AngleConverter.h b/Demo/Pods/BuildHeaders/AGGeometryKit/UIView+AGK+AngleConverter.h index b5a943b..f6f0501 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/UIView+AGK+AngleConverter.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/UIView+AGK+AngleConverter.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/UIView+AGK+AngleConverter.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/UIView+AGK+AngleConverter.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/AGGeometryKit/UIView+AGK+Properties.h b/Demo/Pods/BuildHeaders/AGGeometryKit/UIView+AGK+Properties.h index f1bdaeb..d724431 120000 --- a/Demo/Pods/BuildHeaders/AGGeometryKit/UIView+AGK+Properties.h +++ b/Demo/Pods/BuildHeaders/AGGeometryKit/UIView+AGK+Properties.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/UIView+AGK+Properties.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/UIView+AGK+Properties.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/FloatConversion.h b/Demo/Pods/BuildHeaders/pop/FloatConversion.h index bac7d80..3f5ca44 120000 --- a/Demo/Pods/BuildHeaders/pop/FloatConversion.h +++ b/Demo/Pods/BuildHeaders/pop/FloatConversion.h @@ -1 +1 @@ -../../../../../POP/pop/WebCore/FloatConversion.h \ No newline at end of file +../../pop/pop/WebCore/FloatConversion.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POP.h b/Demo/Pods/BuildHeaders/pop/POP.h index 0a380d3..b8ec0a0 120000 --- a/Demo/Pods/BuildHeaders/pop/POP.h +++ b/Demo/Pods/BuildHeaders/pop/POP.h @@ -1 +1 @@ -../../../../../POP/pop/POP.h \ No newline at end of file +../../pop/pop/POP.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPAction.h b/Demo/Pods/BuildHeaders/pop/POPAction.h index 8abe592..cc63e40 120000 --- a/Demo/Pods/BuildHeaders/pop/POPAction.h +++ b/Demo/Pods/BuildHeaders/pop/POPAction.h @@ -1 +1 @@ -../../../../../POP/pop/POPAction.h \ No newline at end of file +../../pop/pop/POPAction.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPAnimatableProperty.h b/Demo/Pods/BuildHeaders/pop/POPAnimatableProperty.h index c77e285..e954a61 120000 --- a/Demo/Pods/BuildHeaders/pop/POPAnimatableProperty.h +++ b/Demo/Pods/BuildHeaders/pop/POPAnimatableProperty.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimatableProperty.h \ No newline at end of file +../../pop/pop/POPAnimatableProperty.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPAnimation.h b/Demo/Pods/BuildHeaders/pop/POPAnimation.h index bc6f9c9..49b3371 120000 --- a/Demo/Pods/BuildHeaders/pop/POPAnimation.h +++ b/Demo/Pods/BuildHeaders/pop/POPAnimation.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimation.h \ No newline at end of file +../../pop/pop/POPAnimation.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPAnimationEvent.h b/Demo/Pods/BuildHeaders/pop/POPAnimationEvent.h index 18af644..a5fe744 120000 --- a/Demo/Pods/BuildHeaders/pop/POPAnimationEvent.h +++ b/Demo/Pods/BuildHeaders/pop/POPAnimationEvent.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimationEvent.h \ No newline at end of file +../../pop/pop/POPAnimationEvent.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPAnimationEventInternal.h b/Demo/Pods/BuildHeaders/pop/POPAnimationEventInternal.h index bd2d7d8..d9558f4 120000 --- a/Demo/Pods/BuildHeaders/pop/POPAnimationEventInternal.h +++ b/Demo/Pods/BuildHeaders/pop/POPAnimationEventInternal.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimationEventInternal.h \ No newline at end of file +../../pop/pop/POPAnimationEventInternal.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPAnimationExtras.h b/Demo/Pods/BuildHeaders/pop/POPAnimationExtras.h index 048df23..dc47668 120000 --- a/Demo/Pods/BuildHeaders/pop/POPAnimationExtras.h +++ b/Demo/Pods/BuildHeaders/pop/POPAnimationExtras.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimationExtras.h \ No newline at end of file +../../pop/pop/POPAnimationExtras.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPAnimationInternal.h b/Demo/Pods/BuildHeaders/pop/POPAnimationInternal.h index 7bdf543..89921a6 120000 --- a/Demo/Pods/BuildHeaders/pop/POPAnimationInternal.h +++ b/Demo/Pods/BuildHeaders/pop/POPAnimationInternal.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimationInternal.h \ No newline at end of file +../../pop/pop/POPAnimationInternal.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPAnimationPrivate.h b/Demo/Pods/BuildHeaders/pop/POPAnimationPrivate.h index f7d1eae..4a821eb 120000 --- a/Demo/Pods/BuildHeaders/pop/POPAnimationPrivate.h +++ b/Demo/Pods/BuildHeaders/pop/POPAnimationPrivate.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimationPrivate.h \ No newline at end of file +../../pop/pop/POPAnimationPrivate.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPAnimationRuntime.h b/Demo/Pods/BuildHeaders/pop/POPAnimationRuntime.h index 1af8b1a..4134036 120000 --- a/Demo/Pods/BuildHeaders/pop/POPAnimationRuntime.h +++ b/Demo/Pods/BuildHeaders/pop/POPAnimationRuntime.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimationRuntime.h \ No newline at end of file +../../pop/pop/POPAnimationRuntime.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPAnimationTracer.h b/Demo/Pods/BuildHeaders/pop/POPAnimationTracer.h index 52b0c74..d5ed275 120000 --- a/Demo/Pods/BuildHeaders/pop/POPAnimationTracer.h +++ b/Demo/Pods/BuildHeaders/pop/POPAnimationTracer.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimationTracer.h \ No newline at end of file +../../pop/pop/POPAnimationTracer.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPAnimationTracerInternal.h b/Demo/Pods/BuildHeaders/pop/POPAnimationTracerInternal.h index 1ee8a15..654f263 120000 --- a/Demo/Pods/BuildHeaders/pop/POPAnimationTracerInternal.h +++ b/Demo/Pods/BuildHeaders/pop/POPAnimationTracerInternal.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimationTracerInternal.h \ No newline at end of file +../../pop/pop/POPAnimationTracerInternal.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPAnimator.h b/Demo/Pods/BuildHeaders/pop/POPAnimator.h index 8bc3d20..e834293 120000 --- a/Demo/Pods/BuildHeaders/pop/POPAnimator.h +++ b/Demo/Pods/BuildHeaders/pop/POPAnimator.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimator.h \ No newline at end of file +../../pop/pop/POPAnimator.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPAnimatorPrivate.h b/Demo/Pods/BuildHeaders/pop/POPAnimatorPrivate.h index 630d856..417096e 120000 --- a/Demo/Pods/BuildHeaders/pop/POPAnimatorPrivate.h +++ b/Demo/Pods/BuildHeaders/pop/POPAnimatorPrivate.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimatorPrivate.h \ No newline at end of file +../../pop/pop/POPAnimatorPrivate.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPBasicAnimation.h b/Demo/Pods/BuildHeaders/pop/POPBasicAnimation.h index 806c868..a0a88f1 120000 --- a/Demo/Pods/BuildHeaders/pop/POPBasicAnimation.h +++ b/Demo/Pods/BuildHeaders/pop/POPBasicAnimation.h @@ -1 +1 @@ -../../../../../POP/pop/POPBasicAnimation.h \ No newline at end of file +../../pop/pop/POPBasicAnimation.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPBasicAnimationInternal.h b/Demo/Pods/BuildHeaders/pop/POPBasicAnimationInternal.h index af07889..5fead51 120000 --- a/Demo/Pods/BuildHeaders/pop/POPBasicAnimationInternal.h +++ b/Demo/Pods/BuildHeaders/pop/POPBasicAnimationInternal.h @@ -1 +1 @@ -../../../../../POP/pop/POPBasicAnimationInternal.h \ No newline at end of file +../../pop/pop/POPBasicAnimationInternal.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPCGUtils.h b/Demo/Pods/BuildHeaders/pop/POPCGUtils.h index 2e6e301..dbf3828 120000 --- a/Demo/Pods/BuildHeaders/pop/POPCGUtils.h +++ b/Demo/Pods/BuildHeaders/pop/POPCGUtils.h @@ -1 +1 @@ -../../../../../POP/pop/POPCGUtils.h \ No newline at end of file +../../pop/pop/POPCGUtils.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPCustomAnimation.h b/Demo/Pods/BuildHeaders/pop/POPCustomAnimation.h index d98a384..e18a0a1 120000 --- a/Demo/Pods/BuildHeaders/pop/POPCustomAnimation.h +++ b/Demo/Pods/BuildHeaders/pop/POPCustomAnimation.h @@ -1 +1 @@ -../../../../../POP/pop/POPCustomAnimation.h \ No newline at end of file +../../pop/pop/POPCustomAnimation.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPDecayAnimation.h b/Demo/Pods/BuildHeaders/pop/POPDecayAnimation.h index 566d4fc..b2a8bbb 120000 --- a/Demo/Pods/BuildHeaders/pop/POPDecayAnimation.h +++ b/Demo/Pods/BuildHeaders/pop/POPDecayAnimation.h @@ -1 +1 @@ -../../../../../POP/pop/POPDecayAnimation.h \ No newline at end of file +../../pop/pop/POPDecayAnimation.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPDecayAnimationInternal.h b/Demo/Pods/BuildHeaders/pop/POPDecayAnimationInternal.h index b5281be..050c68d 120000 --- a/Demo/Pods/BuildHeaders/pop/POPDecayAnimationInternal.h +++ b/Demo/Pods/BuildHeaders/pop/POPDecayAnimationInternal.h @@ -1 +1 @@ -../../../../../POP/pop/POPDecayAnimationInternal.h \ No newline at end of file +../../pop/pop/POPDecayAnimationInternal.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPDefines.h b/Demo/Pods/BuildHeaders/pop/POPDefines.h index b4717ee..94e709c 120000 --- a/Demo/Pods/BuildHeaders/pop/POPDefines.h +++ b/Demo/Pods/BuildHeaders/pop/POPDefines.h @@ -1 +1 @@ -../../../../../POP/pop/POPDefines.h \ No newline at end of file +../../pop/pop/POPDefines.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPGeometry.h b/Demo/Pods/BuildHeaders/pop/POPGeometry.h index b6e8efb..1e6b6aa 120000 --- a/Demo/Pods/BuildHeaders/pop/POPGeometry.h +++ b/Demo/Pods/BuildHeaders/pop/POPGeometry.h @@ -1 +1 @@ -../../../../../POP/pop/POPGeometry.h \ No newline at end of file +../../pop/pop/POPGeometry.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPLayerExtras.h b/Demo/Pods/BuildHeaders/pop/POPLayerExtras.h index 49835b1..90c3650 120000 --- a/Demo/Pods/BuildHeaders/pop/POPLayerExtras.h +++ b/Demo/Pods/BuildHeaders/pop/POPLayerExtras.h @@ -1 +1 @@ -../../../../../POP/pop/POPLayerExtras.h \ No newline at end of file +../../pop/pop/POPLayerExtras.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPMath.h b/Demo/Pods/BuildHeaders/pop/POPMath.h index 349e36c..740149e 120000 --- a/Demo/Pods/BuildHeaders/pop/POPMath.h +++ b/Demo/Pods/BuildHeaders/pop/POPMath.h @@ -1 +1 @@ -../../../../../POP/pop/POPMath.h \ No newline at end of file +../../pop/pop/POPMath.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPPropertyAnimation.h b/Demo/Pods/BuildHeaders/pop/POPPropertyAnimation.h index a193d07..afde446 120000 --- a/Demo/Pods/BuildHeaders/pop/POPPropertyAnimation.h +++ b/Demo/Pods/BuildHeaders/pop/POPPropertyAnimation.h @@ -1 +1 @@ -../../../../../POP/pop/POPPropertyAnimation.h \ No newline at end of file +../../pop/pop/POPPropertyAnimation.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPPropertyAnimationInternal.h b/Demo/Pods/BuildHeaders/pop/POPPropertyAnimationInternal.h index 88ec76b..a0e6975 120000 --- a/Demo/Pods/BuildHeaders/pop/POPPropertyAnimationInternal.h +++ b/Demo/Pods/BuildHeaders/pop/POPPropertyAnimationInternal.h @@ -1 +1 @@ -../../../../../POP/pop/POPPropertyAnimationInternal.h \ No newline at end of file +../../pop/pop/POPPropertyAnimationInternal.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPSpringAnimation.h b/Demo/Pods/BuildHeaders/pop/POPSpringAnimation.h index be32ee1..4ce9d44 120000 --- a/Demo/Pods/BuildHeaders/pop/POPSpringAnimation.h +++ b/Demo/Pods/BuildHeaders/pop/POPSpringAnimation.h @@ -1 +1 @@ -../../../../../POP/pop/POPSpringAnimation.h \ No newline at end of file +../../pop/pop/POPSpringAnimation.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPSpringAnimationInternal.h b/Demo/Pods/BuildHeaders/pop/POPSpringAnimationInternal.h index cc80f91..c6e6cb3 120000 --- a/Demo/Pods/BuildHeaders/pop/POPSpringAnimationInternal.h +++ b/Demo/Pods/BuildHeaders/pop/POPSpringAnimationInternal.h @@ -1 +1 @@ -../../../../../POP/pop/POPSpringAnimationInternal.h \ No newline at end of file +../../pop/pop/POPSpringAnimationInternal.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPSpringSolver.h b/Demo/Pods/BuildHeaders/pop/POPSpringSolver.h index 4cae385..11aa25c 120000 --- a/Demo/Pods/BuildHeaders/pop/POPSpringSolver.h +++ b/Demo/Pods/BuildHeaders/pop/POPSpringSolver.h @@ -1 +1 @@ -../../../../../POP/pop/POPSpringSolver.h \ No newline at end of file +../../pop/pop/POPSpringSolver.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/POPVector.h b/Demo/Pods/BuildHeaders/pop/POPVector.h index 6625477..4948394 120000 --- a/Demo/Pods/BuildHeaders/pop/POPVector.h +++ b/Demo/Pods/BuildHeaders/pop/POPVector.h @@ -1 +1 @@ -../../../../../POP/pop/POPVector.h \ No newline at end of file +../../pop/pop/POPVector.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/TransformationMatrix.h b/Demo/Pods/BuildHeaders/pop/TransformationMatrix.h index 80f313d..dd8349a 120000 --- a/Demo/Pods/BuildHeaders/pop/TransformationMatrix.h +++ b/Demo/Pods/BuildHeaders/pop/TransformationMatrix.h @@ -1 +1 @@ -../../../../../POP/pop/WebCore/TransformationMatrix.h \ No newline at end of file +../../pop/pop/WebCore/TransformationMatrix.h \ No newline at end of file diff --git a/Demo/Pods/BuildHeaders/pop/UnitBezier.h b/Demo/Pods/BuildHeaders/pop/UnitBezier.h index b72dadc..5df17e1 120000 --- a/Demo/Pods/BuildHeaders/pop/UnitBezier.h +++ b/Demo/Pods/BuildHeaders/pop/UnitBezier.h @@ -1 +1 @@ -../../../../../POP/pop/WebCore/UnitBezier.h \ No newline at end of file +../../pop/pop/WebCore/UnitBezier.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/AGGeometryKit.h b/Demo/Pods/Headers/AGGeometryKit/AGGeometryKit.h index 87605df..7689902 120000 --- a/Demo/Pods/Headers/AGGeometryKit/AGGeometryKit.h +++ b/Demo/Pods/Headers/AGGeometryKit/AGGeometryKit.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGGeometryKit.h \ No newline at end of file +../../AGGeometryKit/Source/AGGeometryKit.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/AGGeometryKitCategories.h b/Demo/Pods/Headers/AGGeometryKit/AGGeometryKitCategories.h index ef2ec0b..5f89ff7 120000 --- a/Demo/Pods/Headers/AGGeometryKit/AGGeometryKitCategories.h +++ b/Demo/Pods/Headers/AGGeometryKit/AGGeometryKitCategories.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/AGGeometryKitCategories.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/AGGeometryKitCategories.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/AGGeometryKitClasses.h b/Demo/Pods/Headers/AGGeometryKit/AGGeometryKitClasses.h index 63b2829..f275bea 120000 --- a/Demo/Pods/Headers/AGGeometryKit/AGGeometryKitClasses.h +++ b/Demo/Pods/Headers/AGGeometryKit/AGGeometryKitClasses.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Classes/AGGeometryKitClasses.h \ No newline at end of file +../../AGGeometryKit/Source/Classes/AGGeometryKitClasses.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/AGGeometryKitCoreGraphics.h b/Demo/Pods/Headers/AGGeometryKit/AGGeometryKitCoreGraphics.h index 17dcf8c..4142795 120000 --- a/Demo/Pods/Headers/AGGeometryKit/AGGeometryKitCoreGraphics.h +++ b/Demo/Pods/Headers/AGGeometryKit/AGGeometryKitCoreGraphics.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/CoreGraphics_Extensions/AGGeometryKitCoreGraphics.h \ No newline at end of file +../../AGGeometryKit/Source/CoreGraphics_Extensions/AGGeometryKitCoreGraphics.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/AGKBitOperations.h b/Demo/Pods/Headers/AGGeometryKit/AGKBitOperations.h index dbb4b7a..63d4a69 120000 --- a/Demo/Pods/Headers/AGGeometryKit/AGKBitOperations.h +++ b/Demo/Pods/Headers/AGGeometryKit/AGKBitOperations.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGKBitOperations.h \ No newline at end of file +../../AGGeometryKit/Source/AGKBitOperations.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/AGKCALayerAnimationBlockDelegate.h b/Demo/Pods/Headers/AGGeometryKit/AGKCALayerAnimationBlockDelegate.h index e94f543..7483293 120000 --- a/Demo/Pods/Headers/AGGeometryKit/AGKCALayerAnimationBlockDelegate.h +++ b/Demo/Pods/Headers/AGGeometryKit/AGKCALayerAnimationBlockDelegate.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Classes/AGKCALayerAnimationBlockDelegate.h \ No newline at end of file +../../AGGeometryKit/Source/Classes/AGKCALayerAnimationBlockDelegate.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/AGKCorner.h b/Demo/Pods/Headers/AGGeometryKit/AGKCorner.h index 7c0ca56..8a8ecd1 120000 --- a/Demo/Pods/Headers/AGGeometryKit/AGKCorner.h +++ b/Demo/Pods/Headers/AGGeometryKit/AGKCorner.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGKCorner.h \ No newline at end of file +../../AGGeometryKit/Source/AGKCorner.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/AGKLine.h b/Demo/Pods/Headers/AGGeometryKit/AGKLine.h index 37beed1..0886310 120000 --- a/Demo/Pods/Headers/AGGeometryKit/AGKLine.h +++ b/Demo/Pods/Headers/AGGeometryKit/AGKLine.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGKLine.h \ No newline at end of file +../../AGGeometryKit/Source/AGKLine.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/AGKMath.h b/Demo/Pods/Headers/AGGeometryKit/AGKMath.h index b5f870b..ff06730 120000 --- a/Demo/Pods/Headers/AGGeometryKit/AGKMath.h +++ b/Demo/Pods/Headers/AGGeometryKit/AGKMath.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGKMath.h \ No newline at end of file +../../AGGeometryKit/Source/AGKMath.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/AGKQuad.h b/Demo/Pods/Headers/AGGeometryKit/AGKQuad.h index 0f6ab81..52697fe 120000 --- a/Demo/Pods/Headers/AGGeometryKit/AGKQuad.h +++ b/Demo/Pods/Headers/AGGeometryKit/AGKQuad.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGKQuad.h \ No newline at end of file +../../AGGeometryKit/Source/AGKQuad.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/AGKTransformPixelMapper.h b/Demo/Pods/Headers/AGGeometryKit/AGKTransformPixelMapper.h index 0643f26..187616a 120000 --- a/Demo/Pods/Headers/AGGeometryKit/AGKTransformPixelMapper.h +++ b/Demo/Pods/Headers/AGGeometryKit/AGKTransformPixelMapper.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Classes/AGKTransformPixelMapper.h \ No newline at end of file +../../AGGeometryKit/Source/Classes/AGKTransformPixelMapper.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/AGKVector3D.h b/Demo/Pods/Headers/AGGeometryKit/AGKVector3D.h index 8e8d4b0..9720b01 120000 --- a/Demo/Pods/Headers/AGGeometryKit/AGKVector3D.h +++ b/Demo/Pods/Headers/AGGeometryKit/AGKVector3D.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/AGKVector3D.h \ No newline at end of file +../../AGGeometryKit/Source/AGKVector3D.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/CALayer+AGK+Methods.h b/Demo/Pods/Headers/AGGeometryKit/CALayer+AGK+Methods.h index 9f763b8..56bdbfb 120000 --- a/Demo/Pods/Headers/AGGeometryKit/CALayer+AGK+Methods.h +++ b/Demo/Pods/Headers/AGGeometryKit/CALayer+AGK+Methods.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/CALayer+AGK+Methods.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/CALayer+AGK+Methods.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/CALayer+AGK+Properties.h b/Demo/Pods/Headers/AGGeometryKit/CALayer+AGK+Properties.h index 36d2fcc..5f5b313 120000 --- a/Demo/Pods/Headers/AGGeometryKit/CALayer+AGK+Properties.h +++ b/Demo/Pods/Headers/AGGeometryKit/CALayer+AGK+Properties.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/CALayer+AGK+Properties.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/CALayer+AGK+Properties.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/CALayer+AGKQuad.h b/Demo/Pods/Headers/AGGeometryKit/CALayer+AGKQuad.h index 51ff8ac..e09df2e 120000 --- a/Demo/Pods/Headers/AGGeometryKit/CALayer+AGKQuad.h +++ b/Demo/Pods/Headers/AGGeometryKit/CALayer+AGKQuad.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/CALayer+AGKQuad.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/CALayer+AGKQuad.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/CGGeometry+AGGeometryKit.h b/Demo/Pods/Headers/AGGeometryKit/CGGeometry+AGGeometryKit.h index ffd6229..1e8ca8c 120000 --- a/Demo/Pods/Headers/AGGeometryKit/CGGeometry+AGGeometryKit.h +++ b/Demo/Pods/Headers/AGGeometryKit/CGGeometry+AGGeometryKit.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.h \ No newline at end of file +../../AGGeometryKit/Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/CGImageRef+AGK+CATransform3D.h b/Demo/Pods/Headers/AGGeometryKit/CGImageRef+AGK+CATransform3D.h index 760f8bb..fdc5e00 120000 --- a/Demo/Pods/Headers/AGGeometryKit/CGImageRef+AGK+CATransform3D.h +++ b/Demo/Pods/Headers/AGGeometryKit/CGImageRef+AGK+CATransform3D.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.h \ No newline at end of file +../../AGGeometryKit/Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/NSValue+AGKQuad.h b/Demo/Pods/Headers/AGGeometryKit/NSValue+AGKQuad.h index 68cf36d..39a3498 120000 --- a/Demo/Pods/Headers/AGGeometryKit/NSValue+AGKQuad.h +++ b/Demo/Pods/Headers/AGGeometryKit/NSValue+AGKQuad.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/NSValue+AGKQuad.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/NSValue+AGKQuad.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/UIBezierPath+AGKQuad.h b/Demo/Pods/Headers/AGGeometryKit/UIBezierPath+AGKQuad.h index dd66bf7..c0ee74d 120000 --- a/Demo/Pods/Headers/AGGeometryKit/UIBezierPath+AGKQuad.h +++ b/Demo/Pods/Headers/AGGeometryKit/UIBezierPath+AGKQuad.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/UIBezierPath+AGKQuad.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/UIBezierPath+AGKQuad.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/UIImage+AGK+CATransform3D.h b/Demo/Pods/Headers/AGGeometryKit/UIImage+AGK+CATransform3D.h index 7a34666..497914f 120000 --- a/Demo/Pods/Headers/AGGeometryKit/UIImage+AGK+CATransform3D.h +++ b/Demo/Pods/Headers/AGGeometryKit/UIImage+AGK+CATransform3D.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/UIImage+AGK+CATransform3D.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/UIImage+AGK+CATransform3D.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/UIImage+AGKQuad.h b/Demo/Pods/Headers/AGGeometryKit/UIImage+AGKQuad.h index eff253c..491edc5 120000 --- a/Demo/Pods/Headers/AGGeometryKit/UIImage+AGKQuad.h +++ b/Demo/Pods/Headers/AGGeometryKit/UIImage+AGKQuad.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/UIImage+AGKQuad.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/UIImage+AGKQuad.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/UIView+AGK+AngleConverter.h b/Demo/Pods/Headers/AGGeometryKit/UIView+AGK+AngleConverter.h index b5a943b..f6f0501 120000 --- a/Demo/Pods/Headers/AGGeometryKit/UIView+AGK+AngleConverter.h +++ b/Demo/Pods/Headers/AGGeometryKit/UIView+AGK+AngleConverter.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/UIView+AGK+AngleConverter.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/UIView+AGK+AngleConverter.h \ No newline at end of file diff --git a/Demo/Pods/Headers/AGGeometryKit/UIView+AGK+Properties.h b/Demo/Pods/Headers/AGGeometryKit/UIView+AGK+Properties.h index f1bdaeb..d724431 120000 --- a/Demo/Pods/Headers/AGGeometryKit/UIView+AGK+Properties.h +++ b/Demo/Pods/Headers/AGGeometryKit/UIView+AGK+Properties.h @@ -1 +1 @@ -../../../../../AGGeometryKit/Source/Categories/UIView+AGK+Properties.h \ No newline at end of file +../../AGGeometryKit/Source/Categories/UIView+AGK+Properties.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POP.h b/Demo/Pods/Headers/pop/POP.h index 0a380d3..b8ec0a0 120000 --- a/Demo/Pods/Headers/pop/POP.h +++ b/Demo/Pods/Headers/pop/POP.h @@ -1 +1 @@ -../../../../../POP/pop/POP.h \ No newline at end of file +../../pop/pop/POP.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POPAnimatableProperty.h b/Demo/Pods/Headers/pop/POPAnimatableProperty.h index c77e285..e954a61 120000 --- a/Demo/Pods/Headers/pop/POPAnimatableProperty.h +++ b/Demo/Pods/Headers/pop/POPAnimatableProperty.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimatableProperty.h \ No newline at end of file +../../pop/pop/POPAnimatableProperty.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POPAnimation.h b/Demo/Pods/Headers/pop/POPAnimation.h index bc6f9c9..49b3371 120000 --- a/Demo/Pods/Headers/pop/POPAnimation.h +++ b/Demo/Pods/Headers/pop/POPAnimation.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimation.h \ No newline at end of file +../../pop/pop/POPAnimation.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POPAnimationEvent.h b/Demo/Pods/Headers/pop/POPAnimationEvent.h index 18af644..a5fe744 120000 --- a/Demo/Pods/Headers/pop/POPAnimationEvent.h +++ b/Demo/Pods/Headers/pop/POPAnimationEvent.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimationEvent.h \ No newline at end of file +../../pop/pop/POPAnimationEvent.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POPAnimationExtras.h b/Demo/Pods/Headers/pop/POPAnimationExtras.h index 048df23..dc47668 120000 --- a/Demo/Pods/Headers/pop/POPAnimationExtras.h +++ b/Demo/Pods/Headers/pop/POPAnimationExtras.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimationExtras.h \ No newline at end of file +../../pop/pop/POPAnimationExtras.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POPAnimationTracer.h b/Demo/Pods/Headers/pop/POPAnimationTracer.h index 52b0c74..d5ed275 120000 --- a/Demo/Pods/Headers/pop/POPAnimationTracer.h +++ b/Demo/Pods/Headers/pop/POPAnimationTracer.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimationTracer.h \ No newline at end of file +../../pop/pop/POPAnimationTracer.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POPAnimator.h b/Demo/Pods/Headers/pop/POPAnimator.h index 8bc3d20..e834293 120000 --- a/Demo/Pods/Headers/pop/POPAnimator.h +++ b/Demo/Pods/Headers/pop/POPAnimator.h @@ -1 +1 @@ -../../../../../POP/pop/POPAnimator.h \ No newline at end of file +../../pop/pop/POPAnimator.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POPBasicAnimation.h b/Demo/Pods/Headers/pop/POPBasicAnimation.h index 806c868..a0a88f1 120000 --- a/Demo/Pods/Headers/pop/POPBasicAnimation.h +++ b/Demo/Pods/Headers/pop/POPBasicAnimation.h @@ -1 +1 @@ -../../../../../POP/pop/POPBasicAnimation.h \ No newline at end of file +../../pop/pop/POPBasicAnimation.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POPCustomAnimation.h b/Demo/Pods/Headers/pop/POPCustomAnimation.h index d98a384..e18a0a1 120000 --- a/Demo/Pods/Headers/pop/POPCustomAnimation.h +++ b/Demo/Pods/Headers/pop/POPCustomAnimation.h @@ -1 +1 @@ -../../../../../POP/pop/POPCustomAnimation.h \ No newline at end of file +../../pop/pop/POPCustomAnimation.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POPDecayAnimation.h b/Demo/Pods/Headers/pop/POPDecayAnimation.h index 566d4fc..b2a8bbb 120000 --- a/Demo/Pods/Headers/pop/POPDecayAnimation.h +++ b/Demo/Pods/Headers/pop/POPDecayAnimation.h @@ -1 +1 @@ -../../../../../POP/pop/POPDecayAnimation.h \ No newline at end of file +../../pop/pop/POPDecayAnimation.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POPDefines.h b/Demo/Pods/Headers/pop/POPDefines.h index b4717ee..94e709c 120000 --- a/Demo/Pods/Headers/pop/POPDefines.h +++ b/Demo/Pods/Headers/pop/POPDefines.h @@ -1 +1 @@ -../../../../../POP/pop/POPDefines.h \ No newline at end of file +../../pop/pop/POPDefines.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POPGeometry.h b/Demo/Pods/Headers/pop/POPGeometry.h index b6e8efb..1e6b6aa 120000 --- a/Demo/Pods/Headers/pop/POPGeometry.h +++ b/Demo/Pods/Headers/pop/POPGeometry.h @@ -1 +1 @@ -../../../../../POP/pop/POPGeometry.h \ No newline at end of file +../../pop/pop/POPGeometry.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POPPropertyAnimation.h b/Demo/Pods/Headers/pop/POPPropertyAnimation.h index a193d07..afde446 120000 --- a/Demo/Pods/Headers/pop/POPPropertyAnimation.h +++ b/Demo/Pods/Headers/pop/POPPropertyAnimation.h @@ -1 +1 @@ -../../../../../POP/pop/POPPropertyAnimation.h \ No newline at end of file +../../pop/pop/POPPropertyAnimation.h \ No newline at end of file diff --git a/Demo/Pods/Headers/pop/POPSpringAnimation.h b/Demo/Pods/Headers/pop/POPSpringAnimation.h index be32ee1..4ce9d44 120000 --- a/Demo/Pods/Headers/pop/POPSpringAnimation.h +++ b/Demo/Pods/Headers/pop/POPSpringAnimation.h @@ -1 +1 @@ -../../../../../POP/pop/POPSpringAnimation.h \ No newline at end of file +../../pop/pop/POPSpringAnimation.h \ No newline at end of file diff --git a/Demo/Pods/Local Podspecs/AGGeometryKit.podspec b/Demo/Pods/Local Podspecs/AGGeometryKit.podspec deleted file mode 100755 index a0a7792..0000000 --- a/Demo/Pods/Local Podspecs/AGGeometryKit.podspec +++ /dev/null @@ -1,30 +0,0 @@ -Pod::Spec.new do |s| - s.name = "AGGeometryKit" - s.version = "0.1.8.3" - s.summary = "A bundle of small classes which enriches your possibilities with UIKit and CoreAnimation." - s.homepage = "https://github.com/hfossli/AGGeometryKit.git" - s.authors = { "Håvard Fossli" => "hfossli@agens.no" } - s.license = 'MIT' - s.source = { - :git => "https://github.com/hfossli/AGGeometryKit.git", - :tag => s.version.to_s - } - s.platform = :ios - s.requires_arc = true - - s.default_subspec = 'Default' - - s.subspec 'Default' do |ss| - ss.dependency 'AGGeometryKit/Core' - ss.dependency 'AGGeometryKit/Dependencies' - ss.frameworks = 'SystemConfiguration', 'IOKit', 'CoreGraphics', 'UIKit', 'QuartzCore' - end - - s.subspec 'Core' do |ss| - ss.source_files = 'Source/**/*.{h,m}' - ss.exclude_files = 'Source/**/*Test.{h,m}' - end - - s.subspec 'Dependencies' do |ss| - end -end diff --git a/Demo/Pods/Local Podspecs/pop.podspec b/Demo/Pods/Local Podspecs/pop.podspec deleted file mode 100644 index ca6eaf1..0000000 --- a/Demo/Pods/Local Podspecs/pop.podspec +++ /dev/null @@ -1,21 +0,0 @@ -Pod::Spec.new do |spec| - spec.name = 'pop' - spec.version = '1.0.4' - spec.license = { :type => 'BSD' } - spec.homepage = 'https://github.com/facebook/pop' - spec.authors = { 'Kimon Tsinteris' => 'kimon@mac.com' } - spec.summary = 'Extensible animation framework for iOS and OS X.' - spec.source = { :git => 'https://github.com/facebook/pop.git', :tag => '1.0.4' } - spec.source_files = 'pop/**/*.{h,m,mm,cpp}' - spec.public_header_files = 'pop/{POP,POPAnimatableProperty,POPAnimation,POPAnimationEvent,POPAnimationExtras,POPAnimationTracer,POPAnimator,POPBasicAnimation,POPCustomAnimation,POPDecayAnimation,POPDefines,POPGeometry,POPPropertyAnimation,POPSpringAnimation}.h' - spec.requires_arc = true - spec.social_media_url = 'https://twitter.com/fbOpenSource' - spec.library = 'c++' - spec.xcconfig = { - 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11', - 'CLANG_CXX_LIBRARY' => 'libc++' - } - - spec.ios.deployment_target = '6.0' - spec.osx.deployment_target = '10.7' -end diff --git a/Demo/Pods/Manifest.lock b/Demo/Pods/Manifest.lock index 11d3a76..f7c138a 100644 --- a/Demo/Pods/Manifest.lock +++ b/Demo/Pods/Manifest.lock @@ -1,25 +1,17 @@ PODS: - - AGGeometryKit (0.1.8.3): + - AGGeometryKit (1.0.1): - AGGeometryKit/Default - - AGGeometryKit/Core (0.1.8.3) - - AGGeometryKit/Default (0.1.8.3): + - AGGeometryKit/Core (1.0.1) + - AGGeometryKit/Default (1.0.1): - AGGeometryKit/Core - - AGGeometryKit/Dependencies - - AGGeometryKit/Dependencies (0.1.8.3) - pop (1.0.4) DEPENDENCIES: - - AGGeometryKit (from `../../AGGeometryKit/AGGeometryKit.podspec`) - - pop (from `../../POP/pop.podspec`) - -EXTERNAL SOURCES: - AGGeometryKit: - :path: ../../AGGeometryKit/AGGeometryKit.podspec - pop: - :path: ../../POP/pop.podspec + - AGGeometryKit (~> 1.0.1) + - pop (~> 1.0.4) SPEC CHECKSUMS: - AGGeometryKit: 5c60ef0435a4c4aeb2a59232f9709927976795d7 + AGGeometryKit: 995cf78e880fa0a88f109e0ac58041d3314d2315 pop: 63a4f5e8942077fed2efe195036ecc572c71c48c COCOAPODS: 0.32.1 diff --git a/Demo/Pods/Pods-environment.h b/Demo/Pods/Pods-environment.h index a7f3ba6..e2ce599 100644 --- a/Demo/Pods/Pods-environment.h +++ b/Demo/Pods/Pods-environment.h @@ -8,31 +8,21 @@ // AGGeometryKit #define COCOAPODS_POD_AVAILABLE_AGGeometryKit -// This library does not follow semantic-versioning, -// so we were not able to define version macros. -// Please contact the author. -// Version: 0.1.8.3. +#define COCOAPODS_VERSION_MAJOR_AGGeometryKit 1 +#define COCOAPODS_VERSION_MINOR_AGGeometryKit 0 +#define COCOAPODS_VERSION_PATCH_AGGeometryKit 1 // AGGeometryKit/Core #define COCOAPODS_POD_AVAILABLE_AGGeometryKit_Core -// This library does not follow semantic-versioning, -// so we were not able to define version macros. -// Please contact the author. -// Version: 0.1.8.3. +#define COCOAPODS_VERSION_MAJOR_AGGeometryKit_Core 1 +#define COCOAPODS_VERSION_MINOR_AGGeometryKit_Core 0 +#define COCOAPODS_VERSION_PATCH_AGGeometryKit_Core 1 // AGGeometryKit/Default #define COCOAPODS_POD_AVAILABLE_AGGeometryKit_Default -// This library does not follow semantic-versioning, -// so we were not able to define version macros. -// Please contact the author. -// Version: 0.1.8.3. - -// AGGeometryKit/Dependencies -#define COCOAPODS_POD_AVAILABLE_AGGeometryKit_Dependencies -// This library does not follow semantic-versioning, -// so we were not able to define version macros. -// Please contact the author. -// Version: 0.1.8.3. +#define COCOAPODS_VERSION_MAJOR_AGGeometryKit_Default 1 +#define COCOAPODS_VERSION_MINOR_AGGeometryKit_Default 0 +#define COCOAPODS_VERSION_PATCH_AGGeometryKit_Default 1 // pop #define COCOAPODS_POD_AVAILABLE_pop diff --git a/Demo/Pods/Pods.xcodeproj/project.pbxproj b/Demo/Pods/Pods.xcodeproj/project.pbxproj index 777087c..ffde7a6 100644 --- a/Demo/Pods/Pods.xcodeproj/project.pbxproj +++ b/Demo/Pods/Pods.xcodeproj/project.pbxproj @@ -10,50 +10,67 @@ 46 objects - 02E9A42FFDD34F2A9393070B + 00E13166445742E992639585 fileRef - 65F25285145B424B910F3003 + C13631D75EA84427B033BEC0 isa PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + - 032CD44AA9AC47BA8FD6EC47 + 00EEA9DB1DB1474790C5C113 - buildConfigurations - - 55D2AC48B7E64AA3BA8D2F17 - CE38777B0620457BAFA8DC71 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release + fileRef + E4A35243651A49A2815C0B3D isa - XCConfigurationList + PBXBuildFile - 036E65BCD93344C59AC15DD3 + 0172E50A1D3A495F89DAD2B4 fileRef - 314EB805A88241C59B9A2BAA + 467B27F85D4F4E898605200E isa PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc + - 055138EFE69E4199BAE80811 + 0182275BDDCD449F8BABFB15 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.h + sourcecode.c.objc name - POPAnimation.h + UIImage+AGK+CATransform3D.m path - pop/POPAnimation.h + Source/Categories/UIImage+AGK+CATransform3D.m sourceTree <group> - 063ACD99E26C466CAB76431D + 01980EA33426472FBB8CFE9F + + buildConfigurations + + 0433B9DD8FCD448493DB0EF1 + A69268D64E764591BEFA6CA8 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 0288007D60CB4A5887FF70BC includeInIndex 1 @@ -62,20 +79,96 @@ lastKnownFileType sourcecode.c.h name - AGKCorner.h + POPCGUtils.h path - Source/AGKCorner.h + pop/POPCGUtils.h sourceTree <group> - 0669BEF43FBF4D718BB1AF3E + 031D675B8682411184C54A12 + + buildConfigurationList + 01980EA33426472FBB8CFE9F + buildPhases + + ACBE031166F4478087272D4E + 909269803BE14A99AA3EAFEF + 82C499C3B2FC48E0B3B2E183 + + buildRules + + dependencies + + isa + PBXNativeTarget + name + Pods-AGGeometryKit + productName + Pods-AGGeometryKit + productReference + 2D606CF9117C4B22BA13FF73 + productType + com.apple.product-type.library.static + + 032D7B05FF8D4D6FB4C9B620 fileRef - C976BE23D85D43B7AA46BF17 + D2D2B9A6D5DD4AD9B6E80765 isa PBXBuildFile - 06F6C91A345F49728AF6E0E5 + 0433B9DD8FCD448493DB0EF1 + + baseConfigurationReference + 125D826F29694559947EA6C9 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Pods-AGGeometryKit-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + GCC_VERSION + com.apple.compilers.llvm.clang.1_0 + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 6.0 + OTHER_LDFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 052E67BCC124410E97EDD696 includeInIndex 1 @@ -84,25 +177,20 @@ lastKnownFileType sourcecode.c.h name - AGKCALayerAnimationBlockDelegate.h + POPSpringAnimation.h path - Source/Classes/AGKCALayerAnimationBlockDelegate.h + pop/POPSpringAnimation.h sourceTree <group> - 07C5BF1F35264B1D9B2DA07E + 076A7DC034B748D38743ABE4 fileRef - F222E569428F4ACAB2ED2E83 + C3987AD9E31C413D96CDEB71 isa PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc - - 081E7AE7B5C943A3AA314E53 + 0791591A10184C2EAF08F19A includeInIndex 1 @@ -111,143 +199,116 @@ lastKnownFileType sourcecode.c.h name - TransformationMatrix.h + AGKMath.h path - pop/WebCore/TransformationMatrix.h + Source/AGKMath.h sourceTree <group> - 0887DBB50AFA49A89CC03108 - - fileRef - AE4FE3792F2341CE8A70291D - isa - PBXBuildFile - - 094B5BB6CA224615AF38B616 + 086992FE964C477288CEF06A fileRef - 98755DB591B044DE87D8758B + 3F0D6F12968D4DA6BAF12747 isa PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - 0AD43144485244628DA96C86 + 09042E97C26F4A688E874F9A - fileRef - 2CB09A2B5C4B44BEBFD8C178 + buildActionMask + 2147483647 + files + + 1838A3B500F44F8DB5F266BC + isa - PBXBuildFile + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 - 0C270BEB5AF7422B9C8EA892 + 0A475EE6172543CC95150148 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.h - name - AGGeometryKitCoreGraphics.h + text path - Source/CoreGraphics_Extensions/AGGeometryKitCoreGraphics.h + Pods-acknowledgements.markdown sourceTree <group> - 0C800223A299408D863FD895 + 0AA7623D75AF4C17A567AF58 includeInIndex 1 isa PBXFileReference - lastKnownFileType - text.plist.xml + name + POPPropertyAnimation.mm path - Pods-acknowledgements.plist + pop/POPPropertyAnimation.mm sourceTree <group> - 0CADE563C4124C29B59E2E85 - - fileRef - AE8D2F55135142508FB0973A - isa - PBXBuildFile - - 0CEA92BFFC984894A7DABC47 - - fileRef - AC98E906535641F8BF9066F9 - isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - - 0D21E5EBF406495CA169817D + 0D3086051F6342C39C866590 includeInIndex 1 isa PBXFileReference lastKnownFileType - text.script.sh + sourcecode.c.objc + name + CGGeometry+AGGeometryKit.m path - Pods-resources.sh + Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.m sourceTree <group> - 0FF2747EEE09444DA275C19F + 0FB3D82FEAE34458BFF98594 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.objc + sourcecode.c.h name - AGKVector3D.m + AGGeometryKitCategories.h path - Source/AGKVector3D.m + Source/Categories/AGGeometryKitCategories.h sourceTree <group> - 1014D0ACDE2A45079EADCE0A + 10CA3244C36248D3B2F1F07B children - 36B43BC85E784EA3AB194E58 - A26C77FC09D94D87B24AC912 + 2B811D5E146641A0B9DB6CE1 + 5D3655B56BB443FB83909004 isa PBXGroup name - Development Pods + Pods sourceTree <group> - 106D41A2534E42729064082E + 112886186D024596A7BD4CC6 includeInIndex 1 isa PBXFileReference - lastKnownFileType - sourcecode.c.h name - POPBasicAnimationInternal.h + POPDecayAnimation.mm path - pop/POPBasicAnimationInternal.h + pop/POPDecayAnimation.mm sourceTree <group> - 1640EE7E9F28467C84E70439 + 1170964F416944FC866F5B84 explicitFileType archive.ar @@ -256,39 +317,11 @@ isa PBXFileReference path - libPods.a + libPods-pop.a sourceTree BUILT_PRODUCTS_DIR - 17EC1A43B4CA46A98F69512E - - fileRef - E9101FA261B94E97AB3E1676 - isa - PBXBuildFile - - 18E46C0C23914F5D897BCC1D - - fileRef - 202C6FE053544146800C4901 - isa - PBXBuildFile - - 18F2CFB811D64701A00770E5 - - fileRef - 871E36011D804307A03D67D5 - isa - PBXBuildFile - - 1919548D1ECA4C8B846D572D - - fileRef - 4A333E2E5AD54441AA0D980B - isa - PBXBuildFile - - 19329B5FB5EE411F8C9F35BA + 125D826F29694559947EA6C9 includeInIndex 1 @@ -297,18 +330,11 @@ lastKnownFileType text.xcconfig path - Pods-pop.xcconfig + Pods-AGGeometryKit-Private.xcconfig sourceTree <group> - 19CF5785FB8843E4A1FE1FFB - - fileRef - A79176C9B3804C67B9672757 - isa - PBXBuildFile - - 1BC6AF7E602B4368862CF25D + 132AFB233B84464CA38A2D92 includeInIndex 1 @@ -316,114 +342,251 @@ PBXFileReference lastKnownFileType sourcecode.c.h - name - POPAnimationPrivate.h path - pop/POPAnimationPrivate.h + Pods-environment.h sourceTree <group> - 1D5255F154D345D89E281AF2 - - fileRef - FF93525D583B4550A7B711A3 - isa - PBXBuildFile - - 1D5C39A887E94AF7917E5C3A + 1347812C7CCA413D8F1B057D fileRef - 55ECE90472984F4E8D39D10A + 3BF1C3641D9C46F7B307E4AD isa PBXBuildFile - 1FD64DEBAB384FC3B370FC6D + 136E32E74A1B417386088E1C fileRef - EE0221E82ABD415E94C8C7B8 + 63DE76EA18174F3E9E9D2924 isa PBXBuildFile - 202C6FE053544146800C4901 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - POPAnimationTracerInternal.h - path - pop/POPAnimationTracerInternal.h - sourceTree - <group> - - 209D5F596E614EE8971A21F4 + 13799A61960A4CC68DB0C8BB - fileRef - AC6228B0625445C7944EDE3B - isa - PBXBuildFile - settings + baseConfigurationReference + E5A186E9B62F42F58BF3D3FA + buildSettings - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - - 2119195649A147A584062E90 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - path - Pods-dummy.m + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + GCC_VERSION + com.apple.compilers.llvm.clang.1_0 + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 6.0 + OTHER_LDFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + 1420090EE57F4B53BDFA42D4 + + fileRef + A9E2877F345F4EF4A2D4A6FB + isa + PBXBuildFile + + 148B7521D1634EE7AB602C07 + + children + + C3987AD9E31C413D96CDEB71 + 944E5547D96E477B847EC63D + 9BD51F2822414C579230D800 + D123BDE9E2974A91B35AD3C6 + EF60F6A8E9904CA99D176F13 + 8A874FE0B63A4F279EBE761B + + isa + PBXGroup + name + iOS sourceTree <group> - 21212DB6006F4F2D87D5F74A + 16FB681309E4423A8ACDCE1A includeInIndex 1 isa PBXFileReference + lastKnownFileType + sourcecode.c.h name - POPAnimationExtras.mm + AGKVector3D.h path - pop/POPAnimationExtras.mm + Source/AGKVector3D.h sourceTree <group> - 2490723988AD468D8F1CD483 + 17093128A47A4EBDAE8AB7C6 includeInIndex 1 isa PBXFileReference + lastKnownFileType + sourcecode.c.objc name - POPSpringAnimation.mm + CALayer+AGK+Properties.m path - pop/POPSpringAnimation.mm + Source/Categories/CALayer+AGK+Properties.m sourceTree <group> - 24C68F69B327460F8E7CC34E + 178262966CA74767BDABB7D2 + + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + CLANG_CXX_LANGUAGE_STANDARD + gnu++0x + CLANG_CXX_LIBRARY + libc++ + CLANG_ENABLE_MODULES + YES + CLANG_ENABLE_OBJC_ARC + NO + CLANG_WARN_BOOL_CONVERSION + YES + CLANG_WARN_CONSTANT_CONVERSION + YES + CLANG_WARN_DIRECT_OBJC_ISA_USAGE + YES + CLANG_WARN_EMPTY_BODY + YES + CLANG_WARN_ENUM_CONVERSION + YES + CLANG_WARN_INT_CONVERSION + YES + CLANG_WARN_OBJC_ROOT_CLASS + YES + COPY_PHASE_STRIP + YES + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + GCC_WARN_64_TO_32_BIT_CONVERSION + YES + GCC_WARN_ABOUT_RETURN_TYPE + YES + GCC_WARN_UNDECLARED_SELECTOR + YES + GCC_WARN_UNINITIALIZED_AUTOS + YES + GCC_WARN_UNUSED_FUNCTION + YES + GCC_WARN_UNUSED_VARIABLE + YES + IPHONEOS_DEPLOYMENT_TARGET + 6.0 + ONLY_ACTIVE_ARCH + YES + STRIP_INSTALLED_PRODUCT + NO + + isa + XCBuildConfiguration + name + Debug + + 1838A3B500F44F8DB5F266BC + + fileRef + 944E5547D96E477B847EC63D + isa + PBXBuildFile + + 188184B3188843398DAFCD4C + + containerPortal + 36E125D8CA594F8BB51F31A6 + isa + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + B76CC8E3C71346F493C2DD6E + remoteInfo + Pods-pop + + 1936C340BC934CB2A8575651 + fileRef + B65E724A8B05460CA96712BA + isa + PBXBuildFile + + 19E480A514424A338FAC399A + + includeInIndex + 1 isa PBXFileReference lastKnownFileType - wrapper.framework + sourcecode.c.objc name - Foundation.framework + UIBezierPath+AGKQuad.m path - Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework + Source/Categories/UIBezierPath+AGKQuad.m sourceTree - DEVELOPER_DIR + <group> + + 1F103B3C43A741F2B4220C65 + + fileRef + EBE2A0FE0CFA4F84A2CC7714 + isa + PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + - 262C6AE8497C40729595B745 + 1F19A3789427431A9447947C includeInIndex 1 @@ -432,64 +595,70 @@ lastKnownFileType sourcecode.c.h name - POPAnimationInternal.h + POPAnimationEventInternal.h path - pop/POPAnimationInternal.h + pop/POPAnimationEventInternal.h sourceTree <group> - 26BBC722345148B986F3322F + 200C558922A84EB697A91DD6 - fileRef - EDF0CE2067884A3D90ACD2AB + includeInIndex + 1 isa - PBXBuildFile + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + POPAnimation.h + path + pop/POPAnimation.h + sourceTree + <group> - 2707FA8B77C041F684767927 + 20628FD14AF948F5A1DC6335 - children - - 1640EE7E9F28467C84E70439 - 492E4F189A1C4FDAAA719B23 - A79176C9B3804C67B9672757 - + includeInIndex + 1 isa - PBXGroup + PBXFileReference name - Products + POPAnimation.mm + path + pop/POPAnimation.mm sourceTree <group> - 27EA0C410B834396BC2F51C0 + 21272A1C881B4243995C2FEA fileRef - 89CCBA65D1294B2E85671F24 + DCFC3E8A78B54B32B2F0E894 isa PBXBuildFile - 2AA25184551B4214BFE35392 + 216CFA607E224B3FBF0DC027 - includeInIndex - 1 + children + + BA703954D69F4095A015CDCD + 2D606CF9117C4B22BA13FF73 + 1170964F416944FC866F5B84 + isa - PBXFileReference - lastKnownFileType - sourcecode.c.h + PBXGroup name - POPLayerExtras.h - path - pop/POPLayerExtras.h + Products sourceTree <group> - 2B1D1771701349A7991B3170 + 2179A499EB10463D8C8EA367 fileRef - 451325C6A19C4BD6A73DE8E2 + 819B35F852D741D1B9739118 isa PBXBuildFile - 2CB09A2B5C4B44BEBFD8C178 + 22E73AFBF9A34E3AAAF4E7A4 includeInIndex 1 @@ -498,154 +667,237 @@ lastKnownFileType sourcecode.c.h name - POPAnimatorPrivate.h + AGKCALayerAnimationBlockDelegate.h path - pop/POPAnimatorPrivate.h + Source/Classes/AGKCALayerAnimationBlockDelegate.h sourceTree <group> - 2CEB1E3183DF4A22A6A072E7 + 23E5E87D59B44ED68C190362 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.h + sourcecode.c.objc name - CALayer+AGKQuad.h + CGImageRef+AGK+CATransform3D.m path - Source/Categories/CALayer+AGKQuad.h + Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.m sourceTree <group> - 2D19CC87078F4301B1C4287E + 23EDDC7FF0654237A18523A7 - buildActionMask - 2147483647 - files - - 8BC66F19A4F4461785944A3D - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 2D1BC4D3A5B54FA8B6D62C02 - - fileRef - B055678840694059AD215839 - isa - PBXBuildFile - settings + baseConfigurationReference + FD9F1D44BF564839897295A8 + buildSettings - COMPILER_FLAGS - -fobjc-arc + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + YES + DSTROOT + /tmp/xcodeproj.dst + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Pods-pop-prefix.pch + GCC_VERSION + com.apple.compilers.llvm.clang.1_0 + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 6.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_LDFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + VALIDATE_PRODUCT + YES + isa + XCBuildConfiguration + name + Release - 2D68E26066BF496289C194D3 + 2431D102C7084FE1B6CB6C79 fileRef - ADD5E5976CDD42398D1B0DE3 + B9DF00972E144AC7A96FFE53 isa PBXBuildFile - 2ED07CBF717B4D19AE08905E + 24C417552FD241A584944318 fileRef - CD868E9D6D564BB6ABC86FD0 + F6EBC054E9814476A30AB200 isa PBXBuildFile settings COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + -fobjc-arc - 314EB805A88241C59B9A2BAA + 24FBED0690D24DB28035F8B2 includeInIndex 1 isa PBXFileReference - lastKnownFileType - sourcecode.c.h name - POPMath.h + TransformationMatrix.cpp path - pop/POPMath.h + pop/WebCore/TransformationMatrix.cpp sourceTree <group> - 3193ACC1F586452FB4249FA8 + 26B256BC488A43F291892A4E - fileRef - FEFAF8B2291F4EB9904623A9 + includeInIndex + 1 isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + POPBasicAnimationInternal.h + path + pop/POPBasicAnimationInternal.h + sourceTree + <group> - 33B8CD5169434E439691B2EB + 2A2FB6DC02C94382B259EAD4 fileRef - A1298D959C13484AAD3261FD + 9303CA42963B480386D6B044 isa PBXBuildFile settings COMPILER_FLAGS - -fobjc-arc + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - 36B43BC85E784EA3AB194E58 + 2B811D5E146641A0B9DB6CE1 children - 780241A8E0DB4E09A0942277 - C3F57D56EC2A4D20BB9C1646 + ABE669EA42A54104A9A63A34 + 9BF3E838E22742EFAB77044D isa PBXGroup name AGGeometryKit path - ../../../AGGeometryKit + AGGeometryKit + sourceTree + <group> + + 2D606CF9117C4B22BA13FF73 + + explicitFileType + archive.ar + includeInIndex + 0 + isa + PBXFileReference + path + libPods-AGGeometryKit.a + sourceTree + BUILT_PRODUCTS_DIR + + 2E9783BAF8C34C9795649C6B + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + AGKVector3D.m + path + Source/AGKVector3D.m + sourceTree + <group> + + 3080772B129A4D63A858E8A4 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + path + Pods-AGGeometryKit-prefix.pch sourceTree <group> - 371802E4837A41D7A9D38E98 + 3220194E980B451D98EC2233 fileRef - 6B0B697C20F7465789BFBB9F + 481C12B41C5F4AD099673ED5 isa PBXBuildFile - 390332F7C6E348EC90C48BE4 + 325330B6E5674718B84497AF fileRef - 063ACD99E26C466CAB76431D + 1170964F416944FC866F5B84 isa PBXBuildFile - 3C34F41CBEF64C349E272793 + 340D9AD132C641418A724822 + + buildConfigurations + + 13799A61960A4CC68DB0C8BB + DAB2380CB12B4E3BB03F2F0F + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 341DDAC65A8F439487E98D7A + includeInIndex + 1 isa PBXFileReference lastKnownFileType - wrapper.framework - name - IOKit.framework + sourcecode.c.h path - Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/IOKit.framework + Pods-pop-prefix.pch sourceTree - DEVELOPER_DIR + <group> - 3D0173973F4F4EF1A3B204F9 + 346C30896DAB4DC2A0FC6392 includeInIndex 1 @@ -654,42 +906,81 @@ lastKnownFileType sourcecode.c.h name - CGGeometry+AGGeometryKit.h + FloatConversion.h path - Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.h + pop/WebCore/FloatConversion.h sourceTree <group> - 3D05B7A343E448A7A9FF06CE + 349A649E8F3048E08E9E2B86 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.objc + sourcecode.c.h name - UIImage+AGK+CATransform3D.m + POPAction.h path - Source/Categories/UIImage+AGK+CATransform3D.m + pop/POPAction.h sourceTree <group> - 3D5290A7E81C4667B6C9EA18 + 36E125D8CA594F8BB51F31A6 - fileRef - B935C10BA42544279EB1FFDD + attributes + + LastUpgradeCheck + 0510 + + buildConfigurationList + 770CA86AFC9E4C29B5397B2F + compatibilityVersion + Xcode 3.2 + developmentRegion + English + hasScannedForEncodings + 0 isa - PBXBuildFile + PBXProject + knownRegions + + en + + mainGroup + 698519AEABB143DA81555D0A + productRefGroup + 216CFA607E224B3FBF0DC027 + projectDirPath + + projectReferences + + projectRoot + + targets + + DAE598EBA12B4C76816F8E9B + 031D675B8682411184C54A12 + B76CC8E3C71346F493C2DD6E + - 3DACEAB8B6374A6CB52F946D + 3715542684AB4E25BA5873DE - fileRef - A98E48E6A1234CFA8E75A14D + buildActionMask + 2147483647 + files + + D8E2B52B74554EC2B78B48CA + 8FC86054A78E406791128505 + 325330B6E5674718B84497AF + isa - PBXBuildFile + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 - 3F72F58854AB4E31A80C0CDD + 3790D3F86B164377AAA5F114 includeInIndex 1 @@ -698,69 +989,43 @@ lastKnownFileType sourcecode.c.h name - AGKLine.h + UIView+AGK+Properties.h path - Source/AGKLine.h + Source/Categories/UIView+AGK+Properties.h sourceTree <group> - 4004E281C73E4901AB670320 - - buildConfigurationList - 81291933D3EE4167B382A6D6 - buildPhases - - 2D19CC87078F4301B1C4287E - D0DA92EDFD864780A081A21B - - buildRules - - dependencies - - 7B05F6DA82894F2BA77BAE7C - 66E72DDE100C46ED95FC714F - - isa - PBXNativeTarget - name - Pods - productName - Pods - productReference - 1640EE7E9F28467C84E70439 - productType - com.apple.product-type.library.static - - 41BFAEA7E5F940EE80B2C991 + 3A68EE7FA73741FDA644C34C includeInIndex 1 isa PBXFileReference name - POPPropertyAnimation.mm + POPAnimationExtras.mm path - pop/POPPropertyAnimation.mm + pop/POPAnimationExtras.mm sourceTree <group> - 451325C6A19C4BD6A73DE8E2 + 3B62AB7F7A5946018296FD74 + buildConfigurations + + BC20005BCDFE4A3E9860F30B + 23EDDC7FF0654237A18523A7 + + defaultConfigurationIsVisible + 0 + defaultConfigurationName + Release isa - PBXFileReference - lastKnownFileType - wrapper.framework - name - SystemConfiguration.framework - path - Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/SystemConfiguration.framework - sourceTree - DEVELOPER_DIR + XCConfigurationList - 45D914DF7B304CC2A3A267A7 + 3B7F9E5474B54365B58BBC42 fileRef - 3D05B7A343E448A7A9FF06CE + 23E5E87D59B44ED68C190362 isa PBXBuildFile settings @@ -769,32 +1034,29 @@ -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - 4649BEC9A6FA4FAD85430D08 + 3B84ECA522D8472F8AD4FF45 fileRef - 21212DB6006F4F2D87D5F74A + D123BDE9E2974A91B35AD3C6 isa PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc - - 4670455E8B724F96BCE8473A + 3BF1C3641D9C46F7B307E4AD includeInIndex 1 isa PBXFileReference + lastKnownFileType + sourcecode.c.h name - POPGeometry.mm + POPDefines.h path - pop/POPGeometry.mm + pop/POPDefines.h sourceTree <group> - 48097D2712F747B1A05A5C93 + 3D0A8911AC7C4F46B8B5F9D6 includeInIndex 1 @@ -803,26 +1065,13 @@ lastKnownFileType sourcecode.c.h name - CGImageRef+AGK+CATransform3D.h + POPDecayAnimationInternal.h path - Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.h + pop/POPDecayAnimationInternal.h sourceTree <group> - 492E4F189A1C4FDAAA719B23 - - explicitFileType - archive.ar - includeInIndex - 0 - isa - PBXFileReference - path - libPods-AGGeometryKit.a - sourceTree - BUILT_PRODUCTS_DIR - - 4A333E2E5AD54441AA0D980B + 3F0D6F12968D4DA6BAF12747 includeInIndex 1 @@ -831,13 +1080,13 @@ lastKnownFileType sourcecode.c.h name - POPAnimationTracer.h + CALayer+AGK+Properties.h path - pop/POPAnimationTracer.h + Source/Categories/CALayer+AGK+Properties.h sourceTree <group> - 4BB966BDFC2D463B80F8DB26 + 3F430697B8134B018D30FF7E includeInIndex 1 @@ -845,93 +1094,71 @@ PBXFileReference lastKnownFileType sourcecode.c.objc - name - CGImageRef+AGK+CATransform3D.m path - Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.m + Pods-dummy.m sourceTree <group> - 4DAD8B4DBF2E4E669C45C452 + 3F9B604B8AA14767897F4D27 fileRef - F36ACA0D3B7646D4BA6B3906 + C457A510F8B24D61BF7757E2 isa PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc - - 4E573EDBF313430F90FB85C6 + 4061E5F26E47437E95A09EEA includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.objc + sourcecode.c.h + name + POPSpringAnimationInternal.h path - Pods-pop-dummy.m + pop/POPSpringAnimationInternal.h sourceTree <group> - 51BEAD5B972841AF87C868EF + 40635A91D6B646D2B54A578D - baseConfigurationReference - D3945C669B474AA69A02918F - buildSettings + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + POPMath.h + path + pop/POPMath.h + sourceTree + <group> + + 4164CF3D9DCB4E31AF6DA392 + + fileRef + CD14F2A474E74B36AC503FD8 + isa + PBXBuildFile + settings - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Pods-AGGeometryKit-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - GCC_VERSION - com.apple.compilers.llvm.clang.1_0 - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 6.0 - OTHER_LDFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + + 428DA347076A4AE1A551895F + + fileRef + FDDE0800755E4BFD8AFA7190 isa - XCBuildConfiguration - name - Debug + PBXBuildFile - 53115C1A40F64E8797C8F3D2 + 440DF83A78D547A5B699F7D4 fileRef - A7F7001724B94AA496DFB48B + 3A68EE7FA73741FDA644C34C isa PBXBuildFile settings @@ -940,22 +1167,20 @@ -fobjc-arc - 5337F0743B8440708A61754D + 467B27F85D4F4E898605200E includeInIndex 1 isa PBXFileReference - lastKnownFileType - sourcecode.c.objc name - UIImage+AGKQuad.m + POPAnimatableProperty.mm path - Source/Categories/UIImage+AGKQuad.m + pop/POPAnimatableProperty.mm sourceTree <group> - 5360CA644CA947C0928B5FFB + 46F88D33BB4A4EF487E67F9F includeInIndex 1 @@ -964,105 +1189,50 @@ lastKnownFileType sourcecode.c.objc name - AGKMath.m + AGKCALayerAnimationBlockDelegate.m path - Source/AGKMath.m + Source/Classes/AGKCALayerAnimationBlockDelegate.m sourceTree <group> - 54C6A9B22D7B427FAA0193BE + 481C12B41C5F4AD099673ED5 includeInIndex 1 isa PBXFileReference lastKnownFileType - text.xcconfig + sourcecode.c.h + name + POPAnimator.h path - Pods.xcconfig + pop/POPAnimator.h sourceTree <group> - 552AC42960C14DC0983370D3 + 4AC3F2B2EC6B4621A8B5171D fileRef - 58B18A56B8B04140BD23DF00 + DADFA188A30F4C60A9584329 isa PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - 55D2AC48B7E64AA3BA8D2F17 + 4AEA892587C742F4A02F4D3D - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - CLANG_CXX_LANGUAGE_STANDARD - gnu++0x - CLANG_CXX_LIBRARY - libc++ - CLANG_ENABLE_MODULES - YES - CLANG_ENABLE_OBJC_ARC - NO - CLANG_WARN_BOOL_CONVERSION - YES - CLANG_WARN_CONSTANT_CONVERSION - YES - CLANG_WARN_DIRECT_OBJC_ISA_USAGE - YES - CLANG_WARN_EMPTY_BODY - YES - CLANG_WARN_ENUM_CONVERSION - YES - CLANG_WARN_INT_CONVERSION - YES - CLANG_WARN_OBJC_ROOT_CLASS - YES - COPY_PHASE_STRIP - YES - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - GCC_WARN_64_TO_32_BIT_CONVERSION - YES - GCC_WARN_ABOUT_RETURN_TYPE - YES - GCC_WARN_UNDECLARED_SELECTOR - YES - GCC_WARN_UNINITIALIZED_AUTOS - YES - GCC_WARN_UNUSED_FUNCTION - YES - GCC_WARN_UNUSED_VARIABLE - YES - IPHONEOS_DEPLOYMENT_TARGET - 6.0 - ONLY_ACTIVE_ARCH - YES - STRIP_INSTALLED_PRODUCT - NO - + includeInIndex + 1 isa - XCBuildConfiguration + PBXFileReference + lastKnownFileType + sourcecode.c.h name - Debug + POPBasicAnimation.h + path + pop/POPBasicAnimation.h + sourceTree + <group> - 55ECE90472984F4E8D39D10A + 4F60BA42B52E41D4811F090D includeInIndex 1 @@ -1071,16 +1241,49 @@ lastKnownFileType sourcecode.c.h name - AGKQuad.h + POPCustomAnimation.h path - Source/AGKQuad.h + pop/POPCustomAnimation.h + sourceTree + <group> + + 50AB7EA0BE6445E091E1A76F + + fileRef + D1997D461AA5473992D6A7A7 + isa + PBXBuildFile + + 51FB51AE6FA34C6AA97C8CC0 + + includeInIndex + 1 + isa + PBXFileReference + name + POPCustomAnimation.mm + path + pop/POPCustomAnimation.mm + sourceTree + <group> + + 542D543533C6432986D58F27 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + text.script.sh + path + Pods-resources.sh sourceTree <group> - 561589FD94644D579491FD18 + 5913F5FA986D49DBA031A60B fileRef - 7298F7718624423E9993A61F + CB2A21AB63EF43D68074D36C isa PBXBuildFile settings @@ -1089,32 +1292,83 @@ -fobjc-arc - 566CFB39121446039B8A7972 + 5979691791734254881A44C0 fileRef - 7554F78820D540B2A0AF11BF + 745B072F47E24058B42FB4DC isa PBXBuildFile - 58B18A56B8B04140BD23DF00 + 5D3655B56BB443FB83909004 - includeInIndex - 1 + children + + 346C30896DAB4DC2A0FC6392 + A0E65658C025442083992668 + 349A649E8F3048E08E9E2B86 + 7D60B623174748A2B24F92EB + 467B27F85D4F4E898605200E + 200C558922A84EB697A91DD6 + 20628FD14AF948F5A1DC6335 + B65E724A8B05460CA96712BA + 690E405241F94567AFAD1042 + 1F19A3789427431A9447947C + E4A35243651A49A2815C0B3D + 3A68EE7FA73741FDA644C34C + C1EA5754F42842B086E7735C + BC9156AA02184B0CBD361C92 + FDD5A99DA7574598AF633FFD + DB40A47F3214462085C39DC4 + 6DE1488BB08041F1A1734789 + BC128C3FEC9249D28109CA43 + BC6ACDA26EEE464FA60F8025 + 481C12B41C5F4AD099673ED5 + 61ED7CABD5AE4305A3FD607A + 7DF36C25C387454094A06D72 + 4AEA892587C742F4A02F4D3D + CB2A21AB63EF43D68074D36C + 26B256BC488A43F291892A4E + 0288007D60CB4A5887FF70BC + 9489C163068849C182EB7C06 + 4F60BA42B52E41D4811F090D + 51FB51AE6FA34C6AA97C8CC0 + 9D5EAC06CD3E45B693071DB6 + 112886186D024596A7BD4CC6 + 3D0A8911AC7C4F46B8B5F9D6 + 3BF1C3641D9C46F7B307E4AD + A9E2877F345F4EF4A2D4A6FB + 6FE5473E1D994CAAAF2F3F21 + 819B35F852D741D1B9739118 + 8C42DF3C67CB4B9DA56E8AE6 + 40635A91D6B646D2B54A578D + DFBE8B76AE764C7FA82BDED5 + 7B9C08F36DF64B20BA05A392 + 0AA7623D75AF4C17A567AF58 + B9DF00972E144AC7A96FFE53 + 052E67BCC124410E97EDD696 + 7CFC9C6DC5DA4B79B42FC6BB + 4061E5F26E47437E95A09EEA + F78A20EE0A8749B095A75646 + 63DE76EA18174F3E9E9D2924 + F6EBC054E9814476A30AB200 + 24FBED0690D24DB28035F8B2 + 86C8809A542840A8B37B2F28 + 92E341C551AA42B49F722056 + 8425379AF99B48238995FC6B + isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc + PBXGroup name - CGGeometry+AGGeometryKit.m + pop path - Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.m + pop sourceTree <group> - 5A6EDA09A61740688C3A3F31 + 5E2A11122BBE496D8749CE17 fileRef - BD9D0C8AB2D34896B6C2B06B + 0AA7623D75AF4C17A567AF58 isa PBXBuildFile settings @@ -1123,106 +1377,145 @@ -fobjc-arc - 5AF1B4DADEA6497A9736576E + 5E2FE7254C6D4E74B23421B6 + + fileRef + AF1E4CEC46CC4CA28BD3B875 + isa + PBXBuildFile + + 5E815FAEA46645829D901D9B + + fileRef + 40635A91D6B646D2B54A578D + isa + PBXBuildFile + + 5FD522DAB44F4FB991D2FBCD includeInIndex 1 isa PBXFileReference + lastKnownFileType + sourcecode.c.h name - POPBasicAnimation.mm + AGGeometryKit.h path - pop/POPBasicAnimation.mm + Source/AGGeometryKit.h sourceTree <group> - 5D00A561D4E04C2A9DDD6299 + 60EF760B1A124B088175EACA + + fileRef + 0791591A10184C2EAF08F19A + isa + PBXBuildFile + + 61ED7CABD5AE4305A3FD607A includeInIndex 1 isa PBXFileReference name - POPAnimationTracer.mm + POPAnimator.mm path - pop/POPAnimationTracer.mm + pop/POPAnimator.mm sourceTree <group> - 5EEEADE2A3984C51A224BE4B + 62375A051E854C00A23D226A + fileRef + B01C7CBE96104B04A1066412 isa - PBXFileReference - lastKnownFileType - wrapper.framework - name - UIKit.framework - path - Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/UIKit.framework - sourceTree - DEVELOPER_DIR + PBXBuildFile - 5F8AFBC2DE364275A76F177A + 626D849E521B4D2AB78391E4 fileRef - D7F59412C06241F2B1BDD71E + 20628FD14AF948F5A1DC6335 isa PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc + - 605E69D2EC4F4A169979F004 + 63DE76EA18174F3E9E9D2924 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.objc + sourcecode.c.h name - AGKCALayerAnimationBlockDelegate.m + POPVector.h path - Source/Classes/AGKCALayerAnimationBlockDelegate.m + pop/POPVector.h sourceTree <group> - 64B13BFD57D442C58C3B6245 + 66AA8B745DE04DD5B6169024 fileRef - 3D0173973F4F4EF1A3B204F9 + 112886186D024596A7BD4CC6 isa PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc + - 65F25285145B424B910F3003 + 690E405241F94567AFAD1042 includeInIndex 1 isa PBXFileReference - lastKnownFileType - sourcecode.c.h name - POPBasicAnimation.h + POPAnimationEvent.mm path - pop/POPBasicAnimation.h + pop/POPAnimationEvent.mm sourceTree <group> - 66E72DDE100C46ED95FC714F + 698519AEABB143DA81555D0A + children + + D86388DEA2D94C8BB08BB7E4 + D8A7E614924F4E6FBC062BCF + 10CA3244C36248D3B2F1F07B + 216CFA607E224B3FBF0DC027 + 9F358DB5C9AC46A586B8A4B0 + isa - PBXTargetDependency - target - B5433746A30A4A75948A9105 - targetProxy - FFCB62AEFEF44BA2A2AB6379 + PBXGroup + sourceTree + <group> - 6854ECD1E6B34A32A4BA2038 + 6DE1488BB08041F1A1734789 - fileRef - 989151A48DFF4B3CB191219F + includeInIndex + 1 isa - PBXBuildFile + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + POPAnimationTracer.h + path + pop/POPAnimationTracer.h + sourceTree + <group> - 6962868C0A164C33918490ED + 6EB970B439BC405E8D6BED20 includeInIndex 1 @@ -1231,106 +1524,141 @@ lastKnownFileType sourcecode.c.h name - POPGeometry.h + UIImage+AGKQuad.h path - pop/POPGeometry.h + Source/Categories/UIImage+AGKQuad.h sourceTree <group> - 6B0B697C20F7465789BFBB9F + 6FE5473E1D994CAAAF2F3F21 includeInIndex 1 isa PBXFileReference - lastKnownFileType - sourcecode.c.h name - POPAnimatableProperty.h + POPGeometry.mm path - pop/POPAnimatableProperty.h + pop/POPGeometry.mm sourceTree <group> - 6B1A1536DBB74DBEB184783F + 70BB682AF053477AB7A0F8B2 fileRef - FD1FCA001F964F788295B320 + 96F79CF015B441FF95CB29DB isa PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - 6EBC36FFF2274F079E159355 + 713A7D73D489432FAC4E5D6B fileRef - 8DCF97614AEA465B96266995 + C1EA5754F42842B086E7735C isa PBXBuildFile - 6EFB4160DCD140C1AA6E1E94 + 71E4BDE9C18F4B23892563B4 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.h + sourcecode.c.objc name - POPPropertyAnimationInternal.h + AGKQuad.m path - pop/POPPropertyAnimationInternal.h + Source/AGKQuad.m sourceTree <group> - 706B5EFB2D424FE5AA037768 + 7394AB7464774F04B2C7BDC1 - includeInIndex - 1 + fileRef + 51FB51AE6FA34C6AA97C8CC0 isa - PBXFileReference - lastKnownFileType - text.xcconfig - path - Pods-pop-Private.xcconfig - sourceTree - <group> + PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc + + + 743182DA57FC45D09BFF9E2A + + fileRef + 0D3086051F6342C39C866590 + isa + PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + - 7298F7718624423E9993A61F + 745B072F47E24058B42FB4DC includeInIndex 1 isa PBXFileReference + lastKnownFileType + sourcecode.c.h name - POPAnimator.mm + UIImage+AGK+CATransform3D.h path - pop/POPAnimator.mm + Source/Categories/UIImage+AGK+CATransform3D.h sourceTree <group> - 739EF2A884B04A3EAB8683B8 + 745F7DE0707541E5BC238547 - buildActionMask - 2147483647 - files + fileRef + 8A874FE0B63A4F279EBE761B + isa + PBXBuildFile + + 770CA86AFC9E4C29B5397B2F + + buildConfigurations - 2D68E26066BF496289C194D3 - C415A4A25CD94CC6A9B1710A - F203B4A50ACE45058039F0A8 - 27EA0C410B834396BC2F51C0 - 2B1D1771701349A7991B3170 - D67496F5AEDC4062948B05E6 + 178262966CA74767BDABB7D2 + 9935A51833D34E36BBD32DAC - isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing + defaultConfigurationIsVisible 0 + defaultConfigurationName + Release + isa + XCConfigurationList + + 786E7B04A7914CB6931712E7 + + fileRef + 4AEA892587C742F4A02F4D3D + isa + PBXBuildFile + + 78D86D0246FC4EE8B34DAB92 + + fileRef + 9BD51F2822414C579230D800 + isa + PBXBuildFile + + 792D57AC45DC41EA8A5479BC + + fileRef + BD09EECEE0F841A48537B43A + isa + PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + - 7554F78820D540B2A0AF11BF + 7B9C08F36DF64B20BA05A392 includeInIndex 1 @@ -1339,126 +1667,101 @@ lastKnownFileType sourcecode.c.h name - UIImage+AGKQuad.h + POPPropertyAnimation.h path - Source/Categories/UIImage+AGKQuad.h + pop/POPPropertyAnimation.h sourceTree <group> - 755E0C97746B42EE82A041A3 + 7C4AE384B8C24D93A2C1CBC0 fileRef - ECF413832C7942ECAC114EFF + DFBE8B76AE764C7FA82BDED5 isa PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc + - 75DEA1E879D14B4D93A91741 + 7CFC9C6DC5DA4B79B42FC6BB - fileRef - B608DE7FE94D412AB2AE4F8E + includeInIndex + 1 isa - PBXBuildFile + PBXFileReference + name + POPSpringAnimation.mm + path + pop/POPSpringAnimation.mm + sourceTree + <group> + + 7D60B623174748A2B24F92EB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + POPAnimatableProperty.h + path + pop/POPAnimatableProperty.h + sourceTree + <group> - 780241A8E0DB4E09A0942277 + 7DF36C25C387454094A06D72 - children - - AF91155DE5B148B6B262039E - C30B424E845341DBBEFA7C89 - D7F59412C06241F2B1BDD71E - 0C270BEB5AF7422B9C8EA892 - EDF0CE2067884A3D90ACD2AB - 06F6C91A345F49728AF6E0E5 - 605E69D2EC4F4A169979F004 - 063ACD99E26C466CAB76431D - FB042503B17F4650BBE4B041 - 3F72F58854AB4E31A80C0CDD - C2449605C2154F90AD951A5D - D5683F702F894BDE9C4199BC - 5360CA644CA947C0928B5FFB - 55ECE90472984F4E8D39D10A - FD1FCA001F964F788295B320 - A98E48E6A1234CFA8E75A14D - FEFAF8B2291F4EB9904623A9 - F24E5F6119A44815965B5873 - 0FF2747EEE09444DA275C19F - E9101FA261B94E97AB3E1676 - 93FB81F4F74D48E892BC3246 - B608DE7FE94D412AB2AE4F8E - 98755DB591B044DE87D8758B - 2CEB1E3183DF4A22A6A072E7 - AC6228B0625445C7944EDE3B - 3D0173973F4F4EF1A3B204F9 - 58B18A56B8B04140BD23DF00 - 48097D2712F747B1A05A5C93 - 4BB966BDFC2D463B80F8DB26 - ECF413832C7942ECAC114EFF - AC98E906535641F8BF9066F9 - C9A48EEF9CDF4430B8ECAE8C - B9914B9F11E8432EA442A3D7 - 989151A48DFF4B3CB191219F - 3D05B7A343E448A7A9FF06CE - 7554F78820D540B2A0AF11BF - 5337F0743B8440708A61754D - A549BC22E2324E448C54AAE4 - CD868E9D6D564BB6ABC86FD0 - 871E36011D804307A03D67D5 - D4DD4B6738D747F988793E41 - + includeInIndex + 1 isa - PBXGroup + PBXFileReference + lastKnownFileType + sourcecode.c.h name - Core + POPAnimatorPrivate.h + path + pop/POPAnimatorPrivate.h sourceTree <group> - 7980948E5B9A4DC5AD05EF4F + 7EC892C6209D48B1A1A8E130 fileRef - 6EFB4160DCD140C1AA6E1E94 + 17093128A47A4EBDAE8AB7C6 isa PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + - 7A5490EF710A4422A56FBC87 + 7EE7EC5146C544A5996AF662 - children - - 19329B5FB5EE411F8C9F35BA - 706B5EFB2D424FE5AA037768 - 4E573EDBF313430F90FB85C6 - B467E9730D424444BF3B4D7A - + fileRef + 0FB3D82FEAE34458BFF98594 isa - PBXGroup - name - Support Files - sourceTree - SOURCE_ROOT + PBXBuildFile - 7B007617414949A4BABA2671 + 7F7161383E99447CAFF96693 - buildConfigurations - - 51BEAD5B972841AF87C868EF - DF75F0B7DBE141728CC2CB0B - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release + fileRef + 90C5396C8DA34A4ABC61418F isa - XCConfigurationList + PBXBuildFile - 7B05F6DA82894F2BA77BAE7C + 8136C3101DFF4C88A86AFD7B + fileRef + 3F430697B8134B018D30FF7E isa - PBXTargetDependency - target - D68400D91DAB42B6B312BF06 - targetProxy - E21691612B884BEB8E1E4589 + PBXBuildFile - 7E130E6B5E88412CAC83E91C + 819B35F852D741D1B9739118 includeInIndex 1 @@ -1467,129 +1770,85 @@ lastKnownFileType sourcecode.c.h name - POPAnimationRuntime.h + POPLayerExtras.h path - pop/POPAnimationRuntime.h + pop/POPLayerExtras.h sourceTree <group> - 8025F914CED14843ADB06F71 + 82C499C3B2FC48E0B3B2E183 - fileRef - 989647C578C644F4AD9DD181 + buildActionMask + 2147483647 + files + + A1CCC07ADCE44B6FBF5B1D18 + 7EE7EC5146C544A5996AF662 + 21272A1C881B4243995C2FEA + 62375A051E854C00A23D226A + 428DA347076A4AE1A551895F + BC09A3BB4F744EE883AD8C5D + 50AB7EA0BE6445E091E1A76F + 7F7161383E99447CAFF96693 + 60EF760B1A124B088175EACA + 70BB682AF053477AB7A0F8B2 + A4DBE4BB6DF448B9B02E4F72 + CCB66DFFCF55497BA579E295 + F4BC9666AC394DED9B6B01A4 + 086992FE964C477288CEF06A + 032D7B05FF8D4D6FB4C9B620 + C2A57A37D4504D29B759B8CC + AFDF558E4C2045BB90DBCB8F + 3F9B604B8AA14767897F4D27 + 5E2FE7254C6D4E74B23421B6 + 5979691791734254881A44C0 + FC6C6D89B1F64ADE8D14AE1C + A3C77B4431C349BFA8163D86 + 85009EF6B06B425A964F84E5 + isa - PBXBuildFile + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 - 81291933D3EE4167B382A6D6 + 8425379AF99B48238995FC6B - buildConfigurations + children - A8FEA3D31BC046FBA38F1F80 - 870367BC2DD14BF881CD2BE9 + F52AAAB738C24CFC8E29287A + FD9F1D44BF564839897295A8 + BED09726BEB747AA944853A7 + 341DDAC65A8F439487E98D7A - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release isa - XCConfigurationList + PBXGroup + name + Support Files + sourceTree + SOURCE_ROOT - 824D8587F97C486B9DF28052 + 85009EF6B06B425A964F84E5 fileRef - 06F6C91A345F49728AF6E0E5 + 3790D3F86B164377AAA5F114 isa PBXBuildFile - 841C81FCCE64408BAF36B32E - - buildActionMask - 2147483647 - files - - DFDD37F22F56442AB2BB2C83 - 33B8CD5169434E439691B2EB - F7481D200EBC4F69B079A1CF - 4649BEC9A6FA4FAD85430D08 - 07C5BF1F35264B1D9B2DA07E - 98D1571229EF4F23B8BE5FF2 - 561589FD94644D579491FD18 - F599FFFCBB1D47678C4B8A2E - BE94223957924E6093735D2B - 53115C1A40F64E8797C8F3D2 - 4DAD8B4DBF2E4E669C45C452 - F5A048680EEA45A9B7403BA6 - BEE80A3FF8D840FFB4D0EBB2 - 5A6EDA09A61740688C3A3F31 - A9B8405B5AB343F29E67C6FC - 9C419C8C897A444A84B8CBCE - 2D1BC4D3A5B54FA8B6D62C02 - AEAB4F8F9D454F289B0C7436 - C050BF08F8C0443087F4B26D - - isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 - - 8545EDD0E8E64E86BDAB1229 + 863B159BDD4D4267B5AF366A fileRef - EF6430F6C0DC4D3BB489DDA4 + 944E5547D96E477B847EC63D isa PBXBuildFile - 870367BC2DD14BF881CD2BE9 + 8696239A0AF14E83B84C5DDE - baseConfigurationReference - 54C6A9B22D7B427FAA0193BE - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_VERSION - com.apple.compilers.llvm.clang.1_0 - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 6.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - + fileRef + 26B256BC488A43F291892A4E isa - XCBuildConfiguration - name - Release + PBXBuildFile - 871E36011D804307A03D67D5 + 86C8809A542840A8B37B2F28 includeInIndex 1 @@ -1598,75 +1857,95 @@ lastKnownFileType sourcecode.c.h name - UIView+AGK+Properties.h + TransformationMatrix.h path - Source/Categories/UIView+AGK+Properties.h + pop/WebCore/TransformationMatrix.h sourceTree <group> - 872BFB288F104682ABD4E604 + 872FFDD04185427FBE44B172 - buildActionMask - 2147483647 - files - - F0916E42C200458C9F5180C2 - + fileRef + 4061E5F26E47437E95A09EEA isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 + PBXBuildFile + + 89D74170960D4AC68BEDFF30 + + fileRef + BC128C3FEC9249D28109CA43 + isa + PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc + - 89CCBA65D1294B2E85671F24 + 8A874FE0B63A4F279EBE761B isa PBXFileReference lastKnownFileType wrapper.framework name - QuartzCore.framework + UIKit.framework path - Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/QuartzCore.framework + Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/UIKit.framework sourceTree DEVELOPER_DIR - 8A67FA75C9934F8FBAC9C80F + 8C42DF3C67CB4B9DA56E8AE6 includeInIndex 1 isa PBXFileReference - lastKnownFileType - sourcecode.c.h name - POPAnimationExtras.h + POPLayerExtras.mm path - pop/POPAnimationExtras.h + pop/POPLayerExtras.mm sourceTree <group> - 8B240FA0448D40CA8BE0EBCC + 8C90EB43910B4014BAA628FD fileRef - 2CEB1E3183DF4A22A6A072E7 + 2E9783BAF8C34C9795649C6B isa PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + - 8BC66F19A4F4461785944A3D + 8FC86054A78E406791128505 fileRef - 2119195649A147A584062E90 + 2D606CF9117C4B22BA13FF73 isa PBXBuildFile - 8C2D95F5D31E4D52904A6FF1 + 909269803BE14A99AA3EAFEF - fileRef - 24C68F69B327460F8E7CC34E + buildActionMask + 2147483647 + files + + 076A7DC034B748D38743ABE4 + 863B159BDD4D4267B5AF366A + 78D86D0246FC4EE8B34DAB92 + 3B84ECA522D8472F8AD4FF45 + E6DA5443ED6047DBAAED5771 + 745F7DE0707541E5BC238547 + isa - PBXBuildFile + PBXFrameworksBuildPhase + runOnlyForDeploymentPostprocessing + 0 - 8DCF97614AEA465B96266995 + 90C5396C8DA34A4ABC61418F includeInIndex 1 @@ -1675,13 +1954,20 @@ lastKnownFileType sourcecode.c.h name - POPVector.h + AGKLine.h path - pop/POPVector.h + Source/AGKLine.h sourceTree <group> - 90FDE5632FAA4701A82DE206 + 911EEBE87959404C98A421F4 + + fileRef + A0E65658C025442083992668 + isa + PBXBuildFile + + 92E341C551AA42B49F722056 includeInIndex 1 @@ -1690,20 +1976,13 @@ lastKnownFileType sourcecode.c.h name - POPDecayAnimationInternal.h + UnitBezier.h path - pop/POPDecayAnimationInternal.h + pop/WebCore/UnitBezier.h sourceTree <group> - 93B97021A34E44B083ADA452 - - fileRef - 1BC6AF7E602B4368862CF25D - isa - PBXBuildFile - - 93FB81F4F74D48E892BC3246 + 9303CA42963B480386D6B044 includeInIndex 1 @@ -1712,46 +1991,39 @@ lastKnownFileType sourcecode.c.objc name - CALayer+AGK+Methods.m + CALayer+AGKQuad.m path - Source/Categories/CALayer+AGK+Methods.m + Source/Categories/CALayer+AGKQuad.m sourceTree <group> - 98755DB591B044DE87D8758B + 944E5547D96E477B847EC63D - includeInIndex - 1 isa PBXFileReference lastKnownFileType - sourcecode.c.objc + wrapper.framework name - CALayer+AGK+Properties.m + Foundation.framework path - Source/Categories/CALayer+AGK+Properties.m + Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/Foundation.framework sourceTree - <group> + DEVELOPER_DIR - 98768F78BEFF49EC9619FA2D + 9489C163068849C182EB7C06 - children - - ADD5E5976CDD42398D1B0DE3 - 24C68F69B327460F8E7CC34E - 3C34F41CBEF64C349E272793 - 89CCBA65D1294B2E85671F24 - 451325C6A19C4BD6A73DE8E2 - 5EEEADE2A3984C51A224BE4B - + includeInIndex + 1 isa - PBXGroup + PBXFileReference name - iOS + POPCGUtils.mm + path + pop/POPCGUtils.mm sourceTree <group> - 989151A48DFF4B3CB191219F + 95F74D1C0E1D430FAA56436C includeInIndex 1 @@ -1760,13 +2032,13 @@ lastKnownFileType sourcecode.c.h name - UIImage+AGK+CATransform3D.h + AGKTransformPixelMapper.h path - Source/Categories/UIImage+AGK+CATransform3D.h + Source/Classes/AGKTransformPixelMapper.h sourceTree <group> - 989647C578C644F4AD9DD181 + 96F79CF015B441FF95CB29DB includeInIndex 1 @@ -1775,177 +2047,172 @@ lastKnownFileType sourcecode.c.h name - POPCustomAnimation.h + AGKQuad.h path - pop/POPCustomAnimation.h + Source/AGKQuad.h sourceTree <group> - 98D1571229EF4F23B8BE5FF2 + 98CD840EABDB4D779B813418 fileRef - 5D00A561D4E04C2A9DDD6299 + 92E341C551AA42B49F722056 isa PBXBuildFile - settings + + 9935A51833D34E36BBD32DAC + + buildSettings - COMPILER_FLAGS - -fobjc-arc + ALWAYS_SEARCH_USER_PATHS + NO + CLANG_CXX_LANGUAGE_STANDARD + gnu++0x + CLANG_CXX_LIBRARY + libc++ + CLANG_ENABLE_MODULES + YES + CLANG_ENABLE_OBJC_ARC + NO + CLANG_WARN_BOOL_CONVERSION + YES + CLANG_WARN_CONSTANT_CONVERSION + YES + CLANG_WARN_DIRECT_OBJC_ISA_USAGE + YES + CLANG_WARN_EMPTY_BODY + YES + CLANG_WARN_ENUM_CONVERSION + YES + CLANG_WARN_INT_CONVERSION + YES + CLANG_WARN_OBJC_ROOT_CLASS + YES + COPY_PHASE_STRIP + NO + ENABLE_NS_ASSERTIONS + NO + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_WARN_64_TO_32_BIT_CONVERSION + YES + GCC_WARN_ABOUT_RETURN_TYPE + YES + GCC_WARN_UNDECLARED_SELECTOR + YES + GCC_WARN_UNINITIALIZED_AUTOS + YES + GCC_WARN_UNUSED_FUNCTION + YES + GCC_WARN_UNUSED_VARIABLE + YES + IPHONEOS_DEPLOYMENT_TARGET + 6.0 + STRIP_INSTALLED_PRODUCT + NO + VALIDATE_PRODUCT + YES - - 999DF370CCA549FFA185588A - - fileRef - 492E4F189A1C4FDAAA719B23 isa - PBXBuildFile + XCBuildConfiguration + name + Release - 9B7F077CE638410DA700C8A9 + 9AA6BC6A12594735876BF109 - fileRef - 0C270BEB5AF7422B9C8EA892 isa - PBXBuildFile + PBXTargetDependency + target + 031D675B8682411184C54A12 + targetProxy + AD3DE9263F214BEA85430E01 - 9BD06CFB7E4D4F9AACFA6685 + 9B801D95A7B749E0B5EC555B fileRef - AF91155DE5B148B6B262039E + 052E67BCC124410E97EDD696 isa PBXBuildFile - 9C20F4151F634EFDB32A856A + 9BD51F2822414C579230D800 - includeInIndex - 1 isa PBXFileReference + lastKnownFileType + wrapper.framework name - TransformationMatrix.cpp + IOKit.framework path - pop/WebCore/TransformationMatrix.cpp + Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/IOKit.framework sourceTree - <group> - - 9C419C8C897A444A84B8CBCE - - fileRef - 2490723988AD468D8F1CD483 - isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc - + DEVELOPER_DIR - 9FFBB9CB306647C688929F87 + 9BF3E838E22742EFAB77044D children - 98768F78BEFF49EC9619FA2D + EC9B64F5FB964906ADD46C07 + 125D826F29694559947EA6C9 + DADFA188A30F4C60A9584329 + 3080772B129A4D63A858E8A4 isa PBXGroup name - Frameworks + Support Files sourceTree - <group> + SOURCE_ROOT - A1298D959C13484AAD3261FD + 9D5EAC06CD3E45B693071DB6 includeInIndex 1 isa PBXFileReference + lastKnownFileType + sourcecode.c.h name - POPAnimation.mm + POPDecayAnimation.h path - pop/POPAnimation.mm + pop/POPDecayAnimation.h sourceTree <group> - A227903E62F14A4098D9D996 + 9DAAD14D205F4E1A9E7CA70F fileRef - 7E130E6B5E88412CAC83E91C + CA417AE225854D9EB527801C isa PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + - A26C77FC09D94D87B24AC912 + 9E15031D3A764AAAB8C83081 + + isa + PBXTargetDependency + target + B76CC8E3C71346F493C2DD6E + targetProxy + 188184B3188843398DAFCD4C + + 9F358DB5C9AC46A586B8A4B0 children - FF93525D583B4550A7B711A3 - FEEF40A21CE94658B98A83C1 - C7E1A35E156348158C25C18D - 6B0B697C20F7465789BFBB9F - B758A1BD9298412694FE1805 - 055138EFE69E4199BAE80811 - A1298D959C13484AAD3261FD - E6E8BF98F2744E59A6515C64 - F5845F37B0CA4EE2A93C5710 - EE0221E82ABD415E94C8C7B8 - 8A67FA75C9934F8FBAC9C80F - 21212DB6006F4F2D87D5F74A - 262C6AE8497C40729595B745 - 1BC6AF7E602B4368862CF25D - 7E130E6B5E88412CAC83E91C - F222E569428F4ACAB2ED2E83 - 4A333E2E5AD54441AA0D980B - 5D00A561D4E04C2A9DDD6299 - 202C6FE053544146800C4901 - B935C10BA42544279EB1FFDD - 7298F7718624423E9993A61F - 2CB09A2B5C4B44BEBFD8C178 - 65F25285145B424B910F3003 - 5AF1B4DADEA6497A9736576E - 106D41A2534E42729064082E - E9FFB068CAE14BA187F8FC19 - E626446FAB664EEAB57E5E60 - 989647C578C644F4AD9DD181 - A7F7001724B94AA496DFB48B - AE4FE3792F2341CE8A70291D - F36ACA0D3B7646D4BA6B3906 - 90FDE5632FAA4701A82DE206 - BFF91BF6400F42AF856B1FF2 - 6962868C0A164C33918490ED - 4670455E8B724F96BCE8473A - 2AA25184551B4214BFE35392 - E6864268595C4CE38B972C54 - 314EB805A88241C59B9A2BAA - BD9D0C8AB2D34896B6C2B06B - FCD5926565ED4F40B9867DAD - 41BFAEA7E5F940EE80B2C991 - 6EFB4160DCD140C1AA6E1E94 - AE8D2F55135142508FB0973A - 2490723988AD468D8F1CD483 - E310D7E4D69B4E749171975C - EF6430F6C0DC4D3BB489DDA4 - 8DCF97614AEA465B96266995 - B055678840694059AD215839 - 9C20F4151F634EFDB32A856A - 081E7AE7B5C943A3AA314E53 - E1BF14EC83C444FC91C5B119 - 7A5490EF710A4422A56FBC87 + DC6F278E5CAC4EFA955A249D isa PBXGroup name - pop - path - ../../../POP + Targets Support Files sourceTree <group> - A276AEA381E34B7E9836A2CC - - fileRef - C7E1A35E156348158C25C18D - isa - PBXBuildFile - - A2E93E23CD6B4EE187C00CF2 + A0E65658C025442083992668 includeInIndex 1 @@ -1953,116 +2220,93 @@ PBXFileReference lastKnownFileType sourcecode.c.h + name + POP.h path - Pods-environment.h + pop/POP.h sourceTree <group> - A4B61538A4FD4453A8CE84C1 + A1CCC07ADCE44B6FBF5B1D18 - buildActionMask - 2147483647 - files - - F8D508C4960D4114BB21BAF3 - E979B9E7B96B44ABB0524A4B - F3637BA2C6D14C2ABC910EC7 - C218FD49631C46C1AC8F815C - 6B1A1536DBB74DBEB184783F - 3193ACC1F586452FB4249FA8 - F567FACAF30E4AB6944F014C - DD47C801E69D4B9E9B929590 - 094B5BB6CA224615AF38B616 - 209D5F596E614EE8971A21F4 - 552AC42960C14DC0983370D3 - EEAEF6B3F6D04D07BFD783EC - 0CEA92BFFC984894A7DABC47 - 0669BEF43FBF4D718BB1AF3E - D94DAA7CBFB14B318EE8BB94 - 45D914DF7B304CC2A3A267A7 - AC3C6507D15F40A2864EF547 - 2ED07CBF717B4D19AE08905E - E39E857D990F4762ABEABF2B - + fileRef + 5FD522DAB44F4FB991D2FBCD isa - PBXSourcesBuildPhase - runOnlyForDeploymentPostprocessing - 0 + PBXBuildFile - A549BC22E2324E448C54AAE4 + A333D471A8674EAA87653379 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.h - name - UIView+AGK+AngleConverter.h + text.plist.xml path - Source/Categories/UIView+AGK+AngleConverter.h + Pods-acknowledgements.plist sourceTree <group> - A79176C9B3804C67B9672757 + A3C77B4431C349BFA8163D86 - explicitFileType - archive.ar - includeInIndex - 0 + fileRef + F6C4FC8510794EB989674D75 isa - PBXFileReference - path - libPods-pop.a - sourceTree - BUILT_PRODUCTS_DIR + PBXBuildFile - A7F7001724B94AA496DFB48B + A4DBE4BB6DF448B9B02E4F72 - includeInIndex - 1 + fileRef + 95F74D1C0E1D430FAA56436C isa - PBXFileReference - name - POPCustomAnimation.mm - path - pop/POPCustomAnimation.mm - sourceTree - <group> + PBXBuildFile - A8FEA3D31BC046FBA38F1F80 + A5DA2ABDCF5F42608868EBA0 + + fileRef + A7E77BEE6E244FA094553738 + isa + PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + + + A69268D64E764591BEFA6CA8 baseConfigurationReference - 54C6A9B22D7B427FAA0193BE + 125D826F29694559947EA6C9 buildSettings ALWAYS_SEARCH_USER_PATHS NO COPY_PHASE_STRIP - NO + YES DSTROOT /tmp/xcodeproj.dst GCC_C_LANGUAGE_STANDARD gnu99 - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 GCC_PRECOMPILE_PREFIX_HEADER YES - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO + GCC_PREFIX_HEADER + Pods-AGGeometryKit-prefix.pch GCC_VERSION com.apple.compilers.llvm.clang.1_0 INSTALL_PATH $(BUILT_PRODUCTS_DIR) IPHONEOS_DEPLOYMENT_TARGET 6.0 + OTHER_CFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + + OTHER_CPLUSPLUSFLAGS + + -DNS_BLOCK_ASSERTIONS=1 + $(inherited) + OTHER_LDFLAGS PRODUCT_NAME @@ -2073,184 +2317,267 @@ iphoneos SKIP_INSTALL YES + VALIDATE_PRODUCT + YES isa XCBuildConfiguration name - Debug + Release + + A6EFD2147B66435C9C3F84D4 + + fileRef + 86C8809A542840A8B37B2F28 + isa + PBXBuildFile + + A78D4537CF8843D188807475 + + fileRef + 19E480A514424A338FAC399A + isa + PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + - A98E48E6A1234CFA8E75A14D + A7E77BEE6E244FA094553738 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.h + sourcecode.c.objc name - AGKTransformPixelMapper.h + UIImage+AGKQuad.m path - Source/Classes/AGKTransformPixelMapper.h + Source/Categories/UIImage+AGKQuad.m + sourceTree + <group> + + A86F3A16B10746508F540500 + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + AGKMath.m + path + Source/AGKMath.m sourceTree <group> - A9B8405B5AB343F29E67C6FC + A944F4993DBF432CA8DA52B7 fileRef - 41BFAEA7E5F940EE80B2C991 + 346C30896DAB4DC2A0FC6392 isa PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc - - A9CC13BBFA1843A79AF4FB76 + A9E2877F345F4EF4A2D4A6FB + + includeInIndex + 1 + isa + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + POPGeometry.h + path + pop/POPGeometry.h + sourceTree + <group> + + ABE669EA42A54104A9A63A34 + + children + + 5FD522DAB44F4FB991D2FBCD + 0FB3D82FEAE34458BFF98594 + DCFC3E8A78B54B32B2F0E894 + B01C7CBE96104B04A1066412 + FDDE0800755E4BFD8AFA7190 + 22E73AFBF9A34E3AAAF4E7A4 + 46F88D33BB4A4EF487E67F9F + D1997D461AA5473992D6A7A7 + C506ED8433CC47F6A255E1B0 + 90C5396C8DA34A4ABC61418F + D3B86BAF7AD44EF38907289C + 0791591A10184C2EAF08F19A + A86F3A16B10746508F540500 + 96F79CF015B441FF95CB29DB + 71E4BDE9C18F4B23892563B4 + 95F74D1C0E1D430FAA56436C + C13631D75EA84427B033BEC0 + 16FB681309E4423A8ACDCE1A + 2E9783BAF8C34C9795649C6B + BD921B1CA18145BEAD12DE88 + EBE2A0FE0CFA4F84A2CC7714 + 3F0D6F12968D4DA6BAF12747 + 17093128A47A4EBDAE8AB7C6 + D2D2B9A6D5DD4AD9B6E80765 + 9303CA42963B480386D6B044 + D405693603354B0BB735BA7D + 0D3086051F6342C39C866590 + CD0553700BAC4467AF52EBFB + 23E5E87D59B44ED68C190362 + C457A510F8B24D61BF7757E2 + BD09EECEE0F841A48537B43A + AF1E4CEC46CC4CA28BD3B875 + 19E480A514424A338FAC399A + 745B072F47E24058B42FB4DC + 0182275BDDCD449F8BABFB15 + 6EB970B439BC405E8D6BED20 + A7E77BEE6E244FA094553738 + F6C4FC8510794EB989674D75 + CA417AE225854D9EB527801C + 3790D3F86B164377AAA5F114 + CD14F2A474E74B36AC503FD8 + + isa + PBXGroup + name + Core + sourceTree + <group> + + ACBE031166F4478087272D4E buildActionMask 2147483647 files - 1D5255F154D345D89E281AF2 - C6A83BE294D946678F7AFB3D - A276AEA381E34B7E9836A2CC - 371802E4837A41D7A9D38E98 - EF6FBE16596C40AC9AF00B89 - F2B80B474157447493BF9FDC - 1FD64DEBAB384FC3B370FC6D - EEA7062EF4004B64ADCC0F4C - AADBE8AEDD874990A78507F2 - 93B97021A34E44B083ADA452 - A227903E62F14A4098D9D996 - 1919548D1ECA4C8B846D572D - 18E46C0C23914F5D897BCC1D - 3D5290A7E81C4667B6C9EA18 - 0AD43144485244628DA96C86 - 02E9A42FFDD34F2A9393070B - B08387F012C045348437C41E - D166723B52E54412B443D4BE - 8025F914CED14843ADB06F71 - 0887DBB50AFA49A89CC03108 - EB0F61C2CF0E478CAF2332F5 - E7BC21EBFA9B4F8492A45CB3 - C49CA2ACD0D644B1BD954E6C - DB2D03E999394C9098033C60 - 036E65BCD93344C59AC15DD3 - C2115F88CBDD4A2F925D7784 - 7980948E5B9A4DC5AD05EF4F - 0CADE563C4124C29B59E2E85 - BE37D3857EB8496F822EA77C - 8545EDD0E8E64E86BDAB1229 - 6EBC36FFF2274F079E159355 - B2CEB7612B4F4339B96BFDA9 - EE0BF0313A934377892669DD + D827B7AFCE704BBAA957277F + AFC4C572EDC4403BBB3BE4B9 + FC77DE00B7B345D7AA19BB9E + CEE2118862214BB4ABB62547 + BBEB1C843AE44F41949B3A89 + 00E13166445742E992639585 + 8C90EB43910B4014BAA628FD + 1F103B3C43A741F2B4220C65 + 7EC892C6209D48B1A1A8E130 + 2A2FB6DC02C94382B259EAD4 + 743182DA57FC45D09BFF9E2A + 3B7F9E5474B54365B58BBC42 + 792D57AC45DC41EA8A5479BC + 4AC3F2B2EC6B4621A8B5171D + A78D4537CF8843D188807475 + B1CB34A3792C4D149D41A938 + A5DA2ABDCF5F42608868EBA0 + 9DAAD14D205F4E1A9E7CA70F + 4164CF3D9DCB4E31AF6DA392 isa - PBXHeadersBuildPhase + PBXSourcesBuildPhase runOnlyForDeploymentPostprocessing 0 - AADBE8AEDD874990A78507F2 - - fileRef - 262C6AE8497C40729595B745 - isa - PBXBuildFile - - AC3C6507D15F40A2864EF547 + AD3DE9263F214BEA85430E01 - fileRef - 5337F0743B8440708A61754D + containerPortal + 36E125D8CA594F8BB51F31A6 isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - + PBXContainerItemProxy + proxyType + 1 + remoteGlobalIDString + 031D675B8682411184C54A12 + remoteInfo + Pods-AGGeometryKit - AC6228B0625445C7944EDE3B + AE4C38BA5FAE4CEBADD6AECB - includeInIndex - 1 + buildActionMask + 2147483647 + files + + 0172E50A1D3A495F89DAD2B4 + 626D849E521B4D2AB78391E4 + BBD28BAE05224CF483C1D893 + 440DF83A78D547A5B699F7D4 + AFCFB2F577AA401B83139BC3 + 89D74170960D4AC68BEDFF30 + C2F903736AEB451C83A5E87E + 5913F5FA986D49DBA031A60B + BC2CCEE0AF1D475FA64B323F + 7394AB7464774F04B2C7BDC1 + 66AA8B745DE04DD5B6169024 + F93EEEB71203488A9D647B46 + F8AA2D709BF24D909F679575 + 7C4AE384B8C24D93A2C1CBC0 + 5E2A11122BBE496D8749CE17 + E9ED181A6B3C454BAFB84974 + 24C417552FD241A584944318 + F070D91354134411AA90690B + D8B4CC3DE88C48BFA432C635 + isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - CALayer+AGKQuad.m - path - Source/Categories/CALayer+AGKQuad.m - sourceTree - <group> + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 - AC98E906535641F8BF9066F9 + AF1E4CEC46CC4CA28BD3B875 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.objc + sourcecode.c.h name - NSValue+AGKQuad.m + UIBezierPath+AGKQuad.h path - Source/Categories/NSValue+AGKQuad.m + Source/Categories/UIBezierPath+AGKQuad.h sourceTree <group> - ADD5E5976CDD42398D1B0DE3 + AF545F04FB5A43008F5E3BCE + fileRef + 6DE1488BB08041F1A1734789 isa - PBXFileReference - lastKnownFileType - wrapper.framework - name - CoreGraphics.framework - path - Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/CoreGraphics.framework - sourceTree - DEVELOPER_DIR + PBXBuildFile - AE4FE3792F2341CE8A70291D + AFC4C572EDC4403BBB3BE4B9 - includeInIndex - 1 + fileRef + C506ED8433CC47F6A255E1B0 isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - POPDecayAnimation.h - path - pop/POPDecayAnimation.h - sourceTree - <group> + PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + - AE8D2F55135142508FB0973A + AFCFB2F577AA401B83139BC3 - includeInIndex - 1 + fileRef + DB40A47F3214462085C39DC4 isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - POPSpringAnimation.h - path - pop/POPSpringAnimation.h - sourceTree - <group> + PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc + - AEAB4F8F9D454F289B0C7436 + AFDF558E4C2045BB90DBCB8F fileRef - 4E573EDBF313430F90FB85C6 + CD0553700BAC4467AF52EBFB isa PBXBuildFile - AF91155DE5B148B6B262039E + B01C7CBE96104B04A1066412 includeInIndex 1 @@ -2259,40 +2586,52 @@ lastKnownFileType sourcecode.c.h name - AGGeometryKit.h + AGGeometryKitCoreGraphics.h path - Source/AGGeometryKit.h + Source/CoreGraphics_Extensions/AGGeometryKitCoreGraphics.h sourceTree <group> - B055678840694059AD215839 + B0E0EFA2C1DA4766946BDCD7 - includeInIndex - 1 + fileRef + BC9156AA02184B0CBD361C92 isa - PBXFileReference - name - POPVector.mm - path - pop/POPVector.mm - sourceTree - <group> + PBXBuildFile - B08387F012C045348437C41E + B144FCD11903417E90931CF5 fileRef - 106D41A2534E42729064082E + 349A649E8F3048E08E9E2B86 isa PBXBuildFile - B2CEB7612B4F4339B96BFDA9 + B1CB34A3792C4D149D41A938 fileRef - 081E7AE7B5C943A3AA314E53 + 0182275BDDCD449F8BABFB15 isa PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + + + B47072F0F0444C5BBF2687F8 + + buildActionMask + 2147483647 + files + + 8136C3101DFF4C88A86AFD7B + + isa + PBXSourcesBuildPhase + runOnlyForDeploymentPostprocessing + 0 - B467E9730D424444BF3B4D7A + B65E724A8B05460CA96712BA includeInIndex 1 @@ -2300,20 +2639,29 @@ PBXFileReference lastKnownFileType sourcecode.c.h + name + POPAnimationEvent.h path - Pods-pop-prefix.pch + pop/POPAnimationEvent.h sourceTree <group> - B5433746A30A4A75948A9105 + B66C97761EF54CECAA3FBE27 + + fileRef + 7DF36C25C387454094A06D72 + isa + PBXBuildFile + + B76CC8E3C71346F493C2DD6E buildConfigurationList - EA5348F4EF1E462FAA8DE671 + 3B62AB7F7A5946018296FD74 buildPhases - 841C81FCCE64408BAF36B32E - 872BFB288F104682ABD4E604 - A9CC13BBFA1843A79AF4FB76 + AE4C38BA5FAE4CEBADD6AECB + 09042E97C26F4A688E874F9A + C2C02678AF044075A48D5517 buildRules @@ -2326,11 +2674,11 @@ productName Pods-pop productReference - A79176C9B3804C67B9672757 + 1170964F416944FC866F5B84 productType com.apple.product-type.library.static - B608DE7FE94D412AB2AE4F8E + B9DF00972E144AC7A96FFE53 includeInIndex 1 @@ -2339,113 +2687,178 @@ lastKnownFileType sourcecode.c.h name - CALayer+AGK+Properties.h + POPPropertyAnimationInternal.h path - Source/Categories/CALayer+AGK+Properties.h + pop/POPPropertyAnimationInternal.h sourceTree <group> - B758A1BD9298412694FE1805 + BA703954D69F4095A015CDCD + explicitFileType + archive.ar includeInIndex - 1 + 0 isa PBXFileReference - name - POPAnimatableProperty.mm path - pop/POPAnimatableProperty.mm + libPods.a sourceTree - <group> + BUILT_PRODUCTS_DIR + + BBD28BAE05224CF483C1D893 + + fileRef + 690E405241F94567AFAD1042 + isa + PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc + + + BBEB1C843AE44F41949B3A89 + + fileRef + 71E4BDE9C18F4B23892563B4 + isa + PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + + + BC09A3BB4F744EE883AD8C5D + + fileRef + 22E73AFBF9A34E3AAAF4E7A4 + isa + PBXBuildFile - B935C10BA42544279EB1FFDD + BC128C3FEC9249D28109CA43 includeInIndex 1 isa PBXFileReference - lastKnownFileType - sourcecode.c.h name - POPAnimator.h + POPAnimationTracer.mm path - pop/POPAnimator.h + pop/POPAnimationTracer.mm sourceTree <group> - B9914B9F11E8432EA442A3D7 + BC20005BCDFE4A3E9860F30B + + baseConfigurationReference + FD9F1D44BF564839897295A8 + buildSettings + + ALWAYS_SEARCH_USER_PATHS + NO + COPY_PHASE_STRIP + NO + DSTROOT + /tmp/xcodeproj.dst + GCC_C_LANGUAGE_STANDARD + gnu99 + GCC_DYNAMIC_NO_PIC + NO + GCC_OPTIMIZATION_LEVEL + 0 + GCC_PRECOMPILE_PREFIX_HEADER + YES + GCC_PREFIX_HEADER + Pods-pop-prefix.pch + GCC_PREPROCESSOR_DEFINITIONS + + DEBUG=1 + $(inherited) + + GCC_SYMBOLS_PRIVATE_EXTERN + NO + GCC_VERSION + com.apple.compilers.llvm.clang.1_0 + INSTALL_PATH + $(BUILT_PRODUCTS_DIR) + IPHONEOS_DEPLOYMENT_TARGET + 6.0 + OTHER_LDFLAGS + + PRODUCT_NAME + $(TARGET_NAME) + PUBLIC_HEADERS_FOLDER_PATH + $(TARGET_NAME) + SDKROOT + iphoneos + SKIP_INSTALL + YES + + isa + XCBuildConfiguration + name + Debug + + BC2CCEE0AF1D475FA64B323F + + fileRef + 9489C163068849C182EB7C06 + isa + PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc + + + BC6ACDA26EEE464FA60F8025 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.objc + sourcecode.c.h name - UIBezierPath+AGKQuad.m + POPAnimationTracerInternal.h path - Source/Categories/UIBezierPath+AGKQuad.m + pop/POPAnimationTracerInternal.h sourceTree <group> - BD9D0C8AB2D34896B6C2B06B + BC9156AA02184B0CBD361C92 includeInIndex 1 isa PBXFileReference + lastKnownFileType + sourcecode.c.h name - POPMath.mm + POPAnimationPrivate.h path - pop/POPMath.mm + pop/POPAnimationPrivate.h sourceTree <group> - BDC31336CB384A8EB41A90E4 + BD09EECEE0F841A48537B43A includeInIndex 1 isa PBXFileReference lastKnownFileType - text + sourcecode.c.objc + name + NSValue+AGKQuad.m path - Pods-acknowledgements.markdown + Source/Categories/NSValue+AGKQuad.m sourceTree <group> - BE37D3857EB8496F822EA77C - - fileRef - E310D7E4D69B4E749171975C - isa - PBXBuildFile - - BE94223957924E6093735D2B - - fileRef - E626446FAB664EEAB57E5E60 - isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc - - - BEE80A3FF8D840FFB4D0EBB2 - - fileRef - E6864268595C4CE38B972C54 - isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc - - - BFF91BF6400F42AF856B1FF2 + BD921B1CA18145BEAD12DE88 includeInIndex 1 @@ -2454,77 +2867,26 @@ lastKnownFileType sourcecode.c.h name - POPDefines.h + CALayer+AGK+Methods.h path - pop/POPDefines.h - sourceTree - <group> - - C050BF08F8C0443087F4B26D - - fileRef - 9C20F4151F634EFDB32A856A - isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc - - - C05DA571741F47EF816EDDFD - - children - - 54C6A9B22D7B427FAA0193BE - BDC31336CB384A8EB41A90E4 - 0C800223A299408D863FD895 - 2119195649A147A584062E90 - A2E93E23CD6B4EE187C00CF2 - 0D21E5EBF406495CA169817D - - isa - PBXGroup - name - Pods + Source/Categories/CALayer+AGK+Methods.h sourceTree <group> - C1076A94C72D4710B00F2227 + BED09726BEB747AA944853A7 - children - - FCE0F20E13564EAB99680E17 - 1014D0ACDE2A45079EADCE0A - 9FFBB9CB306647C688929F87 - 2707FA8B77C041F684767927 - ECF76808AF3445A0A67A4FF0 - + includeInIndex + 1 isa - PBXGroup + PBXFileReference + lastKnownFileType + sourcecode.c.objc + path + Pods-pop-dummy.m sourceTree <group> - C2115F88CBDD4A2F925D7784 - - fileRef - FCD5926565ED4F40B9867DAD - isa - PBXBuildFile - - C218FD49631C46C1AC8F815C - - fileRef - 5360CA644CA947C0928B5FFB - isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - - C2449605C2154F90AD951A5D + C13631D75EA84427B033BEC0 includeInIndex 1 @@ -2533,13 +2895,13 @@ lastKnownFileType sourcecode.c.objc name - AGKLine.m + AGKTransformPixelMapper.m path - Source/AGKLine.m + Source/Classes/AGKTransformPixelMapper.m sourceTree <group> - C30B424E845341DBBEFA7C89 + C1EA5754F42842B086E7735C includeInIndex 1 @@ -2548,100 +2910,127 @@ lastKnownFileType sourcecode.c.h name - AGGeometryKitCategories.h + POPAnimationInternal.h path - Source/Categories/AGGeometryKitCategories.h + pop/POPAnimationInternal.h sourceTree <group> - C3F57D56EC2A4D20BB9C1646 - - children - - DAA940930BB244229C8ACB94 - D3945C669B474AA69A02918F - C976BE23D85D43B7AA46BF17 - DE6F08AFC20C4CE197CE9124 - - isa - PBXGroup - name - Support Files - sourceTree - SOURCE_ROOT - - C415A4A25CD94CC6A9B1710A + C2A57A37D4504D29B759B8CC fileRef - 24C68F69B327460F8E7CC34E + D405693603354B0BB735BA7D isa PBXBuildFile - C49CA2ACD0D644B1BD954E6C + C2C02678AF044075A48D5517 - fileRef - 6962868C0A164C33918490ED + buildActionMask + 2147483647 + files + + A944F4993DBF432CA8DA52B7 + 911EEBE87959404C98A421F4 + B144FCD11903417E90931CF5 + FC72283010AC4146B0E2B4CE + E1E56DCAD13E4B36AAF5E1C8 + 1936C340BC934CB2A8575651 + E2901AFD93B14E67959288E5 + 00EEA9DB1DB1474790C5C113 + 713A7D73D489432FAC4E5D6B + B0E0EFA2C1DA4766946BDCD7 + E917335B0172472CA52AFBF2 + AF545F04FB5A43008F5E3BCE + E26DCE3C798942D8B4A3ADF5 + 3220194E980B451D98EC2233 + B66C97761EF54CECAA3FBE27 + 786E7B04A7914CB6931712E7 + 8696239A0AF14E83B84C5DDE + DE16CFE72C524A718687007F + C5C1C320E98A451F96D92FE3 + D0D8CE95C00A42B895E0AA0A + DBEFEE19D9334012BB23E205 + 1347812C7CCA413D8F1B057D + 1420090EE57F4B53BDFA42D4 + 2179A499EB10463D8C8EA367 + 5E815FAEA46645829D901D9B + E511A18DF8FB4DDCABAC0829 + 2431D102C7084FE1B6CB6C79 + 9B801D95A7B749E0B5EC555B + 872FFDD04185427FBE44B172 + F33FBBF49031490AAE7AB517 + 136E32E74A1B417386088E1C + A6EFD2147B66435C9C3F84D4 + 98CD840EABDB4D779B813418 + isa - PBXBuildFile + PBXHeadersBuildPhase + runOnlyForDeploymentPostprocessing + 0 - C6A83BE294D946678F7AFB3D + C2F903736AEB451C83A5E87E fileRef - FEEF40A21CE94658B98A83C1 + 61ED7CABD5AE4305A3FD607A isa PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc + - C7E1A35E156348158C25C18D + C3987AD9E31C413D96CDEB71 - includeInIndex - 1 isa PBXFileReference lastKnownFileType - sourcecode.c.h + wrapper.framework name - POPAction.h + CoreGraphics.framework path - pop/POPAction.h + Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/CoreGraphics.framework sourceTree - <group> + DEVELOPER_DIR - C976BE23D85D43B7AA46BF17 + C457A510F8B24D61BF7757E2 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.objc + sourcecode.c.h + name + NSValue+AGKQuad.h path - Pods-AGGeometryKit-dummy.m + Source/Categories/NSValue+AGKQuad.h sourceTree <group> - C9A48EEF9CDF4430B8ECAE8C + C506ED8433CC47F6A255E1B0 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.h + sourcecode.c.objc name - UIBezierPath+AGKQuad.h + AGKCorner.m path - Source/Categories/UIBezierPath+AGKQuad.h + Source/AGKCorner.m sourceTree <group> - CBF89F5E6C32433DB13BB86B + C5C1C320E98A451F96D92FE3 fileRef - C9A48EEF9CDF4430B8ECAE8C + 4F60BA42B52E41D4811F090D isa PBXBuildFile - CD868E9D6D564BB6ABC86FD0 + CA417AE225854D9EB527801C includeInIndex 1 @@ -2656,181 +3045,104 @@ sourceTree <group> - CE38777B0620457BAFA8DC71 + CB2A21AB63EF43D68074D36C - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - CLANG_CXX_LANGUAGE_STANDARD - gnu++0x - CLANG_CXX_LIBRARY - libc++ - CLANG_ENABLE_MODULES - YES - CLANG_ENABLE_OBJC_ARC - NO - CLANG_WARN_BOOL_CONVERSION - YES - CLANG_WARN_CONSTANT_CONVERSION - YES - CLANG_WARN_DIRECT_OBJC_ISA_USAGE - YES - CLANG_WARN_EMPTY_BODY - YES - CLANG_WARN_ENUM_CONVERSION - YES - CLANG_WARN_INT_CONVERSION - YES - CLANG_WARN_OBJC_ROOT_CLASS - YES - COPY_PHASE_STRIP - NO - ENABLE_NS_ASSERTIONS - NO - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_WARN_64_TO_32_BIT_CONVERSION - YES - GCC_WARN_ABOUT_RETURN_TYPE - YES - GCC_WARN_UNDECLARED_SELECTOR - YES - GCC_WARN_UNINITIALIZED_AUTOS - YES - GCC_WARN_UNUSED_FUNCTION - YES - GCC_WARN_UNUSED_VARIABLE - YES - IPHONEOS_DEPLOYMENT_TARGET - 6.0 - STRIP_INSTALLED_PRODUCT - NO - VALIDATE_PRODUCT - YES - + includeInIndex + 1 isa - XCBuildConfiguration + PBXFileReference name - Release + POPBasicAnimation.mm + path + pop/POPBasicAnimation.mm + sourceTree + <group> - CF56ED8F9F5646699A71C243 + CCB66DFFCF55497BA579E295 - baseConfigurationReference - 706B5EFB2D424FE5AA037768 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - YES - DSTROOT - /tmp/xcodeproj.dst - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Pods-pop-prefix.pch - GCC_VERSION - com.apple.compilers.llvm.clang.1_0 - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 6.0 - OTHER_CFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_CPLUSPLUSFLAGS - - -DNS_BLOCK_ASSERTIONS=1 - $(inherited) - - OTHER_LDFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - VALIDATE_PRODUCT - YES - + fileRef + 16FB681309E4423A8ACDCE1A isa - XCBuildConfiguration - name - Release + PBXBuildFile - D0DA92EDFD864780A081A21B + CD0553700BAC4467AF52EBFB - buildActionMask - 2147483647 - files - - 8C2D95F5D31E4D52904A6FF1 - 999DF370CCA549FFA185588A - 19CF5785FB8843E4A1FE1FFB - + includeInIndex + 1 isa - PBXFrameworksBuildPhase - runOnlyForDeploymentPostprocessing - 0 + PBXFileReference + lastKnownFileType + sourcecode.c.h + name + CGImageRef+AGK+CATransform3D.h + path + Source/CoreGraphics_Extensions/CGImageRef+AGK+CATransform3D.h + sourceTree + <group> - D166723B52E54412B443D4BE + CD14F2A474E74B36AC503FD8 - fileRef - E9FFB068CAE14BA187F8FC19 + includeInIndex + 1 isa - PBXBuildFile + PBXFileReference + lastKnownFileType + sourcecode.c.objc + name + UIView+AGK+Properties.m + path + Source/Categories/UIView+AGK+Properties.m + sourceTree + <group> - D23E228FC1E54F95A04E288A + CEE2118862214BB4ABB62547 fileRef - A549BC22E2324E448C54AAE4 + A86F3A16B10746508F540500 isa PBXBuildFile + settings + + COMPILER_FLAGS + -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + - D2CD6F4DEF7E4F02BCB0B9B1 + D0D8CE95C00A42B895E0AA0A fileRef - D5683F702F894BDE9C4199BC + 9D5EAC06CD3E45B693071DB6 isa PBXBuildFile - D3945C669B474AA69A02918F + D123BDE9E2974A91B35AD3C6 - includeInIndex - 1 isa PBXFileReference lastKnownFileType - text.xcconfig + wrapper.framework + name + QuartzCore.framework path - Pods-AGGeometryKit-Private.xcconfig + Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/QuartzCore.framework sourceTree - <group> + DEVELOPER_DIR - D4DD4B6738D747F988793E41 + D1997D461AA5473992D6A7A7 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.objc + sourcecode.c.h name - UIView+AGK+Properties.m + AGKCorner.h path - Source/Categories/UIView+AGK+Properties.m + Source/AGKCorner.h sourceTree <group> - D5683F702F894BDE9C4199BC + D2D2B9A6D5DD4AD9B6E80765 includeInIndex 1 @@ -2839,45 +3151,28 @@ lastKnownFileType sourcecode.c.h name - AGKMath.h + CALayer+AGKQuad.h path - Source/AGKMath.h + Source/Categories/CALayer+AGKQuad.h sourceTree <group> - D67496F5AEDC4062948B05E6 - - fileRef - 5EEEADE2A3984C51A224BE4B - isa - PBXBuildFile - - D68400D91DAB42B6B312BF06 + D3B86BAF7AD44EF38907289C - buildConfigurationList - 7B007617414949A4BABA2671 - buildPhases - - A4B61538A4FD4453A8CE84C1 - 739EF2A884B04A3EAB8683B8 - F018BF863B3040F58DAE07CD - - buildRules - - dependencies - + includeInIndex + 1 isa - PBXNativeTarget + PBXFileReference + lastKnownFileType + sourcecode.c.objc name - Pods-AGGeometryKit - productName - Pods-AGGeometryKit - productReference - 492E4F189A1C4FDAAA719B23 - productType - com.apple.product-type.library.static + AGKLine.m + path + Source/AGKLine.m + sourceTree + <group> - D7F59412C06241F2B1BDD71E + D405693603354B0BB735BA7D includeInIndex 1 @@ -2886,16 +3181,16 @@ lastKnownFileType sourcecode.c.h name - AGGeometryKitClasses.h + CGGeometry+AGGeometryKit.h path - Source/Classes/AGGeometryKitClasses.h + Source/CoreGraphics_Extensions/CGGeometry+AGGeometryKit.h sourceTree <group> - D94DAA7CBFB14B318EE8BB94 + D827B7AFCE704BBAA957277F fileRef - B9914B9F11E8432EA442A3D7 + 46F88D33BB4A4EF487E67F9F isa PBXBuildFile settings @@ -2904,100 +3199,59 @@ -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - D950A8C6C1FA4C85826689C7 - - fileRef - C30B424E845341DBBEFA7C89 - isa - PBXBuildFile - - D9B7CC215BC24ADE9EA4AF9C - - attributes - - LastUpgradeCheck - 0510 - - buildConfigurationList - 032CD44AA9AC47BA8FD6EC47 - compatibilityVersion - Xcode 3.2 - developmentRegion - English - hasScannedForEncodings - 0 - isa - PBXProject - knownRegions - - en - - mainGroup - C1076A94C72D4710B00F2227 - productRefGroup - 2707FA8B77C041F684767927 - projectDirPath - - projectReferences - - projectRoot - - targets - - 4004E281C73E4901AB670320 - D68400D91DAB42B6B312BF06 - B5433746A30A4A75948A9105 - - - DAA940930BB244229C8ACB94 + D86388DEA2D94C8BB08BB7E4 includeInIndex 1 isa PBXFileReference lastKnownFileType - text.xcconfig + text + name + Podfile path - Pods-AGGeometryKit.xcconfig + ../Podfile sourceTree - <group> + SOURCE_ROOT + xcLanguageSpecificationIdentifier + xcode.lang.ruby - DB2D03E999394C9098033C60 + D8A7E614924F4E6FBC062BCF - fileRef - 2AA25184551B4214BFE35392 + children + + 148B7521D1634EE7AB602C07 + isa - PBXBuildFile + PBXGroup + name + Frameworks + sourceTree + <group> - DD47C801E69D4B9E9B929590 + D8B4CC3DE88C48BFA432C635 fileRef - 93FB81F4F74D48E892BC3246 + 24FBED0690D24DB28035F8B2 isa PBXBuildFile settings COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + -fobjc-arc - DE6F08AFC20C4CE197CE9124 + D8E2B52B74554EC2B78B48CA - includeInIndex - 1 + fileRef + 944E5547D96E477B847EC63D isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - path - Pods-AGGeometryKit-prefix.pch - sourceTree - <group> + PBXBuildFile - DF75F0B7DBE141728CC2CB0B + DAB2380CB12B4E3BB03F2F0F baseConfigurationReference - D3945C669B474AA69A02918F + E5A186E9B62F42F58BF3D3FA buildSettings ALWAYS_SEARCH_USER_PATHS @@ -3010,8 +3264,6 @@ gnu99 GCC_PRECOMPILE_PREFIX_HEADER YES - GCC_PREFIX_HEADER - Pods-AGGeometryKit-prefix.pch GCC_VERSION com.apple.compilers.llvm.clang.1_0 INSTALL_PATH @@ -3046,100 +3298,85 @@ name Release - DFDD37F22F56442AB2BB2C83 - - fileRef - B758A1BD9298412694FE1805 - isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc - - - E1BF14EC83C444FC91C5B119 + DADFA188A30F4C60A9584329 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.h - name - UnitBezier.h + sourcecode.c.objc path - pop/WebCore/UnitBezier.h + Pods-AGGeometryKit-dummy.m sourceTree <group> - E21691612B884BEB8E1E4589 + DAE598EBA12B4C76816F8E9B - containerPortal - D9B7CC215BC24ADE9EA4AF9C + buildConfigurationList + 340D9AD132C641418A724822 + buildPhases + + B47072F0F0444C5BBF2687F8 + 3715542684AB4E25BA5873DE + + buildRules + + dependencies + + 9AA6BC6A12594735876BF109 + 9E15031D3A764AAAB8C83081 + isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - D68400D91DAB42B6B312BF06 - remoteInfo - Pods-AGGeometryKit + PBXNativeTarget + name + Pods + productName + Pods + productReference + BA703954D69F4095A015CDCD + productType + com.apple.product-type.library.static - E310D7E4D69B4E749171975C + DB40A47F3214462085C39DC4 includeInIndex 1 isa PBXFileReference - lastKnownFileType - sourcecode.c.h name - POPSpringAnimationInternal.h + POPAnimationRuntime.mm path - pop/POPSpringAnimationInternal.h + pop/POPAnimationRuntime.mm sourceTree <group> - E39E857D990F4762ABEABF2B + DBEFEE19D9334012BB23E205 fileRef - D4DD4B6738D747F988793E41 + 3D0A8911AC7C4F46B8B5F9D6 isa PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - - E626446FAB664EEAB57E5E60 - - includeInIndex - 1 - isa - PBXFileReference - name - POPCGUtils.mm - path - pop/POPCGUtils.mm - sourceTree - <group> - E6864268595C4CE38B972C54 + DC6F278E5CAC4EFA955A249D - includeInIndex - 1 + children + + E5A186E9B62F42F58BF3D3FA + 0A475EE6172543CC95150148 + A333D471A8674EAA87653379 + 3F430697B8134B018D30FF7E + 132AFB233B84464CA38A2D92 + 542D543533C6432986D58F27 + isa - PBXFileReference + PBXGroup name - POPLayerExtras.mm - path - pop/POPLayerExtras.mm + Pods sourceTree <group> - E6E8BF98F2744E59A6515C64 + DCFC3E8A78B54B32B2F0E894 includeInIndex 1 @@ -3148,111 +3385,54 @@ lastKnownFileType sourcecode.c.h name - POPAnimationEvent.h + AGGeometryKitClasses.h path - pop/POPAnimationEvent.h + Source/Classes/AGGeometryKitClasses.h sourceTree <group> - E7BC21EBFA9B4F8492A45CB3 + DE16CFE72C524A718687007F fileRef - BFF91BF6400F42AF856B1FF2 + 0288007D60CB4A5887FF70BC isa PBXBuildFile - E9101FA261B94E97AB3E1676 + DFBE8B76AE764C7FA82BDED5 includeInIndex 1 isa PBXFileReference - lastKnownFileType - sourcecode.c.h name - CALayer+AGK+Methods.h + POPMath.mm path - Source/Categories/CALayer+AGK+Methods.h + pop/POPMath.mm sourceTree <group> - E979B9E7B96B44ABB0524A4B + E1E56DCAD13E4B36AAF5E1C8 fileRef - FB042503B17F4650BBE4B041 + 200C558922A84EB697A91DD6 isa PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - - E9FFB068CAE14BA187F8FC19 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - POPCGUtils.h - path - pop/POPCGUtils.h - sourceTree - <group> - - EA5348F4EF1E462FAA8DE671 - - buildConfigurations - - F68D5C528D884BFFA6C9A813 - CF56ED8F9F5646699A71C243 - - defaultConfigurationIsVisible - 0 - defaultConfigurationName - Release - isa - XCConfigurationList - EB0F61C2CF0E478CAF2332F5 + E26DCE3C798942D8B4A3ADF5 fileRef - 90FDE5632FAA4701A82DE206 + BC6ACDA26EEE464FA60F8025 isa PBXBuildFile - - ECF413832C7942ECAC114EFF - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - NSValue+AGKQuad.h - path - Source/Categories/NSValue+AGKQuad.h - sourceTree - <group> - - ECF76808AF3445A0A67A4FF0 - - children - - C05DA571741F47EF816EDDFD - + + E2901AFD93B14E67959288E5 + + fileRef + 1F19A3789427431A9447947C isa - PBXGroup - name - Targets Support Files - sourceTree - <group> + PBXBuildFile - EDF0CE2067884A3D90ACD2AB + E4A35243651A49A2815C0B3D includeInIndex 1 @@ -3261,138 +3441,134 @@ lastKnownFileType sourcecode.c.h name - AGKBitOperations.h + POPAnimationExtras.h path - Source/AGKBitOperations.h + pop/POPAnimationExtras.h sourceTree <group> - EE0221E82ABD415E94C8C7B8 + E511A18DF8FB4DDCABAC0829 + + fileRef + 7B9C08F36DF64B20BA05A392 + isa + PBXBuildFile + + E5A186E9B62F42F58BF3D3FA includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.h - name - POPAnimationEventInternal.h + text.xcconfig path - pop/POPAnimationEventInternal.h + Pods.xcconfig sourceTree <group> - EE0BF0313A934377892669DD + E6DA5443ED6047DBAAED5771 fileRef - E1BF14EC83C444FC91C5B119 + EF60F6A8E9904CA99D176F13 isa PBXBuildFile - EEA7062EF4004B64ADCC0F4C + E917335B0172472CA52AFBF2 fileRef - 8A67FA75C9934F8FBAC9C80F + FDD5A99DA7574598AF633FFD isa PBXBuildFile - EEAEF6B3F6D04D07BFD783EC + E9ED181A6B3C454BAFB84974 fileRef - 4BB966BDFC2D463B80F8DB26 + 7CFC9C6DC5DA4B79B42FC6BB isa PBXBuildFile settings COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 + -fobjc-arc - EF6430F6C0DC4D3BB489DDA4 + EBE2A0FE0CFA4F84A2CC7714 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.h + sourcecode.c.objc name - POPSpringSolver.h + CALayer+AGK+Methods.m path - pop/POPSpringSolver.h + Source/Categories/CALayer+AGK+Methods.m sourceTree <group> - EF6FBE16596C40AC9AF00B89 + EC9B64F5FB964906ADD46C07 - fileRef - 055138EFE69E4199BAE80811 + includeInIndex + 1 isa - PBXBuildFile + PBXFileReference + lastKnownFileType + text.xcconfig + path + Pods-AGGeometryKit.xcconfig + sourceTree + <group> - F018BF863B3040F58DAE07CD + EF60F6A8E9904CA99D176F13 - buildActionMask - 2147483647 - files - - 9BD06CFB7E4D4F9AACFA6685 - D950A8C6C1FA4C85826689C7 - 5F8AFBC2DE364275A76F177A - 9B7F077CE638410DA700C8A9 - 26BBC722345148B986F3322F - 824D8587F97C486B9DF28052 - 390332F7C6E348EC90C48BE4 - F70ED521308247FAA3D41879 - D2CD6F4DEF7E4F02BCB0B9B1 - 1D5C39A887E94AF7917E5C3A - 3DACEAB8B6374A6CB52F946D - F4FAD2478C824FCAB7A39B6D - 17EC1A43B4CA46A98F69512E - 75DEA1E879D14B4D93A91741 - 8B240FA0448D40CA8BE0EBCC - 64B13BFD57D442C58C3B6245 - FBF284ED0D5E4F33B9DE95FA - 755E0C97746B42EE82A041A3 - CBF89F5E6C32433DB13BB86B - 6854ECD1E6B34A32A4BA2038 - 566CFB39121446039B8A7972 - D23E228FC1E54F95A04E288A - 18F2CFB811D64701A00770E5 - isa - PBXHeadersBuildPhase - runOnlyForDeploymentPostprocessing - 0 + PBXFileReference + lastKnownFileType + wrapper.framework + name + SystemConfiguration.framework + path + Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/System/Library/Frameworks/SystemConfiguration.framework + sourceTree + DEVELOPER_DIR + + F070D91354134411AA90690B + + fileRef + BED09726BEB747AA944853A7 + isa + PBXBuildFile - F0916E42C200458C9F5180C2 + F33FBBF49031490AAE7AB517 fileRef - 24C68F69B327460F8E7CC34E + F78A20EE0A8749B095A75646 isa PBXBuildFile - F203B4A50ACE45058039F0A8 + F4BC9666AC394DED9B6B01A4 fileRef - 3C34F41CBEF64C349E272793 + BD921B1CA18145BEAD12DE88 isa PBXBuildFile - F222E569428F4ACAB2ED2E83 + F52AAAB738C24CFC8E29287A includeInIndex 1 isa PBXFileReference - name - POPAnimationRuntime.mm + lastKnownFileType + text.xcconfig path - pop/POPAnimationRuntime.mm + Pods-pop.xcconfig sourceTree <group> - F24E5F6119A44815965B5873 + F6C4FC8510794EB989674D75 includeInIndex 1 @@ -3401,80 +3577,44 @@ lastKnownFileType sourcecode.c.h name - AGKVector3D.h + UIView+AGK+AngleConverter.h path - Source/AGKVector3D.h + Source/Categories/UIView+AGK+AngleConverter.h sourceTree <group> - F2B80B474157447493BF9FDC - - fileRef - E6E8BF98F2744E59A6515C64 - isa - PBXBuildFile - - F3637BA2C6D14C2ABC910EC7 - - fileRef - C2449605C2154F90AD951A5D - isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - - F36ACA0D3B7646D4BA6B3906 + F6EBC054E9814476A30AB200 includeInIndex 1 isa PBXFileReference name - POPDecayAnimation.mm + POPVector.mm path - pop/POPDecayAnimation.mm + pop/POPVector.mm sourceTree <group> - F4FAD2478C824FCAB7A39B6D - - fileRef - F24E5F6119A44815965B5873 - isa - PBXBuildFile - - F567FACAF30E4AB6944F014C - - fileRef - 0FF2747EEE09444DA275C19F - isa - PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - - - F5845F37B0CA4EE2A93C5710 + F78A20EE0A8749B095A75646 includeInIndex 1 isa PBXFileReference + lastKnownFileType + sourcecode.c.h name - POPAnimationEvent.mm + POPSpringSolver.h path - pop/POPAnimationEvent.mm + pop/POPSpringSolver.h sourceTree <group> - F599FFFCBB1D47678C4B8A2E + F8AA2D709BF24D909F679575 fileRef - 5AF1B4DADEA6497A9736576E + 8C42DF3C67CB4B9DA56E8AE6 isa PBXBuildFile settings @@ -3483,10 +3623,10 @@ -fobjc-arc - F5A048680EEA45A9B7403BA6 + F93EEEB71203488A9D647B46 fileRef - 4670455E8B724F96BCE8473A + 6FE5473E1D994CAAAF2F3F21 isa PBXBuildFile settings @@ -3495,80 +3635,24 @@ -fobjc-arc - F68D5C528D884BFFA6C9A813 - - baseConfigurationReference - 706B5EFB2D424FE5AA037768 - buildSettings - - ALWAYS_SEARCH_USER_PATHS - NO - COPY_PHASE_STRIP - NO - DSTROOT - /tmp/xcodeproj.dst - GCC_C_LANGUAGE_STANDARD - gnu99 - GCC_DYNAMIC_NO_PIC - NO - GCC_OPTIMIZATION_LEVEL - 0 - GCC_PRECOMPILE_PREFIX_HEADER - YES - GCC_PREFIX_HEADER - Pods-pop-prefix.pch - GCC_PREPROCESSOR_DEFINITIONS - - DEBUG=1 - $(inherited) - - GCC_SYMBOLS_PRIVATE_EXTERN - NO - GCC_VERSION - com.apple.compilers.llvm.clang.1_0 - INSTALL_PATH - $(BUILT_PRODUCTS_DIR) - IPHONEOS_DEPLOYMENT_TARGET - 6.0 - OTHER_LDFLAGS - - PRODUCT_NAME - $(TARGET_NAME) - PUBLIC_HEADERS_FOLDER_PATH - $(TARGET_NAME) - SDKROOT - iphoneos - SKIP_INSTALL - YES - - isa - XCBuildConfiguration - name - Debug - - F70ED521308247FAA3D41879 + FC6C6D89B1F64ADE8D14AE1C fileRef - 3F72F58854AB4E31A80C0CDD + 6EB970B439BC405E8D6BED20 isa PBXBuildFile - F7481D200EBC4F69B079A1CF + FC72283010AC4146B0E2B4CE fileRef - F5845F37B0CA4EE2A93C5710 + 7D60B623174748A2B24F92EB isa PBXBuildFile - settings - - COMPILER_FLAGS - -fobjc-arc - - F8D508C4960D4114BB21BAF3 + FC77DE00B7B345D7AA19BB9E fileRef - 605E69D2EC4F4A169979F004 + D3B86BAF7AD44EF38907289C isa PBXBuildFile settings @@ -3577,76 +3661,20 @@ -fobjc-arc -DOS_OBJECT_USE_OBJC=0 - FB042503B17F4650BBE4B041 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - AGKCorner.m - path - Source/AGKCorner.m - sourceTree - <group> - - FBF284ED0D5E4F33B9DE95FA - - fileRef - 48097D2712F747B1A05A5C93 - isa - PBXBuildFile - - FCD5926565ED4F40B9867DAD - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.h - name - POPPropertyAnimation.h - path - pop/POPPropertyAnimation.h - sourceTree - <group> - - FCE0F20E13564EAB99680E17 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - text - name - Podfile - path - ../Podfile - sourceTree - SOURCE_ROOT - xcLanguageSpecificationIdentifier - xcode.lang.ruby - - FD1FCA001F964F788295B320 + FD9F1D44BF564839897295A8 includeInIndex 1 isa PBXFileReference lastKnownFileType - sourcecode.c.objc - name - AGKQuad.m + text.xcconfig path - Source/AGKQuad.m + Pods-pop-Private.xcconfig sourceTree <group> - FEEF40A21CE94658B98A83C1 + FDD5A99DA7574598AF633FFD includeInIndex 1 @@ -3655,28 +3683,13 @@ lastKnownFileType sourcecode.c.h name - POP.h - path - pop/POP.h - sourceTree - <group> - - FEFAF8B2291F4EB9904623A9 - - includeInIndex - 1 - isa - PBXFileReference - lastKnownFileType - sourcecode.c.objc - name - AGKTransformPixelMapper.m + POPAnimationRuntime.h path - Source/Classes/AGKTransformPixelMapper.m + pop/POPAnimationRuntime.h sourceTree <group> - FF93525D583B4550A7B711A3 + FDDE0800755E4BFD8AFA7190 includeInIndex 1 @@ -3685,27 +3698,14 @@ lastKnownFileType sourcecode.c.h name - FloatConversion.h + AGKBitOperations.h path - pop/WebCore/FloatConversion.h + Source/AGKBitOperations.h sourceTree <group> - FFCB62AEFEF44BA2A2AB6379 - - containerPortal - D9B7CC215BC24ADE9EA4AF9C - isa - PBXContainerItemProxy - proxyType - 1 - remoteGlobalIDString - B5433746A30A4A75948A9105 - remoteInfo - Pods-pop - rootObject - D9B7CC215BC24ADE9EA4AF9C + 36E125D8CA594F8BB51F31A6 diff --git a/Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/Pods-AGGeometryKit.xcscheme b/Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/Pods-AGGeometryKit.xcscheme deleted file mode 100644 index 1762c6d..0000000 --- a/Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/Pods-AGGeometryKit.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/Pods-pop.xcscheme b/Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/Pods-pop.xcscheme deleted file mode 100644 index 578c1d4..0000000 --- a/Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/Pods-pop.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/Pods.xcscheme b/Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/Pods.xcscheme deleted file mode 100644 index 56ec0c5..0000000 --- a/Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/Pods.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/xcschememanagement.plist b/Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 933a6c1..0000000 --- a/Demo/Pods/Pods.xcodeproj/xcuserdata/hfossli.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - SchemeUserState - - Pods-AGGeometryKit.xcscheme - - isShown - - - Pods-pop.xcscheme - - isShown - - - Pods.xcscheme - - isShown - - - - SuppressBuildableAutocreation - - 4004E281C73E4901AB670320 - - primary - - - B5433746A30A4A75948A9105 - - primary - - - D68400D91DAB42B6B312BF06 - - primary - - - - - diff --git a/Demo/Pods/pop/LICENSE b/Demo/Pods/pop/LICENSE new file mode 100644 index 0000000..642126f --- /dev/null +++ b/Demo/Pods/pop/LICENSE @@ -0,0 +1,30 @@ +BSD License + +For Pop software + +Copyright (c) 2014, Facebook, Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name Facebook nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Demo/Pods/pop/README.md b/Demo/Pods/pop/README.md new file mode 100644 index 0000000..2b81cd1 --- /dev/null +++ b/Demo/Pods/pop/README.md @@ -0,0 +1,165 @@ +![pop](https://github.com/facebook/pop/blob/master/Images/pop.gif?raw=true) + +Pop is an extensible animation engine for iOS and OS X. In addition to basic static animations, it supports spring and decay dynamic animations, making it useful for building realistic, physics-based interactions. The API allows quick integration with existing Objective-C codebases and enables the animation of any property on any object. It's a mature and well-tested framework that drives all the animations and transitions in [Paper](http://www.facebook.com/paper). + +[![Build Status](https://travis-ci.org/facebook/pop.svg)](https://travis-ci.org/facebook/pop) + +## Installation + +Pop is available on [CocoaPods](http://cocoapods.org). Just add the following to your project Podfile: + +```ruby +pod 'pop', '~> 1.0' +``` +Alternatively, you can add the project to your workspace and adopt the provided configuration files or manually copy the files under the pop subdirectory into your project. If installing manually, ensure the C++ standard library is also linked by including `-lc++` to your project linker flags. + +## Usage + +Pop adopts the Core Animation explicit animation programming model. Use by including the following import: + +```objective-c +#import +``` + +### Start, Stop & Update + +To start an animation, add it to the object you wish to animate: + +```objective-c +POPSpringAnimation *anim = [POPSpringAnimation animation]; +... +[layer pop_addAnimation:anim forKey:@"myKey"]; +``` + +To stop an animation, remove it from the object referencing the key specified on start: + +```objective-c +[layer pop_removeAnimationForKey:@"myKey"]; +``` + +The key can also be used to query for the existence of an animation. Updating the toValue of a running animation can provide the most seamless way to change course: + +```objective-c +anim = [layer pop_animationForKey:@"myKey"]; +if (anim) { + /* update to value to new destination */ + anim.toValue = @(42.0); +} else { + /* create and start a new animation */ + .... +} +``` + +While a layer was used in the above examples, the Pop interface is implemented as a category addition on NSObject. Any NSObject or subclass can be animated. + +### Types + +There are four concrete animation types: spring, decay, basic and custom. + +Spring animations can be used to give objects a delightful bounce. In this example, we use a spring animation to animate a layer's bounds from its current value to (0, 0, 400, 400): + +```objective-c +POPSpringAnimation *anim = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerBounds]; +anim.toValue = [NSValue valueWithCGRect:CGRectMake(0, 0, 400, 400)]; +[layer pop_addAnimation:anim forKey:@"size"]; +``` +Decay animations can be used to gradually slow an object to a halt. In this example, we decay a layer's positionX from it's current value and velocity 1000pts per second: + +```objective-c +POPDecayAnimation *anim = [POPDecayAnimation animationWithPropertyNamed:kPOPLayerPositionX]; +anim.velocity = @(1000.); +[layer pop_addAnimation:anim forKey:@"slide"]; +``` + +Basic animations can be used to interpolate values over a specified time period. To use an ease-in ease-out animation to animate a view's alpha from 0.0 to 1.0 over the default duration: +```objective-c +POPBasicAnimation *anim = [POPBasicAnimation animationWithPropertyNamed:kPOPViewAlpha]; +anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; +anim.fromValue = @(0.0); +anim.toValue = @(1.0); +[view pop_addAnimation:anim forKey:@"fade"]; +``` +`POPCustomAnimation` makes creating custom animations and transitions easier by handling CADisplayLink and associated time-step management. See header for more details. + + +### Properties + +The property animated is specified by the `POPAnimatableProperty` class. In this example we create a spring animation and explicitly set the animatable property corresponding to `-[CALayer bounds]`: + +```objective-c +POPSpringAnimation *anim = [POPSpringAnimation animation]; +anim.property = [POPAnimatableProperty propertyWithName:kPOPLayerBounds]; +``` + +The framework provides many common layer and view animatable properties out of box. You can animate a custom property by creating a new instance of the class. In this example, we declare a custom volume property: + +```objective-c +prop = [POPAnimatableProperty propertyWithName:@"com.foo.radio.volume" initializer:^(POPMutableAnimatableProperty *prop) { + // read value + prop.readBlock = ^(id obj, CGFloat values[]) { + values[0] = [obj volume]; + }; + // write value + prop.writeBlock = ^(id obj, const CGFloat values[]) { + [obj setVolume:values[0]]; + }; + // dynamics threshold + prop.threshold = 0.01; +}]; + +anim.property = prop; +``` + +For a complete listing of provided animatable properties, as well more information on declaring custom properties see `POPAnimatableProperty.h`. + + +### Debugging + +Here are a few tips when debugging. Pop obeys the Simulator's Toggle Slow Animations setting. Try enabling it to slow down animations and more easily observe interactions. + +Consider naming your animations. This will allow you to more easily identify them when referencing them, either via logging or in the debugger: + +```objective-c +anim.name = @"springOpen"; +``` + +Each animation comes with an associated tracer. The tracer allows you to record all animation-related events, in a fast and efficient manner, allowing you to query and analyze them after animation completion. The below example starts the tracer and configures it to log all events on animation completion: + +```objective-c +POPAnimationTracer *tracer = anim.tracer; +tracer.shouldLogAndResetOnCompletion = YES; +[tracer start]; +``` + +See `POPAnimationTracer.h` for more details. + +## Testing + +Pop has extensive unit test coverage. To install test dependencies, navigate to the root pop directory and type: + +```sh +pod install +``` + +Assuming CocoaPods is installed, this will include the necessary OCMock dependency to the unit test targets. + +## Resources + +A collection of links to external resources that may prove valuable: + +* [Apple – Core Animation Programming Guide](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CoreAnimation_guide/Introduction/Introduction.html) +* [Tapity Tutorial – Getting Started with Pop](http://tapity.com/tutorial-getting-started-with-pop/) +* [Codeplease – Bridging the gesture to animation gap](http://codeplease.io/playing-with-pop-ii/) +* [Codeplease – Playing with Pop (iii)](http://codeplease.io/playing-with-pop-iii/) +* [Codeplease – Adding a custom animatable property](http://codeplease.io/playing-with-pop-v/) +* [POP-MCAnimate – Concise syntax for the Pop animation framework](https://github.com/matthewcheok/POP-MCAnimate) +* [Tweaks – Easily adjust parameters for iOS apps in development](https://github.com/facebook/tweaks) +* [Rebound – Spring Animations for Android](http://facebook.github.io/rebound/) + + +## Contributing +See the CONTRIBUTING file for how to help out. + +## License + +Pop is released under a BSD License. See LICENSE file for details. diff --git a/Demo/Pods/pop/pop/POP.h b/Demo/Pods/pop/pop/POP.h new file mode 100644 index 0000000..29d5c43 --- /dev/null +++ b/Demo/Pods/pop/pop/POP.h @@ -0,0 +1,28 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#ifndef POP_POP_H +#define POP_POP_H + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + + +#endif /* POP_POP_H */ diff --git a/Demo/Pods/pop/pop/POPAction.h b/Demo/Pods/pop/pop/POPAction.h new file mode 100644 index 0000000..0827a35 --- /dev/null +++ b/Demo/Pods/pop/pop/POPAction.h @@ -0,0 +1,66 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#ifndef POPACTION_H +#define POPACTION_H + +#import +#import + +#ifdef __cplusplus + +namespace POP { + + /** + @abstract Disables Core Animation actions using RAII. + @discussion The disablement of actions is scoped to the current transaction. + */ + class ActionDisabler + { + BOOL state; + + public: + ActionDisabler() POP_NOTHROW + { + state = [CATransaction disableActions]; + [CATransaction setDisableActions:YES]; + } + + ~ActionDisabler() + { + [CATransaction setDisableActions:state]; + } + }; + + /** + @abstract Enables Core Animation actions using RAII. + @discussion The enablement of actions is scoped to the current transaction. + */ + class ActionEnabler + { + BOOL state; + + public: + ActionEnabler() POP_NOTHROW + { + state = [CATransaction disableActions]; + [CATransaction setDisableActions:NO]; + } + + ~ActionEnabler() + { + [CATransaction setDisableActions:state]; + } + }; + +} + +#endif /* __cplusplus */ + +#endif /* POPACTION_H */ diff --git a/Demo/Pods/pop/pop/POPAnimatableProperty.h b/Demo/Pods/pop/pop/POPAnimatableProperty.h new file mode 100644 index 0000000..5020ab3 --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimatableProperty.h @@ -0,0 +1,165 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#import + +@class POPMutableAnimatableProperty; + +/** + @abstract Describes an animatable property. + */ +@interface POPAnimatableProperty : NSObject + +/** + @abstract Property accessor. + @param name The name of the property. + @return The animatable property with that name or nil if it does not exist. + @discussion Common animatable properties are included by default. Use the provided constants to reference. + */ ++ (id)propertyWithName:(NSString *)name; + +/** + @abstract The designated initializer. + @param name The name of the property. + @param block The block used to configure the property on creation. + @return The animatable property with name if it exists, otherwise a newly created instance configured by block. + @discussion Custom properties should use reverse-DNS naming. A newly created instance is only mutable in the scope of block. Once constructed, a property becomes immutable. + */ ++ (id)propertyWithName:(NSString *)name initializer:(void (^)(POPMutableAnimatableProperty *prop))block; + +/** + @abstract The name of the property. + @discussion Used to uniquely identify an animatable property. + */ +@property (readonly, nonatomic, copy) NSString *name; + +/** + @abstract Block used to read values from a property into an array of floats. + */ +@property (readonly, nonatomic, copy) void (^readBlock)(id obj, CGFloat values[]); + +/** + @abstract Block used to write values from an array of floats into a property. + */ +@property (readonly, nonatomic, copy) void (^writeBlock)(id obj, const CGFloat values[]); + +/** + @abstract The threshold value used when determining completion of dynamics simulations. + */ +@property (readonly, nonatomic, assign) CGFloat threshold; + +@end + +/** + @abstract A mutable animatable property intended for configuration. + */ +@interface POPMutableAnimatableProperty : POPAnimatableProperty + +/** + @abstract A read-write version of POPAnimatableProperty name property. + */ +@property (readwrite, nonatomic, copy) NSString *name; + +/** + @abstract A read-write version of POPAnimatableProperty readBlock property. + */ +@property (readwrite, nonatomic, copy) void (^readBlock)(id obj, CGFloat values[]); + +/** + @abstract A read-write version of POPAnimatableProperty writeBlock property. + */ +@property (readwrite, nonatomic, copy) void (^writeBlock)(id obj, const CGFloat values[]); + +/** + @abstract A read-write version of POPAnimatableProperty threshold property. + */ +@property (readwrite, nonatomic, assign) CGFloat threshold; + +@end + +/** + Common CALayer property names. + */ +extern NSString * const kPOPLayerBackgroundColor; +extern NSString * const kPOPLayerBounds; +extern NSString * const kPOPLayerOpacity; +extern NSString * const kPOPLayerPosition; +extern NSString * const kPOPLayerPositionX; +extern NSString * const kPOPLayerPositionY; +extern NSString * const kPOPLayerRotation; +extern NSString * const kPOPLayerRotationX; +extern NSString * const kPOPLayerRotationY; +extern NSString * const kPOPLayerScaleX; +extern NSString * const kPOPLayerScaleXY; +extern NSString * const kPOPLayerScaleY; +extern NSString * const kPOPLayerSize; +extern NSString * const kPOPLayerSubscaleXY; +extern NSString * const kPOPLayerSubtranslationX; +extern NSString * const kPOPLayerSubtranslationXY; +extern NSString * const kPOPLayerSubtranslationY; +extern NSString * const kPOPLayerSubtranslationZ; +extern NSString * const kPOPLayerTranslationX; +extern NSString * const kPOPLayerTranslationXY; +extern NSString * const kPOPLayerTranslationY; +extern NSString * const kPOPLayerTranslationZ; +extern NSString * const kPOPLayerZPosition; + +/** + Common CAShapeLayer property names. + */ +extern NSString * const kPOPShapeLayerStrokeStart; +extern NSString * const kPOPShapeLayerStrokeEnd; +extern NSString * const kPOPShapeLayerStrokeColor; + +/** + Common NSLayoutConstraint property names. + */ +extern NSString * const kPOPLayoutConstraintConstant; + + +#if TARGET_OS_IPHONE + +/** + Common UIView property names. + */ +extern NSString * const kPOPViewAlpha; +extern NSString * const kPOPViewBackgroundColor; +extern NSString * const kPOPViewBounds; +extern NSString * const kPOPViewCenter; +extern NSString * const kPOPViewFrame; +extern NSString * const kPOPViewScaleX; +extern NSString * const kPOPViewScaleXY; +extern NSString * const kPOPViewScaleY; +extern NSString * const kPOPViewSize; + + +/** + Common UIScrollView property names. + */ +extern NSString * const kPOPScrollViewContentOffset; +extern NSString * const kPOPScrollViewContentSize; + +/** + Common UITableView property names. + */ +extern NSString * const kPOPTableViewContentOffset; +extern NSString * const kPOPTableViewContentSize; + +/** + Common UINavigationBar property names. + */ +extern NSString * const kPOPNavigationBarBarTintColor; + +/** + Common UITabBar property names. + */ +extern NSString * const kPOPTabBarBarTintColor; + +#endif diff --git a/Demo/Pods/pop/pop/POPAnimatableProperty.mm b/Demo/Pods/pop/pop/POPAnimatableProperty.mm new file mode 100644 index 0000000..a71abcc --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimatableProperty.mm @@ -0,0 +1,695 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPAnimatableProperty.h" +#import "POPCGUtils.h" +#import "POPAnimationRuntime.h" + +#import + +#import + +#if TARGET_OS_IPHONE +#import +#else +#import +#endif + +// common threshold definitions +static CGFloat const kPOPThresholdColor = 0.01; +static CGFloat const kPOPThresholdPoint = 1.0; +static CGFloat const kPOPThresholdOpacity = 0.01; +static CGFloat const kPOPThresholdScale = 0.005; +static CGFloat const kPOPThresholdRotation = 0.01; + +#pragma mark - Static + +// CALayer +NSString * const kPOPLayerBackgroundColor = @"backgroundColor"; +NSString * const kPOPLayerBounds = @"bounds"; +NSString * const kPOPLayerOpacity = @"opacity"; +NSString * const kPOPLayerPosition = @"position"; +NSString * const kPOPLayerPositionX = @"positionX"; +NSString * const kPOPLayerPositionY = @"positionY"; +NSString * const kPOPLayerRotation = @"rotation"; +NSString * const kPOPLayerRotationX = @"rotationX"; +NSString * const kPOPLayerRotationY = @"rotationY"; +NSString * const kPOPLayerScaleX = @"scaleX"; +NSString * const kPOPLayerScaleXY = @"scaleXY"; +NSString * const kPOPLayerScaleY = @"scaleY"; +NSString * const kPOPLayerSize = @"size"; +NSString * const kPOPLayerSubscaleXY = @"subscaleXY"; +NSString * const kPOPLayerSubtranslationX = @"subtranslationX"; +NSString * const kPOPLayerSubtranslationXY = @"subtranslationXY"; +NSString * const kPOPLayerSubtranslationY = @"subtranslationY"; +NSString * const kPOPLayerSubtranslationZ = @"subtranslationZ"; +NSString * const kPOPLayerTranslationX = @"translationX"; +NSString * const kPOPLayerTranslationXY = @"translationXY"; +NSString * const kPOPLayerTranslationY = @"translationY"; +NSString * const kPOPLayerTranslationZ = @"translationZ"; +NSString * const kPOPLayerZPosition = @"zPosition"; + +// CAShapeLayer +NSString * const kPOPShapeLayerStrokeStart = @"shapeLayer.strokeStart"; +NSString * const kPOPShapeLayerStrokeEnd = @"shapeLayer.strokeEnd"; +NSString * const kPOPShapeLayerStrokeColor = @"shapeLayer.strokeColor"; + +// NSLayoutConstraint +NSString * const kPOPLayoutConstraintConstant = @"layoutConstraint.constant"; + +// UIView +NSString * const kPOPViewAlpha = @"view.alpha"; +NSString * const kPOPViewBackgroundColor = @"view.backgroundColor"; +NSString * const kPOPViewBounds = kPOPLayerBounds; +NSString * const kPOPViewCenter = @"view.center"; +NSString * const kPOPViewFrame = @"view.frame"; +NSString * const kPOPViewScaleX = @"view.scaleX"; +NSString * const kPOPViewScaleXY = @"view.scaleXY"; +NSString * const kPOPViewScaleY = @"view.scaleY"; +NSString * const kPOPViewSize = kPOPLayerSize; + +// UIScrollView +NSString * const kPOPScrollViewContentOffset = @"scrollView.contentOffset"; +NSString * const kPOPScrollViewContentSize = @"scrollView.contentSize"; + +// UITableView +NSString * const kPOPTableViewContentOffset = kPOPScrollViewContentOffset; +NSString * const kPOPTableViewContentSize = kPOPScrollViewContentSize; + +// UINavigationBar +NSString * const kPOPNavigationBarBarTintColor = @"navigationBar.barTintColor"; + +// UITabBar +NSString * const kPOPTabBarBarTintColor = kPOPNavigationBarBarTintColor; + +/** + State structure internal to static animatable property. + */ +typedef struct +{ + NSString *name; + pop_animatable_read_block readBlock; + pop_animatable_write_block writeBlock; + CGFloat threshold; +} _POPStaticAnimatablePropertyState; +typedef _POPStaticAnimatablePropertyState POPStaticAnimatablePropertyState; + +static POPStaticAnimatablePropertyState _staticStates[] = +{ + /* CALayer */ + + {kPOPLayerBackgroundColor, + ^(CALayer *obj, CGFloat values[]) { + POPCGColorGetRGBAComponents(obj.backgroundColor, values); + }, + ^(CALayer *obj, const CGFloat values[]) { + CGColorRef color = POPCGColorRGBACreate(values); + [obj setBackgroundColor:color]; + CGColorRelease(color); + }, + kPOPThresholdColor + }, + + {kPOPLayerBounds, + ^(CALayer *obj, CGFloat values[]) { + values_from_rect(values, [obj bounds]); + }, + ^(CALayer *obj, const CGFloat values[]) { + [obj setBounds:values_to_rect(values)]; + }, + kPOPThresholdPoint + }, + + {kPOPLayerPosition, + ^(CALayer *obj, CGFloat values[]) { + values_from_point(values, [(CALayer *)obj position]); + }, + ^(CALayer *obj, const CGFloat values[]) { + [obj setPosition:values_to_point(values)]; + }, + kPOPThresholdPoint + }, + + {kPOPLayerPositionX, + ^(CALayer *obj, CGFloat values[]) { + values[0] = [(CALayer *)obj position].x; + }, + ^(CALayer *obj, const CGFloat values[]) { + CGPoint p = [(CALayer *)obj position]; + p.x = values[0]; + [obj setPosition:p]; + }, + kPOPThresholdPoint + }, + + {kPOPLayerPositionY, + ^(CALayer *obj, CGFloat values[]) { + values[0] = [(CALayer *)obj position].y; + }, + ^(CALayer *obj, const CGFloat values[]) { + CGPoint p = [(CALayer *)obj position]; + p.y = values[0]; + [obj setPosition:p]; + }, + kPOPThresholdPoint + }, + + {kPOPLayerOpacity, + ^(CALayer *obj, CGFloat values[]) { + values[0] = [obj opacity]; + }, + ^(CALayer *obj, const CGFloat values[]) { + [obj setOpacity:((float)values[0])]; + }, + kPOPThresholdOpacity + }, + + {kPOPLayerScaleX, + ^(CALayer *obj, CGFloat values[]) { + values[0] = POPLayerGetScaleX(obj); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetScaleX(obj, values[0]); + }, + kPOPThresholdScale + }, + + {kPOPLayerScaleY, + ^(CALayer *obj, CGFloat values[]) { + values[0] = POPLayerGetScaleY(obj); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetScaleY(obj, values[0]); + }, + kPOPThresholdScale + }, + + {kPOPLayerScaleXY, + ^(CALayer *obj, CGFloat values[]) { + values_from_point(values, POPLayerGetScaleXY(obj)); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetScaleXY(obj, values_to_point(values)); + }, + kPOPThresholdScale + }, + + {kPOPLayerSubscaleXY, + ^(CALayer *obj, CGFloat values[]) { + values_from_point(values, POPLayerGetSubScaleXY(obj)); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetSubScaleXY(obj, values_to_point(values)); + }, + kPOPThresholdScale + }, + + {kPOPLayerTranslationX, + ^(CALayer *obj, CGFloat values[]) { + values[0] = POPLayerGetTranslationX(obj); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetTranslationX(obj, values[0]); + }, + kPOPThresholdPoint + }, + + {kPOPLayerTranslationY, + ^(CALayer *obj, CGFloat values[]) { + values[0] = POPLayerGetTranslationY(obj); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetTranslationY(obj, values[0]); + }, + kPOPThresholdPoint + }, + + {kPOPLayerTranslationZ, + ^(CALayer *obj, CGFloat values[]) { + values[0] = POPLayerGetTranslationZ(obj); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetTranslationZ(obj, values[0]); + }, + kPOPThresholdPoint + }, + + {kPOPLayerTranslationXY, + ^(CALayer *obj, CGFloat values[]) { + values_from_point(values, POPLayerGetTranslationXY(obj)); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetTranslationXY(obj, values_to_point(values)); + }, + kPOPThresholdPoint + }, + + {kPOPLayerSubtranslationX, + ^(CALayer *obj, CGFloat values[]) { + values[0] = POPLayerGetSubTranslationX(obj); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetSubTranslationX(obj, values[0]); + }, + kPOPThresholdPoint + }, + + {kPOPLayerSubtranslationY, + ^(CALayer *obj, CGFloat values[]) { + values[0] = POPLayerGetSubTranslationY(obj); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetSubTranslationY(obj, values[0]); + }, + kPOPThresholdPoint + }, + + {kPOPLayerSubtranslationZ, + ^(CALayer *obj, CGFloat values[]) { + values[0] = POPLayerGetSubTranslationZ(obj); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetSubTranslationZ(obj, values[0]); + }, + kPOPThresholdPoint + }, + + {kPOPLayerSubtranslationXY, + ^(CALayer *obj, CGFloat values[]) { + values_from_point(values, POPLayerGetSubTranslationXY(obj)); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetSubTranslationXY(obj, values_to_point(values)); + }, + kPOPThresholdPoint + }, + + {kPOPLayerZPosition, + ^(CALayer *obj, CGFloat values[]) { + values[0] = [obj zPosition]; + }, + ^(CALayer *obj, const CGFloat values[]) { + [obj setZPosition:values[0]]; + }, + kPOPThresholdPoint + }, + + {kPOPLayerSize, + ^(CALayer *obj, CGFloat values[]) { + values_from_size(values, [obj bounds].size); + }, + ^(CALayer *obj, const CGFloat values[]) { + CGSize size = values_to_size(values); + if (size.width < 0. || size.height < 0.) + return; + + CGRect b = [obj bounds]; + b.size = size; + [obj setBounds:b]; + }, + kPOPThresholdPoint + }, + + {kPOPLayerRotation, + ^(CALayer *obj, CGFloat values[]) { + values[0] = POPLayerGetRotation(obj); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetRotation(obj, values[0]); + }, + kPOPThresholdRotation + }, + + {kPOPLayerRotationY, + ^(CALayer *obj, CGFloat values[]) { + values[0] = POPLayerGetRotationY(obj); + }, + ^(id obj, const CGFloat values[]) { + POPLayerSetRotationY(obj, values[0]); + }, + kPOPThresholdRotation + }, + + {kPOPLayerRotationX, + ^(CALayer *obj, CGFloat values[]) { + values[0] = POPLayerGetRotationX(obj); + }, + ^(CALayer *obj, const CGFloat values[]) { + POPLayerSetRotationX(obj, values[0]); + }, + kPOPThresholdRotation + }, + + /* CAShapeLayer */ + + {kPOPShapeLayerStrokeStart, + ^(CAShapeLayer *obj, CGFloat values[]) { + values[0] = obj.strokeStart; + }, + ^(CAShapeLayer *obj, const CGFloat values[]) { + obj.strokeStart = values[0]; + }, + 0.01 + }, + + {kPOPShapeLayerStrokeEnd, + ^(CAShapeLayer *obj, CGFloat values[]) { + values[0] = obj.strokeEnd; + }, + ^(CAShapeLayer *obj, const CGFloat values[]) { + obj.strokeEnd = values[0]; + }, + 0.01 + }, + + {kPOPShapeLayerStrokeColor, + ^(CAShapeLayer *obj, CGFloat values[]) { + POPCGColorGetRGBAComponents(obj.strokeColor, values); + }, + ^(CAShapeLayer *obj, const CGFloat values[]) { + CGColorRef color = POPCGColorRGBACreate(values); + [obj setStrokeColor:color]; + CGColorRelease(color); + }, + kPOPThresholdColor + }, + + {kPOPLayoutConstraintConstant, + ^(NSLayoutConstraint *obj, CGFloat values[]) { + values[0] = obj.constant; + }, + ^(NSLayoutConstraint *obj, const CGFloat values[]) { + obj.constant = values[0]; + }, + 0.01 + }, + +#if TARGET_OS_IPHONE + + /* UIView */ + + {kPOPViewAlpha, + ^(UIView *obj, CGFloat values[]) { + values[0] = obj.alpha; + }, + ^(UIView *obj, const CGFloat values[]) { + obj.alpha = values[0]; + }, + kPOPThresholdOpacity + }, + + {kPOPViewBackgroundColor, + ^(UIView *obj, CGFloat values[]) { + POPUIColorGetRGBAComponents(obj.backgroundColor, values); + }, + ^(UIView *obj, const CGFloat values[]) { + obj.backgroundColor = POPUIColorRGBACreate(values); + }, + kPOPThresholdColor + }, + + {kPOPViewCenter, + ^(UIView *obj, CGFloat values[]) { + values_from_point(values, obj.center); + }, + ^(UIView *obj, const CGFloat values[]) { + obj.center = values_to_point(values); + }, + kPOPThresholdPoint + }, + + {kPOPViewFrame, + ^(UIView *obj, CGFloat values[]) { + values_from_rect(values, obj.frame); + }, + ^(UIView *obj, const CGFloat values[]) { + obj.frame = values_to_rect(values); + }, + kPOPThresholdPoint + }, + + {kPOPViewScaleX, + ^(UIView *obj, CGFloat values[]) { + values[0] = POPLayerGetScaleX(obj.layer); + }, + ^(UIView *obj, const CGFloat values[]) { + POPLayerSetScaleX(obj.layer, values[0]); + }, + kPOPThresholdScale + }, + + {kPOPViewScaleY, + ^(UIView *obj, CGFloat values[]) { + values[0] = POPLayerGetScaleY(obj.layer); + }, + ^(UIView *obj, const CGFloat values[]) { + POPLayerSetScaleY(obj.layer, values[0]); + }, + kPOPThresholdScale + }, + + {kPOPViewScaleXY, + ^(UIView *obj, CGFloat values[]) { + values_from_point(values, POPLayerGetScaleXY(obj.layer)); + }, + ^(UIView *obj, const CGFloat values[]) { + POPLayerSetScaleXY(obj.layer, values_to_point(values)); + }, + kPOPThresholdScale + }, + + /* UIScrollView */ + + {kPOPScrollViewContentOffset, + ^(UIScrollView *obj, CGFloat values[]) { + values_from_point(values, obj.contentOffset); + }, + ^(UIScrollView *obj, const CGFloat values[]) { + obj.contentOffset = values_to_point(values); + }, + kPOPThresholdPoint + }, + + {kPOPScrollViewContentSize, + ^(UIScrollView *obj, CGFloat values[]) { + values_from_size(values, obj.contentSize); + }, + ^(UIScrollView *obj, const CGFloat values[]) { + obj.contentSize = values_to_size(values); + }, + kPOPThresholdPoint + }, + + /* UINavigationBar */ + + {kPOPNavigationBarBarTintColor, + ^(UINavigationBar *obj, CGFloat values[]) { + POPUIColorGetRGBAComponents(obj.barTintColor, values); + }, + ^(UINavigationBar *obj, const CGFloat values[]) { + obj.barTintColor = POPUIColorRGBACreate(values); + }, + kPOPThresholdColor + }, + +#endif + +}; + +static NSUInteger staticIndexWithName(NSString *aName) +{ + NSUInteger idx = 0; + + while (idx < POP_ARRAY_COUNT(_staticStates)) { + if ([_staticStates[idx].name isEqualToString:aName]) + return idx; + idx++; + } + + return NSNotFound; +} + +/** + Concrete static property class. + */ +@interface POPStaticAnimatableProperty : POPAnimatableProperty +{ +@public + POPStaticAnimatablePropertyState *_state; +} +@end + +@implementation POPStaticAnimatableProperty + +- (NSString *)name +{ + return _state->name; +} + +- (pop_animatable_read_block)readBlock +{ + return _state->readBlock; +} + +- (pop_animatable_write_block)writeBlock +{ + return _state->writeBlock; +} + +- (CGFloat)threshold +{ + return _state->threshold; +} + +@end + +#pragma mark - Concrete + +/** + Concrete immutable property class. + */ +@interface POPConcreteAnimatableProperty : POPAnimatableProperty +- (instancetype)initWithName:(NSString *)name readBlock:(pop_animatable_read_block)read writeBlock:(pop_animatable_write_block)write threshold:(CGFloat)threshold; +@end + +@implementation POPConcreteAnimatableProperty + +// default synthesis +@synthesize name, readBlock, writeBlock, threshold; + +- (instancetype)initWithName:(NSString *)aName readBlock:(pop_animatable_read_block)aReadBlock writeBlock:(pop_animatable_write_block)aWriteBlock threshold:(CGFloat)aThreshold +{ + self = [super init]; + if (nil != self) { + name = [aName copy]; + readBlock = [aReadBlock copy]; + writeBlock = [aWriteBlock copy]; + threshold = aThreshold; + } + return self; +} +@end + +#pragma mark - Mutable + +@implementation POPMutableAnimatableProperty + +// default synthesis +@synthesize name, readBlock, writeBlock, threshold; + +@end + +#pragma mark - Cluster + +/** + Singleton placeholder property class to support class cluster. + */ +@interface POPPlaceholderAnimatableProperty : POPAnimatableProperty + +@end + +@implementation POPPlaceholderAnimatableProperty + +// default synthesis +@synthesize name, readBlock, writeBlock, threshold; + +@end + +/** + Cluster class. + */ +@implementation POPAnimatableProperty + +// avoid creating backing ivars +@dynamic name, readBlock, writeBlock, threshold; + +static POPAnimatableProperty *placeholder = nil; + ++ (void)initialize +{ + if (self == [POPAnimatableProperty class]) { + placeholder = [POPPlaceholderAnimatableProperty alloc]; + } +} + ++ (id)allocWithZone:(struct _NSZone *)zone +{ + if (self == [POPAnimatableProperty class]) { + if (nil == placeholder) { + placeholder = [super allocWithZone:zone]; + } + return placeholder; + } + return [super allocWithZone:zone]; +} + +- (id)copyWithZone:(NSZone *)zone +{ + if ([self isKindOfClass:[POPMutableAnimatableProperty class]]) { + POPConcreteAnimatableProperty *copyProperty = [[POPConcreteAnimatableProperty alloc] initWithName:self.name readBlock:self.readBlock writeBlock:self.writeBlock threshold:self.threshold]; + return copyProperty; + } else { + return self; + } +} + +- (id)mutableCopyWithZone:(NSZone *)zone +{ + POPMutableAnimatableProperty *copyProperty = [[POPMutableAnimatableProperty alloc] init]; + copyProperty.name = self.name; + copyProperty.readBlock = self.readBlock; + copyProperty.writeBlock = self.writeBlock; + copyProperty.threshold = self.threshold; + return copyProperty; +} + ++ (id)propertyWithName:(NSString *)aName +{ + return [self propertyWithName:aName initializer:NULL]; +} + ++ (id)propertyWithName:(NSString *)aName initializer:(void (^)(POPMutableAnimatableProperty *prop))aBlock +{ + POPAnimatableProperty *prop = nil; + + static NSMutableDictionary *_propertyDict = nil; + if (nil == _propertyDict) { + _propertyDict = [[NSMutableDictionary alloc] initWithCapacity:10]; + } + + prop = _propertyDict[aName]; + if (nil != prop) { + return prop; + } + + NSUInteger staticIdx = staticIndexWithName(aName); + + if (NSNotFound != staticIdx) { + POPStaticAnimatableProperty *staticProp = [[POPStaticAnimatableProperty alloc] init]; + staticProp->_state = &_staticStates[staticIdx]; + _propertyDict[aName] = staticProp; + prop = staticProp; + } else if (NULL != aBlock) { + POPMutableAnimatableProperty *mutableProp = [[POPMutableAnimatableProperty alloc] init]; + mutableProp.name = aName; + mutableProp.threshold = 1.0; + aBlock(mutableProp); + prop = [mutableProp copy]; + } + + return prop; +} + +- (NSString *)description +{ + NSMutableString *s = [NSMutableString stringWithFormat:@"%@ name:%@ threshold:%f", super.description, self.name, self.threshold]; + return s; +} + +@end diff --git a/Demo/Pods/pop/pop/POPAnimation.h b/Demo/Pods/pop/pop/POPAnimation.h new file mode 100644 index 0000000..4b62afc --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimation.h @@ -0,0 +1,134 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import +#import + +@class CAMediaTimingFunction; + +/** + @abstract The abstract animation base class. + @discussion Instantiate and use one of the concrete animation subclasses. + */ +@interface POPAnimation : NSObject + +/** + @abstract The name of the animation. + @discussion Optional property to help identify the animation. + */ +@property (copy, nonatomic) NSString *name; + +/** + @abstract The beginTime of the animation in media time. + @discussion Defaults to 0 and starts immediately. + */ +@property (assign, nonatomic) CFTimeInterval beginTime; + +/** + @abstract The animation delegate. + @discussion See {@ref POPAnimationDelegate} for details. + */ +@property (weak, nonatomic) id delegate; + +/** + @abstract The animation tracer. + @discussion Returns the existing tracer, creating one if needed. Call start/stop on the tracer to toggle event collection. + */ +@property (readonly, nonatomic) POPAnimationTracer *tracer; + +/** + @abstract Optional block called on animation completion. + */ +@property (copy, nonatomic) void (^completionBlock)(POPAnimation *anim, BOOL finished); + +/** + @abstract Flag indicating whether animation should be removed on completion. + @discussion Setting to NO can facilitate animation reuse. Defaults to YES. + */ +@property (assign, nonatomic) BOOL removedOnCompletion; + +/** + @abstract Flag indicating whether animation is paused. + @discussion A paused animation is excluded from the list of active animations. On initial creation, defaults to YES. On animation addition, the animation is implicity unpaused. On animation completion, the animation is implicity paused including for animations with removedOnCompletion set to NO. + */ +@property (assign, nonatomic, getter = isPaused) BOOL paused; + +@end + +/** + @abstract The animation delegate. + */ +@protocol POPAnimationDelegate +@optional + +/** + @abstract Called on animation start. + @param anim The relevant animation. + */ +- (void)pop_animationDidStart:(POPAnimation *)anim; + +/** + @abstract Called when value meets or exceeds to value. + @param anim The relevant animation. + */ +- (void)pop_animationDidReachToValue:(POPAnimation *)anim; + +/** + @abstract Called on animation stop. + @param anim The relevant animation. + @param finished Flag indicating finished state. Flag is true if the animation reached completion before being removed. + */ +- (void)pop_animationDidStop:(POPAnimation *)anim finished:(BOOL)finished; + +/** + @abstract Called each frame animation is applied. + @param anim The relevant animation. + */ +- (void)pop_animationDidApply:(POPAnimation *)anim; + +@end + + +@interface NSObject (POP) + +/** + @abstract Add an animation to the reciver. + @param anim The animation to add. + @param key The key used to identify the animation. + @discussion The 'key' may be any string such that only one animation per unique key is added per object. + */ +- (void)pop_addAnimation:(POPAnimation *)anim forKey:(NSString *)key; + +/** + @abstract Remove all animations attached to the receiver. + */ +- (void)pop_removeAllAnimations; + +/** + @abstract Remove any animation attached to the receiver for 'key'. + @param key The key used to identify the animation. + */ +- (void)pop_removeAnimationForKey:(NSString *)key; + +/** + @abstract Returns an array containing the keys of all animations currently attached to the receiver. + @param The order of keys reflects the order in which animations will be applied. + */ +- (NSArray *)pop_animationKeys; + +/** + @abstract Returns any animation attached to the receiver. + @param key The key used to identify the animation. + @returns The animation currently attached, or nil if no such animation exists. + */ +- (id)pop_animationForKey:(NSString *)key; + +@end diff --git a/Demo/Pods/pop/pop/POPAnimation.mm b/Demo/Pods/pop/pop/POPAnimation.mm new file mode 100644 index 0000000..91b3ca7 --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimation.mm @@ -0,0 +1,228 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPAnimationInternal.h" +#import "POPAnimationTracerInternal.h" + +#import +#include + +#import "POPAnimationExtras.h" +#import "POPAnimationRuntime.h" +#import "POPAnimatorPrivate.h" +#import "POPAction.h" + +using namespace POP; + +#pragma mark - POPAnimation + +@implementation POPAnimation + +#pragma mark - Lifecycle + +- (id)init +{ + [NSException raise:NSStringFromClass([self class]) format:@"Attempting to instantiate an abstract class. Use a concrete subclass instead."]; + return nil; +} + +- (id)_init +{ + self = [super init]; + if (nil != self) { + [self _initState]; + } + return self; +} + +- (void)_initState +{ + _state = new POPAnimationState(self); +} + +- (void)dealloc +{ + if (_state) { + delete _state; + _state = NULL; + }; +} + +#pragma mark - Properties + +- (id)delegate +{ + return _state->delegate; +} + +- (void)setDelegate:(id)delegate +{ + _state->setDelegate(delegate); +} + +- (BOOL)isPaused +{ + return _state->paused; +} + +- (void)setPaused:(BOOL)paused +{ + _state->setPaused(paused ? true : false); +} + +FB_PROPERTY_GET(POPAnimationState, type, POPAnimationType); +DEFINE_RW_PROPERTY_OBJ_COPY(POPAnimationState, completionBlock, setCompletionBlock:, POPAnimationCompletionBlock); +DEFINE_RW_PROPERTY_OBJ_COPY(POPAnimationState, name, setName:, NSString*); +DEFINE_RW_PROPERTY(POPAnimationState, beginTime, setBeginTime:, CFTimeInterval); +DEFINE_RW_FLAG(POPAnimationState, removedOnCompletion, removedOnCompletion, setRemovedOnCompletion:); + +- (id)valueForUndefinedKey:(NSString *)key +{ + return _state->dict[key]; +} + +- (void)setValue:(id)value forUndefinedKey:(NSString *)key +{ + if (!value) { + [_state->dict removeObjectForKey:key]; + } else { + if (!_state->dict) + _state->dict = [[NSMutableDictionary alloc] init]; + _state->dict[key] = value; + } +} + +- (POPAnimationTracer *)tracer +{ + POPAnimationState *s = POPAnimationGetState(self); + if (!s->tracer) { + s->tracer = [[POPAnimationTracer alloc] initWithAnimation:self]; + } + return s->tracer; +} + +- (NSString *)description +{ + NSMutableString *s = [NSMutableString stringWithFormat:@"<%@:%p", NSStringFromClass([self class]), self]; + [self _appendDescription:s debug:NO]; + [s appendString:@">"]; + return s; +} + +- (NSString *)debugDescription +{ + NSMutableString *s = [NSMutableString stringWithFormat:@"<%@:%p", NSStringFromClass([self class]), self]; + [self _appendDescription:s debug:YES]; + [s appendString:@">"]; + return s; +} + +#pragma mark - Utility + +POPAnimationState *POPAnimationGetState(POPAnimation *a) +{ + return a->_state; +} + +- (BOOL)_advance:(id)object currentTime:(CFTimeInterval)currentTime elapsedTime:(CFTimeInterval)elapsedTime +{ + return YES; +} + +- (void)_appendDescription:(NSMutableString *)s debug:(BOOL)debug +{ + if (_state->name) + [s appendFormat:@"; name = %@", _state->name]; + + if (!self.removedOnCompletion) + [s appendFormat:@"; removedOnCompletion = %@", POPStringFromBOOL(self.removedOnCompletion)]; + + if (debug) { + if (_state->active) + [s appendFormat:@"; active = %@", POPStringFromBOOL(_state->active)]; + + if (_state->paused) + [s appendFormat:@"; paused = %@", POPStringFromBOOL(_state->paused)]; + } + + if (_state->beginTime) { + [s appendFormat:@"; beginTime = %f", _state->beginTime]; + } + + for (NSString *key in _state->dict) { + [s appendFormat:@"; %@ = %@", key, _state->dict[key]]; + } +} + +@end + + +#pragma mark - POPPropertyAnimation + +#pragma mark - POPBasicAnimation + +#pragma mark - POPDecayAnimation + +@implementation NSObject (POP) + +- (void)pop_addAnimation:(POPAnimation *)anim forKey:(NSString *)key +{ + [[POPAnimator sharedAnimator] addAnimation:anim forObject:self key:key]; +} + +- (void)pop_removeAllAnimations +{ + [[POPAnimator sharedAnimator] removeAllAnimationsForObject:self]; +} + +- (void)pop_removeAnimationForKey:(NSString *)key +{ + [[POPAnimator sharedAnimator] removeAnimationForObject:self key:key]; +} + +- (NSArray *)pop_animationKeys +{ + return [[POPAnimator sharedAnimator] animationKeysForObject:self]; +} + +- (id)pop_animationForKey:(NSString *)key +{ + return [[POPAnimator sharedAnimator] animationForObject:self key:key]; +} + +@end + +@implementation NSProxy (POP) + +- (void)pop_addAnimation:(POPAnimation *)anim forKey:(NSString *)key +{ + [[POPAnimator sharedAnimator] addAnimation:anim forObject:self key:key]; +} + +- (void)pop_removeAllAnimations +{ + [[POPAnimator sharedAnimator] removeAllAnimationsForObject:self]; +} + +- (void)pop_removeAnimationForKey:(NSString *)key +{ + [[POPAnimator sharedAnimator] removeAnimationForObject:self key:key]; +} + +- (NSArray *)pop_animationKeys +{ + return [[POPAnimator sharedAnimator] animationKeysForObject:self]; +} + +- (id)pop_animationForKey:(NSString *)key +{ + return [[POPAnimator sharedAnimator] animationForObject:self key:key]; +} + +@end diff --git a/Demo/Pods/pop/pop/POPAnimationEvent.h b/Demo/Pods/pop/pop/POPAnimationEvent.h new file mode 100644 index 0000000..cd1414f --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimationEvent.h @@ -0,0 +1,68 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +/** + @abstract Enumeraton of animation event types. + */ +typedef NS_ENUM(NSUInteger, POPAnimationEventType) { + kPOPAnimationEventPropertyRead = 0, + kPOPAnimationEventPropertyWrite, + kPOPAnimationEventToValueUpdate, + kPOPAnimationEventFromValueUpdate, + kPOPAnimationEventVelocityUpdate, + kPOPAnimationEventBouncinessUpdate, + kPOPAnimationEventSpeedUpdate, + kPOPAnimationEventFrictionUpdate, + kPOPAnimationEventMassUpdate, + kPOPAnimationEventTensionUpdate, + kPOPAnimationEventDidStart, + kPOPAnimationEventDidStop, + kPOPAnimationEventDidReachToValue, +}; + +/** + @abstract The base animation event class. + */ +@interface POPAnimationEvent : NSObject + +/** + @abstract The event type. See {@ref POPAnimationEventType} for possible values. + */ +@property (readonly, nonatomic, assign) POPAnimationEventType type; + +/** + @abstract The time of event. + */ +@property (readonly, nonatomic, assign) CFTimeInterval time; + +/** + @abstract Optional string describing the animation at time of event. + */ +@property (readonly, nonatomic, copy) NSString *animationDescription; + +@end + +/** + @abstract An animation event subclass for recording value and velocity. + */ +@interface POPAnimationValueEvent : POPAnimationEvent + +/** + @abstract The value recorded. + */ +@property (readonly, nonatomic, strong) id value; + +/** + @abstract The velocity recorded, if any. + */ +@property (readonly, nonatomic, strong) id velocity; + +@end diff --git a/Demo/Pods/pop/pop/POPAnimationEvent.mm b/Demo/Pods/pop/pop/POPAnimationEvent.mm new file mode 100644 index 0000000..3456e56 --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimationEvent.mm @@ -0,0 +1,101 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPAnimationEvent.h" +#import "POPAnimationEventInternal.h" + +static NSString *stringFromType(POPAnimationEventType aType) +{ + switch (aType) { + case kPOPAnimationEventPropertyRead: + return @"read"; + case kPOPAnimationEventPropertyWrite: + return @"write"; + case kPOPAnimationEventToValueUpdate: + return @"toValue"; + case kPOPAnimationEventFromValueUpdate: + return @"fromValue"; + case kPOPAnimationEventVelocityUpdate: + return @"velocity"; + case kPOPAnimationEventSpeedUpdate: + return @"speed"; + case kPOPAnimationEventBouncinessUpdate: + return @"bounciness"; + case kPOPAnimationEventFrictionUpdate: + return @"friction"; + case kPOPAnimationEventMassUpdate: + return @"mass"; + case kPOPAnimationEventTensionUpdate: + return @"tension"; + case kPOPAnimationEventDidStart: + return @"didStart"; + case kPOPAnimationEventDidStop: + return @"didStop"; + case kPOPAnimationEventDidReachToValue: + return @"didReachToValue"; + default: + return nil; + } +} + +@implementation POPAnimationEvent + +- (instancetype)initWithType:(POPAnimationEventType)aType time:(CFTimeInterval)aTime +{ + self = [super init]; + if (nil != self) { + _type = aType; + _time = aTime; + } + return self; +} + +- (NSString *)description +{ + NSMutableString *s = [NSMutableString stringWithFormat:@""]; + return s; +} + +// subclass override +- (void)_appendDescription:(NSMutableString *)s +{ + if (0 != _animationDescription.length) { + [s appendFormat:@"; animation = %@", _animationDescription]; + } +} + +@end + +@implementation POPAnimationValueEvent + +- (instancetype)initWithType:(POPAnimationEventType)aType time:(CFTimeInterval)aTime value:(id)aValue +{ + self = [self initWithType:aType time:aTime]; + if (nil != self) { + _value = aValue; + } + return self; +} + +- (void)_appendDescription:(NSMutableString *)s +{ + [super _appendDescription:s]; + + if (nil != _value) { + [s appendFormat:@"; value = %@", _value]; + } + + if (nil != _velocity) { + [s appendFormat:@"; velocity = %@", _velocity]; + } +} + +@end diff --git a/Demo/Pods/pop/pop/POPAnimationEventInternal.h b/Demo/Pods/pop/pop/POPAnimationEventInternal.h new file mode 100644 index 0000000..398d59b --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimationEventInternal.h @@ -0,0 +1,41 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "POPAnimationEvent.h" + +@interface POPAnimationEvent () + +/** + @abstract Default initializer. + */ +- (instancetype)initWithType:(POPAnimationEventType)type time:(CFTimeInterval)time; + +/** + @abstract Readwrite redefinition of public property. + */ +@property (readwrite, nonatomic, copy) NSString *animationDescription; + +@end + +@interface POPAnimationValueEvent () + +/** + @abstract Default initializer. + */ +- (instancetype)initWithType:(POPAnimationEventType)type time:(CFTimeInterval)time value:(id)value; + +/** + @abstract Readwrite redefinition of public property. + */ +@property (readwrite, nonatomic, strong) id velocity; + +@end + diff --git a/Demo/Pods/pop/pop/POPAnimationExtras.h b/Demo/Pods/pop/pop/POPAnimationExtras.h new file mode 100644 index 0000000..6c06800 --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimationExtras.h @@ -0,0 +1,43 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import +#import + +/** + @abstract The current drag coefficient. + @discussion A value greater than 1.0 indicates Simulator slow-motion animations are enabled. Defaults to 1.0. + */ +extern CGFloat POPAnimationDragCoefficient(); + +@interface CAAnimation (POPAnimationExtras) + +/** + @abstract Apply the current drag coefficient to animation speed. + @discussion Convenience utility to respect Simulator slow-motion animation settings. + */ +- (void)pop_applyDragCoefficient; + +@end + +@interface POPSpringAnimation (POPAnimationExtras) + +/** + @abstract Converts from spring bounciness and speed to tension, friction and mass dynamics values. + */ ++ (void)convertBounciness:(CGFloat)bounciness speed:(CGFloat)speed toTension:(CGFloat *)outTension friction:(CGFloat *)outFriction mass:(CGFloat *)outMass; + +/** + @abstract Converts from dynamics tension, friction and mass to spring bounciness and speed values. + */ ++ (void)convertTension:(CGFloat)tension friction:(CGFloat)friction toBounciness:(CGFloat *)outBounciness speed:(CGFloat *)outSpeed; + +@end diff --git a/Demo/Pods/pop/pop/POPAnimationExtras.mm b/Demo/Pods/pop/pop/POPAnimationExtras.mm new file mode 100644 index 0000000..d7abbfe --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimationExtras.mm @@ -0,0 +1,117 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPAnimationExtras.h" + +#import "POPAnimationPrivate.h" +#import "POPMath.h" + +#if TARGET_OS_IPHONE +#import +#endif + +#if TARGET_IPHONE_SIMULATOR +UIKIT_EXTERN CGFloat UIAnimationDragCoefficient(); // UIKit private drag coeffient, use judiciously +#endif + +CGFloat POPAnimationDragCoefficient() +{ +#if TARGET_IPHONE_SIMULATOR + return UIAnimationDragCoefficient(); +#else + return 1.0; +#endif +} + +@implementation CAAnimation (POPAnimationExtras) + +- (void)pop_applyDragCoefficient +{ + CGFloat k = POPAnimationDragCoefficient(); + if (k != 0 && k != 1) + self.speed = 1 / k; +} + +@end + +@implementation POPSpringAnimation (POPAnimationExtras) + +static const CGFloat POPBouncy3NormalizationRange = 20.0; +static const CGFloat POPBouncy3NormalizationScale = 1.7; +static const CGFloat POPBouncy3BouncinessNormalizedMin = 0.0; +static const CGFloat POPBouncy3BouncinessNormalizedMax = 0.8; +static const CGFloat POPBouncy3SpeedNormalizedMin = 0.5; +static const CGFloat POPBouncy3SpeedNormalizedMax = 200; +static const CGFloat POPBouncy3FrictionInterpolationMax = 0.01; + ++ (void)convertBounciness:(CGFloat)bounciness speed:(CGFloat)speed toTension:(CGFloat *)outTension friction:(CGFloat *)outFriction mass:(CGFloat *)outMass +{ + double b = normalize(bounciness / POPBouncy3NormalizationScale, 0, POPBouncy3NormalizationRange); + b = project_normal(b, POPBouncy3BouncinessNormalizedMin, POPBouncy3BouncinessNormalizedMax); + + double s = normalize(speed / POPBouncy3NormalizationScale, 0, POPBouncy3NormalizationRange); + + CGFloat tension = project_normal(s, POPBouncy3SpeedNormalizedMin, POPBouncy3SpeedNormalizedMax); + CGFloat friction = quadratic_out_interpolation(b, b3_nobounce(tension), POPBouncy3FrictionInterpolationMax); + + tension = POP_ANIMATION_TENSION_FOR_QC_TENSION(tension); + friction = POP_ANIMATION_FRICTION_FOR_QC_FRICTION(friction); + + if (outTension) { + *outTension = tension; + } + + if (outFriction) { + *outFriction = friction; + } + + if (outMass) { + *outMass = 1.0; + } +} + ++ (void)convertTension:(CGFloat)tension friction:(CGFloat)friction toBounciness:(CGFloat *)outBounciness speed:(CGFloat *)outSpeed +{ + // Convert to QC values, in which our calculations are done. + CGFloat qcFriction = QC_FRICTION_FOR_POP_ANIMATION_FRICTION(friction); + CGFloat qcTension = QC_TENSION_FOR_POP_ANIMATION_TENSION(tension); + + // Friction is a function of bounciness and tension, according to the following: + // friction = quadratic_out_interpolation(b, b3_nobounce(tension), POPBouncy3FrictionInterpolationMax); + // Solve for bounciness, given a tension and friction. + + CGFloat nobounceTension = b3_nobounce(qcTension); + CGFloat bounciness1, bounciness2; + + quadratic_solve((nobounceTension - POPBouncy3FrictionInterpolationMax), // a + 2 * (POPBouncy3FrictionInterpolationMax - nobounceTension), // b + (nobounceTension - qcFriction), // c + bounciness1, // x1 + bounciness2); // x2 + + + // Choose the quadratic solution within the normalized bounciness range + CGFloat projectedNormalizedBounciness = (bounciness2 < POPBouncy3BouncinessNormalizedMax) ? bounciness2 : bounciness1; + CGFloat projectedNormalizedSpeed = qcTension; + + // Reverse projection + normalization + CGFloat bounciness = ((POPBouncy3NormalizationRange * POPBouncy3NormalizationScale) / (POPBouncy3BouncinessNormalizedMax - POPBouncy3BouncinessNormalizedMin)) * (projectedNormalizedBounciness - POPBouncy3BouncinessNormalizedMin); + CGFloat speed = ((POPBouncy3NormalizationRange * POPBouncy3NormalizationScale) / (POPBouncy3SpeedNormalizedMax - POPBouncy3SpeedNormalizedMin)) * (projectedNormalizedSpeed - POPBouncy3SpeedNormalizedMin); + + // Write back results + if (outBounciness) { + *outBounciness = bounciness; + } + + if (outSpeed) { + *outSpeed = speed; + } +} + +@end diff --git a/Demo/Pods/pop/pop/POPAnimationInternal.h b/Demo/Pods/pop/pop/POPAnimationInternal.h new file mode 100644 index 0000000..777d441 --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimationInternal.h @@ -0,0 +1,485 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "POPAnimation.h" +#import "POPAnimationRuntime.h" +#import "POPAnimationTracer.h" +#import "POPAnimationTracerInternal.h" +#import "POPSpringSolver.h" +#import "POPVector.h" +#import "POPAction.h" +#import "POPMath.h" + +using namespace POP; + +/** + Enumeration of supported animation types. + */ +enum POPAnimationType +{ + kPOPAnimationSpring, + kPOPAnimationDecay, + kPOPAnimationBasic, + kPOPAnimationCustom, +}; + +typedef struct +{ + CGFloat progress; + bool reached; +} POPProgressMarker; + +typedef void (^POPAnimationCompletionBlock)(POPAnimation *anim, BOOL finished); + +@interface POPAnimation() +- (instancetype)_init; + +@property (assign, nonatomic) SpringSolver4d *solver; +@property (readonly, nonatomic) POPAnimationType type; + +/** + The current animation value, updated while animation is progressing. + */ +@property (copy, nonatomic, readonly) id currentValue; + +/** + An array of optional progress markers. For each marker specified, the animation delegate will be informed when progress meets or exceeds the value specified. Specifying values outside of the [0, 1] range will give undefined results. + */ +@property (copy, nonatomic) NSArray *progressMarkers; + +/** + Return YES to indicate animation should continue animating. + */ +- (BOOL)_advance:(id)object currentTime:(CFTimeInterval)currentTime elapsedTime:(CFTimeInterval)elapsedTime; + +/** + Subclass override point to append animation description. + */ +- (void)_appendDescription:(NSMutableString *)s debug:(BOOL)debug; + +@end + +NS_INLINE NSString *describe(VectorConstRef vec) +{ + return NULL == vec ? @"null" : vec->toString(); +} + +NS_INLINE Vector4r vector4(VectorConstRef vec) +{ + return NULL == vec ? Vector4r::Zero() : vec->vector4r(); +} + +NS_INLINE Vector4d vector4d(VectorConstRef vec) +{ + if (NULL == vec) { + return Vector4d::Zero(); + } else { + return vec->vector4r().cast(); + } +} + +NS_INLINE bool vec_equal(VectorConstRef v1, VectorConstRef v2) +{ + if (v1 == v2) { + return true; + } + if (!v1 || !v2) { + return false; + } + return *v1 == *v2; +} + +NS_INLINE CGFloat * vec_data(VectorRef vec) +{ + return NULL == vec ? NULL : vec->data(); +} + +template +struct ComputeProgressFunctor { + CGFloat operator()(const T &value, const T &start, const T &end) const { + return 0; + } +}; + +template<> +struct ComputeProgressFunctor { + CGFloat operator()(const Vector4r &value, const Vector4r &start, const Vector4r &end) const { + CGFloat s = (value - start).squaredNorm(); // distance from start + CGFloat e = (value - end).squaredNorm(); // distance from end + CGFloat d = (end - start).squaredNorm(); // distance from start to end + + if (0 == d) { + return 1; + } else if (s > e) { + // s -------- p ---- e OR s ------- e ---- p + return sqrtr(s/d); + } else { + // s --- p --------- e OR p ---- s ------- e + return 1 - sqrtr(e/d); + } + } +}; + +struct _POPAnimationState; +struct _POPDecayAnimationState; +struct _POPPropertyAnimationState; + +extern _POPAnimationState *POPAnimationGetState(POPAnimation *a); + + +#define FB_FLAG_GET(stype, flag, getter) \ +- (BOOL)getter { \ + return ((stype *)_state)->flag; \ +} + +#define FB_FLAG_SET(stype, flag, mutator) \ +- (void)mutator (BOOL)value { \ + if (value == ((stype *)_state)->flag) \ + return; \ + ((stype *)_state)->flag = value; \ +} + +#define DEFINE_RW_FLAG(stype, flag, getter, mutator) \ + FB_FLAG_GET (stype, flag, getter) \ + FB_FLAG_SET (stype, flag, mutator) + +#define FB_PROPERTY_GET(stype, property, ctype) \ +- (ctype)property { \ + return ((stype *)_state)->property; \ +} + +#define FB_PROPERTY_SET(stype, property, mutator, ctype, ...) \ +- (void)mutator (ctype)value { \ + if (value == ((stype *)_state)->property) \ + return; \ + ((stype *)_state)->property = value; \ + __VA_ARGS__ \ +} + +#define FB_PROPERTY_SET_OBJ_COPY(stype, property, mutator, ctype, ...) \ +- (void)mutator (ctype)value { \ + if (value == ((stype *)_state)->property) \ + return; \ + ((stype *)_state)->property = [value copy]; \ + __VA_ARGS__ \ +} + +#define DEFINE_RW_PROPERTY(stype, flag, mutator, ctype, ...) \ + FB_PROPERTY_GET (stype, flag, ctype) \ + FB_PROPERTY_SET (stype, flag, mutator, ctype, __VA_ARGS__) + +#define DEFINE_RW_PROPERTY_OBJ(stype, flag, mutator, ctype, ...) \ + FB_PROPERTY_GET (stype, flag, ctype) \ + FB_PROPERTY_SET (stype, flag, mutator, ctype, __VA_ARGS__) + +#define DEFINE_RW_PROPERTY_OBJ_COPY(stype, flag, mutator, ctype, ...) \ + FB_PROPERTY_GET (stype, flag, ctype) \ + FB_PROPERTY_SET_OBJ_COPY (stype, flag, mutator, ctype, __VA_ARGS__) + + +/** + Internal delegate definition. + */ +@interface NSObject (POPAnimationDelegateInternal) +- (void)pop_animation:(POPAnimation *)anim didReachProgress:(CGFloat)progress; +@end + +struct _POPAnimationState +{ + id __unsafe_unretained self; + POPAnimationType type; + NSString *name; + NSUInteger ID; + CFTimeInterval beginTime; + CFTimeInterval startTime; + CFTimeInterval lastTime; + id __weak delegate; + POPAnimationCompletionBlock completionBlock; + NSMutableDictionary *dict; + POPAnimationTracer *tracer; + CGFloat progress; + + bool active:1; + bool paused:1; + bool removedOnCompletion:1; + + bool delegateDidStart:1; + bool delegateDidStop:1; + bool delegateDidProgress:1; + bool delegateDidApply:1; + bool delegateDidReachToValue:1; + + bool additive:1; + bool didReachToValue:1; + bool tracing:1; // corresponds to tracer started + bool userSpecifiedDynamics:1; + bool customFinished:1; + + _POPAnimationState(id __unsafe_unretained anim) : + self(anim), + type((POPAnimationType)0), + name(nil), + ID(0), + beginTime(0), + startTime(0), + lastTime(0), + delegate(nil), + completionBlock(nil), + dict(nil), + tracer(nil), + progress(0), + active(false), + paused(true), + removedOnCompletion(true), + delegateDidStart(false), + delegateDidStop(false), + delegateDidProgress(false), + delegateDidApply(false), + delegateDidReachToValue(false), + additive(false), + didReachToValue(false), + tracing(false), + userSpecifiedDynamics(false), + customFinished(false) {} + + virtual ~_POPAnimationState() + { + name = nil; + dict = nil; + tracer = nil; + completionBlock = NULL; + } + + bool isCustom() { + return kPOPAnimationCustom == type; + } + + bool isStarted() { + return 0 != startTime; + } + + id getDelegate() { + return delegate; + } + + void setDelegate(id d) { + if (d != delegate) { + delegate = d; + delegateDidStart = [d respondsToSelector:@selector(pop_animationDidStart:)]; + delegateDidStop = [d respondsToSelector:@selector(pop_animationDidStop:finished:)]; + delegateDidProgress = [d respondsToSelector:@selector(pop_animation:didReachProgress:)]; + delegateDidApply = [d respondsToSelector:@selector(pop_animationDidApply:)]; + delegateDidReachToValue = [d respondsToSelector:@selector(pop_animationDidReachToValue:)]; + } + } + + bool getPaused() { + return paused; + } + + void setPaused(bool f) { + if (f != paused) { + paused = f; + if (!paused) { + reset(false); + } + } + } + + CGFloat getProgress() { + return progress; + } + + /* returns true if started */ + bool startIfNeeded(id obj, CFTimeInterval time, CFTimeInterval offset) + { + bool started = false; + + // detect start based on time + if (0 == startTime && time >= beginTime + offset) { + + // activate & unpause + active = true; + setPaused(false); + + // start us one frame in the past (when we added the animation) + if (0 == beginTime) { + time -= 1/60.; + } + + // note start time + startTime = lastTime = time; + started = true; + } + + // ensure values for running animation + bool running = active && !paused; + if (running) { + willRun(started, obj); + } + + // handle start + if (started) { + handleDidStart(); + } + + return started; + } + + void stop(bool removing, bool done) { + if (active) + { + // delegate progress one last time + if (done) { + delegateProgress(); + } + + if (removing) { + active = false; + } + + handleDidStop(done); + } else { + + // stopped before even started + // delegate start and stop regardless; matches CA behavior + if (!isStarted()) { + handleDidStart(); + handleDidStop(false); + } + } + + setPaused(true); + } + + virtual void handleDidStart() + { + if (delegateDidStart) { + ActionEnabler enabler; + [delegate pop_animationDidStart:self]; + } + + if (tracing) { + [tracer didStart]; + } + } + + void handleDidStop(BOOL done) + { + if (delegateDidStop) { + ActionEnabler enabler; + [delegate pop_animationDidStop:self finished:done]; + } + + // add another strong reference to completion block before callout + POPAnimationCompletionBlock block = completionBlock; + if (block != NULL) { + ActionEnabler enabler; + block(self, done); + } + + if (tracing) { + [tracer didStop:done]; + } + } + + /* virtual functions */ + virtual bool isDone() { + if (isCustom()) { + return customFinished; + } + + return false; + } + + bool advanceTime(CFTimeInterval time, id obj) { + bool advanced = false; + bool computedProgress = false; + + CFTimeInterval dt = time - lastTime; + if (dt < 0.001) + return advanced; + + switch (type) { + case kPOPAnimationSpring: + advanced = advance(time, dt, obj); + break; + case kPOPAnimationDecay: + advanced = advance(time, dt, obj); + break; + case kPOPAnimationBasic: { + advanced = advance(time, dt, obj); + computedProgress = true; + break; + } + case kPOPAnimationCustom: { + customFinished = [self _advance:obj currentTime:time elapsedTime:dt] ? false : true; + advanced = true; + break; + } + default: + break; + } + + if (advanced) { + + // estimate progress + if (!computedProgress) { + computeProgress(); + } + + // delegate progress + delegateProgress(); + + // update time + lastTime = time; + } + + return advanced; + } + + virtual void willRun(bool started, id obj) {} + virtual bool advance(CFTimeInterval time, CFTimeInterval dt, id obj) { return false; } + virtual void computeProgress() {} + virtual void delegateProgress() {} + + virtual void delegateApply() { + if (delegateDidApply) { + ActionEnabler enabler; + [delegate pop_animationDidApply:self]; + } + } + + virtual void reset(bool all) { + startTime = 0; + lastTime = 0; + } +}; + +typedef struct _POPAnimationState POPAnimationState; + + +@interface POPAnimation () +{ +@protected + struct _POPAnimationState *_state; +} + +@end + +// NSProxy extensions, for testing pursposes +@interface NSProxy (POP) +- (void)pop_addAnimation:(POPAnimation *)anim forKey:(NSString *)key; +- (void)pop_removeAllAnimations; +- (void)pop_removeAnimationForKey:(NSString *)key; +- (NSArray *)pop_animationKeys; +- (POPAnimation *)pop_animationForKey:(NSString *)key; +@end diff --git a/Demo/Pods/pop/pop/POPAnimationPrivate.h b/Demo/Pods/pop/pop/POPAnimationPrivate.h new file mode 100644 index 0000000..0b7189f --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimationPrivate.h @@ -0,0 +1,16 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#define POP_ANIMATION_FRICTION_FOR_QC_FRICTION(qcFriction) (25.0 + (((qcFriction - 8.0) / 2.0) * (25.0 - 19.0))) +#define POP_ANIMATION_TENSION_FOR_QC_TENSION(qcTension) (194.0 + (((qcTension - 30.0) / 50.0) * (375.0 - 194.0))) + +#define QC_FRICTION_FOR_POP_ANIMATION_FRICTION(fbFriction) (8.0 + 2.0 * ((fbFriction - 25.0)/(25.0 - 19.0))) +#define QC_TENSION_FOR_POP_ANIMATION_TENSION(fbTension) (30.0 + 50.0 * ((fbTension - 194.0)/(375.0 - 194.0))) diff --git a/Demo/Pods/pop/pop/POPAnimationRuntime.h b/Demo/Pods/pop/pop/POPAnimationRuntime.h new file mode 100644 index 0000000..bc02e9b --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimationRuntime.h @@ -0,0 +1,102 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#include + +#import + +#import "POPMath.h" +#import "POPVector.h" + +enum POPValueType +{ + kPOPValueUnknown = 0, + kPOPValueInteger, + kPOPValueFloat, + kPOPValuePoint, + kPOPValueSize, + kPOPValueRect, + kPOPValueAffineTransform, + kPOPValueTransform, + kPOPValueRange, + kPOPValueColor, +}; + +using namespace POP; + +/** + Returns value type based on objc type description, given list of supported value types and length. + */ +extern POPValueType POPSelectValueType(const char *objctype, const POPValueType *types, size_t length); + +/** + Returns value type based on objc object, given a list of supported value types and length. + */ +extern POPValueType POPSelectValueType(id obj, const POPValueType *types, size_t length); + +/** + Array of all value types. + */ +extern const POPValueType kPOPAnimatableAllTypes[9]; + +/** + Array of all value types supported for animation. + */ +extern const POPValueType kPOPAnimatableSupportTypes[7]; + +/** + Returns a string description of a value type. + */ +extern NSString *POPValueTypeToString(POPValueType t); + +/** + Returns a mutable dictionary of weak pointer keys to weak pointer values. + */ +extern CFMutableDictionaryRef POPDictionaryCreateMutableWeakPointerToWeakPointer(NSUInteger capacity) CF_RETURNS_RETAINED; + +/** + Returns a mutable dictionary of weak pointer keys to weak pointer values. + */ +extern CFMutableDictionaryRef POPDictionaryCreateMutableWeakPointerToStrongObject(NSUInteger capacity) CF_RETURNS_RETAINED; + +/** + Box a vector. + */ +extern id POPBox(VectorConstRef vec, POPValueType type, bool force = false); + +/** + Unbox a vector. + */ +extern VectorRef POPUnbox(id value, POPValueType &type, NSUInteger &count, bool validate); + +/** + Read/write block typedefs for convenience. + */ +typedef void(^pop_animatable_read_block)(id obj, CGFloat *value); +typedef void(^pop_animatable_write_block)(id obj, const CGFloat *value); + +/** + Read object value and return a Vector4r. + */ +NS_INLINE Vector4r read_values(pop_animatable_read_block read, id obj, size_t count) +{ + Vector4r vec = Vector4r::Zero(); + if (0 == count) + return vec; + + read(obj, vec.data()); + + return vec; +} + +NS_INLINE NSString *POPStringFromBOOL(BOOL value) +{ + return value ? @"YES" : @"NO"; +} diff --git a/Demo/Pods/pop/pop/POPAnimationRuntime.mm b/Demo/Pods/pop/pop/POPAnimationRuntime.mm new file mode 100644 index 0000000..c54ff7d --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimationRuntime.mm @@ -0,0 +1,271 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPAnimationRuntime.h" + +#import + +#import + +#if TARGET_OS_IPHONE +#import +#else +#import +#endif + +#import "POPVector.h" +#import "POPAnimationRuntime.h" +#import "POPCGUtils.h" +#import "POPGeometry.h" + +static Boolean pointerEqual(const void *ptr1, const void *ptr2) { + return ptr1 == ptr2; +} + +static CFHashCode pointerHash(const void *ptr) { + return (CFHashCode)(ptr); +} + +CFMutableDictionaryRef POPDictionaryCreateMutableWeakPointerToWeakPointer(NSUInteger capacity) +{ + CFDictionaryKeyCallBacks kcb = kCFTypeDictionaryKeyCallBacks; + + // weak, pointer keys + kcb.retain = NULL; + kcb.retain = NULL; + kcb.equal = pointerEqual; + kcb.hash = pointerHash; + + CFDictionaryValueCallBacks vcb = kCFTypeDictionaryValueCallBacks; + + // weak, pointer values + vcb.retain = NULL; + vcb.release = NULL; + vcb.equal = pointerEqual; + + return CFDictionaryCreateMutable(NULL, capacity, &kcb, &vcb); +} + +CFMutableDictionaryRef POPDictionaryCreateMutableWeakPointerToStrongObject(NSUInteger capacity) +{ + CFDictionaryKeyCallBacks kcb = kCFTypeDictionaryKeyCallBacks; + + // weak, pointer keys + kcb.retain = NULL; + kcb.release = NULL; + kcb.equal = pointerEqual; + kcb.hash = pointerHash; + + // strong, object values + CFDictionaryValueCallBacks vcb = kCFTypeDictionaryValueCallBacks; + + return CFDictionaryCreateMutable(NULL, capacity, &kcb, &vcb); +} + +static bool FBCompareTypeEncoding(const char *objctype, POPValueType type) +{ + switch (type) + { + case kPOPValueFloat: + return (strcmp(objctype, @encode(float)) == 0 + || strcmp(objctype, @encode(double)) == 0 + ); + + case kPOPValuePoint: + return (strcmp(objctype, @encode(CGPoint)) == 0 +#if !TARGET_OS_IPHONE + || strcmp(objctype, @encode(NSPoint)) == 0 +#endif + ); + + case kPOPValueSize: + return (strcmp(objctype, @encode(CGSize)) == 0 +#if !TARGET_OS_IPHONE + || strcmp(objctype, @encode(NSSize)) == 0 +#endif + ); + + case kPOPValueRect: + return (strcmp(objctype, @encode(CGRect)) == 0 +#if !TARGET_OS_IPHONE + || strcmp(objctype, @encode(NSRect)) == 0 +#endif + ); + + case kPOPValueAffineTransform: + return strcmp(objctype, @encode(CGAffineTransform)) == 0; + + case kPOPValueTransform: + return strcmp(objctype, @encode(CATransform3D)) == 0; + + case kPOPValueRange: + return strcmp(objctype, @encode(CFRange)) == 0 + || strcmp(objctype, @encode (NSRange)) == 0; + + case kPOPValueInteger: + return (strcmp(objctype, @encode(int)) == 0 + || strcmp(objctype, @encode(unsigned int)) == 0 + || strcmp(objctype, @encode(short)) == 0 + || strcmp(objctype, @encode(unsigned short)) == 0 + || strcmp(objctype, @encode(long)) == 0 + || strcmp(objctype, @encode(unsigned long)) == 0 + || strcmp(objctype, @encode(long long)) == 0 + || strcmp(objctype, @encode(unsigned long long)) == 0 + ); + default: + return false; + } +} + +POPValueType POPSelectValueType(const char *objctype, const POPValueType *types, size_t length) +{ + if (NULL != objctype) { + for (size_t idx = 0; idx < length; idx++) { + if (FBCompareTypeEncoding(objctype, types[idx])) + return types[idx]; + } + } + return kPOPValueUnknown; +} + +POPValueType POPSelectValueType(id obj, const POPValueType *types, size_t length) +{ + if ([obj isKindOfClass:[NSValue class]]) { + return POPSelectValueType([obj objCType], types, length); + } else if (NULL != POPCGColorWithColor(obj)) { + return kPOPValueColor; + } + return kPOPValueUnknown; +} + +const POPValueType kPOPAnimatableAllTypes[9] = {kPOPValueInteger, kPOPValueFloat, kPOPValuePoint, kPOPValueSize, kPOPValueRect, kPOPValueAffineTransform, kPOPValueTransform, kPOPValueRange, kPOPValueColor}; + +const POPValueType kPOPAnimatableSupportTypes[7] = {kPOPValueInteger, kPOPValueFloat, kPOPValuePoint, kPOPValueSize, kPOPValueRect, kPOPValueColor}; + +NSString *POPValueTypeToString(POPValueType t) +{ + switch (t) { + case kPOPValueUnknown: + return @"unknown"; + case kPOPValueInteger: + return @"int"; + case kPOPValueFloat: + return @"CGFloat"; + case kPOPValuePoint: + return @"CGPoint"; + case kPOPValueSize: + return @"CGSize"; + case kPOPValueRect: + return @"CGRect"; + case kPOPValueAffineTransform: + return @"CGAffineTransform"; + case kPOPValueTransform: + return @"CATransform3D"; + case kPOPValueRange: + return @"CFRange"; + case kPOPValueColor: + return @"CGColorRef"; + default: + return nil; + } +} + +id POPBox(VectorConstRef vec, POPValueType type, bool force) +{ + if (NULL == vec) + return nil; + + switch (type) { + case kPOPValueInteger: + case kPOPValueFloat: + return @(vec->data()[0]); + break; + case kPOPValuePoint: + return [NSValue valueWithCGPoint:vec->cg_point()]; + break; + case kPOPValueSize: + return [NSValue valueWithCGSize:vec->cg_size()]; + break; + case kPOPValueRect: + return [NSValue valueWithCGRect:vec->cg_rect()]; + break; + case kPOPValueColor: { + return (__bridge_transfer id)vec->cg_color(); + break; + } + default: + return force ? [NSValue valueWithCGPoint:vec->cg_point()] : nil; + break; + } +} + +static VectorRef vectorize(id value, POPValueType type) +{ + Vector *vec = NULL; + + switch (type) { + case kPOPValueInteger: + case kPOPValueFloat: + vec = Vector::new_cg_float([value floatValue]); + break; + case kPOPValuePoint: + vec = Vector::new_cg_point([value CGPointValue]); + break; + case kPOPValueSize: + vec = Vector::new_cg_size([value CGSizeValue]); + break; + case kPOPValueRect: + vec = Vector::new_cg_rect([value CGRectValue]); + break; + case kPOPValueAffineTransform: + vec = Vector::new_cg_affine_transform([value CGAffineTransformValue]); + break; + case kPOPValueColor: + vec = Vector::new_cg_color(POPCGColorWithColor(value)); + default: + break; + } + + return VectorRef(vec); +} + +VectorRef POPUnbox(id value, POPValueType &animationType, NSUInteger &count, bool validate) +{ + if (nil == value) { + count = 0; + return VectorRef(NULL); + } + + // determine type of value + POPValueType valueType = POPSelectValueType(value, kPOPAnimatableSupportTypes, POP_ARRAY_COUNT(kPOPAnimatableSupportTypes)); + + // handle unknown types + if (kPOPValueUnknown == valueType) { + NSString *valueDesc = kPOPValueUnknown != valueType ? POPValueTypeToString(valueType) : [[value class] description]; + [NSException raise:@"Unsuported value" format:@"Animating %@ values is not supported", valueDesc]; + } + + // vectorize + VectorRef vec = vectorize(value, valueType); + + if (kPOPValueUnknown == animationType || 0 == count) { + // update animation type based on value type + animationType = valueType; + if (NULL != vec) { + count = vec->size(); + } + } else if (validate) { + // allow for mismatched types, so long as vector size matches + if (count != vec->size()) { + [NSException raise:@"Invalid value" format:@"%@ should be of type %@", value, POPValueTypeToString(animationType)]; + } + } + + return vec; +} diff --git a/Demo/Pods/pop/pop/POPAnimationTracer.h b/Demo/Pods/pop/pop/POPAnimationTracer.h new file mode 100644 index 0000000..53a6a03 --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimationTracer.h @@ -0,0 +1,60 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import + +@class POPAnimation; + +/** + @abstract Tracer of animation events to fasciliate unit testing & debugging. + */ +@interface POPAnimationTracer : NSObject + +/** + @abstract Start recording events. + */ +- (void)start; + +/** + @abstract Stop recording events. + */ +- (void)stop; + +/** + @abstract Resets any recoded events. Continues recording events if already started. + */ +- (void)reset; + +/** + @abstract Property representing all recorded events. + @discussion Events are returned in order of occurence. + */ +@property (nonatomic, assign, readonly) NSArray *allEvents; + +/** + @abstract Property representing all recorded write events for convenience. + @discussion Events are returned in order of occurence. + */ +@property (nonatomic, assign, readonly) NSArray *writeEvents; + +/** + @abstract Queries for events of specified type. + @param type The type of event to return. + @returns An array of events of specified type in order of occurence. + */ +- (NSArray *)eventsWithType:(POPAnimationEventType)type; + +/** + @abstract Property indicating whether tracer should automatically log events and reset collection on animation completion. + */ +@property (nonatomic, assign) BOOL shouldLogAndResetOnCompletion; + +@end diff --git a/Demo/Pods/pop/pop/POPAnimationTracer.mm b/Demo/Pods/pop/pop/POPAnimationTracer.mm new file mode 100644 index 0000000..e2ebfb4 --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimationTracer.mm @@ -0,0 +1,184 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPAnimationTracer.h" + +#import + +#import "POPAnimationEventInternal.h" +#import "POPAnimationInternal.h" +#import "POPSpringAnimation.h" + +@implementation POPAnimationTracer +{ + __weak POPAnimation *_animation; + POPAnimationState *_animationState; + NSMutableArray *_events; + BOOL _animationHasVelocity; +} + +static POPAnimationEvent *create_event(POPAnimationTracer *self, POPAnimationEventType type, id value = nil, bool recordAnimation = false) +{ + bool useLocalTime = 0 != self->_animationState->startTime; + CFTimeInterval time = useLocalTime + ? self->_animationState->lastTime - self->_animationState->startTime + : self->_animationState->lastTime; + + POPAnimationEvent *event; + + if (!value) { + event = [[POPAnimationEvent alloc] initWithType:type time:time]; + } else { + event = [[POPAnimationValueEvent alloc] initWithType:type time:time value:value]; + if (self->_animationHasVelocity) { + [(POPAnimationValueEvent *)event setVelocity:[(POPSpringAnimation *)self->_animation velocity]]; + } + } + + if (recordAnimation) { + event.animationDescription = [self->_animation description]; + } + + return event; +} + +- (id)initWithAnimation:(POPAnimation *)anAnim +{ + self = [super init]; + if (nil != self) { + _animation = anAnim; + _animationState = POPAnimationGetState(anAnim); + _events = [[NSMutableArray alloc] initWithCapacity:50]; + _animationHasVelocity = [anAnim respondsToSelector:@selector(velocity)]; + } + return self; +} + +- (void)readPropertyValue:(id)aValue +{ + POPAnimationEvent *event = create_event(self, kPOPAnimationEventPropertyRead, aValue); + [_events addObject:event]; +} + +- (void)writePropertyValue:(id)aValue +{ + POPAnimationEvent *event = create_event(self, kPOPAnimationEventPropertyWrite, aValue); + [_events addObject:event]; +} + +- (void)updateToValue:(id)aValue +{ + POPAnimationEvent *event = create_event(self, kPOPAnimationEventToValueUpdate, aValue); + [_events addObject:event]; +} + +- (void)updateFromValue:(id)aValue +{ + POPAnimationEvent *event = create_event(self, kPOPAnimationEventFromValueUpdate, aValue); + [_events addObject:event]; +} + +- (void)updateVelocity:(id)aValue +{ + POPAnimationEvent *event = create_event(self, kPOPAnimationEventVelocityUpdate, aValue); + [_events addObject:event]; +} + +- (void)updateSpeed:(float)aFloat +{ + POPAnimationEvent *event = create_event(self, kPOPAnimationEventSpeedUpdate, @(aFloat)); + [_events addObject:event]; +} + +- (void)updateBounciness:(float)aFloat +{ + POPAnimationEvent *event = create_event(self, kPOPAnimationEventBouncinessUpdate, @(aFloat)); + [_events addObject:event]; +} + +- (void)updateFriction:(float)aFloat +{ + POPAnimationEvent *event = create_event(self, kPOPAnimationEventFrictionUpdate, @(aFloat)); + [_events addObject:event]; +} + +- (void)updateMass:(float)aFloat +{ + POPAnimationEvent *event = create_event(self, kPOPAnimationEventMassUpdate, @(aFloat)); + [_events addObject:event]; +} + +- (void)updateTension:(float)aFloat +{ + POPAnimationEvent *event = create_event(self, kPOPAnimationEventTensionUpdate, @(aFloat)); + [_events addObject:event]; +} + +- (void)didStart +{ + POPAnimationEvent *event = create_event(self, kPOPAnimationEventDidStart, nil, true); + [_events addObject:event]; +} + +- (void)didStop:(BOOL)finished +{ + POPAnimationEvent *event = create_event(self, kPOPAnimationEventDidStop, @(finished), true); + [_events addObject:event]; + + if (_shouldLogAndResetOnCompletion) { + NSLog(@"events:%@", self.allEvents); + [self reset]; + } +} + +- (void)didReachToValue:(id)aValue +{ + POPAnimationEvent *event = create_event(self, kPOPAnimationEventDidReachToValue, aValue); + [_events addObject:event]; +} + +- (void)start +{ + POPAnimationState *s = POPAnimationGetState(_animation); + s->tracing = true; +} + +- (void)stop +{ + POPAnimationState *s = POPAnimationGetState(_animation); + s->tracing = false; +} + +- (void)reset +{ + [_events removeAllObjects]; +} + +- (NSArray *)allEvents +{ + return [_events copy]; +} + +- (NSArray *)writeEvents +{ + return [self eventsWithType:kPOPAnimationEventPropertyWrite]; +} + +- (NSArray *)eventsWithType:(POPAnimationEventType)aType +{ + NSMutableArray *array = [NSMutableArray array]; + for (POPAnimationEvent *event in _events) { + if (aType == event.type) { + [array addObject:event]; + } + } + return array; +} + +@end diff --git a/Demo/Pods/pop/pop/POPAnimationTracerInternal.h b/Demo/Pods/pop/pop/POPAnimationTracerInternal.h new file mode 100644 index 0000000..748b995 --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimationTracerInternal.h @@ -0,0 +1,91 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import + +@interface POPAnimationTracer (Internal) + +/** + @abstract Designated initalizer. Pass the animation being traced. + */ +- (instancetype)initWithAnimation:(POPAnimation *)anAnim; + +/** + @abstract Records read value. + */ +- (void)readPropertyValue:(id)aValue; + +/** + @abstract Records write value. + */ +- (void)writePropertyValue:(id)aValue; + +/** + Records to value update. + */ +- (void)updateToValue:(id)aValue; + +/** + @abstract Records from value update. + */ +- (void)updateFromValue:(id)aValue; + +/** + @abstract Records from value update. + */ +- (void)updateVelocity:(id)aValue; + +/** + @abstract Records bounciness update. + */ +- (void)updateBounciness:(float)aFloat; + +/** + @abstract Records speed update. + */ +- (void)updateSpeed:(float)aFloat; + +/** + @abstract Records friction update. + */ +- (void)updateFriction:(float)aFloat; + +/** + @abstract Records mass update. + */ +- (void)updateMass:(float)aFloat; + +/** + @abstract Records tension update. + */ +- (void)updateTension:(float)aFloat; + +/** + @abstract Records did add. + */ +- (void)didAdd; + +/** + @abstract Records did start. + */ +- (void)didStart; + +/** + @abstract Records did stop. + */ +- (void)didStop:(BOOL)finished; + +/** + @abstract Records did reach to value. + */ +- (void)didReachToValue:(id)aValue; + +@end diff --git a/Demo/Pods/pop/pop/POPAnimator.h b/Demo/Pods/pop/pop/POPAnimator.h new file mode 100644 index 0000000..7d71d24 --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimator.h @@ -0,0 +1,47 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +@protocol POPAnimatorDelegate; + +/** + @abstract The animator class renders animations. + */ +@interface POPAnimator : NSObject + +/** + @abstract The shared animator instance. + @discussion Consumers should generally use the shared instance in lieu of creating new instances. + */ ++ (instancetype)sharedAnimator; + +/** + @abstract The optional animator delegate. + */ +@property (weak, nonatomic) id delegate; + +@end + +/** + @abstract The animator delegate. + */ +@protocol POPAnimatorDelegate + +/** + @abstract Called on each frame before animation application. + */ +- (void)animatorWillAnimate:(POPAnimator *)animator; + +/** + @abstract Called on each frame after animation application. + */ +- (void)animatorDidAnimate:(POPAnimator *)animator; + +@end diff --git a/Demo/Pods/pop/pop/POPAnimator.mm b/Demo/Pods/pop/pop/POPAnimator.mm new file mode 100644 index 0000000..e207472 --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimator.mm @@ -0,0 +1,643 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPAnimator.h" +#import "POPAnimatorPrivate.h" + +#import +#import +#import + +#import + +#import "POPAnimation.h" +#import "POPAnimationExtras.h" +#import "POPAnimationInternal.h" +#import "POPAnimationRuntime.h" +#import "POPBasicAnimationInternal.h" +#import "POPDecayAnimationInternal.h" +#import "POPSpringAnimationInternal.h" +#import "POPSpringSolver.h" + +using namespace std; +using namespace POP; + +#define ENABLE_LOGGING_DEBUG 0 +#define ENABLE_LOGGING_INFO 0 + +#if ENABLE_LOGGING_DEBUG +#define FBLogAnimDebug NSLog +#else +#define FBLogAnimDebug(...) +#endif + +#if ENABLE_LOGGING_INFO +#define FBLogAnimInfo NSLog +#else +#define FBLogAnimInfo(...) +#endif + +class POPAnimatorItem +{ +public: + id __weak object; + NSString *key; + POPAnimation *animation; + NSInteger refCount; + id __unsafe_unretained unretainedObject; + + POPAnimatorItem(id o, NSString *k, POPAnimation *a) POP_NOTHROW + { + object = o; + key = [k copy]; + animation = a; + refCount = 1; + unretainedObject = o; + } + + ~POPAnimatorItem() + { + } + + bool operator==(const POPAnimatorItem& o) const { + return unretainedObject == o.unretainedObject && animation == o.animation && [key isEqualToString:o.key]; + } + +}; + +typedef std::shared_ptr POPAnimatorItemRef; +typedef std::shared_ptr POPAnimatorItemConstRef; + +typedef std::list POPAnimatorItemList; +typedef POPAnimatorItemList::iterator POPAnimatorItemListIterator; +typedef POPAnimatorItemList::const_iterator POPAnimatorItemListConstIterator; + +static BOOL _disableBackgroundThread = YES; + +@interface POPAnimator () +{ +#if TARGET_OS_IPHONE + CADisplayLink *_displayLink; +#else + CVDisplayLinkRef _displayLink; +#endif + POPAnimatorItemList _list; + CFMutableDictionaryRef _dict; + NSMutableArray *_observers; + CFTimeInterval _slowMotionStartTime; + CFTimeInterval _slowMotionLastTime; + CFTimeInterval _slowMotionAccumulator; + OSSpinLock _lock; +} +@end + +@implementation POPAnimator + +#if !TARGET_OS_IPHONE +static CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *now, const CVTimeStamp *outputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *context) +{ + if (_disableBackgroundThread) { + dispatch_async(dispatch_get_main_queue(), ^{ + [(__bridge POPAnimator*)context render]; + }); + } else { + [(__bridge POPAnimator*)context render]; + } + return kCVReturnSuccess; +} +#endif + +// call while holding lock +static void updateDisplayLink(POPAnimator *self) +{ + BOOL paused = 0 == self->_observers.count && self->_list.empty(); + +#if TARGET_OS_IPHONE + if (paused != self->_displayLink.paused) { + FBLogAnimInfo(paused ? @"pausing display link" : @"unpausing display link"); + self->_displayLink.paused = paused; + } +#else + if (paused == CVDisplayLinkIsRunning(self->_displayLink)) { + FBLogAnimInfo(paused ? @"pausing display link" : @"unpausing display link"); + if (paused) { + CVDisplayLinkStop(self->_displayLink); + } else { + CVDisplayLinkStart(self->_displayLink); + } + } +#endif +} + +static void updateAnimatable(id obj, POPPropertyAnimationState *anim) +{ + // handle user-initiated stop or pause; hault animation + if (!anim->active || anim->paused) + return; + + if (anim->hasValue()) { + pop_animatable_write_block write = anim->property.writeBlock; + if (NULL == write) + return; + + if (!anim->additive) { + + VectorRef currentVec = anim->currentValue(); + + // update previous values; support animation convergence + anim->previous2Vec = anim->previousVec; + anim->previousVec = currentVec; + + // write value + write(obj, currentVec->data()); + if (anim->tracing) { + [anim->tracer writePropertyValue:POPBox(currentVec, anim->valueType, true)]; + } + } else { + pop_animatable_read_block read = anim->property.readBlock; + if (NULL == read) + return; + + // object value + Vector4r objectValue = read_values(read, obj, anim->valueCount); + + // current animation value + VectorRef currentVec = anim->currentValue(); + Vector4r currentValue = currentVec->vector4r(); + + // determine animation change + if (anim->previousVec) { + Vector4r previousValue = anim->previousVec->vector4r(); + currentValue -= previousValue; + } + + // add to object value + currentValue += objectValue; + + // update previous values; support animation convergence + anim->previous2Vec = anim->previousVec; + anim->previousVec = currentVec; + + // write value + write(obj, currentValue.data()); + if (anim->tracing) { + [anim->tracer writePropertyValue:POPBox(currentVec, anim->valueType, true)]; + } + } + } +} + +static void applyAnimationTime(id obj, POPAnimationState *state, CFTimeInterval time) +{ + if (!state->advanceTime(time, obj)) { + return; + } + + POPPropertyAnimationState *ps = dynamic_cast(state); + if (NULL != ps) { + updateAnimatable(obj, ps); + } + + state->delegateApply(); +} + +static void applyAnimationProgress(id obj, POPAnimationState *state, CGFloat progress) +{ + POPPropertyAnimationState *ps = dynamic_cast(state); + if (ps && !ps->advanceProgress(progress)) { + return; + } + + if (NULL != ps) { + updateAnimatable(obj, ps); + } + + state->delegateApply(); +} + +static POPAnimation *deleteDictEntry(POPAnimator *self, id __unsafe_unretained obj, NSString *key, BOOL cleanup = YES) +{ + POPAnimation *anim = nil; + + // lock + OSSpinLockLock(&self->_lock); + + NSMutableDictionary *keyAnimationsDict = (__bridge id)CFDictionaryGetValue(self->_dict, (__bridge void *)obj); + if (keyAnimationsDict) { + + anim = keyAnimationsDict[key]; + if (anim) { + + // remove key + [keyAnimationsDict removeObjectForKey:key]; + + // cleanup empty dictionaries + if (cleanup && 0 == keyAnimationsDict.count) { + CFDictionaryRemoveValue(self->_dict, (__bridge void *)obj); + } + } + } + + // unlock + OSSpinLockUnlock(&self->_lock); + return anim; +} + +static void stopAndCleanup(POPAnimator *self, POPAnimatorItemRef item, bool shouldRemove, bool finished) +{ + // remove + if (shouldRemove) { + deleteDictEntry(self, item->unretainedObject, item->key); + } + + // stop + POPAnimationState *state = POPAnimationGetState(item->animation); + state->stop(shouldRemove, finished); + + if (shouldRemove) { + // lock + OSSpinLockLock(&self->_lock); + + // find item im list + // may have already been removed on animationDidStop: + POPAnimatorItemListIterator find_iter = find(self->_list.begin(), self->_list.end(), item); + BOOL found = find_iter != self->_list.end(); + + if (found) { + self->_list.erase(find_iter); + } + + // unlock + OSSpinLockUnlock(&self->_lock); + } +} + ++ (id)sharedAnimator +{ + static POPAnimator* _animator = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + _animator = [[POPAnimator alloc] init]; + }); + return _animator; +} + ++ (BOOL)disableBackgroundThread +{ + return _disableBackgroundThread; +} + ++ (void)setDisableBackgroundThread:(BOOL)flag +{ + _disableBackgroundThread = flag; +} + +- (id)init +{ + self = [super init]; + if (nil == self) return nil; + +#if TARGET_OS_IPHONE + _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(render)]; + _displayLink.paused = YES; + [_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; +#else + CVReturn ret = CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink); + ret = CVDisplayLinkSetOutputCallback(_displayLink, displayLinkCallback, (__bridge void *)self); +#endif + + _dict = POPDictionaryCreateMutableWeakPointerToStrongObject(5); + _lock = OS_SPINLOCK_INIT; + + return self; +} + +- (void)dealloc +{ +#if TARGET_OS_IPHONE + [_displayLink invalidate]; +#else + CVDisplayLinkStop(_displayLink); + CVDisplayLinkRelease(_displayLink); +#endif +} + +- (NSArray *)observers +{ + // lock + OSSpinLockLock(&_lock); + + // get observers + NSArray *observers = 0 != _observers.count ? [_observers copy] : nil; + + // unlock + OSSpinLockUnlock(&_lock); + return observers; +} + +- (void)addAnimation:(POPAnimation *)anim forObject:(id)obj key:(NSString *)key +{ + if (!anim || !obj) { + return; + } + + // support arbitrarily many nil keys + if (!key) { + key = [[NSUUID UUID] UUIDString]; + } + + // lock + OSSpinLockLock(&_lock); + + // get key, animation dict associated with object + NSMutableDictionary *keyAnimationDict = (__bridge id)CFDictionaryGetValue(_dict, (__bridge void *)obj); + + // update associated animation state + if (nil == keyAnimationDict) { + keyAnimationDict = [NSMutableDictionary dictionary]; + CFDictionarySetValue(_dict, (__bridge void *)obj, (__bridge void *)keyAnimationDict); + } else { + // if the animation instance already exists, avoid cancelling only to restart + POPAnimation *existingAnim = keyAnimationDict[key]; + if (existingAnim) { + // unlock + OSSpinLockUnlock(&_lock); + if (existingAnim == anim) { + return; + } + [self removeAnimationForObject:obj key:key cleanupDict:NO]; + } + } + keyAnimationDict[key] = anim; + + // create entry after potential removal + POPAnimatorItemRef item(new POPAnimatorItem(obj, key, anim)); + _list.push_back(item); + + // support animation re-use, reset all animation state + POPAnimationGetState(anim)->reset(true); + + // update display link + updateDisplayLink(self); + + // unlock + OSSpinLockUnlock(&_lock); +} + +- (void)removeAllAnimationsForObject:(id)obj +{ + // lock + OSSpinLockLock(&_lock); + + NSArray *animations = [(__bridge id)CFDictionaryGetValue(_dict, (__bridge void *)obj) allValues]; + CFDictionaryRemoveValue(_dict, (__bridge void *)obj); + + // unlock + OSSpinLockUnlock(&_lock); + + if (0 == animations.count) { + return; + } + + NSHashTable *animationSet = [[NSHashTable alloc] initWithOptions:NSHashTableObjectPointerPersonality capacity:animations.count]; + for (id animation in animations) { + [animationSet addObject:animation]; + } + + // lock + OSSpinLockLock(&_lock); + + POPAnimatorItemRef item; + for (auto iter = _list.begin(); iter != _list.end();) { + item = *iter; + if(![animationSet containsObject:item->animation]) { + iter++; + } else { + iter = _list.erase(iter); + } + } + + // unlock + OSSpinLockUnlock(&_lock); + + for (POPAnimation *anim in animations) { + POPAnimationState *state = POPAnimationGetState(anim); + state->stop(true, !state->active); + } +} + +- (void)removeAnimationForObject:(id)obj key:(NSString *)key cleanupDict:(BOOL)cleanupDict +{ + POPAnimation *anim = deleteDictEntry(self, obj, key, cleanupDict); + if (nil == anim) { + return; + } + + // lock + OSSpinLockLock(&_lock); + + POPAnimatorItemRef item; + for (auto iter = _list.begin(); iter != _list.end();) { + item = *iter; + if(anim == item->animation) { + _list.erase(iter); + break; + } else { + iter++; + } + } + + // unlock + OSSpinLockUnlock(&_lock); + + // stop animation and callout + POPAnimationState *state = POPAnimationGetState(anim); + state->stop(true, (!state->active && !state->paused)); +} + +- (void)removeAnimationForObject:(id)obj key:(NSString *)key +{ + [self removeAnimationForObject:obj key:key cleanupDict:YES]; +} + +- (NSArray *)animationKeysForObject:(id)obj +{ + // lock + OSSpinLockLock(&_lock); + + // get keys + NSArray *keys = [(__bridge id)CFDictionaryGetValue(_dict, (__bridge void *)obj) allKeys]; + + // unlock + OSSpinLockUnlock(&_lock); + return keys; +} + +- (id)animationForObject:(id)obj key:(NSString *)key +{ + // lock + OSSpinLockLock(&_lock); + + // lookup animation + NSDictionary *keyAnimationsDict = (__bridge id)CFDictionaryGetValue(_dict, (__bridge void *)obj); + POPAnimation *animation = keyAnimationsDict[key]; + + // unlock + OSSpinLockUnlock(&_lock); + return animation; +} + +- (void)render +{ + CFTimeInterval time = CACurrentMediaTime(); + +#if TARGET_IPHONE_SIMULATOR + // support slow-motion animations + time += _slowMotionAccumulator; + float f = POPAnimationDragCoefficient(); + + if (f > 1.0) { + if (!_slowMotionStartTime) { + _slowMotionStartTime = time; + } else { + time = (time - _slowMotionStartTime) / f + _slowMotionStartTime; + _slowMotionLastTime = time; + } + } else if (_slowMotionStartTime) { + CFTimeInterval dt = (_slowMotionLastTime - time); + time += dt; + _slowMotionAccumulator += dt; + _slowMotionStartTime = 0; + } +#endif + + [self renderTime:time]; +} + +- (void)renderTime:(CFTimeInterval)time +{ + // begin transaction with actions disabled + [CATransaction begin]; + [CATransaction setDisableActions:YES]; + + // notify delegate + [_delegate animatorWillAnimate:self]; + + // lock + OSSpinLockLock(&_lock); + + // count active animations + const NSUInteger count = _list.size(); + if (0 == count) { + // unlock + OSSpinLockUnlock(&_lock); + } else { + // copy list into vectory + std::vector vector{ std::begin(_list), std::end(_list) }; + + // unlock + OSSpinLockUnlock(&_lock); + + id obj; + POPAnimation *anim; + POPAnimationState *state; + + for (auto item : vector) { + obj = item->object; + anim = item->animation; + state = POPAnimationGetState(anim); + + if (nil == obj) { + + // object exists not; stop animating + NSAssert(item->unretainedObject, @"object should exist"); + stopAndCleanup(self, item, true, false); + + } else { + // start if needed + state->startIfNeeded(obj, time, _slowMotionAccumulator); + + // only run active, not paused animations + if (state->active && !state->paused) { + // object exists; animate + applyAnimationTime(obj, state, time); + + FBLogAnimDebug(@"time:%f running:%@", time, item->animation); + + if (state->isDone()) { + // set end value + applyAnimationProgress(obj, state, 1.0); + + // finished succesfully, cleanup + stopAndCleanup(self, item, state->removedOnCompletion, YES); + } + } + } + } + } + + // notify observers + for (id observer in self.observers) { + [observer animatorDidAnimate:(id)self]; + } + + // lock + OSSpinLockLock(&_lock); + + // update display link + updateDisplayLink(self); + + // unlock + OSSpinLockUnlock(&_lock); + + // notify delegate and commit + [_delegate animatorDidAnimate:self]; + [CATransaction commit]; +} + +- (void)addObserver:(id)observer +{ + NSAssert(nil != observer, @"attempting to add nil %@ observer", self); + if (nil == observer) { + return; + } + + // lock + OSSpinLockLock(&_lock); + + if (!_observers) { + // use ordered collection for deterministic callout + _observers = [[NSMutableArray alloc] initWithCapacity:1]; + } + + [_observers addObject:observer]; + updateDisplayLink(self); + + // unlock + OSSpinLockUnlock(&_lock); +} + +- (void)removeObserver:(id)observer +{ + NSAssert(nil != observer, @"attempting to remove nil %@ observer", self); + if (nil == observer) { + return; + } + + // lock + OSSpinLockLock(&_lock); + + [_observers removeObject:observer]; + updateDisplayLink(self); + + // unlock + OSSpinLockUnlock(&_lock); +} + +@end diff --git a/Demo/Pods/pop/pop/POPAnimatorPrivate.h b/Demo/Pods/pop/pop/POPAnimatorPrivate.h new file mode 100644 index 0000000..f04fad6 --- /dev/null +++ b/Demo/Pods/pop/pop/POPAnimatorPrivate.h @@ -0,0 +1,58 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +@class POPAnimation; + +@protocol POPAnimatorObserving +@required + +/** + @abstract Called on each observer after animator has advanced. Core Animation actions are disabled by default. + */ +- (void)animatorDidAnimate:(POPAnimator *)animator; + +@end + +@interface POPAnimator () + +#if !TARGET_OS_PHONE +/** + Determines whether or not to use a high priority background thread for animation updates. Using a background thread can result in faster, more responsive updates, but may be less compatible. Defaults to YES. + */ ++ (BOOL)disableBackgroundThread; ++ (void)setDisableBackgroundThread:(BOOL)flag; +#endif + +/** + Exposed for unit testing. + */ +- (void)renderTime:(CFTimeInterval)time; + +/** + Funnel methods for category additions. + */ +- (void)addAnimation:(POPAnimation *)anim forObject:(id)obj key:(NSString *)key; +- (void)removeAllAnimationsForObject:(id)obj; +- (void)removeAnimationForObject:(id)obj key:(NSString *)key; +- (NSArray *)animationKeysForObject:(id)obj; +- (POPAnimation *)animationForObject:(id)obj key:(NSString *)key; + +/** + @abstract Add an animator observer. Observer will be notified of each subsequent animator advance until removal. + */ +- (void)addObserver:(id)observer; + +/** + @abstract Remove an animator observer. + */ +- (void)removeObserver:(id)observer; + +@end diff --git a/Demo/Pods/pop/pop/POPBasicAnimation.h b/Demo/Pods/pop/pop/POPBasicAnimation.h new file mode 100644 index 0000000..a993d82 --- /dev/null +++ b/Demo/Pods/pop/pop/POPBasicAnimation.h @@ -0,0 +1,71 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +/** + @abstract A concrete basic animation class. + @discussion Animation is achieved through interpolation. + */ +@interface POPBasicAnimation : POPPropertyAnimation + +/** + @abstract The designated initializer. + @returns An instance of a basic animation. + */ ++ (instancetype)animation; + +/** + @abstract Convenience initializer that returns an animation with animatable property of name. + @param name The name of the animatable property. + @returns An instance of a basic animation configured with specified animatable property. + */ ++ (instancetype)animationWithPropertyNamed:(NSString *)name; + +/** + @abstract Convenience constructor. + @returns Returns a basic animation with kCAMediaTimingFunctionDefault timing function. + */ ++ (instancetype)defaultAnimation; + +/** + @abstract Convenience constructor. + @returns Returns a basic animation with kCAMediaTimingFunctionLinear timing function. + */ ++ (instancetype)linearAnimation; + +/** + @abstract Convenience constructor. + @returns Returns a basic animation with kCAMediaTimingFunctionEaseIn timing function. + */ ++ (instancetype)easeInAnimation; + +/** + @abstract Convenience constructor. + @returns Returns a basic animation with kCAMediaTimingFunctionEaseOut timing function. + */ ++ (instancetype)easeOutAnimation; + +/** + @abstract Convenience constructor. + @returns Returns a basic animation with kCAMediaTimingFunctionEaseInEaseOut timing function. + */ ++ (instancetype)easeInEaseOutAnimation; + +/** + @abstract The duration in seconds. Defaults to 0.4. + */ +@property (assign, nonatomic) CFTimeInterval duration; + +/** + @abstract A timing function defining the pacing of the animation. Defaults to nil indicating pacing according to kCAMediaTimingFunctionDefault. + */ +@property (strong, nonatomic) CAMediaTimingFunction *timingFunction; + +@end diff --git a/Demo/Pods/pop/pop/POPBasicAnimation.mm b/Demo/Pods/pop/pop/POPBasicAnimation.mm new file mode 100644 index 0000000..f53bba1 --- /dev/null +++ b/Demo/Pods/pop/pop/POPBasicAnimation.mm @@ -0,0 +1,90 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPBasicAnimationInternal.h" + +@implementation POPBasicAnimation + +#undef __state +#define __state ((POPBasicAnimationState *)_state) + +#pragma mark - Lifecycle + ++ (instancetype)animation +{ + return [[self alloc] init]; +} + ++ (instancetype)animationWithPropertyNamed:(NSString *)aName +{ + POPBasicAnimation *anim = [self animation]; + anim.property = [POPAnimatableProperty propertyWithName:aName]; + return anim; +} + +- (void)_initState +{ + _state = new POPBasicAnimationState(self); +} + ++ (instancetype)linearAnimation +{ + POPBasicAnimation *anim = [self animation]; + anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; + return anim; +} + ++ (instancetype)easeInAnimation +{ + POPBasicAnimation *anim = [self animation]; + anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; + return anim; +} + ++ (instancetype)easeOutAnimation +{ + POPBasicAnimation *anim = [self animation]; + anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; + return anim; +} + ++ (instancetype)easeInEaseOutAnimation +{ + POPBasicAnimation *anim = [self animation]; + anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; + return anim; +} + ++ (instancetype)defaultAnimation +{ + POPBasicAnimation *anim = [self animation]; + anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; + return anim; +} + +- (id)init +{ + return [self _init]; +} + +#pragma mark - Properties + +DEFINE_RW_PROPERTY(POPBasicAnimationState, duration, setDuration:, CFTimeInterval); +DEFINE_RW_PROPERTY_OBJ(POPBasicAnimationState, timingFunction, setTimingFunction:, CAMediaTimingFunction*, __state->updatedTimingFunction();); + +#pragma mark - Utility + +- (void)_appendDescription:(NSMutableString *)s debug:(BOOL)debug +{ + [super _appendDescription:s debug:debug]; + if (__state->duration) + [s appendFormat:@"; duration = %f", __state->duration]; +} + +@end diff --git a/Demo/Pods/pop/pop/POPBasicAnimationInternal.h b/Demo/Pods/pop/pop/POPBasicAnimationInternal.h new file mode 100644 index 0000000..be465e0 --- /dev/null +++ b/Demo/Pods/pop/pop/POPBasicAnimationInternal.h @@ -0,0 +1,92 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPBasicAnimation.h" +#import "POPPropertyAnimationInternal.h" + +// default animation duration +static CGFloat const kPOPAnimationDurationDefault = 0.4; + +// progress threshold for computing done +static CGFloat const kPOPProgressThreshold = 1e-6; + +static void interpolate(POPValueType valueType, NSUInteger count, const CGFloat *fromVec, const CGFloat *toVec, CGFloat *outVec, double p) +{ + switch (valueType) { + case kPOPValueInteger: + case kPOPValueFloat: + case kPOPValuePoint: + case kPOPValueSize: + case kPOPValueRect: + case kPOPValueColor: + interpolate_vector(count, outVec, fromVec, toVec, p); + break; + default: + NSCAssert(false, @"unhandled type %d", valueType); + break; + } +} + +struct _POPBasicAnimationState : _POPPropertyAnimationState +{ + CAMediaTimingFunction *timingFunction; + double timingControlPoints[4]; + CFTimeInterval duration; + + _POPBasicAnimationState(id __unsafe_unretained anim) : _POPPropertyAnimationState(anim), + duration(kPOPAnimationDurationDefault), + timingFunction(nil) + { + type = kPOPAnimationBasic; + memset(timingControlPoints, 0, sizeof(timingControlPoints)); + } + + bool isDone() { + if (_POPPropertyAnimationState::isDone()) { + return true; + } + return progress + kPOPProgressThreshold >= 1.; + } + + void updatedTimingFunction() + { + float vec[4] = {0., 0., 0., 0.}; + [timingFunction getControlPointAtIndex:1 values:&vec[0]]; + [timingFunction getControlPointAtIndex:2 values:&vec[2]]; + for (NSUInteger idx = 0; idx < POP_ARRAY_COUNT(vec); idx++) { + timingControlPoints[idx] = vec[idx]; + } + } + + bool advance(CFTimeInterval time, CFTimeInterval dt, id obj) { + // default timing function + if (!timingFunction) { + ((POPBasicAnimation *)self).timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; + } + + // cap local time to duration + CFTimeInterval t = MIN(time - startTime, duration) / duration; + + // solve for normalized time, aka progresss [0, 1] + double p = timing_function_solve(timingControlPoints, t, SOLVE_EPS(duration)); + + // interpolate and advance + if (p != progress) { + interpolate(valueType, valueCount, fromVec->data(), toVec->data(), currentVec->data(), p); + progress = p; + return true; + } + + clampCurrentValue(); + + return false; + } +}; + +typedef struct _POPBasicAnimationState POPBasicAnimationState; diff --git a/Demo/Pods/pop/pop/POPCGUtils.h b/Demo/Pods/pop/pop/POPCGUtils.h new file mode 100644 index 0000000..840f279 --- /dev/null +++ b/Demo/Pods/pop/pop/POPCGUtils.h @@ -0,0 +1,83 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#import "POPDefines.h" + +#if TARGET_OS_IPHONE +@class UIColor; +#endif + +POP_EXTERN_C_BEGIN + +NS_INLINE CGPoint values_to_point(const CGFloat values[]) +{ + return CGPointMake(values[0], values[1]); +} + +NS_INLINE CGSize values_to_size(const CGFloat values[]) +{ + return CGSizeMake(values[0], values[1]); +} + +NS_INLINE CGRect values_to_rect(const CGFloat values[]) +{ + return CGRectMake(values[0], values[1], values[2], values[3]); +} + +NS_INLINE void values_from_point(CGFloat values[], CGPoint p) +{ + values[0] = p.x; + values[1] = p.y; +} + +NS_INLINE void values_from_size(CGFloat values[], CGSize s) +{ + values[0] = s.width; + values[1] = s.height; +} + +NS_INLINE void values_from_rect(CGFloat values[], CGRect r) +{ + values[0] = r.origin.x; + values[1] = r.origin.y; + values[2] = r.size.width; + values[3] = r.size.height; +} + +/** + Takes a CGColorRef and converts it into RGBA components, if necessary. + */ +extern void POPCGColorGetRGBAComponents(CGColorRef color, CGFloat components[]); + +/** + Takes RGBA components and returns a CGColorRef. + */ +extern CGColorRef POPCGColorRGBACreate(const CGFloat components[]) CF_RETURNS_RETAINED; + +/** + Takes a color reference and returns a CGColor. + */ +extern CGColorRef POPCGColorWithColor(id color); + +#if TARGET_OS_IPHONE + +/** + Takes a UIColor and converts it into RGBA components, if necessary. + */ +extern void POPUIColorGetRGBAComponents(UIColor *color, CGFloat components[]); + +/** + Takes RGBA components and returns a UIColor. + */ +extern UIColor *POPUIColorRGBACreate(const CGFloat components[]) NS_RETURNS_RETAINED; + +#endif + +POP_EXTERN_C_END diff --git a/Demo/Pods/pop/pop/POPCGUtils.mm b/Demo/Pods/pop/pop/POPCGUtils.mm new file mode 100644 index 0000000..c8a866a --- /dev/null +++ b/Demo/Pods/pop/pop/POPCGUtils.mm @@ -0,0 +1,96 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPCGUtils.h" + +#if TARGET_OS_IPHONE +#import +#else +#import +#endif + +void POPCGColorGetRGBAComponents(CGColorRef color, CGFloat components[]) +{ + if (!color) { +#if TARGET_OS_IPHONE + color = [UIColor clearColor].CGColor; +#else + color = [NSColor clearColor].CGColor; +#endif + } + + const CGFloat *colors = CGColorGetComponents(color); + size_t count = CGColorGetNumberOfComponents(color); + + if (4 == count) { + // RGB colorspace + components[0] = colors[0]; + components[1] = colors[1]; + components[2] = colors[2]; + components[3] = colors[3]; + } else if (2 == count) { + // Grey colorspace + components[0] = components[1] = components[2] = colors[0]; + components[3] = colors[1]; + } else { + // Use CI to convert + CIColor *ciColor = [CIColor colorWithCGColor:color]; + components[0] = ciColor.red; + components[1] = ciColor.green; + components[2] = ciColor.blue; + components[3] = ciColor.alpha; + } +} + +CGColorRef POPCGColorRGBACreate(const CGFloat components[]) +{ +#if TARGET_OS_IPHONE + CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); + CGColorRef color = CGColorCreate(space, components); + CGColorSpaceRelease(space); + return color; +#else + return CGColorCreateGenericRGB(components[0], components[1], components[2], components[3]); +#endif +} + +CGColorRef POPCGColorWithColor(id color) +{ + if (CFGetTypeID((__bridge CFTypeRef)color) == CGColorGetTypeID()) { + return ((__bridge CGColorRef)color); + } +#if TARGET_OS_IPHONE + else if ([color isKindOfClass:[UIColor class]]) { + return [color CGColor]; + } +#else + else if ([color isKindOfClass:[NSColor class]]) { + return [color CGColor]; + } +#endif + return nil; +} + +#if TARGET_OS_IPHONE + +void POPUIColorGetRGBAComponents(UIColor *color, CGFloat components[]) +{ + return POPCGColorGetRGBAComponents(color.CGColor, components); +} + +UIColor *POPUIColorRGBACreate(const CGFloat components[]) +{ + CGColorRef colorRef = POPCGColorRGBACreate(components); + UIColor *color = [[UIColor alloc] initWithCGColor:colorRef]; + CGColorRelease(colorRef); + return color; +} + +#endif + diff --git a/Demo/Pods/pop/pop/POPCustomAnimation.h b/Demo/Pods/pop/pop/POPCustomAnimation.h new file mode 100644 index 0000000..261eeb4 --- /dev/null +++ b/Demo/Pods/pop/pop/POPCustomAnimation.h @@ -0,0 +1,46 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +@class POPCustomAnimation; + +/** + @abstract POPCustomAnimationBlock is the callback block of a custom animation. + @discussion This block will be executed for each animation frame and should update the property or properties being animated based on current timing. + @param target The object being animated. Reference the passed in target to help avoid retain loops. + @param animation The custom animation instance. Use to determine the current and elapsed time since last callback. Reference the passed in animation to help avoid retain loops. + @return Flag indicating whether the animation should continue animating. Return NO to indicate animation is done. + */ +typedef BOOL (^POPCustomAnimationBlock)(id target, POPCustomAnimation *animation); + +/** + @abstract POPCustomAnimation is a concrete animation subclass for custom animations. + */ +@interface POPCustomAnimation : POPAnimation + +/** +@abstract Creates and returns an initialized custom animation instance. +@discussion This is the designated initializer. +@param block The custom animation callback block. See {@ref POPCustomAnimationBlock}. +@return The initialized custom animation instance. +*/ ++ (instancetype)animationWithBlock:(POPCustomAnimationBlock)block; + +/** + @abstract The current animation time at time of callback. + */ +@property (readonly, nonatomic) CFTimeInterval currentTime; + +/** + @abstract The elapsed animation time since last callback. + */ +@property (readonly, nonatomic) CFTimeInterval elapsedTime; + +@end diff --git a/Demo/Pods/pop/pop/POPCustomAnimation.mm b/Demo/Pods/pop/pop/POPCustomAnimation.mm new file mode 100644 index 0000000..beb309c --- /dev/null +++ b/Demo/Pods/pop/pop/POPCustomAnimation.mm @@ -0,0 +1,53 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPCustomAnimation.h" +#import "POPAnimationInternal.h" + +@interface POPCustomAnimation () +@property (nonatomic, copy) POPCustomAnimationBlock animate; +@end + +@implementation POPCustomAnimation + ++ (instancetype)animationWithBlock:(BOOL(^)(id target, POPCustomAnimation *))block +{ + POPCustomAnimation *b = [[self alloc] _init]; + b.animate = block; + return b; +} + +- (id)_init +{ + self = [super _init]; + if (nil != self) { + _state->type = kPOPAnimationCustom; + } + return self; +} + +- (CFTimeInterval)beginTime +{ + POPAnimationState *s = POPAnimationGetState(self); + return s->startTime > 0 ? s->startTime : s->beginTime; +} + +- (BOOL)_advance:(id)object currentTime:(CFTimeInterval)currentTime elapsedTime:(CFTimeInterval)elapsedTime +{ + _currentTime = currentTime; + _elapsedTime = elapsedTime; + return _animate(object, self); +} + +- (void)_appendDescription:(NSMutableString *)s debug:(BOOL)debug +{ + [s appendFormat:@"; elapsedTime = %f; currentTime = %f;", _elapsedTime, _currentTime]; +} + +@end diff --git a/Demo/Pods/pop/pop/POPDecayAnimation.h b/Demo/Pods/pop/pop/POPDecayAnimation.h new file mode 100644 index 0000000..9018cd8 --- /dev/null +++ b/Demo/Pods/pop/pop/POPDecayAnimation.h @@ -0,0 +1,54 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +/** + @abstract A concrete decay animation class. + @discussion Animation is achieved through gradual decay of animation value. + */ +@interface POPDecayAnimation : POPPropertyAnimation + +/** + @abstract The designated initializer. + @returns An instance of a decay animation. + */ ++ (instancetype)animation; + +/** + @abstract Convenience initializer that returns an animation with animatable property of name. + @param name The name of the animatable property. + @returns An instance of a decay animation configured with specified animatable property. + */ ++ (instancetype)animationWithPropertyNamed:(NSString *)name; + +/** + @abstract The current velocity value. + @discussion Set before animation start to account for initial velocity. Expressed in change of value units per second. + */ +@property (copy, nonatomic) id velocity; + +/** + @abstract The deceleration factor. + @discussion Values specifies should be in the range [0, 1]. Lower values results in faster deceleration. Defaults to 0.998. + */ +@property (assign, nonatomic) CGFloat deceleration; + +/** + @abstract The expected duration. + @discussion Derived based on input velocity and deceleration values. + */ +@property (readonly, assign, nonatomic) CFTimeInterval duration; + +/** + The to value is derived based on input velocity and deceleration. + */ +- (void)setToValue:(id)toValue NS_UNAVAILABLE; + +@end diff --git a/Demo/Pods/pop/pop/POPDecayAnimation.mm b/Demo/Pods/pop/pop/POPDecayAnimation.mm new file mode 100644 index 0000000..8700766 --- /dev/null +++ b/Demo/Pods/pop/pop/POPDecayAnimation.mm @@ -0,0 +1,126 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPDecayAnimationInternal.h" + +@implementation POPDecayAnimation + +#pragma mark - Lifecycle + +#undef __state +#define __state ((POPDecayAnimationState *)_state) + ++ (instancetype)animation +{ + return [[self alloc] init]; +} + ++ (instancetype)animationWithPropertyNamed:(NSString *)aName +{ + POPDecayAnimation *anim = [self animation]; + anim.property = [POPAnimatableProperty propertyWithName:aName]; + return anim; +} + +- (id)init +{ + return [self _init]; +} + +- (void)_initState +{ + _state = new POPDecayAnimationState(self); +} + +#pragma mark - Properties + +DEFINE_RW_PROPERTY(POPDecayAnimationState, deceleration, setDeceleration:, CGFloat, __state->toVec = NULL;); + +@dynamic velocity; + +- (id)toValue +{ + [self _ensureComputedProperties]; + return POPBox(__state->toVec, __state->valueType); +} + +- (CFTimeInterval)duration +{ + [self _ensureComputedProperties]; + return __state->duration; +} + +- (void)setFromValue:(id)fromValue +{ + super.fromValue = fromValue; + [self _invalidateComputedProperties]; +} + +- (void)setToValue:(id)aValue +{ + // no-op + NSLog(@"ignoring to value on decay animation %@", self); +} + +- (id)velocity +{ + return POPBox(__state->velocityVec, __state->valueType); +} + +- (void)setVelocity:(id)aValue +{ + VectorRef vec = POPUnbox(aValue, __state->valueType, __state->valueCount, YES); + + if (!vec_equal(vec, __state->velocityVec)) { + __state->velocityVec = vec; + + if (__state->tracing) { + [__state->tracer updateVelocity:aValue]; + } + + [self _invalidateComputedProperties]; + + // automatically unpause active animations + if (__state->active && __state->paused) { + __state->fromVec = NULL; + __state->setPaused(false); + } + } +} + +#pragma mark - Utility + +- (void)_ensureComputedProperties +{ + if (NULL == __state->toVec) { + __state->computeDuration(); + __state->computeToValue(); + } +} + +- (void)_invalidateComputedProperties +{ + __state->toVec = NULL; + __state->duration = 0; +} + +- (void)_appendDescription:(NSMutableString *)s debug:(BOOL)debug +{ + [super _appendDescription:s debug:debug]; + + if (0 != self.duration) { + [s appendFormat:@"; duration = %f", self.duration]; + } + + if (__state->deceleration) { + [s appendFormat:@"; deceleration = %f", __state->deceleration]; + } +} + +@end diff --git a/Demo/Pods/pop/pop/POPDecayAnimationInternal.h b/Demo/Pods/pop/pop/POPDecayAnimationInternal.h new file mode 100644 index 0000000..883d523 --- /dev/null +++ b/Demo/Pods/pop/pop/POPDecayAnimationInternal.h @@ -0,0 +1,157 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPDecayAnimation.h" +#import "POPPropertyAnimationInternal.h" + +// minimal velocity factor before decay animation is considered complete, in units / s +static CGFloat kPOPAnimationDecayMinimalVelocityFactor = 5.; + +// default decay animation deceleration +static CGFloat kPOPAnimationDecayDecelerationDefault = 0.998; + +static void decay_position(CGFloat *x, CGFloat *v, NSUInteger count, CFTimeInterval dt, CGFloat deceleration) +{ + dt *= 1000; + + // v0 = v / 1000 + // v = v0 * powf(deceleration, dt); + // v = v * 1000; + + // x0 = x; + // x = x0 + v0 * deceleration * (1 - powf(deceleration, dt)) / (1 - deceleration) + float v0[count]; + float kv = powf(deceleration, dt); + float kx = deceleration * (1 - kv) / (1 - deceleration); + + for (NSUInteger idx = 0; idx < count; idx++) { + v0[idx] = v[idx] / 1000.; + v[idx] = v0[idx] * kv * 1000.; + x[idx] = x[idx] + v0[idx] * kx; + } +} + +struct _POPDecayAnimationState : _POPPropertyAnimationState +{ + double deceleration; + CFTimeInterval duration; + + _POPDecayAnimationState(id __unsafe_unretained anim) : + _POPPropertyAnimationState(anim), + duration(0), + deceleration(kPOPAnimationDecayDecelerationDefault) { + type = kPOPAnimationDecay; + } + + bool isDone() { + if (_POPPropertyAnimationState::isDone()) { + return true; + } + + CGFloat f = dynamicsThreshold * kPOPAnimationDecayMinimalVelocityFactor; + const CGFloat *velocityValues = vec_data(velocityVec); + for (NSUInteger idx = 0; idx < valueCount; idx++) { + if (fabsf(velocityValues[idx]) >= f) + return false; + } + return true; + + } + + void computeDuration() { + + // compute duration till threshold velocity + Vector4r scaledVelocity = vector4(velocityVec) / 1000.; + + double k = dynamicsThreshold * kPOPAnimationDecayMinimalVelocityFactor / 1000.; + double vx = k / scaledVelocity.x; + double vy = k / scaledVelocity.y; + double vz = k / scaledVelocity.z; + double vw = k / scaledVelocity.w; + double d = log(deceleration) * 1000.; + duration = MAX(MAX(MAX(log(fabs(vx)) / d, log(fabs(vy)) / d), log(fabs(vz)) / d), log(fabs(vw)) / d); + + // ensure velocity threshold is exceeded + if (isnan(duration) || duration < 0) { + duration = 0; + } + } + + void computeToValue() { + // to value assuming final velocity as a factor of dynamics threshold + // derived from v' = v * d^dt used in decay_position + // to compute the to value with maximal dt, p' = p + (v * d) / (1 - d) + VectorRef fromValue = NULL != currentVec ? currentVec : fromVec; + if (!fromValue) { + return; + } + + // ensure duration is computed + if (0 == duration) { + computeDuration(); + } + + // compute to value + VectorRef toValue(Vector::new_vector(fromValue.get())); + Vector4r velocity = velocityVec->vector4r(); + decay_position(toValue->data(), velocity.data(), valueCount, duration, deceleration); + toVec = toValue; + } + + void computeDestinationValues() { + // to value assuming final velocity as a factor of dynamics threshold + // derived from v' = v * d^dt used in decay_position + // to compute the to value with maximal dt, p' = p + (v * d) / (1 - d) + VectorRef fromValue = NULL != currentVec ? currentVec : fromVec; + if (!fromValue) { + return; + } + + VectorRef toValue(Vector::new_vector(fromValue.get())); + + // compute duration till threshold velocity + Vector4r scaledVelocity = vector4(velocityVec) / 1000.; + + double k = dynamicsThreshold * kPOPAnimationDecayMinimalVelocityFactor / 1000.; + double vx = k / scaledVelocity.x; + double vy = k / scaledVelocity.y; + double vz = k / scaledVelocity.z; + double vw = k / scaledVelocity.w; + double d = log(deceleration) * 1000.; + duration = MAX(MAX(MAX(log(fabs(vx)) / d, log(fabs(vy)) / d), log(fabs(vz)) / d), log(fabs(vw)) / d); + + // ensure velocity threshold is exceeded + if (isnan(duration) || duration < 0) { + duration = 0; + } else { + // compute to value + Vector4r velocity = velocityVec->vector4r(); + decay_position(toValue->data(), velocity.data(), valueCount, duration, deceleration); + } + + toVec = toValue; + } + + bool advance(CFTimeInterval time, CFTimeInterval dt, id obj) { + // advance past not yet initialized animations + if (NULL == currentVec) { + return false; + } + + decay_position(currentVec->data(), velocityVec->data(), valueCount, dt, deceleration); + + // clamp to compute end value; avoid possibility of decaying past + clampCurrentValue(kPOPAnimationClampEnd | clampMode); + + return true; + } + +}; + +typedef struct _POPDecayAnimationState POPDecayAnimationState; diff --git a/Demo/Pods/pop/pop/POPDefines.h b/Demo/Pods/pop/pop/POPDefines.h new file mode 100644 index 0000000..92cf801 --- /dev/null +++ b/Demo/Pods/pop/pop/POPDefines.h @@ -0,0 +1,29 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#ifndef POP_POPDefines_h +#define POP_POPDefines_h + +#ifdef __cplusplus +# define POP_EXTERN_C_BEGIN extern "C" { +# define POP_EXTERN_C_END } +#else +# define POP_EXTERN_C_BEGIN +# define POP_EXTERN_C_END +#endif + +#define POP_ARRAY_COUNT(x) sizeof(x) / sizeof(x[0]) + +#if defined (__cplusplus) && defined (__GNUC__) +# define POP_NOTHROW __attribute__ ((nothrow)) +#else +# define POP_NOTHROW +#endif + +#endif diff --git a/Demo/Pods/pop/pop/POPGeometry.h b/Demo/Pods/pop/pop/POPGeometry.h new file mode 100644 index 0000000..cc78317 --- /dev/null +++ b/Demo/Pods/pop/pop/POPGeometry.h @@ -0,0 +1,53 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#if TARGET_OS_IPHONE +#import +#endif + +#if !TARGET_OS_IPHONE + +/** NSValue extensions to support animatable types. */ +@interface NSValue (POP) + +/** + @abstract Creates an NSValue given a CGPoint. + */ ++ (NSValue *)valueWithCGPoint:(CGPoint)point; + +/** + @abstract Creates an NSValue given a CGSize. + */ ++ (NSValue *)valueWithCGSize:(CGSize)size; + +/** + @abstract Creates an NSValue given a CGRect. + */ ++ (NSValue *)valueWithCGRect:(CGRect)rect; + +/** + @abstract Returns the underlying CGPoint value. + */ +- (CGPoint)CGPointValue; + +/** + @abstract Returns the underlying CGSize value. + */ +- (CGSize)CGSizeValue; + +/** + @abstract Returns the underlying CGRect value. + */ +- (CGRect)CGRectValue; + +@end + +#endif diff --git a/Demo/Pods/pop/pop/POPGeometry.mm b/Demo/Pods/pop/pop/POPGeometry.mm new file mode 100644 index 0000000..29c75a4 --- /dev/null +++ b/Demo/Pods/pop/pop/POPGeometry.mm @@ -0,0 +1,67 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPGeometry.h" + +#if !TARGET_OS_IPHONE +@implementation NSValue (POP) + ++ (NSValue *)valueWithCGPoint:(CGPoint)point { + return [NSValue valueWithBytes:&point objCType:@encode(CGPoint)]; +} + ++ (NSValue *)valueWithCGSize:(CGSize)size { + return [NSValue valueWithBytes:&size objCType:@encode(CGSize)]; +} + ++ (NSValue *)valueWithCGRect:(CGRect)rect { + return [NSValue valueWithBytes:&rect objCType:@encode(CGRect)]; +} + ++ (NSValue *)valueWithCFRange:(CFRange)range { + return [NSValue valueWithBytes:&range objCType:@encode(CFRange)]; +} + ++ (NSValue *)valueWithCGAffineTransform:(CGAffineTransform)transform +{ + return [NSValue valueWithBytes:&transform objCType:@encode(CGAffineTransform)]; +} + +- (CGPoint)CGPointValue { + CGPoint result; + [self getValue:&result]; + return result; +} + +- (CGSize)CGSizeValue { + CGSize result; + [self getValue:&result]; + return result; +} + +- (CGRect)CGRectValue { + CGRect result; + [self getValue:&result]; + return result; +} + +- (CFRange)CFRangeValue { + CFRange result; + [self getValue:&result]; + return result; +} + +- (CGAffineTransform)CGAffineTransformValue { + CGAffineTransform result; + [self getValue:&result]; + return result; +} +@end + +#endif diff --git a/Demo/Pods/pop/pop/POPLayerExtras.h b/Demo/Pods/pop/pop/POPLayerExtras.h new file mode 100644 index 0000000..25a2875 --- /dev/null +++ b/Demo/Pods/pop/pop/POPLayerExtras.h @@ -0,0 +1,196 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import + +POP_EXTERN_C_BEGIN + +#pragma mark - Scale + +/** + @abstract Returns layer scale factor for the x axis. + */ +extern CGFloat POPLayerGetScaleX(CALayer *l); + +/** + @abstract Set layer scale factor for the x axis. + */ +extern void POPLayerSetScaleX(CALayer *l, CGFloat f); + +/** + @abstract Returns layer scale factor for the y axis. + */ +extern CGFloat POPLayerGetScaleY(CALayer *l); + +/** + @abstract Set layer scale factor for the y axis. + */ +extern void POPLayerSetScaleY(CALayer *l, CGFloat f); + +/** + @abstract Returns layer scale factor for the z axis. + */ +extern CGFloat POPLayerGetScaleZ(CALayer *l); + +/** + @abstract Set layer scale factor for the z axis. + */ +extern void POPLayerSetScaleZ(CALayer *l, CGFloat f); + +/** + @abstract Returns layer scale factors for x and y access as point. + */ +extern CGPoint POPLayerGetScaleXY(CALayer *l); + +/** + @abstract Sets layer x and y scale factors given point. + */ +extern void POPLayerSetScaleXY(CALayer *l, CGPoint p); + +#pragma mark - Translation + +/** + @abstract Returns layer translation factor for the x axis. + */ +extern CGFloat POPLayerGetTranslationX(CALayer *l); + +/** + @abstract Set layer translation factor for the x axis. + */ +extern void POPLayerSetTranslationX(CALayer *l, CGFloat f); + +/** + @abstract Returns layer translation factor for the y axis. + */ +extern CGFloat POPLayerGetTranslationY(CALayer *l); + +/** + @abstract Set layer translation factor for the y axis. + */ +extern void POPLayerSetTranslationY(CALayer *l, CGFloat f); + +/** + @abstract Returns layer translation factor for the z axis. + */ +extern CGFloat POPLayerGetTranslationZ(CALayer *l); + +/** + @abstract Set layer translation factor for the z axis. + */ +extern void POPLayerSetTranslationZ(CALayer *l, CGFloat f); + +/** + @abstract Returns layer translation factors for x and y access as point. + */ +extern CGPoint POPLayerGetTranslationXY(CALayer *l); + +/** + @abstract Sets layer x and y translation factors given point. + */ +extern void POPLayerSetTranslationXY(CALayer *l, CGPoint p); + +#pragma mark - Rotation + +/** + @abstract Returns layer rotation, in radians, in the X axis. + */ +extern CGFloat POPLayerGetRotationX(CALayer *l); + +/** + @abstract Sets layer rotation, in radians, in the X axis. + */ +extern void POPLayerSetRotationX(CALayer *l, CGFloat f); + +/** + @abstract Returns layer rotation, in radians, in the Y axis. + */ +extern CGFloat POPLayerGetRotationY(CALayer *l); + +/** + @abstract Sets layer rotation, in radians, in the Y axis. + */ +extern void POPLayerSetRotationY(CALayer *l, CGFloat f); + +/** + @abstract Returns layer rotation, in radians, in the Z axis. + */ +extern CGFloat POPLayerGetRotationZ(CALayer *l); + +/** + @abstract Sets layer rotation, in radians, in the Z axis. + */ +extern void POPLayerSetRotationZ(CALayer *l, CGFloat f); + +/** + @abstract Returns layer rotation, in radians, in the Z axis. + */ +extern CGFloat POPLayerGetRotation(CALayer *l); + +/** + @abstract Sets layer rotation, in radians, in the Z axis. + */ +extern void POPLayerSetRotation(CALayer *l, CGFloat f); + +#pragma mark - Sublayer Scale + +/** + @abstract Returns sublayer scale factors for x and y access as point. + */ +extern CGPoint POPLayerGetSubScaleXY(CALayer *l); + +/** + @abstract Sets sublayer x and y scale factors given point. + */ +extern void POPLayerSetSubScaleXY(CALayer *l, CGPoint p); + +#pragma mark - Sublayer Translation + +/** + @abstract Returns sublayer translation factor for the x axis. + */ +extern CGFloat POPLayerGetSubTranslationX(CALayer *l); + +/** + @abstract Set sublayer translation factor for the x axis. + */ +extern void POPLayerSetSubTranslationX(CALayer *l, CGFloat f); + +/** + @abstract Returns sublayer translation factor for the y axis. + */ +extern CGFloat POPLayerGetSubTranslationY(CALayer *l); + +/** + @abstract Set sublayer translation factor for the y axis. + */ +extern void POPLayerSetSubTranslationY(CALayer *l, CGFloat f); + +/** + @abstract Returns sublayer translation factor for the z axis. + */ +extern CGFloat POPLayerGetSubTranslationZ(CALayer *l); + +/** + @abstract Set sublayer translation factor for the z axis. + */ +extern void POPLayerSetSubTranslationZ(CALayer *l, CGFloat f); + +/** + @abstract Returns sublayer translation factors for x and y access as point. + */ +extern CGPoint POPLayerGetSubTranslationXY(CALayer *l); + +/** + @abstract Sets sublayer x and y translation factors given point. + */ +extern void POPLayerSetSubTranslationXY(CALayer *l, CGPoint p); + +POP_EXTERN_C_END diff --git a/Demo/Pods/pop/pop/POPLayerExtras.mm b/Demo/Pods/pop/pop/POPLayerExtras.mm new file mode 100644 index 0000000..aff8af2 --- /dev/null +++ b/Demo/Pods/pop/pop/POPLayerExtras.mm @@ -0,0 +1,268 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPLayerExtras.h" + +#include "TransformationMatrix.h" + +using namespace WebCore; + +#define DECOMPOSE_TRANSFORM(L) \ + TransformationMatrix _m(L.transform); \ + TransformationMatrix::DecomposedType _d; \ + _m.decompose(_d); + +#define RECOMPOSE_TRANSFORM(L) \ + _m.recompose(_d); \ + L.transform = _m.transform3d(); + +#define RECOMPOSE_ROT_TRANSFORM(L) \ + _m.recompose(_d, true); \ + L.transform = _m.transform3d(); + +#define DECOMPOSE_SUBLAYER_TRANSFORM(L) \ + TransformationMatrix _m(L.sublayerTransform); \ + TransformationMatrix::DecomposedType _d; \ + _m.decompose(_d); + +#define RECOMPOSE_SUBLAYER_TRANSFORM(L) \ + _m.recompose(_d); \ + L.sublayerTransform = _m.transform3d(); + +#pragma mark - Scale + +CGFloat POPLayerGetScaleX(CALayer *l) +{ + DECOMPOSE_TRANSFORM(l); + return _d.scaleX; +} + +void POPLayerSetScaleX(CALayer *l, CGFloat f) +{ + DECOMPOSE_TRANSFORM(l); + _d.scaleX = f; + RECOMPOSE_TRANSFORM(l); +} + +CGFloat POPLayerGetScaleY(CALayer *l) +{ + DECOMPOSE_TRANSFORM(l); + return _d.scaleY; +} + +void POPLayerSetScaleY(CALayer *l, CGFloat f) +{ + DECOMPOSE_TRANSFORM(l); + _d.scaleY = f; + RECOMPOSE_TRANSFORM(l); +} + +CGFloat POPLayerGetScaleZ(CALayer *l) +{ + DECOMPOSE_TRANSFORM(l); + return _d.scaleZ; +} + +void POPLayerSetScaleZ(CALayer *l, CGFloat f) +{ + DECOMPOSE_TRANSFORM(l); + _d.scaleZ = f; + RECOMPOSE_TRANSFORM(l); +} + +CGPoint POPLayerGetScaleXY(CALayer *l) +{ + DECOMPOSE_TRANSFORM(l); + return CGPointMake(_d.scaleX, _d.scaleY); +} + +void POPLayerSetScaleXY(CALayer *l, CGPoint p) +{ + DECOMPOSE_TRANSFORM(l); + _d.scaleX = p.x; + _d.scaleY = p.y; + RECOMPOSE_TRANSFORM(l); +} + +#pragma mark - Translation + +CGFloat POPLayerGetTranslationX(CALayer *l) +{ + DECOMPOSE_TRANSFORM(l); + return _d.translateX; +} + +void POPLayerSetTranslationX(CALayer *l, CGFloat f) +{ + DECOMPOSE_TRANSFORM(l); + _d.translateX = f; + RECOMPOSE_TRANSFORM(l); +} + +CGFloat POPLayerGetTranslationY(CALayer *l) +{ + DECOMPOSE_TRANSFORM(l); + return _d.translateY; +} + +void POPLayerSetTranslationY(CALayer *l, CGFloat f) +{ + DECOMPOSE_TRANSFORM(l); + _d.translateY = f; + RECOMPOSE_TRANSFORM(l); +} + +CGFloat POPLayerGetTranslationZ(CALayer *l) +{ + DECOMPOSE_TRANSFORM(l); + return _d.translateZ; +} + +void POPLayerSetTranslationZ(CALayer *l, CGFloat f) +{ + DECOMPOSE_TRANSFORM(l); + _d.translateZ = f; + RECOMPOSE_TRANSFORM(l); +} + +CGPoint POPLayerGetTranslationXY(CALayer *l) +{ + DECOMPOSE_TRANSFORM(l); + return CGPointMake(_d.translateX, _d.translateY); +} + +void POPLayerSetTranslationXY(CALayer *l, CGPoint p) +{ + DECOMPOSE_TRANSFORM(l); + _d.translateX = p.x; + _d.translateY = p.y; + RECOMPOSE_TRANSFORM(l); +} + +#pragma mark - Rotation + +CGFloat POPLayerGetRotationX(CALayer *l) +{ + DECOMPOSE_TRANSFORM(l); + return _d.rotateX; +} + +void POPLayerSetRotationX(CALayer *l, CGFloat f) +{ + DECOMPOSE_TRANSFORM(l); + _d.rotateX = f; + RECOMPOSE_ROT_TRANSFORM(l); +} + +CGFloat POPLayerGetRotationY(CALayer *l) +{ + DECOMPOSE_TRANSFORM(l); + return _d.rotateY; +} + +void POPLayerSetRotationY(CALayer *l, CGFloat f) +{ + DECOMPOSE_TRANSFORM(l); + _d.rotateY = f; + RECOMPOSE_ROT_TRANSFORM(l); +} + +CGFloat POPLayerGetRotationZ(CALayer *l) +{ + DECOMPOSE_TRANSFORM(l); + return _d.rotateZ; +} + +void POPLayerSetRotationZ(CALayer *l, CGFloat f) +{ + DECOMPOSE_TRANSFORM(l); + _d.rotateZ = f; + RECOMPOSE_ROT_TRANSFORM(l); +} + +CGFloat POPLayerGetRotation(CALayer *l) +{ + return POPLayerGetRotationZ(l); +} + +void POPLayerSetRotation(CALayer *l, CGFloat f) +{ + POPLayerSetRotationZ(l, f); +} + +#pragma mark - Sublayer Scale + +CGPoint POPLayerGetSubScaleXY(CALayer *l) +{ + DECOMPOSE_SUBLAYER_TRANSFORM(l); + return CGPointMake(_d.scaleX, _d.scaleY); +} + +void POPLayerSetSubScaleXY(CALayer *l, CGPoint p) +{ + DECOMPOSE_SUBLAYER_TRANSFORM(l); + _d.scaleX = p.x; + _d.scaleY = p.y; + RECOMPOSE_SUBLAYER_TRANSFORM(l); +} + +#pragma mark - Sublayer Translation + +extern CGFloat POPLayerGetSubTranslationX(CALayer *l) +{ + DECOMPOSE_SUBLAYER_TRANSFORM(l); + return _d.translateX; +} + +extern void POPLayerSetSubTranslationX(CALayer *l, CGFloat f) +{ + DECOMPOSE_SUBLAYER_TRANSFORM(l); + _d.translateX = f; + RECOMPOSE_SUBLAYER_TRANSFORM(l); +} + +extern CGFloat POPLayerGetSubTranslationY(CALayer *l) +{ + DECOMPOSE_SUBLAYER_TRANSFORM(l); + return _d.translateY; +} + +extern void POPLayerSetSubTranslationY(CALayer *l, CGFloat f) +{ + DECOMPOSE_SUBLAYER_TRANSFORM(l); + _d.translateY = f; + RECOMPOSE_SUBLAYER_TRANSFORM(l); +} + +extern CGFloat POPLayerGetSubTranslationZ(CALayer *l) +{ + DECOMPOSE_SUBLAYER_TRANSFORM(l); + return _d.translateZ; +} + +extern void POPLayerSetSubTranslationZ(CALayer *l, CGFloat f) +{ + DECOMPOSE_SUBLAYER_TRANSFORM(l); + _d.translateZ = f; + RECOMPOSE_SUBLAYER_TRANSFORM(l); +} + +extern CGPoint POPLayerGetSubTranslationXY(CALayer *l) +{ + DECOMPOSE_SUBLAYER_TRANSFORM(l); + return CGPointMake(_d.translateX, _d.translateY); +} + +extern void POPLayerSetSubTranslationXY(CALayer *l, CGPoint p) +{ + DECOMPOSE_SUBLAYER_TRANSFORM(l); + _d.translateX = p.x; + _d.translateY = p.y; + RECOMPOSE_SUBLAYER_TRANSFORM(l); +} diff --git a/Demo/Pods/pop/pop/POPMath.h b/Demo/Pods/pop/pop/POPMath.h new file mode 100644 index 0000000..a5142f9 --- /dev/null +++ b/Demo/Pods/pop/pop/POPMath.h @@ -0,0 +1,56 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#import + +#import + +#import "POPVector.h" + +NS_INLINE CGFloat sqrtr(CGFloat f) +{ +#if CGFLOAT_IS_DOUBLE + return sqrt(f); +#else + return sqrtf(f); +#endif +} + +// round to nearest sub; pass 2.0 to round to every 0.5 (eg: retina pixels) +NS_INLINE CGFloat POPSubRound(CGFloat f, CGFloat sub) +{ + return round(f * sub) / sub; +} + +#define MIX(a, b, f) ((a) + (f) * ((b) - (a))) + +// the longer the duration, the higher the necessary precision +#define SOLVE_EPS(dur) (1. / (1000. * (dur))) + +#define _EQLF_(x, y, epsilon) (fabsf ((x) - (y)) < epsilon) + +extern void interpolate_vector(NSUInteger count, CGFloat *dst, const CGFloat *from, const CGFloat *to, double f); + +extern double timing_function_solve(const double vec[4], double t, double eps); + +// quadratic mapping of t [0, 1] to [start, end] +extern double quadratic_out_interpolation(double t, double start, double end); + +// normalize value to [0, 1] based on its range [startValue, endValue] +extern double normalize(double value, double startValue, double endValue); + +// project a normalized value [0, 1] to a given range [start, end] +extern double project_normal(double n, double start, double end); + +// solve a quadratic equation of the form a * x^2 + b * x + c = 0 +extern void quadratic_solve(CGFloat a, CGFloat b, CGFloat c, CGFloat &x1, CGFloat &x2); + +// for a given tension return the bouncy 3 friction that produces no bounce +extern double b3_nobounce(double tension); diff --git a/Demo/Pods/pop/pop/POPMath.mm b/Demo/Pods/pop/pop/POPMath.mm new file mode 100644 index 0000000..dc49457 --- /dev/null +++ b/Demo/Pods/pop/pop/POPMath.mm @@ -0,0 +1,82 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPMath.h" +#import "UnitBezier.h" +#import "POPAnimationPrivate.h" + +void interpolate_vector(NSUInteger count, CGFloat *dst, const CGFloat *from, const CGFloat *to, double f) +{ + for (NSUInteger idx = 0; idx < count; idx++) { + dst[idx] = MIX(from[idx], to[idx], f); + } +} + +double timing_function_solve(const double vec[4], double t, double eps) +{ + WebCore::UnitBezier bezier(vec[0], vec[1], vec[2], vec[3]); + return bezier.solve(t, eps); +} + +double normalize(double value, double startValue, double endValue) +{ + return (value - startValue) / (endValue - startValue); +} + +double project_normal(double n, double start, double end) +{ + return start + (n * (end - start)); +} + +static double linear_interpolation(double t, double start, double end) +{ + return t * end + (1.f - t) * start; +} + +double quadratic_out_interpolation(double t, double start, double end) +{ + return linear_interpolation(2*t - t*t, start, end); +} + +static double b3_friction1(double x) +{ + return (0.0007 * pow(x, 3)) - (0.031 * pow(x, 2)) + 0.64 * x + 1.28; +} + +static double b3_friction2(double x) +{ + return (0.000044 * pow(x, 3)) - (0.006 * pow(x, 2)) + 0.36 * x + 2.; +} + +static double b3_friction3(double x) +{ + return (0.00000045 * pow(x, 3)) - (0.000332 * pow(x, 2)) + 0.1078 * x + 5.84; +} + +double b3_nobounce(double tension) +{ + double friction = 0; + if (tension <= 18.) { + friction = b3_friction1(tension); + } else if (tension > 18 && tension <= 44) { + friction = b3_friction2(tension); + } else if (tension > 44) { + friction = b3_friction3(tension); + } else { + assert(false); + } + return friction; +} + +void quadratic_solve(CGFloat a, CGFloat b, CGFloat c, CGFloat &x1, CGFloat &x2) +{ + CGFloat discriminant = sqrt(b * b - 4 * a * c); + x1 = (-b + discriminant) / (2 * a); + x2 = (-b - discriminant) / (2 * a); +} diff --git a/Demo/Pods/pop/pop/POPPropertyAnimation.h b/Demo/Pods/pop/pop/POPPropertyAnimation.h new file mode 100644 index 0000000..9dcfe2a --- /dev/null +++ b/Demo/Pods/pop/pop/POPPropertyAnimation.h @@ -0,0 +1,65 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#import + +/** + @abstract Flags for clamping animation values. + @discussion Animation values can optionally be clamped to avoid overshoot. kPOPAnimationClampStart ensures values are more than fromValue and kPOPAnimationClampEnd ensures values are less than toValue. + */ +typedef NS_OPTIONS(NSUInteger, POPAnimationClampFlags) +{ + kPOPAnimationClampNone = 0, + kPOPAnimationClampStart = 1UL << 0, + kPOPAnimationClampEnd = 1UL << 1, + kPOPAnimationClampBoth = kPOPAnimationClampStart | kPOPAnimationClampEnd, +}; + +/** + @abstract The semi-concrete property animation subclass. + */ +@interface POPPropertyAnimation : POPAnimation + +/** + @abstract The property to animate. + */ +@property (strong, nonatomic) POPAnimatableProperty *property; + +/** + @abstract The value to animate from. + @discussion The value type should match the property. If unspecified, the value is initialized to the object's current value on animation start. + */ +@property (copy, nonatomic) id fromValue; + +/** + @abstract The value to animate to. + @discussion The value type should match the property. If unspecified, the value is initialized to the object's current value on animation start. + */ +@property (copy, nonatomic) id toValue; + +/** + @abstract The rounding factor applied to the current animated value. + @discussion Specify 1.0 to animate between integral values. Defaults to 0 meaning no rounding. + */ +@property (assign, nonatomic) CGFloat roundingFactor; + +/** + @abstract The clamp mode applied to the current animated value. + @discussion See {@ref POPAnimationClampFlags} for possible values. Defaults to kPOPAnimationClampNone. + */ +@property (assign, nonatomic) NSUInteger clampMode; + +/** + @abstract The flag indicating whether values should be "added" each frame, rather than set. + @discussion Addition may be type dependent. Defaults to NO. + */ +@property (assign, nonatomic, getter = isAdditive) BOOL additive; + +@end diff --git a/Demo/Pods/pop/pop/POPPropertyAnimation.mm b/Demo/Pods/pop/pop/POPPropertyAnimation.mm new file mode 100644 index 0000000..ccabc48 --- /dev/null +++ b/Demo/Pods/pop/pop/POPPropertyAnimation.mm @@ -0,0 +1,105 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPPropertyAnimationInternal.h" + +@implementation POPPropertyAnimation + +#pragma mark - Lifecycle + +#undef __state +#define __state ((POPPropertyAnimationState *)_state) + +- (void)_initState +{ + _state = new POPPropertyAnimationState(self); +} + +#pragma mark - Properties + +DEFINE_RW_FLAG(POPPropertyAnimationState, additive, isAdditive, setAdditive:); +DEFINE_RW_PROPERTY(POPPropertyAnimationState, roundingFactor, setRoundingFactor:, CGFloat); +DEFINE_RW_PROPERTY(POPPropertyAnimationState, clampMode, setClampMode:, NSUInteger); +DEFINE_RW_PROPERTY_OBJ(POPPropertyAnimationState, property, setProperty:, POPAnimatableProperty*, ((POPPropertyAnimationState*)_state)->updatedDynamicsThreshold();); +DEFINE_RW_PROPERTY_OBJ_COPY(POPPropertyAnimationState, progressMarkers, setProgressMarkers:, NSArray*, ((POPPropertyAnimationState*)_state)->updatedProgressMarkers();); + +- (id)fromValue +{ + return POPBox(__state->fromVec, __state->valueType); +} + +- (void)setFromValue:(id)aValue +{ + POPPropertyAnimationState *s = __state; + VectorRef vec = POPUnbox(aValue, s->valueType, s->valueCount, YES); + if (!vec_equal(vec, s->fromVec)) { + s->fromVec = vec; + + if (s->tracing) { + [s->tracer updateFromValue:aValue]; + } + } +} + +- (id)toValue +{ + return POPBox(__state->toVec, __state->valueType); +} + +- (void)setToValue:(id)aValue +{ + POPPropertyAnimationState *s = (POPPropertyAnimationState *)POPAnimationGetState(self); + VectorRef vec = POPUnbox(aValue, s->valueType, s->valueCount, YES); + + if (!vec_equal(vec, s->toVec)) { + s->toVec = vec; + + // invalidate to dependent state + s->didReachToValue = false; + s->distanceVec = NULL; + + if (s->tracing) { + [s->tracer updateToValue:aValue]; + } + + // automatically unpause active animations + if (s->active && s->paused) { + s->setPaused(false); + } + } +} + +- (id)currentValue +{ + return POPBox(__state->currentValue(), __state->valueType); +} + +#pragma mark - Utility + +- (void)_appendDescription:(NSMutableString *)s debug:(BOOL)debug +{ + [s appendFormat:@"; from = %@; to = %@", describe(__state->fromVec), describe(__state->toVec)]; + + if (_state->active) + [s appendFormat:@"; currentValue = %@", describe(__state->currentValue())]; + + if (__state->velocityVec && 0 != __state->velocityVec->norm()) + [s appendFormat:@"; velocity = %@", describe(__state->velocityVec)]; + + if (!self.removedOnCompletion) + [s appendFormat:@"; removedOnCompletion = %@", POPStringFromBOOL(self.removedOnCompletion)]; + + if (__state->progressMarkers) + [s appendFormat:@"; progressMarkers = [%@]", [__state->progressMarkers componentsJoinedByString:@", "]]; + + if (_state->active) + [s appendFormat:@"; progress = %f", __state->progress]; +} + +@end diff --git a/Demo/Pods/pop/pop/POPPropertyAnimationInternal.h b/Demo/Pods/pop/pop/POPPropertyAnimationInternal.h new file mode 100644 index 0000000..ff742ff --- /dev/null +++ b/Demo/Pods/pop/pop/POPPropertyAnimationInternal.h @@ -0,0 +1,358 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPAnimationInternal.h" +#import "POPPropertyAnimation.h" + +static void clampValue(CGFloat &value, CGFloat fromValue, CGFloat toValue, NSUInteger clamp) +{ + BOOL increasing = (toValue > fromValue); + + // Clamp start of animation. + if ((kPOPAnimationClampStart & clamp) && + ((increasing && (value < fromValue)) || (!increasing && (value > fromValue)))) { + value = fromValue; + } + + // Clamp end of animation. + if ((kPOPAnimationClampEnd & clamp) && + ((increasing && (value > toValue)) || (!increasing && (value < toValue)))) { + value = toValue; + } +} + +struct _POPPropertyAnimationState : _POPAnimationState +{ + POPAnimatableProperty *property; + POPValueType valueType; + NSUInteger valueCount; + VectorRef fromVec; + VectorRef toVec; + VectorRef currentVec; + VectorRef previousVec; + VectorRef previous2Vec; + VectorRef velocityVec; + VectorRef distanceVec; + CGFloat roundingFactor; + NSUInteger clampMode; + NSArray *progressMarkers; + POPProgressMarker *progressMarkerState; + NSUInteger progressMarkerCount; + NSUInteger nextProgressMarkerIdx; + CGFloat dynamicsThreshold; + + _POPPropertyAnimationState(id __unsafe_unretained anim) : _POPAnimationState(anim), + property(nil), + valueType((POPValueType)0), + valueCount(nil), + fromVec(nullptr), + toVec(nullptr), + currentVec(nullptr), + previousVec(nullptr), + previous2Vec(nullptr), + velocityVec(nullptr), + distanceVec(nullptr), + roundingFactor(0), + clampMode(0), + progressMarkers(nil), + progressMarkerState(nil), + progressMarkerCount(0), + nextProgressMarkerIdx(0), + dynamicsThreshold(0) + { + type = kPOPAnimationBasic; + } + + ~_POPPropertyAnimationState() + { + if (progressMarkerState) { + free(progressMarkerState); + progressMarkerState = NULL; + } + } + + bool canProgress() { + return hasValue(); + } + + bool shouldRound() { + return 0 != roundingFactor; + } + + bool hasValue() { + return 0 != valueCount; + } + + bool isDone() { + // inherit done + if (_POPAnimationState::isDone()) { + return true; + } + + // consider an animation with no values done + if (!hasValue() && !isCustom()) { + return true; + } + + return false; + } + + // returns a copy of the currentVec, rounding if needed + VectorRef currentValue() { + if (!shouldRound()) { + return VectorRef(Vector::new_vector(currentVec.get())); + } else { + VectorRef vec = VectorRef(Vector::new_vector(currentVec.get())); + vec->subRound(1 / roundingFactor); + return vec; + } + } + + void resetProgressMarkerState() + { + for (NSUInteger idx = 0; idx < progressMarkerCount; idx++) + progressMarkerState[idx].reached = false; + + nextProgressMarkerIdx = 0; + } + + void updatedProgressMarkers() + { + if (progressMarkerState) { + free(progressMarkerState); + progressMarkerState = NULL; + } + + progressMarkerCount = progressMarkers.count; + + if (0 != progressMarkerCount) { + progressMarkerState = (POPProgressMarker *)malloc(progressMarkerCount * sizeof(POPProgressMarker)); + [progressMarkers enumerateObjectsUsingBlock:^(NSNumber *progressMarker, NSUInteger idx, BOOL *stop) { + progressMarkerState[idx].reached = false; + progressMarkerState[idx].progress = [progressMarker floatValue]; + }]; + } + + nextProgressMarkerIdx = 0; + } + + virtual void updatedDynamicsThreshold() + { + dynamicsThreshold = property.threshold; + } + + bool advanceProgress(CGFloat p) + { + bool advanced = progress != p; + if (advanced) { + progress = p; + NSUInteger count = valueCount; + VectorRef outVec(Vector::new_vector(count, NULL)); + + if (1.0 == progress) { + if (outVec && toVec) { + *outVec = *toVec; + } + } else { + interpolate_vector(count, vec_data(outVec), vec_data(fromVec), vec_data(toVec), progress); + } + + currentVec = outVec; + clampCurrentValue(); + delegateProgress(); + } + return advanced; + } + + void computeProgress() { + if (!canProgress()) { + return; + } + + static ComputeProgressFunctor func; + Vector4r v = vector4(currentVec); + Vector4r f = vector4(fromVec); + Vector4r t = vector4(toVec); + progress = func(v, f, t); + } + + void delegateProgress() { + if (!canProgress()) { + return; + } + + if (delegateDidProgress && progressMarkerState) { + + while (nextProgressMarkerIdx < progressMarkerCount) { + if (progress < progressMarkerState[nextProgressMarkerIdx].progress) + break; + + if (!progressMarkerState[nextProgressMarkerIdx].reached) { + ActionEnabler enabler; + [delegate pop_animation:self didReachProgress:progressMarkerState[nextProgressMarkerIdx].progress]; + progressMarkerState[nextProgressMarkerIdx].reached = true; + } + + nextProgressMarkerIdx++; + } + } + + if (!didReachToValue) { + bool didReachToValue = false; + if (0 == valueCount) { + didReachToValue = true; + } else { + Vector4r distance = toVec->vector4r(); + distance -= currentVec->vector4r(); + + if (0 == distance.squaredNorm()) { + didReachToValue = true; + } else { + // components + if (distanceVec) { + didReachToValue = true; + const CGFloat *distanceValues = distanceVec->data(); + for (NSUInteger idx = 0; idx < valueCount; idx++) { + didReachToValue &= signbit(distance[idx]) != signbit(distanceValues[idx]); + } + } + } + } + + if (didReachToValue) { + handleDidReachToValue(); + } + } + } + + void handleDidReachToValue() { + didReachToValue = true; + + if (delegateDidReachToValue) { + ActionEnabler enabler; + [delegate pop_animationDidReachToValue:self]; + } + + if (tracing) { + [tracer didReachToValue:POPBox(currentValue(), valueType, true)]; + } + } + + void readObjectValue(VectorRef *ptrVec, id obj) + { + // use current object value as from value + pop_animatable_read_block read = property.readBlock; + if (NULL != read) { + + Vector4r vec = read_values(read, obj, valueCount); + *ptrVec = VectorRef(Vector::new_vector(valueCount, vec)); + + if (tracing) { + [tracer readPropertyValue:POPBox(*ptrVec, valueType, true)]; + } + } + } + + virtual void willRun(bool started, id obj) { + // ensure from value initialized + if (NULL == fromVec) { + readObjectValue(&fromVec, obj); + } + + // ensure to value initialized + if (NULL == toVec) { + // compute decay to value + if (kPOPAnimationDecay == type) { + [self toValue]; + } else { + // read to value + readObjectValue(&toVec, obj); + } + } + + // handle one time value initialization on start + if (started) { + + // initialize current vec + if (!currentVec) { + currentVec = VectorRef(Vector::new_vector(valueCount, NULL)); + + // initialize current value with from value + // only do this on initial creation to avoid overwriting current value + // on paused animation continuation + if (currentVec && fromVec) { + *currentVec = *fromVec; + } + } + + // ensure velocity values + if (!velocityVec) { + velocityVec = VectorRef(Vector::new_vector(valueCount, NULL)); + } + } + + // ensure distance value initialized + // depends on current value set on one time start + if (NULL == distanceVec) { + + // not yet started animations may not have from value + VectorRef fromVec2 = NULL != currentVec ? currentVec : fromVec; + + if (fromVec2 && toVec) { + Vector4r distance = toVec->vector4r(); + distance -= fromVec2->vector4r(); + + if (0 != distance.squaredNorm()) { + distanceVec = VectorRef(Vector::new_vector(valueCount, distance)); + } + } + } + } + + virtual void reset(bool all) { + _POPAnimationState::reset(all); + + if (all) { + currentVec = NULL; + previousVec = NULL; + previous2Vec = NULL; + } + progress = 0; + resetProgressMarkerState(); + didReachToValue = false; + distanceVec = NULL; + } + + void clampCurrentValue(NSUInteger clamp) + { + if (kPOPAnimationClampNone == clamp) + return; + + // Clamp all vector values + CGFloat *currentValues = currentVec->data(); + const CGFloat *fromValues = fromVec->data(); + const CGFloat *toValues = toVec->data(); + + for (NSUInteger idx = 0; idx < valueCount; idx++) { + clampValue(currentValues[idx], fromValues[idx], toValues[idx], clamp); + } + } + + void clampCurrentValue() + { + clampCurrentValue(clampMode); + } +}; + +typedef struct _POPPropertyAnimationState POPPropertyAnimationState; + +@interface POPPropertyAnimation () + +@end + diff --git a/Demo/Pods/pop/pop/POPSpringAnimation.h b/Demo/Pods/pop/pop/POPSpringAnimation.h new file mode 100644 index 0000000..75c3bab --- /dev/null +++ b/Demo/Pods/pop/pop/POPSpringAnimation.h @@ -0,0 +1,67 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +/** + @abstract A concrete spring animation class. + @discussion Animation is achieved through modeling spring dynamics. + */ +@interface POPSpringAnimation : POPPropertyAnimation + +/** + @abstract The designated initializer. + @returns An instance of a spring animation. + */ ++ (instancetype)animation; + +/** + @abstract Convenience initializer that returns an animation with animatable property of name. + @param name The name of the animatable property. + @returns An instance of a spring animation configured with specified animatable property. + */ ++ (instancetype)animationWithPropertyNamed:(NSString *)name; + +/** + @abstract The current velocity value. + @discussion Set before animation start to account for initial velocity. Expressed in change of value units per second. + */ +@property (copy, nonatomic) id velocity; + +/** + @abstract The effective bounciness. + @discussion Use in conjunction with 'springSpeed' to change animation effect. Values are converted into corresponding dynamics constants. Defined as a value in the range [0, 20]. Defaults to 4. + */ +@property (assign, nonatomic) CGFloat springBounciness; + +/** + @abstract The effective speed. + @discussion Use in conjunction with 'springBounciness' to change animation effect. Values are converted into corresponding dynamics constants. Defined as a value in the range [0, 20]. Defaults to 12. + */ +@property (assign, nonatomic) CGFloat springSpeed; + +/** + @abstract The tension used in the dynamics simulation. + @discussion Can be used over bounciness and speed for finer grain tweaking of animation effect. + */ +@property (assign, nonatomic) CGFloat dynamicsTension; + +/** + @abstract The friction used in the dynamics simulation. + @discussion Can be used over bounciness and speed for finer grain tweaking of animation effect. + */ +@property (assign, nonatomic) CGFloat dynamicsFriction; + +/** + @abstract The mass used in the dynamics simulation. + @discussion Can be used over bounciness and speed for finer grain tweaking of animation effect. + */ +@property (assign, nonatomic) CGFloat dynamicsMass; + +@end diff --git a/Demo/Pods/pop/pop/POPSpringAnimation.mm b/Demo/Pods/pop/pop/POPSpringAnimation.mm new file mode 100644 index 0000000..10cb510 --- /dev/null +++ b/Demo/Pods/pop/pop/POPSpringAnimation.mm @@ -0,0 +1,164 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPSpringAnimationInternal.h" + +@implementation POPSpringAnimation + +#pragma mark - Lifecycle + +#undef __state +#define __state ((POPSpringAnimationState *)_state) + ++ (instancetype)animation +{ + return [[self alloc] init]; +} + ++ (instancetype)animationWithPropertyNamed:(NSString *)aName +{ + POPSpringAnimation *anim = [self animation]; + anim.property = [POPAnimatableProperty propertyWithName:aName]; + return anim; +} + +- (void)_initState +{ + _state = new POPSpringAnimationState(self); +} + +- (id)init +{ + self = [super _init]; + if (nil != self) { + __state->solver = new SpringSolver4d(1, 1, 1); + __state->updatedDynamicsThreshold(); + __state->updatedBouncinessAndSpeed(); + } + return self; +} + +- (void)dealloc +{ + if (__state) { + delete __state->solver; + __state->solver = NULL; + } +} + +#pragma mark - Properties + +- (id)velocity +{ + return POPBox(__state->velocityVec, __state->valueType); +} + +- (void)setVelocity:(id)aValue +{ + POPPropertyAnimationState *s = __state; + VectorRef vec = POPUnbox(aValue, s->valueType, s->valueCount, YES); + if (!vec_equal(vec, s->velocityVec)) { + s->velocityVec = vec; + + if (s->tracing) { + [s->tracer updateVelocity:aValue]; + } + } +} + +DEFINE_RW_PROPERTY(POPSpringAnimationState, dynamicsTension, setDynamicsTension:, CGFloat, [self _updatedDynamicsTension];); +DEFINE_RW_PROPERTY(POPSpringAnimationState, dynamicsFriction, setDynamicsFriction:, CGFloat, [self _updatedDynamicsFriction];); +DEFINE_RW_PROPERTY(POPSpringAnimationState, dynamicsMass, setDynamicsMass:, CGFloat, [self _updatedDynamicsMass];); + +FB_PROPERTY_GET(POPSpringAnimationState, springSpeed, CGFloat); +- (void)setSpringSpeed:(CGFloat)aFloat +{ + POPSpringAnimationState *s = __state; + if (s->userSpecifiedDynamics || aFloat != s->springSpeed) { + s->springSpeed = aFloat; + s->userSpecifiedDynamics = false; + s->updatedBouncinessAndSpeed(); + if (s->tracing) { + [s->tracer updateSpeed:aFloat]; + } + } +} + +FB_PROPERTY_GET(POPSpringAnimationState, springBounciness, CGFloat); +- (void)setSpringBounciness:(CGFloat)aFloat +{ + POPSpringAnimationState *s = __state; + if (s->userSpecifiedDynamics || aFloat != s->springBounciness) { + s->springBounciness = aFloat; + s->userSpecifiedDynamics = false; + s->updatedBouncinessAndSpeed(); + if (s->tracing) { + [s->tracer updateBounciness:aFloat]; + } + } +} + +- (SpringSolver4d *)solver +{ + return __state->solver; +} + +- (void)setSolver:(SpringSolver4d *)aSolver +{ + if (aSolver != __state->solver) { + if (__state->solver) { + delete(__state->solver); + } + __state->solver = aSolver; + } +} + +#pragma mark - Utility + +- (void)_updatedDynamicsTension +{ + __state->userSpecifiedDynamics = true; + if(__state->tracing) { + [__state->tracer updateTension:__state->dynamicsTension]; + } + __state->updatedDynamics(); +} + +- (void)_updatedDynamicsFriction +{ + __state->userSpecifiedDynamics = true; + if(__state->tracing) { + [__state->tracer updateFriction:__state->dynamicsFriction]; + } + __state->updatedDynamics(); +} + +- (void)_updatedDynamicsMass +{ + __state->userSpecifiedDynamics = true; + if(__state->tracing) { + [__state->tracer updateMass:__state->dynamicsMass]; + } + __state->updatedDynamics(); +} + +- (void)_appendDescription:(NSMutableString *)s debug:(BOOL)debug +{ + [super _appendDescription:s debug:debug]; + + if (debug) { + if (_state->userSpecifiedDynamics) { + [s appendFormat:@"; dynamics = (tension:%f, friction:%f, mass:%f)", __state->dynamicsTension, __state->dynamicsFriction, __state->dynamicsMass]; + } else { + [s appendFormat:@"; bounciness = %f; speed = %f", __state->springBounciness, __state->springSpeed]; + } + } +} + +@end diff --git a/Demo/Pods/pop/pop/POPSpringAnimationInternal.h b/Demo/Pods/pop/pop/POPSpringAnimationInternal.h new file mode 100644 index 0000000..82df1ac --- /dev/null +++ b/Demo/Pods/pop/pop/POPSpringAnimationInternal.h @@ -0,0 +1,131 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPAnimationExtras.h" +#import "POPPropertyAnimationInternal.h" +#import "POPSpringAnimation.h" + +struct _POPSpringAnimationState : _POPPropertyAnimationState +{ + SpringSolver4d *solver; + CGFloat springSpeed; + CGFloat springBounciness; // normalized springiness + CGFloat dynamicsTension; // tension + CGFloat dynamicsFriction; // friction + CGFloat dynamicsMass; // mass + + _POPSpringAnimationState(id __unsafe_unretained anim) : _POPPropertyAnimationState(anim), + solver(nullptr), + springSpeed(12.), + springBounciness(4.), + dynamicsTension(0), + dynamicsFriction(0), + dynamicsMass(0) + { + type = kPOPAnimationSpring; + } + + bool hasConverged() + { + NSUInteger count = valueCount; + if (shouldRound()) { + return vec_equal(previous2Vec, previousVec) && vec_equal(previousVec, toVec); + } else { + if (!previousVec || !previous2Vec) + return false; + + CGFloat t = dynamicsThreshold / 5; + + const CGFloat *toValues = toVec->data(); + const CGFloat *previousValues = previousVec->data(); + const CGFloat *previous2Values = previous2Vec->data(); + + for (NSUInteger idx = 0; idx < count; idx++) { + if ((fabsf(toValues[idx] - previousValues[idx]) >= t) || (fabsf(previous2Values[idx] - previousValues[idx]) >= t)) { + return false; + } + } + return true; + } + } + + bool isDone() { + if (_POPPropertyAnimationState::isDone()) { + return true; + } + return solver->started() && (hasConverged() || solver->hasConverged()); + } + + void updatedDynamics() + { + if (NULL != solver) { + solver->setConstants(dynamicsTension, dynamicsFriction, dynamicsMass); + } + } + + void updatedDynamicsThreshold() + { + _POPPropertyAnimationState::updatedDynamicsThreshold(); + if (NULL != solver) { + solver->setThreshold(dynamicsThreshold); + } + } + + void updatedBouncinessAndSpeed() { + [POPSpringAnimation convertBounciness:springBounciness speed:springSpeed toTension:&dynamicsTension friction:&dynamicsFriction mass:&dynamicsMass]; + updatedDynamics(); + } + + bool advance(CFTimeInterval time, CFTimeInterval dt, id obj) { + // advance past not yet initialized animations + if (NULL == currentVec) { + return false; + } + + CFTimeInterval localTime = time - startTime; + + Vector4d value = vector4d(currentVec); + Vector4d toValue = vector4d(toVec); + Vector4d velocity = vector4d(velocityVec); + + SSState4d state; + state.p = toValue - value; + + // the solver assumes a spring of size zero + // flip the velocity from user perspective to solver perspective + state.v = velocity * -1; + + solver->advance(state, localTime, dt); + value = toValue - state.p; + + // flip velocity back to user perspective + velocity = state.v * -1; + + *currentVec = value; + + if (velocityVec) { + *velocityVec = velocity; + } + + clampCurrentValue(); + + return true; + } + + virtual void reset(bool all) { + _POPPropertyAnimationState::reset(all); + + if (solver) { + solver->setConstants(dynamicsTension, dynamicsFriction, dynamicsMass); + solver->reset(); + } + } +}; + +typedef struct _POPSpringAnimationState POPSpringAnimationState; diff --git a/Demo/Pods/pop/pop/POPSpringSolver.h b/Demo/Pods/pop/pop/POPSpringSolver.h new file mode 100644 index 0000000..76e1cda --- /dev/null +++ b/Demo/Pods/pop/pop/POPSpringSolver.h @@ -0,0 +1,190 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import + +#import "POPVector.h" + +namespace POP { + + template + struct SSState + { + T p; + T v; + }; + + template + struct SSDerivative + { + T dp; + T dv; + }; + + typedef SSState SSState4d; + typedef SSDerivative SSDerivative4d; + + const CFTimeInterval solverDt = 0.001f; + const CFTimeInterval maxSolverDt = 30.0f; + + /** + Templated spring solver class. + */ + template + class SpringSolver + { + double _k; // stiffness + double _b; // dampening + double _m; // mass + + double _tp; // threshold + double _tv; // threshold velocity + double _ta; // threshold acceleration + + CFTimeInterval _accumulatedTime; + SSState _lastState; + T _lastDv; + bool _started; + + public: + SpringSolver(double k, double b, double m = 1) : _k(k), _b(b), _m(m), _started(false) + { + _accumulatedTime = 0; + _lastState.p = T::Zero(); + _lastState.v = T::Zero(); + _lastDv = T::Zero(); + setThreshold(1.); + } + + ~SpringSolver() + { + } + + bool started() + { + return _started; + } + + void setConstants(double k, double b, double m) + { + _k = k; + _b = b; + _m = m; + } + + void setThreshold(double t) + { + _tp = t / 2; // half a unit + _tv = 25.0 * t; // 5 units per second, squared for comparison + _ta = 625.0 * t * t; // 5 units per second squared, squared for comparison + } + + T acceleration(const SSState &state, double t) + { + return state.p*(-_k/_m) - state.v*(_b/_m); + } + + SSDerivative evaluate(const SSState &initial, double t) + { + SSDerivative output; + output.dp = initial.v; + output.dv = acceleration(initial, t); + return output; + } + + SSDerivative evaluate(const SSState &initial, double t, double dt, const SSDerivative &d) + { + SSState state; + state.p = initial.p + d.dp*dt; + state.v = initial.v + d.dv*dt; + SSDerivative output; + output.dp = state.v; + output.dv = acceleration(state, t+dt); + return output; + } + + void integrate(SSState &state, double t, double dt) + { + SSDerivative a = evaluate(state, t); + SSDerivative b = evaluate(state, t, dt*0.5, a); + SSDerivative c = evaluate(state, t, dt*0.5, b); + SSDerivative d = evaluate(state, t, dt, c); + + T dpdt = (a.dp + (b.dp + c.dp)*2.0 + d.dp) * (1.0/6.0); + T dvdt = (a.dv + (b.dv + c.dv)*2.0 + d.dv) * (1.0/6.0); + + state.p = state.p + dpdt*dt; + state.v = state.v + dvdt*dt; + + _lastDv = dvdt; + } + + SSState interpolate(const SSState &previous, const SSState ¤t, double alpha) + { + SSState state; + state.p = current.p*alpha + previous.p*(1-alpha); + state.v = current.v*alpha + previous.v*(1-alpha); + return state; + } + + void advance(SSState &state, double t, double dt) + { + _started = true; + + if (dt > maxSolverDt) { + // excessive time step, force shut down + _lastDv = _lastState.v = _lastState.p = T::Zero(); + } else { + _accumulatedTime += dt; + + SSState previousState = state, currentState = state; + while (_accumulatedTime >= solverDt) { + previousState = currentState; + this->integrate(currentState, t, solverDt); + t += solverDt; + _accumulatedTime -= solverDt; + } + CFTimeInterval alpha = _accumulatedTime / solverDt; + _lastState = state = this->interpolate(previousState, currentState, alpha); + } + } + + bool hasConverged() + { + if (!_started) { + return false; + } + + for (int idx = 0; idx < _lastState.p.size(); idx++) { + if (fabs(_lastState.p(idx)) >= _tp) { + return false; + } + } + + return (_lastState.v.squaredNorm() < _tv) && (_lastDv.squaredNorm() < _ta); + } + + void reset() + { + _accumulatedTime = 0; + _lastState.p = T::Zero(); + _lastState.v = T::Zero(); + _lastDv = T::Zero(); + _started = false; + } + }; + + /** + Convenience spring solver type definitions. + */ + typedef SpringSolver SpringSolver2d; + typedef SpringSolver SpringSolver3d; + typedef SpringSolver SpringSolver4d; +} + diff --git a/Demo/Pods/pop/pop/POPVector.h b/Demo/Pods/pop/pop/POPVector.h new file mode 100644 index 0000000..05a4a74 --- /dev/null +++ b/Demo/Pods/pop/pop/POPVector.h @@ -0,0 +1,366 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#ifndef __POP__FBVector__ +#define __POP__FBVector__ + +#include +#include + +#import +#import +#import "POPMath.h" + +namespace POP { + + /** Fixed two-size vector class */ + template + struct Vector2 + { + private: + typedef T Vector2::* const _data[2]; + static const _data _v; + + public: + T x; + T y; + + // Zero vector + static const Vector2 Zero() { return Vector2(0); } + + // Constructors + Vector2() {} + explicit Vector2(T v) { x = v; y = v; }; + explicit Vector2(T x0, T y0) : x(x0), y(y0) {}; + explicit Vector2(const CGPoint &p) : x(p.x), y (p.y) {} + explicit Vector2(const CGSize &s) : x(s.width), y (s.height) {} + + // Copy constructor + template explicit Vector2(const Vector2 &v) : x(v.x), y(v.y) {} + + // Index operators + const T& operator[](size_t i) const { return this->*_v[i]; } + T& operator[](size_t i) { return this->*_v[i]; } + const T& operator()(size_t i) const { return this->*_v[i]; } + T& operator()(size_t i) { return this->*_v[i]; } + + // Backing data + T * data() { return &(this->*_v[0]); } + const T * data() const { return &(this->*_v[0]); } + + // Size + inline size_t size() const { return 2; } + + // Assignment + Vector2 &operator= (T v) { x = v; y = v; return *this;} + template Vector2 &operator= (const Vector2 &v) { x = v.x; y = v.y; return *this;} + + // Negation + Vector2 operator- (void) const { return Vector2(-x, -y); } + + // Equality + bool operator== (T v) const { return (x == v && y == v); } + bool operator== (const Vector2 &v) const { return (x == v.x && y == v.y); } + + // Inequality + bool operator!= (T v) const {return (x != v || y != v); } + bool operator!= (const Vector2 &v) const { return (x != v.x || y != v.y); } + + // Scalar Math + Vector2 operator+ (T v) const { return Vector2(x + v, y + v); } + Vector2 operator- (T v) const { return Vector2(x - v, y - v); } + Vector2 operator* (T v) const { return Vector2(x * v, y * v); } + Vector2 operator/ (T v) const { return Vector2(x / v, y / v); } + Vector2 &operator+= (T v) { x += v; y += v; return *this; }; + Vector2 &operator-= (T v) { x -= v; y -= v; return *this; }; + Vector2 &operator*= (T v) { x *= v; y *= v; return *this; }; + Vector2 &operator/= (T v) { x /= v; y /= v; return *this; }; + + // Vector Math + Vector2 operator+ (const Vector2 &v) const { return Vector2(x + v.x, y + v.y); } + Vector2 operator- (const Vector2 &v) const { return Vector2(x - v.x, y - v.y); } + Vector2 &operator+= (const Vector2 &v) { x += v.x; y += v.y; return *this; }; + Vector2 &operator-= (const Vector2 &v) { x -= v.x; y -= v.y; return *this; }; + + // Norms + CGFloat norm() const { return sqrtr(squaredNorm()); } + CGFloat squaredNorm() const { return x * x + y * y; } + + // Cast + template Vector2 cast() const { return Vector2(x, y); } + CGPoint cg_point() const { return CGPointMake(x, y); }; + }; + + template + const typename Vector2::_data Vector2::_v = { &Vector2::x, &Vector2::y }; + + /** Fixed three-size vector class */ + template + struct Vector3 + { + private: + typedef T Vector3::* const _data[3]; + static const _data _v; + + public: + T x; + T y; + T z; + + // Zero vector + static const Vector3 Zero() { return Vector3(0); }; + + // Constructors + Vector3() {} + explicit Vector3(T v) : x(v), y(v), z(v) {}; + explicit Vector3(T x0, T y0, T z0) : x(x0), y(y0), z(z0) {}; + + // Copy constructor + template explicit Vector3(const Vector3 &v) : x(v.x), y(v.y), z(v.z) {} + + // Index operators + const T& operator[](size_t i) const { return this->*_v[i]; } + T& operator[](size_t i) { return this->*_v[i]; } + const T& operator()(size_t i) const { return this->*_v[i]; } + T& operator()(size_t i) { return this->*_v[i]; } + + // Backing data + T * data() { return &(this->*_v[0]); } + const T * data() const { return &(this->*_v[0]); } + + // Size + inline size_t size() const { return 3; } + + // Assignment + Vector3 &operator= (T v) { x = v; y = v; z = v; return *this;} + template Vector3 &operator= (const Vector3 &v) { x = v.x; y = v.y; z = v.z; return *this;} + + // Negation + Vector3 operator- (void) const { return Vector3(-x, -y, -z); } + + // Equality + bool operator== (T v) const { return (x == v && y == v && z = v); } + bool operator== (const Vector3 &v) const { return (x == v.x && y == v.y && z == v.z); } + + // Inequality + bool operator!= (T v) const {return (x != v || y != v || z != v); } + bool operator!= (const Vector3 &v) const { return (x != v.x || y != v.y || z != v.z); } + + // Scalar Math + Vector3 operator+ (T v) const { return Vector3(x + v, y + v, z + v); } + Vector3 operator- (T v) const { return Vector3(x - v, y - v, z - v); } + Vector3 operator* (T v) const { return Vector3(x * v, y * v, z * v); } + Vector3 operator/ (T v) const { return Vector3(x / v, y / v, z / v); } + Vector3 &operator+= (T v) { x += v; y += v; z += v; return *this; }; + Vector3 &operator-= (T v) { x -= v; y -= v; z -= v; return *this; }; + Vector3 &operator*= (T v) { x *= v; y *= v; z *= v; return *this; }; + Vector3 &operator/= (T v) { x /= v; y /= v; z /= v; return *this; }; + + // Vector Math + Vector3 operator+ (const Vector3 &v) const { return Vector3(x + v.x, y + v.y, z + v.z); } + Vector3 operator- (const Vector3 &v) const { return Vector3(x - v.x, y - v.y, z - v.z); } + Vector3 &operator+= (const Vector3 &v) { x += v.x; y += v.y; z += v.z; return *this; }; + Vector3 &operator-= (const Vector3 &v) { x -= v.x; y -= v.y; z -= v.z; return *this; }; + + // Norms + CGFloat norm() const { return sqrtr(squaredNorm()); } + CGFloat squaredNorm() const { return x * x + y * y + z * z; } + + // Cast + template Vector3 cast() const { return Vector3(x, y, z); } + }; + + template + const typename Vector3::_data Vector3::_v = { &Vector3::x, &Vector3::y, &Vector3::z }; + + /** Fixed four-size vector class */ + template + struct Vector4 + { + private: + typedef T Vector4::* const _data[4]; + static const _data _v; + + public: + T x; + T y; + T z; + T w; + + // Zero vector + static const Vector4 Zero() { return Vector4(0); }; + + // Constructors + Vector4() {} + explicit Vector4(T v) : x(v), y(v), z(v), w(v) {}; + explicit Vector4(T x0, T y0, T z0, T w0) : x(x0), y(y0), z(z0), w(w0) {}; + + // Copy constructor + template explicit Vector4(const Vector4 &v) : x(v.x), y(v.y), z(v.z), w(v.w) {} + + // Index operators + const T& operator[](size_t i) const { return this->*_v[i]; } + T& operator[](size_t i) { return this->*_v[i]; } + const T& operator()(size_t i) const { return this->*_v[i]; } + T& operator()(size_t i) { return this->*_v[i]; } + + // Backing data + T * data() { return &(this->*_v[0]); } + const T * data() const { return &(this->*_v[0]); } + + // Size + inline size_t size() const { return 4; } + + // Assignment + Vector4 &operator= (T v) { x = v; y = v; z = v; w = v; return *this;} + template Vector4 &operator= (const Vector4 &v) { x = v.x; y = v.y; z = v.z; w = v.w; return *this;} + + // Negation + Vector4 operator- (void) const { return Vector4(-x, -y, -z, -w); } + + // Equality + bool operator== (T v) const { return (x == v && y == v && z = v, w = v); } + bool operator== (const Vector4 &v) const { return (x == v.x && y == v.y && z == v.z && w = v.w); } + + // Inequality + bool operator!= (T v) const {return (x != v || y != v || z != v || w != v); } + bool operator!= (const Vector4 &v) const { return (x != v.x || y != v.y || z != v.z || w != v.w); } + + // Scalar Math + Vector4 operator+ (T v) const { return Vector4(x + v, y + v, z + v, w + v); } + Vector4 operator- (T v) const { return Vector4(x - v, y - v, z - v, w - v); } + Vector4 operator* (T v) const { return Vector4(x * v, y * v, z * v, w * v); } + Vector4 operator/ (T v) const { return Vector4(x / v, y / v, z / v, w / v); } + Vector4 &operator+= (T v) { x += v; y += v; z += v; w += v; return *this; }; + Vector4 &operator-= (T v) { x -= v; y -= v; z -= v; w -= v; return *this; }; + Vector4 &operator*= (T v) { x *= v; y *= v; z *= v; w *= v; return *this; }; + Vector4 &operator/= (T v) { x /= v; y /= v; z /= v; w /= v; return *this; }; + + // Vector Math + Vector4 operator+ (const Vector4 &v) const { return Vector4(x + v.x, y + v.y, z + v.z, w + v.w); } + Vector4 operator- (const Vector4 &v) const { return Vector4(x - v.x, y - v.y, z - v.z, w - v.w); } + Vector4 &operator+= (const Vector4 &v) { x += v.x; y += v.y; z += v.z; w += v.w; return *this; }; + Vector4 &operator-= (const Vector4 &v) { x -= v.x; y -= v.y; z -= v.z; w -= v.w; return *this; }; + + // Norms + CGFloat norm() const { return sqrtr(squaredNorm()); } + CGFloat squaredNorm() const { return x * x + y * y + z * z + w * w; } + + // Cast + template Vector4 cast() const { return Vector4(x, y, z, w); } + }; + + template + const typename Vector4::_data Vector4::_v = { &Vector4::x, &Vector4::y, &Vector4::z, &Vector4::w }; + + /** Convenience typedefs */ + typedef Vector2 Vector2f; + typedef Vector2 Vector2d; + typedef Vector2 Vector2r; + typedef Vector3 Vector3f; + typedef Vector3 Vector3d; + typedef Vector3 Vector3r; + typedef Vector4 Vector4f; + typedef Vector4 Vector4d; + typedef Vector4 Vector4r; + + /** Variable-sized vector class */ + class Vector + { + size_t _count; + CGFloat *_values; + + private: + Vector(size_t); + Vector(const Vector& other); + + public: + ~Vector(); + + // Creates a new vector instance of count with values. Initializing a vector of size 0 returns NULL. + static Vector *new_vector(NSUInteger count, const CGFloat *values); + + // Creates a new vector given a pointer to another. Can return NULL. + static Vector *new_vector(const Vector * const other); + + // Creates a variable size vector given a static vector and count. + static Vector *new_vector(NSUInteger count, Vector4r vec); + + // Size of vector + NSUInteger size() const { return _count; } + + // Returns array of values + CGFloat *data () { return _values; } + const CGFloat *data () const { return _values; }; + + // Vector2r support + Vector2r vector2r() const; + + // Vector4r support + Vector4r vector4r() const; + + // CGFloat support + static Vector *new_cg_float(CGFloat f); + + // CGPoint support + CGPoint cg_point() const; + static Vector *new_cg_point(const CGPoint &p); + + // CGSize support + CGSize cg_size() const; + static Vector *new_cg_size(const CGSize &s); + + // CGRect support + CGRect cg_rect() const; + static Vector *new_cg_rect(const CGRect &r); + + // CGAffineTransform support + CGAffineTransform cg_affine_transform() const; + static Vector *new_cg_affine_transform(const CGAffineTransform &t); + + // CGColorRef support + CGColorRef cg_color() const CF_RETURNS_RETAINED; + static Vector *new_cg_color(CGColorRef color); + + // operator overloads + CGFloat &operator[](size_t i) const { + NSCAssert(size() > i, @"unexpected vector size:%lu", (unsigned long)size()); + return _values[i]; + } + + // Returns the mathematical length + CGFloat norm() const; + CGFloat squaredNorm() const; + + // Round to nearest sub + void subRound(CGFloat sub); + + // Returns string description + NSString * const toString() const; + + // Operator overloads + template Vector& operator= (const Vector4& other) { + size_t count = MIN(_count, other.size()); + for (size_t i = 0; i < count; i++) { + _values[i] = other[i]; + } + return *this; + } + Vector& operator= (const Vector& other); + void swap(Vector &first, Vector &second); + bool operator==(const Vector &other) const; + bool operator!=(const Vector &other) const; + }; + + /** Convenience typedefs */ + typedef std::shared_ptr VectorRef; + typedef std::shared_ptr VectorConstRef; + +} +#endif /* defined(__POP__FBVector__) */ diff --git a/Demo/Pods/pop/pop/POPVector.mm b/Demo/Pods/pop/pop/POPVector.mm new file mode 100644 index 0000000..fcaa7ab --- /dev/null +++ b/Demo/Pods/pop/pop/POPVector.mm @@ -0,0 +1,283 @@ +/** + Copyright (c) 2014-present, Facebook, Inc. + All rights reserved. + + This source code is licensed under the BSD-style license found in the + LICENSE file in the root directory of this source tree. An additional grant + of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "POPVector.h" +#import "POPAnimationRuntime.h" +#import "POPCGUtils.h" + +namespace POP +{ + + Vector::Vector(const size_t count) + { + _count = count; + _values = 0 != count ? (CGFloat *)calloc(count, sizeof(CGFloat)) : NULL; + } + + Vector::Vector(const Vector& other) + { + _count = other.size(); + _values = 0 != _count ? (CGFloat *)calloc(_count, sizeof(CGFloat)) : NULL; + if (0 != _count) { + memcpy(_values, other.data(), _count * sizeof(CGFloat)); + } + } + + Vector::~Vector() + { + if (NULL != _values) { + free(_values); + _values = NULL; + } + _count = 0; + } + + void Vector::swap(Vector &first, Vector &second) + { + using std::swap; + swap(first._count, second._count); + swap(first._values, second._values); + } + + Vector& Vector::operator=(const Vector& other) + { + Vector temp(other); + swap(*this, temp); + return *this; + } + + bool Vector::operator==(const Vector &other) const { + if (_count != other.size()) { + return false; + } + + const CGFloat * const values = other.data(); + + for (NSUInteger idx = 0; idx < _count; idx++) { + if (_values[idx] != values[idx]) { + return false; + } + } + + return true; + } + + bool Vector::operator!=(const Vector &other) const { + if (_count == other.size()) { + return false; + } + + const CGFloat * const values = other.data(); + + for (NSUInteger idx = 0; idx < _count; idx++) { + if (_values[idx] != values[idx]) { + return false; + } + } + + return true; + } + + Vector *Vector::new_vector(NSUInteger count, const CGFloat *values) + { + if (0 == count) { + return NULL; + } + + Vector *v = new Vector(count); + if (NULL != values) { + memcpy(v->_values, values, count * sizeof(CGFloat)); + } + return v; + } + + Vector *Vector::new_vector(const Vector * const other) + { + if (NULL == other) { + return NULL; + } + + return Vector::new_vector(other->size(), other->data()); + } + + Vector *Vector::new_vector(NSUInteger count, Vector4r vec) + { + if (0 == count) { + return NULL; + } + + Vector *v = new Vector(count); + + NSCAssert(count <= 4, @"unexpected count %lu", (unsigned long)count); + for (NSUInteger i = 0; i < MIN(count, 4); i++) { + v->_values[i] = vec[i]; + } + + return v; + } + + Vector4r Vector::vector4r() const + { + Vector4r v = Vector4r::Zero(); + for (int i = 0; i < _count; i++) { + v(i) = _values[i]; + } + return v; + } + + Vector2r Vector::vector2r() const + { + Vector2r v = Vector2r::Zero(); + if (_count > 0) v(0) = _values[0]; + if (_count > 1) v(1) = _values[1]; + return v; + } + + Vector *Vector::new_cg_float(CGFloat f) + { + Vector *v = new Vector(1); + v->_values[0] = f; + return v; + } + + CGPoint Vector::cg_point () const + { + Vector2r v = vector2r(); + return CGPointMake(v(0), v(1)); + } + + Vector *Vector::new_cg_point(const CGPoint &p) + { + Vector *v = new Vector(2); + v->_values[0] = p.x; + v->_values[1] = p.y; + return v; + } + + CGSize Vector::cg_size () const + { + Vector2r v = vector2r(); + return CGSizeMake(v(0), v(1)); + } + + Vector *Vector::new_cg_size(const CGSize &s) + { + Vector *v = new Vector(2); + v->_values[0] = s.width; + v->_values[1] = s.height; + return v; + } + + CGRect Vector::cg_rect() const + { + return _count < 4 ? CGRectZero : CGRectMake(_values[0], _values[1], _values[2], _values[3]); + } + + Vector *Vector::new_cg_rect(const CGRect &r) + { + Vector *v = new Vector(4); + v->_values[0] = r.origin.x; + v->_values[1] = r.origin.y; + v->_values[2] = r.size.width; + v->_values[3] = r.size.height; + return v; + } + + CGAffineTransform Vector::cg_affine_transform() const + { + if (_count < 6) { + return CGAffineTransformIdentity; + } + + NSCAssert(size() >= 6, @"unexpected vector size:%lu", (unsigned long)size()); + CGAffineTransform t; + t.a = _values[0]; + t.b = _values[1]; + t.c = _values[2]; + t.d = _values[3]; + t.tx = _values[4]; + t.ty = _values[5]; + return t; + } + + Vector *Vector::new_cg_affine_transform(const CGAffineTransform &t) + { + Vector *v = new Vector(6); + v->_values[0] = t.a; + v->_values[1] = t.b; + v->_values[2] = t.c; + v->_values[3] = t.d; + v->_values[4] = t.tx; + v->_values[5] = t.ty; + return v; + } + + CGColorRef Vector::cg_color() const + { + if (_count < 4) { + return NULL; + } + return POPCGColorRGBACreate(_values); + } + + Vector *Vector::new_cg_color(CGColorRef color) + { + CGFloat rgba[4]; + POPCGColorGetRGBAComponents(color, rgba); + return new_vector(4, rgba); + } + + void Vector::subRound(CGFloat sub) + { + for (NSUInteger idx = 0; idx < _count; idx++) { + _values[idx] = POPSubRound(_values[idx], sub); + } + } + + CGFloat Vector::norm() const + { + return sqrtr(squaredNorm()); + } + + CGFloat Vector::squaredNorm() const + { + CGFloat d = 0; + for (NSUInteger idx = 0; idx < _count; idx++) { + d += (_values[idx] * _values[idx]); + } + return d; + } + + NSString * const Vector::toString() const + { + if (0 == _count) + return @"()"; + + if (1 == _count) + return [NSString stringWithFormat:@"%f", _values[0]]; + + if (2 == _count) + return [NSString stringWithFormat:@"(%.3f, %.3f)", _values[0], _values[1]]; + + NSMutableString *s = [NSMutableString stringWithCapacity:10]; + + for (NSUInteger idx = 0; idx < _count; idx++) { + if (0 == idx) { + [s appendFormat:@"[%.3f", _values[idx]]; + } else if (idx == _count - 1) { + [s appendFormat:@", %.3f]", _values[idx]]; + } else { + [s appendFormat:@", %.3f", _values[idx]]; + } + } + + return s; + + } +} diff --git a/Demo/Pods/pop/pop/WebCore/FloatConversion.h b/Demo/Pods/pop/pop/WebCore/FloatConversion.h new file mode 100644 index 0000000..4a16166 --- /dev/null +++ b/Demo/Pods/pop/pop/WebCore/FloatConversion.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2007 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef FloatConversion_h +#define FloatConversion_h + +#include + +namespace WebCore { + + template + float narrowPrecisionToFloat(T); + + template<> + inline float narrowPrecisionToFloat(double number) + { + return static_cast(number); + } + + template + CGFloat narrowPrecisionToCGFloat(T); + + template<> + inline CGFloat narrowPrecisionToCGFloat(double number) + { + return static_cast(number); + } + +} // namespace WebCore + +#endif // FloatConversion_h diff --git a/Demo/Pods/pop/pop/WebCore/TransformationMatrix.cpp b/Demo/Pods/pop/pop/WebCore/TransformationMatrix.cpp new file mode 100644 index 0000000..cbfd701 --- /dev/null +++ b/Demo/Pods/pop/pop/WebCore/TransformationMatrix.cpp @@ -0,0 +1,1072 @@ +/* + * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2009 Torch Mobile, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "TransformationMatrix.h" +#include "FloatConversion.h" +#include + +inline double deg2rad(double d) { return d * M_PI / 180.0; } +inline double rad2deg(double r) { return r * 180.0 / M_PI; } +inline double deg2grad(double d) { return d * 400.0 / 360.0; } +inline double grad2deg(double g) { return g * 360.0 / 400.0; } +inline double turn2deg(double t) { return t * 360.0; } +inline double deg2turn(double d) { return d / 360.0; } +inline double rad2grad(double r) { return r * 200.0 / M_PI; } +inline double grad2rad(double g) { return g * M_PI / 200.0; } + +//using namespace std; + +namespace WebCore { + + // + // Supporting Math Functions + // + // This is a set of function from various places (attributed inline) to do things like + // inversion and decomposition of a 4x4 matrix. They are used throughout the code + // + + // + // Adapted from Matrix Inversion by Richard Carling, Graphics Gems . + + // EULA: The Graphics Gems code is copyright-protected. In other words, you cannot claim the text of the code + // as your own and resell it. Using the code is permitted in any program, product, or library, non-commercial + // or commercial. Giving credit is not required, though is a nice gesture. The code comes as-is, and if there + // are any flaws or problems with any Gems code, nobody involved with Gems - authors, editors, publishers, or + // webmasters - are to be held responsible. Basically, don't be a jerk, and remember that anything free comes + // with no guarantee. + + // A clarification about the storage of matrix elements + // + // This class uses a 2 dimensional array internally to store the elements of the matrix. The first index into + // the array refers to the column that the element lies in; the second index refers to the row. + // + // In other words, this is the layout of the matrix: + // + // | m_matrix[0][0] m_matrix[1][0] m_matrix[2][0] m_matrix[3][0] | + // | m_matrix[0][1] m_matrix[1][1] m_matrix[2][1] m_matrix[3][1] | + // | m_matrix[0][2] m_matrix[1][2] m_matrix[2][2] m_matrix[3][2] | + // | m_matrix[0][3] m_matrix[1][3] m_matrix[2][3] m_matrix[3][3] | + + typedef double Vector4[4]; + typedef double Vector3[3]; + + const double SMALL_NUMBER = 1.e-8; + + // inverse(original_matrix, inverse_matrix) + // + // calculate the inverse of a 4x4 matrix + // + // -1 + // A = ___1__ adjoint A + // det A + + // double = determinant2x2(double a, double b, double c, double d) + // + // calculate the determinant of a 2x2 matrix. + + static double determinant2x2(double a, double b, double c, double d) + { + return a * d - b * c; + } + + // double = determinant3x3(a1, a2, a3, b1, b2, b3, c1, c2, c3) + // + // Calculate the determinant of a 3x3 matrix + // in the form + // + // | a1, b1, c1 | + // | a2, b2, c2 | + // | a3, b3, c3 | + + static double determinant3x3(double a1, double a2, double a3, double b1, double b2, double b3, double c1, double c2, double c3) + { + return a1 * determinant2x2(b2, b3, c2, c3) + - b1 * determinant2x2(a2, a3, c2, c3) + + c1 * determinant2x2(a2, a3, b2, b3); + } + + // double = determinant4x4(matrix) + // + // calculate the determinant of a 4x4 matrix. + + static double determinant4x4(const TransformationMatrix::Matrix4& m) + { + // Assign to individual variable names to aid selecting + // correct elements + + double a1 = m[0][0]; + double b1 = m[0][1]; + double c1 = m[0][2]; + double d1 = m[0][3]; + + double a2 = m[1][0]; + double b2 = m[1][1]; + double c2 = m[1][2]; + double d2 = m[1][3]; + + double a3 = m[2][0]; + double b3 = m[2][1]; + double c3 = m[2][2]; + double d3 = m[2][3]; + + double a4 = m[3][0]; + double b4 = m[3][1]; + double c4 = m[3][2]; + double d4 = m[3][3]; + + return a1 * determinant3x3(b2, b3, b4, c2, c3, c4, d2, d3, d4) + - b1 * determinant3x3(a2, a3, a4, c2, c3, c4, d2, d3, d4) + + c1 * determinant3x3(a2, a3, a4, b2, b3, b4, d2, d3, d4) + - d1 * determinant3x3(a2, a3, a4, b2, b3, b4, c2, c3, c4); + } + + // adjoint( original_matrix, inverse_matrix ) + // + // calculate the adjoint of a 4x4 matrix + // + // Let a denote the minor determinant of matrix A obtained by + // ij + // + // deleting the ith row and jth column from A. + // + // i+j + // Let b = (-1) a + // ij ji + // + // The matrix B = (b ) is the adjoint of A + // ij + + static void adjoint(const TransformationMatrix::Matrix4& matrix, TransformationMatrix::Matrix4& result) + { + // Assign to individual variable names to aid + // selecting correct values + double a1 = matrix[0][0]; + double b1 = matrix[0][1]; + double c1 = matrix[0][2]; + double d1 = matrix[0][3]; + + double a2 = matrix[1][0]; + double b2 = matrix[1][1]; + double c2 = matrix[1][2]; + double d2 = matrix[1][3]; + + double a3 = matrix[2][0]; + double b3 = matrix[2][1]; + double c3 = matrix[2][2]; + double d3 = matrix[2][3]; + + double a4 = matrix[3][0]; + double b4 = matrix[3][1]; + double c4 = matrix[3][2]; + double d4 = matrix[3][3]; + + // Row column labeling reversed since we transpose rows & columns + result[0][0] = determinant3x3(b2, b3, b4, c2, c3, c4, d2, d3, d4); + result[1][0] = - determinant3x3(a2, a3, a4, c2, c3, c4, d2, d3, d4); + result[2][0] = determinant3x3(a2, a3, a4, b2, b3, b4, d2, d3, d4); + result[3][0] = - determinant3x3(a2, a3, a4, b2, b3, b4, c2, c3, c4); + + result[0][1] = - determinant3x3(b1, b3, b4, c1, c3, c4, d1, d3, d4); + result[1][1] = determinant3x3(a1, a3, a4, c1, c3, c4, d1, d3, d4); + result[2][1] = - determinant3x3(a1, a3, a4, b1, b3, b4, d1, d3, d4); + result[3][1] = determinant3x3(a1, a3, a4, b1, b3, b4, c1, c3, c4); + + result[0][2] = determinant3x3(b1, b2, b4, c1, c2, c4, d1, d2, d4); + result[1][2] = - determinant3x3(a1, a2, a4, c1, c2, c4, d1, d2, d4); + result[2][2] = determinant3x3(a1, a2, a4, b1, b2, b4, d1, d2, d4); + result[3][2] = - determinant3x3(a1, a2, a4, b1, b2, b4, c1, c2, c4); + + result[0][3] = - determinant3x3(b1, b2, b3, c1, c2, c3, d1, d2, d3); + result[1][3] = determinant3x3(a1, a2, a3, c1, c2, c3, d1, d2, d3); + result[2][3] = - determinant3x3(a1, a2, a3, b1, b2, b3, d1, d2, d3); + result[3][3] = determinant3x3(a1, a2, a3, b1, b2, b3, c1, c2, c3); + } + + // Returns false if the matrix is not invertible + static bool inverse(const TransformationMatrix::Matrix4& matrix, TransformationMatrix::Matrix4& result) + { + // Calculate the adjoint matrix + adjoint(matrix, result); + + // Calculate the 4x4 determinant + // If the determinant is zero, + // then the inverse matrix is not unique. + double det = determinant4x4(matrix); + + if (fabs(det) < SMALL_NUMBER) + return false; + + // Scale the adjoint matrix to get the inverse + + for (int i = 0; i < 4; i++) + for (int j = 0; j < 4; j++) + result[i][j] = result[i][j] / det; + + return true; + } + + // End of code adapted from Matrix Inversion by Richard Carling + + // Perform a decomposition on the passed matrix, return false if unsuccessful + // From Graphics Gems: unmatrix.c + + // Transpose rotation portion of matrix a, return b + static void transposeMatrix4(const TransformationMatrix::Matrix4& a, TransformationMatrix::Matrix4& b) + { + for (int i = 0; i < 4; i++) + for (int j = 0; j < 4; j++) + b[i][j] = a[j][i]; + } + + // Multiply a homogeneous point by a matrix and return the transformed point + static void v4MulPointByMatrix(const Vector4 p, const TransformationMatrix::Matrix4& m, Vector4 result) + { + result[0] = (p[0] * m[0][0]) + (p[1] * m[1][0]) + + (p[2] * m[2][0]) + (p[3] * m[3][0]); + result[1] = (p[0] * m[0][1]) + (p[1] * m[1][1]) + + (p[2] * m[2][1]) + (p[3] * m[3][1]); + result[2] = (p[0] * m[0][2]) + (p[1] * m[1][2]) + + (p[2] * m[2][2]) + (p[3] * m[3][2]); + result[3] = (p[0] * m[0][3]) + (p[1] * m[1][3]) + + (p[2] * m[2][3]) + (p[3] * m[3][3]); + } + + static double v3Length(Vector3 a) + { + return sqrt((a[0] * a[0]) + (a[1] * a[1]) + (a[2] * a[2])); + } + + static void v3Scale(Vector3 v, double desiredLength) + { + double len = v3Length(v); + if (len != 0) { + double l = desiredLength / len; + v[0] *= l; + v[1] *= l; + v[2] *= l; + } + } + + static double v3Dot(const Vector3 a, const Vector3 b) + { + return (a[0] * b[0]) + (a[1] * b[1]) + (a[2] * b[2]); + } + + // Make a linear combination of two vectors and return the result. + // result = (a * ascl) + (b * bscl) + static void v3Combine(const Vector3 a, const Vector3 b, Vector3 result, double ascl, double bscl) + { + result[0] = (ascl * a[0]) + (bscl * b[0]); + result[1] = (ascl * a[1]) + (bscl * b[1]); + result[2] = (ascl * a[2]) + (bscl * b[2]); + } + + // Return the cross product result = a cross b */ + static void v3Cross(const Vector3 a, const Vector3 b, Vector3 result) + { + result[0] = (a[1] * b[2]) - (a[2] * b[1]); + result[1] = (a[2] * b[0]) - (a[0] * b[2]); + result[2] = (a[0] * b[1]) - (a[1] * b[0]); + } + + static bool decompose(const TransformationMatrix::Matrix4& mat, TransformationMatrix::DecomposedType& result) + { + TransformationMatrix::Matrix4 localMatrix; + memcpy(localMatrix, mat, sizeof(TransformationMatrix::Matrix4)); + + // Normalize the matrix. + if (localMatrix[3][3] == 0) + return false; + + int i, j; + for (i = 0; i < 4; i++) + for (j = 0; j < 4; j++) + localMatrix[i][j] /= localMatrix[3][3]; + + // perspectiveMatrix is used to solve for perspective, but it also provides + // an easy way to test for singularity of the upper 3x3 component. + TransformationMatrix::Matrix4 perspectiveMatrix; + memcpy(perspectiveMatrix, localMatrix, sizeof(TransformationMatrix::Matrix4)); + for (i = 0; i < 3; i++) + perspectiveMatrix[i][3] = 0; + perspectiveMatrix[3][3] = 1; + + if (determinant4x4(perspectiveMatrix) == 0) + return false; + + // First, isolate perspective. This is the messiest. + if (localMatrix[0][3] != 0 || localMatrix[1][3] != 0 || localMatrix[2][3] != 0) { + // rightHandSide is the right hand side of the equation. + Vector4 rightHandSide; + rightHandSide[0] = localMatrix[0][3]; + rightHandSide[1] = localMatrix[1][3]; + rightHandSide[2] = localMatrix[2][3]; + rightHandSide[3] = localMatrix[3][3]; + + // Solve the equation by inverting perspectiveMatrix and multiplying + // rightHandSide by the inverse. (This is the easiest way, not + // necessarily the best.) + TransformationMatrix::Matrix4 inversePerspectiveMatrix, transposedInversePerspectiveMatrix; + inverse(perspectiveMatrix, inversePerspectiveMatrix); + transposeMatrix4(inversePerspectiveMatrix, transposedInversePerspectiveMatrix); + + Vector4 perspectivePoint; + v4MulPointByMatrix(rightHandSide, transposedInversePerspectiveMatrix, perspectivePoint); + + result.perspectiveX = perspectivePoint[0]; + result.perspectiveY = perspectivePoint[1]; + result.perspectiveZ = perspectivePoint[2]; + result.perspectiveW = perspectivePoint[3]; + + // Clear the perspective partition + localMatrix[0][3] = localMatrix[1][3] = localMatrix[2][3] = 0; + localMatrix[3][3] = 1; + } else { + // No perspective. + result.perspectiveX = result.perspectiveY = result.perspectiveZ = 0; + result.perspectiveW = 1; + } + + // Next take care of translation (easy). + result.translateX = localMatrix[3][0]; + localMatrix[3][0] = 0; + result.translateY = localMatrix[3][1]; + localMatrix[3][1] = 0; + result.translateZ = localMatrix[3][2]; + localMatrix[3][2] = 0; + + // Vector4 type and functions need to be added to the common set. + Vector3 row[3], pdum3; + + // Now get scale and shear. + for (i = 0; i < 3; i++) { + row[i][0] = localMatrix[i][0]; + row[i][1] = localMatrix[i][1]; + row[i][2] = localMatrix[i][2]; + } + + // Compute X scale factor and normalize first row. + result.scaleX = v3Length(row[0]); + v3Scale(row[0], 1.0); + + // Compute XY shear factor and make 2nd row orthogonal to 1st. + result.skewXY = v3Dot(row[0], row[1]); + v3Combine(row[1], row[0], row[1], 1.0, -result.skewXY); + + // Now, compute Y scale and normalize 2nd row. + result.scaleY = v3Length(row[1]); + v3Scale(row[1], 1.0); + result.skewXY /= result.scaleY; + + // Compute XZ and YZ shears, orthogonalize 3rd row. + result.skewXZ = v3Dot(row[0], row[2]); + v3Combine(row[2], row[0], row[2], 1.0, -result.skewXZ); + result.skewYZ = v3Dot(row[1], row[2]); + v3Combine(row[2], row[1], row[2], 1.0, -result.skewYZ); + + // Next, get Z scale and normalize 3rd row. + result.scaleZ = v3Length(row[2]); + v3Scale(row[2], 1.0); + result.skewXZ /= result.scaleZ; + result.skewYZ /= result.scaleZ; + + // At this point, the matrix (in rows[]) is orthonormal. + // Check for a coordinate system flip. If the determinant + // is -1, then negate the matrix and the scaling factors. + v3Cross(row[1], row[2], pdum3); + if (v3Dot(row[0], pdum3) < 0) { + + result.scaleX *= -1; + result.scaleY *= -1; + result.scaleZ *= -1; + + for (i = 0; i < 3; i++) { + row[i][0] *= -1; + row[i][1] *= -1; + row[i][2] *= -1; + } + } + + // Now, get the rotations out, as described in the gem. + + result.rotateY = asin(-row[0][2]); + if (cos(result.rotateY) != 0) { + result.rotateX = atan2(row[1][2], row[2][2]); + result.rotateZ = atan2(row[0][1], row[0][0]); + } else { + result.rotateX = atan2(-row[2][0], row[1][1]); + result.rotateZ = 0; + } + + double s, t, x, y, z, w; + + t = row[0][0] + row[1][1] + row[2][2] + 1.0; + + if (t > 1e-4) { + s = 0.5 / sqrt(t); + w = 0.25 / s; + x = (row[2][1] - row[1][2]) * s; + y = (row[0][2] - row[2][0]) * s; + z = (row[1][0] - row[0][1]) * s; + } else if (row[0][0] > row[1][1] && row[0][0] > row[2][2]) { + s = sqrt (1.0 + row[0][0] - row[1][1] - row[2][2]) * 2.0; // S=4*qx + x = 0.25 * s; + y = (row[0][1] + row[1][0]) / s; + z = (row[0][2] + row[2][0]) / s; + w = (row[2][1] - row[1][2]) / s; + } else if (row[1][1] > row[2][2]) { + s = sqrt (1.0 + row[1][1] - row[0][0] - row[2][2]) * 2.0; // S=4*qy + x = (row[0][1] + row[1][0]) / s; + y = 0.25 * s; + z = (row[1][2] + row[2][1]) / s; + w = (row[0][2] - row[2][0]) / s; + } else { + s = sqrt(1.0 + row[2][2] - row[0][0] - row[1][1]) * 2.0; // S=4*qz + x = (row[0][2] + row[2][0]) / s; + y = (row[1][2] + row[2][1]) / s; + z = 0.25 * s; + w = (row[1][0] - row[0][1]) / s; + } + + result.quaternionX = x; + result.quaternionY = y; + result.quaternionZ = z; + result.quaternionW = w; + + return true; + } + + // Perform a spherical linear interpolation between the two + // passed quaternions with 0 <= t <= 1 + static void slerp(double qa[4], const double qb[4], double t) + { + double ax, ay, az, aw; + double bx, by, bz, bw; + double cx, cy, cz, cw; + double angle; + double th, invth, scale, invscale; + + ax = qa[0]; ay = qa[1]; az = qa[2]; aw = qa[3]; + bx = qb[0]; by = qb[1]; bz = qb[2]; bw = qb[3]; + + angle = ax * bx + ay * by + az * bz + aw * bw; + + if (angle < 0.0) { + ax = -ax; ay = -ay; + az = -az; aw = -aw; + angle = -angle; + } + + if (angle + 1.0 > .05) { + if (1.0 - angle >= .05) { + th = acos (angle); + invth = 1.0 / sin (th); + scale = sin (th * (1.0 - t)) * invth; + invscale = sin (th * t) * invth; + } else { + scale = 1.0 - t; + invscale = t; + } + } else { + bx = -ay; + by = ax; + bz = -aw; + bw = az; + scale = sin(M_PI * (.5 - t)); + invscale = sin (M_PI * t); + } + + cx = ax * scale + bx * invscale; + cy = ay * scale + by * invscale; + cz = az * scale + bz * invscale; + cw = aw * scale + bw * invscale; + + qa[0] = cx; qa[1] = cy; qa[2] = cz; qa[3] = cw; + } + + // End of Supporting Math Functions + + TransformationMatrix::TransformationMatrix(const CGAffineTransform& t) + { + setMatrix(t.a, t.b, t.c, t.d, t.tx, t.ty); + } + + TransformationMatrix::TransformationMatrix(const CATransform3D& t) + { + setMatrix( + t.m11, t.m12, t.m13, t.m14, + t.m21, t.m22, t.m23, t.m24, + t.m31, t.m32, t.m33, t.m34, + t.m41, t.m42, t.m43, t.m44); + } + + CATransform3D TransformationMatrix::transform3d() const + { + CATransform3D t; + t.m11 = narrowPrecisionToFloat(m11()); + t.m12 = narrowPrecisionToFloat(m12()); + t.m13 = narrowPrecisionToFloat(m13()); + t.m14 = narrowPrecisionToFloat(m14()); + t.m21 = narrowPrecisionToFloat(m21()); + t.m22 = narrowPrecisionToFloat(m22()); + t.m23 = narrowPrecisionToFloat(m23()); + t.m24 = narrowPrecisionToFloat(m24()); + t.m31 = narrowPrecisionToFloat(m31()); + t.m32 = narrowPrecisionToFloat(m32()); + t.m33 = narrowPrecisionToFloat(m33()); + t.m34 = narrowPrecisionToFloat(m34()); + t.m41 = narrowPrecisionToFloat(m41()); + t.m42 = narrowPrecisionToFloat(m42()); + t.m43 = narrowPrecisionToFloat(m43()); + t.m44 = narrowPrecisionToFloat(m44()); + return t; + } + + CGAffineTransform TransformationMatrix::affineTransform () const + { + CGAffineTransform t; + t.a = narrowPrecisionToFloat(m11()); + t.b = narrowPrecisionToFloat(m12()); + t.c = narrowPrecisionToFloat(m21()); + t.d = narrowPrecisionToFloat(m22()); + t.tx = narrowPrecisionToFloat(m41()); + t.ty = narrowPrecisionToFloat(m42()); + return t; + } + + TransformationMatrix::operator CATransform3D() const + { + return transform3d(); + } + + TransformationMatrix& TransformationMatrix::scale(double s) + { + return scaleNonUniform(s, s); + } + + TransformationMatrix& TransformationMatrix::rotateFromVector(double x, double y) + { + return rotate(rad2deg(atan2(y, x))); + } + + TransformationMatrix& TransformationMatrix::flipX() + { + return scaleNonUniform(-1.0, 1.0); + } + + TransformationMatrix& TransformationMatrix::flipY() + { + return scaleNonUniform(1.0, -1.0); + } + + TransformationMatrix& TransformationMatrix::scaleNonUniform(double sx, double sy) + { + m_matrix[0][0] *= sx; + m_matrix[0][1] *= sx; + m_matrix[0][2] *= sx; + m_matrix[0][3] *= sx; + + m_matrix[1][0] *= sy; + m_matrix[1][1] *= sy; + m_matrix[1][2] *= sy; + m_matrix[1][3] *= sy; + return *this; + } + + TransformationMatrix& TransformationMatrix::scale3d(double sx, double sy, double sz) + { + scaleNonUniform(sx, sy); + + m_matrix[2][0] *= sz; + m_matrix[2][1] *= sz; + m_matrix[2][2] *= sz; + m_matrix[2][3] *= sz; + return *this; + } + + TransformationMatrix& TransformationMatrix::rotate3d(double x, double y, double z, double angle) + { + // Normalize the axis of rotation + double length = sqrt(x * x + y * y + z * z); + if (length == 0) { + // A direction vector that cannot be normalized, such as [0, 0, 0], will cause the rotation to not be applied. + return *this; + } else if (length != 1) { + x /= length; + y /= length; + z /= length; + } + + // Angles are in degrees. Switch to radians. + angle = deg2rad(angle); + + double sinTheta = sin(angle); + double cosTheta = cos(angle); + + TransformationMatrix mat; + + // Optimize cases where the axis is along a major axis + if (x == 1.0 && y == 0.0 && z == 0.0) { + mat.m_matrix[0][0] = 1.0; + mat.m_matrix[0][1] = 0.0; + mat.m_matrix[0][2] = 0.0; + mat.m_matrix[1][0] = 0.0; + mat.m_matrix[1][1] = cosTheta; + mat.m_matrix[1][2] = sinTheta; + mat.m_matrix[2][0] = 0.0; + mat.m_matrix[2][1] = -sinTheta; + mat.m_matrix[2][2] = cosTheta; + mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; + mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; + mat.m_matrix[3][3] = 1.0; + } else if (x == 0.0 && y == 1.0 && z == 0.0) { + mat.m_matrix[0][0] = cosTheta; + mat.m_matrix[0][1] = 0.0; + mat.m_matrix[0][2] = -sinTheta; + mat.m_matrix[1][0] = 0.0; + mat.m_matrix[1][1] = 1.0; + mat.m_matrix[1][2] = 0.0; + mat.m_matrix[2][0] = sinTheta; + mat.m_matrix[2][1] = 0.0; + mat.m_matrix[2][2] = cosTheta; + mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; + mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; + mat.m_matrix[3][3] = 1.0; + } else if (x == 0.0 && y == 0.0 && z == 1.0) { + mat.m_matrix[0][0] = cosTheta; + mat.m_matrix[0][1] = sinTheta; + mat.m_matrix[0][2] = 0.0; + mat.m_matrix[1][0] = -sinTheta; + mat.m_matrix[1][1] = cosTheta; + mat.m_matrix[1][2] = 0.0; + mat.m_matrix[2][0] = 0.0; + mat.m_matrix[2][1] = 0.0; + mat.m_matrix[2][2] = 1.0; + mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; + mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; + mat.m_matrix[3][3] = 1.0; + } else { + // This case is the rotation about an arbitrary unit vector. + // + // Formula is adapted from Wikipedia article on Rotation matrix, + // http://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle + // + // An alternate resource with the same matrix: http://www.fastgraph.com/makegames/3drotation/ + // + double oneMinusCosTheta = 1 - cosTheta; + mat.m_matrix[0][0] = cosTheta + x * x * oneMinusCosTheta; + mat.m_matrix[0][1] = y * x * oneMinusCosTheta + z * sinTheta; + mat.m_matrix[0][2] = z * x * oneMinusCosTheta - y * sinTheta; + mat.m_matrix[1][0] = x * y * oneMinusCosTheta - z * sinTheta; + mat.m_matrix[1][1] = cosTheta + y * y * oneMinusCosTheta; + mat.m_matrix[1][2] = z * y * oneMinusCosTheta + x * sinTheta; + mat.m_matrix[2][0] = x * z * oneMinusCosTheta + y * sinTheta; + mat.m_matrix[2][1] = y * z * oneMinusCosTheta - x * sinTheta; + mat.m_matrix[2][2] = cosTheta + z * z * oneMinusCosTheta; + mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; + mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; + mat.m_matrix[3][3] = 1.0; + } + multiply(mat); + return *this; + } + + TransformationMatrix& TransformationMatrix::rotate3d(double rx, double ry, double rz) + { + // Angles are in degrees. Switch to radians. + rx = deg2rad(rx); + ry = deg2rad(ry); + rz = deg2rad(rz); + + TransformationMatrix mat; + + double sinTheta = sin(rz); + double cosTheta = cos(rz); + + mat.m_matrix[0][0] = cosTheta; + mat.m_matrix[0][1] = sinTheta; + mat.m_matrix[0][2] = 0.0; + mat.m_matrix[1][0] = -sinTheta; + mat.m_matrix[1][1] = cosTheta; + mat.m_matrix[1][2] = 0.0; + mat.m_matrix[2][0] = 0.0; + mat.m_matrix[2][1] = 0.0; + mat.m_matrix[2][2] = 1.0; + mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; + mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; + mat.m_matrix[3][3] = 1.0; + + TransformationMatrix rmat(mat); + + sinTheta = sin(ry); + cosTheta = cos(ry); + + mat.m_matrix[0][0] = cosTheta; + mat.m_matrix[0][1] = 0.0; + mat.m_matrix[0][2] = -sinTheta; + mat.m_matrix[1][0] = 0.0; + mat.m_matrix[1][1] = 1.0; + mat.m_matrix[1][2] = 0.0; + mat.m_matrix[2][0] = sinTheta; + mat.m_matrix[2][1] = 0.0; + mat.m_matrix[2][2] = cosTheta; + mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; + mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; + mat.m_matrix[3][3] = 1.0; + + rmat.multiply(mat); + + sinTheta = sin(rx); + cosTheta = cos(rx); + + mat.m_matrix[0][0] = 1.0; + mat.m_matrix[0][1] = 0.0; + mat.m_matrix[0][2] = 0.0; + mat.m_matrix[1][0] = 0.0; + mat.m_matrix[1][1] = cosTheta; + mat.m_matrix[1][2] = sinTheta; + mat.m_matrix[2][0] = 0.0; + mat.m_matrix[2][1] = -sinTheta; + mat.m_matrix[2][2] = cosTheta; + mat.m_matrix[0][3] = mat.m_matrix[1][3] = mat.m_matrix[2][3] = 0.0; + mat.m_matrix[3][0] = mat.m_matrix[3][1] = mat.m_matrix[3][2] = 0.0; + mat.m_matrix[3][3] = 1.0; + + rmat.multiply(mat); + + multiply(rmat); + return *this; + } + + TransformationMatrix& TransformationMatrix::translate(double tx, double ty) + { + m_matrix[3][0] += tx * m_matrix[0][0] + ty * m_matrix[1][0]; + m_matrix[3][1] += tx * m_matrix[0][1] + ty * m_matrix[1][1]; + m_matrix[3][2] += tx * m_matrix[0][2] + ty * m_matrix[1][2]; + m_matrix[3][3] += tx * m_matrix[0][3] + ty * m_matrix[1][3]; + return *this; + } + + TransformationMatrix& TransformationMatrix::translate3d(double tx, double ty, double tz) + { + m_matrix[3][0] += tx * m_matrix[0][0] + ty * m_matrix[1][0] + tz * m_matrix[2][0]; + m_matrix[3][1] += tx * m_matrix[0][1] + ty * m_matrix[1][1] + tz * m_matrix[2][1]; + m_matrix[3][2] += tx * m_matrix[0][2] + ty * m_matrix[1][2] + tz * m_matrix[2][2]; + m_matrix[3][3] += tx * m_matrix[0][3] + ty * m_matrix[1][3] + tz * m_matrix[2][3]; + return *this; + } + + TransformationMatrix& TransformationMatrix::translateRight(double tx, double ty) + { + if (tx != 0) { + m_matrix[0][0] += m_matrix[0][3] * tx; + m_matrix[1][0] += m_matrix[1][3] * tx; + m_matrix[2][0] += m_matrix[2][3] * tx; + m_matrix[3][0] += m_matrix[3][3] * tx; + } + + if (ty != 0) { + m_matrix[0][1] += m_matrix[0][3] * ty; + m_matrix[1][1] += m_matrix[1][3] * ty; + m_matrix[2][1] += m_matrix[2][3] * ty; + m_matrix[3][1] += m_matrix[3][3] * ty; + } + + return *this; + } + + TransformationMatrix& TransformationMatrix::translateRight3d(double tx, double ty, double tz) + { + translateRight(tx, ty); + if (tz != 0) { + m_matrix[0][2] += m_matrix[0][3] * tz; + m_matrix[1][2] += m_matrix[1][3] * tz; + m_matrix[2][2] += m_matrix[2][3] * tz; + m_matrix[3][2] += m_matrix[3][3] * tz; + } + + return *this; + } + + TransformationMatrix& TransformationMatrix::skew(double sx, double sy) + { + // angles are in degrees. Switch to radians + sx = deg2rad(sx); + sy = deg2rad(sy); + + TransformationMatrix mat; + mat.m_matrix[0][1] = tan(sy); // note that the y shear goes in the first row + mat.m_matrix[1][0] = tan(sx); // and the x shear in the second row + + multiply(mat); + return *this; + } + + TransformationMatrix& TransformationMatrix::applyPerspective(double p) + { + TransformationMatrix mat; + if (p != 0) + mat.m_matrix[2][3] = -1/p; + + multiply(mat); + return *this; + } + + // this = mat * this. + TransformationMatrix& TransformationMatrix::multiply(const TransformationMatrix& mat) + { + Matrix4 tmp; + + tmp[0][0] = (mat.m_matrix[0][0] * m_matrix[0][0] + mat.m_matrix[0][1] * m_matrix[1][0] + + mat.m_matrix[0][2] * m_matrix[2][0] + mat.m_matrix[0][3] * m_matrix[3][0]); + tmp[0][1] = (mat.m_matrix[0][0] * m_matrix[0][1] + mat.m_matrix[0][1] * m_matrix[1][1] + + mat.m_matrix[0][2] * m_matrix[2][1] + mat.m_matrix[0][3] * m_matrix[3][1]); + tmp[0][2] = (mat.m_matrix[0][0] * m_matrix[0][2] + mat.m_matrix[0][1] * m_matrix[1][2] + + mat.m_matrix[0][2] * m_matrix[2][2] + mat.m_matrix[0][3] * m_matrix[3][2]); + tmp[0][3] = (mat.m_matrix[0][0] * m_matrix[0][3] + mat.m_matrix[0][1] * m_matrix[1][3] + + mat.m_matrix[0][2] * m_matrix[2][3] + mat.m_matrix[0][3] * m_matrix[3][3]); + + tmp[1][0] = (mat.m_matrix[1][0] * m_matrix[0][0] + mat.m_matrix[1][1] * m_matrix[1][0] + + mat.m_matrix[1][2] * m_matrix[2][0] + mat.m_matrix[1][3] * m_matrix[3][0]); + tmp[1][1] = (mat.m_matrix[1][0] * m_matrix[0][1] + mat.m_matrix[1][1] * m_matrix[1][1] + + mat.m_matrix[1][2] * m_matrix[2][1] + mat.m_matrix[1][3] * m_matrix[3][1]); + tmp[1][2] = (mat.m_matrix[1][0] * m_matrix[0][2] + mat.m_matrix[1][1] * m_matrix[1][2] + + mat.m_matrix[1][2] * m_matrix[2][2] + mat.m_matrix[1][3] * m_matrix[3][2]); + tmp[1][3] = (mat.m_matrix[1][0] * m_matrix[0][3] + mat.m_matrix[1][1] * m_matrix[1][3] + + mat.m_matrix[1][2] * m_matrix[2][3] + mat.m_matrix[1][3] * m_matrix[3][3]); + + tmp[2][0] = (mat.m_matrix[2][0] * m_matrix[0][0] + mat.m_matrix[2][1] * m_matrix[1][0] + + mat.m_matrix[2][2] * m_matrix[2][0] + mat.m_matrix[2][3] * m_matrix[3][0]); + tmp[2][1] = (mat.m_matrix[2][0] * m_matrix[0][1] + mat.m_matrix[2][1] * m_matrix[1][1] + + mat.m_matrix[2][2] * m_matrix[2][1] + mat.m_matrix[2][3] * m_matrix[3][1]); + tmp[2][2] = (mat.m_matrix[2][0] * m_matrix[0][2] + mat.m_matrix[2][1] * m_matrix[1][2] + + mat.m_matrix[2][2] * m_matrix[2][2] + mat.m_matrix[2][3] * m_matrix[3][2]); + tmp[2][3] = (mat.m_matrix[2][0] * m_matrix[0][3] + mat.m_matrix[2][1] * m_matrix[1][3] + + mat.m_matrix[2][2] * m_matrix[2][3] + mat.m_matrix[2][3] * m_matrix[3][3]); + + tmp[3][0] = (mat.m_matrix[3][0] * m_matrix[0][0] + mat.m_matrix[3][1] * m_matrix[1][0] + + mat.m_matrix[3][2] * m_matrix[2][0] + mat.m_matrix[3][3] * m_matrix[3][0]); + tmp[3][1] = (mat.m_matrix[3][0] * m_matrix[0][1] + mat.m_matrix[3][1] * m_matrix[1][1] + + mat.m_matrix[3][2] * m_matrix[2][1] + mat.m_matrix[3][3] * m_matrix[3][1]); + tmp[3][2] = (mat.m_matrix[3][0] * m_matrix[0][2] + mat.m_matrix[3][1] * m_matrix[1][2] + + mat.m_matrix[3][2] * m_matrix[2][2] + mat.m_matrix[3][3] * m_matrix[3][2]); + tmp[3][3] = (mat.m_matrix[3][0] * m_matrix[0][3] + mat.m_matrix[3][1] * m_matrix[1][3] + + mat.m_matrix[3][2] * m_matrix[2][3] + mat.m_matrix[3][3] * m_matrix[3][3]); + + setMatrix(tmp); + return *this; + } + + void TransformationMatrix::multVecMatrix(double x, double y, double& resultX, double& resultY) const + { + resultX = m_matrix[3][0] + x * m_matrix[0][0] + y * m_matrix[1][0]; + resultY = m_matrix[3][1] + x * m_matrix[0][1] + y * m_matrix[1][1]; + double w = m_matrix[3][3] + x * m_matrix[0][3] + y * m_matrix[1][3]; + if (w != 1 && w != 0) { + resultX /= w; + resultY /= w; + } + } + + void TransformationMatrix::multVecMatrix(double x, double y, double z, double& resultX, double& resultY, double& resultZ) const + { + resultX = m_matrix[3][0] + x * m_matrix[0][0] + y * m_matrix[1][0] + z * m_matrix[2][0]; + resultY = m_matrix[3][1] + x * m_matrix[0][1] + y * m_matrix[1][1] + z * m_matrix[2][1]; + resultZ = m_matrix[3][2] + x * m_matrix[0][2] + y * m_matrix[1][2] + z * m_matrix[2][2]; + double w = m_matrix[3][3] + x * m_matrix[0][3] + y * m_matrix[1][3] + z * m_matrix[2][3]; + if (w != 1 && w != 0) { + resultX /= w; + resultY /= w; + resultZ /= w; + } + } + + bool TransformationMatrix::isInvertible() const + { + if (isIdentityOrTranslation()) + return true; + + double det = WebCore::determinant4x4(m_matrix); + + if (fabs(det) < SMALL_NUMBER) + return false; + + return true; + } + + TransformationMatrix TransformationMatrix::inverse() const + { + if (isIdentityOrTranslation()) { + // identity matrix + if (m_matrix[3][0] == 0 && m_matrix[3][1] == 0 && m_matrix[3][2] == 0) + return TransformationMatrix(); + + // translation + return TransformationMatrix(1, 0, 0, 0, + 0, 1, 0, 0, + 0, 0, 1, 0, + -m_matrix[3][0], -m_matrix[3][1], -m_matrix[3][2], 1); + } + + TransformationMatrix invMat; + bool inverted = WebCore::inverse(m_matrix, invMat.m_matrix); + if (!inverted) + return TransformationMatrix(); + + return invMat; + } + + void TransformationMatrix::makeAffine() + { + m_matrix[0][2] = 0; + m_matrix[0][3] = 0; + + m_matrix[1][2] = 0; + m_matrix[1][3] = 0; + + m_matrix[2][0] = 0; + m_matrix[2][1] = 0; + m_matrix[2][2] = 1; + m_matrix[2][3] = 0; + + m_matrix[3][2] = 0; + m_matrix[3][3] = 1; + } + + static inline void blendFloat(double& from, double to, double progress) + { + if (from != to) + from = from + (to - from) * progress; + } + + void TransformationMatrix::blend(const TransformationMatrix& from, double progress) + { + if (from.isIdentity() && isIdentity()) + return; + + // decompose + DecomposedType fromDecomp; + DecomposedType toDecomp; + from.decompose(fromDecomp); + decompose(toDecomp); + + // interpolate + blendFloat(fromDecomp.scaleX, toDecomp.scaleX, progress); + blendFloat(fromDecomp.scaleY, toDecomp.scaleY, progress); + blendFloat(fromDecomp.scaleZ, toDecomp.scaleZ, progress); + blendFloat(fromDecomp.skewXY, toDecomp.skewXY, progress); + blendFloat(fromDecomp.skewXZ, toDecomp.skewXZ, progress); + blendFloat(fromDecomp.skewYZ, toDecomp.skewYZ, progress); + blendFloat(fromDecomp.translateX, toDecomp.translateX, progress); + blendFloat(fromDecomp.translateY, toDecomp.translateY, progress); + blendFloat(fromDecomp.translateZ, toDecomp.translateZ, progress); + blendFloat(fromDecomp.perspectiveX, toDecomp.perspectiveX, progress); + blendFloat(fromDecomp.perspectiveY, toDecomp.perspectiveY, progress); + blendFloat(fromDecomp.perspectiveZ, toDecomp.perspectiveZ, progress); + blendFloat(fromDecomp.perspectiveW, toDecomp.perspectiveW, progress); + + slerp(&fromDecomp.quaternionX, &toDecomp.quaternionX, progress); + + // recompose + recompose(fromDecomp); + } + + bool TransformationMatrix::decompose(DecomposedType& decomp) const + { + if (isIdentity()) { + memset(&decomp, 0, sizeof(decomp)); + decomp.perspectiveW = 1; + decomp.scaleX = 1; + decomp.scaleY = 1; + decomp.scaleZ = 1; + } + + if (!WebCore::decompose(m_matrix, decomp)) + return false; + return true; + } + + void TransformationMatrix::recompose(const DecomposedType& decomp, bool useEulerAngle) + { + makeIdentity(); + + // first apply perspective + m_matrix[0][3] = decomp.perspectiveX; + m_matrix[1][3] = decomp.perspectiveY; + m_matrix[2][3] = decomp.perspectiveZ; + m_matrix[3][3] = decomp.perspectiveW; + + // now translate + translate3d(decomp.translateX, decomp.translateY, decomp.translateZ); + + if (!useEulerAngle) { + // apply rotation + double xx = decomp.quaternionX * decomp.quaternionX; + double xy = decomp.quaternionX * decomp.quaternionY; + double xz = decomp.quaternionX * decomp.quaternionZ; + double xw = decomp.quaternionX * decomp.quaternionW; + double yy = decomp.quaternionY * decomp.quaternionY; + double yz = decomp.quaternionY * decomp.quaternionZ; + double yw = decomp.quaternionY * decomp.quaternionW; + double zz = decomp.quaternionZ * decomp.quaternionZ; + double zw = decomp.quaternionZ * decomp.quaternionW; + + // Construct a composite rotation matrix from the quaternion values + TransformationMatrix rotationMatrix(1 - 2 * (yy + zz), 2 * (xy - zw), 2 * (xz + yw), 0, + 2 * (xy + zw), 1 - 2 * (xx + zz), 2 * (yz - xw), 0, + 2 * (xz - yw), 2 * (yz + xw), 1 - 2 * (xx + yy), 0, + 0, 0, 0, 1); + + multiply(rotationMatrix); + } else { + rotate3d(1.0, 0.0, 0.0, rad2deg(decomp.rotateX)); + rotate3d(0.0, 1.0, 0.0, rad2deg(decomp.rotateY)); + rotate3d(0.0, 0.0, 1.0, rad2deg(decomp.rotateZ)); + } + + // now apply skew + if (decomp.skewYZ) { + TransformationMatrix tmp; + tmp.setM32(decomp.skewYZ); + multiply(tmp); + } + + if (decomp.skewXZ) { + TransformationMatrix tmp; + tmp.setM31(decomp.skewXZ); + multiply(tmp); + } + + if (decomp.skewXY) { + TransformationMatrix tmp; + tmp.setM21(decomp.skewXY); + multiply(tmp); + } + + // finally, apply scale + scale3d(decomp.scaleX, decomp.scaleY, decomp.scaleZ); + } +} \ No newline at end of file diff --git a/Demo/Pods/pop/pop/WebCore/TransformationMatrix.h b/Demo/Pods/pop/pop/WebCore/TransformationMatrix.h new file mode 100644 index 0000000..9dad2e9 --- /dev/null +++ b/Demo/Pods/pop/pop/WebCore/TransformationMatrix.h @@ -0,0 +1,277 @@ +/* + * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef TransformationMatrix_h +#define TransformationMatrix_h + +#include //for memcpy +#include +#include + +namespace WebCore { + + class TransformationMatrix { + public: + + typedef double Matrix4[4][4]; + + TransformationMatrix() { makeIdentity(); } + TransformationMatrix(const TransformationMatrix& t) { *this = t; } + TransformationMatrix(double a, double b, double c, double d, double e, double f) { setMatrix(a, b, c, d, e, f); } + TransformationMatrix(double m11, double m12, double m13, double m14, + double m21, double m22, double m23, double m24, + double m31, double m32, double m33, double m34, + double m41, double m42, double m43, double m44) + { + setMatrix(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44); + } + + void setMatrix(double a, double b, double c, double d, double e, double f) + { + m_matrix[0][0] = a; m_matrix[0][1] = b; m_matrix[0][2] = 0; m_matrix[0][3] = 0; + m_matrix[1][0] = c; m_matrix[1][1] = d; m_matrix[1][2] = 0; m_matrix[1][3] = 0; + m_matrix[2][0] = 0; m_matrix[2][1] = 0; m_matrix[2][2] = 1; m_matrix[2][3] = 0; + m_matrix[3][0] = e; m_matrix[3][1] = f; m_matrix[3][2] = 0; m_matrix[3][3] = 1; + } + + void setMatrix(double m11, double m12, double m13, double m14, + double m21, double m22, double m23, double m24, + double m31, double m32, double m33, double m34, + double m41, double m42, double m43, double m44) + { + m_matrix[0][0] = m11; m_matrix[0][1] = m12; m_matrix[0][2] = m13; m_matrix[0][3] = m14; + m_matrix[1][0] = m21; m_matrix[1][1] = m22; m_matrix[1][2] = m23; m_matrix[1][3] = m24; + m_matrix[2][0] = m31; m_matrix[2][1] = m32; m_matrix[2][2] = m33; m_matrix[2][3] = m34; + m_matrix[3][0] = m41; m_matrix[3][1] = m42; m_matrix[3][2] = m43; m_matrix[3][3] = m44; + } + + TransformationMatrix& operator =(const TransformationMatrix &t) + { + setMatrix(t.m_matrix); + return *this; + } + + TransformationMatrix& makeIdentity() + { + setMatrix(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + return *this; + } + + bool isIdentity() const + { + return m_matrix[0][0] == 1 && m_matrix[0][1] == 0 && m_matrix[0][2] == 0 && m_matrix[0][3] == 0 && + m_matrix[1][0] == 0 && m_matrix[1][1] == 1 && m_matrix[1][2] == 0 && m_matrix[1][3] == 0 && + m_matrix[2][0] == 0 && m_matrix[2][1] == 0 && m_matrix[2][2] == 1 && m_matrix[2][3] == 0 && + m_matrix[3][0] == 0 && m_matrix[3][1] == 0 && m_matrix[3][2] == 0 && m_matrix[3][3] == 1; + } + + // This form preserves the double math from input to output + void map(double x, double y, double& x2, double& y2) const { multVecMatrix(x, y, x2, y2); } + + double m11() const { return m_matrix[0][0]; } + void setM11(double f) { m_matrix[0][0] = f; } + double m12() const { return m_matrix[0][1]; } + void setM12(double f) { m_matrix[0][1] = f; } + double m13() const { return m_matrix[0][2]; } + void setM13(double f) { m_matrix[0][2] = f; } + double m14() const { return m_matrix[0][3]; } + void setM14(double f) { m_matrix[0][3] = f; } + double m21() const { return m_matrix[1][0]; } + void setM21(double f) { m_matrix[1][0] = f; } + double m22() const { return m_matrix[1][1]; } + void setM22(double f) { m_matrix[1][1] = f; } + double m23() const { return m_matrix[1][2]; } + void setM23(double f) { m_matrix[1][2] = f; } + double m24() const { return m_matrix[1][3]; } + void setM24(double f) { m_matrix[1][3] = f; } + double m31() const { return m_matrix[2][0]; } + void setM31(double f) { m_matrix[2][0] = f; } + double m32() const { return m_matrix[2][1]; } + void setM32(double f) { m_matrix[2][1] = f; } + double m33() const { return m_matrix[2][2]; } + void setM33(double f) { m_matrix[2][2] = f; } + double m34() const { return m_matrix[2][3]; } + void setM34(double f) { m_matrix[2][3] = f; } + double m41() const { return m_matrix[3][0]; } + void setM41(double f) { m_matrix[3][0] = f; } + double m42() const { return m_matrix[3][1]; } + void setM42(double f) { m_matrix[3][1] = f; } + double m43() const { return m_matrix[3][2]; } + void setM43(double f) { m_matrix[3][2] = f; } + double m44() const { return m_matrix[3][3]; } + void setM44(double f) { m_matrix[3][3] = f; } + + double a() const { return m_matrix[0][0]; } + void setA(double a) { m_matrix[0][0] = a; } + + double b() const { return m_matrix[0][1]; } + void setB(double b) { m_matrix[0][1] = b; } + + double c() const { return m_matrix[1][0]; } + void setC(double c) { m_matrix[1][0] = c; } + + double d() const { return m_matrix[1][1]; } + void setD(double d) { m_matrix[1][1] = d; } + + double e() const { return m_matrix[3][0]; } + void setE(double e) { m_matrix[3][0] = e; } + + double f() const { return m_matrix[3][1]; } + void setF(double f) { m_matrix[3][1] = f; } + + // this = this * mat + TransformationMatrix& multiply(const TransformationMatrix&); + + TransformationMatrix& scale(double); + TransformationMatrix& scaleNonUniform(double sx, double sy); + TransformationMatrix& scale3d(double sx, double sy, double sz); + + TransformationMatrix& rotate(double d) { return rotate3d(0, 0, d); } + TransformationMatrix& rotateFromVector(double x, double y); + TransformationMatrix& rotate3d(double rx, double ry, double rz); + + // The vector (x,y,z) is normalized if it's not already. A vector of + // (0,0,0) uses a vector of (0,0,1). + TransformationMatrix& rotate3d(double x, double y, double z, double angle); + + TransformationMatrix& translate(double tx, double ty); + TransformationMatrix& translate3d(double tx, double ty, double tz); + + // translation added with a post-multiply + TransformationMatrix& translateRight(double tx, double ty); + TransformationMatrix& translateRight3d(double tx, double ty, double tz); + + TransformationMatrix& flipX(); + TransformationMatrix& flipY(); + TransformationMatrix& skew(double angleX, double angleY); + TransformationMatrix& skewX(double angle) { return skew(angle, 0); } + TransformationMatrix& skewY(double angle) { return skew(0, angle); } + + TransformationMatrix& applyPerspective(double p); + bool hasPerspective() const { return m_matrix[2][3] != 0.0f; } + + bool isInvertible() const; + + // This method returns the identity matrix if it is not invertible. + // Use isInvertible() before calling this if you need to know. + TransformationMatrix inverse() const; + + // decompose the matrix into its component parts + typedef struct { + double scaleX, scaleY, scaleZ; + double skewXY, skewXZ, skewYZ; + double rotateX, rotateY, rotateZ; + double quaternionX, quaternionY, quaternionZ, quaternionW; + double translateX, translateY, translateZ; + double perspectiveX, perspectiveY, perspectiveZ, perspectiveW; + } DecomposedType; + + bool decompose(DecomposedType& decomp) const; + void recompose(const DecomposedType& decomp, bool useEulerAngle = false); + + void blend(const TransformationMatrix& from, double progress); + + bool isAffine() const + { + return (m13() == 0 && m14() == 0 && m23() == 0 && m24() == 0 && + m31() == 0 && m32() == 0 && m33() == 1 && m34() == 0 && m43() == 0 && m44() == 1); + } + + // Throw away the non-affine parts of the matrix (lossy!) + void makeAffine(); + + bool operator==(const TransformationMatrix& m2) const + { + return (m_matrix[0][0] == m2.m_matrix[0][0] && + m_matrix[0][1] == m2.m_matrix[0][1] && + m_matrix[0][2] == m2.m_matrix[0][2] && + m_matrix[0][3] == m2.m_matrix[0][3] && + m_matrix[1][0] == m2.m_matrix[1][0] && + m_matrix[1][1] == m2.m_matrix[1][1] && + m_matrix[1][2] == m2.m_matrix[1][2] && + m_matrix[1][3] == m2.m_matrix[1][3] && + m_matrix[2][0] == m2.m_matrix[2][0] && + m_matrix[2][1] == m2.m_matrix[2][1] && + m_matrix[2][2] == m2.m_matrix[2][2] && + m_matrix[2][3] == m2.m_matrix[2][3] && + m_matrix[3][0] == m2.m_matrix[3][0] && + m_matrix[3][1] == m2.m_matrix[3][1] && + m_matrix[3][2] == m2.m_matrix[3][2] && + m_matrix[3][3] == m2.m_matrix[3][3]); + } + + bool operator!=(const TransformationMatrix& other) const { return !(*this == other); } + + // *this = *this * t (i.e., a multRight) + TransformationMatrix& operator*=(const TransformationMatrix& t) + { + return multiply(t); + } + + // result = *this * t (i.e., a multRight) + TransformationMatrix operator*(const TransformationMatrix& t) + { + TransformationMatrix result = *this; + result.multiply(t); + return result; + } + + CATransform3D transform3d () const; + CGAffineTransform affineTransform () const; + + TransformationMatrix(const CATransform3D&); + operator CATransform3D() const; + + TransformationMatrix(const CGAffineTransform&); + operator CGAffineTransform() const; + + private: + + // multiply passed 2D point by matrix (assume z=0) + void multVecMatrix(double x, double y, double& dstX, double& dstY) const; + + // multiply passed 3D point by matrix + void multVecMatrix(double x, double y, double z, double& dstX, double& dstY, double& dstZ) const; + + void setMatrix(const Matrix4 m) + { + if (m && m != m_matrix) + memcpy(m_matrix, m, sizeof(Matrix4)); + } + + bool isIdentityOrTranslation() const + { + return m_matrix[0][0] == 1 && m_matrix[0][1] == 0 && m_matrix[0][2] == 0 && m_matrix[0][3] == 0 && + m_matrix[1][0] == 0 && m_matrix[1][1] == 1 && m_matrix[1][2] == 0 && m_matrix[1][3] == 0 && + m_matrix[2][0] == 0 && m_matrix[2][1] == 0 && m_matrix[2][2] == 1 && m_matrix[2][3] == 0 && + m_matrix[3][3] == 1; + } + + Matrix4 m_matrix; + }; + +} // namespace WebCore + +#endif // TransformationMatrix_h diff --git a/Demo/Pods/pop/pop/WebCore/UnitBezier.h b/Demo/Pods/pop/pop/WebCore/UnitBezier.h new file mode 100644 index 0000000..0f847a0 --- /dev/null +++ b/Demo/Pods/pop/pop/WebCore/UnitBezier.h @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2008 Apple Inc. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef UnitBezier_h +#define UnitBezier_h + +#include + +namespace WebCore { + + struct UnitBezier { + UnitBezier(double p1x, double p1y, double p2x, double p2y) + { + // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1). + cx = 3.0 * p1x; + bx = 3.0 * (p2x - p1x) - cx; + ax = 1.0 - cx -bx; + + cy = 3.0 * p1y; + by = 3.0 * (p2y - p1y) - cy; + ay = 1.0 - cy - by; + } + + double sampleCurveX(double t) + { + // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule. + return ((ax * t + bx) * t + cx) * t; + } + + double sampleCurveY(double t) + { + return ((ay * t + by) * t + cy) * t; + } + + double sampleCurveDerivativeX(double t) + { + return (3.0 * ax * t + 2.0 * bx) * t + cx; + } + + // Given an x value, find a parametric value it came from. + double solveCurveX(double x, double epsilon) + { + double t0; + double t1; + double t2; + double x2; + double d2; + int i; + + // First try a few iterations of Newton's method -- normally very fast. + for (t2 = x, i = 0; i < 8; i++) { + x2 = sampleCurveX(t2) - x; + if (fabs (x2) < epsilon) + return t2; + d2 = sampleCurveDerivativeX(t2); + if (fabs(d2) < 1e-6) + break; + t2 = t2 - x2 / d2; + } + + // Fall back to the bisection method for reliability. + t0 = 0.0; + t1 = 1.0; + t2 = x; + + if (t2 < t0) + return t0; + if (t2 > t1) + return t1; + + while (t0 < t1) { + x2 = sampleCurveX(t2); + if (fabs(x2 - x) < epsilon) + return t2; + if (x > x2) + t0 = t2; + else + t1 = t2; + t2 = (t1 - t0) * .5 + t0; + } + + // Failure. + return t2; + } + + double solve(double x, double epsilon) + { + return sampleCurveY(solveCurveX(x, epsilon)); + } + + private: + double ax; + double bx; + double cx; + + double ay; + double by; + double cy; + }; +} +#endif