diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..8e45d030f --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.pbxproj merge=union diff --git a/documentation/Coding Style.markdown b/.github/CONTRIBUTING.md similarity index 100% rename from documentation/Coding Style.markdown rename to .github/CONTRIBUTING.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..4e7381cd7 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,6 @@ +Please consider the following issues before submitting a pull request: + +-[] Support all platforms (Mac, iOS, and tvOS) +-[] Pass Travis build validation +-[] Include unit tests where appropriate +-[] If adding a new feature, consider including a demo in the *Plot Gallery* example app \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 067d42d10..1df945ce3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,28 @@ language: objective-c +osx_image: xcode11 -env: +ios_env: SDK:iphonesimulator SDK:iphoneos +tvos_env: + TVSDK:appletvsimulator + TVSDK:appletvos + # Framework builds -script: xcodebuild -project framework/CorePlot.xcodeproj -target CorePlot -configuration Release -script: xcodebuild -project framework/CorePlot-CocoaTouch.xcodeproj -target CorePlot-CocoaTouch -sdk ${SDK} -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "CorePlot Mac" -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "CorePlot iOS" -sdk ${SDK} -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "CorePlot tvOS" -sdk ${TVSDK} -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "CorePlot-CocoaTouch" -sdk ${SDK} -configuration Release # Unit tests -script: xcodebuild -project framework/CorePlot.xcodeproj -target UnitTests -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "UnitTests Mac" -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "UnitTests iOS" -sdk ${SDK} -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "UnitTests tvOS" -sdk ${TVSDK} -configuration Release +script: xcodebuild -project framework/CorePlot.xcodeproj -target "CorePlot-CocoaTouchTests" -sdk ${SDK} -configuration Release # Mac examples -script: xcodebuild -project examples/CorePlotGallery/Plot_Gallery_Mac.xcodeproj -target "Plot Gallery-Mac" -configuration Release +script: xcodebuild -project examples/CorePlotGallery/Plot_Gallery.xcodeproj -target "Plot Gallery-Mac" -configuration Release script: xcodebuild -project examples/CPTTestApp/CPTTestApp.xcodeproj -target CPTTestApp -configuration Release script: xcodebuild -project examples/DatePlot/DatePlot.xcodeproj -target DatePlot -configuration Release script: xcodebuild -project examples/DropPlot/DropPlot.xcodeproj -target DropPlot -configuration Release @@ -20,12 +30,15 @@ script: xcodebuild -project examples/MinorTickLabels/minorTickFormatter.xcodepro script: xcodebuild -project examples/RangePlot/RangePlot.xcodeproj -target RangePlot -configuration Release # iOS examples -script: xcodebuild -project examples/CorePlotGallery/Plot_Gallery_iOS.xcodeproj -target "Plot Gallery-iOS" -sdk ${SDK} -configuration Release +script: xcodebuild -project examples/CorePlotGallery/Plot_Gallery.xcodeproj -target "Plot Gallery-iOS" -sdk ${SDK} -configuration Release script: xcodebuild -project examples/AAPLot/AAPLot.xcodeproj -target AAPLot -sdk ${SDK} -configuration Release script: xcodebuild -project examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj -target CPTTestApp-iPad -sdk ${SDK} -configuration Release script: xcodebuild -project examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj -target CPTTestApp-iPhone -sdk ${SDK} -configuration Release script: xcodebuild -project examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone.xcodeproj -CPTTestApp-iPhone AAPLot -sdk ${SDK} -configuration Release script: xcodebuild -project examples/StockPlot/StockPlot.xcodeproj -target StockPlot -sdk ${SDK} -configuration Release +# tvOS examples +script: xcodebuild -project examples/CorePlotGallery/Plot_Gallery.xcodeproj -target "Plot Gallery-tvOS" -sdk ${TVSDK} -configuration Release + # Quartz Composer plugin script: xcodebuild -project QCPlugin/CorePlotQCPlugin.xcodeproj -target CorePlotQCPlugin -configuration Release diff --git a/CorePlot-latest.podspec b/CorePlot-latest.podspec index c92026a5b..3b958f7e4 100644 --- a/CorePlot-latest.podspec +++ b/CorePlot-latest.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |s| s.name = 'CorePlot' s.version = '99.99.99' s.license = 'BSD' - s.summary = 'Cocoa plotting framework for Mac OS X and iOS.' + s.summary = 'Cocoa plotting framework for macOS, iOS, and tvOS.' s.homepage = 'https://github.com/core-plot' s.social_media_url = 'https://twitter.com/CorePlot' s.documentation_url = 'http://core-plot.github.io' @@ -14,26 +14,32 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/core-plot/core-plot.git' } - s.description = 'Core Plot is a plotting framework for OS X and iOS. It provides 2D visualization ' \ + s.description = 'Core Plot is a plotting framework for macOS, iOS, and tvOS. It provides 2D visualization ' \ 'of data, and is tightly integrated with Apple technologies like Core Animation, ' \ 'Core Data, and Cocoa Bindings.' - s.ios.deployment_target = '5.0' - s.osx.deployment_target = '10.7' + s.ios.deployment_target = '8.0' + s.osx.deployment_target = '10.8' + s.tvos.deployment_target = '9.0' s.ios.header_dir = 'ios' s.osx.header_dir = 'osx' + s.tvos.header_dir = 'tvos' - s.source_files = 'framework/Source/*.{h,m}', 'framework/CocoaPods/*.h', 'framework/TestResources/CorePlotProbes.d' + s.source_files = 'framework/Source/*.{h,m}', 'framework/CocoaPods/*.h' s.exclude_files = '**/*{TestCase,Tests}.{h,m}', '**/mainpage.h' s.ios.source_files = 'framework/CorePlot-CocoaTouch.h', 'framework/iPhoneOnly/*.{h,m}' + s.tvos.source_files = 'framework/iPhoneOnly/*.{h,m}' s.osx.source_files = 'framework/MacOnly/*.{h,m}' - s.private_header_files = '**/_*.h', '**/CorePlotProbes.h' + s.private_header_files = '**/_*.h' - s.requires_arc = true - s.xcconfig = { 'ALWAYS_SEARCH_USER_PATHS' => 'YES' } + s.requires_arc = true + s.ios.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/ios"' } + s.osx.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/osx"' } + s.tvos.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/tvos"' } - s.frameworks = 'QuartzCore', 'Accelerate' + s.frameworks = 'QuartzCore' s.ios.frameworks = 'UIKit', 'Foundation' + s.tvos.frameworks = 'UIKit', 'Foundation' s.osx.frameworks = 'Cocoa' end \ No newline at end of file diff --git a/CorePlot.podspec b/CorePlot.podspec index 3945d1b05..d6906a089 100644 --- a/CorePlot.podspec +++ b/CorePlot.podspec @@ -1,8 +1,8 @@ Pod::Spec.new do |s| s.name = 'CorePlot' - s.version = '1.6' + s.version = '2.3' s.license = 'BSD' - s.summary = 'Cocoa plotting framework for Mac OS X and iOS.' + s.summary = 'Cocoa plotting framework for macOS, iOS, and tvOS.' s.homepage = 'https://github.com/core-plot' s.social_media_url = 'https://twitter.com/CorePlot' s.documentation_url = 'http://core-plot.github.io' @@ -12,28 +12,34 @@ Pod::Spec.new do |s| 'Eric Skroch' => 'eskroch@mac.com', 'Barry Wark' => 'barrywark@gmail.com' } - s.source = { :git => 'https://github.com/core-plot/core-plot.git', :tag => 'release_1.6'} + s.source = { :git => 'https://github.com/core-plot/core-plot.git', :tag => 'release_2.3'} - s.description = 'Core Plot is a plotting framework for OS X and iOS. It provides 2D visualization ' \ + s.description = 'Core Plot is a plotting framework for macOS, iOS, and tvOS. It provides 2D visualization ' \ 'of data, and is tightly integrated with Apple technologies like Core Animation, ' \ 'Core Data, and Cocoa Bindings.' - s.ios.deployment_target = '5.0' - s.osx.deployment_target = '10.7' + s.ios.deployment_target = '8.0' + s.osx.deployment_target = '10.8' + s.tvos.deployment_target = '9.0' s.ios.header_dir = 'ios' s.osx.header_dir = 'osx' + s.tvos.header_dir = 'tvos' - s.source_files = 'framework/Source/*.{h,m}', 'framework/CocoaPods/*.h', 'framework/TestResources/CorePlotProbes.d' + s.source_files = 'framework/Source/*.{h,m}', 'framework/CocoaPods/*.h' s.exclude_files = '**/*{TestCase,Tests}.{h,m}', '**/mainpage.h' s.ios.source_files = 'framework/CorePlot-CocoaTouch.h', 'framework/iPhoneOnly/*.{h,m}' + s.tvos.source_files = 'framework/iPhoneOnly/*.{h,m}' s.osx.source_files = 'framework/MacOnly/*.{h,m}' - s.private_header_files = '**/_*.h', '**/CorePlotProbes.h' + s.private_header_files = '**/_*.h' - s.requires_arc = true - s.xcconfig = { 'ALWAYS_SEARCH_USER_PATHS' => 'YES' } + s.requires_arc = true + s.ios.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/ios"' } + s.osx.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/osx"' } + s.tvos.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PODS_ROOT}/Headers/Private/CorePlot/tvos"' } - s.frameworks = 'QuartzCore', 'Accelerate' + s.frameworks = 'QuartzCore' s.ios.frameworks = 'UIKit', 'Foundation' + s.tvos.frameworks = 'UIKit', 'Foundation' s.osx.frameworks = 'Cocoa' end \ No newline at end of file diff --git a/License.txt b/License.txt index 3706aaebe..fbd7853fe 100644 --- a/License.txt +++ b/License.txt @@ -1,9 +1,13 @@ -Copyright (c) 2014, Drew McCormack, Brad Larson, Eric Skroch, Barry Wark, Dirkjan Krijnders, Rick Maddy, Vijay Kalusani, Caleb Cannon, Jeff Buck, Thomas Elstner, Jeroen Leenarts, Craig Hockenberry, Hartwig Wiesmann, Koen van der Drift, Nino Ag, Mike Lischke, Trevor Harmon, Travis Fischer, Graham Mueller, Rafał Wójcik, Mike Rossetti, Michael Merickel, Ingmar Stein, and Victor Martin Garcia. +Copyright (c) 2020, Drew McCormack, Brad Larson, Eric Skroch, Barry Wark, Dirkjan Krijnders, Rick Maddy, Vijay Kalusani, Caleb Cannon, Jeff Buck, Thomas Elstner, Jeroen Leenarts, Craig Hockenberry, Hartwig Wiesmann, Koen van der Drift, Nino Ag, Mike Lischke, Trevor Harmon, Travis Fischer, Graham Mueller, Rafał Wójcik, Mike Rossetti, Michael Merickel, Lane Roathe, Ingmar Stein, Sean Holbert, Victor Martin Garcia, Jérôme Morissard, Demitri Muna, Tim Monzures, Kirill Yakimovich, Tom Izaks, Pascal Freiburghaus, Fred Potter, and Aurélien Hugelé. + 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 of the Core Plot Project 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/QCPlugin/Info.plist b/QCPlugin/Base.lproj/Info.plist similarity index 100% rename from QCPlugin/Info.plist rename to QCPlugin/Base.lproj/Info.plist diff --git a/QCPlugin/Base.lproj/Settings.xib b/QCPlugin/Base.lproj/Settings.xib new file mode 100644 index 000000000..fa3c596e5 --- /dev/null +++ b/QCPlugin/Base.lproj/Settings.xib @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QCPlugin/CPTBarPlotPlugin.h b/QCPlugin/CPTBarPlotPlugin.h index e8ecf371d..e5fbb2bce 100644 --- a/QCPlugin/CPTBarPlotPlugin.h +++ b/QCPlugin/CPTBarPlotPlugin.h @@ -1,4 +1,4 @@ -#import "CorePlotQCPlugIn.h" +#import "CorePlotQCPlugin.h" #import @interface CPTBarPlotPlugIn : CorePlotQCPlugIn diff --git a/QCPlugin/CPTBarPlotPlugin.m b/QCPlugin/CPTBarPlotPlugin.m index 1856a78fd..77d6fc9fc 100644 --- a/QCPlugin/CPTBarPlotPlugin.m +++ b/QCPlugin/CPTBarPlotPlugin.m @@ -1,4 +1,4 @@ -#import "CPTBarPlotPlugIn.h" +#import "CPTBarPlotPlugin.h" @implementation CPTBarPlotPlugIn @@ -27,72 +27,72 @@ @implementation CPTBarPlotPlugIn */ @dynamic inputBaseValue, inputBarOffset, inputBarWidth, inputHorizontalBars; -+(NSDictionary *)attributes ++(nonnull NSDictionary *)attributes { return @{ - QCPlugInAttributeNameKey: @"Core Plot Bar Chart", - QCPlugInAttributeDescriptionKey: @"Bar chart" + QCPlugInAttributeNameKey: @"Core Plot Bar Chart", + QCPlugInAttributeDescriptionKey: @"Bar chart" }; } -+(NSDictionary *)attributesForPropertyPortWithKey:(NSString *)key ++(nullable CPTDictionary *)attributesForPropertyPortWithKey:(nullable NSString *)key { // A few additional ports for the bar plot chart type ... if ( [key isEqualToString:@"inputBarWidth"] ) { return @{ - QCPortAttributeNameKey: @"Bar Width", - QCPortAttributeDefaultValueKey: @1.0, - QCPortAttributeMinimumValueKey: @0.0 + QCPortAttributeNameKey: @"Bar Width", + QCPortAttributeDefaultValueKey: @1.0, + QCPortAttributeMinimumValueKey: @0.0 }; } if ( [key isEqualToString:@"inputBarOffset"] ) { return @{ - QCPortAttributeNameKey: @"Bar Offset", - QCPortAttributeDefaultValueKey: @0.5 + QCPortAttributeNameKey: @"Bar Offset", + QCPortAttributeDefaultValueKey: @0.5 }; } if ( [key isEqualToString:@"inputBaseValue"] ) { return @{ - QCPortAttributeNameKey: @"Base Value", - QCPortAttributeDefaultValueKey: @0.0 + QCPortAttributeNameKey: @"Base Value", + QCPortAttributeDefaultValueKey: @0.0 }; } if ( [key isEqualToString:@"inputHorizontalBars"] ) { return @{ - QCPortAttributeNameKey: @"Horizontal Bars", - QCPortAttributeDefaultValueKey: @NO + QCPortAttributeNameKey: @"Horizontal Bars", + QCPortAttributeDefaultValueKey: @NO }; } if ( [key isEqualToString:@"inputXMin"] ) { return @{ - QCPortAttributeNameKey: @"X Range Min", - QCPortAttributeDefaultValueKey: @0.0 + QCPortAttributeNameKey: @"X Range Min", + QCPortAttributeDefaultValueKey: @0.0 }; } if ( [key isEqualToString:@"inputXMax"] ) { return @{ - QCPortAttributeNameKey: @"X Range Max", - QCPortAttributeDefaultValueKey: @5.0 + QCPortAttributeNameKey: @"X Range Max", + QCPortAttributeDefaultValueKey: @5.0 }; } if ( [key isEqualToString:@"inputYMin"] ) { return @{ - QCPortAttributeNameKey: @"Y Range Min", - QCPortAttributeDefaultValueKey: @0.0 + QCPortAttributeNameKey: @"Y Range Min", + QCPortAttributeDefaultValueKey: @0.0 }; } if ( [key isEqualToString:@"inputYMax"] ) { return @{ - QCPortAttributeNameKey: @"Y Range Max", - QCPortAttributeDefaultValueKey: @5.0 + QCPortAttributeNameKey: @"Y Range Max", + QCPortAttributeDefaultValueKey: @5.0 }; } @@ -114,7 +114,7 @@ -(void)addPlotWithIndex:(NSUInteger)index forKey:[NSString stringWithFormat:@"plotDataLineColor%lu", (unsigned long)index] withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Plot Line Color %lu", (unsigned long)(index + 1)], QCPortAttributeTypeKey: QCPortTypeColor, - QCPortAttributeDefaultValueKey: CFBridgingRelease(lineColor) } + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(lineColor) } ]; CGColorRef fillColor = [self newDefaultColorForPlot:index alpha:0.25]; @@ -122,7 +122,7 @@ -(void)addPlotWithIndex:(NSUInteger)index forKey:[NSString stringWithFormat:@"plotFillColor%lu", (unsigned long)index] withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Plot Fill Color %lu", (unsigned long)(index + 1)], QCPortAttributeTypeKey: QCPortTypeColor, - QCPortAttributeDefaultValueKey: CFBridgingRelease(fillColor) } + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(fillColor) } ]; [self addInputPortWithType:QCPortTypeNumber @@ -153,7 +153,7 @@ -(void)removePlots:(NSUInteger)count [self removeInputPortForKey:[NSString stringWithFormat:@"plotFillColor%lu", (unsigned long)(i - 1)]]; [self removeInputPortForKey:[NSString stringWithFormat:@"plotDataLineWidth%lu", (unsigned long)(i - 1)]]; - [theGraph removePlot:[[theGraph allPlots] lastObject]]; + [theGraph removePlot:[theGraph allPlots].lastObject]; } } @@ -162,7 +162,7 @@ -(BOOL)configurePlots CPTGraph *theGraph = self.graph; // The pixel width of a single plot unit (1..2) along the x axis of the plot - double count = (double)[[theGraph allPlots] count]; + double count = (double)[theGraph allPlots].count; double unitWidth = theGraph.plotAreaFrame.bounds.size.width / (self.inputXMax - self.inputXMin); double barWidth = self.inputBarWidth * unitWidth / count; @@ -173,11 +173,14 @@ -(BOOL)configurePlots lineStyle.lineColor = [CPTColor colorWithCGColor:[self dataLineColor:index]]; lineStyle.lineWidth = [self dataLineWidth:index]; plot.lineStyle = lineStyle; - plot.baseValue = CPTDecimalFromDouble(self.inputBaseValue); - plot.barWidth = CPTDecimalFromDouble(barWidth); - plot.barOffset = CPTDecimalFromDouble(self.inputBarOffset); + plot.baseValue = @(self.inputBaseValue); + plot.barWidth = @(barWidth); + plot.barOffset = @(self.inputBarOffset); plot.barsAreHorizontal = self.inputHorizontalBars; - plot.fill = [CPTFill fillWithColor:[CPTColor colorWithCGColor:(CGColorRef)[self areaFillColor : index]]]; + CGColorRef fillColor = [self areaFillColor:index]; + if ( fillColor ) { + plot.fill = [CPTFill fillWithColor:[CPTColor colorWithCGColor:fillColor]]; + } [plot reloadData]; } @@ -188,7 +191,7 @@ -(BOOL)configurePlots #pragma mark - #pragma mark Data source methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot { NSUInteger plotIndex = [[self.graph allPlots] indexOfObject:plot]; NSString *key = [NSString stringWithFormat:@"plotNumbers%lu", (unsigned long)plotIndex]; @@ -196,28 +199,28 @@ -(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot return [[self valueForInputKey:key] count]; } --(NSArray *)numbersForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange +-(nullable NSArray *)numbersForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange __unused)indexRange { NSUInteger plotIndex = [[self.graph allPlots] indexOfObject:plot]; NSString *key = [NSString stringWithFormat:@"plotNumbers%lu", (unsigned long)plotIndex]; - NSDictionary *dict = [self valueForInputKey:key]; + CPTDictionary *dict = [self valueForInputKey:key]; if ( !dict ) { return nil; } - NSUInteger keyCount = [[dict allKeys] count]; - NSMutableArray *array = [NSMutableArray array]; + NSUInteger keyCount = dict.allKeys.count; + CPTMutableNumberArray *array = [NSMutableArray array]; if ( fieldEnum == CPTBarPlotFieldBarLocation ) { // Calculate horizontal position of bar - nth bar index + barWidth*plotIndex + 0.5 float xpos; - float plotCount = [[self.graph allPlots] count]; + float plotCount = [self.graph allPlots].count; for ( NSUInteger i = 0; i < keyCount; i++ ) { xpos = (float)i + (float)plotIndex / (plotCount); - [array addObject:[NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%f", xpos]]]; + [array addObject:[NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%f", (double)xpos]]]; } } else { diff --git a/QCPlugin/CPTPieChartPlugin.h b/QCPlugin/CPTPieChartPlugin.h index fbe9781eb..844715ba9 100644 --- a/QCPlugin/CPTPieChartPlugin.h +++ b/QCPlugin/CPTPieChartPlugin.h @@ -1,4 +1,4 @@ -#import "CorePlotQCPlugIn.h" +#import "CorePlotQCPlugin.h" #import @interface CPTPieChartPlugIn : CorePlotQCPlugIn @@ -8,7 +8,7 @@ @property (readwrite, assign) double inputStartAngle; @property (readwrite, assign) NSUInteger inputSliceDirection; @property (readwrite, assign) double inputBorderWidth; -@property (readwrite, assign) CGColorRef inputBorderColor; -@property (readwrite, assign) CGColorRef inputLabelColor; +@property (readwrite, assign, nonnull) CGColorRef inputBorderColor; +@property (readwrite, assign, nonnull) CGColorRef inputLabelColor; @end diff --git a/QCPlugin/CPTPieChartPlugin.m b/QCPlugin/CPTPieChartPlugin.m index 2874e1ae3..99aeb2ede 100644 --- a/QCPlugin/CPTPieChartPlugin.m +++ b/QCPlugin/CPTPieChartPlugin.m @@ -25,11 +25,11 @@ @implementation CPTPieChartPlugIn */ @dynamic inputPieRadius, inputSliceLabelOffset, inputStartAngle, inputSliceDirection; -+(NSDictionary *)attributes ++(nonnull NSDictionary *)attributes { return @{ - QCPlugInAttributeNameKey: @"Core Plot Pie Chart", - QCPlugInAttributeDescriptionKey: @"Pie chart" + QCPlugInAttributeNameKey: @"Core Plot Pie Chart", + QCPlugInAttributeDescriptionKey: @"Pie chart" }; } @@ -55,68 +55,68 @@ -(double)inputYMin // Pie charts only support one layer so we override the createViewController method (to hide the number of charts button) --(QCPlugInViewController *)createViewController +-(nullable QCPlugInViewController *)createViewController { return nil; } -+(NSArray *)sortedPropertyPortKeys ++(nonnull CPTStringArray *)sortedPropertyPortKeys { - NSArray *pieChartPropertyPortKeys = @[@"inputPieRadius", @"inputSliceLabelOffset", @"inputStartAngle", @"inputSliceDirection", @"inputBorderColor", @"inputBorderWidth"]; + CPTStringArray *pieChartPropertyPortKeys = @[@"inputPieRadius", @"inputSliceLabelOffset", @"inputStartAngle", @"inputSliceDirection", @"inputBorderColor", @"inputBorderWidth"]; return [[super sortedPropertyPortKeys] arrayByAddingObjectsFromArray:pieChartPropertyPortKeys]; } -+(NSDictionary *)attributesForPropertyPortWithKey:(NSString *)key ++(nullable CPTDictionary *)attributesForPropertyPortWithKey:(nullable NSString *)key { // A few additional ports for the pie chart type ... if ( [key isEqualToString:@"inputPieRadius"] ) { return @{ - QCPortAttributeNameKey: @"Pie Radius", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @0.75 + QCPortAttributeNameKey: @"Pie Radius", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @0.75 }; } else if ( [key isEqualToString:@"inputSliceLabelOffset"] ) { return @{ - QCPortAttributeNameKey: @"Label Offset", - QCPortAttributeDefaultValueKey: @20.0 + QCPortAttributeNameKey: @"Label Offset", + QCPortAttributeDefaultValueKey: @20.0 }; } else if ( [key isEqualToString:@"inputStartAngle"] ) { return @{ - QCPortAttributeNameKey: @"Start Angle", - QCPortAttributeDefaultValueKey: @0.0 + QCPortAttributeNameKey: @"Start Angle", + QCPortAttributeDefaultValueKey: @0.0 }; } else if ( [key isEqualToString:@"inputSliceDirection"] ) { return @{ - QCPortAttributeNameKey: @"Slice Direction", - QCPortAttributeMaximumValueKey: @1, - QCPortAttributeMenuItemsKey: @[@"Clockwise", @"Counter-Clockwise"], - QCPortAttributeDefaultValueKey: @0 + QCPortAttributeNameKey: @"Slice Direction", + QCPortAttributeMaximumValueKey: @1, + QCPortAttributeMenuItemsKey: @[@"Clockwise", @"Counter-Clockwise"], + QCPortAttributeDefaultValueKey: @0 }; } else if ( [key isEqualToString:@"inputBorderWidth"] ) { return @{ - QCPortAttributeNameKey: @"Border Width", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @1.0 + QCPortAttributeNameKey: @"Border Width", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @1.0 }; } else if ( [key isEqualToString:@"inputBorderColor"] ) { - CGColorRef grayColor = CGColorCreateGenericGray(0.0, 1.0); - NSDictionary *result = @{ - QCPortAttributeNameKey: @"Border Color", - QCPortAttributeDefaultValueKey: CFBridgingRelease(grayColor) + CGColorRef grayColor = CGColorCreateGenericGray(0.0, 1.0); + CPTDictionary *result = @{ + QCPortAttributeNameKey: @"Border Color", + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(grayColor) }; return result; } else if ( [key isEqualToString:@"inputLabelColor"] ) { - CGColorRef grayColor = CGColorCreateGenericGray(1.0, 1.0); - NSDictionary *result = @{ - QCPortAttributeNameKey: @"Label Color", - QCPortAttributeDefaultValueKey: CFBridgingRelease(grayColor) + CGColorRef grayColor = CGColorCreateGenericGray(1.0, 1.0); + CPTDictionary *result = @{ + QCPortAttributeNameKey: @"Label Color", + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(grayColor) }; return result; } @@ -147,7 +147,7 @@ -(void)addPlotWithIndex:(NSUInteger)index forKey:[NSString stringWithFormat:@"plotFillColor%lu", (unsigned long)index] withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Primary Fill Color %lu", (unsigned long)(index + 1)], QCPortAttributeTypeKey: QCPortTypeColor, - QCPortAttributeDefaultValueKey: CFBridgingRelease(grayColor) } + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(grayColor) } ]; // Add the new plot to the graph @@ -216,7 +216,7 @@ -(BOOL)configurePlots #pragma mark - #pragma mark Data source methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot { NSUInteger plotIndex = [[self.graph allPlots] indexOfObject:plot]; NSString *key = [NSString stringWithFormat:@"plotNumbers%lu", (unsigned long)plotIndex]; @@ -224,12 +224,12 @@ -(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot return [[self valueForInputKey:key] count]; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger __unused)fieldEnum recordIndex:(NSUInteger)index { NSUInteger plotIndex = [[self.graph allPlots] indexOfObject:plot]; NSString *key = [NSString stringWithFormat:@"plotNumbers%lu", (unsigned long)plotIndex]; - NSDictionary *dict = [self valueForInputKey:key]; + CPTDictionary *dict = [self valueForInputKey:key]; if ( dict ) { return [NSDecimalNumber decimalNumberWithString:[dict[[NSString stringWithFormat:@"%lu", (unsigned long)index]] stringValue]]; @@ -239,10 +239,10 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI } } --(CPTFill *)sliceFillForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)index +-(nullable CPTFill *)sliceFillForPieChart:(nonnull CPTPieChart *__unused)pieChart recordIndex:(NSUInteger)index { - CGColorRef plotFillColor = [[CPTPieChart defaultPieSliceColorForIndex:index] cgColor]; - CGColorRef inputFillColor = (CGColorRef)[self areaFillColor : 0]; + CGColorRef plotFillColor = [CPTPieChart defaultPieSliceColorForIndex:index].cgColor; + CGColorRef inputFillColor = (CGColorRef)[self areaFillColor:0]; const CGFloat *plotColorComponents = CGColorGetComponents(plotFillColor); const CGFloat *inputColorComponents = CGColorGetComponents(inputFillColor); @@ -259,12 +259,12 @@ -(CPTFill *)sliceFillForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger return [[CPTFill alloc] initWithColor:fillCPColor]; } --(CPTTextLayer *)sliceLabelForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)index +-(nullable CPTTextLayer *)sliceLabelForPieChart:(nonnull CPTPieChart *)pieChart recordIndex:(NSUInteger)index { NSUInteger plotIndex = [[self.graph allPlots] indexOfObject:pieChart]; NSString *key = [NSString stringWithFormat:@"plotLabels%lu", (unsigned long)plotIndex]; - NSDictionary *dict = [self valueForInputKey:key]; + CPTDictionary *dict = [self valueForInputKey:key]; if ( !dict ) { return nil; diff --git a/QCPlugin/CPTScatterPlotPlugin.h b/QCPlugin/CPTScatterPlotPlugin.h index 0ea178c1d..aaad42138 100644 --- a/QCPlugin/CPTScatterPlotPlugin.h +++ b/QCPlugin/CPTScatterPlotPlugin.h @@ -1,4 +1,4 @@ -#import "CorePlotQCPlugIn.h" +#import "CorePlotQCPlugin.h" #import @interface CPTScatterPlotPlugIn : CorePlotQCPlugIn diff --git a/QCPlugin/CPTScatterPlotPlugin.m b/QCPlugin/CPTScatterPlotPlugin.m index 834222994..023a890db 100644 --- a/QCPlugin/CPTScatterPlotPlugin.m +++ b/QCPlugin/CPTScatterPlotPlugin.m @@ -1,4 +1,4 @@ -#import "CPTScatterPlotPlugIn.h" +#import "CPTScatterPlotPlugin.h" @implementation CPTScatterPlotPlugIn @@ -22,11 +22,11 @@ @implementation CPTScatterPlotPlugIn @dynamic inputXMin, inputXMax, inputYMin, inputYMax; @dynamic inputXMajorIntervals, inputYMajorIntervals, inputXMinorIntervals, inputYMinorIntervals; -+(NSDictionary *)attributes ++(nonnull NSDictionary *)attributes { return @{ - QCPlugInAttributeNameKey: @"Core Plot Scatter Plot", - QCPlugInAttributeDescriptionKey: @"Scatter plot" + QCPlugInAttributeNameKey: @"Core Plot Scatter Plot", + QCPlugInAttributeDescriptionKey: @"Scatter plot" }; } @@ -51,7 +51,7 @@ -(void)addPlotWithIndex:(NSUInteger)index forKey:[NSString stringWithFormat:@"plotDataLineColor%lu", (unsigned long)index] withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Plot Line Color %lu", (unsigned long)(index + 1)], QCPortAttributeTypeKey: QCPortTypeColor, - QCPortAttributeDefaultValueKey: CFBridgingRelease(lineColor) } + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(lineColor) } ]; CGColorRef fillColor = [self newDefaultColorForPlot:index alpha:0.25]; @@ -59,7 +59,7 @@ -(void)addPlotWithIndex:(NSUInteger)index forKey:[NSString stringWithFormat:@"plotFillColor%lu", (unsigned long)index] withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Plot Fill Color %lu", (unsigned long)(index + 1)], QCPortAttributeTypeKey: QCPortTypeColor, - QCPortAttributeDefaultValueKey: CFBridgingRelease(fillColor) } + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(fillColor) } ]; [self addInputPortWithType:QCPortTypeNumber @@ -85,7 +85,7 @@ -(void)addPlotWithIndex:(NSUInteger)index forKey:[NSString stringWithFormat:@"plotDataSymbolColor%lu", (unsigned long)index] withAttributes:@{ QCPortAttributeNameKey: [NSString stringWithFormat:@"Data Symbol Color %lu", (unsigned long)(index + 1)], QCPortAttributeTypeKey: QCPortTypeColor, - QCPortAttributeDefaultValueKey: CFBridgingRelease(symbolColor) } + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(symbolColor) } ]; // Add the new plot to the graph @@ -123,11 +123,11 @@ -(void)removePlots:(NSUInteger)count [self removeInputPortForKey:[NSString stringWithFormat:@"plotDataSymbols%lu", (unsigned long)(i - 1)]]; [self removeInputPortForKey:[NSString stringWithFormat:@"plotDataSymbolColor%lu", (unsigned long)(i - 1)]]; - [theGraph removePlot:[[theGraph allPlots] lastObject]]; + [theGraph removePlot:[theGraph allPlots].lastObject]; } } --(CPTPlotSymbol *)plotSymbol:(NSUInteger)index +-(nullable CPTPlotSymbol *)plotSymbol:(NSUInteger)index { NSString *key = [NSString stringWithFormat:@"plotDataSymbols%lu", (unsigned long)index]; NSUInteger value = [[self valueForInputKey:key] unsignedIntegerValue]; @@ -168,7 +168,7 @@ -(CPTPlotSymbol *)plotSymbol:(NSUInteger)index } } --(CGColorRef)dataSymbolColor:(NSUInteger)index +-(nonnull CGColorRef)dataSymbolColor:(NSUInteger)index { NSString *key = [NSString stringWithFormat:@"plotDataSymbolColor%lu", (unsigned long)index]; @@ -193,8 +193,11 @@ -(BOOL)configurePlots plot.plotSymbol.lineStyle = lineStyle; plot.plotSymbol.fill = [CPTFill fillWithColor:[CPTColor colorWithCGColor:[self dataSymbolColor:index]]]; plot.plotSymbol.size = CGSizeMake(10.0, 10.0); - plot.areaFill = [CPTFill fillWithColor:[CPTColor colorWithCGColor:[self areaFillColor:index]]]; - plot.areaBaseValue = CPTDecimalFromDouble( MAX( self.inputYMin, MIN(self.inputYMax, 0.0) ) ); + CGColorRef fillColor = [self areaFillColor:index]; + if ( fillColor ) { + plot.areaFill = [CPTFill fillWithColor:[CPTColor colorWithCGColor:fillColor]]; + } + plot.areaBaseValue = @(MAX(self.inputYMin, MIN(self.inputYMax, 0.0))); [plot reloadData]; } @@ -204,14 +207,14 @@ -(BOOL)configurePlots #pragma mark - #pragma mark Data source methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot { NSUInteger plotIndex = [[self.graph allPlots] indexOfObject:plot]; NSString *xKey = [NSString stringWithFormat:@"plotXNumbers%lu", (unsigned long)plotIndex]; NSString *yKey = [NSString stringWithFormat:@"plotYNumbers%lu", (unsigned long)plotIndex]; - NSDictionary *xVals = [self valueForInputKey:xKey]; - NSDictionary *yVals = [self valueForInputKey:yKey]; + CPTDictionary *xVals = [self valueForInputKey:xKey]; + CPTDictionary *yVals = [self valueForInputKey:yKey]; if ( !xVals || !yVals ) { return 0; @@ -223,14 +226,14 @@ -(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot return xVals.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSUInteger plotIndex = [[self.graph allPlots] indexOfObject:plot]; NSString *xKey = [NSString stringWithFormat:@"plotXNumbers%lu", (unsigned long)plotIndex]; NSString *yKey = [NSString stringWithFormat:@"plotYNumbers%lu", (unsigned long)plotIndex]; - NSDictionary *xVals = [self valueForInputKey:xKey]; - NSDictionary *yVals = [self valueForInputKey:yKey]; + CPTDictionary *xVals = [self valueForInputKey:xKey]; + CPTDictionary *yVals = [self valueForInputKey:yKey]; if ( !xVals || !yVals ) { return nil; @@ -239,7 +242,7 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI return nil; } - NSDictionary *dict = (fieldEnum == CPTScatterPlotFieldX) ? xVals : yVals; + CPTDictionary *dict = (fieldEnum == CPTScatterPlotFieldX) ? xVals : yVals; NSString *dictionaryKey = [NSString stringWithFormat:@"%lu", (unsigned long)index]; diff --git a/QCPlugin/CorePlotQCPlugin.h b/QCPlugin/CorePlotQCPlugin.h index c5359b7ca..99354c2d5 100644 --- a/QCPlugin/CorePlotQCPlugin.h +++ b/QCPlugin/CorePlotQCPlugin.h @@ -3,18 +3,18 @@ @interface CorePlotQCPlugIn : QCPlugIn -@property (readwrite, strong) CPTGraph *graph; +@property (readwrite, strong, nullable) CPTGraph *graph; -@property (readwrite, assign) id outputImage; +@property (readwrite, strong, nonnull) id outputImage; @property (readwrite, assign) NSUInteger numberOfPlots; @property (readwrite, assign) NSUInteger inputPixelsWide; @property (readwrite, assign) NSUInteger inputPixelsHigh; -@property (readwrite, assign) CGColorRef inputPlotAreaColor; +@property (readwrite, assign, nonnull) CGColorRef inputPlotAreaColor; -@property (readwrite, assign) CGColorRef inputAxisColor; +@property (readwrite, assign, nonnull) CGColorRef inputAxisColor; @property (readwrite, assign) double inputAxisLineWidth; @property (readwrite, assign) double inputAxisMajorTickWidth; @property (readwrite, assign) double inputAxisMinorTickWidth; @@ -41,14 +41,14 @@ -(BOOL)configurePlots; -(BOOL)configureAxis; --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot; --(CGColorRef)newDefaultColorForPlot:(NSUInteger)index alpha:(CGFloat)alpha; +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot; +-(nonnull CGColorRef)newDefaultColorForPlot:(NSUInteger)index alpha:(CGFloat)alpha; -(void)freeResources; --(CGColorRef)dataLineColor:(NSUInteger)index; +-(nonnull CGColorRef)dataLineColor:(NSUInteger)index; -(CGFloat)dataLineWidth:(NSUInteger)index; --(CGColorRef)areaFillColor:(NSUInteger)index; --(CGImageRef)newAreaFillImage:(NSUInteger)index; +-(nullable CGColorRef)areaFillColor:(NSUInteger)index; +-(nullable CGImageRef)newAreaFillImage:(NSUInteger)index; @end diff --git a/QCPlugin/CorePlotQCPlugin.m b/QCPlugin/CorePlotQCPlugin.m index 16970e821..3aa3ef332 100644 --- a/QCPlugin/CorePlotQCPlugin.m +++ b/QCPlugin/CorePlotQCPlugin.m @@ -1,4 +1,4 @@ -#import "CorePlotQCPlugIn.h" +#import "CorePlotQCPlugin.h" #import #define kQCPlugIn_Name @"CorePlotQCPlugIn" @@ -8,18 +8,18 @@ @interface CorePlotQCPlugIn() -@property (nonatomic, readwrite, strong) NSMutableData *imageData; -@property (nonatomic, readwrite, assign) CGContextRef bitmapContext; -@property (nonatomic, readwrite, strong) id imageProvider; +@property (nonatomic, readwrite, strong, nullable) NSMutableData *imageData; +@property (nonatomic, readwrite, assign, nullable) CGContextRef bitmapContext; +@property (nonatomic, readwrite, strong, nullable) id imageProvider; -void drawErrorText(CGContextRef context, CGRect rect); +void drawErrorText(CGContextRef __nonnull context, CGRect rect); @end #pragma mark - // Draws the string "ERROR" in the given context in big red letters -void drawErrorText(CGContextRef context, CGRect rect) +void drawErrorText(CGContextRef __nonnull context, CGRect rect) { CGContextSaveGState(context); @@ -83,15 +83,15 @@ @implementation CorePlotQCPlugIn */ @synthesize numberOfPlots; -+(NSDictionary *)attributes ++(nonnull NSDictionary *)attributes { /* * Return a dictionary of attributes describing the plug-in (QCPlugInAttributeNameKey, QCPlugInAttributeDescriptionKey...). */ return @{ - QCPlugInAttributeNameKey: kQCPlugIn_Name, - QCPlugInAttributeDescriptionKey: kQCPlugIn_Description + QCPlugInAttributeNameKey: kQCPlugIn_Name, + QCPlugInAttributeDescriptionKey: kQCPlugIn_Description }; } @@ -113,9 +113,9 @@ +(QCPlugInTimeMode)timeMode return kQCPlugInTimeModeNone; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { /* * Allocate any permanent resource required by the plug-in. */ @@ -149,7 +149,7 @@ -(void)freeResources self.graph = nil; } --(QCPlugInViewController *)createViewController +-(nullable QCPlugInViewController *)createViewController { /* * Return a new QCPlugInViewController to edit the internal settings of this plug-in instance. @@ -162,7 +162,7 @@ -(QCPlugInViewController *)createViewController #pragma mark - #pragma mark Input and output port configuration -+(NSArray *)sortedPropertyPortKeys ++(nonnull CPTStringArray *)sortedPropertyPortKeys { return @[@"inputPixelsWide", @"inputPixelsHigh", @@ -186,7 +186,7 @@ +(NSArray *)sortedPropertyPortKeys @"inputAxisMinorTickWidth"]; } -+(NSDictionary *)attributesForPropertyPortWithKey:(NSString *)key ++(nullable CPTDictionary *)attributesForPropertyPortWithKey:(nullable NSString *)key { /* * Specify the optional attributes for property based ports (QCPortAttributeNameKey, QCPortAttributeDefaultValueKey...). @@ -194,157 +194,157 @@ +(NSDictionary *)attributesForPropertyPortWithKey:(NSString *)key if ( [key isEqualToString:@"inputXMin"] ) { return @{ - QCPortAttributeNameKey: @"X Range Min", - QCPortAttributeDefaultValueKey: @ - 1.0 + QCPortAttributeNameKey: @"X Range Min", + QCPortAttributeDefaultValueKey: @(-1.0) }; } if ( [key isEqualToString:@"inputXMax"] ) { return @{ - QCPortAttributeNameKey: @"X Range Max", - QCPortAttributeDefaultValueKey: @1.0 + QCPortAttributeNameKey: @"X Range Max", + QCPortAttributeDefaultValueKey: @1.0 }; } if ( [key isEqualToString:@"inputYMin"] ) { return @{ - QCPortAttributeNameKey: @"Y Range Min", - QCPortAttributeDefaultValueKey: @ - 1.0 + QCPortAttributeNameKey: @"Y Range Min", + QCPortAttributeDefaultValueKey: @(-1.0) }; } if ( [key isEqualToString:@"inputYMax"] ) { return @{ - QCPortAttributeNameKey: @"Y Range Max", - QCPortAttributeDefaultValueKey: @1.0 + QCPortAttributeNameKey: @"Y Range Max", + QCPortAttributeDefaultValueKey: @1.0 }; } if ( [key isEqualToString:@"inputXMajorIntervals"] ) { return @{ - QCPortAttributeNameKey: @"X Major Intervals", - QCPortAttributeDefaultValueKey: @4.0, - QCPortAttributeMinimumValueKey: @0.0 + QCPortAttributeNameKey: @"X Major Intervals", + QCPortAttributeDefaultValueKey: @4.0, + QCPortAttributeMinimumValueKey: @0.0 }; } if ( [key isEqualToString:@"inputYMajorIntervals"] ) { return @{ - QCPortAttributeNameKey: @"Y Major Intervals", - QCPortAttributeDefaultValueKey: @4.0, - QCPortAttributeMinimumValueKey: @0.0 + QCPortAttributeNameKey: @"Y Major Intervals", + QCPortAttributeDefaultValueKey: @4.0, + QCPortAttributeMinimumValueKey: @0.0 }; } if ( [key isEqualToString:@"inputXMinorIntervals"] ) { return @{ - QCPortAttributeNameKey: @"X Minor Intervals", - QCPortAttributeDefaultValueKey: @1, - QCPortAttributeMinimumValueKey: @0 + QCPortAttributeNameKey: @"X Minor Intervals", + QCPortAttributeDefaultValueKey: @1, + QCPortAttributeMinimumValueKey: @0 }; } if ( [key isEqualToString:@"inputYMinorIntervals"] ) { return @{ - QCPortAttributeNameKey: @"Y Minor Intervals", - QCPortAttributeDefaultValueKey: @1, - QCPortAttributeMinimumValueKey: @0 + QCPortAttributeNameKey: @"Y Minor Intervals", + QCPortAttributeDefaultValueKey: @1, + QCPortAttributeMinimumValueKey: @0 }; } if ( [key isEqualToString:@"inputAxisColor"] ) { - CGColorRef axisColor = CGColorCreateGenericRGB(1.0, 1.0, 1.0, 1.0); - NSDictionary *result = @{ - QCPortAttributeNameKey: @"Axis Color", - QCPortAttributeDefaultValueKey: CFBridgingRelease(axisColor) + CGColorRef axisColor = CGColorCreateGenericRGB(1.0, 1.0, 1.0, 1.0); + CPTDictionary *result = @{ + QCPortAttributeNameKey: @"Axis Color", + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(axisColor) }; return result; } if ( [key isEqualToString:@"inputAxisLineWidth"] ) { return @{ - QCPortAttributeNameKey: @"Axis Line Width", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @1.0 + QCPortAttributeNameKey: @"Axis Line Width", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @1.0 }; } if ( [key isEqualToString:@"inputAxisMajorTickWidth"] ) { return @{ - QCPortAttributeNameKey: @"Major Tick Width", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @2.0 + QCPortAttributeNameKey: @"Major Tick Width", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @2.0 }; } if ( [key isEqualToString:@"inputAxisMinorTickWidth"] ) { return @{ - QCPortAttributeNameKey: @"Minor Tick Width", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @1.0 + QCPortAttributeNameKey: @"Minor Tick Width", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @1.0 }; } if ( [key isEqualToString:@"inputAxisMajorTickLength"] ) { return @{ - QCPortAttributeNameKey: @"Major Tick Length", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @10.0 + QCPortAttributeNameKey: @"Major Tick Length", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @10.0 }; } if ( [key isEqualToString:@"inputAxisMinorTickLength"] ) { return @{ - QCPortAttributeNameKey: @"Minor Tick Length", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @3.0 + QCPortAttributeNameKey: @"Minor Tick Length", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @3.0 }; } if ( [key isEqualToString:@"inputMajorGridLineWidth"] ) { return @{ - QCPortAttributeNameKey: @"Major Grid Line Width", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @1.0 + QCPortAttributeNameKey: @"Major Grid Line Width", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @1.0 }; } if ( [key isEqualToString:@"inputMinorGridLineWidth"] ) { return @{ - QCPortAttributeNameKey: @"Minor Grid Line Width", - QCPortAttributeMinimumValueKey: @0.0, - QCPortAttributeDefaultValueKey: @0.0 + QCPortAttributeNameKey: @"Minor Grid Line Width", + QCPortAttributeMinimumValueKey: @0.0, + QCPortAttributeDefaultValueKey: @0.0 }; } if ( [key isEqualToString:@"inputPlotAreaColor"] ) { CGColorRef plotAreaColor = CGColorCreateGenericRGB(0.0, 0.0, 0.0, 0.4); - NSDictionary *result = @{ - QCPortAttributeNameKey: @"Plot Area Color", - QCPortAttributeDefaultValueKey: CFBridgingRelease(plotAreaColor) + CPTDictionary *result = @{ + QCPortAttributeNameKey: @"Plot Area Color", + QCPortAttributeDefaultValueKey: (id)CFBridgingRelease(plotAreaColor) }; return result; } if ( [key isEqualToString:@"inputPixelsWide"] ) { return @{ - QCPortAttributeNameKey: @"Pixels Wide", - QCPortAttributeMinimumValueKey: @1, - QCPortAttributeDefaultValueKey: @512 + QCPortAttributeNameKey: @"Pixels Wide", + QCPortAttributeMinimumValueKey: @1, + QCPortAttributeDefaultValueKey: @512 }; } if ( [key isEqualToString:@"inputPixelsHigh"] ) { return @{ - QCPortAttributeNameKey: @"Pixels High", - QCPortAttributeMinimumValueKey: @1, - QCPortAttributeDefaultValueKey: @512 + QCPortAttributeNameKey: @"Pixels High", + QCPortAttributeMinimumValueKey: @1, + QCPortAttributeDefaultValueKey: @512 }; } if ( [key isEqualToString:@"outputImage"] ) { return @{ - QCPortAttributeNameKey: @"Image" + QCPortAttributeNameKey: @"Image" }; } @@ -364,23 +364,23 @@ -(void)createGraph // Setup scatter plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(1.0) length:CPTDecimalFromFloat(1.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-1.0) length:CPTDecimalFromFloat(1.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@1.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]; // Axes CPTXYAxisSet *axisSet = (CPTXYAxisSet *)newGraph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromFloat(0.5); + x.majorIntervalLength = @0.5; x.minorTicksPerInterval = 2; CPTXYAxis *y = axisSet.yAxis; - y.majorIntervalLength = CPTDecimalFromFloat(0.5); + y.majorIntervalLength = @0.5; y.minorTicksPerInterval = 5; } } --(CGColorRef)newDefaultColorForPlot:(NSUInteger)index alpha:(CGFloat)alpha +-(nonnull CGColorRef)newDefaultColorForPlot:(NSUInteger)index alpha:(CGFloat)alpha { CGColorRef color; @@ -451,11 +451,11 @@ -(BOOL)configureAxis set.xAxis.labelTextStyle = textStyle; double xrange = self.inputXMax - self.inputXMin; - set.xAxis.majorIntervalLength = CPTDecimalFromDouble( xrange / (self.inputXMajorIntervals) ); + set.xAxis.majorIntervalLength = @(xrange / (self.inputXMajorIntervals)); set.xAxis.minorTicksPerInterval = self.inputXMinorIntervals; double yrange = self.inputYMax - self.inputYMin; - set.yAxis.majorIntervalLength = CPTDecimalFromDouble( yrange / (self.inputYMajorIntervals) ); + set.yAxis.majorIntervalLength = @(yrange / (self.inputYMajorIntervals)); set.yAxis.minorTicksPerInterval = self.inputYMinorIntervals; set.xAxis.minorTickLength = self.inputAxisMinorTickLength; @@ -497,7 +497,7 @@ -(BOOL)configureAxis return YES; } --(CGColorRef)dataLineColor:(NSUInteger)index +-(nonnull CGColorRef)dataLineColor:(NSUInteger)index { NSString *key = [NSString stringWithFormat:@"plotDataLineColor%lu", (unsigned long)index]; @@ -513,18 +513,19 @@ -(CGFloat)dataLineWidth:(NSUInteger)index return inputValue.doubleValue; } --(CGColorRef)areaFillColor:(NSUInteger)index +-(nullable CGColorRef)areaFillColor:(NSUInteger)index { NSString *key = [NSString stringWithFormat:@"plotFillColor%lu", (unsigned long)index]; return (__bridge CGColorRef)([self valueForInputKey:key]); } --(CGImageRef)newAreaFillImage:(NSUInteger)index +-(nullable CGImageRef)newAreaFillImage:(NSUInteger)index { NSString *key = [NSString stringWithFormat:@"plotFillImage%lu", (unsigned long)index]; id img = [self valueForInputKey:key]; + if ( !img ) { return nil; } @@ -546,6 +547,9 @@ -(CGImageRef)newAreaFillImage:(NSUInteger)index NSUInteger bytesPerRow = [img bufferBytesPerRow]; CGColorSpaceRef colorSpace = [img bufferColorSpace]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wincompatible-pointer-types-discards-qualifiers" + CGContextRef imgContext = CGBitmapContextCreate(baseAddress, pixelsWide, pixelsHigh, @@ -554,6 +558,8 @@ -(CGImageRef)newAreaFillImage:(NSUInteger)index colorSpace, (CGBitmapInfo)kCGImageAlphaNoneSkipLast); +#pragma clang diagnostic pop + CGImageRef imageRef = CGBitmapContextCreateImage(imgContext); [img unlockBufferRepresentation]; @@ -563,12 +569,12 @@ -(CGImageRef)newAreaFillImage:(NSUInteger)index return imageRef; } -static void _BufferReleaseCallback(const void *address, void *context) +static void _BufferReleaseCallback(const void *__nonnull __unused address, void *__nonnull __unused context) { // Don't do anything. We release the buffer manually when it's recreated or during dealloc } --(void)createImageResourcesWithContext:(id)context +-(void)createImageResourcesWithContext:(nonnull id)context { // Create a CG bitmap for drawing. The image data is released when QC calls _BufferReleaseCallback CGSize boundsSize = self.graph.bounds.size; @@ -576,7 +582,7 @@ -(void)createImageResourcesWithContext:(id)context size_t rowBytes = (size_t)boundsSize.width * 4; if ( rowBytes % 16 ) { - rowBytes = ( (rowBytes / 16) + 1 ) * 16; + rowBytes = ((rowBytes / 16) + 1) * 16; } if ( !self.imageData ) { @@ -609,7 +615,7 @@ -(void)createImageResourcesWithContext:(id)context CGContextRelease(newContext); if ( rowBytes % 16 ) { - rowBytes = ( (rowBytes / 16) + 1 ) * 16; + rowBytes = ((rowBytes / 16) + 1) * 16; } // Note: I don't have a PPC to test on so this may or may not cause some color issues @@ -639,12 +645,12 @@ -(void)createImageResourcesWithContext:(id)context #pragma mark - #pragma mark Data source methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return 0; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger __unused)fieldEnum recordIndex:(NSUInteger __unused)index { return @0; } @@ -671,12 +677,12 @@ -(void)setNumberOfPlots:(NSUInteger)number numberOfPlots = number; } -+(NSArray *)plugInKeys ++(nonnull CPTStringArray *)plugInKeys { return @[@"numberOfPlots"]; } --(id)serializedValueForKey:(NSString *)key +-(nonnull id)serializedValueForKey:(nonnull NSString *)key { /* * Provide custom serialization for the plug-in internal settings that are not values complying to the protocol. @@ -691,7 +697,7 @@ -(id)serializedValueForKey:(NSString *)key } } --(void)setSerializedValue:(id)serializedValue forKey:(NSString *)key +-(void)setSerializedValue:(nonnull id)serializedValue forKey:(nonnull NSString *)key { /* * Provide deserialization for the plug-in internal settings that were custom serialized in -serializedValueForKey. @@ -699,7 +705,7 @@ -(void)setSerializedValue:(id)serializedValue forKey:(NSString *)key */ if ( [key isEqualToString:@"numberOfPlots"] ) { - [self setNumberOfPlots:MAX(1, [(NSNumber *)serializedValue unsignedIntegerValue])]; + [self setNumberOfPlots:MAX(1, [(NSNumber *) serializedValue unsignedIntegerValue])]; } else { [super setSerializedValue:serializedValue forKey:key]; @@ -709,7 +715,7 @@ -(void)setSerializedValue:(id)serializedValue forKey:(NSString *)key #pragma mark - #pragma mark Accessors --(void)setBitmapContext:(CGContextRef)newContext +-(void)setBitmapContext:(nullable CGContextRef)newContext { if ( newContext != bitmapContext ) { CGContextRelease(bitmapContext); @@ -720,14 +726,14 @@ -(void)setBitmapContext:(CGContextRef)newContext #pragma mark - #pragma mark Subclass methods --(void)addPlotWithIndex:(NSUInteger)index +-(void)addPlotWithIndex:(NSUInteger __unused)index { /* * Subclasses should override this method to create their own ports, plots, and add the plots to the graph */ } --(void)removePlots:(NSUInteger)count +-(void)removePlots:(NSUInteger __unused)count { /* * Subclasses should override this method to remove plots and their ports @@ -750,7 +756,7 @@ -(BOOL)configureGraph */ // Configure the graph area - CGRect frame = CPTRectMake( 0.0, 0.0, MAX(1, self.inputPixelsWide), MAX(1, self.inputPixelsHigh) ); + CGRect frame = CPTRectMake(0.0, 0.0, MAX(1, self.inputPixelsWide), MAX(1, self.inputPixelsHigh)); self.graph.bounds = frame; @@ -760,7 +766,7 @@ -(BOOL)configureGraph self.graph.paddingBottom = 0.0; // Perform some sanity checks. If there is a configuration error set the error flag so that a message is displayed - if ( (self.inputXMax <= self.inputXMin) || (self.inputYMax <= self.inputYMin) ) { + if ((self.inputXMax <= self.inputXMin) || (self.inputYMax <= self.inputYMin)) { return NO; } @@ -778,8 +784,8 @@ -(BOOL)configureGraph // Configure the plot space and axis sets CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(self.inputXMin) length:CPTDecimalFromDouble(self.inputXMax - self.inputXMin)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(self.inputYMin) length:CPTDecimalFromDouble(self.inputYMax - self.inputYMin)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(self.inputXMin) length:@(self.inputXMax - self.inputXMin)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(self.inputYMin) length:@(self.inputYMax - self.inputYMin)]; [self configureAxis]; @@ -795,7 +801,7 @@ -(BOOL)configureGraph @implementation CorePlotQCPlugIn(Execution) --(BOOL)execute:(id)context atTime:(NSTimeInterval)time withArguments:(NSDictionary *)arguments +-(BOOL)execute:(nonnull id)context atTime:(NSTimeInterval __unused)time withArguments:(nullable CPTDictionary *__unused)arguments { // Configure the plot for drawing BOOL configurationCheck = [self configureGraph]; @@ -811,9 +817,9 @@ -(BOOL)execute:(id)context atTime:(NSTimeInterval)time withArgu // Draw the plot ... CGSize boundsSize = self.graph.bounds.size; CGContextRef bmContext = self.bitmapContext; - CGContextClearRect( bmContext, CPTRectMake(0.0, 0.0, boundsSize.width, boundsSize.height) ); + CGContextClearRect(bmContext, CPTRectMake(0.0, 0.0, boundsSize.width, boundsSize.height)); CGContextSetRGBFillColor(bmContext, 0.0, 0.0, 0.0, 0.0); - CGContextFillRect( bmContext, CPTRectMake(0, 0, boundsSize.width, boundsSize.height) ); + CGContextFillRect(bmContext, CPTRectMake(0, 0, boundsSize.width, boundsSize.height)); CGContextSetAllowsAntialiasing(bmContext, true); if ( configurationCheck ) { @@ -821,16 +827,21 @@ -(BOOL)execute:(id)context atTime:(NSTimeInterval)time withArgu [self.graph recursivelyRenderInContext:bmContext]; } else { - drawErrorText( bmContext, CPTRectMake(0, 0, self.inputPixelsWide, self.inputPixelsHigh) ); + drawErrorText(bmContext, CPTRectMake(0, 0, self.inputPixelsWide, self.inputPixelsHigh)); } - //CGContextSetAllowsAntialiasing(bitmapContext, false); + // CGContextSetAllowsAntialiasing(bitmapContext, false); CGContextFlush(bmContext); // ... and put it on the output port - self.outputImage = self.imageProvider; - - return YES; + id provider = self.imageProvider; + if ( provider ) { + self.outputImage = provider; + return YES; + } + else { + return NO; + } } @end diff --git a/QCPlugin/CorePlotQCPlugin.xcodeproj/project.pbxproj b/QCPlugin/CorePlotQCPlugin.xcodeproj/project.pbxproj index 2833773af..e07788d06 100644 --- a/QCPlugin/CorePlotQCPlugin.xcodeproj/project.pbxproj +++ b/QCPlugin/CorePlotQCPlugin.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 47; objects = { /* Begin PBXAggregateTarget section */ @@ -62,6 +62,48 @@ remoteGlobalIDString = 8DC2EF4F0486A6940098B216; remoteInfo = CorePlot; }; + C31D02421D10F531008C1EF2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A89BAB3B1027EFBD004B2FE1 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C31D02441D10F531008C1EF2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A89BAB3B1027EFBD004B2FE1 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; + C3B925EA1ADF1CBE00C67086 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A89BAB3B1027EFBD004B2FE1 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09781A46185200D45436; + remoteInfo = CorePlot_iOS; + }; + C3B925EC1ADF1CBE00C67086 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A89BAB3B1027EFBD004B2FE1 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09821A46185300D45436; + remoteInfo = CorePlot_iOSTests; + }; + C3B925EE1ADF1CBE00C67086 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A89BAB3B1027EFBD004B2FE1 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09BA1A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouch"; + }; + C3B925F01ADF1CBE00C67086 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = A89BAB3B1027EFBD004B2FE1 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09C41A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouchTests"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -81,11 +123,9 @@ 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 16AA5C440A7EEE7300888E31 /* CorePlotQCPlugin_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CorePlotQCPlugin_Prefix.pch; sourceTree = ""; }; 16BA95400A7EB2EB001E4983 /* CorePlotQCPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CorePlotQCPlugin.h; sourceTree = ""; }; - 16BA95410A7EB2EB001E4983 /* CorePlotQCPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = CorePlotQCPlugin.m; sourceTree = ""; }; + 16BA95410A7EB2EB001E4983 /* CorePlotQCPlugin.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CorePlotQCPlugin.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 16BA96300A7EB9AC001E4983 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = /System/Library/Frameworks/Quartz.framework; sourceTree = ""; }; - 7238D5510DB6988600E9A42D /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/Settings.xib; sourceTree = ""; }; 8D5B49B6048680CD000E48DA /* CorePlotQCPlugin.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CorePlotQCPlugin.plugin; sourceTree = BUILT_PRODUCTS_DIR; }; - 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A819AA0311FD3F23006D1C2D /* CPTPieChartPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPieChartPlugin.h; sourceTree = ""; }; A819AA0411FD3F23006D1C2D /* CPTPieChartPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPieChartPlugin.m; sourceTree = ""; }; A89BAB3B1027EFBD004B2FE1 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../framework/CorePlot.xcodeproj; sourceTree = SOURCE_ROOT; }; @@ -93,7 +133,9 @@ A8FC1815102CBADE00CF2266 /* CPTScatterPlotPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTScatterPlotPlugin.m; sourceTree = ""; }; A8FC1817102CBAEA00CF2266 /* CPTBarPlotPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTBarPlotPlugin.h; sourceTree = ""; }; A8FC1818102CBAEA00CF2266 /* CPTBarPlotPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTBarPlotPlugin.m; sourceTree = ""; }; - C3C8CFF619E9504C007E0BCB /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../framework/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C37A410E20E0326C00C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Info.plist; sourceTree = ""; }; + C3C8CFF619E9504C007E0BCB /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3DA083820E00C7700F73704 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/Settings.xib; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -139,7 +181,7 @@ isa = PBXGroup; children = ( 7238D5500DB6988600E9A42D /* Settings.xib */, - 8D5B49B7048680CD000E48DA /* Info.plist */, + C37A410F20E0326C00C4FF48 /* Info.plist */, ); name = Resources; sourceTree = ""; @@ -181,6 +223,12 @@ children = ( BC21A97F1035BEAF00FED2A4 /* CorePlot.framework */, A8F18CF511FA634B00B2C42F /* UnitTests.xctest */, + C3B925EB1ADF1CBE00C67086 /* CorePlot.framework */, + C3B925ED1ADF1CBE00C67086 /* UnitTests iOS.xctest */, + C3B925EF1ADF1CBE00C67086 /* libCorePlot-CocoaTouch.a */, + C3B925F11ADF1CBE00C67086 /* CorePlot-CocoaTouchTests.xctest */, + C31D02431D10F531008C1EF2 /* CorePlot.framework */, + C31D02451D10F531008C1EF2 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -214,17 +262,18 @@ 089C1669FE841209C02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0700; + LastUpgradeCheck = 0930; }; buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "CorePlotQCPlugin" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + en, + ja, + fr, + de, ); mainGroup = 089C166AFE841209C02AAC07 /* Quartz Composer Plug In */; projectDirPath = ""; @@ -257,6 +306,48 @@ remoteRef = BC21A97E1035BEAF00FED2A4 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C31D02431D10F531008C1EF2 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C31D02421D10F531008C1EF2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C31D02451D10F531008C1EF2 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C31D02441D10F531008C1EF2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B925EB1ADF1CBE00C67086 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3B925EA1ADF1CBE00C67086 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B925ED1ADF1CBE00C67086 /* UnitTests iOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests iOS.xctest"; + remoteRef = C3B925EC1ADF1CBE00C67086 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B925EF1ADF1CBE00C67086 /* libCorePlot-CocoaTouch.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libCorePlot-CocoaTouch.a"; + remoteRef = C3B925EE1ADF1CBE00C67086 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B925F11ADF1CBE00C67086 /* CorePlot-CocoaTouchTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "CorePlot-CocoaTouchTests.xctest"; + remoteRef = C3B925F01ADF1CBE00C67086 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -317,16 +408,25 @@ 7238D5500DB6988600E9A42D /* Settings.xib */ = { isa = PBXVariantGroup; children = ( - 7238D5510DB6988600E9A42D /* English */, + C3DA083820E00C7700F73704 /* Base */, ); name = Settings.xib; sourceTree = ""; }; + C37A410F20E0326C00C4FF48 /* Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A410E20E0326C00C4FF48 /* Base */, + ); + name = Info.plist; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 1DEB913B08733D840010E9CD /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C8CFF619E9504C007E0BCB /* CorePlotWarnings.xcconfig */; buildSettings = { ADDITIONAL_SDKS = ""; CLANG_ENABLE_OBJC_ARC = YES; @@ -334,11 +434,11 @@ COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CorePlotQCPlugin_Prefix.pch; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Library/Graphics/Quartz Composer Plug-Ins"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = CorePlotQCPlugin; @@ -350,6 +450,7 @@ }; 1DEB913C08733D840010E9CD /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C8CFF619E9504C007E0BCB /* CorePlotWarnings.xcconfig */; buildSettings = { ADDITIONAL_SDKS = ""; CLANG_ENABLE_OBJC_ARC = YES; @@ -358,8 +459,9 @@ GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CorePlotQCPlugin_Prefix.pch; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Library/Graphics/Quartz Composer Plug-Ins"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = CorePlotQCPlugin; @@ -374,8 +476,12 @@ baseConfigurationReference = C3C8CFF619E9504C007E0BCB /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_WARN_ABOUT_RETURN_TYPE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; SYMROOT = "$(PROJECT_DIR)/../build"; @@ -387,7 +493,11 @@ baseConfigurationReference = C3C8CFF619E9504C007E0BCB /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; + GCC_WARN_ABOUT_RETURN_TYPE = YES; MACOSX_DEPLOYMENT_TARGET = 10.8; OTHER_LDFLAGS = ""; SYMROOT = "$(PROJECT_DIR)/../build"; @@ -397,6 +507,7 @@ 233E2D8A0A83C7AC005A62DF /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; PRODUCT_NAME = "Build & Install"; }; @@ -405,6 +516,7 @@ 233E2D8B0A83C7AC005A62DF /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; PRODUCT_NAME = "Build & Install"; }; diff --git a/QCPlugin/CorePlotQCPlugin.xcodeproj/xcshareddata/xcschemes/Build & Copy.xcscheme b/QCPlugin/CorePlotQCPlugin.xcodeproj/xcshareddata/xcschemes/Build & Copy.xcscheme new file mode 100644 index 000000000..7afa5ea4a --- /dev/null +++ b/QCPlugin/CorePlotQCPlugin.xcodeproj/xcshareddata/xcschemes/Build & Copy.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QCPlugin/CorePlotQCPlugin.xcodeproj/xcshareddata/xcschemes/CorePlotQCPlugin.xcscheme b/QCPlugin/CorePlotQCPlugin.xcodeproj/xcshareddata/xcschemes/CorePlotQCPlugin.xcscheme new file mode 100644 index 000000000..d1baaa5f3 --- /dev/null +++ b/QCPlugin/CorePlotQCPlugin.xcodeproj/xcshareddata/xcschemes/CorePlotQCPlugin.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/QCPlugin/English.lproj/Settings.xib b/QCPlugin/English.lproj/Settings.xib deleted file mode 100644 index a2ce340ec..000000000 --- a/QCPlugin/English.lproj/Settings.xib +++ /dev/null @@ -1,490 +0,0 @@ - - - - 1050 - 9J61 - 677 - 949.46 - 353.00 - - YES - - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - YES - - - YES - - - - YES - - QCPlugInViewController - - - FirstResponder - - - - 256 - - YES - - - 268 - {{17, 363}, {94, 14}} - - YES - - 68288064 - 272761856 - Number of Plots: - - LucidaGrande - 1.100000e+01 - 3100 - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2OQA - - - - 6 - System - controlTextColor - - 3 - MAA - - - - - - - 268 - {{116, 361}, {34, 19}} - - YES - - -1804468671 - 272761856 - - - - - YES - - YES - allowsFloats - formatterBehavior - minimum - negativeFormat - numberStyle - positiveFormat - - - YES - - - - ###0 - - ###0 - - - ###0 - ###0 - - - - - - - - - - NaN - - YES - - YES - - - YES - - - - - - 0 - 0 - YES - NO - 1 - AAAAAAAAAAAAAAAAAAAAAA - - - 3 - YES - YES - YES - - . - , - NO - YES - YES - - - YES - - 6 - System - textBackgroundColor - - 3 - MQA - - - - 6 - System - textColor - - - - - - - 268 - {{155, 359}, {15, 22}} - - YES - - 68025888 - 131072 - - - 1.000000e+02 - 1.000000e+00 - YES - YES - - - - - 36 - - YES - - - 256 - - YES - - - 268 - {{15, 14}, {234, 28}} - - YES - - 67239424 - 272760832 - Use the up and down arrows to select the number of plots. - - - - - - - - {{1, 1}, {264, 54}} - - - - {{17, 299}, {266, 56}} - - {0, 0} - - 67239424 - 0 - Box - - - - 3 - MCAwLjgwMDAwMDAxAA - - - - 1 - 0 - 0 - NO - - - {300, 400} - - - NSView - - NSResponder - - - NSApplication - - - YES - - - - - YES - - - view - - - - 10 - - - - value: plugIn.numberOfPlots - - - - - - value: plugIn.numberOfPlots - value - plugIn.numberOfPlots - 2 - - - 34 - - - - value: plugIn.numberOfPlots - - - - - - value: plugIn.numberOfPlots - value - plugIn.numberOfPlots - 2 - - - 35 - - - - - YES - - 0 - - YES - - - - - - -2 - - - RmlsZSdzIE93bmVyA - - - -1 - - - First Responder - - - 5 - - - YES - - - - - - - View - - - -3 - - - Application - - - 20 - - - - - 27 - - - YES - - - - - - 28 - - - - - 29 - - - YES - - - - - - 30 - - - YES - - - - - - 31 - - - YES - - - - - - 32 - - - - - 33 - - - - - 38 - - - YES - - - - - - 36 - - - YES - - - - - - 37 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 20.IBPluginDependency - 27.IBPluginDependency - 28.IBPluginDependency - 29.IBPluginDependency - 30.IBPluginDependency - 31.IBPluginDependency - 32.IBPluginDependency - 33.IBPluginDependency - 36.IBPluginDependency - 37.IBPluginDependency - 5.IBEditorWindowLastContentRect - 5.IBPluginDependency - 5.ImportedFromIB2 - 5.editorWindowContentRectSynchronizationRect - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{430, 228}, {300, 400}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{0, 1145}, {300, 400}} - - - - YES - - YES - - - YES - - - - - YES - - YES - - - YES - - - - 38 - - - 0 - ../CorePlotQCPlugin.xcodeproj - 3 - - diff --git a/README.md b/README.md index a7f06d994..b0b803087 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,29 @@ +Core Plot logo + +# Core Plot + +*Cocoa plotting framework for macOS, iOS, and tvOS.* + +[![Cocoapods platforms](https://img.shields.io/cocoapods/p/CorePlot?color=bright-green)](https://core-plot.github.io) [![core-plot CI](https://github.com/core-plot/core-plot/actions/workflows/ci.yml/badge.svg)](https://github.com/core-plot/core-plot/actions/workflows/ci.yml) +[![Cocoapods](https://img.shields.io/cocoapods/v/CorePlot?color=bright-green)](https://cocoapods.org/pods/CorePlot) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen?style=flat)](https://github.com/Carthage/Carthage) [![Swift Package Manager compatible](https://img.shields.io/badge/SPM-compatible-brightgreen)](https://github.com/apple/swift-package-manager) +[![GitHub license](https://img.shields.io/github/license/core-plot/core-plot?color=bright-green)](https://opensource.org/licenses/BSD-3-Clause) + # Introduction -Core Plot is a 2D plotting framework for Mac OS X and iOS. It is highly customizable and capable of drawing many types of plots. See the [Example Graphs](https://github.com/core-plot/core-plot/wiki/Example-Graphs) wiki page and the [example applications](https://github.com/core-plot/core-plot/tree/master/examples) for examples of some of its capabilities. +Core Plot is a 2D plotting framework for macOS, iOS, and tvOS. It is highly customizable and capable of drawing many types of plots. See the [Example Graphs](https://github.com/core-plot/core-plot/wiki/Example-Graphs) wiki page and the [example applications](https://github.com/core-plot/core-plot/tree/master/examples) for examples of some of its capabilities. # Getting Started -See the [High Level Design Overview](https://github.com/core-plot/core-plot/wiki/High-Level-Design-Overview) wiki for an overview of Core Plot's architecture and the [Using Core Plot in an Application](http://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications) wiki for information on how to use Core Plot in your own application. +See the [High Level Design Overview](https://github.com/core-plot/core-plot/wiki/High-Level-Design-Overview) wiki for an overview of Core Plot's architecture and the [Using Core Plot in an Application](https://github.com/core-plot/core-plot/wiki/Using-Core-Plot-in-an-Application) wiki for information on how to use Core Plot in your own application. # Documentation Documentation of the Core Plot API and high-level architecture can be found in the following places: * [Change log](https://github.com/core-plot/core-plot/blob/master/documentation/changelog.markdown) - * [API documentation](http://core-plot.github.io/MacOS/index.html) for Mac - * [API documentation](http://core-plot.github.io/iOS/index.html) for iOS - * API documentation built with [Doxygen](http://www.doxygen.org/) and installed locally in Xcode (see the [instructions](https://github.com/core-plot/core-plot/blob/master/READMEs/README%20for%20Docs%20Install.md) in the **READMEs** folder for details) + * [API documentation](https://core-plot.github.io/MacOS/index.html) for Mac + * [API documentation](https://core-plot.github.io/iOS/index.html) for iOS and tvOS + * API documentation built with [Doxygen](https://www.doxygen.nl/) and installed locally in Xcode (see the [instructions](https://github.com/core-plot/core-plot/blob/master/READMEs/README%20for%20Docs%20Install.md) in the **READMEs** folder for details) * [Project Wiki](https://github.com/core-plot/core-plot/wiki) on GitHub * [Documentation](https://github.com/core-plot/core-plot/tree/master/documentation) folder in the code repository @@ -21,13 +31,12 @@ Documentation of the Core Plot API and high-level architecture can be found in t ## Q&A Sites - * [Core Plot](http://groups.google.com/group/coreplot-discuss) Google Group - * Stackoverflow.com [core-plot tag](http://stackoverflow.com/questions/tagged/core-plot) + * [Core Plot](https://groups.google.com/group/coreplot-discuss) Google Group + * Stackoverflow.com [core-plot tag](https://stackoverflow.com/questions/tagged/core-plot) ## Social Networks * [Twitter](https://twitter.com/CorePlot) - * [App.net](https://alpha.app.net/coreplot); Subscribe to the [Announcements](https://app.net/c/2rw2) broadcast. # Contributing to Core Plot @@ -35,16 +44,12 @@ Core Plot is an open source project hosted on [GitHub](https://github.com/core-p * [core-plot](https://github.com/core-plot/core-plot): This is main code repository with the framework and all examples. This is where you will find the release packages, wiki pages, and issue tracker. - * [core-plot.github.io](https://github.com/core-plot/core-plot.github.io): This is the HTML API documentation. You can view the pages online at [http://core-plot.github.io](http://core-plot.github.io). + * [core-plot.github.io](https://github.com/core-plot/core-plot.github.io): This is the HTML API documentation. You can view the pages online at [https://core-plot.github.io](https://core-plot.github.io). ## Coding Standards -Everyone has a their own preferred coding style, and no one way can be considered right. Nonetheless, in a project like Core Plot, with many developers contributing, it is worthwhile defining a set of basic coding standards to prevent a mishmash of different styles which can become frustrating when navigating the code base. See the file [Coding Style.markdown](https://github.com/core-plot/core-plot/blob/master/documentation/Coding%20Style.markdown) found in the [documentation](https://github.com/core-plot/core-plot/tree/master/documentation) directory of the project source for specific guidelines. +Everyone has a their own preferred coding style, and no one way can be considered right. Nonetheless, in a project like Core Plot, with many developers contributing, it is worthwhile defining a set of basic coding standards to prevent a mishmash of different styles which can become frustrating when navigating the code base. See the file [CONTRIBUTING.md](https://github.com/core-plot/core-plot/blob/master/.github/CONTRIBUTING.md) found in the [.github](https://github.com/core-plot/core-plot/tree/master/.github) directory of the project source for specific guidelines. -Core Plot includes a [script](https://github.com/core-plot/core-plot/blob/master/scripts/format_core_plot.sh) to run [Uncrustify](http://uncrustify.sourceforge.net) on the source code to standardize the formatting. All source code will be formatted with this tool before being committed to the Core Plot repository. +Core Plot includes a [script](https://github.com/core-plot/core-plot/blob/master/scripts/format_core_plot.sh) to run [Uncrustify](https://github.com/uncrustify/uncrustify) on the source code to standardize the formatting. All source code will be formatted with this tool before being committed to the Core Plot repository. ## Testing -Because Core Plot is intended to be used in scientific, financial, and other domains where correctness is paramount, unit testing is integrated into the framework. Good test coverage protects developers from introducing accidental regressions and frees them to experiment and refactor without fear of breaking things. See the [unit testing](https://github.com/core-plot/core-plot/wiki/Unit-Testing) wiki page for instructions on how to build unit tests for any new code you add to the project. - -# Support Core Plot - -Flattr this +Core Plot is intended to be applied in scientific, financial, and other domains where correctness is paramount. In order to assure the quality of the framework, unit testing is integrated. Good test coverage protects developers from introducing accidental regressions, and helps them to experiment and refactor without breaking existing code. See the [unit testing](https://github.com/core-plot/core-plot/wiki/Unit-Testing) wiki page for instructions on how to build unit tests for any new code you add to the project. diff --git a/READMEs/README for Docs Install.md b/READMEs/README for Docs Install.md index 01cf04a82..57c19c0bd 100644 --- a/READMEs/README for Docs Install.md +++ b/READMEs/README for Docs Install.md @@ -8,10 +8,10 @@ # To Build the Documentation From Source -1. Install [Doxygen]([http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc) in **/Applications**. Core Plot requires Doxygen 1.8.6 or later. +1. Install [Doxygen]([http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc) in **/Applications**. Core Plot requires Doxygen 1.8.11 or later. -2. Install [Graphviz](http://www.graphviz.org/Download_macos.php). Core Plot requires Graphviz 2.34.0 or later. +2. Install [Graphviz](http://www.graphviz.org/Download_macos.php). Core Plot requires Graphviz 2.36.0 or later. -3. Open the **CorePlot** or **CorePlot-CocoaTouch** project in Xcode. +3. Open the **CorePlot** project in Xcode. -4. Build the "Documentation" target. \ No newline at end of file +4. Build the "Documentation-Mac" and/or "Documentation-iOS" targets. \ No newline at end of file diff --git a/READMEs/README for Static Library Install.md b/READMEs/README for Static Library Install.md index 286d1e38a..ece0cccd7 100644 --- a/READMEs/README for Static Library Install.md +++ b/READMEs/README for Static Library Install.md @@ -5,8 +5,8 @@ 2. Copy **libCorePlotCocoaTouch.a** to your Xcode project 3. Add the following flags to "Other Linker Flags" in your target build settings: - `-ObjC -all_load` + `-ObjC` -4. Add the **QuartzCore** framework to the project. +4. Add the **QuartzCore** and **Accelerate** frameworks to the project. 5. Add a `CPTGraph` to your application. See the example apps in Source Code to see how, or read the documentation. \ No newline at end of file diff --git a/documentation/changelog.markdown b/documentation/changelog.markdown index c3024755e..ed231ffeb 100644 --- a/documentation/changelog.markdown +++ b/documentation/changelog.markdown @@ -1,3 +1,96 @@ +# Release 2.3 (January 10, 2020) + +## Release Notes + +This release updates Core Plot to be compatible with Xcode 11 and Swift 5. It adds support for platform-native fonts and colors, including dynamic system colors. + +The Mac deployment target remains OS X 10.8. The iOS deployment target remains iOS 8.0 for both the framework and the static library. The tvOS deployment target remains tvOS 9.0. + +## Details +- **New**: Added support for platform native fonts (`NSFont` and `UIFont`). +- **New**: Added support for platform native colors (`NSColor` and `UIColor`), including dynamic system colors. +- **New**: Added support for variable bar widths in bar, range, and trading range plots. +- **Changed**: Updated the Core Plot project to prefer the new Xcode build system introduced with Xcode 9. +- **Changed**: Updated all framework and example code to be compatible with Xcode 11 and the latest SDKs on all platforms. +- **Changed**: Updated all Swift example apps to Swift 5. +- **Changed**: Added arm64e as a valid build architecture on iOS. +- **Changed**: Miscellaneous bug fixes and cleanup. +- **Removed**: Removed DTrace probing to support Xcode's New Build System. +- **Removed**: Removed docset generation. Docsets are no longer supported under Xcode 9.3. +- **Removed**: Removed the AAPLot and StockPlot example apps because the Yahoo finance API that both relied for data is no longer available. + + + +# Release 2.2 (September 18, 2016) + +## Release Notes + +This release updates Core Plot to be compatible with Xcode 8 and Swift 3. + +The Mac deployment target remains OS X 10.8. The iOS deployment target has changed to iOS 8.0 for both the framework and the static library. The tvOS deployment target remains tvOS 9.0. Core Plot no longer requires the Accelerate framework. + +## Details +- **New**: Increased the iOS deployment target to iOS 8. +- **Changed**: Added Swift name mappings for all string constants. +- **Changed**: Updated all Swift example apps to Swift 3. +- **Changed**: Miscellaneous bug fixes and cleanup. +- **Removed**: Removed the dependency on the Accelerate framework. + + + +# Release 2.1 (April 16, 2016) + +## Release Notes + +This release adds a tvOS framework and removes the deprecated `CorePlot-CocoaTouch.xcodeproj` project file. All Core Plot build targets for Mac, iOS, tvOS, and the documentation are in the `CorePlot.xcodeproj` project file. Annotated type definitions (e.g., `CPTNumberArray`) were changed to exclude the pointer star ("*") so they can be used interchangeably with class names. + +Curved scatter plots received several improvements. This release adds options to use Catmull-Rom and Hermite cubic splines to draw curved scatter plot lines. When a Hermite spline is used to draw a monotonic data series, the curved line will be monotonic as well. Plot spaces have new methods to scale the plot space to fit entire plots. + +The Mac deployment target has increased to OS X 10.8. The iOS deployment target remains iOS 6.0 for the static library and iOS 8.0 for the framework. The tvOS deployment target is tvOS 9.0. + +## Details +- **New**: Increased the Mac deployment target to OS X 10.8. +- **New**: Added a tvOS framework. +- **New**: Added an option to anchor alternating band fills to a specific starting value. +- **New**: Added support for animating `NSNumber` properties with `CPTAnimation`. +- **New**: Added support for `NSSecureCoding`. +- **New**: Added an option to draw legend swatches to the left or right side of the title. +- **New**: Added options to use Catmull-Rom and Hermite cubic splines to draw curved scatter plot lines. +- **New**: Added a method to automatically scale the plot space to fit the entire plot. +- **Changed**: Changed the annotated type definitions to exclude the pointer star ("*"). +- **Changed**: Miscellaneous bug fixes and cleanup. +- **Removed**: Removed the deprecated `CorePlot-CocoaTouch.xcodeproj` project file. + + + +# Release 2.0 (October 4, 2015) + +## Release Notes + +This release contains changes that will break apps built against earlier Core Plot +versions. For a cleaner public API and ease of use from Swift, all public properties and methods that take `NSDecimal` values have been changed to take `NSNumber` values instead. See the [Release 2.0 API Changes](https://github.com/core-plot/core-plot/wiki/Core-Plot-API-Changes-Between-Versions-1.x-and-2.x) wiki page for a detailed list of the API changes. + +The Mac and iOS projects have been combined into one project file. The `CorePlot-CocoaTouch.xcodeproj` project file is deprecated and will be removed in a future release. There is now an iOS framework target in addition to the static library in the `CorePlot.xcodeproj` project file. + +The deployment target has increased to iOS 6.0 for the static library and iOS 8.0 for the framework. The Mac deployment target remains OS X 10.7. + +## Details +- **New**: Combined the Mac and iOS projects and added an iOS framework target. The `CorePlot-CocoaTouch.xcodeproj` project file is deprecated. +- **New**: Added histogram style options to `CPTScatterPlot`. +- **New**: Added iOS unit tests. +- **New**: Added plot space point conversion methods that take an `NSArray` of coordinate values. +- **New**: Added nullability annotations to all property and method declarations. +- **New**: Added type annotations to all arrays, sets, and dictionaries. +- **New**: Added the log-modulus scale type. +- **Changed**: Increased the deployment target to iOS 6.0 and Mac OS X 10.7. The iOS framework requires iOS 8 or higher. +- **Changed**: Changed the Installation Directory for the Mac framework to "@rpath" and updated the Runpath Search Path in each Mac example app. +- **Changed**: Changed all public properties and methods that take `NSDecimal` values to take `NSNumber` values instead. Use `NSDecimalNumber` to maintain full decimal precision. +- **Changed**: Added properties to `CPTPlotRange` and `CPTMutablePlotRange` to read and write all range properties as `NSNumber`, `NSDecimal`, or `double`. +- **Changed**: Renamed the `CPTXYAxis.orthogonalCoordinateDecimal` property to `CPTXYAxis.orthogonalPosition`. +- **Changed**: Miscellaneous bug fixes and cleanup. + + + # Release 1.6 (May 9, 2015) ## Release Notes diff --git a/documentation/doxygen/doxygen touch.config b/documentation/doxygen/doxygen touch.config index 9d62214e5..01d4c0b2d 100644 --- a/documentation/doxygen/doxygen touch.config +++ b/documentation/doxygen/doxygen touch.config @@ -1,4 +1,4 @@ -# Doxyfile 1.8.9.1 +# Doxyfile 1.8.14 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -20,8 +20,8 @@ # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "Core Plot (iOS)" +PROJECT_NAME = "Core Plot (iOS and tvOS)" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -44,7 +44,7 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = "Cocoa plotting framework for Mac OS X and iOS" +PROJECT_BRIEF = "Cocoa plotting framework for macOS, iOS, and tvOS" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 @@ -226,7 +226,8 @@ TAB_SIZE = 4 # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. ALIASES = "YES=@ref YES" \ "NO=@ref NO" \ @@ -312,6 +313,15 @@ EXTENSION_MAPPING = MARKDOWN_SUPPORT = NO +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or @@ -337,7 +347,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -362,6 +372,13 @@ IDL_PROPERTY_SUPPORT = YES DISTRIBUTE_GROUP_DOC = NO +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent @@ -701,7 +718,7 @@ LAYOUT_FILE = "$(SOURCE_ROOT)/../documentation/doxygen/DoxygenLayout. # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -751,6 +768,12 @@ WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = YES +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated @@ -774,7 +797,7 @@ WARN_LOGFILE = # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with -# spaces. +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = "$(SOURCE_ROOT)/CorePlot-CocoaTouch.h" \ @@ -784,7 +807,7 @@ INPUT = "$(SOURCE_ROOT)/CorePlot-CocoaTouch.h" \ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of # possible encodings. # The default value is: UTF-8. @@ -792,12 +815,17 @@ INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. FILE_PATTERNS = @@ -887,6 +915,10 @@ IMAGE_PATH = "$(SOURCE_ROOT)/../documentation/" # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. INPUT_FILTER = @@ -896,6 +928,10 @@ INPUT_FILTER = # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. FILTER_PATTERNS = @@ -980,7 +1016,7 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: @@ -1013,7 +1049,7 @@ VERBATIM_HEADERS = YES # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was -# compiled with the --with-libclang option. +# generated with the -Duse-libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO @@ -1026,6 +1062,17 @@ CLANG_ASSISTED_PARSING = NO CLANG_OPTIONS = +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files +# were built. This is equivalent to specifying the "-p" option to a clang tool, +# such as clang-check. These options will then be passed to the parser. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: 0. + +CLANG_COMPILATION_DATABASE_PATH = 0 + #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1145,7 +1192,7 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1174,12 +1221,24 @@ HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via Javascript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have Javascript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1203,12 +1262,12 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# environment (see: https://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1324,7 +1383,7 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1332,8 +1391,7 @@ QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1341,23 +1399,21 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = @@ -1450,7 +1506,7 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # @@ -1462,7 +1518,7 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1489,8 +1545,8 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://www.mathjax.org/mathjax @@ -1551,7 +1607,7 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1564,7 +1620,7 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Xapian (see: https://xapian.org/). See the section "External Indexing and # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1649,9 +1705,12 @@ COMPACT_LATEX = NO PAPER_TYPE = letter # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names -# that should be included in the LaTeX output. To get the times font for -# instance you can specify -# EXTRA_PACKAGES=times +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1748,12 +1807,20 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_BIB_STYLE = plain +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -1923,9 +1990,9 @@ DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -2026,9 +2093,17 @@ INCLUDE_FILE_PATTERNS = # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. PREDEFINED = TARGET_OS_IPHONE, \ - TARGET_IPHONE_SIMULATOR, \ - "NS_ENUM(_type,_name):=enum _name : _type _name; enum _name : _type" \ - "NS_OPTIONS(_type,_name):=enum _name : _type _name; enum _name : _type" + TARGET_OS_TV, \ + TARGET_OS_SIMULATOR, \ + "NS_DESIGNATED_INITIALIZER:= " \ + "NS_RETURNS_INNER_POINTER:= " \ + "NS_ENUM(_type,_name):=enum _name : _type _name; enum _name : _type " \ + "NS_CLOSED_ENUM(_type,_name):=enum _name : _type _name; enum _name : _type " \ + "NS_OPTIONS(_type,_name):=enum _name : _type _name; enum _name : _type " \ + "NS_SWIFT_NAME(_name):= " \ + "cpt_deprecated:= " \ + "cpt_swift_enum:= " \ + "cpt_swift_struct:= " # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2255,7 +2330,8 @@ INCLUDED_BY_GRAPH = YES # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2266,7 +2342,8 @@ CALL_GRAPH = NO # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2289,11 +2366,15 @@ GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# http://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). -# Possible values are: png, jpg, gif and svg. +# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. # The default value is: png. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2344,6 +2425,11 @@ DIAFILE_DIRS = PLANTUML_JAR_PATH = +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. diff --git a/documentation/doxygen/doxygen-cocoa-tags.xml b/documentation/doxygen/doxygen-cocoa-tags.xml index 956632492..1578dd526 100644 --- a/documentation/doxygen/doxygen-cocoa-tags.xml +++ b/documentation/doxygen/doxygen-cocoa-tags.xml @@ -258,6 +258,15 @@ NSFastEnumeration-p NSMutableCopying-p + + NSMutableDictionary + https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSMutableDictionary_Class/Reference/Reference.html + NSObject + NSCoding-p + NSCopying-p + NSFastEnumeration-p + NSMutableCopying-p + NSEvent https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/Reference/Reference.html @@ -511,6 +520,24 @@ NSFastEnumeration-p NSMutableCopying-p + + NSMutableSet + https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSMutableSet_Class/Reference/Reference.html + NSObject + NSCoding-p + NSCopying-p + NSFastEnumeration-p + NSMutableCopying-p + + + NSSecureCoding + https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSSecureCoding_Protocol_Ref/ + + BOOL + supportsSecureCoding: + //apple_ref/occ/intfcm/NSSecureCoding/supportsSecureCoding + + NSString https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html @@ -731,6 +758,21 @@ + + CAAnimationDelegate + https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CAAnimationDelegate_protocol/Introduction/Introduction.html/ + NSObject-p + + void + animationDidStart: + //apple_ref/occ/intfcm/CAAnimationDelegate/animationDidStart + + + void + animationDidStop:finished: + //apple_ref/occ/intfcm/CAAnimationDelegate/animationDidStopfinished + + CALayer https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CALayer_class/Introduction/Introduction.html @@ -833,6 +875,36 @@ //apple_ref/occ/instm/CALayer/setNeedsLayout + + CALayerDelegate + https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CALayerDelegate_protocol/Introduction/Introduction.html/ + NSObject-p + + id + actionForLayer:forKey: + //apple_ref/occ/intfcm/CALayerDelegate/actionForLayerforKey + + + void + displayLayer: + //apple_ref/occ/intfcm/CALayerDelegate/displayLayer + + + void + drawLayer:inContext: + //apple_ref/occ/intfcm/CALayerDelegate/drawLayerinContext + + + void + layerWillDraw: + //apple_ref/occ/intfcm/CALayerDelegate/layerWillDraw + + + void + layoutSublayersOfLayer: + //apple_ref/occ/intfcm/CALayerDelegate/layoutSublayersOfLayer + + CAMediaTiming https://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/CAMediaTiming_protocol/Introduction/Introduction.html diff --git a/documentation/doxygen/doxygen-cocoa-touch-tags.xml b/documentation/doxygen/doxygen-cocoa-touch-tags.xml index 7b10f8fa8..1de3c13d3 100644 --- a/documentation/doxygen/doxygen-cocoa-touch-tags.xml +++ b/documentation/doxygen/doxygen-cocoa-touch-tags.xml @@ -241,6 +241,15 @@ NSFastEnumeration-p NSMutableCopying-p + + NSMutableDictionary + https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSMutableDictionary_Class/Reference/Reference.html + NSObject + NSCoding-p + NSCopying-p + NSFastEnumeration-p + NSMutableCopying-p + UIEvent https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIEvent_Class/Reference/Reference.html @@ -440,11 +449,29 @@ NSFastEnumeration-p NSMutableCopying-p + + NSMutableSet + https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSMutableSet_Class/Reference/Reference.html + NSObject + NSCoding-p + NSCopying-p + NSFastEnumeration-p + NSMutableCopying-p + UIResponder https://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIResponder_Class/Reference/Reference.html#//apple_ref/occ/cl/UIResponder NSObject + + NSSecureCoding + https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSSecureCoding_Protocol_Ref/ + + BOOL + supportsSecureCoding: + //apple_ref/occ/intfcm/NSSecureCoding/supportsSecureCoding + + NSString https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html @@ -660,6 +687,21 @@ + + CAAnimationDelegate + https://developer.apple.com/library/ios/documentation/Foundation/Reference/CAAnimationDelegate_Protocol_Ref/ + NSObject-p + + void + animationDidStart: + //apple_ref/occ/intfcm/CAAnimationDelegate/animationDidStart + + + void + animationDidStop:finished: + //apple_ref/occ/intfcm/CAAnimationDelegate/animationDidStopfinished + + CALayer https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CALayer_class/Introduction/Introduction.html @@ -761,6 +803,36 @@ //apple_ref/occ/instm/CALayer/setNeedsLayout + + CALayerDelegate + https://developer.apple.com/library/ios/documentation/Foundation/Reference/CALayerDelegate_Protocol_Ref/ + NSObject-p + + id + actionForLayer:forKey: + //apple_ref/occ/intfcm/CALayerDelegate/actionForLayerforKey + + + void + displayLayer: + //apple_ref/occ/intfcm/CALayerDelegate/displayLayer + + + void + drawLayer:inContext: + //apple_ref/occ/intfcm/CALayerDelegate/drawLayerinContext + + + void + layerWillDraw: + //apple_ref/occ/intfcm/CALayerDelegate/layerWillDraw + + + void + layoutSublayersOfLayer: + //apple_ref/occ/intfcm/CALayerDelegate/layoutSublayersOfLayer + + CAMediaTiming https://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CAMediaTiming_protocol/Introduction/Introduction.html @@ -927,4 +999,4 @@ //apple_ref/c/tdef/NSZone - \ No newline at end of file + diff --git a/documentation/doxygen/doxygen.config b/documentation/doxygen/doxygen.config index 6324933d5..46ed09de4 100644 --- a/documentation/doxygen/doxygen.config +++ b/documentation/doxygen/doxygen.config @@ -1,4 +1,4 @@ -# Doxyfile 1.8.9.1 +# Doxyfile 1.8.14 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -20,8 +20,8 @@ # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "Core Plot (Mac OS)" +PROJECT_NAME = "Core Plot (macOS)" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -44,7 +44,7 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = "Cocoa plotting framework for Mac OS X and iOS" +PROJECT_BRIEF = "Cocoa plotting framework for macOS, iOS, and tvOS" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 @@ -226,7 +226,8 @@ TAB_SIZE = 4 # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. ALIASES = "YES=@ref YES" \ "NO=@ref NO" \ @@ -312,6 +313,15 @@ EXTENSION_MAPPING = MARKDOWN_SUPPORT = NO +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or @@ -337,7 +347,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -362,6 +372,13 @@ IDL_PROPERTY_SUPPORT = YES DISTRIBUTE_GROUP_DOC = NO +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent @@ -701,7 +718,7 @@ LAYOUT_FILE = "$(SOURCE_ROOT)/../documentation/doxygen/DoxygenLayout. # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. @@ -751,6 +768,12 @@ WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = YES +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated @@ -774,7 +797,7 @@ WARN_LOGFILE = # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with -# spaces. +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = "$(SOURCE_ROOT)/CorePlot.h" \ @@ -784,7 +807,7 @@ INPUT = "$(SOURCE_ROOT)/CorePlot.h" \ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of # possible encodings. # The default value is: UTF-8. @@ -792,12 +815,17 @@ INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. FILE_PATTERNS = @@ -887,6 +915,10 @@ IMAGE_PATH = "$(SOURCE_ROOT)/../documentation/" # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. INPUT_FILTER = @@ -896,6 +928,10 @@ INPUT_FILTER = # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. FILTER_PATTERNS = @@ -980,7 +1016,7 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: @@ -1013,7 +1049,7 @@ VERBATIM_HEADERS = YES # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was -# compiled with the --with-libclang option. +# generated with the -Duse-libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO @@ -1026,6 +1062,17 @@ CLANG_ASSISTED_PARSING = NO CLANG_OPTIONS = +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files +# were built. This is equivalent to specifying the "-p" option to a clang tool, +# such as clang-check. These options will then be passed to the parser. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: 0. + +CLANG_COMPILATION_DATABASE_PATH = 0 + #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- @@ -1145,7 +1192,7 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1174,12 +1221,24 @@ HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via Javascript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have Javascript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1203,12 +1262,12 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# environment (see: https://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1324,7 +1383,7 @@ QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1332,8 +1391,7 @@ QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). +# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1341,23 +1399,21 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). +# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = @@ -1450,7 +1506,7 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # @@ -1462,7 +1518,7 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1489,8 +1545,8 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://www.mathjax.org/mathjax @@ -1551,7 +1607,7 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1564,7 +1620,7 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Xapian (see: https://xapian.org/). See the section "External Indexing and # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1649,9 +1705,12 @@ COMPACT_LATEX = NO PAPER_TYPE = letter # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names -# that should be included in the LaTeX output. To get the times font for -# instance you can specify -# EXTRA_PACKAGES=times +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1748,12 +1807,20 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_BIB_STYLE = plain +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -1923,9 +1990,9 @@ DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -2025,8 +2092,15 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = "NS_ENUM(_type,_name):=enum _name : _type _name; enum _name : _type" \ - "NS_OPTIONS(_type,_name):=enum _name : _type _name; enum _name : _type" +PREDEFINED = "NS_DESIGNATED_INITIALIZER:= " \ + "NS_RETURNS_INNER_POINTER:= " \ + "NS_ENUM(_type,_name):=enum _name : _type _name; enum _name : _type " \ + "NS_CLOSED_ENUM(_type,_name):=enum _name : _type _name; enum _name : _type " \ + "NS_OPTIONS(_type,_name):=enum _name : _type _name; enum _name : _type " \ + "NS_SWIFT_NAME(_name):= " \ + "cpt_deprecated:= " \ + "cpt_swift_enum:= " \ + "cpt_swift_struct:= " # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -2253,7 +2327,8 @@ INCLUDED_BY_GRAPH = YES # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2264,7 +2339,8 @@ CALL_GRAPH = NO # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2287,11 +2363,15 @@ GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# http://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). -# Possible values are: png, jpg, gif and svg. +# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. # The default value is: png. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2342,6 +2422,11 @@ DIAFILE_DIRS = PLANTUML_JAR_PATH = +# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a +# configuration file for plantuml. + +PLANTUML_CFG_FILE = + # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. diff --git a/examples/AAPLot/AAPL.plist b/examples/AAPLot/AAPL.plist deleted file mode 100644 index 482c91dc4..000000000 --- a/examples/AAPLot/AAPL.plist +++ /dev/null @@ -1,963 +0,0 @@ - - - - - endDate - 2009-06-19T02:55:22Z - financialData - - - adjClose - 144.67 - close - 144.67 - date - 2009-06-05T04:00:00Z - high - 146.4 - low - 143.21 - open - 145.31 - volume - 22585700 - - - adjClose - 143.74 - close - 143.74 - date - 2009-06-04T04:00:00Z - high - 144.18 - low - 140.04 - open - 140.13 - volume - 19537200 - - - adjClose - 140.95 - close - 140.95 - date - 2009-06-03T04:00:00Z - high - 141.11 - low - 139.07 - open - 140 - volume - 20171800 - - - adjClose - 139.49 - close - 139.49 - date - 2009-06-02T04:00:00Z - high - 141.34 - low - 138.35 - open - 138.99 - volume - 16199500 - - - adjClose - 139.35 - close - 139.35 - date - 2009-06-01T04:00:00Z - high - 139.99 - low - 136 - open - 136.47 - volume - 16160700 - - - adjClose - 135.81 - close - 135.81 - date - 2009-05-29T04:00:00Z - high - 135.9 - low - 133.85 - open - 135.39 - volume - 16304800 - - - adjClose - 135.07 - close - 135.07 - date - 2009-05-28T04:00:00Z - high - 135.39 - low - 132.03 - open - 133.45 - volume - 17397200 - - - adjClose - 133.05 - close - 133.05 - date - 2009-05-27T04:00:00Z - high - 134.98 - low - 130.91 - open - 131.78 - volume - 23086500 - - - adjClose - 130.78 - close - 130.78 - date - 2009-05-26T04:00:00Z - high - 130.83 - low - 124.55 - open - 124.76 - volume - 22692300 - - - adjClose - 122.5 - close - 122.5 - date - 2009-05-22T04:00:00Z - high - 124.18 - low - 121.75 - open - 124.05 - volume - 10642800 - - - adjClose - 124.18 - close - 124.18 - date - 2009-05-21T04:00:00Z - high - 126.78 - low - 122.89 - open - 125.15 - volume - 14569500 - - - adjClose - 125.87 - close - 125.87 - date - 2009-05-20T04:00:00Z - high - 129.21 - low - 125.3 - open - 127.63 - volume - 13878000 - - - adjClose - 127.45 - close - 127.45 - date - 2009-05-19T04:00:00Z - high - 129.31 - low - 125.74 - open - 126.82 - volume - 13300800 - - - adjClose - 126.65 - close - 126.65 - date - 2009-05-18T04:00:00Z - high - 126.7 - low - 121.57 - open - 123.73 - volume - 16387200 - - - adjClose - 122.42 - close - 122.42 - date - 2009-05-15T04:00:00Z - high - 124.62 - low - 121.61 - open - 122.32 - volume - 13127400 - - - adjClose - 122.95 - close - 122.95 - date - 2009-05-14T04:00:00Z - high - 123.53 - low - 119.7 - open - 119.78 - volume - 15993800 - - - adjClose - 119.49 - close - 119.49 - date - 2009-05-13T04:00:00Z - high - 124.02 - low - 119.38 - open - 123.21 - volume - 21284700 - - - adjClose - 124.42 - close - 124.42 - date - 2009-05-12T04:00:00Z - high - 129.71 - low - 123.25 - open - 129.56 - volume - 21767200 - - - adjClose - 129.57 - close - 129.57 - date - 2009-05-11T04:00:00Z - high - 130.96 - low - 127.12 - open - 127.37 - volume - 14452100 - - - adjClose - 129.19 - close - 129.19 - date - 2009-05-08T04:00:00Z - high - 131.23 - low - 126.26 - open - 129.04 - volume - 16713000 - - - adjClose - 129.06 - close - 129.06 - date - 2009-05-07T04:00:00Z - high - 132.39 - low - 127.9 - open - 132.33 - volume - 18992000 - - - adjClose - 132.5 - close - 132.5 - date - 2009-05-06T04:00:00Z - high - 133.5 - low - 130.22 - open - 133.33 - volume - 16912100 - - - adjClose - 132.71 - close - 132.71 - date - 2009-05-05T04:00:00Z - high - 132.86 - low - 131.12 - open - 131.75 - volume - 14223400 - - - adjClose - 132.07 - close - 132.07 - date - 2009-05-04T04:00:00Z - high - 132.25 - low - 127.68 - open - 128.24 - volume - 21762800 - - - adjClose - 127.24 - close - 127.24 - date - 2009-05-01T04:00:00Z - high - 127.95 - low - 125.8 - open - 125.8 - volume - 14197000 - - - adjClose - 125.83 - close - 125.83 - date - 2009-04-30T04:00:00Z - high - 127 - low - 124.92 - open - 126.22 - volume - 17803200 - - - adjClose - 125.14 - close - 125.14 - date - 2009-04-29T04:00:00Z - high - 126.85 - low - 123.83 - open - 124.85 - volume - 16361100 - - - adjClose - 123.9 - close - 123.9 - date - 2009-04-28T04:00:00Z - high - 126.21 - low - 123.26 - open - 123.35 - volume - 16280600 - - - adjClose - 124.73 - close - 124.73 - date - 2009-04-27T04:00:00Z - high - 125 - low - 122.66 - open - 122.9 - volume - 17167500 - - - adjClose - 123.9 - close - 123.9 - date - 2009-04-24T04:00:00Z - high - 125.14 - low - 122.97 - open - 124.64 - volume - 19313000 - - - adjClose - 125.4 - close - 125.4 - date - 2009-04-23T04:00:00Z - high - 127.2 - low - 123.51 - open - 126.62 - volume - 33755600 - - - adjClose - 121.51 - close - 121.51 - date - 2009-04-22T04:00:00Z - high - 125.35 - low - 121.2 - open - 122.63 - volume - 33527400 - - - adjClose - 121.76 - close - 121.76 - date - 2009-04-21T04:00:00Z - high - 122.14 - low - 118.6 - open - 118.89 - volume - 16810200 - - - adjClose - 120.5 - close - 120.5 - date - 2009-04-20T04:00:00Z - high - 122.99 - low - 119.16 - open - 121.73 - volume - 16659500 - - - adjClose - 123.42 - close - 123.42 - date - 2009-04-17T04:00:00Z - high - 124.25 - low - 120.25 - open - 121.18 - volume - 17767700 - - - adjClose - 121.45 - close - 121.45 - date - 2009-04-16T04:00:00Z - high - 123.15 - low - 118.79 - open - 119.19 - volume - 21194500 - - - adjClose - 117.64 - close - 117.64 - date - 2009-04-15T04:00:00Z - high - 118.25 - low - 115.76 - open - 117.2 - volume - 14745800 - - - adjClose - 118.31 - close - 118.31 - date - 2009-04-14T04:00:00Z - high - 120.17 - low - 117.25 - open - 119.57 - volume - 16236500 - - - adjClose - 120.22 - close - 120.22 - date - 2009-04-13T04:00:00Z - high - 120.98 - low - 119 - open - 120.01 - volume - 13901300 - - - adjClose - 119.57 - close - 119.57 - date - 2009-04-09T04:00:00Z - high - 120 - low - 117.96 - open - 118.42 - volume - 18955600 - - - adjClose - 116.32 - close - 116.32 - date - 2009-04-08T04:00:00Z - high - 116.79 - low - 114.58 - open - 115.43 - volume - 16272500 - - - adjClose - 115 - close - 115 - date - 2009-04-07T04:00:00Z - high - 116.67 - low - 114.19 - open - 116.53 - volume - 19163600 - - - adjClose - 118.45 - close - 118.45 - date - 2009-04-06T04:00:00Z - high - 118.75 - low - 113.28 - open - 114.94 - volume - 23502300 - - - adjClose - 115.99 - close - 115.99 - date - 2009-04-03T04:00:00Z - high - 116.13 - low - 113.52 - open - 114.19 - volume - 22722900 - - - adjClose - 112.71 - close - 112.71 - date - 2009-04-02T04:00:00Z - high - 114.75 - low - 109.78 - open - 110.14 - volume - 29013100 - - - adjClose - 108.69 - close - 108.69 - date - 2009-04-01T04:00:00Z - high - 109 - low - 103.89 - open - 104.09 - volume - 21049000 - - - adjClose - 105.12 - close - 105.12 - date - 2009-03-31T04:00:00Z - high - 107.45 - low - 105 - open - 105.45 - volume - 20338500 - - - adjClose - 104.49 - close - 104.49 - date - 2009-03-30T04:00:00Z - high - 105.01 - low - 102.61 - open - 104.51 - volume - 17957000 - - - adjClose - 106.85 - close - 106.85 - date - 2009-03-27T04:00:00Z - high - 108.53 - low - 106.4 - open - 108.23 - volume - 17602600 - - - adjClose - 109.87 - close - 109.87 - date - 2009-03-26T04:00:00Z - high - 109.98 - low - 107.58 - open - 107.83 - volume - 22009000 - - - adjClose - 106.49 - close - 106.49 - date - 2009-03-25T04:00:00Z - high - 108.36 - low - 103.86 - open - 107.58 - volume - 23093500 - - - adjClose - 106.5 - close - 106.5 - date - 2009-03-24T04:00:00Z - high - 109.44 - low - 105.39 - open - 106.36 - volume - 22879000 - - - adjClose - 107.66 - close - 107.66 - date - 2009-03-23T04:00:00Z - high - 108.16 - low - 101.75 - open - 102.71 - volume - 23799900 - - - adjClose - 101.59 - close - 101.59 - date - 2009-03-20T04:00:00Z - high - 103.11 - low - 100.57 - open - 102.09 - volume - 24842400 - - - adjClose - 101.62 - close - 101.62 - date - 2009-03-19T04:00:00Z - high - 103.2 - low - 100.25 - open - 101.85 - volume - 17863600 - - - adjClose - 101.52 - close - 101.52 - date - 2009-03-18T04:00:00Z - high - 103.48 - low - 99.72 - open - 99.91 - volume - 28429900 - - - adjClose - 99.66 - close - 99.66 - date - 2009-03-17T04:00:00Z - high - 99.69 - low - 95.07000000000001 - open - 95.23999999999999 - volume - 28094500 - - - adjClose - 95.42 - close - 95.42 - date - 2009-03-16T04:00:00Z - high - 97.39 - low - 94.17999999999999 - open - 96.53 - volume - 28473000 - - - adjClose - 95.92999999999999 - close - 95.92999999999999 - date - 2009-03-13T04:00:00Z - high - 97.2 - low - 95.01000000000001 - open - 96.3 - volume - 21470300 - - - overallHigh - 146.4 - overallLow - 94.17999999999999 - startDate - 2009-03-27T02:55:22Z - symbol - AAPL - - diff --git a/examples/AAPLot/AAPLot.png b/examples/AAPLot/AAPLot.png deleted file mode 100644 index c218d2598..000000000 Binary files a/examples/AAPLot/AAPLot.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot.xcodeproj/project.pbxproj b/examples/AAPLot/AAPLot.xcodeproj/project.pbxproj deleted file mode 100644 index 4ee5307e5..000000000 --- a/examples/AAPLot/AAPLot.xcodeproj/project.pbxproj +++ /dev/null @@ -1,438 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 073703570FE5193C006D46AD /* APFinancialData.m in Sources */ = {isa = PBXBuildFile; fileRef = 073703560FE5193C006D46AD /* APFinancialData.m */; }; - 073703B10FE51E6C006D46AD /* NSDateFormatterExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 073703B00FE51E6C006D46AD /* NSDateFormatterExtensions.m */; }; - 1D3623260D0F684500981E51 /* AAPLotAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* AAPLotAppDelegate.m */; }; - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - 280E754D0DD40C5E005A515E /* FlipsideView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 280E754A0DD40C5E005A515E /* FlipsideView.xib */; }; - 280E754E0DD40C5E005A515E /* MainView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 280E754B0DD40C5E005A515E /* MainView.xib */; }; - 280E754F0DD40C5E005A515E /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 280E754C0DD40C5E005A515E /* MainWindow.xib */; }; - 288765590DF743DE002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765580DF743DE002DB57D /* CoreGraphics.framework */; }; - 289233A60DB2D0840083E9F9 /* FlipsideView.m in Sources */ = {isa = PBXBuildFile; fileRef = 289233A30DB2D0840083E9F9 /* FlipsideView.m */; }; - 289233AE0DB2D0DB0083E9F9 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 289233A90DB2D0DB0083E9F9 /* MainViewController.m */; }; - 289233AF0DB2D0DB0083E9F9 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 289233AB0DB2D0DB0083E9F9 /* RootViewController.m */; }; - 289233B00DB2D0DB0083E9F9 /* FlipsideViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 289233AD0DB2D0DB0083E9F9 /* FlipsideViewController.m */; }; - AB8989470FE0309E00FDC37F /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB8989460FE0309E00FDC37F /* QuartzCore.framework */; }; - AB8F944A0FDEF5DC00E61485 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AB8F94490FDEF56700E61485 /* libCorePlot-CocoaTouch.a */; }; - AB8F94580FDEFA1500E61485 /* APYahooDataPuller.m in Sources */ = {isa = PBXBuildFile; fileRef = AB8F94570FDEFA1500E61485 /* APYahooDataPuller.m */; }; - ABA5345E0FEB40CE0046A8DA /* AAPL.plist in Resources */ = {isa = PBXBuildFile; fileRef = ABA5345D0FEB40CE0046A8DA /* AAPL.plist */; }; - C3CD283017DE9B9C008EED1E /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3CD282F17DE9B9C008EED1E /* Accelerate.framework */; }; - C3D3936C19FD6B1D00148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3936B19FD6B1D00148319 /* Images.xcassets */; }; - C3F0BA3919EC9F6300F7CB47 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3F0BA3819EC9F6300F7CB47 /* Launch Screen.xib */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - AB8F94480FDEF56700E61485 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = AB8F94440FDEF56700E61485 /* CorePlot-CocoaTouch.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = BC9B83470FB8A0A40035D8DA; - remoteInfo = "CorePlot-CocoaTouch"; - }; - AB8F944B0FDEF5E000E61485 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = AB8F94440FDEF56700E61485 /* CorePlot-CocoaTouch.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = BC9B83460FB8A0A40035D8DA; - remoteInfo = "CorePlot-CocoaTouch"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 073703550FE5193C006D46AD /* APFinancialData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APFinancialData.h; sourceTree = ""; }; - 073703560FE5193C006D46AD /* APFinancialData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APFinancialData.m; sourceTree = ""; }; - 073703AF0FE51E6C006D46AD /* NSDateFormatterExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDateFormatterExtensions.h; sourceTree = ""; }; - 073703B00FE51E6C006D46AD /* NSDateFormatterExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSDateFormatterExtensions.m; sourceTree = ""; }; - 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1D3623240D0F684500981E51 /* AAPLotAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAPLotAppDelegate.h; sourceTree = ""; }; - 1D3623250D0F684500981E51 /* AAPLotAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AAPLotAppDelegate.m; sourceTree = ""; }; - 1D6058910D05DD3D006BFB54 /* AAPLot.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AAPLot.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 280E754A0DD40C5E005A515E /* FlipsideView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FlipsideView.xib; sourceTree = ""; }; - 280E754B0DD40C5E005A515E /* MainView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainView.xib; sourceTree = ""; }; - 280E754C0DD40C5E005A515E /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainWindow.xib; path = ../MainWindow.xib; sourceTree = ""; }; - 288765580DF743DE002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 289233A20DB2D0840083E9F9 /* FlipsideView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FlipsideView.h; path = Classes/FlipsideView.h; sourceTree = ""; }; - 289233A30DB2D0840083E9F9 /* FlipsideView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FlipsideView.m; path = Classes/FlipsideView.m; sourceTree = ""; }; - 289233A80DB2D0DB0083E9F9 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MainViewController.h; path = Classes/MainViewController.h; sourceTree = ""; }; - 289233A90DB2D0DB0083E9F9 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MainViewController.m; path = Classes/MainViewController.m; sourceTree = ""; }; - 289233AA0DB2D0DB0083E9F9 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; - 289233AB0DB2D0DB0083E9F9 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; }; - 289233AC0DB2D0DB0083E9F9 /* FlipsideViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FlipsideViewController.h; path = Classes/FlipsideViewController.h; sourceTree = ""; }; - 289233AD0DB2D0DB0083E9F9 /* FlipsideViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FlipsideViewController.m; path = Classes/FlipsideViewController.m; sourceTree = ""; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* AAPLot_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AAPLot_Prefix.pch; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - AB8989460FE0309E00FDC37F /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - AB8F94440FDEF56700E61485 /* CorePlot-CocoaTouch.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "CorePlot-CocoaTouch.xcodeproj"; path = "../../framework/CorePlot-CocoaTouch.xcodeproj"; sourceTree = SOURCE_ROOT; }; - AB8F94560FDEFA1500E61485 /* APYahooDataPuller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APYahooDataPuller.h; sourceTree = ""; }; - AB8F94570FDEFA1500E61485 /* APYahooDataPuller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APYahooDataPuller.m; sourceTree = ""; }; - ABA5345D0FEB40CE0046A8DA /* AAPL.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = AAPL.plist; sourceTree = ""; }; - C3CA9B5819E1F79B008DF7A3 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/CorePlotWarnings.xcconfig; sourceTree = ""; }; - C3CD282F17DE9B9C008EED1E /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; - C3D3936B19FD6B1D00148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = AAPLot/Images.xcassets; sourceTree = ""; }; - C3F0BA3819EC9F6300F7CB47 /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "Launch Screen.xib"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, - 288765590DF743DE002DB57D /* CoreGraphics.framework in Frameworks */, - AB8F944A0FDEF5DC00E61485 /* libCorePlot-CocoaTouch.a in Frameworks */, - AB8989470FE0309E00FDC37F /* QuartzCore.framework in Frameworks */, - C3CD283017DE9B9C008EED1E /* Accelerate.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0737034D0FE518E7006D46AD /* Data Acquisition */ = { - isa = PBXGroup; - children = ( - AB8F94560FDEFA1500E61485 /* APYahooDataPuller.h */, - AB8F94570FDEFA1500E61485 /* APYahooDataPuller.m */, - 073703550FE5193C006D46AD /* APFinancialData.h */, - 073703560FE5193C006D46AD /* APFinancialData.m */, - 073703AF0FE51E6C006D46AD /* NSDateFormatterExtensions.h */, - 073703B00FE51E6C006D46AD /* NSDateFormatterExtensions.m */, - ); - name = "Data Acquisition"; - sourceTree = ""; - }; - 080E96DDFE201D6D7F000001 /* Application Controllers */ = { - isa = PBXGroup; - children = ( - 280E754C0DD40C5E005A515E /* MainWindow.xib */, - 1D3623240D0F684500981E51 /* AAPLotAppDelegate.h */, - 1D3623250D0F684500981E51 /* AAPLotAppDelegate.m */, - 289233AA0DB2D0DB0083E9F9 /* RootViewController.h */, - 289233AB0DB2D0DB0083E9F9 /* RootViewController.m */, - ); - name = "Application Controllers"; - path = Classes; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 1D6058910D05DD3D006BFB54 /* AAPLot.app */, - ); - name = Products; - sourceTree = ""; - }; - 281C6CD70DB2D82200F60ACC /* Flipside View */ = { - isa = PBXGroup; - children = ( - 280E754A0DD40C5E005A515E /* FlipsideView.xib */, - 289233A20DB2D0840083E9F9 /* FlipsideView.h */, - 289233A30DB2D0840083E9F9 /* FlipsideView.m */, - 289233AC0DB2D0DB0083E9F9 /* FlipsideViewController.h */, - 289233AD0DB2D0DB0083E9F9 /* FlipsideViewController.m */, - ); - name = "Flipside View"; - sourceTree = ""; - }; - 289233A00DB2D0730083E9F9 /* Main View */ = { - isa = PBXGroup; - children = ( - 280E754B0DD40C5E005A515E /* MainView.xib */, - 289233A80DB2D0DB0083E9F9 /* MainViewController.h */, - 289233A90DB2D0DB0083E9F9 /* MainViewController.m */, - C3F0BA3819EC9F6300F7CB47 /* Launch Screen.xib */, - ); - name = "Main View"; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - AB8F94440FDEF56700E61485 /* CorePlot-CocoaTouch.xcodeproj */, - 289233A00DB2D0730083E9F9 /* Main View */, - 0737034D0FE518E7006D46AD /* Data Acquisition */, - 281C6CD70DB2D82200F60ACC /* Flipside View */, - 080E96DDFE201D6D7F000001 /* Application Controllers */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - indentWidth = 4; - name = CustomTemplate; - sourceTree = ""; - tabWidth = 4; - usesTabs = 0; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* AAPLot_Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main.m */, - C3CA9B5819E1F79B008DF7A3 /* CorePlotWarnings.xcconfig */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - C3D3936B19FD6B1D00148319 /* Images.xcassets */, - ABA5345D0FEB40CE0046A8DA /* AAPL.plist */, - 8D1107310486CEB800E47090 /* Info.plist */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - AB8989460FE0309E00FDC37F /* QuartzCore.framework */, - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, - 1D30AB110D05D00D00671497 /* Foundation.framework */, - 288765580DF743DE002DB57D /* CoreGraphics.framework */, - C3CD282F17DE9B9C008EED1E /* Accelerate.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - AB8F94450FDEF56700E61485 /* Products */ = { - isa = PBXGroup; - children = ( - AB8F94490FDEF56700E61485 /* libCorePlot-CocoaTouch.a */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* AAPLot */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "AAPLot" */; - buildPhases = ( - 1D60588D0D05DD3D006BFB54 /* Resources */, - 1D60588E0D05DD3D006BFB54 /* Sources */, - 1D60588F0D05DD3D006BFB54 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - AB8F944C0FDEF5E000E61485 /* PBXTargetDependency */, - ); - name = AAPLot; - productName = AAPLot; - productReference = 1D6058910D05DD3D006BFB54 /* AAPLot.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0700; - TargetAttributes = { - 1D6058900D05DD3D006BFB54 = { - DevelopmentTeam = 28ZA45DE7D; - }; - }; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AAPLot" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - en, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = AB8F94450FDEF56700E61485 /* Products */; - ProjectRef = AB8F94440FDEF56700E61485 /* CorePlot-CocoaTouch.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 1D6058900D05DD3D006BFB54 /* AAPLot */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - AB8F94490FDEF56700E61485 /* libCorePlot-CocoaTouch.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libCorePlot-CocoaTouch.a"; - remoteRef = AB8F94480FDEF56700E61485 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 1D60588D0D05DD3D006BFB54 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 280E754D0DD40C5E005A515E /* FlipsideView.xib in Resources */, - 280E754E0DD40C5E005A515E /* MainView.xib in Resources */, - C3D3936C19FD6B1D00148319 /* Images.xcassets in Resources */, - 280E754F0DD40C5E005A515E /* MainWindow.xib in Resources */, - ABA5345E0FEB40CE0046A8DA /* AAPL.plist in Resources */, - C3F0BA3919EC9F6300F7CB47 /* Launch Screen.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1D60588E0D05DD3D006BFB54 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, - 1D3623260D0F684500981E51 /* AAPLotAppDelegate.m in Sources */, - 289233A60DB2D0840083E9F9 /* FlipsideView.m in Sources */, - 289233AE0DB2D0DB0083E9F9 /* MainViewController.m in Sources */, - 289233AF0DB2D0DB0083E9F9 /* RootViewController.m in Sources */, - 289233B00DB2D0DB0083E9F9 /* FlipsideViewController.m in Sources */, - AB8F94580FDEFA1500E61485 /* APYahooDataPuller.m in Sources */, - 073703570FE5193C006D46AD /* APFinancialData.m in Sources */, - 073703B10FE51E6C006D46AD /* NSDateFormatterExtensions.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - AB8F944C0FDEF5E000E61485 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "CorePlot-CocoaTouch"; - targetProxy = AB8F944B0FDEF5E000E61485 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 1D6058940D05DD3E006BFB54 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = AAPLot_Prefix.pch; - HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = Info.plist; - OTHER_LDFLAGS = ( - "-ObjC", - "-all_load", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; - PRODUCT_NAME = AAPLot; - }; - name = Debug; - }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - COPY_PHASE_STRIP = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = AAPLot_Prefix.pch; - HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = Info.plist; - OTHER_LDFLAGS = ( - "-ObjC", - "-all_load", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; - PRODUCT_NAME = AAPLot; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3CA9B5819E1F79B008DF7A3 /* CorePlotWarnings.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SYMROOT = "$(SRCROOT)/../../build"; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3CA9B5819E1F79B008DF7A3 /* CorePlotWarnings.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - SDKROOT = iphoneos; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "AAPLot" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D6058940D05DD3E006BFB54 /* Debug */, - 1D6058950D05DD3E006BFB54 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AAPLot" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/examples/AAPLot/AAPLot.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/AAPLot/AAPLot.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 0044da799..000000000 --- a/examples/AAPLot/AAPLot.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Contents.json b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 340f2376e..000000000 --- a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "images" : [ - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-Spotlight-40@2x.png", - "scale" : "2x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon.png", - "scale" : "1x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png deleted file mode 100644 index 489d32b6c..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png deleted file mode 100644 index e732a791c..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Small.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Small.png deleted file mode 100644 index 0310c42a8..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Small.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png deleted file mode 100644 index 8170f07ca..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png deleted file mode 100644 index c7fba2304..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon.png deleted file mode 100644 index ca3d9f35b..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon@2x.png b/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon@2x.png deleted file mode 100644 index d67508c07..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/AppIcon.appiconset/Icon@2x.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot/Images.xcassets/LaunchImage.launchimage/Contents.json b/examples/AAPLot/AAPLot/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index f0fce5477..000000000 --- a/examples/AAPLot/AAPLot/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "filename" : "Default-568h@2x.png", - "minimum-system-version" : "7.0", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "scale" : "1x", - "orientation" : "portrait" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "orientation" : "portrait" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "filename" : "Default-568h@2x.png", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "minimum-system-version" : "7.0", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/AAPLot/AAPLot/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png b/examples/AAPLot/AAPLot/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png deleted file mode 100644 index 0891b7aab..000000000 Binary files a/examples/AAPLot/AAPLot/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png and /dev/null differ diff --git a/examples/AAPLot/AAPLot_Prefix.pch b/examples/AAPLot/AAPLot_Prefix.pch deleted file mode 100644 index dc5f28052..000000000 --- a/examples/AAPLot/AAPLot_Prefix.pch +++ /dev/null @@ -1,10 +0,0 @@ -// -// Prefix header for all source files of the 'AAPLot' target in the 'AAPLot' project -// - -#define DEBUG (1) - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/examples/AAPLot/APFinancialData.h b/examples/AAPLot/APFinancialData.h deleted file mode 100644 index 7ca481d37..000000000 --- a/examples/AAPLot/APFinancialData.h +++ /dev/null @@ -1,7 +0,0 @@ -#import - -@interface NSDictionary(APFinancialData) - -+(id)dictionaryWithCSVLine:(NSString *)csvLine; - -@end diff --git a/examples/AAPLot/APFinancialData.m b/examples/AAPLot/APFinancialData.m deleted file mode 100644 index f274794b2..000000000 --- a/examples/AAPLot/APFinancialData.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "APFinancialData.h" -#import "NSDateFormatterExtensions.h" - -@implementation NSDictionary(APFinancialData) - -+(id)dictionaryWithCSVLine:(NSString *)csvLine -{ - NSArray *csvChunks = [csvLine componentsSeparatedByString:@","]; - - NSMutableDictionary *csvDict = [NSMutableDictionary dictionaryWithCapacity:7]; - - // Date,Open,High,Low,Close,Volume,Adj Close - // 2009-06-08,143.82,144.23,139.43,143.85,33255400,143.85 - NSDate *theDate = [[NSDateFormatter csvDateFormatter] dateFromString:(NSString *)csvChunks[0]]; - - csvDict[@"date"] = theDate; - NSDecimalNumber *theOpen = [NSDecimalNumber decimalNumberWithString:(NSString *)csvChunks[1]]; - csvDict[@"open"] = theOpen; - NSDecimalNumber *theHigh = [NSDecimalNumber decimalNumberWithString:(NSString *)csvChunks[2]]; - csvDict[@"high"] = theHigh; - NSDecimalNumber *theLow = [NSDecimalNumber decimalNumberWithString:(NSString *)csvChunks[3]]; - csvDict[@"low"] = theLow; - NSDecimalNumber *theClose = [NSDecimalNumber decimalNumberWithString:(NSString *)csvChunks[4]]; - csvDict[@"close"] = theClose; - NSDecimalNumber *theVolume = [NSDecimalNumber decimalNumberWithString:(NSString *)csvChunks[5]]; - csvDict[@"volume"] = theVolume; - NSDecimalNumber *theAdjClose = [NSDecimalNumber decimalNumberWithString:(NSString *)csvChunks[6]]; - csvDict[@"adjClose"] = theAdjClose; - - //non-mutable autoreleased dict - return [NSDictionary dictionaryWithDictionary:csvDict]; -} - -@end diff --git a/examples/AAPLot/APYahooDataPuller.h b/examples/AAPLot/APYahooDataPuller.h deleted file mode 100644 index 2e6c505d6..000000000 --- a/examples/AAPLot/APYahooDataPuller.h +++ /dev/null @@ -1,31 +0,0 @@ -#import - -@class APYahooDataPuller; - -@protocol APYahooDataPullerDelegate - -@optional - --(void)dataPullerDidFinishFetch:(APYahooDataPuller *)dp; - -@end - -@interface APYahooDataPuller : NSObject - -@property (nonatomic, readwrite, weak) id delegate; -@property (nonatomic, readwrite, copy) NSString *symbol; -@property (nonatomic, readwrite, strong) NSDate *startDate; -@property (nonatomic, readwrite, strong) NSDate *endDate; -@property (nonatomic, readwrite, copy) NSString *targetSymbol; -@property (nonatomic, readwrite, strong) NSDate *targetStartDate; -@property (nonatomic, readwrite, strong) NSDate *targetEndDate; -@property (nonatomic, readonly, strong) NSArray *financialData; -@property (nonatomic, readonly, strong) NSDecimalNumber *overallHigh; -@property (nonatomic, readonly, strong) NSDecimalNumber *overallLow; -@property (nonatomic, readonly, strong) NSDecimalNumber *overallVolumeHigh; -@property (nonatomic, readonly, strong) NSDecimalNumber *overallVolumeLow; -@property (nonatomic, readonly, assign) BOOL loadingData; - --(instancetype)initWithTargetSymbol:(NSString *)aSymbol targetStartDate:(NSDate *)aStartDate targetEndDate:(NSDate *)anEndDate; - -@end diff --git a/examples/AAPLot/APYahooDataPuller.m b/examples/AAPLot/APYahooDataPuller.m deleted file mode 100644 index 8bc95d6c0..000000000 --- a/examples/AAPLot/APYahooDataPuller.m +++ /dev/null @@ -1,380 +0,0 @@ -#import "APFinancialData.h" -#import "APYahooDataPuller.h" - -@interface APYahooDataPuller() - -@property (nonatomic, readwrite, copy) NSString *csvString; - -@property (nonatomic, readwrite, strong) NSDecimalNumber *overallHigh; -@property (nonatomic, readwrite, strong) NSDecimalNumber *overallLow; -@property (nonatomic, readwrite, strong) NSDecimalNumber *overallVolumeHigh; -@property (nonatomic, readwrite, strong) NSDecimalNumber *overallVolumeLow; -@property (nonatomic, readwrite, strong) NSArray *financialData; - -@property (nonatomic, readwrite, assign) BOOL loadingData; -@property (nonatomic, readwrite, strong) NSMutableData *receivedData; -@property (nonatomic, readwrite, strong) NSURLConnection *connection; - --(void)fetch; --(NSString *)URL; --(void)notifyPulledData; --(void)parseCSVAndPopulate; - -NSTimeInterval timeIntervalForNumberOfWeeks(double numberOfWeeks); - -@end - -#pragma mark - - -NSTimeInterval timeIntervalForNumberOfWeeks(double numberOfWeeks) -{ - NSTimeInterval seconds = fabs(60.0 * 60.0 * 24.0 * 7.0 * numberOfWeeks); - - return seconds; -} - -@implementation APYahooDataPuller - -@synthesize symbol; -@synthesize startDate; -@synthesize endDate; -@synthesize targetStartDate; -@synthesize targetEndDate; -@synthesize targetSymbol; -@synthesize overallLow; -@synthesize overallHigh; -@synthesize overallVolumeHigh; -@synthesize overallVolumeLow; -@synthesize csvString; -@synthesize financialData; - -@synthesize receivedData; -@synthesize connection; -@synthesize loadingData; - -@synthesize delegate; - --(void)setDelegate:(id)aDelegate -{ - if ( delegate != aDelegate ) { - delegate = aDelegate; - if ( self.financialData.count > 0 ) { - [self notifyPulledData]; //loads cached data onto UI - } - } -} - --(NSDictionary *)plistRep -{ - NSMutableDictionary *rep = [NSMutableDictionary dictionaryWithCapacity:7]; - - rep[@"symbol"] = [self symbol]; - rep[@"startDate"] = [self startDate]; - rep[@"endDate"] = [self endDate]; - rep[@"overallHigh"] = [self overallHigh]; - rep[@"overallLow"] = [self overallLow]; - rep[@"overallVolumeHigh"] = [self overallVolumeHigh]; - rep[@"overallVolumeLow"] = [self overallVolumeLow]; - rep[@"financialData"] = [self financialData]; - return [NSDictionary dictionaryWithDictionary:rep]; -} - --(BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag -{ - NSLog(@"writeToFile:%@", path); - BOOL success = [[self plistRep] writeToFile:path atomically:flag]; - return success; -} - --(instancetype)initWithDictionary:(NSDictionary *)aDict targetSymbol:(NSString *)aSymbol targetStartDate:(NSDate *)aStartDate targetEndDate:(NSDate *)anEndDate -{ - self = [super init]; - if ( self != nil ) { - self.symbol = aDict[@"symbol"]; - self.startDate = aDict[@"startDate"]; - self.overallLow = [NSDecimalNumber decimalNumberWithDecimal:[aDict[@"overallLow"] decimalValue]]; - self.overallHigh = [NSDecimalNumber decimalNumberWithDecimal:[aDict[@"overallHigh"] decimalValue]]; - self.endDate = aDict[@"endDate"]; - self.financialData = aDict[@"financialData"]; - - self.targetSymbol = aSymbol; - self.targetStartDate = aStartDate; - self.targetEndDate = anEndDate; - self.csvString = @""; - [self performSelector:@selector(fetch) withObject:nil afterDelay:0.01]; - } - return self; -} - --(NSString *)pathForSymbol:(NSString *)aSymbol -{ - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsDirectory = paths[0]; - NSString *docPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.plist", aSymbol]]; - - return docPath; -} - --(NSString *)faultTolerantPathForSymbol:(NSString *)aSymbol -{ - NSString *docPath = [self pathForSymbol:aSymbol]; - - if ( ![[NSFileManager defaultManager] fileExistsAtPath:docPath] ) { - //if there isn't one in the user's documents directory, see if we ship with this data - docPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.plist", aSymbol]]; - } - return docPath; -} - -//Always returns *something* --(NSDictionary *)dictionaryForSymbol:(NSString *)aSymbol -{ - NSString *path = [self faultTolerantPathForSymbol:aSymbol]; - NSMutableDictionary *localPlistDict = [NSMutableDictionary dictionaryWithContentsOfFile:path]; - - return localPlistDict; -} - --(instancetype)initWithTargetSymbol:(NSString *)aSymbol targetStartDate:(NSDate *)aStartDate targetEndDate:(NSDate *)anEndDate -{ - NSDictionary *cachedDictionary = [self dictionaryForSymbol:aSymbol]; - - if ( nil != cachedDictionary ) { - return [self initWithDictionary:cachedDictionary targetSymbol:aSymbol targetStartDate:aStartDate targetEndDate:anEndDate]; - } - - NSMutableDictionary *rep = [NSMutableDictionary dictionaryWithCapacity:7]; - rep[@"symbol"] = aSymbol; - rep[@"startDate"] = aStartDate; - rep[@"endDate"] = anEndDate; - rep[@"overallHigh"] = [NSDecimalNumber notANumber]; - rep[@"overallLow"] = [NSDecimalNumber notANumber]; - rep[@"financialData"] = @[]; - return [self initWithDictionary:rep targetSymbol:aSymbol targetStartDate:aStartDate targetEndDate:anEndDate]; -} - --(instancetype)init -{ - NSTimeInterval secondsAgo = -timeIntervalForNumberOfWeeks(14.0); //12 weeks ago - NSDate *start = [NSDate dateWithTimeIntervalSinceNow:secondsAgo]; - - NSDate *end = [NSDate date]; - - return [self initWithTargetSymbol:@"GOOG" targetStartDate:start targetEndDate:end]; -} - --(void)dealloc -{ - delegate = nil; -} - -// http://www.goldb.org/ystockquote.html --(NSString *)URL -{ - unsigned int unitFlags = NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitYear; - - NSCalendar *gregorian = [[NSCalendar alloc] - initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; - - NSDateComponents *compsStart = [gregorian components:unitFlags fromDate:self.targetStartDate]; - NSDateComponents *compsEnd = [gregorian components:unitFlags fromDate:self.targetEndDate]; - - NSString *url = [NSString stringWithFormat:@"http://ichart.yahoo.com/table.csv?s=%@&", [self targetSymbol]]; - - url = [url stringByAppendingFormat:@"a=%ld&", (long)[compsStart month] - 1]; - url = [url stringByAppendingFormat:@"b=%ld&", (long)[compsStart day]]; - url = [url stringByAppendingFormat:@"c=%ld&", (long)[compsStart year]]; - - url = [url stringByAppendingFormat:@"d=%ld&", (long)[compsEnd month] - 1]; - url = [url stringByAppendingFormat:@"e=%ld&", (long)[compsEnd day]]; - url = [url stringByAppendingFormat:@"f=%ld&", (long)[compsEnd year]]; - url = [url stringByAppendingString:@"g=d&"]; - - url = [url stringByAppendingString:@"ignore=.csv"]; - url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - return url; -} - --(void)notifyPulledData -{ - id theDelegate = self.delegate; - - if ( [theDelegate respondsToSelector:@selector(dataPullerDidFinishFetch:)] ) { - [theDelegate performSelector:@selector(dataPullerDidFinishFetch:) withObject:self]; - } -} - -#pragma mark - -#pragma mark Downloading of data - --(BOOL)shouldDownload -{ - BOOL shouldDownload = YES; - - return shouldDownload; -} - --(void)fetch -{ - if ( self.loadingData ) { - return; - } - - if ( [self shouldDownload] ) { - self.loadingData = YES; - NSString *urlString = [self URL]; - NSLog(@"URL = %@", urlString); - NSURL *url = [NSURL URLWithString:urlString]; - NSURLRequest *theRequest = [NSURLRequest requestWithURL:url - cachePolicy:NSURLRequestUseProtocolCachePolicy - timeoutInterval:60.0]; - - // create the connection with the request - // and start loading the data - self.connection = [NSURLConnection connectionWithRequest:theRequest delegate:self]; - if ( self.connection ) { - self.receivedData = [NSMutableData data]; - } - else { - //TODO: Inform the user that the download could not be started - self.loadingData = NO; - } - } -} - --(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data -{ - // append the new data to the receivedData - [self.receivedData appendData:data]; -} - --(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response -{ - // this method is called when the server has determined that it - // has enough information to create the NSURLResponse - // it can be called multiple times, for example in the case of a - // redirect, so each time we reset the data. - [self.receivedData setLength:0]; -} - --(void)cancelDownload -{ - if ( self.loadingData ) { - [self.connection cancel]; - self.loadingData = NO; - - self.receivedData = nil; - self.connection = nil; - } -} - --(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error -{ - self.loadingData = NO; - self.receivedData = nil; - self.connection = nil; - NSLog(@"err = %@", [error localizedDescription]); - //TODO:report err -} - --(void)connectionDidFinishLoading:(NSURLConnection *)connection -{ - self.loadingData = NO; - self.connection = nil; - - NSString *csv = [[NSString alloc] initWithData:self.receivedData encoding:NSUTF8StringEncoding]; - self.csvString = csv; - - self.receivedData = nil; - [self parseCSVAndPopulate]; - - //see if we need to write to file - NSDictionary *dictionaryForSymbol = [self dictionaryForSymbol:self.symbol]; - - BOOL sameSymbol = NO; - NSString *dictSymbol = dictionaryForSymbol[@"symbol"]; - if ( dictSymbol ) { - sameSymbol = [[self symbol] isEqualToString:dictSymbol]; - } - - BOOL sameStart = NO; - NSDate *dictStart = dictionaryForSymbol[@"startDate"]; - if ( dictStart ) { - sameStart = ([[self startDate] compare:dictStart] != NSOrderedSame); - } - - BOOL sameEnd = NO; - NSDate *dictEnd = dictionaryForSymbol[@"endDate"]; - if ( dictEnd ) { - sameEnd = ([[self startDate] compare:dictEnd] != NSOrderedSame); - } - - if ( !sameSymbol || !sameStart || !sameEnd ) { - [self writeToFile:[self pathForSymbol:self.symbol] atomically:YES]; - } - else { - NSLog(@"Not writing to file -- No Need, its data is fresh."); - } -} - --(void)parseCSVAndPopulate -{ - NSArray *csvLines = [self.csvString componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]; - NSMutableArray *newFinancials = [NSMutableArray arrayWithCapacity:[csvLines count]]; - NSDictionary *currentFinancial = nil; - NSString *line = nil; - - self.overallHigh = [NSDecimalNumber notANumber]; - self.overallLow = [NSDecimalNumber notANumber]; - self.overallVolumeHigh = [NSDecimalNumber notANumber]; - self.overallVolumeLow = [NSDecimalNumber notANumber]; - - for ( NSUInteger i = 1; i < [csvLines count] - 1; i++ ) { - line = (NSString *)csvLines[i]; - currentFinancial = [NSDictionary dictionaryWithCSVLine:line]; - [newFinancials addObject:currentFinancial]; - - NSDecimalNumber *high = currentFinancial[@"high"]; - NSDecimalNumber *low = currentFinancial[@"low"]; - NSDecimalNumber *volume = currentFinancial[@"volume"]; - - if ( [self.overallHigh isEqual:[NSDecimalNumber notANumber]] ) { - self.overallHigh = high; - } - - if ( [self.overallLow isEqual:[NSDecimalNumber notANumber]] ) { - self.overallLow = low; - } - - if ( [low compare:self.overallLow] == NSOrderedAscending ) { - self.overallLow = low; - } - if ( [high compare:self.overallHigh] == NSOrderedDescending ) { - self.overallHigh = high; - } - - if ( [self.overallVolumeHigh isEqual:[NSDecimalNumber notANumber]] ) { - self.overallVolumeHigh = volume; - } - - if ( [self.overallVolumeLow isEqual:[NSDecimalNumber notANumber]] ) { - self.overallVolumeLow = volume; - } - - if ( [volume compare:self.overallVolumeLow] == NSOrderedAscending ) { - self.overallVolumeLow = volume; - } - - if ( [volume compare:self.overallVolumeHigh] == NSOrderedDescending ) { - self.overallVolumeHigh = volume; - } - } - self.startDate = self.targetStartDate; - self.endDate = self.targetEndDate; - self.symbol = self.targetSymbol; - - [self setFinancialData:[NSArray arrayWithArray:newFinancials]]; - [self notifyPulledData]; -} - -@end diff --git a/examples/AAPLot/Classes/AAPLotAppDelegate.h b/examples/AAPLot/Classes/AAPLotAppDelegate.h deleted file mode 100644 index c55b9f096..000000000 --- a/examples/AAPLot/Classes/AAPLotAppDelegate.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// AAPLotAppDelegate.h -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import - -@class RootViewController; - -@interface AAPLotAppDelegate : NSObject - -@property (nonatomic, strong) IBOutlet UIWindow *window; -@property (nonatomic, strong) IBOutlet RootViewController *rootViewController; - -@end diff --git a/examples/AAPLot/Classes/AAPLotAppDelegate.m b/examples/AAPLot/Classes/AAPLotAppDelegate.m deleted file mode 100644 index bc20eff63..000000000 --- a/examples/AAPLot/Classes/AAPLotAppDelegate.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// AAPLotAppDelegate.m -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import "AAPLotAppDelegate.h" -#import "RootViewController.h" - -@implementation AAPLotAppDelegate - -@synthesize window; -@synthesize rootViewController; - --(void)applicationDidFinishLaunching:(UIApplication *)application -{ - self.window.rootViewController = self.rootViewController; - [self.window makeKeyAndVisible]; -} - -@end diff --git a/examples/AAPLot/Classes/FlipsideView.h b/examples/AAPLot/Classes/FlipsideView.h deleted file mode 100644 index 9a407b402..000000000 --- a/examples/AAPLot/Classes/FlipsideView.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// FlipsideView.h -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import - -@interface FlipsideView : UIView { -} - -@end diff --git a/examples/AAPLot/Classes/FlipsideView.m b/examples/AAPLot/Classes/FlipsideView.m deleted file mode 100644 index 21d8c4f55..000000000 --- a/examples/AAPLot/Classes/FlipsideView.m +++ /dev/null @@ -1,26 +0,0 @@ -// -// FlipsideView.m -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import "FlipsideView.h" - -@implementation FlipsideView - --(instancetype)initWithFrame:(CGRect)frame -{ - if ( (self = [super initWithFrame:frame]) ) { - // Initialization code - } - return self; -} - --(void)drawRect:(CGRect)rect -{ - // Drawing code -} - -@end diff --git a/examples/AAPLot/Classes/FlipsideViewController.h b/examples/AAPLot/Classes/FlipsideViewController.h deleted file mode 100644 index ed84c2d55..000000000 --- a/examples/AAPLot/Classes/FlipsideViewController.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// FlipsideViewController.h -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import - -@interface FlipsideViewController : UIViewController { -} - -@end diff --git a/examples/AAPLot/Classes/FlipsideViewController.m b/examples/AAPLot/Classes/FlipsideViewController.m deleted file mode 100644 index 727f8548e..000000000 --- a/examples/AAPLot/Classes/FlipsideViewController.m +++ /dev/null @@ -1,39 +0,0 @@ -// -// FlipsideViewController.m -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import "FlipsideViewController.h" - -@implementation FlipsideViewController - --(void)viewDidLoad -{ - [super viewDidLoad]; - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - if ( [UIColor respondsToSelector:@selector(viewFlipsideBackgroundColor)] ) { - self.view.backgroundColor = [UIColor viewFlipsideBackgroundColor]; - } -#pragma clang diagnostic pop -} - -/* - * // Override to allow orientations other than the default portrait orientation. - * - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - * // Return YES for supported orientations - * return (interfaceOrientation == UIInterfaceOrientationPortrait); - * } - */ - --(void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview - // Release anything that's not essential, such as cached data -} - -@end diff --git a/examples/AAPLot/Classes/MainViewController.h b/examples/AAPLot/Classes/MainViewController.h deleted file mode 100644 index f907b8530..000000000 --- a/examples/AAPLot/Classes/MainViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -#import "APYahooDataPuller.h" -#import "CorePlot-CocoaTouch.h" -#import - -@class CPTGraphHostingView; -@class APYahooDataPuller; -@class CPTXYGraph; - -@interface MainViewController : UIViewController - -@property (nonatomic, readwrite, strong) IBOutlet CPTGraphHostingView *graphHost; - -@end diff --git a/examples/AAPLot/Classes/MainViewController.m b/examples/AAPLot/Classes/MainViewController.m deleted file mode 100644 index b0b67309c..000000000 --- a/examples/AAPLot/Classes/MainViewController.m +++ /dev/null @@ -1,670 +0,0 @@ -#import "APFinancialData.h" -#import "APYahooDataPuller.h" -#import "MainViewController.h" - -#define ROWS_FIRST_DATA_ORDER 1 - -@interface MainViewController() - -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; -@property (nonatomic, readwrite, strong) APYahooDataPuller *datapuller; - -@end - -@implementation MainViewController - -@synthesize graph; -@synthesize datapuller; -@synthesize graphHost; - --(void)setView:(UIView *)aView -{ - [super setView:aView]; - if ( nil == aView ) { - self.graph = nil; - self.graphHost = nil; - } -} - --(void)viewDidLoad -{ - CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:self.view.bounds]; - CPTTheme *theme = [CPTTheme themeNamed:kCPTStocksTheme]; - - [newGraph applyTheme:theme]; - self.graph = newGraph; - - newGraph.paddingRight = 50.0; - newGraph.paddingLeft = 50.0; - newGraph.plotAreaFrame.masksToBorder = NO; - newGraph.plotAreaFrame.cornerRadius = 0.0; - - CPTMutableLineStyle *borderLineStyle = [CPTMutableLineStyle lineStyle]; - borderLineStyle.lineColor = [CPTColor whiteColor]; - borderLineStyle.lineWidth = 2.0; - newGraph.plotAreaFrame.borderLineStyle = borderLineStyle; - self.graphHost.hostedGraph = newGraph; - - // Axes - CPTXYAxisSet *xyAxisSet = (CPTXYAxisSet *)newGraph.axisSet; - CPTXYAxis *xAxis = xyAxisSet.xAxis; - CPTMutableLineStyle *lineStyle = [xAxis.axisLineStyle mutableCopy]; - lineStyle.lineCap = kCGLineCapButt; - xAxis.axisLineStyle = lineStyle; - xAxis.labelingPolicy = CPTAxisLabelingPolicyNone; - - CPTXYAxis *yAxis = xyAxisSet.yAxis; - yAxis.axisLineStyle = nil; - - // Line plot with gradient fill - CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] initWithFrame:newGraph.bounds]; - dataSourceLinePlot.identifier = @"Data Source Plot"; - dataSourceLinePlot.dataLineStyle = nil; - dataSourceLinePlot.dataSource = self; - dataSourceLinePlot.cachePrecision = CPTPlotCachePrecisionDouble; - [newGraph addPlot:dataSourceLinePlot]; - - CPTColor *areaColor = [CPTColor colorWithComponentRed:CPTFloat(1.0) green:CPTFloat(1.0) blue:CPTFloat(1.0) alpha:CPTFloat(0.6)]; - CPTGradient *areaGradient = [CPTGradient gradientWithBeginningColor:areaColor endingColor:[CPTColor clearColor]]; - areaGradient.angle = -90.0; - CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient]; - dataSourceLinePlot.areaFill = areaGradientFill; - dataSourceLinePlot.areaBaseValue = CPTDecimalFromDouble(200.0); - - areaColor = [CPTColor colorWithComponentRed:CPTFloat(0.0) green:CPTFloat(1.0) blue:CPTFloat(0.0) alpha:CPTFloat(0.6)]; - areaGradient = [CPTGradient gradientWithBeginningColor:[CPTColor clearColor] endingColor:areaColor]; - areaGradient.angle = -90.0; - areaGradientFill = [CPTFill fillWithGradient:areaGradient]; - dataSourceLinePlot.areaFill2 = areaGradientFill; - dataSourceLinePlot.areaBaseValue2 = CPTDecimalFromDouble(400.0); - - // OHLC plot - CPTMutableLineStyle *whiteLineStyle = [CPTMutableLineStyle lineStyle]; - whiteLineStyle.lineColor = [CPTColor whiteColor]; - whiteLineStyle.lineWidth = 1.0; - CPTTradingRangePlot *ohlcPlot = [[CPTTradingRangePlot alloc] initWithFrame:newGraph.bounds]; - ohlcPlot.identifier = @"OHLC"; - ohlcPlot.lineStyle = whiteLineStyle; - CPTMutableTextStyle *whiteTextStyle = [CPTMutableTextStyle textStyle]; - whiteTextStyle.color = [CPTColor whiteColor]; - whiteTextStyle.fontSize = 8.0; - ohlcPlot.labelTextStyle = whiteTextStyle; - ohlcPlot.labelOffset = 5.0; - ohlcPlot.stickLength = 2.0; - ohlcPlot.dataSource = self; - ohlcPlot.plotStyle = CPTTradingRangePlotStyleOHLC; - ohlcPlot.cachePrecision = CPTPlotCachePrecisionDecimal; - [newGraph addPlot:ohlcPlot]; - - // Add plot space for bar chart - CPTXYPlotSpace *volumePlotSpace = [[CPTXYPlotSpace alloc] init]; - volumePlotSpace.identifier = @"Volume Plot Space"; - [newGraph addPlotSpace:volumePlotSpace]; - - // Volume plot - CPTBarPlot *volumePlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor blackColor] horizontalBars:NO]; - volumePlot.dataSource = self; - - lineStyle = [volumePlot.lineStyle mutableCopy]; - lineStyle.lineColor = [CPTColor whiteColor]; - volumePlot.lineStyle = lineStyle; - - volumePlot.fill = nil; - volumePlot.barWidth = CPTDecimalFromFloat(1.0f); - volumePlot.identifier = @"Volume Plot"; - volumePlot.cachePrecision = CPTPlotCachePrecisionDouble; - [newGraph addPlot:volumePlot toPlotSpace:volumePlotSpace]; - - // Data puller - NSDate *start = [NSDate dateWithTimeIntervalSinceNow:-60.0 * 60.0 * 24.0 * 7.0 * 12.0]; // 12 weeks ago - NSDate *end = [NSDate date]; - APYahooDataPuller *dp = [[APYahooDataPuller alloc] initWithTargetSymbol:@"AAPL" targetStartDate:start targetEndDate:end]; - [self setDatapuller:dp]; - [dp setDelegate:self]; - - [super viewDidLoad]; -} - --(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - if ( (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) ) { - } - return self; -} - -#pragma mark - -#pragma mark Plot Data Source Methods - --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot -{ - return self.datapuller.financialData.count; -} - -#if ROWS_FIRST_DATA_ORDER - --(CPTNumericData *)dataForPlot:(CPTPlot *)plot recordIndexRange:(NSRange)indexRange -{ - NSArray *financialData = self.datapuller.financialData; - const NSUInteger financialDataCount = financialData.count; - - const BOOL useDoubles = plot.doublePrecisionCache; - - NSUInteger numFields = plot.numberOfFields; - - if ( [plot.identifier isEqual:@"Volume Plot"] ) { - numFields = 2; - } - - NSMutableData *data = [[NSMutableData alloc] initWithLength:indexRange.length * numFields * ( useDoubles ? sizeof(double) : sizeof(NSDecimal) )]; - - const NSUInteger maxIndex = NSMaxRange(indexRange); - - if ( [plot.identifier isEqual:@"Data Source Plot"] ) { - if ( useDoubles ) { - double *nextValue = data.mutableBytes; - - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - NSDictionary *fData = (NSDictionary *)financialData[financialDataCount - i - 1]; - NSNumber *value; - - for ( NSUInteger fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - switch ( fieldEnum ) { - case CPTScatterPlotFieldX: - *nextValue++ = (double)(i + 1); - break; - - case CPTScatterPlotFieldY: - value = fData[@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = [value doubleValue]; - break; - - default: - break; - } - } - } - } - else { - NSDecimal *nextValue = data.mutableBytes; - - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - NSDictionary *fData = (NSDictionary *)financialData[financialDataCount - i - 1]; - NSNumber *value; - - for ( NSUInteger fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - switch ( fieldEnum ) { - case CPTScatterPlotFieldX: - *nextValue++ = CPTDecimalFromUnsignedInteger(i + 1); - break; - - case CPTScatterPlotFieldY: - value = fData[@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = [value decimalValue]; - break; - - default: - break; - } - } - } - } - } - else if ( [plot.identifier isEqual:@"Volume Plot"] ) { - if ( useDoubles ) { - double *nextValue = data.mutableBytes; - - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - NSDictionary *fData = (NSDictionary *)financialData[financialDataCount - i - 1]; - NSNumber *value; - - for ( NSUInteger fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - switch ( fieldEnum ) { - case CPTBarPlotFieldBarLocation: - *nextValue++ = (double)(i + 1); - break; - - case CPTBarPlotFieldBarTip: - value = fData[@"volume"]; - NSAssert(value, @"Volume value was nil"); - *nextValue++ = [value doubleValue]; - break; - - default: - break; - } - } - } - } - else { - NSDecimal *nextValue = data.mutableBytes; - - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - NSDictionary *fData = (NSDictionary *)financialData[financialDataCount - i - 1]; - NSNumber *value; - - for ( NSUInteger fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - switch ( fieldEnum ) { - case CPTBarPlotFieldBarLocation: - *nextValue++ = CPTDecimalFromUnsignedInteger(i + 1); - break; - - case CPTBarPlotFieldBarTip: - value = fData[@"volume"]; - NSAssert(value, @"Volume value was nil"); - *nextValue++ = [value decimalValue]; - break; - - default: - break; - } - } - } - } - } - else { - if ( useDoubles ) { - double *nextValue = data.mutableBytes; - - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - NSDictionary *fData = (NSDictionary *)financialData[financialDataCount - i - 1]; - NSNumber *value; - - for ( NSUInteger fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - switch ( fieldEnum ) { - case CPTTradingRangePlotFieldX: - *nextValue++ = (double)(i + 1); - break; - - case CPTTradingRangePlotFieldOpen: - value = fData[@"open"]; - NSAssert(value, @"Open value was nil"); - *nextValue++ = [value doubleValue]; - break; - - case CPTTradingRangePlotFieldHigh: - value = fData[@"high"]; - NSAssert(value, @"High value was nil"); - *nextValue++ = [value doubleValue]; - break; - - case CPTTradingRangePlotFieldLow: - value = fData[@"low"]; - NSAssert(value, @"Low value was nil"); - *nextValue++ = [value doubleValue]; - break; - - case CPTTradingRangePlotFieldClose: - value = fData[@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = [value doubleValue]; - break; - - default: - break; - } - } - } - } - else { - NSDecimal *nextValue = data.mutableBytes; - - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - NSDictionary *fData = (NSDictionary *)financialData[financialDataCount - i - 1]; - NSNumber *value; - - for ( NSUInteger fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - switch ( fieldEnum ) { - case CPTTradingRangePlotFieldX: - *nextValue++ = CPTDecimalFromUnsignedInteger(i + 1); - break; - - case CPTTradingRangePlotFieldOpen: - value = fData[@"open"]; - NSAssert(value, @"Open value was nil"); - *nextValue++ = [value decimalValue]; - break; - - case CPTTradingRangePlotFieldHigh: - value = fData[@"high"]; - NSAssert(value, @"High value was nil"); - *nextValue++ = [value decimalValue]; - break; - - case CPTTradingRangePlotFieldLow: - value = fData[@"low"]; - NSAssert(value, @"Low value was nil"); - *nextValue++ = [value decimalValue]; - break; - - case CPTTradingRangePlotFieldClose: - value = fData[@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = [value decimalValue]; - break; - - default: - break; - } - } - } - } - } - - CPTMutableNumericData *numericData = [CPTMutableNumericData numericDataWithData:data - dataType:(useDoubles ? plot.doubleDataType : plot.decimalDataType) - shape:@[@(indexRange.length), - @(numFields)] - dataOrder:CPTDataOrderRowsFirst]; - - return numericData; -} - -#else - --(CPTNumericData *)dataForPlot:(CPTPlot *)plot recordIndexRange:(NSRange)indexRange -{ - NSArray *financialData = self.datapuller.financialData; - const NSUInteger financialDataCount = financialData.count; - - const BOOL useDoubles = plot.doublePrecisionCache; - - NSUInteger numFields = plot.numberOfFields; - - if ( [plot.identifier isEqual:@"Volume Plot"] ) { - numFields = 2; - } - - NSMutableData *data = [[NSMutableData alloc] initWithLength:indexRange.length * numFields * ( useDoubles ? sizeof(double) : sizeof(NSDecimal) )]; - - const NSUInteger maxIndex = NSMaxRange(indexRange); - - if ( [plot.identifier isEqual:@"Data Source Plot"] ) { - if ( useDoubles ) { - double *nextValue = data.mutableBytes; - - for ( int fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - NSDictionary *fData = (NSDictionary *)[financialData objectAtIndex:financialDataCount - i - 1]; - NSNumber *value; - - switch ( fieldEnum ) { - case CPTScatterPlotFieldX: - *nextValue++ = (double)(i + 1); - break; - - case CPTScatterPlotFieldY: - value = [fData objectForKey:@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = [value doubleValue]; - break; - - default: - break; - } - } - } - } - else { - NSDecimal *nextValue = data.mutableBytes; - - for ( int fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - NSDictionary *fData = (NSDictionary *)[financialData objectAtIndex:financialDataCount - i - 1]; - NSNumber *value; - - switch ( fieldEnum ) { - case CPTScatterPlotFieldX: - *nextValue++ = CPTDecimalFromUnsignedInteger(i + 1); - break; - - case CPTScatterPlotFieldY: - value = [fData objectForKey:@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = [value decimalValue]; - break; - - default: - break; - } - } - } - } - } - else if ( [plot.identifier isEqual:@"Volume Plot"] ) { - if ( useDoubles ) { - double *nextValue = data.mutableBytes; - - for ( int fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - NSDictionary *fData = (NSDictionary *)[financialData objectAtIndex:financialDataCount - i - 1]; - NSNumber *value; - - switch ( fieldEnum ) { - case CPTBarPlotFieldBarLocation: - *nextValue++ = (double)(i + 1); - break; - - case CPTBarPlotFieldBarTip: - value = [fData objectForKey:@"volume"]; - NSAssert(value, @"Volume value was nil"); - *nextValue++ = [value doubleValue]; - break; - - default: - break; - } - } - } - } - else { - NSDecimal *nextValue = data.mutableBytes; - - for ( int fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - NSDictionary *fData = (NSDictionary *)[financialData objectAtIndex:financialDataCount - i - 1]; - NSNumber *value; - - switch ( fieldEnum ) { - case CPTBarPlotFieldBarLocation: - *nextValue++ = CPTDecimalFromUnsignedInteger(i + 1); - break; - - case CPTBarPlotFieldBarTip: - value = [fData objectForKey:@"volume"]; - NSAssert(value, @"Volume value was nil"); - *nextValue++ = [value decimalValue]; - break; - - default: - break; - } - } - } - } - } - else { - if ( useDoubles ) { - double *nextValue = data.mutableBytes; - - for ( int fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - NSDictionary *fData = (NSDictionary *)[financialData objectAtIndex:financialDataCount - i - 1]; - NSNumber *value; - - switch ( fieldEnum ) { - case CPTTradingRangePlotFieldX: - *nextValue++ = (double)(i + 1); - break; - - case CPTTradingRangePlotFieldOpen: - value = [fData objectForKey:@"open"]; - NSAssert(value, @"Open value was nil"); - *nextValue++ = [value doubleValue]; - break; - - case CPTTradingRangePlotFieldHigh: - value = [fData objectForKey:@"high"]; - NSAssert(value, @"High value was nil"); - *nextValue++ = [value doubleValue]; - break; - - case CPTTradingRangePlotFieldLow: - value = [fData objectForKey:@"low"]; - NSAssert(value, @"Low value was nil"); - *nextValue++ = [value doubleValue]; - break; - - case CPTTradingRangePlotFieldClose: - value = [fData objectForKey:@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = [value doubleValue]; - break; - - default: - break; - } - } - } - } - else { - NSDecimal *nextValue = data.mutableBytes; - - for ( int fieldEnum = 0; fieldEnum < numFields; fieldEnum++ ) { - for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { - NSDictionary *fData = (NSDictionary *)[financialData objectAtIndex:financialDataCount - i - 1]; - NSNumber *value; - - switch ( fieldEnum ) { - case CPTTradingRangePlotFieldX: - *nextValue++ = CPTDecimalFromUnsignedInteger(i + 1); - break; - - case CPTTradingRangePlotFieldOpen: - value = [fData objectForKey:@"open"]; - NSAssert(value, @"Open value was nil"); - *nextValue++ = [value decimalValue]; - break; - - case CPTTradingRangePlotFieldHigh: - value = [fData objectForKey:@"high"]; - NSAssert(value, @"High value was nil"); - *nextValue++ = [value decimalValue]; - break; - - case CPTTradingRangePlotFieldLow: - value = [fData objectForKey:@"low"]; - NSAssert(value, @"Low value was nil"); - *nextValue++ = [value decimalValue]; - break; - - case CPTTradingRangePlotFieldClose: - value = [fData objectForKey:@"close"]; - NSAssert(value, @"Close value was nil"); - *nextValue++ = [value decimalValue]; - break; - - default: - break; - } - } - } - } - } - - CPTMutableNumericData *numericData = [CPTMutableNumericData numericDataWithData:data - dataType:(useDoubles ? plot.doubleDataType : plot.decimalDataType) - shape:@[@(indexRange.length), @(numFields)] - dataOrder:CPTDataOrderColumnsFirst]; - [data release]; - - return numericData; -} -#endif - --(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index -{ - if ( ![(NSString *)plot.identifier isEqualToString : @"OHLC"] ) { - return (id)[NSNull null]; // Don't show any label - } - else if ( index % 5 ) { - return (id)[NSNull null]; - } - else { - return nil; // Use default label style - } -} - --(void)dataPullerDidFinishFetch:(APYahooDataPuller *)dp -{ - static CPTAnimationOperation *animationOperation = nil; - - CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; - CPTXYPlotSpace *volumePlotSpace = (CPTXYPlotSpace *)[self.graph plotSpaceWithIdentifier:@"Volume Plot Space"]; - - APYahooDataPuller *thePuller = self.datapuller; - - NSDecimalNumber *high = thePuller.overallHigh; - NSDecimalNumber *low = thePuller.overallLow; - NSDecimalNumber *length = [high decimalNumberBySubtracting:low]; - - NSLog(@"high = %@, low = %@, length = %@", high, low, length); - NSDecimalNumber *pricePlotSpaceDisplacementPercent = [NSDecimalNumber decimalNumberWithMantissa:33 - exponent:-2 - isNegative:NO]; - - NSDecimalNumber *lengthDisplacementValue = [length decimalNumberByMultiplyingBy:pricePlotSpaceDisplacementPercent]; - NSDecimalNumber *lowDisplayLocation = [low decimalNumberBySubtracting:lengthDisplacementValue]; - NSDecimalNumber *lengthDisplayLocation = [length decimalNumberByAdding:lengthDisplacementValue]; - - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromUnsignedInteger(thePuller.financialData.count + 1)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:lowDisplayLocation.decimalValue length:lengthDisplayLocation.decimalValue]; - - CPTScatterPlot *linePlot = (CPTScatterPlot *)[self.graph plotWithIdentifier:@"Data Source Plot"]; - linePlot.areaBaseValue = [high decimalValue]; - linePlot.areaBaseValue2 = [low decimalValue]; - - // Axes - CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.graph.axisSet; - - NSDecimalNumber *overallVolumeHigh = thePuller.overallVolumeHigh; - NSDecimalNumber *overallVolumeLow = thePuller.overallVolumeLow; - NSDecimalNumber *volumeLength = [overallVolumeHigh decimalNumberBySubtracting:overallVolumeLow]; - - // make the length aka height for y 3 times more so that we get a 1/3 area covered by volume - NSDecimalNumber *volumePlotSpaceDisplacementPercent = [NSDecimalNumber decimalNumberWithMantissa:3 - exponent:0 - isNegative:NO]; - - NSDecimalNumber *volumeLengthDisplacementValue = [volumeLength decimalNumberByMultiplyingBy:volumePlotSpaceDisplacementPercent]; - NSDecimalNumber *volumeLowDisplayLocation = overallVolumeLow; - NSDecimalNumber *volumeLengthDisplayLocation = [volumeLength decimalNumberByAdding:volumeLengthDisplacementValue]; - - volumePlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromUnsignedInteger(thePuller.financialData.count + 1)]; -// volumePlotSpace.yRange = [CPTPlotRange plotRangeWithLocation:[volumeLowDisplayLocation decimalValue] length:[volumeLengthDisplayLocation decimalValue]]; - - if ( animationOperation ) { - [[CPTAnimation sharedInstance] removeAnimationOperation:animationOperation]; - } - - animationOperation = [CPTAnimation animate:volumePlotSpace - property:@"yRange" - fromPlotRange:[CPTPlotRange plotRangeWithLocation:[volumeLowDisplayLocation decimalValue] - length:CPTDecimalMultiply( [volumeLengthDisplayLocation decimalValue], CPTDecimalFromInteger(10) )] - toPlotRange:[CPTPlotRange plotRangeWithLocation:[volumeLowDisplayLocation decimalValue] - length:[volumeLengthDisplayLocation decimalValue]] - duration:2.5]; - - axisSet.xAxis.orthogonalCoordinateDecimal = [low decimalValue]; - axisSet.yAxis.majorIntervalLength = CPTDecimalFromDouble(50.0); - axisSet.yAxis.minorTicksPerInterval = 4; - axisSet.yAxis.orthogonalCoordinateDecimal = CPTDecimalFromDouble(1.0); - NSArray *exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0) length:[low decimalValue]]]; - - axisSet.yAxis.labelExclusionRanges = exclusionRanges; - - [self.graph reloadData]; -} - -@end diff --git a/examples/AAPLot/Classes/RootViewController.h b/examples/AAPLot/Classes/RootViewController.h deleted file mode 100644 index 57e4a4988..000000000 --- a/examples/AAPLot/Classes/RootViewController.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// RootViewController.h -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import - -@class MainViewController; -@class FlipsideViewController; - -@interface RootViewController : UIViewController - -@property (nonatomic, strong) IBOutlet UIButton *infoButton; -@property (nonatomic, strong) MainViewController *mainViewController; -@property (nonatomic, strong) UINavigationBar *flipsideNavigationBar; -@property (nonatomic, strong) FlipsideViewController *flipsideViewController; - --(IBAction)toggleView; - -@end diff --git a/examples/AAPLot/Classes/RootViewController.m b/examples/AAPLot/Classes/RootViewController.m deleted file mode 100644 index 120ecc7a2..000000000 --- a/examples/AAPLot/Classes/RootViewController.m +++ /dev/null @@ -1,106 +0,0 @@ -// -// RootViewController.m -// AAPLot -// -// Created by Jonathan Saggau on 6/9/09. -// Copyright Sounds Broken inc. 2009. All rights reserved. -// - -#import "FlipsideViewController.h" -#import "MainViewController.h" -#import "RootViewController.h" - -@implementation RootViewController - -@synthesize infoButton; -@synthesize flipsideNavigationBar; -@synthesize mainViewController; -@synthesize flipsideViewController; - --(void)viewDidLoad -{ - [super viewDidLoad]; - MainViewController *viewController = [[MainViewController alloc] initWithNibName:@"MainView" bundle:nil]; - self.mainViewController = viewController; - - [self.view insertSubview:self.mainViewController.view belowSubview:self.infoButton]; - self.mainViewController.view.frame = self.view.bounds; -} - --(void)loadFlipsideViewController -{ - FlipsideViewController *viewController = [[FlipsideViewController alloc] initWithNibName:@"FlipsideView" bundle:nil]; - - self.flipsideViewController = viewController; - - self.flipsideViewController.view.frame = self.view.bounds; - - // Set up the navigation bar - UINavigationBar *aNavigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 44.0)]; - aNavigationBar.barStyle = UIBarStyleBlackOpaque; - self.flipsideNavigationBar = aNavigationBar; - - UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone - target:self - action:@selector(toggleView)]; - UINavigationItem *navigationItem = [[UINavigationItem alloc] initWithTitle:@"AAPLot"]; - navigationItem.rightBarButtonItem = buttonItem; - [self.flipsideNavigationBar pushNavigationItem:navigationItem animated:NO]; -} - --(IBAction)toggleView -{ - /* - * This method is called when the info or Done button is pressed. - * It flips the displayed view from the main view to the flipside view and vice-versa. - */ - if ( self.flipsideViewController == nil ) { - [self loadFlipsideViewController]; - } - - UIView *mainView = self.mainViewController.view; - UIView *flipsideView = self.flipsideViewController.view; - - [UIView beginAnimations:nil context:NULL]; - [UIView setAnimationDuration:1]; - UIViewAnimationTransition transition = ([mainView superview] ? UIViewAnimationTransitionFlipFromRight : UIViewAnimationTransitionFlipFromLeft); - [UIView setAnimationTransition:transition forView:self.view cache:YES]; - - if ( [mainView superview] != nil ) { - [self.flipsideViewController viewWillAppear:YES]; - [self.mainViewController viewWillDisappear:YES]; - [mainView removeFromSuperview]; - [self.infoButton removeFromSuperview]; - [self.view addSubview:flipsideView]; - [self.view insertSubview:self.flipsideNavigationBar aboveSubview:flipsideView]; - [self.mainViewController viewDidDisappear:YES]; - [self.flipsideViewController viewDidAppear:YES]; - } - else { - [self.mainViewController viewWillAppear:YES]; - [self.flipsideViewController viewWillDisappear:YES]; - [flipsideView removeFromSuperview]; - [self.flipsideNavigationBar removeFromSuperview]; - [self.view addSubview:mainView]; - [self.view insertSubview:self.infoButton aboveSubview:self.mainViewController.view]; - [self.flipsideViewController viewDidDisappear:YES]; - [self.mainViewController viewDidAppear:YES]; - } - [UIView commitAnimations]; -} - -/* - * // Override to allow orientations other than the default portrait orientation. - * - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - * // Return YES for supported orientations - * return (interfaceOrientation == UIInterfaceOrientationPortrait); - * } - */ - --(void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview - // Release anything that's not essential, such as cached data -} - -@end diff --git a/examples/AAPLot/FlipsideView.xib b/examples/AAPLot/FlipsideView.xib deleted file mode 100644 index 165ced2e7..000000000 --- a/examples/AAPLot/FlipsideView.xib +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/AAPLot/Launch Screen.xib b/examples/AAPLot/Launch Screen.xib deleted file mode 100644 index f8672842a..000000000 --- a/examples/AAPLot/Launch Screen.xib +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/AAPLot/MainView.xib b/examples/AAPLot/MainView.xib deleted file mode 100644 index e968aa1ef..000000000 --- a/examples/AAPLot/MainView.xib +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/AAPLot/MainWindow.xib b/examples/AAPLot/MainWindow.xib deleted file mode 100644 index 182fe85d1..000000000 --- a/examples/AAPLot/MainWindow.xib +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/AAPLot/NSDateFormatterExtensions.h b/examples/AAPLot/NSDateFormatterExtensions.h deleted file mode 100644 index 2deb1696c..000000000 --- a/examples/AAPLot/NSDateFormatterExtensions.h +++ /dev/null @@ -1,7 +0,0 @@ -#import - -@interface NSDateFormatter(APExtensions) - -+(NSDateFormatter *)csvDateFormatter; - -@end diff --git a/examples/AAPLot/NSDateFormatterExtensions.m b/examples/AAPLot/NSDateFormatterExtensions.m deleted file mode 100644 index 9bb5989a1..000000000 --- a/examples/AAPLot/NSDateFormatterExtensions.m +++ /dev/null @@ -1,18 +0,0 @@ -#import "NSDateFormatterExtensions.h" - -@implementation NSDateFormatter(APExtensions) - -+(NSDateFormatter *)csvDateFormatter -{ - static NSDateFormatter *df = nil; - static dispatch_once_t onceToken = 0; - - dispatch_once(&onceToken, ^{ - df = [[NSDateFormatter alloc] init]; - [df setDateFormat:@"yyyy-MM-dd"]; - }); - - return df; -} - -@end diff --git a/examples/AAPLot/main.m b/examples/AAPLot/main.m deleted file mode 100644 index 9098265c6..000000000 --- a/examples/AAPLot/main.m +++ /dev/null @@ -1,10 +0,0 @@ -#import - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - int retVal = UIApplicationMain(argc, argv, nil, nil); - - return retVal; - } -} diff --git a/examples/CPTTestApp-iPad/CPTTestApp_iPad-Info.plist b/examples/CPTTestApp-iPad/Base.lproj/CPTTestApp_iPad-Info.plist similarity index 95% rename from examples/CPTTestApp-iPad/CPTTestApp_iPad-Info.plist rename to examples/CPTTestApp-iPad/Base.lproj/CPTTestApp_iPad-Info.plist index f0cf9adbd..65b56f8c5 100644 --- a/examples/CPTTestApp-iPad/CPTTestApp_iPad-Info.plist +++ b/examples/CPTTestApp-iPad/Base.lproj/CPTTestApp_iPad-Info.plist @@ -18,6 +18,8 @@ ${PRODUCT_NAME} CFBundlePackageType APPL + CFBundleShortVersionString + 1.0 CFBundleSignature ???? CFBundleVersion diff --git a/examples/CPTTestApp-iPad/Base.lproj/CPTTestApp_iPadViewController.xib b/examples/CPTTestApp-iPad/Base.lproj/CPTTestApp_iPadViewController.xib new file mode 100644 index 000000000..03311ea1e --- /dev/null +++ b/examples/CPTTestApp-iPad/Base.lproj/CPTTestApp_iPadViewController.xib @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp-iPad/Launch Screen.xib b/examples/CPTTestApp-iPad/Base.lproj/Launch Screen.xib similarity index 66% rename from examples/CPTTestApp-iPad/Launch Screen.xib rename to examples/CPTTestApp-iPad/Base.lproj/Launch Screen.xib index 31b1b876d..84090add7 100644 --- a/examples/CPTTestApp-iPad/Launch Screen.xib +++ b/examples/CPTTestApp-iPad/Base.lproj/Launch Screen.xib @@ -1,8 +1,12 @@ - - + + + + + - - + + + @@ -11,14 +15,14 @@ - - + diff --git a/examples/CPTTestApp-iPad/Base.lproj/MainWindow.xib b/examples/CPTTestApp-iPad/Base.lproj/MainWindow.xib new file mode 100644 index 000000000..9e25633e1 --- /dev/null +++ b/examples/CPTTestApp-iPad/Base.lproj/MainWindow.xib @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/project.pbxproj b/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/project.pbxproj index f8b46b37d..afd032e09 100644 --- a/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/project.pbxproj +++ b/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 47; objects = { /* Begin PBXBuildFile section */ @@ -12,33 +12,74 @@ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; - 2899E5220DE3E06400AC0155 /* CPTTestApp_iPadViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* CPTTestApp_iPadViewController.xib */; }; - 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; 28D7ACF80DDB3853001CB0EB /* CPTTestApp_iPadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* CPTTestApp_iPadViewController.m */; }; - BC65753F11653FC60008F594 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BC65753611653F8A0008F594 /* libCorePlot-CocoaTouch.a */; }; BC65758F116549890008F594 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC65758E116549890008F594 /* QuartzCore.framework */; }; - C34677AE19F3341700429A85 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C34677AD19F3341700429A85 /* Launch Screen.xib */; }; - C3CD283917DE9C59008EED1E /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3CD283817DE9C59008EED1E /* Accelerate.framework */; }; + C3D0A1F520E019BF00BA2921 /* CPTTestApp_iPadViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A1F720E019BF00BA2921 /* CPTTestApp_iPadViewController.xib */; }; + C3D0A20620E019CD00BA2921 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A20820E019CD00BA2921 /* MainWindow.xib */; }; + C3D0A20920E019D400BA2921 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A20B20E019D400BA2921 /* Launch Screen.xib */; }; C3D3936019FD670400148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3935F19FD670400148319 /* Images.xcassets */; }; + C3D414AD1A7D844400B6F5D6 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3D414AA1A7D843800B6F5D6 /* libCorePlot-CocoaTouch.a */; }; C3F47B6E17BF99DE0075181F /* CorePlotIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = C3F47B6C17BF99DE0075181F /* CorePlotIcon.png */; }; C3F47B6F17BF99DE0075181F /* CorePlotIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C3F47B6D17BF99DE0075181F /* CorePlotIcon@2x.png */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - BC65753511653F8A0008F594 /* PBXContainerItemProxy */ = { + C31D01E01D10F4FF008C1EF2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = BC65753011653F8A0008F594 /* CorePlot-CocoaTouch.xcodeproj */; + containerPortal = C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */; proxyType = 2; - remoteGlobalIDString = BC9B83470FB8A0A40035D8DA; - remoteInfo = "CorePlot-CocoaTouch"; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C31D01E21D10F4FF008C1EF2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; + C3D414A11A7D843800B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8DC2EF5B0486A6940098B216; + remoteInfo = CorePlot; + }; + C3D414A31A7D843800B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 0730F600109492D800E95162; + remoteInfo = UnitTests; + }; + C3D414A51A7D843800B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09781A46185200D45436; + remoteInfo = CorePlot_iOS; + }; + C3D414A71A7D843800B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09821A46185300D45436; + remoteInfo = CorePlot_iOSTests; }; - BC65753711653FA50008F594 /* PBXContainerItemProxy */ = { + C3D414A91A7D843800B6F5D6 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = BC65753011653F8A0008F594 /* CorePlot-CocoaTouch.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = BC9B83460FB8A0A40035D8DA; + containerPortal = C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09BA1A4619A900D45436; remoteInfo = "CorePlot-CocoaTouch"; }; + C3D414AB1A7D843800B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09C41A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouchTests"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -48,19 +89,19 @@ 1D6058910D05DD3D006BFB54 /* CPTTestApp-iPad.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CPTTestApp-iPad.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 2899E5210DE3E06400AC0155 /* CPTTestApp_iPadViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CPTTestApp_iPadViewController.xib; sourceTree = ""; }; - 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; - 28D7ACF60DDB3853001CB0EB /* CPTTestApp_iPadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestApp_iPadViewController.h; sourceTree = ""; }; - 28D7ACF70DDB3853001CB0EB /* CPTTestApp_iPadViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTestApp_iPadViewController.m; sourceTree = ""; }; + 28D7ACF60DDB3853001CB0EB /* CPTTestApp_iPadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTTestApp_iPadViewController.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 28D7ACF70DDB3853001CB0EB /* CPTTestApp_iPadViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTTestApp_iPadViewController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* CPTTestApp_iPad_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestApp_iPad_Prefix.pch; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* CPTTestApp_iPad-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "CPTTestApp_iPad-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; - BC65753011653F8A0008F594 /* CorePlot-CocoaTouch.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "CorePlot-CocoaTouch.xcodeproj"; path = "../../framework/CorePlot-CocoaTouch.xcodeproj"; sourceTree = SOURCE_ROOT; }; BC65758E116549890008F594 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - C34677AD19F3341700429A85 /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "Launch Screen.xib"; sourceTree = ""; }; - C36E7CC519DE1C1F00EDEACB /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C36E7CC519DE1C1F00EDEACB /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C37A40E120E0320500C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CPTTestApp_iPad-Info.plist"; sourceTree = ""; }; C3CD283817DE9C59008EED1E /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; + C3D0A20520E019C900BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/CPTTestApp_iPadViewController.xib; sourceTree = ""; }; + C3D0A20720E019CD00BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainWindow.xib; sourceTree = ""; }; + C3D0A20A20E019D400BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Base.lproj/Launch Screen.xib"; sourceTree = ""; }; C3D3935F19FD670400148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "CPTTestApp-iPad/Images.xcassets"; sourceTree = ""; }; + C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../../framework/CorePlot.xcodeproj; sourceTree = ""; }; C3F47B6C17BF99DE0075181F /* CorePlotIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = CorePlotIcon.png; sourceTree = ""; }; C3F47B6D17BF99DE0075181F /* CorePlotIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "CorePlotIcon@2x.png"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -73,9 +114,8 @@ 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */, - BC65753F11653FC60008F594 /* libCorePlot-CocoaTouch.a in Frameworks */, BC65758F116549890008F594 /* QuartzCore.framework in Frameworks */, - C3CD283917DE9C59008EED1E /* Accelerate.framework in Frameworks */, + C3D414AD1A7D844400B6F5D6 /* libCorePlot-CocoaTouch.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -104,7 +144,7 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( - BC65753011653F8A0008F594 /* CorePlot-CocoaTouch.xcodeproj */, + C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */, 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97317FDCFA39411CA2CEA /* Resources */, @@ -131,12 +171,12 @@ isa = PBXGroup; children = ( C3D3935F19FD670400148319 /* Images.xcassets */, - 2899E5210DE3E06400AC0155 /* CPTTestApp_iPadViewController.xib */, - 28AD733E0D9D9553002E5188 /* MainWindow.xib */, - C34677AD19F3341700429A85 /* Launch Screen.xib */, + C3D0A1F720E019BF00BA2921 /* CPTTestApp_iPadViewController.xib */, + C3D0A20820E019CD00BA2921 /* MainWindow.xib */, + C3D0A20B20E019D400BA2921 /* Launch Screen.xib */, C3F47B6C17BF99DE0075181F /* CorePlotIcon.png */, C3F47B6D17BF99DE0075181F /* CorePlotIcon@2x.png */, - 8D1107310486CEB800E47090 /* CPTTestApp_iPad-Info.plist */, + C37A40E220E0320500C4FF48 /* CPTTestApp_iPad-Info.plist */, ); name = Resources; sourceTree = ""; @@ -153,10 +193,17 @@ name = Frameworks; sourceTree = ""; }; - BC65753111653F8A0008F594 /* Products */ = { + C3D414961A7D843800B6F5D6 /* Products */ = { isa = PBXGroup; children = ( - BC65753611653F8A0008F594 /* libCorePlot-CocoaTouch.a */, + C3D414A21A7D843800B6F5D6 /* CorePlot.framework */, + C3D414A41A7D843800B6F5D6 /* UnitTests.xctest */, + C3D414A61A7D843800B6F5D6 /* CorePlot.framework */, + C3D414A81A7D843800B6F5D6 /* UnitTests iOS.xctest */, + C3D414AA1A7D843800B6F5D6 /* libCorePlot-CocoaTouch.a */, + C3D414AC1A7D843800B6F5D6 /* CorePlot-CocoaTouchTests.xctest */, + C31D01E11D10F4FF008C1EF2 /* CorePlot.framework */, + C31D01E31D10F4FF008C1EF2 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -175,7 +222,6 @@ buildRules = ( ); dependencies = ( - BC65753811653FA50008F594 /* PBXTargetDependency */, ); name = "CPTTestApp-iPad"; productName = "CPTTestApp-iPad"; @@ -188,24 +234,30 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0700; + LastUpgradeCheck = 0900; + TargetAttributes = { + 1D6058900D05DD3D006BFB54 = { + DevelopmentTeam = 28ZA45DE7D; + }; + }; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CPTTestApp-iPad" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + ja, + en, + de, + fr, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; projectDirPath = ""; projectReferences = ( { - ProductGroup = BC65753111653F8A0008F594 /* Products */; - ProjectRef = BC65753011653F8A0008F594 /* CorePlot-CocoaTouch.xcodeproj */; + ProductGroup = C3D414961A7D843800B6F5D6 /* Products */; + ProjectRef = C3D414951A7D843800B6F5D6 /* CorePlot.xcodeproj */; }, ); projectRoot = ""; @@ -216,11 +268,60 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - BC65753611653F8A0008F594 /* libCorePlot-CocoaTouch.a */ = { + C31D01E11D10F4FF008C1EF2 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C31D01E01D10F4FF008C1EF2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C31D01E31D10F4FF008C1EF2 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C31D01E21D10F4FF008C1EF2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414A21A7D843800B6F5D6 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3D414A11A7D843800B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414A41A7D843800B6F5D6 /* UnitTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = UnitTests.xctest; + remoteRef = C3D414A31A7D843800B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414A61A7D843800B6F5D6 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3D414A51A7D843800B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414A81A7D843800B6F5D6 /* UnitTests iOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests iOS.xctest"; + remoteRef = C3D414A71A7D843800B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414AA1A7D843800B6F5D6 /* libCorePlot-CocoaTouch.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libCorePlot-CocoaTouch.a"; - remoteRef = BC65753511653F8A0008F594 /* PBXContainerItemProxy */; + remoteRef = C3D414A91A7D843800B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414AC1A7D843800B6F5D6 /* CorePlot-CocoaTouchTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "CorePlot-CocoaTouchTests.xctest"; + remoteRef = C3D414AB1A7D843800B6F5D6 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -230,12 +331,12 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, - 2899E5220DE3E06400AC0155 /* CPTTestApp_iPadViewController.xib in Resources */, + C3D0A20620E019CD00BA2921 /* MainWindow.xib in Resources */, + C3D0A1F520E019BF00BA2921 /* CPTTestApp_iPadViewController.xib in Resources */, C3F47B6E17BF99DE0075181F /* CorePlotIcon.png in Resources */, C3D3936019FD670400148319 /* Images.xcassets in Resources */, C3F47B6F17BF99DE0075181F /* CorePlotIcon@2x.png in Resources */, - C34677AE19F3341700429A85 /* Launch Screen.xib in Resources */, + C3D0A20920E019D400BA2921 /* Launch Screen.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -254,17 +355,45 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - BC65753811653FA50008F594 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "CorePlot-CocoaTouch"; - targetProxy = BC65753711653FA50008F594 /* PBXContainerItemProxy */; +/* Begin PBXVariantGroup section */ + C37A40E220E0320500C4FF48 /* CPTTestApp_iPad-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A40E120E0320500C4FF48 /* Base */, + ); + name = "CPTTestApp_iPad-Info.plist"; + sourceTree = ""; + }; + C3D0A1F720E019BF00BA2921 /* CPTTestApp_iPadViewController.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A20520E019C900BA2921 /* Base */, + ); + name = CPTTestApp_iPadViewController.xib; + sourceTree = ""; + }; + C3D0A20820E019CD00BA2921 /* MainWindow.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A20720E019CD00BA2921 /* Base */, + ); + name = MainWindow.xib; + sourceTree = ""; }; -/* End PBXTargetDependency section */ + C3D0A20B20E019D400BA2921 /* Launch Screen.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A20A20E019D400BA2921 /* Base */, + ); + name = "Launch Screen.xib"; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 1D6058940D05DD3E006BFB54 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C36E7CC519DE1C1F00EDEACB /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -273,12 +402,12 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + DEVELOPMENT_TEAM = 28ZA45DE7D; GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CPTTestApp_iPad_Prefix.pch; HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = "CPTTestApp_iPad-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/CPTTestApp_iPad-Info.plist"; PRODUCT_BUNDLE_IDENTIFIER = org.CorePlot.CPTTestAppiPad; PRODUCT_NAME = "CPTTestApp-iPad"; }; @@ -286,6 +415,7 @@ }; 1D6058950D05DD3E006BFB54 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C36E7CC519DE1C1F00EDEACB /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -294,10 +424,11 @@ CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=*]" = "iPhone Distribution"; COPY_PHASE_STRIP = YES; + DEVELOPMENT_TEAM = 28ZA45DE7D; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CPTTestApp_iPad_Prefix.pch; HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = "CPTTestApp_iPad-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/CPTTestApp_iPad-Info.plist"; PRODUCT_BUNDLE_IDENTIFIER = org.CorePlot.CPTTestAppiPad; PRODUCT_NAME = "CPTTestApp-iPad"; VALIDATE_PRODUCT = YES; @@ -309,12 +440,13 @@ baseConfigurationReference = C36E7CC519DE1C1F00EDEACB /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "-ObjC", @@ -323,7 +455,7 @@ SDKROOT = iphoneos; SYMROOT = "$(SRCROOT)/../../build"; TARGETED_DEVICE_FAMILY = 2; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; + USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\" \"${PROJECT_DIR}/../../framework/Source\" \"${PROJECT_DIR}/../../framework/iPhoneOnly\""; }; name = Debug; }; @@ -332,11 +464,12 @@ baseConfigurationReference = C36E7CC519DE1C1F00EDEACB /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; OTHER_LDFLAGS = ( "-ObjC", @@ -345,7 +478,7 @@ SDKROOT = iphoneos; SYMROOT = "$(SRCROOT)/../../build"; TARGETED_DEVICE_FAMILY = 2; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; + USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\" \"${PROJECT_DIR}/../../framework/Source\" \"${PROJECT_DIR}/../../framework/iPhoneOnly\""; }; name = Release; }; diff --git a/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPad.xcscheme b/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPad.xcscheme new file mode 100644 index 000000000..8ee44490d --- /dev/null +++ b/examples/CPTTestApp-iPad/CPTTestApp-iPad.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPad.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp-iPad/CPTTestApp-iPad/Images.xcassets/AppIcon.appiconset/Contents.json b/examples/CPTTestApp-iPad/CPTTestApp-iPad/Images.xcassets/AppIcon.appiconset/Contents.json index 9423e2f5b..80abb1d7e 100644 --- a/examples/CPTTestApp-iPad/CPTTestApp-iPad/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/CPTTestApp-iPad/CPTTestApp-iPad/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "size" : "29x29", "idiom" : "ipad", @@ -59,6 +69,18 @@ "idiom" : "ipad", "filename" : "Icon-76@2x.png", "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-iPadPro@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "iTunesArtwork.png", + "scale" : "1x" } ], "info" : { diff --git a/examples/CPTTestApp-iPad/CPTTestApp-iPad/Images.xcassets/AppIcon.appiconset/Icon-iPadPro@2x.png b/examples/CPTTestApp-iPad/CPTTestApp-iPad/Images.xcassets/AppIcon.appiconset/Icon-iPadPro@2x.png new file mode 100644 index 000000000..594df78ef Binary files /dev/null and b/examples/CPTTestApp-iPad/CPTTestApp-iPad/Images.xcassets/AppIcon.appiconset/Icon-iPadPro@2x.png differ diff --git a/examples/CPTTestApp-iPad/CPTTestApp-iPad/Images.xcassets/AppIcon.appiconset/iTunesArtwork.png b/examples/CPTTestApp-iPad/CPTTestApp-iPad/Images.xcassets/AppIcon.appiconset/iTunesArtwork.png new file mode 100644 index 000000000..969aff8dd Binary files /dev/null and b/examples/CPTTestApp-iPad/CPTTestApp-iPad/Images.xcassets/AppIcon.appiconset/iTunesArtwork.png differ diff --git a/examples/CPTTestApp-iPad/CPTTestApp_iPadViewController.xib b/examples/CPTTestApp-iPad/CPTTestApp_iPadViewController.xib deleted file mode 100644 index e2254d8ae..000000000 --- a/examples/CPTTestApp-iPad/CPTTestApp_iPadViewController.xib +++ /dev/null @@ -1,263 +0,0 @@ - - - - 1536 - 12C60 - 2843 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1929 - - - YES - IBProxyObject - IBUIToolbar - IBUIView - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBIPadFramework - - - IBFirstResponder - IBIPadFramework - - - - 274 - - YES - - - 292 - {{20, 55}, {728, 556}} - - - 3 - MQA - - IBIPadFramework - - - - 292 - {{408, 644}, {340, 340}} - - - 3 - MQA - - 2 - - - IBIPadFramework - - - - 292 - {{20, 644}, {340, 340}} - - - 3 - MQA - - - IBIPadFramework - - - - 290 - {768, 44} - - NO - NO - IBIPadFramework - 1 - - YES - - - - {{0, 20}, {768, 1004}} - - - 1 - MCAwIDAAA - darkTextColor - - - 2 - - IBIPadFramework - - - - - YES - - - view - - - - 3 - - - - barChartView - - - - 9 - - - - pieChartView - - - - 10 - - - - scatterPlotView - - - - 12 - - - - - YES - - 0 - - YES - - - - - - -1 - - - File's Owner - - - -2 - - - - - 2 - - - YES - - - - - - - - - 4 - - - - - 5 - - - - - 6 - - - - - 7 - - - YES - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 2.IBPluginDependency - 4.CustomClassName - 4.IBPluginDependency - 5.CustomClassName - 5.IBPluginDependency - 6.CustomClassName - 6.IBPluginDependency - 7.IBPluginDependency - - - YES - CPTTestApp_iPadViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - CPTGraphHostingView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - CPTGraphHostingView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - CPTGraphHostingView - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 12 - - - 0 - IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - 1929 - - diff --git a/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadAppDelegate.h b/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadAppDelegate.h index 8ba37367e..728b16a7b 100644 --- a/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadAppDelegate.h +++ b/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadAppDelegate.h @@ -1,8 +1,8 @@ // -// CPTTestApp_iPadAppDelegate.h -// CPTTestApp-iPad +// CPTTestApp_iPadAppDelegate.h +// CPTTestApp-iPad // -// Created by Brad Larson on 4/1/2010. +// Created by Brad Larson on 4/1/2010. // #import @@ -11,7 +11,7 @@ @interface CPTTestApp_iPadAppDelegate : NSObject -@property (nonatomic, readwrite, strong) IBOutlet UIWindow *window; -@property (nonatomic, readwrite, strong) IBOutlet CPTTestApp_iPadViewController *viewController; +@property (nonatomic, readwrite, strong, nullable) IBOutlet UIWindow *window; +@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTTestApp_iPadViewController *viewController; @end diff --git a/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadAppDelegate.m b/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadAppDelegate.m index b8a47d016..b3c3e65b8 100644 --- a/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadAppDelegate.m +++ b/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadAppDelegate.m @@ -1,8 +1,8 @@ // -// CPTTestApp_iPadAppDelegate.m -// CPTTestApp-iPad +// CPTTestApp_iPadAppDelegate.m +// CPTTestApp-iPad // -// Created by Brad Larson on 4/1/2010. +// Created by Brad Larson on 4/1/2010. // #import "CPTTestApp_iPadAppDelegate.h" @@ -13,7 +13,7 @@ @implementation CPTTestApp_iPadAppDelegate @synthesize window; @synthesize viewController; --(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +-(BOOL)application:(nonnull UIApplication *__unused)application didFinishLaunchingWithOptions:(nullable CPTDictionary *__unused)launchOptions { self.window.rootViewController = self.viewController; [self.window makeKeyAndVisible]; diff --git a/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadViewController.h b/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadViewController.h index 62596a8b6..120d9fbf3 100644 --- a/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadViewController.h +++ b/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadViewController.h @@ -1,17 +1,20 @@ // -// CPTTestApp_iPadViewController.h -// CPTTestApp-iPad +// CPTTestApp_iPadViewController.h +// CPTTestApp-iPad // -// Created by Brad Larson on 4/1/2010. +// Created by Brad Larson on 4/1/2010. // #import "CorePlot-CocoaTouch.h" #import -@interface CPTTestApp_iPadViewController : UIViewController +@interface CPTTestApp_iPadViewController : UIViewController -@property (nonatomic, readwrite, strong) NSArray *dataForChart; -@property (nonatomic, readwrite, strong) NSArray *dataForPlot; +@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray *dataForChart; +@property (nonatomic, readwrite, strong, nonnull) NSArray *dataForPlot; // Plot construction methods -(void)constructScatterPlot; diff --git a/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadViewController.m b/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadViewController.m index b047c5eef..4312843d4 100644 --- a/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadViewController.m +++ b/examples/CPTTestApp-iPad/Classes/CPTTestApp_iPadViewController.m @@ -1,8 +1,8 @@ // -// CPTTestApp_iPadViewController.m -// CPTTestApp-iPad +// CPTTestApp_iPadViewController.m +// CPTTestApp-iPad // -// Created by Brad Larson on 4/1/2010. +// Created by Brad Larson on 4/1/2010. // #import "CPTTestApp_iPadViewController.h" @@ -10,15 +10,15 @@ @interface CPTTestApp_iPadViewController() -@property (nonatomic, readwrite, strong) IBOutlet CPTGraphHostingView *scatterPlotView; -@property (nonatomic, readwrite, strong) IBOutlet CPTGraphHostingView *barChartView; -@property (nonatomic, readwrite, strong) IBOutlet CPTGraphHostingView *pieChartView; +@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTGraphHostingView *scatterPlotView; +@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTGraphHostingView *barChartView; +@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTGraphHostingView *pieChartView; -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; -@property (nonatomic, readwrite, strong) CPTXYGraph *barChart; -@property (nonatomic, readwrite, strong) CPTXYGraph *pieGraph; +@property (nonatomic, readwrite, strong, nonnull) CPTXYGraph *graph; +@property (nonatomic, readwrite, strong, nonnull) CPTXYGraph *barChart; +@property (nonatomic, readwrite, strong, nonnull) CPTXYGraph *pieGraph; -@property (nonatomic, readwrite, strong) CPTPieChart *piePlot; +@property (nonatomic, readwrite, strong, nonnull) CPTPieChart *piePlot; @property (nonatomic, readwrite, assign) BOOL piePlotIsRotating; @end @@ -70,36 +70,12 @@ -(void)viewDidAppear:(BOOL)animated self.piePlotIsRotating = YES; } --(void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag +-(void)animationDidStop:(CAAnimation *__unused)theAnimation finished:(BOOL __unused)flag { self.piePlotIsRotating = NO; [self.piePlot performSelector:@selector(reloadData) withObject:nil afterDelay:0.4]; } --(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation -{ - if ( UIInterfaceOrientationIsLandscape(fromInterfaceOrientation) ) { - // Move the plots into place for portrait - self.scatterPlotView.frame = CGRectMake(20.0, 55.0, 728.0, 556.0); - self.barChartView.frame = CGRectMake(20.0, 644.0, 340.0, 340.0); - self.pieChartView.frame = CGRectMake(408.0, 644.0, 340.0, 340.0); - } - else { - // Move the plots into place for landscape - self.scatterPlotView.frame = CGRectMake(20.0, 51.0, 628.0, 677.0); - self.barChartView.frame = CGRectMake(684.0, 51.0, 320.0, 320.0); - self.pieChartView.frame = CGRectMake(684.0, 408.0, 320.0, 320.0); - } -} - --(void)didReceiveMemoryWarning -{ - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - #pragma mark - #pragma mark Plot construction methods @@ -121,27 +97,27 @@ -(void)constructScatterPlot // Setup plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; plotSpace.allowsUserInteraction = YES; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) length:CPTDecimalFromDouble(2.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) length:CPTDecimalFromDouble(3.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@2.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@3.0]; // Axes CPTXYAxisSet *axisSet = (CPTXYAxisSet *)newGraph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(0.5); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(2.0); - x.minorTicksPerInterval = 2; - NSArray *exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(2.99) length:CPTDecimalFromDouble(0.02)]]; + x.majorIntervalLength = @0.5; + x.orthogonalPosition = @2.0; + x.minorTicksPerInterval = 2; + CPTPlotRangeArray *exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@1.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@0.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@2.99 length:@0.02]]; x.labelExclusionRanges = exclusionRanges; CPTXYAxis *y = axisSet.yAxis; - y.majorIntervalLength = CPTDecimalFromDouble(0.5); - y.minorTicksPerInterval = 5; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(2.0); - exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(3.99) length:CPTDecimalFromDouble(0.02)]]; + y.majorIntervalLength = @0.5; + y.minorTicksPerInterval = 5; + y.orthogonalPosition = @2.0; + exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@1.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@0.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@3.99 length:@0.02]]; y.labelExclusionRanges = exclusionRanges; // Create a green plot area @@ -162,7 +138,7 @@ -(void)constructScatterPlot areaGradient.angle = -90.0; CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient]; dataSourceLinePlot.areaFill = areaGradientFill; - dataSourceLinePlot.areaBaseValue = CPTDecimalFromDouble(1.75); + dataSourceLinePlot.areaBaseValue = @1.75; // Animate in the new plot, as an example dataSourceLinePlot.opacity = 0.0; @@ -196,7 +172,7 @@ -(void)constructScatterPlot areaGradient1.angle = -90.0; areaGradientFill = [CPTFill fillWithGradient:areaGradient1]; boundLinePlot.areaFill = areaGradientFill; - boundLinePlot.areaBaseValue = [[NSDecimalNumber zero] decimalValue]; + boundLinePlot.areaBaseValue = @0.0; // Add plot symbols CPTMutableLineStyle *symbolLineStyle = [CPTMutableLineStyle lineStyle]; @@ -208,7 +184,7 @@ -(void)constructScatterPlot boundLinePlot.plotSymbol = plotSymbol; // Add some initial data - NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100]; + NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100]; for ( NSUInteger i = 0; i < 60; i++ ) { NSNumber *xVal = @(1 + i * 0.05); NSNumber *yVal = @(1.2 * arc4random() / (double)UINT32_MAX + 1.2); @@ -219,7 +195,7 @@ -(void)constructScatterPlot -(void)constructBarChart { - // Create barChart from theme +// Create barChart from theme CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; @@ -235,32 +211,32 @@ -(void)constructBarChart newGraph.paddingRight = 20.0; newGraph.paddingBottom = 80.0; - // Add plot space for horizontal bar charts +// Add plot space for horizontal bar charts CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(300.0f)]; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(16.0f)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@300.0]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@16.0]; CPTXYAxisSet *axisSet = (CPTXYAxisSet *)newGraph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.axisLineStyle = nil; - x.majorTickLineStyle = nil; - x.minorTickLineStyle = nil; - x.majorIntervalLength = CPTDecimalFromDouble(5.0); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - x.title = @"X Axis"; - x.titleLocation = CPTDecimalFromFloat(7.5f); - x.titleOffset = 55.0; - - // Define some custom labels for the data elements + x.axisLineStyle = nil; + x.majorTickLineStyle = nil; + x.minorTickLineStyle = nil; + x.majorIntervalLength = @5.0; + x.orthogonalPosition = @0.0; + x.title = @"X Axis"; + x.titleLocation = @7.5; + x.titleOffset = 55.0; + +// Define some custom labels for the data elements x.labelRotation = CPTFloat(M_PI_4); x.labelingPolicy = CPTAxisLabelingPolicyNone; - NSArray *customTickLocations = @[@1, @5, @10, @15]; - NSArray *xAxisLabels = @[@"Label A", @"Label B", @"Label C", @"Label D"]; - NSUInteger labelLocation = 0; - NSMutableSet *customLabels = [NSMutableSet setWithCapacity:[xAxisLabels count]]; + CPTNumberArray *customTickLocations = @[@1, @5, @10, @15]; + CPTStringArray *xAxisLabels = @[@"Label A", @"Label B", @"Label C", @"Label D"]; + NSUInteger labelLocation = 0; + CPTMutableAxisLabelSet *customLabels = [NSMutableSet setWithCapacity:xAxisLabels.count]; for ( NSNumber *tickLocation in customTickLocations ) { CPTAxisLabel *newLabel = [[CPTAxisLabel alloc] initWithText:xAxisLabels[labelLocation++] textStyle:x.labelTextStyle]; - newLabel.tickLocation = [tickLocation decimalValue]; + newLabel.tickLocation = tickLocation; newLabel.offset = x.labelOffset + x.majorTickLength; newLabel.rotation = CPTFloat(M_PI_4); [customLabels addObject:newLabel]; @@ -269,28 +245,28 @@ -(void)constructBarChart x.axisLabels = customLabels; CPTXYAxis *y = axisSet.yAxis; - y.axisLineStyle = nil; - y.majorTickLineStyle = nil; - y.minorTickLineStyle = nil; - y.majorIntervalLength = CPTDecimalFromDouble(50.0); - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - y.title = @"Y Axis"; - y.titleOffset = 45.0; - y.titleLocation = CPTDecimalFromFloat(150.0f); - - // First bar plot + y.axisLineStyle = nil; + y.majorTickLineStyle = nil; + y.minorTickLineStyle = nil; + y.majorIntervalLength = @50.0; + y.orthogonalPosition = @0.0; + y.title = @"Y Axis"; + y.titleOffset = 45.0; + y.titleLocation = @150.0; + +// First bar plot CPTBarPlot *barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor darkGrayColor] horizontalBars:NO]; - barPlot.baseValue = CPTDecimalFromDouble(0.0); + barPlot.baseValue = @0.0; barPlot.dataSource = self; - barPlot.barOffset = CPTDecimalFromFloat(-0.25f); + barPlot.barOffset = @(-0.25); barPlot.identifier = @"Bar Plot 1"; [newGraph addPlot:barPlot toPlotSpace:plotSpace]; - // Second bar plot +// Second bar plot barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor blueColor] horizontalBars:NO]; barPlot.dataSource = self; - barPlot.baseValue = CPTDecimalFromDouble(0.0); - barPlot.barOffset = CPTDecimalFromFloat(0.25f); + barPlot.baseValue = @0.0; + barPlot.barOffset = @0.25; barPlot.barCornerRadius = 2.0; barPlot.identifier = @"Bar Plot 2"; barPlot.delegate = self; @@ -299,7 +275,7 @@ -(void)constructBarChart -(void)constructPieChart { - // Create pieChart from theme +// Create pieChart from theme CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; @@ -317,14 +293,14 @@ -(void)constructPieChart newGraph.axisSet = nil; - // Prepare a radial overlay gradient for shading/gloss +// Prepare a radial overlay gradient for shading/gloss CPTGradient *overlayGradient = [[CPTGradient alloc] init]; overlayGradient.gradientType = CPTGradientTypeRadial; overlayGradient = [overlayGradient addColorStop:[[CPTColor blackColor] colorWithAlphaComponent:CPTFloat(0.0)] atPosition:CPTFloat(0.0)]; overlayGradient = [overlayGradient addColorStop:[[CPTColor blackColor] colorWithAlphaComponent:CPTFloat(0.3)] atPosition:CPTFloat(0.9)]; overlayGradient = [overlayGradient addColorStop:[[CPTColor blackColor] colorWithAlphaComponent:CPTFloat(0.7)] atPosition:CPTFloat(1.0)]; - // Add pie chart +// Add pie chart CPTPieChart *newPlot = [[CPTPieChart alloc] init]; newPlot.dataSource = self; newPlot.pieRadius = 130.0; @@ -337,14 +313,14 @@ -(void)constructPieChart [newGraph addPlot:newPlot]; self.piePlot = newPlot; - // Add some initial data +// Add some initial data self.dataForChart = @[@20.0, @30.0, @(NAN), @60.0]; } #pragma mark - #pragma mark CPTBarPlot delegate method --(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index +-(void)barPlot:(nonnull CPTBarPlot *__unused)plot barWasSelectedAtRecordIndex:(NSUInteger)index { NSLog(@"barWasSelectedAtRecordIndex %lu", (unsigned long)index); } @@ -352,7 +328,7 @@ -(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot { if ( [plot isKindOfClass:[CPTPieChart class]] ) { return self.dataForChart.count; @@ -365,12 +341,12 @@ -(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot } } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSNumber *num = nil; if ( [plot isKindOfClass:[CPTPieChart class]] ) { - if ( index >= [self.dataForChart count] ) { + if ( index >= self.dataForChart.count ) { return nil; } @@ -397,7 +373,7 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI num = @(NAN); } else { - num = @( (index + 1) * (index + 1) ); + num = @((index + 1) * (index + 1)); if ( [plot.identifier isEqual:@"Bar Plot 2"] ) { num = @(num.integerValue - 10); } @@ -409,10 +385,10 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI if ( index % 8 ) { NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y"); num = self.dataForPlot[index][key]; - // Green plot gets shifted above the blue - if ( [(NSString *)plot.identifier isEqualToString : @"Green Plot"] ) { +// Green plot gets shifted above the blue + if ( [(NSString *) plot.identifier isEqualToString:@"Green Plot"] ) { if ( fieldEnum == CPTScatterPlotFieldY ) { - num = @([num doubleValue] + 1.0); + num = @(num.doubleValue + 1.0); } } } @@ -424,7 +400,7 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI return num; } --(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index +-(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *)plot recordIndex:(NSUInteger)index { if ( self.piePlotIsRotating ) { return nil; @@ -434,7 +410,7 @@ -(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - whiteText = [[CPTMutableTextStyle alloc] init]; + whiteText = [[CPTMutableTextStyle alloc] init]; whiteText.color = [CPTColor whiteColor]; }); diff --git a/examples/CPTTestApp-iPad/MainWindow.xib b/examples/CPTTestApp-iPad/MainWindow.xib deleted file mode 100644 index 0f4c3fd6a..000000000 --- a/examples/CPTTestApp-iPad/MainWindow.xib +++ /dev/null @@ -1,436 +0,0 @@ - - - - 800 - 10D540 - 760 - 1038.29 - 460.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 81 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 292 - {768, 1024} - - - 1 - MSAxIDEAA - - NO - NO - - 2 - - IBIPadFramework - YES - - - IBIPadFramework - - - CPTTestApp_iPadViewController - - IBIPadFramework - - - - - YES - - - viewController - - - - 8 - - - - delegate - - - - 9 - - - - window - - - - 10 - - - - - YES - - 0 - - - - - - -1 - - - File's Owner - - - -2 - - - - - 2 - - - - - 6 - - - CPTTestApp_iPad App Delegate - - - 7 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 2.IBEditorWindowLastContentRect - 2.IBPluginDependency - 6.CustomClassName - 6.IBPluginDependency - 7.CustomClassName - 7.IBEditorWindowLastContentRect - 7.IBPluginDependency - - - YES - UIApplication - UIResponder - {{200, 57}, {783, 799}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - CPTTestApp_iPadAppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - CPTTestApp_iPadViewController - {{512, 351}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 10 - - - - YES - - CPTTestApp_iPadAppDelegate - NSObject - - YES - - YES - viewController - window - - - YES - CPTTestApp_iPadViewController - UIWindow - - - - IBProjectSource - Classes/CPTTestApp_iPadAppDelegate.h - - - - CPTTestApp_iPadViewController - UIViewController - - IBProjectSource - Classes/CPTTestApp_iPadViewController.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSNetServices.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPort.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSStream.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSXMLParser.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIApplication - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIApplication.h - - - - UIResponder - NSObject - - - - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UITextInput.h - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - UIWindow - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIWindow.h - - - - - 0 - IBIPadFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - CPTTestApp-iPad.xcodeproj - 3 - 81 - - diff --git a/examples/CPTTestApp-iPad/main.m b/examples/CPTTestApp-iPad/main.m index 9ab34edf9..fa2ec758c 100644 --- a/examples/CPTTestApp-iPad/main.m +++ b/examples/CPTTestApp-iPad/main.m @@ -1,8 +1,8 @@ // -// main.m -// CPTTestApp-iPad +// main.m +// CPTTestApp-iPad // -// Created by Brad Larson on 4/1/2010. +// Created by Brad Larson on 4/1/2010. // #import diff --git a/examples/CPTTestApp-iPhone-SpeedTest/BarChart.xib b/examples/CPTTestApp-iPhone-SpeedTest/BarChart.xib deleted file mode 100644 index 5e197ad1d..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/BarChart.xib +++ /dev/null @@ -1,348 +0,0 @@ - - - - 768 - 10F569 - 804 - 1038.29 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 123 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - {320, 411} - - - 3 - MQA - - 2 - - - - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 3 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - -1 - - - File's Owner - - - -2 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - - - YES - CPTTestAppBarChartController - UIResponder - CPTGraphHostingView - {{568, 433}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 9 - - - - YES - - CPTTestAppBarChartController - UIViewController - - IBProjectSource - Classes/CPTTestAppBarChartController.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - CPTTestApp-iPhone.xcodeproj - 3 - 123 - - diff --git a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone.xcodeproj/project.pbxproj b/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone.xcodeproj/project.pbxproj deleted file mode 100644 index 1ddedae2a..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone.xcodeproj/project.pbxproj +++ /dev/null @@ -1,411 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1D3623260D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.m */; }; - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - 28216C970DB411BC00E5133A /* CPTTestAppBarChartController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28216C960DB411BC00E5133A /* CPTTestAppBarChartController.m */; }; - 282CCBFE0DB6C98000C4EA27 /* BarChart.xib in Resources */ = {isa = PBXBuildFile; fileRef = 282CCBFD0DB6C98000C4EA27 /* BarChart.xib */; }; - 288765080DF74369002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765070DF74369002DB57D /* CoreGraphics.framework */; }; - 28AD73880D9D96C1002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD73870D9D96C1002E5188 /* MainWindow.xib */; }; - 4E5EFFBC11B7DC6D00D8D6CB /* TestXYTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E5EFFBB11B7DC6D00D8D6CB /* TestXYTheme.m */; }; - BC74A33A10FC40C600E7E90D /* CPTTestAppPieChartController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74A33910FC40C600E7E90D /* CPTTestAppPieChartController.m */; }; - BC74A34110FC418D00E7E90D /* PieChart.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC74A34010FC418D00E7E90D /* PieChart.xib */; }; - BC8166CE1100DD00006D898E /* 16-line-chart.png in Resources */ = {isa = PBXBuildFile; fileRef = BC8166CC1100DD00006D898E /* 16-line-chart.png */; }; - BC8166CF1100DD00006D898E /* 17-bar-chart.png in Resources */ = {isa = PBXBuildFile; fileRef = BC8166CD1100DD00006D898E /* 17-bar-chart.png */; }; - BC8166D21100DD6F006D898E /* 62-contrast.png in Resources */ = {isa = PBXBuildFile; fileRef = BC8166D11100DD6F006D898E /* 62-contrast.png */; }; - BC9B81DA0FB893F70035D8DA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC9B81D90FB893F70035D8DA /* QuartzCore.framework */; }; - BC9B84360FB8B7110035D8DA /* ScatterPlot.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC9B84350FB8B7110035D8DA /* ScatterPlot.xib */; }; - BC9B843A0FB8B76B0035D8DA /* CPTTestAppScatterPlotController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B84390FB8B76B0035D8DA /* CPTTestAppScatterPlotController.m */; }; - C34677B619F3348600429A85 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C34677B519F3348600429A85 /* Launch Screen.xib */; }; - C3CD284317DE9CB7008EED1E /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3CD284217DE9CB7008EED1E /* Accelerate.framework */; }; - C3D3936819FD671A00148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3936719FD671A00148319 /* Images.xcassets */; }; - F7AE270A0FFFB61E001F26F0 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BC9B83B50FB8A9BC0035D8DA /* libCorePlot-CocoaTouch.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - BC9B83B40FB8A9BC0035D8DA /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BC9B83B00FB8A9BC0035D8DA /* CorePlot-CocoaTouch.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = BC9B83470FB8A0A40035D8DA; - remoteInfo = "CorePlot-CocoaTouch"; - }; - BC9B83B60FB8A9C70035D8DA /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BC9B83B00FB8A9BC0035D8DA /* CorePlot-CocoaTouch.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = BC9B83460FB8A0A40035D8DA; - remoteInfo = "CorePlot-CocoaTouch"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1D3623240D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestApp_iPhoneAppDelegate.h; sourceTree = ""; }; - 1D3623250D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTestApp_iPhoneAppDelegate.m; sourceTree = ""; }; - 1D6058910D05DD3D006BFB54 /* CPTTestApp-iPhone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CPTTestApp-iPhone.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 28216C950DB411BC00E5133A /* CPTTestAppBarChartController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestAppBarChartController.h; sourceTree = ""; }; - 28216C960DB411BC00E5133A /* CPTTestAppBarChartController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTestAppBarChartController.m; sourceTree = ""; }; - 282CCBFD0DB6C98000C4EA27 /* BarChart.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BarChart.xib; sourceTree = ""; }; - 288765070DF74369002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 28A0AB4B0D9B1048005BE974 /* CPTTestApp_iPhone_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestApp_iPhone_Prefix.pch; sourceTree = ""; }; - 28AD73870D9D96C1002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 4E5EFFBA11B7DC6D00D8D6CB /* TestXYTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestXYTheme.h; sourceTree = ""; }; - 4E5EFFBB11B7DC6D00D8D6CB /* TestXYTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestXYTheme.m; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BC74A33810FC40C600E7E90D /* CPTTestAppPieChartController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestAppPieChartController.h; sourceTree = ""; }; - BC74A33910FC40C600E7E90D /* CPTTestAppPieChartController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTestAppPieChartController.m; sourceTree = ""; }; - BC74A34010FC418D00E7E90D /* PieChart.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PieChart.xib; sourceTree = ""; }; - BC8166CC1100DD00006D898E /* 16-line-chart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "16-line-chart.png"; path = "GlyphishIcons/16-line-chart.png"; sourceTree = ""; }; - BC8166CD1100DD00006D898E /* 17-bar-chart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "17-bar-chart.png"; path = "GlyphishIcons/17-bar-chart.png"; sourceTree = ""; }; - BC8166D11100DD6F006D898E /* 62-contrast.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "62-contrast.png"; path = "GlyphishIcons/62-contrast.png"; sourceTree = ""; }; - BC9B81D90FB893F70035D8DA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - BC9B83B00FB8A9BC0035D8DA /* CorePlot-CocoaTouch.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "CorePlot-CocoaTouch.xcodeproj"; path = "../../framework/CorePlot-CocoaTouch.xcodeproj"; sourceTree = SOURCE_ROOT; }; - BC9B84350FB8B7110035D8DA /* ScatterPlot.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ScatterPlot.xib; sourceTree = ""; }; - BC9B84380FB8B76B0035D8DA /* CPTTestAppScatterPlotController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestAppScatterPlotController.h; sourceTree = ""; }; - BC9B84390FB8B76B0035D8DA /* CPTTestAppScatterPlotController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTestAppScatterPlotController.m; sourceTree = ""; }; - C34677B519F3348600429A85 /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "Launch Screen.xib"; sourceTree = ""; }; - C36E7CBF19DE1BFD00EDEACB /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/CorePlotWarnings.xcconfig; sourceTree = ""; }; - C3CD284217DE9CB7008EED1E /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; - C3D3936719FD671A00148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "CPTTestApp-iPhone/Images.xcassets"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, - 288765080DF74369002DB57D /* CoreGraphics.framework in Frameworks */, - BC9B81DA0FB893F70035D8DA /* QuartzCore.framework in Frameworks */, - F7AE270A0FFFB61E001F26F0 /* libCorePlot-CocoaTouch.a in Frameworks */, - C3CD284317DE9CB7008EED1E /* Accelerate.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - 4E5EFFBA11B7DC6D00D8D6CB /* TestXYTheme.h */, - 4E5EFFBB11B7DC6D00D8D6CB /* TestXYTheme.m */, - 28216C950DB411BC00E5133A /* CPTTestAppBarChartController.h */, - 28216C960DB411BC00E5133A /* CPTTestAppBarChartController.m */, - 1D3623240D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.h */, - 1D3623250D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.m */, - BC74A33810FC40C600E7E90D /* CPTTestAppPieChartController.h */, - BC74A33910FC40C600E7E90D /* CPTTestAppPieChartController.m */, - BC9B84380FB8B76B0035D8DA /* CPTTestAppScatterPlotController.h */, - BC9B84390FB8B76B0035D8DA /* CPTTestAppScatterPlotController.m */, - ); - path = Classes; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 1D6058910D05DD3D006BFB54 /* CPTTestApp-iPhone.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CPTTestApp-iPhone */ = { - isa = PBXGroup; - children = ( - BC9B83B00FB8A9BC0035D8DA /* CorePlot-CocoaTouch.xcodeproj */, - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - indentWidth = 4; - name = "CPTTestApp-iPhone"; - sourceTree = ""; - tabWidth = 4; - usesTabs = 0; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 28A0AB4B0D9B1048005BE974 /* CPTTestApp_iPhone_Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main.m */, - C36E7CBF19DE1BFD00EDEACB /* CorePlotWarnings.xcconfig */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - C3D3936719FD671A00148319 /* Images.xcassets */, - BC8166D11100DD6F006D898E /* 62-contrast.png */, - BC8166CC1100DD00006D898E /* 16-line-chart.png */, - BC8166CD1100DD00006D898E /* 17-bar-chart.png */, - 28AD73870D9D96C1002E5188 /* MainWindow.xib */, - BC9B84350FB8B7110035D8DA /* ScatterPlot.xib */, - 282CCBFD0DB6C98000C4EA27 /* BarChart.xib */, - BC74A34010FC418D00E7E90D /* PieChart.xib */, - 8D1107310486CEB800E47090 /* Info.plist */, - C34677B519F3348600429A85 /* Launch Screen.xib */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - BC9B81D90FB893F70035D8DA /* QuartzCore.framework */, - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, - 1D30AB110D05D00D00671497 /* Foundation.framework */, - 288765070DF74369002DB57D /* CoreGraphics.framework */, - C3CD284217DE9CB7008EED1E /* Accelerate.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - BC9B83B10FB8A9BC0035D8DA /* Products */ = { - isa = PBXGroup; - children = ( - BC9B83B50FB8A9BC0035D8DA /* libCorePlot-CocoaTouch.a */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* CPTTestApp-iPhone */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "CPTTestApp-iPhone" */; - buildPhases = ( - 1D60588D0D05DD3D006BFB54 /* Resources */, - 1D60588E0D05DD3D006BFB54 /* Sources */, - 1D60588F0D05DD3D006BFB54 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - BC9B83B70FB8A9C70035D8DA /* PBXTargetDependency */, - ); - name = "CPTTestApp-iPhone"; - productName = "CPTTestApp-iPhone"; - productReference = 1D6058910D05DD3D006BFB54 /* CPTTestApp-iPhone.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0700; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CPTTestApp-iPhone" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* CPTTestApp-iPhone */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = BC9B83B10FB8A9BC0035D8DA /* Products */; - ProjectRef = BC9B83B00FB8A9BC0035D8DA /* CorePlot-CocoaTouch.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 1D6058900D05DD3D006BFB54 /* CPTTestApp-iPhone */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - BC9B83B50FB8A9BC0035D8DA /* libCorePlot-CocoaTouch.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libCorePlot-CocoaTouch.a"; - remoteRef = BC9B83B40FB8A9BC0035D8DA /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 1D60588D0D05DD3D006BFB54 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 28AD73880D9D96C1002E5188 /* MainWindow.xib in Resources */, - 282CCBFE0DB6C98000C4EA27 /* BarChart.xib in Resources */, - BC9B84360FB8B7110035D8DA /* ScatterPlot.xib in Resources */, - BC74A34110FC418D00E7E90D /* PieChart.xib in Resources */, - C34677B619F3348600429A85 /* Launch Screen.xib in Resources */, - BC8166CE1100DD00006D898E /* 16-line-chart.png in Resources */, - BC8166CF1100DD00006D898E /* 17-bar-chart.png in Resources */, - BC8166D21100DD6F006D898E /* 62-contrast.png in Resources */, - C3D3936819FD671A00148319 /* Images.xcassets in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1D60588E0D05DD3D006BFB54 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, - 1D3623260D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.m in Sources */, - 28216C970DB411BC00E5133A /* CPTTestAppBarChartController.m in Sources */, - BC9B843A0FB8B76B0035D8DA /* CPTTestAppScatterPlotController.m in Sources */, - BC74A33A10FC40C600E7E90D /* CPTTestAppPieChartController.m in Sources */, - 4E5EFFBC11B7DC6D00D8D6CB /* TestXYTheme.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - BC9B83B70FB8A9C70035D8DA /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "CorePlot-CocoaTouch"; - targetProxy = BC9B83B60FB8A9C70035D8DA /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 1D6058940D05DD3E006BFB54 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = CPTTestApp_iPhone_Prefix.pch; - HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = Info.plist; - LIBRARY_SEARCH_PATHS = ""; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - PRODUCT_BUNDLE_IDENTIFIER = org.CorePlot.CPTTestAppiPhoneSpeed; - PRODUCT_NAME = "CPTTestApp-iPhone"; - SDKROOT = iphoneos; - }; - name = Debug; - }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - COPY_PHASE_STRIP = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = CPTTestApp_iPhone_Prefix.pch; - HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = Info.plist; - LIBRARY_SEARCH_PATHS = ""; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - PRODUCT_BUNDLE_IDENTIFIER = org.CorePlot.CPTTestAppiPhoneSpeed; - PRODUCT_NAME = "CPTTestApp-iPhone"; - SDKROOT = iphoneos; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C36E7CBF19DE1BFD00EDEACB /* CorePlotWarnings.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - SDKROOT = iphoneos; - SYMROOT = "$(SRCROOT)/../../build"; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C36E7CBF19DE1BFD00EDEACB /* CorePlotWarnings.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - ONLY_ACTIVE_ARCH = NO; - OTHER_LDFLAGS = "-ObjC"; - SDKROOT = iphoneos; - SYMROOT = "$(SRCROOT)/../../build"; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "CPTTestApp-iPhone" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D6058940D05DD3E006BFB54 /* Debug */, - 1D6058950D05DD3E006BFB54 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CPTTestApp-iPhone" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index ab9bdd134..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Contents.json b/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 340f2376e..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "images" : [ - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-Spotlight-40@2x.png", - "scale" : "2x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon.png", - "scale" : "1x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png b/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png deleted file mode 100644 index e48d5b2ba..000000000 Binary files a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png and /dev/null differ diff --git a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png b/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png deleted file mode 100644 index 0c4f8a4cc..000000000 Binary files a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png and /dev/null differ diff --git a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-Small.png b/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-Small.png deleted file mode 100644 index 5104b1d94..000000000 Binary files a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-Small.png and /dev/null differ diff --git a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png deleted file mode 100644 index 7f872ef97..000000000 Binary files a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png and /dev/null differ diff --git a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png b/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png deleted file mode 100644 index 87672586c..000000000 Binary files a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png and /dev/null differ diff --git a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon.png b/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon.png deleted file mode 100644 index c40700a7a..000000000 Binary files a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon.png and /dev/null differ diff --git a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon@2x.png b/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon@2x.png deleted file mode 100644 index 2e49f1b07..000000000 Binary files a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Icon@2x.png and /dev/null differ diff --git a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/LaunchImage.launchimage/Contents.json b/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index f0fce5477..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "filename" : "Default-568h@2x.png", - "minimum-system-version" : "7.0", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "scale" : "1x", - "orientation" : "portrait" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "orientation" : "portrait" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "filename" : "Default-568h@2x.png", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "minimum-system-version" : "7.0", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png b/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png deleted file mode 100644 index 0891b7aab..000000000 Binary files a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp-iPhone/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png and /dev/null differ diff --git a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp_iPhone_Prefix.pch b/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp_iPhone_Prefix.pch deleted file mode 100644 index 5cdc39f4d..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/CPTTestApp_iPhone_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'CPTTestApp-iPhone' target in the 'CPTTestApp-iPhone' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppBarChartController.h b/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppBarChartController.h deleted file mode 100644 index 147b3aebb..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppBarChartController.h +++ /dev/null @@ -1,11 +0,0 @@ -// -// CPTTestAppBarChartController.h -// CPTTestApp-iPhone -// - -#import "CorePlot-CocoaTouch.h" -#import - -@interface CPTTestAppBarChartController : UIViewController - -@end diff --git a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppBarChartController.m b/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppBarChartController.m deleted file mode 100644 index 43aeb02b8..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppBarChartController.m +++ /dev/null @@ -1,143 +0,0 @@ -// -// CPTTestAppBarChartController.m -// CPTTestApp-iPhone -// - -#import "CPTTestAppBarChartController.h" - -@interface CPTTestAppBarChartController() - -@property (nonatomic, readwrite, strong) CPTXYGraph *barChart; - -@end - -#pragma mark - - -@implementation CPTTestAppBarChartController - -@synthesize barChart; - -#pragma mark - -#pragma mark Initialization and teardown - --(void)viewDidLoad -{ - [super viewDidLoad]; - - // Create barChart from theme - CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; - CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; - [newGraph applyTheme:theme]; - CPTGraphHostingView *hostingView = (CPTGraphHostingView *)self.view; - self.barChart = newGraph; - - hostingView.hostedGraph = newGraph; - newGraph.plotAreaFrame.masksToBorder = NO; - - newGraph.paddingLeft = 70.0; - newGraph.paddingTop = 55.0; - newGraph.paddingRight = 20.0; - newGraph.paddingBottom = 80.0; - - // Add plot space for horizontal bar charts - CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(300.0)]; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(16.0)]; - - CPTXYAxisSet *axisSet = (CPTXYAxisSet *)newGraph.axisSet; - CPTXYAxis *x = axisSet.xAxis; - x.axisLineStyle = nil; - x.majorTickLineStyle = nil; - x.minorTickLineStyle = nil; - x.majorIntervalLength = CPTDecimalFromDouble(5.0); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - x.title = @"X Axis"; - x.titleLocation = CPTDecimalFromFloat(7.5f); - x.titleOffset = 55.0; - - // Define some custom labels for the data elements - x.labelRotation = CPTFloat(M_PI_4); - x.labelingPolicy = CPTAxisLabelingPolicyNone; - NSArray *customTickLocations = @[@1, @5, @10, @15]; - NSArray *xAxisLabels = @[@"Label A", @"Label B", @"Label C", @"Label D"]; - NSUInteger labelLocation = 0; - NSMutableSet *customLabels = [NSMutableSet setWithCapacity:[xAxisLabels count]]; - for ( NSNumber *tickLocation in customTickLocations ) { - CPTAxisLabel *newLabel = [[CPTAxisLabel alloc] initWithText:xAxisLabels[labelLocation++] textStyle:x.labelTextStyle]; - newLabel.tickLocation = [tickLocation decimalValue]; - newLabel.offset = x.labelOffset + x.majorTickLength; - newLabel.rotation = CPTFloat(M_PI_4); - [customLabels addObject:newLabel]; - } - - x.axisLabels = customLabels; - - CPTXYAxis *y = axisSet.yAxis; - y.axisLineStyle = nil; - y.majorTickLineStyle = nil; - y.minorTickLineStyle = nil; - y.majorIntervalLength = CPTDecimalFromDouble(50.0); - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - y.title = @"Y Axis"; - y.titleOffset = 45.0; - y.titleLocation = CPTDecimalFromFloat(150.0f); - - // First bar plot - CPTBarPlot *barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor darkGrayColor] horizontalBars:NO]; - barPlot.baseValue = CPTDecimalFromDouble(0.0); - barPlot.dataSource = self; - barPlot.barOffset = CPTDecimalFromFloat(-0.25f); - barPlot.identifier = @"Bar Plot 1"; - [newGraph addPlot:barPlot toPlotSpace:plotSpace]; - - // Second bar plot - barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor blueColor] horizontalBars:NO]; - barPlot.dataSource = self; - barPlot.baseValue = CPTDecimalFromDouble(0.0); - barPlot.barOffset = CPTDecimalFromFloat(0.25f); - barPlot.barCornerRadius = 2.0; - barPlot.identifier = @"Bar Plot 2"; - [newGraph addPlot:barPlot toPlotSpace:plotSpace]; - -#ifdef PERFORMANCE_TEST - [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(changePlotRange) userInfo:nil repeats:YES]; -#endif -} - --(void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview - // Release anything that's not essential, such as cached data -} - -#pragma mark - -#pragma mark Plot Data Source Methods - --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot -{ - return 16; -} - --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index -{ - NSNumber *num = nil; - - if ( [plot isKindOfClass:[CPTBarPlot class]] ) { - switch ( fieldEnum ) { - case CPTBarPlotFieldBarLocation: - num = @(index); - break; - - case CPTBarPlotFieldBarTip: - num = @( (index + 1) * (index + 1) ); - if ( [plot.identifier isEqual:@"Bar Plot 2"] ) { - num = @(num.integerValue - 10); - } - break; - } - } - - return num; -} - -@end diff --git a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppPieChartController.h b/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppPieChartController.h deleted file mode 100644 index 66cafd708..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppPieChartController.h +++ /dev/null @@ -1,8 +0,0 @@ -#import "CorePlot-CocoaTouch.h" -#import - -@interface CPTTestAppPieChartController : UIViewController - -@property (nonatomic, readwrite, strong) NSArray *dataForChart; - -@end diff --git a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppPieChartController.m b/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppPieChartController.m deleted file mode 100644 index 770569465..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppPieChartController.m +++ /dev/null @@ -1,128 +0,0 @@ -#import "CPTTestAppPieChartController.h" - -@interface CPTTestAppPieChartController() - -@property (nonatomic, readwrite, strong) CPTXYGraph *pieChart; -@property (nonatomic, readonly, assign) CGFloat pieMargin; -@property (nonatomic, readonly, assign) CGFloat pieRadius; -@property (nonatomic, readonly, assign) CGPoint pieCenter; - -@end - -#pragma mark - - -@implementation CPTTestAppPieChartController - -@synthesize dataForChart; -@synthesize pieChart; - --(CGFloat)pieMargin -{ - return self.pieChart.plotAreaFrame.borderLineStyle.lineWidth + CPTFloat(20.0); -} - --(CGFloat)pieRadius -{ - CGRect plotBounds = self.pieChart.plotAreaFrame.bounds; - - return MIN(plotBounds.size.width, plotBounds.size.height) / CPTFloat(2.0) - self.pieMargin; -} - --(CGPoint)pieCenter -{ - CGRect plotBounds = self.pieChart.plotAreaFrame.bounds; - - CGFloat y = 0.0; - - if ( plotBounds.size.width > plotBounds.size.height ) { - y = 0.45; - } - else { - y = (self.pieRadius + self.pieMargin) / plotBounds.size.height; - } - - return CGPointMake(0.5, y); -} - --(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation -{ - CPTPieChart *piePlot = (CPTPieChart *)[self.pieChart plotWithIdentifier:@"Pie Chart 1"]; - - piePlot.pieRadius = self.pieRadius; - piePlot.centerAnchor = self.pieCenter; -} - -#pragma mark - -#pragma mark Initialization and teardown - --(void)viewDidLoad -{ - [super viewDidLoad]; - - // Create pieChart from theme - CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; - CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; - [newGraph applyTheme:theme]; - self.pieChart = newGraph; - - CPTGraphHostingView *hostingView = (CPTGraphHostingView *)self.view; - hostingView.hostedGraph = newGraph; - - newGraph.paddingLeft = 20.0; - newGraph.paddingTop = 20.0; - newGraph.paddingRight = 20.0; - newGraph.paddingBottom = 20.0; - - newGraph.plotAreaFrame.masksToBorder = NO; - - newGraph.axisSet = nil; - - // Add pie chart - CPTPieChart *piePlot = [[CPTPieChart alloc] init]; - piePlot.dataSource = self; - piePlot.pieRadius = 1.0; - piePlot.identifier = @"Pie Chart 1"; - piePlot.startAngle = CPTFloat(M_PI_4); - piePlot.sliceDirection = CPTPieDirectionCounterClockwise; - [newGraph addPlot:piePlot]; - - // Add some initial data - self.dataForChart = @[@20.0, @30.0, @60.0]; - - [newGraph layoutIfNeeded]; - [self didRotateFromInterfaceOrientation:UIInterfaceOrientationPortrait]; - -#ifdef PERFORMANCE_TEST - [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(changePlotRange) userInfo:nil repeats:YES]; -#endif -} - --(void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview - // Release anything that's not essential, such as cached data -} - -#pragma mark - -#pragma mark Plot Data Source Methods - --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot -{ - return self.dataForChart.count; -} - --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index -{ - if ( index >= self.dataForChart.count ) { - return nil; - } - - if ( fieldEnum == CPTPieChartFieldSliceWidth ) { - return (self.dataForChart)[index]; - } - else { - return @(index); - } -} - -@end diff --git a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppScatterPlotController.h b/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppScatterPlotController.h deleted file mode 100644 index 22e5746e1..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppScatterPlotController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// CPTTestAppScatterPlotController.h -// CPTTestApp-iPhone -// -// Created by Brad Larson on 5/11/2009. -// - -#import "CorePlot-CocoaTouch.h" -#import - -#define NUM_POINTS 500 - -@interface CPTTestAppScatterPlotController : UIViewController - -@end diff --git a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppScatterPlotController.m b/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppScatterPlotController.m deleted file mode 100644 index 894327c7b..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestAppScatterPlotController.m +++ /dev/null @@ -1,211 +0,0 @@ -// -// CPTTestAppScatterPlotController.m -// CPTTestApp-iPhone -// -// Created by Brad Larson on 5/11/2009. -// - -#import "CPTTestAppScatterPlotController.h" -#import "TestXYTheme.h" - -#define USE_DOUBLEFASTPATH true -#define USE_ONEVALUEPATH false - -@interface CPTTestAppScatterPlotController() - -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; - -@property (nonatomic, readwrite, strong) NSData *xxx; -@property (nonatomic, readwrite, strong) NSData *yyy1; -@property (nonatomic, readwrite, strong) NSData *yyy2; - -@end - -#pragma mark - - -@implementation CPTTestAppScatterPlotController - -@synthesize graph; - -@synthesize xxx; -@synthesize yyy1; -@synthesize yyy2; - -#pragma mark - -#pragma mark Initialization and teardown - --(void)viewDidLoad -{ - [super viewDidLoad]; - - // Create graph from a custom theme - CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; - CPTTheme *theme = [[TestXYTheme alloc] init]; - [newGraph applyTheme:theme]; - self.graph = newGraph; - - newGraph.paddingLeft = 10.0; - newGraph.paddingTop = 20.0; - newGraph.paddingRight = 10.0; - newGraph.paddingBottom = 10.0; - - CPTGraphHostingView *hostingView = (CPTGraphHostingView *)self.view; - hostingView.hostedGraph = newGraph; - - newGraph.plotAreaFrame.masksToBorder = NO; - - // Setup plot space - CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; - plotSpace.allowsUserInteraction = NO; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(NUM_POINTS)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(NUM_POINTS)]; - - // Create a blue plot area - CPTScatterPlot *boundLinePlot = [[CPTScatterPlot alloc] init]; - boundLinePlot.identifier = @"Blue Plot"; - - CPTMutableLineStyle *lineStyle = [boundLinePlot.dataLineStyle mutableCopy]; - lineStyle.lineWidth = 1.0; - lineStyle.lineColor = [CPTColor blueColor]; - boundLinePlot.dataLineStyle = lineStyle; - - boundLinePlot.dataSource = self; - [newGraph addPlot:boundLinePlot]; - - // Create a green plot area - CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] init]; - dataSourceLinePlot.identifier = @"Green Plot"; - - lineStyle = [dataSourceLinePlot.dataLineStyle mutableCopy]; - lineStyle.lineWidth = 1.0; - lineStyle.lineColor = [CPTColor greenColor]; - dataSourceLinePlot.dataLineStyle = lineStyle; - - dataSourceLinePlot.dataSource = self; - [newGraph addPlot:dataSourceLinePlot]; - - // Create plot data - NSMutableData *xData = [[NSMutableData alloc] initWithCapacity:NUM_POINTS * sizeof(double)]; - NSMutableData *y1Data = [[NSMutableData alloc] initWithCapacity:NUM_POINTS * sizeof(double)]; - NSMutableData *y2Data = [[NSMutableData alloc] initWithCapacity:NUM_POINTS * sizeof(double)]; - - double *xArray = xData.mutableBytes; - double *y1Array = y1Data.mutableBytes; - double *y2Array = y2Data.mutableBytes; - - for ( NSUInteger i = 0; i < NUM_POINTS; i++ ) { - xArray[i] = i; - y1Array[i] = (NUM_POINTS / 3) * (arc4random() / (double)UINT32_MAX); - y2Array[i] = (NUM_POINTS / 3) * (arc4random() / (double)UINT32_MAX) + NUM_POINTS / 3; - } - - self.xxx = xData; - self.yyy1 = y1Data; - self.yyy2 = y2Data; - -#define PERFORMANCE_TEST1 -#ifdef PERFORMANCE_TEST1 - [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(changePlotRange) userInfo:nil repeats:YES]; -#endif - -#ifdef PERFORMANCE_TEST2 - [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(reloadPlots) userInfo:nil repeats:YES]; -#endif -} - --(void)reloadPlots -{ - NSArray *plots = [self.graph allPlots]; - - for ( CPTPlot *plot in plots ) { - [plot reloadData]; - } -} - --(void)changePlotRange -{ - // Setup plot space - CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; - - double ylen = NUM_POINTS * (arc4random() / (double)UINT32_MAX); - - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(NUM_POINTS)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(ylen)]; -} - -#pragma mark - -#pragma mark Plot Data - --(const double *)valuesForPlotWithIdentifier:(id)identifier field:(NSUInteger)fieldEnum -{ - if ( fieldEnum == 0 ) { - return (const double *)self.xxx.bytes; - } - else { - if ( [identifier isEqualToString:@"Blue Plot"] ) { - return (const double *)self.yyy1.bytes; - } - else { - return (const double *)self.yyy2.bytes; - } - } -} - -#pragma mark - -#pragma mark Plot Data Source Methods - --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot -{ - return NUM_POINTS; -} - -#if USE_DOUBLEFASTPATH -#if USE_ONEVALUEPATH --(double)doubleForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)indx -{ - double *values = [self valuesForPlotWithIdentifier:[plot identifier] field:fieldEnum]; - - return values[indx]; -} - -#else --(double *)doublesForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange -{ - double *values = [self valuesForPlotWithIdentifier:[plot identifier] field:fieldEnum]; - - return values + indexRange.location; -} -#endif - -#else -#if USE_ONEVALUEPATH --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)indx -{ - NSNumber *num = nil; - double *values = [self valuesForPlotWithIdentifier:[plot identifier] field:fieldEnum]; - - if ( values ) { - num = @(values[indx]); - } - return num; -} - -#else --(NSArray *)numbersForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange -{ - double *values = [self valuesForPlotWithIdentifier:[plot identifier] field:fieldEnum]; - - if ( values == NULL ) { - return nil; - } - - NSMutableArray *returnArray = [NSMutableArray arrayWithCapacity:indexRange.length]; - for ( NSUInteger i = indexRange.location; i < indexRange.location + indexRange.length; i++ ) { - [returnArray addObject:@(values[i])]; - } - return returnArray; -} -#endif -#endif - -@end diff --git a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestApp_iPhoneAppDelegate.h b/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestApp_iPhoneAppDelegate.h deleted file mode 100644 index d985da722..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestApp_iPhoneAppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// CPTTestApp_iPhoneAppDelegate.h -// CPTTestApp-iPhone -// -// Toolbar icons in the application are courtesy of Joseph Wain / glyphish.com -// See the license file in the GlyphishIcons directory for more information on these icons - -#import - -@interface CPTTestApp_iPhoneAppDelegate : NSObject - -@property (nonatomic, readwrite, strong) IBOutlet UIWindow *window; -@property (nonatomic, readwrite, strong) IBOutlet UITabBarController *tabBarController; - -@end diff --git a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestApp_iPhoneAppDelegate.m b/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestApp_iPhoneAppDelegate.m deleted file mode 100644 index 0203992bc..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/Classes/CPTTestApp_iPhoneAppDelegate.m +++ /dev/null @@ -1,32 +0,0 @@ -// -// CPTTestApp_iPhoneAppDelegate.m -// CPTTestApp-iPhone -// -// Created by Brad Larson on 5/11/2009. - -#import "CPTTestApp_iPhoneAppDelegate.h" - -@implementation CPTTestApp_iPhoneAppDelegate - -@synthesize window; -@synthesize tabBarController; - --(void)applicationDidFinishLaunching:(UIApplication *)application -{ - self.window.rootViewController = self.tabBarController; - [self.window makeKeyAndVisible]; -} - -/* - * // Optional UITabBarControllerDelegate method - * - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { - * } - */ - -/* - * // Optional UITabBarControllerDelegate method - * - (void)tabBarController:(UITabBarController *)tabBarController didEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed { - * } - */ - -@end diff --git a/examples/CPTTestApp-iPhone-SpeedTest/Classes/TestXYTheme.h b/examples/CPTTestApp-iPhone-SpeedTest/Classes/TestXYTheme.h deleted file mode 100644 index c20a51e5f..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/Classes/TestXYTheme.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// TestXYTheme.h -// CPTTestApp-iPhone -// -// Created by Joan on 03/06/10. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - -#import - -#import "CorePlot-CocoaTouch.h" - -@interface TestXYTheme : CPTTheme -{ -} - -@end diff --git a/examples/CPTTestApp-iPhone-SpeedTest/Classes/TestXYTheme.m b/examples/CPTTestApp-iPhone-SpeedTest/Classes/TestXYTheme.m deleted file mode 100644 index f5eac3860..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/Classes/TestXYTheme.m +++ /dev/null @@ -1,103 +0,0 @@ -// -// TestXYTheme.m -// CPTTestApp-iPhone -// -// Created by Joan on 03/06/10. -// Copyright 2010 __MyCompanyName__. All rights reserved. -// - -#import "TestXYTheme.h" - -@implementation TestXYTheme - -+(NSString *)name -{ - return @"TestXYTheme"; -} - --(instancetype)init -{ - if ( (self = [super init]) ) { - self.graphClass = [CPTXYGraph class]; - } - return self; -} - -#pragma mark - - --(void)applyThemeToAxis:(CPTXYAxis *)axis usingMajorLineStyle:(CPTLineStyle *)majorLineStyle - minorLineStyle:(CPTLineStyle *)minorLineStyle majorGridLineStyle:majorGridLineStyle textStyle:(CPTTextStyle *)textStyle -{ - axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - axis.majorIntervalLength = CPTDecimalFromDouble(20.0); - axis.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - axis.tickDirection = CPTSignNone; - axis.minorTicksPerInterval = 3; - axis.majorTickLineStyle = majorLineStyle; - axis.minorTickLineStyle = minorLineStyle; - axis.axisLineStyle = majorLineStyle; - axis.majorTickLength = 5.0; - axis.minorTickLength = 3.0; - axis.labelTextStyle = textStyle; - axis.titleTextStyle = textStyle; - //axis.labelFormatter = numberFormatter ; - axis.majorGridLineStyle = majorGridLineStyle; - axis.labelingPolicy = CPTAxisLabelingPolicyAutomatic; -} - --(void)applyThemeToBackground:(CPTGraph *)graph -{ - CPTColor *endColor = [CPTColor colorWithGenericGray:CPTFloat(0.1)]; - CPTGradient *graphGradient = [CPTGradient gradientWithBeginningColor:endColor endingColor:endColor]; - - graphGradient = [graphGradient addColorStop:[CPTColor colorWithGenericGray:CPTFloat(0.2)] atPosition:CPTFloat(0.3)]; - graphGradient = [graphGradient addColorStop:[CPTColor colorWithGenericGray:CPTFloat(0.3)] atPosition:CPTFloat(0.5)]; - graphGradient = [graphGradient addColorStop:[CPTColor colorWithGenericGray:CPTFloat(0.2)] atPosition:CPTFloat(0.6)]; - graphGradient.angle = 90.0; - graph.fill = [CPTFill fillWithGradient:graphGradient]; -} - --(void)applyThemeToPlotArea:(CPTPlotAreaFrame *)plotAreaFrame -{ - CPTGradient *gradient = [CPTGradient gradientWithBeginningColor:[CPTColor colorWithGenericGray:CPTFloat(0.1)] endingColor:[CPTColor colorWithGenericGray:CPTFloat(0.3)]]; - - gradient.angle = 90.0; - plotAreaFrame.fill = [CPTFill fillWithGradient:gradient]; - - plotAreaFrame.paddingLeft = 50; - plotAreaFrame.paddingTop = 10; - plotAreaFrame.paddingRight = 20; - plotAreaFrame.paddingBottom = 30; -} - --(void)applyThemeToAxisSet:(CPTAxisSet *)axisSet -{ - CPTMutableLineStyle *majorLineStyle = [CPTMutableLineStyle lineStyle]; - - majorLineStyle.lineCap = kCGLineCapSquare; - majorLineStyle.lineColor = [CPTColor grayColor]; - majorLineStyle.lineWidth = 2.0; - - CPTMutableLineStyle *minorLineStyle = [CPTMutableLineStyle lineStyle]; - minorLineStyle.lineCap = kCGLineCapSquare; - minorLineStyle.lineColor = [CPTColor grayColor]; - minorLineStyle.lineWidth = 1.0; - - CPTMutableLineStyle *majorGridLineStyle = [CPTMutableLineStyle lineStyle]; - majorGridLineStyle.lineWidth = CPTFloat(0.1); - majorGridLineStyle.lineColor = [CPTColor lightGrayColor]; - - CPTMutableLineStyle *minorGridLineStyle = [CPTMutableLineStyle lineStyle]; - minorGridLineStyle.lineWidth = 0.25; - minorGridLineStyle.lineColor = [CPTColor blueColor]; - - CPTMutableTextStyle *whiteTextStyle = [[CPTMutableTextStyle alloc] init]; - whiteTextStyle.color = [CPTColor whiteColor]; - whiteTextStyle.fontSize = 14.0; - - CPTXYAxisSet *xyAxisSet = (CPTXYAxisSet *)axisSet; - [self applyThemeToAxis:xyAxisSet.xAxis usingMajorLineStyle:majorLineStyle minorLineStyle:minorLineStyle majorGridLineStyle:majorGridLineStyle textStyle:whiteTextStyle]; - [self applyThemeToAxis:xyAxisSet.yAxis usingMajorLineStyle:majorLineStyle minorLineStyle:minorLineStyle majorGridLineStyle:majorGridLineStyle textStyle:whiteTextStyle]; -} - -@end diff --git a/examples/CPTTestApp-iPhone-SpeedTest/GlyphishIcons/16-line-chart.png b/examples/CPTTestApp-iPhone-SpeedTest/GlyphishIcons/16-line-chart.png deleted file mode 100644 index 37b48e956..000000000 Binary files a/examples/CPTTestApp-iPhone-SpeedTest/GlyphishIcons/16-line-chart.png and /dev/null differ diff --git a/examples/CPTTestApp-iPhone-SpeedTest/GlyphishIcons/17-bar-chart.png b/examples/CPTTestApp-iPhone-SpeedTest/GlyphishIcons/17-bar-chart.png deleted file mode 100644 index f3fbebbc2..000000000 Binary files a/examples/CPTTestApp-iPhone-SpeedTest/GlyphishIcons/17-bar-chart.png and /dev/null differ diff --git a/examples/CPTTestApp-iPhone-SpeedTest/GlyphishIcons/62-contrast.png b/examples/CPTTestApp-iPhone-SpeedTest/GlyphishIcons/62-contrast.png deleted file mode 100644 index 98ec0ad25..000000000 Binary files a/examples/CPTTestApp-iPhone-SpeedTest/GlyphishIcons/62-contrast.png and /dev/null differ diff --git a/examples/CPTTestApp-iPhone-SpeedTest/GlyphishIcons/Read me first - license.txt b/examples/CPTTestApp-iPhone-SpeedTest/GlyphishIcons/Read me first - license.txt deleted file mode 100644 index 5fa3c99ad..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/GlyphishIcons/Read me first - license.txt +++ /dev/null @@ -1,14 +0,0 @@ -Created by Joseph Wain (see http://penandthink.com) at and probably downloaded from http://glyphish.com - -This work is licensed under the Creative Commons Attribution 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. - -You are free to share it and to remix it remix under the following conditions: - -* You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). -* For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to http://creativecommons.org/licenses/by/3.0/us/ -* Any of the above conditions can be waived if you get permission from the copyright holder (send me an email!). -* Apart from the remix rights granted under this license, nothing in this license impairs or restricts the author's moral rights. - -ATTRIBUTION -- a note reading "icons by Joseph Wain / glyphish.com" or similar, plus a link back to glyphish.com from your app's website, is the preferred form of attribution. Also acceptable would be, like, a link from within your iPhone application, or from the iTunes store page, but those aren't as useful to other people. If none of these work for you, please contact hello@glyphish.com and we can work something out. - -USE WITHOUT ATTRIBUTION -- If attribution is not possible, workable or desirable for your application, contact hello@glyphish.com for commercial non-attributed licensing terms. \ No newline at end of file diff --git a/examples/CPTTestApp-iPhone-SpeedTest/Info.plist b/examples/CPTTestApp-iPhone-SpeedTest/Info.plist deleted file mode 100644 index 9f9e720f2..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/Info.plist +++ /dev/null @@ -1,39 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIcons~ipad - - CFBundleIdentifier - com.SweetWilliam.CPTTestApp - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - NSMainNibFile - MainWindow - UILaunchStoryboardName - Launch Screen - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/examples/CPTTestApp-iPhone-SpeedTest/Launch Screen.xib b/examples/CPTTestApp-iPhone-SpeedTest/Launch Screen.xib deleted file mode 100644 index 8337721bd..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/Launch Screen.xib +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/CPTTestApp-iPhone-SpeedTest/MainWindow.xib b/examples/CPTTestApp-iPhone-SpeedTest/MainWindow.xib deleted file mode 100644 index 97a8aead0..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/MainWindow.xib +++ /dev/null @@ -1,436 +0,0 @@ - - - - 528 - 12C60 - 2843 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1929 - - - YES - IBProxyObject - IBUICustomObject - IBUITabBar - IBUITabBarController - IBUITabBarItem - IBUIViewController - IBUIWindow - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - IBCocoaTouchFramework - - - - 1316 - - {320, 480} - - - - 1 - MSAxIDEAA - - NO - NO - - IBCocoaTouchFramework - YES - YES - - - - - - 1 - 1 - - IBCocoaTouchFramework - NO - - Pie Chart - - Pie Chart - - NSImage - 62-contrast.png - - IBCocoaTouchFramework - - - YES - - - PieChart - - 1 - 1 - - IBCocoaTouchFramework - NO - - - YES - - Scatter Plot - - Scatter Plot - - NSImage - 16-line-chart.png - - IBCocoaTouchFramework - - - ScatterPlot - - 1 - 1 - - IBCocoaTouchFramework - NO - - - - Bar Chart - - NSImage - 17-bar-chart.png - - IBCocoaTouchFramework - - - BarChart - - 1 - 1 - - IBCocoaTouchFramework - NO - - - - - - 266 - {{129, 330}, {163, 49}} - - 3 - MCAwAA - - NO - IBCocoaTouchFramework - - - - - - YES - - - delegate - - - - 99 - - - - window - - - - 9 - - - - tabBarController - - - - 113 - - - - - YES - - 0 - - - - - - 2 - - - YES - - - - - -1 - - - File's Owner - - - 3 - - - - - 106 - - - YES - - - - - - - - - 107 - - - - - 108 - - - YES - - - - - - 109 - - - YES - - - - - - 110 - - - - - 111 - - - - - -2 - - - - - 125 - - - YES - - - - - - 126 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 106.IBPluginDependency - 107.IBPluginDependency - 108.CustomClassName - 108.IBPluginDependency - 109.CustomClassName - 109.IBPluginDependency - 110.IBPluginDependency - 111.IBPluginDependency - 125.CustomClassName - 125.IBPluginDependency - 126.IBPluginDependency - 2.IBAttributePlaceholdersKey - 2.IBPluginDependency - 3.CustomClassName - 3.IBPluginDependency - - - YES - UIApplication - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - CPTTestAppScatterPlotController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - CPTTestAppBarChartController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - CPTTestAppPieChartController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - YES - - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - CPTTestApp_iPhoneAppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 126 - - - - YES - - CPTTestAppBarChartController - UIViewController - - IBProjectSource - ./Classes/CPTTestAppBarChartController.h - - - - CPTTestAppPieChartController - UIViewController - - IBProjectSource - ./Classes/CPTTestAppPieChartController.h - - - - CPTTestAppScatterPlotController - UIViewController - - IBProjectSource - ./Classes/CPTTestAppScatterPlotController.h - - - - CPTTestApp_iPhoneAppDelegate - NSObject - - YES - - YES - tabBarController - window - - - YES - UITabBarController - UIWindow - - - - YES - - YES - tabBarController - window - - - YES - - tabBarController - UITabBarController - - - window - UIWindow - - - - - IBProjectSource - ./Classes/CPTTestApp_iPhoneAppDelegate.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - 16-line-chart.png - 17-bar-chart.png - 62-contrast.png - - - YES - {30, 24} - {29, 24} - {20, 20} - - - 1929 - - diff --git a/examples/CPTTestApp-iPhone-SpeedTest/PieChart.xib b/examples/CPTTestApp-iPhone-SpeedTest/PieChart.xib deleted file mode 100644 index 0793e4bdd..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/PieChart.xib +++ /dev/null @@ -1,346 +0,0 @@ - - - - 768 - 10F569 - 804 - 1038.29 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 123 - - - YES - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - {320, 411} - - 3 - MQA - - 2 - - - - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 3 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - -1 - - - File's Owner - - - -2 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - - - YES - CPTTestAppPieChartController - UIResponder - CPTGraphHostingView - {{158, 204}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 9 - - - - YES - - CPTTestAppPieChartController - UIViewController - - IBProjectSource - Classes/CPTTestAppPieChartController.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - CPTTestApp-iPhone.xcodeproj - 3 - 123 - - diff --git a/examples/CPTTestApp-iPhone-SpeedTest/ScatterPlot.xib b/examples/CPTTestApp-iPhone-SpeedTest/ScatterPlot.xib deleted file mode 100644 index acd2d4ba7..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/ScatterPlot.xib +++ /dev/null @@ -1,356 +0,0 @@ - - - - 528 - 10F569 - 804 - 1038.29 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 123 - - - YES - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - {320, 460} - - 3 - MQA - - 2 - - - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 5 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - -1 - - - File's Owner - - - -2 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - - - YES - CPTTestAppScatterPlotController - UIResponder - CPTGraphHostingView - {{430, 168}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 5 - - - - YES - - CPTTestAppScatterPlotController - UIViewController - - IBProjectSource - Classes/CPTTestAppScatterPlotController.h - - - - - YES - - CPTGraphHostingView - UIView - - IBDocumentRelativeSource - ../../framework/iPhoneOnly/CPTGraphHostingView.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - CPTTestApp-iPhone.xcodeproj - 3 - 123 - - diff --git a/examples/CPTTestApp-iPhone-SpeedTest/main.m b/examples/CPTTestApp-iPhone-SpeedTest/main.m deleted file mode 100644 index 762bdbbff..000000000 --- a/examples/CPTTestApp-iPhone-SpeedTest/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// CPTTestApp-iPhone -// -// Created by Brad Larson on 5/11/2009. -// - -#import - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - int retVal = UIApplicationMain(argc, argv, nil, nil); - - return retVal; - } -} diff --git a/examples/CPTTestApp-iPhone/BarChart.xib b/examples/CPTTestApp-iPhone/BarChart.xib deleted file mode 100644 index 487a42233..000000000 --- a/examples/CPTTestApp-iPhone/BarChart.xib +++ /dev/null @@ -1,356 +0,0 @@ - - - - 768 - 10F569 - 804 - 1038.29 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 123 - - - YES - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - {320, 411} - - - - 3 - MQA - - 2 - - - - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 3 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - -1 - - - File's Owner - - - -2 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - - - YES - CPTTestAppBarChartController - UIResponder - CPTGraphHostingView - {{568, 433}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 9 - - - - YES - - CPTGraphHostingView - UIView - - IBUserSource - - - - - CPTTestAppBarChartController - UIViewController - - IBProjectSource - Classes/CPTTestAppBarChartController.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - CPTTestApp-iPhone.xcodeproj - 3 - 123 - - diff --git a/examples/CPTTestApp-iPhone/Base.lproj/BarChart.xib b/examples/CPTTestApp-iPhone/Base.lproj/BarChart.xib new file mode 100644 index 000000000..646ef95c3 --- /dev/null +++ b/examples/CPTTestApp-iPhone/Base.lproj/BarChart.xib @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp-iPhone/Info.plist b/examples/CPTTestApp-iPhone/Base.lproj/Info.plist similarity index 95% rename from examples/CPTTestApp-iPhone/Info.plist rename to examples/CPTTestApp-iPhone/Base.lproj/Info.plist index 5e25306a4..3f5c82874 100644 --- a/examples/CPTTestApp-iPhone/Info.plist +++ b/examples/CPTTestApp-iPhone/Base.lproj/Info.plist @@ -18,6 +18,8 @@ ${PRODUCT_NAME} CFBundlePackageType APPL + CFBundleShortVersionString + 1.0 CFBundleSignature ???? CFBundleVersion diff --git a/examples/CPTTestApp-iPhone/Launch Screen.xib b/examples/CPTTestApp-iPhone/Base.lproj/Launch Screen.xib similarity index 66% rename from examples/CPTTestApp-iPhone/Launch Screen.xib rename to examples/CPTTestApp-iPhone/Base.lproj/Launch Screen.xib index 4529d82e3..b51d6d522 100644 --- a/examples/CPTTestApp-iPhone/Launch Screen.xib +++ b/examples/CPTTestApp-iPhone/Base.lproj/Launch Screen.xib @@ -1,8 +1,12 @@ - - + + + + + - - + + + @@ -11,14 +15,14 @@ - - + diff --git a/examples/CPTTestApp-iPhone/Base.lproj/MainWindow.xib b/examples/CPTTestApp-iPhone/Base.lproj/MainWindow.xib new file mode 100644 index 000000000..19255ec6e --- /dev/null +++ b/examples/CPTTestApp-iPhone/Base.lproj/MainWindow.xib @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp-iPhone/Base.lproj/PieChart.xib b/examples/CPTTestApp-iPhone/Base.lproj/PieChart.xib new file mode 100644 index 000000000..840e4935a --- /dev/null +++ b/examples/CPTTestApp-iPhone/Base.lproj/PieChart.xib @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp-iPhone/Base.lproj/ScatterPlot.xib b/examples/CPTTestApp-iPhone/Base.lproj/ScatterPlot.xib new file mode 100644 index 000000000..b1747d817 --- /dev/null +++ b/examples/CPTTestApp-iPhone/Base.lproj/ScatterPlot.xib @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone-Bridging-Header.h b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone-Bridging-Header.h new file mode 100644 index 000000000..c99c8cd1b --- /dev/null +++ b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone-Bridging-Header.h @@ -0,0 +1 @@ +#import "CorePlot-CocoaTouch.h" diff --git a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/project.pbxproj b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/project.pbxproj index 85eca2c31..672347980 100644 --- a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/project.pbxproj +++ b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/project.pbxproj @@ -3,80 +3,115 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 47; objects = { /* Begin PBXBuildFile section */ - 1D3623260D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.m */; }; - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - 28216C970DB411BC00E5133A /* CPTTestAppBarChartController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28216C960DB411BC00E5133A /* CPTTestAppBarChartController.m */; }; - 282CCBFE0DB6C98000C4EA27 /* BarChart.xib in Resources */ = {isa = PBXBuildFile; fileRef = 282CCBFD0DB6C98000C4EA27 /* BarChart.xib */; }; 288765080DF74369002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765070DF74369002DB57D /* CoreGraphics.framework */; }; - 28AD73880D9D96C1002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD73870D9D96C1002E5188 /* MainWindow.xib */; }; - BC74A33A10FC40C600E7E90D /* CPTTestAppPieChartController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74A33910FC40C600E7E90D /* CPTTestAppPieChartController.m */; }; - BC74A34110FC418D00E7E90D /* PieChart.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC74A34010FC418D00E7E90D /* PieChart.xib */; }; BC8166CE1100DD00006D898E /* 16-line-chart.png in Resources */ = {isa = PBXBuildFile; fileRef = BC8166CC1100DD00006D898E /* 16-line-chart.png */; }; BC8166CF1100DD00006D898E /* 17-bar-chart.png in Resources */ = {isa = PBXBuildFile; fileRef = BC8166CD1100DD00006D898E /* 17-bar-chart.png */; }; BC8166D21100DD6F006D898E /* 62-contrast.png in Resources */ = {isa = PBXBuildFile; fileRef = BC8166D11100DD6F006D898E /* 62-contrast.png */; }; BC9B81DA0FB893F70035D8DA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC9B81D90FB893F70035D8DA /* QuartzCore.framework */; }; - BC9B84360FB8B7110035D8DA /* ScatterPlot.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC9B84350FB8B7110035D8DA /* ScatterPlot.xib */; }; - BC9B843A0FB8B76B0035D8DA /* CPTTestAppScatterPlotController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B84390FB8B76B0035D8DA /* CPTTestAppScatterPlotController.m */; }; - C34677B219F3345500429A85 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C34677B119F3345500429A85 /* Launch Screen.xib */; }; + C359603719CE34FC005CDFB9 /* BarChartController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C359603319CE34FB005CDFB9 /* BarChartController.swift */; }; + C359603819CE34FC005CDFB9 /* iPhoneAppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C359603419CE34FB005CDFB9 /* iPhoneAppDelegate.swift */; }; + C359603919CE34FC005CDFB9 /* PieChartController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C359603519CE34FB005CDFB9 /* PieChartController.swift */; }; + C359603A19CE34FC005CDFB9 /* ScatterPlotController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C359603619CE34FB005CDFB9 /* ScatterPlotController.swift */; }; C3B9F9D417503CDD001CCC50 /* BlueTexture.png in Resources */ = {isa = PBXBuildFile; fileRef = C3B9F9D317503CDD001CCC50 /* BlueTexture.png */; }; - C3CD283E17DE9C95008EED1E /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3CD283D17DE9C95008EED1E /* Accelerate.framework */; }; + C3D0A20C20E019EB00BA2921 /* PieChart.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A20E20E019EB00BA2921 /* PieChart.xib */; }; + C3D0A21C20E019F000BA2921 /* BarChart.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A21E20E019F000BA2921 /* BarChart.xib */; }; + C3D0A21F20E019F300BA2921 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A22120E019F300BA2921 /* MainWindow.xib */; }; + C3D0A22220E019F800BA2921 /* ScatterPlot.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A22420E019F800BA2921 /* ScatterPlot.xib */; }; + C3D0A22520E019FF00BA2921 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A22720E019FF00BA2921 /* Launch Screen.xib */; }; C3D3936419FD671100148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3936319FD671100148319 /* Images.xcassets */; }; - F7AE270A0FFFB61E001F26F0 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BC9B83B50FB8A9BC0035D8DA /* libCorePlot-CocoaTouch.a */; }; + C3D414C61A7D847C00B6F5D6 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C3D414C31A7D846500B6F5D6 /* libCorePlot-CocoaTouch.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - BC9B83B40FB8A9BC0035D8DA /* PBXContainerItemProxy */ = { + C31D01F11D10F506008C1EF2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = BC9B83B00FB8A9BC0035D8DA /* CorePlot-CocoaTouch.xcodeproj */; + containerPortal = C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */; proxyType = 2; - remoteGlobalIDString = BC9B83470FB8A0A40035D8DA; - remoteInfo = "CorePlot-CocoaTouch"; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; }; - BC9B83B60FB8A9C70035D8DA /* PBXContainerItemProxy */ = { + C31D01F31D10F506008C1EF2 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = BC9B83B00FB8A9BC0035D8DA /* CorePlot-CocoaTouch.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = BC9B83460FB8A0A40035D8DA; + containerPortal = C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; + C3D414BA1A7D846500B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8DC2EF5B0486A6940098B216; + remoteInfo = CorePlot; + }; + C3D414BC1A7D846500B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 0730F600109492D800E95162; + remoteInfo = UnitTests; + }; + C3D414BE1A7D846500B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09781A46185200D45436; + remoteInfo = CorePlot_iOS; + }; + C3D414C01A7D846500B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09821A46185300D45436; + remoteInfo = CorePlot_iOSTests; + }; + C3D414C21A7D846500B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09BA1A4619A900D45436; remoteInfo = "CorePlot-CocoaTouch"; }; + C3D414C41A7D846500B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09C41A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouchTests"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1D3623240D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestApp_iPhoneAppDelegate.h; sourceTree = ""; }; - 1D3623250D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTestApp_iPhoneAppDelegate.m; sourceTree = ""; }; 1D6058910D05DD3D006BFB54 /* CPTTestApp-iPhone.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "CPTTestApp-iPhone.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 28216C950DB411BC00E5133A /* CPTTestAppBarChartController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestAppBarChartController.h; sourceTree = ""; }; - 28216C960DB411BC00E5133A /* CPTTestAppBarChartController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTestAppBarChartController.m; sourceTree = ""; }; - 282CCBFD0DB6C98000C4EA27 /* BarChart.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BarChart.xib; sourceTree = ""; }; 288765070DF74369002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 28A0AB4B0D9B1048005BE974 /* CPTTestApp_iPhone_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestApp_iPhone_Prefix.pch; sourceTree = ""; }; - 28AD73870D9D96C1002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BC74A33810FC40C600E7E90D /* CPTTestAppPieChartController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestAppPieChartController.h; sourceTree = ""; }; - BC74A33910FC40C600E7E90D /* CPTTestAppPieChartController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTestAppPieChartController.m; sourceTree = ""; }; - BC74A34010FC418D00E7E90D /* PieChart.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PieChart.xib; sourceTree = ""; }; BC8166CC1100DD00006D898E /* 16-line-chart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "16-line-chart.png"; path = "GlyphishIcons/16-line-chart.png"; sourceTree = ""; }; BC8166CD1100DD00006D898E /* 17-bar-chart.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "17-bar-chart.png"; path = "GlyphishIcons/17-bar-chart.png"; sourceTree = ""; }; BC8166D11100DD6F006D898E /* 62-contrast.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "62-contrast.png"; path = "GlyphishIcons/62-contrast.png"; sourceTree = ""; }; BC9B81D90FB893F70035D8DA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - BC9B83B00FB8A9BC0035D8DA /* CorePlot-CocoaTouch.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "CorePlot-CocoaTouch.xcodeproj"; path = "../../framework/CorePlot-CocoaTouch.xcodeproj"; sourceTree = SOURCE_ROOT; }; - BC9B84350FB8B7110035D8DA /* ScatterPlot.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ScatterPlot.xib; sourceTree = ""; }; - BC9B84380FB8B76B0035D8DA /* CPTTestAppScatterPlotController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestAppScatterPlotController.h; sourceTree = ""; }; - BC9B84390FB8B76B0035D8DA /* CPTTestAppScatterPlotController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTestAppScatterPlotController.m; sourceTree = ""; }; - C34677B119F3345500429A85 /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "Launch Screen.xib"; sourceTree = ""; }; - C36E7CC219DE1C1700EDEACB /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C359603319CE34FB005CDFB9 /* BarChartController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BarChartController.swift; sourceTree = ""; }; + C359603419CE34FB005CDFB9 /* iPhoneAppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = iPhoneAppDelegate.swift; sourceTree = ""; }; + C359603519CE34FB005CDFB9 /* PieChartController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PieChartController.swift; sourceTree = ""; }; + C359603619CE34FB005CDFB9 /* ScatterPlotController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScatterPlotController.swift; sourceTree = ""; }; + C359603B19CE352A005CDFB9 /* CPTTestApp-iPhone-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = "CPTTestApp-iPhone-Bridging-Header.h"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C37A40F020E0322D00C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Info.plist; sourceTree = ""; }; C3B9F9D317503CDD001CCC50 /* BlueTexture.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = BlueTexture.png; sourceTree = ""; }; + C3C3CBDE19EA125D00A0296A /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; C3CD283D17DE9C95008EED1E /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; + C3D0A22820E01A0600BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PieChart.xib; sourceTree = ""; }; + C3D0A22920E01A0600BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/BarChart.xib; sourceTree = ""; }; + C3D0A22A20E01A0600BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainWindow.xib; sourceTree = ""; }; + C3D0A22B20E01A0600BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ScatterPlot.xib; sourceTree = ""; }; + C3D0A22C20E01A0600BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Base.lproj/Launch Screen.xib"; sourceTree = ""; }; C3D3936319FD671100148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "CPTTestApp-iPhone/Images.xcassets"; sourceTree = ""; }; + C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../../framework/CorePlot.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -88,8 +123,7 @@ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, 288765080DF74369002DB57D /* CoreGraphics.framework in Frameworks */, BC9B81DA0FB893F70035D8DA /* QuartzCore.framework in Frameworks */, - F7AE270A0FFFB61E001F26F0 /* libCorePlot-CocoaTouch.a in Frameworks */, - C3CD283E17DE9C95008EED1E /* Accelerate.framework in Frameworks */, + C3D414C61A7D847C00B6F5D6 /* libCorePlot-CocoaTouch.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -99,14 +133,10 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( - 28216C950DB411BC00E5133A /* CPTTestAppBarChartController.h */, - 28216C960DB411BC00E5133A /* CPTTestAppBarChartController.m */, - 1D3623240D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.h */, - 1D3623250D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.m */, - BC74A33810FC40C600E7E90D /* CPTTestAppPieChartController.h */, - BC74A33910FC40C600E7E90D /* CPTTestAppPieChartController.m */, - BC9B84380FB8B76B0035D8DA /* CPTTestAppScatterPlotController.h */, - BC9B84390FB8B76B0035D8DA /* CPTTestAppScatterPlotController.m */, + C359603419CE34FB005CDFB9 /* iPhoneAppDelegate.swift */, + C359603319CE34FB005CDFB9 /* BarChartController.swift */, + C359603519CE34FB005CDFB9 /* PieChartController.swift */, + C359603619CE34FB005CDFB9 /* ScatterPlotController.swift */, ); path = Classes; sourceTree = ""; @@ -122,7 +152,7 @@ 29B97314FDCFA39411CA2CEA /* CPTTestApp-iPhone */ = { isa = PBXGroup; children = ( - BC9B83B00FB8A9BC0035D8DA /* CorePlot-CocoaTouch.xcodeproj */, + C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */, 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97317FDCFA39411CA2CEA /* Resources */, @@ -138,9 +168,8 @@ 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( - 28A0AB4B0D9B1048005BE974 /* CPTTestApp_iPhone_Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main.m */, - C36E7CC219DE1C1700EDEACB /* CorePlotWarnings.xcconfig */, + C359603B19CE352A005CDFB9 /* CPTTestApp-iPhone-Bridging-Header.h */, + C3C3CBDE19EA125D00A0296A /* CorePlotWarnings.xcconfig */, ); name = "Other Sources"; sourceTree = ""; @@ -153,12 +182,12 @@ BC8166CC1100DD00006D898E /* 16-line-chart.png */, BC8166CD1100DD00006D898E /* 17-bar-chart.png */, C3B9F9D317503CDD001CCC50 /* BlueTexture.png */, - BC74A34010FC418D00E7E90D /* PieChart.xib */, - 282CCBFD0DB6C98000C4EA27 /* BarChart.xib */, - 28AD73870D9D96C1002E5188 /* MainWindow.xib */, - 8D1107310486CEB800E47090 /* Info.plist */, - BC9B84350FB8B7110035D8DA /* ScatterPlot.xib */, - C34677B119F3345500429A85 /* Launch Screen.xib */, + C3D0A22720E019FF00BA2921 /* Launch Screen.xib */, + C3D0A22120E019F300BA2921 /* MainWindow.xib */, + C3D0A22420E019F800BA2921 /* ScatterPlot.xib */, + C3D0A21E20E019F000BA2921 /* BarChart.xib */, + C3D0A20E20E019EB00BA2921 /* PieChart.xib */, + C37A40F120E0322D00C4FF48 /* Info.plist */, ); name = Resources; sourceTree = ""; @@ -175,10 +204,17 @@ name = Frameworks; sourceTree = ""; }; - BC9B83B10FB8A9BC0035D8DA /* Products */ = { + C3D414AF1A7D846500B6F5D6 /* Products */ = { isa = PBXGroup; children = ( - BC9B83B50FB8A9BC0035D8DA /* libCorePlot-CocoaTouch.a */, + C3D414BB1A7D846500B6F5D6 /* CorePlot.framework */, + C3D414BD1A7D846500B6F5D6 /* UnitTests.xctest */, + C3D414BF1A7D846500B6F5D6 /* CorePlot.framework */, + C3D414C11A7D846500B6F5D6 /* UnitTests iOS.xctest */, + C3D414C31A7D846500B6F5D6 /* libCorePlot-CocoaTouch.a */, + C3D414C51A7D846500B6F5D6 /* CorePlot-CocoaTouchTests.xctest */, + C31D01F21D10F506008C1EF2 /* CorePlot.framework */, + C31D01F41D10F506008C1EF2 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -197,7 +233,6 @@ buildRules = ( ); dependencies = ( - BC9B83B70FB8A9C70035D8DA /* PBXTargetDependency */, ); name = "CPTTestApp-iPhone"; productName = "CPTTestApp-iPhone"; @@ -210,24 +245,32 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0500; + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 0930; + TargetAttributes = { + 1D6058900D05DD3D006BFB54 = { + DevelopmentTeam = 28ZA45DE7D; + LastSwiftMigration = 1020; + }; + }; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CPTTestApp-iPhone" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + fr, + de, + ja, + en, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CPTTestApp-iPhone */; projectDirPath = ""; projectReferences = ( { - ProductGroup = BC9B83B10FB8A9BC0035D8DA /* Products */; - ProjectRef = BC9B83B00FB8A9BC0035D8DA /* CorePlot-CocoaTouch.xcodeproj */; + ProductGroup = C3D414AF1A7D846500B6F5D6 /* Products */; + ProjectRef = C3D414AE1A7D846500B6F5D6 /* CorePlot.xcodeproj */; }, ); projectRoot = ""; @@ -238,11 +281,60 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - BC9B83B50FB8A9BC0035D8DA /* libCorePlot-CocoaTouch.a */ = { + C31D01F21D10F506008C1EF2 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C31D01F11D10F506008C1EF2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C31D01F41D10F506008C1EF2 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C31D01F31D10F506008C1EF2 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414BB1A7D846500B6F5D6 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3D414BA1A7D846500B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414BD1A7D846500B6F5D6 /* UnitTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = UnitTests.xctest; + remoteRef = C3D414BC1A7D846500B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414BF1A7D846500B6F5D6 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3D414BE1A7D846500B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414C11A7D846500B6F5D6 /* UnitTests iOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests iOS.xctest"; + remoteRef = C3D414C01A7D846500B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414C31A7D846500B6F5D6 /* libCorePlot-CocoaTouch.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = "libCorePlot-CocoaTouch.a"; - remoteRef = BC9B83B40FB8A9BC0035D8DA /* PBXContainerItemProxy */; + remoteRef = C3D414C21A7D846500B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414C51A7D846500B6F5D6 /* CorePlot-CocoaTouchTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "CorePlot-CocoaTouchTests.xctest"; + remoteRef = C3D414C41A7D846500B6F5D6 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -252,12 +344,12 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 28AD73880D9D96C1002E5188 /* MainWindow.xib in Resources */, - 282CCBFE0DB6C98000C4EA27 /* BarChart.xib in Resources */, - BC9B84360FB8B7110035D8DA /* ScatterPlot.xib in Resources */, + C3D0A21F20E019F300BA2921 /* MainWindow.xib in Resources */, + C3D0A21C20E019F000BA2921 /* BarChart.xib in Resources */, + C3D0A22220E019F800BA2921 /* ScatterPlot.xib in Resources */, C3D3936419FD671100148319 /* Images.xcassets in Resources */, - BC74A34110FC418D00E7E90D /* PieChart.xib in Resources */, - C34677B219F3345500429A85 /* Launch Screen.xib in Resources */, + C3D0A20C20E019EB00BA2921 /* PieChart.xib in Resources */, + C3D0A22520E019FF00BA2921 /* Launch Screen.xib in Resources */, BC8166CE1100DD00006D898E /* 16-line-chart.png in Resources */, BC8166CF1100DD00006D898E /* 17-bar-chart.png in Resources */, BC8166D21100DD6F006D898E /* 62-contrast.png in Resources */, @@ -272,40 +364,82 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, - 1D3623260D0F684500981E51 /* CPTTestApp_iPhoneAppDelegate.m in Sources */, - 28216C970DB411BC00E5133A /* CPTTestAppBarChartController.m in Sources */, - BC9B843A0FB8B76B0035D8DA /* CPTTestAppScatterPlotController.m in Sources */, - BC74A33A10FC40C600E7E90D /* CPTTestAppPieChartController.m in Sources */, + C359603719CE34FC005CDFB9 /* BarChartController.swift in Sources */, + C359603819CE34FC005CDFB9 /* iPhoneAppDelegate.swift in Sources */, + C359603919CE34FC005CDFB9 /* PieChartController.swift in Sources */, + C359603A19CE34FC005CDFB9 /* ScatterPlotController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - BC9B83B70FB8A9C70035D8DA /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "CorePlot-CocoaTouch"; - targetProxy = BC9B83B60FB8A9C70035D8DA /* PBXContainerItemProxy */; +/* Begin PBXVariantGroup section */ + C37A40F120E0322D00C4FF48 /* Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A40F020E0322D00C4FF48 /* Base */, + ); + name = Info.plist; + sourceTree = ""; + }; + C3D0A20E20E019EB00BA2921 /* PieChart.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A22820E01A0600BA2921 /* Base */, + ); + name = PieChart.xib; + sourceTree = ""; }; -/* End PBXTargetDependency section */ + C3D0A21E20E019F000BA2921 /* BarChart.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A22920E01A0600BA2921 /* Base */, + ); + name = BarChart.xib; + sourceTree = ""; + }; + C3D0A22120E019F300BA2921 /* MainWindow.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A22A20E01A0600BA2921 /* Base */, + ); + name = MainWindow.xib; + sourceTree = ""; + }; + C3D0A22420E019F800BA2921 /* ScatterPlot.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A22B20E01A0600BA2921 /* Base */, + ); + name = ScatterPlot.xib; + sourceTree = ""; + }; + C3D0A22720E019FF00BA2921 /* Launch Screen.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A22C20E01A0600BA2921 /* Base */, + ); + name = "Launch Screen.xib"; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 1D6058940D05DD3E006BFB54 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C3CBDE19EA125D00A0296A /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ENABLE_OBJC_ARC = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + DEVELOPMENT_TEAM = 28ZA45DE7D; GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CPTTestApp_iPhone_Prefix.pch; HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; LIBRARY_SEARCH_PATHS = ""; OTHER_LDFLAGS = ( "-all_load", @@ -314,23 +448,25 @@ PRODUCT_BUNDLE_IDENTIFIER = org.CorePlot.CPTTestAppiPhone; PRODUCT_NAME = "CPTTestApp-iPhone"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; + SWIFT_OBJC_BRIDGING_HEADER = "CPTTestApp-iPhone-Bridging-Header.h"; + SWIFT_VERSION = 5.0; }; name = Debug; }; 1D6058950D05DD3E006BFB54 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C3CBDE19EA125D00A0296A /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CLANG_ENABLE_OBJC_ARC = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; COPY_PHASE_STRIP = YES; + DEVELOPMENT_TEAM = 28ZA45DE7D; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CPTTestApp_iPhone_Prefix.pch; HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; LIBRARY_SEARCH_PATHS = ""; OTHER_LDFLAGS = ( "-all_load", @@ -339,23 +475,28 @@ PRODUCT_BUNDLE_IDENTIFIER = org.CorePlot.CPTTestAppiPhone; PRODUCT_NAME = "CPTTestApp-iPhone"; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; + SWIFT_OBJC_BRIDGING_HEADER = "CPTTestApp-iPhone-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; }; name = Release; }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C36E7CC219DE1C1700EDEACB /* CorePlotWarnings.xcconfig */; + baseConfigurationReference = C3C3CBDE19EA125D00A0296A /* CorePlotWarnings.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/Frameworks"; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; PROVISIONING_PROFILE = ""; @@ -363,23 +504,25 @@ SDKROOT = iphoneos; SYMROOT = "$(SRCROOT)/../../build"; TARGETED_DEVICE_FAMILY = 1; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; + USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\" \"${PROJECT_DIR}/../../framework/Source\" \"${PROJECT_DIR}/../../framework/iPhoneOnly\""; }; name = Debug; }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C36E7CC219DE1C1700EDEACB /* CorePlotWarnings.xcconfig */; + baseConfigurationReference = C3C3CBDE19EA125D00A0296A /* CorePlotWarnings.xcconfig */; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; GCC_C_LANGUAGE_STANDARD = c99; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/Frameworks"; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = "-ObjC"; PROVISIONING_PROFILE = ""; @@ -387,7 +530,7 @@ SDKROOT = iphoneos; SYMROOT = "$(SRCROOT)/../../build"; TARGETED_DEVICE_FAMILY = 1; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; + USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\" \"${PROJECT_DIR}/../../framework/Source\" \"${PROJECT_DIR}/../../framework/iPhoneOnly\""; }; name = Release; }; diff --git a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPhone.xcscheme b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPhone.xcscheme new file mode 100644 index 000000000..0977a0925 --- /dev/null +++ b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone.xcodeproj/xcshareddata/xcschemes/CPTTestApp-iPhone.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Contents.json b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Contents.json index 340f2376e..44518e8c3 100644 --- a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "size" : "29x29", "idiom" : "iphone", @@ -12,12 +22,22 @@ "filename" : "Icon-Small@2x.png", "scale" : "2x" }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, { "size" : "40x40", "idiom" : "iphone", "filename" : "Icon-Spotlight-40@2x.png", "scale" : "2x" }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, { "size" : "57x57", "idiom" : "iphone", @@ -41,6 +61,12 @@ "idiom" : "iphone", "filename" : "Icon-60@3x.png", "scale" : "3x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "iTunesArtwork.png", + "scale" : "1x" } ], "info" : { diff --git a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/iTunesArtwork.png b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/iTunesArtwork.png new file mode 100644 index 000000000..969aff8dd Binary files /dev/null and b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/AppIcon.appiconset/iTunesArtwork.png differ diff --git a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/Contents.json b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/LaunchImage.launchimage/Contents.json b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index f0fce5477..000000000 --- a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "filename" : "Default-568h@2x.png", - "minimum-system-version" : "7.0", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "scale" : "1x", - "orientation" : "portrait" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "orientation" : "portrait" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "filename" : "Default-568h@2x.png", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "minimum-system-version" : "7.0", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png b/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png deleted file mode 100644 index 0891b7aab..000000000 Binary files a/examples/CPTTestApp-iPhone/CPTTestApp-iPhone/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png and /dev/null differ diff --git a/examples/CPTTestApp-iPhone/CPTTestApp_iPhone_Prefix.pch b/examples/CPTTestApp-iPhone/CPTTestApp_iPhone_Prefix.pch deleted file mode 100644 index 5cdc39f4d..000000000 --- a/examples/CPTTestApp-iPhone/CPTTestApp_iPhone_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'CPTTestApp-iPhone' target in the 'CPTTestApp-iPhone' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/examples/CPTTestApp-iPhone/Classes/BarChartController.swift b/examples/CPTTestApp-iPhone/Classes/BarChartController.swift new file mode 100644 index 000000000..5e5618f03 --- /dev/null +++ b/examples/CPTTestApp-iPhone/Classes/BarChartController.swift @@ -0,0 +1,153 @@ +import UIKit + +class BarChartController : UIViewController, CPTBarPlotDataSource { + private var barGraph : CPTXYGraph? = nil + + // MARK: - Initialization + + override func viewDidAppear(_ animated : Bool) + { + super.viewDidAppear(animated) + + // Create graph from theme + let newGraph = CPTXYGraph(frame: .zero) + newGraph.apply(CPTTheme(named: .darkGradientTheme)) + + let hostingView = self.view as! CPTGraphHostingView + hostingView.hostedGraph = newGraph + + if let frameLayer = newGraph.plotAreaFrame { + // Border + frameLayer.borderLineStyle = nil + frameLayer.cornerRadius = 0.0 + frameLayer.masksToBorder = false + + // Paddings + newGraph.paddingLeft = 0.0 + newGraph.paddingRight = 0.0 + newGraph.paddingTop = 0.0 + newGraph.paddingBottom = 0.0 + + frameLayer.paddingLeft = 70.0 + frameLayer.paddingTop = 20.0 + frameLayer.paddingRight = 20.0 + frameLayer.paddingBottom = 80.0 + } + + // Graph title + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.alignment = .center + + let lineOne = "Graph Title" + let lineTwo = "Line 2" + + let line1Font = UIFont(name: "Helvetica-Bold", size:16.0) + let line2Font = UIFont(name: "Helvetica", size:12.0) + + let graphTitle = NSMutableAttributedString(string: lineOne + "\n" + lineTwo) + + let titleRange1 = NSRange(location: 0, length: lineOne.utf16.count) + let titleRange2 = NSRange(location: lineOne.utf16.count + 1, length: lineTwo.utf16.count) + + graphTitle.addAttribute(.foregroundColor, value:UIColor.white, range:titleRange1) + graphTitle.addAttribute(.foregroundColor, value:UIColor.gray, range:titleRange2) + graphTitle.addAttribute(.paragraphStyle, value:paragraphStyle, range:NSRange(location: 0, length: graphTitle.length)) + graphTitle.addAttribute(.font, value:line1Font!, range:titleRange1) + graphTitle.addAttribute(.font, value:line2Font!, range:titleRange2) + + newGraph.attributedTitle = graphTitle + + newGraph.titleDisplacement = CGPoint(x: 0.0, y:-20.0) + newGraph.titlePlotAreaFrameAnchor = .top + + // Plot space + let plotSpace = newGraph.defaultPlotSpace as! CPTXYPlotSpace + plotSpace.yRange = CPTPlotRange(location:0.0, length:300.0) + plotSpace.xRange = CPTPlotRange(location:0.0, length:16.0) + + let axisSet = newGraph.axisSet as! CPTXYAxisSet + + if let x = axisSet.xAxis { + x.axisLineStyle = nil + x.majorTickLineStyle = nil + x.minorTickLineStyle = nil + x.majorIntervalLength = 5.0 + x.orthogonalPosition = 0.0 + x.title = "X Axis" + x.titleLocation = 7.5 + x.titleOffset = 55.0 + + // Custom labels + x.labelRotation = CGFloat(.pi / 4.0) + x.labelingPolicy = .none + + let customTickLocations = [1, 5, 10, 15] + let xAxisLabels = ["Label A", "Label B", "Label C", "Label D"] + + var labelLocation = 0 + var customLabels = Set() + for tickLocation in customTickLocations { + let newLabel = CPTAxisLabel(text:xAxisLabels[labelLocation], textStyle:x.labelTextStyle) + labelLocation += 1 + newLabel.tickLocation = tickLocation as NSNumber + newLabel.offset = x.labelOffset + x.majorTickLength + newLabel.rotation = CGFloat(.pi / 4.0) + customLabels.insert(newLabel) + } + + x.axisLabels = customLabels + } + + if let y = axisSet.yAxis { + y.axisLineStyle = nil + y.majorTickLineStyle = nil + y.minorTickLineStyle = nil + y.majorIntervalLength = 50.0 + y.orthogonalPosition = 0.0 + y.title = "Y Axis" + y.titleOffset = 45.0 + y.titleLocation = 150.0 + } + + // First bar plot + let barPlot1 = CPTBarPlot.tubularBarPlot(with: .darkGray(), horizontalBars:false) + barPlot1.baseValue = 0.0 + barPlot1.dataSource = self + barPlot1.barOffset = -0.2 + barPlot1.identifier = "Bar Plot 1" as NSString + newGraph.add(barPlot1, to:plotSpace) + + // Second bar plot + let barPlot2 = CPTBarPlot.tubularBarPlot(with: .blue(), horizontalBars:false) + barPlot2.dataSource = self + barPlot2.baseValue = 0.0 + barPlot2.barOffset = 0.25 + barPlot2.barCornerRadius = 2.0 + barPlot2.identifier = "Bar Plot 2" as NSString + newGraph.add(barPlot2, to:plotSpace) + + self.barGraph = newGraph + } + + // MARK: - Plot Data Source Methods + + func numberOfRecords(for plot: CPTPlot) -> UInt + { + return 16 + } + + func number(for plot: CPTPlot, field: UInt, record: UInt) -> Any? + { + switch CPTBarPlotField(rawValue: Int(field))! { + case .barLocation: + return record as NSNumber + + case .barTip: + let plotID = plot.identifier as! String + return (plotID == "Bar Plot 2" ? record : ((record + 1) * (record + 1)) ) as NSNumber + + default: + return nil + } + } +} diff --git a/examples/CPTTestApp-iPhone/Classes/CPTTestAppBarChartController.h b/examples/CPTTestApp-iPhone/Classes/CPTTestAppBarChartController.h deleted file mode 100644 index 48141d7b6..000000000 --- a/examples/CPTTestApp-iPhone/Classes/CPTTestAppBarChartController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// CPTTestAppBarChartController.h -// CPTTestApp-iPhone -// - -#import "CorePlot-CocoaTouch.h" -#import - -@interface CPTTestAppBarChartController : UIViewController - -@property (nonatomic, readwrite, strong) NSTimer *timer; - --(void)timerFired; - -@end diff --git a/examples/CPTTestApp-iPhone/Classes/CPTTestAppBarChartController.m b/examples/CPTTestApp-iPhone/Classes/CPTTestAppBarChartController.m deleted file mode 100644 index dfee77707..000000000 --- a/examples/CPTTestApp-iPhone/Classes/CPTTestAppBarChartController.m +++ /dev/null @@ -1,185 +0,0 @@ -// -// CPTTestAppBarChartController.m -// CPTTestApp-iPhone -// - -#import "CPTTestAppBarChartController.h" - -@interface CPTTestAppBarChartController() - -@property (nonatomic, readwrite, strong) CPTXYGraph *barChart; - -@end - -#pragma mark - - -@implementation CPTTestAppBarChartController - -@synthesize timer; -@synthesize barChart; - -#pragma mark - -#pragma mark Initialization and teardown - --(void)viewDidAppear:(BOOL)animated -{ - [super viewDidAppear:animated]; - - [self timerFired]; -#ifdef MEMORY_TEST - self.timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self - selector:@selector(timerFired) userInfo:nil repeats:YES]; -#endif -} - --(void)timerFired -{ -#ifdef MEMORY_TEST - static NSUInteger counter = 0; - - NSLog(@"\n----------------------------\ntimerFired: %lu", counter++); -#endif - - // Create barChart from theme - CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; - CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; - [newGraph applyTheme:theme]; - self.barChart = newGraph; - - CPTGraphHostingView *hostingView = (CPTGraphHostingView *)self.view; - hostingView.hostedGraph = newGraph; - - // Border - newGraph.plotAreaFrame.borderLineStyle = nil; - newGraph.plotAreaFrame.cornerRadius = 0.0; - newGraph.plotAreaFrame.masksToBorder = NO; - - // Paddings - newGraph.paddingLeft = 0.0; - newGraph.paddingRight = 0.0; - newGraph.paddingTop = 0.0; - newGraph.paddingBottom = 0.0; - - newGraph.plotAreaFrame.paddingLeft = 70.0; - newGraph.plotAreaFrame.paddingTop = 55.0; - newGraph.plotAreaFrame.paddingRight = 20.0; - newGraph.plotAreaFrame.paddingBottom = 80.0; - - // Graph title - NSString *lineOne = @"Graph Title"; - NSString *lineTwo = @"Line 2"; - - NSMutableAttributedString *graphTitle = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n%@", lineOne, lineTwo]]; - [graphTitle addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, lineOne.length)]; - [graphTitle addAttribute:NSForegroundColorAttributeName value:[UIColor grayColor] range:NSMakeRange(lineOne.length + 1, lineTwo.length)]; - NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; - paragraphStyle.alignment = CPTTextAlignmentCenter; - [graphTitle addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, graphTitle.length)]; - UIFont *titleFont = [UIFont fontWithName:@"Helvetica-Bold" size:16.0]; - [graphTitle addAttribute:NSFontAttributeName value:titleFont range:NSMakeRange(0, lineOne.length)]; - titleFont = [UIFont fontWithName:@"Helvetica" size:12.0]; - [graphTitle addAttribute:NSFontAttributeName value:titleFont range:NSMakeRange(lineOne.length + 1, lineTwo.length)]; - - newGraph.attributedTitle = graphTitle; - - newGraph.titleDisplacement = CGPointMake(0.0, -20.0); - newGraph.titlePlotAreaFrameAnchor = CPTRectAnchorTop; - - // Add plot space for horizontal bar charts - CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(300.0)]; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(16.0)]; - - CPTXYAxisSet *axisSet = (CPTXYAxisSet *)newGraph.axisSet; - CPTXYAxis *x = axisSet.xAxis; - x.axisLineStyle = nil; - x.majorTickLineStyle = nil; - x.minorTickLineStyle = nil; - x.majorIntervalLength = CPTDecimalFromDouble(5.0); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - x.title = @"X Axis"; - x.titleLocation = CPTDecimalFromFloat(7.5f); - x.titleOffset = 55.0; - - // Define some custom labels for the data elements - x.labelRotation = CPTFloat(M_PI_4); - x.labelingPolicy = CPTAxisLabelingPolicyNone; - NSArray *customTickLocations = @[@1, @5, @10, @15]; - NSArray *xAxisLabels = @[@"Label A", @"Label B", @"Label C", @"Label D"]; - NSUInteger labelLocation = 0; - NSMutableSet *customLabels = [NSMutableSet setWithCapacity:[xAxisLabels count]]; - for ( NSNumber *tickLocation in customTickLocations ) { - CPTAxisLabel *newLabel = [[CPTAxisLabel alloc] initWithText:xAxisLabels[labelLocation++] textStyle:x.labelTextStyle]; - newLabel.tickLocation = [tickLocation decimalValue]; - newLabel.offset = x.labelOffset + x.majorTickLength; - newLabel.rotation = CPTFloat(M_PI_4); - [customLabels addObject:newLabel]; - } - - x.axisLabels = customLabels; - - CPTXYAxis *y = axisSet.yAxis; - y.axisLineStyle = nil; - y.majorTickLineStyle = nil; - y.minorTickLineStyle = nil; - y.majorIntervalLength = CPTDecimalFromDouble(50.0); - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - y.title = @"Y Axis"; - y.titleOffset = 45.0; - y.titleLocation = CPTDecimalFromFloat(150.0f); - - // First bar plot - CPTBarPlot *barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor darkGrayColor] horizontalBars:NO]; - barPlot.baseValue = CPTDecimalFromDouble(0.0); - barPlot.dataSource = self; - barPlot.barOffset = CPTDecimalFromFloat(-0.25f); - barPlot.identifier = @"Bar Plot 1"; - [newGraph addPlot:barPlot toPlotSpace:plotSpace]; - - // Second bar plot - barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor blueColor] horizontalBars:NO]; - barPlot.dataSource = self; - barPlot.baseValue = CPTDecimalFromDouble(0.0); - barPlot.barOffset = CPTDecimalFromFloat(0.25f); - barPlot.barCornerRadius = 2.0; - barPlot.identifier = @"Bar Plot 2"; - [newGraph addPlot:barPlot toPlotSpace:plotSpace]; -} - --(void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview - // Release anything that's not essential, such as cached data -} - -#pragma mark - -#pragma mark Plot Data Source Methods - --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot -{ - return 16; -} - --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index -{ - NSNumber *num = nil; - - if ( [plot isKindOfClass:[CPTBarPlot class]] ) { - switch ( fieldEnum ) { - case CPTBarPlotFieldBarLocation: - num = @(index); - break; - - case CPTBarPlotFieldBarTip: - num = @( (index + 1) * (index + 1) ); - if ( [plot.identifier isEqual:@"Bar Plot 2"] ) { - num = @(num.integerValue - 10); - } - break; - } - } - - return num; -} - -@end diff --git a/examples/CPTTestApp-iPhone/Classes/CPTTestAppPieChartController.h b/examples/CPTTestApp-iPhone/Classes/CPTTestAppPieChartController.h deleted file mode 100644 index df553ddf7..000000000 --- a/examples/CPTTestApp-iPhone/Classes/CPTTestAppPieChartController.h +++ /dev/null @@ -1,11 +0,0 @@ -#import "CorePlot-CocoaTouch.h" -#import - -@interface CPTTestAppPieChartController : UIViewController - -@property (nonatomic, readwrite, strong) NSArray *dataForChart; -@property (nonatomic, readwrite, strong) NSTimer *timer; - --(void)timerFired; - -@end diff --git a/examples/CPTTestApp-iPhone/Classes/CPTTestAppPieChartController.m b/examples/CPTTestApp-iPhone/Classes/CPTTestAppPieChartController.m deleted file mode 100644 index 0ace47128..000000000 --- a/examples/CPTTestApp-iPhone/Classes/CPTTestAppPieChartController.m +++ /dev/null @@ -1,217 +0,0 @@ -#import "CPTTestAppPieChartController.h" - -@interface CPTTestAppPieChartController() - -@property (nonatomic, readwrite, strong) CPTXYGraph *pieChart; -@property (nonatomic, readonly, assign) CGFloat pieMargin; -@property (nonatomic, readonly, assign) CGFloat pieRadius; -@property (nonatomic, readonly, assign) CGPoint pieCenter; - -@end - -#pragma mark - - -@implementation CPTTestAppPieChartController - -@synthesize dataForChart; -@synthesize timer; -@synthesize pieChart; - --(CGFloat)pieMargin -{ - return self.pieChart.plotAreaFrame.borderLineStyle.lineWidth + CPTFloat(20.0); -} - --(CGFloat)pieRadius -{ - CGRect plotBounds = self.pieChart.plotAreaFrame.bounds; - - return MIN(plotBounds.size.width, plotBounds.size.height) / CPTFloat(2.0) - self.pieMargin; -} - --(CGPoint)pieCenter -{ - CGRect plotBounds = self.pieChart.plotAreaFrame.bounds; - - CGFloat y = 0.0; - - if ( plotBounds.size.width > plotBounds.size.height ) { - y = 0.45; - } - else { - y = (self.pieRadius + self.pieMargin) / plotBounds.size.height; - } - - return CGPointMake(0.5, y); -} - --(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation -{ - CPTPieChart *piePlot = (CPTPieChart *)[self.pieChart plotWithIdentifier:@"Pie Chart 1"]; - CGPoint newAnchor = self.pieCenter; - - // Animate the change - [CATransaction begin]; - { - [CATransaction setAnimationDuration:0.5]; - [CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]]; - - NSString *key = NSStringFromSelector( @selector(pieRadius) ); - - CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:key]; - - animation.toValue = @(self.pieRadius * 8.0 / 9.0); // leave room for the exploded slice - animation.fillMode = kCAFillModeForwards; - animation.delegate = self; - [piePlot addAnimation:animation forKey:key]; - - key = NSStringFromSelector( @selector(centerAnchor) ); - animation = [CABasicAnimation animationWithKeyPath:key]; - - animation.toValue = [NSValue valueWithBytes:&newAnchor objCType:@encode(CGPoint)]; - animation.fillMode = kCAFillModeForwards; - animation.delegate = self; - [piePlot addAnimation:animation forKey:key]; - } - [CATransaction commit]; -} - -#pragma mark - -#pragma mark Initialization and teardown - --(void)viewDidAppear:(BOOL)animated -{ - [super viewDidAppear:animated]; - - // Add some initial data - self.dataForChart = @[@20.0, @30.0, @60.0]; - - [self timerFired]; -#ifdef MEMORY_TEST - self.timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self - selector:@selector(timerFired) userInfo:nil repeats:YES]; -#endif -} - --(void)timerFired -{ -#ifdef MEMORY_TEST - static NSUInteger counter = 0; - - NSLog(@"\n----------------------------\ntimerFired: %lu", counter++); -#endif - - // Create pieChart from theme - CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; - CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; - [newGraph applyTheme:theme]; - self.pieChart = newGraph; - - CPTGraphHostingView *hostingView = (CPTGraphHostingView *)self.view; - hostingView.hostedGraph = newGraph; - - newGraph.paddingLeft = 20.0; - newGraph.paddingTop = 20.0; - newGraph.paddingRight = 20.0; - newGraph.paddingBottom = 20.0; - - newGraph.axisSet = nil; - - CPTMutableTextStyle *whiteText = [CPTMutableTextStyle textStyle]; - whiteText.color = [CPTColor whiteColor]; - - newGraph.titleTextStyle = whiteText; - newGraph.title = @"Graph Title"; - - newGraph.titleDisplacement = CGPointMake(0.0, -5.0); - - // Add pie chart - CPTPieChart *piePlot = [[CPTPieChart alloc] init]; - piePlot.dataSource = self; - piePlot.pieRadius = 1.0; - piePlot.identifier = @"Pie Chart 1"; - piePlot.startAngle = CPTFloat(M_PI_4); - piePlot.sliceDirection = CPTPieDirectionCounterClockwise; - piePlot.borderLineStyle = [CPTLineStyle lineStyle]; - piePlot.delegate = self; - [newGraph addPlot:piePlot]; - - [newGraph layoutIfNeeded]; - [self didRotateFromInterfaceOrientation:UIInterfaceOrientationPortrait]; - -#ifdef PERFORMANCE_TEST - [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(changePlotRange) userInfo:nil repeats:YES]; -#endif -} - --(void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview - // Release anything that's not essential, such as cached data -} - -#pragma mark - -#pragma mark Plot Data Source Methods - --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot -{ - return [self.dataForChart count]; -} - --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index -{ - if ( index >= [self.dataForChart count] ) { - return nil; - } - - if ( fieldEnum == CPTPieChartFieldSliceWidth ) { - return (self.dataForChart)[index]; - } - else { - return @(index); - } -} - --(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index -{ - CPTTextLayer *label = [[CPTTextLayer alloc] initWithText:[NSString stringWithFormat:@"%lu", (unsigned long)index]]; - CPTMutableTextStyle *textStyle = [label.textStyle mutableCopy]; - - textStyle.color = [CPTColor lightGrayColor]; - label.textStyle = textStyle; - return label; -} - --(CGFloat)radialOffsetForPieChart:(CPTPieChart *)piePlot recordIndex:(NSUInteger)index -{ - CGFloat offset = 0.0; - - if ( index == 0 ) { - offset = piePlot.pieRadius / CPTFloat(8.0); - } - - return offset; -} - -#pragma mark - -#pragma mark Delegate Methods - --(void)pieChart:(CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)index -{ - self.pieChart.title = [NSString stringWithFormat:@"Selected index: %lu", (unsigned long)index]; -} - --(void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag -{ - CPTPieChart *piePlot = (CPTPieChart *)[self.pieChart plotWithIdentifier:@"Pie Chart 1"]; - CABasicAnimation *basicAnimation = (CABasicAnimation *)theAnimation; - NSString *keyPath = basicAnimation.keyPath; - - if ( keyPath ) { - [piePlot removeAnimationForKey:keyPath]; - [piePlot setValue:basicAnimation.toValue forKey:keyPath]; - } - [piePlot repositionAllLabelAnnotations]; -} - -@end diff --git a/examples/CPTTestApp-iPhone/Classes/CPTTestAppScatterPlotController.h b/examples/CPTTestApp-iPhone/Classes/CPTTestAppScatterPlotController.h deleted file mode 100644 index 87d4645a3..000000000 --- a/examples/CPTTestApp-iPhone/Classes/CPTTestAppScatterPlotController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// CPTTestAppScatterPlotController.h -// CPTTestApp-iPhone -// -// Created by Brad Larson on 5/11/2009. -// - -#import "CorePlot-CocoaTouch.h" -#import - -@interface CPTTestAppScatterPlotController : UIViewController - -@property (nonatomic, readwrite, strong) NSMutableArray *dataForPlot; - -@end diff --git a/examples/CPTTestApp-iPhone/Classes/CPTTestAppScatterPlotController.m b/examples/CPTTestApp-iPhone/Classes/CPTTestAppScatterPlotController.m deleted file mode 100644 index 57426b89c..000000000 --- a/examples/CPTTestApp-iPhone/Classes/CPTTestAppScatterPlotController.m +++ /dev/null @@ -1,227 +0,0 @@ -// -// CPTTestAppScatterPlotController.m -// CPTTestApp-iPhone -// -// Created by Brad Larson on 5/11/2009. -// - -#import "CPTTestAppScatterPlotController.h" - -@interface CPTTestAppScatterPlotController() - -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; - -@end - -#pragma mark - - -@implementation CPTTestAppScatterPlotController - -@synthesize dataForPlot; -@synthesize graph; - -#pragma mark - -#pragma mark Initialization and teardown - --(void)viewDidLoad -{ - [super viewDidLoad]; - - // Create graph from theme - CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; - CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; - [newGraph applyTheme:theme]; - self.graph = newGraph; - - CPTGraphHostingView *hostingView = (CPTGraphHostingView *)self.view; - hostingView.collapsesLayers = NO; // Setting to YES reduces GPU memory usage, but can slow drawing/scrolling - hostingView.hostedGraph = newGraph; - - newGraph.paddingLeft = 10.0; - newGraph.paddingTop = 20.0; - newGraph.paddingRight = 10.0; - newGraph.paddingBottom = 10.0; - - // Setup plot space - CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; - plotSpace.allowsUserInteraction = YES; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) length:CPTDecimalFromDouble(2.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) length:CPTDecimalFromDouble(3.0)]; - - // Axes - CPTXYAxisSet *axisSet = (CPTXYAxisSet *)newGraph.axisSet; - CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(0.5); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(2.0); - x.minorTicksPerInterval = 2; - NSArray *exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(2.99) length:CPTDecimalFromDouble(0.02)]]; - x.labelExclusionRanges = exclusionRanges; - - CPTXYAxis *y = axisSet.yAxis; - y.majorIntervalLength = CPTDecimalFromDouble(0.5); - y.minorTicksPerInterval = 5; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(2.0); - exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(3.99) length:CPTDecimalFromDouble(0.02)]]; - y.labelExclusionRanges = exclusionRanges; - y.delegate = self; - - // Create a blue plot area - CPTScatterPlot *boundLinePlot = [[CPTScatterPlot alloc] init]; - CPTMutableLineStyle *lineStyle = [CPTMutableLineStyle lineStyle]; - lineStyle.miterLimit = 1.0; - lineStyle.lineWidth = 3.0; - lineStyle.lineColor = [CPTColor blueColor]; - boundLinePlot.dataLineStyle = lineStyle; - boundLinePlot.identifier = @"Blue Plot"; - boundLinePlot.dataSource = self; - [newGraph addPlot:boundLinePlot]; - - CPTImage *fillImage = [CPTImage imageNamed:@"BlueTexture"]; - fillImage.tiled = YES; - CPTFill *areaImageFill = [CPTFill fillWithImage:fillImage]; - boundLinePlot.areaFill = areaImageFill; - boundLinePlot.areaBaseValue = [[NSDecimalNumber zero] decimalValue]; - - // Add plot symbols - CPTMutableLineStyle *symbolLineStyle = [CPTMutableLineStyle lineStyle]; - symbolLineStyle.lineColor = [CPTColor blackColor]; - CPTPlotSymbol *plotSymbol = [CPTPlotSymbol ellipsePlotSymbol]; - plotSymbol.fill = [CPTFill fillWithColor:[CPTColor blueColor]]; - plotSymbol.lineStyle = symbolLineStyle; - plotSymbol.size = CGSizeMake(10.0, 10.0); - boundLinePlot.plotSymbol = plotSymbol; - - // Create a green plot area - CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] init]; - lineStyle = [CPTMutableLineStyle lineStyle]; - lineStyle.lineWidth = 3.0; - lineStyle.lineColor = [CPTColor greenColor]; - lineStyle.dashPattern = @[@5.0, @5.0]; - dataSourceLinePlot.dataLineStyle = lineStyle; - dataSourceLinePlot.identifier = @"Green Plot"; - dataSourceLinePlot.dataSource = self; - - // Put an area gradient under the plot above - CPTColor *areaColor = [CPTColor colorWithComponentRed:CPTFloat(0.3) green:CPTFloat(1.0) blue:CPTFloat(0.3) alpha:CPTFloat(0.8)]; - CPTGradient *areaGradient = [CPTGradient gradientWithBeginningColor:areaColor endingColor:[CPTColor clearColor]]; - areaGradient.angle = -90.0; - CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient]; - dataSourceLinePlot.areaFill = areaGradientFill; - dataSourceLinePlot.areaBaseValue = CPTDecimalFromDouble(1.75); - - // Animate in the new plot, as an example - dataSourceLinePlot.opacity = 0.0; - [newGraph addPlot:dataSourceLinePlot]; - - CABasicAnimation *fadeInAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; - fadeInAnimation.duration = 1.0; - fadeInAnimation.removedOnCompletion = NO; - fadeInAnimation.fillMode = kCAFillModeForwards; - fadeInAnimation.toValue = @1.0; - [dataSourceLinePlot addAnimation:fadeInAnimation forKey:@"animateOpacity"]; - - // Add some initial data - NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100]; - for ( NSUInteger i = 0; i < 60; i++ ) { - NSNumber *xVal = @(1.0 + i * 0.05); - NSNumber *yVal = @(1.2 * arc4random() / (double)UINT32_MAX + 1.2); - [contentArray addObject:@{ @"x": xVal, - @"y": yVal } - ]; - } - self.dataForPlot = contentArray; - -#ifdef PERFORMANCE_TEST - [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(changePlotRange) userInfo:nil repeats:YES]; -#endif -} - --(void)changePlotRange -{ - // Setup plot space - CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; - - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0) length:CPTDecimalFromDouble(3.0 + 2.0 * arc4random() / UINT32_MAX)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0) length:CPTDecimalFromDouble(3.0 + 2.0 * arc4random() / UINT32_MAX)]; -} - -#pragma mark - -#pragma mark Plot Data Source Methods - --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot -{ - return self.dataForPlot.count; -} - --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index -{ - NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y"); - NSNumber *num = self.dataForPlot[index][key]; - - // Green plot gets shifted above the blue - if ( [(NSString *)plot.identifier isEqualToString : @"Green Plot"] ) { - if ( fieldEnum == CPTScatterPlotFieldY ) { - num = @([num doubleValue] + 1.0); - } - } - return num; -} - -#pragma mark - -#pragma mark Axis Delegate Methods - --(BOOL)axis:(CPTAxis *)axis shouldUpdateAxisLabelsAtLocations:(NSSet *)locations -{ - static CPTTextStyle *positiveStyle = nil; - static CPTTextStyle *negativeStyle = nil; - static dispatch_once_t positiveOnce = 0; - static dispatch_once_t negativeOnce = 0; - - NSFormatter *formatter = axis.labelFormatter; - CGFloat labelOffset = axis.labelOffset; - NSDecimalNumber *zero = [NSDecimalNumber zero]; - - NSMutableSet *newLabels = [NSMutableSet set]; - - for ( NSDecimalNumber *tickLocation in locations ) { - CPTTextStyle *theLabelTextStyle; - - if ( [tickLocation isGreaterThanOrEqualTo:zero] ) { - dispatch_once(&positiveOnce, ^{ - CPTMutableTextStyle *newStyle = [axis.labelTextStyle mutableCopy]; - newStyle.color = [CPTColor greenColor]; - positiveStyle = newStyle; - }); - - theLabelTextStyle = positiveStyle; - } - else { - dispatch_once(&negativeOnce, ^{ - CPTMutableTextStyle *newStyle = [axis.labelTextStyle mutableCopy]; - newStyle.color = [CPTColor redColor]; - negativeStyle = newStyle; - }); - - theLabelTextStyle = negativeStyle; - } - - NSString *labelString = [formatter stringForObjectValue:tickLocation]; - CPTTextLayer *newLabelLayer = [[CPTTextLayer alloc] initWithText:labelString style:theLabelTextStyle]; - - CPTAxisLabel *newLabel = [[CPTAxisLabel alloc] initWithContentLayer:newLabelLayer]; - newLabel.tickLocation = tickLocation.decimalValue; - newLabel.offset = labelOffset; - - [newLabels addObject:newLabel]; - } - - axis.axisLabels = newLabels; - - return NO; -} - -@end diff --git a/examples/CPTTestApp-iPhone/Classes/CPTTestApp_iPhoneAppDelegate.h b/examples/CPTTestApp-iPhone/Classes/CPTTestApp_iPhoneAppDelegate.h deleted file mode 100644 index d985da722..000000000 --- a/examples/CPTTestApp-iPhone/Classes/CPTTestApp_iPhoneAppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// CPTTestApp_iPhoneAppDelegate.h -// CPTTestApp-iPhone -// -// Toolbar icons in the application are courtesy of Joseph Wain / glyphish.com -// See the license file in the GlyphishIcons directory for more information on these icons - -#import - -@interface CPTTestApp_iPhoneAppDelegate : NSObject - -@property (nonatomic, readwrite, strong) IBOutlet UIWindow *window; -@property (nonatomic, readwrite, strong) IBOutlet UITabBarController *tabBarController; - -@end diff --git a/examples/CPTTestApp-iPhone/Classes/CPTTestApp_iPhoneAppDelegate.m b/examples/CPTTestApp-iPhone/Classes/CPTTestApp_iPhoneAppDelegate.m deleted file mode 100644 index 0203992bc..000000000 --- a/examples/CPTTestApp-iPhone/Classes/CPTTestApp_iPhoneAppDelegate.m +++ /dev/null @@ -1,32 +0,0 @@ -// -// CPTTestApp_iPhoneAppDelegate.m -// CPTTestApp-iPhone -// -// Created by Brad Larson on 5/11/2009. - -#import "CPTTestApp_iPhoneAppDelegate.h" - -@implementation CPTTestApp_iPhoneAppDelegate - -@synthesize window; -@synthesize tabBarController; - --(void)applicationDidFinishLaunching:(UIApplication *)application -{ - self.window.rootViewController = self.tabBarController; - [self.window makeKeyAndVisible]; -} - -/* - * // Optional UITabBarControllerDelegate method - * - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { - * } - */ - -/* - * // Optional UITabBarControllerDelegate method - * - (void)tabBarController:(UITabBarController *)tabBarController didEndCustomizingViewControllers:(NSArray *)viewControllers changed:(BOOL)changed { - * } - */ - -@end diff --git a/examples/CPTTestApp-iPhone/Classes/PieChartController.swift b/examples/CPTTestApp-iPhone/Classes/PieChartController.swift new file mode 100644 index 000000000..3b99ed916 --- /dev/null +++ b/examples/CPTTestApp-iPhone/Classes/PieChartController.swift @@ -0,0 +1,102 @@ +import UIKit + +class PieChartController : UIViewController, CPTPieChartDataSource, CPTPieChartDelegate { + private var pieGraph : CPTXYGraph? = nil + + let dataForChart = [20.0, 30.0, 60.0] + + // MARK: - Initialization + + override func viewDidAppear(_ animated : Bool) + { + super.viewDidAppear(animated) + + // Create graph from theme + let newGraph = CPTXYGraph(frame: .zero) + newGraph.apply(CPTTheme(named: .darkGradientTheme)) + + let hostingView = self.view as! CPTGraphHostingView + hostingView.hostedGraph = newGraph + + // Paddings + newGraph.paddingLeft = 20.0 + newGraph.paddingRight = 20.0 + newGraph.paddingTop = 20.0 + newGraph.paddingBottom = 20.0 + + newGraph.axisSet = nil + + let whiteText = CPTMutableTextStyle() + whiteText.color = .white() + + newGraph.titleTextStyle = whiteText + newGraph.title = "Graph Title" + + // Add pie chart + let piePlot = CPTPieChart(frame: .zero) + piePlot.dataSource = self + piePlot.pieRadius = 131.0 + piePlot.identifier = "Pie Chart 1" as NSString + piePlot.startAngle = CGFloat(.pi / 4.0) + piePlot.sliceDirection = .counterClockwise + piePlot.centerAnchor = CGPoint(x: 0.5, y: 0.38) + piePlot.borderLineStyle = CPTLineStyle() + piePlot.delegate = self + newGraph.add(piePlot) + + self.pieGraph = newGraph + } + + // MARK: - Plot Data Source Methods + + func numberOfRecords(for plot: CPTPlot) -> UInt + { + return UInt(self.dataForChart.count) + } + + func number(for plot: CPTPlot, field: UInt, record: UInt) -> Any? + { + if Int(record) > self.dataForChart.count { + return nil + } + else { + switch CPTPieChartField(rawValue: Int(field))! { + case .sliceWidth: + return (self.dataForChart)[Int(record)] as NSNumber + + default: + return record as NSNumber + } + } + } + + func dataLabel(for plot: CPTPlot, record: UInt) -> CPTLayer? + { + let label = CPTTextLayer(text:"\(record)") + + if let textStyle = label.textStyle?.mutableCopy() as? CPTMutableTextStyle { + textStyle.color = .lightGray() + + label.textStyle = textStyle + } + + return label + } + + func radialOffset(for piePlot: CPTPieChart, record recordIndex: UInt) -> CGFloat + { + var offset: CGFloat = 0.0 + + if ( recordIndex == 0 ) { + offset = piePlot.pieRadius / 8.0 + } + + return offset + } + + // MARK: - Delegate Methods + + func pieChart(_ plot: CPTPieChart, sliceWasSelectedAtRecord idx: UInt) { + self.pieGraph?.title = "Selected index: \(idx)" + } +} diff --git a/examples/CPTTestApp-iPhone/Classes/ScatterPlotController.swift b/examples/CPTTestApp-iPhone/Classes/ScatterPlotController.swift new file mode 100644 index 000000000..76b3191ee --- /dev/null +++ b/examples/CPTTestApp-iPhone/Classes/ScatterPlotController.swift @@ -0,0 +1,186 @@ +import UIKit + +class ScatterPlotController : UIViewController, CPTScatterPlotDataSource, CPTAxisDelegate { + private var scatterGraph : CPTXYGraph? = nil + + typealias plotDataType = [CPTScatterPlotField : Double] + private var dataForPlot = [plotDataType]() + + // MARK: - Initialization + + override func viewDidAppear(_ animated : Bool) + { + super.viewDidAppear(animated) + + // Create graph from theme + let newGraph = CPTXYGraph(frame: .zero) + newGraph.apply(CPTTheme(named: .darkGradientTheme)) + + let hostingView = self.view as! CPTGraphHostingView + hostingView.hostedGraph = newGraph + + // Paddings + newGraph.paddingLeft = 10.0 + newGraph.paddingRight = 10.0 + newGraph.paddingTop = 10.0 + newGraph.paddingBottom = 10.0 + + // Plot space + let plotSpace = newGraph.defaultPlotSpace as! CPTXYPlotSpace + plotSpace.allowsUserInteraction = true + plotSpace.yRange = CPTPlotRange(location:1.0, length:2.0) + plotSpace.xRange = CPTPlotRange(location:1.0, length:3.0) + + // Axes + let axisSet = newGraph.axisSet as! CPTXYAxisSet + + if let x = axisSet.xAxis { + x.majorIntervalLength = 0.5 + x.orthogonalPosition = 2.0 + x.minorTicksPerInterval = 2 + x.labelExclusionRanges = [ + CPTPlotRange(location: 0.99, length: 0.02), + CPTPlotRange(location: 1.99, length: 0.02), + CPTPlotRange(location: 2.99, length: 0.02) + ] + } + + if let y = axisSet.yAxis { + y.majorIntervalLength = 0.5 + y.minorTicksPerInterval = 5 + y.orthogonalPosition = 2.0 + y.labelExclusionRanges = [ + CPTPlotRange(location: 0.99, length: 0.02), + CPTPlotRange(location: 1.99, length: 0.02), + CPTPlotRange(location: 3.99, length: 0.02) + ] + y.delegate = self + } + + // Create a blue plot area + let boundLinePlot = CPTScatterPlot(frame: .zero) + let blueLineStyle = CPTMutableLineStyle() + blueLineStyle.miterLimit = 1.0 + blueLineStyle.lineWidth = 3.0 + blueLineStyle.lineColor = .blue() + boundLinePlot.dataLineStyle = blueLineStyle + boundLinePlot.identifier = "Blue Plot" as NSString + boundLinePlot.dataSource = self + newGraph.add(boundLinePlot) + + let fillImage = CPTImage(named:"BlueTexture") + fillImage.isTiled = true + boundLinePlot.areaFill = CPTFill(image: fillImage) + boundLinePlot.areaBaseValue = 0.0 + + // Add plot symbols + let symbolLineStyle = CPTMutableLineStyle() + symbolLineStyle.lineColor = .black() + let plotSymbol = CPTPlotSymbol.ellipse() + plotSymbol.fill = CPTFill(color: .blue()) + plotSymbol.lineStyle = symbolLineStyle + plotSymbol.size = CGSize(width: 10.0, height: 10.0) + boundLinePlot.plotSymbol = plotSymbol + + // Create a green plot area + let dataSourceLinePlot = CPTScatterPlot(frame: .zero) + let greenLineStyle = CPTMutableLineStyle() + greenLineStyle.lineWidth = 3.0 + greenLineStyle.lineColor = .green() + greenLineStyle.dashPattern = [5.0, 5.0] + dataSourceLinePlot.dataLineStyle = greenLineStyle + dataSourceLinePlot.identifier = "Green Plot" as NSString + dataSourceLinePlot.dataSource = self + + // Put an area gradient under the plot above + let areaColor = CPTColor(componentRed: 0.3, green: 1.0, blue: 0.3, alpha: 0.8) + let areaGradient = CPTGradient(beginning: areaColor, ending: .clear()) + areaGradient.angle = -90.0 + let areaGradientFill = CPTFill(gradient: areaGradient) + dataSourceLinePlot.areaFill = areaGradientFill + dataSourceLinePlot.areaBaseValue = 1.75 + + // Animate in the new plot, as an example + dataSourceLinePlot.opacity = 0.0 + newGraph.add(dataSourceLinePlot) + + let fadeInAnimation = CABasicAnimation(keyPath: "opacity") + fadeInAnimation.duration = 1.0 + fadeInAnimation.isRemovedOnCompletion = false + fadeInAnimation.fillMode = .forwards + fadeInAnimation.toValue = 1.0 + dataSourceLinePlot.add(fadeInAnimation, forKey: "animateOpacity") + + // Add some initial data + var contentArray = [plotDataType]() + for i in 0 ..< 60 { + let x = 1.0 + Double(i) * 0.05 + let y = 1.2 * Double(arc4random()) / Double(UInt32.max) + 1.2 + let dataPoint: plotDataType = [.X: x, .Y: y] + contentArray.append(dataPoint) + } + self.dataForPlot = contentArray + + self.scatterGraph = newGraph + } + + // MARK: - Plot Data Source Methods + + func numberOfRecords(for plot: CPTPlot) -> UInt + { + return UInt(self.dataForPlot.count) + } + + func number(for plot: CPTPlot, field: UInt, record: UInt) -> Any? + { + let plotField = CPTScatterPlotField(rawValue: Int(field)) + + if let num = self.dataForPlot[Int(record)][plotField!] { + let plotID = plot.identifier as! String + if (plotField! == .Y) && (plotID == "Green Plot") { + return (num + 1.0) as NSNumber + } + else { + return num as NSNumber + } + } + else { + return nil + } + } + + // MARK: - Axis Delegate Methods + + func axis(_ axis: CPTAxis, shouldUpdateAxisLabelsAtLocations locations: Set) -> Bool + { + if let formatter = axis.labelFormatter { + let labelOffset = axis.labelOffset + + var newLabels = Set() + + for tickLocation in locations { + if let labelTextStyle = axis.labelTextStyle?.mutableCopy() as? CPTMutableTextStyle { + if tickLocation.doubleValue >= 0.0 { + labelTextStyle.color = .green() + } + else { + labelTextStyle.color = .red() + } + + let labelString = formatter.string(for:tickLocation) + let newLabelLayer = CPTTextLayer(text: labelString, style: labelTextStyle) + + let newLabel = CPTAxisLabel(contentLayer: newLabelLayer) + newLabel.tickLocation = tickLocation + newLabel.offset = labelOffset + + newLabels.insert(newLabel) + } + + axis.axisLabels = newLabels + } + } + + return false + } +} diff --git a/examples/CPTTestApp-iPhone/Classes/iPhoneAppDelegate.swift b/examples/CPTTestApp-iPhone/Classes/iPhoneAppDelegate.swift new file mode 100644 index 000000000..42189f9ec --- /dev/null +++ b/examples/CPTTestApp-iPhone/Classes/iPhoneAppDelegate.swift @@ -0,0 +1,20 @@ +import UIKit + +// Toolbar icons in the application are courtesy of Joseph Wain / glyphish.com +// See the license file in the GlyphishIcons directory for more information on these icons + +@UIApplicationMain + +class iPhoneAppDelegate : NSObject, UIApplicationDelegate, UITabBarControllerDelegate +{ + + @IBOutlet var window: UIWindow? = nil + @IBOutlet var tabBarController: UITabBarController? = nil + + func applicationDidFinishLaunching(_ application: UIApplication) { + if let myWindow = self.window { + myWindow.rootViewController = self.tabBarController + myWindow.makeKeyAndVisible() + } + } +} diff --git a/examples/CPTTestApp-iPhone/MainWindow.xib b/examples/CPTTestApp-iPhone/MainWindow.xib deleted file mode 100644 index 68ae98bc2..000000000 --- a/examples/CPTTestApp-iPhone/MainWindow.xib +++ /dev/null @@ -1,370 +0,0 @@ - - - - 528 - 12C60 - 2843 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1929 - - - YES - IBProxyObject - IBUICustomObject - IBUITabBar - IBUITabBarController - IBUITabBarItem - IBUIViewController - IBUIWindow - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - IBCocoaTouchFramework - - - - 1316 - - {320, 480} - - - - 1 - MSAxIDEAA - - NO - NO - - IBCocoaTouchFramework - YES - YES - - - - - - 1 - 1 - - IBCocoaTouchFramework - NO - - Scatter Plot - - Scatter Plot - - NSImage - 16-line-chart.png - - IBCocoaTouchFramework - - - ScatterPlot - - 1 - 1 - - IBCocoaTouchFramework - NO - - - YES - - - - Bar Chart - - NSImage - 17-bar-chart.png - - IBCocoaTouchFramework - - - BarChart - - 1 - 1 - - IBCocoaTouchFramework - NO - - - Pie Chart - - Pie Chart - - NSImage - 62-contrast.png - - IBCocoaTouchFramework - - - YES - - - PieChart - - 1 - 1 - - IBCocoaTouchFramework - NO - - - - - 266 - {{0, 431}, {320, 49}} - - - - 3 - MCAwAA - - NO - IBCocoaTouchFramework - - - - - - YES - - - delegate - - - - 99 - - - - window - - - - 9 - - - - tabBarController - - - - 113 - - - - - YES - - 0 - - - - - - 2 - - - YES - - - - - -1 - - - File's Owner - - - 3 - - - - - 106 - - - YES - - - - - - - - - 107 - - - - - 108 - - - YES - - - - - - 109 - - - YES - - - - - - 110 - - - - - 111 - - - - - -2 - - - - - 125 - - - YES - - - - - - 126 - - - - - - - YES - - YES - -1.CustomClassName - -1.IBPluginDependency - -2.CustomClassName - -2.IBPluginDependency - 106.IBPluginDependency - 107.IBPluginDependency - 108.CustomClassName - 108.IBPluginDependency - 109.CustomClassName - 109.IBPluginDependency - 110.IBPluginDependency - 111.IBPluginDependency - 125.CustomClassName - 125.IBPluginDependency - 126.IBPluginDependency - 2.IBAttributePlaceholdersKey - 2.IBPluginDependency - 3.CustomClassName - 3.IBPluginDependency - - - YES - UIApplication - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - CPTTestAppScatterPlotController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - CPTTestAppBarChartController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - CPTTestAppPieChartController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - YES - - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - CPTTestApp_iPhoneAppDelegate - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - - - - YES - - - - - 126 - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - 16-line-chart.png - 17-bar-chart.png - 62-contrast.png - - - YES - {30, 24} - {29, 24} - {20, 20} - - - 1929 - - diff --git a/examples/CPTTestApp-iPhone/PieChart.xib b/examples/CPTTestApp-iPhone/PieChart.xib deleted file mode 100644 index 757532e4b..000000000 --- a/examples/CPTTestApp-iPhone/PieChart.xib +++ /dev/null @@ -1,354 +0,0 @@ - - - - 768 - 10F569 - 804 - 1038.29 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 123 - - - YES - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - {320, 411} - - 3 - MQA - - 2 - - - - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 3 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - -1 - - - File's Owner - - - -2 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - - - YES - CPTTestAppPieChartController - UIResponder - CPTGraphHostingView - {{158, 204}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 9 - - - - YES - - CPTGraphHostingView - UIView - - IBUserSource - - - - - CPTTestAppPieChartController - UIViewController - - IBProjectSource - Classes/CPTTestAppPieChartController.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - CPTTestApp-iPhone.xcodeproj - 3 - 123 - - diff --git a/examples/CPTTestApp-iPhone/ScatterPlot.xib b/examples/CPTTestApp-iPhone/ScatterPlot.xib deleted file mode 100644 index df5411823..000000000 --- a/examples/CPTTestApp-iPhone/ScatterPlot.xib +++ /dev/null @@ -1,355 +0,0 @@ - - - - 528 - 10F569 - 804 - 1038.29 - 461.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 123 - - - YES - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - {320, 460} - - - - 3 - MQA - - 2 - - - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 3 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - -1 - - - File's Owner - - - -2 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - - - YES - CPTTestAppScatterPlotController - UIResponder - CPTGraphHostingView - {{430, 168}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 4 - - - - YES - - CPTGraphHostingView - UIView - - IBUserSource - - - - - CPTTestAppScatterPlotController - UIViewController - - IBProjectSource - Classes/CPTTestAppScatterPlotController.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - CPTTestApp-iPhone.xcodeproj - 3 - 123 - - diff --git a/examples/CPTTestApp-iPhone/main.m b/examples/CPTTestApp-iPhone/main.m deleted file mode 100644 index 762bdbbff..000000000 --- a/examples/CPTTestApp-iPhone/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// CPTTestApp-iPhone -// -// Created by Brad Larson on 5/11/2009. -// - -#import - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - int retVal = UIApplicationMain(argc, argv, nil, nil); - - return retVal; - } -} diff --git a/examples/CPTTestApp/Info.plist b/examples/CPTTestApp/Base.lproj/Info.plist similarity index 100% rename from examples/CPTTestApp/Info.plist rename to examples/CPTTestApp/Base.lproj/Info.plist diff --git a/examples/CPTTestApp/CPTTestApp.xcodeproj/project.pbxproj b/examples/CPTTestApp/CPTTestApp.xcodeproj/project.pbxproj index 0644d707d..a844a7791 100644 --- a/examples/CPTTestApp/CPTTestApp.xcodeproj/project.pbxproj +++ b/examples/CPTTestApp/CPTTestApp.xcodeproj/project.pbxproj @@ -3,26 +3,25 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 47; objects = { /* Begin PBXBuildFile section */ - 07032B7111ABB9F300463D20 /* CorePlot.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 07032B6A11ABB9E000463D20 /* CorePlot.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 07032B7211ABB9F700463D20 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07032B6A11ABB9E000463D20 /* CorePlot.framework */; }; 077382B10F3DC1FB002F10E2 /* Controller.m in Sources */ = {isa = PBXBuildFile; fileRef = 077382B00F3DC1FB002F10E2 /* Controller.m */; }; - 07C13BBB0FF9322A00BEE616 /* BlueTexture.png in Resources */ = {isa = PBXBuildFile; fileRef = 07C13BBA0FF9322A00BEE616 /* BlueTexture.png */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - 90AF4F440F36CF1800753D26 /* CPTTestApp.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90AF4F430F36CF1800753D26 /* CPTTestApp.xib */; }; BC8E74240FC0B96000DF8511 /* RotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC8E74230FC0B96000DF8511 /* RotationView.m */; }; - C317AB4F1093CC1E00B25011 /* PlotSymbolDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = C317AB4E1093CC1E00B25011 /* PlotSymbolDemo.xib */; }; - C317AB711093E09D00B25011 /* AxisDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = C317AB701093E09D00B25011 /* AxisDemo.xib */; }; C317AB751093E17500B25011 /* AxisDemoController.m in Sources */ = {isa = PBXBuildFile; fileRef = C317AB731093E17500B25011 /* AxisDemoController.m */; }; C34D4F8E0F8ED78400969C24 /* CPTPlotSymbolTestController.m in Sources */ = {isa = PBXBuildFile; fileRef = C34D4F8C0F8ED78400969C24 /* CPTPlotSymbolTestController.m */; }; - C38017DD124132020052B00D /* SelectionDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = C38017DC124132020052B00D /* SelectionDemo.xib */; }; + C36912D21C0B48DF000A1D61 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07032B6A11ABB9E000463D20 /* CorePlot.framework */; }; + C36912D31C0B48DF000A1D61 /* CorePlot.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 07032B6A11ABB9E000463D20 /* CorePlot.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; C38017E1124132610052B00D /* SelectionDemoController.m in Sources */ = {isa = PBXBuildFile; fileRef = C38017E0124132610052B00D /* SelectionDemoController.m */; }; C39BB9A4181C154500D95E01 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8E737C0FC0B3CF00DF8511 /* QuartzCore.framework */; }; + C3D0A18B20E017C500BA2921 /* AxisDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A18D20E017C500BA2921 /* AxisDemo.xib */; }; + C3D0A19A20E017CC00BA2921 /* CPTTestApp.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A19C20E017CC00BA2921 /* CPTTestApp.xib */; }; + C3D0A19D20E017D100BA2921 /* PlotSymbolDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A19F20E017D100BA2921 /* PlotSymbolDemo.xib */; }; + C3D0A1A020E017D600BA2921 /* SelectionDemo.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A1A220E017D600BA2921 /* SelectionDemo.xib */; }; C3D3935C19FD653300148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3935B19FD653300148319 /* Images.xcassets */; }; /* End PBXBuildFile section */ @@ -48,6 +47,55 @@ remoteGlobalIDString = 8DC2EF4F0486A6940098B216; remoteInfo = CorePlot; }; + C36912D41C0B48DF000A1D61 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 07032B6311ABB9E000463D20 /* CorePlot.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 8DC2EF4F0486A6940098B216; + remoteInfo = "CorePlot Mac"; + }; + C371E4D01BB714EC00AC18DB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 07032B6311ABB9E000463D20 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09781A46185200D45436; + remoteInfo = "CorePlot iOS"; + }; + C371E4D21BB714EC00AC18DB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 07032B6311ABB9E000463D20 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09821A46185300D45436; + remoteInfo = "UnitTests iOS"; + }; + C371E4D41BB714EC00AC18DB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 07032B6311ABB9E000463D20 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09BA1A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouch"; + }; + C371E4D61BB714EC00AC18DB /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 07032B6311ABB9E000463D20 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09C41A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouchTests"; + }; + C3CBFB691BE5874200519EE8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 07032B6311ABB9E000463D20 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C3CBFB6B1BE5874200519EE8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 07032B6311ABB9E000463D20 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -57,7 +105,7 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 07032B7111ABB9F300463D20 /* CorePlot.framework in Copy Frameworks */, + C36912D31C0B48DF000A1D61 /* CorePlot.framework in Copy Frameworks */, ); name = "Copy Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -69,30 +117,29 @@ 0761854B0F3CB3CB00A89A76 /* CorePlot.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = CorePlot.framework; path = ../../../../framework/build/Debug/CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 077382AF0F3DC1FB002F10E2 /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Controller.h; path = Source/Controller.h; sourceTree = ""; }; 077382B00F3DC1FB002F10E2 /* Controller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Controller.m; path = Source/Controller.m; sourceTree = ""; }; - 07C13BBA0FF9322A00BEE616 /* BlueTexture.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = BlueTexture.png; path = Resources/BlueTexture.png; sourceTree = ""; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Source/main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* CPTTestApp_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestApp_Prefix.pch; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* CPTTestApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CPTTestApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 90AF4F430F36CF1800753D26 /* CPTTestApp.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = CPTTestApp.xib; path = Resources/CPTTestApp.xib; sourceTree = ""; }; BC8E737C0FC0B3CF00DF8511 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BC8E74220FC0B96000DF8511 /* RotationView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RotationView.h; path = Source/RotationView.h; sourceTree = ""; }; BC8E74230FC0B96000DF8511 /* RotationView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RotationView.m; path = Source/RotationView.m; sourceTree = ""; }; - C317AB4E1093CC1E00B25011 /* PlotSymbolDemo.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = PlotSymbolDemo.xib; path = Resources/PlotSymbolDemo.xib; sourceTree = ""; }; - C317AB701093E09D00B25011 /* AxisDemo.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = AxisDemo.xib; path = Resources/AxisDemo.xib; sourceTree = ""; }; C317AB731093E17500B25011 /* AxisDemoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AxisDemoController.m; path = Source/AxisDemoController.m; sourceTree = ""; }; C317AB741093E17500B25011 /* AxisDemoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AxisDemoController.h; path = Source/AxisDemoController.h; sourceTree = ""; }; C34D4F8C0F8ED78400969C24 /* CPTPlotSymbolTestController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotSymbolTestController.m; path = Source/CPTPlotSymbolTestController.m; sourceTree = ""; }; C34D4F8D0F8ED78400969C24 /* CPTPlotSymbolTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotSymbolTestController.h; path = Source/CPTPlotSymbolTestController.h; sourceTree = ""; }; - C38017DC124132020052B00D /* SelectionDemo.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = SelectionDemo.xib; path = Resources/SelectionDemo.xib; sourceTree = ""; }; + C3564D2522A2D11D000A54C9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + C37A40A620E030C000C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Info.plist; sourceTree = ""; }; C38017DF124132610052B00D /* SelectionDemoController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SelectionDemoController.h; path = Source/SelectionDemoController.h; sourceTree = ""; }; C38017E0124132610052B00D /* SelectionDemoController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SelectionDemoController.m; path = Source/SelectionDemoController.m; sourceTree = ""; }; - C3880C3919DCD6A000ED0618 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3880C3919DCD6A000ED0618 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3D0A1A320E017E400BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/AxisDemo.xib; sourceTree = ""; }; + C3D0A1A420E017E400BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/CPTTestApp.xib; sourceTree = ""; }; + C3D0A1A520E017E400BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PlotSymbolDemo.xib; sourceTree = ""; }; + C3D0A1A620E017E400BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/SelectionDemo.xib; sourceTree = ""; }; C3D3935B19FD653300148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = CPTTestApp/Images.xcassets; sourceTree = ""; }; /* End PBXFileReference section */ @@ -101,7 +148,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 07032B7211ABB9F700463D20 /* CorePlot.framework in Frameworks */, + C36912D21C0B48DF000A1D61 /* CorePlot.framework in Frameworks */, 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, C39BB9A4181C154500D95E01 /* QuartzCore.framework in Frameworks */, ); @@ -115,6 +162,12 @@ children = ( 07032B6A11ABB9E000463D20 /* CorePlot.framework */, 07032B6C11ABB9E000463D20 /* UnitTests.xctest */, + C371E4D11BB714EC00AC18DB /* CorePlot.framework */, + C371E4D31BB714EC00AC18DB /* UnitTests iOS.xctest */, + C371E4D51BB714EC00AC18DB /* libCorePlot-CocoaTouch.a */, + C371E4D71BB714EC00AC18DB /* CorePlot-CocoaTouchTests.xctest */, + C3CBFB6A1BE5874200519EE8 /* CorePlot.framework */, + C3CBFB6C1BE5874200519EE8 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -194,13 +247,12 @@ isa = PBXGroup; children = ( C3D3935B19FD653300148319 /* Images.xcassets */, - 8D1107310486CEB800E47090 /* Info.plist */, - 07C13BBA0FF9322A00BEE616 /* BlueTexture.png */, + C37A40A720E030C000C4FF48 /* Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - C317AB701093E09D00B25011 /* AxisDemo.xib */, - 90AF4F430F36CF1800753D26 /* CPTTestApp.xib */, - C317AB4E1093CC1E00B25011 /* PlotSymbolDemo.xib */, - C38017DC124132020052B00D /* SelectionDemo.xib */, + C3D0A18D20E017C500BA2921 /* AxisDemo.xib */, + C3D0A19C20E017CC00BA2921 /* CPTTestApp.xib */, + C3D0A19F20E017D100BA2921 /* PlotSymbolDemo.xib */, + C3D0A1A220E017D600BA2921 /* SelectionDemo.xib */, ); name = Resources; sourceTree = ""; @@ -230,6 +282,7 @@ ); dependencies = ( 07032B7411ABBA0E00463D20 /* PBXTargetDependency */, + C36912D51C0B48DF000A1D61 /* PBXTargetDependency */, ); name = CPTTestApp; productInstallPath = "$(HOME)/Applications"; @@ -244,17 +297,18 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = NO; - LastUpgradeCheck = 0610; + LastUpgradeCheck = 1100; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CPTTestApp" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + ja, + de, + en, + fr, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CPTTestApp */; projectDirPath = ""; @@ -286,6 +340,48 @@ remoteRef = 07032B6B11ABB9E000463D20 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C371E4D11BB714EC00AC18DB /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C371E4D01BB714EC00AC18DB /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C371E4D31BB714EC00AC18DB /* UnitTests iOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests iOS.xctest"; + remoteRef = C371E4D21BB714EC00AC18DB /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C371E4D51BB714EC00AC18DB /* libCorePlot-CocoaTouch.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libCorePlot-CocoaTouch.a"; + remoteRef = C371E4D41BB714EC00AC18DB /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C371E4D71BB714EC00AC18DB /* CorePlot-CocoaTouchTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "CorePlot-CocoaTouchTests.xctest"; + remoteRef = C371E4D61BB714EC00AC18DB /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3CBFB6A1BE5874200519EE8 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3CBFB691BE5874200519EE8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3CBFB6C1BE5874200519EE8 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C3CBFB6B1BE5874200519EE8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -295,11 +391,10 @@ files = ( 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, C3D3935C19FD653300148319 /* Images.xcassets in Resources */, - 90AF4F440F36CF1800753D26 /* CPTTestApp.xib in Resources */, - 07C13BBB0FF9322A00BEE616 /* BlueTexture.png in Resources */, - C317AB4F1093CC1E00B25011 /* PlotSymbolDemo.xib in Resources */, - C317AB711093E09D00B25011 /* AxisDemo.xib in Resources */, - C38017DD124132020052B00D /* SelectionDemo.xib in Resources */, + C3D0A19A20E017CC00BA2921 /* CPTTestApp.xib in Resources */, + C3D0A19D20E017D100BA2921 /* PlotSymbolDemo.xib in Resources */, + C3D0A18B20E017C500BA2921 /* AxisDemo.xib in Resources */, + C3D0A1A020E017D600BA2921 /* SelectionDemo.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -327,37 +422,88 @@ name = CorePlot; targetProxy = 07032B7311ABBA0E00463D20 /* PBXContainerItemProxy */; }; + C36912D51C0B48DF000A1D61 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CorePlot Mac"; + targetProxy = C36912D41C0B48DF000A1D61 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 089C165DFE840E0CC02AAC07 /* English */, + C3564D2522A2D11D000A54C9 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; + C37A40A720E030C000C4FF48 /* Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A40A620E030C000C4FF48 /* Base */, + ); + name = Info.plist; + sourceTree = ""; + }; + C3D0A18D20E017C500BA2921 /* AxisDemo.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1A320E017E400BA2921 /* Base */, + ); + name = AxisDemo.xib; + path = Resources; + sourceTree = ""; + }; + C3D0A19C20E017CC00BA2921 /* CPTTestApp.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1A420E017E400BA2921 /* Base */, + ); + name = CPTTestApp.xib; + path = Resources; + sourceTree = ""; + }; + C3D0A19F20E017D100BA2921 /* PlotSymbolDemo.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1A520E017E400BA2921 /* Base */, + ); + name = PlotSymbolDemo.xib; + path = Resources; + sourceTree = ""; + }; + C3D0A1A220E017D600BA2921 /* SelectionDemo.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1A620E017E400BA2921 /* Base */, + ); + name = SelectionDemo.xib; + path = Resources; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3880C3919DCD6A000ED0618 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CPTTestApp_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ""; GCC_TREAT_WARNINGS_AS_ERRORS = YES; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = CPTTestApp; }; @@ -365,18 +511,21 @@ }; C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3880C3919DCD6A000ED0618 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = CPTTestApp_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ""; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = CPTTestApp; }; @@ -387,12 +536,13 @@ baseConfigurationReference = C3880C3919DCD6A000ED0618 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SYMROOT = "$(PROJECT_DIR)/../../build"; @@ -404,11 +554,12 @@ baseConfigurationReference = C3880C3919DCD6A000ED0618 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; SDKROOT = macosx; SYMROOT = "$(PROJECT_DIR)/../../build"; }; diff --git a/examples/CPTTestApp/CPTTestApp.xcodeproj/xcshareddata/xcschemes/CPTTestApp.xcscheme b/examples/CPTTestApp/CPTTestApp.xcodeproj/xcshareddata/xcschemes/CPTTestApp.xcscheme new file mode 100644 index 000000000..a741352d0 --- /dev/null +++ b/examples/CPTTestApp/CPTTestApp.xcodeproj/xcshareddata/xcschemes/CPTTestApp.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp/Resources/AxisDemo.xib b/examples/CPTTestApp/Resources/AxisDemo.xib deleted file mode 100644 index e83ef3f9f..000000000 --- a/examples/CPTTestApp/Resources/AxisDemo.xib +++ /dev/null @@ -1,275 +0,0 @@ - - - - 1060 - 12C60 - 2844 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 2844 - - - NSCustomObject - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - Controller - - - FirstResponder - - - NSApplication - - - 15 - 2 - {{112, 543}, {777, 567}} - 1677722624 - Axis Demo - NSWindow - - - - - 274 - - {777, 567} - - - - {{0, 0}, {1920, 1178}} - {10000000000000, 10000000000000} - YES - - - AxisDemoController - - - - - - - axisDemoWindow - - - - 8 - - - - hostView - - - - 10 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - - - - - - 2 - - - Axis Demo Controller - - - 3 - - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{19, 188}, {777, 567}} - - com.apple.InterfaceBuilder.CocoaPlugin - CPTGraphHostingView - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 10 - - - - - AxisDemoController - NSObject - - hostView - CPTGraphHostingView - - - hostView - - hostView - CPTGraphHostingView - - - - IBProjectSource - ./Classes/AxisDemoController.h - - - - CPTGraphHostingView - NSView - - IBProjectSource - ./Classes/CPTGraphHostingView.h - - - - Controller - NSArrayController - - id - id - id - id - id - id - id - id - id - id - id - - - - axisDemo: - id - - - explodeLayers: - id - - - exportToPDF: - id - - - exportToPNG: - id - - - insertData: - id - - - plotSymbolDemo: - id - - - printDocument: - id - - - reassembleLayers: - id - - - reloadDataSourcePlot: - id - - - removeData: - id - - - selectionDemo: - id - - - - NSWindow - CPTGraphHostingView - NSWindow - NSWindow - - - - axisDemoWindow - NSWindow - - - hostView - CPTGraphHostingView - - - plotSymbolWindow - NSWindow - - - selectionDemoWindow - NSWindow - - - - IBProjectSource - ./Classes/Controller.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - YES - 3 - - diff --git a/examples/CPTTestApp/Resources/Base.lproj/AxisDemo.xib b/examples/CPTTestApp/Resources/Base.lproj/AxisDemo.xib new file mode 100644 index 000000000..27d0611f4 --- /dev/null +++ b/examples/CPTTestApp/Resources/Base.lproj/AxisDemo.xib @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp/Resources/Base.lproj/CPTTestApp.xib b/examples/CPTTestApp/Resources/Base.lproj/CPTTestApp.xib new file mode 100644 index 000000000..4b7d3ae17 --- /dev/null +++ b/examples/CPTTestApp/Resources/Base.lproj/CPTTestApp.xib @@ -0,0 +1,751 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CPTDecimalNumberValueTransformer + + + + + + + + + + + + + + + + + + + + + + + + CPTDecimalNumberValueTransformer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x + y + + + + + + + + + + diff --git a/examples/CPTTestApp/Resources/Base.lproj/PlotSymbolDemo.xib b/examples/CPTTestApp/Resources/Base.lproj/PlotSymbolDemo.xib new file mode 100644 index 000000000..ce94cac6a --- /dev/null +++ b/examples/CPTTestApp/Resources/Base.lproj/PlotSymbolDemo.xib @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp/Resources/Base.lproj/SelectionDemo.xib b/examples/CPTTestApp/Resources/Base.lproj/SelectionDemo.xib new file mode 100644 index 000000000..c79ae2d56 --- /dev/null +++ b/examples/CPTTestApp/Resources/Base.lproj/SelectionDemo.xib @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CPTTestApp/Resources/BlueTexture.png b/examples/CPTTestApp/Resources/BlueTexture.png deleted file mode 100644 index ea004c70d..000000000 Binary files a/examples/CPTTestApp/Resources/BlueTexture.png and /dev/null differ diff --git a/examples/CPTTestApp/Resources/CPTTestApp.xib b/examples/CPTTestApp/Resources/CPTTestApp.xib deleted file mode 100644 index 7377c4b81..000000000 --- a/examples/CPTTestApp/Resources/CPTTestApp.xib +++ /dev/null @@ -1,3733 +0,0 @@ - - - - 1060 - 12C60 - 2844 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 2844 - - - NSArrayController - NSButton - NSButtonCell - NSCustomObject - NSCustomView - NSMenu - NSMenuItem - NSNumberFormatter - NSScrollView - NSScroller - NSSlider - NSSliderCell - NSSplitView - NSTableColumn - NSTableHeaderView - NSTableView - NSTextFieldCell - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - NSApplication - - - FirstResponder - - - NSApplication - - - NSFontManager - - - AMainMenu - - - - CPTTestApp - - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - CPTTestApp - - - - About CPTTestApp - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Services - - 2147483647 - - - submenuAction: - - Services - - _NSServicesMenu - - - - - YES - YES - - - 2147483647 - - - - - - Hide CPTTestApp - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Quit CPTTestApp - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - File - - 2147483647 - - - submenuAction: - - File - - - - New - n - 1048576 - 2147483647 - - - - - - Open… - o - 1048576 - 2147483647 - - - - - - Open Recent - - 2147483647 - - - submenuAction: - - Open Recent - - - - Clear Menu - - 2147483647 - - - - - _NSRecentDocumentsMenu - - - - - YES - YES - - - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - Save - s - 1048576 - 2147483647 - - - - - - Save As… - S - 1179648 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Export to PDF... - - 2147483647 - - - - - - Export to PNG... - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - - - - - - - Edit - - 2147483647 - - - submenuAction: - - Edit - - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1179648 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Delete - - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Find - - 2147483647 - - - submenuAction: - - Find - - - - Find… - f - 1048576 - 2147483647 - - - 1 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1179648 - 2147483647 - - - 3 - - - - Use Selection for Find - e - 1048576 - 2147483647 - - - 7 - - - - Jump to Selection - j - 1048576 - 2147483647 - - - - - - - - - Spelling and Grammar - - 2147483647 - - - submenuAction: - - Spelling and Grammar - - - - Show Spelling… - : - 1048576 - 2147483647 - - - - - - Check Spelling - ; - 1048576 - 2147483647 - - - - - - Check Spelling While Typing - - 2147483647 - - - - - - Check Grammar With Spelling - - 2147483647 - - - - - - - - - Substitutions - - 2147483647 - - - submenuAction: - - Substitutions - - - - Smart Copy/Paste - f - 1048576 - 2147483647 - - - 1 - - - - Smart Quotes - g - 1048576 - 2147483647 - - - 2 - - - - Smart Links - G - 1179648 - 2147483647 - - - 3 - - - - - - - Speech - - 2147483647 - - - submenuAction: - - Speech - - - - Start Speaking - - 2147483647 - - - - - - Stop Speaking - - 2147483647 - - - - - - - - - - - - Format - - 2147483647 - - - submenuAction: - - Format - - - - Font - - 2147483647 - - - submenuAction: - - Font - - - - Show Fonts - t - 1048576 - 2147483647 - - - - - - Bold - b - 1048576 - 2147483647 - - - 2 - - - - Italic - i - 1048576 - 2147483647 - - - 1 - - - - Underline - u - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bigger - + - 1048576 - 2147483647 - - - 3 - - - - Smaller - - - 1048576 - 2147483647 - - - 4 - - - - YES - YES - - - 2147483647 - - - - - - Kern - - 2147483647 - - - submenuAction: - - Kern - - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Tighten - - 2147483647 - - - - - - Loosen - - 2147483647 - - - - - - - - - Ligature - - 2147483647 - - - submenuAction: - - Ligature - - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Use All - - 2147483647 - - - - - - - - - Baseline - - 2147483647 - - - submenuAction: - - Baseline - - - - Use Default - - 2147483647 - - - - - - Superscript - - 2147483647 - - - - - - Subscript - - 2147483647 - - - - - - Raise - - 2147483647 - - - - - - Lower - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Colors - C - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Copy Style - c - 1572864 - 2147483647 - - - - - - Paste Style - v - 1572864 - 2147483647 - - - - - _NSFontMenu - - - - - Text - - 2147483647 - - - submenuAction: - - Text - - - - Align Left - { - 1048576 - 2147483647 - - - - - - Center - | - 1048576 - 2147483647 - - - - - - Justify - - 2147483647 - - - - - - Align Right - } - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Show Ruler - - 2147483647 - - - - - - Copy Ruler - c - 1310720 - 2147483647 - - - - - - Paste Ruler - v - 1310720 - 2147483647 - - - - - - - - - - - - View - - 2147483647 - - - submenuAction: - - View - - - - Show Toolbar - t - 1572864 - 2147483647 - - - - - - Customize Toolbar… - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Explode Layers - e - 1572864 - 2147483647 - - - - - - Reassemble Layers - r - 1572864 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Plot Symbols Demo - - 2147483647 - - - - - - Axes Only Demo - - 2147483647 - - - - - - Point Selection Demo - - 2147483647 - - - - - - - - - Window - - 2147483647 - - - submenuAction: - - Window - - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bring All to Front - - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - - - CPTTestApp Help - ? - 1048576 - 2147483647 - - - - - - - - _NSMainMenu - - - 271 - 2 - {{68, 397}, {944, 525}} - 603979776 - Window - NSWindow - - - {450, 250} - - - 256 - - - - 292 - {{4, 4}, {30, 27}} - - YES - - -2080374784 - 134217728 - - - LucidaGrande - 13 - 1044 - - - -2033434624 - 160 - - NSImage - NSAddTemplate - - - - 400 - 75 - - NO - - - - 292 - {{40, 4}, {51, 27}} - - YES - - -2080374784 - 134217728 - Reload - - - -2033434624 - 160 - - - 400 - 75 - - NO - - - - 274 - - - - 4370 - - - - 2304 - - - - 4370 - {343, 474} - - YES - NO - YES - - - 256 - {343, 17} - - - - - - -2147483392 - {{-26, 0}, {16, 17}} - - - - - 101 - 40 - 1000 - - 75497536 - 2048 - - - LucidaGrande - 11 - 3100 - - - 3 - MC4zMzMzMzI5OQA - - - 6 - System - headerTextColor - - 3 - MAA - - - - - 337641536 - -2080372736 - Text Cell - - - - - - - - - -∞ - - - #,##0.00 - +∞ - - #,##0.00 - #,##0.00 - - - - - - - - NaN - - - - 0 - 0 - YES - NO - 1 - AAAAAAAAAAAAAAAAAAAAAA - - - - 3 - YES - YES - YES - - . - , - YES - NO - YES - - - - 6 - System - controlBackgroundColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - - - 3 - YES - YES - - - - 93 - 40 - 1000 - - 75497536 - 2048 - - - - - - - 337641536 - -2080372736 - Text Cell - - - - - - - - #,##0.000 - - #,##0.000 - #,##0.000 - - - - - - NaN - - - - - - 3 - YES - YES - YES - - . - , - YES - NO - YES - - - - - - 3 - YES - YES - - - - 3 - 2 - - 3 - MQA - - - 6 - System - gridColor - - 3 - MC41AA - - - 17 - -702545920 - - - 4 - 15 - 0 - YES - 0 - 1 - - - {{1, 17}, {343, 474}} - - - - - 4 - - - - -2147483392 - {{276, 17}, {15, 238}} - - NO - - _doScroller: - 37 - 0.19473679999999999 - - - - -2147483392 - {{-100, -100}, {275, 15}} - - NO - 1 - - _doScroller: - 0.0029154519999999998 - 0.57142859999999995 - - - - 2304 - - - - {{1, 0}, {343, 17}} - - - - - 4 - - - - {345, 492} - - - 133650 - - - - - QSAAAEEgAABBmAAAQZgAAA - 0.25 - 4 - 1 - - - - 274 - - - - 274 - {559, 492} - - CPTGraphHostingView - - - {{354, 0}, {559, 492}} - - NSView - - - {{-1, 34}, {913, 492}} - - YES - - - - 289 - {{818, 7}, {96, 21}} - - YES - - -2080112384 - 0 - - - 1 - -1 - 0.0 - 0.0 - 0 - 1 - NO - NO - - NO - - - - 289 - {{917, 31}, {21, 96}} - - YES - - -2080112384 - 0 - - - 1 - -1 - 1 - 0.0 - 0 - 0 - NO - YES - - NO - - - - 289 - {{780, 0}, {32, 34}} - - YES - - -2080112384 - 0 - - - 6.2831853071795862 - 0.0 - 0.0 - 0.0 - 12 - 1 - NO - NO - 1 - - NO - - - - 292 - {{97, 4}, {99, 27}} - - YES - - -2080374784 - 134217728 - Insert Record - - - -2033434624 - 160 - - - 400 - 75 - - NO - - - - 292 - {{202, 3}, {105, 27}} - - YES - - -2080374784 - 134217728 - Delete Record - - - -2033434624 - 160 - - - 400 - 75 - - NO - - - {944, 525} - - {{0, 0}, {1920, 1178}} - {450, 272} - {10000000000000, 10000000000000} - YES - - - - x - y - - YES - - YES - YES - YES - YES - YES - - - - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - - - - performClose: - - - - 193 - - - - toggleContinuousSpellChecking: - - - - 222 - - - - undo: - - - - 223 - - - - copy: - - - - 224 - - - - checkSpelling: - - - - 225 - - - - paste: - - - - 226 - - - - stopSpeaking: - - - - 227 - - - - cut: - - - - 228 - - - - showGuessPanel: - - - - 230 - - - - redo: - - - - 231 - - - - selectAll: - - - - 232 - - - - startSpeaking: - - - - 233 - - - - delete: - - - - 235 - - - - performZoom: - - - - 240 - - - - performFindPanelAction: - - - - 241 - - - - centerSelectionInVisibleArea: - - - - 245 - - - - toggleGrammarChecking: - - - - 347 - - - - toggleSmartInsertDelete: - - - - 355 - - - - toggleAutomaticQuoteSubstitution: - - - - 356 - - - - toggleAutomaticLinkDetection: - - - - 357 - - - - showHelp: - - - - 360 - - - - saveDocument: - - - - 362 - - - - saveDocumentAs: - - - - 363 - - - - revertDocumentToSaved: - - - - 364 - - - - runToolbarCustomizationPalette: - - - - 365 - - - - toggleToolbarShown: - - - - 366 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - terminate: - - - - 369 - - - - unhideAllApplications: - - - - 370 - - - - raiseBaseline: - - - - 423 - - - - lowerBaseline: - - - - 424 - - - - copyFont: - - - - 425 - - - - subscript: - - - - 426 - - - - superscript: - - - - 427 - - - - tightenKerning: - - - - 428 - - - - underline: - - - - 429 - - - - orderFrontColorPanel: - - - - 430 - - - - useAllLigatures: - - - - 431 - - - - loosenKerning: - - - - 432 - - - - pasteFont: - - - - 433 - - - - unscript: - - - - 434 - - - - useStandardKerning: - - - - 435 - - - - useStandardLigatures: - - - - 436 - - - - turnOffLigatures: - - - - 437 - - - - turnOffKerning: - - - - 438 - - - - alignLeft: - - - - 439 - - - - alignJustified: - - - - 440 - - - - copyRuler: - - - - 441 - - - - alignCenter: - - - - 442 - - - - toggleRuler: - - - - 443 - - - - alignRight: - - - - 444 - - - - pasteRuler: - - - - 445 - - - - addFontTrait: - - - - 418 - - - - addFontTrait: - - - - 419 - - - - modifyFont: - - - - 420 - - - - orderFrontFontPanel: - - - - 421 - - - - modifyFont: - - - - 422 - - - - add: - - - - 484 - - - - reloadDataSourcePlot: - - - - 498 - - - - exportToPDF: - - - - 509 - - - - exportToPNG: - - - - 511 - - - - explodeLayers: - - - - 515 - - - - reassembleLayers: - - - - 516 - - - - hostView - - - - 518 - - - - plotSymbolDemo: - - - - 530 - - - - axisDemo: - - - - 532 - - - - selectionDemo: - - - - 540 - - - - removeData: - - - - 545 - - - - insertData: - - - - 546 - - - - printDocument: - - - - 552 - - - - value: arrangedObjects.x - - - - - - value: arrangedObjects.x - value - arrangedObjects.x - - NSValueTransformerName - CPTDecimalNumberValueTransformer - - 2 - - - 500 - - - - value: arrangedObjects.y - - - - - - value: arrangedObjects.y - value - arrangedObjects.y - - NSValueTransformerName - CPTDecimalNumberValueTransformer - - 2 - - - 499 - - - - value: xShift - - - - - - value: xShift - value - xShift - 2 - - - 525 - - - - value: yShift - - - - - - value: yShift - value - yShift - 2 - - - 526 - - - - value: labelRotation - - - - - - value: labelRotation - value - labelRotation - 2 - - - 536 - - - - enabled: isEditable - - - - - - enabled: isEditable - enabled - isEditable - 2 - - - 550 - - - - enabled: isEditable - - - - - - enabled: isEditable - enabled - isEditable - 2 - - - 551 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - - - - - - - - - - MainMenu - - - 19 - - - - - - - - 56 - - - - - - - - 103 - - - - - - 1 - - - 217 - - - - - - - - 83 - - - - - - - - 81 - - - - - - - - - - - - - - - - - - - - - 75 - - - 3 - - - 80 - - - 8 - - - 78 - - - 6 - - - 72 - - - - - 82 - - - 9 - - - 124 - - - - - - - - 77 - - - 5 - - - 73 - - - 1 - - - 79 - - - 7 - - - 112 - - - 10 - - - 74 - - - 2 - - - 125 - - - - - - - - 126 - - - - - 205 - - - - - - - - - - - - - - - - - - - - 202 - - - - - 198 - - - - - 207 - - - - - 214 - - - - - 199 - - - - - 203 - - - - - 197 - - - - - 206 - - - - - 215 - - - - - 218 - - - - - - - - 216 - - - - - - - - 200 - - - - - - - - - - - 219 - - - - - 201 - - - - - 204 - - - - - 220 - - - - - - - - - - - - 213 - - - - - 210 - - - - - 221 - - - - - 208 - - - - - 209 - - - - - 106 - - - - - - 2 - - - 111 - - - - - 57 - - - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - 1111 - - - 144 - - - - - 129 - - - 121 - - - 143 - - - - - 236 - - - - - 131 - - - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - - - - - - 296 - - - - - - - - - - - - - - - - 297 - - - - - 298 - - - - - 211 - - - - - - - - 212 - - - - - - - - - 195 - - - - - 196 - - - - - 346 - - - - - 348 - - - - - - - - 349 - - - - - - - - - - 350 - - - - - 351 - - - - - 354 - - - - - 371 - - - - - 373 - - - - - - - - 374 - - - - - - - - - 375 - - - - - - - - 376 - - - - - - - - 377 - - - - - - - - - - - - - - - 378 - - - - - 379 - - - - - 380 - - - - - 381 - - - - - 382 - - - - - 383 - - - - - 384 - - - - - 385 - - - - - 386 - - - - - - - - - - - - - - - - - - - - - - - 387 - - - - - 388 - - - - - 389 - - - - - 390 - - - - - 391 - - - - - 392 - - - - - 393 - - - - - 394 - - - - - 395 - - - - - - - - 396 - - - - - - - - 397 - - - - - - - - 398 - - - - - 399 - - - - - 400 - - - - - 401 - - - - - 402 - - - - - 403 - - - - - - - - - - - - 404 - - - - - 405 - - - - - 406 - - - - - 407 - - - - - 408 - - - - - 409 - - - - - - - - - - 410 - - - - - 411 - - - - - 412 - - - - - 413 - - - - - - - - - - - 414 - - - - - 415 - - - - - 416 - - - - - 417 - - - - - 446 - - - - - - - - 447 - - - - - - - - - - - - - - - 456 - - - XY Values Controller - - - 481 - - - - - - - - 482 - - - - - 490 - - - - - - - - - 460 - - - - - - - - - - - 464 - - - - - 462 - - - - - 461 - - - - - 463 - - - - - - - - - 466 - - - - - - - - 465 - - - - - - - - 468 - - - - - - - - 467 - - - - - - - - 493 - - - - - 496 - - - - - - - - 497 - - - - - 506 - - - 10 - - - 507 - - - 2 - - - 510 - - - 10 - - - 512 - - - - - 513 - - - - - 514 - - - - - 485 - - - - - - - - 517 - - - - - 519 - - - - - - - - 520 - - - - - 523 - - - - - - - - 524 - - - - - 527 - - - - - 528 - - - - - 529 - - - - - 533 - - - - - - - - 534 - - - - - 538 - - - - - 539 - - - - - 541 - - - - - - - - 542 - - - - - 543 - - - - - - - - 544 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{14, 274}, {944, 525}} - - com.apple.InterfaceBuilder.CocoaPlugin - Controller - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 552 - - - - - FirstResponder - - exportToPDF: - id - - - exportToPDF: - - exportToPDF: - id - - - - IBUserSource - - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - YES - 3 - - {8, 8} - {11, 11} - {10, 3} - - - diff --git a/examples/CPTTestApp/Resources/PlotSymbolDemo.xib b/examples/CPTTestApp/Resources/PlotSymbolDemo.xib deleted file mode 100644 index dcac2b389..000000000 --- a/examples/CPTTestApp/Resources/PlotSymbolDemo.xib +++ /dev/null @@ -1,153 +0,0 @@ - - - - 1060 - 12C60 - 2844 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 2844 - - - NSCustomObject - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - Controller - - - FirstResponder - - - NSApplication - - - 15 - 2 - {{112, 543}, {777, 567}} - 1677722624 - CPTPlotSymbol Demo - NSWindow - - - - - 274 - - {777, 567} - - - - {{0, 0}, {1920, 1178}} - {10000000000000, 10000000000000} - YES - - - CPTPlotSymbolTestController - - - - - - - plotSymbolWindow - - - - 7 - - - - hostView - - - - 8 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - - - - - - 2 - - - - - 3 - - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{19, 188}, {777, 567}} - - com.apple.InterfaceBuilder.CocoaPlugin - CPTGraphHostingView - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 8 - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - YES - 3 - - diff --git a/examples/CPTTestApp/Resources/SelectionDemo.xib b/examples/CPTTestApp/Resources/SelectionDemo.xib deleted file mode 100644 index 0a632e9bb..000000000 --- a/examples/CPTTestApp/Resources/SelectionDemo.xib +++ /dev/null @@ -1,276 +0,0 @@ - - - - 1060 - 12C60 - 2844 - 1187.34 - 625.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 2844 - - - NSCustomObject - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - Controller - - - FirstResponder - - - NSApplication - - - 15 - 2 - {{112, 543}, {777, 567}} - 1677722624 - Point Selection Demo - NSWindow - - - - - 274 - - {777, 567} - - - - - {{0, 0}, {1920, 1178}} - {10000000000000, 10000000000000} - YES - - - SelectionDemoController - - - - - - - selectionDemoWindow - - - - 8 - - - - hostView - - - - 9 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - - - - - - 2 - - - Point Selection Demo Controller - - - 3 - - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{19, 188}, {777, 567}} - - com.apple.InterfaceBuilder.CocoaPlugin - CPTGraphHostingView - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 9 - - - - - CPTGraphHostingView - NSView - - IBProjectSource - ./Classes/CPTGraphHostingView.h - - - - Controller - NSArrayController - - id - id - id - id - id - id - id - id - id - id - id - - - - axisDemo: - id - - - explodeLayers: - id - - - exportToPDF: - id - - - exportToPNG: - id - - - insertData: - id - - - plotSymbolDemo: - id - - - printDocument: - id - - - reassembleLayers: - id - - - reloadDataSourcePlot: - id - - - removeData: - id - - - selectionDemo: - id - - - - NSWindow - CPTGraphHostingView - NSWindow - NSWindow - - - - axisDemoWindow - NSWindow - - - hostView - CPTGraphHostingView - - - plotSymbolWindow - NSWindow - - - selectionDemoWindow - NSWindow - - - - IBProjectSource - ./Classes/Controller.h - - - - SelectionDemoController - NSObject - - hostView - CPTGraphHostingView - - - hostView - - hostView - CPTGraphHostingView - - - - IBProjectSource - ./Classes/SelectionDemoController.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - YES - 3 - - diff --git a/examples/CPTTestApp/Source/AxisDemoController.m b/examples/CPTTestApp/Source/AxisDemoController.m index def2851c1..51cf85317 100644 --- a/examples/CPTTestApp/Source/AxisDemoController.m +++ b/examples/CPTTestApp/Source/AxisDemoController.m @@ -2,7 +2,7 @@ @interface AxisDemoController() -@property (nonatomic, readwrite, strong) IBOutlet CPTGraphHostingView *hostView; +@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTGraphHostingView *hostView; @end @@ -37,8 +37,8 @@ -(void)awakeFromNib // Setup plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(-10.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.5) length:CPTDecimalFromDouble(1500.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(-10.0)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.5 length:@1500.0]; plotSpace.yScaleType = CPTScaleTypeLog; // Line styles @@ -63,22 +63,22 @@ -(void)awakeFromNib // Label x axis with a fixed interval policy CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.separateLayers = NO; - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.5); - x.majorIntervalLength = CPTDecimalFromDouble(0.5); - x.minorTicksPerInterval = 4; - x.tickDirection = CPTSignNone; - x.axisLineStyle = axisLineStyle; - x.majorTickLength = 12.0; - x.majorTickLineStyle = axisLineStyle; - x.majorGridLineStyle = majorGridLineStyle; - x.minorTickLength = 8.0; - x.minorGridLineStyle = minorGridLineStyle; - x.title = @"X Axis"; - x.titleTextStyle = axisTitleTextStyle; - x.titleOffset = 25.0; - x.alternatingBandFills = @[[[CPTColor redColor] colorWithAlphaComponent:0.1], [[CPTColor greenColor] colorWithAlphaComponent:0.1]]; - x.labelingPolicy = CPTAxisLabelingPolicyAutomatic; + x.separateLayers = NO; + x.orthogonalPosition = @0.5; + x.majorIntervalLength = @0.5; + x.minorTicksPerInterval = 4; + x.tickDirection = CPTSignNone; + x.axisLineStyle = axisLineStyle; + x.majorTickLength = 12.0; + x.majorTickLineStyle = axisLineStyle; + x.majorGridLineStyle = majorGridLineStyle; + x.minorTickLength = 8.0; + x.minorGridLineStyle = minorGridLineStyle; + x.title = @"X Axis"; + x.titleTextStyle = axisTitleTextStyle; + x.titleOffset = 25.0; + x.alternatingBandFills = @[[[CPTColor redColor] colorWithAlphaComponent:0.1], [[CPTColor greenColor] colorWithAlphaComponent:0.1]]; + x.labelingPolicy = CPTAxisLabelingPolicyAutomatic; // Label y with an automatic label policy. axisLineStyle.lineColor = [CPTColor greenColor]; @@ -100,8 +100,8 @@ -(void)awakeFromNib y.labelingPolicy = CPTAxisLabelingPolicyAutomatic; CPTFill *bandFill = [CPTFill fillWithColor:[[CPTColor darkGrayColor] colorWithAlphaComponent:0.5]]; - [y addBackgroundLimitBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(7.0) length:CPTDecimalFromDouble(1.5)] fill:bandFill]]; - [y addBackgroundLimitBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.5) length:CPTDecimalFromDouble(3.0)] fill:bandFill]]; + [y addBackgroundLimitBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:@7.0 length:@1.5] fill:bandFill]]; + [y addBackgroundLimitBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:@1.5 length:@3.0] fill:bandFill]]; } @end diff --git a/examples/CPTTestApp/Source/CPTPlotSymbolTestController.m b/examples/CPTTestApp/Source/CPTPlotSymbolTestController.m index 6fd98a083..8cf7d0aee 100644 --- a/examples/CPTTestApp/Source/CPTPlotSymbolTestController.m +++ b/examples/CPTTestApp/Source/CPTPlotSymbolTestController.m @@ -2,8 +2,8 @@ @interface CPTPlotSymbolTestController() -@property (nonatomic, readwrite, strong) IBOutlet CPTGraphHostingView *hostView; -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; +@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTGraphHostingView *hostView; +@property (nonatomic, readwrite, strong, nonnull) CPTXYGraph *graph; @end @@ -39,8 +39,8 @@ -(void)awakeFromNib // Setup plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-1.0) length:CPTDecimalFromFloat(11.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-1.0) length:CPTDecimalFromFloat(14.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@11.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@14.0]; CPTMutableShadow *lineShadow = [CPTMutableShadow shadow]; lineShadow.shadowOffset = CGSizeMake(3.0, -3.0); @@ -50,7 +50,7 @@ -(void)awakeFromNib // Create a series of plots that uses the data source method for ( NSUInteger i = CPTPlotSymbolTypeNone; i <= CPTPlotSymbolTypeCustom; i++ ) { CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] initWithFrame:newGraph.bounds]; - dataSourceLinePlot.identifier = [NSString stringWithFormat:@"%lu", (unsigned long)i]; + dataSourceLinePlot.identifier = @(i); dataSourceLinePlot.shadow = lineShadow; CPTMutableLineStyle *lineStyle = [dataSourceLinePlot.dataLineStyle mutableCopy]; @@ -67,12 +67,12 @@ -(void)awakeFromNib #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return 10; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSNumber *num; @@ -82,7 +82,7 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI break; case CPTScatterPlotFieldY: - num = @([(NSString *)plot.identifier integerValue]); + num = (NSNumber *)plot.identifier; break; default: @@ -91,7 +91,7 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI return num; } --(CPTPlotSymbol *)symbolForScatterPlot:(CPTScatterPlot *)plot recordIndex:(NSUInteger)index +-(nullable CPTPlotSymbol *)symbolForScatterPlot:(nonnull CPTScatterPlot *)plot recordIndex:(NSUInteger)index { CPTGradient *gradientFill = [CPTGradient rainbowGradient]; @@ -103,7 +103,7 @@ -(CPTPlotSymbol *)symbolForScatterPlot:(CPTScatterPlot *)plot recordIndex:(NSUIn symbolShadow.shadowColor = [CPTColor blackColor]; CPTPlotSymbol *symbol = [[CPTPlotSymbol alloc] init]; - symbol.symbolType = (CPTPlotSymbolType)[(NSString *)plot.identifier intValue]; + symbol.symbolType = (CPTPlotSymbolType)((NSString *)plot.identifier).intValue; symbol.fill = [CPTFill fillWithGradient:gradientFill]; symbol.shadow = symbolShadow; @@ -116,9 +116,9 @@ -(CPTPlotSymbol *)symbolForScatterPlot:(CPTScatterPlot *)plot recordIndex:(NSUIn CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint(path, NULL, 0., 0.); - CGPathAddEllipseInRect( path, NULL, CGRectMake(0., 0., 10., 10.) ); - CGPathAddEllipseInRect( path, NULL, CGRectMake(1.5, 4., 3., 3.) ); - CGPathAddEllipseInRect( path, NULL, CGRectMake(5.5, 4., 3., 3.) ); + CGPathAddEllipseInRect(path, NULL, CGRectMake(0., 0., 10., 10.)); + CGPathAddEllipseInRect(path, NULL, CGRectMake(1.5, 4., 3., 3.)); + CGPathAddEllipseInRect(path, NULL, CGRectMake(5.5, 4., 3., 3.)); CGPathMoveToPoint(path, NULL, 5., 2.); CGPathAddArc(path, NULL, 5., 3.3, 2.8, 0., M_PI, TRUE); CGPathCloseSubpath(path); diff --git a/examples/CPTTestApp/Source/Controller.h b/examples/CPTTestApp/Source/Controller.h index 206c7e1ca..d6fee2276 100644 --- a/examples/CPTTestApp/Source/Controller.h +++ b/examples/CPTTestApp/Source/Controller.h @@ -9,27 +9,27 @@ @property (nonatomic, readwrite, assign) CGFloat labelRotation; // Data loading --(IBAction)reloadDataSourcePlot:(id)sender; --(IBAction)removeData:(id)sender; --(IBAction)insertData:(id)sender; +-(IBAction)reloadDataSourcePlot:(nullable id)sender; +-(IBAction)removeData:(nullable id)sender; +-(IBAction)insertData:(nullable id)sender; // PDF / image export --(IBAction)exportToPDF:(id)sender; --(IBAction)exportToPNG:(id)sender; +-(IBAction)exportToPDF:(nullable id)sender; +-(IBAction)exportToPNG:(nullable id)sender; // Printing --(IBAction)printDocument:(id)sender; --(void)printOperationDidRun:(NSPrintOperation *)printOperation success:(BOOL)success contextInfo:(void *)contextInfo; +-(IBAction)printDocument:(nullable id)sender; +-(void)printOperationDidRun:(nonnull NSPrintOperation *)printOperation success:(BOOL)success contextInfo:(nullable void *)contextInfo; // Layer exploding for illustration --(IBAction)explodeLayers:(id)sender; -+(void)recursivelySplitSublayersInZForLayer:(CALayer *)layer depthLevel:(NSUInteger)depthLevel; --(IBAction)reassembleLayers:(id)sender; -+(void)recursivelyAssembleSublayersInZForLayer:(CALayer *)layer; +-(IBAction)explodeLayers:(nullable id)sender; ++(void)recursivelySplitSublayersInZForLayer:(nonnull CALayer *)layer depthLevel:(NSUInteger)depthLevel; +-(IBAction)reassembleLayers:(nullable id)sender; ++(void)recursivelyAssembleSublayersInZForLayer:(nonnull CALayer *)layer; // Demo windows --(IBAction)plotSymbolDemo:(id)sender; --(IBAction)axisDemo:(id)sender; --(IBAction)selectionDemo:(id)sender; +-(IBAction)plotSymbolDemo:(nullable id)sender; +-(IBAction)axisDemo:(nullable id)sender; +-(IBAction)selectionDemo:(nullable id)sender; @end diff --git a/examples/CPTTestApp/Source/Controller.m b/examples/CPTTestApp/Source/Controller.m index 5009a8277..9f1d5439a 100644 --- a/examples/CPTTestApp/Source/Controller.m +++ b/examples/CPTTestApp/Source/Controller.m @@ -1,5 +1,9 @@ #import "Controller.h" +#import "AxisDemoController.h" +#import "CPTPlotSymbolTestController.h" +#import "SelectionDemoController.h" + static const CGFloat kZDistanceBetweenLayers = 20.0; static NSString *const bindingsPlot = @"Bindings Plot"; @@ -9,14 +13,24 @@ @interface Controller() -@property (nonatomic, readwrite, strong) IBOutlet CPTGraphHostingView *hostView; -@property (nonatomic, readwrite, weak) IBOutlet NSWindow *plotSymbolWindow; -@property (nonatomic, readwrite, weak) IBOutlet NSWindow *axisDemoWindow; -@property (nonatomic, readwrite, weak) IBOutlet NSWindow *selectionDemoWindow; +-(void)plotSymbolWindowClosed; +-(void)axisDemoWindowClosed; +-(void)selectionDemoWindowClosed; + +@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTGraphHostingView *hostView; + +@property (nonatomic, readwrite, strong, nullable) IBOutlet NSWindow *plotSymbolWindow; +@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTPlotSymbolTestController *plotSymbolTestController; + +@property (nonatomic, readwrite, strong, nullable) IBOutlet NSWindow *axisDemoWindow; +@property (nonatomic, readwrite, strong, nullable) IBOutlet AxisDemoController *axisDemoController; + +@property (nonatomic, readwrite, strong, nullable) IBOutlet NSWindow *selectionDemoWindow; +@property (nonatomic, readwrite, strong, nullable) IBOutlet SelectionDemoController *selectionDemoController; -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; -@property (nonatomic, readwrite, strong) RotationView *overlayRotationView; -@property (nonatomic, readwrite, strong) CPTPlotSpaceAnnotation *symbolTextAnnotation; +@property (nonatomic, readwrite, strong, nonnull) CPTXYGraph *graph; +@property (nonatomic, readwrite, strong, nullable) RotationView *overlayRotationView; +@property (nonatomic, readwrite, strong, nullable) CPTPlotSpaceAnnotation *symbolTextAnnotation; -(void)setupGraph; -(void)setupAxes; @@ -32,8 +46,11 @@ @implementation Controller @synthesize hostView; @synthesize plotSymbolWindow; +@synthesize plotSymbolTestController; @synthesize axisDemoWindow; +@synthesize axisDemoController; @synthesize selectionDemoWindow; +@synthesize selectionDemoController; @synthesize graph; @synthesize overlayRotationView; @@ -64,12 +81,12 @@ -(void)awakeFromNib -(id)newObject { - NSNumber *x1 = @(1.0 + ( (NSMutableArray *)self.content ).count * 0.05); + NSNumber *x1 = @(1.0 + ((NSMutableArray *)self.content).count * 0.05); NSNumber *y1 = @(1.2 * arc4random() / (double)UINT32_MAX + 1.2); return @{ - @"x": x1, - @"y": y1 + @"x": x1, + @"y": y1 }; } @@ -80,9 +97,7 @@ -(void)setupGraph { // Create graph and apply a dark theme CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:NSRectToCGRect(self.hostView.bounds)]; - CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; - [newGraph applyTheme:theme]; self.hostView.hostedGraph = newGraph; self.graph = newGraph; @@ -91,8 +106,8 @@ -(void)setupGraph NSString *lineTwo = @"This is the Second Line of the Title"; NSMutableAttributedString *graphTitle = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n%@", lineOne, lineTwo]]; - [graphTitle addAttribute:NSForegroundColorAttributeName value:[NSColor grayColor] range:NSMakeRange(0, lineOne.length)]; - [graphTitle addAttribute:NSForegroundColorAttributeName value:[NSColor darkGrayColor] range:NSMakeRange(lineOne.length + 1, lineTwo.length)]; + [graphTitle addAttribute:NSForegroundColorAttributeName value:[NSColor labelColor] range:NSMakeRange(0, lineOne.length)]; + [graphTitle addAttribute:NSForegroundColorAttributeName value:[NSColor secondaryLabelColor] range:NSMakeRange(lineOne.length + 1, lineTwo.length)]; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; paragraphStyle.alignment = CPTTextAlignmentCenter; [graphTitle addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, graphTitle.length)]; @@ -105,11 +120,14 @@ -(void)setupGraph newGraph.titleDisplacement = CGPointMake(0.0, 50.0); newGraph.titlePlotAreaFrameAnchor = CPTRectAnchorTop; + // newGraph.fill = [CPTFill fillWithColor:[CPTColor colorWithNSColor:[NSColor windowBackgroundColor]]]; + newGraph.plotAreaFrame.fill = [CPTFill fillWithColor:[CPTColor colorWithNSColor:[NSColor controlBackgroundColor]]]; + // Graph padding - newGraph.paddingLeft = 60.0; + newGraph.paddingLeft = 10.0; newGraph.paddingTop = 60.0; - newGraph.paddingRight = 60.0; - newGraph.paddingBottom = 60.0; + newGraph.paddingRight = 10.0; + newGraph.paddingBottom = 10.0; // Plot area delegate newGraph.plotAreaFrame.plotArea.delegate = self; @@ -126,65 +144,71 @@ -(void)setupAxes // Grid line styles CPTMutableLineStyle *majorGridLineStyle = [CPTMutableLineStyle lineStyle]; majorGridLineStyle.lineWidth = 0.75; - majorGridLineStyle.lineColor = [[CPTColor colorWithGenericGray:0.2] colorWithAlphaComponent:0.75]; + majorGridLineStyle.lineColor = [[CPTColor colorWithNSColor:[NSColor gridColor]] colorWithAlphaComponent:0.75]; CPTMutableLineStyle *minorGridLineStyle = [CPTMutableLineStyle lineStyle]; minorGridLineStyle.lineWidth = 0.25; - minorGridLineStyle.lineColor = [[CPTColor whiteColor] colorWithAlphaComponent:0.1]; + minorGridLineStyle.lineColor = [[CPTColor colorWithNSColor:[NSColor gridColor]] colorWithAlphaComponent:0.1]; CPTMutableLineStyle *redLineStyle = [CPTMutableLineStyle lineStyle]; redLineStyle.lineWidth = 10.0; - redLineStyle.lineColor = [[CPTColor redColor] colorWithAlphaComponent:0.5]; + redLineStyle.lineColor = [[CPTColor colorWithNSColor:[NSColor systemRedColor]] colorWithAlphaComponent:0.5]; // Axes // Label x axis with a fixed interval policy CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.graph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(0.5); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(2.0); - x.minorTicksPerInterval = 2; - x.majorGridLineStyle = majorGridLineStyle; - x.minorGridLineStyle = minorGridLineStyle; - NSArray *exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(2.99) length:CPTDecimalFromDouble(0.02)]]; + + CPTMutableTextStyle *textStyle = [x.titleTextStyle mutableCopy]; + textStyle.color = [CPTColor colorWithNSColor:[NSColor secondaryLabelColor]]; + + x.labelTextStyle = textStyle; + x.majorIntervalLength = @0.5; + x.orthogonalPosition = @2.0; + x.minorTicksPerInterval = 2; + x.majorGridLineStyle = majorGridLineStyle; + x.minorGridLineStyle = minorGridLineStyle; + CPTPlotRangeArray *exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@1.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@0.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@2.99 length:@0.02]]; x.labelExclusionRanges = exclusionRanges; NSMutableAttributedString *xTitle = [[NSMutableAttributedString alloc] initWithString:@"X Axis\nLine 2"]; - [xTitle addAttribute:NSForegroundColorAttributeName value:[NSColor whiteColor] range:NSMakeRange(0, 6)]; - [xTitle addAttribute:NSForegroundColorAttributeName value:[NSColor grayColor] range:NSMakeRange(7, 6)]; + [xTitle addAttribute:NSForegroundColorAttributeName value:[NSColor secondaryLabelColor] range:NSMakeRange(0, 6)]; + [xTitle addAttribute:NSForegroundColorAttributeName value:[NSColor tertiaryLabelColor] range:NSMakeRange(7, 6)]; NSMutableParagraphStyle *xParagraphStyle = [[NSMutableParagraphStyle alloc] init]; xParagraphStyle.alignment = CPTTextAlignmentCenter; [xTitle addAttribute:NSParagraphStyleAttributeName value:xParagraphStyle range:NSMakeRange(0, xTitle.length)]; x.attributedTitle = xTitle; x.titleOffset = 30.0; - x.titleLocation = CPTDecimalFromDouble(3.0); + x.titleLocation = @3.0; // Label y with an automatic label policy. CPTXYAxis *y = axisSet.yAxis; y.labelingPolicy = CPTAxisLabelingPolicyAutomatic; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(2.0); + y.labelTextStyle = textStyle; + y.orthogonalPosition = @2.0; y.minorTicksPerInterval = 2; y.preferredNumberOfMajorTicks = 8; y.majorGridLineStyle = majorGridLineStyle; y.minorGridLineStyle = minorGridLineStyle; y.labelOffset = 10.0; - exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(3.99) length:CPTDecimalFromDouble(0.02)]]; + exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@1.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@0.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@3.99 length:@0.02]]; y.labelExclusionRanges = exclusionRanges; NSMutableAttributedString *yTitle = [[NSMutableAttributedString alloc] initWithString:@"Y Axis\nLine 2"]; - [yTitle addAttribute:NSForegroundColorAttributeName value:[NSColor whiteColor] range:NSMakeRange(0, 6)]; - [yTitle addAttribute:NSForegroundColorAttributeName value:[NSColor grayColor] range:NSMakeRange(7, 6)]; + [yTitle addAttribute:NSForegroundColorAttributeName value:[NSColor secondaryLabelColor] range:NSMakeRange(0, 6)]; + [yTitle addAttribute:NSForegroundColorAttributeName value:[NSColor tertiaryLabelColor] range:NSMakeRange(7, 6)]; NSMutableParagraphStyle *yParagraphStyle = [[NSMutableParagraphStyle alloc] init]; yParagraphStyle.alignment = CPTTextAlignmentCenter; [yTitle addAttribute:NSParagraphStyleAttributeName value:yParagraphStyle range:NSMakeRange(0, yTitle.length)]; y.attributedTitle = yTitle; y.titleOffset = 30.0; - y.titleLocation = CPTDecimalFromDouble(2.7); + y.titleLocation = @2.7; // Rotate the labels by 45 degrees, just to show it can be done. self.labelRotation = M_PI_4; @@ -192,8 +216,9 @@ -(void)setupAxes // Add an extra y axis (red) // We add constraints to this axis below CPTXYAxis *y2 = [[CPTXYAxis alloc] initWithFrame:CGRectZero]; + y2.labelingPolicy = CPTAxisLabelingPolicyAutomatic; - y2.orthogonalCoordinateDecimal = CPTDecimalFromDouble(3.0); + y2.orthogonalPosition = @3.0; y2.minorTicksPerInterval = 0; y2.preferredNumberOfMajorTicks = 4; y2.majorGridLineStyle = majorGridLineStyle; @@ -205,9 +230,11 @@ -(void)setupAxes y2.majorTickLineStyle = redLineStyle; y2.minorTickLineStyle = nil; y2.labelTextStyle = nil; - y2.visibleRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromInteger(2) length:CPTDecimalFromInteger(3)]; + y2.visibleRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@3.0]; + y2.titleTextStyle = textStyle; y2.title = @"Y2 title"; - y2.titleLocation = CPTDecimalFromInteger(3); + y2.titleLocation = @3.0; + // Set axes self.graph.axisSet.axes = @[x, y, y2]; } @@ -232,17 +259,19 @@ -(void)setupScatterPlots [boundLinePlot bind:CPTScatterPlotBindingYValues toObject:self withKeyPath:@"arrangedObjects.y" options:nil]; // Put an area gradient under the plot above - CPTImage *fillImage = [CPTImage imageNamed:@"BlueTexture"]; - fillImage.tiled = YES; - CPTFill *areaImageFill = [CPTFill fillWithImage:fillImage]; - boundLinePlot.areaFill = areaImageFill; - boundLinePlot.areaBaseValue = [[NSDecimalNumber one] decimalValue]; + CPTColor *areaColor = [CPTColor colorWithComponentRed:0.3 green:0.3 blue:1.0 alpha:0.8]; + CPTGradient *areaGradient = [CPTGradient gradientWithBeginningColor:areaColor endingColor:[CPTColor clearColor]]; + areaGradient.angle = -90.0; + CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient]; + + boundLinePlot.areaFill = areaGradientFill; + boundLinePlot.areaBaseValue = @1.0; // Add plot symbols CPTMutableLineStyle *symbolLineStyle = [CPTMutableLineStyle lineStyle]; symbolLineStyle.lineColor = [CPTColor blackColor]; CPTPlotSymbol *plotSymbol = [CPTPlotSymbol ellipsePlotSymbol]; - plotSymbol.fill = [CPTFill fillWithColor:[CPTColor blueColor]]; + plotSymbol.fill = [CPTFill fillWithColor:[CPTColor colorWithNSColor:[NSColor systemBlueColor]]]; plotSymbol.lineStyle = symbolLineStyle; plotSymbol.size = CGSizeMake(10.0, 10.0); boundLinePlot.plotSymbol = plotSymbol; @@ -259,14 +288,14 @@ -(void)setupScatterPlots lineStyle = [dataSourceLinePlot.dataLineStyle mutableCopy]; lineStyle.lineWidth = 1.0; - lineStyle.lineColor = [CPTColor greenColor]; + lineStyle.lineColor = [CPTColor colorWithNSColor:[NSColor systemGreenColor]]; dataSourceLinePlot.dataLineStyle = lineStyle; dataSourceLinePlot.dataSource = self; - CPTMutableTextStyle *whiteTextStyle = [CPTMutableTextStyle textStyle]; - whiteTextStyle.color = [CPTColor whiteColor]; - dataSourceLinePlot.labelTextStyle = whiteTextStyle; + CPTMutableTextStyle *textStyle = [CPTMutableTextStyle textStyle]; + textStyle.color = [CPTColor colorWithNSColor:[NSColor secondaryLabelColor]]; + dataSourceLinePlot.labelTextStyle = textStyle; dataSourceLinePlot.labelOffset = 5.0; dataSourceLinePlot.labelRotation = M_PI_4; @@ -276,16 +305,17 @@ -(void)setupScatterPlots dataSourceLinePlot.interpolation = CPTScatterPlotInterpolationStepped; // Put an area gradient under the plot above - CPTColor *areaColor = [CPTColor colorWithComponentRed:0.3 green:1.0 blue:0.3 alpha:0.8]; - CPTGradient *areaGradient = [CPTGradient gradientWithBeginningColor:areaColor endingColor:[CPTColor clearColor]]; + areaColor = [CPTColor colorWithComponentRed:0.3 green:1.0 blue:0.3 alpha:0.8]; + areaGradient = [CPTGradient gradientWithBeginningColor:areaColor endingColor:[CPTColor clearColor]]; areaGradient.angle = -90.0; - CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient]; + areaGradientFill = [CPTFill fillWithGradient:areaGradient]; + dataSourceLinePlot.areaFill = areaGradientFill; - dataSourceLinePlot.areaBaseValue = CPTDecimalFromDouble(1.75); + dataSourceLinePlot.areaBaseValue = @1.75; if ( !hasData ) { // Add some initial data - NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100]; + NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100]; for ( NSUInteger i = 0; i < 60; i++ ) { NSNumber *x = @(1.0 + i * 0.05); NSNumber *y = @(1.2 * arc4random() / (double)UINT32_MAX + 1.2); @@ -306,12 +336,12 @@ -(void)setupScatterPlots [plotSpace scaleToFitPlots:@[boundLinePlot, dataSourceLinePlot]]; CPTPlotRange *xRange = plotSpace.xRange; CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy]; - [yRange expandRangeByFactor:CPTDecimalFromDouble(1.1)]; + [yRange expandRangeByFactor:@1.1]; plotSpace.yRange = yRange; // Restrict y range to a global range - plotSpace.globalXRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(5.0)]; - plotSpace.globalYRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(6.0)]; + plotSpace.globalXRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@5.0]; + plotSpace.globalYRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@6.0]; // set the x and y shift to match the new ranges CGFloat length = xRange.lengthDouble; @@ -333,30 +363,31 @@ -(void)setupBarPlots // Add plot space for horizontal bar charts CPTXYPlotSpace *barPlotSpace = [[CPTXYPlotSpace alloc] init]; - barPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-20.0f) length:CPTDecimalFromFloat(200.0f)]; - barPlotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-7.0f) length:CPTDecimalFromFloat(15.0f)]; + barPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-20.0) length:@200.0]; + barPlotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-7.0) length:@15.0]; [self.graph addPlotSpace:barPlotSpace]; // First bar plot - CPTMutableTextStyle *whiteTextStyle = [CPTMutableTextStyle textStyle]; - whiteTextStyle.color = [CPTColor whiteColor]; + CPTMutableTextStyle *textStyle = [CPTMutableTextStyle textStyle]; + textStyle.color = [CPTColor colorWithNSColor:[NSColor secondaryLabelColor]]; + CPTBarPlot *barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor darkGrayColor] horizontalBars:YES]; - barPlot.baseValue = CPTDecimalFromFloat(20.0f); + barPlot.baseValue = @20.0; barPlot.dataSource = self; - barPlot.barOffset = CPTDecimalFromFloat(-0.25f); + barPlot.barOffset = @(-0.25); barPlot.identifier = barPlot1; - barPlot.plotRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(7.0)]; - barPlot.labelTextStyle = whiteTextStyle; + barPlot.plotRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@7.0]; + barPlot.labelTextStyle = textStyle; [self.graph addPlot:barPlot toPlotSpace:barPlotSpace]; // Second bar plot barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor blueColor] horizontalBars:YES]; barPlot.dataSource = self; - barPlot.baseValue = CPTDecimalFromFloat(20.0f); - barPlot.barOffset = CPTDecimalFromFloat(0.25f); + barPlot.baseValue = @20.0; + barPlot.barOffset = @0.25; barPlot.cornerRadius = 2.0; barPlot.identifier = barPlot2; - barPlot.plotRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(7.0)]; + barPlot.plotRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@7.0]; barPlot.delegate = self; [self.graph addPlot:barPlot toPlotSpace:barPlotSpace]; } @@ -364,14 +395,14 @@ -(void)setupBarPlots #pragma mark - #pragma mark Actions --(IBAction)reloadDataSourcePlot:(id)sender +-(IBAction)reloadDataSourcePlot:(nullable id __unused)sender { CPTPlot *plot = [self.graph plotWithIdentifier:dataSourcePlot]; [plot reloadData]; } --(IBAction)removeData:(id)sender +-(IBAction)removeData:(nullable id __unused)sender { NSUInteger index = self.selectionIndex; @@ -383,7 +414,7 @@ -(IBAction)removeData:(id)sender } } --(IBAction)insertData:(id)sender +-(IBAction)insertData:(nullable id __unused)sender { NSUInteger index = self.selectionIndex; @@ -399,7 +430,7 @@ -(IBAction)insertData:(id)sender #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot { if ( [plot isKindOfClass:[CPTBarPlot class]] ) { return 8; @@ -409,12 +440,12 @@ -(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot } } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSNumber *num; if ( [plot isKindOfClass:[CPTBarPlot class]] ) { - num = @( (index + 1) * (index + 1) ); + num = @((index + 1) * (index + 1)); if ( [plot.identifier isEqual:barPlot2] ) { num = @(num.integerValue - 10); } @@ -423,18 +454,18 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y"); num = (self.arrangedObjects)[index][key]; if ( fieldEnum == CPTScatterPlotFieldY ) { - num = @([num doubleValue] + 1.0); + num = @(num.doubleValue + 1.0); } } return num; } --(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index +-(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *)plot recordIndex:(NSUInteger)index { - if ( [(NSString *)plot.identifier isEqualToString : barPlot2] ) { + if ( [(NSString *) plot.identifier isEqualToString:barPlot2] ) { return (id)[NSNull null]; // Don't show any label } - else if ( [(NSString *)plot.identifier isEqualToString : barPlot1] && (index < 4) ) { + else if ( [(NSString *) plot.identifier isEqualToString:barPlot1] && (index < 4)) { return (id)[NSNull null]; } else if ( index % 4 ) { @@ -448,7 +479,7 @@ -(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index #pragma mark - #pragma mark CPTScatterPlot delegate method --(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index +-(void)scatterPlot:(nonnull CPTScatterPlot *__unused)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index { CPTPlotSpaceAnnotation *annotation = self.symbolTextAnnotation; @@ -459,37 +490,40 @@ -(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NS // Setup a style for the annotation CPTMutableTextStyle *hitAnnotationTextStyle = [CPTMutableTextStyle textStyle]; - hitAnnotationTextStyle.color = [CPTColor whiteColor]; - hitAnnotationTextStyle.fontSize = 16.0f; + hitAnnotationTextStyle.color = [CPTColor colorWithNSColor:[NSColor labelColor]]; + hitAnnotationTextStyle.fontSize = CPTFloat(16.0); hitAnnotationTextStyle.fontName = @"Helvetica-Bold"; // Determine point of symbol in plot coordinates - NSDictionary *dataPoint = (self.arrangedObjects)[index]; + NSDictionary *dataPoint = (self.arrangedObjects)[index]; NSNumber *x = dataPoint[@"x"]; NSNumber *y = dataPoint[@"y"]; - NSArray *anchorPoint = @[x, y]; + CPTNumberArray *anchorPoint = @[x, y]; // Add annotation // First make a string for the y value NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; - [formatter setMaximumFractionDigits:2]; + formatter.maximumFractionDigits = 2; NSString *yString = [formatter stringFromNumber:y]; // Now add the annotation to the plot area - CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:yString style:hitAnnotationTextStyle]; - annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:self.graph.defaultPlotSpace anchorPlotPoint:anchorPoint]; - annotation.contentLayer = textLayer; - annotation.displacement = CGPointMake(0.0, 20.0); - [self.graph.plotAreaFrame.plotArea addAnnotation:annotation]; - self.symbolTextAnnotation = annotation; + CPTPlotSpace *defaultSpace = self.graph.defaultPlotSpace; + if ( defaultSpace ) { + CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:yString style:hitAnnotationTextStyle]; + annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:defaultSpace anchorPlotPoint:anchorPoint]; + annotation.contentLayer = textLayer; + annotation.displacement = CGPointMake(0.0, 20.0); + [self.graph.plotAreaFrame.plotArea addAnnotation:annotation]; + self.symbolTextAnnotation = annotation; + } } #pragma mark - #pragma mark CPTBarPlot delegate method --(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index +-(void)barPlot:(nonnull CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index { NSLog(@"barWasSelectedAtRecordIndex %u", (unsigned)index); @@ -501,43 +535,62 @@ -(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index // Setup a style for the annotation CPTMutableTextStyle *hitAnnotationTextStyle = [CPTMutableTextStyle textStyle]; - hitAnnotationTextStyle.color = [CPTColor redColor]; + hitAnnotationTextStyle.color = [CPTColor colorWithNSColor:[NSColor labelColor]]; hitAnnotationTextStyle.fontSize = 16.0; hitAnnotationTextStyle.fontName = @"Helvetica-Bold"; // Determine point of symbol in plot coordinates - NSNumber *x = @0; - NSNumber *y = [self numberForPlot:plot field:0 recordIndex:index]; - NSArray *anchorPoint = @[x, @(index)]; + NSNumber *x = @0; + NSNumber *y = [self numberForPlot:plot field:CPTBarPlotFieldBarLocation recordIndex:index]; + + CPTNumberArray *anchorPoint = @[x, @(index)]; // Add annotation // First make a string for the y value NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; - [formatter setMaximumFractionDigits:2]; + formatter.maximumFractionDigits = 2; NSString *yString = [formatter stringFromNumber:y]; // Now add the annotation to the plot area - CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:yString style:hitAnnotationTextStyle]; - annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:self.graph.defaultPlotSpace anchorPlotPoint:anchorPoint]; - annotation.contentLayer = textLayer; - annotation.displacement = CGPointMake(0.0, 0.0); - [self.graph.plotAreaFrame.plotArea addAnnotation:annotation]; - self.symbolTextAnnotation = annotation; - - CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"barWidthScale"]; - animation.duration = 0.25; - animation.toValue = @0.0; - animation.repeatCount = 1; - animation.autoreverses = YES; - animation.removedOnCompletion = YES; - [plot addAnimation:animation forKey:@"barWidthScale"]; + CPTPlotSpace *plotSpace = plot.plotSpace; + if ( plotSpace ) { + CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:yString style:hitAnnotationTextStyle]; + annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:plotSpace anchorPlotPoint:anchorPoint]; + annotation.contentLayer = textLayer; + annotation.displacement = CGPointMake(0.0, 0.0); + [self.graph.plotAreaFrame.plotArea addAnnotation:annotation]; + self.symbolTextAnnotation = annotation; + } + + const CGFloat duration = 0.25; + NSNumber *barWidth = plot.barWidth; + + if ( barWidth ) { + [CPTAnimation animate:plot + property:@"barWidth" + fromNumber:plot.barWidth + toNumber:@0.0 + duration:duration + withDelay:0.0 + animationCurve:CPTAnimationCurveDefault + delegate:nil]; + + [CPTAnimation animate:plot + property:@"barWidth" + fromNumber:nil + toNumber:barWidth + duration:duration + withDelay:duration + animationCurve:CPTAnimationCurveDefault + delegate:nil]; + } } #pragma mark - #pragma mark Plot area delegate method --(void)plotAreaWasSelected:(CPTPlotArea *)plotArea +-(void)plotAreaWasSelected:(nonnull CPTPlotArea *__unused)plotArea { // Remove the annotation CPTPlotSpaceAnnotation *annotation = self.symbolTextAnnotation; @@ -551,35 +604,35 @@ -(void)plotAreaWasSelected:(CPTPlotArea *)plotArea #pragma mark - #pragma mark PDF / image export --(IBAction)exportToPDF:(id)sender +-(IBAction)exportToPDF:(nullable id __unused)sender { NSSavePanel *pdfSavingDialog = [NSSavePanel savePanel]; - [pdfSavingDialog setAllowedFileTypes:@[@"pdf"]]; + pdfSavingDialog.allowedFileTypes = @[@"pdf"]; if ( [pdfSavingDialog runModal] == NSOKButton ) { NSData *dataForPDF = [self.graph dataForPDFRepresentationOfLayer]; - NSURL *url = [pdfSavingDialog URL]; + NSURL *url = pdfSavingDialog.URL; if ( url ) { [dataForPDF writeToURL:url atomically:NO]; } } } --(IBAction)exportToPNG:(id)sender +-(IBAction)exportToPNG:(nullable id __unused)sender { NSSavePanel *pngSavingDialog = [NSSavePanel savePanel]; - [pngSavingDialog setAllowedFileTypes:@[@"png"]]; + pngSavingDialog.allowedFileTypes = @[@"png"]; if ( [pngSavingDialog runModal] == NSOKButton ) { NSImage *image = [self.graph imageOfLayer]; - NSData *tiffData = [image TIFFRepresentation]; + NSData *tiffData = image.TIFFRepresentation; NSBitmapImageRep *tiffRep = [NSBitmapImageRep imageRepWithData:tiffData]; - NSData *pngData = [tiffRep representationUsingType:NSPNGFileType properties:[NSDictionary dictionary]]; + NSData *pngData = [tiffRep representationUsingType:NSPNGFileType properties:@{}]; - NSURL *url = [pngSavingDialog URL]; + NSURL *url = pngSavingDialog.URL; if ( url ) { [pngData writeToURL:url atomically:NO]; } @@ -589,7 +642,7 @@ -(IBAction)exportToPNG:(id)sender #pragma mark - #pragma mark Printing --(IBAction)printDocument:(id)sender +-(IBAction)printDocument:(nullable id __unused)sender { NSPrintInfo *printInfo = [NSPrintInfo sharedPrintInfo]; @@ -600,9 +653,10 @@ -(IBAction)printDocument:(id)sender self.hostView.printRect = printRect; - NSWindow *window = self.hostView.window; + CPTGraphHostingView *host = self.hostView; + NSWindow *window = host.window; if ( window ) { - NSPrintOperation *printOperation = [NSPrintOperation printOperationWithView:self.hostView printInfo:printInfo]; + NSPrintOperation *printOperation = [NSPrintOperation printOperationWithView:host printInfo:printInfo]; [printOperation runOperationModalForWindow:window delegate:self didRunSelector:@selector(printOperationDidRun:success:contextInfo:) @@ -610,15 +664,15 @@ -(IBAction)printDocument:(id)sender } } --(void)printOperationDidRun:(NSPrintOperation *)printOperation success:(BOOL)success contextInfo:(void *)contextInfo +-(void)printOperationDidRun:(nonnull NSPrintOperation *__unused)printOperation success:(BOOL __unused)success contextInfo:(nullable void *__unused)contextInfo { - // print delegate +// print delegate } #pragma mark - #pragma mark Layer exploding for illustration --(IBAction)explodeLayers:(id)sender +-(IBAction)explodeLayers:(nullable id __unused)sender { CATransform3D perspectiveRotation = CATransform3DMakeRotation(-40.0 * M_PI / 180.0, 0.0, 1.0, 0.0); @@ -632,8 +686,8 @@ -(IBAction)explodeLayers:(id)sender RotationView *overlayView = [[RotationView alloc] initWithFrame:self.hostView.frame]; overlayView.rotationDelegate = self; overlayView.rotationTransform = perspectiveRotation; - [overlayView setAutoresizingMask:[self.hostView autoresizingMask]]; - [[self.hostView superview] addSubview:overlayView positioned:NSWindowAbove relativeTo:self.hostView]; + overlayView.autoresizingMask = self.hostView.autoresizingMask; + [self.hostView.superview addSubview:overlayView positioned:NSWindowAbove relativeTo:self.hostView]; self.overlayRotationView = overlayView; [CATransaction begin]; @@ -645,7 +699,7 @@ -(IBAction)explodeLayers:(id)sender [CATransaction commit]; } -+(void)recursivelySplitSublayersInZForLayer:(CALayer *)layer depthLevel:(NSUInteger)depthLevel ++(void)recursivelySplitSublayersInZForLayer:(nonnull CALayer *)layer depthLevel:(NSUInteger)depthLevel { layer.zPosition = kZDistanceBetweenLayers * (CGFloat)depthLevel; layer.borderColor = [CPTColor blueColor].cgColor; @@ -657,7 +711,7 @@ +(void)recursivelySplitSublayersInZForLayer:(CALayer *)layer depthLevel:(NSUInte } } --(IBAction)reassembleLayers:(id)sender +-(IBAction)reassembleLayers:(nullable id __unused)sender { [CATransaction begin]; [CATransaction setValue:@1.0f forKey:kCATransactionAnimationDuration]; @@ -671,7 +725,7 @@ -(IBAction)reassembleLayers:(id)sender self.overlayRotationView = nil; } -+(void)recursivelyAssembleSublayersInZForLayer:(CALayer *)layer ++(void)recursivelyAssembleSublayersInZForLayer:(nonnull CALayer *)layer { layer.zPosition = 0.0; layer.borderColor = [CPTColor clearColor].cgColor; @@ -684,34 +738,73 @@ +(void)recursivelyAssembleSublayersInZForLayer:(CALayer *)layer #pragma mark - #pragma mark Demo windows --(IBAction)plotSymbolDemo:(id)sender +-(IBAction)plotSymbolDemo:(nullable id)sender { if ( !self.plotSymbolWindow ) { - [NSBundle loadNibNamed:@"PlotSymbolDemo" owner:self]; + [[NSBundle mainBundle] loadNibNamed:@"PlotSymbolDemo" + owner:self + topLevelObjects:nil]; } NSWindow *window = self.plotSymbolWindow; [window makeKeyAndOrderFront:sender]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(plotSymbolWindowClosed) + name:NSWindowWillCloseNotification + object:window]; } --(IBAction)axisDemo:(id)sender +-(IBAction)axisDemo:(nullable id)sender { if ( !self.axisDemoWindow ) { - [NSBundle loadNibNamed:@"AxisDemo" owner:self]; + [[NSBundle mainBundle] loadNibNamed:@"AxisDemo" + owner:self + topLevelObjects:nil]; } NSWindow *window = self.axisDemoWindow; [window makeKeyAndOrderFront:sender]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(axisDemoWindowClosed) + name:NSWindowWillCloseNotification + object:window]; } --(IBAction)selectionDemo:(id)sender +-(IBAction)selectionDemo:(nullable id)sender { if ( !self.selectionDemoWindow ) { - [NSBundle loadNibNamed:@"SelectionDemo" owner:self]; + [[NSBundle mainBundle] loadNibNamed:@"SelectionDemo" + owner:self + topLevelObjects:nil]; } NSWindow *window = self.selectionDemoWindow; [window makeKeyAndOrderFront:sender]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(selectionDemoWindowClosed) + name:NSWindowWillCloseNotification + object:window]; +} + +-(void)plotSymbolWindowClosed +{ + self.plotSymbolWindow = nil; + self.plotSymbolTestController = nil; +} + +-(void)axisDemoWindowClosed +{ + self.axisDemoWindow = nil; + self.axisDemoController = nil; +} + +-(void)selectionDemoWindowClosed +{ + self.selectionDemoWindow = nil; + self.selectionDemoController = nil; } #pragma mark - @@ -735,8 +828,8 @@ -(void)setXShift:(CGFloat)newShift xShift = newShift; CPTXYPlotSpace *space = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; CPTMutablePlotRange *newRange = [space.xRange mutableCopy]; - newRange.length = CPTDecimalFromDouble(3.0 + newShift); - space.xRange = newRange; + newRange.lengthDouble = 3.0 + newShift; + space.xRange = newRange; } -(void)setYShift:(CGFloat)newShift @@ -744,15 +837,15 @@ -(void)setYShift:(CGFloat)newShift yShift = newShift; CPTXYPlotSpace *space = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; CPTMutablePlotRange *newRange = [space.yRange mutableCopy]; - newRange.length = CPTDecimalFromDouble(2.0 + newShift); - space.yRange = newRange; + newRange.lengthDouble = 2.0 + newShift; + space.yRange = newRange; } -(void)setLabelRotation:(CGFloat)newRotation { labelRotation = newRotation; - ( (CPTXYAxisSet *)self.graph.axisSet ).yAxis.labelRotation = newRotation; + ((CPTXYAxisSet *)self.graph.axisSet).yAxis.labelRotation = newRotation; [self.graph plotWithIdentifier:dataSourcePlot].labelRotation = newRotation; } diff --git a/examples/CPTTestApp/Source/RotationView.h b/examples/CPTTestApp/Source/RotationView.h index b8917b021..0ec33c63c 100644 --- a/examples/CPTTestApp/Source/RotationView.h +++ b/examples/CPTTestApp/Source/RotationView.h @@ -1,6 +1,6 @@ // -// RotationView.h -// CPTTestApp +// RotationView.h +// CPTTestApp // #import @@ -11,10 +11,11 @@ @interface RotationView : NSView @property (nonatomic, readwrite) CATransform3D rotationTransform; -@property (nonatomic, readwrite, weak) id rotationDelegate; +@property (nonatomic, readwrite, weak, nullable) id rotationDelegate; @end @protocol CPTRotationDelegate -(void)rotateObjectUsingTransform:(CATransform3D)rotationTransform; + @end diff --git a/examples/CPTTestApp/Source/RotationView.m b/examples/CPTTestApp/Source/RotationView.m index 429f143a6..68b892fab 100644 --- a/examples/CPTTestApp/Source/RotationView.m +++ b/examples/CPTTestApp/Source/RotationView.m @@ -1,6 +1,6 @@ // -// 3DRotationView.m -// CPTTestApp +// 3DRotationView.m +// CPTTestApp // #import "RotationView.h" @@ -18,9 +18,9 @@ @implementation RotationView #pragma mark - #pragma mark Initialization and teardown --(instancetype)initWithFrame:(NSRect)frame +-(nonnull instancetype)initWithFrame:(NSRect)frame { - if ( (self = [super initWithFrame:frame]) ) { + if ((self = [super initWithFrame:frame])) { rotationTransform = CATransform3DIdentity; // Initialization code here. } @@ -30,19 +30,19 @@ -(instancetype)initWithFrame:(NSRect)frame #pragma mark - #pragma mark Mouse handling methods --(BOOL)acceptsFirstMouse:(NSEvent *)theEvent +-(BOOL)acceptsFirstMouse:(nullable NSEvent *__unused)theEvent { return YES; } --(void)mouseDown:(NSEvent *)theEvent +-(void)mouseDown:(nonnull NSEvent *)theEvent { - self.previousLocation = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + self.previousLocation = [self convertPoint:theEvent.locationInWindow fromView:nil]; } --(void)mouseDragged:(NSEvent *)theEvent +-(void)mouseDragged:(nonnull NSEvent *)theEvent { - NSPoint currentLocation = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + NSPoint currentLocation = [self convertPoint:theEvent.locationInWindow fromView:nil]; CGFloat displacementInX = kMouseMovementScaleFactorForRotation * (currentLocation.x - self.previousLocation.x); CGFloat displacementInY = kMouseMovementScaleFactorForRotation * (self.previousLocation.y - currentLocation.y); @@ -50,21 +50,22 @@ -(void)mouseDragged:(NSEvent *)theEvent CGFloat totalRotation = sqrt(displacementInX * displacementInX + displacementInY * displacementInY); CATransform3D oldTransform = self.rotationTransform; - CATransform3D newTransform = CATransform3DRotate( oldTransform, totalRotation * M_PI / 180.0, - ( (displacementInX / totalRotation) * oldTransform.m12 + (displacementInY / totalRotation) * oldTransform.m11 ), - ( (displacementInX / totalRotation) * oldTransform.m22 + (displacementInY / totalRotation) * oldTransform.m21 ), - ( (displacementInX / totalRotation) * oldTransform.m32 + (displacementInY / totalRotation) * oldTransform.m31 ) ); + CATransform3D newTransform = CATransform3DRotate(oldTransform, totalRotation * M_PI / 180.0, + ((displacementInX / totalRotation) * oldTransform.m12 + (displacementInY / totalRotation) * oldTransform.m11), + ((displacementInX / totalRotation) * oldTransform.m22 + (displacementInY / totalRotation) * oldTransform.m21), + ((displacementInX / totalRotation) * oldTransform.m32 + (displacementInY / totalRotation) * oldTransform.m31)); id theDelegate = self.rotationDelegate; + [theDelegate rotateObjectUsingTransform:newTransform]; self.rotationTransform = newTransform; - self.previousLocation = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + self.previousLocation = [self convertPoint:theEvent.locationInWindow fromView:nil]; } --(void)mouseUp:(NSEvent *)theEvent +-(void)mouseUp:(nonnull NSEvent *)theEvent { - self.previousLocation = [self convertPoint:[theEvent locationInWindow] fromView:nil]; + self.previousLocation = [self convertPoint:theEvent.locationInWindow fromView:nil]; } #pragma mark - diff --git a/examples/CPTTestApp/Source/SelectionDemoController.h b/examples/CPTTestApp/Source/SelectionDemoController.h index d4e3be7dc..a94d0e322 100644 --- a/examples/CPTTestApp/Source/SelectionDemoController.h +++ b/examples/CPTTestApp/Source/SelectionDemoController.h @@ -1,6 +1,8 @@ #import #import -@interface SelectionDemoController : NSObject +@interface SelectionDemoController : NSObject @end diff --git a/examples/CPTTestApp/Source/SelectionDemoController.m b/examples/CPTTestApp/Source/SelectionDemoController.m index d59f0a399..bcf2fdde1 100644 --- a/examples/CPTTestApp/Source/SelectionDemoController.m +++ b/examples/CPTTestApp/Source/SelectionDemoController.m @@ -10,11 +10,11 @@ -(void)setupAxes; -(void)setupScatterPlots; -(void)initializeData; -@property (nonatomic, readwrite, strong) IBOutlet CPTGraphHostingView *hostView; +@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTGraphHostingView *hostView; -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; +@property (nonatomic, readwrite, strong, nonnull) CPTXYGraph *graph; -@property (nonatomic, readwrite, strong) NSMutableArray *dataForPlot; +@property (nonatomic, readwrite, strong, nonnull) NSMutableArray *dataForPlot; @property (nonatomic, readwrite) NSUInteger selectedIndex; @end @@ -153,21 +153,21 @@ -(void)setupScatterPlots CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; [plotSpace scaleToFitPlots:@[dataSourceLinePlot]]; CPTMutablePlotRange *xRange = [plotSpace.xRange mutableCopy]; - [xRange expandRangeByFactor:CPTDecimalFromDouble(0.75)]; + [xRange expandRangeByFactor:@0.75]; plotSpace.xRange = xRange; CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy]; - [yRange expandRangeByFactor:CPTDecimalFromDouble(0.75)]; + [yRange expandRangeByFactor:@0.75]; plotSpace.yRange = yRange; - CPTPlotRange *globalXRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(10.0)]; + CPTPlotRange *globalXRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@10.0]; plotSpace.globalXRange = globalXRange; - CPTPlotRange *globalYRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-5.0) length:CPTDecimalFromDouble(10.0)]; + CPTPlotRange *globalYRange = [CPTPlotRange plotRangeWithLocation:@(-5.0) length:@10.0]; plotSpace.globalYRange = globalYRange; } -(void)initializeData { - NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100]; + NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100]; for ( NSUInteger i = 0; i < 100; i++ ) { NSNumber *x = @(i * 0.05); @@ -182,14 +182,14 @@ -(void)initializeData #pragma mark - #pragma mark Plot datasource methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot { NSUInteger count = 0; - if ( [(NSString *)plot.identifier isEqualToString : MAIN_PLOT] ) { - count = [self.dataForPlot count]; + if ( [(NSString *) plot.identifier isEqualToString:MAIN_PLOT] ) { + count = self.dataForPlot.count; } - else if ( [(NSString *)plot.identifier isEqualToString : SELECTION_PLOT] ) { + else if ( [(NSString *) plot.identifier isEqualToString:SELECTION_PLOT] ) { if ( self.selectedIndex < NSUIntegerMax ) { count = 5; } @@ -198,26 +198,26 @@ -(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot return count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSNumber *num = nil; - if ( [(NSString *)plot.identifier isEqualToString : MAIN_PLOT] ) { + if ( [(NSString *) plot.identifier isEqualToString:MAIN_PLOT] ) { NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y"); num = (self.dataForPlot)[index][key]; } - else if ( [(NSString *)plot.identifier isEqualToString : SELECTION_PLOT] ) { + else if ( [(NSString *) plot.identifier isEqualToString:SELECTION_PLOT] ) { CPTXYPlotSpace *thePlotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; switch ( fieldEnum ) { case CPTScatterPlotFieldX: switch ( index ) { case 0: - num = [NSDecimalNumber decimalNumberWithDecimal:thePlotSpace.globalXRange.minLimit]; + num = thePlotSpace.globalXRange.minLimit; break; case 1: - num = [NSDecimalNumber decimalNumberWithDecimal:thePlotSpace.globalXRange.maxLimit]; + num = thePlotSpace.globalXRange.maxLimit; break; case 2: @@ -240,11 +240,11 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI break; case 3: - num = [NSDecimalNumber decimalNumberWithDecimal:thePlotSpace.globalYRange.maxLimit]; + num = thePlotSpace.globalYRange.maxLimit; break; case 4: - num = [NSDecimalNumber decimalNumberWithDecimal:thePlotSpace.globalYRange.minLimit]; + num = thePlotSpace.globalYRange.minLimit; break; default: @@ -260,13 +260,13 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI return num; } --(CPTPlotSymbol *)symbolForScatterPlot:(CPTScatterPlot *)plot recordIndex:(NSUInteger)index +-(nullable CPTPlotSymbol *)symbolForScatterPlot:(nonnull CPTScatterPlot *)plot recordIndex:(NSUInteger)index { static CPTPlotSymbol *redDot = nil; CPTPlotSymbol *symbol = (id)[NSNull null]; - if ( [(NSString *)plot.identifier isEqualToString : SELECTION_PLOT] && (index == 2) ) { + if ( [(NSString *) plot.identifier isEqualToString:SELECTION_PLOT] && (index == 2)) { if ( !redDot ) { redDot = [[CPTPlotSymbol alloc] init]; redDot.symbolType = CPTPlotSymbolTypeEllipse; @@ -282,7 +282,7 @@ -(CPTPlotSymbol *)symbolForScatterPlot:(CPTScatterPlot *)plot recordIndex:(NSUIn #pragma mark - #pragma mark CPTScatterPlot delegate methods --(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index +-(void)scatterPlot:(nonnull CPTScatterPlot *__unused)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index { self.selectedIndex = index; } @@ -291,11 +291,12 @@ -(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NS #pragma mark Plot space delegate methods #ifdef REMOVE_SELECTION_ON_CLICK --(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)event atPoint:(CGPoint)point +-(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)point { self.selectedIndex = NSUIntegerMax; return YES; } + #endif #pragma mark - diff --git a/examples/CPTTestApp/Source/main.m b/examples/CPTTestApp/Source/main.m index e8a345f07..4177914fd 100644 --- a/examples/CPTTestApp/Source/main.m +++ b/examples/CPTTestApp/Source/main.m @@ -1,9 +1,9 @@ // -// main.m -// CPTTestApp +// main.m +// CPTTestApp // -// Created by Dirkjan Krijnders on 2/2/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. +// Created by Dirkjan Krijnders on 2/2/09. +// Copyright __MyCompanyName__ 2009. All rights reserved. // int main(int argc, const char *argv[]) diff --git a/examples/CPTTestApp/English.lproj/InfoPlist.strings b/examples/CPTTestApp/en.lproj/InfoPlist.strings similarity index 100% rename from examples/CPTTestApp/English.lproj/InfoPlist.strings rename to examples/CPTTestApp/en.lproj/InfoPlist.strings diff --git a/examples/CorePlotExamples.xcworkspace/contents.xcworkspacedata b/examples/CorePlotExamples.xcworkspace/contents.xcworkspacedata index 60585fe51..a9ec2bf00 100644 --- a/examples/CorePlotExamples.xcworkspace/contents.xcworkspacedata +++ b/examples/CorePlotExamples.xcworkspace/contents.xcworkspacedata @@ -5,10 +5,7 @@ location = "group:CorePlotGallery" name = "Plot Gallery"> - - + location = "group:Plot_Gallery.xcodeproj"> - - - - - - + + + + IDEDidComputeMac32BitWarning + + + diff --git a/examples/CorePlotExamples.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/examples/CorePlotExamples.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..0c67376eb --- /dev/null +++ b/examples/CorePlotExamples.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,5 @@ + + + + + diff --git a/examples/CorePlotGallery/Plot_Gallery_Mac-Info.plist b/examples/CorePlotGallery/Base.lproj/Plot_Gallery_Mac-Info.plist similarity index 94% rename from examples/CorePlotGallery/Plot_Gallery_Mac-Info.plist rename to examples/CorePlotGallery/Base.lproj/Plot_Gallery_Mac-Info.plist index b0cb1bbde..0bd38f049 100644 --- a/examples/CorePlotGallery/Plot_Gallery_Mac-Info.plist +++ b/examples/CorePlotGallery/Base.lproj/Plot_Gallery_Mac-Info.plist @@ -20,6 +20,8 @@ ???? CFBundleVersion 1 + LSApplicationCategoryType + LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSMainNibFile diff --git a/examples/CorePlotGallery/Plot_Gallery-Info.plist b/examples/CorePlotGallery/Base.lproj/Plot_Gallery_iOS-Info.plist similarity index 95% rename from examples/CorePlotGallery/Plot_Gallery-Info.plist rename to examples/CorePlotGallery/Base.lproj/Plot_Gallery_iOS-Info.plist index 8c20e1104..2c91ece38 100644 --- a/examples/CorePlotGallery/Plot_Gallery-Info.plist +++ b/examples/CorePlotGallery/Base.lproj/Plot_Gallery_iOS-Info.plist @@ -16,6 +16,8 @@ ${PRODUCT_NAME} CFBundlePackageType APPL + CFBundleShortVersionString + 1.0 CFBundleSignature ???? CFBundleVersion diff --git a/examples/AAPLot/Info.plist b/examples/CorePlotGallery/Base.lproj/Plot_Gallery_tvOS-Info.plist similarity index 60% rename from examples/AAPLot/Info.plist rename to examples/CorePlotGallery/Base.lproj/Plot_Gallery_tvOS-Info.plist index 4081ec7d1..4f338601b 100644 --- a/examples/AAPLot/Info.plist +++ b/examples/CorePlotGallery/Base.lproj/Plot_Gallery_tvOS-Info.plist @@ -3,34 +3,30 @@ CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PRODUCT_NAME} + en CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIcons~ipad - + $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName - ${PRODUCT_NAME} + $(PRODUCT_NAME) CFBundlePackageType APPL + CFBundleShortVersionString + 1.0 CFBundleSignature ???? CFBundleVersion - 1.0 + 1 LSRequiresIPhoneOS - NSMainNibFile - MainWindow - UILaunchStoryboardName - Launch Screen - UISupportedInterfaceOrientations + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities - UIInterfaceOrientationPortrait + arm64 diff --git a/examples/CorePlotGallery/Plot Gallery-Mac/PlotViewItem.xib b/examples/CorePlotGallery/Plot Gallery-Mac/PlotViewItem.xib new file mode 100644 index 000000000..047384075 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-Mac/PlotViewItem.xib @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/Contents.json b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/Contents.json index 1e95c6488..b3e167fda 100644 --- a/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "size" : "29x29", "idiom" : "iphone", @@ -54,6 +64,16 @@ "filename" : "Icon-60@3x.png", "scale" : "3x" }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "idiom" : "ipad", "size" : "29x29", @@ -110,6 +130,18 @@ "idiom" : "ipad", "filename" : "Icon-76@2x.png", "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-iPadPro@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "iTunesArtwork.png", + "scale" : "1x" } ], "info" : { diff --git a/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/Icon-iPadPro@2x.png b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/Icon-iPadPro@2x.png new file mode 100644 index 000000000..4f193923f Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/Icon-iPadPro@2x.png differ diff --git a/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/iTunesArtwork.png b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/iTunesArtwork.png new file mode 100644 index 000000000..228e5b861 Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/AppIcon.appiconset/iTunesArtwork.png differ diff --git a/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/Contents.json b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/LaunchImage.launchimage/Contents.json b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/LaunchImage.launchimage/Contents.json index 8b61e901e..6d2d4295e 100644 --- a/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/LaunchImage.launchimage/Contents.json +++ b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -1,32 +1,56 @@ { "images" : [ { + "orientation" : "portrait", "idiom" : "iphone", - "scale" : "1x", - "orientation" : "portrait" + "extent" : "full-screen", + "minimum-system-version" : "11.0", + "subtype" : "2436h", + "scale" : "3x" }, { + "orientation" : "landscape", "idiom" : "iphone", - "scale" : "2x", - "orientation" : "portrait" + "extent" : "full-screen", + "minimum-system-version" : "11.0", + "subtype" : "2436h", + "scale" : "3x" }, { "orientation" : "portrait", "idiom" : "iphone", - "filename" : "Default-568h@2x.png", - "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "8.0", + "subtype" : "736h", + "scale" : "3x" + }, + { + "orientation" : "landscape", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "8.0", + "subtype" : "736h", + "scale" : "3x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "8.0", + "subtype" : "667h", "scale" : "2x" }, { "orientation" : "portrait", "idiom" : "iphone", + "extent" : "full-screen", "minimum-system-version" : "7.0", "scale" : "2x" }, { "orientation" : "portrait", "idiom" : "iphone", - "filename" : "Default-568h@2x.png", + "extent" : "full-screen", "minimum-system-version" : "7.0", "subtype" : "retina4", "scale" : "2x" @@ -34,52 +58,95 @@ { "orientation" : "portrait", "idiom" : "ipad", - "extent" : "to-status-bar", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", "scale" : "1x" }, { "orientation" : "portrait", "idiom" : "ipad", - "extent" : "to-status-bar", + "extent" : "full-screen", + "minimum-system-version" : "7.0", "scale" : "2x" }, { "orientation" : "landscape", "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "subtype" : "retina4", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", "extent" : "to-status-bar", "scale" : "1x" }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "scale" : "1x" + }, { "orientation" : "landscape", "idiom" : "ipad", "extent" : "to-status-bar", - "scale" : "2x" + "scale" : "1x" }, { - "orientation" : "portrait", + "orientation" : "landscape", "idiom" : "ipad", - "minimum-system-version" : "7.0", "extent" : "full-screen", "scale" : "1x" }, { "orientation" : "portrait", "idiom" : "ipad", - "minimum-system-version" : "7.0", + "extent" : "to-status-bar", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", "extent" : "full-screen", "scale" : "2x" }, { "orientation" : "landscape", "idiom" : "ipad", - "minimum-system-version" : "7.0", - "extent" : "full-screen", - "scale" : "1x" + "extent" : "to-status-bar", + "scale" : "2x" }, { "orientation" : "landscape", "idiom" : "ipad", - "minimum-system-version" : "7.0", "extent" : "full-screen", "scale" : "2x" } diff --git a/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png b/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png deleted file mode 100644 index 0891b7aab..000000000 Binary files a/examples/CorePlotGallery/Plot Gallery-iOS/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png and /dev/null differ diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..7aa641214 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "PlotGalleryLargeIconBack.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/PlotGalleryLargeIconBack.png b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/PlotGalleryLargeIconBack.png new file mode 100644 index 000000000..cb50a05bc Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/PlotGalleryLargeIconBack.png differ diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json new file mode 100644 index 000000000..cf8282aa5 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Contents.json @@ -0,0 +1,14 @@ +{ + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..f9614e449 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "PlotGalleryLargeIconFront.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/PlotGalleryLargeIconFront.png b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/PlotGalleryLargeIconFront.png new file mode 100644 index 000000000..43e6f1300 Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/PlotGalleryLargeIconFront.png differ diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..2f7e2f531 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "PlotGallerySmallIconBack.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/PlotGallerySmallIconBack.png b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/PlotGallerySmallIconBack.png new file mode 100644 index 000000000..9f511b9bc Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/PlotGallerySmallIconBack.png differ diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json new file mode 100644 index 000000000..cf8282aa5 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Contents.json @@ -0,0 +1,14 @@ +{ + "layers" : [ + { + "filename" : "Front.imagestacklayer" + }, + { + "filename" : "Back.imagestacklayer" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json new file mode 100644 index 000000000..387ff905b --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "PlotGallerySmallIconFront.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/PlotGallerySmallIconFront.png b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/PlotGallerySmallIconFront.png new file mode 100644 index 000000000..51a34de0f Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/PlotGallerySmallIconFront.png differ diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json new file mode 100644 index 000000000..dea6e49fd --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json @@ -0,0 +1,32 @@ +{ + "assets" : [ + { + "size" : "1280x768", + "idiom" : "tv", + "filename" : "App Icon - Large.imagestack", + "role" : "primary-app-icon" + }, + { + "size" : "400x240", + "idiom" : "tv", + "filename" : "App Icon - Small.imagestack", + "role" : "primary-app-icon" + }, + { + "size" : "2320x720", + "idiom" : "tv", + "filename" : "Top Shelf Image Wide.imageset", + "role" : "top-shelf-image-wide" + }, + { + "size" : "1920x720", + "idiom" : "tv", + "filename" : "Top Shelf Image.imageset", + "role" : "top-shelf-image" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json new file mode 100644 index 000000000..16a370df0 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json @@ -0,0 +1,16 @@ +{ + "images" : [ + { + "idiom" : "tv", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json new file mode 100644 index 000000000..167022b51 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json @@ -0,0 +1,17 @@ +{ + "images" : [ + { + "idiom" : "tv", + "filename" : "PlotGalleryTopShelf.png", + "scale" : "1x" + }, + { + "idiom" : "tv", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/PlotGalleryTopShelf.png b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/PlotGalleryTopShelf.png new file mode 100644 index 000000000..ea9cef263 Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/PlotGalleryTopShelf.png differ diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/LaunchImage.launchimage/Contents.json b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 000000000..f4a929b0d --- /dev/null +++ b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "orientation" : "landscape", + "idiom" : "tv", + "extent" : "full-screen", + "minimum-system-version" : "11.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "tv", + "filename" : "LaunchImage.png", + "extent" : "full-screen", + "minimum-system-version" : "9.0", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/LaunchImage.launchimage/LaunchImage.png b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/LaunchImage.launchimage/LaunchImage.png new file mode 100644 index 000000000..d0ba363b2 Binary files /dev/null and b/examples/CorePlotGallery/Plot Gallery-tvOS/Assets.xcassets/LaunchImage.launchimage/LaunchImage.png differ diff --git a/examples/CorePlotGallery/Plot_Gallery.xcodeproj/project.pbxproj b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/project.pbxproj new file mode 100644 index 000000000..5fc2950c5 --- /dev/null +++ b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/project.pbxproj @@ -0,0 +1,1283 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 47; + objects = { + +/* Begin PBXBuildFile section */ + 4F22FF4912342978006BF615 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF4712342978006BF615 /* main.m */; }; + 4F22FF4C1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF4B1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m */; }; + 4F22FFA412342D7C006BF615 /* CompositePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9B12342D7C006BF615 /* CompositePlot.m */; }; + 4F22FFA512342D7C006BF615 /* GradientScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9D12342D7C006BF615 /* GradientScatterPlot.m */; }; + 4F22FFA612342D7C006BF615 /* SimplePieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9F12342D7C006BF615 /* SimplePieChart.m */; }; + 4F22FFA712342D7C006BF615 /* SimpleScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA112342D7C006BF615 /* SimpleScatterPlot.m */; }; + 4F22FFA812342D7C006BF615 /* VerticalBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA312342D7C006BF615 /* VerticalBarChart.m */; }; + 4F22FFAF12342DB1006BF615 /* PlotGallery.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAC12342DB1006BF615 /* PlotGallery.m */; }; + 4F22FFB012342DB1006BF615 /* PlotItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAE12342DB1006BF615 /* PlotItem.m */; }; + 4F22FFE8123431D2006BF615 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F22FFE7123431D2006BF615 /* Quartz.framework */; }; + 4F35EBF7123611E3007C3389 /* PlotGalleryController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F35EBF4123611E3007C3389 /* PlotGalleryController.m */; }; + 4F35EBF8123611E3007C3389 /* PlotView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F35EBF6123611E3007C3389 /* PlotView.m */; }; + 4F8E1C14129077C200D2035F /* DatePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C13129077C200D2035F /* DatePlot.m */; }; + 4F8E1C86129083B000D2035F /* SteppedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C85129083B000D2035F /* SteppedScatterPlot.m */; }; + 4F8E1CC212908B0000D2035F /* AxisDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1CC112908B0000D2035F /* AxisDemo.m */; }; + 4FABDD421291110D003A2DB7 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F4892891290FFCD00EDB93F /* CorePlot.framework */; }; + 4FABDD4612911127003A2DB7 /* CorePlot.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 4F4892891290FFCD00EDB93F /* CorePlot.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + C309C23423B3E12500DEDE9D /* PlotViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = C309C23323B3E12500DEDE9D /* PlotViewItem.xib */; }; + C309C23623B3E21500DEDE9D /* PlotViewItem.m in Sources */ = {isa = PBXBuildFile; fileRef = C309C23523B3E21500DEDE9D /* PlotViewItem.m */; }; + C30B12431BCADD300084C567 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3D4146F1A7D824700B6F5D6 /* CorePlot.framework */; }; + C30B12441BCADD300084C567 /* CorePlot.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C3D4146F1A7D824700B6F5D6 /* CorePlot.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + C30B12481BCADE170084C567 /* PlotItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAE12342DB1006BF615 /* PlotItem.m */; }; + C30B12491BCADE170084C567 /* PlotGallery.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAC12342DB1006BF615 /* PlotGallery.m */; }; + C30B124A1BCADE170084C567 /* PiNumberFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C3457A4C17AD7C5D000880F3 /* PiNumberFormatter.m */; }; + C30D8AFA1BCAF99D0003BB70 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C30D8AF91BCAF99D0003BB70 /* main.m */; }; + C30D8AFD1BCAF99D0003BB70 /* AppDelegateTV.m in Sources */ = {isa = PBXBuildFile; fileRef = C30D8AFC1BCAF99D0003BB70 /* AppDelegateTV.m */; }; + C30D8B081BCAF99D0003BB70 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C30D8B071BCAF99D0003BB70 /* Assets.xcassets */; }; + C30D8B211BCAFD3E0003BB70 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D2FE6219FF1D03002CD4D6 /* Images.xcassets */; }; + C30D8B221BCAFD3E0003BB70 /* PlotItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAE12342DB1006BF615 /* PlotItem.m */; }; + C30D8B231BCAFD3E0003BB70 /* PlotGallery.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAC12342DB1006BF615 /* PlotGallery.m */; }; + C30D8B241BCAFD3E0003BB70 /* PiNumberFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C3457A4C17AD7C5D000880F3 /* PiNumberFormatter.m */; }; + C30D8B251BCAFDE20003BB70 /* AxisDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1CC112908B0000D2035F /* AxisDemo.m */; }; + C30D8B261BCAFDE20003BB70 /* CandlestickPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1DF13B18CAE007994B6 /* CandlestickPlot.m */; }; + C30D8B271BCAFDE20003BB70 /* ColoredBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A31A5514DF782A00734AB7 /* ColoredBarChart.m */; }; + C30D8B281BCAFDE20003BB70 /* CompositePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9B12342D7C006BF615 /* CompositePlot.m */; }; + C30D8B291BCAFDE20003BB70 /* ControlChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C35597951437E07800B41DA7 /* ControlChart.m */; }; + C30D8B2A1BCAFDE20003BB70 /* CurvedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */; }; + C30D8B2B1BCAFDE20003BB70 /* DatePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C13129077C200D2035F /* DatePlot.m */; }; + C30D8B2C1BCAFDE20003BB70 /* DonutChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F34F1412AB2598008FBDC3 /* DonutChart.m */; }; + C30D8B2D1BCAFDE20003BB70 /* FunctionPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F97F1817A9DE2000A52FF2 /* FunctionPlot.m */; }; + C30D8B2E1BCAFDE20003BB70 /* GradientScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9D12342D7C006BF615 /* GradientScatterPlot.m */; }; + C30D8B2F1BCAFDE20003BB70 /* ImageDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D70BA5175EB29E00F27173 /* ImageDemo.m */; }; + C30D8B301BCAFDE20003BB70 /* LabelingPolicyDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4013BFE1A900CD9194 /* LabelingPolicyDemo.m */; }; + C30D8B311BCAFDE20003BB70 /* LineCapDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C367249213E103910070F47A /* LineCapDemo.m */; }; + C30D8B321BCAFDE20003BB70 /* OHLCPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1C513B18AAF007994B6 /* OHLCPlot.m */; }; + C30D8B331BCAFDE20003BB70 /* PlotSpaceDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4313BFE1B400CD9194 /* PlotSpaceDemo.m */; }; + C30D8B341BCAFDE20003BB70 /* RangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A14BEB13AEB7E700D103EA /* RangePlot.m */; }; + C30D8B351BCAFDE20003BB70 /* RealTimePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C354C0D613C7CDBE00DA8822 /* RealTimePlot.m */; }; + C30D8B361BCAFDE20003BB70 /* SteppedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C85129083B000D2035F /* SteppedScatterPlot.m */; }; + C30D8B371BCAFDE20003BB70 /* SimplePieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9F12342D7C006BF615 /* SimplePieChart.m */; }; + C30D8B381BCAFDE20003BB70 /* SimpleScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA112342D7C006BF615 /* SimpleScatterPlot.m */; }; + C30D8B391BCAFDE20003BB70 /* VerticalBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA312342D7C006BF615 /* VerticalBarChart.m */; }; + C30D8B3D1BCAFFB50003BB70 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C30D8B3C1BCAFFB50003BB70 /* CoreGraphics.framework */; }; + C30D8B3F1BCAFFBB0003BB70 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C30D8B3E1BCAFFBB0003BB70 /* QuartzCore.framework */; }; + C30D8B411BCAFFC10003BB70 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C30D8B401BCAFFC10003BB70 /* Foundation.framework */; }; + C30D8B431BCAFFCB0003BB70 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C30D8B421BCAFFCB0003BB70 /* UIKit.framework */; }; + C32D229E23B1086600043720 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = C32D229C23B1086600043720 /* MainMenu.xib */; }; + C3457A4D17AD7C5D000880F3 /* PiNumberFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C3457A4C17AD7C5D000880F3 /* PiNumberFormatter.m */; }; + C3490DD820E025760089F309 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = C3490DDA20E025760089F309 /* Icon.icns */; }; + C34CB5461BC9A83C009270A0 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C34CB5451BC9A83C009270A0 /* Images.xcassets */; }; + C34CB5541BC9A889009270A0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB5481BC9A889009270A0 /* AppDelegate.m */; }; + C34CB5551BC9A889009270A0 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB54A1BC9A889009270A0 /* DetailViewController.m */; }; + C34CB5571BC9A889009270A0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB54C1BC9A889009270A0 /* main.m */; }; + C34CB55A1BC9A889009270A0 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB5511BC9A889009270A0 /* RootViewController.m */; }; + C34CB55B1BC9A889009270A0 /* ThemeTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C34CB5531BC9A889009270A0 /* ThemeTableViewController.m */; }; + C34CB5601BC9AB7B009270A0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C34CB55F1BC9AB7B009270A0 /* Foundation.framework */; }; + C34CB5621BC9AB85009270A0 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C34CB5611BC9AB85009270A0 /* UIKit.framework */; }; + C34CB5641BC9AB8C009270A0 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C34CB5631BC9AB8C009270A0 /* CoreGraphics.framework */; }; + C34CB5661BC9AB93009270A0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C34CB5651BC9AB93009270A0 /* QuartzCore.framework */; }; + C34CB57C1BC9B1C1009270A0 /* AxisDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1CC112908B0000D2035F /* AxisDemo.m */; }; + C34CB57D1BC9B1C1009270A0 /* CandlestickPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1DF13B18CAE007994B6 /* CandlestickPlot.m */; }; + C34CB57E1BC9B1C1009270A0 /* ColoredBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A31A5514DF782A00734AB7 /* ColoredBarChart.m */; }; + C34CB57F1BC9B1C1009270A0 /* CompositePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9B12342D7C006BF615 /* CompositePlot.m */; }; + C34CB5801BC9B1C1009270A0 /* ControlChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C35597951437E07800B41DA7 /* ControlChart.m */; }; + C34CB5811BC9B1C1009270A0 /* CurvedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */; }; + C34CB5821BC9B1C1009270A0 /* DatePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C13129077C200D2035F /* DatePlot.m */; }; + C34CB5831BC9B1C1009270A0 /* DonutChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F34F1412AB2598008FBDC3 /* DonutChart.m */; }; + C34CB5841BC9B1C1009270A0 /* FunctionPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F97F1817A9DE2000A52FF2 /* FunctionPlot.m */; }; + C34CB5851BC9B1C1009270A0 /* GradientScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9D12342D7C006BF615 /* GradientScatterPlot.m */; }; + C34CB5861BC9B1C1009270A0 /* ImageDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D70BA5175EB29E00F27173 /* ImageDemo.m */; }; + C34CB5871BC9B1C1009270A0 /* LabelingPolicyDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4013BFE1A900CD9194 /* LabelingPolicyDemo.m */; }; + C34CB5881BC9B1C1009270A0 /* LineCapDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C367249213E103910070F47A /* LineCapDemo.m */; }; + C34CB5891BC9B1C1009270A0 /* OHLCPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1C513B18AAF007994B6 /* OHLCPlot.m */; }; + C34CB58A1BC9B1C1009270A0 /* PlotSpaceDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4313BFE1B400CD9194 /* PlotSpaceDemo.m */; }; + C34CB58B1BC9B1C1009270A0 /* RangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A14BEB13AEB7E700D103EA /* RangePlot.m */; }; + C34CB58C1BC9B1C1009270A0 /* RealTimePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C354C0D613C7CDBE00DA8822 /* RealTimePlot.m */; }; + C34CB58D1BC9B1C1009270A0 /* SteppedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C85129083B000D2035F /* SteppedScatterPlot.m */; }; + C34CB58E1BC9B1C1009270A0 /* SimplePieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9F12342D7C006BF615 /* SimplePieChart.m */; }; + C34CB58F1BC9B1C1009270A0 /* SimpleScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA112342D7C006BF615 /* SimpleScatterPlot.m */; }; + C34CB5901BC9B1C1009270A0 /* VerticalBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA312342D7C006BF615 /* VerticalBarChart.m */; }; + C354C0D713C7CDBE00DA8822 /* RealTimePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C354C0D613C7CDBE00DA8822 /* RealTimePlot.m */; }; + C35597961437E07800B41DA7 /* ControlChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C35597951437E07800B41DA7 /* ControlChart.m */; }; + C357EA9D1F708E870060CF48 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C30D8B181BCAF99D0003BB70 /* CorePlot.framework */; }; + C360E1C613B18AAF007994B6 /* OHLCPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1C513B18AAF007994B6 /* OHLCPlot.m */; }; + C360E1E013B18CAF007994B6 /* CandlestickPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1DF13B18CAE007994B6 /* CandlestickPlot.m */; }; + C367249313E103910070F47A /* LineCapDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C367249213E103910070F47A /* LineCapDemo.m */; }; + C367EEE21BCAEA9E00A21FE7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D2FE6219FF1D03002CD4D6 /* Images.xcassets */; }; + C39C4E4113BFE1A900CD9194 /* LabelingPolicyDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4013BFE1A900CD9194 /* LabelingPolicyDemo.m */; }; + C39C4E4413BFE1B400CD9194 /* PlotSpaceDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4313BFE1B400CD9194 /* PlotSpaceDemo.m */; }; + C3A14BEC13AEB7E700D103EA /* RangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A14BEB13AEB7E700D103EA /* RangePlot.m */; }; + C3A31A5614DF782A00734AB7 /* ColoredBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A31A5514DF782A00734AB7 /* ColoredBarChart.m */; }; + C3AC1410150EDE5C00631001 /* CurvedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */; }; + C3B9C26F1BCB237000BD560B /* DetailViewControllerTV.m in Sources */ = {isa = PBXBuildFile; fileRef = C3B9C26A1BCB237000BD560B /* DetailViewControllerTV.m */; }; + C3B9C2701BCB237000BD560B /* RootViewControllerTV.m in Sources */ = {isa = PBXBuildFile; fileRef = C3B9C26C1BCB237000BD560B /* RootViewControllerTV.m */; }; + C3B9C2711BCB237000BD560B /* ThemeTableViewControllerTV.m in Sources */ = {isa = PBXBuildFile; fileRef = C3B9C26E1BCB237000BD560B /* ThemeTableViewControllerTV.m */; }; + C3D0A1B720E0187600BA2921 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A1B920E0187600BA2921 /* Main.storyboard */; }; + C3D0A1C420E0188800BA2921 /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A1C620E0188800BA2921 /* Launch Screen.xib */; }; + C3D0A1C820E018DE00BA2921 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A1CA20E018DE00BA2921 /* Main.storyboard */; }; + C3D2FE6319FF1D03002CD4D6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D2FE6219FF1D03002CD4D6 /* Images.xcassets */; }; + C3D70BA6175EB29E00F27173 /* ImageDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D70BA5175EB29E00F27173 /* ImageDemo.m */; }; + C3EF42FD19FC75810060791A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3EF42FC19FC75810060791A /* Images.xcassets */; }; + C3F34F1512AB2598008FBDC3 /* DonutChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F34F1412AB2598008FBDC3 /* DonutChart.m */; }; + C3F6216C1C9F365100301061 /* CurvedInterpolationDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = E9595DFB1C9973B9004129DA /* CurvedInterpolationDemo.m */; }; + C3F97F1917A9DE2000A52FF2 /* FunctionPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F97F1817A9DE2000A52FF2 /* FunctionPlot.m */; }; + E9595DFC1C9973B9004129DA /* CurvedInterpolationDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = E9595DFB1C9973B9004129DA /* CurvedInterpolationDemo.m */; }; + E9AB989C1C9A903700D23875 /* CurvedInterpolationDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = E9595DFB1C9973B9004129DA /* CurvedInterpolationDemo.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 4F4892881290FFCD00EDB93F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8DC2EF5B0486A6940098B216; + remoteInfo = CorePlot; + }; + 4F48928A1290FFCD00EDB93F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 0730F600109492D800E95162; + remoteInfo = UnitTests; + }; + 4F4892921290FFED00EDB93F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 8DC2EF4F0486A6940098B216; + remoteInfo = CorePlot; + }; + C30B12451BCADD300084C567 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = C38A09771A46185200D45436; + remoteInfo = "CorePlot iOS"; + }; + C30D8B171BCAF99D0003BB70 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C30D8B191BCAF99D0003BB70 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; + C30D8B1E1BCAFC080003BB70 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = C37EA5C91BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C34CB5791BC9B0D4009270A0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = C38A09771A46185200D45436; + remoteInfo = "CorePlot iOS"; + }; + C3D4146E1A7D824700B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09781A46185200D45436; + remoteInfo = CorePlot_iOS; + }; + C3D414701A7D824700B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09821A46185300D45436; + remoteInfo = CorePlot_iOSTests; + }; + C3D414721A7D824700B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09BA1A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouch"; + }; + C3D414741A7D824700B6F5D6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09C41A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouchTests"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 4F22FFDB12343172006BF615 /* Copy Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 4FABDD4612911127003A2DB7 /* CorePlot.framework in Copy Frameworks */, + ); + name = "Copy Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + C30B12471BCADD310084C567 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + C30B12441BCADD300084C567 /* CorePlot.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; + 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; + 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + 4F22FF4712342978006BF615 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/mac/main.m; sourceTree = ""; }; + 4F22FF4A1234298E006BF615 /* Plot_Gallery_MacAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Plot_Gallery_MacAppDelegate.h; path = src/mac/Plot_Gallery_MacAppDelegate.h; sourceTree = ""; }; + 4F22FF4B1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Plot_Gallery_MacAppDelegate.m; path = src/mac/Plot_Gallery_MacAppDelegate.m; sourceTree = ""; }; + 4F22FF7B12342B5A006BF615 /* Plot_Gallery_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Plot_Gallery_Prefix.pch; sourceTree = ""; }; + 4F22FF9A12342D7C006BF615 /* CompositePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = CompositePlot.h; path = src/plots/CompositePlot.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 4F22FF9B12342D7C006BF615 /* CompositePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CompositePlot.m; path = src/plots/CompositePlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 4F22FF9C12342D7C006BF615 /* GradientScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GradientScatterPlot.h; path = src/plots/GradientScatterPlot.h; sourceTree = ""; }; + 4F22FF9D12342D7C006BF615 /* GradientScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = GradientScatterPlot.m; path = src/plots/GradientScatterPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 4F22FF9E12342D7C006BF615 /* SimplePieChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SimplePieChart.h; path = src/plots/SimplePieChart.h; sourceTree = ""; }; + 4F22FF9F12342D7C006BF615 /* SimplePieChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SimplePieChart.m; path = src/plots/SimplePieChart.m; sourceTree = ""; }; + 4F22FFA012342D7C006BF615 /* SimpleScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SimpleScatterPlot.h; path = src/plots/SimpleScatterPlot.h; sourceTree = ""; }; + 4F22FFA112342D7C006BF615 /* SimpleScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SimpleScatterPlot.m; path = src/plots/SimpleScatterPlot.m; sourceTree = ""; }; + 4F22FFA212342D7C006BF615 /* VerticalBarChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VerticalBarChart.h; path = src/plots/VerticalBarChart.h; sourceTree = ""; }; + 4F22FFA312342D7C006BF615 /* VerticalBarChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VerticalBarChart.m; path = src/plots/VerticalBarChart.m; sourceTree = ""; }; + 4F22FFAB12342DB1006BF615 /* PlotGallery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotGallery.h; path = src/shared/PlotGallery.h; sourceTree = ""; }; + 4F22FFAC12342DB1006BF615 /* PlotGallery.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotGallery.m; path = src/shared/PlotGallery.m; sourceTree = ""; }; + 4F22FFAD12342DB1006BF615 /* PlotItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = PlotItem.h; path = src/shared/PlotItem.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 4F22FFAE12342DB1006BF615 /* PlotItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotItem.m; path = src/shared/PlotItem.m; sourceTree = ""; }; + 4F22FFE7123431D2006BF615 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; }; + 4F35EBF3123611E3007C3389 /* PlotGalleryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotGalleryController.h; path = src/mac/PlotGalleryController.h; sourceTree = ""; }; + 4F35EBF4123611E3007C3389 /* PlotGalleryController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotGalleryController.m; path = src/mac/PlotGalleryController.m; sourceTree = ""; }; + 4F35EBF5123611E3007C3389 /* PlotView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotView.h; path = src/mac/PlotView.h; sourceTree = ""; }; + 4F35EBF6123611E3007C3389 /* PlotView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotView.m; path = src/mac/PlotView.m; sourceTree = ""; }; + 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../../framework/CorePlot.xcodeproj; sourceTree = SOURCE_ROOT; }; + 4F8E1C12129077C200D2035F /* DatePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DatePlot.h; path = src/plots/DatePlot.h; sourceTree = ""; }; + 4F8E1C13129077C200D2035F /* DatePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = DatePlot.m; path = src/plots/DatePlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 4F8E1C84129083B000D2035F /* SteppedScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SteppedScatterPlot.h; path = src/plots/SteppedScatterPlot.h; sourceTree = ""; }; + 4F8E1C85129083B000D2035F /* SteppedScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SteppedScatterPlot.m; path = src/plots/SteppedScatterPlot.m; sourceTree = ""; }; + 4F8E1CC012908B0000D2035F /* AxisDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AxisDemo.h; path = src/plots/AxisDemo.h; sourceTree = ""; }; + 4F8E1CC112908B0000D2035F /* AxisDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = AxisDemo.m; path = src/plots/AxisDemo.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 8D1107320486CEB800E47090 /* Plot Gallery.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Plot Gallery.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + C309C23323B3E12500DEDE9D /* PlotViewItem.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = PlotViewItem.xib; path = "Plot Gallery-Mac/PlotViewItem.xib"; sourceTree = ""; }; + C309C23523B3E21500DEDE9D /* PlotViewItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PlotViewItem.m; path = src/mac/PlotViewItem.m; sourceTree = ""; }; + C309C23723B3E29F00DEDE9D /* PlotViewItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PlotViewItem.h; path = src/mac/PlotViewItem.h; sourceTree = ""; }; + C30D8AF61BCAF99D0003BB70 /* Plot Gallery tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Plot Gallery tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + C30D8AF91BCAF99D0003BB70 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/tvOS/main.m; sourceTree = ""; }; + C30D8AFB1BCAF99D0003BB70 /* AppDelegateTV.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppDelegateTV.h; path = src/tvOS/AppDelegateTV.h; sourceTree = ""; }; + C30D8AFC1BCAF99D0003BB70 /* AppDelegateTV.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AppDelegateTV.m; path = src/tvOS/AppDelegateTV.m; sourceTree = ""; }; + C30D8B071BCAF99D0003BB70 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = "Plot Gallery-tvOS/Assets.xcassets"; sourceTree = ""; }; + C30D8B3A1BCAFFAE0003BB70 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks/Accelerate.framework; sourceTree = DEVELOPER_DIR; }; + C30D8B3C1BCAFFB50003BB70 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; }; + C30D8B3E1BCAFFBB0003BB70 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + C30D8B401BCAFFC10003BB70 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + C30D8B421BCAFFCB0003BB70 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + C32D229D23B1086600043720 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = src/mac/Base.lproj/MainMenu.xib; sourceTree = ""; }; + C3457A4B17AD7C5D000880F3 /* PiNumberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PiNumberFormatter.h; path = src/shared/PiNumberFormatter.h; sourceTree = ""; }; + C3457A4C17AD7C5D000880F3 /* PiNumberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PiNumberFormatter.m; path = src/shared/PiNumberFormatter.m; sourceTree = ""; }; + C3490DCC20E025660089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/Plot_Gallery_Mac-Info.plist"; sourceTree = ""; }; + C3490DD920E025760089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = Base; path = Base.lproj/Icon.icns; sourceTree = ""; }; + C3490DDB20E025B60089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/Plot_Gallery_iOS-Info.plist"; sourceTree = ""; }; + C3490DDF20E026410089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/Plot_Gallery_tvOS-Info.plist"; sourceTree = ""; }; + C34CB52E1BC9A76A009270A0 /* Plot Gallery-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Plot Gallery-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + C34CB5451BC9A83C009270A0 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "Plot Gallery-iOS/Images.xcassets"; sourceTree = ""; }; + C34CB5471BC9A889009270A0 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = src/ios/AppDelegate.h; sourceTree = ""; }; + C34CB5481BC9A889009270A0 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = src/ios/AppDelegate.m; sourceTree = ""; }; + C34CB5491BC9A889009270A0 /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetailViewController.h; path = src/ios/DetailViewController.h; sourceTree = ""; }; + C34CB54A1BC9A889009270A0 /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DetailViewController.m; path = src/ios/DetailViewController.m; sourceTree = ""; }; + C34CB54C1BC9A889009270A0 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/ios/main.m; sourceTree = ""; }; + C34CB5501BC9A889009270A0 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RootViewController.h; path = src/ios/RootViewController.h; sourceTree = ""; }; + C34CB5511BC9A889009270A0 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RootViewController.m; path = src/ios/RootViewController.m; sourceTree = ""; }; + C34CB5521BC9A889009270A0 /* ThemeTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThemeTableViewController.h; path = src/ios/ThemeTableViewController.h; sourceTree = ""; }; + C34CB5531BC9A889009270A0 /* ThemeTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ThemeTableViewController.m; path = src/ios/ThemeTableViewController.m; sourceTree = ""; }; + C34CB55F1BC9AB7B009270A0 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + C34CB5611BC9AB85009270A0 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + C34CB5631BC9AB8C009270A0 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; }; + C34CB5651BC9AB93009270A0 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + C34CB5671BC9AB9E009270A0 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/Accelerate.framework; sourceTree = DEVELOPER_DIR; }; + C354C0D513C7CDBE00DA8822 /* RealTimePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RealTimePlot.h; path = src/plots/RealTimePlot.h; sourceTree = ""; }; + C354C0D613C7CDBE00DA8822 /* RealTimePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RealTimePlot.m; path = src/plots/RealTimePlot.m; sourceTree = ""; }; + C35597941437E07800B41DA7 /* ControlChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ControlChart.h; path = src/plots/ControlChart.h; sourceTree = ""; }; + C35597951437E07800B41DA7 /* ControlChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ControlChart.m; path = src/plots/ControlChart.m; sourceTree = ""; }; + C360E1C413B18AAF007994B6 /* OHLCPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OHLCPlot.h; path = src/plots/OHLCPlot.h; sourceTree = ""; }; + C360E1C513B18AAF007994B6 /* OHLCPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OHLCPlot.m; path = src/plots/OHLCPlot.m; sourceTree = ""; }; + C360E1DE13B18CAE007994B6 /* CandlestickPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CandlestickPlot.h; path = src/plots/CandlestickPlot.h; sourceTree = ""; }; + C360E1DF13B18CAE007994B6 /* CandlestickPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CandlestickPlot.m; path = src/plots/CandlestickPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C367249113E103910070F47A /* LineCapDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LineCapDemo.h; path = src/plots/LineCapDemo.h; sourceTree = ""; }; + C367249213E103910070F47A /* LineCapDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LineCapDemo.m; path = src/plots/LineCapDemo.m; sourceTree = ""; }; + C39C4E3F13BFE1A900CD9194 /* LabelingPolicyDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LabelingPolicyDemo.h; path = src/plots/LabelingPolicyDemo.h; sourceTree = ""; }; + C39C4E4013BFE1A900CD9194 /* LabelingPolicyDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = LabelingPolicyDemo.m; path = src/plots/LabelingPolicyDemo.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C39C4E4213BFE1B400CD9194 /* PlotSpaceDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotSpaceDemo.h; path = src/plots/PlotSpaceDemo.h; sourceTree = ""; }; + C39C4E4313BFE1B400CD9194 /* PlotSpaceDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotSpaceDemo.m; path = src/plots/PlotSpaceDemo.m; sourceTree = ""; }; + C3A14BEA13AEB7E700D103EA /* RangePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RangePlot.h; path = src/plots/RangePlot.h; sourceTree = ""; }; + C3A14BEB13AEB7E700D103EA /* RangePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RangePlot.m; path = src/plots/RangePlot.m; sourceTree = ""; }; + C3A31A5414DF782A00734AB7 /* ColoredBarChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ColoredBarChart.h; path = src/plots/ColoredBarChart.h; sourceTree = ""; }; + C3A31A5514DF782A00734AB7 /* ColoredBarChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = ColoredBarChart.m; path = src/plots/ColoredBarChart.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C3B9C2691BCB237000BD560B /* DetailViewControllerTV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetailViewControllerTV.h; path = src/tvOS/DetailViewControllerTV.h; sourceTree = ""; }; + C3B9C26A1BCB237000BD560B /* DetailViewControllerTV.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DetailViewControllerTV.m; path = src/tvOS/DetailViewControllerTV.m; sourceTree = ""; }; + C3B9C26B1BCB237000BD560B /* RootViewControllerTV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RootViewControllerTV.h; path = src/tvOS/RootViewControllerTV.h; sourceTree = ""; }; + C3B9C26C1BCB237000BD560B /* RootViewControllerTV.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RootViewControllerTV.m; path = src/tvOS/RootViewControllerTV.m; sourceTree = ""; }; + C3B9C26D1BCB237000BD560B /* ThemeTableViewControllerTV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThemeTableViewControllerTV.h; path = src/tvOS/ThemeTableViewControllerTV.h; sourceTree = ""; }; + C3B9C26E1BCB237000BD560B /* ThemeTableViewControllerTV.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ThemeTableViewControllerTV.m; path = src/tvOS/ThemeTableViewControllerTV.m; sourceTree = ""; }; + C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3D0A1B820E0187600BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + C3D0A1C520E0188800BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = "Base.lproj/Launch Screen.xib"; sourceTree = ""; }; + C3D0A1C920E018DE00BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + C3D2FE6219FF1D03002CD4D6 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = img/Images.xcassets; sourceTree = ""; }; + C3D70BA4175EB29E00F27173 /* ImageDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImageDemo.h; path = src/plots/ImageDemo.h; sourceTree = ""; }; + C3D70BA5175EB29E00F27173 /* ImageDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = ImageDemo.m; path = src/plots/ImageDemo.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C3EF42FC19FC75810060791A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "Plot Gallery-Mac/Images.xcassets"; sourceTree = ""; }; + C3F34F1312AB2598008FBDC3 /* DonutChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DonutChart.h; path = src/plots/DonutChart.h; sourceTree = ""; }; + C3F34F1412AB2598008FBDC3 /* DonutChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = DonutChart.m; path = src/plots/DonutChart.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C3F42A2614D3A75F0044B323 /* CurvedScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CurvedScatterPlot.h; path = src/plots/CurvedScatterPlot.h; sourceTree = ""; }; + C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 2; name = CurvedScatterPlot.m; path = src/plots/CurvedScatterPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C3F97F1717A9DE2000A52FF2 /* FunctionPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FunctionPlot.h; path = src/plots/FunctionPlot.h; sourceTree = ""; }; + C3F97F1817A9DE2000A52FF2 /* FunctionPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = FunctionPlot.m; path = src/plots/FunctionPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + E9595DFA1C9973B9004129DA /* CurvedInterpolationDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CurvedInterpolationDemo.h; path = src/plots/CurvedInterpolationDemo.h; sourceTree = ""; }; + E9595DFB1C9973B9004129DA /* CurvedInterpolationDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CurvedInterpolationDemo.m; path = src/plots/CurvedInterpolationDemo.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8D11072E0486CEB800E47090 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4FABDD421291110D003A2DB7 /* CorePlot.framework in Frameworks */, + 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, + 4F22FFE8123431D2006BF615 /* Quartz.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C30D8AF31BCAF99D0003BB70 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C30D8B3D1BCAFFB50003BB70 /* CoreGraphics.framework in Frameworks */, + C30D8B411BCAFFC10003BB70 /* Foundation.framework in Frameworks */, + C30D8B3F1BCAFFBB0003BB70 /* QuartzCore.framework in Frameworks */, + C30D8B431BCAFFCB0003BB70 /* UIKit.framework in Frameworks */, + C357EA9D1F708E870060CF48 /* CorePlot.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C34CB52B1BC9A76A009270A0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C30B12431BCADD300084C567 /* CorePlot.framework in Frameworks */, + C34CB5641BC9AB8C009270A0 /* CoreGraphics.framework in Frameworks */, + C34CB5601BC9AB7B009270A0 /* Foundation.framework in Frameworks */, + C34CB5661BC9AB93009270A0 /* QuartzCore.framework in Frameworks */, + C34CB5621BC9AB85009270A0 /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Mac */ = { + isa = PBXGroup; + children = ( + 29B97317FDCFA39411CA2CEA /* Resources */, + 4F35EBF3123611E3007C3389 /* PlotGalleryController.h */, + 4F35EBF4123611E3007C3389 /* PlotGalleryController.m */, + 4F35EBF5123611E3007C3389 /* PlotView.h */, + 4F35EBF6123611E3007C3389 /* PlotView.m */, + C309C23723B3E29F00DEDE9D /* PlotViewItem.h */, + C309C23523B3E21500DEDE9D /* PlotViewItem.m */, + 4F22FF4712342978006BF615 /* main.m */, + 4F22FF4A1234298E006BF615 /* Plot_Gallery_MacAppDelegate.h */, + 4F22FF4B1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m */, + ); + name = Mac; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 8D1107320486CEB800E47090 /* Plot Gallery.app */, + C34CB52E1BC9A76A009270A0 /* Plot Gallery-iOS.app */, + C30D8AF61BCAF99D0003BB70 /* Plot Gallery tvOS.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* Plot Gallery-Mac */ = { + isa = PBXGroup; + children = ( + 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */, + 4F22FF9812342D54006BF615 /* Shared */, + 080E96DDFE201D6D7F000001 /* Mac */, + C33821B11BC9A54100CF8FF6 /* iOS */, + C30D8B1C1BCAF9D10003BB70 /* tvOS */, + 4F22FF9912342D5F006BF615 /* Plots */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + indentWidth = 4; + name = "Plot Gallery-Mac"; + sourceTree = ""; + tabWidth = 4; + usesTabs = 0; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 4F22FF7B12342B5A006BF615 /* Plot_Gallery_Prefix.pch */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + C3EF42FC19FC75810060791A /* Images.xcassets */, + C3490DDA20E025760089F309 /* Icon.icns */, + C32D229C23B1086600043720 /* MainMenu.xib */, + C309C23323B3E12500DEDE9D /* PlotViewItem.xib */, + C3490DCD20E025660089F309 /* Plot_Gallery_Mac-Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + C30D8B421BCAFFCB0003BB70 /* UIKit.framework */, + C30D8B401BCAFFC10003BB70 /* Foundation.framework */, + C30D8B3E1BCAFFBB0003BB70 /* QuartzCore.framework */, + C30D8B3C1BCAFFB50003BB70 /* CoreGraphics.framework */, + C30D8B3A1BCAFFAE0003BB70 /* Accelerate.framework */, + C34CB5911BC9B21F009270A0 /* Mac */, + C34CB5921BC9B224009270A0 /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + 4F22FF9812342D54006BF615 /* Shared */ = { + isa = PBXGroup; + children = ( + C3D2FE6219FF1D03002CD4D6 /* Images.xcassets */, + 4F22FFAD12342DB1006BF615 /* PlotItem.h */, + 4F22FFAE12342DB1006BF615 /* PlotItem.m */, + 4F22FFAB12342DB1006BF615 /* PlotGallery.h */, + 4F22FFAC12342DB1006BF615 /* PlotGallery.m */, + C3457A4B17AD7C5D000880F3 /* PiNumberFormatter.h */, + C3457A4C17AD7C5D000880F3 /* PiNumberFormatter.m */, + C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */, + ); + name = Shared; + sourceTree = ""; + }; + 4F22FF9912342D5F006BF615 /* Plots */ = { + isa = PBXGroup; + children = ( + 4F8E1CC012908B0000D2035F /* AxisDemo.h */, + 4F8E1CC112908B0000D2035F /* AxisDemo.m */, + C360E1DE13B18CAE007994B6 /* CandlestickPlot.h */, + C360E1DF13B18CAE007994B6 /* CandlestickPlot.m */, + C3A31A5414DF782A00734AB7 /* ColoredBarChart.h */, + C3A31A5514DF782A00734AB7 /* ColoredBarChart.m */, + 4F22FF9A12342D7C006BF615 /* CompositePlot.h */, + 4F22FF9B12342D7C006BF615 /* CompositePlot.m */, + C35597941437E07800B41DA7 /* ControlChart.h */, + C35597951437E07800B41DA7 /* ControlChart.m */, + C3F42A2614D3A75F0044B323 /* CurvedScatterPlot.h */, + C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */, + E9595DFA1C9973B9004129DA /* CurvedInterpolationDemo.h */, + E9595DFB1C9973B9004129DA /* CurvedInterpolationDemo.m */, + 4F8E1C12129077C200D2035F /* DatePlot.h */, + 4F8E1C13129077C200D2035F /* DatePlot.m */, + C3F34F1312AB2598008FBDC3 /* DonutChart.h */, + C3F34F1412AB2598008FBDC3 /* DonutChart.m */, + C3F97F1717A9DE2000A52FF2 /* FunctionPlot.h */, + C3F97F1817A9DE2000A52FF2 /* FunctionPlot.m */, + 4F22FF9C12342D7C006BF615 /* GradientScatterPlot.h */, + 4F22FF9D12342D7C006BF615 /* GradientScatterPlot.m */, + C3D70BA4175EB29E00F27173 /* ImageDemo.h */, + C3D70BA5175EB29E00F27173 /* ImageDemo.m */, + C39C4E3F13BFE1A900CD9194 /* LabelingPolicyDemo.h */, + C39C4E4013BFE1A900CD9194 /* LabelingPolicyDemo.m */, + C367249113E103910070F47A /* LineCapDemo.h */, + C367249213E103910070F47A /* LineCapDemo.m */, + C360E1C413B18AAF007994B6 /* OHLCPlot.h */, + C360E1C513B18AAF007994B6 /* OHLCPlot.m */, + C39C4E4213BFE1B400CD9194 /* PlotSpaceDemo.h */, + C39C4E4313BFE1B400CD9194 /* PlotSpaceDemo.m */, + C3A14BEA13AEB7E700D103EA /* RangePlot.h */, + C3A14BEB13AEB7E700D103EA /* RangePlot.m */, + C354C0D513C7CDBE00DA8822 /* RealTimePlot.h */, + C354C0D613C7CDBE00DA8822 /* RealTimePlot.m */, + 4F8E1C84129083B000D2035F /* SteppedScatterPlot.h */, + 4F8E1C85129083B000D2035F /* SteppedScatterPlot.m */, + 4F22FF9E12342D7C006BF615 /* SimplePieChart.h */, + 4F22FF9F12342D7C006BF615 /* SimplePieChart.m */, + 4F22FFA012342D7C006BF615 /* SimpleScatterPlot.h */, + 4F22FFA112342D7C006BF615 /* SimpleScatterPlot.m */, + 4F22FFA212342D7C006BF615 /* VerticalBarChart.h */, + 4F22FFA312342D7C006BF615 /* VerticalBarChart.m */, + ); + name = Plots; + sourceTree = ""; + }; + 4F4892831290FFCD00EDB93F /* Products */ = { + isa = PBXGroup; + children = ( + 4F4892891290FFCD00EDB93F /* CorePlot.framework */, + 4F48928B1290FFCD00EDB93F /* UnitTests.xctest */, + C3D4146F1A7D824700B6F5D6 /* CorePlot.framework */, + C3D414711A7D824700B6F5D6 /* UnitTests iOS.xctest */, + C3D414731A7D824700B6F5D6 /* libCorePlot-CocoaTouch.a */, + C3D414751A7D824700B6F5D6 /* CorePlot-CocoaTouchTests.xctest */, + C30D8B181BCAF99D0003BB70 /* CorePlot.framework */, + C30D8B1A1BCAF99D0003BB70 /* UnitTests tvOS.xctest */, + ); + name = Products; + sourceTree = ""; + }; + C30D8B1C1BCAF9D10003BB70 /* tvOS */ = { + isa = PBXGroup; + children = ( + C30D8B1D1BCAF9E80003BB70 /* Resources */, + C30D8AF91BCAF99D0003BB70 /* main.m */, + C30D8AFB1BCAF99D0003BB70 /* AppDelegateTV.h */, + C30D8AFC1BCAF99D0003BB70 /* AppDelegateTV.m */, + C3B9C2691BCB237000BD560B /* DetailViewControllerTV.h */, + C3B9C26A1BCB237000BD560B /* DetailViewControllerTV.m */, + C3B9C26B1BCB237000BD560B /* RootViewControllerTV.h */, + C3B9C26C1BCB237000BD560B /* RootViewControllerTV.m */, + C3B9C26D1BCB237000BD560B /* ThemeTableViewControllerTV.h */, + C3B9C26E1BCB237000BD560B /* ThemeTableViewControllerTV.m */, + ); + name = tvOS; + sourceTree = ""; + }; + C30D8B1D1BCAF9E80003BB70 /* Resources */ = { + isa = PBXGroup; + children = ( + C30D8B071BCAF99D0003BB70 /* Assets.xcassets */, + C3490DE020E026410089F309 /* Plot_Gallery_tvOS-Info.plist */, + C3D0A1CA20E018DE00BA2921 /* Main.storyboard */, + ); + name = Resources; + sourceTree = ""; + }; + C33821B11BC9A54100CF8FF6 /* iOS */ = { + isa = PBXGroup; + children = ( + C34CB55C1BC9A8B3009270A0 /* Resources */, + C34CB5471BC9A889009270A0 /* AppDelegate.h */, + C34CB5481BC9A889009270A0 /* AppDelegate.m */, + C34CB5491BC9A889009270A0 /* DetailViewController.h */, + C34CB54A1BC9A889009270A0 /* DetailViewController.m */, + C34CB54C1BC9A889009270A0 /* main.m */, + C34CB5501BC9A889009270A0 /* RootViewController.h */, + C34CB5511BC9A889009270A0 /* RootViewController.m */, + C34CB5521BC9A889009270A0 /* ThemeTableViewController.h */, + C34CB5531BC9A889009270A0 /* ThemeTableViewController.m */, + ); + name = iOS; + sourceTree = ""; + }; + C34CB55C1BC9A8B3009270A0 /* Resources */ = { + isa = PBXGroup; + children = ( + C34CB5451BC9A83C009270A0 /* Images.xcassets */, + C3490DDC20E025B60089F309 /* Plot_Gallery_iOS-Info.plist */, + C3D0A1B920E0187600BA2921 /* Main.storyboard */, + C3D0A1C620E0188800BA2921 /* Launch Screen.xib */, + ); + name = Resources; + sourceTree = ""; + }; + C34CB5911BC9B21F009270A0 /* Mac */ = { + isa = PBXGroup; + children = ( + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, + 4F22FFE7123431D2006BF615 /* Quartz.framework */, + 29B97324FDCFA39411CA2CEA /* AppKit.framework */, + 29B97325FDCFA39411CA2CEA /* Foundation.framework */, + ); + name = Mac; + sourceTree = ""; + }; + C34CB5921BC9B224009270A0 /* iOS */ = { + isa = PBXGroup; + children = ( + C34CB5671BC9AB9E009270A0 /* Accelerate.framework */, + C34CB5651BC9AB93009270A0 /* QuartzCore.framework */, + C34CB5631BC9AB8C009270A0 /* CoreGraphics.framework */, + C34CB5611BC9AB85009270A0 /* UIKit.framework */, + C34CB55F1BC9AB7B009270A0 /* Foundation.framework */, + ); + name = iOS; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8D1107260486CEB800E47090 /* Plot Gallery-Mac */ = { + isa = PBXNativeTarget; + buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Plot Gallery-Mac" */; + buildPhases = ( + 8D1107290486CEB800E47090 /* Resources */, + 8D11072C0486CEB800E47090 /* Sources */, + 8D11072E0486CEB800E47090 /* Frameworks */, + 4F22FFDB12343172006BF615 /* Copy Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 4F4892931290FFED00EDB93F /* PBXTargetDependency */, + ); + name = "Plot Gallery-Mac"; + productInstallPath = "$(HOME)/Applications"; + productName = "Plot Gallery-Mac"; + productReference = 8D1107320486CEB800E47090 /* Plot Gallery.app */; + productType = "com.apple.product-type.application"; + }; + C30D8AF51BCAF99D0003BB70 /* Plot Gallery tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = C30D8B1B1BCAF99D0003BB70 /* Build configuration list for PBXNativeTarget "Plot Gallery tvOS" */; + buildPhases = ( + C30D8AF21BCAF99D0003BB70 /* Sources */, + C30D8AF31BCAF99D0003BB70 /* Frameworks */, + C30D8AF41BCAF99D0003BB70 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C30D8B1F1BCAFC080003BB70 /* PBXTargetDependency */, + ); + name = "Plot Gallery tvOS"; + productName = "Plot Gallery tvOS"; + productReference = C30D8AF61BCAF99D0003BB70 /* Plot Gallery tvOS.app */; + productType = "com.apple.product-type.application"; + }; + C34CB52D1BC9A76A009270A0 /* Plot Gallery-iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = C34CB5421BC9A76A009270A0 /* Build configuration list for PBXNativeTarget "Plot Gallery-iOS" */; + buildPhases = ( + C34CB52A1BC9A76A009270A0 /* Sources */, + C34CB52B1BC9A76A009270A0 /* Frameworks */, + C34CB52C1BC9A76A009270A0 /* Resources */, + C30B12471BCADD310084C567 /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + C34CB57A1BC9B0D4009270A0 /* PBXTargetDependency */, + C30B12461BCADD300084C567 /* PBXTargetDependency */, + ); + name = "Plot Gallery-iOS"; + productName = "Plot Gallery-iOS"; + productReference = C34CB52E1BC9A76A009270A0 /* Plot Gallery-iOS.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1100; + TargetAttributes = { + C30D8AF51BCAF99D0003BB70 = { + CreatedOnToolsVersion = 7.1; + DevelopmentTeam = 28ZA45DE7D; + }; + C34CB52D1BC9A76A009270A0 = { + CreatedOnToolsVersion = 7.0.1; + DevelopmentTeam = 28ZA45DE7D; + }; + }; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Plot_Gallery" */; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = en; + hasScannedForEncodings = 1; + knownRegions = ( + Base, + en, + fr, + ja, + de, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* Plot Gallery-Mac */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 4F4892831290FFCD00EDB93F /* Products */; + ProjectRef = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 8D1107260486CEB800E47090 /* Plot Gallery-Mac */, + C34CB52D1BC9A76A009270A0 /* Plot Gallery-iOS */, + C30D8AF51BCAF99D0003BB70 /* Plot Gallery tvOS */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXReferenceProxy section */ + 4F4892891290FFCD00EDB93F /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = 4F4892881290FFCD00EDB93F /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 4F48928B1290FFCD00EDB93F /* UnitTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = UnitTests.xctest; + remoteRef = 4F48928A1290FFCD00EDB93F /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C30D8B181BCAF99D0003BB70 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C30D8B171BCAF99D0003BB70 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C30D8B1A1BCAF99D0003BB70 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C30D8B191BCAF99D0003BB70 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D4146F1A7D824700B6F5D6 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3D4146E1A7D824700B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414711A7D824700B6F5D6 /* UnitTests iOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests iOS.xctest"; + remoteRef = C3D414701A7D824700B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414731A7D824700B6F5D6 /* libCorePlot-CocoaTouch.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libCorePlot-CocoaTouch.a"; + remoteRef = C3D414721A7D824700B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3D414751A7D824700B6F5D6 /* CorePlot-CocoaTouchTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "CorePlot-CocoaTouchTests.xctest"; + remoteRef = C3D414741A7D824700B6F5D6 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + +/* Begin PBXResourcesBuildPhase section */ + 8D1107290486CEB800E47090 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C3D2FE6319FF1D03002CD4D6 /* Images.xcassets in Resources */, + C32D229E23B1086600043720 /* MainMenu.xib in Resources */, + C3EF42FD19FC75810060791A /* Images.xcassets in Resources */, + C3490DD820E025760089F309 /* Icon.icns in Resources */, + C309C23423B3E12500DEDE9D /* PlotViewItem.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C30D8AF41BCAF99D0003BB70 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C30D8B211BCAFD3E0003BB70 /* Images.xcassets in Resources */, + C30D8B081BCAF99D0003BB70 /* Assets.xcassets in Resources */, + C3D0A1C820E018DE00BA2921 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C34CB52C1BC9A76A009270A0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C34CB5461BC9A83C009270A0 /* Images.xcassets in Resources */, + C367EEE21BCAEA9E00A21FE7 /* Images.xcassets in Resources */, + C3D0A1B720E0187600BA2921 /* Main.storyboard in Resources */, + C3D0A1C420E0188800BA2921 /* Launch Screen.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8D11072C0486CEB800E47090 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C309C23623B3E21500DEDE9D /* PlotViewItem.m in Sources */, + 4F22FF4912342978006BF615 /* main.m in Sources */, + 4F22FF4C1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m in Sources */, + 4F22FFA412342D7C006BF615 /* CompositePlot.m in Sources */, + 4F22FFA512342D7C006BF615 /* GradientScatterPlot.m in Sources */, + 4F22FFA612342D7C006BF615 /* SimplePieChart.m in Sources */, + 4F22FFA712342D7C006BF615 /* SimpleScatterPlot.m in Sources */, + 4F22FFA812342D7C006BF615 /* VerticalBarChart.m in Sources */, + 4F22FFAF12342DB1006BF615 /* PlotGallery.m in Sources */, + 4F22FFB012342DB1006BF615 /* PlotItem.m in Sources */, + 4F35EBF7123611E3007C3389 /* PlotGalleryController.m in Sources */, + 4F35EBF8123611E3007C3389 /* PlotView.m in Sources */, + 4F8E1C14129077C200D2035F /* DatePlot.m in Sources */, + 4F8E1C86129083B000D2035F /* SteppedScatterPlot.m in Sources */, + 4F8E1CC212908B0000D2035F /* AxisDemo.m in Sources */, + C3F34F1512AB2598008FBDC3 /* DonutChart.m in Sources */, + C3A14BEC13AEB7E700D103EA /* RangePlot.m in Sources */, + C360E1C613B18AAF007994B6 /* OHLCPlot.m in Sources */, + C360E1E013B18CAF007994B6 /* CandlestickPlot.m in Sources */, + C39C4E4113BFE1A900CD9194 /* LabelingPolicyDemo.m in Sources */, + C39C4E4413BFE1B400CD9194 /* PlotSpaceDemo.m in Sources */, + C354C0D713C7CDBE00DA8822 /* RealTimePlot.m in Sources */, + E9595DFC1C9973B9004129DA /* CurvedInterpolationDemo.m in Sources */, + C367249313E103910070F47A /* LineCapDemo.m in Sources */, + C35597961437E07800B41DA7 /* ControlChart.m in Sources */, + C3A31A5614DF782A00734AB7 /* ColoredBarChart.m in Sources */, + C3AC1410150EDE5C00631001 /* CurvedScatterPlot.m in Sources */, + C3F97F1917A9DE2000A52FF2 /* FunctionPlot.m in Sources */, + C3D70BA6175EB29E00F27173 /* ImageDemo.m in Sources */, + C3457A4D17AD7C5D000880F3 /* PiNumberFormatter.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C30D8AF21BCAF99D0003BB70 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C3F6216C1C9F365100301061 /* CurvedInterpolationDemo.m in Sources */, + C30D8B301BCAFDE20003BB70 /* LabelingPolicyDemo.m in Sources */, + C30D8B291BCAFDE20003BB70 /* ControlChart.m in Sources */, + C30D8B2B1BCAFDE20003BB70 /* DatePlot.m in Sources */, + C30D8B2E1BCAFDE20003BB70 /* GradientScatterPlot.m in Sources */, + C30D8B2F1BCAFDE20003BB70 /* ImageDemo.m in Sources */, + C30D8B261BCAFDE20003BB70 /* CandlestickPlot.m in Sources */, + C30D8B361BCAFDE20003BB70 /* SteppedScatterPlot.m in Sources */, + C30D8AFD1BCAF99D0003BB70 /* AppDelegateTV.m in Sources */, + C30D8B391BCAFDE20003BB70 /* VerticalBarChart.m in Sources */, + C3B9C26F1BCB237000BD560B /* DetailViewControllerTV.m in Sources */, + C30D8B231BCAFD3E0003BB70 /* PlotGallery.m in Sources */, + C30D8B221BCAFD3E0003BB70 /* PlotItem.m in Sources */, + C30D8B351BCAFDE20003BB70 /* RealTimePlot.m in Sources */, + C30D8B2C1BCAFDE20003BB70 /* DonutChart.m in Sources */, + C30D8B281BCAFDE20003BB70 /* CompositePlot.m in Sources */, + C30D8B311BCAFDE20003BB70 /* LineCapDemo.m in Sources */, + C30D8AFA1BCAF99D0003BB70 /* main.m in Sources */, + C30D8B371BCAFDE20003BB70 /* SimplePieChart.m in Sources */, + C30D8B241BCAFD3E0003BB70 /* PiNumberFormatter.m in Sources */, + C30D8B331BCAFDE20003BB70 /* PlotSpaceDemo.m in Sources */, + C30D8B321BCAFDE20003BB70 /* OHLCPlot.m in Sources */, + C30D8B341BCAFDE20003BB70 /* RangePlot.m in Sources */, + C30D8B251BCAFDE20003BB70 /* AxisDemo.m in Sources */, + C30D8B271BCAFDE20003BB70 /* ColoredBarChart.m in Sources */, + C3B9C2711BCB237000BD560B /* ThemeTableViewControllerTV.m in Sources */, + C30D8B2D1BCAFDE20003BB70 /* FunctionPlot.m in Sources */, + C30D8B2A1BCAFDE20003BB70 /* CurvedScatterPlot.m in Sources */, + C30D8B381BCAFDE20003BB70 /* SimpleScatterPlot.m in Sources */, + C3B9C2701BCB237000BD560B /* RootViewControllerTV.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C34CB52A1BC9A76A009270A0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C34CB5551BC9A889009270A0 /* DetailViewController.m in Sources */, + C30B12481BCADE170084C567 /* PlotItem.m in Sources */, + C34CB5821BC9B1C1009270A0 /* DatePlot.m in Sources */, + C30B124A1BCADE170084C567 /* PiNumberFormatter.m in Sources */, + C34CB5871BC9B1C1009270A0 /* LabelingPolicyDemo.m in Sources */, + C34CB5801BC9B1C1009270A0 /* ControlChart.m in Sources */, + C34CB5831BC9B1C1009270A0 /* DonutChart.m in Sources */, + E9AB989C1C9A903700D23875 /* CurvedInterpolationDemo.m in Sources */, + C34CB5811BC9B1C1009270A0 /* CurvedScatterPlot.m in Sources */, + C34CB5861BC9B1C1009270A0 /* ImageDemo.m in Sources */, + C34CB5541BC9A889009270A0 /* AppDelegate.m in Sources */, + C34CB5881BC9B1C1009270A0 /* LineCapDemo.m in Sources */, + C34CB5901BC9B1C1009270A0 /* VerticalBarChart.m in Sources */, + C34CB58F1BC9B1C1009270A0 /* SimpleScatterPlot.m in Sources */, + C34CB57C1BC9B1C1009270A0 /* AxisDemo.m in Sources */, + C34CB58C1BC9B1C1009270A0 /* RealTimePlot.m in Sources */, + C34CB5891BC9B1C1009270A0 /* OHLCPlot.m in Sources */, + C30B12491BCADE170084C567 /* PlotGallery.m in Sources */, + C34CB55A1BC9A889009270A0 /* RootViewController.m in Sources */, + C34CB57F1BC9B1C1009270A0 /* CompositePlot.m in Sources */, + C34CB5851BC9B1C1009270A0 /* GradientScatterPlot.m in Sources */, + C34CB58D1BC9B1C1009270A0 /* SteppedScatterPlot.m in Sources */, + C34CB58A1BC9B1C1009270A0 /* PlotSpaceDemo.m in Sources */, + C34CB57D1BC9B1C1009270A0 /* CandlestickPlot.m in Sources */, + C34CB58B1BC9B1C1009270A0 /* RangePlot.m in Sources */, + C34CB58E1BC9B1C1009270A0 /* SimplePieChart.m in Sources */, + C34CB57E1BC9B1C1009270A0 /* ColoredBarChart.m in Sources */, + C34CB55B1BC9A889009270A0 /* ThemeTableViewController.m in Sources */, + C34CB5571BC9A889009270A0 /* main.m in Sources */, + C34CB5841BC9B1C1009270A0 /* FunctionPlot.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 4F4892931290FFED00EDB93F /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = CorePlot; + targetProxy = 4F4892921290FFED00EDB93F /* PBXContainerItemProxy */; + }; + C30B12461BCADD300084C567 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CorePlot iOS"; + targetProxy = C30B12451BCADD300084C567 /* PBXContainerItemProxy */; + }; + C30D8B1F1BCAFC080003BB70 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CorePlot tvOS"; + targetProxy = C30D8B1E1BCAFC080003BB70 /* PBXContainerItemProxy */; + }; + C34CB57A1BC9B0D4009270A0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "CorePlot iOS"; + targetProxy = C34CB5791BC9B0D4009270A0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + C32D229C23B1086600043720 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + C32D229D23B1086600043720 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; + C3490DCD20E025660089F309 /* Plot_Gallery_Mac-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C3490DCC20E025660089F309 /* Base */, + ); + name = "Plot_Gallery_Mac-Info.plist"; + sourceTree = ""; + }; + C3490DDA20E025760089F309 /* Icon.icns */ = { + isa = PBXVariantGroup; + children = ( + C3490DD920E025760089F309 /* Base */, + ); + name = Icon.icns; + path = src/mac; + sourceTree = ""; + }; + C3490DDC20E025B60089F309 /* Plot_Gallery_iOS-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C3490DDB20E025B60089F309 /* Base */, + ); + name = "Plot_Gallery_iOS-Info.plist"; + sourceTree = ""; + }; + C3490DE020E026410089F309 /* Plot_Gallery_tvOS-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C3490DDF20E026410089F309 /* Base */, + ); + name = "Plot_Gallery_tvOS-Info.plist"; + sourceTree = ""; + }; + C3D0A1B920E0187600BA2921 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1B820E0187600BA2921 /* Base */, + ); + name = Main.storyboard; + path = src/ios; + sourceTree = ""; + }; + C3D0A1C620E0188800BA2921 /* Launch Screen.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1C520E0188800BA2921 /* Base */, + ); + name = "Launch Screen.xib"; + path = src/ios; + sourceTree = ""; + }; + C3D0A1CA20E018DE00BA2921 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1C920E018DE00BA2921 /* Base */, + ); + name = Main.storyboard; + path = src/tvOS; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C01FCF4B08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_MODEL_TUNING = G5; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Plot_Gallery_Mac-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + OTHER_LDFLAGS = ( + "-ObjC", + "-all_load", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.Plot-Gallery-Mac"; + PRODUCT_NAME = "Plot Gallery"; + RUN_CLANG_STATIC_ANALYZER = YES; + SDKROOT = macosx; + VALID_ARCHS = "i386 x86_64"; + }; + name = Debug; + }; + C01FCF4C08A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_MODEL_TUNING = G5; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Plot_Gallery_Mac-Info.plist"; + INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.11; + OTHER_LDFLAGS = ( + "-ObjC", + "-all_load", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.Plot-Gallery-Mac"; + PRODUCT_NAME = "Plot Gallery"; + RUN_CLANG_STATIC_ANALYZER = YES; + SDKROOT = macosx; + VALID_ARCHS = "i386 x86_64"; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Plot_Gallery_Prefix.pch; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "-ObjC", + "-all_load", + ); + SYMROOT = "$(PROJECT_DIR)/../../build"; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = Plot_Gallery_Prefix.pch; + OTHER_LDFLAGS = ( + "-ObjC", + "-all_load", + ); + SYMROOT = "$(PROJECT_DIR)/../../build"; + }; + name = Release; + }; + C30D8B0A1BCAF99D0003BB70 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Plot_Gallery_tvOS-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.Plot-Gallery-tvOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.0; + }; + name = Debug; + }; + C30D8B0B1BCAF99D0003BB70 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image"; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Plot_Gallery_tvOS-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.Plot-Gallery-tvOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.0; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C34CB5431BC9A76A009270A0 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Plot_Gallery_iOS-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.Plot-Gallery-iOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C34CB5441BC9A76A009270A0 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Plot_Gallery_iOS-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.Plot-Gallery-iOS"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Plot Gallery-Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4B08A954540054247B /* Debug */, + C01FCF4C08A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Plot_Gallery" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C30D8B1B1BCAF99D0003BB70 /* Build configuration list for PBXNativeTarget "Plot Gallery tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C30D8B0A1BCAF99D0003BB70 /* Debug */, + C30D8B0B1BCAF99D0003BB70 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C34CB5421BC9A76A009270A0 /* Build configuration list for PBXNativeTarget "Plot Gallery-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C34CB5431BC9A76A009270A0 /* Debug */, + C34CB5441BC9A76A009270A0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/examples/CorePlotGallery/Plot_Gallery_Mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from examples/CorePlotGallery/Plot_Gallery_Mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to examples/CorePlotGallery/Plot_Gallery.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-Mac.xcscheme b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-Mac.xcscheme new file mode 100644 index 000000000..d03877413 --- /dev/null +++ b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-Mac.xcscheme @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-iOS.xcscheme b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-iOS.xcscheme new file mode 100644 index 000000000..a45febfc8 --- /dev/null +++ b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-iOS.xcscheme @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-tvOS.xcscheme b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-tvOS.xcscheme new file mode 100644 index 000000000..d0f30ca9a --- /dev/null +++ b/examples/CorePlotGallery/Plot_Gallery.xcodeproj/xcshareddata/xcschemes/Plot Gallery-tvOS.xcscheme @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CorePlotGallery/Plot_Gallery_Mac.xcodeproj/project.pbxproj b/examples/CorePlotGallery/Plot_Gallery_Mac.xcodeproj/project.pbxproj deleted file mode 100644 index 82f043a87..000000000 --- a/examples/CorePlotGallery/Plot_Gallery_Mac.xcodeproj/project.pbxproj +++ /dev/null @@ -1,604 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 4F22FF4912342978006BF615 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF4712342978006BF615 /* main.m */; }; - 4F22FF4C1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF4B1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m */; }; - 4F22FF5B12342A21006BF615 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4F22FF5712342A21006BF615 /* InfoPlist.strings */; }; - 4F22FF5C12342A21006BF615 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4F22FF5912342A21006BF615 /* MainMenu.xib */; }; - 4F22FFA412342D7C006BF615 /* CompositePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9B12342D7C006BF615 /* CompositePlot.m */; }; - 4F22FFA512342D7C006BF615 /* GradientScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9D12342D7C006BF615 /* GradientScatterPlot.m */; }; - 4F22FFA612342D7C006BF615 /* SimplePieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FF9F12342D7C006BF615 /* SimplePieChart.m */; }; - 4F22FFA712342D7C006BF615 /* SimpleScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA112342D7C006BF615 /* SimpleScatterPlot.m */; }; - 4F22FFA812342D7C006BF615 /* VerticalBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFA312342D7C006BF615 /* VerticalBarChart.m */; }; - 4F22FFAF12342DB1006BF615 /* PlotGallery.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAC12342DB1006BF615 /* PlotGallery.m */; }; - 4F22FFB012342DB1006BF615 /* PlotItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FFAE12342DB1006BF615 /* PlotItem.m */; }; - 4F22FFE8123431D2006BF615 /* Quartz.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F22FFE7123431D2006BF615 /* Quartz.framework */; }; - 4F35EBBD12360D89007C3389 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4F35EBBC12360D89007C3389 /* Icon.icns */; }; - 4F35EBF7123611E3007C3389 /* PlotGalleryController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F35EBF4123611E3007C3389 /* PlotGalleryController.m */; }; - 4F35EBF8123611E3007C3389 /* PlotView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F35EBF6123611E3007C3389 /* PlotView.m */; }; - 4F8E1C14129077C200D2035F /* DatePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C13129077C200D2035F /* DatePlot.m */; }; - 4F8E1C86129083B000D2035F /* SteppedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C85129083B000D2035F /* SteppedScatterPlot.m */; }; - 4F8E1CC212908B0000D2035F /* AxisDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1CC112908B0000D2035F /* AxisDemo.m */; }; - 4FABDD421291110D003A2DB7 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F4892891290FFCD00EDB93F /* CorePlot.framework */; }; - 4FABDD4612911127003A2DB7 /* CorePlot.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 4F4892891290FFCD00EDB93F /* CorePlot.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - C3457A4D17AD7C5D000880F3 /* PiNumberFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C3457A4C17AD7C5D000880F3 /* PiNumberFormatter.m */; }; - C354C0D713C7CDBE00DA8822 /* RealTimePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C354C0D613C7CDBE00DA8822 /* RealTimePlot.m */; }; - C35597961437E07800B41DA7 /* ControlChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C35597951437E07800B41DA7 /* ControlChart.m */; }; - C360E1C613B18AAF007994B6 /* OHLCPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1C513B18AAF007994B6 /* OHLCPlot.m */; }; - C360E1E013B18CAF007994B6 /* CandlestickPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1DF13B18CAE007994B6 /* CandlestickPlot.m */; }; - C367249313E103910070F47A /* LineCapDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C367249213E103910070F47A /* LineCapDemo.m */; }; - C39C4E4113BFE1A900CD9194 /* LabelingPolicyDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4013BFE1A900CD9194 /* LabelingPolicyDemo.m */; }; - C39C4E4413BFE1B400CD9194 /* PlotSpaceDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E4313BFE1B400CD9194 /* PlotSpaceDemo.m */; }; - C3A14BEC13AEB7E700D103EA /* RangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A14BEB13AEB7E700D103EA /* RangePlot.m */; }; - C3A31A5614DF782A00734AB7 /* ColoredBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A31A5514DF782A00734AB7 /* ColoredBarChart.m */; }; - C3AC1410150EDE5C00631001 /* CurvedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */; }; - C3D2FE6319FF1D03002CD4D6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D2FE6219FF1D03002CD4D6 /* Images.xcassets */; }; - C3D70BA6175EB29E00F27173 /* ImageDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D70BA5175EB29E00F27173 /* ImageDemo.m */; }; - C3EF42FD19FC75810060791A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3EF42FC19FC75810060791A /* Images.xcassets */; }; - C3F34F1512AB2598008FBDC3 /* DonutChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F34F1412AB2598008FBDC3 /* DonutChart.m */; }; - C3F97F1917A9DE2000A52FF2 /* FunctionPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F97F1817A9DE2000A52FF2 /* FunctionPlot.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 4F4892881290FFCD00EDB93F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 8DC2EF5B0486A6940098B216; - remoteInfo = CorePlot; - }; - 4F48928A1290FFCD00EDB93F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 0730F600109492D800E95162; - remoteInfo = UnitTests; - }; - 4F4892921290FFED00EDB93F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 8DC2EF4F0486A6940098B216; - remoteInfo = CorePlot; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 4F22FFDB12343172006BF615 /* Copy Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 4FABDD4612911127003A2DB7 /* CorePlot.framework in Copy Frameworks */, - ); - name = "Copy Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; - 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 4F22FF4712342978006BF615 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/mac/main.m; sourceTree = ""; }; - 4F22FF4A1234298E006BF615 /* Plot_Gallery_MacAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Plot_Gallery_MacAppDelegate.h; path = src/mac/Plot_Gallery_MacAppDelegate.h; sourceTree = ""; }; - 4F22FF4B1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Plot_Gallery_MacAppDelegate.m; path = src/mac/Plot_Gallery_MacAppDelegate.m; sourceTree = ""; }; - 4F22FF5812342A21006BF615 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = InfoPlist.strings; sourceTree = ""; }; - 4F22FF5A12342A21006BF615 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = MainMenu.xib; sourceTree = ""; }; - 4F22FF7B12342B5A006BF615 /* Plot_Gallery_Mac_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Plot_Gallery_Mac_Prefix.pch; sourceTree = ""; }; - 4F22FF7C12342B6E006BF615 /* Plot_Gallery_Mac-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Plot_Gallery_Mac-Info.plist"; sourceTree = ""; }; - 4F22FF9A12342D7C006BF615 /* CompositePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = CompositePlot.h; path = src/plots/CompositePlot.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 4F22FF9B12342D7C006BF615 /* CompositePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CompositePlot.m; path = src/plots/CompositePlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 4F22FF9C12342D7C006BF615 /* GradientScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GradientScatterPlot.h; path = src/plots/GradientScatterPlot.h; sourceTree = ""; }; - 4F22FF9D12342D7C006BF615 /* GradientScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = GradientScatterPlot.m; path = src/plots/GradientScatterPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 4F22FF9E12342D7C006BF615 /* SimplePieChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SimplePieChart.h; path = src/plots/SimplePieChart.h; sourceTree = ""; }; - 4F22FF9F12342D7C006BF615 /* SimplePieChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SimplePieChart.m; path = src/plots/SimplePieChart.m; sourceTree = ""; }; - 4F22FFA012342D7C006BF615 /* SimpleScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SimpleScatterPlot.h; path = src/plots/SimpleScatterPlot.h; sourceTree = ""; }; - 4F22FFA112342D7C006BF615 /* SimpleScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SimpleScatterPlot.m; path = src/plots/SimpleScatterPlot.m; sourceTree = ""; }; - 4F22FFA212342D7C006BF615 /* VerticalBarChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VerticalBarChart.h; path = src/plots/VerticalBarChart.h; sourceTree = ""; }; - 4F22FFA312342D7C006BF615 /* VerticalBarChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VerticalBarChart.m; path = src/plots/VerticalBarChart.m; sourceTree = ""; }; - 4F22FFAB12342DB1006BF615 /* PlotGallery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotGallery.h; path = src/shared/PlotGallery.h; sourceTree = ""; }; - 4F22FFAC12342DB1006BF615 /* PlotGallery.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotGallery.m; path = src/shared/PlotGallery.m; sourceTree = ""; }; - 4F22FFAD12342DB1006BF615 /* PlotItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotItem.h; path = src/shared/PlotItem.h; sourceTree = ""; }; - 4F22FFAE12342DB1006BF615 /* PlotItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotItem.m; path = src/shared/PlotItem.m; sourceTree = ""; }; - 4F22FFE7123431D2006BF615 /* Quartz.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Quartz.framework; path = System/Library/Frameworks/Quartz.framework; sourceTree = SDKROOT; }; - 4F35EBBC12360D89007C3389 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = Icon.icns; path = src/mac/Icon.icns; sourceTree = ""; }; - 4F35EBF3123611E3007C3389 /* PlotGalleryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotGalleryController.h; path = src/mac/PlotGalleryController.h; sourceTree = ""; }; - 4F35EBF4123611E3007C3389 /* PlotGalleryController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotGalleryController.m; path = src/mac/PlotGalleryController.m; sourceTree = ""; }; - 4F35EBF5123611E3007C3389 /* PlotView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotView.h; path = src/mac/PlotView.h; sourceTree = ""; }; - 4F35EBF6123611E3007C3389 /* PlotView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotView.m; path = src/mac/PlotView.m; sourceTree = ""; }; - 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../../framework/CorePlot.xcodeproj; sourceTree = SOURCE_ROOT; }; - 4F8E1C12129077C200D2035F /* DatePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DatePlot.h; path = src/plots/DatePlot.h; sourceTree = ""; }; - 4F8E1C13129077C200D2035F /* DatePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = DatePlot.m; path = src/plots/DatePlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 4F8E1C84129083B000D2035F /* SteppedScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SteppedScatterPlot.h; path = src/plots/SteppedScatterPlot.h; sourceTree = ""; }; - 4F8E1C85129083B000D2035F /* SteppedScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SteppedScatterPlot.m; path = src/plots/SteppedScatterPlot.m; sourceTree = ""; }; - 4F8E1CC012908B0000D2035F /* AxisDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AxisDemo.h; path = src/plots/AxisDemo.h; sourceTree = ""; }; - 4F8E1CC112908B0000D2035F /* AxisDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = AxisDemo.m; path = src/plots/AxisDemo.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 8D1107320486CEB800E47090 /* Plot Gallery.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Plot Gallery.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - C3457A4B17AD7C5D000880F3 /* PiNumberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PiNumberFormatter.h; path = src/shared/PiNumberFormatter.h; sourceTree = ""; }; - C3457A4C17AD7C5D000880F3 /* PiNumberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PiNumberFormatter.m; path = src/shared/PiNumberFormatter.m; sourceTree = ""; }; - C354C0D513C7CDBE00DA8822 /* RealTimePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RealTimePlot.h; path = src/plots/RealTimePlot.h; sourceTree = ""; }; - C354C0D613C7CDBE00DA8822 /* RealTimePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RealTimePlot.m; path = src/plots/RealTimePlot.m; sourceTree = ""; }; - C35597941437E07800B41DA7 /* ControlChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ControlChart.h; path = src/plots/ControlChart.h; sourceTree = ""; }; - C35597951437E07800B41DA7 /* ControlChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ControlChart.m; path = src/plots/ControlChart.m; sourceTree = ""; }; - C360E1C413B18AAF007994B6 /* OHLCPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OHLCPlot.h; path = src/plots/OHLCPlot.h; sourceTree = ""; }; - C360E1C513B18AAF007994B6 /* OHLCPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OHLCPlot.m; path = src/plots/OHLCPlot.m; sourceTree = ""; }; - C360E1DE13B18CAE007994B6 /* CandlestickPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CandlestickPlot.h; path = src/plots/CandlestickPlot.h; sourceTree = ""; }; - C360E1DF13B18CAE007994B6 /* CandlestickPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CandlestickPlot.m; path = src/plots/CandlestickPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C367249113E103910070F47A /* LineCapDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LineCapDemo.h; path = src/plots/LineCapDemo.h; sourceTree = ""; }; - C367249213E103910070F47A /* LineCapDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LineCapDemo.m; path = src/plots/LineCapDemo.m; sourceTree = ""; }; - C39C4E3F13BFE1A900CD9194 /* LabelingPolicyDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LabelingPolicyDemo.h; path = src/plots/LabelingPolicyDemo.h; sourceTree = ""; }; - C39C4E4013BFE1A900CD9194 /* LabelingPolicyDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = LabelingPolicyDemo.m; path = src/plots/LabelingPolicyDemo.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C39C4E4213BFE1B400CD9194 /* PlotSpaceDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotSpaceDemo.h; path = src/plots/PlotSpaceDemo.h; sourceTree = ""; }; - C39C4E4313BFE1B400CD9194 /* PlotSpaceDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotSpaceDemo.m; path = src/plots/PlotSpaceDemo.m; sourceTree = ""; }; - C3A14BEA13AEB7E700D103EA /* RangePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RangePlot.h; path = src/plots/RangePlot.h; sourceTree = ""; }; - C3A14BEB13AEB7E700D103EA /* RangePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RangePlot.m; path = src/plots/RangePlot.m; sourceTree = ""; }; - C3A31A5414DF782A00734AB7 /* ColoredBarChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ColoredBarChart.h; path = src/plots/ColoredBarChart.h; sourceTree = ""; }; - C3A31A5514DF782A00734AB7 /* ColoredBarChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = ColoredBarChart.m; path = src/plots/ColoredBarChart.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/CorePlotWarnings.xcconfig; sourceTree = ""; }; - C3D2FE6219FF1D03002CD4D6 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = img/Images.xcassets; sourceTree = ""; }; - C3D70BA4175EB29E00F27173 /* ImageDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImageDemo.h; path = src/plots/ImageDemo.h; sourceTree = ""; }; - C3D70BA5175EB29E00F27173 /* ImageDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = ImageDemo.m; path = src/plots/ImageDemo.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C3EF42FC19FC75810060791A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "Plot Gallery-Mac/Images.xcassets"; sourceTree = ""; }; - C3F34F1312AB2598008FBDC3 /* DonutChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DonutChart.h; path = src/plots/DonutChart.h; sourceTree = ""; }; - C3F34F1412AB2598008FBDC3 /* DonutChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = DonutChart.m; path = src/plots/DonutChart.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C3F42A2614D3A75F0044B323 /* CurvedScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CurvedScatterPlot.h; path = src/plots/CurvedScatterPlot.h; sourceTree = ""; }; - C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 2; name = CurvedScatterPlot.m; path = src/plots/CurvedScatterPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C3F97F1717A9DE2000A52FF2 /* FunctionPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FunctionPlot.h; path = src/plots/FunctionPlot.h; sourceTree = ""; }; - C3F97F1817A9DE2000A52FF2 /* FunctionPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = FunctionPlot.m; path = src/plots/FunctionPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 8D11072E0486CEB800E47090 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4FABDD421291110D003A2DB7 /* CorePlot.framework in Frameworks */, - 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - 4F22FFE8123431D2006BF615 /* Quartz.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Mac */ = { - isa = PBXGroup; - children = ( - 4F35EBF3123611E3007C3389 /* PlotGalleryController.h */, - 4F35EBF4123611E3007C3389 /* PlotGalleryController.m */, - 4F35EBF5123611E3007C3389 /* PlotView.h */, - 4F35EBF6123611E3007C3389 /* PlotView.m */, - 4F22FF4712342978006BF615 /* main.m */, - 4F22FF4A1234298E006BF615 /* Plot_Gallery_MacAppDelegate.h */, - 4F22FF4B1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m */, - ); - name = Mac; - sourceTree = ""; - }; - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - 4F22FFE7123431D2006BF615 /* Quartz.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 29B97324FDCFA39411CA2CEA /* AppKit.framework */, - 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, - 29B97325FDCFA39411CA2CEA /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 8D1107320486CEB800E47090 /* Plot Gallery.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* Plot Gallery-Mac */ = { - isa = PBXGroup; - children = ( - 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */, - 4F22FF9812342D54006BF615 /* Shared */, - 080E96DDFE201D6D7F000001 /* Mac */, - 4F22FF9912342D5F006BF615 /* Plots */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - indentWidth = 4; - name = "Plot Gallery-Mac"; - sourceTree = ""; - tabWidth = 4; - usesTabs = 0; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 4F22FF7B12342B5A006BF615 /* Plot_Gallery_Mac_Prefix.pch */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - C3EF42FC19FC75810060791A /* Images.xcassets */, - 4F35EBBC12360D89007C3389 /* Icon.icns */, - 4F22FF7C12342B6E006BF615 /* Plot_Gallery_Mac-Info.plist */, - 4F22FF5912342A21006BF615 /* MainMenu.xib */, - 4F22FF5712342A21006BF615 /* InfoPlist.strings */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, - 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; - 4F22FF9812342D54006BF615 /* Shared */ = { - isa = PBXGroup; - children = ( - C3D2FE6219FF1D03002CD4D6 /* Images.xcassets */, - 4F22FFAD12342DB1006BF615 /* PlotItem.h */, - 4F22FFAE12342DB1006BF615 /* PlotItem.m */, - 4F22FFAB12342DB1006BF615 /* PlotGallery.h */, - 4F22FFAC12342DB1006BF615 /* PlotGallery.m */, - C3457A4B17AD7C5D000880F3 /* PiNumberFormatter.h */, - C3457A4C17AD7C5D000880F3 /* PiNumberFormatter.m */, - C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */, - ); - name = Shared; - sourceTree = ""; - }; - 4F22FF9912342D5F006BF615 /* Plots */ = { - isa = PBXGroup; - children = ( - 4F8E1CC012908B0000D2035F /* AxisDemo.h */, - 4F8E1CC112908B0000D2035F /* AxisDemo.m */, - C360E1DE13B18CAE007994B6 /* CandlestickPlot.h */, - C360E1DF13B18CAE007994B6 /* CandlestickPlot.m */, - C3A31A5414DF782A00734AB7 /* ColoredBarChart.h */, - C3A31A5514DF782A00734AB7 /* ColoredBarChart.m */, - 4F22FF9A12342D7C006BF615 /* CompositePlot.h */, - 4F22FF9B12342D7C006BF615 /* CompositePlot.m */, - C35597941437E07800B41DA7 /* ControlChart.h */, - C35597951437E07800B41DA7 /* ControlChart.m */, - C3F42A2614D3A75F0044B323 /* CurvedScatterPlot.h */, - C3F42A2714D3A75F0044B323 /* CurvedScatterPlot.m */, - 4F8E1C12129077C200D2035F /* DatePlot.h */, - 4F8E1C13129077C200D2035F /* DatePlot.m */, - C3F34F1312AB2598008FBDC3 /* DonutChart.h */, - C3F34F1412AB2598008FBDC3 /* DonutChart.m */, - C3F97F1717A9DE2000A52FF2 /* FunctionPlot.h */, - C3F97F1817A9DE2000A52FF2 /* FunctionPlot.m */, - 4F22FF9C12342D7C006BF615 /* GradientScatterPlot.h */, - 4F22FF9D12342D7C006BF615 /* GradientScatterPlot.m */, - C3D70BA4175EB29E00F27173 /* ImageDemo.h */, - C3D70BA5175EB29E00F27173 /* ImageDemo.m */, - C39C4E3F13BFE1A900CD9194 /* LabelingPolicyDemo.h */, - C39C4E4013BFE1A900CD9194 /* LabelingPolicyDemo.m */, - C367249113E103910070F47A /* LineCapDemo.h */, - C367249213E103910070F47A /* LineCapDemo.m */, - C360E1C413B18AAF007994B6 /* OHLCPlot.h */, - C360E1C513B18AAF007994B6 /* OHLCPlot.m */, - C39C4E4213BFE1B400CD9194 /* PlotSpaceDemo.h */, - C39C4E4313BFE1B400CD9194 /* PlotSpaceDemo.m */, - C3A14BEA13AEB7E700D103EA /* RangePlot.h */, - C3A14BEB13AEB7E700D103EA /* RangePlot.m */, - C354C0D513C7CDBE00DA8822 /* RealTimePlot.h */, - C354C0D613C7CDBE00DA8822 /* RealTimePlot.m */, - 4F8E1C84129083B000D2035F /* SteppedScatterPlot.h */, - 4F8E1C85129083B000D2035F /* SteppedScatterPlot.m */, - 4F22FF9E12342D7C006BF615 /* SimplePieChart.h */, - 4F22FF9F12342D7C006BF615 /* SimplePieChart.m */, - 4F22FFA012342D7C006BF615 /* SimpleScatterPlot.h */, - 4F22FFA112342D7C006BF615 /* SimpleScatterPlot.m */, - 4F22FFA212342D7C006BF615 /* VerticalBarChart.h */, - 4F22FFA312342D7C006BF615 /* VerticalBarChart.m */, - ); - name = Plots; - sourceTree = ""; - }; - 4F4892831290FFCD00EDB93F /* Products */ = { - isa = PBXGroup; - children = ( - 4F4892891290FFCD00EDB93F /* CorePlot.framework */, - 4F48928B1290FFCD00EDB93F /* UnitTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 8D1107260486CEB800E47090 /* Plot Gallery-Mac */ = { - isa = PBXNativeTarget; - buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Plot Gallery-Mac" */; - buildPhases = ( - 8D1107290486CEB800E47090 /* Resources */, - 8D11072C0486CEB800E47090 /* Sources */, - 8D11072E0486CEB800E47090 /* Frameworks */, - 4F22FFDB12343172006BF615 /* Copy Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 4F4892931290FFED00EDB93F /* PBXTargetDependency */, - ); - name = "Plot Gallery-Mac"; - productInstallPath = "$(HOME)/Applications"; - productName = "Plot Gallery-Mac"; - productReference = 8D1107320486CEB800E47090 /* Plot Gallery.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0700; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Plot_Gallery_Mac" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* Plot Gallery-Mac */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 4F4892831290FFCD00EDB93F /* Products */; - ProjectRef = 4F35EC1D1236AE6E007C3389 /* CorePlot.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 8D1107260486CEB800E47090 /* Plot Gallery-Mac */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 4F4892891290FFCD00EDB93F /* CorePlot.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = CorePlot.framework; - remoteRef = 4F4892881290FFCD00EDB93F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4F48928B1290FFCD00EDB93F /* UnitTests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = UnitTests.xctest; - remoteRef = 4F48928A1290FFCD00EDB93F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 8D1107290486CEB800E47090 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C3D2FE6319FF1D03002CD4D6 /* Images.xcassets in Resources */, - 4F22FF5B12342A21006BF615 /* InfoPlist.strings in Resources */, - C3EF42FD19FC75810060791A /* Images.xcassets in Resources */, - 4F22FF5C12342A21006BF615 /* MainMenu.xib in Resources */, - 4F35EBBD12360D89007C3389 /* Icon.icns in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 8D11072C0486CEB800E47090 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4F22FF4912342978006BF615 /* main.m in Sources */, - 4F22FF4C1234298E006BF615 /* Plot_Gallery_MacAppDelegate.m in Sources */, - 4F22FFA412342D7C006BF615 /* CompositePlot.m in Sources */, - 4F22FFA512342D7C006BF615 /* GradientScatterPlot.m in Sources */, - 4F22FFA612342D7C006BF615 /* SimplePieChart.m in Sources */, - 4F22FFA712342D7C006BF615 /* SimpleScatterPlot.m in Sources */, - 4F22FFA812342D7C006BF615 /* VerticalBarChart.m in Sources */, - 4F22FFAF12342DB1006BF615 /* PlotGallery.m in Sources */, - 4F22FFB012342DB1006BF615 /* PlotItem.m in Sources */, - 4F35EBF7123611E3007C3389 /* PlotGalleryController.m in Sources */, - 4F35EBF8123611E3007C3389 /* PlotView.m in Sources */, - 4F8E1C14129077C200D2035F /* DatePlot.m in Sources */, - 4F8E1C86129083B000D2035F /* SteppedScatterPlot.m in Sources */, - 4F8E1CC212908B0000D2035F /* AxisDemo.m in Sources */, - C3F34F1512AB2598008FBDC3 /* DonutChart.m in Sources */, - C3A14BEC13AEB7E700D103EA /* RangePlot.m in Sources */, - C360E1C613B18AAF007994B6 /* OHLCPlot.m in Sources */, - C360E1E013B18CAF007994B6 /* CandlestickPlot.m in Sources */, - C39C4E4113BFE1A900CD9194 /* LabelingPolicyDemo.m in Sources */, - C39C4E4413BFE1B400CD9194 /* PlotSpaceDemo.m in Sources */, - C354C0D713C7CDBE00DA8822 /* RealTimePlot.m in Sources */, - C367249313E103910070F47A /* LineCapDemo.m in Sources */, - C35597961437E07800B41DA7 /* ControlChart.m in Sources */, - C3A31A5614DF782A00734AB7 /* ColoredBarChart.m in Sources */, - C3AC1410150EDE5C00631001 /* CurvedScatterPlot.m in Sources */, - C3F97F1917A9DE2000A52FF2 /* FunctionPlot.m in Sources */, - C3D70BA6175EB29E00F27173 /* ImageDemo.m in Sources */, - C3457A4D17AD7C5D000880F3 /* PiNumberFormatter.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 4F4892931290FFED00EDB93F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = CorePlot; - targetProxy = 4F4892921290FFED00EDB93F /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 4F22FF5712342A21006BF615 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 4F22FF5812342A21006BF615 /* English */, - ); - name = InfoPlist.strings; - path = src/mac/English.lproj; - sourceTree = ""; - }; - 4F22FF5912342A21006BF615 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - 4F22FF5A12342A21006BF615 /* English */, - ); - name = MainMenu.xib; - path = src/mac/English.lproj; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C01FCF4B08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_OBJC_ARC = YES; - COMBINE_HIDPI_IMAGES = YES; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Plot_Gallery_Mac_Prefix.pch; - INFOPLIST_FILE = "Plot_Gallery_Mac-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - OTHER_LDFLAGS = ( - "-ObjC", - "-all_load", - ); - PRODUCT_BUNDLE_IDENTIFIER = org.CorePlot.PlotGallery; - PRODUCT_NAME = "Plot Gallery"; - RUN_CLANG_STATIC_ANALYZER = YES; - VALID_ARCHS = "i386 x86_64"; - }; - name = Debug; - }; - C01FCF4C08A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_OBJC_ARC = YES; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = s; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Plot_Gallery_Mac_Prefix.pch; - INFOPLIST_FILE = "Plot_Gallery_Mac-Info.plist"; - INSTALL_PATH = "$(HOME)/Applications"; - OTHER_LDFLAGS = ( - "-ObjC", - "-all_load", - ); - PRODUCT_BUNDLE_IDENTIFIER = org.CorePlot.PlotGallery; - PRODUCT_NAME = "Plot Gallery"; - RUN_CLANG_STATIC_ANALYZER = YES; - VALID_ARCHS = "i386 x86_64"; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; - buildSettings = { - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - MACOSX_DEPLOYMENT_TARGET = 10.7; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ( - "-ObjC", - "-all_load", - ); - SDKROOT = macosx; - SYMROOT = "$(PROJECT_DIR)/../../build"; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3C0DF2719D86B5E00631CAD /* CorePlotWarnings.xcconfig */; - buildSettings = { - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; - OTHER_LDFLAGS = ( - "-ObjC", - "-all_load", - ); - SDKROOT = macosx; - SYMROOT = "$(PROJECT_DIR)/../../build"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "Plot Gallery-Mac" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4B08A954540054247B /* Debug */, - C01FCF4C08A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Plot_Gallery_Mac" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/examples/CorePlotGallery/Plot_Gallery_Mac_Prefix.pch b/examples/CorePlotGallery/Plot_Gallery_Mac_Prefix.pch deleted file mode 100644 index 2f480edf1..000000000 --- a/examples/CorePlotGallery/Plot_Gallery_Mac_Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'Plot Gallery-Mac' target in the 'Plot Gallery-Mac' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/examples/CorePlotGallery/Plot_Gallery_Prefix.pch b/examples/CorePlotGallery/Plot_Gallery_Prefix.pch index 81f53cd17..e76705a48 100644 --- a/examples/CorePlotGallery/Plot_Gallery_Prefix.pch +++ b/examples/CorePlotGallery/Plot_Gallery_Prefix.pch @@ -1,9 +1,13 @@ // -// Prefix header for all source files of the 'Plot Gallery' target in the 'Plot Gallery' project +// Prefix header for all source files in the 'Plot Gallery' project // -#import - #ifdef __OBJC__ - #import - #import + #import + + #if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_TV + #import + #import + #else + #import + #endif #endif diff --git a/examples/CorePlotGallery/Plot_Gallery_iOS.xcodeproj/project.pbxproj b/examples/CorePlotGallery/Plot_Gallery_iOS.xcodeproj/project.pbxproj deleted file mode 100644 index 843454d95..000000000 --- a/examples/CorePlotGallery/Plot_Gallery_iOS.xcodeproj/project.pbxproj +++ /dev/null @@ -1,530 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */; }; - 4F22FE3A12340464006BF615 /* PlotGallery.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FE3712340464006BF615 /* PlotGallery.m */; }; - 4F22FE3B12340464006BF615 /* PlotItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FE3912340464006BF615 /* PlotItem.m */; }; - 4F22FE46123404C2006BF615 /* CompositePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FE3D123404C2006BF615 /* CompositePlot.m */; }; - 4F22FE47123404C2006BF615 /* GradientScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FE3F123404C2006BF615 /* GradientScatterPlot.m */; }; - 4F22FE48123404C2006BF615 /* SimplePieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FE41123404C2006BF615 /* SimplePieChart.m */; }; - 4F22FE49123404C2006BF615 /* SimpleScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FE43123404C2006BF615 /* SimpleScatterPlot.m */; }; - 4F22FE4A123404C2006BF615 /* VerticalBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FE45123404C2006BF615 /* VerticalBarChart.m */; }; - 4F22FE6712340671006BF615 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FE6612340671006BF615 /* main.m */; }; - 4F22FE7B123406DF006BF615 /* ThemeTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F22FE78123406DF006BF615 /* ThemeTableViewController.m */; }; - 4F4892581290FAD100EDB93F /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F4892451290F96500EDB93F /* libCorePlot-CocoaTouch.a */; }; - 4F5EBAC312297F2400D147E7 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F5EBAC212297F2400D147E7 /* QuartzCore.framework */; }; - 4F7541F3126B59A200313026 /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F7541EF126B59A200313026 /* DetailViewController.m */; }; - 4F8E1C6012907C1800D2035F /* DatePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C5F12907C1800D2035F /* DatePlot.m */; }; - 4F8E1CA0129089D600D2035F /* SteppedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F8E1C9F129089D600D2035F /* SteppedScatterPlot.m */; }; - C31A40BA17ABD6910020C5C6 /* FunctionPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C31A40B917ABD6910020C5C6 /* FunctionPlot.m */; }; - C32960CB1A101AEB0086D047 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C32960CA1A101AEB0086D047 /* AppDelegate.m */; }; - C3457A5317AD7C72000880F3 /* PiNumberFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C3457A5217AD7C72000880F3 /* PiNumberFormatter.m */; }; - C354C0D413C7CDA900DA8822 /* RealTimePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C354C0D313C7CDA900DA8822 /* RealTimePlot.m */; }; - C35597A21437E09300B41DA7 /* ControlChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C35597A11437E09300B41DA7 /* ControlChart.m */; }; - C360E1C913B18ABC007994B6 /* OHLCPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1C813B18ABC007994B6 /* OHLCPlot.m */; }; - C360E1DA13B18B24007994B6 /* AxisDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1D913B18B24007994B6 /* AxisDemo.m */; }; - C360E1EE13B18CCC007994B6 /* CandlestickPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C360E1ED13B18CCC007994B6 /* CandlestickPlot.m */; }; - C36157B919D790E10036ACDA /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C36157B819D790E10036ACDA /* Launch Screen.xib */; }; - C367249F13E103AC0070F47A /* LineCapDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C367249E13E103AC0070F47A /* LineCapDemo.m */; }; - C37995991A1912A400F7378C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C37995981A1912A400F7378C /* Main.storyboard */; }; - C3858C641A17A0E5004BC750 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C3858C631A17A0E5004BC750 /* RootViewController.m */; }; - C39C4E3B13BFE19200CD9194 /* PlotSpaceDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E3A13BFE19200CD9194 /* PlotSpaceDemo.m */; }; - C39C4E3E13BFE19E00CD9194 /* LabelingPolicyDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C39C4E3D13BFE19E00CD9194 /* LabelingPolicyDemo.m */; }; - C3A14C1513AEE7CC00D103EA /* RangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A14C1413AEE7CC00D103EA /* RangePlot.m */; }; - C3A31A5914DF783500734AB7 /* ColoredBarChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A31A5814DF783500734AB7 /* ColoredBarChart.m */; }; - C3AC1411150EDEF300631001 /* CurvedScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CBCB98914753D6F000C8951 /* CurvedScatterPlot.m */; }; - C3CD282A17DE9A7E008EED1E /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3CD282917DE9A7E008EED1E /* Accelerate.framework */; }; - C3D2FE6919FF1D3E002CD4D6 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D2FE6819FF1D3E002CD4D6 /* Images.xcassets */; }; - C3D70BAC175EB30800F27173 /* ImageDemo.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D70BAB175EB30800F27173 /* ImageDemo.m */; }; - C3EF42F919FC753E0060791A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3EF42F819FC753E0060791A /* Images.xcassets */; }; - C3F34F2A12AB25AE008FBDC3 /* DonutChart.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F34F2912AB25AE008FBDC3 /* DonutChart.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 4F4892441290F96500EDB93F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4F07461A1236B1CB0039593F /* CorePlot-CocoaTouch.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = BC9B83470FB8A0A40035D8DA; - remoteInfo = "CorePlot-CocoaTouch"; - }; - 4F4892561290FAB500EDB93F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4F07461A1236B1CB0039593F /* CorePlot-CocoaTouch.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = BC9B83460FB8A0A40035D8DA; - remoteInfo = "CorePlot-CocoaTouch"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1D6058910D05DD3D006BFB54 /* Plot Gallery.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Plot Gallery.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 28A0AAE50D9B0CCF005BE974 /* Plot_Gallery_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Plot_Gallery_Prefix.pch; sourceTree = ""; }; - 4CBCB98814753D6F000C8951 /* CurvedScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CurvedScatterPlot.h; path = src/plots/CurvedScatterPlot.h; sourceTree = ""; }; - 4CBCB98914753D6F000C8951 /* CurvedScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 2; name = CurvedScatterPlot.m; path = src/plots/CurvedScatterPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 4F07461A1236B1CB0039593F /* CorePlot-CocoaTouch.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "CorePlot-CocoaTouch.xcodeproj"; path = "../../framework/CorePlot-CocoaTouch.xcodeproj"; sourceTree = SOURCE_ROOT; }; - 4F22FE3612340464006BF615 /* PlotGallery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotGallery.h; path = src/shared/PlotGallery.h; sourceTree = ""; }; - 4F22FE3712340464006BF615 /* PlotGallery.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotGallery.m; path = src/shared/PlotGallery.m; sourceTree = ""; }; - 4F22FE3812340464006BF615 /* PlotItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotItem.h; path = src/shared/PlotItem.h; sourceTree = ""; }; - 4F22FE3912340464006BF615 /* PlotItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotItem.m; path = src/shared/PlotItem.m; sourceTree = ""; }; - 4F22FE3C123404C2006BF615 /* CompositePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = CompositePlot.h; path = src/plots/CompositePlot.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 4F22FE3D123404C2006BF615 /* CompositePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CompositePlot.m; path = src/plots/CompositePlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 4F22FE3E123404C2006BF615 /* GradientScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GradientScatterPlot.h; path = src/plots/GradientScatterPlot.h; sourceTree = ""; }; - 4F22FE3F123404C2006BF615 /* GradientScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = GradientScatterPlot.m; path = src/plots/GradientScatterPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 4F22FE40123404C2006BF615 /* SimplePieChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SimplePieChart.h; path = src/plots/SimplePieChart.h; sourceTree = ""; }; - 4F22FE41123404C2006BF615 /* SimplePieChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SimplePieChart.m; path = src/plots/SimplePieChart.m; sourceTree = ""; }; - 4F22FE42123404C2006BF615 /* SimpleScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SimpleScatterPlot.h; path = src/plots/SimpleScatterPlot.h; sourceTree = ""; }; - 4F22FE43123404C2006BF615 /* SimpleScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SimpleScatterPlot.m; path = src/plots/SimpleScatterPlot.m; sourceTree = ""; }; - 4F22FE44123404C2006BF615 /* VerticalBarChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VerticalBarChart.h; path = src/plots/VerticalBarChart.h; sourceTree = ""; }; - 4F22FE45123404C2006BF615 /* VerticalBarChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VerticalBarChart.m; path = src/plots/VerticalBarChart.m; sourceTree = ""; }; - 4F22FE6612340671006BF615 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = src/ios/main.m; sourceTree = ""; }; - 4F22FE77123406DF006BF615 /* ThemeTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThemeTableViewController.h; path = src/ios/ThemeTableViewController.h; sourceTree = ""; }; - 4F22FE78123406DF006BF615 /* ThemeTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ThemeTableViewController.m; path = src/ios/ThemeTableViewController.m; sourceTree = ""; }; - 4F5EBAC212297F2400D147E7 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 4F7541EE126B59A200313026 /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DetailViewController.h; path = src/ios/DetailViewController.h; sourceTree = ""; }; - 4F7541EF126B59A200313026 /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = DetailViewController.m; path = src/ios/DetailViewController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 4F8E1C5E12907C1800D2035F /* DatePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DatePlot.h; path = src/plots/DatePlot.h; sourceTree = ""; }; - 4F8E1C5F12907C1800D2035F /* DatePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = DatePlot.m; path = src/plots/DatePlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 4F8E1C9E129089D600D2035F /* SteppedScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SteppedScatterPlot.h; path = src/plots/SteppedScatterPlot.h; sourceTree = ""; }; - 4F8E1C9F129089D600D2035F /* SteppedScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SteppedScatterPlot.m; path = src/plots/SteppedScatterPlot.m; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Plot_Gallery-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Plot_Gallery-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; - C31A40B817ABD6910020C5C6 /* FunctionPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FunctionPlot.h; path = src/plots/FunctionPlot.h; sourceTree = ""; }; - C31A40B917ABD6910020C5C6 /* FunctionPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = FunctionPlot.m; path = src/plots/FunctionPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C32960C91A101AEB0086D047 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = src/ios/AppDelegate.h; sourceTree = ""; }; - C32960CA1A101AEB0086D047 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = AppDelegate.m; path = src/ios/AppDelegate.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C3457A5117AD7C72000880F3 /* PiNumberFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PiNumberFormatter.h; path = src/shared/PiNumberFormatter.h; sourceTree = ""; }; - C3457A5217AD7C72000880F3 /* PiNumberFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PiNumberFormatter.m; path = src/shared/PiNumberFormatter.m; sourceTree = ""; }; - C354C0D213C7CDA900DA8822 /* RealTimePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RealTimePlot.h; path = src/plots/RealTimePlot.h; sourceTree = ""; }; - C354C0D313C7CDA900DA8822 /* RealTimePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RealTimePlot.m; path = src/plots/RealTimePlot.m; sourceTree = ""; }; - C35597A01437E09300B41DA7 /* ControlChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ControlChart.h; path = src/plots/ControlChart.h; sourceTree = ""; }; - C35597A11437E09300B41DA7 /* ControlChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ControlChart.m; path = src/plots/ControlChart.m; sourceTree = ""; }; - C360E1C713B18ABC007994B6 /* OHLCPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OHLCPlot.h; path = src/plots/OHLCPlot.h; sourceTree = ""; }; - C360E1C813B18ABC007994B6 /* OHLCPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OHLCPlot.m; path = src/plots/OHLCPlot.m; sourceTree = ""; }; - C360E1D813B18B24007994B6 /* AxisDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AxisDemo.h; path = src/plots/AxisDemo.h; sourceTree = ""; }; - C360E1D913B18B24007994B6 /* AxisDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = AxisDemo.m; path = src/plots/AxisDemo.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C360E1EC13B18CCC007994B6 /* CandlestickPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CandlestickPlot.h; path = src/plots/CandlestickPlot.h; sourceTree = ""; }; - C360E1ED13B18CCC007994B6 /* CandlestickPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CandlestickPlot.m; path = src/plots/CandlestickPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C36157B819D790E10036ACDA /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = "Launch Screen.xib"; path = "src/ios/Launch Screen.xib"; sourceTree = ""; }; - C367249D13E103AC0070F47A /* LineCapDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LineCapDemo.h; path = src/plots/LineCapDemo.h; sourceTree = ""; }; - C367249E13E103AC0070F47A /* LineCapDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LineCapDemo.m; path = src/plots/LineCapDemo.m; sourceTree = ""; }; - C37995981A1912A400F7378C /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = src/ios/Main.storyboard; sourceTree = ""; }; - C3858C621A17A0E5004BC750 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = RootViewController.h; path = src/ios/RootViewController.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - C3858C631A17A0E5004BC750 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = RootViewController.m; path = src/ios/RootViewController.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C39C4E3913BFE19200CD9194 /* PlotSpaceDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlotSpaceDemo.h; path = src/plots/PlotSpaceDemo.h; sourceTree = ""; }; - C39C4E3A13BFE19200CD9194 /* PlotSpaceDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PlotSpaceDemo.m; path = src/plots/PlotSpaceDemo.m; sourceTree = ""; }; - C39C4E3C13BFE19E00CD9194 /* LabelingPolicyDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LabelingPolicyDemo.h; path = src/plots/LabelingPolicyDemo.h; sourceTree = ""; }; - C39C4E3D13BFE19E00CD9194 /* LabelingPolicyDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = LabelingPolicyDemo.m; path = src/plots/LabelingPolicyDemo.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C3A14C1313AEE7CC00D103EA /* RangePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RangePlot.h; path = src/plots/RangePlot.h; sourceTree = ""; }; - C3A14C1413AEE7CC00D103EA /* RangePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RangePlot.m; path = src/plots/RangePlot.m; sourceTree = ""; }; - C3A31A5714DF783500734AB7 /* ColoredBarChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ColoredBarChart.h; path = src/plots/ColoredBarChart.h; sourceTree = ""; }; - C3A31A5814DF783500734AB7 /* ColoredBarChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = ColoredBarChart.m; path = src/plots/ColoredBarChart.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C3C0DF2419D86B3A00631CAD /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/CorePlotWarnings.xcconfig; sourceTree = ""; }; - C3CD282917DE9A7E008EED1E /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; - C3D2FE6819FF1D3E002CD4D6 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = img/Images.xcassets; sourceTree = ""; }; - C3D70BAA175EB30800F27173 /* ImageDemo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImageDemo.h; path = src/plots/ImageDemo.h; sourceTree = ""; }; - C3D70BAB175EB30800F27173 /* ImageDemo.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = ImageDemo.m; path = src/plots/ImageDemo.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C3EF42F819FC753E0060791A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = "Plot Gallery-iOS/Images.xcassets"; sourceTree = ""; }; - C3F34F2812AB25AE008FBDC3 /* DonutChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DonutChart.h; path = src/plots/DonutChart.h; sourceTree = ""; }; - C3F34F2912AB25AE008FBDC3 /* DonutChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = DonutChart.m; path = src/plots/DonutChart.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4F4892581290FAD100EDB93F /* libCorePlot-CocoaTouch.a in Frameworks */, - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, - 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */, - 4F5EBAC312297F2400D147E7 /* QuartzCore.framework in Frameworks */, - C3CD282A17DE9A7E008EED1E /* Accelerate.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 1D6058910D05DD3D006BFB54 /* Plot Gallery.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - 4F07461A1236B1CB0039593F /* CorePlot-CocoaTouch.xcodeproj */, - 4F22FE351234043F006BF615 /* Shared */, - 4F22FE3112340417006BF615 /* iOS */, - 4F5EBAFA1229818000D147E7 /* Plots */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - indentWidth = 4; - name = CustomTemplate; - sourceTree = ""; - tabWidth = 4; - usesTabs = 0; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, - 1D30AB110D05D00D00671497 /* Foundation.framework */, - 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */, - 4F5EBAC212297F2400D147E7 /* QuartzCore.framework */, - C3CD282917DE9A7E008EED1E /* Accelerate.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 4F22FE3112340417006BF615 /* iOS */ = { - isa = PBXGroup; - children = ( - C3EF42F819FC753E0060791A /* Images.xcassets */, - C32960C91A101AEB0086D047 /* AppDelegate.h */, - C32960CA1A101AEB0086D047 /* AppDelegate.m */, - 4F7541EE126B59A200313026 /* DetailViewController.h */, - 4F7541EF126B59A200313026 /* DetailViewController.m */, - C3858C621A17A0E5004BC750 /* RootViewController.h */, - C3858C631A17A0E5004BC750 /* RootViewController.m */, - 28A0AAE50D9B0CCF005BE974 /* Plot_Gallery_Prefix.pch */, - 8D1107310486CEB800E47090 /* Plot_Gallery-Info.plist */, - 4F22FE6612340671006BF615 /* main.m */, - 4F22FE77123406DF006BF615 /* ThemeTableViewController.h */, - 4F22FE78123406DF006BF615 /* ThemeTableViewController.m */, - C37995981A1912A400F7378C /* Main.storyboard */, - C36157B819D790E10036ACDA /* Launch Screen.xib */, - ); - name = iOS; - sourceTree = ""; - }; - 4F22FE351234043F006BF615 /* Shared */ = { - isa = PBXGroup; - children = ( - C3D2FE6819FF1D3E002CD4D6 /* Images.xcassets */, - 4F22FE3812340464006BF615 /* PlotItem.h */, - 4F22FE3912340464006BF615 /* PlotItem.m */, - 4F22FE3612340464006BF615 /* PlotGallery.h */, - 4F22FE3712340464006BF615 /* PlotGallery.m */, - C3457A5117AD7C72000880F3 /* PiNumberFormatter.h */, - C3457A5217AD7C72000880F3 /* PiNumberFormatter.m */, - C3C0DF2419D86B3A00631CAD /* CorePlotWarnings.xcconfig */, - ); - name = Shared; - sourceTree = ""; - }; - 4F48923F1290F96500EDB93F /* Products */ = { - isa = PBXGroup; - children = ( - 4F4892451290F96500EDB93F /* libCorePlot-CocoaTouch.a */, - ); - name = Products; - sourceTree = ""; - }; - 4F5EBAFA1229818000D147E7 /* Plots */ = { - isa = PBXGroup; - children = ( - C360E1D813B18B24007994B6 /* AxisDemo.h */, - C360E1D913B18B24007994B6 /* AxisDemo.m */, - C360E1EC13B18CCC007994B6 /* CandlestickPlot.h */, - C360E1ED13B18CCC007994B6 /* CandlestickPlot.m */, - C3A31A5714DF783500734AB7 /* ColoredBarChart.h */, - C3A31A5814DF783500734AB7 /* ColoredBarChart.m */, - 4F22FE3C123404C2006BF615 /* CompositePlot.h */, - 4F22FE3D123404C2006BF615 /* CompositePlot.m */, - C35597A01437E09300B41DA7 /* ControlChart.h */, - C35597A11437E09300B41DA7 /* ControlChart.m */, - 4CBCB98814753D6F000C8951 /* CurvedScatterPlot.h */, - 4CBCB98914753D6F000C8951 /* CurvedScatterPlot.m */, - 4F8E1C5E12907C1800D2035F /* DatePlot.h */, - 4F8E1C5F12907C1800D2035F /* DatePlot.m */, - C3F34F2812AB25AE008FBDC3 /* DonutChart.h */, - C3F34F2912AB25AE008FBDC3 /* DonutChart.m */, - C31A40B817ABD6910020C5C6 /* FunctionPlot.h */, - C31A40B917ABD6910020C5C6 /* FunctionPlot.m */, - 4F22FE3E123404C2006BF615 /* GradientScatterPlot.h */, - 4F22FE3F123404C2006BF615 /* GradientScatterPlot.m */, - C3D70BAA175EB30800F27173 /* ImageDemo.h */, - C3D70BAB175EB30800F27173 /* ImageDemo.m */, - C39C4E3C13BFE19E00CD9194 /* LabelingPolicyDemo.h */, - C39C4E3D13BFE19E00CD9194 /* LabelingPolicyDemo.m */, - C367249D13E103AC0070F47A /* LineCapDemo.h */, - C367249E13E103AC0070F47A /* LineCapDemo.m */, - C360E1C713B18ABC007994B6 /* OHLCPlot.h */, - C360E1C813B18ABC007994B6 /* OHLCPlot.m */, - C39C4E3913BFE19200CD9194 /* PlotSpaceDemo.h */, - C39C4E3A13BFE19200CD9194 /* PlotSpaceDemo.m */, - C3A14C1313AEE7CC00D103EA /* RangePlot.h */, - C3A14C1413AEE7CC00D103EA /* RangePlot.m */, - C354C0D213C7CDA900DA8822 /* RealTimePlot.h */, - C354C0D313C7CDA900DA8822 /* RealTimePlot.m */, - 4F22FE40123404C2006BF615 /* SimplePieChart.h */, - 4F22FE41123404C2006BF615 /* SimplePieChart.m */, - 4F22FE42123404C2006BF615 /* SimpleScatterPlot.h */, - 4F22FE43123404C2006BF615 /* SimpleScatterPlot.m */, - 4F8E1C9E129089D600D2035F /* SteppedScatterPlot.h */, - 4F8E1C9F129089D600D2035F /* SteppedScatterPlot.m */, - 4F22FE44123404C2006BF615 /* VerticalBarChart.h */, - 4F22FE45123404C2006BF615 /* VerticalBarChart.m */, - ); - name = Plots; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* Plot Gallery-iOS */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Plot Gallery-iOS" */; - buildPhases = ( - 1D60588D0D05DD3D006BFB54 /* Resources */, - 1D60588E0D05DD3D006BFB54 /* Sources */, - 1D60588F0D05DD3D006BFB54 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 4F4892571290FAB500EDB93F /* PBXTargetDependency */, - ); - name = "Plot Gallery-iOS"; - productName = "Plot Gallery"; - productReference = 1D6058910D05DD3D006BFB54 /* Plot Gallery.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0700; - TargetAttributes = { - 1D6058900D05DD3D006BFB54 = { - DevelopmentTeam = 28ZA45DE7D; - }; - }; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Plot_Gallery_iOS" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - en, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = 4F48923F1290F96500EDB93F /* Products */; - ProjectRef = 4F07461A1236B1CB0039593F /* CorePlot-CocoaTouch.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 1D6058900D05DD3D006BFB54 /* Plot Gallery-iOS */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 4F4892451290F96500EDB93F /* libCorePlot-CocoaTouch.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libCorePlot-CocoaTouch.a"; - remoteRef = 4F4892441290F96500EDB93F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 1D60588D0D05DD3D006BFB54 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - C36157B919D790E10036ACDA /* Launch Screen.xib in Resources */, - C3D2FE6919FF1D3E002CD4D6 /* Images.xcassets in Resources */, - C3EF42F919FC753E0060791A /* Images.xcassets in Resources */, - C37995991A1912A400F7378C /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1D60588E0D05DD3D006BFB54 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4F22FE3A12340464006BF615 /* PlotGallery.m in Sources */, - C3858C641A17A0E5004BC750 /* RootViewController.m in Sources */, - 4F22FE3B12340464006BF615 /* PlotItem.m in Sources */, - 4F22FE46123404C2006BF615 /* CompositePlot.m in Sources */, - 4F22FE47123404C2006BF615 /* GradientScatterPlot.m in Sources */, - 4F22FE48123404C2006BF615 /* SimplePieChart.m in Sources */, - 4F22FE49123404C2006BF615 /* SimpleScatterPlot.m in Sources */, - 4F22FE4A123404C2006BF615 /* VerticalBarChart.m in Sources */, - 4F22FE6712340671006BF615 /* main.m in Sources */, - 4F22FE7B123406DF006BF615 /* ThemeTableViewController.m in Sources */, - 4F7541F3126B59A200313026 /* DetailViewController.m in Sources */, - 4F8E1C6012907C1800D2035F /* DatePlot.m in Sources */, - 4F8E1CA0129089D600D2035F /* SteppedScatterPlot.m in Sources */, - C3F34F2A12AB25AE008FBDC3 /* DonutChart.m in Sources */, - C3A14C1513AEE7CC00D103EA /* RangePlot.m in Sources */, - C360E1C913B18ABC007994B6 /* OHLCPlot.m in Sources */, - C360E1DA13B18B24007994B6 /* AxisDemo.m in Sources */, - C360E1EE13B18CCC007994B6 /* CandlestickPlot.m in Sources */, - C39C4E3B13BFE19200CD9194 /* PlotSpaceDemo.m in Sources */, - C39C4E3E13BFE19E00CD9194 /* LabelingPolicyDemo.m in Sources */, - C354C0D413C7CDA900DA8822 /* RealTimePlot.m in Sources */, - C32960CB1A101AEB0086D047 /* AppDelegate.m in Sources */, - C367249F13E103AC0070F47A /* LineCapDemo.m in Sources */, - C35597A21437E09300B41DA7 /* ControlChart.m in Sources */, - C3A31A5914DF783500734AB7 /* ColoredBarChart.m in Sources */, - C3AC1411150EDEF300631001 /* CurvedScatterPlot.m in Sources */, - C31A40BA17ABD6910020C5C6 /* FunctionPlot.m in Sources */, - C3D70BAC175EB30800F27173 /* ImageDemo.m in Sources */, - C3457A5317AD7C72000880F3 /* PiNumberFormatter.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 4F4892571290FAB500EDB93F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "CorePlot-CocoaTouch"; - targetProxy = 4F4892561290FAB500EDB93F /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 1D6058940D05DD3E006BFB54 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Plot_Gallery_Prefix.pch; - HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework/\"/**"; - INFOPLIST_FILE = "Plot_Gallery-Info.plist"; - OTHER_LDFLAGS = ( - "-ObjC", - "-all_load", - ); - PRODUCT_BUNDLE_IDENTIFIER = org.CorePlot.PlotGallery; - PRODUCT_NAME = "Plot Gallery"; - PROVISIONING_PROFILE = ""; - SYMROOT = "$(SRCROOT)/../../build"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Plot_Gallery_Prefix.pch; - HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework/\"/**"; - INFOPLIST_FILE = "Plot_Gallery-Info.plist"; - OTHER_LDFLAGS = ( - "-ObjC", - "-all_load", - ); - PRODUCT_BUNDLE_IDENTIFIER = org.CorePlot.PlotGallery; - PRODUCT_NAME = "Plot Gallery"; - PROVISIONING_PROFILE = ""; - SYMROOT = "$(SRCROOT)/../../build"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3C0DF2419D86B3A00631CAD /* CorePlotWarnings.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = 2; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3C0DF2419D86B3A00631CAD /* CorePlotWarnings.xcconfig */; - buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = 2; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "Plot Gallery-iOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D6058940D05DD3E006BFB54 /* Debug */, - 1D6058950D05DD3E006BFB54 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Plot_Gallery_iOS" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/examples/CorePlotGallery/Plot_Gallery_iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/CorePlotGallery/Plot_Gallery_iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 28edda14c..000000000 --- a/examples/CorePlotGallery/Plot_Gallery_iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/examples/CorePlotGallery/README b/examples/CorePlotGallery/README deleted file mode 100644 index 7bdc3c740..000000000 --- a/examples/CorePlotGallery/README +++ /dev/null @@ -1,43 +0,0 @@ -A gallery of Core Plot examples for Mac OS X and iPad. -iPhone support is on the todo list. - -There are currently a few generic examples in the -plots group of the Xcode projects, but the hope is -to provide small simple examples that illustrate -a simple task in core-plot (creating a floating -axis, for example). - -To add a new plot: - -1. Create a new class that derives from PlotItem - -2. Add a - + (void)load - class method to register the class via the - [super registerPlotItem:self]; - message. - This makes it show up in the tableview/imageview. - -3. If you are only generating a single plot, override - the renderInLayer:withTheme method to create your - graphs. Make sure you add your CPTGraph object to - the graphs array. - -4. Add any delegate methods you need for handling - labels or user interaction. - -If your view consists of multiple plots, you also -need to override the - renderInView:withTheme -method to set up your CPTLayers. You should also -override the - setFrameSize: -on the Mac and - didRotateFromInterfaceOrientation: -on iOS to handle resizing and device rotation. See -the CompositePlot.[hm] files for an example of -creating multiple plots. - -If you are just generating a single plot, the -resizing and rotation handling are done for you. - diff --git a/examples/CorePlotGallery/README.md b/examples/CorePlotGallery/README.md new file mode 100644 index 000000000..7b78d6b3b --- /dev/null +++ b/examples/CorePlotGallery/README.md @@ -0,0 +1,17 @@ +A gallery of Core Plot examples for Mac OS X and iOS. The iOS app is a universal app that supports both iPhone and iPad. + +To add a new plot demo: + +1. Create a new subclass of the `PlotItem` class. + +2. Add a `+(void)load` class method to register the class via the `[super registerPlotItem:self];` message. This makes it show up in the tableview/imageview. + +3. Set the `title` and `section` in the `-init` method. The `title` is used as the label in the list of plots, grouped alphabetically under the `section`. + +4. Override the `-renderInGraphHostingView:withTheme:animated:` method to set up the plot demo. Add the graph hosting view(s) for the demo as sublayers of the hosting view parameter. If the plot demo includes more than one graph, your `PlotItem` subclass is responsible for the layout of the graphs. Use autolayout on iOS and calculate the layout manually on the Mac. Be sure to implement the `-setFrameSize:` method on the Mac and update the layout there, too. See the `CompositePlot` class for an example of creating multiple graphs in a plot demo. + +5. Call the `-addGraph:toHostingView:` method to add each graph to its hosting view and to the master list of graphs. + +6. Implement the `-killGraph` method to release temporary data or views created in the `-renderInGraphHostingView:withTheme:animated:` method. + +7. Add any delegate methods you need for handling labels or user interaction and datasource methods to provide plot data. diff --git a/examples/CorePlotGallery/img/BlueBackground.sketch/Data b/examples/CorePlotGallery/img/BlueBackground.sketch/Data index 15d53a4c6..8d19e2be6 100644 Binary files a/examples/CorePlotGallery/img/BlueBackground.sketch/Data and b/examples/CorePlotGallery/img/BlueBackground.sketch/Data differ diff --git a/examples/CorePlotGallery/img/BlueBackground.sketch/QuickLook/Preview.png b/examples/CorePlotGallery/img/BlueBackground.sketch/QuickLook/Preview.png index 8792a0598..116d5faf6 100644 Binary files a/examples/CorePlotGallery/img/BlueBackground.sketch/QuickLook/Preview.png and b/examples/CorePlotGallery/img/BlueBackground.sketch/QuickLook/Preview.png differ diff --git a/examples/CorePlotGallery/img/BlueBackground.sketch/QuickLook/Thumbnail.png b/examples/CorePlotGallery/img/BlueBackground.sketch/QuickLook/Thumbnail.png index 2c1aa34e8..ce0aa7293 100644 Binary files a/examples/CorePlotGallery/img/BlueBackground.sketch/QuickLook/Thumbnail.png and b/examples/CorePlotGallery/img/BlueBackground.sketch/QuickLook/Thumbnail.png differ diff --git a/examples/CorePlotGallery/img/BlueBackground.sketch/metadata b/examples/CorePlotGallery/img/BlueBackground.sketch/metadata index b7b87b0e4..aed2eba0c 100644 --- a/examples/CorePlotGallery/img/BlueBackground.sketch/metadata +++ b/examples/CorePlotGallery/img/BlueBackground.sketch/metadata @@ -11,7 +11,7 @@ fonts length - 9846 + 13192 version 18 diff --git a/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/BlueBackground.png b/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/BlueBackground.png index 021a54e24..6183e3d5c 100644 Binary files a/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/BlueBackground.png and b/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/BlueBackground.png differ diff --git a/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/BlueBackground@2x.png b/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/BlueBackground@2x.png index ec0eb1432..2d1522f3d 100644 Binary files a/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/BlueBackground@2x.png and b/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/BlueBackground@2x.png differ diff --git a/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/BlueBackground@3x.png b/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/BlueBackground@3x.png new file mode 100644 index 000000000..255633faf Binary files /dev/null and b/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/BlueBackground@3x.png differ diff --git a/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/Contents.json b/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/Contents.json index fb9e4394a..1bccf4969 100644 --- a/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/Contents.json +++ b/examples/CorePlotGallery/img/Images.xcassets/BlueBackground.imageset/Contents.json @@ -9,6 +9,11 @@ "idiom" : "universal", "scale" : "2x", "filename" : "BlueBackground@2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "BlueBackground@3x.png" } ], "info" : { diff --git a/examples/CorePlotGallery/src/ios/AppDelegate.h b/examples/CorePlotGallery/src/ios/AppDelegate.h index c39b0224c..b0a134582 100644 --- a/examples/CorePlotGallery/src/ios/AppDelegate.h +++ b/examples/CorePlotGallery/src/ios/AppDelegate.h @@ -1,12 +1,12 @@ // -// AppDelegate.h -// CorePlotGallery +// AppDelegate.h +// CorePlotGallery // #import @interface AppDelegate : UIResponder -@property (nonatomic, readwrite, strong) UIWindow *window; +@property (nonatomic, readwrite, strong, nullable) UIWindow *window; @end diff --git a/examples/CorePlotGallery/src/ios/AppDelegate.m b/examples/CorePlotGallery/src/ios/AppDelegate.m index 442dfeb8f..e3bafe91b 100644 --- a/examples/CorePlotGallery/src/ios/AppDelegate.m +++ b/examples/CorePlotGallery/src/ios/AppDelegate.m @@ -1,6 +1,6 @@ // -// AppDelegate.m -// CorePlotGallery +// AppDelegate.m +// CorePlotGallery // #import "AppDelegate.h" @@ -18,14 +18,14 @@ @implementation AppDelegate @synthesize window; --(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +-(BOOL)application:(nonnull UIApplication *__unused)application didFinishLaunchingWithOptions:(nullable CPTDictionary *__unused)launchOptions { [[PlotGallery sharedPlotGallery] sortByTitle]; UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController; splitViewController.delegate = self; - UINavigationController *navigationController = [splitViewController.viewControllers lastObject]; + UINavigationController *navigationController = splitViewController.viewControllers.lastObject; navigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem; return YES; @@ -33,9 +33,9 @@ -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(N #pragma mark - Split view --(BOOL)splitViewController:(UISplitViewController *)splitViewController collapseSecondaryViewController:(UIViewController *)secondaryViewController ontoPrimaryViewController:(UIViewController *)primaryViewController +-(BOOL)splitViewController:(UISplitViewController *__unused)splitViewController collapseSecondaryViewController:(UIViewController *)secondaryViewController ontoPrimaryViewController:(UIViewController *__unused)primaryViewController { - if ( [secondaryViewController isKindOfClass:[UINavigationController class]] && [[(UINavigationController *)secondaryViewController topViewController] isKindOfClass:[DetailViewController class]] && ([(DetailViewController *)[(UINavigationController *)secondaryViewController topViewController] detailItem] == nil) ) { + if ( [secondaryViewController isKindOfClass:[UINavigationController class]] && [((UINavigationController *)secondaryViewController).topViewController isKindOfClass:[DetailViewController class]] && (((DetailViewController *)((UINavigationController *)secondaryViewController).topViewController).detailItem == nil)) { // Return YES to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded. return YES; } diff --git a/examples/CorePlotGallery/src/ios/Launch Screen.xib b/examples/CorePlotGallery/src/ios/Base.lproj/Launch Screen.xib similarity index 65% rename from examples/CorePlotGallery/src/ios/Launch Screen.xib rename to examples/CorePlotGallery/src/ios/Base.lproj/Launch Screen.xib index 7f22f14f7..8a42da815 100644 --- a/examples/CorePlotGallery/src/ios/Launch Screen.xib +++ b/examples/CorePlotGallery/src/ios/Base.lproj/Launch Screen.xib @@ -1,25 +1,28 @@ - - + + + + + - - + + - + - + diff --git a/examples/CorePlotGallery/src/ios/Main.storyboard b/examples/CorePlotGallery/src/ios/Base.lproj/Main.storyboard similarity index 83% rename from examples/CorePlotGallery/src/ios/Main.storyboard rename to examples/CorePlotGallery/src/ios/Base.lproj/Main.storyboard index ed627f0c5..949e2f780 100644 --- a/examples/CorePlotGallery/src/ios/Main.storyboard +++ b/examples/CorePlotGallery/src/ios/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - - + + + + + - - + + + @@ -10,6 +14,7 @@ + @@ -29,15 +34,15 @@ - + - - + + - + @@ -62,26 +67,29 @@ - + - + - + + + @@ -118,27 +126,27 @@ - + - + - + - + - + @@ -156,11 +164,12 @@ - + - + + diff --git a/examples/CorePlotGallery/src/ios/DetailViewController.h b/examples/CorePlotGallery/src/ios/DetailViewController.h index 5948c7918..fad34930c 100644 --- a/examples/CorePlotGallery/src/ios/DetailViewController.h +++ b/examples/CorePlotGallery/src/ios/DetailViewController.h @@ -1,18 +1,18 @@ // -// DetailViewController.h -// CorePlotGallery +// DetailViewController.h +// CorePlotGallery // @class PlotItem; @interface DetailViewController : UIViewController -@property (nonatomic, strong) PlotItem *detailItem; -@property (nonatomic, copy) NSString *currentThemeName; +@property (nonatomic, strong, nonnull) PlotItem *detailItem; +@property (nonatomic, copy, nonnull) NSString *currentThemeName; -@property (nonatomic, strong) IBOutlet UIView *hostingView; -@property (nonatomic, strong) IBOutlet UIBarButtonItem *themeBarButton; +@property (nonatomic, strong, nullable) IBOutlet UIView *hostingView; +@property (nonatomic, strong, nullable) IBOutlet UIBarButtonItem *themeBarButton; --(void)themeSelectedWithName:(NSString *)themeName; +-(void)themeSelectedWithName:(nonnull NSString *)themeName; @end diff --git a/examples/CorePlotGallery/src/ios/DetailViewController.m b/examples/CorePlotGallery/src/ios/DetailViewController.m index 0a0e3a8e0..9d787a9fa 100644 --- a/examples/CorePlotGallery/src/ios/DetailViewController.m +++ b/examples/CorePlotGallery/src/ios/DetailViewController.m @@ -1,6 +1,6 @@ // -// DetailViewController.m -// CorePlotGallery +// DetailViewController.m +// CorePlotGallery // #import "DetailViewController.h" @@ -10,12 +10,10 @@ @interface DetailViewController() --(CPTTheme *)currentTheme; - -@property (nonatomic, readwrite) UIPopoverController *themePopoverController; +-(nullable CPTTheme *)currentTheme; -(void)setupView; --(void)themeChanged:(NSNotification *)notification; +-(void)themeChanged:(nonnull NSNotification *)notification; @end @@ -27,7 +25,6 @@ @implementation DetailViewController @synthesize hostingView; @synthesize themeBarButton; @synthesize currentThemeName; -@synthesize themePopoverController; #pragma mark - #pragma mark Initialization and Memory Management @@ -39,17 +36,22 @@ -(void)setupView name:PlotGalleryThemeDidChangeNotification object:nil]; - [self.detailItem renderInView:self.hostingView withTheme:[self currentTheme] animated:YES]; + UIView *hostView = self.hostingView; + if ( hostView ) { + [self.detailItem renderInView:hostView withTheme:[self currentTheme] animated:YES]; + } } -(void)awakeFromNib { + [super awakeFromNib]; + [self setupView]; } --(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +-(nonnull instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil { - if ( (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) ) { + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { [self setupView]; } @@ -64,15 +66,16 @@ -(void)dealloc #pragma mark - #pragma mark Managing the detail item --(void)setDetailItem:(PlotItem *)newDetailItem +-(void)setDetailItem:(nonnull PlotItem *)newDetailItem { if ( detailItem != newDetailItem ) { [detailItem killGraph]; detailItem = newDetailItem; - if ( self.hostingView ) { - [detailItem renderInView:self.hostingView withTheme:[self currentTheme] animated:YES]; + UIView *hostView = self.hostingView; + if ( hostView ) { + [detailItem renderInView:hostView withTheme:[self currentTheme] animated:YES]; } } } @@ -90,7 +93,7 @@ -(void)viewDidAppear:(BOOL)animated #pragma mark - #pragma mark Theme Selection --(void)setCurrentThemeName:(NSString *)newThemeName +-(void)setCurrentThemeName:(nonnull NSString *)newThemeName { if ( newThemeName != currentThemeName ) { currentThemeName = [newThemeName copy]; @@ -99,7 +102,7 @@ -(void)setCurrentThemeName:(NSString *)newThemeName } } --(CPTTheme *)currentTheme +-(nullable CPTTheme *)currentTheme { CPTTheme *theme; @@ -116,18 +119,25 @@ -(CPTTheme *)currentTheme return theme; } --(void)themeSelectedWithName:(NSString *)themeName +-(void)themeSelectedWithName:(nonnull NSString *)themeName { self.currentThemeName = themeName; - [self.detailItem renderInView:self.hostingView withTheme:[self currentTheme] animated:YES]; + UIView *hostView = self.hostingView; + if ( hostView ) { + [self.detailItem renderInView:hostView withTheme:[self currentTheme] animated:YES]; + } } --(void)themeChanged:(NSNotification *)notification +-(void)themeChanged:(nonnull NSNotification *)notification { - NSDictionary *themeInfo = notification.userInfo; + NSDictionary *themeInfo = notification.userInfo; + + NSString *themeName = themeInfo[PlotGalleryThemeNameKey]; - [self themeSelectedWithName:themeInfo[PlotGalleryThemeNameKey]]; + if ( themeName ) { + [self themeSelectedWithName:themeName]; + } } @end diff --git a/examples/CorePlotGallery/src/ios/PlotHostView.h b/examples/CorePlotGallery/src/ios/PlotHostView.h deleted file mode 100644 index ad2183f95..000000000 --- a/examples/CorePlotGallery/src/ios/PlotHostView.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// PlotHostView.h -// Plot Gallery -// -// Created by Jeff Buck on 9/4/10. -// Copyright 2010 Jeff Buck. All rights reserved. -// - -#import - -@interface PlotHostView : UIView -{ -} - -@end diff --git a/examples/CorePlotGallery/src/ios/PlotHostView.m b/examples/CorePlotGallery/src/ios/PlotHostView.m deleted file mode 100644 index f3e27fecf..000000000 --- a/examples/CorePlotGallery/src/ios/PlotHostView.m +++ /dev/null @@ -1,35 +0,0 @@ -// -// PlotHostView.m -// Plot Gallery -// -// Created by Jeff Buck on 9/4/10. -// Copyright 2010 Jeff Buck. All rights reserved. -// - -#import "PlotHostView.h" - -@implementation PlotHostView - --(id)initWithFrame:(CGRect)frame -{ - if ( (self = [super initWithFrame:frame]) ) { - } - return self; -} - --(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -{ - return YES; -} - --(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation -{ - NSLog(@"PlotHostView:didRotateFromInterfaceOrientation:"); -} - --(void)dealloc -{ - [super dealloc]; -} - -@end diff --git a/examples/CorePlotGallery/src/ios/RootViewController.h b/examples/CorePlotGallery/src/ios/RootViewController.h index 4b29ad39d..6318baa62 100644 --- a/examples/CorePlotGallery/src/ios/RootViewController.h +++ b/examples/CorePlotGallery/src/ios/RootViewController.h @@ -1,6 +1,6 @@ // -// RootViewController.h -// CorePlotGallery +// RootViewController.h +// CorePlotGallery // @interface RootViewController : UITableViewController diff --git a/examples/CorePlotGallery/src/ios/RootViewController.m b/examples/CorePlotGallery/src/ios/RootViewController.m index 12b7d09ec..9d81892b5 100644 --- a/examples/CorePlotGallery/src/ios/RootViewController.m +++ b/examples/CorePlotGallery/src/ios/RootViewController.m @@ -1,6 +1,6 @@ // -// RootViewController.m -// CorePlotGallery +// RootViewController.m +// CorePlotGallery // #import "RootViewController.h" @@ -13,9 +13,9 @@ @interface RootViewController() -@property (nonatomic, copy) NSString *currentThemeName; +@property (nonatomic, copy, nonnull) NSString *currentThemeName; --(void)themeChanged:(NSNotification *)notification; +-(void)themeChanged:(nonnull NSNotification *)notification; @end @@ -47,17 +47,17 @@ -(void)dealloc #pragma mark - #pragma mark Segues --(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender +-(void)prepareForSegue:(nonnull UIStoryboardSegue *)segue sender:(nullable id __unused)sender { if ( [segue.identifier isEqualToString:@"showDetail"] ) { - DetailViewController *controller = (DetailViewController *)[segue.destinationViewController topViewController]; + DetailViewController *controller = (DetailViewController *)((UINavigationController *)segue.destinationViewController).topViewController; controller.navigationItem.leftBarButtonItem = self.splitViewController.displayModeButtonItem; controller.navigationItem.leftItemsSupplementBackButton = YES; controller.currentThemeName = self.currentThemeName; - NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; + NSIndexPath *indexPath = self.tableView.indexPathForSelectedRow; PlotItem *plotItem = [[PlotGallery sharedPlotGallery] objectInSection:[indexPath indexAtPosition:0] atIndex:[indexPath indexAtPosition:1]]; @@ -69,27 +69,31 @@ -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender #pragma mark - #pragma mark Theme Selection --(void)themeChanged:(NSNotification *)notification +-(void)themeChanged:(nonnull NSNotification *)notification { - NSDictionary *themeInfo = notification.userInfo; + NSDictionary *themeInfo = notification.userInfo; - self.currentThemeName = themeInfo[PlotGalleryThemeNameKey]; + NSString *themeName = themeInfo[PlotGalleryThemeNameKey]; + + if ( themeName ) { + self.currentThemeName = themeName; + } } #pragma mark - #pragma mark Table view data source --(NSInteger)numberOfSectionsInTableView:(UITableView *)tv +-(NSInteger)numberOfSectionsInTableView:(nonnull UITableView *__unused)tv { - return (NSInteger)[[PlotGallery sharedPlotGallery] numberOfSections]; + return (NSInteger)[PlotGallery sharedPlotGallery].numberOfSections; } --(NSInteger)tableView:(UITableView *)tv numberOfRowsInSection:(NSInteger)section +-(NSInteger)tableView:(nonnull UITableView *__unused)tv numberOfRowsInSection:(NSInteger)section { - return (NSInteger)[[PlotGallery sharedPlotGallery] numberOfRowsInSection : (NSUInteger)section]; + return (NSInteger)[[PlotGallery sharedPlotGallery] numberOfRowsInSection:(NSUInteger)section]; } --(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath +-(nonnull UITableViewCell *)tableView:(nonnull UITableView *)tv cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath { static NSString *cellId = @"PlotCell"; @@ -108,9 +112,9 @@ -(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPa return cell; } --(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +-(nullable NSString *)tableView:(nonnull UITableView *__unused)tableView titleForHeaderInSection:(NSInteger)section { - return [[PlotGallery sharedPlotGallery] sectionTitles][(NSUInteger)section]; + return [PlotGallery sharedPlotGallery].sectionTitles[(NSUInteger)section]; } @end diff --git a/examples/CorePlotGallery/src/ios/ThemeTableViewController.h b/examples/CorePlotGallery/src/ios/ThemeTableViewController.h index d7f28fe4e..4c14585c2 100644 --- a/examples/CorePlotGallery/src/ios/ThemeTableViewController.h +++ b/examples/CorePlotGallery/src/ios/ThemeTableViewController.h @@ -1,13 +1,13 @@ // -// ThemeTableViewController.h -// CorePlotGallery +// ThemeTableViewController.h +// CorePlotGallery // -extern NSString *const kThemeTableViewControllerNoTheme; -extern NSString *const kThemeTableViewControllerDefaultTheme; +extern NSString *__nonnull const kThemeTableViewControllerNoTheme; +extern NSString *__nonnull const kThemeTableViewControllerDefaultTheme; -extern NSString *const PlotGalleryThemeDidChangeNotification; -extern NSString *const PlotGalleryThemeNameKey; +extern NSString *__nonnull const PlotGalleryThemeDidChangeNotification; +extern NSString *__nonnull const PlotGalleryThemeNameKey; #pragma mark - diff --git a/examples/CorePlotGallery/src/ios/ThemeTableViewController.m b/examples/CorePlotGallery/src/ios/ThemeTableViewController.m index 0a61304b2..a705f18cf 100644 --- a/examples/CorePlotGallery/src/ios/ThemeTableViewController.m +++ b/examples/CorePlotGallery/src/ios/ThemeTableViewController.m @@ -1,11 +1,11 @@ // -// ThemeTableViewController.m -// CorePlotGallery +// ThemeTableViewController.m +// CorePlotGallery // #import "ThemeTableViewController.h" -#import "CorePlot-CocoaTouch.h" +#import NSString *const kThemeTableViewControllerNoTheme = @"None"; NSString *const kThemeTableViewControllerDefaultTheme = @"Default"; @@ -15,7 +15,7 @@ @interface ThemeTableViewController() -@property (nonatomic, readwrite, strong) NSMutableArray *themes; +@property (nonatomic, readwrite, strong, nonnull) CPTMutableStringArray *themes; @end @@ -27,7 +27,7 @@ @implementation ThemeTableViewController -(void)setupThemes { - NSMutableArray *themeList = [[NSMutableArray alloc] init]; + CPTMutableStringArray *themeList = [[NSMutableArray alloc] init]; [themeList addObject:kThemeTableViewControllerDefaultTheme]; [themeList addObject:kThemeTableViewControllerNoTheme]; @@ -41,12 +41,14 @@ -(void)setupThemes -(void)awakeFromNib { + [super awakeFromNib]; + [self setupThemes]; } --(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +-(nonnull instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil { - if ( (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) ) { + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { [self setupThemes]; } @@ -56,17 +58,17 @@ -(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBu #pragma mark - #pragma mark Table view data source --(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +-(NSInteger)numberOfSectionsInTableView:(nonnull UITableView *__unused)tableView { return 1; } --(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +-(NSInteger)tableView:(nonnull UITableView *__unused)tableView numberOfRowsInSection:(NSInteger __unused)section { return (NSInteger)self.themes.count; } --(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +-(nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath { static NSString *CellIdentifier = @"ThemeCell"; @@ -84,10 +86,10 @@ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NS #pragma mark - #pragma mark Table view delegate --(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +-(void)tableView:(nonnull UITableView *__unused)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath { - NSDictionary *themeInfo = @{ - PlotGalleryThemeNameKey: self.themes[(NSUInteger)indexPath.row] + NSDictionary *themeInfo = @{ + PlotGalleryThemeNameKey: self.themes[(NSUInteger)indexPath.row] }; [[NSNotificationCenter defaultCenter] postNotificationName:PlotGalleryThemeDidChangeNotification diff --git a/examples/CorePlotGallery/src/ios/main.m b/examples/CorePlotGallery/src/ios/main.m index b1abaa361..7f96dbbda 100644 --- a/examples/CorePlotGallery/src/ios/main.m +++ b/examples/CorePlotGallery/src/ios/main.m @@ -1,6 +1,6 @@ // -// main.m -// CorePlotGallery +// main.m +// CorePlotGallery // #import "AppDelegate.h" @@ -8,6 +8,6 @@ int main(int argc, char *argv[]) { @autoreleasepool { - return UIApplicationMain( argc, argv, nil, NSStringFromClass([AppDelegate class]) ); + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } } diff --git a/examples/CorePlotGallery/src/mac/Icon.icns b/examples/CorePlotGallery/src/mac/Base.lproj/Icon.icns similarity index 100% rename from examples/CorePlotGallery/src/mac/Icon.icns rename to examples/CorePlotGallery/src/mac/Base.lproj/Icon.icns diff --git a/examples/CorePlotGallery/src/mac/Base.lproj/MainMenu.xib b/examples/CorePlotGallery/src/mac/Base.lproj/MainMenu.xib new file mode 100644 index 000000000..349c7533b --- /dev/null +++ b/examples/CorePlotGallery/src/mac/Base.lproj/MainMenu.xib @@ -0,0 +1,313 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CorePlotGallery/src/mac/English.lproj/MainMenu.xib b/examples/CorePlotGallery/src/mac/English.lproj/MainMenu.xib deleted file mode 100644 index 564eda80f..000000000 --- a/examples/CorePlotGallery/src/mac/English.lproj/MainMenu.xib +++ /dev/null @@ -1,1908 +0,0 @@ - - - - 1060 - 11B26 - 1617 - 1138 - 566.00 - - YES - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.imagekit.ibplugin - - - YES - 1617 - 518 - - - - YES - NSToolbar - NSToolbarFlexibleSpaceItem - NSSplitView - NSMenuItem - NSMenu - NSScrollView - NSScroller - NSToolbarSpaceItem - NSPopUpButton - NSToolbarSeparatorItem - IKImageBrowserView - NSCustomObject - NSCustomView - NSView - NSWindowTemplate - NSPopUpButtonCell - NSToolbarItem - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.imagekit.ibplugin - - - YES - - YES - - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - YES - - - Plot Gallery - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - Plot Gallery - - YES - - - About Plot Gallery - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide Plot Gallery - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit Plot Gallery - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - File - - 1048576 - 2147483647 - - - submenuAction: - - File - - YES - - - Close - w - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - - - - - - - Edit - - 1048576 - 2147483647 - - - submenuAction: - - Edit - - YES - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1179648 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Paste and Match Style - V - 1572864 - 2147483647 - - - - - - Delete - - 1048576 - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - - - - View - - 1048576 - 2147483647 - - - submenuAction: - - View - - YES - - - Show Toolbar - t - 1572864 - 2147483647 - - - - - - Customize Toolbar… - - 1048576 - 2147483647 - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - YES - - - Plot Gallery Help - ? - 1048576 - 2147483647 - - - - - _NSHelpMenu - - - - _NSMainMenu - - - 15 - 2 - {{344, 741}, {800, 600}} - 1954021376 - Plot Gallery-Mac - NSWindow - - - 362C0A69-3C26-43DD-93B4-5616D6FA9979 - - - YES - YES - YES - NO - 1 - 1 - - YES - - YES - 87A1C903-CE7F-4572-AA57-3BA4CA3E30FB - NSToolbarCustomizeToolbarItem - NSToolbarFlexibleSpaceItem - NSToolbarSeparatorItem - NSToolbarSpaceItem - - - YES - - - 87A1C903-CE7F-4572-AA57-3BA4CA3E30FB - - Theme - Theme - - - - 268 - {{0, 14}, {100, 25}} - YES - - -2076049856 - 2048 - - LucidaGrande - 13 - 1044 - - - -2038284033 - 163 - - - 400 - 75 - - YES - - OtherViews - - YES - - - - -1 - 1 - YES - YES - 2 - - - - - - {100, 25} - {150, 25} - YES - YES - 0 - YES - 0 - - - NSToolbarCustomizeToolbarItem - Customize - Customize - Customize Toolbar - - - NSImage - NSToolbarCustomizeToolbarItemImage - - - runToolbarCustomizationPalette: - {0, 0} - {0, 0} - YES - YES - -1 - YES - 0 - - - NSToolbarFlexibleSpaceItem - - Flexible Space - - - - - - {1, 5} - {20000, 32} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - - - - - NSToolbarSeparatorItem - - Separator - - - - - - {12, 5} - {12, 1000} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - - - - - NSToolbarSpaceItem - - Space - - - - - - {32, 5} - {32, 32} - YES - YES - -1 - YES - 0 - - YES - YES - - - 1048576 - 2147483647 - - - - - - - - YES - - - - - - - - YES - - - - - - - - - - 256 - - YES - - - 274 - - YES - - - 256 - - YES - - - 274 - - YES - - - 2304 - - YES - - - 18 - - YES - - YES - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - Apple URL pasteboard type - NSFilenamesPboardType - NSTypedFilenamesPboardType:'.SGI' - NSTypedFilenamesPboardType:'8BPS' - NSTypedFilenamesPboardType:'BMP ' - NSTypedFilenamesPboardType:'BMPf' - NSTypedFilenamesPboardType:'EPSF' - NSTypedFilenamesPboardType:'FPix' - NSTypedFilenamesPboardType:'GIFf' - NSTypedFilenamesPboardType:'ICO ' - NSTypedFilenamesPboardType:'JPEG' - NSTypedFilenamesPboardType:'PDF ' - NSTypedFilenamesPboardType:'PICT' - NSTypedFilenamesPboardType:'PNGf' - NSTypedFilenamesPboardType:'PNTG' - NSTypedFilenamesPboardType:'TIFF' - NSTypedFilenamesPboardType:'TPIC' - NSTypedFilenamesPboardType:'icns' - NSTypedFilenamesPboardType:'jp2 ' - NSTypedFilenamesPboardType:'qtif' - NSTypedFilenamesPboardType:3FR - NSTypedFilenamesPboardType:3fr - NSTypedFilenamesPboardType:ARW - NSTypedFilenamesPboardType:BMP - NSTypedFilenamesPboardType:CR2 - NSTypedFilenamesPboardType:CRW - NSTypedFilenamesPboardType:CUR - NSTypedFilenamesPboardType:DCR - NSTypedFilenamesPboardType:DNG - NSTypedFilenamesPboardType:EFX - NSTypedFilenamesPboardType:EPI - NSTypedFilenamesPboardType:EPS - NSTypedFilenamesPboardType:EPSF - NSTypedFilenamesPboardType:EPSI - NSTypedFilenamesPboardType:ERF - NSTypedFilenamesPboardType:EXR - NSTypedFilenamesPboardType:FAX - NSTypedFilenamesPboardType:FFF - NSTypedFilenamesPboardType:FPIX - NSTypedFilenamesPboardType:FPX - NSTypedFilenamesPboardType:G3 - NSTypedFilenamesPboardType:GIF - NSTypedFilenamesPboardType:HDR - NSTypedFilenamesPboardType:ICNS - NSTypedFilenamesPboardType:ICO - NSTypedFilenamesPboardType:JFAX - NSTypedFilenamesPboardType:JFX - NSTypedFilenamesPboardType:JP2 - NSTypedFilenamesPboardType:JPE - NSTypedFilenamesPboardType:JPEG - NSTypedFilenamesPboardType:JPF - NSTypedFilenamesPboardType:JPG - NSTypedFilenamesPboardType:MAC - NSTypedFilenamesPboardType:MOS - NSTypedFilenamesPboardType:MPO - NSTypedFilenamesPboardType:MRW - NSTypedFilenamesPboardType:NEF - NSTypedFilenamesPboardType:NRW - NSTypedFilenamesPboardType:ORF - NSTypedFilenamesPboardType:PCT - NSTypedFilenamesPboardType:PDF - NSTypedFilenamesPboardType:PEF - NSTypedFilenamesPboardType:PIC - NSTypedFilenamesPboardType:PICT - NSTypedFilenamesPboardType:PNG - NSTypedFilenamesPboardType:PNT - NSTypedFilenamesPboardType:PNTG - NSTypedFilenamesPboardType:PS - NSTypedFilenamesPboardType:PSD - NSTypedFilenamesPboardType:QTI - NSTypedFilenamesPboardType:QTIF - NSTypedFilenamesPboardType:RAF - NSTypedFilenamesPboardType:RAW - NSTypedFilenamesPboardType:RGB - NSTypedFilenamesPboardType:RW2 - NSTypedFilenamesPboardType:RWL - NSTypedFilenamesPboardType:SGI - NSTypedFilenamesPboardType:SR2 - NSTypedFilenamesPboardType:SRF - NSTypedFilenamesPboardType:SRW - NSTypedFilenamesPboardType:TARGA - NSTypedFilenamesPboardType:TGA - NSTypedFilenamesPboardType:TIF - NSTypedFilenamesPboardType:TIFF - NSTypedFilenamesPboardType:XBM - NSTypedFilenamesPboardType:arw - NSTypedFilenamesPboardType:bmp - NSTypedFilenamesPboardType:cr2 - NSTypedFilenamesPboardType:crw - NSTypedFilenamesPboardType:cur - NSTypedFilenamesPboardType:dcr - NSTypedFilenamesPboardType:dng - NSTypedFilenamesPboardType:efx - NSTypedFilenamesPboardType:epi - NSTypedFilenamesPboardType:eps - NSTypedFilenamesPboardType:epsf - NSTypedFilenamesPboardType:epsi - NSTypedFilenamesPboardType:erf - NSTypedFilenamesPboardType:exr - NSTypedFilenamesPboardType:fax - NSTypedFilenamesPboardType:fff - NSTypedFilenamesPboardType:fpix - NSTypedFilenamesPboardType:fpx - NSTypedFilenamesPboardType:g3 - NSTypedFilenamesPboardType:gif - NSTypedFilenamesPboardType:hdr - NSTypedFilenamesPboardType:icns - NSTypedFilenamesPboardType:ico - NSTypedFilenamesPboardType:jfax - NSTypedFilenamesPboardType:jfx - NSTypedFilenamesPboardType:jp2 - NSTypedFilenamesPboardType:jpe - NSTypedFilenamesPboardType:jpeg - NSTypedFilenamesPboardType:jpf - NSTypedFilenamesPboardType:jpg - NSTypedFilenamesPboardType:mac - NSTypedFilenamesPboardType:mos - NSTypedFilenamesPboardType:mpo - NSTypedFilenamesPboardType:mrw - NSTypedFilenamesPboardType:nef - NSTypedFilenamesPboardType:nrw - NSTypedFilenamesPboardType:orf - NSTypedFilenamesPboardType:pct - NSTypedFilenamesPboardType:pdf - NSTypedFilenamesPboardType:pef - NSTypedFilenamesPboardType:pic - NSTypedFilenamesPboardType:pict - NSTypedFilenamesPboardType:png - NSTypedFilenamesPboardType:pnt - NSTypedFilenamesPboardType:pntg - NSTypedFilenamesPboardType:ps - NSTypedFilenamesPboardType:psd - NSTypedFilenamesPboardType:qti - NSTypedFilenamesPboardType:qtif - NSTypedFilenamesPboardType:raf - NSTypedFilenamesPboardType:raw - NSTypedFilenamesPboardType:rgb - NSTypedFilenamesPboardType:rw2 - NSTypedFilenamesPboardType:rwl - NSTypedFilenamesPboardType:sgi - NSTypedFilenamesPboardType:sr2 - NSTypedFilenamesPboardType:srf - NSTypedFilenamesPboardType:srw - NSTypedFilenamesPboardType:targa - NSTypedFilenamesPboardType:tga - NSTypedFilenamesPboardType:tif - NSTypedFilenamesPboardType:tiff - NSTypedFilenamesPboardType:xbm - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - - {225, 598} - - - YES - NO - NO - NO - NO - YES - NO - NO - NO - YES - 100 - 100 - - - - - {{1, 1}, {225, 598}} - - - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - 6 - - - - -2147483392 - {{126, 1}, {15, 184}} - - - - _doScroller: - 1 - 0.96363627910614014 - - - - -2147483392 - {{-100, -100}, {125, 15}} - - - 1 - - _doScroller: - 0.50602412223815918 - - - {227, 600} - - - 133650 - - - - QSAAAEEgAABCzQAAQvAAAA - - - {227, 600} - - - NSView - - - - 274 - {{237, 0}, {563, 600}} - - - PlotView - - - {800, 600} - - - YES - 3 - - - {800, 600} - - - - {{0, 0}, {2560, 1578}} - {10000000000000, 10000000000000} - PlotGallery - YES - - - Plot_Gallery_MacAppDelegate - - - NSFontManager - - - PlotGalleryController - - - - - YES - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - print: - - - - 86 - - - - runPageLayout: - - - - 87 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - performClose: - - - - 193 - - - - undo: - - - - 223 - - - - copy: - - - - 224 - - - - paste: - - - - 226 - - - - cut: - - - - 228 - - - - redo: - - - - 231 - - - - selectAll: - - - - 232 - - - - delete: - - - - 235 - - - - performZoom: - - - - 240 - - - - runToolbarCustomizationPalette: - - - - 365 - - - - toggleToolbarShown: - - - - 366 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - unhideAllApplications: - - - - 370 - - - - terminate: - - - - 449 - - - - pasteAsPlainText: - - - - 486 - - - - showHelp: - - - - 493 - - - - delegate - - - - 495 - - - - window - - - - 532 - - - - imageBrowser - - - - 564 - - - - scrollView - - - - 565 - - - - splitView - - - - 566 - - - - themePopUpButton - - - - 567 - - - - hostingView - - - - 568 - - - - themeSelectionDidChange: - - - - 569 - - - - - YES - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 217 - - - YES - - - - - - 83 - - - YES - - - - - - 81 - - - YES - - - - - - - - - 78 - - - - - 77 - - - - - 73 - - - - - 205 - - - YES - - - - - - - - - - - - - - 202 - - - - - 198 - - - - - 207 - - - - - 199 - - - - - 203 - - - - - 197 - - - - - 206 - - - - - 215 - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - - 297 - - - - - 298 - - - - - 371 - - - YES - - - - - - - 372 - - - YES - - - - - - 420 - - - - - 485 - - - - - 490 - - - YES - - - - - - 491 - - - YES - - - - - - 492 - - - - - 494 - - - - - 533 - - - YES - - - - - - - - - - 536 - - - - - 538 - - - - - 539 - - - - - 540 - - - - - 541 - - - YES - - - - - - - 542 - - - YES - - - - - - 543 - - - YES - - - - - 545 - - - YES - - - - - - - - 546 - - - - - 547 - - - - - 544 - - - - - 562 - - - YES - - - - - - 556 - - - YES - - - - - - 557 - - - YES - - - - - - 558 - - - YES - - - - - 563 - - - - - 74 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 129.IBPluginDependency - 130.IBPluginDependency - 131.IBPluginDependency - 134.IBPluginDependency - 136.IBPluginDependency - 143.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 149.IBPluginDependency - 150.IBPluginDependency - 19.IBPluginDependency - 197.IBPluginDependency - 198.IBPluginDependency - 199.IBPluginDependency - 202.IBPluginDependency - 203.IBPluginDependency - 205.IBPluginDependency - 206.IBPluginDependency - 207.IBPluginDependency - 215.IBPluginDependency - 217.IBPluginDependency - 23.IBPluginDependency - 236.IBPluginDependency - 239.IBPluginDependency - 24.IBPluginDependency - 29.IBPluginDependency - 295.IBPluginDependency - 296.IBPluginDependency - 297.IBPluginDependency - 298.IBPluginDependency - 371.IBPluginDependency - 371.IBWindowTemplateEditedContentRect - 371.NSWindowTemplate.visibleAtLaunch - 372.IBPluginDependency - 420.IBPluginDependency - 485.IBPluginDependency - 490.IBPluginDependency - 491.IBPluginDependency - 492.IBPluginDependency - 494.IBPluginDependency - 5.IBPluginDependency - 533.IBPluginDependency - 536.IBPluginDependency - 538.IBPluginDependency - 539.IBPluginDependency - 540.IBPluginDependency - 541.IBPluginDependency - 542.IBPluginDependency - 543.IBPluginDependency - 544.IBPluginDependency - 545.IBPluginDependency - 546.IBPluginDependency - 547.IBPluginDependency - 556.IBPluginDependency - 557.IBPluginDependency - 558.IBPluginDependency - 56.IBPluginDependency - 562.IBPluginDependency - 563.IBPluginDependency - 57.IBPluginDependency - 58.IBPluginDependency - 73.IBPluginDependency - 74.IBPluginDependency - 77.IBPluginDependency - 78.IBPluginDependency - 81.IBPluginDependency - 83.IBPluginDependency - 92.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{426, 688}, {800, 600}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.imagekit.ibplugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 569 - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - NSToolbarCustomizeToolbarItemImage - - - YES - {9, 8} - {7, 2} - {32, 32} - - - - diff --git a/examples/CorePlotGallery/src/mac/PlotGalleryController.h b/examples/CorePlotGallery/src/mac/PlotGalleryController.h index 8be0744f4..c8418c4a6 100644 --- a/examples/CorePlotGallery/src/mac/PlotGalleryController.h +++ b/examples/CorePlotGallery/src/mac/PlotGalleryController.h @@ -1,6 +1,6 @@ // -// PlotGalleryController.h -// CorePlotGallery +// PlotGalleryController.h +// CorePlotGallery // #import @@ -11,11 +11,13 @@ #import "PlotView.h" @interface PlotGalleryController : NSObject -@property (nonatomic, strong) PlotItem *plotItem; -@property (nonatomic, copy) NSString *currentThemeName; +@property (nonatomic, strong, nullable) PlotItem *plotItem; +@property (nonatomic, copy, nullable) NSString *currentThemeName; --(IBAction)themeSelectionDidChange:(id)sender; +-(IBAction)themeSelectionDidChange:(nonnull id)sender; @end diff --git a/examples/CorePlotGallery/src/mac/PlotGalleryController.m b/examples/CorePlotGallery/src/mac/PlotGalleryController.m index a0caba205..be4239e94 100644 --- a/examples/CorePlotGallery/src/mac/PlotGalleryController.m +++ b/examples/CorePlotGallery/src/mac/PlotGalleryController.m @@ -1,29 +1,34 @@ // -// PlotGalleryController.m -// CorePlotGallery +// PlotGalleryController.m +// CorePlotGallery // #import "PlotGalleryController.h" #import "dlfcn.h" -//#define EMBED_NU 1 +#import "PlotViewItem.h" static const CGFloat CPT_SPLIT_VIEW_MIN_LHS_WIDTH = 150.0; static NSString *const kThemeTableViewControllerNoTheme = @"None"; static NSString *const kThemeTableViewControllerDefaultTheme = @"Default"; +static NSString *const kCollectionHeader = @"CPTCollectionHeader"; +static NSString *const kCollectionItem = @"PlotViewItem"; + @interface PlotGalleryController() -@property (nonatomic, readwrite, strong) IBOutlet NSSplitView *splitView; -@property (nonatomic, readwrite, strong) IBOutlet NSScrollView *scrollView; -@property (nonatomic, readwrite, strong) IBOutlet IKImageBrowserView *imageBrowser; -@property (nonatomic, readwrite, strong) IBOutlet NSPopUpButton *themePopUpButton; +@property (nonatomic, readwrite, strong, nullable) IBOutlet NSSplitView *splitView; +@property (nonatomic, readwrite, strong, nullable) IBOutlet NSScrollView *scrollView; +@property (nonatomic, readwrite, strong, nullable) IBOutlet NSCollectionView *imageBrowser; +@property (nonatomic, readwrite, strong, nullable) IBOutlet NSPopUpButton *themePopUpButton; -@property (nonatomic, readwrite, strong) IBOutlet PlotView *hostingView; +@property (nonatomic, readwrite, strong, nullable) IBOutlet PlotView *hostingView; @end +#pragma mark - + @implementation PlotGalleryController @synthesize splitView; @@ -51,53 +56,36 @@ -(void)setupThemes -(void)awakeFromNib { + [super awakeFromNib]; + [[PlotGallery sharedPlotGallery] sortByTitle]; - [self.splitView setDelegate:self]; + self.splitView.delegate = self; - [self.imageBrowser setDelegate:self]; - [self.imageBrowser setDataSource:self]; - [self.imageBrowser setCellsStyleMask:IKCellsStyleShadowed | IKCellsStyleTitled]; //| IKCellsStyleSubtitled]; + NSCollectionView *browser = self.imageBrowser; - [self.imageBrowser reloadData]; + browser.delegate = self; + browser.dataSource = self; - [self.hostingView setDelegate:self]; + [browser registerClass:[NSTextField class] + forSupplementaryViewOfKind:NSCollectionElementKindSectionHeader + withIdentifier:kCollectionHeader]; - [self setupThemes]; + [browser reloadData]; -#ifdef EMBED_NU - // Setup a Nu console without the help of the Nu include files or - // an explicit link of the Nu framework, which may not be installed - nuHandle = dlopen("/Library/Frameworks/Nu.framework/Nu", RTLD_LAZY); - - if ( nuHandle ) { - NSString *consoleStartup = - @"(progn \ - (load \"console\") \ - (set $console ((NuConsoleWindowController alloc) init)))"; - - Class nuClass = NSClassFromString(@"Nu"); - id parser = [nuClass performSelector:@selector(parser)]; - id code = [parser performSelector:@selector(parse:) withObject:consoleStartup]; - [parser performSelector:@selector(eval:) withObject:code]; - } -#endif + self.hostingView.delegate = self; + + [self setupThemes]; } -(void)dealloc { [self setPlotItem:nil]; - [splitView setDelegate:nil]; - [imageBrowser setDataSource:nil]; - [imageBrowser setDelegate:nil]; - [hostingView setDelegate:nil]; - -#ifdef EMBED_NU - if ( nuHandle ) { - dlclose(nuHandle); - } -#endif + splitView.delegate = nil; + imageBrowser.dataSource = nil; + imageBrowser.delegate = nil; + hostingView.delegate = nil; } -(void)setFrameSize:(NSSize)newSize @@ -110,7 +98,7 @@ -(void)setFrameSize:(NSSize)newSize #pragma mark - #pragma mark Theme Selection --(CPTTheme *)currentTheme +-(nullable CPTTheme *)currentTheme { CPTTheme *theme; @@ -127,99 +115,249 @@ -(CPTTheme *)currentTheme return theme; } --(IBAction)themeSelectionDidChange:(id)sender +-(IBAction)themeSelectionDidChange:(nonnull id)sender { self.currentThemeName = [sender titleOfSelectedItem]; - [self.plotItem renderInView:self.hostingView withTheme:[self currentTheme] animated:YES]; + + PlotView *hostView = self.hostingView; + if ( hostView ) { + [self.plotItem renderInView:hostView withTheme:[self currentTheme] animated:YES]; + } +} + +#pragma mark - +#pragma mark Export Images + +-(void)exportTVImageWithSize:(CGSize)size toURL:(NSURL *)url showPlots:(BOOL)showPlots showBackground:(BOOL)showBackground +{ + if ( url ) { + CGRect imageFrame = CGRectMake(0.0, 0.0, size.width, size.height); + + NSView *imageView = [[NSView alloc] initWithFrame:NSRectFromCGRect(imageFrame)]; + [imageView setWantsLayer:YES]; + + [self.plotItem renderInView:imageView withTheme:nil animated:NO]; + + if ( !showBackground ) { + for ( CPTGraphHostingView *view in imageView.subviews ) { + CPTGraph *graph = view.hostedGraph; + + graph.fill = [CPTFill fillWithColor:[CPTColor clearColor]]; + graph.axisSet = nil; + + graph.plotAreaFrame.fill = [CPTFill fillWithColor:[CPTColor clearColor]]; + graph.plotAreaFrame.borderLineStyle = nil; + + graph.plotAreaFrame.plotArea.fill = [CPTFill fillWithColor:[CPTColor clearColor]]; + graph.plotAreaFrame.plotArea.borderLineStyle = nil; + } + } + + if ( !showPlots ) { + for ( CPTGraphHostingView *view in imageView.subviews ) { + for ( CPTPlot *plot in view.hostedGraph.allPlots ) { + plot.hidden = YES; + } + } + } + + CGSize boundsSize = imageFrame.size; + + NSBitmapImageRep *layerImage = [[NSBitmapImageRep alloc] + initWithBitmapDataPlanes:NULL + pixelsWide:(NSInteger)boundsSize.width + pixelsHigh:(NSInteger)boundsSize.height + bitsPerSample:8 + samplesPerPixel:4 + hasAlpha:YES + isPlanar:NO + colorSpaceName:NSCalibratedRGBColorSpace + bytesPerRow:(NSInteger)boundsSize.width * 4 + bitsPerPixel:32]; + + NSGraphicsContext *bitmapContext = [NSGraphicsContext graphicsContextWithBitmapImageRep:layerImage]; + CGContextRef context = (CGContextRef)bitmapContext.graphicsPort; + + CGContextClearRect(context, CGRectMake(0.0, 0.0, boundsSize.width, boundsSize.height)); + CGContextSetAllowsAntialiasing(context, true); + CGContextSetShouldSmoothFonts(context, false); + [imageView.layer renderInContext:context]; + CGContextFlush(context); + + NSImage *image = [[NSImage alloc] initWithSize:NSSizeFromCGSize(boundsSize)]; + [image addRepresentation:layerImage]; + + NSData *tiffData = image.TIFFRepresentation; + NSBitmapImageRep *tiffRep = [NSBitmapImageRep imageRepWithData:tiffData]; + NSData *pngData = [tiffRep representationUsingType:NSPNGFileType properties:@{}]; + + [pngData writeToURL:url atomically:NO]; + } +} + +-(IBAction)exportTVImagesToPNG:(id __unused)sender +{ + NSOpenPanel *pngSavingDialog = [NSOpenPanel openPanel]; + + pngSavingDialog.canChooseFiles = NO; + pngSavingDialog.canChooseDirectories = YES; + pngSavingDialog.allowsMultipleSelection = NO; + + if ( [pngSavingDialog runModal] == NSModalResponseOK ) { + NSURL *url = pngSavingDialog.URL; + if ( url ) { +// top image + CGSize topShelfSize = CGSizeMake(1920.0, 720.0); + + NSURL *topURL = [NSURL URLWithString:@"PlotGalleryTopShelf.png" relativeToURL:url]; + [self exportTVImageWithSize:topShelfSize toURL:topURL showPlots:YES showBackground:YES]; + +// large icon image + CGSize largeIconSize = CGSizeMake(1280.0, 768.0); + + NSURL *largeBackURL = [NSURL URLWithString:@"PlotGalleryLargeIconBack.png" relativeToURL:url]; + [self exportTVImageWithSize:largeIconSize toURL:largeBackURL showPlots:NO showBackground:YES]; + + NSURL *largeFrontURL = [NSURL URLWithString:@"PlotGalleryLargeIconFront.png" relativeToURL:url]; + [self exportTVImageWithSize:largeIconSize toURL:largeFrontURL showPlots:YES showBackground:NO]; + +// small icon image + CGSize smallIconSize = CGSizeMake(400.0, 240.0); + + NSURL *smallBackURL = [NSURL URLWithString:@"PlotGallerySmallIconBack.png" relativeToURL:url]; + [self exportTVImageWithSize:smallIconSize toURL:smallBackURL showPlots:NO showBackground:YES]; + + NSURL *smallFrontURL = [NSURL URLWithString:@"PlotGallerySmallIconFront.png" relativeToURL:url]; + [self exportTVImageWithSize:smallIconSize toURL:smallFrontURL showPlots:YES showBackground:NO]; + } + } } #pragma mark - #pragma mark PlotItem Property --(void)setPlotItem:(PlotItem *)item +-(void)setPlotItem:(nullable PlotItem *)item { if ( plotItem != item ) { [plotItem killGraph]; plotItem = item; - [plotItem renderInView:self.hostingView withTheme:[self currentTheme] animated:YES]; + PlotView *hostView = self.hostingView; + if ( hostView ) { + [plotItem renderInView:hostView withTheme:[self currentTheme] animated:YES]; + } } } #pragma mark - -#pragma mark IKImageBrowserViewDataSource methods +#pragma mark NSCollectionViewDataSource methods --(NSUInteger)numberOfItemsInImageBrowser:(IKImageBrowserView *)browser +-(NSInteger)numberOfSectionsInCollectionView:(nonnull NSCollectionView *__unused)collectionView { - return [[PlotGallery sharedPlotGallery] count]; + return (NSInteger)[PlotGallery sharedPlotGallery].numberOfSections; } --(id)imageBrowser:(IKImageBrowserView *)browser itemAtIndex:(NSUInteger)index +-(NSInteger)collectionView:(nonnull NSCollectionView *__unused)collectionView + numberOfItemsInSection:(NSInteger)section { - return [[PlotGallery sharedPlotGallery] objectInSection:0 atIndex:index]; + return (NSInteger)[[PlotGallery sharedPlotGallery] numberOfRowsInSection:(NSUInteger)section]; } --(NSUInteger)numberOfGroupsInImageBrowser:(IKImageBrowserView *)aBrowser +-(nonnull NSCollectionViewItem *)collectionView:(nonnull NSCollectionView *)collectionView + itemForRepresentedObjectAtIndexPath:(nonnull NSIndexPath *)indexPath { - return [[PlotGallery sharedPlotGallery] numberOfSections]; + PlotViewItem *item = [collectionView makeItemWithIdentifier:kCollectionItem + forIndexPath:indexPath]; + + PlotItem *thePlotItem = [[PlotGallery sharedPlotGallery] objectInSection:(NSUInteger)indexPath.section + atIndex:(NSUInteger)indexPath.item]; + + item.plotItemTitle.stringValue = thePlotItem.title; + item.plotItemImage.image = thePlotItem.image; + + return item; } --(NSDictionary *)imageBrowser:(IKImageBrowserView *)aBrowser groupAtIndex:(NSUInteger)index +-(nonnull NSView *) collectionView:(nonnull NSCollectionView *)collectionView + viewForSupplementaryElementOfKind:(nonnull NSCollectionViewSupplementaryElementKind)kind + atIndexPath:(nonnull NSIndexPath *)indexPath { - NSString *groupTitle = [[PlotGallery sharedPlotGallery] sectionTitles][index]; - - NSUInteger offset = 0; + NSString *identifier = nil; - for ( NSUInteger i = 0; i < index; i++ ) { - offset += [[PlotGallery sharedPlotGallery] numberOfRowsInSection:i]; + if ( [kind isEqual:NSCollectionElementKindSectionHeader] ) { + identifier = kCollectionHeader; + } + else { + identifier = @""; } - NSValue *groupRange = [NSValue valueWithRange:NSMakeRange(offset, [[PlotGallery sharedPlotGallery] numberOfRowsInSection:index])]; + NSString *content = [PlotGallery sharedPlotGallery].sectionTitles[(NSUInteger)indexPath.section]; - return @{ - IKImageBrowserGroupStyleKey: @(IKGroupDisclosureStyle), - IKImageBrowserGroupTitleKey: groupTitle, - IKImageBrowserGroupRangeKey: groupRange - }; + NSView *view = [collectionView makeSupplementaryViewOfKind:kind withIdentifier:identifier forIndexPath:indexPath]; + if ( content && [view isKindOfClass:[NSTextField class]] ) { + NSTextField *titleTextField = (NSTextField *)view; + + titleTextField.editable = NO; + titleTextField.selectable = NO; + titleTextField.backgroundColor = [NSColor controlAccentColor]; + titleTextField.textColor = [NSColor headerTextColor]; + titleTextField.font = [NSFont boldSystemFontOfSize:14.0]; + titleTextField.bordered = YES; + titleTextField.stringValue = content; + } + + return view; } #pragma mark - -#pragma mark IKImageBrowserViewDelegate methods +#pragma mark NSCollectionViewDelegate methods --(void)imageBrowserSelectionDidChange:(IKImageBrowserView *)browser +-(void) collectionView:(nonnull NSCollectionView *__unused)collectionView + didSelectItemsAtIndexPaths:(nonnull NSSet *)indexPaths { - NSUInteger index = [[browser selectionIndexes] firstIndex]; + NSUInteger section = NSNotFound; + NSUInteger index = NSNotFound; + NSIndexPath *path = indexPaths.allObjects.firstObject; + + if ( path ) { + section = (NSUInteger)path.section; + index = (NSUInteger)path.item; + } if ( index != NSNotFound ) { - PlotItem *item = [[PlotGallery sharedPlotGallery] objectInSection:0 atIndex:index]; - self.plotItem = item; + self.plotItem = [[PlotGallery sharedPlotGallery] objectInSection:section atIndex:index]; } } #pragma mark - #pragma mark NSSplitViewDelegate methods --(CGFloat)splitView:(NSSplitView *)sv constrainMinCoordinate:(CGFloat)coord ofSubviewAt:(NSInteger)index +-(CGFloat) splitView:(nonnull NSSplitView *__unused)sv + constrainMinCoordinate:(CGFloat)coord + ofSubviewAt:(NSInteger __unused)index { return coord + CPT_SPLIT_VIEW_MIN_LHS_WIDTH; } --(CGFloat)splitView:(NSSplitView *)sv constrainMaxCoordinate:(CGFloat)coord ofSubviewAt:(NSInteger)index +-(CGFloat) splitView:(nonnull NSSplitView *__unused)sv + constrainMaxCoordinate:(CGFloat)coord + ofSubviewAt:(NSInteger __unused)index { return coord - CPT_SPLIT_VIEW_MIN_LHS_WIDTH; } --(void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:(NSSize)oldSize +-(void) splitView:(nonnull NSSplitView *)sender + resizeSubviewsWithOldSize:(NSSize __unused)oldSize { - // Lock the LHS width - NSRect frame = [sender frame]; - NSView *lhs = [sender subviews][0]; - NSRect lhsRect = [lhs frame]; - NSView *rhs = [sender subviews][1]; - NSRect rhsRect = [rhs frame]; +// Lock the LHS width + NSRect frame = sender.frame; + NSView *lhs = sender.subviews[0]; + NSRect lhsRect = lhs.frame; + NSView *rhs = sender.subviews[1]; + NSRect rhsRect = rhs.frame; - CGFloat dividerThickness = [sender dividerThickness]; + CGFloat dividerThickness = sender.dividerThickness; lhsRect.size.height = frame.size.height; @@ -227,8 +365,8 @@ -(void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:(NSSize)oldSize rhsRect.size.height = frame.size.height; rhsRect.origin.x = lhsRect.size.width + dividerThickness; - [lhs setFrame:lhsRect]; - [rhs setFrame:rhsRect]; + lhs.frame = lhsRect; + rhs.frame = rhsRect; } @end diff --git a/examples/CorePlotGallery/src/mac/PlotView.h b/examples/CorePlotGallery/src/mac/PlotView.h index b2631d2dd..f4e9bc28a 100644 --- a/examples/CorePlotGallery/src/mac/PlotView.h +++ b/examples/CorePlotGallery/src/mac/PlotView.h @@ -1,6 +1,6 @@ // -// PlotView.h -// CorePlotGallery +// PlotView.h +// CorePlotGallery // #import @@ -11,7 +11,7 @@ @end -@interface PlotView : NSView -@property (nonatomic, weak) id delegate; +@interface PlotView : NSView +@property (nonatomic, weak, nullable) id delegate; @end diff --git a/examples/CorePlotGallery/src/mac/PlotView.m b/examples/CorePlotGallery/src/mac/PlotView.m index ffadad1d3..b769c4a9e 100644 --- a/examples/CorePlotGallery/src/mac/PlotView.m +++ b/examples/CorePlotGallery/src/mac/PlotView.m @@ -1,6 +1,6 @@ // -// PlotView.m -// CorePlotGallery +// PlotView.m +// CorePlotGallery // #import "PlotView.h" @@ -9,15 +9,15 @@ @implementation PlotView @synthesize delegate; --(instancetype)initWithFrame:(NSRect)frame +-(nonnull instancetype)initWithFrame:(NSRect)frame { - if ( (self = [super initWithFrame:frame]) ) { + if ((self = [super initWithFrame:frame])) { } return self; } --(void)drawRect:(NSRect)dirtyRect +-(void)drawRect:(NSRect __unused)dirtyRect { } diff --git a/examples/CorePlotGallery/src/mac/PlotViewItem.h b/examples/CorePlotGallery/src/mac/PlotViewItem.h new file mode 100644 index 000000000..c908c2f82 --- /dev/null +++ b/examples/CorePlotGallery/src/mac/PlotViewItem.h @@ -0,0 +1,13 @@ +// +// PlotViewItem.h +// CorePlotGallery +// + +#import + +@interface PlotViewItem : NSCollectionViewItem + +@property (nonatomic, readwrite, strong) IBOutlet NSImageView *plotItemImage; +@property (nonatomic, readwrite, strong) IBOutlet NSTextField *plotItemTitle; + +@end diff --git a/examples/CorePlotGallery/src/mac/PlotViewItem.m b/examples/CorePlotGallery/src/mac/PlotViewItem.m new file mode 100644 index 000000000..300f5e158 --- /dev/null +++ b/examples/CorePlotGallery/src/mac/PlotViewItem.m @@ -0,0 +1,13 @@ +// +// PlotViewItem.m +// CorePlotGallery +// + +#import "PlotViewItem.h" + +@implementation PlotViewItem + +@synthesize plotItemImage; +@synthesize plotItemTitle; + +@end diff --git a/examples/CorePlotGallery/src/mac/Plot_Gallery_MacAppDelegate.h b/examples/CorePlotGallery/src/mac/Plot_Gallery_MacAppDelegate.h index d5a7380d6..c4820dd23 100644 --- a/examples/CorePlotGallery/src/mac/Plot_Gallery_MacAppDelegate.h +++ b/examples/CorePlotGallery/src/mac/Plot_Gallery_MacAppDelegate.h @@ -1,12 +1,12 @@ // -// Plot_Gallery_MacAppDelegate.h -// CorePlotGallery +// Plot_Gallery_MacAppDelegate.h +// CorePlotGallery // #import @interface Plot_Gallery_MacAppDelegate : NSObject -@property (nonatomic, readwrite, strong) IBOutlet NSWindow *window; +@property (nonatomic, readwrite, strong, nullable) IBOutlet NSWindow *window; @end diff --git a/examples/CorePlotGallery/src/mac/Plot_Gallery_MacAppDelegate.m b/examples/CorePlotGallery/src/mac/Plot_Gallery_MacAppDelegate.m index a999dc691..b5c8479b6 100644 --- a/examples/CorePlotGallery/src/mac/Plot_Gallery_MacAppDelegate.m +++ b/examples/CorePlotGallery/src/mac/Plot_Gallery_MacAppDelegate.m @@ -1,6 +1,6 @@ // -// Plot_Gallery_MacAppDelegate.m -// CorePlotGallery +// Plot_Gallery_MacAppDelegate.m +// CorePlotGallery // #import "Plot_Gallery_MacAppDelegate.h" @@ -9,11 +9,11 @@ @implementation Plot_Gallery_MacAppDelegate @synthesize window; --(void)applicationDidFinishLaunching:(NSNotification *)aNotification +-(void)applicationDidFinishLaunching:(nonnull NSNotification *__unused)aNotification { } --(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender +-(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *__unused)sender { return YES; } diff --git a/examples/CorePlotGallery/src/mac/English.lproj/InfoPlist.strings b/examples/CorePlotGallery/src/mac/en.lproj/InfoPlist.strings similarity index 100% rename from examples/CorePlotGallery/src/mac/English.lproj/InfoPlist.strings rename to examples/CorePlotGallery/src/mac/en.lproj/InfoPlist.strings diff --git a/examples/CorePlotGallery/src/mac/en.lproj/MainMenu.strings b/examples/CorePlotGallery/src/mac/en.lproj/MainMenu.strings new file mode 100644 index 000000000..e11842f48 --- /dev/null +++ b/examples/CorePlotGallery/src/mac/en.lproj/MainMenu.strings @@ -0,0 +1,129 @@ + +/* Class = "NSMenuItem"; title = "Bring All to Front"; ObjectID = "5"; */ +"5.title" = "Bring All to Front"; + +/* Class = "NSMenuItem"; title = "Window"; ObjectID = "19"; */ +"19.title" = "Window"; + +/* Class = "NSMenuItem"; title = "Minimize"; ObjectID = "23"; */ +"23.title" = "Minimize"; + +/* Class = "NSMenu"; title = "Window"; ObjectID = "24"; */ +"24.title" = "Window"; + +/* Class = "NSMenu"; title = "AMainMenu"; ObjectID = "29"; */ +"29.title" = "AMainMenu"; + +/* Class = "NSMenuItem"; title = "Plot Gallery"; ObjectID = "56"; */ +"56.title" = "Plot Gallery"; + +/* Class = "NSMenu"; title = "Plot Gallery"; ObjectID = "57"; */ +"57.title" = "Plot Gallery"; + +/* Class = "NSMenuItem"; title = "About Plot Gallery"; ObjectID = "58"; */ +"58.title" = "About Plot Gallery"; + +/* Class = "NSMenuItem"; title = "Close"; ObjectID = "73"; */ +"73.title" = "Close"; + +/* Class = "NSMenuItem"; title = "Page Setup..."; ObjectID = "77"; */ +"77.title" = "Page Setup..."; + +/* Class = "NSMenuItem"; title = "Print…"; ObjectID = "78"; */ +"78.title" = "Print…"; + +/* Class = "NSMenu"; title = "File"; ObjectID = "81"; */ +"81.title" = "File"; + +/* Class = "NSMenuItem"; title = "File"; ObjectID = "83"; */ +"83.title" = "File"; + +/* Class = "NSMenuItem"; title = "Preferences…"; ObjectID = "129"; */ +"129.title" = "Preferences…"; + +/* Class = "NSMenu"; title = "Services"; ObjectID = "130"; */ +"130.title" = "Services"; + +/* Class = "NSMenuItem"; title = "Services"; ObjectID = "131"; */ +"131.title" = "Services"; + +/* Class = "NSMenuItem"; title = "Hide Plot Gallery"; ObjectID = "134"; */ +"134.title" = "Hide Plot Gallery"; + +/* Class = "NSMenuItem"; title = "Quit Plot Gallery"; ObjectID = "136"; */ +"136.title" = "Quit Plot Gallery"; + +/* Class = "NSMenuItem"; title = "Hide Others"; ObjectID = "145"; */ +"145.title" = "Hide Others"; + +/* Class = "NSMenuItem"; title = "Show All"; ObjectID = "150"; */ +"150.title" = "Show All"; + +/* Class = "NSMenuItem"; title = "Copy"; ObjectID = "197"; */ +"197.title" = "Copy"; + +/* Class = "NSMenuItem"; title = "Select All"; ObjectID = "198"; */ +"198.title" = "Select All"; + +/* Class = "NSMenuItem"; title = "Cut"; ObjectID = "199"; */ +"199.title" = "Cut"; + +/* Class = "NSMenuItem"; title = "Delete"; ObjectID = "202"; */ +"202.title" = "Delete"; + +/* Class = "NSMenuItem"; title = "Paste"; ObjectID = "203"; */ +"203.title" = "Paste"; + +/* Class = "NSMenu"; title = "Edit"; ObjectID = "205"; */ +"205.title" = "Edit"; + +/* Class = "NSMenuItem"; title = "Undo"; ObjectID = "207"; */ +"207.title" = "Undo"; + +/* Class = "NSMenuItem"; title = "Redo"; ObjectID = "215"; */ +"215.title" = "Redo"; + +/* Class = "NSMenuItem"; title = "Edit"; ObjectID = "217"; */ +"217.title" = "Edit"; + +/* Class = "NSMenuItem"; title = "Zoom"; ObjectID = "239"; */ +"239.title" = "Zoom"; + +/* Class = "NSMenuItem"; title = "View"; ObjectID = "295"; */ +"295.title" = "View"; + +/* Class = "NSMenu"; title = "View"; ObjectID = "296"; */ +"296.title" = "View"; + +/* Class = "NSMenuItem"; title = "Show Toolbar"; ObjectID = "297"; */ +"297.title" = "Show Toolbar"; + +/* Class = "NSMenuItem"; title = "Customize Toolbar…"; ObjectID = "298"; */ +"298.title" = "Customize Toolbar…"; + +/* Class = "NSWindow"; title = "Plot Gallery-Mac"; ObjectID = "371"; */ +"371.title" = "Plot Gallery-Mac"; + +/* Class = "NSMenuItem"; title = "Paste and Match Style"; ObjectID = "485"; */ +"485.title" = "Paste and Match Style"; + +/* Class = "NSMenuItem"; title = "Help"; ObjectID = "490"; */ +"490.title" = "Help"; + +/* Class = "NSMenu"; title = "Help"; ObjectID = "491"; */ +"491.title" = "Help"; + +/* Class = "NSMenuItem"; title = "Plot Gallery Help"; ObjectID = "492"; */ +"492.title" = "Plot Gallery Help"; + +/* Class = "NSMenu"; title = "OtherViews"; ObjectID = "558"; */ +"558.title" = "OtherViews"; + +/* Class = "NSToolbarItem"; label = "Theme"; ObjectID = "562"; */ +"562.label" = "Theme"; + +/* Class = "NSToolbarItem"; paletteLabel = "Theme"; ObjectID = "562"; */ +"562.paletteLabel" = "Theme"; + +/* Class = "NSMenuItem"; title = "Save TV Images…"; ObjectID = "JRn-xt-TSn"; */ +"JRn-xt-TSn.title" = "Save TV Images…"; diff --git a/examples/CorePlotGallery/src/mac/main.m b/examples/CorePlotGallery/src/mac/main.m index 90ccb7f4b..e0c7c6e57 100644 --- a/examples/CorePlotGallery/src/mac/main.m +++ b/examples/CorePlotGallery/src/mac/main.m @@ -1,6 +1,6 @@ // -// main.m -// CorePlotGallery +// main.m +// CorePlotGallery // #import diff --git a/examples/CorePlotGallery/src/plots/AxisDemo.h b/examples/CorePlotGallery/src/plots/AxisDemo.h index 46fc89979..05e4fb001 100644 --- a/examples/CorePlotGallery/src/plots/AxisDemo.h +++ b/examples/CorePlotGallery/src/plots/AxisDemo.h @@ -1,6 +1,6 @@ // -// AxisDemo.h -// Plot Gallery-Mac +// AxisDemo.h +// Plot Gallery-Mac // #import "PlotItem.h" diff --git a/examples/CorePlotGallery/src/plots/AxisDemo.m b/examples/CorePlotGallery/src/plots/AxisDemo.m index ed57b52d6..07730cda7 100644 --- a/examples/CorePlotGallery/src/plots/AxisDemo.m +++ b/examples/CorePlotGallery/src/plots/AxisDemo.m @@ -1,6 +1,6 @@ // -// AxisDemo.m -// Plot Gallery-Mac +// AxisDemo.m +// Plot Gallery-Mac // #import "AxisDemo.h" @@ -12,9 +12,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Axis Demo"; self.section = kDemoPlots; } @@ -22,7 +22,7 @@ -(instancetype)init return self; } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { #if TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; @@ -52,8 +52,8 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Setup plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(-10.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.5) length:CPTDecimalFromDouble(10.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(-10.0)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.5 length:@10.0]; // Line styles CPTMutableLineStyle *axisLineStyle = [CPTMutableLineStyle lineStyle]; @@ -76,22 +76,22 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Label x axis with a fixed interval policy CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.separateLayers = NO; - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.5); - x.majorIntervalLength = CPTDecimalFromDouble(0.5); - x.minorTicksPerInterval = 4; - x.tickDirection = CPTSignNone; - x.axisLineStyle = axisLineStyle; - x.majorTickLength = 12.0; - x.majorTickLineStyle = axisLineStyle; - x.majorGridLineStyle = majorGridLineStyle; - x.minorTickLength = 8.0; - x.minorGridLineStyle = minorGridLineStyle; - x.title = @"X Axis"; - x.titleTextStyle = axisTitleTextStyle; - x.titleOffset = self.titleSize; - x.alternatingBandFills = @[[[CPTColor redColor] colorWithAlphaComponent:CPTFloat(0.1)], [[CPTColor greenColor] colorWithAlphaComponent:CPTFloat(0.1)]]; - x.delegate = self; + x.separateLayers = NO; + x.orthogonalPosition = @0.5; + x.majorIntervalLength = @0.5; + x.minorTicksPerInterval = 4; + x.tickDirection = CPTSignNone; + x.axisLineStyle = axisLineStyle; + x.majorTickLength = 12.0; + x.majorTickLineStyle = axisLineStyle; + x.majorGridLineStyle = majorGridLineStyle; + x.minorTickLength = 8.0; + x.minorGridLineStyle = minorGridLineStyle; + x.title = @"X Axis"; + x.titleTextStyle = axisTitleTextStyle; + x.titleOffset = self.titleSize; + x.alternatingBandFills = @[[[CPTColor redColor] colorWithAlphaComponent:CPTFloat(0.1)], [[CPTColor greenColor] colorWithAlphaComponent:CPTFloat(0.1)]]; + x.delegate = self; // Label y with an automatic labeling policy. axisLineStyle.lineColor = [CPTColor greenColor]; @@ -114,8 +114,8 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP y.delegate = self; CPTFill *bandFill = [CPTFill fillWithColor:[[CPTColor darkGrayColor] colorWithAlphaComponent:0.5]]; - [y addBackgroundLimitBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(7.0) length:CPTDecimalFromDouble(1.5)] fill:bandFill]]; - [y addBackgroundLimitBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.5) length:CPTDecimalFromDouble(3.0)] fill:bandFill]]; + [y addBackgroundLimitBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:@7.0 length:@1.5] fill:bandFill]]; + [y addBackgroundLimitBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:@1.5 length:@3.0] fill:bandFill]]; // Label y2 with an equal division labeling policy. axisLineStyle.lineColor = [CPTColor orangeColor]; @@ -123,7 +123,7 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP CPTXYAxis *y2 = [[CPTXYAxis alloc] init]; y2.coordinate = CPTCoordinateY; y2.plotSpace = plotSpace; - y2.orthogonalCoordinateDecimal = CPTDecimalFromDouble(-10.0); + y2.orthogonalPosition = @(-10.0); y2.labelingPolicy = CPTAxisLabelingPolicyEqualDivisions; y2.separateLayers = NO; y2.preferredNumberOfMajorTicks = 6; @@ -146,11 +146,9 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP #pragma mark - Axis delegate --(void)axis:(CPTAxis *)axis labelWasSelected:(CPTAxisLabel *)label +-(void)axis:(nonnull CPTAxis *)axis labelWasSelected:(nonnull CPTAxisLabel *)label { - NSDecimal labelLocation = label.tickLocation; - - NSLog( @"%@ label was selected at location %@", axis.title, NSDecimalString(&labelLocation, nil) ); + NSLog(@"%@ label was selected at location %@", axis.title, label.tickLocation); } @end diff --git a/examples/CorePlotGallery/src/plots/CandlestickPlot.h b/examples/CorePlotGallery/src/plots/CandlestickPlot.h index 92e0c6424..e015ab15c 100644 --- a/examples/CorePlotGallery/src/plots/CandlestickPlot.h +++ b/examples/CorePlotGallery/src/plots/CandlestickPlot.h @@ -1,10 +1,12 @@ // -// CandlestickPlot.h -// CorePlotGallery +// CandlestickPlot.h +// CorePlotGallery // #import "PlotItem.h" -@interface CandlestickPlot : PlotItem +@interface CandlestickPlot : PlotItem @end diff --git a/examples/CorePlotGallery/src/plots/CandlestickPlot.m b/examples/CorePlotGallery/src/plots/CandlestickPlot.m index 350069934..961ddc972 100644 --- a/examples/CorePlotGallery/src/plots/CandlestickPlot.m +++ b/examples/CorePlotGallery/src/plots/CandlestickPlot.m @@ -1,6 +1,6 @@ // -// CandlestickPlot.m -// CorePlotGallery +// CandlestickPlot.m +// CorePlotGallery // #import "CandlestickPlot.h" @@ -9,8 +9,8 @@ @interface CandlestickPlot() -@property (nonatomic, readwrite, strong) CPTGraph *graph; -@property (nonatomic, readwrite, strong) NSArray *plotData; +@property (nonatomic, readwrite, strong, nullable) CPTGraph *graph; +@property (nonatomic, readwrite, strong, nonnull) NSArray *plotData; @end @@ -24,11 +24,11 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { graph = nil; - plotData = nil; + plotData = @[]; self.title = @"Candlestick Plot"; self.section = kFinancialPlots; @@ -39,15 +39,15 @@ -(instancetype)init -(void)generateData { - if ( !self.plotData ) { - NSMutableArray *newData = [NSMutableArray array]; + if ( self.plotData.count == 0 ) { + NSMutableArray *newData = [NSMutableArray array]; for ( NSUInteger i = 0; i < 8; i++ ) { NSTimeInterval x = oneDay * i; double rOpen = 3.0 * arc4random() / (double)UINT32_MAX + 1.0; double rClose = (arc4random() / (double)UINT32_MAX - 0.5) * 0.125 + rOpen; - double rHigh = MAX( rOpen, MAX(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen) ); - double rLow = MIN( rOpen, MIN(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen) ); + double rHigh = MAX(rOpen, MAX(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen)); + double rLow = MIN(rOpen, MIN(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen)); [newData addObject: @{ @(CPTTradingRangePlotFieldX): @(x), @@ -62,14 +62,14 @@ -(void)generateData } } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { // If you make sure your dates are calculated at noon, you shouldn't have to // worry about daylight savings. If you use midnight, you will have to adjust // for daylight savings time. NSDate *refDate = [NSDate dateWithTimeIntervalSinceReferenceDate:oneDay / 2.0]; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -94,7 +94,7 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Axes CPTXYAxisSet *xyAxisSet = (CPTXYAxisSet *)newGraph.axisSet; CPTXYAxis *xAxis = xyAxisSet.xAxis; - xAxis.majorIntervalLength = CPTDecimalFromDouble(oneDay); + xAxis.majorIntervalLength = @(oneDay); xAxis.minorTicksPerInterval = 0; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.dateStyle = kCFDateFormatterShortStyle; @@ -103,14 +103,18 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP xAxis.labelFormatter = timeFormatter; CPTLineCap *lineCap = [[CPTLineCap alloc] init]; - lineCap.lineStyle = xAxis.axisLineStyle; - lineCap.lineCapType = CPTLineCapTypeSweptArrow; - lineCap.size = CGSizeMake( self.titleSize * CPTFloat(0.5), self.titleSize * CPTFloat(0.625) ); - lineCap.fill = [CPTFill fillWithColor:xAxis.axisLineStyle.lineColor]; + lineCap.lineStyle = xAxis.axisLineStyle; + lineCap.lineCapType = CPTLineCapTypeSweptArrow; + lineCap.size = CGSizeMake(self.titleSize * CPTFloat(0.5), self.titleSize * CPTFloat(0.625)); + + CPTColor *lineColor = xAxis.axisLineStyle.lineColor; + if ( lineColor ) { + lineCap.fill = [CPTFill fillWithColor:lineColor]; + } xAxis.axisLineCapMax = lineCap; CPTXYAxis *yAxis = xyAxisSet.yAxis; - yAxis.orthogonalCoordinateDecimal = CPTDecimalFromDouble(-0.5 * oneDay); + yAxis.orthogonalPosition = @(-0.5 * oneDay); // Line plot with gradient fill CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] initWithFrame:newGraph.bounds]; @@ -125,14 +129,14 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP areaGradient.angle = -90.0; CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient]; dataSourceLinePlot.areaFill = areaGradientFill; - dataSourceLinePlot.areaBaseValue = CPTDecimalFromDouble(0.0); + dataSourceLinePlot.areaBaseValue = @0.0; areaColor = [CPTColor colorWithComponentRed:CPTFloat(0.0) green:CPTFloat(1.0) blue:CPTFloat(0.0) alpha:CPTFloat(0.6)]; areaGradient = [CPTGradient gradientWithBeginningColor:[CPTColor clearColor] endingColor:areaColor]; areaGradient.angle = -90.0; areaGradientFill = [CPTFill fillWithGradient:areaGradient]; dataSourceLinePlot.areaFill2 = areaGradientFill; - dataSourceLinePlot.areaBaseValue2 = CPTDecimalFromDouble(5.0); + dataSourceLinePlot.areaBaseValue2 = @5.0; CPTMutableShadow *whiteShadow = [CPTMutableShadow shadow]; whiteShadow.shadowOffset = CGSizeMake(2.0, -2.0); @@ -168,24 +172,26 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP newGraph.legend.borderLineStyle = newGraph.plotAreaFrame.borderLineStyle; newGraph.legend.cornerRadius = 5.0; newGraph.legend.swatchCornerRadius = 5.0; - newGraph.legendAnchor = CPTRectAnchorBottom; - newGraph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(3.0) ); + newGraph.legend.swatchLayout = CPTLegendSwatchLayoutRight; + + newGraph.legendAnchor = CPTRectAnchorBottom; + newGraph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(3.0)); // Set plot ranges CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-0.5 * oneDay) length:CPTDecimalFromDouble(oneDay * self.plotData.count)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromInteger(0) length:CPTDecimalFromInteger(4)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-0.5 * oneDay) length:@(oneDay * self.plotData.count)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; } #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSDecimalNumber *num = [NSDecimalNumber zero]; @@ -209,10 +215,15 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI return num; } +-(nullable NSNumber *)barWidthForTradingRangePlot:(nonnull CPTTradingRangePlot *__unused)plot recordIndex:(NSUInteger __unused)idx +{ + return @(arc4random_uniform(85) + 15); +} + #pragma mark - #pragma mark Plot Delegate Methods --(void)tradingRangePlot:(CPTTradingRangePlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index +-(void)tradingRangePlot:(nonnull CPTTradingRangePlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index { NSLog(@"Bar for '%@' was selected at index %d.", plot.identifier, (int)index); } diff --git a/examples/CorePlotGallery/src/plots/ColoredBarChart.m b/examples/CorePlotGallery/src/plots/ColoredBarChart.m index 8c4d35750..e2a607c84 100644 --- a/examples/CorePlotGallery/src/plots/ColoredBarChart.m +++ b/examples/CorePlotGallery/src/plots/ColoredBarChart.m @@ -2,7 +2,7 @@ @interface ColoredBarChart() -@property (nonatomic, readwrite, strong) NSArray *plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray *plotData; @end @@ -15,9 +15,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Colored Bar Chart"; self.section = kBarPlots; } @@ -27,8 +27,8 @@ -(instancetype)init -(void)generateData { - if ( self.plotData == nil ) { - NSMutableArray *contentArray = [NSMutableArray array]; + if ( self.plotData.count == 0 ) { + CPTMutableNumberArray *contentArray = [NSMutableArray array]; for ( NSUInteger i = 0; i < 8; i++ ) { [contentArray addObject:@(10.0 * arc4random() / (double)UINT32_MAX + 5.0)]; } @@ -36,9 +36,9 @@ -(void)generateData } } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -67,20 +67,20 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; CPTXYAxis *x = axisSet.xAxis; { - x.majorIntervalLength = CPTDecimalFromInteger(1); - x.minorTicksPerInterval = 0; - x.orthogonalCoordinateDecimal = CPTDecimalFromInteger(0); - x.majorGridLineStyle = majorGridLineStyle; - x.minorGridLineStyle = minorGridLineStyle; - x.axisLineStyle = nil; - x.majorTickLineStyle = nil; - x.minorTickLineStyle = nil; - x.labelFormatter = nil; + x.majorIntervalLength = @1.0; + x.minorTicksPerInterval = 0; + x.orthogonalPosition = @0.0; + x.majorGridLineStyle = majorGridLineStyle; + x.minorGridLineStyle = minorGridLineStyle; + x.axisLineStyle = nil; + x.majorTickLineStyle = nil; + x.minorTickLineStyle = nil; + x.labelFormatter = nil; } CPTXYAxis *y = axisSet.yAxis; { - y.majorIntervalLength = CPTDecimalFromInteger(10); + y.majorIntervalLength = @10.0; y.minorTicksPerInterval = 9; y.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0]; y.preferredNumberOfMajorTicks = 8; @@ -105,7 +105,7 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Create bar plot CPTBarPlot *barPlot = [[CPTBarPlot alloc] init]; barPlot.lineStyle = barLineStyle; - barPlot.barWidth = CPTDecimalFromFloat(0.75f); // bar is 75% of the available space + barPlot.barWidth = @0.75; // bar is 75% of the available space barPlot.barCornerRadius = 4.0; barPlot.barsAreHorizontal = NO; barPlot.dataSource = self; @@ -115,11 +115,11 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Plot space CPTMutablePlotRange *barRange = [[barPlot plotRangeEnclosingBars] mutableCopy]; - [barRange expandRangeByFactor:CPTDecimalFromDouble(1.05)]; + [barRange expandRangeByFactor:@1.05]; CPTXYPlotSpace *barPlotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace; barPlotSpace.xRange = barRange; - barPlotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(16.0f)]; + barPlotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@16.0]; // Add legend CPTLegend *theLegend = [CPTLegend legendWithGraph:graph]; @@ -131,28 +131,29 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP theLegend.textStyle = whiteTextStyle; theLegend.numberOfRows = 1; - graph.legend = theLegend; - graph.legendAnchor = CPTRectAnchorTop; - graph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(-2.625) ); + graph.legend = theLegend; + graph.legend.swatchLayout = CPTLegendSwatchLayoutTop; + graph.legendAnchor = CPTRectAnchorTop; + graph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(-2.625)); } #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(NSArray *)numbersForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange +-(nullable NSArray *)numbersForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange { - NSArray *nums = nil; + CPTNumberArray *nums = nil; switch ( fieldEnum ) { case CPTBarPlotFieldBarLocation: nums = [NSMutableArray arrayWithCapacity:indexRange.length]; for ( NSUInteger i = indexRange.location; i < NSMaxRange(indexRange); i++ ) { - [(NSMutableArray *)nums addObject : @(i)]; + [(NSMutableArray *) nums addObject:@(i)]; } break; @@ -167,7 +168,7 @@ -(NSArray *)numbersForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordInd return nums; } --(CPTFill *)barFillForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)index +-(nullable CPTFill *)barFillForBarPlot:(nonnull CPTBarPlot *__unused)barPlot recordIndex:(NSUInteger)index { CPTColor *color = nil; @@ -205,6 +206,7 @@ -(CPTFill *)barFillForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)inde break; default: + color = [CPTColor blackColor]; break; } @@ -213,7 +215,12 @@ -(CPTFill *)barFillForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)inde return [CPTFill fillWithGradient:fillGradient]; } --(NSString *)legendTitleForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)index +-(nullable NSNumber *)barWidthForBarPlot:(nonnull CPTBarPlot *__unused)barPlot recordIndex:(NSUInteger __unused)idx +{ + return @((double)(arc4random_uniform(50) + 25) / 100.0); +} + +-(nullable NSString *)legendTitleForBarPlot:(nonnull CPTBarPlot *__unused)barPlot recordIndex:(NSUInteger)index { return [NSString stringWithFormat:@"Bar %lu", (unsigned long)(index + 1)]; } diff --git a/examples/CorePlotGallery/src/plots/CompositePlot.h b/examples/CorePlotGallery/src/plots/CompositePlot.h index 1b8f875fa..51fdabfe4 100644 --- a/examples/CorePlotGallery/src/plots/CompositePlot.h +++ b/examples/CorePlotGallery/src/plots/CompositePlot.h @@ -1,6 +1,6 @@ // -// CompositePlot.h -// CorePlotGallery +// CompositePlot.h +// CorePlotGallery // #import "PlotItem.h" @@ -10,11 +10,11 @@ CPTScatterPlotDelegate, CPTBarPlotDelegate> -@property (readwrite, strong, nonatomic) NSMutableArray *dataForChart; -@property (readwrite, strong, nonatomic) NSMutableArray *dataForPlot; +@property (readwrite, strong, nonatomic, nonnull) CPTMutableNumberArray *dataForChart; +@property (readwrite, strong, nonatomic, nonnull) NSMutableArray *dataForPlot; --(void)renderScatterPlotInHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme; --(void)renderBarPlotInHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme; --(void)renderPieChartInHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme; +-(void)renderScatterPlotInHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme; +-(void)renderBarPlotInHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme; +-(void)renderPieChartInHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme; @end diff --git a/examples/CorePlotGallery/src/plots/CompositePlot.m b/examples/CorePlotGallery/src/plots/CompositePlot.m index f7e399bcb..9a3c140b8 100644 --- a/examples/CorePlotGallery/src/plots/CompositePlot.m +++ b/examples/CorePlotGallery/src/plots/CompositePlot.m @@ -1,6 +1,6 @@ // -// CompositePlot.m -// CorePlotGallery +// CompositePlot.m +// CorePlotGallery // #import "CompositePlot.h" @@ -9,13 +9,13 @@ @interface CompositePlot() @property (nonatomic, readwrite, assign) NSInteger selectedIndex; -@property (nonatomic, readwrite, strong) CPTGraphHostingView *scatterPlotView; -@property (nonatomic, readwrite, strong) CPTGraphHostingView *barChartView; -@property (nonatomic, readwrite, strong) CPTGraphHostingView *pieChartView; +@property (nonatomic, readwrite, strong, nullable) CPTGraphHostingView *scatterPlotView; +@property (nonatomic, readwrite, strong, nullable) CPTGraphHostingView *barChartView; +@property (nonatomic, readwrite, strong, nullable) CPTGraphHostingView *pieChartView; -@property (nonatomic, readwrite, strong) CPTXYGraph *scatterPlot; -@property (nonatomic, readwrite, strong) CPTXYGraph *barChart; -@property (nonatomic, readwrite, strong) CPTXYGraph *pieChart; +@property (nonatomic, readwrite, strong, nullable) CPTXYGraph *scatterPlot; +@property (nonatomic, readwrite, strong, nullable) CPTXYGraph *barChart; +@property (nonatomic, readwrite, strong, nullable) CPTXYGraph *pieChart; @end @@ -38,9 +38,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { selectedIndex = NSNotFound; self.title = @"Composite Plot"; @@ -53,33 +53,34 @@ -(instancetype)init #pragma mark - #pragma mark Plot construction methods -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else -(void)setFrameSize:(NSSize)newSize { - self.scatterPlotView.frame = NSMakeRect( 0.0, - 0.0, - newSize.width, - newSize.height * CPTFloat(0.5) ); + self.scatterPlotView.frame = NSMakeRect(0.0, + 0.0, + newSize.width, + newSize.height * CPTFloat(0.5)); - self.barChartView.frame = NSMakeRect( 0.0, - newSize.height * CPTFloat(0.5), - newSize.width * CPTFloat(0.5), - newSize.height * CPTFloat(0.5) ); + self.barChartView.frame = NSMakeRect(0.0, + newSize.height * CPTFloat(0.5), + newSize.width * CPTFloat(0.5), + newSize.height * CPTFloat(0.5)); - self.pieChartView.frame = NSMakeRect( newSize.width * CPTFloat(0.5), - newSize.height * CPTFloat(0.5), - newSize.width * CPTFloat(0.5), - newSize.height * CPTFloat(0.5) ); + self.pieChartView.frame = NSMakeRect(newSize.width * CPTFloat(0.5), + newSize.height * CPTFloat(0.5), + newSize.width * CPTFloat(0.5), + newSize.height * CPTFloat(0.5)); [self.scatterPlotView setNeedsDisplay:YES]; [self.barChartView setNeedsDisplay:YES]; [self.pieChartView setNeedsDisplay:YES]; } + #endif --(void)renderInView:(PlotGalleryNativeView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInView:(nonnull PlotGalleryNativeView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { [self killGraph]; @@ -87,7 +88,7 @@ -(void)renderInView:(PlotGalleryNativeView *)hostingView withTheme:(CPTTheme *)t CPTGraphHostingView *barView = [[CPTGraphHostingView alloc] init]; CPTGraphHostingView *pieView = [[CPTGraphHostingView alloc] init]; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE for ( UIView *view in @[scatterView, barView, pieView] ) { view.translatesAutoresizingMaskIntoConstraints = NO; [hostingView addSubview:view]; @@ -166,28 +167,27 @@ -(void)renderInView:(PlotGalleryNativeView *)hostingView withTheme:(CPTTheme *)t attribute:NSLayoutAttributeTop multiplier:1.0 constant:0.0]]; - #else - NSRect viewRect = [hostingView bounds]; + NSRect viewRect = hostingView.bounds; - scatterView.frame = NSMakeRect( 0.0, - 0.0, - viewRect.size.width, - viewRect.size.height * CPTFloat(0.5) ); + scatterView.frame = NSMakeRect(0.0, + 0.0, + viewRect.size.width, + viewRect.size.height * CPTFloat(0.5)); - barView.frame = NSMakeRect( 0.0, - viewRect.size.height * CPTFloat(0.5), - viewRect.size.width * CPTFloat(0.5), - viewRect.size.height * CPTFloat(0.5) ); + barView.frame = NSMakeRect(0.0, + viewRect.size.height * CPTFloat(0.5), + viewRect.size.width * CPTFloat(0.5), + viewRect.size.height * CPTFloat(0.5)); - pieView.frame = NSMakeRect( viewRect.size.width * CPTFloat(0.5), - viewRect.size.height * CPTFloat(0.5), - viewRect.size.width * CPTFloat(0.5), - viewRect.size.height * CPTFloat(0.5) ); + pieView.frame = NSMakeRect(viewRect.size.width * CPTFloat(0.5), + viewRect.size.height * CPTFloat(0.5), + viewRect.size.width * CPTFloat(0.5), + viewRect.size.height * CPTFloat(0.5)); for ( NSView *view in @[scatterView, barView, pieView] ) { [view setAutoresizesSubviews:YES]; - [view setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; + view.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; [hostingView addSubview:view]; } @@ -221,46 +221,47 @@ -(void)killGraph [super killGraph]; } --(void)renderScatterPlotInHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme +-(void)renderScatterPlotInHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme { // Create graph from theme -#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR +#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR CGRect bounds = self.scatterPlotView.bounds; #else CGRect bounds = NSRectToCGRect(self.scatterPlotView.bounds); #endif - self.scatterPlot = [[CPTXYGraph alloc] initWithFrame:bounds]; - [self addGraph:self.scatterPlot toHostingView:hostingView]; + CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:bounds]; + self.scatterPlot = newGraph; - [self applyTheme:theme toGraph:self.scatterPlot withDefault:[CPTTheme themeNamed:kCPTDarkGradientTheme]]; + [self addGraph:newGraph toHostingView:hostingView]; + [self applyTheme:theme toGraph:newGraph withDefault:[CPTTheme themeNamed:kCPTDarkGradientTheme]]; self.scatterPlot.plotAreaFrame.plotArea.delegate = self; // Setup plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.scatterPlot.defaultPlotSpace; plotSpace.allowsUserInteraction = YES; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) length:CPTDecimalFromDouble(2.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) length:CPTDecimalFromDouble(3.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@2.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@3.0]; // Axes CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.scatterPlot.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(0.5); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(2.0); - x.minorTicksPerInterval = 2; - NSArray *exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(2.99) length:CPTDecimalFromDouble(0.02)]]; + x.majorIntervalLength = @0.5; + x.orthogonalPosition = @2.0; + x.minorTicksPerInterval = 2; + CPTPlotRangeArray *exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@1.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@0.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@2.99 length:@0.02]]; x.labelExclusionRanges = exclusionRanges; CPTXYAxis *y = axisSet.yAxis; - y.majorIntervalLength = CPTDecimalFromDouble(0.5); - y.minorTicksPerInterval = 5; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(2.0); - exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.99) length:CPTDecimalFromDouble(0.02)], - [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(3.99) length:CPTDecimalFromDouble(0.02)]]; + y.majorIntervalLength = @0.5; + y.minorTicksPerInterval = 5; + y.orthogonalPosition = @2.0; + exclusionRanges = @[[CPTPlotRange plotRangeWithLocation:@1.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@0.99 length:@0.02], + [CPTPlotRange plotRangeWithLocation:@3.99 length:@0.02]]; y.labelExclusionRanges = exclusionRanges; // Create a blue plot area @@ -281,7 +282,7 @@ -(void)renderScatterPlotInHostingView:(CPTGraphHostingView *)hostingView withThe areaGradient1.angle = -90.0; CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient1]; boundLinePlot.areaFill = areaGradientFill; - boundLinePlot.areaBaseValue = [[NSDecimalNumber zero] decimalValue]; + boundLinePlot.areaBaseValue = @0.0; boundLinePlot.delegate = self; // Add plot symbols @@ -311,14 +312,14 @@ -(void)renderScatterPlotInHostingView:(CPTGraphHostingView *)hostingView withThe areaGradient.angle = -90.0; areaGradientFill = [CPTFill fillWithGradient:areaGradient]; dataSourceLinePlot.areaFill = areaGradientFill; - dataSourceLinePlot.areaBaseValue = CPTDecimalFromDouble(1.75); + dataSourceLinePlot.areaBaseValue = @1.75; // Animate in the new plot, as an example dataSourceLinePlot.opacity = 1.0; [self.scatterPlot addPlot:dataSourceLinePlot]; // Add some initial data - NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100]; + NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100]; for ( NSUInteger i = 0; i < 60; i++ ) { NSNumber *xVal = @(1 + i * 0.05); NSNumber *yVal = @(1.2 * arc4random() / (double)UINT32_MAX + 1.2); @@ -328,43 +329,45 @@ -(void)renderScatterPlotInHostingView:(CPTGraphHostingView *)hostingView withThe self.dataForPlot = contentArray; } --(void)renderBarPlotInHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme +-(void)renderBarPlotInHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); #endif - self.barChart = [[CPTXYGraph alloc] initWithFrame:bounds]; - [self addGraph:self.barChart toHostingView:hostingView]; - [self applyTheme:theme toGraph:self.barChart withDefault:[CPTTheme themeNamed:kCPTDarkGradientTheme]]; + CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:bounds]; + self.barChart = newGraph; + + [self addGraph:newGraph toHostingView:hostingView]; + [self applyTheme:theme toGraph:newGraph withDefault:[CPTTheme themeNamed:kCPTDarkGradientTheme]]; self.barChart.plotAreaFrame.masksToBorder = NO; CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.barChart.defaultPlotSpace; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(300.0f)]; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-1.0f) length:CPTDecimalFromFloat(17.0f)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@300.0]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@17.0]; CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.barChart.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.axisLineStyle = nil; - x.majorTickLineStyle = nil; - x.minorTickLineStyle = nil; - x.majorIntervalLength = CPTDecimalFromDouble(5.0); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); + x.axisLineStyle = nil; + x.majorTickLineStyle = nil; + x.minorTickLineStyle = nil; + x.majorIntervalLength = @5.0; + x.orthogonalPosition = @0.0; // Define some custom labels for the data elements x.labelOffset = 2.0; x.labelRotation = CPTFloat(M_PI_4); x.labelingPolicy = CPTAxisLabelingPolicyNone; - NSArray *customTickLocations = @[@1, @5, @10, @15]; - NSArray *xAxisLabels = @[@"Label A", @"Label B", @"Label C", @"Label D"]; - NSUInteger labelLocation = 0; - NSMutableSet *customLabels = [NSMutableSet setWithCapacity:[xAxisLabels count]]; + CPTNumberArray *customTickLocations = @[@1, @5, @10, @15]; + CPTStringArray *xAxisLabels = @[@"Label A", @"Label B", @"Label C", @"Label D"]; + NSUInteger labelLocation = 0; + CPTMutableAxisLabelSet *customLabels = [NSMutableSet setWithCapacity:xAxisLabels.count]; for ( NSNumber *tickLocation in customTickLocations ) { CPTAxisLabel *newLabel = [[CPTAxisLabel alloc] initWithText:xAxisLabels[labelLocation++] textStyle:x.labelTextStyle]; - newLabel.tickLocation = tickLocation.decimalValue; + newLabel.tickLocation = tickLocation; newLabel.offset = x.labelOffset; newLabel.rotation = CPTFloat(M_PI_4); [customLabels addObject:newLabel]; @@ -373,11 +376,11 @@ -(void)renderBarPlotInHostingView:(CPTGraphHostingView *)hostingView withTheme:( x.axisLabels = customLabels; CPTXYAxis *y = axisSet.yAxis; - y.axisLineStyle = nil; - y.majorTickLineStyle = nil; - y.minorTickLineStyle = nil; - y.majorIntervalLength = CPTDecimalFromDouble(50.0); - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); + y.axisLineStyle = nil; + y.majorTickLineStyle = nil; + y.minorTickLineStyle = nil; + y.majorIntervalLength = @50.0; + y.orthogonalPosition = @0.0; // First bar plot CPTBarPlot *barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor redColor] horizontalBars:NO]; @@ -389,16 +392,16 @@ -(void)renderBarPlotInHostingView:(CPTGraphHostingView *)hostingView withTheme:( // Second bar plot barPlot = [CPTBarPlot tubularBarPlotWithColor:[CPTColor blueColor] horizontalBars:NO]; barPlot.dataSource = self; - barPlot.barOffset = CPTDecimalFromFloat(0.25f); // 25% offset, 75% overlap + barPlot.barOffset = @0.25; // 25% offset, 75% overlap barPlot.barCornerRadius = 2.0; barPlot.identifier = @"Bar Plot 2"; barPlot.delegate = self; [self.barChart addPlot:barPlot toPlotSpace:plotSpace]; } --(void)renderPieChartInHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme +-(void)renderPieChartInHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE [hostingView layoutIfNeeded]; CGRect bounds = hostingView.bounds; @@ -406,9 +409,11 @@ -(void)renderPieChartInHostingView:(CPTGraphHostingView *)hostingView withTheme: CGRect bounds = NSRectToCGRect(hostingView.bounds); #endif - self.pieChart = [[CPTXYGraph alloc] initWithFrame:bounds]; - [self addGraph:self.pieChart toHostingView:hostingView]; - [self applyTheme:theme toGraph:self.pieChart withDefault:[CPTTheme themeNamed:kCPTDarkGradientTheme]]; + CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:bounds]; + self.pieChart = newGraph; + + [self addGraph:newGraph toHostingView:hostingView]; + [self applyTheme:theme toGraph:newGraph withDefault:[CPTTheme themeNamed:kCPTDarkGradientTheme]]; self.pieChart.plotAreaFrame.masksToBorder = NO; @@ -417,8 +422,8 @@ -(void)renderPieChartInHostingView:(CPTGraphHostingView *)hostingView withTheme: // Add pie chart CPTPieChart *piePlot = [[CPTPieChart alloc] init]; piePlot.dataSource = self; - piePlot.pieRadius = MIN( CPTFloat(0.7) * (hostingView.frame.size.height - CPTFloat(2.0) * self.pieChart.paddingLeft) / CPTFloat(2.0), - CPTFloat(0.7) * (hostingView.frame.size.width - CPTFloat(2.0) * self.pieChart.paddingTop) / CPTFloat(2.0) ); + piePlot.pieRadius = MIN(CPTFloat(0.7) * (hostingView.frame.size.height - CPTFloat(2.0) * self.pieChart.paddingLeft) / CPTFloat(2.0), + CPTFloat(0.7) * (hostingView.frame.size.width - CPTFloat(2.0) * self.pieChart.paddingTop) / CPTFloat(2.0)); piePlot.identifier = @"Pie Chart 1"; piePlot.startAngle = CPTFloat(M_PI_4); piePlot.sliceDirection = CPTPieDirectionCounterClockwise; @@ -432,7 +437,7 @@ -(void)renderPieChartInHostingView:(CPTGraphHostingView *)hostingView withTheme: #pragma mark - #pragma mark CPTBarPlot delegate --(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index +-(void)barPlot:(nonnull CPTBarPlot *__unused)plot barWasSelectedAtRecordIndex:(NSUInteger)index { NSLog(@"barWasSelectedAtRecordIndex %d", (int)index); } @@ -440,9 +445,9 @@ -(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index #pragma mark - #pragma mark CPTScatterPlot delegate --(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index +-(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index { - if ( [(NSString *)plot.identifier isEqualToString : @"Blue Plot"] ) { + if ( [(NSString *) plot.identifier isEqualToString:@"Blue Plot"] ) { self.selectedIndex = (NSInteger)index; } } @@ -450,7 +455,7 @@ -(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NS #pragma mark - #pragma mark Plot area delegate --(void)plotAreaWasSelected:(CPTPlotArea *)plotArea +-(void)plotAreaWasSelected:(nonnull CPTPlotArea *)plotArea { CPTGraph *theGraph = plotArea.graph; @@ -462,10 +467,10 @@ -(void)plotAreaWasSelected:(CPTPlotArea *)plotArea #pragma mark - #pragma mark Plot Data Source --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot { if ( [plot isKindOfClass:[CPTPieChart class]] ) { - return [self.dataForChart count]; + return self.dataForChart.count; } else if ( [plot isKindOfClass:[CPTBarPlot class]] ) { return 16; @@ -475,12 +480,12 @@ -(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot } } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSNumber *num = nil; if ( [plot isKindOfClass:[CPTPieChart class]] ) { - if ( index >= [self.dataForChart count] ) { + if ( index >= self.dataForChart.count ) { return nil; } @@ -498,7 +503,7 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI break; case CPTBarPlotFieldBarTip: - num = @( (index + 1) * (index + 1) ); + num = @((index + 1) * (index + 1)); if ( [plot.identifier isEqual:@"Bar Plot 2"] ) { num = @(num.integerValue - 10); } @@ -510,9 +515,9 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI num = self.dataForPlot[index][key]; // Green plot gets shifted above the blue - if ( [(NSString *)plot.identifier isEqualToString : @"Green Plot"] ) { + if ( [(NSString *) plot.identifier isEqualToString:@"Green Plot"] ) { if ( fieldEnum == CPTScatterPlotFieldY ) { - num = @([num doubleValue] + 1.0); + num = @(num.doubleValue + 1.0); } } } @@ -520,7 +525,7 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI return num; } --(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index +-(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *)plot recordIndex:(NSUInteger)index { CPTTextLayer *newLayer = nil; @@ -529,8 +534,8 @@ -(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index static dispatch_once_t whiteOnceToken = 0; dispatch_once(&whiteOnceToken, ^{ - whiteText = [[CPTMutableTextStyle alloc] init]; - whiteText.color = [CPTColor whiteColor]; + whiteText = [[CPTMutableTextStyle alloc] init]; + whiteText.color = [CPTColor whiteColor]; whiteText.fontSize = self.titleSize * CPTFloat(0.5); }); @@ -538,8 +543,8 @@ -(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index static dispatch_once_t blackOnceToken = 0; dispatch_once(&blackOnceToken, ^{ - redText = [[CPTMutableTextStyle alloc] init]; - redText.color = [CPTColor redColor]; + redText = [[CPTMutableTextStyle alloc] init]; + redText.color = [CPTColor redColor]; redText.fontSize = self.titleSize * CPTFloat(0.5); }); @@ -563,20 +568,20 @@ -(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index return newLayer; } --(CPTPlotSymbol *)symbolForScatterPlot:(CPTScatterPlot *)plot recordIndex:(NSUInteger)index +-(nullable CPTPlotSymbol *)symbolForScatterPlot:(nonnull CPTScatterPlot *)plot recordIndex:(NSUInteger)index { static CPTPlotSymbol *redDot = nil; static dispatch_once_t onceToken = 0; CPTPlotSymbol *symbol = nil; // Use the default symbol - if ( [(NSString *)plot.identifier isEqualToString : @"Blue Plot"] && ( (NSInteger)index == self.selectedIndex ) ) { + if ( [(NSString *) plot.identifier isEqualToString:@"Blue Plot"] && ((NSInteger)index == self.selectedIndex)) { dispatch_once(&onceToken, ^{ - redDot = [[CPTPlotSymbol alloc] init]; + redDot = [[CPTPlotSymbol alloc] init]; redDot.symbolType = CPTPlotSymbolTypeEllipse; - redDot.size = CGSizeMake(10.0, 10.0); - redDot.fill = [CPTFill fillWithColor:[CPTColor redColor]]; - redDot.lineStyle = [CPTLineStyle lineStyle]; + redDot.size = CGSizeMake(10.0, 10.0); + redDot.fill = [CPTFill fillWithColor:[CPTColor redColor]]; + redDot.lineStyle = [CPTLineStyle lineStyle]; }); symbol = redDot; @@ -597,10 +602,10 @@ -(void)setSelectedIndex:(NSInteger)newIndex CPTScatterPlot *thePlot = (CPTScatterPlot *)[self.scatterPlot plotWithIdentifier:@"Blue Plot"]; if ( oldIndex != NSNotFound ) { - [thePlot reloadPlotSymbolsInIndexRange:NSMakeRange( (NSUInteger)oldIndex, 1 )]; + [thePlot reloadPlotSymbolsInIndexRange:NSMakeRange((NSUInteger)oldIndex, 1)]; } if ( newIndex != NSNotFound ) { - [thePlot reloadPlotSymbolsInIndexRange:NSMakeRange( (NSUInteger)newIndex, 1 )]; + [thePlot reloadPlotSymbolsInIndexRange:NSMakeRange((NSUInteger)newIndex, 1)]; } } } diff --git a/examples/CorePlotGallery/src/plots/ControlChart.m b/examples/CorePlotGallery/src/plots/ControlChart.m index 655270632..cc8682410 100644 --- a/examples/CorePlotGallery/src/plots/ControlChart.m +++ b/examples/CorePlotGallery/src/plots/ControlChart.m @@ -9,7 +9,7 @@ @interface ControlChart() -@property (nonatomic, readwrite, strong) NSArray *plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray *plotData; @property (nonatomic, readwrite, assign) double meanValue; @property (nonatomic, readwrite, assign) double standardError; @@ -26,9 +26,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Control Chart"; self.section = kLinePlots; } @@ -38,8 +38,8 @@ -(instancetype)init -(void)generateData { - if ( self.plotData == nil ) { - NSMutableArray *contentArray = [NSMutableArray array]; + if ( self.plotData.count == 0 ) { + CPTMutableNumberArray *contentArray = [NSMutableArray array]; double sum = 0.0; @@ -55,17 +55,17 @@ -(void)generateData sum = 0.0; for ( NSNumber *value in contentArray ) { - double error = [value doubleValue] - self.meanValue; + double error = value.doubleValue - self.meanValue; sum += error * error; } - double stdDev = sqrt( ( 1.0 / (numberOfPoints - 1) ) * sum ); + double stdDev = sqrt((1.0 / (numberOfPoints - 1)) * sum); self.standardError = stdDev / sqrt(numberOfPoints); } } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -185,8 +185,8 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP CPTMutablePlotRange *xRange = [plotSpace.xRange mutableCopy]; CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy]; - x.orthogonalCoordinateDecimal = yRange.location; - y.orthogonalCoordinateDecimal = xRange.location; + x.orthogonalPosition = yRange.location; + y.orthogonalPosition = xRange.location; x.visibleRange = xRange; y.visibleRange = yRange; @@ -194,8 +194,8 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP x.gridLinesRange = yRange; y.gridLinesRange = xRange; - [xRange expandRangeByFactor:CPTDecimalFromDouble(1.05)]; - [yRange expandRangeByFactor:CPTDecimalFromDouble(1.05)]; + [xRange expandRangeByFactor:@1.05]; + [yRange expandRangeByFactor:@1.05]; plotSpace.xRange = xRange; plotSpace.yRange = yRange; @@ -207,13 +207,13 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP graph.legend.cornerRadius = 5.0; graph.legend.numberOfRows = 1; graph.legendAnchor = CPTRectAnchorBottom; - graph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(4.0) ); + graph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(4.0)); } #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot { if ( plot.identifier == kDataLine ) { return self.plotData.count; @@ -226,9 +226,9 @@ -(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot } } --(double)doubleForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(double)doubleForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { - double number = NAN; + double number = (double)NAN; switch ( fieldEnum ) { case CPTScatterPlotFieldX: @@ -246,7 +246,7 @@ -(double)doubleForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:( break; case 2: - number = NAN; + number = (double)NAN; break; } } @@ -255,7 +255,7 @@ -(double)doubleForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:( case CPTScatterPlotFieldY: if ( plot.identifier == kDataLine ) { - number = [self.plotData[index] doubleValue]; + number = self.plotData[index].doubleValue; } else if ( plot.identifier == kCenterLine ) { number = self.meanValue; @@ -268,7 +268,7 @@ -(double)doubleForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:( break; case 2: - number = NAN; + number = (double)NAN; break; case 3: @@ -285,7 +285,7 @@ -(double)doubleForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:( break; case 2: - number = NAN; + number = (double)NAN; break; case 3: diff --git a/examples/CorePlotGallery/src/plots/CurvedInterpolationDemo.h b/examples/CorePlotGallery/src/plots/CurvedInterpolationDemo.h new file mode 100644 index 000000000..ac63057b9 --- /dev/null +++ b/examples/CorePlotGallery/src/plots/CurvedInterpolationDemo.h @@ -0,0 +1,13 @@ +// +// CurvedInterpolationDemo.h +// Plot_Gallery +// +// Created by malte on 16/03/16. +// +// + +#import "PlotItem.h" + +@interface CurvedInterpolationDemo : PlotItem + +@end diff --git a/examples/CorePlotGallery/src/plots/CurvedInterpolationDemo.m b/examples/CorePlotGallery/src/plots/CurvedInterpolationDemo.m new file mode 100644 index 000000000..d5e6f20e9 --- /dev/null +++ b/examples/CorePlotGallery/src/plots/CurvedInterpolationDemo.m @@ -0,0 +1,315 @@ +// +// CurvedInterpolationDemo.m +// Plot_Gallery +// +// Created by malte on 16/03/16. +// +// + +#import "CurvedInterpolationDemo.h" + +static const double bezierYShift = -1.0; +static const double catmullRomUniformPlotYShift = 0.0; +static const double catmullRomCentripetalYShift = 1.0; +static const double catmullRomChordalYShift = 2.0; +static const double hermiteCubicYShift = -2.0; + +static NSString *const bezierCurveIdentifier = @"Bezier"; +static NSString *const catmullRomUniformIdentifier = @"Catmull-Rom Uniform"; +static NSString *const catmullRomCentripetalIdentifier = @"Catmull-Rom Centripetal"; +static NSString *const catmullRomChordalIdentifier = @"Catmull-Rom Chordal"; +static NSString *const hermiteCubicIdentifier = @"Hermite Cubic"; + +@interface CurvedInterpolationDemo() + +@property (nonatomic, readwrite, strong) NSArray *> *plotData; + +@end + +@implementation CurvedInterpolationDemo + +@synthesize plotData = _plotData; + ++(void)load +{ + [super registerPlotItem:self]; +} + +-(instancetype)init +{ + if ((self = [super init])) { + self.title = @"Curved Interpolation Options Demo"; + self.section = kLinePlots; + } + + return self; +} + +-(void)generateData +{ + if ( self.plotData.count == 0 ) { + NSArray *const xValues = @[@0, @0.1, @0.2, @0.5, @0.6, @0.7, @1]; + NSArray *const yValues = @[@(0.5), @0.5, @(-1), @1, @1, @0, @0.1]; + + if ( xValues.count != yValues.count ) { + [[NSException exceptionWithName:NSInternalInconsistencyException reason:@"invalid const data" userInfo:nil] raise]; + } + NSMutableArray *> *generatedData = [NSMutableArray new]; + for ( NSUInteger i = 0; i < xValues.count; i++ ) { + NSNumber *x = xValues[i]; + NSNumber *y = yValues[i]; + if ( x && y ) { + [generatedData addObject:@{ + @"x": x, + @"y": y + }]; + } + } + self.plotData = generatedData; + } +} + +-(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL __unused)animated +{ +#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE + CGRect bounds = hostingView.bounds; +#else + CGRect bounds = NSRectToCGRect(hostingView.bounds); +#endif + + CPTGraph *graph = [[CPTXYGraph alloc] initWithFrame:bounds]; + [self addGraph:graph toHostingView:hostingView]; + [self applyTheme:theme toGraph:graph withDefault:[CPTTheme themeNamed:kCPTDarkGradientTheme]]; + + graph.plotAreaFrame.paddingLeft += self.titleSize * CPTFloat(2.25); + graph.plotAreaFrame.paddingTop += self.titleSize; + graph.plotAreaFrame.paddingRight += self.titleSize; + graph.plotAreaFrame.paddingBottom += self.titleSize; + graph.plotAreaFrame.masksToBorder = NO; + +// Setup scatter plot space + CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace; + plotSpace.allowsUserInteraction = YES; + plotSpace.delegate = self; + +// Grid line styles + CPTMutableLineStyle *majorGridLineStyle = [CPTMutableLineStyle lineStyle]; + majorGridLineStyle.lineWidth = 0.75; + majorGridLineStyle.lineColor = [[CPTColor colorWithGenericGray:CPTFloat(0.2)] colorWithAlphaComponent:CPTFloat(0.75)]; + + CPTMutableLineStyle *minorGridLineStyle = [CPTMutableLineStyle lineStyle]; + minorGridLineStyle.lineWidth = 0.25; + minorGridLineStyle.lineColor = [[CPTColor whiteColor] colorWithAlphaComponent:CPTFloat(0.1)]; + + CPTMutableLineStyle *redLineStyle = [CPTMutableLineStyle lineStyle]; + redLineStyle.lineWidth = 10.0; + redLineStyle.lineColor = [[CPTColor redColor] colorWithAlphaComponent:0.5]; + + CPTLineCap *lineCap = [CPTLineCap sweptArrowPlotLineCap]; + lineCap.size = CGSizeMake(self.titleSize * CPTFloat(0.625), self.titleSize * CPTFloat(0.625)); + +// Axes +// Label x axis with a fixed interval policy + CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; + CPTXYAxis *x = axisSet.xAxis; + x.majorIntervalLength = @0.1; + x.minorTicksPerInterval = 4; + x.majorGridLineStyle = majorGridLineStyle; + x.minorGridLineStyle = minorGridLineStyle; + x.axisConstraints = [CPTConstraints constraintWithRelativeOffset:0.5]; + + lineCap.lineStyle = x.axisLineStyle; + CPTColor *lineColor = lineCap.lineStyle.lineColor; + if ( lineColor ) { + lineCap.fill = [CPTFill fillWithColor:lineColor]; + } + x.axisLineCapMax = lineCap; + + x.title = @"X Axis"; + x.titleOffset = self.titleSize * CPTFloat(1.25); + +// Label y with an automatic label policy. + CPTXYAxis *y = axisSet.yAxis; + y.labelingPolicy = CPTAxisLabelingPolicyAutomatic; + y.minorTicksPerInterval = 4; + y.preferredNumberOfMajorTicks = 8; + y.majorGridLineStyle = majorGridLineStyle; + y.minorGridLineStyle = minorGridLineStyle; + y.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0]; + y.labelOffset = self.titleSize * CPTFloat(0.25); + + lineCap.lineStyle = y.axisLineStyle; + lineColor = lineCap.lineStyle.lineColor; + if ( lineColor ) { + lineCap.fill = [CPTFill fillWithColor:lineColor]; + } + y.axisLineCapMax = lineCap; + y.axisLineCapMin = lineCap; + + y.title = @"Y Axis"; + y.titleOffset = self.titleSize * CPTFloat(1.25); + +// Set axes + graph.axisSet.axes = @[x, y]; + +// Create the plots +// Bezier + CPTScatterPlot *bezierPlot = [[CPTScatterPlot alloc] initWithFrame:CGRectZero]; + bezierPlot.identifier = bezierCurveIdentifier; +// Catmull-Rom + CPTScatterPlot *cmUniformPlot = [[CPTScatterPlot alloc] initWithFrame:CGRectZero]; + cmUniformPlot.identifier = catmullRomUniformIdentifier; + CPTScatterPlot *cmCentripetalPlot = [[CPTScatterPlot alloc] initWithFrame:CGRectZero]; + cmCentripetalPlot.identifier = catmullRomCentripetalIdentifier; + CPTScatterPlot *cmChordalPlot = [[CPTScatterPlot alloc] initWithFrame:CGRectZero]; + cmChordalPlot.identifier = catmullRomChordalIdentifier; +// Hermite Cubic + CPTScatterPlot *hermitePlot = [[CPTScatterPlot alloc] initWithFrame:CGRectZero]; + hermitePlot.identifier = hermiteCubicIdentifier; + +// set interpolation types + bezierPlot.interpolation = cmUniformPlot.interpolation = cmCentripetalPlot.interpolation = cmChordalPlot.interpolation = hermitePlot.interpolation = CPTScatterPlotInterpolationCurved; + + bezierPlot.curvedInterpolationOption = CPTScatterPlotCurvedInterpolationNormal; + cmUniformPlot.curvedInterpolationOption = CPTScatterPlotCurvedInterpolationCatmullRomUniform; + cmChordalPlot.curvedInterpolationOption = CPTScatterPlotCurvedInterpolationCatmullRomChordal; + cmCentripetalPlot.curvedInterpolationOption = CPTScatterPlotCurvedInterpolationCatmullRomCentripetal; + hermitePlot.curvedInterpolationOption = CPTScatterPlotCurvedInterpolationHermiteCubic; + +// style plots + CPTMutableLineStyle *lineStyle = [bezierPlot.dataLineStyle mutableCopy]; + lineStyle.lineWidth = 2.0; + lineStyle.lineColor = [CPTColor greenColor]; + + bezierPlot.dataLineStyle = lineStyle; + + lineStyle.lineColor = [CPTColor redColor]; + cmUniformPlot.dataLineStyle = lineStyle; + + lineStyle.lineColor = [CPTColor orangeColor]; + cmCentripetalPlot.dataLineStyle = lineStyle; + + lineStyle.lineColor = [CPTColor yellowColor]; + cmChordalPlot.dataLineStyle = lineStyle; + + lineStyle.lineColor = [CPTColor cyanColor]; + hermitePlot.dataLineStyle = lineStyle; + +// set data source and add plots + bezierPlot.dataSource = cmUniformPlot.dataSource = cmCentripetalPlot.dataSource = cmChordalPlot.dataSource = hermitePlot.dataSource = self; + + [graph addPlot:bezierPlot]; + [graph addPlot:cmUniformPlot]; + [graph addPlot:cmCentripetalPlot]; + [graph addPlot:cmChordalPlot]; + [graph addPlot:hermitePlot]; + +// Auto scale the plot space to fit the plot data + [plotSpace scaleToFitPlots:[graph allPlots]]; + CPTMutablePlotRange *xRange = [plotSpace.xRange mutableCopy]; + CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy]; + +// Expand the ranges to put some space around the plot + [xRange expandRangeByFactor:@1.2]; + [yRange expandRangeByFactor:@1.2]; + plotSpace.xRange = xRange; + plotSpace.yRange = yRange; + + [xRange expandRangeByFactor:@1.025]; + xRange.location = plotSpace.xRange.location; + [yRange expandRangeByFactor:@1.05]; + x.visibleAxisRange = xRange; + y.visibleAxisRange = yRange; + + [xRange expandRangeByFactor:@3.0]; + [yRange expandRangeByFactor:@3.0]; + plotSpace.globalXRange = xRange; + plotSpace.globalYRange = yRange; + +// Add plot symbols + CPTMutableLineStyle *symbolLineStyle = [CPTMutableLineStyle lineStyle]; + symbolLineStyle.lineColor = [[CPTColor blackColor] colorWithAlphaComponent:0.5]; + CPTPlotSymbol *plotSymbol = [CPTPlotSymbol ellipsePlotSymbol]; + plotSymbol.fill = [CPTFill fillWithColor:[[CPTColor blueColor] colorWithAlphaComponent:0.5]]; + plotSymbol.lineStyle = symbolLineStyle; + plotSymbol.size = CGSizeMake(5.0, 5.0); + bezierPlot.plotSymbol = cmUniformPlot.plotSymbol = cmCentripetalPlot.plotSymbol = cmChordalPlot.plotSymbol = hermitePlot.plotSymbol = plotSymbol; + +// Add legend + graph.legend = [CPTLegend legendWithGraph:graph]; + graph.legend.numberOfRows = 2; + graph.legend.textStyle = x.titleTextStyle; + graph.legend.fill = [CPTFill fillWithColor:[CPTColor darkGrayColor]]; + graph.legend.borderLineStyle = x.axisLineStyle; + graph.legend.cornerRadius = 5.0; + graph.legendAnchor = CPTRectAnchorBottom; + graph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(2.0)); +} + +#pragma mark - +#pragma mark Plot Data Source Methods + +-(NSUInteger)numberOfRecordsForPlot:(CPTPlot *__unused)plot +{ + return self.plotData.count; +} + +-(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +{ + NSString *identifier = (NSString *)plot.identifier; + + if ( fieldEnum == CPTScatterPlotFieldX ) { + return self.plotData[index][@"x"]; + } + else { + NSNumber *baseY = self.plotData[index][@"y"]; + double shift = 0.0; + if ( [identifier isEqualToString:catmullRomUniformIdentifier] ) { + shift = catmullRomUniformPlotYShift; + } + else if ( [identifier isEqualToString:catmullRomCentripetalIdentifier] ) { + shift = catmullRomCentripetalYShift; + } + else if ( [identifier isEqualToString:catmullRomChordalIdentifier] ) { + shift = catmullRomChordalYShift; + } + else if ( [identifier isEqualToString:hermiteCubicIdentifier] ) { + shift = hermiteCubicYShift; + } + else if ( [identifier isEqualToString:bezierCurveIdentifier] ) { + shift = bezierYShift; + } + return @(baseY.doubleValue + shift); + } +} + +#pragma mark - +#pragma mark Plot Space Delegate Methods + +-(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate +{ + CPTGraph *theGraph = space.graph; + CPTXYAxisSet *axisSet = (CPTXYAxisSet *)theGraph.axisSet; + + CPTMutablePlotRange *changedRange = [newRange mutableCopy]; + + switch ( coordinate ) { + case CPTCoordinateX: + [changedRange expandRangeByFactor:@1.025]; + changedRange.location = newRange.location; + axisSet.xAxis.visibleAxisRange = changedRange; + break; + + case CPTCoordinateY: + [changedRange expandRangeByFactor:@1.05]; + axisSet.yAxis.visibleAxisRange = changedRange; + break; + + default: + break; + } + + return newRange; +} + +@end diff --git a/examples/CorePlotGallery/src/plots/CurvedScatterPlot.h b/examples/CorePlotGallery/src/plots/CurvedScatterPlot.h index 8073492c1..d88ebf2a3 100644 --- a/examples/CorePlotGallery/src/plots/CurvedScatterPlot.h +++ b/examples/CorePlotGallery/src/plots/CurvedScatterPlot.h @@ -1,8 +1,8 @@ // -// CurvedScatterPlot.h -// Plot_Gallery_iOS +// CurvedScatterPlot.h +// Plot_Gallery_iOS // -// Created by Nino Ag on 23/10/11. +// Created by Nino Ag on 23/10/11. #import "PlotItem.h" diff --git a/examples/CorePlotGallery/src/plots/CurvedScatterPlot.m b/examples/CorePlotGallery/src/plots/CurvedScatterPlot.m index 3e5407374..27e300d0f 100644 --- a/examples/CorePlotGallery/src/plots/CurvedScatterPlot.m +++ b/examples/CorePlotGallery/src/plots/CurvedScatterPlot.m @@ -1,8 +1,8 @@ // -// CurvedScatterPlot.m -// Plot_Gallery_iOS +// CurvedScatterPlot.m +// Plot_Gallery_iOS // -// Created by Nino Ag on 23/10/11. +// Created by Nino Ag on 23/10/11. #import "CurvedScatterPlot.h" @@ -12,11 +12,11 @@ @interface CurvedScatterPlot() -@property (nonatomic, readwrite, strong) CPTPlotSpaceAnnotation *symbolTextAnnotation; +@property (nonatomic, readwrite, strong, nullable) CPTPlotSpaceAnnotation *symbolTextAnnotation; -@property (nonatomic, readwrite, strong) NSArray *plotData; -@property (nonatomic, readwrite, strong) NSArray *plotData1; -@property (nonatomic, readwrite, strong) NSArray *plotData2; +@property (nonatomic, readwrite, strong, nonnull) NSArray *> *plotData; +@property (nonatomic, readwrite, strong, nonnull) NSArray *> *plotData1; +@property (nonatomic, readwrite, strong, nonnull) NSArray *> *plotData2; @end @@ -32,9 +32,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Curved Scatter Plot"; self.section = kLinePlots; } @@ -59,13 +59,15 @@ -(void)killGraph -(void)generateData { - if ( self.plotData == nil ) { - NSMutableArray *contentArray = [NSMutableArray array]; + if ( self.plotData.count == 0 ) { + NSMutableArray *> *contentArray = [NSMutableArray array]; for ( NSUInteger i = 0; i < 11; i++ ) { NSNumber *x = @(1.0 + i * 0.05); NSNumber *y = @(1.2 * arc4random() / (double)UINT32_MAX + 0.5); - [contentArray addObject:@{ @"x": x, @"y": y } + [contentArray addObject: + @{ @"x": x, + @"y": y } ]; } @@ -73,25 +75,26 @@ -(void)generateData } if ( self.plotData1 == nil ) { - NSMutableArray *contentArray = [NSMutableArray array]; + NSMutableArray *> *contentArray = [NSMutableArray array]; - NSArray *dataArray = self.plotData; + NSArray *> *dataArray = self.plotData; for ( NSUInteger i = 1; i < dataArray.count; i++ ) { - NSDictionary *point1 = dataArray[i - 1]; - NSDictionary *point2 = dataArray[i]; + NSDictionary *point1 = dataArray[i - 1]; + NSDictionary *point2 = dataArray[i]; - double x1 = [(NSNumber *)point1[@"x"] doubleValue]; - double x2 = [(NSNumber *)point2[@"x"] doubleValue]; + double x1 = point1[@"x"].doubleValue; + double x2 = point2[@"x"].doubleValue; double dx = x2 - x1; double xLoc = (x1 + x2) * 0.5; - double y1 = [(NSNumber *)point1[@"y"] doubleValue]; - double y2 = [(NSNumber *)point2[@"y"] doubleValue]; + double y1 = point1[@"y"].doubleValue; + double y2 = point2[@"y"].doubleValue; double dy = y2 - y1; - [contentArray addObject:@{ @"x": @(xLoc), - @"y": @( (dy / dx) / 20.0 ) } + [contentArray addObject: + @{ @"x": @(xLoc), + @"y": @((dy / dx) / 20.0) } ]; } @@ -99,25 +102,26 @@ -(void)generateData } if ( self.plotData2 == nil ) { - NSMutableArray *contentArray = [NSMutableArray array]; + NSMutableArray *> *contentArray = [NSMutableArray array]; - NSArray *dataArray = self.plotData1; + NSArray *> *dataArray = self.plotData1; for ( NSUInteger i = 1; i < dataArray.count; i++ ) { - NSDictionary *point1 = dataArray[i - 1]; - NSDictionary *point2 = dataArray[i]; + NSDictionary *point1 = dataArray[i - 1]; + NSDictionary *point2 = dataArray[i]; - double x1 = [(NSNumber *)point1[@"x"] doubleValue]; - double x2 = [(NSNumber *)point2[@"x"] doubleValue]; + double x1 = point1[@"x"].doubleValue; + double x2 = point2[@"x"].doubleValue; double dx = x2 - x1; double xLoc = (x1 + x2) * 0.5; - double y1 = [(NSNumber *)point1[@"y"] doubleValue]; - double y2 = [(NSNumber *)point2[@"y"] doubleValue]; + double y1 = point1[@"y"].doubleValue; + double y2 = point2[@"y"].doubleValue; double dy = y2 - y1; - [contentArray addObject:@{ @"x": @(xLoc), - @"y": @( (dy / dx) / 20.0 ) } + [contentArray addObject: + @{ @"x": @(xLoc), + @"y": @((dy / dx) / 20.0) } ]; } @@ -125,9 +129,9 @@ -(void)generateData } } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -165,21 +169,24 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP redLineStyle.lineColor = [[CPTColor redColor] colorWithAlphaComponent:0.5]; CPTLineCap *lineCap = [CPTLineCap sweptArrowPlotLineCap]; - lineCap.size = CGSizeMake( self.titleSize * CPTFloat(0.625), self.titleSize * CPTFloat(0.625) ); + lineCap.size = CGSizeMake(self.titleSize * CPTFloat(0.625), self.titleSize * CPTFloat(0.625)); // Axes // Label x axis with a fixed interval policy CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(0.1); + x.majorIntervalLength = @0.1; x.minorTicksPerInterval = 4; x.majorGridLineStyle = majorGridLineStyle; x.minorGridLineStyle = minorGridLineStyle; x.axisConstraints = [CPTConstraints constraintWithRelativeOffset:0.5]; lineCap.lineStyle = x.axisLineStyle; - lineCap.fill = [CPTFill fillWithColor:lineCap.lineStyle.lineColor]; - x.axisLineCapMax = lineCap; + CPTColor *lineColor = lineCap.lineStyle.lineColor; + if ( lineColor ) { + lineCap.fill = [CPTFill fillWithColor:lineColor]; + } + x.axisLineCapMax = lineCap; x.title = @"X Axis"; x.titleOffset = self.titleSize * CPTFloat(1.25); @@ -193,11 +200,16 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP y.minorGridLineStyle = minorGridLineStyle; y.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0]; y.labelOffset = self.titleSize * CPTFloat(0.25); + y.alternatingBandFills = @[[[CPTColor whiteColor] colorWithAlphaComponent:CPTFloat(0.1)], [NSNull null]]; + y.alternatingBandAnchor = @0.0; lineCap.lineStyle = y.axisLineStyle; - lineCap.fill = [CPTFill fillWithColor:lineCap.lineStyle.lineColor]; - y.axisLineCapMax = lineCap; - y.axisLineCapMin = lineCap; + lineColor = lineCap.lineStyle.lineColor; + if ( lineColor ) { + lineCap.fill = [CPTFill fillWithColor:lineColor]; + } + y.axisLineCapMax = lineCap; + y.axisLineCapMin = lineCap; y.title = @"Y Axis"; y.titleOffset = self.titleSize * CPTFloat(1.25); @@ -228,7 +240,7 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP firstPlot.dataLineStyle = lineStyle; firstPlot.dataSource = self; -// [graph addPlot:firstPlot]; +// [graph addPlot:firstPlot]; // Second derivative CPTScatterPlot *secondPlot = [[CPTScatterPlot alloc] init]; @@ -237,27 +249,22 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP secondPlot.dataLineStyle = lineStyle; secondPlot.dataSource = self; -// [graph addPlot:secondPlot]; +// [graph addPlot:secondPlot]; // Auto scale the plot space to fit the plot data - [plotSpace scaleToFitPlots:[graph allPlots]]; + [plotSpace scaleToFitEntirePlots:[graph allPlots]]; CPTMutablePlotRange *xRange = [plotSpace.xRange mutableCopy]; CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy]; // Expand the ranges to put some space around the plot - [xRange expandRangeByFactor:CPTDecimalFromDouble(1.2)]; - [yRange expandRangeByFactor:CPTDecimalFromDouble(1.2)]; - plotSpace.xRange = xRange; - plotSpace.yRange = yRange; - - [xRange expandRangeByFactor:CPTDecimalFromDouble(1.025)]; + [xRange expandRangeByFactor:@1.025]; xRange.location = plotSpace.xRange.location; - [yRange expandRangeByFactor:CPTDecimalFromDouble(1.05)]; + [yRange expandRangeByFactor:@1.05]; x.visibleAxisRange = xRange; y.visibleAxisRange = yRange; - [xRange expandRangeByFactor:CPTDecimalFromDouble(3.0)]; - [yRange expandRangeByFactor:CPTDecimalFromDouble(3.0)]; + [xRange expandRangeByFactor:@3.0]; + [yRange expandRangeByFactor:@3.0]; plotSpace.globalXRange = xRange; plotSpace.globalYRange = yRange; @@ -284,13 +291,13 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP graph.legend.borderLineStyle = x.axisLineStyle; graph.legend.cornerRadius = 5.0; graph.legendAnchor = CPTRectAnchorBottom; - graph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(2.0) ); + graph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(2.0)); } #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot { NSUInteger numRecords = 0; NSString *identifier = (NSString *)plot.identifier; @@ -308,7 +315,7 @@ -(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot return numRecords; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSNumber *num = nil; NSString *identifier = (NSString *)plot.identifier; @@ -329,7 +336,7 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI #pragma mark - #pragma mark Plot Space Delegate Methods --(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate +-(nullable CPTPlotRange *)plotSpace:(nonnull CPTPlotSpace *)space willChangePlotRangeTo:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate { CPTGraph *theGraph = space.graph; CPTXYAxisSet *axisSet = (CPTXYAxisSet *)theGraph.axisSet; @@ -338,13 +345,13 @@ -(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotR switch ( coordinate ) { case CPTCoordinateX: - [changedRange expandRangeByFactor:CPTDecimalFromDouble(1.025)]; + [changedRange expandRangeByFactor:@1.025]; changedRange.location = newRange.location; axisSet.xAxis.visibleAxisRange = changedRange; break; case CPTCoordinateY: - [changedRange expandRangeByFactor:CPTDecimalFromDouble(1.05)]; + [changedRange expandRangeByFactor:@1.05]; axisSet.yAxis.visibleAxisRange = changedRange; break; @@ -358,7 +365,7 @@ -(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotR #pragma mark - #pragma mark CPTScatterPlot delegate methods --(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index +-(void)scatterPlot:(nonnull CPTScatterPlot *__unused)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index { CPTXYGraph *graph = (self.graphs)[0]; @@ -375,17 +382,17 @@ -(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NS hitAnnotationTextStyle.fontName = @"Helvetica-Bold"; // Determine point of symbol in plot coordinates - NSDictionary *dataPoint = self.plotData[index]; + NSDictionary *dataPoint = self.plotData[index]; NSNumber *x = dataPoint[@"x"]; NSNumber *y = dataPoint[@"y"]; - NSArray *anchorPoint = @[x, y]; + CPTNumberArray *anchorPoint = @[x, y]; // Add annotation // First make a string for the y value NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; - [formatter setMaximumFractionDigits:2]; + formatter.maximumFractionDigits = 2; NSString *yString = [formatter stringFromNumber:y]; // Now add the annotation to the plot area @@ -398,24 +405,29 @@ -(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NS textLayer.paddingRight = 2.0; textLayer.paddingBottom = 2.0; - annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:graph.defaultPlotSpace anchorPlotPoint:anchorPoint]; - annotation.contentLayer = textLayer; - annotation.contentAnchorPoint = CGPointMake(0.5, 0.0); - annotation.displacement = CGPointMake(0.0, 10.0); - [graph.plotAreaFrame.plotArea addAnnotation:annotation]; + CPTPlotSpace *defaultSpace = graph.defaultPlotSpace; + if ( defaultSpace ) { + annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:defaultSpace anchorPlotPoint:anchorPoint]; + annotation.contentLayer = textLayer; + annotation.contentAnchorPoint = CGPointMake(0.5, 0.0); + annotation.displacement = CGPointMake(0.0, 10.0); + [graph.plotAreaFrame.plotArea addAnnotation:annotation]; + + self.symbolTextAnnotation = annotation; + } } --(void)scatterPlotDataLineWasSelected:(CPTScatterPlot *)plot +-(void)scatterPlotDataLineWasSelected:(nonnull CPTScatterPlot *)plot { NSLog(@"scatterPlotDataLineWasSelected: %@", plot); } --(void)scatterPlotDataLineTouchDown:(CPTScatterPlot *)plot +-(void)scatterPlotDataLineTouchDown:(nonnull CPTScatterPlot *)plot { NSLog(@"scatterPlotDataLineTouchDown: %@", plot); } --(void)scatterPlotDataLineTouchUp:(CPTScatterPlot *)plot +-(void)scatterPlotDataLineTouchUp:(nonnull CPTScatterPlot *)plot { NSLog(@"scatterPlotDataLineTouchUp: %@", plot); } @@ -423,13 +435,13 @@ -(void)scatterPlotDataLineTouchUp:(CPTScatterPlot *)plot #pragma mark - #pragma mark Plot area delegate method --(void)plotAreaWasSelected:(CPTPlotArea *)plotArea +-(void)plotAreaWasSelected:(nonnull CPTPlotArea *__unused)plotArea { // Remove the annotation CPTPlotSpaceAnnotation *annotation = self.symbolTextAnnotation; if ( annotation ) { - CPTXYGraph *graph = [self.graphs objectAtIndex:0]; + CPTXYGraph *graph = (self.graphs)[0]; [graph.plotAreaFrame.plotArea removeAnnotation:annotation]; self.symbolTextAnnotation = nil; diff --git a/examples/CorePlotGallery/src/plots/DatePlot.h b/examples/CorePlotGallery/src/plots/DatePlot.h index 717841aa3..bc4c14c59 100644 --- a/examples/CorePlotGallery/src/plots/DatePlot.h +++ b/examples/CorePlotGallery/src/plots/DatePlot.h @@ -1,6 +1,6 @@ // -// DatePlot.h -// Plot Gallery-Mac +// DatePlot.h +// Plot Gallery-Mac // #import "PlotItem.h" diff --git a/examples/CorePlotGallery/src/plots/DatePlot.m b/examples/CorePlotGallery/src/plots/DatePlot.m index ea5fd3de1..3bc85e487 100644 --- a/examples/CorePlotGallery/src/plots/DatePlot.m +++ b/examples/CorePlotGallery/src/plots/DatePlot.m @@ -1,28 +1,40 @@ // -// DatePlot.m -// Plot Gallery-Mac +// DatePlot.m +// Plot Gallery-Mac // #import "DatePlot.h" +typedef NSDictionary CPTPlotData; + +typedef NSArray CPTPlotDataArray; +typedef NSMutableArray CPTMutablePlotDataArray; + +static const NSUInteger kNumPoints = 10; +static const NSTimeInterval oneDay = 24 * 60 * 60; + @interface DatePlot() -@property (nonatomic, readwrite, strong) NSArray *plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTPlotDataArray *plotData; +@property (nonatomic, readwrite, strong, nullable) CPTPlotSpaceAnnotation *markerAnnotation; @end +#pragma mark - + @implementation DatePlot @synthesize plotData; +@synthesize markerAnnotation; +(void)load { [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Date Plot"; self.section = kLinePlots; } @@ -32,13 +44,11 @@ -(instancetype)init -(void)generateData { - if ( !self.plotData ) { - const NSTimeInterval oneDay = 24 * 60 * 60; - + if ( self.plotData.count == 0 ) { // Add some data - NSMutableArray *newData = [NSMutableArray array]; + CPTMutablePlotDataArray *newData = [NSMutableArray array]; - for ( NSUInteger i = 0; i < 5; i++ ) { + for ( NSUInteger i = 0; i < kNumPoints; i++ ) { NSTimeInterval xVal = oneDay * i; double yVal = 1.2 * arc4random() / (double)UINT32_MAX + 1.2; @@ -53,27 +63,25 @@ -(void)generateData } } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { // If you make sure your dates are calculated at noon, you shouldn't have to // worry about daylight savings. If you use midnight, you will have to adjust // for daylight savings time. NSDateComponents *dateComponents = [[NSDateComponents alloc] init]; - [dateComponents setMonth:10]; - [dateComponents setDay:29]; - [dateComponents setYear:2009]; - [dateComponents setHour:12]; - [dateComponents setMinute:0]; - [dateComponents setSecond:0]; + dateComponents.month = 10; + dateComponents.day = 29; + dateComponents.year = 2009; + dateComponents.hour = 12; + dateComponents.minute = 0; + dateComponents.second = 0; NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; NSDate *refDate = [gregorian dateFromComponents:dateComponents]; - NSTimeInterval oneDay = 24 * 60 * 60; - -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -83,18 +91,27 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP [self addGraph:graph toHostingView:hostingView]; [self applyTheme:theme toGraph:graph withDefault:[CPTTheme themeNamed:kCPTDarkGradientTheme]]; + graph.plotAreaFrame.paddingLeft = 36.0; + graph.plotAreaFrame.paddingTop = 12.0; + graph.plotAreaFrame.paddingRight = 12.0; + graph.plotAreaFrame.paddingBottom = 12.0; + // Setup scatter plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace; - NSTimeInterval xLow = 0.0; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(xLow) length:CPTDecimalFromDouble(oneDay * 5.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) length:CPTDecimalFromDouble(3.0)]; + + NSTimeInterval xLow = 0.0; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(xLow) length:@(oneDay * (kNumPoints - 1))]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@2.0]; + + plotSpace.allowsUserInteraction = YES; + plotSpace.delegate = self; // Axes CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(oneDay); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(2.0); - x.minorTicksPerInterval = 0; + x.majorIntervalLength = @(oneDay); + x.orthogonalPosition = @2.0; + x.minorTicksPerInterval = 0; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.dateStyle = kCFDateFormatterShortStyle; CPTTimeFormatter *timeFormatter = [[CPTTimeFormatter alloc] initWithDateFormatter:dateFormatter]; @@ -103,9 +120,27 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP x.labelRotation = CPTFloat(M_PI_4); CPTXYAxis *y = axisSet.yAxis; - y.majorIntervalLength = CPTDecimalFromDouble(0.5); - y.minorTicksPerInterval = 5; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(oneDay); + y.majorIntervalLength = @0.5; + y.minorTicksPerInterval = 5; + y.orthogonalPosition = @(oneDay); + + CPTMutableLineStyle *blueLineStyle = [CPTMutableLineStyle lineStyle]; + blueLineStyle.lineColor = [CPTColor blueColor]; + blueLineStyle.lineWidth = 2.0; + + CPTXYAxis *iAxis = [[CPTXYAxis alloc] initWithFrame:CGRectZero]; + iAxis.title = nil; + iAxis.labelFormatter = nil; + iAxis.axisLineStyle = blueLineStyle; + + iAxis.coordinate = CPTCoordinateY; + iAxis.plotSpace = graph.defaultPlotSpace; + iAxis.majorTickLineStyle = nil; + iAxis.minorTickLineStyle = nil; + iAxis.orthogonalPosition = @0.0; + iAxis.hidden = YES; + + graph.axisSet.axes = @[x, y, iAxis]; // Create a plot that uses the data source method CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] init]; @@ -118,19 +153,125 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP dataSourceLinePlot.dataSource = self; [graph addPlot:dataSourceLinePlot]; + + // Setup a style for the annotation + CPTMutableTextStyle *hitAnnotationTextStyle = [CPTMutableTextStyle textStyle]; + hitAnnotationTextStyle.color = [CPTColor blackColor]; + hitAnnotationTextStyle.fontName = @"Helvetica-Bold"; + hitAnnotationTextStyle.fontSize = self.titleSize * CPTFloat(0.5); + + CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:@"Annotation" style:hitAnnotationTextStyle]; + textLayer.borderLineStyle = blueLineStyle; + textLayer.fill = [CPTFill fillWithColor:[CPTColor whiteColor]]; + textLayer.cornerRadius = 3.0; + textLayer.paddingLeft = 2.0; + textLayer.paddingTop = 2.0; + textLayer.paddingRight = 2.0; + textLayer.paddingBottom = 2.0; + textLayer.hidden = YES; + + CPTPlotSpaceAnnotation *annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:plotSpace anchorPlotPoint:@[@0, @0]]; + annotation.contentLayer = textLayer; + + [graph addAnnotation:annotation]; + + self.markerAnnotation = annotation; } #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { return self.plotData[index][@(fieldEnum)]; } +#pragma mark - +#pragma mark Plot Space Delegate Methods + +-(CGPoint)plotSpace:(CPTPlotSpace *__unused)space willDisplaceBy:(CGPoint __unused)displacement +{ + return CPTPointMake(0.0, 0.0); +} + +-(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotRange *__unused)newRange forCoordinate:(CPTCoordinate)coordinate +{ + CPTPlotRange *updatedRange = nil; + + CPTXYPlotSpace *xySpace = (CPTXYPlotSpace *)space; + + switch ( coordinate ) { + case CPTCoordinateX: + updatedRange = xySpace.xRange; + break; + + case CPTCoordinateY: + updatedRange = xySpace.yRange; + break; + + default: + break; + } + + return updatedRange; +} + +-(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint __unused)point +{ + CPTXYPlotSpace *xySpace = (CPTXYPlotSpace *)space; + + CPTGraph *graph = space.graph; + + CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; + + CPTAxisArray *axes = axisSet.axes; + CPTXYAxis *iAxis = axes.lastObject; + + CPTNumberArray *plotPoint = [space plotPointForEvent:event]; + + CPTPlotSpaceAnnotation *annotation = self.markerAnnotation; + + CPTTextLayer *textLayer = (CPTTextLayer *)annotation.contentLayer; + + NSNumber *xNumber = plotPoint[CPTCoordinateX]; + + if ( [xySpace.xRange containsNumber:xNumber] ) { + NSUInteger x = (NSUInteger)lround(xNumber.doubleValue / oneDay); + + xNumber = @(x * oneDay); + + NSString *dateValue = [axisSet.xAxis.labelFormatter stringForObjectValue:xNumber]; + NSNumber *plotValue = self.plotData[x][@(CPTCoordinateY)]; + + textLayer.text = [NSString stringWithFormat:@"%@ → %@", dateValue, [NSString stringWithFormat:@"%1.3f", plotValue.doubleValue]]; + textLayer.hidden = NO; + + annotation.anchorPlotPoint = @[xNumber, xySpace.yRange.maxLimit]; + + iAxis.orthogonalPosition = xNumber; + iAxis.hidden = NO; + } + else { + textLayer.hidden = YES; + iAxis.hidden = YES; + } + + return NO; +} + +-(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)point +{ + return [self plotSpace:space shouldHandlePointingDeviceDownEvent:event atPoint:point]; +} + +-(BOOL)plotSpace:(CPTPlotSpace *__unused)space shouldHandlePointingDeviceUpEvent:(CPTNativeEvent *__unused)event atPoint:(CGPoint __unused)point +{ + return NO; +} + @end diff --git a/examples/CorePlotGallery/src/plots/DonutChart.h b/examples/CorePlotGallery/src/plots/DonutChart.h index 0514a4ec7..bab4de00a 100644 --- a/examples/CorePlotGallery/src/plots/DonutChart.h +++ b/examples/CorePlotGallery/src/plots/DonutChart.h @@ -1,5 +1,8 @@ #import "PlotItem.h" -@interface DonutChart : PlotItem +@interface DonutChart : PlotItem @end diff --git a/examples/CorePlotGallery/src/plots/DonutChart.m b/examples/CorePlotGallery/src/plots/DonutChart.m index 5d1cdb735..a56ec42fb 100644 --- a/examples/CorePlotGallery/src/plots/DonutChart.m +++ b/examples/CorePlotGallery/src/plots/DonutChart.m @@ -5,7 +5,7 @@ @interface DonutChart() -@property (nonatomic, readwrite, strong) NSArray *plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray *plotData; @end @@ -18,9 +18,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Donut Chart"; self.section = kPieCharts; } @@ -30,14 +30,14 @@ -(instancetype)init -(void)generateData { - if ( self.plotData == nil ) { + if ( self.plotData.count == 0 ) { self.plotData = @[@20.0, @30.0, @60.0]; } } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -59,8 +59,8 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP whiteShadow.shadowColor = [[CPTColor whiteColor] colorWithAlphaComponent:0.25]; // Add pie chart - const CGFloat outerRadius = MIN( CPTFloat(0.7) * (hostingView.frame.size.height - CPTFloat(2.0) * graph.paddingLeft) / CPTFloat(2.0), - CPTFloat(0.7) * (hostingView.frame.size.width - CPTFloat(2.0) * graph.paddingTop) / CPTFloat(2.0) ); + const CGFloat outerRadius = MIN(CPTFloat(0.7) * (hostingView.frame.size.height - CPTFloat(2.0) * graph.paddingLeft) / CPTFloat(2.0), + CPTFloat(0.7) * (hostingView.frame.size.width - CPTFloat(2.0) * graph.paddingTop) / CPTFloat(2.0)); const CGFloat innerRadius = outerRadius / CPTFloat(2.0); CPTPieChart *piePlot = [[CPTPieChart alloc] init]; @@ -92,7 +92,7 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Add another pie chart piePlot = [[CPTPieChart alloc] init]; piePlot.dataSource = self; - piePlot.pieRadius = CPTFloat( animated ? 0.0 : (innerRadius - 5.0) ); + piePlot.pieRadius = (animated ? CPTFloat(0.0) : (innerRadius - CPTFloat(5.0))); piePlot.identifier = innerChartName; piePlot.borderLineStyle = whiteLineStyle; piePlot.startAngle = CPTFloat(M_PI_4); @@ -113,7 +113,7 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP } } --(void)pieChart:(CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)index +-(void)pieChart:(nonnull CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)index { NSLog(@"%@ slice was selected at index %lu. Value = %@", plot.identifier, (unsigned long)index, self.plotData[index]); } @@ -121,12 +121,12 @@ -(void)pieChart:(CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)in #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSNumber *num; @@ -140,21 +140,21 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI return num; } --(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index +-(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *)plot recordIndex:(NSUInteger)index { static CPTMutableTextStyle *whiteText = nil; static dispatch_once_t onceToken = 0; CPTTextLayer *newLayer = nil; - if ( [(NSString *)plot.identifier isEqualToString : outerChartName] ) { + if ( [(NSString *) plot.identifier isEqualToString:outerChartName] ) { dispatch_once(&onceToken, ^{ - whiteText = [[CPTMutableTextStyle alloc] init]; - whiteText.color = [CPTColor whiteColor]; + whiteText = [[CPTMutableTextStyle alloc] init]; + whiteText.color = [CPTColor whiteColor]; whiteText.fontSize = self.titleSize * CPTFloat(0.5); }); - newLayer = [[CPTTextLayer alloc] initWithText:[NSString stringWithFormat:@"%.0f", [self.plotData[index] floatValue]] style:whiteText]; + newLayer = [[CPTTextLayer alloc] initWithText:[NSString stringWithFormat:@"%.0f", self.plotData[index].doubleValue] style:whiteText]; newLayer.fill = [CPTFill fillWithColor:[CPTColor darkGrayColor]]; newLayer.cornerRadius = 5.0; newLayer.paddingLeft = 3.0; @@ -167,11 +167,11 @@ -(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index return newLayer; } --(CGFloat)radialOffsetForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)index +-(CGFloat)radialOffsetForPieChart:(nonnull CPTPieChart *)pieChart recordIndex:(NSUInteger)index { CGFloat result = 0.0; - if ( [(NSString *)pieChart.identifier isEqualToString : outerChartName] ) { + if ( [(NSString *) pieChart.identifier isEqualToString:outerChartName] ) { result = (index == 0 ? 15.0 : 0.0); } return result; @@ -180,27 +180,27 @@ -(CGFloat)radialOffsetForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUIntege #pragma mark - #pragma mark Animation Delegate --(void)animationDidStart:(id)operation +-(void)animationDidStart:(nonnull id)operation { NSLog(@"animationDidStart: %@", operation); } --(void)animationDidFinish:(CPTAnimationOperation *)operation +-(void)animationDidFinish:(nonnull CPTAnimationOperation *)operation { NSLog(@"animationDidFinish: %@", operation); } --(void)animationCancelled:(CPTAnimationOperation *)operation +-(void)animationCancelled:(nonnull CPTAnimationOperation *)operation { NSLog(@"animationCancelled: %@", operation); } --(void)animationWillUpdate:(CPTAnimationOperation *)operation +-(void)animationWillUpdate:(nonnull CPTAnimationOperation *__unused)operation { NSLog(@"animationWillUpdate:"); } --(void)animationDidUpdate:(CPTAnimationOperation *)operation +-(void)animationDidUpdate:(nonnull CPTAnimationOperation *__unused)operation { NSLog(@"animationDidUpdate:"); } diff --git a/examples/CorePlotGallery/src/plots/FunctionPlot.m b/examples/CorePlotGallery/src/plots/FunctionPlot.m index 72146befc..839ca3d52 100644 --- a/examples/CorePlotGallery/src/plots/FunctionPlot.m +++ b/examples/CorePlotGallery/src/plots/FunctionPlot.m @@ -4,13 +4,9 @@ @interface FunctionPlot() -@property (nonatomic, readwrite, strong) NSMutableSet *dataSources; +@property (nonatomic, readwrite, strong) NSMutableSet *dataSources; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE --(UIFont *)italicFontForFont:(UIFont *)oldFont; -#else --(NSFont *)italicFontForFont:(NSFont *)oldFont; -#endif +-(nullable CPTNativeFont *)italicFontForFont:(nonnull CPTNativeFont *)oldFont; @end @@ -29,9 +25,9 @@ +(void)load #pragma mark - --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { dataSources = [[NSMutableSet alloc] init]; self.title = @"Math Function Plot"; @@ -48,9 +44,9 @@ -(void)killGraph [super killGraph]; } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -65,8 +61,8 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Setup scatter plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace; plotSpace.allowsUserInteraction = YES; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(2.0 * M_PI)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.1) length:CPTDecimalFromDouble(2.2)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(2.0 * M_PI)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-1.1) length:@2.2]; // Grid line styles CPTMutableLineStyle *majorGridLineStyle = [CPTMutableLineStyle lineStyle]; @@ -84,7 +80,7 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Label x axis with a fixed interval policy CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(M_PI_4); + x.majorIntervalLength = @(M_PI_4); x.minorTicksPerInterval = 3; x.labelFormatter = formatter; x.majorGridLineStyle = majorGridLineStyle; @@ -116,13 +112,13 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP switch ( plotNum ) { case 0: - titleString = @"y = sin(x)"; + titleString = NSLocalizedString(@"y = sin(x)", @"y = sin(x)"); function = &sin; lineColor = [CPTColor redColor]; break; case 1: - titleString = @"y = cos(x)"; + titleString = NSLocalizedString(@"y = cos(x)", @"y = cos(x)"); block = ^(double xVal) { return cos(xVal); }; @@ -130,7 +126,7 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP break; case 2: - titleString = @"y = tan(x)"; + titleString = NSLocalizedString(@"y = tan(x)", @"y = tan(x)"); function = &tan; lineColor = [CPTColor blueColor]; break; @@ -139,29 +135,24 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP CPTScatterPlot *linePlot = [[CPTScatterPlot alloc] init]; linePlot.identifier = [NSString stringWithFormat:@"Function Plot %lu", (unsigned long)(plotNum + 1)]; - NSDictionary *textAttributes = x.titleTextStyle.attributes; + CPTDictionary *textAttributes = x.titleTextStyle.attributes; NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:titleString attributes:textAttributes]; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - UIFont *italicFont = [self italicFontForFont:textAttributes[NSFontAttributeName]]; -#else - NSFont *italicFont = [self italicFontForFont:textAttributes[NSFontAttributeName]]; -#endif + CPTNativeFont *fontAttribute = textAttributes[NSFontAttributeName]; + if ( fontAttribute ) { + CPTNativeFont *italicFont = [self italicFontForFont:fontAttribute]; - [title addAttribute:NSFontAttributeName - value:italicFont - range:NSMakeRange(0, 1)]; - [title addAttribute:NSFontAttributeName - value:italicFont - range:NSMakeRange(8, 1)]; + [title addAttribute:NSFontAttributeName + value:italicFont + range:NSMakeRange(0, 1)]; + [title addAttribute:NSFontAttributeName + value:italicFont + range:NSMakeRange(8, 1)]; + } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - UIFont *labelFont = [UIFont fontWithName:@"Helvetica" size:self.titleSize * CPTFloat(0.5)]; -#else - NSFont *labelFont = [NSFont fontWithName:@"Helvetica" size:self.titleSize * CPTFloat(0.5)]; -#endif + CPTNativeFont *labelFont = [CPTNativeFont fontWithName:@"Helvetica" size:self.titleSize * CPTFloat(0.5)]; [title addAttribute:NSFontAttributeName value:labelFont range:NSMakeRange(0, title.length)]; @@ -192,8 +183,8 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP } // Restrict y range to a global range - CPTPlotRange *globalYRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-2.5) - length:CPTDecimalFromDouble(5.0)]; + CPTPlotRange *globalYRange = [CPTPlotRange plotRangeWithLocation:@(-2.5) + length:@5.0]; plotSpace.globalYRange = globalYRange; // Add legend @@ -204,18 +195,18 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP graph.legend.numberOfRows = 1; graph.legend.delegate = self; graph.legendAnchor = CPTRectAnchorBottom; - graph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(1.25) ); + graph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(1.25)); } #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE --(UIFont *)italicFontForFont:(UIFont *)oldFont +-(nullable UIFont *)italicFontForFont:(nonnull UIFont *)oldFont { NSString *italicName = nil; - NSArray *fontNames = [UIFont fontNamesForFamilyName:oldFont.familyName]; + CPTStringArray *fontNames = [UIFont fontNamesForFamilyName:oldFont.familyName]; for ( NSString *fontName in fontNames ) { - NSString *upperCaseFontName = [fontName uppercaseString]; + NSString *upperCaseFontName = fontName.uppercaseString; if ( [upperCaseFontName rangeOfString:@"ITALIC"].location != NSNotFound ) { italicName = fontName; break; @@ -223,7 +214,7 @@ -(UIFont *)italicFontForFont:(UIFont *)oldFont } if ( !italicName ) { for ( NSString *fontName in fontNames ) { - NSString *upperCaseFontName = [fontName uppercaseString]; + NSString *upperCaseFontName = fontName.uppercaseString; if ( [upperCaseFontName rangeOfString:@"OBLIQUE"].location != NSNotFound ) { italicName = fontName; break; @@ -240,16 +231,17 @@ -(UIFont *)italicFontForFont:(UIFont *)oldFont } #else --(NSFont *)italicFontForFont:(NSFont *)oldFont +-(nullable NSFont *)italicFontForFont:(nonnull NSFont *)oldFont { return [[NSFontManager sharedFontManager] convertFont:oldFont toHaveTrait:NSFontItalicTrait]; } + #endif #pragma mark - Legend delegate --(void)legend:(CPTLegend *)legend legendEntryForPlot:(CPTPlot *)plot wasSelectedAtIndex:(NSUInteger)idx +-(void)legend:(nonnull CPTLegend *__unused)legend legendEntryForPlot:(nonnull CPTPlot *)plot wasSelectedAtIndex:(NSUInteger __unused)idx { plot.hidden = !plot.hidden; } diff --git a/examples/CorePlotGallery/src/plots/GradientScatterPlot.h b/examples/CorePlotGallery/src/plots/GradientScatterPlot.h index 299b8cce3..627e9eb99 100644 --- a/examples/CorePlotGallery/src/plots/GradientScatterPlot.h +++ b/examples/CorePlotGallery/src/plots/GradientScatterPlot.h @@ -1,6 +1,6 @@ // -// GradientScatterPlot.h -// CorePlotGallery +// GradientScatterPlot.h +// CorePlotGallery // #import "PlotItem.h" diff --git a/examples/CorePlotGallery/src/plots/GradientScatterPlot.m b/examples/CorePlotGallery/src/plots/GradientScatterPlot.m index aa72aa6fe..db1004011 100644 --- a/examples/CorePlotGallery/src/plots/GradientScatterPlot.m +++ b/examples/CorePlotGallery/src/plots/GradientScatterPlot.m @@ -1,14 +1,14 @@ // -// GradientScatterPlot.m -// CorePlotGallery +// GradientScatterPlot.m +// CorePlotGallery // #import "GradientScatterPlot.h" @interface GradientScatterPlot() -@property (nonatomic, readwrite, strong) CPTPlotSpaceAnnotation *symbolTextAnnotation; -@property (nonatomic, readwrite, strong) NSArray *plotData; +@property (nonatomic, readwrite, strong, nullable) CPTPlotSpaceAnnotation *symbolTextAnnotation; +@property (nonatomic, readwrite, strong, nonnull) NSArray *plotData; @end @@ -22,9 +22,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Gradient Scatter Plot"; self.section = kLinePlots; } @@ -34,7 +34,7 @@ -(instancetype)init -(void)killGraph { - if ( [self.graphs count] ) { + if ( self.graphs.count ) { CPTGraph *graph = (self.graphs)[0]; CPTPlotSpaceAnnotation *annotation = self.symbolTextAnnotation; @@ -49,8 +49,8 @@ -(void)killGraph -(void)generateData { - if ( self.plotData == nil ) { - NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100]; + if ( self.plotData.count == 0 ) { + NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100]; for ( NSUInteger i = 0; i < 10; i++ ) { NSNumber *x = @(1.0 + i * 0.05); NSNumber *y = @(1.2 * arc4random() / (double)UINT32_MAX + 0.5); @@ -61,9 +61,9 @@ -(void)generateData } } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -95,20 +95,20 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Label x axis with a fixed interval policy CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(0.5); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(1.0); - x.minorTicksPerInterval = 2; - x.majorGridLineStyle = majorGridLineStyle; - x.minorGridLineStyle = minorGridLineStyle; + x.majorIntervalLength = @0.5; + x.orthogonalPosition = @1.0; + x.minorTicksPerInterval = 2; + x.majorGridLineStyle = majorGridLineStyle; + x.minorGridLineStyle = minorGridLineStyle; x.title = @"X Axis"; x.titleOffset = 30.0; - x.titleLocation = CPTDecimalFromDouble(1.25); + x.titleLocation = @1.25; // Label y with an automatic label policy. CPTXYAxis *y = axisSet.yAxis; y.labelingPolicy = CPTAxisLabelingPolicyAutomatic; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(1.0); + y.orthogonalPosition = @1.0; y.minorTicksPerInterval = 2; y.preferredNumberOfMajorTicks = 8; y.majorGridLineStyle = majorGridLineStyle; @@ -117,7 +117,7 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP y.title = @"Y Axis"; y.titleOffset = 30.0; - y.titleLocation = CPTDecimalFromDouble(1.0); + y.titleLocation = @1.0; // Create a plot that uses the data source method CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] init]; @@ -137,23 +137,23 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP areaGradient.angle = -90.0; CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient]; dataSourceLinePlot.areaFill = areaGradientFill; - dataSourceLinePlot.areaBaseValue = CPTDecimalFromDouble(0.0); + dataSourceLinePlot.areaBaseValue = @0.0; // Add some fill bands CPTColor *band1Color = [CPTColor colorWithComponentRed:CPTFloat(0.3) green:CPTFloat(0.3) blue:CPTFloat(1.0) alpha:CPTFloat(0.8)]; CPTGradient *band1Gradient = [CPTGradient gradientWithBeginningColor:band1Color endingColor:[CPTColor clearColor]]; band1Gradient.angle = -90.0; CPTFill *band1Fill = [CPTFill fillWithGradient:band1Gradient]; - [dataSourceLinePlot addAreaFillBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.05) - length:CPTDecimalFromDouble(0.15)] + [dataSourceLinePlot addAreaFillBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:@1.05 + length:@0.15] fill:band1Fill]]; CPTColor *band2Color = [CPTColor colorWithComponentRed:CPTFloat(1.0) green:CPTFloat(0.3) blue:CPTFloat(0.3) alpha:CPTFloat(0.8)]; CPTGradient *band2Gradient = [CPTGradient gradientWithBeginningColor:band2Color endingColor:[CPTColor clearColor]]; band2Gradient.angle = -90.0; CPTFill *band2Fill = [CPTFill fillWithGradient:band2Gradient]; - [dataSourceLinePlot addAreaFillBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.3) - length:CPTDecimalFromDouble(0.1)] + [dataSourceLinePlot addAreaFillBand:[CPTLimitBand limitBandWithRange:[CPTPlotRange plotRangeWithLocation:@1.3 + length:@0.1] fill:band2Fill]]; // Auto scale the plot space to fit the plot data @@ -161,14 +161,12 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP [plotSpace scaleToFitPlots:@[dataSourceLinePlot]]; CPTMutablePlotRange *xRange = [plotSpace.xRange mutableCopy]; CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy]; - [xRange expandRangeByFactor:CPTDecimalFromDouble(1.3)]; - [yRange expandRangeByFactor:CPTDecimalFromDouble(1.3)]; plotSpace.xRange = xRange; plotSpace.yRange = yRange; // Restrict y range to a global range - CPTPlotRange *globalYRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) - length:CPTDecimalFromFloat(2.0f)]; + CPTPlotRange *globalYRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@2.0]; plotSpace.globalYRange = globalYRange; // Add plot symbols @@ -192,31 +190,27 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y"); NSNumber *num = self.plotData[index][key]; - if ( fieldEnum == CPTScatterPlotFieldY ) { - num = @([num doubleValue]); - } - return num; } #pragma mark - #pragma mark Plot Space Delegate Methods --(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate +-(nullable CPTPlotRange *)plotSpace:(nonnull CPTPlotSpace *__unused)space willChangePlotRangeTo:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate { // Impose a limit on how far user can scroll in x if ( coordinate == CPTCoordinateX ) { - CPTPlotRange *maxRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-1.0f) length:CPTDecimalFromFloat(6.0f)]; + CPTPlotRange *maxRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@6.0]; CPTMutablePlotRange *changedRange = [newRange mutableCopy]; [changedRange shiftEndToFitInRange:maxRange]; [changedRange shiftLocationToFitInRange:maxRange]; @@ -228,7 +222,7 @@ -(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotR #pragma mark - #pragma mark CPTScatterPlot delegate method --(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index +-(void)scatterPlot:(nonnull CPTScatterPlot *__unused)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index { CPTGraph *graph = (self.graphs)[0]; @@ -246,38 +240,41 @@ -(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NS hitAnnotationTextStyle.fontName = @"Helvetica-Bold"; // Determine point of symbol in plot coordinates - NSDictionary *dataPoint = self.plotData[index]; + NSDictionary *dataPoint = self.plotData[index]; NSNumber *x = dataPoint[@"x"]; NSNumber *y = dataPoint[@"y"]; - NSArray *anchorPoint = @[x, y]; + CPTNumberArray *anchorPoint = @[x, y]; // Add annotation // First make a string for the y value NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; - [formatter setMaximumFractionDigits:2]; + formatter.maximumFractionDigits = 2; NSString *yString = [formatter stringFromNumber:y]; // Now add the annotation to the plot area - CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:yString style:hitAnnotationTextStyle]; - annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:graph.defaultPlotSpace anchorPlotPoint:anchorPoint]; - annotation.contentLayer = textLayer; - annotation.displacement = CGPointMake(0.0, 20.0); - self.symbolTextAnnotation = annotation; - [graph.plotAreaFrame.plotArea addAnnotation:annotation]; + CPTPlotSpace *defaultSpace = graph.defaultPlotSpace; + if ( defaultSpace ) { + CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:yString style:hitAnnotationTextStyle]; + annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:defaultSpace anchorPlotPoint:anchorPoint]; + annotation.contentLayer = textLayer; + annotation.displacement = CGPointMake(0.0, 20.0); + self.symbolTextAnnotation = annotation; + [graph.plotAreaFrame.plotArea addAnnotation:annotation]; + } } #pragma mark - #pragma mark Plot area delegate method --(void)plotAreaWasSelected:(CPTPlotArea *)plotArea +-(void)plotAreaWasSelected:(nonnull CPTPlotArea *__unused)plotArea { // Remove the annotation CPTPlotSpaceAnnotation *annotation = self.symbolTextAnnotation; if ( annotation ) { - CPTXYGraph *graph = [self.graphs objectAtIndex:0]; + CPTXYGraph *graph = (self.graphs)[0]; [graph.plotAreaFrame.plotArea removeAnnotation:annotation]; self.symbolTextAnnotation = nil; diff --git a/examples/CorePlotGallery/src/plots/ImageDemo.h b/examples/CorePlotGallery/src/plots/ImageDemo.h index 714a09bd4..bc8886a20 100644 --- a/examples/CorePlotGallery/src/plots/ImageDemo.h +++ b/examples/CorePlotGallery/src/plots/ImageDemo.h @@ -1,6 +1,6 @@ // -// ImageDemo.h -// Plot Gallery +// ImageDemo.h +// Plot Gallery // #import "PlotItem.h" diff --git a/examples/CorePlotGallery/src/plots/ImageDemo.m b/examples/CorePlotGallery/src/plots/ImageDemo.m index 8de6cbb54..df304a094 100644 --- a/examples/CorePlotGallery/src/plots/ImageDemo.m +++ b/examples/CorePlotGallery/src/plots/ImageDemo.m @@ -1,6 +1,6 @@ // -// ImageDemo.m -// Plot Gallery +// ImageDemo.m +// Plot Gallery // #import "ImageDemo.h" @@ -12,9 +12,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Image Demo"; self.section = kDemoPlots; } @@ -22,7 +22,7 @@ -(instancetype)init return self; } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { #if TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; @@ -91,11 +91,14 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP titleLayer.paddingTop = self.titleSize * CPTFloat(4.0); titleLayer.paddingBottom = self.titleSize * CPTFloat(0.25); - annotation = [[CPTLayerAnnotation alloc] initWithAnchorLayer:graph.plotAreaFrame.plotArea]; - annotation.rectAnchor = CPTRectAnchorBottomRight; - annotation.contentLayer = titleLayer; - annotation.contentAnchorPoint = CGPointMake(1.0, 0.0); - [graph.plotAreaFrame.plotArea addAnnotation:annotation]; + CPTLayer *anchorLayer = graph.plotAreaFrame.plotArea; + if ( anchorLayer ) { + annotation = [[CPTLayerAnnotation alloc] initWithAnchorLayer:anchorLayer]; + annotation.rectAnchor = CPTRectAnchorBottomRight; + annotation.contentLayer = titleLayer; + annotation.contentAnchorPoint = CGPointMake(1.0, 0.0); + [graph.plotAreaFrame.plotArea addAnnotation:annotation]; + } } @end diff --git a/examples/CorePlotGallery/src/plots/LabelingPolicyDemo.h b/examples/CorePlotGallery/src/plots/LabelingPolicyDemo.h index 73cafa63d..cd498bfe3 100644 --- a/examples/CorePlotGallery/src/plots/LabelingPolicyDemo.h +++ b/examples/CorePlotGallery/src/plots/LabelingPolicyDemo.h @@ -1,6 +1,6 @@ // -// LabelingPolicyDemo.h -// Plot Gallery +// LabelingPolicyDemo.h +// Plot Gallery // #import "PlotItem.h" diff --git a/examples/CorePlotGallery/src/plots/LabelingPolicyDemo.m b/examples/CorePlotGallery/src/plots/LabelingPolicyDemo.m index 0a2e45347..5be94fe80 100644 --- a/examples/CorePlotGallery/src/plots/LabelingPolicyDemo.m +++ b/examples/CorePlotGallery/src/plots/LabelingPolicyDemo.m @@ -1,6 +1,6 @@ // -// LabelingPolicyDemo.m -// Plot Gallery +// LabelingPolicyDemo.m +// Plot Gallery // #import "LabelingPolicyDemo.h" @@ -12,9 +12,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Axis Labeling Policies"; self.section = kDemoPlots; } @@ -22,7 +22,7 @@ -(instancetype)init return self; } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { const CGFloat majorTickLength = 12.0; const CGFloat minorTickLength = 8.0; @@ -50,8 +50,8 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Setup plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromUnsignedInteger(0) length:CPTDecimalFromUnsignedInteger(100)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.75) length:CPTDecimalFromInteger(-5)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@100.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@5.75 length:@(-5.0)]; // Line styles CPTMutableLineStyle *axisLineStyle = [CPTMutableLineStyle lineStyle]; @@ -70,9 +70,9 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP axisTitleTextStyle.fontName = @"Helvetica-Bold"; // Tick locations - NSSet *majorTickLocations = [NSSet setWithObjects:@0, @30, @50, @85, @100, nil]; + CPTNumberSet *majorTickLocations = [NSSet setWithObjects:@0, @30, @50, @85, @100, nil]; - NSMutableSet *minorTickLocations = [NSMutableSet set]; + CPTMutableNumberSet *minorTickLocations = [NSMutableSet set]; for ( NSUInteger loc = 0; loc <= 100; loc += 10 ) { [minorTickLocations addObject:@(loc)]; } @@ -80,25 +80,26 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Axes // CPTAxisLabelingPolicyNone CPTXYAxis *axisNone = [[CPTXYAxis alloc] init]; - axisNone.plotSpace = graph.defaultPlotSpace; - axisNone.labelingPolicy = CPTAxisLabelingPolicyNone; - axisNone.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(1); - axisNone.tickDirection = CPTSignNone; - axisNone.axisLineStyle = axisLineStyle; - axisNone.majorTickLength = majorTickLength; - axisNone.majorTickLineStyle = majorTickLineStyle; - axisNone.minorTickLength = minorTickLength; - axisNone.minorTickLineStyle = minorTickLineStyle; - axisNone.title = @"CPTAxisLabelingPolicyNone"; - axisNone.titleTextStyle = axisTitleTextStyle; - axisNone.titleOffset = titleOffset; - axisNone.majorTickLocations = majorTickLocations; - axisNone.minorTickLocations = minorTickLocations; - NSMutableSet *newAxisLabels = [NSMutableSet set]; + axisNone.plotSpace = graph.defaultPlotSpace; + axisNone.labelingPolicy = CPTAxisLabelingPolicyNone; + axisNone.orthogonalPosition = @1.0; + axisNone.tickDirection = CPTSignNone; + axisNone.axisLineStyle = axisLineStyle; + axisNone.majorTickLength = majorTickLength; + axisNone.majorTickLineStyle = majorTickLineStyle; + axisNone.minorTickLength = minorTickLength; + axisNone.minorTickLineStyle = minorTickLineStyle; + axisNone.title = @"CPTAxisLabelingPolicyNone"; + axisNone.titleTextStyle = axisTitleTextStyle; + axisNone.titleOffset = titleOffset; + axisNone.majorTickLocations = majorTickLocations; + axisNone.minorTickLocations = minorTickLocations; + + CPTMutableAxisLabelSet *newAxisLabels = [NSMutableSet set]; for ( NSUInteger i = 0; i <= 5; i++ ) { CPTAxisLabel *newLabel = [[CPTAxisLabel alloc] initWithText:[NSString stringWithFormat:@"Label %lu", (unsigned long)i] textStyle:axisNone.labelTextStyle]; - newLabel.tickLocation = CPTDecimalFromUnsignedInteger(i * 20); + newLabel.tickLocation = @(i * 20); newLabel.offset = axisNone.labelOffset + axisNone.majorTickLength / CPTFloat(2.0); [newAxisLabels addObject:newLabel]; @@ -107,59 +108,59 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // CPTAxisLabelingPolicyLocationsProvided CPTXYAxis *axisLocationsProvided = [[CPTXYAxis alloc] init]; - axisLocationsProvided.plotSpace = graph.defaultPlotSpace; - axisLocationsProvided.labelingPolicy = CPTAxisLabelingPolicyLocationsProvided; - axisLocationsProvided.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(2); - axisLocationsProvided.tickDirection = CPTSignNone; - axisLocationsProvided.axisLineStyle = axisLineStyle; - axisLocationsProvided.majorTickLength = majorTickLength; - axisLocationsProvided.majorTickLineStyle = majorTickLineStyle; - axisLocationsProvided.minorTickLength = minorTickLength; - axisLocationsProvided.minorTickLineStyle = minorTickLineStyle; - axisLocationsProvided.title = @"CPTAxisLabelingPolicyLocationsProvided"; - axisLocationsProvided.titleTextStyle = axisTitleTextStyle; - axisLocationsProvided.titleOffset = titleOffset; - axisLocationsProvided.majorTickLocations = majorTickLocations; - axisLocationsProvided.minorTickLocations = minorTickLocations; + axisLocationsProvided.plotSpace = graph.defaultPlotSpace; + axisLocationsProvided.labelingPolicy = CPTAxisLabelingPolicyLocationsProvided; + axisLocationsProvided.orthogonalPosition = @2.0; + axisLocationsProvided.tickDirection = CPTSignNone; + axisLocationsProvided.axisLineStyle = axisLineStyle; + axisLocationsProvided.majorTickLength = majorTickLength; + axisLocationsProvided.majorTickLineStyle = majorTickLineStyle; + axisLocationsProvided.minorTickLength = minorTickLength; + axisLocationsProvided.minorTickLineStyle = minorTickLineStyle; + axisLocationsProvided.title = @"CPTAxisLabelingPolicyLocationsProvided"; + axisLocationsProvided.titleTextStyle = axisTitleTextStyle; + axisLocationsProvided.titleOffset = titleOffset; + axisLocationsProvided.majorTickLocations = majorTickLocations; + axisLocationsProvided.minorTickLocations = minorTickLocations; // CPTAxisLabelingPolicyFixedInterval CPTXYAxis *axisFixedInterval = [[CPTXYAxis alloc] init]; - axisFixedInterval.plotSpace = graph.defaultPlotSpace; - axisFixedInterval.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - axisFixedInterval.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(3); - axisFixedInterval.majorIntervalLength = CPTDecimalFromDouble(25.0); - axisFixedInterval.minorTicksPerInterval = 4; - axisFixedInterval.tickDirection = CPTSignNone; - axisFixedInterval.axisLineStyle = axisLineStyle; - axisFixedInterval.majorTickLength = majorTickLength; - axisFixedInterval.majorTickLineStyle = majorTickLineStyle; - axisFixedInterval.minorTickLength = minorTickLength; - axisFixedInterval.minorTickLineStyle = minorTickLineStyle; - axisFixedInterval.title = @"CPTAxisLabelingPolicyFixedInterval"; - axisFixedInterval.titleTextStyle = axisTitleTextStyle; - axisFixedInterval.titleOffset = titleOffset; + axisFixedInterval.plotSpace = graph.defaultPlotSpace; + axisFixedInterval.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; + axisFixedInterval.orthogonalPosition = @3.0; + axisFixedInterval.majorIntervalLength = @25.0; + axisFixedInterval.minorTicksPerInterval = 4; + axisFixedInterval.tickDirection = CPTSignNone; + axisFixedInterval.axisLineStyle = axisLineStyle; + axisFixedInterval.majorTickLength = majorTickLength; + axisFixedInterval.majorTickLineStyle = majorTickLineStyle; + axisFixedInterval.minorTickLength = minorTickLength; + axisFixedInterval.minorTickLineStyle = minorTickLineStyle; + axisFixedInterval.title = @"CPTAxisLabelingPolicyFixedInterval"; + axisFixedInterval.titleTextStyle = axisTitleTextStyle; + axisFixedInterval.titleOffset = titleOffset; // CPTAxisLabelingPolicyAutomatic CPTXYAxis *axisAutomatic = [[CPTXYAxis alloc] init]; - axisAutomatic.plotSpace = graph.defaultPlotSpace; - axisAutomatic.labelingPolicy = CPTAxisLabelingPolicyAutomatic; - axisAutomatic.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(4); - axisAutomatic.minorTicksPerInterval = 9; - axisAutomatic.tickDirection = CPTSignNone; - axisAutomatic.axisLineStyle = axisLineStyle; - axisAutomatic.majorTickLength = majorTickLength; - axisAutomatic.majorTickLineStyle = majorTickLineStyle; - axisAutomatic.minorTickLength = minorTickLength; - axisAutomatic.minorTickLineStyle = minorTickLineStyle; - axisAutomatic.title = @"CPTAxisLabelingPolicyAutomatic"; - axisAutomatic.titleTextStyle = axisTitleTextStyle; - axisAutomatic.titleOffset = titleOffset; + axisAutomatic.plotSpace = graph.defaultPlotSpace; + axisAutomatic.labelingPolicy = CPTAxisLabelingPolicyAutomatic; + axisAutomatic.orthogonalPosition = @4.0; + axisAutomatic.minorTicksPerInterval = 9; + axisAutomatic.tickDirection = CPTSignNone; + axisAutomatic.axisLineStyle = axisLineStyle; + axisAutomatic.majorTickLength = majorTickLength; + axisAutomatic.majorTickLineStyle = majorTickLineStyle; + axisAutomatic.minorTickLength = minorTickLength; + axisAutomatic.minorTickLineStyle = minorTickLineStyle; + axisAutomatic.title = @"CPTAxisLabelingPolicyAutomatic"; + axisAutomatic.titleTextStyle = axisTitleTextStyle; + axisAutomatic.titleOffset = titleOffset; // CPTAxisLabelingPolicyEqualDivisions CPTXYAxis *axisEqualDivisions = [[CPTXYAxis alloc] init]; axisEqualDivisions.plotSpace = graph.defaultPlotSpace; axisEqualDivisions.labelingPolicy = CPTAxisLabelingPolicyEqualDivisions; - axisEqualDivisions.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(5); + axisEqualDivisions.orthogonalPosition = @5.0; axisEqualDivisions.preferredNumberOfMajorTicks = 7; axisEqualDivisions.minorTicksPerInterval = 4; axisEqualDivisions.tickDirection = CPTSignNone; diff --git a/examples/CorePlotGallery/src/plots/LineCapDemo.h b/examples/CorePlotGallery/src/plots/LineCapDemo.h index 196e5502f..479f2f7eb 100644 --- a/examples/CorePlotGallery/src/plots/LineCapDemo.h +++ b/examples/CorePlotGallery/src/plots/LineCapDemo.h @@ -1,6 +1,6 @@ // -// LineCapDemo.h -// Plot Gallery +// LineCapDemo.h +// Plot Gallery // #import "PlotItem.h" diff --git a/examples/CorePlotGallery/src/plots/LineCapDemo.m b/examples/CorePlotGallery/src/plots/LineCapDemo.m index 7e5778dd5..c5b5eb68f 100644 --- a/examples/CorePlotGallery/src/plots/LineCapDemo.m +++ b/examples/CorePlotGallery/src/plots/LineCapDemo.m @@ -1,6 +1,6 @@ // -// LineCapDemo.m -// Plot Gallery +// LineCapDemo.m +// Plot Gallery // #import "LineCapDemo.h" @@ -12,9 +12,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Line Caps"; self.section = kDemoPlots; } @@ -22,7 +22,7 @@ -(instancetype)init return self; } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { #if TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; @@ -46,8 +46,8 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Setup plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromUnsignedInteger(0) length:CPTDecimalFromUnsignedInteger(100)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.5) length:CPTDecimalFromInteger(-6)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@100.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@5.5 length:@(-6.0)]; // Line styles CPTMutableLineStyle *axisLineStyle = [CPTMutableLineStyle lineStyle]; @@ -60,15 +60,15 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP lineCap.fill = [CPTFill fillWithColor:[CPTColor blueColor]]; // Axes - NSMutableArray *axes = [[NSMutableArray alloc] init]; + CPTMutableAxisArray *axes = [[NSMutableArray alloc] init]; CPTLineCapType lineCapType = CPTLineCapTypeNone; while ( lineCapType < CPTLineCapTypeCustom ) { CPTXYAxis *axis = [[CPTXYAxis alloc] init]; - axis.plotSpace = graph.defaultPlotSpace; - axis.labelingPolicy = CPTAxisLabelingPolicyNone; - axis.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(lineCapType / 2); - axis.axisLineStyle = axisLineStyle; + axis.plotSpace = graph.defaultPlotSpace; + axis.labelingPolicy = CPTAxisLabelingPolicyNone; + axis.orthogonalPosition = @(lineCapType / 2); + axis.axisLineStyle = axisLineStyle; lineCap.lineCapType = lineCapType++; axis.axisLineCapMin = lineCap; diff --git a/examples/CorePlotGallery/src/plots/OHLCPlot.h b/examples/CorePlotGallery/src/plots/OHLCPlot.h index 5f25f97ef..a29b0936a 100644 --- a/examples/CorePlotGallery/src/plots/OHLCPlot.h +++ b/examples/CorePlotGallery/src/plots/OHLCPlot.h @@ -1,10 +1,11 @@ // -// OHLCPlot.h -// CorePlotGallery +// OHLCPlot.h +// CorePlotGallery // #import "PlotItem.h" -@interface OHLCPlot : PlotItem +@interface OHLCPlot : PlotItem @end diff --git a/examples/CorePlotGallery/src/plots/OHLCPlot.m b/examples/CorePlotGallery/src/plots/OHLCPlot.m index 85e027473..7761c4069 100644 --- a/examples/CorePlotGallery/src/plots/OHLCPlot.m +++ b/examples/CorePlotGallery/src/plots/OHLCPlot.m @@ -1,6 +1,6 @@ // -// OHLCPlot.m -// CorePlotGallery +// OHLCPlot.m +// CorePlotGallery // #import "OHLCPlot.h" @@ -9,8 +9,8 @@ @interface OHLCPlot() -@property (nonatomic, readwrite, strong) CPTGraph *graph; -@property (nonatomic, readwrite, strong) NSArray *plotData; +@property (nonatomic, readwrite, strong, nullable) CPTGraph *graph; +@property (nonatomic, readwrite, strong, nonnull) NSArray *plotData; @end @@ -24,11 +24,11 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { graph = nil; - plotData = nil; + plotData = @[]; self.title = @"OHLC Plot"; self.section = kFinancialPlots; @@ -39,15 +39,15 @@ -(instancetype)init -(void)generateData { - if ( !self.plotData ) { - NSMutableArray *newData = [NSMutableArray array]; + if ( self.plotData.count == 0 ) { + NSMutableArray *newData = [NSMutableArray array]; for ( NSUInteger i = 0; i < 8; i++ ) { NSTimeInterval x = oneDay * i; double rOpen = 3.0 * arc4random() / (double)UINT32_MAX + 1.0; double rClose = (arc4random() / (double)UINT32_MAX - 0.5) * 0.125 + rOpen; - double rHigh = MAX( rOpen, MAX(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen) ); - double rLow = MIN( rOpen, MIN(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen) ); + double rHigh = MAX(rOpen, MAX(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen)); + double rLow = MIN(rOpen, MIN(rClose, (arc4random() / (double)UINT32_MAX - 0.5) * 0.5 + rOpen)); [newData addObject: @{ @(CPTTradingRangePlotFieldX): @(x), @@ -62,14 +62,14 @@ -(void)generateData } } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { // If you make sure your dates are calculated at noon, you shouldn't have to // worry about daylight savings. If you use midnight, you will have to adjust // for daylight savings time. NSDate *refDate = [NSDate dateWithTimeIntervalSinceReferenceDate:oneDay / 2.0]; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -94,7 +94,7 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Axes CPTXYAxisSet *xyAxisSet = (CPTXYAxisSet *)newGraph.axisSet; CPTXYAxis *xAxis = xyAxisSet.xAxis; - xAxis.majorIntervalLength = CPTDecimalFromDouble(oneDay); + xAxis.majorIntervalLength = @(oneDay); xAxis.minorTicksPerInterval = 0; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.dateStyle = kCFDateFormatterShortStyle; @@ -105,11 +105,11 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP CPTLineCap *lineCap = [[CPTLineCap alloc] init]; lineCap.lineStyle = xAxis.axisLineStyle; lineCap.lineCapType = CPTLineCapTypeOpenArrow; - lineCap.size = CGSizeMake( self.titleSize * CPTFloat(0.5), self.titleSize * CPTFloat(0.5) ); + lineCap.size = CGSizeMake(self.titleSize * CPTFloat(0.5), self.titleSize * CPTFloat(0.5)); xAxis.axisLineCapMax = lineCap; CPTXYAxis *yAxis = xyAxisSet.yAxis; - yAxis.orthogonalCoordinateDecimal = CPTDecimalFromDouble(-0.5 * oneDay); + yAxis.orthogonalPosition = @(-0.5 * oneDay); // Line plot with gradient fill CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] initWithFrame:newGraph.bounds]; @@ -124,14 +124,14 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP areaGradient.angle = -90.0; CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient]; dataSourceLinePlot.areaFill = areaGradientFill; - dataSourceLinePlot.areaBaseValue = CPTDecimalFromDouble(0.0); + dataSourceLinePlot.areaBaseValue = @0.0; areaColor = [CPTColor colorWithComponentRed:CPTFloat(0.0) green:CPTFloat(1.0) blue:CPTFloat(0.0) alpha:CPTFloat(0.6)]; areaGradient = [CPTGradient gradientWithBeginningColor:[CPTColor clearColor] endingColor:areaColor]; areaGradient.angle = -90.0; areaGradientFill = [CPTFill fillWithGradient:areaGradient]; dataSourceLinePlot.areaFill2 = areaGradientFill; - dataSourceLinePlot.areaBaseValue2 = CPTDecimalFromDouble(5.0); + dataSourceLinePlot.areaBaseValue2 = @5.0; // OHLC plot CPTMutableLineStyle *whiteLineStyle = [CPTMutableLineStyle lineStyle]; @@ -170,23 +170,23 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP newGraph.legend.cornerRadius = 5.0; newGraph.legend.swatchCornerRadius = 5.0; newGraph.legendAnchor = CPTRectAnchorBottom; - newGraph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(3.0) ); + newGraph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(3.0)); // Set plot ranges CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-0.5 * oneDay) length:CPTDecimalFromDouble(oneDay * self.plotData.count)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromInteger(0) length:CPTDecimalFromInteger(4)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-0.5 * oneDay) length:@(oneDay * self.plotData.count)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; } #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSDecimalNumber *num = [NSDecimalNumber zero]; @@ -213,7 +213,7 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI #pragma mark - #pragma mark Plot Delegate Methods --(void)tradingRangePlot:(CPTTradingRangePlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index +-(void)tradingRangePlot:(nonnull CPTTradingRangePlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index { NSLog(@"Bar for '%@' was selected at index %d.", plot.identifier, (int)index); } diff --git a/examples/CorePlotGallery/src/plots/PlotSpaceDemo.h b/examples/CorePlotGallery/src/plots/PlotSpaceDemo.h index 9c11d2ba9..b384b8bea 100644 --- a/examples/CorePlotGallery/src/plots/PlotSpaceDemo.h +++ b/examples/CorePlotGallery/src/plots/PlotSpaceDemo.h @@ -1,6 +1,6 @@ // -// PlotSpaceDemo.h -// Plot Gallery +// PlotSpaceDemo.h +// Plot Gallery // #import "PlotItem.h" diff --git a/examples/CorePlotGallery/src/plots/PlotSpaceDemo.m b/examples/CorePlotGallery/src/plots/PlotSpaceDemo.m index dd28ff3f5..c192afd12 100644 --- a/examples/CorePlotGallery/src/plots/PlotSpaceDemo.m +++ b/examples/CorePlotGallery/src/plots/PlotSpaceDemo.m @@ -1,6 +1,6 @@ // -// PlotSpaceDemo.m -// Plot Gallery +// PlotSpaceDemo.m +// Plot Gallery // #import "PlotSpaceDemo.h" @@ -12,9 +12,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Plot Space Demo"; self.section = kDemoPlots; } @@ -22,7 +22,7 @@ -(instancetype)init return self; } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { const CGFloat majorTickLength = 12.0; const CGFloat minorTickLength = 8.0; @@ -66,96 +66,140 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Plot Spaces CPTXYPlotSpace *linearPlotSpace = [[CPTXYPlotSpace alloc] init]; - linearPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromUnsignedInteger(0) length:CPTDecimalFromUnsignedInteger(100)]; - linearPlotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(4.5) length:CPTDecimalFromInteger(-4)]; + linearPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@100.0]; + linearPlotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@6.5 length:@(-6.0)]; CPTXYPlotSpace *negativeLinearPlotSpace = [[CPTXYPlotSpace alloc] init]; - negativeLinearPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromUnsignedInteger(100) length:CPTDecimalFromInteger(-100)]; + negativeLinearPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@100.0 length:@(-100.0)]; negativeLinearPlotSpace.yRange = linearPlotSpace.yRange; CPTXYPlotSpace *logPlotSpace = [[CPTXYPlotSpace alloc] init]; logPlotSpace.xScaleType = CPTScaleTypeLog; - logPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.1) length:CPTDecimalFromDouble(99.9)]; + logPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.1 length:@99.9]; logPlotSpace.yRange = linearPlotSpace.yRange; CPTXYPlotSpace *negativeLogPlotSpace = [[CPTXYPlotSpace alloc] init]; negativeLogPlotSpace.xScaleType = CPTScaleTypeLog; - negativeLogPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromUnsignedInteger(100) length:CPTDecimalFromDouble(-99.9)]; + negativeLogPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@100.0 length:@(-99.9)]; negativeLogPlotSpace.yRange = linearPlotSpace.yRange; + CPTXYPlotSpace *logModulusPlotSpace = [[CPTXYPlotSpace alloc] init]; + logModulusPlotSpace.xScaleType = CPTScaleTypeLogModulus; + logModulusPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-100.0) length:@1100.0]; + logModulusPlotSpace.yRange = linearPlotSpace.yRange; + + CPTXYPlotSpace *negativeLogModulusPlotSpace = [[CPTXYPlotSpace alloc] init]; + negativeLogModulusPlotSpace.xScaleType = CPTScaleTypeLogModulus; + negativeLogModulusPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.1 length:@(-0.2)]; + negativeLogModulusPlotSpace.yRange = linearPlotSpace.yRange; + [graph removePlotSpace:graph.defaultPlotSpace]; [graph addPlotSpace:linearPlotSpace]; [graph addPlotSpace:negativeLinearPlotSpace]; [graph addPlotSpace:logPlotSpace]; [graph addPlotSpace:negativeLogPlotSpace]; + [graph addPlotSpace:logModulusPlotSpace]; + [graph addPlotSpace:negativeLogModulusPlotSpace]; // Axes // Linear axis--positive direction CPTXYAxis *linearAxis = [[CPTXYAxis alloc] init]; - linearAxis.plotSpace = linearPlotSpace; - linearAxis.labelingPolicy = CPTAxisLabelingPolicyAutomatic; - linearAxis.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(1); - linearAxis.minorTicksPerInterval = 9; - linearAxis.tickDirection = CPTSignNone; - linearAxis.axisLineStyle = axisLineStyle; - linearAxis.majorTickLength = majorTickLength; - linearAxis.majorTickLineStyle = majorTickLineStyle; - linearAxis.minorTickLength = minorTickLength; - linearAxis.minorTickLineStyle = minorTickLineStyle; - linearAxis.title = @"Linear Plot Space—Positive Length"; - linearAxis.titleTextStyle = axisTitleTextStyle; - linearAxis.titleOffset = titleOffset; + linearAxis.plotSpace = linearPlotSpace; + linearAxis.labelingPolicy = CPTAxisLabelingPolicyAutomatic; + linearAxis.orthogonalPosition = @1.0; + linearAxis.minorTicksPerInterval = 9; + linearAxis.tickDirection = CPTSignNone; + linearAxis.axisLineStyle = axisLineStyle; + linearAxis.majorTickLength = majorTickLength; + linearAxis.majorTickLineStyle = majorTickLineStyle; + linearAxis.minorTickLength = minorTickLength; + linearAxis.minorTickLineStyle = minorTickLineStyle; + linearAxis.title = @"Linear Plot Space—Positive Length"; + linearAxis.titleTextStyle = axisTitleTextStyle; + linearAxis.titleOffset = titleOffset; // Linear axis--negative direction CPTXYAxis *negativeLinearAxis = [[CPTXYAxis alloc] init]; - negativeLinearAxis.plotSpace = negativeLinearPlotSpace; - negativeLinearAxis.labelingPolicy = CPTAxisLabelingPolicyAutomatic; - negativeLinearAxis.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(2); - negativeLinearAxis.minorTicksPerInterval = 9; - negativeLinearAxis.tickDirection = CPTSignNone; - negativeLinearAxis.axisLineStyle = axisLineStyle; - negativeLinearAxis.majorTickLength = majorTickLength; - negativeLinearAxis.majorTickLineStyle = majorTickLineStyle; - negativeLinearAxis.minorTickLength = minorTickLength; - negativeLinearAxis.minorTickLineStyle = minorTickLineStyle; - negativeLinearAxis.title = @"Linear Plot Space—Negative Length"; - negativeLinearAxis.titleTextStyle = axisTitleTextStyle; - negativeLinearAxis.titleOffset = titleOffset; + negativeLinearAxis.plotSpace = negativeLinearPlotSpace; + negativeLinearAxis.labelingPolicy = CPTAxisLabelingPolicyAutomatic; + negativeLinearAxis.orthogonalPosition = @2.0; + negativeLinearAxis.minorTicksPerInterval = 4; + negativeLinearAxis.tickDirection = CPTSignNone; + negativeLinearAxis.axisLineStyle = axisLineStyle; + negativeLinearAxis.majorTickLength = majorTickLength; + negativeLinearAxis.majorTickLineStyle = majorTickLineStyle; + negativeLinearAxis.minorTickLength = minorTickLength; + negativeLinearAxis.minorTickLineStyle = minorTickLineStyle; + negativeLinearAxis.title = @"Linear Plot Space—Negative Length"; + negativeLinearAxis.titleTextStyle = axisTitleTextStyle; + negativeLinearAxis.titleOffset = titleOffset; // Log axis--positive direction CPTXYAxis *logAxis = [[CPTXYAxis alloc] init]; - logAxis.plotSpace = logPlotSpace; - logAxis.labelingPolicy = CPTAxisLabelingPolicyAutomatic; - logAxis.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(3); - logAxis.minorTicksPerInterval = 9; - logAxis.tickDirection = CPTSignNone; - logAxis.axisLineStyle = axisLineStyle; - logAxis.majorTickLength = majorTickLength; - logAxis.majorTickLineStyle = majorTickLineStyle; - logAxis.minorTickLength = minorTickLength; - logAxis.minorTickLineStyle = minorTickLineStyle; - logAxis.title = @"Log Plot Space—Positive Length"; - logAxis.titleTextStyle = axisTitleTextStyle; - logAxis.titleOffset = titleOffset; + logAxis.plotSpace = logPlotSpace; + logAxis.labelingPolicy = CPTAxisLabelingPolicyAutomatic; + logAxis.orthogonalPosition = @3.0; + logAxis.minorTicksPerInterval = 8; + logAxis.tickDirection = CPTSignNone; + logAxis.axisLineStyle = axisLineStyle; + logAxis.majorTickLength = majorTickLength; + logAxis.majorTickLineStyle = majorTickLineStyle; + logAxis.minorTickLength = minorTickLength; + logAxis.minorTickLineStyle = minorTickLineStyle; + logAxis.title = @"Log Plot Space—Positive Length"; + logAxis.titleTextStyle = axisTitleTextStyle; + logAxis.titleOffset = titleOffset; // Log axis--negative direction CPTXYAxis *negativeLogAxis = [[CPTXYAxis alloc] init]; - negativeLogAxis.plotSpace = negativeLogPlotSpace; - negativeLogAxis.labelingPolicy = CPTAxisLabelingPolicyAutomatic; - negativeLogAxis.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(4); - negativeLogAxis.minorTicksPerInterval = 9; - negativeLogAxis.tickDirection = CPTSignNone; - negativeLogAxis.axisLineStyle = axisLineStyle; - negativeLogAxis.majorTickLength = majorTickLength; - negativeLogAxis.majorTickLineStyle = majorTickLineStyle; - negativeLogAxis.minorTickLength = minorTickLength; - negativeLogAxis.minorTickLineStyle = minorTickLineStyle; - negativeLogAxis.title = @"Log Plot Space—Negative Length"; - negativeLogAxis.titleTextStyle = axisTitleTextStyle; - negativeLogAxis.titleOffset = titleOffset; + negativeLogAxis.plotSpace = negativeLogPlotSpace; + negativeLogAxis.labelingPolicy = CPTAxisLabelingPolicyAutomatic; + negativeLogAxis.orthogonalPosition = @4.0; + negativeLogAxis.minorTicksPerInterval = 4; + negativeLogAxis.tickDirection = CPTSignNone; + negativeLogAxis.axisLineStyle = axisLineStyle; + negativeLogAxis.majorTickLength = majorTickLength; + negativeLogAxis.majorTickLineStyle = majorTickLineStyle; + negativeLogAxis.minorTickLength = minorTickLength; + negativeLogAxis.minorTickLineStyle = minorTickLineStyle; + negativeLogAxis.title = @"Log Plot Space—Negative Length"; + negativeLogAxis.titleTextStyle = axisTitleTextStyle; + negativeLogAxis.titleOffset = titleOffset; + + // Log modulus axis--positive direction + CPTXYAxis *logModulusAxis = [[CPTXYAxis alloc] init]; + logModulusAxis.plotSpace = logModulusPlotSpace; + logModulusAxis.labelingPolicy = CPTAxisLabelingPolicyAutomatic; + logModulusAxis.orthogonalPosition = @5.0; + logModulusAxis.minorTicksPerInterval = 8; + logModulusAxis.tickDirection = CPTSignNone; + logModulusAxis.axisLineStyle = axisLineStyle; + logModulusAxis.majorTickLength = majorTickLength; + logModulusAxis.majorTickLineStyle = majorTickLineStyle; + logModulusAxis.minorTickLength = minorTickLength; + logModulusAxis.minorTickLineStyle = minorTickLineStyle; + logModulusAxis.title = @"Log Modulus Plot Space—Positive Length"; + logModulusAxis.titleTextStyle = axisTitleTextStyle; + logModulusAxis.titleOffset = titleOffset; + + // Log modulus axis--negative direction + CPTXYAxis *negativeLogModulusAxis = [[CPTXYAxis alloc] init]; + negativeLogModulusAxis.plotSpace = negativeLogModulusPlotSpace; + negativeLogModulusAxis.labelingPolicy = CPTAxisLabelingPolicyAutomatic; + negativeLogModulusAxis.orthogonalPosition = @6.0; + negativeLogModulusAxis.minorTicksPerInterval = 4; + negativeLogModulusAxis.tickDirection = CPTSignNone; + negativeLogModulusAxis.axisLineStyle = axisLineStyle; + negativeLogModulusAxis.majorTickLength = majorTickLength; + negativeLogModulusAxis.majorTickLineStyle = majorTickLineStyle; + negativeLogModulusAxis.minorTickLength = minorTickLength; + negativeLogModulusAxis.minorTickLineStyle = minorTickLineStyle; + negativeLogModulusAxis.title = @"Log Modulus Plot Space—Negative Length"; + negativeLogModulusAxis.titleTextStyle = axisTitleTextStyle; + negativeLogModulusAxis.titleOffset = titleOffset; // Add axes to the graph - graph.axisSet.axes = @[linearAxis, negativeLinearAxis, logAxis, negativeLogAxis]; + graph.axisSet.axes = @[linearAxis, negativeLinearAxis, logAxis, negativeLogAxis, logModulusAxis, negativeLogModulusAxis]; } @end diff --git a/examples/CorePlotGallery/src/plots/RangePlot.h b/examples/CorePlotGallery/src/plots/RangePlot.h index 6ba3e717a..53327e4fa 100644 --- a/examples/CorePlotGallery/src/plots/RangePlot.h +++ b/examples/CorePlotGallery/src/plots/RangePlot.h @@ -1,10 +1,12 @@ // -// RangePlot.h -// CorePlotGallery +// RangePlot.h +// CorePlotGallery // #import "PlotItem.h" -@interface RangePlot : PlotItem +@interface RangePlot : PlotItem @end diff --git a/examples/CorePlotGallery/src/plots/RangePlot.m b/examples/CorePlotGallery/src/plots/RangePlot.m index 260d2b323..779a94ee0 100644 --- a/examples/CorePlotGallery/src/plots/RangePlot.m +++ b/examples/CorePlotGallery/src/plots/RangePlot.m @@ -1,6 +1,6 @@ // -// RangePlot.m -// CorePlotGallery +// RangePlot.m +// CorePlotGallery // #import "RangePlot.h" @@ -9,10 +9,10 @@ @interface RangePlot() -@property (nonatomic, readwrite, strong) CPTGraph *graph; -@property (nonatomic, readwrite, strong) NSArray *plotData; -@property (nonatomic, readwrite, strong) CPTFill *areaFill; -@property (nonatomic, readwrite, strong) CPTLineStyle *barLineStyle; +@property (nonatomic, readwrite, strong, nullable) CPTGraph *graph; +@property (nonatomic, readwrite, strong, nonnull) NSArray *plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTFill *areaFill; +@property (nonatomic, readwrite, strong, nonnull) CPTLineStyle *barLineStyle; @end @@ -28,11 +28,11 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { graph = nil; - plotData = nil; + plotData = @[]; self.title = @"Range Plot"; self.section = kFinancialPlots; @@ -43,8 +43,8 @@ -(instancetype)init -(void)generateData { - if ( self.plotData == nil ) { - NSMutableArray *newData = [NSMutableArray array]; + if ( self.plotData.count == 0 ) { + NSMutableArray *newData = [NSMutableArray array]; for ( NSUInteger i = 0; i < 5; i++ ) { NSTimeInterval x = oneDay * (i + 1.0); @@ -68,25 +68,26 @@ -(void)generateData } } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { // If you make sure your dates are calculated at noon, you shouldn't have to // worry about daylight savings. If you use midnight, you will have to adjust // for daylight savings time. NSDate *refDate = [NSDate dateWithTimeIntervalSinceReferenceDate:oneDay / 2.0]; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); #endif CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:bounds]; + self.graph = newGraph; + [self addGraph:newGraph toHostingView:hostingView]; [self applyTheme:theme toGraph:newGraph withDefault:[CPTTheme themeNamed:kCPTDarkGradientTheme]]; newGraph.plotAreaFrame.masksToBorder = NO; - self.graph = newGraph; // Instructions CPTMutableTextStyle *textStyle = [CPTMutableTextStyle textStyle]; @@ -94,17 +95,21 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP textStyle.fontName = @"Helvetica"; textStyle.fontSize = self.titleSize * CPTFloat(0.5); -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:@"Touch to Toggle Range Plot Style" style:textStyle]; #else CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:@"Click to Toggle Range Plot Style" style:textStyle]; #endif - CPTLayerAnnotation *instructionsAnnotation = [[CPTLayerAnnotation alloc] initWithAnchorLayer:newGraph.plotAreaFrame.plotArea]; - instructionsAnnotation.contentLayer = textLayer; - instructionsAnnotation.rectAnchor = CPTRectAnchorBottom; - instructionsAnnotation.contentAnchorPoint = CGPointMake(0.5, 0.0); - instructionsAnnotation.displacement = CGPointMake(0.0, 10.0); - [newGraph.plotAreaFrame.plotArea addAnnotation:instructionsAnnotation]; + + CPTLayer *anchorLayer = newGraph.plotAreaFrame.plotArea; + if ( anchorLayer ) { + CPTLayerAnnotation *instructionsAnnotation = [[CPTLayerAnnotation alloc] initWithAnchorLayer:anchorLayer]; + instructionsAnnotation.contentLayer = textLayer; + instructionsAnnotation.rectAnchor = CPTRectAnchorBottom; + instructionsAnnotation.contentAnchorPoint = CGPointMake(0.5, 0.0); + instructionsAnnotation.displacement = CGPointMake(0.0, 10.0); + [newGraph.plotAreaFrame.plotArea addAnnotation:instructionsAnnotation]; + } // Setup fill and bar style if ( !self.areaFill ) { @@ -122,15 +127,15 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Setup scatter plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; NSTimeInterval xLow = oneDay * 0.5; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(xLow) length:CPTDecimalFromDouble(oneDay * 5.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.5) length:CPTDecimalFromDouble(3.5)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(xLow) length:@(oneDay * 5.0)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.5 length:@3.5]; // Axes CPTXYAxisSet *axisSet = (CPTXYAxisSet *)newGraph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(oneDay); - x.orthogonalCoordinateDecimal = CPTDecimalFromInteger(2); - x.minorTicksPerInterval = 0; + x.majorIntervalLength = @(oneDay); + x.orthogonalPosition = @2.0; + x.minorTicksPerInterval = 0; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.dateStyle = kCFDateFormatterShortStyle; CPTTimeFormatter *timeFormatter = [[CPTTimeFormatter alloc] initWithDateFormatter:dateFormatter]; @@ -138,9 +143,9 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP x.labelFormatter = timeFormatter; CPTXYAxis *y = axisSet.yAxis; - y.majorIntervalLength = CPTDecimalFromDouble(0.5); - y.minorTicksPerInterval = 5; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(oneDay); + y.majorIntervalLength = @0.5; + y.minorTicksPerInterval = 5; + y.orthogonalPosition = @(oneDay); // Create a plot that uses the data source method CPTRangePlot *rangePlot = [[CPTRangePlot alloc] init]; @@ -165,19 +170,20 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP newGraph.legend.borderLineStyle = x.axisLineStyle; newGraph.legend.cornerRadius = 5.0; newGraph.legend.swatchCornerRadius = 3.0; + newGraph.legend.swatchLayout = CPTLegendSwatchLayoutBottom; newGraph.legendAnchor = CPTRectAnchorTop; - newGraph.legendDisplacement = CGPointMake( 0.0, self.titleSize * CPTFloat(-2.0) - CPTFloat(12.0) ); + newGraph.legendDisplacement = CGPointMake(0.0, self.titleSize * CPTFloat(-2.0) - CPTFloat(12.0)); } #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { return self.plotData[index][@(fieldEnum)]; } @@ -185,7 +191,7 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI #pragma mark - #pragma mark Plot Space Delegate Methods --(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(id)event atPoint:(CGPoint)point +-(BOOL)plotSpace:(nonnull CPTPlotSpace *__unused)space shouldHandlePointingDeviceUpEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint __unused)point { CPTRangePlot *rangePlot = (CPTRangePlot *)[self.graph plotWithIdentifier:@"Range Plot"]; @@ -204,10 +210,15 @@ -(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(id)eve return NO; } +-(nullable NSNumber *)barWidthForRangePlot:(nonnull CPTRangePlot *__unused)plot recordIndex:(NSUInteger __unused)idx +{ + return @(arc4random_uniform(85) + 15); +} + #pragma mark - #pragma mark Plot Delegate Methods --(void)rangePlot:(CPTRangePlot *)plot rangeWasSelectedAtRecordIndex:(NSUInteger)index +-(void)rangePlot:(nonnull CPTRangePlot *)plot rangeWasSelectedAtRecordIndex:(NSUInteger)index { NSLog(@"Range for '%@' was selected at index %d.", plot.identifier, (int)index); } diff --git a/examples/CorePlotGallery/src/plots/RealTimePlot.h b/examples/CorePlotGallery/src/plots/RealTimePlot.h index 0684082cd..dff911140 100644 --- a/examples/CorePlotGallery/src/plots/RealTimePlot.h +++ b/examples/CorePlotGallery/src/plots/RealTimePlot.h @@ -1,12 +1,12 @@ // -// RealTimePlot.h -// CorePlotGallery +// RealTimePlot.h +// CorePlotGallery // #import "PlotItem.h" @interface RealTimePlot : PlotItem --(void)newData:(NSTimer *)theTimer; +-(void)newData:(nonnull NSTimer *)theTimer; @end diff --git a/examples/CorePlotGallery/src/plots/RealTimePlot.m b/examples/CorePlotGallery/src/plots/RealTimePlot.m index ff0a4b2cd..053fdda2b 100644 --- a/examples/CorePlotGallery/src/plots/RealTimePlot.m +++ b/examples/CorePlotGallery/src/plots/RealTimePlot.m @@ -1,6 +1,6 @@ // -// RealTimePlot.m -// CorePlotGallery +// RealTimePlot.m +// CorePlotGallery // #import "RealTimePlot.h" @@ -13,9 +13,9 @@ @interface RealTimePlot() -@property (nonatomic, readwrite, strong) NSMutableArray *plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTMutableNumberArray *plotData; @property (nonatomic, readwrite, assign) NSUInteger currentIndex; -@property (nonatomic, readwrite, strong) NSTimer *dataTimer; +@property (nonatomic, readwrite, strong, nullable) NSTimer *dataTimer; @end @@ -30,9 +30,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { plotData = [[NSMutableArray alloc] initWithCapacity:kMaxDataPoints]; dataTimer = nil; @@ -57,9 +57,9 @@ -(void)generateData self.currentIndex = 0; } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -88,29 +88,30 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // X axis CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.labelingPolicy = CPTAxisLabelingPolicyAutomatic; - x.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(0); - x.majorGridLineStyle = majorGridLineStyle; - x.minorGridLineStyle = minorGridLineStyle; - x.minorTicksPerInterval = 9; - x.labelOffset = self.titleSize * CPTFloat(0.25); - x.title = @"X Axis"; - x.titleOffset = self.titleSize * CPTFloat(1.5); + x.labelingPolicy = CPTAxisLabelingPolicyAutomatic; + x.orthogonalPosition = @0.0; + x.majorGridLineStyle = majorGridLineStyle; + x.minorGridLineStyle = minorGridLineStyle; + x.minorTicksPerInterval = 9; + x.labelOffset = self.titleSize * CPTFloat(0.25); + x.title = @"X Axis"; + x.titleOffset = self.titleSize * CPTFloat(1.5); + NSNumberFormatter *labelFormatter = [[NSNumberFormatter alloc] init]; labelFormatter.numberStyle = NSNumberFormatterNoStyle; x.labelFormatter = labelFormatter; // Y axis CPTXYAxis *y = axisSet.yAxis; - y.labelingPolicy = CPTAxisLabelingPolicyAutomatic; - y.orthogonalCoordinateDecimal = CPTDecimalFromUnsignedInteger(0); - y.majorGridLineStyle = majorGridLineStyle; - y.minorGridLineStyle = minorGridLineStyle; - y.minorTicksPerInterval = 3; - y.labelOffset = self.titleSize * CPTFloat(0.25); - y.title = @"Y Axis"; - y.titleOffset = self.titleSize * CPTFloat(1.25); - y.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0]; + y.labelingPolicy = CPTAxisLabelingPolicyAutomatic; + y.orthogonalPosition = @0.0; + y.majorGridLineStyle = majorGridLineStyle; + y.minorGridLineStyle = minorGridLineStyle; + y.minorTicksPerInterval = 3; + y.labelOffset = self.titleSize * CPTFloat(0.25); + y.title = @"Y Axis"; + y.titleOffset = self.titleSize * CPTFloat(1.25); + y.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0]; // Rotate the labels by 45 degrees, just to show it can be done. x.labelRotation = CPTFloat(M_PI_4); @@ -130,18 +131,19 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromUnsignedInteger(0) length:CPTDecimalFromUnsignedInteger(kMaxDataPoints - 2)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromUnsignedInteger(0) length:CPTDecimalFromUnsignedInteger(1)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(kMaxDataPoints - 2)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@1.0]; [self.dataTimer invalidate]; if ( animated ) { - self.dataTimer = [NSTimer timerWithTimeInterval:1.0 / kFrameRate - target:self - selector:@selector(newData:) - userInfo:nil - repeats:YES]; - [[NSRunLoop mainRunLoop] addTimer:self.dataTimer forMode:NSRunLoopCommonModes]; + NSTimer *newTimer = [NSTimer timerWithTimeInterval:1.0 / kFrameRate + target:self + selector:@selector(newData:) + userInfo:nil + repeats:YES]; + self.dataTimer = newTimer; + [[NSRunLoop mainRunLoop] addTimer:newTimer forMode:NSRunLoopCommonModes]; } else { self.dataTimer = nil; @@ -156,7 +158,7 @@ -(void)dealloc #pragma mark - #pragma mark Timer callback --(void)newData:(NSTimer *)theTimer +-(void)newData:(nonnull NSTimer *__unused)theTimer { CPTGraph *theGraph = (self.graphs)[0]; CPTPlot *thePlot = [theGraph plotWithIdentifier:kPlotIdentifier]; @@ -170,10 +172,10 @@ -(void)newData:(NSTimer *)theTimer CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)theGraph.defaultPlotSpace; NSUInteger location = (self.currentIndex >= kMaxDataPoints ? self.currentIndex - kMaxDataPoints + 2 : 0); - CPTPlotRange *oldRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromUnsignedInteger( (location > 0) ? (location - 1) : 0 ) - length:CPTDecimalFromUnsignedInteger(kMaxDataPoints - 2)]; - CPTPlotRange *newRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromUnsignedInteger(location) - length:CPTDecimalFromUnsignedInteger(kMaxDataPoints - 2)]; + CPTPlotRange *oldRange = [CPTPlotRange plotRangeWithLocation:@((location > 0) ? (location - 1) : 0) + length:@(kMaxDataPoints - 2)]; + CPTPlotRange *newRange = [CPTPlotRange plotRangeWithLocation:@(location) + length:@(kMaxDataPoints - 2)]; [CPTAnimation animate:plotSpace property:@"xRange" @@ -182,7 +184,7 @@ -(void)newData:(NSTimer *)theTimer duration:CPTFloat(1.0 / kFrameRate)]; self.currentIndex++; - [self.plotData addObject:@( (1.0 - kAlpha) * [[self.plotData lastObject] doubleValue] + kAlpha * arc4random() / (double)UINT32_MAX )]; + [self.plotData addObject:@((1.0 - kAlpha) * self.plotData.lastObject.doubleValue + kAlpha * arc4random() / (double)UINT32_MAX)]; [thePlot insertDataAtIndex:self.plotData.count - 1 numberOfRecords:1]; } } @@ -190,12 +192,12 @@ -(void)newData:(NSTimer *)theTimer #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSNumber *num = nil; diff --git a/examples/CorePlotGallery/src/plots/SimplePieChart.h b/examples/CorePlotGallery/src/plots/SimplePieChart.h index cb35ffaf2..569890585 100644 --- a/examples/CorePlotGallery/src/plots/SimplePieChart.h +++ b/examples/CorePlotGallery/src/plots/SimplePieChart.h @@ -1,6 +1,6 @@ // -// SimplePieChart.h -// CorePlotGallery +// SimplePieChart.h +// CorePlotGallery // #import "PlotItem.h" diff --git a/examples/CorePlotGallery/src/plots/SimplePieChart.m b/examples/CorePlotGallery/src/plots/SimplePieChart.m index 45fea6329..76e5c79ac 100644 --- a/examples/CorePlotGallery/src/plots/SimplePieChart.m +++ b/examples/CorePlotGallery/src/plots/SimplePieChart.m @@ -1,13 +1,13 @@ // -// SimplePieChart.m -// CorePlotGallery +// SimplePieChart.m +// CorePlotGallery // #import "SimplePieChart.h" @interface SimplePieChart() -@property (nonatomic, readwrite, strong) NSArray *plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray *plotData; @property (nonatomic, readwrite) NSUInteger offsetIndex; @property (nonatomic, readwrite) CGFloat sliceOffset; @@ -24,9 +24,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Simple Pie Chart"; self.section = kPieCharts; @@ -38,14 +38,14 @@ -(instancetype)init -(void)generateData { - if ( self.plotData == nil ) { + if ( self.plotData.count == 0 ) { self.plotData = @[@20.0, @30.0, @60.0]; } } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -68,8 +68,8 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Add pie chart CPTPieChart *piePlot = [[CPTPieChart alloc] init]; piePlot.dataSource = self; - piePlot.pieRadius = MIN( CPTFloat(0.7) * (hostingView.frame.size.height - CPTFloat(2.0) * graph.paddingLeft) / CPTFloat(2.0), - CPTFloat(0.7) * (hostingView.frame.size.width - CPTFloat(2.0) * graph.paddingTop) / CPTFloat(2.0) ); + piePlot.pieRadius = MIN(CPTFloat(0.7) * (hostingView.frame.size.height - CPTFloat(2.0) * graph.paddingLeft) / CPTFloat(2.0), + CPTFloat(0.7) * (hostingView.frame.size.width - CPTFloat(2.0) * graph.paddingTop) / CPTFloat(2.0)); piePlot.identifier = self.title; piePlot.startAngle = CPTFloat(M_PI_4); piePlot.sliceDirection = CPTPieDirectionCounterClockwise; @@ -105,18 +105,18 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP graph.legendDisplacement = CGPointMake(-graph.paddingRight - CPTFloat(10.0), 0.0); } --(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index +-(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *__unused)plot recordIndex:(NSUInteger)index { static CPTMutableTextStyle *whiteText = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - whiteText = [[CPTMutableTextStyle alloc] init]; - whiteText.color = [CPTColor whiteColor]; + whiteText = [[CPTMutableTextStyle alloc] init]; + whiteText.color = [CPTColor whiteColor]; whiteText.fontSize = self.titleSize * CPTFloat(0.5); }); - CPTTextLayer *newLayer = [[CPTTextLayer alloc] initWithText:[NSString stringWithFormat:@"%1.0f", [self.plotData[index] floatValue]] + CPTTextLayer *newLayer = [[CPTTextLayer alloc] initWithText:[NSString stringWithFormat:@"%1.0f", self.plotData[index].doubleValue] style:whiteText]; return newLayer; } @@ -124,19 +124,19 @@ -(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)index #pragma mark - #pragma mark CPTPieChartDelegate Methods --(void)plot:(CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUInteger)index +-(void)Plot:(nonnull CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUInteger)index { NSLog(@"Data label for '%@' was selected at index %d.", plot.identifier, (int)index); } --(void)pieChart:(CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)index +-(void)pieChart:(nonnull CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)index { - NSLog(@"Slice was selected at index %d. Value = %f", (int)index, [self.plotData[index] floatValue]); + NSLog(@"Slice was selected at index %d. Value = %f", (int)index, self.plotData[index].doubleValue); self.offsetIndex = NSNotFound; - NSMutableArray *newData = [[NSMutableArray alloc] init]; - NSUInteger dataCount = (NSUInteger)lrint( ceil(10.0 * arc4random() / (double)UINT32_MAX) ) + 1; + CPTMutableNumberArray *newData = [[NSMutableArray alloc] init]; + NSUInteger dataCount = (NSUInteger)lrint(ceil(10.0 * arc4random() / (double)UINT32_MAX)) + 1; for ( NSUInteger i = 1; i < dataCount; i++ ) { [newData addObject:@(100.0 * arc4random() / (double)UINT32_MAX)]; } @@ -150,14 +150,14 @@ -(void)pieChart:(CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)in #pragma mark - #pragma mark CPTLegendDelegate Methods --(void)legend:(CPTLegend *)legend legendEntryForPlot:(CPTPlot *)plot wasSelectedAtIndex:(NSUInteger)idx +-(void)legend:(nonnull CPTLegend *__unused)legend legendEntryForPlot:(nonnull CPTPlot *)plot wasSelectedAtIndex:(NSUInteger)idx { NSLog(@"Legend entry for '%@' was selected at index %lu.", plot.identifier, (unsigned long)idx); [CPTAnimation animate:self property:@"sliceOffset" - from:(idx == self.offsetIndex ? NAN : 0.0) - to:(idx == self.offsetIndex ? 0.0 : 35.0) + from:(idx == self.offsetIndex ? CPTNAN : CPTFloat(0.0)) + to:(idx == self.offsetIndex ? CPTFloat(0.0) : CPTFloat(35.0)) duration:0.5 animationCurve:CPTAnimationCurveCubicOut delegate:nil]; @@ -168,12 +168,12 @@ -(void)legend:(CPTLegend *)legend legendEntryForPlot:(CPTPlot *)plot wasSelected #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSNumber *num; @@ -187,17 +187,14 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI return num; } --(NSAttributedString *)attributedLegendTitleForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)index +-(NSAttributedString *)attributedLegendTitleForPieChart:(nonnull CPTPieChart *__unused)pieChart recordIndex:(NSUInteger)index { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - UIColor *sliceColor = [CPTPieChart defaultPieSliceColorForIndex:index].uiColor; - UIFont *labelFont = [UIFont fontWithName:@"Helvetica" size:self.titleSize * CPTFloat(0.5)]; -#else - NSColor *sliceColor = [CPTPieChart defaultPieSliceColorForIndex:index].nsColor; - NSFont *labelFont = [NSFont fontWithName:@"Helvetica" size:self.titleSize * CPTFloat(0.5)]; -#endif + CPTNativeColor *sliceColor = [CPTPieChart defaultPieSliceColorForIndex:index].nativeColor; + CPTNativeFont *labelFont = [CPTNativeFont fontWithName:@"Helvetica" + size:self.titleSize * CPTFloat(0.5)]; NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"Pie Slice %lu", (unsigned long)index]]; + [title addAttribute:NSForegroundColorAttributeName value:sliceColor range:NSMakeRange(4, 5)]; @@ -209,7 +206,7 @@ -(NSAttributedString *)attributedLegendTitleForPieChart:(CPTPieChart *)pieChart return title; } --(CGFloat)radialOffsetForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)index +-(CGFloat)radialOffsetForPieChart:(nonnull CPTPieChart *__unused)pieChart recordIndex:(NSUInteger)index { return index == self.offsetIndex ? self.sliceOffset : 0.0; } @@ -224,7 +221,7 @@ -(void)setSliceOffset:(CGFloat)newOffset [self.graphs[0] reloadData]; - if ( newOffset == 0.0 ) { + if ( newOffset == CPTFloat(0.0)) { self.offsetIndex = NSNotFound; } } diff --git a/examples/CorePlotGallery/src/plots/SimpleScatterPlot.h b/examples/CorePlotGallery/src/plots/SimpleScatterPlot.h index e974a12cd..9b86f8bb3 100644 --- a/examples/CorePlotGallery/src/plots/SimpleScatterPlot.h +++ b/examples/CorePlotGallery/src/plots/SimpleScatterPlot.h @@ -1,6 +1,6 @@ // -// SimpleScatterPlot.h -// CorePlotGallery +// SimpleScatterPlot.h +// CorePlotGallery // #import "PlotItem.h" diff --git a/examples/CorePlotGallery/src/plots/SimpleScatterPlot.m b/examples/CorePlotGallery/src/plots/SimpleScatterPlot.m index 951c18e2a..4a321efc4 100644 --- a/examples/CorePlotGallery/src/plots/SimpleScatterPlot.m +++ b/examples/CorePlotGallery/src/plots/SimpleScatterPlot.m @@ -1,14 +1,15 @@ // -// SimpleScatterPlot.m -// CorePlotGallery +// SimpleScatterPlot.m +// CorePlotGallery // #import "SimpleScatterPlot.h" @interface SimpleScatterPlot() -@property (nonatomic, readwrite, strong) CPTPlotSpaceAnnotation *symbolTextAnnotation; -@property (nonatomic, readwrite, strong) NSArray *plotData; +@property (nonatomic, readwrite, strong, nullable) CPTPlotSpaceAnnotation *symbolTextAnnotation; +@property (nonatomic, readwrite, strong, nonnull) NSArray *plotData; +@property (nonatomic, readwrite, assign) CPTScatterPlotHistogramOption histogramOption; @end @@ -16,17 +17,20 @@ @implementation SimpleScatterPlot @synthesize symbolTextAnnotation; @synthesize plotData; +@synthesize histogramOption; +(void)load { [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Simple Scatter Plot"; self.section = kLinePlots; + + self.histogramOption = CPTScatterPlotHistogramSkipSecond; } return self; @@ -34,7 +38,7 @@ -(instancetype)init -(void)killGraph { - if ( [self.graphs count] ) { + if ( self.graphs.count ) { CPTGraph *graph = (self.graphs)[0]; CPTPlotSpaceAnnotation *annotation = self.symbolTextAnnotation; @@ -49,8 +53,8 @@ -(void)killGraph -(void)generateData { - if ( self.plotData == nil ) { - NSMutableArray *contentArray = [NSMutableArray array]; + if ( self.plotData.count == 0 ) { + NSMutableArray *contentArray = [NSMutableArray array]; for ( NSUInteger i = 0; i < 10; i++ ) { NSNumber *x = @(1.0 + i * 0.05); NSNumber *y = @(1.2 * arc4random() / (double)UINT32_MAX + 0.5); @@ -61,9 +65,9 @@ -(void)generateData } } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -98,20 +102,20 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Label x axis with a fixed interval policy CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(0.5); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(1.0); - x.minorTicksPerInterval = 2; - x.majorGridLineStyle = majorGridLineStyle; - x.minorGridLineStyle = minorGridLineStyle; + x.majorIntervalLength = @0.5; + x.orthogonalPosition = @1.0; + x.minorTicksPerInterval = 2; + x.majorGridLineStyle = majorGridLineStyle; + x.minorGridLineStyle = minorGridLineStyle; x.title = @"X Axis"; x.titleOffset = 30.0; - x.titleLocation = CPTDecimalFromDouble(1.25); + x.titleLocation = @1.25; // Label y with an automatic label policy. CPTXYAxis *y = axisSet.yAxis; y.labelingPolicy = CPTAxisLabelingPolicyAutomatic; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(1.0); + y.orthogonalPosition = @1.0; y.minorTicksPerInterval = 2; y.preferredNumberOfMajorTicks = 8; y.majorGridLineStyle = majorGridLineStyle; @@ -120,7 +124,7 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP y.title = @"Y Axis"; y.titleOffset = 30.0; - y.titleLocation = CPTDecimalFromDouble(1.0); + y.titleLocation = @1.0; // Set axes graph.axisSet.axes = @[x, y]; @@ -130,9 +134,10 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP dataSourceLinePlot.identifier = @"Data Source Plot"; CPTMutableLineStyle *lineStyle = [dataSourceLinePlot.dataLineStyle mutableCopy]; - lineStyle.lineWidth = 3.0; - lineStyle.lineColor = [CPTColor greenColor]; - dataSourceLinePlot.dataLineStyle = lineStyle; + lineStyle.lineWidth = 3.0; + lineStyle.lineColor = [CPTColor greenColor]; + dataSourceLinePlot.dataLineStyle = lineStyle; + dataSourceLinePlot.histogramOption = self.histogramOption; dataSourceLinePlot.dataSource = self; [graph addPlot:dataSourceLinePlot]; @@ -142,14 +147,14 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP [plotSpace scaleToFitPlots:@[dataSourceLinePlot]]; CPTMutablePlotRange *xRange = [plotSpace.xRange mutableCopy]; CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy]; - [xRange expandRangeByFactor:CPTDecimalFromDouble(1.3)]; - [yRange expandRangeByFactor:CPTDecimalFromDouble(1.3)]; + [xRange expandRangeByFactor:@1.3]; + [yRange expandRangeByFactor:@1.3]; plotSpace.xRange = xRange; plotSpace.yRange = yRange; // Restrict y range to a global range - CPTPlotRange *globalYRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) - length:CPTDecimalFromFloat(2.0f)]; + CPTPlotRange *globalYRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@2.0]; plotSpace.globalYRange = globalYRange; // Add plot symbols @@ -179,12 +184,12 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y"); NSNumber *num = self.plotData[index][key]; @@ -195,11 +200,11 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI #pragma mark - #pragma mark Plot Space Delegate Methods --(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate +-(nullable CPTPlotRange *)plotSpace:(nonnull CPTPlotSpace *__unused)space willChangePlotRangeTo:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate { // Impose a limit on how far user can scroll in x if ( coordinate == CPTCoordinateX ) { - CPTPlotRange *maxRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-1.0f) length:CPTDecimalFromFloat(6.0f)]; + CPTPlotRange *maxRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@6.0]; CPTMutablePlotRange *changedRange = [newRange mutableCopy]; [changedRange shiftEndToFitInRange:maxRange]; [changedRange shiftLocationToFitInRange:maxRange]; @@ -212,7 +217,7 @@ -(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotR #pragma mark - #pragma mark CPTScatterPlot delegate methods --(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index +-(void)scatterPlot:(nonnull CPTScatterPlot *__unused)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)index { CPTXYGraph *graph = (self.graphs)[0]; @@ -230,39 +235,42 @@ -(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NS hitAnnotationTextStyle.fontName = @"Helvetica-Bold"; // Determine point of symbol in plot coordinates - NSDictionary *dataPoint = self.plotData[index]; + NSDictionary *dataPoint = self.plotData[index]; NSNumber *x = dataPoint[@"x"]; NSNumber *y = dataPoint[@"y"]; - NSArray *anchorPoint = @[x, y]; + CPTNumberArray *anchorPoint = @[x, y]; // Add annotation // First make a string for the y value NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; - [formatter setMaximumFractionDigits:2]; + formatter.maximumFractionDigits = 2; NSString *yString = [formatter stringFromNumber:y]; // Now add the annotation to the plot area - CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:yString style:hitAnnotationTextStyle]; - annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:graph.defaultPlotSpace anchorPlotPoint:anchorPoint]; - annotation.contentLayer = textLayer; - annotation.displacement = CGPointMake(0.0, 20.0); - self.symbolTextAnnotation = annotation; - [graph.plotAreaFrame.plotArea addAnnotation:annotation]; + CPTPlotSpace *defaultSpace = graph.defaultPlotSpace; + if ( defaultSpace ) { + CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:yString style:hitAnnotationTextStyle]; + annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:defaultSpace anchorPlotPoint:anchorPoint]; + annotation.contentLayer = textLayer; + annotation.displacement = CGPointMake(0.0, 20.0); + self.symbolTextAnnotation = annotation; + [graph.plotAreaFrame.plotArea addAnnotation:annotation]; + } } --(void)scatterPlotDataLineWasSelected:(CPTScatterPlot *)plot +-(void)scatterPlotDataLineWasSelected:(nonnull CPTScatterPlot *)plot { NSLog(@"scatterPlotDataLineWasSelected: %@", plot); } --(void)scatterPlotDataLineTouchDown:(CPTScatterPlot *)plot +-(void)scatterPlotDataLineTouchDown:(nonnull CPTScatterPlot *)plot { NSLog(@"scatterPlotDataLineTouchDown: %@", plot); } --(void)scatterPlotDataLineTouchUp:(CPTScatterPlot *)plot +-(void)scatterPlotDataLineTouchUp:(nonnull CPTScatterPlot *)plot { NSLog(@"scatterPlotDataLineTouchUp: %@", plot); } @@ -270,16 +278,33 @@ -(void)scatterPlotDataLineTouchUp:(CPTScatterPlot *)plot #pragma mark - #pragma mark Plot area delegate method --(void)plotAreaWasSelected:(CPTPlotArea *)plotArea +-(void)plotAreaWasSelected:(nonnull CPTPlotArea *__unused)plotArea { - // Remove the annotation - CPTPlotSpaceAnnotation *annotation = self.symbolTextAnnotation; + CPTXYGraph *graph = (self.graphs)[0]; - if ( annotation ) { - CPTXYGraph *graph = [self.graphs objectAtIndex:0]; + if ( graph ) { + // Remove the annotation + CPTPlotSpaceAnnotation *annotation = self.symbolTextAnnotation; - [graph.plotAreaFrame.plotArea removeAnnotation:annotation]; - self.symbolTextAnnotation = nil; + if ( annotation ) { + [graph.plotAreaFrame.plotArea removeAnnotation:annotation]; + self.symbolTextAnnotation = nil; + } + else { + CPTScatterPlotInterpolation interpolation = CPTScatterPlotInterpolationHistogram; + + // Decrease the histogram display option, and if < CPTScatterPlotHistogramNormal display linear graph + if ( --self.histogramOption < CPTScatterPlotHistogramNormal ) { + interpolation = CPTScatterPlotInterpolationLinear; + + // Set the histogram option to the count, as that is guaranteed to be the last available option + 1 + // (thus the next time the user clicks in the empty plot area the value will be decremented, becoming last option) + self.histogramOption = CPTScatterPlotHistogramOptionCount; + } + CPTScatterPlot *dataSourceLinePlot = (CPTScatterPlot *)[graph plotWithIdentifier:@"Data Source Plot"]; + dataSourceLinePlot.interpolation = interpolation; + dataSourceLinePlot.histogramOption = self.histogramOption; + } } } diff --git a/examples/CorePlotGallery/src/plots/SteppedScatterPlot.h b/examples/CorePlotGallery/src/plots/SteppedScatterPlot.h index 6ce56f9a2..4d8d78d2e 100644 --- a/examples/CorePlotGallery/src/plots/SteppedScatterPlot.h +++ b/examples/CorePlotGallery/src/plots/SteppedScatterPlot.h @@ -1,6 +1,6 @@ // -// SteppedScatterPlot.h -// Plot Gallery-Mac +// SteppedScatterPlot.h +// Plot Gallery-Mac // #import "PlotItem.h" @@ -8,4 +8,5 @@ @interface SteppedScatterPlot : PlotItem + @end diff --git a/examples/CorePlotGallery/src/plots/SteppedScatterPlot.m b/examples/CorePlotGallery/src/plots/SteppedScatterPlot.m index b5d5c67f3..861e3a1b7 100644 --- a/examples/CorePlotGallery/src/plots/SteppedScatterPlot.m +++ b/examples/CorePlotGallery/src/plots/SteppedScatterPlot.m @@ -1,13 +1,13 @@ // -// SteppedScatterPlot.m -// Plot Gallery-Mac +// SteppedScatterPlot.m +// Plot Gallery-Mac // #import "SteppedScatterPlot.h" @interface SteppedScatterPlot() -@property (nonatomic, readwrite, strong) NSArray *plotData; +@property (nonatomic, readwrite, strong, nonnull) NSArray *plotData; @end @@ -20,9 +20,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Stepped Scatter Plot"; self.section = kLinePlots; } @@ -32,8 +32,8 @@ -(instancetype)init -(void)generateData { - if ( self.plotData == nil ) { - NSMutableArray *contentArray = [NSMutableArray array]; + if ( self.plotData.count == 0 ) { + NSMutableArray *contentArray = [NSMutableArray array]; for ( NSUInteger i = 0; i < 10; i++ ) { NSNumber *x = @(1.0 + i * 0.05); NSNumber *y = @(1.2 * arc4random() / (double)UINT32_MAX + 1.2); @@ -44,9 +44,9 @@ -(void)generateData } } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -84,25 +84,25 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP areaGradient.angle = -90.0; CPTFill *areaGradientFill = [CPTFill fillWithGradient:areaGradient]; dataSourceLinePlot.areaFill = areaGradientFill; - dataSourceLinePlot.areaBaseValue = CPTDecimalFromDouble(1.75); + dataSourceLinePlot.areaBaseValue = @1.75; // Auto scale the plot space to fit the plot data // Extend the y range by 10% for neatness CPTXYPlotSpace *plotSpace = (id)graph.defaultPlotSpace; [plotSpace scaleToFitPlots:@[dataSourceLinePlot]]; CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy]; - [yRange expandRangeByFactor:CPTDecimalFromDouble(1.1)]; + [yRange expandRangeByFactor:@1.1]; plotSpace.yRange = yRange; // Restrict y range to a global range - CPTPlotRange *globalYRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(6.0f)]; + CPTPlotRange *globalYRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@6.0]; plotSpace.globalYRange = globalYRange; } #pragma mark - #pragma mark CPTScatterPlotDelegate Methods --(void)plot:(CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUInteger)index +-(void)Plot:(nonnull CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUInteger)index { NSLog(@"Data label for '%@' was selected at index %d.", plot.identifier, (int)index); } @@ -110,12 +110,12 @@ -(void)plot:(CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUInteger)index #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y"); NSNumber *num = self.plotData[index][key]; diff --git a/examples/CorePlotGallery/src/plots/VerticalBarChart.h b/examples/CorePlotGallery/src/plots/VerticalBarChart.h index 9d4634483..7f09fff01 100644 --- a/examples/CorePlotGallery/src/plots/VerticalBarChart.h +++ b/examples/CorePlotGallery/src/plots/VerticalBarChart.h @@ -1,6 +1,6 @@ // -// SimpleBarGraph.h -// CorePlotGallery +// SimpleBarGraph.h +// CorePlotGallery // #import "PlotItem.h" diff --git a/examples/CorePlotGallery/src/plots/VerticalBarChart.m b/examples/CorePlotGallery/src/plots/VerticalBarChart.m index eb4255798..2236f441f 100644 --- a/examples/CorePlotGallery/src/plots/VerticalBarChart.m +++ b/examples/CorePlotGallery/src/plots/VerticalBarChart.m @@ -1,6 +1,6 @@ // -// SimpleBarGraph.m -// CorePlotGallery +// SimpleBarGraph.m +// CorePlotGallery // #import "VerticalBarChart.h" @@ -9,7 +9,8 @@ @interface VerticalBarChart() -@property (nonatomic, readwrite, strong) CPTPlotSpaceAnnotation *symbolTextAnnotation; +@property (nonatomic, readwrite, strong, nullable) CPTPlotSpaceAnnotation *symbolTextAnnotation; + @end @implementation VerticalBarChart @@ -21,9 +22,9 @@ +(void)load [super registerPlotItem:self]; } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.title = @"Vertical Bar Chart"; self.section = kBarPlots; } @@ -33,7 +34,7 @@ -(instancetype)init -(void)killGraph { - if ( [self.graphs count] ) { + if ( self.graphs.count ) { CPTGraph *graph = (self.graphs)[0]; CPTPlotSpaceAnnotation *annotation = self.symbolTextAnnotation; @@ -50,9 +51,9 @@ -(void)generateData { } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL __unused)animated { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGRect bounds = hostingView.bounds; #else CGRect bounds = NSRectToCGRect(hostingView.bounds); @@ -76,12 +77,12 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP CPTXYPlotSpace *barPlotSpace = [[CPTXYPlotSpace alloc] init]; [barPlotSpace setScaleType:CPTScaleTypeCategory forCoordinate:CPTCoordinateX]; if ( kUseHorizontalBars ) { - barPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-10.0f) length:CPTDecimalFromFloat(120.0f)]; - barPlotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-1.0f) length:CPTDecimalFromFloat(11.0f)]; + barPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-10.0) length:@120.0]; + barPlotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@11.0]; } else { - barPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-1.0f) length:CPTDecimalFromFloat(11.0f)]; - barPlotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-10.0f) length:CPTDecimalFromFloat(120.0f)]; + barPlotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@11.0]; + barPlotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-10.0) length:@120.0]; } [graph addPlotSpace:barPlotSpace]; @@ -98,38 +99,39 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; CPTXYAxis *x = axisSet.xAxis; { - x.majorIntervalLength = ( kUseHorizontalBars ? CPTDecimalFromInteger(10) : CPTDecimalFromInteger(1) ); - x.minorTicksPerInterval = (kUseHorizontalBars ? 9 : 0); - x.orthogonalCoordinateDecimal = ( kUseHorizontalBars ? CPTDecimalFromDouble(-0.5) : CPTDecimalFromInteger(0) ); + x.majorIntervalLength = (kUseHorizontalBars ? @10.0 : @1.0); + x.minorTicksPerInterval = (kUseHorizontalBars ? 9 : 0); + x.orthogonalPosition = (kUseHorizontalBars ? @(-0.5) : @0.0); x.majorGridLineStyle = majorGridLineStyle; x.minorGridLineStyle = minorGridLineStyle; x.axisLineStyle = nil; x.majorTickLineStyle = nil; x.minorTickLineStyle = nil; - x.labelOffset = self.titleSize * CPTFloat(0.5); + + x.labelOffset = self.titleSize * CPTFloat(0.5); if ( kUseHorizontalBars ) { - x.visibleRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(100.0f)]; - x.gridLinesRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-0.5f) length:CPTDecimalFromFloat(10.0f)]; + x.visibleRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@100.0]; + x.gridLinesRange = [CPTPlotRange plotRangeWithLocation:@(-0.5) length:@10.0]; } else { - x.visibleRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-0.5f) length:CPTDecimalFromFloat(10.0f)]; - x.gridLinesRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(100.0f)]; + x.visibleRange = [CPTPlotRange plotRangeWithLocation:@(-0.5) length:@10.0]; + x.gridLinesRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@100.0]; } x.title = @"X Axis"; x.titleOffset = self.titleSize * CPTFloat(1.5); - x.titleLocation = ( kUseHorizontalBars ? CPTDecimalFromInteger(55) : CPTDecimalFromInteger(5) ); + x.titleLocation = (kUseHorizontalBars ? @55.0 : @5.0); x.plotSpace = barPlotSpace; } CPTXYAxis *y = axisSet.yAxis; { - y.majorIntervalLength = ( kUseHorizontalBars ? CPTDecimalFromInteger(1) : CPTDecimalFromInteger(10) ); - y.minorTicksPerInterval = (kUseHorizontalBars ? 0 : 9); - y.orthogonalCoordinateDecimal = ( kUseHorizontalBars ? CPTDecimalFromInteger(0) : CPTDecimalFromDouble(-0.5) ); + y.majorIntervalLength = (kUseHorizontalBars ? @1.0 : @10.0); + y.minorTicksPerInterval = (kUseHorizontalBars ? 0 : 9); + y.orthogonalPosition = (kUseHorizontalBars ? @0.0 : @(-0.5)); y.preferredNumberOfMajorTicks = 8; y.majorGridLineStyle = majorGridLineStyle; @@ -139,37 +141,38 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP y.minorTickLineStyle = nil; y.labelOffset = self.titleSize * CPTFloat(0.5); y.labelRotation = CPTFloat(M_PI_2); + if ( kUseHorizontalBars ) { - y.visibleRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-0.5f) length:CPTDecimalFromFloat(10.0f)]; - y.gridLinesRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(100.0f)]; + y.visibleRange = [CPTPlotRange plotRangeWithLocation:@(-0.5) length:@10.0]; + y.gridLinesRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@100.0]; } else { - y.visibleRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0f) length:CPTDecimalFromFloat(100.0f)]; - y.gridLinesRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-0.5f) length:CPTDecimalFromFloat(10.0f)]; + y.visibleRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@100.0]; + y.gridLinesRange = [CPTPlotRange plotRangeWithLocation:@(-0.5) length:@10.0]; } y.title = @"Y Axis"; y.titleOffset = self.titleSize * CPTFloat(1.5); - y.titleLocation = ( kUseHorizontalBars ? CPTDecimalFromInteger(5) : CPTDecimalFromInteger(55) ); + y.titleLocation = (kUseHorizontalBars ? @5.0 : @55.0); y.plotSpace = barPlotSpace; } - // Set axes +// Set axes graph.axisSet.axes = @[x, y]; - // Create a bar line style +// Create a bar line style CPTMutableLineStyle *barLineStyle = [[CPTMutableLineStyle alloc] init]; barLineStyle.lineWidth = 1.0; barLineStyle.lineColor = [CPTColor whiteColor]; - // Create first bar plot +// Create first bar plot CPTBarPlot *barPlot = [[CPTBarPlot alloc] init]; barPlot.lineStyle = barLineStyle; barPlot.fill = [CPTFill fillWithColor:[CPTColor colorWithComponentRed:1.0 green:0.0 blue:0.5 alpha:0.5]]; barPlot.barBasesVary = YES; - barPlot.barWidth = CPTDecimalFromFloat(0.5f); // bar is 50% of the available space + barPlot.barWidth = @0.5; // bar is 50% of the available space barPlot.barCornerRadius = 10.0; barPlot.barsAreHorizontal = kUseHorizontalBars; @@ -189,11 +192,10 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP // Create second bar plot CPTBarPlot *barPlot2 = [CPTBarPlot tubularBarPlotWithColor:[CPTColor blueColor] horizontalBars:NO]; - barPlot2.lineStyle = barLineStyle; - barPlot2.fill = [CPTFill fillWithColor:[CPTColor colorWithComponentRed:0.0 green:1.0 blue:0.5 alpha:0.5]]; - barPlot2.barBasesVary = YES; - - barPlot2.barWidth = CPTDecimalFromFloat(1.0f); // bar is full (100%) width + barPlot2.lineStyle = barLineStyle; + barPlot2.fill = [CPTFill fillWithColor:[CPTColor colorWithComponentRed:0.0 green:1.0 blue:0.5 alpha:0.5]]; + barPlot2.barBasesVary = YES; + barPlot2.barWidth = @1.0; // bar is full (100%) width barPlot2.barCornerRadius = 2.0; barPlot2.barsAreHorizontal = kUseHorizontalBars; @@ -204,13 +206,13 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP [graph addPlot:barPlot2 toPlotSpace:barPlotSpace]; - // Add legend using an annotation + // Add legend CPTLegend *theLegend = [CPTLegend legendWithGraph:graph]; theLegend.numberOfRows = 2; theLegend.fill = [CPTFill fillWithColor:[CPTColor colorWithGenericGray:CPTFloat(0.15)]]; theLegend.borderLineStyle = barLineStyle; theLegend.cornerRadius = textSize * CPTFloat(0.25); - theLegend.swatchSize = CGSizeMake( textSize * CPTFloat(0.75), textSize * CPTFloat(0.75) ); + theLegend.swatchSize = CGSizeMake(textSize * CPTFloat(0.75), textSize * CPTFloat(0.75)); whiteTextStyle.fontSize = textSize * CPTFloat(0.5); theLegend.textStyle = whiteTextStyle; theLegend.rowMargin = textSize * CPTFloat(0.25); @@ -220,12 +222,12 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP theLegend.paddingRight = textSize * CPTFloat(0.375); theLegend.paddingBottom = textSize * CPTFloat(0.375); - NSArray *plotPoint = (kUseHorizontalBars ? @[@95, @0] : @[@0, @95]); + CPTNumberArray *plotPoint = (kUseHorizontalBars ? @[@95, @0] : @[@0, @95]); CPTPlotSpaceAnnotation *legendAnnotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:barPlotSpace anchorPlotPoint:plotPoint]; legendAnnotation.contentLayer = theLegend; - legendAnnotation.contentAnchorPoint = ( kUseHorizontalBars ? CGPointMake(1.0, 0.0) : CGPointMake(0.0, 1.0) ); + legendAnnotation.contentAnchorPoint = (kUseHorizontalBars ? CGPointMake(1.0, 0.0) : CGPointMake(0.0, 1.0)); [graph.plotAreaFrame.plotArea addAnnotation:legendAnnotation]; } @@ -233,16 +235,16 @@ -(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CP #pragma mark - #pragma mark CPTBarPlot delegate methods --(void)plot:(CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUInteger)index +-(void)Plot:(nonnull CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUInteger)index { NSLog(@"Data label for '%@' was selected at index %d.", plot.identifier, (int)index); } --(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index +-(void)barPlot:(nonnull CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index { NSNumber *value = [self numberForPlot:plot field:CPTBarPlotFieldBarTip recordIndex:index]; - NSLog(@"Bar for '%@' was selected at index %d. Value = %f", plot.identifier, (int)index, [value floatValue]); + NSLog(@"Bar for '%@' was selected at index %d. Value = %f", plot.identifier, (int)index, value.doubleValue); CPTGraph *graph = (self.graphs)[0]; @@ -262,51 +264,54 @@ -(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index NSNumber *x = @(index); NSNumber *y = @2; - NSArray *anchorPoint = (kUseHorizontalBars ? @[y, x] : @[x, y]); + CPTNumberArray *anchorPoint = (kUseHorizontalBars ? @[y, x] : @[x, y]); // Add annotation // First make a string for the y value NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; - [formatter setMaximumFractionDigits:2]; + formatter.maximumFractionDigits = 2; NSString *yString = [formatter stringFromNumber:value]; // Now add the annotation to the plot area - CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:yString style:hitAnnotationTextStyle]; - annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:plot.plotSpace anchorPlotPoint:anchorPoint]; - annotation.contentLayer = textLayer; - annotation.displacement = CGPointMake(0.0, 0.0); - self.symbolTextAnnotation = annotation; - - [graph.plotAreaFrame.plotArea addAnnotation:annotation]; + CPTPlotSpace *space = plot.plotSpace; + if ( space ) { + CPTTextLayer *textLayer = [[CPTTextLayer alloc] initWithText:yString style:hitAnnotationTextStyle]; + annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:space anchorPlotPoint:anchorPoint]; + annotation.contentLayer = textLayer; + annotation.displacement = CGPointMake(0.0, 0.0); + self.symbolTextAnnotation = annotation; + + [graph.plotAreaFrame.plotArea addAnnotation:annotation]; + } } #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return 10; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { id num = nil; if ( fieldEnum == CPTBarPlotFieldBarLocation ) { - // location +// location num = [NSString stringWithFormat:@"Cat %lu", (unsigned long)index]; } else if ( fieldEnum == CPTBarPlotFieldBarTip ) { - // length +// length if ( [plot.identifier isEqual:@"Bar Plot 2"] ) { num = @(index); } else { - num = @( (index + 1) * (index + 1) ); + num = @((index + 1) * (index + 1)); } } else { - // base +// base if ( [plot.identifier isEqual:@"Bar Plot 2"] ) { num = @0; } diff --git a/examples/CorePlotGallery/src/shared/PiNumberFormatter.m b/examples/CorePlotGallery/src/shared/PiNumberFormatter.m index dc8aa6f7b..8b1f1fdfb 100644 --- a/examples/CorePlotGallery/src/shared/PiNumberFormatter.m +++ b/examples/CorePlotGallery/src/shared/PiNumberFormatter.m @@ -2,6 +2,8 @@ double gcd(double a, double b); +#pragma mark - + /** @brief A number formatter that converts numbers to multiples of π. **/ @implementation PiNumberFormatter @@ -17,12 +19,12 @@ @implementation PiNumberFormatter * @param coordinateValue The numeric value. * @return The formatted string. **/ --(NSString *)stringForObjectValue:(id)coordinateValue +-(nullable NSString *)stringForObjectValue:(nullable id)coordinateValue { NSString *string = nil; if ( [coordinateValue respondsToSelector:@selector(doubleValue)] ) { - double value = [(NSNumber *)coordinateValue doubleValue] / M_PI; + double value = ((NSNumber *)coordinateValue).doubleValue / M_PI; double factor = round(self.multiplier.doubleValue); if ( factor == 0.0 ) { @@ -32,19 +34,19 @@ -(NSString *)stringForObjectValue:(id)coordinateValue double numerator = round(value * factor); double denominator = factor; double fraction = numerator / denominator; - double divisor = ABS( gcd(numerator, denominator) ); + double divisor = ABS(gcd(numerator, denominator)); if ( fraction == 0.0 ) { string = @"0"; } else if ( ABS(fraction) == 1.0 ) { - string = [NSString stringWithFormat:@"%@π", signbit(fraction) ? self.minusSign:@""]; + string = [NSString stringWithFormat:@"%@π", signbit(fraction) ? self.minusSign : @""]; } else if ( ABS(numerator) == 1.0 ) { - string = [NSString stringWithFormat:@"%@π/%g", signbit(numerator) ? self.minusSign:@"", denominator]; + string = [NSString stringWithFormat:@"%@π/%g", signbit(numerator) ? self.minusSign : @"", denominator]; } else if ( ABS(numerator / divisor) == 1.0 ) { - string = [NSString stringWithFormat:@"%@π/%g", signbit(numerator) ? self.minusSign:@"", denominator / divisor]; + string = [NSString stringWithFormat:@"%@π/%g", signbit(numerator) ? self.minusSign : @"", denominator / divisor]; } else if ( round(fraction) == fraction ) { string = [NSString stringWithFormat:@"%g π", fraction]; @@ -70,7 +72,7 @@ -(NSString *)stringForObjectValue:(id)coordinateValue while ( a != 0.0 ) { c = a; - a = round( fmod(b, a) ); + a = round(fmod(b, a)); b = c; } diff --git a/examples/CorePlotGallery/src/shared/PlotGallery.h b/examples/CorePlotGallery/src/shared/PlotGallery.h index 8ff5f6135..0c6e22f2f 100644 --- a/examples/CorePlotGallery/src/shared/PlotGallery.h +++ b/examples/CorePlotGallery/src/shared/PlotGallery.h @@ -1,23 +1,23 @@ // -// PlotGallery.h -// CorePlotGallery +// PlotGallery.h +// CorePlotGallery // #import "PlotItem.h" -@interface PlotGallery : NSObject +@interface PlotGallery : NSObject @property (nonatomic, readonly) NSUInteger count; @property (nonatomic, readonly) NSUInteger numberOfSections; -@property (nonatomic, readonly, strong) NSArray *sectionTitles; +@property (nonatomic, readonly, strong, nonnull) CPTStringArray *sectionTitles; -+(PlotGallery *)sharedPlotGallery; ++(nonnull PlotGallery *)sharedPlotGallery; --(void)addPlotItem:(PlotItem *)plotItem; +-(void)addPlotItem:(nonnull PlotItem *)plotItem; -(void)sortByTitle; --(PlotItem *)objectInSection:(NSUInteger)section atIndex:(NSUInteger)index; +-(nonnull PlotItem *)objectInSection:(NSUInteger)section atIndex:(NSUInteger)index; -(NSUInteger)numberOfRowsInSection:(NSUInteger)section; @end diff --git a/examples/CorePlotGallery/src/shared/PlotGallery.m b/examples/CorePlotGallery/src/shared/PlotGallery.m index 14eed30e9..fc40ffe5a 100644 --- a/examples/CorePlotGallery/src/shared/PlotGallery.m +++ b/examples/CorePlotGallery/src/shared/PlotGallery.m @@ -1,17 +1,19 @@ // -// PlotGallery.m -// CorePlotGallery +// PlotGallery.m +// CorePlotGallery // #import "PlotGallery.h" @interface PlotGallery() -@property (nonatomic, readwrite, strong) NSMutableArray *plotItems; +@property (nonatomic, readwrite, strong) NSMutableArray *plotItems; @property (nonatomic, readwrite, strong) NSCountedSet *plotSections; @end +#pragma mark - + @implementation PlotGallery @synthesize plotItems; @@ -19,10 +21,9 @@ @implementation PlotGallery static PlotGallery *sharedPlotGallery = nil; -+(PlotGallery *)sharedPlotGallery ++(nonnull PlotGallery *)sharedPlotGallery { - @synchronized(self) - { + @synchronized ( self ) { if ( sharedPlotGallery == nil ) { sharedPlotGallery = [[self alloc] init]; } @@ -32,8 +33,7 @@ +(PlotGallery *)sharedPlotGallery +(id)allocWithZone:(NSZone *)zone { - @synchronized(self) - { + @synchronized ( self ) { if ( sharedPlotGallery == nil ) { return [super allocWithZone:zone]; } @@ -41,14 +41,13 @@ +(id)allocWithZone:(NSZone *)zone return sharedPlotGallery; } --(instancetype)init +-(nonnull instancetype)init { Class thisClass = [self class]; - @synchronized(thisClass) - { + @synchronized ( thisClass ) { if ( sharedPlotGallery == nil ) { - if ( (self = [super init]) ) { + if ((self = [super init])) { sharedPlotGallery = self; plotItems = [[NSMutableArray alloc] init]; plotSections = [[NSCountedSet alloc] init]; @@ -59,12 +58,12 @@ -(instancetype)init return sharedPlotGallery; } --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *__unused)zone { return self; } --(void)addPlotItem:(PlotItem *)plotItem +-(void)addPlotItem:(nonnull PlotItem *)plotItem { [self.plotItems addObject:plotItem]; @@ -89,7 +88,7 @@ -(NSUInteger)numberOfRowsInSection:(NSUInteger)section return [self.plotSections countForObject:self.sectionTitles[section]]; } --(PlotItem *)objectInSection:(NSUInteger)section atIndex:(NSUInteger)index +-(nonnull PlotItem *)objectInSection:(NSUInteger)section atIndex:(NSUInteger)index { NSUInteger offset = 0; @@ -105,9 +104,9 @@ -(void)sortByTitle [self.plotItems sortUsingSelector:@selector(titleCompare:)]; } --(NSArray *)sectionTitles +-(CPTStringArray *)sectionTitles { - return [[self.plotSections allObjects] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; + return [self.plotSections.allObjects sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; } @end diff --git a/examples/CorePlotGallery/src/shared/PlotItem.h b/examples/CorePlotGallery/src/shared/PlotItem.h index ce18914dc..eefd5e40d 100644 --- a/examples/CorePlotGallery/src/shared/PlotItem.h +++ b/examples/CorePlotGallery/src/shared/PlotItem.h @@ -1,12 +1,13 @@ // -// PlotItem.h -// CorePlotGallery +// PlotItem.h +// CorePlotGallery // #import -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE -#import "CorePlot-CocoaTouch.h" +#import + +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #import typedef CGRect CGNSRect; @@ -14,52 +15,51 @@ typedef UIView PlotGalleryNativeView; #else -#import typedef NSRect CGNSRect; typedef NSView PlotGalleryNativeView; #endif -extern NSString *const kDemoPlots; -extern NSString *const kPieCharts; -extern NSString *const kLinePlots; -extern NSString *const kBarPlots; -extern NSString *const kFinancialPlots; +extern NSString *__nonnull const kDemoPlots; +extern NSString *__nonnull const kPieCharts; +extern NSString *__nonnull const kLinePlots; +extern NSString *__nonnull const kBarPlots; +extern NSString *__nonnull const kFinancialPlots; @class CPTGraph; @class CPTTheme; @interface PlotItem : NSObject -@property (nonatomic, readwrite, strong) CPTGraphHostingView *defaultLayerHostingView; +@property (nonatomic, readwrite, strong, nullable) CPTGraphHostingView *defaultLayerHostingView; -@property (nonatomic, readwrite, strong) NSMutableArray *graphs; -@property (nonatomic, readwrite, strong) NSString *section; -@property (nonatomic, readwrite, strong) NSString *title; +@property (nonatomic, readwrite, strong, nonnull) NSMutableArray<__kindof CPTGraph *> *graphs; +@property (nonatomic, readwrite, strong, nonnull) NSString *section; +@property (nonatomic, readwrite, strong, nonnull) NSString *title; @property (nonatomic, readonly) CGFloat titleSize; -+(void)registerPlotItem:(id)item; ++(void)registerPlotItem:(nonnull id)item; --(void)renderInView:(PlotGalleryNativeView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated; --(CPTNativeImage *)image; +-(void)renderInView:(nonnull PlotGalleryNativeView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated; +-(nonnull CPTNativeImage *)image; #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE #else -(void)setFrameSize:(NSSize)size; #endif --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated; +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *)hostingView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated; -(void)formatAllGraphs; -(void)reloadData; --(void)applyTheme:(CPTTheme *)theme toGraph:(CPTGraph *)graph withDefault:(CPTTheme *)defaultTheme; +-(void)applyTheme:(nullable CPTTheme *)theme toGraph:(nonnull CPTGraph *)graph withDefault:(nullable CPTTheme *)defaultTheme; --(void)addGraph:(CPTGraph *)graph; --(void)addGraph:(CPTGraph *)graph toHostingView:(CPTGraphHostingView *)hostingView; +-(void)addGraph:(nonnull CPTGraph *)graph; +-(void)addGraph:(nonnull CPTGraph *)graph toHostingView:(nullable CPTGraphHostingView *)hostingView; -(void)killGraph; -(void)generateData; --(NSComparisonResult)titleCompare:(PlotItem *)other; +-(NSComparisonResult)titleCompare:(nonnull PlotItem *)other; @end diff --git a/examples/CorePlotGallery/src/shared/PlotItem.m b/examples/CorePlotGallery/src/shared/PlotItem.m index 15254b415..08bc060b7 100644 --- a/examples/CorePlotGallery/src/shared/PlotItem.m +++ b/examples/CorePlotGallery/src/shared/PlotItem.m @@ -1,15 +1,15 @@ // -// PlotItem.m -// CorePlotGallery +// PlotItem.m +// CorePlotGallery // #import "PlotGallery.h" #import -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else -// For IKImageBrowser +// For NSCollectionView #import #endif @@ -36,7 +36,7 @@ @implementation PlotItem @synthesize cachedImage; @dynamic titleSize; -+(void)registerPlotItem:(id)item ++(void)registerPlotItem:(nonnull id)item { NSLog(@"registerPlotItem for class %@", [item class]); @@ -51,20 +51,20 @@ +(void)registerPlotItem:(id)item } } --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { defaultLayerHostingView = nil; graphs = [[NSMutableArray alloc] init]; - section = nil; - title = nil; + section = @""; + title = @""; } return self; } --(void)addGraph:(CPTGraph *)graph toHostingView:(CPTGraphHostingView *)hostingView +-(void)addGraph:(nonnull CPTGraph *)graph toHostingView:(nullable CPTGraphHostingView *)hostingView { [self.graphs addObject:graph]; @@ -73,7 +73,7 @@ -(void)addGraph:(CPTGraph *)graph toHostingView:(CPTGraphHostingView *)hostingVi } } --(void)addGraph:(CPTGraph *)graph +-(void)addGraph:(nonnull CPTGraph *)graph { [self addGraph:graph toHostingView:nil]; } @@ -106,7 +106,7 @@ -(void)generateData { } --(NSComparisonResult)titleCompare:(PlotItem *)other +-(NSComparisonResult)titleCompare:(nonnull PlotItem *)other { NSComparisonResult comparisonResult = [self.section caseInsensitiveCompare:other.section]; @@ -121,8 +121,10 @@ -(CGFloat)titleSize { CGFloat size; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - switch ( UI_USER_INTERFACE_IDIOM() ) { +#if TARGET_OS_TV + size = 36.0; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + switch ( UI_USER_INTERFACE_IDIOM()) { case UIUserInterfaceIdiomPad: size = 24.0; break; @@ -142,13 +144,13 @@ -(CGFloat)titleSize return size; } --(void)setPaddingDefaultsForGraph:(CPTGraph *)graph +-(void)setPaddingDefaultsForGraph:(nonnull CPTGraph *)graph { CGFloat boundsPadding = self.titleSize; graph.paddingLeft = boundsPadding; - if ( graph.titleDisplacement.y > 0.0 ) { + if ( graph.titleDisplacement.y > CPTFloat(0.0)) { graph.paddingTop = graph.titleTextStyle.fontSize * CPTFloat(2.0); } else { @@ -172,7 +174,7 @@ -(void)formatAllGraphs graph.title = (self.graphs.count == 1 ? self.title : nil); graph.titleTextStyle = textStyle; - graph.titleDisplacement = CPTPointMake( 0.0, textStyle.fontSize * CPTFloat(1.5) ); + graph.titleDisplacement = CPTPointMake(0.0, textStyle.fontSize * CPTFloat(1.5)); graph.titlePlotAreaFrameAnchor = CPTRectAnchorTop; // Padding @@ -226,7 +228,7 @@ -(void)formatAllGraphs textStyle.fontSize = labelSize; theLegend.textStyle = textStyle; - theLegend.swatchSize = CGSizeMake( labelSize * CPTFloat(1.5), labelSize * CPTFloat(1.5) ); + theLegend.swatchSize = CGSizeMake(labelSize * CPTFloat(1.5), labelSize * CPTFloat(1.5)); theLegend.rowMargin = labelSize * CPTFloat(0.75); theLegend.columnMargin = labelSize * CPTFloat(0.75); @@ -238,9 +240,9 @@ -(void)formatAllGraphs } } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE --(UIImage *)image +-(nonnull CPTNativeImage *)image { if ( self.cachedImage == nil ) { CGRect imageFrame = CGRectMake(0, 0, 400, 300); @@ -285,7 +287,7 @@ -(UIImage *)image #else // OSX --(NSImage *)image +-(nonnull CPTNativeImage *)image { if ( self.cachedImage == nil ) { CGRect imageFrame = CGRectMake(0, 0, 400, 300); @@ -297,26 +299,9 @@ -(NSImage *)image CGSize boundsSize = imageFrame.size; - NSBitmapImageRep *layerImage = [[NSBitmapImageRep alloc] - initWithBitmapDataPlanes:NULL - pixelsWide:(NSInteger)boundsSize.width - pixelsHigh:(NSInteger)boundsSize.height - bitsPerSample:8 - samplesPerPixel:4 - hasAlpha:YES - isPlanar:NO - colorSpaceName:NSCalibratedRGBColorSpace - bytesPerRow:(NSInteger)boundsSize.width * 4 - bitsPerPixel:32]; - - NSGraphicsContext *bitmapContext = [NSGraphicsContext graphicsContextWithBitmapImageRep:layerImage]; - CGContextRef context = (CGContextRef)[bitmapContext graphicsPort]; - - CGContextClearRect( context, CGRectMake(0.0, 0.0, boundsSize.width, boundsSize.height) ); - CGContextSetAllowsAntialiasing(context, true); - CGContextSetShouldSmoothFonts(context, false); - [imageView.layer renderInContext:context]; - CGContextFlush(context); + NSBitmapImageRep *layerImage = [imageView bitmapImageRepForCachingDisplayInRect:imageFrame]; + layerImage.size = boundsSize; + [imageView cacheDisplayInRect:imageFrame toBitmapImageRep:layerImage]; self.cachedImage = [[NSImage alloc] initWithSize:NSSizeFromCGSize(boundsSize)]; [self.cachedImage addRepresentation:layerImage]; @@ -324,9 +309,10 @@ -(NSImage *)image return self.cachedImage; } + #endif --(void)applyTheme:(CPTTheme *)theme toGraph:(CPTGraph *)graph withDefault:(CPTTheme *)defaultTheme +-(void)applyTheme:(nullable CPTTheme *)theme toGraph:(nonnull CPTGraph *)graph withDefault:(nullable CPTTheme *)defaultTheme { if ( theme == nil ) { [graph applyTheme:defaultTheme]; @@ -336,14 +322,15 @@ -(void)applyTheme:(CPTTheme *)theme toGraph:(CPTGraph *)graph withDefault:(CPTTh } } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else --(void)setFrameSize:(NSSize)size +-(void)setFrameSize:(NSSize __unused)size { } + #endif --(void)renderInView:(PlotGalleryNativeView *)inView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInView:(nonnull PlotGalleryNativeView *)inView withTheme:(nullable CPTTheme *)theme animated:(BOOL)animated { [self killGraph]; @@ -351,7 +338,7 @@ -(void)renderInView:(PlotGalleryNativeView *)inView withTheme:(CPTTheme *)theme [inView addSubview:hostingView]; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE hostingView.translatesAutoresizingMaskIntoConstraints = NO; [inView addConstraint:[NSLayoutConstraint constraintWithItem:hostingView attribute:NSLayoutAttributeLeft @@ -382,7 +369,7 @@ -(void)renderInView:(PlotGalleryNativeView *)inView withTheme:(CPTTheme *)theme multiplier:1.0 constant:0.0]]; #else - [hostingView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; + hostingView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; [hostingView setAutoresizesSubviews:YES]; #endif @@ -394,7 +381,7 @@ -(void)renderInView:(PlotGalleryNativeView *)inView withTheme:(CPTTheme *)theme self.defaultLayerHostingView = hostingView; } --(void)renderInGraphHostingView:(CPTGraphHostingView *)hostingView withTheme:(CPTTheme *)theme animated:(BOOL)animated +-(void)renderInGraphHostingView:(nonnull CPTGraphHostingView *__unused)hostingView withTheme:(nullable CPTTheme *__unused)theme animated:(BOOL __unused)animated { NSLog(@"PlotItem:renderInLayer: Override me"); } @@ -409,7 +396,7 @@ -(void)reloadData #pragma mark - #pragma mark IKImageBrowserItem methods -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else -(NSString *)imageUID @@ -431,6 +418,7 @@ -(NSString *)imageTitle { return self.title; } + #endif @end diff --git a/examples/CorePlotGallery/src/tvOS/AppDelegateTV.h b/examples/CorePlotGallery/src/tvOS/AppDelegateTV.h new file mode 100644 index 000000000..45bd5ecd6 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/AppDelegateTV.h @@ -0,0 +1,7 @@ +#import + +@interface AppDelegateTV : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/examples/CorePlotGallery/src/tvOS/AppDelegateTV.m b/examples/CorePlotGallery/src/tvOS/AppDelegateTV.m new file mode 100644 index 000000000..25c2be344 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/AppDelegateTV.m @@ -0,0 +1,16 @@ +#import "AppDelegateTV.h" + +#import "PlotGallery.h" + +@implementation AppDelegateTV + +@synthesize window; + +-(BOOL)application:(UIApplication *__unused)application didFinishLaunchingWithOptions:(NSDictionary *__unused)launchOptions +{ + [[PlotGallery sharedPlotGallery] sortByTitle]; + + return YES; +} + +@end diff --git a/examples/CorePlotGallery/src/tvOS/Base.lproj/Main.storyboard b/examples/CorePlotGallery/src/tvOS/Base.lproj/Main.storyboard new file mode 100644 index 000000000..6c7f86385 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/Base.lproj/Main.storyboard @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/CorePlotGallery/src/tvOS/DetailViewControllerTV.h b/examples/CorePlotGallery/src/tvOS/DetailViewControllerTV.h new file mode 100644 index 000000000..46e67160d --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/DetailViewControllerTV.h @@ -0,0 +1,17 @@ +// +// DetailViewControllerTV.h +// CorePlotGallery +// + +@class PlotItem; + +@interface DetailViewControllerTV : UIViewController + +@property (nonatomic, strong) PlotItem *detailItem; +@property (nonatomic, copy) NSString *currentThemeName; + +@property (nonatomic, strong) IBOutlet UIView *hostingView; + +-(void)themeSelectedWithName:(NSString *)themeName; + +@end diff --git a/examples/CorePlotGallery/src/tvOS/DetailViewControllerTV.m b/examples/CorePlotGallery/src/tvOS/DetailViewControllerTV.m new file mode 100644 index 000000000..7cc1f5d52 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/DetailViewControllerTV.m @@ -0,0 +1,122 @@ +// +// DetailViewControllerTV +// CorePlotGallery +// + +#import "DetailViewControllerTV.h" + +#import "PlotItem.h" +#import "ThemeTableViewControllerTV.h" + +@interface DetailViewControllerTV() + +-(CPTTheme *)currentTheme; + +-(void)setupView; +-(void)themeChanged:(NSNotification *)notification; + +@end + +#pragma mark - + +@implementation DetailViewControllerTV + +@synthesize detailItem; +@synthesize hostingView; +@synthesize currentThemeName; + +#pragma mark - +#pragma mark Initialization and Memory Management + +-(void)setupView +{ + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(themeChanged:) + name:PlotGalleryThemeDidChangeNotification + object:nil]; + + [self.detailItem renderInView:self.hostingView withTheme:[self currentTheme] animated:YES]; +} + +-(void)awakeFromNib +{ + [super awakeFromNib]; + + [self setupView]; +} + +-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { + [self setupView]; + } + + return self; +} + +-(void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +#pragma mark - +#pragma mark Managing the detail item + +-(void)setDetailItem:(PlotItem *)newDetailItem +{ + if ( detailItem != newDetailItem ) { + [detailItem killGraph]; + + detailItem = newDetailItem; + + if ( self.hostingView ) { + [detailItem renderInView:self.hostingView withTheme:[self currentTheme] animated:YES]; + } + } +} + +#pragma mark - +#pragma mark View lifecycle + +-(void)viewDidAppear:(BOOL)animated +{ + [super viewDidAppear:animated]; + + [self setupView]; +} + +#pragma mark - +#pragma mark Theme Selection + +-(CPTTheme *)currentTheme +{ + CPTTheme *theme; + + if ( [self.currentThemeName isEqualToString:kThemeTableViewControllerNoTheme] ) { + theme = (id)[NSNull null]; + } + else if ( [self.currentThemeName isEqualToString:kThemeTableViewControllerDefaultTheme] ) { + theme = nil; + } + else { + theme = [CPTTheme themeNamed:self.currentThemeName]; + } + + return theme; +} + +-(void)themeSelectedWithName:(NSString *)themeName +{ + self.currentThemeName = themeName; + + [self.detailItem renderInView:self.hostingView withTheme:[self currentTheme] animated:YES]; +} + +-(void)themeChanged:(NSNotification *)notification +{ + NSDictionary *themeInfo = notification.userInfo; + + [self themeSelectedWithName:themeInfo[PlotGalleryThemeNameKey]]; +} + +@end diff --git a/examples/CorePlotGallery/src/tvOS/RootViewControllerTV.h b/examples/CorePlotGallery/src/tvOS/RootViewControllerTV.h new file mode 100644 index 000000000..db15ca7f8 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/RootViewControllerTV.h @@ -0,0 +1,10 @@ +// +// RootViewControllerTV.h +// CorePlotGallery +// + +@interface RootViewControllerTV : UITableViewController + +@property (nonatomic, strong) IBOutlet UIBarButtonItem *themeBarButton; + +@end diff --git a/examples/CorePlotGallery/src/tvOS/RootViewControllerTV.m b/examples/CorePlotGallery/src/tvOS/RootViewControllerTV.m new file mode 100644 index 000000000..0e114aef2 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/RootViewControllerTV.m @@ -0,0 +1,125 @@ +// +// RootViewControllerTV.m +// CorePlotGallery +// + +#import "RootViewControllerTV.h" + +#import "DetailViewControllerTV.h" +#import "ThemeTableViewControllerTV.h" + +#import "PlotGallery.h" +#import "PlotItem.h" + +@interface RootViewControllerTV() + +@property (nonatomic, copy) NSString *currentThemeName; + +-(void)themeChanged:(NSNotification *)notification; + +@end + +#pragma mark - + +@implementation RootViewControllerTV + +@synthesize themeBarButton; +@synthesize currentThemeName; + +-(void)viewDidLoad +{ + [super viewDidLoad]; + + self.clearsSelectionOnViewWillAppear = NO; + + self.currentThemeName = kThemeTableViewControllerDefaultTheme; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(themeChanged:) + name:PlotGalleryThemeDidChangeNotification + object:nil]; +} + +-(void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +#pragma mark - +#pragma mark Segues + +-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id __unused)sender +{ + if ( [segue.identifier isEqualToString:@"showDetail"] ) { + DetailViewControllerTV *controller = (DetailViewControllerTV *)segue.destinationViewController; + + controller.navigationItem.leftBarButtonItem = self.splitViewController.displayModeButtonItem; + + controller.currentThemeName = self.currentThemeName; + + NSIndexPath *indexPath = self.tableView.indexPathForSelectedRow; + + PlotItem *plotItem = [[PlotGallery sharedPlotGallery] objectInSection:[indexPath indexAtPosition:0] + atIndex:[indexPath indexAtPosition:1]]; + + controller.detailItem = plotItem; + } +} + +#pragma mark - +#pragma mark Theme Selection + +-(void)setCurrentThemeName:(NSString *)newThemeName +{ + if ( newThemeName != currentThemeName ) { + currentThemeName = [newThemeName copy]; + + self.themeBarButton.title = newThemeName; + } +} + +-(void)themeChanged:(NSNotification *)notification +{ + NSDictionary *themeInfo = notification.userInfo; + + self.currentThemeName = themeInfo[PlotGalleryThemeNameKey]; +} + +#pragma mark - +#pragma mark Table view data source + +-(NSInteger)numberOfSectionsInTableView:(UITableView *__unused)tv +{ + return (NSInteger)[PlotGallery sharedPlotGallery].numberOfSections; +} + +-(NSInteger)tableView:(UITableView *__unused)tv numberOfRowsInSection:(NSInteger)section +{ + return (NSInteger)[[PlotGallery sharedPlotGallery] numberOfRowsInSection:(NSUInteger)section]; +} + +-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *cellId = @"PlotCell"; + + UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:cellId]; + + if ( cell == nil ) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; + cell.accessoryType = UITableViewCellAccessoryNone; + } + + PlotItem *plotItem = [[PlotGallery sharedPlotGallery] objectInSection:[indexPath indexAtPosition:0] + atIndex:[indexPath indexAtPosition:1]]; + cell.imageView.image = [plotItem image]; + cell.textLabel.text = plotItem.title; + + return cell; +} + +-(NSString *)tableView:(UITableView *__unused)tableView titleForHeaderInSection:(NSInteger)section +{ + return [PlotGallery sharedPlotGallery].sectionTitles[(NSUInteger)section]; +} + +@end diff --git a/examples/CorePlotGallery/src/tvOS/ThemeTableViewControllerTV.h b/examples/CorePlotGallery/src/tvOS/ThemeTableViewControllerTV.h new file mode 100644 index 000000000..db53d1f17 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/ThemeTableViewControllerTV.h @@ -0,0 +1,16 @@ +// +// ThemeTableViewControllerTV.h +// CorePlotGallery +// + +extern NSString *const kThemeTableViewControllerNoTheme; +extern NSString *const kThemeTableViewControllerDefaultTheme; + +extern NSString *const PlotGalleryThemeDidChangeNotification; +extern NSString *const PlotGalleryThemeNameKey; + +#pragma mark - + +@interface ThemeTableViewControllerTV : UITableViewController + +@end diff --git a/examples/CorePlotGallery/src/tvOS/ThemeTableViewControllerTV.m b/examples/CorePlotGallery/src/tvOS/ThemeTableViewControllerTV.m new file mode 100644 index 000000000..fb6aac50e --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/ThemeTableViewControllerTV.m @@ -0,0 +1,102 @@ +// +// ThemeTableViewControllerTV.m +// CorePlotGallery +// + +#import "ThemeTableViewControllerTV.h" + +#import + +NSString *const kThemeTableViewControllerNoTheme = @"None"; +NSString *const kThemeTableViewControllerDefaultTheme = @"Default"; + +NSString *const PlotGalleryThemeDidChangeNotification = @"PlotGalleryThemeDidChangeNotification"; +NSString *const PlotGalleryThemeNameKey = @"PlotGalleryThemeNameKey"; + +@interface ThemeTableViewControllerTV() + +@property (nonatomic, readwrite, strong) CPTMutableStringArray *themes; + +@end + +#pragma mark - + +@implementation ThemeTableViewControllerTV + +@synthesize themes; + +-(void)setupThemes +{ + CPTMutableStringArray *themeList = [[NSMutableArray alloc] init]; + + [themeList addObject:kThemeTableViewControllerDefaultTheme]; + [themeList addObject:kThemeTableViewControllerNoTheme]; + + for ( Class themeClass in [CPTTheme themeClasses] ) { + [themeList addObject:[themeClass name]]; + } + + self.themes = themeList; +} + +-(void)awakeFromNib +{ + [super awakeFromNib]; + + [self setupThemes]; +} + +-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { + [self setupThemes]; + } + + return self; +} + +#pragma mark - +#pragma mark Table view data source + +-(NSInteger)numberOfSectionsInTableView:(UITableView *__unused)tableView +{ + return 1; +} + +-(NSInteger)tableView:(UITableView *__unused)tableView numberOfRowsInSection:(NSInteger __unused)section +{ + return (NSInteger)self.themes.count; +} + +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"ThemeCell"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + + if ( cell == nil ) { + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; + } + + cell.textLabel.text = self.themes[(NSUInteger)indexPath.row]; + + return cell; +} + +#pragma mark - +#pragma mark Table view delegate + +-(void)tableView:(UITableView *__unused)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSDictionary *themeInfo = @{ + PlotGalleryThemeNameKey: self.themes[(NSUInteger)indexPath.row] + }; + + [[NSNotificationCenter defaultCenter] postNotificationName:PlotGalleryThemeDidChangeNotification + object:self + userInfo:themeInfo]; + + [self dismissViewControllerAnimated:YES completion:nil]; +} + +@end diff --git a/examples/CorePlotGallery/src/tvOS/main.m b/examples/CorePlotGallery/src/tvOS/main.m new file mode 100644 index 000000000..3bc32fa82 --- /dev/null +++ b/examples/CorePlotGallery/src/tvOS/main.m @@ -0,0 +1,9 @@ +#import "AppDelegateTV.h" +#import + +int main(int argc, char *argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegateTV class])); + } +} diff --git a/examples/DatePlot/Base.lproj/DatePlot.xib b/examples/DatePlot/Base.lproj/DatePlot.xib new file mode 100644 index 000000000..f51bd76b4 --- /dev/null +++ b/examples/DatePlot/Base.lproj/DatePlot.xib @@ -0,0 +1,553 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/DatePlot/Info.plist b/examples/DatePlot/Base.lproj/Info.plist similarity index 100% rename from examples/DatePlot/Info.plist rename to examples/DatePlot/Base.lproj/Info.plist diff --git a/examples/DatePlot/Controller.h b/examples/DatePlot/Controller.h deleted file mode 100644 index fb20447ea..000000000 --- a/examples/DatePlot/Controller.h +++ /dev/null @@ -1,6 +0,0 @@ -#import -#import - -@interface Controller : NSObject - -@end diff --git a/examples/DatePlot/Controller.m b/examples/DatePlot/Controller.m deleted file mode 100644 index b8b1639d1..000000000 --- a/examples/DatePlot/Controller.m +++ /dev/null @@ -1,102 +0,0 @@ -#import "Controller.h" -#import - -@interface Controller() - -@property (nonatomic, readwrite, strong) IBOutlet CPTGraphHostingView *hostView; -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; -@property (nonatomic, readwrite, strong) NSArray *plotData; - -@end - -#pragma mark - - -@implementation Controller - -@synthesize hostView; -@synthesize graph; -@synthesize plotData; - --(void)awakeFromNib -{ - [super awakeFromNib]; - - // If you make sure your dates are calculated at noon, you shouldn't have to - // worry about daylight savings. If you use midnight, you will have to adjust - // for daylight savings time. - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - NSDate *refDate = [formatter dateFromString:@"12:00 Oct 29, 2009"]; - NSTimeInterval oneDay = 24 * 60 * 60; - - // Create graph from theme - CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; - CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; - [newGraph applyTheme:theme]; - self.graph = newGraph; - - self.hostView.hostedGraph = newGraph; - - // Setup scatter plot space - CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; - NSTimeInterval xLow = 0.0; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(xLow) length:CPTDecimalFromDouble(oneDay * 5.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) length:CPTDecimalFromDouble(3.0)]; - - // Axes - CPTXYAxisSet *axisSet = (CPTXYAxisSet *)newGraph.axisSet; - CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(oneDay); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(2.0); - x.minorTicksPerInterval = 0; - NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; - dateFormatter.dateStyle = kCFDateFormatterShortStyle; - CPTTimeFormatter *timeFormatter = [[CPTTimeFormatter alloc] initWithDateFormatter:dateFormatter]; - timeFormatter.referenceDate = refDate; - x.labelFormatter = timeFormatter; - - CPTXYAxis *y = axisSet.yAxis; - y.majorIntervalLength = CPTDecimalFromDouble(0.5); - y.minorTicksPerInterval = 5; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(oneDay); - - // Create a plot that uses the data source method - CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] init]; - dataSourceLinePlot.identifier = @"Date Plot"; - - CPTMutableLineStyle *lineStyle = [dataSourceLinePlot.dataLineStyle mutableCopy]; - lineStyle.lineWidth = 3.0; - lineStyle.lineColor = [CPTColor greenColor]; - dataSourceLinePlot.dataLineStyle = lineStyle; - - dataSourceLinePlot.dataSource = self; - [newGraph addPlot:dataSourceLinePlot]; - - // Add some data - NSMutableArray *newData = [NSMutableArray array]; - for ( NSUInteger i = 0; i < 5; i++ ) { - NSTimeInterval xVal = oneDay * i; - - double yVal = 1.2 * arc4random() / (double)UINT32_MAX + 1.2; - - [newData addObject: - @{ @(CPTScatterPlotFieldX): @(xVal), - @(CPTScatterPlotFieldY): @(yVal) } - ]; - } - self.plotData = newData; -} - -#pragma mark - -#pragma mark Plot Data Source Methods - --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot -{ - return self.plotData.count; -} - --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index -{ - return self.plotData[index][@(fieldEnum)]; -} - -@end diff --git a/examples/DatePlot/DatePlot.xcodeproj/project.pbxproj b/examples/DatePlot/DatePlot.xcodeproj/project.pbxproj index 42698b435..21d005158 100644 --- a/examples/DatePlot/DatePlot.xcodeproj/project.pbxproj +++ b/examples/DatePlot/DatePlot.xcodeproj/project.pbxproj @@ -3,18 +3,18 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 47; objects = { /* Begin PBXBuildFile section */ - 076185040F3CB17800A89A76 /* CorePlot.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 076184C10F3CAD5900A89A76 /* CorePlot.framework */; }; + 076185040F3CB17800A89A76 /* CorePlot.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 076184C10F3CAD5900A89A76 /* CorePlot.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 0761850B0F3CB1E800A89A76 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 076184C10F3CAD5900A89A76 /* CorePlot.framework */; }; - 077382B10F3DC1FB002F10E2 /* Controller.m in Sources */ = {isa = PBXBuildFile; fileRef = 077382B00F3DC1FB002F10E2 /* Controller.m */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - 90AF4F440F36CF1800753D26 /* DatePlot.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90AF4F430F36CF1800753D26 /* DatePlot.xib */; }; BC8E737D0FC0B3CF00DF8511 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8E737C0FC0B3CF00DF8511 /* QuartzCore.framework */; }; + C33E19A8198330CA00182AF2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C33E19A7198330CA00182AF2 /* AppDelegate.swift */; }; + C3A14440197DE35F0048F1FF /* DateController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3A1443F197DE35F0048F1FF /* DateController.swift */; }; + C3D0A1A720E0183A00BA2921 /* DatePlot.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A1A920E0183A00BA2921 /* DatePlot.xib */; }; C3D3937419FD6E3500148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3937319FD6E3500148319 /* Images.xcassets */; }; /* End PBXBuildFile section */ @@ -40,6 +40,48 @@ remoteGlobalIDString = 0730F600109492D800E95162; remoteInfo = UnitTests; }; + C310CE5B1C0A3DB500C4FCB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C310CE5D1C0A3DB500C4FCB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; + C3F04DB71B44CCFD0002322A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09781A46185200D45436; + remoteInfo = CorePlot_iOS; + }; + C3F04DB91B44CCFD0002322A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09821A46185300D45436; + remoteInfo = CorePlot_iOSTests; + }; + C3F04DBB1B44CCFD0002322A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09BA1A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouch"; + }; + C3F04DBD1B44CCFD0002322A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09C41A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouchTests"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -60,21 +102,19 @@ 071BCBD61079EBE00045E43D /* CorePlot.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../../framework/CorePlot.xcodeproj; sourceTree = SOURCE_ROOT; }; 0761854B0F3CB3CB00A89A76 /* CorePlot.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = CorePlot.framework; path = ../../../../framework/build/Debug/CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 077382AF0F3DC1FB002F10E2 /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Controller.h; sourceTree = ""; }; - 077382B00F3DC1FB002F10E2 /* Controller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Controller.m; sourceTree = ""; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Source/main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 32CA4F630368D1EE00C91783 /* DatePlot_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatePlot_Prefix.pch; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* DatePlot.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DatePlot.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 90AF4F430F36CF1800753D26 /* DatePlot.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DatePlot.xib; sourceTree = ""; }; BC8E737C0FC0B3CF00DF8511 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + C33E19A7198330CA00182AF2 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = Source/AppDelegate.swift; sourceTree = ""; }; + C37A409820E030B500C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Info.plist; sourceTree = ""; }; + C385066522A9CC740086BAD5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + C3A1443F197DE35F0048F1FF /* DateController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DateController.swift; path = Source/DateController.swift; sourceTree = ""; }; + C3C3CBBF19EA07F600A0296A /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3D0A1B620E0184100BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/DatePlot.xib; sourceTree = ""; }; C3D3937319FD6E3500148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = DatePlot/Images.xcassets; sourceTree = ""; }; - C3D6210B19DF70DB00652CE7 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/CorePlotWarnings.xcconfig; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -96,6 +136,12 @@ children = ( 076184C10F3CAD5900A89A76 /* CorePlot.framework */, 07E0DF80109C4E9500F108D2 /* UnitTests.xctest */, + C3F04DB81B44CCFD0002322A /* CorePlot.framework */, + C3F04DBA1B44CCFD0002322A /* UnitTests iOS.xctest */, + C3F04DBC1B44CCFD0002322A /* libCorePlot-CocoaTouch.a */, + C3F04DBE1B44CCFD0002322A /* CorePlot-CocoaTouchTests.xctest */, + C310CE5C1C0A3DB500C4FCB4 /* CorePlot.framework */, + C310CE5E1C0A3DB500C4FCB4 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -103,8 +149,8 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( - 077382AF0F3DC1FB002F10E2 /* Controller.h */, - 077382B00F3DC1FB002F10E2 /* Controller.m */, + C33E19A7198330CA00182AF2 /* AppDelegate.swift */, + C3A1443F197DE35F0048F1FF /* DateController.swift */, ); name = Classes; sourceTree = ""; @@ -143,7 +189,7 @@ children = ( 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */, 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, + C33E19A219832EEA00182AF2 /* Other Sources */, 29B97317FDCFA39411CA2CEA /* Resources */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, @@ -154,22 +200,12 @@ tabWidth = 4; usesTabs = 0; }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32CA4F630368D1EE00C91783 /* DatePlot_Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main.m */, - C3D6210B19DF70DB00652CE7 /* CorePlotWarnings.xcconfig */, - ); - name = "Other Sources"; - sourceTree = ""; - }; 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( C3D3937319FD6E3500148319 /* Images.xcassets */, - 90AF4F430F36CF1800753D26 /* DatePlot.xib */, - 8D1107310486CEB800E47090 /* Info.plist */, + C3D0A1A920E0183A00BA2921 /* DatePlot.xib */, + C37A409920E030B500C4FF48 /* Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, ); name = Resources; @@ -184,6 +220,14 @@ name = Frameworks; sourceTree = ""; }; + C33E19A219832EEA00182AF2 /* Other Sources */ = { + isa = PBXGroup; + children = ( + C3C3CBBF19EA07F600A0296A /* CorePlotWarnings.xcconfig */, + ); + name = "Other Sources"; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -214,17 +258,24 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = NO; - LastUpgradeCheck = 0500; + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 1100; + TargetAttributes = { + 8D1107260486CEB800E47090 = { + LastSwiftMigration = 1020; + }; + }; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "DatePlot" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + de, + ja, + en, + fr, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CPTTestApp */; projectDirPath = ""; @@ -256,6 +307,48 @@ remoteRef = 07E0DF7F109C4E9500F108D2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C310CE5C1C0A3DB500C4FCB4 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C310CE5B1C0A3DB500C4FCB4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C310CE5E1C0A3DB500C4FCB4 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C310CE5D1C0A3DB500C4FCB4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3F04DB81B44CCFD0002322A /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3F04DB71B44CCFD0002322A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3F04DBA1B44CCFD0002322A /* UnitTests iOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests iOS.xctest"; + remoteRef = C3F04DB91B44CCFD0002322A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3F04DBC1B44CCFD0002322A /* libCorePlot-CocoaTouch.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libCorePlot-CocoaTouch.a"; + remoteRef = C3F04DBB1B44CCFD0002322A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3F04DBE1B44CCFD0002322A /* CorePlot-CocoaTouchTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "CorePlot-CocoaTouchTests.xctest"; + remoteRef = C3F04DBD1B44CCFD0002322A /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -265,7 +358,7 @@ files = ( 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, C3D3937419FD6E3500148319 /* Images.xcassets in Resources */, - 90AF4F440F36CF1800753D26 /* DatePlot.xib in Resources */, + C3D0A1A720E0183A00BA2921 /* DatePlot.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -276,8 +369,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8D11072D0486CEB800E47090 /* main.m in Sources */, - 077382B10F3DC1FB002F10E2 /* Controller.m in Sources */, + C33E19A8198330CA00182AF2 /* AppDelegate.swift in Sources */, + C3A14440197DE35F0048F1FF /* DateController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -295,65 +388,93 @@ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 089C165DFE840E0CC02AAC07 /* English */, + C385066522A9CC740086BAD5 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; + C37A409920E030B500C4FF48 /* Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A409820E030B500C4FF48 /* Base */, + ); + name = Info.plist; + sourceTree = ""; + }; + C3D0A1A920E0183A00BA2921 /* DatePlot.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1B620E0184100BA2921 /* Base */, + ); + name = DatePlot.xib; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C3CBBF19EA07F600A0296A /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = DatePlot_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = DatePlot; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; }; name = Debug; }; C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C3CBBF19EA07F600A0296A /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = DatePlot_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ""; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = DatePlot; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; }; name = Release; }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C3D6210B19DF70DB00652CE7 /* CorePlotWarnings.xcconfig */; + baseConfigurationReference = C3C3CBBF19EA07F600A0296A /* CorePlotWarnings.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ""; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SYMROOT = "$(SRCROOT)/../../build"; @@ -362,13 +483,14 @@ }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C3D6210B19DF70DB00652CE7 /* CorePlotWarnings.xcconfig */; + baseConfigurationReference = C3C3CBBF19EA07F600A0296A /* CorePlotWarnings.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.9; SDKROOT = macosx; SYMROOT = "$(SRCROOT)/../../build"; }; diff --git a/examples/DatePlot/DatePlot.xcodeproj/xcshareddata/xcschemes/DatePlot.xcscheme b/examples/DatePlot/DatePlot.xcodeproj/xcshareddata/xcschemes/DatePlot.xcscheme new file mode 100644 index 000000000..40f98e3d8 --- /dev/null +++ b/examples/DatePlot/DatePlot.xcodeproj/xcshareddata/xcschemes/DatePlot.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/DatePlot/DatePlot.xib b/examples/DatePlot/DatePlot.xib deleted file mode 100644 index f55d70028..000000000 --- a/examples/DatePlot/DatePlot.xib +++ /dev/null @@ -1,3101 +0,0 @@ - - - - 1050 - 11B26 - 1617 - 1138 - 566.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 1617 - - - YES - NSCustomView - NSWindowTemplate - NSView - NSMenu - NSMenuItem - NSCustomObject - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - YES - - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - NSFontManager - - - AMainMenu - - YES - - - DatePlot - - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - DatePlot - - YES - - - About DatePlot - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Services - - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 2147483647 - - - - - - Hide DatePlot - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Quit DatePlot - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - File - - 2147483647 - - - submenuAction: - - File - - YES - - - New - n - 1048576 - 2147483647 - - - - - - Open… - o - 1048576 - 2147483647 - - - - - - Open Recent - - 2147483647 - - - submenuAction: - - Open Recent - - YES - - - Clear Menu - - 2147483647 - - - - - _NSRecentDocumentsMenu - - - - - YES - YES - - - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - Save - s - 1048576 - 2147483647 - - - - - - Save As… - S - 1179648 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Export to PDF... - - 2147483647 - - - - - - Export to PNG... - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - - - - - - - Edit - - 2147483647 - - - submenuAction: - - Edit - - YES - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1179648 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Delete - - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Find - - 2147483647 - - - submenuAction: - - Find - - YES - - - Find… - f - 1048576 - 2147483647 - - - 1 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1179648 - 2147483647 - - - 3 - - - - Use Selection for Find - e - 1048576 - 2147483647 - - - 7 - - - - Jump to Selection - j - 1048576 - 2147483647 - - - - - - - - - Spelling and Grammar - - 2147483647 - - - submenuAction: - - Spelling and Grammar - - YES - - - Show Spelling… - : - 1048576 - 2147483647 - - - - - - Check Spelling - ; - 1048576 - 2147483647 - - - - - - Check Spelling While Typing - - 2147483647 - - - - - - Check Grammar With Spelling - - 2147483647 - - - - - - - - - Substitutions - - 2147483647 - - - submenuAction: - - Substitutions - - YES - - - Smart Copy/Paste - f - 1048576 - 2147483647 - - - 1 - - - - Smart Quotes - g - 1048576 - 2147483647 - - - 2 - - - - Smart Links - G - 1179648 - 2147483647 - - - 3 - - - - - - - Speech - - 2147483647 - - - submenuAction: - - Speech - - YES - - - Start Speaking - - 2147483647 - - - - - - Stop Speaking - - 2147483647 - - - - - - - - - - - - Format - - 2147483647 - - - submenuAction: - - Format - - YES - - - Font - - 2147483647 - - - submenuAction: - - Font - - YES - - - Show Fonts - t - 1048576 - 2147483647 - - - - - - Bold - b - 1048576 - 2147483647 - - - 2 - - - - Italic - i - 1048576 - 2147483647 - - - 1 - - - - Underline - u - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bigger - + - 1048576 - 2147483647 - - - 3 - - - - Smaller - - - 1048576 - 2147483647 - - - 4 - - - - YES - YES - - - 2147483647 - - - - - - Kern - - 2147483647 - - - submenuAction: - - Kern - - YES - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Tighten - - 2147483647 - - - - - - Loosen - - 2147483647 - - - - - - - - - Ligature - - 2147483647 - - - submenuAction: - - Ligature - - YES - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Use All - - 2147483647 - - - - - - - - - Baseline - - 2147483647 - - - submenuAction: - - Baseline - - YES - - - Use Default - - 2147483647 - - - - - - Superscript - - 2147483647 - - - - - - Subscript - - 2147483647 - - - - - - Raise - - 2147483647 - - - - - - Lower - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Colors - C - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Copy Style - c - 1572864 - 2147483647 - - - - - - Paste Style - v - 1572864 - 2147483647 - - - - - _NSFontMenu - - - - - Text - - 2147483647 - - - submenuAction: - - Text - - YES - - - Align Left - { - 1048576 - 2147483647 - - - - - - Center - | - 1048576 - 2147483647 - - - - - - Justify - - 2147483647 - - - - - - Align Right - } - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Show Ruler - - 2147483647 - - - - - - Copy Ruler - c - 1310720 - 2147483647 - - - - - - Paste Ruler - v - 1310720 - 2147483647 - - - - - - - - - - - - View - - 2147483647 - - - submenuAction: - - View - - YES - - - Show Toolbar - t - 1572864 - 2147483647 - - - - - - Customize Toolbar… - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Explode Layers - e - 1572864 - 2147483647 - - - - - - Reassemble Layers - r - 1572864 - 2147483647 - - - - - - - - - Window - - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bring All to Front - - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - YES - - - DatePlot Help - ? - 1048576 - 2147483647 - - - - - - - - _NSMainMenu - - - 13 - 2 - {{68, 396}, {912, 526}} - 603979776 - Window - NSWindow - - - {450, 250} - - - 256 - - YES - - - 274 - {912, 526} - - - - CPTGraphHostingView - - - {912, 526} - - - - - {{0, 0}, {1680, 1028}} - {450, 272} - {10000000000000, 10000000000000} - YES - - - Controller - - - - - YES - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - print: - - - - 86 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - performClose: - - - - 193 - - - - toggleContinuousSpellChecking: - - - - 222 - - - - undo: - - - - 223 - - - - copy: - - - - 224 - - - - checkSpelling: - - - - 225 - - - - paste: - - - - 226 - - - - stopSpeaking: - - - - 227 - - - - cut: - - - - 228 - - - - showGuessPanel: - - - - 230 - - - - redo: - - - - 231 - - - - selectAll: - - - - 232 - - - - startSpeaking: - - - - 233 - - - - delete: - - - - 235 - - - - performZoom: - - - - 240 - - - - performFindPanelAction: - - - - 241 - - - - centerSelectionInVisibleArea: - - - - 245 - - - - toggleGrammarChecking: - - - - 347 - - - - toggleSmartInsertDelete: - - - - 355 - - - - toggleAutomaticQuoteSubstitution: - - - - 356 - - - - toggleAutomaticLinkDetection: - - - - 357 - - - - showHelp: - - - - 360 - - - - saveDocument: - - - - 362 - - - - saveDocumentAs: - - - - 363 - - - - revertDocumentToSaved: - - - - 364 - - - - runToolbarCustomizationPalette: - - - - 365 - - - - toggleToolbarShown: - - - - 366 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - terminate: - - - - 369 - - - - unhideAllApplications: - - - - 370 - - - - addFontTrait: - - - - 418 - - - - addFontTrait: - - - - 419 - - - - modifyFont: - - - - 420 - - - - orderFrontFontPanel: - - - - 421 - - - - modifyFont: - - - - 422 - - - - raiseBaseline: - - - - 423 - - - - lowerBaseline: - - - - 424 - - - - copyFont: - - - - 425 - - - - subscript: - - - - 426 - - - - superscript: - - - - 427 - - - - tightenKerning: - - - - 428 - - - - underline: - - - - 429 - - - - orderFrontColorPanel: - - - - 430 - - - - useAllLigatures: - - - - 431 - - - - loosenKerning: - - - - 432 - - - - pasteFont: - - - - 433 - - - - unscript: - - - - 434 - - - - useStandardKerning: - - - - 435 - - - - useStandardLigatures: - - - - 436 - - - - turnOffLigatures: - - - - 437 - - - - turnOffKerning: - - - - 438 - - - - alignLeft: - - - - 439 - - - - alignJustified: - - - - 440 - - - - copyRuler: - - - - 441 - - - - alignCenter: - - - - 442 - - - - toggleRuler: - - - - 443 - - - - alignRight: - - - - 444 - - - - pasteRuler: - - - - 445 - - - - hostView - - - - 521 - - - - - YES - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - - MainMenu - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 103 - - - YES - - - - 1 - - - 217 - - - YES - - - - - - 83 - - - YES - - - - - - 81 - - - YES - - - - - - - - - - - - - - - - - - - 75 - - - 3 - - - 80 - - - 8 - - - 78 - - - 6 - - - 72 - - - - - 82 - - - 9 - - - 124 - - - YES - - - - - - 77 - - - 5 - - - 73 - - - 1 - - - 79 - - - 7 - - - 112 - - - 10 - - - 74 - - - 2 - - - 125 - - - YES - - - - - - 126 - - - - - 205 - - - YES - - - - - - - - - - - - - - - - - - 202 - - - - - 198 - - - - - 207 - - - - - 214 - - - - - 199 - - - - - 203 - - - - - 197 - - - - - 206 - - - - - 215 - - - - - 218 - - - YES - - - - - - 216 - - - YES - - - - - - 200 - - - YES - - - - - - - - - 219 - - - - - 201 - - - - - 204 - - - - - 220 - - - YES - - - - - - - - - - 213 - - - - - 210 - - - - - 221 - - - - - 208 - - - - - 209 - - - - - 106 - - - YES - - - - 2 - - - 111 - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - 1111 - - - 144 - - - - - 129 - - - 121 - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - - - - - 297 - - - - - 298 - - - - - 211 - - - YES - - - - - - 212 - - - YES - - - - - - - 195 - - - - - 196 - - - - - 346 - - - - - 348 - - - YES - - - - - - 349 - - - YES - - - - - - - - 350 - - - - - 351 - - - - - 354 - - - - - 371 - - - - - 373 - - - YES - - - - - - 374 - - - YES - - - - - - - 375 - - - YES - - - - - - 376 - - - YES - - - - - - 377 - - - YES - - - - - - - - - - - - - 378 - - - - - 379 - - - - - 380 - - - - - 381 - - - - - 382 - - - - - 383 - - - - - 384 - - - - - 385 - - - - - 386 - - - YES - - - - - - - - - - - - - - - - - - - - - 387 - - - - - 388 - - - - - 389 - - - - - 390 - - - - - 391 - - - - - 392 - - - - - 393 - - - - - 394 - - - - - 395 - - - YES - - - - - - 396 - - - YES - - - - - - 397 - - - YES - - - - - - 398 - - - - - 399 - - - - - 400 - - - - - 401 - - - - - 402 - - - - - 403 - - - YES - - - - - - - - - - 404 - - - - - 405 - - - - - 406 - - - - - 407 - - - - - 408 - - - - - 409 - - - YES - - - - - - - - 410 - - - - - 411 - - - - - 412 - - - - - 413 - - - YES - - - - - - - - - 414 - - - - - 415 - - - - - 416 - - - - - 417 - - - - - 446 - - - YES - - - - - - 447 - - - YES - - - - - - 506 - - - 10 - - - 507 - - - 2 - - - 510 - - - 10 - - - 512 - - - - - 513 - - - - - 514 - - - - - 519 - - - - - 520 - - - Controller - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 103.IBPluginDependency - 106.IBPluginDependency - 111.IBPluginDependency - 112.IBPluginDependency - 124.IBPluginDependency - 125.IBPluginDependency - 126.IBPluginDependency - 129.IBPluginDependency - 130.IBPluginDependency - 131.IBPluginDependency - 134.IBPluginDependency - 136.IBPluginDependency - 143.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 149.IBPluginDependency - 150.IBPluginDependency - 19.IBPluginDependency - 195.IBPluginDependency - 196.IBPluginDependency - 197.IBPluginDependency - 198.IBPluginDependency - 199.IBPluginDependency - 200.IBPluginDependency - 201.IBPluginDependency - 202.IBPluginDependency - 203.IBPluginDependency - 204.IBPluginDependency - 205.IBPluginDependency - 206.IBPluginDependency - 207.IBPluginDependency - 208.IBPluginDependency - 209.IBPluginDependency - 210.IBPluginDependency - 211.IBPluginDependency - 212.IBPluginDependency - 213.IBPluginDependency - 214.IBPluginDependency - 215.IBPluginDependency - 216.IBPluginDependency - 217.IBPluginDependency - 218.IBPluginDependency - 219.IBPluginDependency - 220.IBPluginDependency - 221.IBPluginDependency - 23.IBPluginDependency - 236.IBPluginDependency - 239.IBPluginDependency - 24.IBPluginDependency - 29.IBPluginDependency - 295.IBPluginDependency - 296.IBPluginDependency - 297.IBPluginDependency - 298.IBPluginDependency - 346.IBPluginDependency - 348.IBPluginDependency - 349.IBPluginDependency - 350.IBPluginDependency - 351.IBPluginDependency - 354.IBPluginDependency - 371.IBPluginDependency - 373.IBPluginDependency - 374.IBPluginDependency - 375.IBPluginDependency - 376.IBPluginDependency - 377.IBPluginDependency - 378.IBPluginDependency - 379.IBPluginDependency - 380.IBPluginDependency - 381.IBPluginDependency - 382.IBPluginDependency - 383.IBPluginDependency - 384.IBPluginDependency - 385.IBPluginDependency - 386.IBPluginDependency - 387.IBPluginDependency - 388.IBPluginDependency - 389.IBPluginDependency - 390.IBPluginDependency - 391.IBPluginDependency - 392.IBPluginDependency - 393.IBPluginDependency - 394.IBPluginDependency - 395.IBPluginDependency - 396.IBPluginDependency - 397.IBPluginDependency - 398.IBPluginDependency - 399.IBPluginDependency - 400.IBPluginDependency - 401.IBPluginDependency - 402.IBPluginDependency - 403.IBPluginDependency - 404.IBPluginDependency - 405.IBPluginDependency - 406.IBPluginDependency - 407.IBPluginDependency - 408.IBPluginDependency - 409.IBPluginDependency - 410.IBPluginDependency - 411.IBPluginDependency - 412.IBPluginDependency - 413.IBPluginDependency - 414.IBPluginDependency - 415.IBPluginDependency - 416.IBPluginDependency - 417.IBPluginDependency - 446.IBPluginDependency - 446.IBWindowTemplateEditedContentRect - 446.NSWindowTemplate.visibleAtLaunch - 447.IBPluginDependency - 5.IBPluginDependency - 506.IBPluginDependency - 507.IBPluginDependency - 510.IBPluginDependency - 512.IBPluginDependency - 513.IBPluginDependency - 514.IBPluginDependency - 519.IBPluginDependency - 520.IBPluginDependency - 56.IBPluginDependency - 57.IBPluginDependency - 58.IBPluginDependency - 72.IBPluginDependency - 73.IBPluginDependency - 74.IBPluginDependency - 75.IBPluginDependency - 77.IBPluginDependency - 78.IBPluginDependency - 79.IBPluginDependency - 80.IBPluginDependency - 81.IBPluginDependency - 82.IBPluginDependency - 83.IBPluginDependency - 92.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{78, 234}, {912, 526}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 521 - - - - YES - - CPTGraphHostingView - NSView - - IBProjectSource - ./Classes/CPTGraphHostingView.h - - - - Controller - NSObject - - hostView - CPTLayerHostingView - - - hostView - - hostView - CPTLayerHostingView - - - - IBProjectSource - ./Classes/Controller.h - - - - FirstResponder - - exportToPDF: - id - - - exportToPDF: - - exportToPDF: - id - - - - IBUserSource - - - - - NSDocument - - YES - - YES - printDocument: - revertDocumentToSaved: - runPageLayout: - saveDocument: - saveDocumentAs: - saveDocumentTo: - - - YES - id - id - id - id - id - id - - - - YES - - YES - printDocument: - revertDocumentToSaved: - runPageLayout: - saveDocument: - saveDocumentAs: - saveDocumentTo: - - - YES - - printDocument: - id - - - revertDocumentToSaved: - id - - - runPageLayout: - id - - - saveDocument: - id - - - saveDocumentAs: - id - - - saveDocumentTo: - id - - - - - IBProjectSource - ./Classes/NSDocument.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {9, 8} - {7, 2} - - - - diff --git a/examples/DatePlot/DatePlot_Prefix.pch b/examples/DatePlot/DatePlot_Prefix.pch deleted file mode 100644 index 1e2a5f180..000000000 --- a/examples/DatePlot/DatePlot_Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'CPTTestApp' target in the 'CPTTestApp' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/examples/DatePlot/Source/AppDelegate.swift b/examples/DatePlot/Source/AppDelegate.swift new file mode 100644 index 000000000..32a1c9cba --- /dev/null +++ b/examples/DatePlot/Source/AppDelegate.swift @@ -0,0 +1,12 @@ +import Cocoa + +@NSApplicationMain +class AppDelegate: NSObject, NSApplicationDelegate { + func applicationDidFinishLaunching(_ aNotification: Notification) { + // Insert code here to initialize your application + } + + func applicationWillTerminate(_ aNotification: Notification) { + // Insert code here to tear down your application + } +} diff --git a/examples/DatePlot/Source/DateController.swift b/examples/DatePlot/Source/DateController.swift new file mode 100644 index 000000000..fa77a2a96 --- /dev/null +++ b/examples/DatePlot/Source/DateController.swift @@ -0,0 +1,109 @@ +import Foundation +import Cocoa +import CorePlot + +class DateController : NSObject, CPTPlotDataSource { + private let oneDay : Double = 24 * 60 * 60 + + @IBOutlet var hostView : CPTGraphHostingView? = nil + + private var graph : CPTXYGraph? = nil + + private var plotData = [Double]() + + // MARK: - Initialization + + override func awakeFromNib() + { + self.plotData = newPlotData() + + // If you make sure your dates are calculated at noon, you shouldn't have to + // worry about daylight savings. If you use midnight, you will have to adjust + // for daylight savings time. + let refDate = DateFormatter().date(from: "12:00 Oct 29, 2009") + + // Create graph + let newGraph = CPTXYGraph(frame: .zero) + + let theme = CPTTheme(named: .darkGradientTheme) + newGraph.apply(theme) + + if let host = self.hostView { + host.hostedGraph = newGraph + } + + // Setup scatter plot space + let plotSpace = newGraph.defaultPlotSpace as! CPTXYPlotSpace + + plotSpace.xRange = CPTPlotRange(location: 0.0, length: (oneDay * 5.0) as NSNumber) + plotSpace.yRange = CPTPlotRange(location: 1.0, length: 3.0) + + // Axes + let axisSet = newGraph.axisSet as! CPTXYAxisSet + if let x = axisSet.xAxis { + x.majorIntervalLength = oneDay as NSNumber + x.orthogonalPosition = 2.0 + x.minorTicksPerInterval = 0 + let dateFormatter = DateFormatter() + dateFormatter.dateStyle = .short + let timeFormatter = CPTTimeFormatter(dateFormatter:dateFormatter) + timeFormatter.referenceDate = refDate + x.labelFormatter = timeFormatter + } + + if let y = axisSet.yAxis { + y.majorIntervalLength = 0.5 + y.minorTicksPerInterval = 5 + y.orthogonalPosition = oneDay as NSNumber + + y.labelingPolicy = .none + } + + // Create a plot that uses the data source method + let dataSourceLinePlot = CPTScatterPlot(frame: .zero) + dataSourceLinePlot.identifier = "Date Plot" as NSString + + if let lineStyle = dataSourceLinePlot.dataLineStyle?.mutableCopy() as? CPTMutableLineStyle { + lineStyle.lineWidth = 3.0 + lineStyle.lineColor = .green() + dataSourceLinePlot.dataLineStyle = lineStyle + } + + dataSourceLinePlot.dataSource = self + newGraph.add(dataSourceLinePlot) + + self.graph = newGraph + } + + func newPlotData() -> [Double] + { + var newData = [Double]() + + for _ in 0 ..< 5 { + newData.append(1.2 * Double(arc4random()) / Double(UInt32.max) + 1.2) + } + + return newData + } + + // MARK: - Plot Data Source Methods + + func numberOfRecords(for plot: CPTPlot) -> UInt + { + return UInt(self.plotData.count) + } + + func number(for plot: CPTPlot, field: UInt, record: UInt) -> Any? + { + switch CPTScatterPlotField(rawValue: Int(field))! { + case .X: + return (oneDay * Double(record)) as NSNumber + + case .Y: + return self.plotData[Int(record)] as NSNumber + + @unknown default: + return nil + } + } +} diff --git a/examples/DatePlot/Source/main.m b/examples/DatePlot/Source/main.m deleted file mode 100644 index 50ab6acfb..000000000 --- a/examples/DatePlot/Source/main.m +++ /dev/null @@ -1,14 +0,0 @@ -// -// main.m -// CPTTestApp -// -// Created by Dirkjan Krijnders on 2/2/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. -// - -#import - -int main(int argc, const char *argv[]) -{ - return NSApplicationMain(argc, argv); -} diff --git a/examples/DatePlot/English.lproj/InfoPlist.strings b/examples/DatePlot/en.lproj/InfoPlist.strings similarity index 100% rename from examples/DatePlot/English.lproj/InfoPlist.strings rename to examples/DatePlot/en.lproj/InfoPlist.strings diff --git a/examples/DropPlot/Base.lproj/CPTPlotDocument.xib b/examples/DropPlot/Base.lproj/CPTPlotDocument.xib new file mode 100644 index 000000000..4ffc1a74c --- /dev/null +++ b/examples/DropPlot/Base.lproj/CPTPlotDocument.xib @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/DropPlot/Info.plist b/examples/DropPlot/Base.lproj/Info.plist similarity index 100% rename from examples/DropPlot/Info.plist rename to examples/DropPlot/Base.lproj/Info.plist diff --git a/examples/DropPlot/Base.lproj/MainMenu.xib b/examples/DropPlot/Base.lproj/MainMenu.xib new file mode 100644 index 000000000..55467d561 --- /dev/null +++ b/examples/DropPlot/Base.lproj/MainMenu.xib @@ -0,0 +1,537 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/DropPlot/CPTPlotDocument.h b/examples/DropPlot/CPTPlotDocument.h index 53ca54d7a..695e3165f 100644 --- a/examples/DropPlot/CPTPlotDocument.h +++ b/examples/DropPlot/CPTPlotDocument.h @@ -7,7 +7,7 @@ -(IBAction)zoomOut; // PDF / image export --(IBAction)exportToPDF:(id)sender; --(IBAction)exportToPNG:(id)sender; +-(IBAction)exportToPDF:(nullable id)sender; +-(IBAction)exportToPNG:(nullable id)sender; @end diff --git a/examples/DropPlot/CPTPlotDocument.m b/examples/DropPlot/CPTPlotDocument.m index aa70a20a0..537a8bdcb 100644 --- a/examples/DropPlot/CPTPlotDocument.m +++ b/examples/DropPlot/CPTPlotDocument.m @@ -3,8 +3,8 @@ @interface CPTPlotDocument() -@property (nonatomic, readwrite, strong) IBOutlet CPTGraphHostingView *graphView; -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; +@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTGraphHostingView *graphView; +@property (nonatomic, readwrite, strong, nonnull) CPTXYGraph *graph; @property (nonatomic, readwrite, assign) double minimumValueForXAxis; @property (nonatomic, readwrite, assign) double maximumValueForXAxis; @@ -12,9 +12,9 @@ @interface CPTPlotDocument() @property (nonatomic, readwrite, assign) double maximumValueForYAxis; @property (nonatomic, readwrite, assign) double majorIntervalLengthForX; @property (nonatomic, readwrite, assign) double majorIntervalLengthForY; -@property (nonatomic, readwrite, strong) NSArray *dataPoints; +@property (nonatomic, readwrite, strong) NSArray *dataPoints; -@property (nonatomic, readwrite, strong) CPTPlotSpaceAnnotation *zoomAnnotation; +@property (nonatomic, readwrite, strong, nullable) CPTPlotSpaceAnnotation *zoomAnnotation; @property (nonatomic, readwrite, assign) CGPoint dragStart; @property (nonatomic, readwrite, assign) CGPoint dragEnd; @@ -40,9 +40,9 @@ @implementation CPTPlotDocument @synthesize dragStart; @synthesize dragEnd; -//#define USE_NSDECIMAL +// #define USE_NSDECIMAL --(instancetype)init +-(nonnull instancetype)init { self = [super init]; if ( self ) { @@ -54,12 +54,12 @@ -(instancetype)init return self; } --(NSString *)windowNibName +-(nullable NSString *)windowNibName { return @"CPTPlotDocument"; } --(void)windowControllerDidLoadNib:(NSWindowController *)windowController +-(void)windowControllerDidLoadNib:(nonnull NSWindowController *__unused)windowController { // Create graph from theme CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; @@ -89,26 +89,26 @@ -(void)windowControllerDidLoadNib:(NSWindowController *)windowController // Setup plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(self.minimumValueForXAxis) - length:CPTDecimalFromDouble(ceil( (self.maximumValueForXAxis - self.minimumValueForXAxis) / self.majorIntervalLengthForX ) * self.majorIntervalLengthForX)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(self.minimumValueForYAxis) - length:CPTDecimalFromDouble(ceil( (self.maximumValueForYAxis - self.minimumValueForYAxis) / self.majorIntervalLengthForY ) * self.majorIntervalLengthForY)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(self.minimumValueForXAxis) + length:@(ceil((self.maximumValueForXAxis - self.minimumValueForXAxis) / self.majorIntervalLengthForX) * self.majorIntervalLengthForX)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(self.minimumValueForYAxis) + length:@(ceil((self.maximumValueForYAxis - self.minimumValueForYAxis) / self.majorIntervalLengthForY) * self.majorIntervalLengthForY)]; // this allows the plot to respond to mouse events - [plotSpace setDelegate:self]; + plotSpace.delegate = self; [plotSpace setAllowsUserInteraction:YES]; CPTXYAxisSet *axisSet = (CPTXYAxisSet *)newGraph.axisSet; CPTXYAxis *x = axisSet.xAxis; x.minorTicksPerInterval = 9; - x.majorIntervalLength = CPTDecimalFromDouble(self.majorIntervalLengthForX); + x.majorIntervalLength = @(self.majorIntervalLengthForX); x.labelOffset = 5.0; x.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0]; CPTXYAxis *y = axisSet.yAxis; y.minorTicksPerInterval = 9; - y.majorIntervalLength = CPTDecimalFromDouble(self.majorIntervalLengthForY); + y.majorIntervalLength = @(self.majorIntervalLengthForY); y.labelOffset = 5.0; y.axisConstraints = [CPTConstraints constraintWithLowerOffset:0.0]; @@ -128,7 +128,7 @@ -(void)windowControllerDidLoadNib:(NSWindowController *)windowController #pragma mark - #pragma mark Data loading methods --(NSData *)dataOfType:(NSString *)typeName error:(NSError *__autoreleasing *)outError +-(nullable NSData *)dataOfType:(nonnull NSString *__unused)typeName error:(NSError *__autoreleasing __nullable *)outError { // Insert code here to write your document to data of the specified type. If the given outError != NULL, ensure that you set *outError when returning nil. @@ -142,37 +142,37 @@ -(NSData *)dataOfType:(NSString *)typeName error:(NSError *__autoreleasing *)out return nil; } --(BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError *__autoreleasing *)outError +-(BOOL)readFromData:(nonnull NSData *)data ofType:(NSString *)typeName error:(NSError *__autoreleasing __nullable *)outError { if ( [typeName isEqualToString:@"CSVDocument"] ) { - double minX = MAXFLOAT; - double maxX = -MAXFLOAT; + double minX = (double)INFINITY; + double maxX = -(double)INFINITY; - double minY = MAXFLOAT; - double maxY = -MAXFLOAT; + double minY = (double)INFINITY; + double maxY = -(double)INFINITY; - NSMutableArray *newData = [[NSMutableArray alloc] init]; + NSMutableArray *newData = [[NSMutableArray alloc] init]; NSString *fileContents = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; // Parse CSV - NSUInteger length = fileContents.length; + NSUInteger length = fileContents.length; NSUInteger lineStart = 0, lineEnd = 0, contentsEnd = 0; NSRange currentRange; // Read headers from the first line of the file [fileContents getParagraphStart:&lineStart end:&lineEnd contentsEnd:&contentsEnd forRange:NSMakeRange(lineEnd, 0)]; -// currentRange = NSMakeRange(lineStart, contentsEnd - lineStart); -// NSArray *columnHeaders = [[fileContents substringWithRange:currentRange] arrayByParsingCSVLine]; -// NSLog([columnHeaders objectAtIndex:0]); + // currentRange = NSMakeRange(lineStart, contentsEnd - lineStart); + // CPTStringArray * columnHeaders = [[fileContents substringWithRange:currentRange] arrayByParsingCSVLine]; + // NSLog([columnHeaders objectAtIndex:0]); while ( lineEnd < length ) { [fileContents getParagraphStart:&lineStart end:&lineEnd contentsEnd:&contentsEnd forRange:NSMakeRange(lineEnd, 0)]; currentRange = NSMakeRange(lineStart, contentsEnd - lineStart); - NSArray *columnValues = [[fileContents substringWithRange:currentRange] arrayByParsingCSVLine]; + CPTStringArray *columnValues = [[fileContents substringWithRange:currentRange] arrayByParsingCSVLine]; - double xValue = [columnValues[0] doubleValue]; - double yValue = [columnValues[1] doubleValue]; + double xValue = columnValues[0].doubleValue; + double yValue = columnValues[1].doubleValue; if ( xValue < minX ) { minX = xValue; } @@ -201,13 +201,13 @@ -(BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError *_ double intervalX = (maxX - minX) / 5.0; if ( intervalX > 0.0 ) { - intervalX = pow( 10.0, ceil( log10(intervalX) ) ); + intervalX = pow(10.0, ceil(log10(intervalX))); } self.majorIntervalLengthForX = intervalX; double intervalY = (maxY - minY) / 10.0; if ( intervalY > 0.0 ) { - intervalY = pow( 10.0, ceil( log10(intervalY) ) ); + intervalY = pow(10.0, ceil(log10(intervalY))); } self.majorIntervalLengthForY = intervalY; @@ -251,10 +251,10 @@ -(IBAction)zoomIn self.maximumValueForYAxis = MAX(start[CPTCoordinateY], end[CPTCoordinateY]); // now adjust the plot range and axes - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(self.minimumValueForXAxis) - length:CPTDecimalFromDouble(self.maximumValueForXAxis - self.minimumValueForXAxis)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(self.minimumValueForYAxis) - length:CPTDecimalFromDouble(self.maximumValueForYAxis - self.minimumValueForYAxis)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(self.minimumValueForXAxis) + length:@(self.maximumValueForXAxis - self.minimumValueForXAxis)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(self.minimumValueForYAxis) + length:@(self.maximumValueForYAxis - self.minimumValueForYAxis)]; CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.graph.axisSet; axisSet.xAxis.labelingPolicy = CPTAxisLabelingPolicyAutomatic; @@ -263,20 +263,20 @@ -(IBAction)zoomIn -(IBAction)zoomOut { - double minX = MAXFLOAT; - double maxX = -MAXFLOAT; + double minX = (double)INFINITY; + double maxX = -(double)INFINITY; - double minY = MAXFLOAT; - double maxY = -MAXFLOAT; + double minY = (double)INFINITY; + double maxY = -(double)INFINITY; // get the ful range min and max values - for ( NSDictionary *xyValues in self.dataPoints ) { - double xVal = [xyValues[@"x"] doubleValue]; + for ( NSDictionary *xyValues in self.dataPoints ) { + double xVal = xyValues[@"x"].doubleValue; minX = fmin(xVal, minX); maxX = fmax(xVal, maxX); - double yVal = [xyValues[@"y"] doubleValue]; + double yVal = xyValues[@"y"].doubleValue; minY = fmin(yVal, minY); maxY = fmax(yVal, maxY); @@ -296,11 +296,10 @@ -(IBAction)zoomOut // now adjust the plot range and axes CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(minX) - length:CPTDecimalFromDouble(ceil( (maxX - minX) / intervalX ) * intervalX)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(minY) - length:CPTDecimalFromDouble(ceil( (maxY - minY) / intervalY ) * intervalY)]; - + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(minX) + length:@(ceil((maxX - minX) / intervalX) * intervalX)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(minY) + length:@(ceil((maxY - minY) / intervalY) * intervalY)]; CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.graph.axisSet; axisSet.xAxis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; axisSet.yAxis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; @@ -309,35 +308,35 @@ -(IBAction)zoomOut #pragma mark - #pragma mark PDF / image export --(IBAction)exportToPDF:(id)sender +-(IBAction)exportToPDF:(nullable id __unused)sender { NSSavePanel *pdfSavingDialog = [NSSavePanel savePanel]; - [pdfSavingDialog setAllowedFileTypes:@[@"pdf"]]; + pdfSavingDialog.allowedFileTypes = @[@"pdf"]; if ( [pdfSavingDialog runModal] == NSOKButton ) { NSData *dataForPDF = [self.graph dataForPDFRepresentationOfLayer]; - NSURL *url = [pdfSavingDialog URL]; + NSURL *url = pdfSavingDialog.URL; if ( url ) { [dataForPDF writeToURL:url atomically:NO]; } } } --(IBAction)exportToPNG:(id)sender +-(IBAction)exportToPNG:(nullable id __unused)sender { NSSavePanel *pngSavingDialog = [NSSavePanel savePanel]; - [pngSavingDialog setAllowedFileTypes:@[@"png"]]; + pngSavingDialog.allowedFileTypes = @[@"png"]; if ( [pngSavingDialog runModal] == NSOKButton ) { NSImage *image = [self.graph imageOfLayer]; - NSData *tiffData = [image TIFFRepresentation]; + NSData *tiffData = image.TIFFRepresentation; NSBitmapImageRep *tiffRep = [NSBitmapImageRep imageRepWithData:tiffData]; - NSData *pngData = [tiffRep representationUsingType:NSPNGFileType properties:[NSDictionary dictionary]]; + NSData *pngData = [tiffRep representationUsingType:NSPNGFileType properties:@{}]; - NSURL *url = [pngSavingDialog URL]; + NSURL *url = pngSavingDialog.URL; if ( url ) { [pngData writeToURL:url atomically:NO]; } @@ -347,12 +346,12 @@ -(IBAction)exportToPNG:(id)sender #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.dataPoints.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSString *key = (fieldEnum == CPTScatterPlotFieldX ? @"x" : @"y"); @@ -362,7 +361,7 @@ -(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUI #pragma mark - #pragma mark Plot Space Delegate Methods --(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(id)event atPoint:(CGPoint)interactionPoint +-(BOOL)plotSpace:(nonnull CPTPlotSpace *__unused)space shouldHandlePointingDeviceDraggedEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint)interactionPoint { CPTPlotSpaceAnnotation *annotation = self.zoomAnnotation; @@ -370,16 +369,16 @@ -(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(i CPTPlotArea *plotArea = self.graph.plotAreaFrame.plotArea; CGRect plotBounds = plotArea.bounds; - // convert the dragStart and dragEnd values to plot coordinates +// convert the dragStart and dragEnd values to plot coordinates CGPoint dragStartInPlotArea = [self.graph convertPoint:self.dragStart toLayer:plotArea]; CGPoint dragEndInPlotArea = [self.graph convertPoint:interactionPoint toLayer:plotArea]; - // create the dragrect from dragStart to the current location - CGFloat endX = MAX( MIN( dragEndInPlotArea.x, CGRectGetMaxX(plotBounds) ), CGRectGetMinX(plotBounds) ); - CGFloat endY = MAX( MIN( dragEndInPlotArea.y, CGRectGetMaxY(plotBounds) ), CGRectGetMinY(plotBounds) ); - CGRect borderRect = CGRectMake( dragStartInPlotArea.x, dragStartInPlotArea.y, - (endX - dragStartInPlotArea.x), - (endY - dragStartInPlotArea.y) ); +// create the dragrect from dragStart to the current location + CGFloat endX = MAX(MIN(dragEndInPlotArea.x, CGRectGetMaxX(plotBounds)), CGRectGetMinX(plotBounds)); + CGFloat endY = MAX(MIN(dragEndInPlotArea.y, CGRectGetMaxY(plotBounds)), CGRectGetMinY(plotBounds)); + CGRect borderRect = CGRectMake(dragStartInPlotArea.x, dragStartInPlotArea.y, + (endX - dragStartInPlotArea.x), + (endY - dragStartInPlotArea.y)); annotation.contentAnchorPoint = CGPointMake(dragEndInPlotArea.x >= dragStartInPlotArea.x ? 0.0 : 1.0, dragEndInPlotArea.y >= dragStartInPlotArea.y ? 0.0 : 1.0); @@ -389,7 +388,7 @@ -(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(i return NO; } --(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)event atPoint:(CGPoint)interactionPoint +-(BOOL)plotSpace:(nonnull CPTPlotSpace *__unused)space shouldHandlePointingDeviceDownEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint)interactionPoint { if ( !self.zoomAnnotation ) { self.dragStart = interactionPoint; @@ -397,9 +396,9 @@ -(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)e CPTPlotArea *plotArea = self.graph.plotAreaFrame.plotArea; CGPoint dragStartInPlotArea = [self.graph convertPoint:self.dragStart toLayer:plotArea]; - if ( CGRectContainsPoint(plotArea.bounds, dragStartInPlotArea) ) { - // create the zoom rectangle - // first a bordered layer to draw the zoomrect + if ( CGRectContainsPoint(plotArea.bounds, dragStartInPlotArea)) { +// create the zoom rectangle +// first a bordered layer to draw the zoomrect CPTBorderedLayer *zoomRectangleLayer = [[CPTBorderedLayer alloc] initWithFrame:CGRectNull]; CPTMutableLineStyle *lineStyle = [CPTMutableLineStyle lineStyle]; @@ -412,22 +411,25 @@ -(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(id)e double start[2]; [self.graph.defaultPlotSpace doublePrecisionPlotPoint:start numberOfCoordinates:2 forPlotAreaViewPoint:dragStartInPlotArea]; - NSArray *anchorPoint = @[@(start[CPTCoordinateX]), - @(start[CPTCoordinateY])]; + CPTNumberArray *anchorPoint = @[@(start[CPTCoordinateX]), + @(start[CPTCoordinateY])]; // now create the annotation - CPTPlotSpaceAnnotation *annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:self.graph.defaultPlotSpace anchorPlotPoint:anchorPoint]; - annotation.contentLayer = zoomRectangleLayer; - self.zoomAnnotation = annotation; + CPTPlotSpace *defaultSpace = self.graph.defaultPlotSpace; + if ( defaultSpace ) { + CPTPlotSpaceAnnotation *annotation = [[CPTPlotSpaceAnnotation alloc] initWithPlotSpace:defaultSpace anchorPlotPoint:anchorPoint]; + annotation.contentLayer = zoomRectangleLayer; + self.zoomAnnotation = annotation; - [self.graph.plotAreaFrame.plotArea addAnnotation:annotation]; + [self.graph.plotAreaFrame.plotArea addAnnotation:annotation]; + } } } return NO; } --(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(id)event atPoint:(CGPoint)interactionPoint +-(BOOL)plotSpace:(nonnull CPTPlotSpace *__unused)space shouldHandlePointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { CPTPlotSpaceAnnotation *annotation = self.zoomAnnotation; @@ -435,15 +437,15 @@ -(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(id)eve self.dragEnd = interactionPoint; // double-click to completely zoom out - if ( [event clickCount] == 2 ) { + if ((event.type != NSEventTypeScrollWheel) && (event.clickCount == 2)) { CPTPlotArea *plotArea = self.graph.plotAreaFrame.plotArea; CGPoint dragEndInPlotArea = [self.graph convertPoint:interactionPoint toLayer:plotArea]; - if ( CGRectContainsPoint(plotArea.bounds, dragEndInPlotArea) ) { + if ( CGRectContainsPoint(plotArea.bounds, dragEndInPlotArea)) { [self zoomOut]; } } - else if ( !CGPointEqualToPoint(self.dragStart, self.dragEnd) ) { + else if ( !CGPointEqualToPoint(self.dragStart, self.dragEnd)) { // no accidental drag, so zoom in [self zoomIn]; } @@ -459,7 +461,7 @@ -(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(id)eve return NO; } --(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceCancelledEvent:(id)event atPoint:(CGPoint)interactionPoint +-(BOOL)plotSpace:(nonnull CPTPlotSpace *__unused)space shouldHandlePointingDeviceCancelledEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint __unused)interactionPoint { CPTPlotSpaceAnnotation *annotation = self.zoomAnnotation; diff --git a/examples/DropPlot/DropPlot.xcodeproj/project.pbxproj b/examples/DropPlot/DropPlot.xcodeproj/project.pbxproj index 9940ef0fd..43c984131 100644 --- a/examples/DropPlot/DropPlot.xcodeproj/project.pbxproj +++ b/examples/DropPlot/DropPlot.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 47; objects = { /* Begin PBXBuildFile section */ @@ -43,6 +43,48 @@ remoteGlobalIDString = 8DC2EF4F0486A6940098B216; remoteInfo = CorePlot; }; + C3B345A71B46194500844218 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BC93AA7C0FDEFEAC00606226 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09781A46185200D45436; + remoteInfo = CorePlot_iOS; + }; + C3B345A91B46194500844218 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BC93AA7C0FDEFEAC00606226 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09821A46185300D45436; + remoteInfo = CorePlot_iOSTests; + }; + C3B345AB1B46194500844218 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BC93AA7C0FDEFEAC00606226 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09BA1A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouch"; + }; + C3B345AD1B46194500844218 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BC93AA7C0FDEFEAC00606226 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09C41A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouchTests"; + }; + C3CBFB791BE590A300519EE8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BC93AA7C0FDEFEAC00606226 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C3CBFB7B1BE590A300519EE8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BC93AA7C0FDEFEAC00606226 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -60,26 +102,26 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 089C1660FE840EACC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 13E42FBA07B3F13500E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; - 1DDD58290DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/CPTPlotDocument.xib; sourceTree = ""; }; - 1DDD582B0DA1D0D100B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; - 2A37F4ACFDCFA73011CA2CEA /* CPTPlotDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlotDocument.m; sourceTree = ""; }; + 2A37F4ACFDCFA73011CA2CEA /* CPTPlotDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlotDocument.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 2A37F4AEFDCFA73011CA2CEA /* CPTPlotDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotDocument.h; sourceTree = ""; }; 2A37F4B0FDCFA73011CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 2A37F4BAFDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = English.lproj/Credits.rtf; sourceTree = ""; }; 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 32DBCF750370BD2300C91783 /* DropPlot_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DropPlot_Prefix.pch; sourceTree = ""; }; - 8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D15AC370486D014006FF6A4 /* DropPlot.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DropPlot.app; sourceTree = BUILT_PRODUCTS_DIR; }; BC00E6470FE1BF0A00DE81E0 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; BC93AA7C0FDEFEAC00606226 /* CorePlot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CorePlot.xcodeproj; path = ../../framework/CorePlot.xcodeproj; sourceTree = SOURCE_ROOT; }; BC93AAF40FDF3F0200606226 /* NSString+ParseCSV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+ParseCSV.h"; sourceTree = ""; }; BC93AAF50FDF3F0200606226 /* NSString+ParseCSV.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+ParseCSV.m"; sourceTree = ""; }; + C3564D1722A2D115000A54C9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; + C3564D1822A2D115000A54C9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + C37A40A820E0314800C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Info.plist; sourceTree = ""; }; C3D3937719FD705000148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = DropPlot/Images.xcassets; sourceTree = ""; }; - C3D6210E19DF72E000652CE7 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3D6210E19DF72E000652CE7 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3DA082A20E00C3C00F73704 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/CPTPlotDocument.xib; sourceTree = ""; }; + C3DA082B20E00C3C00F73704 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -165,7 +207,7 @@ children = ( C3D3937719FD705000148319 /* Images.xcassets */, 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */, - 8D15AC360486D014006FF6A4 /* Info.plist */, + C37A40A920E0314800C4FF48 /* Info.plist */, 089C165FFE840EACC02AAC07 /* InfoPlist.strings */, 1DDD58280DA1D0D100B32029 /* CPTPlotDocument.xib */, 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */, @@ -187,6 +229,12 @@ children = ( BC93AA970FDEFEAC00606226 /* CorePlot.framework */, 07E0DFAC109C4EB500F108D2 /* UnitTests.xctest */, + C3B345A81B46194500844218 /* CorePlot.framework */, + C3B345AA1B46194500844218 /* UnitTests iOS.xctest */, + C3B345AC1B46194500844218 /* libCorePlot-CocoaTouch.a */, + C3B345AE1B46194500844218 /* CorePlot-CocoaTouchTests.xctest */, + C3CBFB7A1BE590A300519EE8 /* CorePlot.framework */, + C3CBFB7C1BE590A300519EE8 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -220,17 +268,18 @@ 2A37F4A9FDCFA73011CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0600; + LastUpgradeCheck = 1100; }; buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "DropPlot" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + de, + ja, + fr, + en, ); mainGroup = 2A37F4AAFDCFA73011CA2CEA /* DropPlot */; projectDirPath = ""; @@ -262,6 +311,48 @@ remoteRef = BC93AA960FDEFEAC00606226 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C3B345A81B46194500844218 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3B345A71B46194500844218 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B345AA1B46194500844218 /* UnitTests iOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests iOS.xctest"; + remoteRef = C3B345A91B46194500844218 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B345AC1B46194500844218 /* libCorePlot-CocoaTouch.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libCorePlot-CocoaTouch.a"; + remoteRef = C3B345AB1B46194500844218 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B345AE1B46194500844218 /* CorePlot-CocoaTouchTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "CorePlot-CocoaTouchTests.xctest"; + remoteRef = C3B345AD1B46194500844218 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3CBFB7A1BE590A300519EE8 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3CBFB791BE590A300519EE8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3CBFB7C1BE590A300519EE8 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C3CBFB7B1BE590A300519EE8 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -304,7 +395,7 @@ 089C165FFE840EACC02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 089C1660FE840EACC02AAC07 /* English */, + C3564D1822A2D115000A54C9 /* en */, ); name = InfoPlist.strings; sourceTree = ""; @@ -312,7 +403,7 @@ 1DDD58280DA1D0D100B32029 /* CPTPlotDocument.xib */ = { isa = PBXVariantGroup; children = ( - 1DDD58290DA1D0D100B32029 /* English */, + C3DA082A20E00C3C00F73704 /* Base */, ); name = CPTPlotDocument.xib; sourceTree = ""; @@ -320,7 +411,7 @@ 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( - 1DDD582B0DA1D0D100B32029 /* English */, + C3DA082B20E00C3C00F73704 /* Base */, ); name = MainMenu.xib; sourceTree = ""; @@ -328,29 +419,39 @@ 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */ = { isa = PBXVariantGroup; children = ( - 2A37F4BAFDCFA73011CA2CEA /* English */, + C3564D1722A2D115000A54C9 /* en */, ); name = Credits.rtf; sourceTree = ""; }; + C37A40A920E0314800C4FF48 /* Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A40A820E0314800C4FF48 /* Base */, + ); + name = Info.plist; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ C05733C808A9546B00998B17 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3D6210E19DF72E000652CE7 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = DropPlot_Prefix.pch; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = DropPlot; }; @@ -358,18 +459,21 @@ }; C05733C908A9546B00998B17 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3D6210E19DF72E000652CE7 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = DropPlot_Prefix.pch; HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = DropPlot; }; @@ -380,12 +484,12 @@ baseConfigurationReference = C3D6210E19DF72E000652CE7 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SYMROOT = "$(SRCROOT)/../../build"; @@ -396,10 +500,11 @@ isa = XCBuildConfiguration; baseConfigurationReference = C3D6210E19DF72E000652CE7 /* CorePlotWarnings.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; + MACOSX_DEPLOYMENT_TARGET = 10.8; SDKROOT = macosx; SYMROOT = "$(SRCROOT)/../../build"; }; diff --git a/examples/DropPlot/DropPlot.xcodeproj/xcshareddata/xcschemes/DropPlot.xcscheme b/examples/DropPlot/DropPlot.xcodeproj/xcshareddata/xcschemes/DropPlot.xcscheme new file mode 100644 index 000000000..e0844ecb4 --- /dev/null +++ b/examples/DropPlot/DropPlot.xcodeproj/xcshareddata/xcschemes/DropPlot.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/DropPlot/English.lproj/CPTPlotDocument.xib b/examples/DropPlot/English.lproj/CPTPlotDocument.xib deleted file mode 100644 index 34e4c656e..000000000 --- a/examples/DropPlot/English.lproj/CPTPlotDocument.xib +++ /dev/null @@ -1,213 +0,0 @@ - - - - 1050 - 11B26 - 1617 - 1138 - 566.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 1617 - - - YES - NSCustomView - NSWindowTemplate - NSView - NSCustomObject - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - YES - - - - - YES - - CPTPlotDocument - - - FirstResponder - - - 15 - 2 - {{133, 173}, {561, 475}} - 1886912512 - Window - NSWindow - View - - {94, 86} - - - 256 - - YES - - - 274 - {561, 475} - - - YES - 2 - CPTGraphHostingView - - - {561, 475} - - - - {{0, 0}, {1440, 878}} - {94, 108} - {10000000000000, 10000000000000} - YES - - - NSApplication - - - - - YES - - - delegate - - - - 17 - - - - window - - - - 18 - - - - graphView - - - - 100029 - - - - - YES - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - 5 - - - YES - - - - Window - - - 6 - - - YES - - - - - - -3 - - - Application - - - 100021 - - - YES - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 100021.IBPluginDependency - 5.IBPluginDependency - 5.IBWindowTemplateEditedContentRect - 6.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{277, 382}, {561, 475}} - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 100029 - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - diff --git a/examples/DropPlot/English.lproj/MainMenu.xib b/examples/DropPlot/English.lproj/MainMenu.xib deleted file mode 100644 index be8439b99..000000000 --- a/examples/DropPlot/English.lproj/MainMenu.xib +++ /dev/null @@ -1,3641 +0,0 @@ - - - - 1050 - 10A380 - 731 - 1025.2 - 427.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 731 - - - YES - - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - YES - - - YES - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - YES - - - DropPlot - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - DropPlot - - YES - - - About DropPlot - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Services - - 1048576 - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Hide DropPlot - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit DropPlot - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - File - - 1048576 - 2147483647 - - - submenuAction: - - File - - YES - - - New - n - 1048576 - 2147483647 - - - - - - Open… - o - 1048576 - 2147483647 - - - - - - Open Recent - - 1048576 - 2147483647 - - - submenuAction: - - Open Recent - - YES - - - Clear Menu - - 1048576 - 2147483647 - - - - - _NSRecentDocumentsMenu - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - Save - s - 1048576 - 2147483647 - - - - - - Save As… - S - 1179648 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Export to PDF... - - 2147483647 - - - - - - Export to PNG... - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - - - - - - - Edit - - 1048576 - 2147483647 - - - submenuAction: - - Edit - - YES - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1179648 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Delete - - 1048576 - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Find - - 1048576 - 2147483647 - - - submenuAction: - - Find - - YES - - - Find… - f - 1048576 - 2147483647 - - - 1 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1179648 - 2147483647 - - - 3 - - - - Use Selection for Find - e - 1048576 - 2147483647 - - - 7 - - - - Jump to Selection - j - 1048576 - 2147483647 - - - - - - - - - Spelling and Grammar - - 1048576 - 2147483647 - - - submenuAction: - - Spelling and Grammar - - YES - - - Show Spelling… - : - 1048576 - 2147483647 - - - - - - Check Spelling - ; - 1048576 - 2147483647 - - - - - - Check Spelling While Typing - - 1048576 - 2147483647 - - - - - - Check Grammar With Spelling - - 1048576 - 2147483647 - - - - - - - - - Substitutions - - 1048576 - 2147483647 - - - submenuAction: - - Substitutions - - YES - - - Smart Copy/Paste - f - 1048576 - 2147483647 - - - 1 - - - - Smart Quotes - g - 1048576 - 2147483647 - - - 2 - - - - Smart Links - G - 1179648 - 2147483647 - - - 3 - - - - - - - Speech - - 1048576 - 2147483647 - - - submenuAction: - - Speech - - YES - - - Start Speaking - - 1048576 - 2147483647 - - - - - - Stop Speaking - - 1048576 - 2147483647 - - - - - - - - - - - - Format - - 2147483647 - - - submenuAction: - - Format - - YES - - - Font - - 2147483647 - - - submenuAction: - - Font - - YES - - - Show Fonts - t - 1048576 - 2147483647 - - - - - - Bold - b - 1048576 - 2147483647 - - - 2 - - - - Italic - i - 1048576 - 2147483647 - - - 1 - - - - Underline - u - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bigger - + - 1048576 - 2147483647 - - - 3 - - - - Smaller - - - 1048576 - 2147483647 - - - 4 - - - - YES - YES - - - 2147483647 - - - - - - Kern - - 2147483647 - - - submenuAction: - - Kern - - YES - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Tighten - - 2147483647 - - - - - - Loosen - - 2147483647 - - - - - - - - - Ligature - - 2147483647 - - - submenuAction: - - Ligature - - YES - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Use All - - 2147483647 - - - - - - - - - Baseline - - 2147483647 - - - submenuAction: - - Baseline - - YES - - - Use Default - - 2147483647 - - - - - - Superscript - - 2147483647 - - - - - - Subscript - - 2147483647 - - - - - - Raise - - 2147483647 - - - - - - Lower - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Colors - C - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Copy Style - c - 1572864 - 2147483647 - - - - - - Paste Style - v - 1572864 - 2147483647 - - - - - _NSFontMenu - - - - - Text - - 2147483647 - - - submenuAction: - - Text - - YES - - - Align Left - { - 1048576 - 2147483647 - - - - - - Center - | - 1048576 - 2147483647 - - - - - - Justify - - 2147483647 - - - - - - Align Right - } - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Show Ruler - - 2147483647 - - - - - - Copy Ruler - c - 1310720 - 2147483647 - - - - - - Paste Ruler - v - 1310720 - 2147483647 - - - - - - - - - - - - View - - 1048576 - 2147483647 - - - submenuAction: - - View - - YES - - - Show Toolbar - t - 1572864 - 2147483647 - - - - - - Customize Toolbar… - - 1048576 - 2147483647 - - - - - - - - - Window - - 1048576 - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 1048576 - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Bring All to Front - - 1048576 - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 1048576 - 2147483647 - - - submenuAction: - - Help - - YES - - - DropPlot Help - ? - 1048576 - 2147483647 - - - - - - - - _NSMainMenu - - - NSFontManager - - - - - YES - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - performClose: - - - - 193 - - - - toggleContinuousSpellChecking: - - - - 222 - - - - undo: - - - - 223 - - - - copy: - - - - 224 - - - - checkSpelling: - - - - 225 - - - - paste: - - - - 226 - - - - stopSpeaking: - - - - 227 - - - - cut: - - - - 228 - - - - showGuessPanel: - - - - 230 - - - - redo: - - - - 231 - - - - selectAll: - - - - 232 - - - - startSpeaking: - - - - 233 - - - - delete: - - - - 235 - - - - performZoom: - - - - 240 - - - - performFindPanelAction: - - - - 241 - - - - centerSelectionInVisibleArea: - - - - 245 - - - - toggleGrammarChecking: - - - - 347 - - - - toggleSmartInsertDelete: - - - - 355 - - - - toggleAutomaticQuoteSubstitution: - - - - 356 - - - - toggleAutomaticLinkDetection: - - - - 357 - - - - showHelp: - - - - 360 - - - - saveDocument: - - - - 362 - - - - saveDocumentAs: - - - - 363 - - - - revertDocumentToSaved: - - - - 364 - - - - runToolbarCustomizationPalette: - - - - 365 - - - - toggleToolbarShown: - - - - 366 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - unhideAllApplications: - - - - 370 - - - - newDocument: - - - - 371 - - - - openDocument: - - - - 372 - - - - printDocument: - - - - 373 - - - - addFontTrait: - - - - 420 - - - - addFontTrait: - - - - 421 - - - - modifyFont: - - - - 422 - - - - orderFrontFontPanel: - - - - 423 - - - - modifyFont: - - - - 424 - - - - raiseBaseline: - - - - 425 - - - - lowerBaseline: - - - - 426 - - - - copyFont: - - - - 427 - - - - subscript: - - - - 428 - - - - superscript: - - - - 429 - - - - tightenKerning: - - - - 430 - - - - underline: - - - - 431 - - - - orderFrontColorPanel: - - - - 432 - - - - useAllLigatures: - - - - 433 - - - - loosenKerning: - - - - 434 - - - - pasteFont: - - - - 435 - - - - unscript: - - - - 436 - - - - useStandardKerning: - - - - 437 - - - - useStandardLigatures: - - - - 438 - - - - turnOffLigatures: - - - - 439 - - - - turnOffKerning: - - - - 440 - - - - alignLeft: - - - - 441 - - - - alignJustified: - - - - 442 - - - - copyRuler: - - - - 443 - - - - alignCenter: - - - - 444 - - - - toggleRuler: - - - - 445 - - - - alignRight: - - - - 446 - - - - pasteRuler: - - - - 447 - - - - terminate: - - - - 448 - - - - exportToPDF: - - - - 456 - - - - exportToPNG: - - - - 457 - - - - - YES - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - - MainMenu - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 103 - - - YES - - - - 1 - - - 217 - - - YES - - - - - - 83 - - - YES - - - - - - 81 - - - YES - - - - - - - - - - - - - - - - - - - 75 - - - 3 - - - 80 - - - 8 - - - 78 - - - 6 - - - 72 - - - - - 82 - - - 9 - - - 124 - - - YES - - - - - - 77 - - - 5 - - - 73 - - - 1 - - - 79 - - - 7 - - - 112 - - - 10 - - - 74 - - - 2 - - - 125 - - - YES - - - - - - 126 - - - - - 205 - - - YES - - - - - - - - - - - - - - - - - - 202 - - - - - 198 - - - - - 207 - - - - - 214 - - - - - 199 - - - - - 203 - - - - - 197 - - - - - 206 - - - - - 215 - - - - - 218 - - - YES - - - - - - 216 - - - YES - - - - - - 200 - - - YES - - - - - - - - - 219 - - - - - 201 - - - - - 204 - - - - - 220 - - - YES - - - - - - - - - - 213 - - - - - 210 - - - - - 221 - - - - - 208 - - - - - 209 - - - - - 106 - - - YES - - - - 2 - - - 111 - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - 1111 - - - 144 - - - - - 129 - - - 121 - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - - 297 - - - - - 298 - - - - - 211 - - - YES - - - - - - 212 - - - YES - - - - - - - 195 - - - - - 196 - - - - - 346 - - - - - 348 - - - YES - - - - - - 349 - - - YES - - - - - - - - 350 - - - - - 351 - - - - - 354 - - - - - 374 - - - YES - - - - - - 375 - - - YES - - - - - - - 376 - - - YES - - - - - - 377 - - - YES - - - - - - 378 - - - YES - - - - - - - - - - - - - 379 - - - - - 380 - - - - - 381 - - - - - 382 - - - - - 383 - - - - - 384 - - - - - 385 - - - - - 386 - - - - - 387 - - - YES - - - - - - - - - - - - - - - - - - - - - 388 - - - - - 389 - - - - - 390 - - - - - 391 - - - - - 392 - - - - - 393 - - - - - 394 - - - - - 395 - - - - - 396 - - - YES - - - - - - 397 - - - YES - - - - - - 398 - - - YES - - - - - - 399 - - - - - 400 - - - - - 401 - - - - - 402 - - - - - 403 - - - - - 404 - - - YES - - - - - - - - - - 405 - - - - - 406 - - - - - 407 - - - - - 408 - - - - - 409 - - - - - 410 - - - YES - - - - - - - - 411 - - - - - 412 - - - - - 413 - - - - - 414 - - - YES - - - - - - - - - 415 - - - - - 416 - - - - - 417 - - - - - 418 - - - - - 419 - - - - - 449 - - - 2 - - - 450 - - - 10 - - - 452 - - - 10 - - - - - YES - - YES - -3.IBPluginDependency - 103.IBPluginDependency - 103.ImportedFromIB2 - 106.IBEditorWindowLastContentRect - 106.IBPluginDependency - 106.ImportedFromIB2 - 106.editorWindowContentRectSynchronizationRect - 111.IBPluginDependency - 111.ImportedFromIB2 - 112.IBPluginDependency - 112.ImportedFromIB2 - 124.IBPluginDependency - 124.ImportedFromIB2 - 125.IBPluginDependency - 125.ImportedFromIB2 - 125.editorWindowContentRectSynchronizationRect - 126.IBPluginDependency - 126.ImportedFromIB2 - 129.IBPluginDependency - 129.ImportedFromIB2 - 130.IBPluginDependency - 130.ImportedFromIB2 - 130.editorWindowContentRectSynchronizationRect - 131.IBPluginDependency - 131.ImportedFromIB2 - 134.IBPluginDependency - 134.ImportedFromIB2 - 136.IBPluginDependency - 136.ImportedFromIB2 - 143.IBPluginDependency - 143.ImportedFromIB2 - 144.IBPluginDependency - 144.ImportedFromIB2 - 145.IBPluginDependency - 145.ImportedFromIB2 - 149.IBPluginDependency - 149.ImportedFromIB2 - 150.IBPluginDependency - 150.ImportedFromIB2 - 19.IBPluginDependency - 19.ImportedFromIB2 - 195.IBPluginDependency - 195.ImportedFromIB2 - 196.IBPluginDependency - 196.ImportedFromIB2 - 197.IBPluginDependency - 197.ImportedFromIB2 - 198.IBPluginDependency - 198.ImportedFromIB2 - 199.IBPluginDependency - 199.ImportedFromIB2 - 200.IBPluginDependency - 200.ImportedFromIB2 - 200.editorWindowContentRectSynchronizationRect - 201.IBPluginDependency - 201.ImportedFromIB2 - 202.IBPluginDependency - 202.ImportedFromIB2 - 203.IBPluginDependency - 203.ImportedFromIB2 - 204.IBPluginDependency - 204.ImportedFromIB2 - 205.IBPluginDependency - 205.ImportedFromIB2 - 205.editorWindowContentRectSynchronizationRect - 206.IBPluginDependency - 206.ImportedFromIB2 - 207.IBPluginDependency - 207.ImportedFromIB2 - 208.IBPluginDependency - 208.ImportedFromIB2 - 209.IBPluginDependency - 209.ImportedFromIB2 - 210.IBPluginDependency - 210.ImportedFromIB2 - 211.IBPluginDependency - 211.ImportedFromIB2 - 212.IBPluginDependency - 212.ImportedFromIB2 - 212.editorWindowContentRectSynchronizationRect - 213.IBPluginDependency - 213.ImportedFromIB2 - 214.IBPluginDependency - 214.ImportedFromIB2 - 215.IBPluginDependency - 215.ImportedFromIB2 - 216.IBPluginDependency - 216.ImportedFromIB2 - 217.IBPluginDependency - 217.ImportedFromIB2 - 218.IBPluginDependency - 218.ImportedFromIB2 - 219.IBPluginDependency - 219.ImportedFromIB2 - 220.IBPluginDependency - 220.ImportedFromIB2 - 220.editorWindowContentRectSynchronizationRect - 221.IBPluginDependency - 221.ImportedFromIB2 - 23.IBPluginDependency - 23.ImportedFromIB2 - 236.IBPluginDependency - 236.ImportedFromIB2 - 239.IBPluginDependency - 239.ImportedFromIB2 - 24.IBPluginDependency - 24.ImportedFromIB2 - 24.editorWindowContentRectSynchronizationRect - 29.IBEditorWindowLastContentRect - 29.IBPluginDependency - 29.ImportedFromIB2 - 29.WindowOrigin - 29.editorWindowContentRectSynchronizationRect - 295.IBPluginDependency - 296.IBPluginDependency - 296.editorWindowContentRectSynchronizationRect - 297.IBPluginDependency - 298.IBPluginDependency - 346.IBPluginDependency - 346.ImportedFromIB2 - 348.IBPluginDependency - 348.ImportedFromIB2 - 349.IBPluginDependency - 349.ImportedFromIB2 - 349.editorWindowContentRectSynchronizationRect - 350.IBPluginDependency - 350.ImportedFromIB2 - 351.IBPluginDependency - 351.ImportedFromIB2 - 354.IBPluginDependency - 354.ImportedFromIB2 - 374.IBPluginDependency - 375.IBPluginDependency - 376.IBPluginDependency - 377.IBPluginDependency - 378.IBPluginDependency - 379.IBPluginDependency - 380.IBPluginDependency - 381.IBPluginDependency - 382.IBPluginDependency - 383.IBPluginDependency - 384.IBPluginDependency - 385.IBPluginDependency - 386.IBPluginDependency - 387.IBPluginDependency - 388.IBPluginDependency - 389.IBPluginDependency - 390.IBPluginDependency - 391.IBPluginDependency - 392.IBPluginDependency - 393.IBPluginDependency - 394.IBPluginDependency - 395.IBPluginDependency - 396.IBPluginDependency - 397.IBPluginDependency - 398.IBPluginDependency - 399.IBPluginDependency - 400.IBPluginDependency - 401.IBPluginDependency - 402.IBPluginDependency - 403.IBPluginDependency - 404.IBPluginDependency - 405.IBPluginDependency - 406.IBPluginDependency - 407.IBPluginDependency - 408.IBPluginDependency - 409.IBPluginDependency - 410.IBPluginDependency - 411.IBPluginDependency - 412.IBPluginDependency - 413.IBPluginDependency - 414.IBPluginDependency - 415.IBPluginDependency - 416.IBPluginDependency - 417.IBPluginDependency - 418.IBPluginDependency - 449.IBPluginDependency - 449.ImportedFromIB2 - 450.IBPluginDependency - 450.ImportedFromIB2 - 452.IBPluginDependency - 452.ImportedFromIB2 - 5.IBPluginDependency - 5.ImportedFromIB2 - 56.IBPluginDependency - 56.ImportedFromIB2 - 57.IBEditorWindowLastContentRect - 57.IBPluginDependency - 57.ImportedFromIB2 - 57.editorWindowContentRectSynchronizationRect - 58.IBPluginDependency - 58.ImportedFromIB2 - 72.IBPluginDependency - 72.ImportedFromIB2 - 73.IBPluginDependency - 73.ImportedFromIB2 - 74.IBPluginDependency - 74.ImportedFromIB2 - 75.IBPluginDependency - 75.ImportedFromIB2 - 77.IBPluginDependency - 77.ImportedFromIB2 - 78.IBPluginDependency - 78.ImportedFromIB2 - 79.IBPluginDependency - 79.ImportedFromIB2 - 80.IBPluginDependency - 80.ImportedFromIB2 - 81.IBEditorWindowLastContentRect - 81.IBPluginDependency - 81.ImportedFromIB2 - 81.editorWindowContentRectSynchronizationRect - 82.IBPluginDependency - 82.ImportedFromIB2 - 83.IBPluginDependency - 83.ImportedFromIB2 - 92.IBPluginDependency - 92.ImportedFromIB2 - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - {{683, 713}, {169, 23}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{596, 852}, {216, 23}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{522, 812}, {146, 23}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{436, 809}, {64, 6}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{608, 612}, {275, 83}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{197, 734}, {243, 243}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{608, 612}, {167, 43}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{608, 612}, {241, 103}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{525, 802}, {197, 73}} - {{316, 736}, {428, 20}} - com.apple.InterfaceBuilder.CocoaPlugin - - {74, 862} - {{11, 977}, {478, 20}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{475, 832}, {234, 43}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{608, 612}, {215, 63}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{328, 553}, {198, 183}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{23, 794}, {245, 183}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{410, 483}, {200, 253}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{155, 774}, {199, 203}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - - - - YES - - - YES - - - - - YES - - - YES - - - - 457 - - - - YES - - CPTPlotDocument - NSDocument - - YES - - YES - exportToPDF: - exportToPNG: - - - YES - id - id - - - - graphView - CPTLayerHostingView - - - IBProjectSource - CPTPlotDocument.h - - - - FirstResponder - - YES - - YES - exportToPDF: - exportToPNG: - - - YES - id - id - - - - IBUserSource - - - - - - YES - - NSApplication - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSApplication.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSApplicationScripting.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSColorPanel.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSHelpManager.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSPageLayout.h - - - - NSApplication - - IBFrameworkSource - AppKit.framework/Headers/NSUserInterfaceItemSearching.h - - - - NSBrowser - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSBrowser.h - - - - NSControl - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSControl.h - - - - NSDocument - NSObject - - YES - - YES - printDocument: - revertDocumentToSaved: - runPageLayout: - saveDocument: - saveDocumentAs: - saveDocumentTo: - - - YES - id - id - id - id - id - id - - - - IBFrameworkSource - AppKit.framework/Headers/NSDocument.h - - - - NSDocument - - IBFrameworkSource - AppKit.framework/Headers/NSDocumentScripting.h - - - - NSDocumentController - NSObject - - YES - - YES - clearRecentDocuments: - newDocument: - openDocument: - saveAllDocuments: - - - YES - id - id - id - id - - - - IBFrameworkSource - AppKit.framework/Headers/NSDocumentController.h - - - - NSFontManager - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontManager.h - - - - NSFormatter - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFormatter.h - - - - NSMatrix - NSControl - - IBFrameworkSource - AppKit.framework/Headers/NSMatrix.h - - - - NSMenu - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenu.h - - - - NSMenuItem - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSMenuItem.h - - - - NSMovieView - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSMovieView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSAccessibility.h - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDictionaryController.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSDragging.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSFontPanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSKeyValueBinding.h - - - - NSObject - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSNibLoading.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSOutlineView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSPasteboard.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSSavePanel.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSTableView.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSToolbarItem.h - - - - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSView.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObjectScripting.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPortCoder.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptClassDescription.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptObjectSpecifiers.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSScriptWhoseTests.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLDownload.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CIImageProvider.h - - - - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSInterfaceStyle.h - - - - NSResponder - NSObject - - IBFrameworkSource - AppKit.framework/Headers/NSResponder.h - - - - NSTableView - NSControl - - - - NSText - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSText.h - - - - NSTextView - NSText - - IBFrameworkSource - AppKit.framework/Headers/NSTextView.h - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSClipView.h - - - - NSView - - - - NSView - - IBFrameworkSource - AppKit.framework/Headers/NSRulerView.h - - - - NSView - NSResponder - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSDrawer.h - - - - NSWindow - NSResponder - - IBFrameworkSource - AppKit.framework/Headers/NSWindow.h - - - - NSWindow - - IBFrameworkSource - AppKit.framework/Headers/NSWindowScripting.h - - - - - 0 - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - ../DropPlot.xcodeproj - 3 - - diff --git a/examples/DropPlot/NSString+ParseCSV.h b/examples/DropPlot/NSString+ParseCSV.h index 7df3e87cd..2258c2636 100644 --- a/examples/DropPlot/NSString+ParseCSV.h +++ b/examples/DropPlot/NSString+ParseCSV.h @@ -1,7 +1,8 @@ #import +#import @interface NSString(ParseCSV) --(NSArray *)arrayByParsingCSVLine; +-(CPTStringArray *)arrayByParsingCSVLine; @end diff --git a/examples/DropPlot/NSString+ParseCSV.m b/examples/DropPlot/NSString+ParseCSV.m index d1ba330e9..7a9bbde09 100644 --- a/examples/DropPlot/NSString+ParseCSV.m +++ b/examples/DropPlot/NSString+ParseCSV.m @@ -2,21 +2,22 @@ @implementation NSString(ParseCSV) --(NSArray *)arrayByParsingCSVLine +-(CPTStringArray *)arrayByParsingCSVLine { - BOOL isRemoveWhitespace = YES; - NSMutableArray *theArray = [NSMutableArray array]; - NSArray *theFields = [self componentsSeparatedByString:@","]; + BOOL isRemoveWhitespace = YES; + + CPTMutableStringArray *theArray = [NSMutableArray array]; + CPTStringArray *theFields = [self componentsSeparatedByString:@","]; NSCharacterSet *quotedCharacterSet = [NSCharacterSet characterSetWithCharactersInString:@"\""]; - BOOL inField = NO; NSMutableString *theConcatenatedField = [NSMutableString string]; - unsigned int i; - for ( i = 0; i < [theFields count]; i++ ) { + BOOL inField = NO; + + for ( NSUInteger i = 0; i < theFields.count; i++ ) { NSString *theField = theFields[i]; switch ( inField ) { case NO: - if ( ([theField hasPrefix:@"\""] == YES) && ([theField hasSuffix:@"\""] == NO) ) { + if (([theField hasPrefix:@"\""] == YES) && ([theField hasSuffix:@"\""] == NO)) { inField = YES; [theConcatenatedField appendString:theField]; [theConcatenatedField appendString:@","]; diff --git a/examples/DropPlot/English.lproj/Credits.rtf b/examples/DropPlot/en.lproj/Credits.rtf similarity index 100% rename from examples/DropPlot/English.lproj/Credits.rtf rename to examples/DropPlot/en.lproj/Credits.rtf diff --git a/examples/DropPlot/English.lproj/InfoPlist.strings b/examples/DropPlot/en.lproj/InfoPlist.strings similarity index 100% rename from examples/DropPlot/English.lproj/InfoPlist.strings rename to examples/DropPlot/en.lproj/InfoPlist.strings diff --git a/examples/DropPlot/main.m b/examples/DropPlot/main.m index c81924a60..77a0b5c98 100644 --- a/examples/DropPlot/main.m +++ b/examples/DropPlot/main.m @@ -1,9 +1,9 @@ // -// main.m -// DropPlot +// main.m +// DropPlot // -// Created by Brad Larson on 6/9/2009. -// Copyright SonoPlot, Inc. 2009 . All rights reserved. +// Created by Brad Larson on 6/9/2009. +// Copyright SonoPlot, Inc. 2009 . All rights reserved. // #import diff --git a/examples/MinorTickLabels/Info.plist b/examples/MinorTickLabels/Base.lproj/Info.plist similarity index 100% rename from examples/MinorTickLabels/Info.plist rename to examples/MinorTickLabels/Base.lproj/Info.plist diff --git a/examples/MinorTickLabels/Base.lproj/minorTickFormatter.xib b/examples/MinorTickLabels/Base.lproj/minorTickFormatter.xib new file mode 100644 index 000000000..cf72d4d05 --- /dev/null +++ b/examples/MinorTickLabels/Base.lproj/minorTickFormatter.xib @@ -0,0 +1,554 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/MinorTickLabels/Controller.m b/examples/MinorTickLabels/Controller.m index 727259cfc..194c6a92a 100644 --- a/examples/MinorTickLabels/Controller.m +++ b/examples/MinorTickLabels/Controller.m @@ -3,9 +3,9 @@ @interface Controller() -@property (nonatomic, readwrite, strong) IBOutlet CPTGraphHostingView *hostView; -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; -@property (nonatomic, readwrite, strong) NSArray *plotData; +@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTGraphHostingView *hostView; +@property (nonatomic, readwrite, strong, nonnull) CPTXYGraph *graph; +@property (nonatomic, readwrite, strong, nonnull) NSArray *plotData; @end @@ -40,15 +40,15 @@ -(void)awakeFromNib // Setup scatter plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; NSTimeInterval xLow = 0.0; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(xLow) length:CPTDecimalFromDouble(oneDay * 3.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) length:CPTDecimalFromDouble(3.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(xLow) length:@(oneDay * 3.0)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@3.0]; // Axes CPTXYAxisSet *axisSet = (CPTXYAxisSet *)newGraph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(oneDay); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(2.0); - x.minorTicksPerInterval = 3; + x.majorIntervalLength = @(oneDay); + x.orthogonalPosition = @2.0; + x.minorTicksPerInterval = 3; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.dateStyle = kCFDateFormatterShortStyle; @@ -61,12 +61,12 @@ -(void)awakeFromNib CPTTimeFormatter *myTimeFormatter = [[CPTTimeFormatter alloc] initWithDateFormatter:timeFormatter]; myTimeFormatter.referenceDate = refDate; x.minorTickLabelFormatter = myTimeFormatter; -// x.minorTickLabelRotation = M_PI_2; +// x.minorTickLabelRotation = M_PI_2; CPTXYAxis *y = axisSet.yAxis; - y.majorIntervalLength = CPTDecimalFromDouble(0.5); - y.minorTicksPerInterval = 5; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.5 * oneDay); + y.majorIntervalLength = @0.5; + y.minorTicksPerInterval = 5; + y.orthogonalPosition = @(0.5 * oneDay); // Create a plot that uses the data source method CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] init]; @@ -81,7 +81,7 @@ -(void)awakeFromNib [newGraph addPlot:dataSourceLinePlot]; // Add some data - NSMutableArray *newData = [NSMutableArray array]; + NSMutableArray *newData = [NSMutableArray array]; for ( NSUInteger i = 0; i < 7; i++ ) { NSTimeInterval xVal = oneDay * i * 0.5; @@ -98,12 +98,12 @@ -(void)awakeFromNib #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { return self.plotData[index][@(fieldEnum)]; } diff --git a/examples/MinorTickLabels/Source/main.m b/examples/MinorTickLabels/Source/main.m index 50ab6acfb..c8341df20 100644 --- a/examples/MinorTickLabels/Source/main.m +++ b/examples/MinorTickLabels/Source/main.m @@ -1,9 +1,9 @@ // -// main.m -// CPTTestApp +// main.m +// CPTTestApp // -// Created by Dirkjan Krijnders on 2/2/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. +// Created by Dirkjan Krijnders on 2/2/09. +// Copyright __MyCompanyName__ 2009. All rights reserved. // #import diff --git a/examples/MinorTickLabels/English.lproj/InfoPlist.strings b/examples/MinorTickLabels/en.lproj/InfoPlist.strings similarity index 100% rename from examples/MinorTickLabels/English.lproj/InfoPlist.strings rename to examples/MinorTickLabels/en.lproj/InfoPlist.strings diff --git a/examples/MinorTickLabels/minorTickFormatter.xcodeproj/project.pbxproj b/examples/MinorTickLabels/minorTickFormatter.xcodeproj/project.pbxproj index 4422e9d3f..d0e672ef8 100644 --- a/examples/MinorTickLabels/minorTickFormatter.xcodeproj/project.pbxproj +++ b/examples/MinorTickLabels/minorTickFormatter.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 47; objects = { /* Begin PBXBuildFile section */ @@ -13,8 +13,8 @@ 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - 90AF4F440F36CF1800753D26 /* minorTickFormatter.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90AF4F430F36CF1800753D26 /* minorTickFormatter.xib */; }; BC8E737D0FC0B3CF00DF8511 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8E737C0FC0B3CF00DF8511 /* QuartzCore.framework */; }; + C3D0A1CB20E0195800BA2921 /* minorTickFormatter.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A1CD20E0195800BA2921 /* minorTickFormatter.xib */; }; C3D3937C19FD732200148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3937B19FD732200148319 /* Images.xcassets */; }; /* End PBXBuildFile section */ @@ -40,6 +40,48 @@ remoteGlobalIDString = 0730F600109492D800E95162; remoteInfo = UnitTests; }; + C310CE771C0A3DF000C4FCB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C310CE791C0A3DF000C4FCB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; + C3B345B71B46195100844218 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09781A46185200D45436; + remoteInfo = CorePlot_iOS; + }; + C3B345B91B46195100844218 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09821A46185300D45436; + remoteInfo = CorePlot_iOSTests; + }; + C3B345BB1B46195100844218 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09BA1A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouch"; + }; + C3B345BD1B46195100844218 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09C41A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouchTests"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -62,18 +104,18 @@ 0761854B0F3CB3CB00A89A76 /* CorePlot.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = CorePlot.framework; path = ../../../../framework/build/Debug/CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 077382AF0F3DC1FB002F10E2 /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Controller.h; sourceTree = ""; }; 077382B00F3DC1FB002F10E2 /* Controller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Controller.m; sourceTree = ""; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Source/main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* minorTickFormatter_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = minorTickFormatter_Prefix.pch; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* minorTickFormatter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = minorTickFormatter.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 90AF4F430F36CF1800753D26 /* minorTickFormatter.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = minorTickFormatter.xib; sourceTree = ""; }; BC8E737C0FC0B3CF00DF8511 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - C37FFB5D19E1ECF0003F34C5 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3564CFD22A2D107000A54C9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + C37A40B620E0316900C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Info.plist; sourceTree = ""; }; + C37FFB5D19E1ECF0003F34C5 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3D0A1DA20E0195F00BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/minorTickFormatter.xib; sourceTree = ""; }; C3D3937B19FD732200148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = minorTickFormatter/Images.xcassets; sourceTree = ""; }; /* End PBXFileReference section */ @@ -96,6 +138,12 @@ children = ( 076184C10F3CAD5900A89A76 /* CorePlot.framework */, 07E0DF80109C4E9500F108D2 /* UnitTests.xctest */, + C3B345B81B46195100844218 /* CorePlot.framework */, + C3B345BA1B46195100844218 /* UnitTests iOS.xctest */, + C3B345BC1B46195100844218 /* libCorePlot-CocoaTouch.a */, + C3B345BE1B46195100844218 /* CorePlot-CocoaTouchTests.xctest */, + C310CE781C0A3DF000C4FCB4 /* CorePlot.framework */, + C310CE7A1C0A3DF000C4FCB4 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -168,8 +216,8 @@ isa = PBXGroup; children = ( C3D3937B19FD732200148319 /* Images.xcassets */, - 90AF4F430F36CF1800753D26 /* minorTickFormatter.xib */, - 8D1107310486CEB800E47090 /* Info.plist */, + C3D0A1CD20E0195800BA2921 /* minorTickFormatter.xib */, + C37A40B720E0316900C4FF48 /* Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, ); name = Resources; @@ -214,17 +262,18 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = NO; - LastUpgradeCheck = 0600; + LastUpgradeCheck = 1100; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "minorTickFormatter" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + de, + en, + ja, + fr, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CPTTestApp */; projectDirPath = ""; @@ -256,6 +305,48 @@ remoteRef = 07E0DF7F109C4E9500F108D2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C310CE781C0A3DF000C4FCB4 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C310CE771C0A3DF000C4FCB4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C310CE7A1C0A3DF000C4FCB4 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C310CE791C0A3DF000C4FCB4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B345B81B46195100844218 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3B345B71B46195100844218 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B345BA1B46195100844218 /* UnitTests iOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests iOS.xctest"; + remoteRef = C3B345B91B46195100844218 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B345BC1B46195100844218 /* libCorePlot-CocoaTouch.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libCorePlot-CocoaTouch.a"; + remoteRef = C3B345BB1B46195100844218 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B345BE1B46195100844218 /* CorePlot-CocoaTouchTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "CorePlot-CocoaTouchTests.xctest"; + remoteRef = C3B345BD1B46195100844218 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -265,7 +356,7 @@ files = ( 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, C3D3937C19FD732200148319 /* Images.xcassets in Resources */, - 90AF4F440F36CF1800753D26 /* minorTickFormatter.xib in Resources */, + C3D0A1CB20E0195800BA2921 /* minorTickFormatter.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -295,31 +386,48 @@ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 089C165DFE840E0CC02AAC07 /* English */, + C3564CFD22A2D107000A54C9 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; + C37A40B720E0316900C4FF48 /* Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A40B620E0316900C4FF48 /* Base */, + ); + name = Info.plist; + sourceTree = ""; + }; + C3D0A1CD20E0195800BA2921 /* minorTickFormatter.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A1DA20E0195F00BA2921 /* Base */, + ); + name = minorTickFormatter.xib; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C37FFB5D19E1ECF0003F34C5 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = minorTickFormatter_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = minorTickFormatter; }; @@ -327,18 +435,21 @@ }; C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C37FFB5D19E1ECF0003F34C5 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = minorTickFormatter_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ""; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = minorTickFormatter; }; @@ -348,12 +459,14 @@ isa = XCBuildConfiguration; baseConfigurationReference = C37FFB5D19E1ECF0003F34C5 /* CorePlotWarnings.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ""; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SYMROOT = "$(SRCROOT)/../../build"; @@ -364,11 +477,12 @@ isa = XCBuildConfiguration; baseConfigurationReference = C37FFB5D19E1ECF0003F34C5 /* CorePlotWarnings.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; SDKROOT = macosx; SYMROOT = "$(SRCROOT)/../../build"; }; diff --git a/examples/MinorTickLabels/minorTickFormatter.xcodeproj/xcshareddata/xcschemes/minorTickFormatter.xcscheme b/examples/MinorTickLabels/minorTickFormatter.xcodeproj/xcshareddata/xcschemes/minorTickFormatter.xcscheme new file mode 100644 index 000000000..417b6d1dc --- /dev/null +++ b/examples/MinorTickLabels/minorTickFormatter.xcodeproj/xcshareddata/xcschemes/minorTickFormatter.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/MinorTickLabels/minorTickFormatter.xib b/examples/MinorTickLabels/minorTickFormatter.xib deleted file mode 100644 index 526102e96..000000000 --- a/examples/MinorTickLabels/minorTickFormatter.xib +++ /dev/null @@ -1,3101 +0,0 @@ - - - - 1050 - 11B26 - 1617 - 1138 - 566.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 1617 - - - YES - NSCustomView - NSWindowTemplate - NSView - NSMenu - NSMenuItem - NSCustomObject - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - YES - - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - NSFontManager - - - AMainMenu - - YES - - - minorTickFormatter - - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - minorTickFormatter - - YES - - - About minorTickFormatter - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Services - - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 2147483647 - - - - - - Hide minorTickFormatter - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Quit minorTickFormatter - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - File - - 2147483647 - - - submenuAction: - - File - - YES - - - New - n - 1048576 - 2147483647 - - - - - - Open… - o - 1048576 - 2147483647 - - - - - - Open Recent - - 2147483647 - - - submenuAction: - - Open Recent - - YES - - - Clear Menu - - 2147483647 - - - - - _NSRecentDocumentsMenu - - - - - YES - YES - - - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - Save - s - 1048576 - 2147483647 - - - - - - Save As… - S - 1179648 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Export to PDF... - - 2147483647 - - - - - - Export to PNG... - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - - - - - - - Edit - - 2147483647 - - - submenuAction: - - Edit - - YES - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1179648 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Delete - - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Find - - 2147483647 - - - submenuAction: - - Find - - YES - - - Find… - f - 1048576 - 2147483647 - - - 1 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1179648 - 2147483647 - - - 3 - - - - Use Selection for Find - e - 1048576 - 2147483647 - - - 7 - - - - Jump to Selection - j - 1048576 - 2147483647 - - - - - - - - - Spelling and Grammar - - 2147483647 - - - submenuAction: - - Spelling and Grammar - - YES - - - Show Spelling… - : - 1048576 - 2147483647 - - - - - - Check Spelling - ; - 1048576 - 2147483647 - - - - - - Check Spelling While Typing - - 2147483647 - - - - - - Check Grammar With Spelling - - 2147483647 - - - - - - - - - Substitutions - - 2147483647 - - - submenuAction: - - Substitutions - - YES - - - Smart Copy/Paste - f - 1048576 - 2147483647 - - - 1 - - - - Smart Quotes - g - 1048576 - 2147483647 - - - 2 - - - - Smart Links - G - 1179648 - 2147483647 - - - 3 - - - - - - - Speech - - 2147483647 - - - submenuAction: - - Speech - - YES - - - Start Speaking - - 2147483647 - - - - - - Stop Speaking - - 2147483647 - - - - - - - - - - - - Format - - 2147483647 - - - submenuAction: - - Format - - YES - - - Font - - 2147483647 - - - submenuAction: - - Font - - YES - - - Show Fonts - t - 1048576 - 2147483647 - - - - - - Bold - b - 1048576 - 2147483647 - - - 2 - - - - Italic - i - 1048576 - 2147483647 - - - 1 - - - - Underline - u - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bigger - + - 1048576 - 2147483647 - - - 3 - - - - Smaller - - - 1048576 - 2147483647 - - - 4 - - - - YES - YES - - - 2147483647 - - - - - - Kern - - 2147483647 - - - submenuAction: - - Kern - - YES - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Tighten - - 2147483647 - - - - - - Loosen - - 2147483647 - - - - - - - - - Ligature - - 2147483647 - - - submenuAction: - - Ligature - - YES - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Use All - - 2147483647 - - - - - - - - - Baseline - - 2147483647 - - - submenuAction: - - Baseline - - YES - - - Use Default - - 2147483647 - - - - - - Superscript - - 2147483647 - - - - - - Subscript - - 2147483647 - - - - - - Raise - - 2147483647 - - - - - - Lower - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Colors - C - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Copy Style - c - 1572864 - 2147483647 - - - - - - Paste Style - v - 1572864 - 2147483647 - - - - - _NSFontMenu - - - - - Text - - 2147483647 - - - submenuAction: - - Text - - YES - - - Align Left - { - 1048576 - 2147483647 - - - - - - Center - | - 1048576 - 2147483647 - - - - - - Justify - - 2147483647 - - - - - - Align Right - } - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Show Ruler - - 2147483647 - - - - - - Copy Ruler - c - 1310720 - 2147483647 - - - - - - Paste Ruler - v - 1310720 - 2147483647 - - - - - - - - - - - - View - - 2147483647 - - - submenuAction: - - View - - YES - - - Show Toolbar - t - 1572864 - 2147483647 - - - - - - Customize Toolbar… - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Explode Layers - e - 1572864 - 2147483647 - - - - - - Reassemble Layers - r - 1572864 - 2147483647 - - - - - - - - - Window - - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bring All to Front - - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - YES - - - minorTickFormatter Help - ? - 1048576 - 2147483647 - - - - - - - - _NSMainMenu - - - 13 - 2 - {{68, 396}, {912, 526}} - 603979776 - Window - NSWindow - - - {450, 250} - - - 256 - - YES - - - 274 - {912, 526} - - - - CPTGraphHostingView - - - {912, 526} - - - - - {{0, 0}, {1680, 1028}} - {450, 272} - {10000000000000, 10000000000000} - YES - - - Controller - - - - - YES - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - print: - - - - 86 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - performClose: - - - - 193 - - - - toggleContinuousSpellChecking: - - - - 222 - - - - undo: - - - - 223 - - - - copy: - - - - 224 - - - - checkSpelling: - - - - 225 - - - - paste: - - - - 226 - - - - stopSpeaking: - - - - 227 - - - - cut: - - - - 228 - - - - showGuessPanel: - - - - 230 - - - - redo: - - - - 231 - - - - selectAll: - - - - 232 - - - - startSpeaking: - - - - 233 - - - - delete: - - - - 235 - - - - performZoom: - - - - 240 - - - - performFindPanelAction: - - - - 241 - - - - centerSelectionInVisibleArea: - - - - 245 - - - - toggleGrammarChecking: - - - - 347 - - - - toggleSmartInsertDelete: - - - - 355 - - - - toggleAutomaticQuoteSubstitution: - - - - 356 - - - - toggleAutomaticLinkDetection: - - - - 357 - - - - showHelp: - - - - 360 - - - - saveDocument: - - - - 362 - - - - saveDocumentAs: - - - - 363 - - - - revertDocumentToSaved: - - - - 364 - - - - runToolbarCustomizationPalette: - - - - 365 - - - - toggleToolbarShown: - - - - 366 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - terminate: - - - - 369 - - - - unhideAllApplications: - - - - 370 - - - - addFontTrait: - - - - 418 - - - - addFontTrait: - - - - 419 - - - - modifyFont: - - - - 420 - - - - orderFrontFontPanel: - - - - 421 - - - - modifyFont: - - - - 422 - - - - raiseBaseline: - - - - 423 - - - - lowerBaseline: - - - - 424 - - - - copyFont: - - - - 425 - - - - subscript: - - - - 426 - - - - superscript: - - - - 427 - - - - tightenKerning: - - - - 428 - - - - underline: - - - - 429 - - - - orderFrontColorPanel: - - - - 430 - - - - useAllLigatures: - - - - 431 - - - - loosenKerning: - - - - 432 - - - - pasteFont: - - - - 433 - - - - unscript: - - - - 434 - - - - useStandardKerning: - - - - 435 - - - - useStandardLigatures: - - - - 436 - - - - turnOffLigatures: - - - - 437 - - - - turnOffKerning: - - - - 438 - - - - alignLeft: - - - - 439 - - - - alignJustified: - - - - 440 - - - - copyRuler: - - - - 441 - - - - alignCenter: - - - - 442 - - - - toggleRuler: - - - - 443 - - - - alignRight: - - - - 444 - - - - pasteRuler: - - - - 445 - - - - hostView - - - - 521 - - - - - YES - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - - MainMenu - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 103 - - - YES - - - - 1 - - - 217 - - - YES - - - - - - 83 - - - YES - - - - - - 81 - - - YES - - - - - - - - - - - - - - - - - - - 75 - - - 3 - - - 80 - - - 8 - - - 78 - - - 6 - - - 72 - - - - - 82 - - - 9 - - - 124 - - - YES - - - - - - 77 - - - 5 - - - 73 - - - 1 - - - 79 - - - 7 - - - 112 - - - 10 - - - 74 - - - 2 - - - 125 - - - YES - - - - - - 126 - - - - - 205 - - - YES - - - - - - - - - - - - - - - - - - 202 - - - - - 198 - - - - - 207 - - - - - 214 - - - - - 199 - - - - - 203 - - - - - 197 - - - - - 206 - - - - - 215 - - - - - 218 - - - YES - - - - - - 216 - - - YES - - - - - - 200 - - - YES - - - - - - - - - 219 - - - - - 201 - - - - - 204 - - - - - 220 - - - YES - - - - - - - - - - 213 - - - - - 210 - - - - - 221 - - - - - 208 - - - - - 209 - - - - - 106 - - - YES - - - - 2 - - - 111 - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - 1111 - - - 144 - - - - - 129 - - - 121 - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - - - - - 297 - - - - - 298 - - - - - 211 - - - YES - - - - - - 212 - - - YES - - - - - - - 195 - - - - - 196 - - - - - 346 - - - - - 348 - - - YES - - - - - - 349 - - - YES - - - - - - - - 350 - - - - - 351 - - - - - 354 - - - - - 371 - - - - - 373 - - - YES - - - - - - 374 - - - YES - - - - - - - 375 - - - YES - - - - - - 376 - - - YES - - - - - - 377 - - - YES - - - - - - - - - - - - - 378 - - - - - 379 - - - - - 380 - - - - - 381 - - - - - 382 - - - - - 383 - - - - - 384 - - - - - 385 - - - - - 386 - - - YES - - - - - - - - - - - - - - - - - - - - - 387 - - - - - 388 - - - - - 389 - - - - - 390 - - - - - 391 - - - - - 392 - - - - - 393 - - - - - 394 - - - - - 395 - - - YES - - - - - - 396 - - - YES - - - - - - 397 - - - YES - - - - - - 398 - - - - - 399 - - - - - 400 - - - - - 401 - - - - - 402 - - - - - 403 - - - YES - - - - - - - - - - 404 - - - - - 405 - - - - - 406 - - - - - 407 - - - - - 408 - - - - - 409 - - - YES - - - - - - - - 410 - - - - - 411 - - - - - 412 - - - - - 413 - - - YES - - - - - - - - - 414 - - - - - 415 - - - - - 416 - - - - - 417 - - - - - 446 - - - YES - - - - - - 447 - - - YES - - - - - - 506 - - - 10 - - - 507 - - - 2 - - - 510 - - - 10 - - - 512 - - - - - 513 - - - - - 514 - - - - - 519 - - - - - 520 - - - Controller - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 103.IBPluginDependency - 106.IBPluginDependency - 111.IBPluginDependency - 112.IBPluginDependency - 124.IBPluginDependency - 125.IBPluginDependency - 126.IBPluginDependency - 129.IBPluginDependency - 130.IBPluginDependency - 131.IBPluginDependency - 134.IBPluginDependency - 136.IBPluginDependency - 143.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 149.IBPluginDependency - 150.IBPluginDependency - 19.IBPluginDependency - 195.IBPluginDependency - 196.IBPluginDependency - 197.IBPluginDependency - 198.IBPluginDependency - 199.IBPluginDependency - 200.IBPluginDependency - 201.IBPluginDependency - 202.IBPluginDependency - 203.IBPluginDependency - 204.IBPluginDependency - 205.IBPluginDependency - 206.IBPluginDependency - 207.IBPluginDependency - 208.IBPluginDependency - 209.IBPluginDependency - 210.IBPluginDependency - 211.IBPluginDependency - 212.IBPluginDependency - 213.IBPluginDependency - 214.IBPluginDependency - 215.IBPluginDependency - 216.IBPluginDependency - 217.IBPluginDependency - 218.IBPluginDependency - 219.IBPluginDependency - 220.IBPluginDependency - 221.IBPluginDependency - 23.IBPluginDependency - 236.IBPluginDependency - 239.IBPluginDependency - 24.IBPluginDependency - 29.IBPluginDependency - 295.IBPluginDependency - 296.IBPluginDependency - 297.IBPluginDependency - 298.IBPluginDependency - 346.IBPluginDependency - 348.IBPluginDependency - 349.IBPluginDependency - 350.IBPluginDependency - 351.IBPluginDependency - 354.IBPluginDependency - 371.IBPluginDependency - 373.IBPluginDependency - 374.IBPluginDependency - 375.IBPluginDependency - 376.IBPluginDependency - 377.IBPluginDependency - 378.IBPluginDependency - 379.IBPluginDependency - 380.IBPluginDependency - 381.IBPluginDependency - 382.IBPluginDependency - 383.IBPluginDependency - 384.IBPluginDependency - 385.IBPluginDependency - 386.IBPluginDependency - 387.IBPluginDependency - 388.IBPluginDependency - 389.IBPluginDependency - 390.IBPluginDependency - 391.IBPluginDependency - 392.IBPluginDependency - 393.IBPluginDependency - 394.IBPluginDependency - 395.IBPluginDependency - 396.IBPluginDependency - 397.IBPluginDependency - 398.IBPluginDependency - 399.IBPluginDependency - 400.IBPluginDependency - 401.IBPluginDependency - 402.IBPluginDependency - 403.IBPluginDependency - 404.IBPluginDependency - 405.IBPluginDependency - 406.IBPluginDependency - 407.IBPluginDependency - 408.IBPluginDependency - 409.IBPluginDependency - 410.IBPluginDependency - 411.IBPluginDependency - 412.IBPluginDependency - 413.IBPluginDependency - 414.IBPluginDependency - 415.IBPluginDependency - 416.IBPluginDependency - 417.IBPluginDependency - 446.IBPluginDependency - 446.IBWindowTemplateEditedContentRect - 446.NSWindowTemplate.visibleAtLaunch - 447.IBPluginDependency - 5.IBPluginDependency - 506.IBPluginDependency - 507.IBPluginDependency - 510.IBPluginDependency - 512.IBPluginDependency - 513.IBPluginDependency - 514.IBPluginDependency - 519.IBPluginDependency - 520.IBPluginDependency - 56.IBPluginDependency - 57.IBPluginDependency - 58.IBPluginDependency - 72.IBPluginDependency - 73.IBPluginDependency - 74.IBPluginDependency - 75.IBPluginDependency - 77.IBPluginDependency - 78.IBPluginDependency - 79.IBPluginDependency - 80.IBPluginDependency - 81.IBPluginDependency - 82.IBPluginDependency - 83.IBPluginDependency - 92.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{78, 234}, {912, 526}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 521 - - - - YES - - CPTGraphHostingView - NSView - - IBProjectSource - ./Classes/CPTGraphHostingView.h - - - - Controller - NSObject - - hostView - CPTLayerHostingView - - - hostView - - hostView - CPTLayerHostingView - - - - IBProjectSource - ./Classes/Controller.h - - - - FirstResponder - - exportToPDF: - id - - - exportToPDF: - - exportToPDF: - id - - - - IBUserSource - - - - - NSDocument - - YES - - YES - printDocument: - revertDocumentToSaved: - runPageLayout: - saveDocument: - saveDocumentAs: - saveDocumentTo: - - - YES - id - id - id - id - id - id - - - - YES - - YES - printDocument: - revertDocumentToSaved: - runPageLayout: - saveDocument: - saveDocumentAs: - saveDocumentTo: - - - YES - - printDocument: - id - - - revertDocumentToSaved: - id - - - runPageLayout: - id - - - saveDocument: - id - - - saveDocumentAs: - id - - - saveDocumentTo: - id - - - - - IBProjectSource - ./Classes/NSDocument.h - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {9, 8} - {7, 2} - - - - diff --git a/examples/RangePlot/Info.plist b/examples/RangePlot/Base.lproj/Info.plist similarity index 100% rename from examples/RangePlot/Info.plist rename to examples/RangePlot/Base.lproj/Info.plist diff --git a/examples/RangePlot/Base.lproj/RangePlot.xib b/examples/RangePlot/Base.lproj/RangePlot.xib new file mode 100644 index 000000000..6787210bb --- /dev/null +++ b/examples/RangePlot/Base.lproj/RangePlot.xib @@ -0,0 +1,554 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/RangePlot/Controller.m b/examples/RangePlot/Controller.m index e0ceb0e64..bf6741983 100644 --- a/examples/RangePlot/Controller.m +++ b/examples/RangePlot/Controller.m @@ -3,11 +3,11 @@ @interface Controller() -@property (nonatomic, readwrite, strong) IBOutlet CPTGraphHostingView *hostView; -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; -@property (nonatomic, readwrite, strong) NSArray *plotData; -@property (nonatomic, readwrite, strong) CPTFill *areaFill; -@property (nonatomic, readwrite, strong) CPTLineStyle *barLineStyle; +@property (nonatomic, readwrite, strong, nullable) IBOutlet CPTGraphHostingView *hostView; +@property (nonatomic, readwrite, strong, nonnull) CPTXYGraph *graph; +@property (nonatomic, readwrite, strong, nonnull) NSArray *plotData; +@property (nonatomic, readwrite, strong, nonnull) CPTFill *areaFill; +@property (nonatomic, readwrite, strong, nonnull) CPTLineStyle *barLineStyle; @end @@ -53,15 +53,15 @@ -(void)awakeFromNib // Setup scatter plot space CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)newGraph.defaultPlotSpace; NSTimeInterval xLow = oneDay * 0.5; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(xLow) length:CPTDecimalFromDouble(oneDay * 5.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) length:CPTDecimalFromDouble(3.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(xLow) length:@(oneDay * 5.0)]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@3.0]; // Axes CPTXYAxisSet *axisSet = (CPTXYAxisSet *)newGraph.axisSet; CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(oneDay); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(2.0); - x.minorTicksPerInterval = 0; + x.majorIntervalLength = @(oneDay); + x.orthogonalPosition = @2.0; + x.minorTicksPerInterval = 0; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.dateStyle = kCFDateFormatterShortStyle; CPTTimeFormatter *timeFormatter = [[CPTTimeFormatter alloc] initWithDateFormatter:dateFormatter]; @@ -69,9 +69,9 @@ -(void)awakeFromNib x.labelFormatter = timeFormatter; CPTXYAxis *y = axisSet.yAxis; - y.majorIntervalLength = CPTDecimalFromDouble(0.5); - y.minorTicksPerInterval = 5; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(oneDay); + y.majorIntervalLength = @0.5; + y.minorTicksPerInterval = 5; + y.orthogonalPosition = @(oneDay); // Create a plot that uses the data source method CPTRangePlot *dataSourceLinePlot = [[CPTRangePlot alloc] init]; @@ -99,7 +99,7 @@ -(void)awakeFromNib self.areaFill = [[CPTFill alloc] initWithColor:transparentGreen]; // Add some data - NSMutableArray *newData = [NSMutableArray array]; + NSMutableArray *newData = [NSMutableArray array]; for ( NSUInteger i = 0; i < 5; i++ ) { NSTimeInterval xVal = oneDay * (i + 1.0); @@ -124,17 +124,17 @@ -(void)awakeFromNib #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.plotData.count; } --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index +-(nullable id)numberForPlot:(nonnull CPTPlot *__unused)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { return self.plotData[index][@(fieldEnum)]; } --(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(id)event atPoint:(CGPoint)point +-(BOOL)plotSpace:(nonnull CPTPlotSpace *__unused)space shouldHandlePointingDeviceUpEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint __unused)point { CPTRangePlot *rangePlot = (CPTRangePlot *)[self.graph plotWithIdentifier:@"Date Plot"]; diff --git a/examples/RangePlot/RangePlot.xcodeproj/project.pbxproj b/examples/RangePlot/RangePlot.xcodeproj/project.pbxproj index 66f5153fe..53802d311 100644 --- a/examples/RangePlot/RangePlot.xcodeproj/project.pbxproj +++ b/examples/RangePlot/RangePlot.xcodeproj/project.pbxproj @@ -3,19 +3,18 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 47; objects = { /* Begin PBXBuildFile section */ - 071BCBD71079EBE00045E43D /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 071BCBD61079EBE00045E43D /* CorePlot.framework */; }; 076185040F3CB17800A89A76 /* CorePlot.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 076184C10F3CAD5900A89A76 /* CorePlot.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 0761850B0F3CB1E800A89A76 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 076184C10F3CAD5900A89A76 /* CorePlot.framework */; }; 077382B10F3DC1FB002F10E2 /* Controller.m in Sources */ = {isa = PBXBuildFile; fileRef = 077382B00F3DC1FB002F10E2 /* Controller.m */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - 90AF4F440F36CF1800753D26 /* RangePlot.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90AF4F430F36CF1800753D26 /* RangePlot.xib */; }; BC8E737D0FC0B3CF00DF8511 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8E737C0FC0B3CF00DF8511 /* QuartzCore.framework */; }; + C3D0A17B20E0179100BA2921 /* RangePlot.xib in Resources */ = {isa = PBXBuildFile; fileRef = C3D0A17D20E0179100BA2921 /* RangePlot.xib */; }; C3D3938219FD786F00148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3938119FD786F00148319 /* Images.xcassets */; }; /* End PBXBuildFile section */ @@ -41,6 +40,48 @@ remoteGlobalIDString = 0730F600109492D800E95162; remoteInfo = UnitTests; }; + C310CE871C0A3DF700C4FCB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6921BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; + C310CE891C0A3DF700C4FCB4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C37EA6B71BC83F2D0091C8F7; + remoteInfo = "UnitTests tvOS"; + }; + C3B345C71B46195900844218 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09781A46185200D45436; + remoteInfo = CorePlot_iOS; + }; + C3B345C91B46195900844218 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09821A46185300D45436; + remoteInfo = CorePlot_iOSTests; + }; + C3B345CB1B46195900844218 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09BA1A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouch"; + }; + C3B345CD1B46195900844218 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 076184BC0F3CAD5900A89A76 /* CorePlot.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = C38A09C41A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouchTests"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -63,18 +104,18 @@ 0761854B0F3CB3CB00A89A76 /* CorePlot.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = CorePlot.framework; path = ../../../../framework/build/Debug/CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 077382AF0F3DC1FB002F10E2 /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Controller.h; sourceTree = ""; }; 077382B00F3DC1FB002F10E2 /* Controller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Controller.m; sourceTree = ""; }; - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Source/main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* RangePlot_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RangePlot_Prefix.pch; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* RangePlot.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RangePlot.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 90AF4F430F36CF1800753D26 /* RangePlot.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RangePlot.xib; sourceTree = ""; }; BC8E737C0FC0B3CF00DF8511 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - C37FFB6019E1EEB6003F34C5 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3564CBC22A2D0E1000A54C9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + C37A40C420E0318900C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = Base.lproj/Info.plist; sourceTree = ""; }; + C37FFB6019E1EEB6003F34C5 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3D0A18A20E0179F00BA2921 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/RangePlot.xib; sourceTree = ""; }; C3D3938119FD786F00148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RangePlot/Images.xcassets; sourceTree = ""; }; /* End PBXFileReference section */ @@ -86,7 +127,6 @@ 0761850B0F3CB1E800A89A76 /* CorePlot.framework in Frameworks */, 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, BC8E737D0FC0B3CF00DF8511 /* QuartzCore.framework in Frameworks */, - 071BCBD71079EBE00045E43D /* CorePlot.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -98,6 +138,12 @@ children = ( 076184C10F3CAD5900A89A76 /* CorePlot.framework */, 07E0DF80109C4E9500F108D2 /* UnitTests.xctest */, + C3B345C81B46195900844218 /* CorePlot.framework */, + C3B345CA1B46195900844218 /* UnitTests iOS.xctest */, + C3B345CC1B46195900844218 /* libCorePlot-CocoaTouch.a */, + C3B345CE1B46195900844218 /* CorePlot-CocoaTouchTests.xctest */, + C310CE881C0A3DF700C4FCB4 /* CorePlot.framework */, + C310CE8A1C0A3DF700C4FCB4 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -170,8 +216,8 @@ isa = PBXGroup; children = ( C3D3938119FD786F00148319 /* Images.xcassets */, - 90AF4F430F36CF1800753D26 /* RangePlot.xib */, - 8D1107310486CEB800E47090 /* Info.plist */, + C3D0A17D20E0179100BA2921 /* RangePlot.xib */, + C37A40C520E0318900C4FF48 /* Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, ); name = Resources; @@ -216,17 +262,18 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = NO; - LastUpgradeCheck = 0600; + LastUpgradeCheck = 1100; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "RangePlot" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + en, + de, + fr, + ja, ); mainGroup = 29B97314FDCFA39411CA2CEA /* CPTTestApp */; projectDirPath = ""; @@ -258,6 +305,48 @@ remoteRef = 07E0DF7F109C4E9500F108D2 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + C310CE881C0A3DF700C4FCB4 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C310CE871C0A3DF700C4FCB4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C310CE8A1C0A3DF700C4FCB4 /* UnitTests tvOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests tvOS.xctest"; + remoteRef = C310CE891C0A3DF700C4FCB4 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B345C81B46195900844218 /* CorePlot.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = CorePlot.framework; + remoteRef = C3B345C71B46195900844218 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B345CA1B46195900844218 /* UnitTests iOS.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "UnitTests iOS.xctest"; + remoteRef = C3B345C91B46195900844218 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B345CC1B46195900844218 /* libCorePlot-CocoaTouch.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libCorePlot-CocoaTouch.a"; + remoteRef = C3B345CB1B46195900844218 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C3B345CE1B46195900844218 /* CorePlot-CocoaTouchTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = "CorePlot-CocoaTouchTests.xctest"; + remoteRef = C3B345CD1B46195900844218 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -267,7 +356,7 @@ files = ( 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, C3D3938219FD786F00148319 /* Images.xcassets in Resources */, - 90AF4F440F36CF1800753D26 /* RangePlot.xib in Resources */, + C3D0A17B20E0179100BA2921 /* RangePlot.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -297,31 +386,48 @@ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 089C165DFE840E0CC02AAC07 /* English */, + C3564CBC22A2D0E1000A54C9 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; + C37A40C520E0318900C4FF48 /* Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A40C420E0318900C4FF48 /* Base */, + ); + name = Info.plist; + sourceTree = ""; + }; + C3D0A17D20E0179100BA2921 /* RangePlot.xib */ = { + isa = PBXVariantGroup; + children = ( + C3D0A18A20E0179F00BA2921 /* Base */, + ); + name = RangePlot.xib; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C37FFB6019E1EEB6003F34C5 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = RangePlot_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = RangePlot; }; @@ -329,18 +435,21 @@ }; C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C37FFB6019E1EEB6003F34C5 /* CorePlotWarnings.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_ARC = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = RangePlot_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ""; - INFOPLIST_FILE = Info.plist; + INFOPLIST_FILE = "$(SRCROOT)/Base.lproj/Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = RangePlot; }; @@ -350,12 +459,14 @@ isa = XCBuildConfiguration; baseConfigurationReference = C37FFB6019E1EEB6003F34C5 /* CorePlotWarnings.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + ENABLE_TESTABILITY = YES; + FRAMEWORK_SEARCH_PATHS = ""; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; SYMROOT = "$(SRCROOT)/../../build"; @@ -366,11 +477,12 @@ isa = XCBuildConfiguration; baseConfigurationReference = C37FFB6019E1EEB6003F34C5 /* CorePlotWarnings.xcconfig */; buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; GCC_C_LANGUAGE_STANDARD = c99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = s; GCC_PREPROCESSOR_DEFINITIONS = ""; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; + MACOSX_DEPLOYMENT_TARGET = 10.8; SDKROOT = macosx; SYMROOT = "$(SRCROOT)/../../build"; }; diff --git a/examples/RangePlot/RangePlot.xcodeproj/xcshareddata/xcschemes/RangePlot.xcscheme b/examples/RangePlot/RangePlot.xcodeproj/xcshareddata/xcschemes/RangePlot.xcscheme new file mode 100644 index 000000000..ecd1f2065 --- /dev/null +++ b/examples/RangePlot/RangePlot.xcodeproj/xcshareddata/xcschemes/RangePlot.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/RangePlot/RangePlot.xib b/examples/RangePlot/RangePlot.xib deleted file mode 100644 index 0e300bd10..000000000 --- a/examples/RangePlot/RangePlot.xib +++ /dev/null @@ -1,3005 +0,0 @@ - - - - 1050 - 11B26 - 1617 - 1138 - 566.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 1617 - - - YES - NSCustomView - NSWindowTemplate - NSView - NSMenu - NSMenuItem - NSCustomObject - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - YES - - - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - NSFontManager - - - AMainMenu - - YES - - - DatePlot - - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - DatePlot - - YES - - - About DatePlot - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Preferences… - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Services - - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 2147483647 - - - - - - Hide DatePlot - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Quit DatePlot - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - File - - 2147483647 - - - submenuAction: - - File - - YES - - - New - n - 1048576 - 2147483647 - - - - - - Open… - o - 1048576 - 2147483647 - - - - - - Open Recent - - 2147483647 - - - submenuAction: - - Open Recent - - YES - - - Clear Menu - - 2147483647 - - - - - _NSRecentDocumentsMenu - - - - - YES - YES - - - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - Save - s - 1048576 - 2147483647 - - - - - - Save As… - S - 1179648 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Export to PDF... - - 2147483647 - - - - - - Export to PNG... - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - Print… - p - 1048576 - 2147483647 - - - - - - - - - Edit - - 2147483647 - - - submenuAction: - - Edit - - YES - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1179648 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Delete - - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Find - - 2147483647 - - - submenuAction: - - Find - - YES - - - Find… - f - 1048576 - 2147483647 - - - 1 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1179648 - 2147483647 - - - 3 - - - - Use Selection for Find - e - 1048576 - 2147483647 - - - 7 - - - - Jump to Selection - j - 1048576 - 2147483647 - - - - - - - - - Spelling and Grammar - - 2147483647 - - - submenuAction: - - Spelling and Grammar - - YES - - - Show Spelling… - : - 1048576 - 2147483647 - - - - - - Check Spelling - ; - 1048576 - 2147483647 - - - - - - Check Spelling While Typing - - 2147483647 - - - - - - Check Grammar With Spelling - - 2147483647 - - - - - - - - - Substitutions - - 2147483647 - - - submenuAction: - - Substitutions - - YES - - - Smart Copy/Paste - f - 1048576 - 2147483647 - - - 1 - - - - Smart Quotes - g - 1048576 - 2147483647 - - - 2 - - - - Smart Links - G - 1179648 - 2147483647 - - - 3 - - - - - - - Speech - - 2147483647 - - - submenuAction: - - Speech - - YES - - - Start Speaking - - 2147483647 - - - - - - Stop Speaking - - 2147483647 - - - - - - - - - - - - Format - - 2147483647 - - - submenuAction: - - Format - - YES - - - Font - - 2147483647 - - - submenuAction: - - Font - - YES - - - Show Fonts - t - 1048576 - 2147483647 - - - - - - Bold - b - 1048576 - 2147483647 - - - 2 - - - - Italic - i - 1048576 - 2147483647 - - - 1 - - - - Underline - u - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bigger - + - 1048576 - 2147483647 - - - 3 - - - - Smaller - - - 1048576 - 2147483647 - - - 4 - - - - YES - YES - - - 2147483647 - - - - - - Kern - - 2147483647 - - - submenuAction: - - Kern - - YES - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Tighten - - 2147483647 - - - - - - Loosen - - 2147483647 - - - - - - - - - Ligature - - 2147483647 - - - submenuAction: - - Ligature - - YES - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Use All - - 2147483647 - - - - - - - - - Baseline - - 2147483647 - - - submenuAction: - - Baseline - - YES - - - Use Default - - 2147483647 - - - - - - Superscript - - 2147483647 - - - - - - Subscript - - 2147483647 - - - - - - Raise - - 2147483647 - - - - - - Lower - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Colors - C - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Copy Style - c - 1572864 - 2147483647 - - - - - - Paste Style - v - 1572864 - 2147483647 - - - - - _NSFontMenu - - - - - Text - - 2147483647 - - - submenuAction: - - Text - - YES - - - Align Left - { - 1048576 - 2147483647 - - - - - - Center - | - 1048576 - 2147483647 - - - - - - Justify - - 2147483647 - - - - - - Align Right - } - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Show Ruler - - 2147483647 - - - - - - Copy Ruler - c - 1310720 - 2147483647 - - - - - - Paste Ruler - v - 1310720 - 2147483647 - - - - - - - - - - - - View - - 2147483647 - - - submenuAction: - - View - - YES - - - Show Toolbar - t - 1572864 - 2147483647 - - - - - - Customize Toolbar… - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Explode Layers - e - 1572864 - 2147483647 - - - - - - Reassemble Layers - r - 1572864 - 2147483647 - - - - - - - - - Window - - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bring All to Front - - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - YES - - - DatePlot Help - ? - 1048576 - 2147483647 - - - - - - - - _NSMainMenu - - - 13 - 2 - {{68, 396}, {912, 526}} - 603979776 - Window - NSWindow - - - {450, 250} - - - 256 - - YES - - - 274 - {912, 526} - - - CPTGraphHostingView - - - {912, 526} - - - - {{0, 0}, {1680, 1028}} - {450, 272} - {10000000000000, 10000000000000} - YES - - - Controller - - - - - YES - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - print: - - - - 86 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - performClose: - - - - 193 - - - - toggleContinuousSpellChecking: - - - - 222 - - - - undo: - - - - 223 - - - - copy: - - - - 224 - - - - checkSpelling: - - - - 225 - - - - paste: - - - - 226 - - - - stopSpeaking: - - - - 227 - - - - cut: - - - - 228 - - - - showGuessPanel: - - - - 230 - - - - redo: - - - - 231 - - - - selectAll: - - - - 232 - - - - startSpeaking: - - - - 233 - - - - delete: - - - - 235 - - - - performZoom: - - - - 240 - - - - performFindPanelAction: - - - - 241 - - - - centerSelectionInVisibleArea: - - - - 245 - - - - toggleGrammarChecking: - - - - 347 - - - - toggleSmartInsertDelete: - - - - 355 - - - - toggleAutomaticQuoteSubstitution: - - - - 356 - - - - toggleAutomaticLinkDetection: - - - - 357 - - - - showHelp: - - - - 360 - - - - saveDocument: - - - - 362 - - - - saveDocumentAs: - - - - 363 - - - - revertDocumentToSaved: - - - - 364 - - - - runToolbarCustomizationPalette: - - - - 365 - - - - toggleToolbarShown: - - - - 366 - - - - hide: - - - - 367 - - - - hideOtherApplications: - - - - 368 - - - - terminate: - - - - 369 - - - - unhideAllApplications: - - - - 370 - - - - addFontTrait: - - - - 418 - - - - addFontTrait: - - - - 419 - - - - modifyFont: - - - - 420 - - - - orderFrontFontPanel: - - - - 421 - - - - modifyFont: - - - - 422 - - - - raiseBaseline: - - - - 423 - - - - lowerBaseline: - - - - 424 - - - - copyFont: - - - - 425 - - - - subscript: - - - - 426 - - - - superscript: - - - - 427 - - - - tightenKerning: - - - - 428 - - - - underline: - - - - 429 - - - - orderFrontColorPanel: - - - - 430 - - - - useAllLigatures: - - - - 431 - - - - loosenKerning: - - - - 432 - - - - pasteFont: - - - - 433 - - - - unscript: - - - - 434 - - - - useStandardKerning: - - - - 435 - - - - useStandardLigatures: - - - - 436 - - - - turnOffLigatures: - - - - 437 - - - - turnOffKerning: - - - - 438 - - - - alignLeft: - - - - 439 - - - - alignJustified: - - - - 440 - - - - copyRuler: - - - - 441 - - - - alignCenter: - - - - 442 - - - - toggleRuler: - - - - 443 - - - - alignRight: - - - - 444 - - - - pasteRuler: - - - - 445 - - - - hostView - - - - 521 - - - - - YES - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - - MainMenu - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 103 - - - YES - - - - 1 - - - 217 - - - YES - - - - - - 83 - - - YES - - - - - - 81 - - - YES - - - - - - - - - - - - - - - - - - - 75 - - - 3 - - - 80 - - - 8 - - - 78 - - - 6 - - - 72 - - - - - 82 - - - 9 - - - 124 - - - YES - - - - - - 77 - - - 5 - - - 73 - - - 1 - - - 79 - - - 7 - - - 112 - - - 10 - - - 74 - - - 2 - - - 125 - - - YES - - - - - - 126 - - - - - 205 - - - YES - - - - - - - - - - - - - - - - - - 202 - - - - - 198 - - - - - 207 - - - - - 214 - - - - - 199 - - - - - 203 - - - - - 197 - - - - - 206 - - - - - 215 - - - - - 218 - - - YES - - - - - - 216 - - - YES - - - - - - 200 - - - YES - - - - - - - - - 219 - - - - - 201 - - - - - 204 - - - - - 220 - - - YES - - - - - - - - - - 213 - - - - - 210 - - - - - 221 - - - - - 208 - - - - - 209 - - - - - 106 - - - YES - - - - 2 - - - 111 - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - 1111 - - - 144 - - - - - 129 - - - 121 - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - - - - - 297 - - - - - 298 - - - - - 211 - - - YES - - - - - - 212 - - - YES - - - - - - - 195 - - - - - 196 - - - - - 346 - - - - - 348 - - - YES - - - - - - 349 - - - YES - - - - - - - - 350 - - - - - 351 - - - - - 354 - - - - - 371 - - - - - 373 - - - YES - - - - - - 374 - - - YES - - - - - - - 375 - - - YES - - - - - - 376 - - - YES - - - - - - 377 - - - YES - - - - - - - - - - - - - 378 - - - - - 379 - - - - - 380 - - - - - 381 - - - - - 382 - - - - - 383 - - - - - 384 - - - - - 385 - - - - - 386 - - - YES - - - - - - - - - - - - - - - - - - - - - 387 - - - - - 388 - - - - - 389 - - - - - 390 - - - - - 391 - - - - - 392 - - - - - 393 - - - - - 394 - - - - - 395 - - - YES - - - - - - 396 - - - YES - - - - - - 397 - - - YES - - - - - - 398 - - - - - 399 - - - - - 400 - - - - - 401 - - - - - 402 - - - - - 403 - - - YES - - - - - - - - - - 404 - - - - - 405 - - - - - 406 - - - - - 407 - - - - - 408 - - - - - 409 - - - YES - - - - - - - - 410 - - - - - 411 - - - - - 412 - - - - - 413 - - - YES - - - - - - - - - 414 - - - - - 415 - - - - - 416 - - - - - 417 - - - - - 446 - - - YES - - - - - - 447 - - - YES - - - - - - 506 - - - 10 - - - 507 - - - 2 - - - 510 - - - 10 - - - 512 - - - - - 513 - - - - - 514 - - - - - 519 - - - - - 520 - - - Controller - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 103.IBPluginDependency - 106.IBPluginDependency - 111.IBPluginDependency - 112.IBPluginDependency - 124.IBPluginDependency - 125.IBPluginDependency - 126.IBPluginDependency - 129.IBPluginDependency - 130.IBPluginDependency - 131.IBPluginDependency - 134.IBPluginDependency - 136.IBPluginDependency - 143.IBPluginDependency - 144.IBPluginDependency - 145.IBPluginDependency - 149.IBPluginDependency - 150.IBPluginDependency - 19.IBPluginDependency - 195.IBPluginDependency - 196.IBPluginDependency - 197.IBPluginDependency - 198.IBPluginDependency - 199.IBPluginDependency - 200.IBPluginDependency - 201.IBPluginDependency - 202.IBPluginDependency - 203.IBPluginDependency - 204.IBPluginDependency - 205.IBPluginDependency - 206.IBPluginDependency - 207.IBPluginDependency - 208.IBPluginDependency - 209.IBPluginDependency - 210.IBPluginDependency - 211.IBPluginDependency - 212.IBPluginDependency - 213.IBPluginDependency - 214.IBPluginDependency - 215.IBPluginDependency - 216.IBPluginDependency - 217.IBPluginDependency - 218.IBPluginDependency - 219.IBPluginDependency - 220.IBPluginDependency - 221.IBPluginDependency - 23.IBPluginDependency - 236.IBPluginDependency - 239.IBPluginDependency - 24.IBPluginDependency - 29.IBPluginDependency - 295.IBPluginDependency - 296.IBPluginDependency - 297.IBPluginDependency - 298.IBPluginDependency - 346.IBPluginDependency - 348.IBPluginDependency - 349.IBPluginDependency - 350.IBPluginDependency - 351.IBPluginDependency - 354.IBPluginDependency - 371.IBPluginDependency - 373.IBPluginDependency - 374.IBPluginDependency - 375.IBPluginDependency - 376.IBPluginDependency - 377.IBPluginDependency - 378.IBPluginDependency - 379.IBPluginDependency - 380.IBPluginDependency - 381.IBPluginDependency - 382.IBPluginDependency - 383.IBPluginDependency - 384.IBPluginDependency - 385.IBPluginDependency - 386.IBPluginDependency - 387.IBPluginDependency - 388.IBPluginDependency - 389.IBPluginDependency - 390.IBPluginDependency - 391.IBPluginDependency - 392.IBPluginDependency - 393.IBPluginDependency - 394.IBPluginDependency - 395.IBPluginDependency - 396.IBPluginDependency - 397.IBPluginDependency - 398.IBPluginDependency - 399.IBPluginDependency - 400.IBPluginDependency - 401.IBPluginDependency - 402.IBPluginDependency - 403.IBPluginDependency - 404.IBPluginDependency - 405.IBPluginDependency - 406.IBPluginDependency - 407.IBPluginDependency - 408.IBPluginDependency - 409.IBPluginDependency - 410.IBPluginDependency - 411.IBPluginDependency - 412.IBPluginDependency - 413.IBPluginDependency - 414.IBPluginDependency - 415.IBPluginDependency - 416.IBPluginDependency - 417.IBPluginDependency - 446.IBPluginDependency - 446.IBWindowTemplateEditedContentRect - 446.NSWindowTemplate.visibleAtLaunch - 447.IBPluginDependency - 5.IBPluginDependency - 506.IBPluginDependency - 507.IBPluginDependency - 510.IBPluginDependency - 512.IBPluginDependency - 513.IBPluginDependency - 514.IBPluginDependency - 519.IBPluginDependency - 520.IBPluginDependency - 56.IBPluginDependency - 57.IBPluginDependency - 58.IBPluginDependency - 72.IBPluginDependency - 73.IBPluginDependency - 74.IBPluginDependency - 75.IBPluginDependency - 77.IBPluginDependency - 78.IBPluginDependency - 79.IBPluginDependency - 80.IBPluginDependency - 81.IBPluginDependency - 82.IBPluginDependency - 83.IBPluginDependency - 92.IBPluginDependency - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{78, 234}, {912, 526}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - YES - - - - - - YES - - - - - 521 - - - - YES - - FirstResponder - - exportToPDF: - id - - - exportToPDF: - - exportToPDF: - id - - - - IBUserSource - - - - - - 0 - IBCocoaFramework - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.macosx - - - - com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 - - - YES - 3 - - YES - - YES - NSMenuCheckmark - NSMenuMixedState - - - YES - {9, 8} - {7, 2} - - - - diff --git a/examples/RangePlot/Source/main.m b/examples/RangePlot/Source/main.m index 50ab6acfb..c8341df20 100644 --- a/examples/RangePlot/Source/main.m +++ b/examples/RangePlot/Source/main.m @@ -1,9 +1,9 @@ // -// main.m -// CPTTestApp +// main.m +// CPTTestApp // -// Created by Dirkjan Krijnders on 2/2/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. +// Created by Dirkjan Krijnders on 2/2/09. +// Copyright __MyCompanyName__ 2009. All rights reserved. // #import diff --git a/examples/RangePlot/English.lproj/InfoPlist.strings b/examples/RangePlot/en.lproj/InfoPlist.strings similarity index 100% rename from examples/RangePlot/English.lproj/InfoPlist.strings rename to examples/RangePlot/en.lproj/InfoPlist.strings diff --git a/examples/StockPlot/AAPL.plist b/examples/StockPlot/AAPL.plist deleted file mode 100644 index 717591046..000000000 --- a/examples/StockPlot/AAPL.plist +++ /dev/null @@ -1,1107 +0,0 @@ - - - - - endDate - 2009-06-19T06:53:47Z - financialData - - - adjClose - 135.88 - close - 135.88 - date - 2009-06-18T04:00:00Z - high - 138 - low - 135.59 - open - 136.11 - volume - 15237600 - - - adjClose - 135.58 - close - 135.58 - date - 2009-06-17T04:00:00Z - high - 137.45 - low - 134.53 - open - 136.67 - volume - 20377100 - - - adjClose - 136.35 - close - 136.35 - date - 2009-06-16T04:00:00Z - high - 138.47 - low - 136.1 - open - 136.66 - volume - 18255100 - - - adjClose - 136.09 - close - 136.09 - date - 2009-06-15T04:00:00Z - high - 136.93 - low - 134.89 - open - 136.01 - volume - 19276800 - - - adjClose - 136.97 - close - 136.97 - date - 2009-06-12T04:00:00Z - high - 139.1 - low - 136.04 - open - 138.81 - volume - 20098500 - - - adjClose - 139.95 - close - 139.95 - date - 2009-06-11T04:00:00Z - high - 141.56 - low - 138.55 - open - 139.55 - volume - 18719300 - - - adjClose - 140.25 - close - 140.25 - date - 2009-06-10T04:00:00Z - high - 142.35 - low - 138.3 - open - 142.28 - volume - 24593700 - - - adjClose - 142.72 - close - 142.72 - date - 2009-06-09T04:00:00Z - high - 144.56 - low - 140.55 - open - 143.81 - volume - 24152500 - - - adjClose - 143.85 - close - 143.85 - date - 2009-06-08T04:00:00Z - high - 144.23 - low - 139.43 - open - 143.82 - volume - 33255400 - - - adjClose - 144.67 - close - 144.67 - date - 2009-06-05T04:00:00Z - high - 146.4 - low - 143.21 - open - 145.31 - volume - 22585700 - - - adjClose - 143.74 - close - 143.74 - date - 2009-06-04T04:00:00Z - high - 144.18 - low - 140.04 - open - 140.13 - volume - 19537200 - - - adjClose - 140.95 - close - 140.95 - date - 2009-06-03T04:00:00Z - high - 141.11 - low - 139.07 - open - 140 - volume - 20171800 - - - adjClose - 139.49 - close - 139.49 - date - 2009-06-02T04:00:00Z - high - 141.34 - low - 138.35 - open - 138.99 - volume - 16199500 - - - adjClose - 139.35 - close - 139.35 - date - 2009-06-01T04:00:00Z - high - 139.99 - low - 136 - open - 136.47 - volume - 16160700 - - - adjClose - 135.81 - close - 135.81 - date - 2009-05-29T04:00:00Z - high - 135.9 - low - 133.85 - open - 135.39 - volume - 16304800 - - - adjClose - 135.07 - close - 135.07 - date - 2009-05-28T04:00:00Z - high - 135.39 - low - 132.03 - open - 133.45 - volume - 17397200 - - - adjClose - 133.05 - close - 133.05 - date - 2009-05-27T04:00:00Z - high - 134.98 - low - 130.91 - open - 131.78 - volume - 23086500 - - - adjClose - 130.78 - close - 130.78 - date - 2009-05-26T04:00:00Z - high - 130.83 - low - 124.55 - open - 124.76 - volume - 22692300 - - - adjClose - 122.5 - close - 122.5 - date - 2009-05-22T04:00:00Z - high - 124.18 - low - 121.75 - open - 124.05 - volume - 10642800 - - - adjClose - 124.18 - close - 124.18 - date - 2009-05-21T04:00:00Z - high - 126.78 - low - 122.89 - open - 125.15 - volume - 14569500 - - - adjClose - 125.87 - close - 125.87 - date - 2009-05-20T04:00:00Z - high - 129.21 - low - 125.3 - open - 127.63 - volume - 13878000 - - - adjClose - 127.45 - close - 127.45 - date - 2009-05-19T04:00:00Z - high - 129.31 - low - 125.74 - open - 126.82 - volume - 13300800 - - - adjClose - 126.65 - close - 126.65 - date - 2009-05-18T04:00:00Z - high - 126.7 - low - 121.57 - open - 123.73 - volume - 16387200 - - - adjClose - 122.42 - close - 122.42 - date - 2009-05-15T04:00:00Z - high - 124.62 - low - 121.61 - open - 122.32 - volume - 13127400 - - - adjClose - 122.95 - close - 122.95 - date - 2009-05-14T04:00:00Z - high - 123.53 - low - 119.7 - open - 119.78 - volume - 15993800 - - - adjClose - 119.49 - close - 119.49 - date - 2009-05-13T04:00:00Z - high - 124.02 - low - 119.38 - open - 123.21 - volume - 21284700 - - - adjClose - 124.42 - close - 124.42 - date - 2009-05-12T04:00:00Z - high - 129.71 - low - 123.25 - open - 129.56 - volume - 21767200 - - - adjClose - 129.57 - close - 129.57 - date - 2009-05-11T04:00:00Z - high - 130.96 - low - 127.12 - open - 127.37 - volume - 14452100 - - - adjClose - 129.19 - close - 129.19 - date - 2009-05-08T04:00:00Z - high - 131.23 - low - 126.26 - open - 129.04 - volume - 16713000 - - - adjClose - 129.06 - close - 129.06 - date - 2009-05-07T04:00:00Z - high - 132.39 - low - 127.9 - open - 132.33 - volume - 18992000 - - - adjClose - 132.5 - close - 132.5 - date - 2009-05-06T04:00:00Z - high - 133.5 - low - 130.22 - open - 133.33 - volume - 16912100 - - - adjClose - 132.71 - close - 132.71 - date - 2009-05-05T04:00:00Z - high - 132.86 - low - 131.12 - open - 131.75 - volume - 14223400 - - - adjClose - 132.07 - close - 132.07 - date - 2009-05-04T04:00:00Z - high - 132.25 - low - 127.68 - open - 128.24 - volume - 21762800 - - - adjClose - 127.24 - close - 127.24 - date - 2009-05-01T04:00:00Z - high - 127.95 - low - 125.8 - open - 125.8 - volume - 14197000 - - - adjClose - 125.83 - close - 125.83 - date - 2009-04-30T04:00:00Z - high - 127 - low - 124.92 - open - 126.22 - volume - 17803200 - - - adjClose - 125.14 - close - 125.14 - date - 2009-04-29T04:00:00Z - high - 126.85 - low - 123.83 - open - 124.85 - volume - 16361100 - - - adjClose - 123.9 - close - 123.9 - date - 2009-04-28T04:00:00Z - high - 126.21 - low - 123.26 - open - 123.35 - volume - 16280600 - - - adjClose - 124.73 - close - 124.73 - date - 2009-04-27T04:00:00Z - high - 125 - low - 122.66 - open - 122.9 - volume - 17167500 - - - adjClose - 123.9 - close - 123.9 - date - 2009-04-24T04:00:00Z - high - 125.14 - low - 122.97 - open - 124.64 - volume - 19313000 - - - adjClose - 125.4 - close - 125.4 - date - 2009-04-23T04:00:00Z - high - 127.2 - low - 123.51 - open - 126.62 - volume - 33755600 - - - adjClose - 121.51 - close - 121.51 - date - 2009-04-22T04:00:00Z - high - 125.35 - low - 121.2 - open - 122.63 - volume - 33527400 - - - adjClose - 121.76 - close - 121.76 - date - 2009-04-21T04:00:00Z - high - 122.14 - low - 118.6 - open - 118.89 - volume - 16810200 - - - adjClose - 120.5 - close - 120.5 - date - 2009-04-20T04:00:00Z - high - 122.99 - low - 119.16 - open - 121.73 - volume - 16659500 - - - adjClose - 123.42 - close - 123.42 - date - 2009-04-17T04:00:00Z - high - 124.25 - low - 120.25 - open - 121.18 - volume - 17767700 - - - adjClose - 121.45 - close - 121.45 - date - 2009-04-16T04:00:00Z - high - 123.15 - low - 118.79 - open - 119.19 - volume - 21194500 - - - adjClose - 117.64 - close - 117.64 - date - 2009-04-15T04:00:00Z - high - 118.25 - low - 115.76 - open - 117.2 - volume - 14745800 - - - adjClose - 118.31 - close - 118.31 - date - 2009-04-14T04:00:00Z - high - 120.17 - low - 117.25 - open - 119.57 - volume - 16236500 - - - adjClose - 120.22 - close - 120.22 - date - 2009-04-13T04:00:00Z - high - 120.98 - low - 119 - open - 120.01 - volume - 13901300 - - - adjClose - 119.57 - close - 119.57 - date - 2009-04-09T04:00:00Z - high - 120 - low - 117.96 - open - 118.42 - volume - 18955600 - - - adjClose - 116.32 - close - 116.32 - date - 2009-04-08T04:00:00Z - high - 116.79 - low - 114.58 - open - 115.43 - volume - 16272500 - - - adjClose - 115 - close - 115 - date - 2009-04-07T04:00:00Z - high - 116.67 - low - 114.19 - open - 116.53 - volume - 19163600 - - - adjClose - 118.45 - close - 118.45 - date - 2009-04-06T04:00:00Z - high - 118.75 - low - 113.28 - open - 114.94 - volume - 23502300 - - - adjClose - 115.99 - close - 115.99 - date - 2009-04-03T04:00:00Z - high - 116.13 - low - 113.52 - open - 114.19 - volume - 22722900 - - - adjClose - 112.71 - close - 112.71 - date - 2009-04-02T04:00:00Z - high - 114.75 - low - 109.78 - open - 110.14 - volume - 29013100 - - - adjClose - 108.69 - close - 108.69 - date - 2009-04-01T04:00:00Z - high - 109 - low - 103.89 - open - 104.09 - volume - 21049000 - - - adjClose - 105.12 - close - 105.12 - date - 2009-03-31T04:00:00Z - high - 107.45 - low - 105 - open - 105.45 - volume - 20338500 - - - adjClose - 104.49 - close - 104.49 - date - 2009-03-30T04:00:00Z - high - 105.01 - low - 102.61 - open - 104.51 - volume - 17957000 - - - adjClose - 106.85 - close - 106.85 - date - 2009-03-27T04:00:00Z - high - 108.53 - low - 106.4 - open - 108.23 - volume - 17602600 - - - adjClose - 109.87 - close - 109.87 - date - 2009-03-26T04:00:00Z - high - 109.98 - low - 107.58 - open - 107.83 - volume - 22009000 - - - adjClose - 106.49 - close - 106.49 - date - 2009-03-25T04:00:00Z - high - 108.36 - low - 103.86 - open - 107.58 - volume - 23093500 - - - adjClose - 106.5 - close - 106.5 - date - 2009-03-24T04:00:00Z - high - 109.44 - low - 105.39 - open - 106.36 - volume - 22879000 - - - adjClose - 107.66 - close - 107.66 - date - 2009-03-23T04:00:00Z - high - 108.16 - low - 101.75 - open - 102.71 - volume - 23799900 - - - adjClose - 101.59 - close - 101.59 - date - 2009-03-20T04:00:00Z - high - 103.11 - low - 100.57 - open - 102.09 - volume - 24842400 - - - adjClose - 101.62 - close - 101.62 - date - 2009-03-19T04:00:00Z - high - 103.2 - low - 100.25 - open - 101.85 - volume - 17863600 - - - adjClose - 101.52 - close - 101.52 - date - 2009-03-18T04:00:00Z - high - 103.48 - low - 99.72 - open - 99.91 - volume - 28429900 - - - adjClose - 99.66 - close - 99.66 - date - 2009-03-17T04:00:00Z - high - 99.69 - low - 95.07000000000001 - open - 95.23999999999999 - volume - 28094500 - - - adjClose - 95.42 - close - 95.42 - date - 2009-03-16T04:00:00Z - high - 97.39 - low - 94.17999999999999 - open - 96.53 - volume - 28473000 - - - adjClose - 95.92999999999999 - close - 95.92999999999999 - date - 2009-03-13T04:00:00Z - high - 97.2 - low - 95.01000000000001 - open - 96.3 - volume - 21470300 - - - overallHigh - 146.4 - overallLow - 94.17999999999999 - startDate - 2009-03-13T06:53:47Z - symbol - AAPL - - diff --git a/examples/StockPlot/Classes/APYahooDataPuller.h b/examples/StockPlot/Classes/APYahooDataPuller.h deleted file mode 100644 index 82c91b1ab..000000000 --- a/examples/StockPlot/Classes/APYahooDataPuller.h +++ /dev/null @@ -1,33 +0,0 @@ -#import - -@class APYahooDataPuller; - -@protocol APYahooDataPullerDelegate - -@optional - --(void)dataPullerFinancialDataDidChange:(APYahooDataPuller *)dp; --(void)dataPuller:(APYahooDataPuller *)dp downloadDidFailWithError:(NSError *)error; - -@end - -@interface APYahooDataPuller : NSObject - -@property (nonatomic, readwrite, weak) id delegate; -@property (nonatomic, readwrite, copy) NSString *symbol; -@property (nonatomic, readwrite, strong) NSDate *startDate; -@property (nonatomic, readwrite, strong) NSDate *endDate; -@property (nonatomic, readwrite, copy) NSString *targetSymbol; -@property (nonatomic, readwrite, strong) NSDate *targetStartDate; -@property (nonatomic, readwrite, strong) NSDate *targetEndDate; -@property (nonatomic, readonly, strong) NSArray *financialData; -@property (nonatomic, readonly, strong) NSDecimalNumber *overallHigh; -@property (nonatomic, readonly, strong) NSDecimalNumber *overallLow; -@property (nonatomic, readonly, assign) BOOL loadingData; -@property (nonatomic, readonly, assign) BOOL staleData; - --(instancetype)initWithTargetSymbol:(NSString *)aSymbol targetStartDate:(NSDate *)aStartDate targetEndDate:(NSDate *)anEndDate; --(void)fetchIfNeeded; --(void)cancelDownload; - -@end diff --git a/examples/StockPlot/Classes/APYahooDataPuller.m b/examples/StockPlot/Classes/APYahooDataPuller.m deleted file mode 100644 index 8d137d5e8..000000000 --- a/examples/StockPlot/Classes/APYahooDataPuller.m +++ /dev/null @@ -1,354 +0,0 @@ -#import "APYahooDataPuller.h" -#import "NSDictionary+APFinancialData.h" - -@interface APYahooDataPuller() - -@property (nonatomic, readwrite, copy) NSString *csvString; - -@property (nonatomic, readwrite, strong) NSDecimalNumber *overallHigh; -@property (nonatomic, readwrite, strong) NSDecimalNumber *overallLow; -@property (nonatomic, readwrite, strong) NSArray *financialData; - -@property (nonatomic, readwrite, assign) BOOL loadingData; -@property (nonatomic, readwrite, strong) NSMutableData *receivedData; -@property (nonatomic, readwrite, strong) NSURLConnection *connection; - -NSTimeInterval timeIntervalForNumberOfWeeks(double numberOfWeeks); - -@end - -#pragma mark - - -NSTimeInterval timeIntervalForNumberOfWeeks(double numberOfWeeks) -{ - NSTimeInterval seconds = fabs(60.0 * 60.0 * 24.0 * 7.0 * numberOfWeeks); - - return seconds; -} - -@implementation APYahooDataPuller - -@synthesize symbol; -@synthesize startDate; -@synthesize endDate; -@synthesize targetStartDate; -@synthesize targetEndDate; -@synthesize targetSymbol; -@synthesize overallLow; -@synthesize overallHigh; -@synthesize csvString; -@synthesize financialData; - -@synthesize receivedData; -@synthesize connection; -@synthesize loadingData; -@dynamic staleData; - -@synthesize delegate; - -//convert any NSNumber in financial line to NSDecimalNumber --(NSDictionary *)sanitizedFinancialLine:(NSDictionary *)theFinancialLine -{ - NSMutableDictionary *aFinancialLine = [NSMutableDictionary dictionaryWithDictionary:theFinancialLine]; - - for ( id key in [aFinancialLine allKeys] ) { - id something = aFinancialLine[key]; - if ( [something respondsToSelector:@selector(decimalValue)] ) { - something = [NSDecimalNumber decimalNumberWithDecimal:[(NSNumber *)something decimalValue]]; - aFinancialLine[key] = something; - } - } - return [NSDictionary dictionaryWithDictionary:aFinancialLine]; -} - --(void)setFinancialData:(NSArray *)aFinancialData -{ - //NSLog(@"in -setFinancialData:, old value of financialData: %@, changed to: %@", financialData, aFinancialData); - - if ( financialData != aFinancialData ) { - NSMutableArray *mutableFinancialData = [aFinancialData mutableCopy]; - NSDictionary *financialLine = nil; - NSUInteger i = 0, count = mutableFinancialData.count; - for ( i = 0; i < count; i++ ) { - financialLine = (NSDictionary *)mutableFinancialData[i]; - financialLine = [self sanitizedFinancialLine:financialLine]; - mutableFinancialData[i] = financialLine; - } - - financialData = [[NSArray alloc] initWithArray:mutableFinancialData]; - if ( 0 < financialData.count ) { - [self notifyFinancesChanged]; - } - } -} - --(NSDictionary *)plistRep -{ - NSMutableDictionary *rep = [NSMutableDictionary dictionaryWithCapacity:7]; - - rep[@"symbol"] = [self symbol]; - rep[@"startDate"] = [self startDate]; - rep[@"endDate"] = [self endDate]; - rep[@"overallHigh"] = [self overallHigh]; - rep[@"overallLow"] = [self overallLow]; - rep[@"financialData"] = [self financialData]; - return [NSDictionary dictionaryWithDictionary:rep]; -} - --(BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag -{ - NSLog(@"writeToFile:%@", path); - BOOL success = [[self plistRep] writeToFile:path atomically:flag]; - return success; -} - --(instancetype)initWithDictionary:(NSDictionary *)aDict targetSymbol:(NSString *)aSymbol targetStartDate:(NSDate *)aStartDate targetEndDate:(NSDate *)anEndDate -{ - self = [super init]; - if ( self != nil ) { - self.symbol = aDict[@"symbol"]; - self.startDate = aDict[@"startDate"]; - self.overallLow = [NSDecimalNumber decimalNumberWithDecimal:[aDict[@"overallLow"] decimalValue]]; - self.overallHigh = [NSDecimalNumber decimalNumberWithDecimal:[aDict[@"overallHigh"] decimalValue]]; - self.endDate = aDict[@"endDate"]; - self.financialData = aDict[@"financialData"]; - - self.targetSymbol = aSymbol; - self.targetStartDate = aStartDate; - self.targetEndDate = anEndDate; - } - return self; -} - --(NSString *)pathForSymbol:(NSString *)aSymbol -{ - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsDirectory = paths[0]; - NSString *docPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.plist", aSymbol]]; - - return docPath; -} - --(NSString *)faultTolerantPathForSymbol:(NSString *)aSymbol -{ - NSString *docPath = [self pathForSymbol:aSymbol]; - - if ( ![[NSFileManager defaultManager] fileExistsAtPath:docPath] ) { - //if there isn't one in the user's documents directory, see if we ship with this data - docPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.plist", aSymbol]]; - } - return docPath; -} - -//Always returns *something* --(NSDictionary *)dictionaryForSymbol:(NSString *)aSymbol -{ - NSString *path = [self faultTolerantPathForSymbol:aSymbol]; - NSMutableDictionary *localPlistDict = [NSMutableDictionary dictionaryWithContentsOfFile:path]; - - return localPlistDict; -} - --(instancetype)initWithTargetSymbol:(NSString *)aSymbol targetStartDate:(NSDate *)aStartDate targetEndDate:(NSDate *)anEndDate -{ - NSDictionary *cachedDictionary = [self dictionaryForSymbol:aSymbol]; - - if ( nil != cachedDictionary ) { - return [self initWithDictionary:cachedDictionary targetSymbol:aSymbol targetStartDate:aStartDate targetEndDate:anEndDate]; - } - - NSMutableDictionary *rep = [NSMutableDictionary dictionaryWithCapacity:7]; - rep[@"symbol"] = aSymbol; - rep[@"startDate"] = aStartDate; - rep[@"endDate"] = anEndDate; - rep[@"overallHigh"] = [NSDecimalNumber notANumber]; - rep[@"overallLow"] = [NSDecimalNumber notANumber]; - rep[@"financialData"] = @[]; - return [self initWithDictionary:rep targetSymbol:aSymbol targetStartDate:aStartDate targetEndDate:anEndDate]; -} - --(instancetype)init -{ - NSTimeInterval secondsAgo = -timeIntervalForNumberOfWeeks(14.0); //12 weeks ago - NSDate *start = [NSDate dateWithTimeIntervalSinceNow:secondsAgo]; - - NSDate *end = [NSDate date]; - - return [self initWithTargetSymbol:@"AAPL" targetStartDate:start targetEndDate:end]; -} - --(void)dealloc -{ - delegate = nil; -} - -// http://www.goldb.org/ystockquote.html --(NSString *)URL -{ - unsigned int unitFlags = NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitYear; - - NSCalendar *gregorian = [[NSCalendar alloc] - initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; - - NSDateComponents *compsStart = [gregorian components:unitFlags fromDate:self.targetStartDate]; - NSDateComponents *compsEnd = [gregorian components:unitFlags fromDate:self.targetEndDate]; - - NSString *url = [NSString stringWithFormat:@"http://ichart.yahoo.com/table.csv?s=%@&", [self targetSymbol]]; - - url = [url stringByAppendingFormat:@"a=%ld&", (long)[compsStart month] - 1]; - url = [url stringByAppendingFormat:@"b=%ld&", (long)[compsStart day]]; - url = [url stringByAppendingFormat:@"c=%ld&", (long)[compsStart year]]; - - url = [url stringByAppendingFormat:@"d=%ld&", (long)[compsEnd month] - 1]; - url = [url stringByAppendingFormat:@"e=%ld&", (long)[compsEnd day]]; - url = [url stringByAppendingFormat:@"f=%ld&", (long)[compsEnd year]]; - url = [url stringByAppendingString:@"g=d&"]; - - url = [url stringByAppendingString:@"ignore=.csv"]; - url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; - return url; -} - --(void)notifyFinancesChanged -{ - id theDelegate = self.delegate; - - if ( [theDelegate respondsToSelector:@selector(dataPullerFinancialDataDidChange:)] ) { - [theDelegate performSelector:@selector(dataPullerFinancialDataDidChange:) withObject:self]; - } -} - -#pragma mark - -#pragma mark Downloading of data - --(BOOL)staleData -{ - NSTimeInterval twelveHours = 60.0 * 60.0 * 12.0; - - return 0 >= self.financialData.count || - ![[self targetSymbol] isEqualToString:[self symbol]] || - [[self targetStartDate] timeIntervalSinceDate:[self startDate]] > twelveHours || - [[self targetEndDate] timeIntervalSinceDate:[self endDate]] > twelveHours; -} - --(void)fetchIfNeeded -{ - if ( self.loadingData ) { - return; - } - - //Check to see if cached data is stale - if ( self.staleData ) { - self.loadingData = YES; - NSString *urlString = [self URL]; - NSLog(@"Fetching URL %@", urlString); - NSURL *url = [NSURL URLWithString:urlString]; - NSURLRequest *theRequest = [NSURLRequest requestWithURL:url - cachePolicy:NSURLRequestUseProtocolCachePolicy - timeoutInterval:60.0]; - - // create the connection with the request - // and start loading the data - self.connection = [NSURLConnection connectionWithRequest:theRequest delegate:self]; - if ( self.connection ) { - self.receivedData = [NSMutableData data]; - } - else { - self.loadingData = NO; - } - } -} - --(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data -{ - // append the new data to the receivedData - [self.receivedData appendData:data]; -} - --(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response -{ - // this method is called when the server has determined that it - // has enough information to create the NSURLResponse - // it can be called multiple times, for example in the case of a - // redirect, so each time we reset the data. - [self.receivedData setLength:0]; -} - --(void)cancelDownload -{ - if ( self.loadingData ) { - [self.connection cancel]; - self.loadingData = NO; - - self.receivedData = nil; - self.connection = nil; - } -} - --(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error -{ - self.loadingData = NO; - self.receivedData = nil; - self.connection = nil; - NSLog(@"err = %@", [error localizedDescription]); - self.connection = nil; - - id theDelegate = self.delegate; - if ( [theDelegate respondsToSelector:@selector(dataPuller:downloadDidFailWithError:)] ) { - [theDelegate performSelector:@selector(dataPuller:downloadDidFailWithError:) withObject:self withObject:error]; - } -} - --(void)connectionDidFinishLoading:(NSURLConnection *)connection -{ - self.loadingData = NO; - self.connection = nil; - - NSString *csv = [[NSString alloc] initWithData:self.receivedData encoding:NSUTF8StringEncoding]; - [self populateWithString:csv]; - - self.receivedData = nil; - [self writeToFile:[self pathForSymbol:self.symbol] atomically:YES]; -} - --(void)populateWithString:(NSString *)csv -{ - NSArray *csvLines = [csv componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]; - NSMutableArray *newFinancials = [NSMutableArray arrayWithCapacity:csvLines.count]; - NSDictionary *currentFinancial = nil; - NSString *line = nil; - - self.overallHigh = [NSDecimalNumber notANumber]; - self.overallLow = [NSDecimalNumber notANumber]; - - for ( NSUInteger i = 1; i < csvLines.count - 1; i++ ) { - line = (NSString *)csvLines[i]; - currentFinancial = [NSDictionary dictionaryWithCSVLine:line]; - [newFinancials addObject:currentFinancial]; - - NSDecimalNumber *high = currentFinancial[@"high"]; - NSDecimalNumber *low = currentFinancial[@"low"]; - - if ( [self.overallHigh isEqual:[NSDecimalNumber notANumber]] ) { - self.overallHigh = high; - } - - if ( [self.overallLow isEqual:[NSDecimalNumber notANumber]] ) { - self.overallLow = low; - } - - if ( [low compare:self.overallLow] == NSOrderedAscending ) { - self.overallLow = low; - } - if ( [high compare:self.overallHigh] == NSOrderedDescending ) { - self.overallHigh = high; - } - } - self.startDate = self.targetStartDate; - self.endDate = self.targetEndDate; - self.symbol = self.targetSymbol; - - [self setFinancialData:[NSArray arrayWithArray:newFinancials]]; -} - -@end diff --git a/examples/StockPlot/Classes/APYahooDataPullerGraph.h b/examples/StockPlot/Classes/APYahooDataPullerGraph.h deleted file mode 100644 index f47a2770e..000000000 --- a/examples/StockPlot/Classes/APYahooDataPullerGraph.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// APYahooDataPullerGraph.h -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// - -#import "APYahooDataPuller.h" -#import "CorePlot-CocoaTouch.h" -#import - -@interface APYahooDataPullerGraph : UIViewController - -@property (nonatomic, strong) IBOutlet CPTGraphHostingView *graphHost; -@property (nonatomic, strong) APYahooDataPuller *dataPuller; - -@end diff --git a/examples/StockPlot/Classes/APYahooDataPullerGraph.m b/examples/StockPlot/Classes/APYahooDataPullerGraph.m deleted file mode 100644 index 6a5021857..000000000 --- a/examples/StockPlot/Classes/APYahooDataPullerGraph.m +++ /dev/null @@ -1,170 +0,0 @@ -// -// APYahooDataPullerGraph.m -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright 2009 __MyCompanyName__. All rights reserved. -// - -#import "APYahooDataPullerGraph.h" - -@interface APYahooDataPullerGraph() - -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; - -@end - -#pragma mark - - -@implementation APYahooDataPullerGraph - -@synthesize graphHost; -@synthesize dataPuller; -@synthesize graph; - --(void)reloadData -{ - if ( !self.graph ) { - CPTXYGraph *newGraph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; - CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; - [newGraph applyTheme:theme]; - self.graph = newGraph; - - newGraph.paddingTop = 30.0; - newGraph.paddingBottom = 30.0; - newGraph.paddingLeft = 50.0; - newGraph.paddingRight = 50.0; - - CPTScatterPlot *dataSourceLinePlot = [[CPTScatterPlot alloc] initWithFrame:newGraph.bounds]; - dataSourceLinePlot.identifier = @"Data Source Plot"; - - CPTMutableLineStyle *lineStyle = [dataSourceLinePlot.dataLineStyle mutableCopy]; - lineStyle.lineWidth = 1.0; - lineStyle.lineColor = [CPTColor redColor]; - dataSourceLinePlot.dataLineStyle = lineStyle; - - dataSourceLinePlot.dataSource = self; - [newGraph addPlot:dataSourceLinePlot]; - } - - CPTXYGraph *theGraph = self.graph; - self.graphHost.hostedGraph = theGraph; - - CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)theGraph.defaultPlotSpace; - - NSDecimalNumber *high = self.dataPuller.overallHigh; - NSDecimalNumber *low = self.dataPuller.overallLow; - NSDecimalNumber *length = [high decimalNumberBySubtracting:low]; - - //NSLog(@"high = %@, low = %@, length = %@", high, low, length); - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromUnsignedInteger([self.dataPuller.financialData count])]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:low.decimalValue length:length.decimalValue]; - // Axes - CPTXYAxisSet *axisSet = (CPTXYAxisSet *)theGraph.axisSet; - - CPTXYAxis *x = axisSet.xAxis; - x.majorIntervalLength = CPTDecimalFromDouble(10.0); - x.orthogonalCoordinateDecimal = CPTDecimalFromInteger(0); - x.minorTicksPerInterval = 1; - - CPTXYAxis *y = axisSet.yAxis; - NSDecimal six = CPTDecimalFromInteger(6); - y.majorIntervalLength = CPTDecimalDivide([length decimalValue], six); - y.majorTickLineStyle = nil; - y.minorTicksPerInterval = 4; - y.minorTickLineStyle = nil; - y.orthogonalCoordinateDecimal = CPTDecimalFromInteger(0); - y.alternatingBandFills = @[[[CPTColor whiteColor] colorWithAlphaComponent:CPTFloat(0.1)], [NSNull null]]; - - [theGraph reloadData]; - - [[self navigationItem] setTitle:[self.dataPuller symbol]]; -} - --(void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; -} - -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. --(void)viewDidLoad -{ - [super viewDidLoad]; - [self reloadData]; -} - --(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration -{ - // NSLog(@"willRotateToInterfaceOrientation"); -} - --(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation -{ - // NSLog(@"didRotateFromInterfaceOrientation"); -} - --(void)didReceiveMemoryWarning -{ - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -#pragma mark - -#pragma mark Plot Data Source Methods - --(NSUInteger)numberOfRecords -{ - return self.dataPuller.financialData.count; -} - --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index -{ - NSNumber *num = @0; - - if ( fieldEnum == CPTScatterPlotFieldX ) { - num = @(index + 1); - } - else if ( fieldEnum == CPTScatterPlotFieldY ) { - NSArray *financialData = self.dataPuller.financialData; - - NSDictionary *fData = (NSDictionary *)financialData[[financialData count] - index - 1]; - num = fData[@"close"]; - NSAssert([num isMemberOfClass:[NSDecimalNumber class]], @"grrr"); - } - - return num; -} - --(void)dataPullerFinancialDataDidChange:(APYahooDataPuller *)dp -{ - [self reloadData]; -} - -#pragma mark accessors - --(void)setDataPuller:(APYahooDataPuller *)aDataPuller -{ - //NSLog(@"in -setDataPuller:, old value of dataPuller: %@, changed to: %@", dataPuller, aDataPuller); - - if ( dataPuller != aDataPuller ) { - dataPuller = aDataPuller; - [dataPuller setDelegate:self]; - [self reloadData]; - } -} - --(void)dealloc -{ - if ( dataPuller.delegate == self ) { - [dataPuller setDelegate:nil]; - } -} - --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot -{ - return [self numberOfRecords]; -} - -@end diff --git a/examples/StockPlot/Classes/APYahooDataPullerGraph.xib b/examples/StockPlot/Classes/APYahooDataPullerGraph.xib deleted file mode 100644 index e01f8d6b5..000000000 --- a/examples/StockPlot/Classes/APYahooDataPullerGraph.xib +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/StockPlot/Classes/NSDictionary+APFinancialData.h b/examples/StockPlot/Classes/NSDictionary+APFinancialData.h deleted file mode 100644 index 7ca481d37..000000000 --- a/examples/StockPlot/Classes/NSDictionary+APFinancialData.h +++ /dev/null @@ -1,7 +0,0 @@ -#import - -@interface NSDictionary(APFinancialData) - -+(id)dictionaryWithCSVLine:(NSString *)csvLine; - -@end diff --git a/examples/StockPlot/Classes/NSDictionary+APFinancialData.m b/examples/StockPlot/Classes/NSDictionary+APFinancialData.m deleted file mode 100644 index 51f8ea553..000000000 --- a/examples/StockPlot/Classes/NSDictionary+APFinancialData.m +++ /dev/null @@ -1,56 +0,0 @@ -#import "NSDictionary+APFinancialData.h" - -@interface NSDateFormatter(yahooCSVDateFormatter) - -+(NSDateFormatter *)yahooCSVDateFormatter; - -@end - -@implementation NSDateFormatter(yahooCSVDateFormatter) - -+(NSDateFormatter *)yahooCSVDateFormatter -{ - static NSDateFormatter *df = nil; - static dispatch_once_t onceToken = 0; - - dispatch_once(&onceToken, ^{ - df = [[NSDateFormatter alloc] init]; - [df setDateFormat:@"yyyy-MM-dd"]; - }); - - return df; -} - -@end - -@implementation NSDictionary(APFinancialData) - -+(id)dictionaryWithCSVLine:(NSString *)csvLine -{ - NSArray *csvChunks = [csvLine componentsSeparatedByString:@","]; - - NSMutableDictionary *csvDict = [NSMutableDictionary dictionaryWithCapacity:7]; - - // Date,Open,High,Low,Close,Volume,Adj Close - // 2009-06-08,143.82,144.23,139.43,143.85,33255400,143.85 - NSDate *theDate = [[NSDateFormatter yahooCSVDateFormatter] dateFromString:(NSString *)csvChunks[0]]; - - csvDict[@"date"] = theDate; - NSDecimalNumber *theOpen = [NSDecimalNumber decimalNumberWithString:(NSString *)csvChunks[1]]; - csvDict[@"open"] = theOpen; - NSDecimalNumber *theHigh = [NSDecimalNumber decimalNumberWithString:(NSString *)csvChunks[2]]; - csvDict[@"high"] = theHigh; - NSDecimalNumber *theLow = [NSDecimalNumber decimalNumberWithString:(NSString *)csvChunks[3]]; - csvDict[@"low"] = theLow; - NSDecimalNumber *theClose = [NSDecimalNumber decimalNumberWithString:(NSString *)csvChunks[4]]; - csvDict[@"close"] = theClose; - NSDecimalNumber *theVolume = [NSDecimalNumber decimalNumberWithString:(NSString *)csvChunks[5]]; - csvDict[@"volume"] = theVolume; - NSDecimalNumber *theAdjClose = [NSDecimalNumber decimalNumberWithString:(NSString *)csvChunks[6]]; - csvDict[@"adjClose"] = theAdjClose; - - //non-mutable autoreleased dict - return [NSDictionary dictionaryWithDictionary:csvDict]; -} - -@end diff --git a/examples/StockPlot/Classes/RootViewController.h b/examples/StockPlot/Classes/RootViewController.h deleted file mode 100644 index cebf53065..000000000 --- a/examples/StockPlot/Classes/RootViewController.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// RootViewController.h -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. -// -#import - -#import "APYahooDataPuller.h" -#import "APYahooDataPullerGraph.h" - -@interface RootViewController : UITableViewController - -@property (nonatomic, readonly, strong) NSArray *symbols; - --(void)addSymbol:(NSString *)aSymbol; - -@end diff --git a/examples/StockPlot/Classes/RootViewController.m b/examples/StockPlot/Classes/RootViewController.m deleted file mode 100644 index e079077aa..000000000 --- a/examples/StockPlot/Classes/RootViewController.m +++ /dev/null @@ -1,319 +0,0 @@ -// -// RootViewController.m -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. -// - -#import "APYahooDataPuller.h" -#import "RootViewController.h" - -@interface RootViewController() - -@property (nonatomic, readwrite, strong) APYahooDataPullerGraph *graph; -@property (nonatomic, readwrite, strong) NSMutableArray *stocks; - -@end - -@implementation RootViewController - -@synthesize graph; -@synthesize stocks; -@dynamic symbols; - --(void)viewDidLoad -{ - [super viewDidLoad]; - self.stocks = [[NSMutableArray alloc] initWithCapacity:4]; - [self addSymbol:@"AAPL"]; - [self addSymbol:@"GOOG"]; - [self addSymbol:@"YHOO"]; - [self addSymbol:@"MSFT"]; - - // Uncomment the following line to display an Edit button in the navigation bar for this view controller. - // self.navigationItem.rightBarButtonItem = self.editButtonItem; -} - --(void)didReceiveMemoryWarning -{ - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - --(void)viewWillAppear:(BOOL)animated -{ - [super viewWillAppear:animated]; - [[self navigationItem] setTitle:@"Stocks"]; - //the graph will set itself as delegate of the dataPuller when we push it, so we need to reset this. - for ( APYahooDataPuller *dp in self.stocks ) { - [dp setDelegate:self]; - } -} - -#pragma mark Table view methods - --(void)inspectStock:(APYahooDataPuller *)aStock -{ - NSDecimalNumber *high = [aStock overallHigh]; - NSDecimalNumber *low = [aStock overallLow]; - - if ( [high isEqualToNumber:[NSDecimalNumber notANumber]] || [low isEqualToNumber:[NSDecimalNumber notANumber]] || ([[aStock financialData] count] <= 0) ) { - NSString *message = [NSString stringWithFormat:@"No information available for %@", [aStock symbol]]; - UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Alert" message:message delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil]; - [av show]; - } - else { - if ( nil == self.graph ) { - APYahooDataPullerGraph *aGraph = [[APYahooDataPullerGraph alloc] initWithNibName:@"APYahooDataPullerGraph" bundle:nil]; - self.graph = aGraph; - } - - [self.graph setDataPuller:aStock]; - [self.navigationController pushViewController:self.graph animated:YES]; - self.graph.view.frame = self.view.bounds; - } -} - -// Override to support row selection in the table view. --(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath -{ - APYahooDataPuller *dp = self.stocks[(NSUInteger)indexPath.row]; - - [self inspectStock:dp]; - [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; -} - --(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView -{ - return 1; -} - -// Customize the number of rows in the table view. --(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ - return (NSInteger)self.stocks.count; -} - --(void)setupCell:(UITableViewCell *)cell forStockAtIndex:(NSUInteger)row -{ - APYahooDataPuller *dp = self.stocks[row]; - - [[cell textLabel] setText:[dp symbol]]; - - NSDateFormatter *df = [[NSDateFormatter alloc] init]; - [df setDateStyle:NSDateFormatterShortStyle]; - NSString *startString = @"(NA)"; - if ( [dp startDate] ) { - startString = [df stringFromDate:[dp startDate]]; - } - - NSString *endString = @"(NA)"; - if ( [dp endDate] ) { - endString = [df stringFromDate:[dp endDate]]; - } - - NSNumberFormatter *nf = [[NSNumberFormatter alloc] init]; - [nf setRoundingMode:NSNumberFormatterRoundHalfUp]; - [nf setDecimalSeparator:@"."]; - [nf setGroupingSeparator:@","]; - [nf setPositiveFormat:@"\u00A4###,##0.00"]; - [nf setNegativeFormat:@"(\u00A4###,##0.00)"]; - - NSString *overallLow = @"(NA)"; - if ( ![[NSDecimalNumber notANumber] isEqual:[dp overallLow]] ) { - overallLow = [nf stringFromNumber:[dp overallLow]]; - } - NSString *overallHigh = @"(NA)"; - if ( ![[NSDecimalNumber notANumber] isEqual:[dp overallHigh]] ) { - overallHigh = [nf stringFromNumber:[dp overallHigh]]; - } - - [[cell detailTextLabel] setText:[NSString stringWithFormat:@"%@ - %@; Low:%@ High:%@", startString, endString, overallLow, overallHigh]]; - - UIView *accessory = [cell accessoryView]; - if ( dp.loadingData ) { - if ( ![accessory isMemberOfClass:[UIActivityIndicatorView class]] ) { - accessory = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; - [(UIActivityIndicatorView *)accessory setHidesWhenStopped : NO]; - [cell setAccessoryView:accessory]; - } - [(UIActivityIndicatorView *)accessory startAnimating]; - } - else { - if ( [accessory isMemberOfClass:[UIActivityIndicatorView class]] ) { - [(UIActivityIndicatorView *)accessory stopAnimating]; - } - if ( dp.staleData ) { - if ( ![accessory isMemberOfClass:[UIImageView class]] ) { - UIImage *caution = [UIImage imageNamed:@"caution.png"]; - accessory = [[UIImageView alloc] initWithImage:caution]; - [cell setAccessoryView:accessory]; -// CGRect frame = accessory.frame; -//#pragma unused (frame) - } - } - else { - [cell setAccessoryView:nil]; - } - } -} - -// Customize the appearance of table view cells. --(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - static NSString *CellIdentifier = @"UITableViewCellStyleSubtitle"; - - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; - - if ( cell == nil ) { - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; - } - - NSUInteger row = (NSUInteger)indexPath.row; - - [self setupCell:cell forStockAtIndex:row]; - - return cell; -} - --(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation -{ - self.graph.view.frame = self.view.bounds; -} - -#pragma mark - -#pragma mark accessors - --(NSArray *)symbols -{ - //NSLog(@"in -symbols, returned symbols = %@", symbols); - NSMutableArray *symbols = [NSMutableArray arrayWithCapacity:self.stocks.count]; - - for ( APYahooDataPuller *dp in self.stocks ) { - [symbols addObject:[dp symbol]]; - } - return [NSArray arrayWithArray:symbols]; -} - --(void)dataPuller:(APYahooDataPuller *)dp downloadDidFailWithError:(NSError *)error -{ - NSLog(@"dataPuller:%@ downloadDidFailWithError:%@", dp, error); - NSUInteger idx = [self.stocks indexOfObject:dp]; - NSInteger section = 0; - NSIndexPath *path = [NSIndexPath indexPathForRow:(NSInteger)idx inSection:section]; - UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:path]; - [self setupCell:cell forStockAtIndex:idx]; -} - --(void)dataPullerFinancialDataDidChange:(APYahooDataPuller *)dp -{ - NSLog(@"dataPullerFinancialDataDidChange:%@", dp); - NSUInteger idx = [self.stocks indexOfObject:dp]; - NSInteger section = 0; - NSIndexPath *path = [NSIndexPath indexPathForRow:(NSInteger)idx inSection:section]; - UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:path]; - [self setupCell:cell forStockAtIndex:idx]; -} - --(void)addSymbol:(NSString *)aSymbol -{ - NSTimeInterval secondsAgo = -fabs(60.0 * 60.0 * 24.0 * 7.0 * 12.0); //12 weeks ago - NSDate *start = [NSDate dateWithTimeIntervalSinceNow:secondsAgo]; - NSDate *end = [NSDate date]; - - APYahooDataPuller *dp = [[APYahooDataPuller alloc] initWithTargetSymbol:aSymbol targetStartDate:start targetEndDate:end]; - - [[self stocks] addObject:dp]; - [dp fetchIfNeeded]; - [dp setDelegate:self]; - [[self tableView] reloadData]; //TODO: should reload whole thing -} - --(void)dealloc -{ - for ( APYahooDataPuller *dp in stocks ) { - if ( dp.delegate == self ) { - dp.delegate = nil; - } - } - stocks = nil; -} - -/* - * - (void)viewDidLoad { - * [super viewDidLoad]; - * - * // Uncomment the following line to display an Edit button in the navigation bar for this view controller. - * // self.navigationItem.rightBarButtonItem = self.editButtonItem; - * } - */ - -/* - * - (void)viewDidAppear:(BOOL)animated { - * [super viewDidAppear:animated]; - * } - */ - -/* - * - (void)viewWillDisappear:(BOOL)animated { - * [super viewWillDisappear:animated]; - * } - */ - -/* - * - (void)viewDidDisappear:(BOOL)animated { - * [super viewDidDisappear:animated]; - * } - */ - -/* - * // Override to support row selection in the table view. - * - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - * - * // Navigation logic may go here -- for example, create and push another view controller. - * // AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil]; - * // [self.navigationController pushViewController:anotherViewController animated:YES]; - * // [anotherViewController release]; - * } - */ - -/* - * // Override to support conditional editing of the table view. - * - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { - * // Return NO if you do not want the specified item to be editable. - * return YES; - * } - */ - -/* - * // Override to support editing the table view. - * - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { - * - * if (editingStyle == UITableViewCellEditingStyleDelete) { - * // Delete the row from the data source. - * [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; - * } - * else if (editingStyle == UITableViewCellEditingStyleInsert) { - * // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view. - * } - * } - */ - -/* - * // Override to support rearranging the table view. - * - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { - * } - */ - -/* - * // Override to support conditional rearranging of the table view. - * - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { - * // Return NO if you do not want the item to be re-orderable. - * return YES; - * } - */ - -@end diff --git a/examples/StockPlot/Classes/StockPlotAppDelegate.h b/examples/StockPlot/Classes/StockPlotAppDelegate.h deleted file mode 100644 index 0a3b0badf..000000000 --- a/examples/StockPlot/Classes/StockPlotAppDelegate.h +++ /dev/null @@ -1,14 +0,0 @@ -// -// StockPlotAppDelegate.h -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. -// - -@interface StockPlotAppDelegate : NSObject - -@property (nonatomic, strong) IBOutlet UIWindow *window; -@property (nonatomic, strong) IBOutlet UINavigationController *navigationController; - -@end diff --git a/examples/StockPlot/Classes/StockPlotAppDelegate.m b/examples/StockPlot/Classes/StockPlotAppDelegate.m deleted file mode 100644 index aed96ab66..000000000 --- a/examples/StockPlot/Classes/StockPlotAppDelegate.m +++ /dev/null @@ -1,36 +0,0 @@ -// -// StockPlotAppDelegate.m -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. -// - -#import "RootViewController.h" -#import "StockPlotAppDelegate.h" - -@implementation StockPlotAppDelegate - -@synthesize window; -@synthesize navigationController; - -#pragma mark - -#pragma mark Application lifecycle - --(void)applicationDidFinishLaunching:(UIApplication *)application -{ - [[self.navigationController navigationBar] setTintColor:[UIColor blackColor]]; - - self.window.rootViewController = self.navigationController; - [self.window makeKeyAndVisible]; -} - --(void)applicationWillTerminate:(UIApplication *)application -{ - // Save data if appropriate -} - -#pragma mark - -#pragma mark Memory management - -@end diff --git a/examples/StockPlot/GOOG.plist b/examples/StockPlot/GOOG.plist deleted file mode 100644 index 489ad37be..000000000 --- a/examples/StockPlot/GOOG.plist +++ /dev/null @@ -1,1107 +0,0 @@ - - - - - endDate - 2009-06-19T06:53:47Z - financialData - - - adjClose - 414.0600000000001 - close - 414.0600000000001 - date - 2009-06-18T04:00:00Z - high - 418.6899999999999 - low - 413 - open - 415.68 - volume - 3085200 - - - adjClose - 415.16 - close - 415.16 - date - 2009-06-17T04:00:00Z - high - 419.72 - low - 411.5600000000001 - open - 416.1899999999999 - volume - 3490100 - - - adjClose - 416 - close - 416 - date - 2009-06-16T04:00:00Z - high - 421.09 - low - 415.42 - open - 419.3100000000001 - volume - 3049700 - - - adjClose - 416.77 - close - 416.77 - date - 2009-06-15T04:00:00Z - high - 421.5 - low - 414 - open - 421.5 - volume - 3736900 - - - adjClose - 424.84 - close - 424.84 - date - 2009-06-12T04:00:00Z - high - 427.7 - low - 421.21 - open - 426.86 - volume - 2918400 - - - adjClose - 429 - close - 429 - date - 2009-06-11T04:00:00Z - high - 433.73 - low - 428.37 - open - 431.77 - volume - 2865200 - - - adjClose - 432.6 - close - 432.6 - date - 2009-06-10T04:00:00Z - high - 437.89 - low - 426.67 - open - 436.23 - volume - 3358900 - - - adjClose - 435.62 - close - 435.62 - date - 2009-06-09T04:00:00Z - high - 440.5 - low - 431.76 - open - 438.58 - volume - 3254900 - - - adjClose - 438.77 - close - 438.77 - date - 2009-06-08T04:00:00Z - high - 440.92 - low - 434.12 - open - 439.5 - volume - 3098700 - - - adjClose - 444.32 - close - 444.32 - date - 2009-06-05T04:00:00Z - high - 447.34 - low - 439.46 - open - 445.07 - volume - 3680800 - - - adjClose - 440.28 - close - 440.28 - date - 2009-06-04T04:00:00Z - high - 441.24 - low - 434.5 - open - 435.3 - volume - 3638100 - - - adjClose - 431.65 - close - 431.65 - date - 2009-06-03T04:00:00Z - high - 432.46 - low - 424 - open - 426 - volume - 3532800 - - - adjClose - 428.4 - close - 428.4 - date - 2009-06-02T04:00:00Z - high - 429.96 - low - 423.4 - open - 426.25 - volume - 2623600 - - - adjClose - 426.5600000000001 - close - 426.5600000000001 - date - 2009-06-01T04:00:00Z - high - 429.6 - low - 418.53 - open - 418.73 - volume - 3322400 - - - adjClose - 417.23 - close - 417.23 - date - 2009-05-29T04:00:00Z - high - 417.23 - low - 410.7 - open - 412.11 - volume - 2648200 - - - adjClose - 410.4 - close - 410.4 - date - 2009-05-28T04:00:00Z - high - 411.62 - low - 404.61 - open - 408.68 - volume - 2668800 - - - adjClose - 405.56 - close - 405.56 - date - 2009-05-27T04:00:00Z - high - 411.86 - low - 404.81 - open - 405.64 - volume - 3034300 - - - adjClose - 404.36 - close - 404.36 - date - 2009-05-26T04:00:00Z - high - 405 - low - 390 - open - 391.95 - volume - 3104500 - - - adjClose - 393.5 - close - 393.5 - date - 2009-05-22T04:00:00Z - high - 398.65 - low - 392 - open - 396.66 - volume - 1718600 - - - adjClose - 396.5 - close - 396.5 - date - 2009-05-21T04:00:00Z - high - 402.84 - low - 393.84 - open - 396.3 - volume - 2719800 - - - adjClose - 397.18 - close - 397.18 - date - 2009-05-20T04:00:00Z - high - 405.67 - low - 395 - open - 402.09 - volume - 2284000 - - - adjClose - 398.88 - close - 398.88 - date - 2009-05-19T04:00:00Z - high - 401.64 - low - 393 - open - 396.1 - volume - 2837500 - - - adjClose - 396.84 - close - 396.84 - date - 2009-05-18T04:00:00Z - high - 397.31 - low - 385.4 - open - 394.73 - volume - 3351700 - - - adjClose - 390 - close - 390 - date - 2009-05-15T04:00:00Z - high - 394.11 - low - 389.09 - open - 391.1 - volume - 3008700 - - - adjClose - 387.5 - close - 387.5 - date - 2009-05-14T04:00:00Z - high - 392.21 - low - 384.69 - open - 388.8 - volume - 2937000 - - - adjClose - 389.54 - close - 389.54 - date - 2009-05-13T04:00:00Z - high - 396.39 - low - 388.35 - open - 394.09 - volume - 2842800 - - - adjClose - 399.01 - close - 399.01 - date - 2009-05-12T04:00:00Z - high - 410.99 - low - 395.11 - open - 410.01 - volume - 3790800 - - - adjClose - 407.98 - close - 407.98 - date - 2009-05-11T04:00:00Z - high - 412 - low - 401.2 - open - 402.8 - volume - 2559300 - - - adjClose - 407.33 - close - 407.33 - date - 2009-05-08T04:00:00Z - high - 410.13 - low - 395 - open - 402.85 - volume - 3865100 - - - adjClose - 396.61 - close - 396.61 - date - 2009-05-07T04:00:00Z - high - 404.99 - low - 392.5 - open - 404.1 - volume - 2999800 - - - adjClose - 403.47 - close - 403.47 - date - 2009-05-06T04:00:00Z - high - 408.28 - low - 401 - open - 406.79 - volume - 2632900 - - - adjClose - 402.99 - close - 402.99 - date - 2009-05-05T04:00:00Z - high - 405 - low - 397.25 - open - 399.98 - volume - 2400800 - - - adjClose - 401.98 - close - 401.98 - date - 2009-05-04T04:00:00Z - high - 402.4 - low - 394.79 - open - 398.17 - volume - 3203000 - - - adjClose - 393.69 - close - 393.69 - date - 2009-05-01T04:00:00Z - high - 397.59 - low - 391.55 - open - 395.03 - volume - 2427700 - - - adjClose - 395.97 - close - 395.97 - date - 2009-04-30T04:00:00Z - high - 403.75 - low - 394.8 - open - 395.76 - volume - 4355700 - - - adjClose - 391.47 - close - 391.47 - date - 2009-04-29T04:00:00Z - high - 394.97 - low - 385.83 - open - 385.97 - volume - 3610000 - - - adjClose - 383.71 - close - 383.71 - date - 2009-04-28T04:00:00Z - high - 389.05 - low - 381.54 - open - 383.75 - volume - 2943600 - - - adjClose - 385.95 - close - 385.95 - date - 2009-04-27T04:00:00Z - high - 389.49 - low - 382.75 - open - 384.34 - volume - 2290600 - - - adjClose - 389.49 - close - 389.49 - date - 2009-04-24T04:00:00Z - high - 393.18 - low - 380.5 - open - 386.05 - volume - 3385400 - - - adjClose - 384.69 - close - 384.69 - date - 2009-04-23T04:00:00Z - high - 389.75 - low - 381.11 - open - 387.51 - volume - 2609000 - - - adjClose - 383.86 - close - 383.86 - date - 2009-04-22T04:00:00Z - high - 390 - low - 379.01 - open - 381.75 - volume - 3501800 - - - adjClose - 381.47 - close - 381.47 - date - 2009-04-21T04:00:00Z - high - 384.3 - low - 376.1 - open - 376.17 - volume - 3695400 - - - adjClose - 379.3 - close - 379.3 - date - 2009-04-20T04:00:00Z - high - 390.65 - low - 375.89 - open - 386.15 - volume - 4428900 - - - adjClose - 392.24 - close - 392.24 - date - 2009-04-17T04:00:00Z - high - 399.82 - low - 384.81 - open - 386.02 - volume - 10730800 - - - adjClose - 388.74 - close - 388.74 - date - 2009-04-16T04:00:00Z - high - 392.9 - low - 381.02 - open - 381.5 - volume - 10185100 - - - adjClose - 379.5 - close - 379.5 - date - 2009-04-15T04:00:00Z - high - 381.06 - low - 364.16 - open - 367.1 - volume - 4930700 - - - adjClose - 368.91 - close - 368.91 - date - 2009-04-14T04:00:00Z - high - 376.99 - low - 365.6 - open - 376.94 - volume - 3428600 - - - adjClose - 378.11 - close - 378.11 - date - 2009-04-13T04:00:00Z - high - 379.1 - low - 370.3 - open - 371.33 - volume - 3050100 - - - adjClose - 372.5 - close - 372.5 - date - 2009-04-09T04:00:00Z - high - 374.35 - low - 366.25 - open - 369.5 - volume - 3382600 - - - adjClose - 362 - close - 362 - date - 2009-04-08T04:00:00Z - high - 365 - low - 356.21 - open - 363.5 - volume - 2765200 - - - adjClose - 358.65 - close - 358.65 - date - 2009-04-07T04:00:00Z - high - 363.75 - low - 355.31 - open - 362.6 - volume - 3680100 - - - adjClose - 368.24 - close - 368.24 - date - 2009-04-06T04:00:00Z - high - 369.82 - low - 361.4 - open - 367 - volume - 3280300 - - - adjClose - 369.78 - close - 369.78 - date - 2009-04-03T04:00:00Z - high - 371.72 - low - 358 - open - 364.5 - volume - 3789800 - - - adjClose - 362.5 - close - 362.5 - date - 2009-04-02T04:00:00Z - high - 369.76 - low - 360.32 - open - 363.31 - volume - 4488000 - - - adjClose - 354.09 - close - 354.09 - date - 2009-04-01T04:00:00Z - high - 355.24 - low - 340.61 - open - 343.78 - volume - 3301200 - - - adjClose - 348.06 - close - 348.06 - date - 2009-03-31T04:00:00Z - high - 353.51 - low - 346.18 - open - 348.93 - volume - 3655300 - - - adjClose - 342.69 - close - 342.69 - date - 2009-03-30T04:00:00Z - high - 343.81 - low - 336.05 - open - 342.55 - volume - 3094100 - - - adjClose - 347.7 - close - 347.7 - date - 2009-03-27T04:00:00Z - high - 352 - low - 345.47 - open - 350 - volume - 3322800 - - - adjClose - 353.29 - close - 353.29 - date - 2009-03-26T04:00:00Z - high - 359.16 - low - 348.5 - open - 353.13 - volume - 6003300 - - - adjClose - 344.07 - close - 344.07 - date - 2009-03-25T04:00:00Z - high - 351.34 - low - 336.25 - open - 350.4 - volume - 4336300 - - - adjClose - 347.17 - close - 347.17 - date - 2009-03-24T04:00:00Z - high - 353.84 - low - 344 - open - 346.5 - volume - 3820000 - - - adjClose - 348.6 - close - 348.6 - date - 2009-03-23T04:00:00Z - high - 349.45 - low - 333.03 - open - 333.56 - volume - 4271500 - - - adjClose - 330.16 - close - 330.16 - date - 2009-03-20T04:00:00Z - high - 332.99 - low - 326.34 - open - 330.3 - volume - 4737900 - - - adjClose - 329.94 - close - 329.94 - date - 2009-03-19T04:00:00Z - high - 336 - low - 327.38 - open - 331.68 - volume - 4111200 - - - adjClose - 333.1 - close - 333.1 - date - 2009-03-18T04:00:00Z - high - 340 - low - 328.05 - open - 334.81 - volume - 5012200 - - - adjClose - 335.34 - close - 335.34 - date - 2009-03-17T04:00:00Z - high - 335.34 - low - 319.09 - open - 320.18 - volume - 4712500 - - - adjClose - 319.69 - close - 319.69 - date - 2009-03-16T04:00:00Z - high - 329.73 - low - 318.59 - open - 325.99 - volume - 4946800 - - - adjClose - 324.42 - close - 324.42 - date - 2009-03-13T04:00:00Z - high - 327.46 - low - 319.03 - open - 326.1 - volume - 3906400 - - - overallHigh - 447.34 - overallLow - 318.59 - startDate - 2009-03-13T06:53:47Z - symbol - GOOG - - diff --git a/examples/StockPlot/Launch Screen.xib b/examples/StockPlot/Launch Screen.xib deleted file mode 100644 index a4454db08..000000000 --- a/examples/StockPlot/Launch Screen.xib +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/StockPlot/MSFT.plist b/examples/StockPlot/MSFT.plist deleted file mode 100644 index 5564f546f..000000000 --- a/examples/StockPlot/MSFT.plist +++ /dev/null @@ -1,1107 +0,0 @@ - - - - - endDate - 2009-06-19T06:53:47Z - financialData - - - adjClose - 23.5 - close - 23.5 - date - 2009-06-18T04:00:00Z - high - 23.69 - low - 23.3 - open - 23.62 - volume - 58825800 - - - adjClose - 23.68 - close - 23.68 - date - 2009-06-17T04:00:00Z - high - 23.82 - low - 23.17 - open - 23.5 - volume - 86463700 - - - adjClose - 23.45 - close - 23.45 - date - 2009-06-16T04:00:00Z - high - 24.11 - low - 23.44 - open - 23.47 - volume - 105284900 - - - adjClose - 23.42 - close - 23.42 - date - 2009-06-15T04:00:00Z - high - 23.54 - low - 23.02 - open - 23.23 - volume - 69074500 - - - adjClose - 23.33 - close - 23.33 - date - 2009-06-12T04:00:00Z - high - 23.38 - low - 22.74 - open - 22.9 - volume - 50951800 - - - adjClose - 22.83 - close - 22.83 - date - 2009-06-11T04:00:00Z - high - 23.26 - low - 22.57 - open - 22.59 - volume - 65124600 - - - adjClose - 22.55 - close - 22.55 - date - 2009-06-10T04:00:00Z - high - 22.62 - low - 22.12 - open - 22.17 - volume - 61202600 - - - adjClose - 22.08 - close - 22.08 - date - 2009-06-09T04:00:00Z - high - 22.32 - low - 21.88 - open - 22.06 - volume - 50852100 - - - adjClose - 22.05 - close - 22.05 - date - 2009-06-08T04:00:00Z - high - 22.32 - low - 21.63 - open - 21.98 - volume - 49000600 - - - adjClose - 22.14 - close - 22.14 - date - 2009-06-05T04:00:00Z - high - 22.31 - low - 21.81 - open - 21.96 - volume - 59579200 - - - adjClose - 21.83 - close - 21.83 - date - 2009-06-04T04:00:00Z - high - 21.9 - low - 21.58 - open - 21.77 - volume - 42330000 - - - adjClose - 21.73 - close - 21.73 - date - 2009-06-03T04:00:00Z - high - 21.76 - low - 21.29 - open - 21.31 - volume - 56039600 - - - adjClose - 21.4 - close - 21.4 - date - 2009-06-02T04:00:00Z - high - 21.98 - low - 21.2 - open - 21.36 - volume - 48935700 - - - adjClose - 21.4 - close - 21.4 - date - 2009-06-01T04:00:00Z - high - 21.5 - low - 20.86 - open - 21 - volume - 57317100 - - - adjClose - 20.89 - close - 20.89 - date - 2009-05-29T04:00:00Z - high - 20.94 - low - 20.3 - open - 20.56 - volume - 46134900 - - - adjClose - 20.45 - close - 20.45 - date - 2009-05-28T04:00:00Z - high - 20.63 - low - 20.05 - open - 20.32 - volume - 45480800 - - - adjClose - 20.13 - close - 20.13 - date - 2009-05-27T04:00:00Z - high - 20.6 - low - 20.07 - open - 20.25 - volume - 42892900 - - - adjClose - 20.34 - close - 20.34 - date - 2009-05-26T04:00:00Z - high - 20.45 - low - 19.45 - open - 19.54 - volume - 44991700 - - - adjClose - 19.75 - close - 19.75 - date - 2009-05-22T04:00:00Z - high - 20.17 - low - 19.47 - open - 19.93 - volume - 37318700 - - - adjClose - 19.82 - close - 19.82 - date - 2009-05-21T04:00:00Z - high - 20.23 - low - 19.51 - open - 20.14 - volume - 58232800 - - - adjClose - 20.38 - close - 20.38 - date - 2009-05-20T04:00:00Z - high - 20.69 - low - 20.22 - open - 20.41 - volume - 47450700 - - - adjClose - 20.31 - close - 20.31 - date - 2009-05-19T04:00:00Z - high - 20.74 - low - 20.25 - open - 20.51 - volume - 51368300 - - - adjClose - 20.47 - close - 20.6 - date - 2009-05-18T04:00:00Z - high - 20.6 - low - 20.24 - open - 20.36 - volume - 46073800 - - - adjClose - 20.09 - close - 20.22 - date - 2009-05-15T04:00:00Z - high - 20.5 - low - 19.98 - open - 20.13 - volume - 61289900 - - - adjClose - 19.93 - close - 20.06 - date - 2009-05-14T04:00:00Z - high - 20.23 - low - 19.8 - open - 19.83 - volume - 54539500 - - - adjClose - 19.63 - close - 19.75 - date - 2009-05-13T04:00:00Z - high - 20 - low - 19.67 - open - 19.92 - volume - 49281700 - - - adjClose - 19.76 - close - 19.89 - date - 2009-05-12T04:00:00Z - high - 20.06 - low - 19.47 - open - 19.51 - volume - 71966800 - - - adjClose - 19.2 - close - 19.32 - date - 2009-05-11T04:00:00Z - high - 19.73 - low - 19.01 - open - 19.2 - volume - 63762600 - - - adjClose - 19.3 - close - 19.42 - date - 2009-05-08T04:00:00Z - high - 19.64 - low - 19.14 - open - 19.46 - volume - 67597600 - - - adjClose - 19.2 - close - 19.32 - date - 2009-05-07T04:00:00Z - high - 19.99 - low - 19.14 - open - 19.96 - volume - 68727200 - - - adjClose - 19.67 - close - 19.79 - date - 2009-05-06T04:00:00Z - high - 20.07 - low - 19.61 - open - 20.06 - volume - 59639100 - - - adjClose - 19.67 - close - 19.79 - date - 2009-05-05T04:00:00Z - high - 20.24 - low - 19.64 - open - 20.14 - volume - 66835500 - - - adjClose - 20.06 - close - 20.19 - date - 2009-05-04T04:00:00Z - high - 20.4 - low - 19.98 - open - 20.37 - volume - 54313400 - - - adjClose - 20.11 - close - 20.24 - date - 2009-05-01T04:00:00Z - high - 20.35 - low - 19.86 - open - 20.19 - volume - 63224500 - - - adjClose - 20.13 - close - 20.26 - date - 2009-04-30T04:00:00Z - high - 21.1 - low - 20.01 - open - 20.6 - volume - 87439900 - - - adjClose - 20.12 - close - 20.25 - date - 2009-04-29T04:00:00Z - high - 20.89 - low - 20.06 - open - 20.11 - volume - 79301600 - - - adjClose - 19.8 - close - 19.93 - date - 2009-04-28T04:00:00Z - high - 20.27 - low - 19.79 - open - 20.25 - volume - 76685200 - - - adjClose - 20.27 - close - 20.4 - date - 2009-04-27T04:00:00Z - high - 20.82 - low - 20.28 - open - 20.55 - volume - 68219600 - - - adjClose - 20.78 - close - 20.91 - date - 2009-04-24T04:00:00Z - high - 21.2 - low - 19.5 - open - 19.82 - volume - 168478500 - - - adjClose - 18.8 - close - 18.92 - date - 2009-04-23T04:00:00Z - high - 18.94 - low - 18.47 - open - 18.92 - volume - 86116300 - - - adjClose - 18.66 - close - 18.78 - date - 2009-04-22T04:00:00Z - high - 19.19 - low - 18.7 - open - 18.76 - volume - 59401000 - - - adjClose - 18.85 - close - 18.97 - date - 2009-04-21T04:00:00Z - high - 19.08 - low - 18.57 - open - 18.59 - volume - 60928300 - - - adjClose - 18.49 - close - 18.61 - date - 2009-04-20T04:00:00Z - high - 18.95 - low - 18.57 - open - 18.89 - volume - 62937200 - - - adjClose - 19.08 - close - 19.2 - date - 2009-04-17T04:00:00Z - high - 19.69 - low - 19 - open - 19.69 - volume - 61398500 - - - adjClose - 19.64 - close - 19.76 - date - 2009-04-16T04:00:00Z - high - 19.78 - low - 18.99 - open - 19.16 - volume - 67688700 - - - adjClose - 18.71 - close - 18.83 - date - 2009-04-15T04:00:00Z - high - 19.25 - low - 18.51 - open - 19.21 - volume - 72725500 - - - adjClose - 19.23 - close - 19.35 - date - 2009-04-14T04:00:00Z - high - 19.55 - low - 19 - open - 19.44 - volume - 63796300 - - - adjClose - 19.47 - close - 19.59 - date - 2009-04-13T04:00:00Z - high - 19.85 - low - 19.37 - open - 19.69 - volume - 44444700 - - - adjClose - 19.55 - close - 19.67 - date - 2009-04-09T04:00:00Z - high - 19.7 - low - 19.22 - open - 19.45 - volume - 55759600 - - - adjClose - 19.07 - close - 19.19 - date - 2009-04-08T04:00:00Z - high - 19.62 - low - 18.96 - open - 18.97 - volume - 56408900 - - - adjClose - 18.64 - close - 18.76 - date - 2009-04-07T04:00:00Z - high - 19.14 - low - 18.63 - open - 18.76 - volume - 65815200 - - - adjClose - 18.64 - close - 18.76 - date - 2009-04-06T04:00:00Z - high - 18.76 - low - 18.27 - open - 18.54 - volume - 47476100 - - - adjClose - 18.63 - close - 18.75 - date - 2009-04-03T04:00:00Z - high - 19.15 - low - 18.43 - open - 19.13 - volume - 81858400 - - - adjClose - 19.17 - close - 19.29 - date - 2009-04-02T04:00:00Z - high - 19.89 - low - 19 - open - 19.5 - volume - 99082300 - - - adjClose - 19.19 - close - 19.31 - date - 2009-04-01T04:00:00Z - high - 19.36 - low - 18.18 - open - 18.23 - volume - 96438900 - - - adjClose - 18.25 - close - 18.37 - date - 2009-03-31T04:00:00Z - high - 18.79 - low - 17.78 - open - 17.83 - volume - 92095500 - - - adjClose - 17.37 - close - 17.48 - date - 2009-03-30T04:00:00Z - high - 17.76 - low - 17.27 - open - 17.74 - volume - 49633000 - - - adjClose - 18.02 - close - 18.13 - date - 2009-03-27T04:00:00Z - high - 18.62 - low - 18.05 - open - 18.54 - volume - 47670400 - - - adjClose - 18.71 - close - 18.83 - date - 2009-03-26T04:00:00Z - high - 18.88 - low - 18.12 - open - 18.17 - volume - 63775100 - - - adjClose - 17.77 - close - 17.88 - date - 2009-03-25T04:00:00Z - high - 18.31 - low - 17.52 - open - 17.98 - volume - 73927100 - - - adjClose - 17.82 - close - 17.93 - date - 2009-03-24T04:00:00Z - high - 18.21 - low - 17.84 - open - 18.04 - volume - 50044100 - - - adjClose - 18.21 - close - 18.33 - date - 2009-03-23T04:00:00Z - high - 18.59 - low - 17.31 - open - 17.37 - volume - 71600000 - - - adjClose - 16.95 - close - 17.06 - date - 2009-03-20T04:00:00Z - high - 17.65 - low - 16.88 - open - 17.32 - volume - 81725500 - - - adjClose - 17.03 - close - 17.14 - date - 2009-03-19T04:00:00Z - high - 17.45 - low - 16.92 - open - 17.37 - volume - 58994600 - - - adjClose - 16.85 - close - 16.96 - date - 2009-03-18T04:00:00Z - high - 17.22 - low - 16.6 - open - 17.03 - volume - 70710700 - - - adjClose - 16.79 - close - 16.9 - date - 2009-03-17T04:00:00Z - high - 16.9 - low - 16.26 - open - 16.32 - volume - 62481000 - - - adjClose - 16.15 - close - 16.25 - date - 2009-03-16T04:00:00Z - high - 16.96 - low - 16.24 - open - 16.82 - volume - 67028900 - - - adjClose - 16.54 - close - 16.65 - date - 2009-03-13T04:00:00Z - high - 17.05 - low - 16.18 - open - 16.98 - volume - 82965800 - - - overallHigh - 24.11 - overallLow - 16.18 - startDate - 2009-03-13T06:53:47Z - symbol - MSFT - - diff --git a/examples/StockPlot/MainWindow.xib b/examples/StockPlot/MainWindow.xib deleted file mode 100644 index ddc52b78a..000000000 --- a/examples/StockPlot/MainWindow.xib +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/StockPlot/RootViewController.xib b/examples/StockPlot/RootViewController.xib deleted file mode 100644 index 046950821..000000000 --- a/examples/StockPlot/RootViewController.xib +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/StockPlot/StockPlot-Info.plist b/examples/StockPlot/StockPlot-Info.plist deleted file mode 100644 index 1d8d9b7be..000000000 --- a/examples/StockPlot/StockPlot-Info.plist +++ /dev/null @@ -1,41 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIcons~ipad - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - NSMainNibFile - MainWindow - UILaunchStoryboardName - Launch Screen - UIStatusBarStyle - UIStatusBarStyleDefault - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - UIInterfaceOrientationPortraitUpsideDown - - - diff --git a/examples/StockPlot/StockPlot.png b/examples/StockPlot/StockPlot.png deleted file mode 100644 index 8c1c5ca30..000000000 Binary files a/examples/StockPlot/StockPlot.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot.xcodeproj/project.pbxproj b/examples/StockPlot/StockPlot.xcodeproj/project.pbxproj deleted file mode 100644 index 798df5c6b..000000000 --- a/examples/StockPlot/StockPlot.xcodeproj/project.pbxproj +++ /dev/null @@ -1,411 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1D3623260D0F684500981E51 /* StockPlotAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* StockPlotAppDelegate.m */; }; - 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */; }; - 2899E5600DE3E45000AC0155 /* RootViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E55F0DE3E45000AC0155 /* RootViewController.xib */; }; - 28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD735F0D9D9599002E5188 /* MainWindow.xib */; }; - 28C286E10D94DF7D0034E888 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28C286E00D94DF7D0034E888 /* RootViewController.m */; }; - AB0363AA0FEF3681007B09A9 /* YHOO.plist in Resources */ = {isa = PBXBuildFile; fileRef = AB6FA6090FEB6DAA008DB04A /* YHOO.plist */; }; - AB0363AB0FEF3684007B09A9 /* MSFT.plist in Resources */ = {isa = PBXBuildFile; fileRef = AB6FA60A0FEB6DAA008DB04A /* MSFT.plist */; }; - AB0363AC0FEF3687007B09A9 /* GOOG.plist in Resources */ = {isa = PBXBuildFile; fileRef = AB6FA60B0FEB6DAA008DB04A /* GOOG.plist */; }; - AB0363AD0FEF368A007B09A9 /* AAPL.plist in Resources */ = {isa = PBXBuildFile; fileRef = AB6FA60C0FEB6DAA008DB04A /* AAPL.plist */; }; - AB0364770FEF4603007B09A9 /* caution.png in Resources */ = {isa = PBXBuildFile; fileRef = AB0364760FEF4603007B09A9 /* caution.png */; }; - AB4913C80FECC2B8008A08AB /* APYahooDataPuller.m in Sources */ = {isa = PBXBuildFile; fileRef = AB4913C60FECC2B8008A08AB /* APYahooDataPuller.m */; }; - AB4913C90FECC2B8008A08AB /* NSDictionary+APFinancialData.m in Sources */ = {isa = PBXBuildFile; fileRef = AB4913C70FECC2B8008A08AB /* NSDictionary+APFinancialData.m */; }; - AB6FA4A40FEB579B008DB04A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB6FA4A30FEB579B008DB04A /* QuartzCore.framework */; }; - AB6FA5590FEB6235008DB04A /* APYahooDataPullerGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = AB6FA5570FEB6235008DB04A /* APYahooDataPullerGraph.m */; }; - AB6FA55A0FEB6235008DB04A /* APYahooDataPullerGraph.xib in Resources */ = {isa = PBXBuildFile; fileRef = AB6FA5580FEB6235008DB04A /* APYahooDataPullerGraph.xib */; }; - C36157E919D79AAC0036ACDA /* Launch Screen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C36157E819D79AAC0036ACDA /* Launch Screen.xib */; }; - C3CD284817DE9D1F008EED1E /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3CD284717DE9D1F008EED1E /* Accelerate.framework */; }; - C3D3937019FD6CBF00148319 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C3D3936F19FD6CBF00148319 /* Images.xcassets */; }; - F7AE27940FFFBB84001F26F0 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F7AE27930FFFBB7A001F26F0 /* libCorePlot-CocoaTouch.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - AB03631D0FEF304A007B09A9 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = AB0363130FEF303D007B09A9 /* CorePlot-CocoaTouch.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = BC9B83460FB8A0A40035D8DA; - remoteInfo = "CorePlot-CocoaTouch"; - }; - F7AE27920FFFBB7A001F26F0 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = AB0363130FEF303D007B09A9 /* CorePlot-CocoaTouch.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = BC9B83470FB8A0A40035D8DA; - remoteInfo = "CorePlot-CocoaTouch"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1D3623240D0F684500981E51 /* StockPlotAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StockPlotAppDelegate.h; sourceTree = ""; }; - 1D3623250D0F684500981E51 /* StockPlotAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StockPlotAppDelegate.m; sourceTree = ""; }; - 1D6058910D05DD3D006BFB54 /* StockPlot.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StockPlot.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 2899E55F0DE3E45000AC0155 /* RootViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RootViewController.xib; sourceTree = ""; }; - 28A0AAE50D9B0CCF005BE974 /* StockPlot_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StockPlot_Prefix.pch; sourceTree = ""; }; - 28AD735F0D9D9599002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; - 28C286DF0D94DF7D0034E888 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = ""; }; - 28C286E00D94DF7D0034E888 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = ""; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* StockPlot-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "StockPlot-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; - AB0363130FEF303D007B09A9 /* CorePlot-CocoaTouch.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "CorePlot-CocoaTouch.xcodeproj"; path = "../../framework/CorePlot-CocoaTouch.xcodeproj"; sourceTree = SOURCE_ROOT; }; - AB0364760FEF4603007B09A9 /* caution.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = caution.png; sourceTree = SOURCE_ROOT; }; - AB4913C50FECC2B8008A08AB /* APYahooDataPuller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = APYahooDataPuller.h; path = Classes/APYahooDataPuller.h; sourceTree = SOURCE_ROOT; }; - AB4913C60FECC2B8008A08AB /* APYahooDataPuller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = APYahooDataPuller.m; path = Classes/APYahooDataPuller.m; sourceTree = SOURCE_ROOT; }; - AB4913C70FECC2B8008A08AB /* NSDictionary+APFinancialData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSDictionary+APFinancialData.m"; path = "Classes/NSDictionary+APFinancialData.m"; sourceTree = SOURCE_ROOT; }; - AB6FA4A30FEB579B008DB04A /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - AB6FA4DE0FEB59DB008DB04A /* NSDictionary+APFinancialData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+APFinancialData.h"; sourceTree = ""; }; - AB6FA5560FEB6235008DB04A /* APYahooDataPullerGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APYahooDataPullerGraph.h; sourceTree = ""; }; - AB6FA5570FEB6235008DB04A /* APYahooDataPullerGraph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = APYahooDataPullerGraph.m; sourceTree = ""; }; - AB6FA5580FEB6235008DB04A /* APYahooDataPullerGraph.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = APYahooDataPullerGraph.xib; path = Classes/APYahooDataPullerGraph.xib; sourceTree = ""; }; - AB6FA6090FEB6DAA008DB04A /* YHOO.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = YHOO.plist; sourceTree = SOURCE_ROOT; }; - AB6FA60A0FEB6DAA008DB04A /* MSFT.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = MSFT.plist; sourceTree = SOURCE_ROOT; }; - AB6FA60B0FEB6DAA008DB04A /* GOOG.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = GOOG.plist; sourceTree = SOURCE_ROOT; }; - AB6FA60C0FEB6DAA008DB04A /* AAPL.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = AAPL.plist; sourceTree = SOURCE_ROOT; }; - C36157E819D79AAC0036ACDA /* Launch Screen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "Launch Screen.xib"; sourceTree = ""; }; - C3CA9B5B19E203B2008DF7A3 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = ../../framework/CorePlotWarnings.xcconfig; sourceTree = ""; }; - C3CD284717DE9D1F008EED1E /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; - C3D3936F19FD6CBF00148319 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = StockPlot/Images.xcassets; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F7AE27940FFFBB84001F26F0 /* libCorePlot-CocoaTouch.a in Frameworks */, - 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, - 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */, - AB6FA4A40FEB579B008DB04A /* QuartzCore.framework in Frameworks */, - C3CD284817DE9D1F008EED1E /* Accelerate.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 080E96DDFE201D6D7F000001 /* Classes */ = { - isa = PBXGroup; - children = ( - AB4913C50FECC2B8008A08AB /* APYahooDataPuller.h */, - AB4913C60FECC2B8008A08AB /* APYahooDataPuller.m */, - AB6FA4DE0FEB59DB008DB04A /* NSDictionary+APFinancialData.h */, - AB4913C70FECC2B8008A08AB /* NSDictionary+APFinancialData.m */, - 28C286DF0D94DF7D0034E888 /* RootViewController.h */, - 28C286E00D94DF7D0034E888 /* RootViewController.m */, - 1D3623240D0F684500981E51 /* StockPlotAppDelegate.h */, - 1D3623250D0F684500981E51 /* StockPlotAppDelegate.m */, - AB6FA5560FEB6235008DB04A /* APYahooDataPullerGraph.h */, - AB6FA5570FEB6235008DB04A /* APYahooDataPullerGraph.m */, - ); - path = Classes; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 1D6058910D05DD3D006BFB54 /* StockPlot.app */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - AB0363130FEF303D007B09A9 /* CorePlot-CocoaTouch.xcodeproj */, - 080E96DDFE201D6D7F000001 /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - indentWidth = 4; - name = CustomTemplate; - sourceTree = ""; - tabWidth = 4; - usesTabs = 0; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 28A0AAE50D9B0CCF005BE974 /* StockPlot_Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main.m */, - C3CA9B5B19E203B2008DF7A3 /* CorePlotWarnings.xcconfig */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - C3D3936F19FD6CBF00148319 /* Images.xcassets */, - AB0364760FEF4603007B09A9 /* caution.png */, - AB6FA6090FEB6DAA008DB04A /* YHOO.plist */, - AB6FA60A0FEB6DAA008DB04A /* MSFT.plist */, - AB6FA60B0FEB6DAA008DB04A /* GOOG.plist */, - AB6FA60C0FEB6DAA008DB04A /* AAPL.plist */, - AB6FA5580FEB6235008DB04A /* APYahooDataPullerGraph.xib */, - 2899E55F0DE3E45000AC0155 /* RootViewController.xib */, - 28AD735F0D9D9599002E5188 /* MainWindow.xib */, - 8D1107310486CEB800E47090 /* StockPlot-Info.plist */, - C36157E819D79AAC0036ACDA /* Launch Screen.xib */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, - 1D30AB110D05D00D00671497 /* Foundation.framework */, - 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */, - AB6FA4A30FEB579B008DB04A /* QuartzCore.framework */, - C3CD284717DE9D1F008EED1E /* Accelerate.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - AB0363140FEF303D007B09A9 /* Products */ = { - isa = PBXGroup; - children = ( - F7AE27930FFFBB7A001F26F0 /* libCorePlot-CocoaTouch.a */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 1D6058900D05DD3D006BFB54 /* StockPlot */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "StockPlot" */; - buildPhases = ( - 1D60588D0D05DD3D006BFB54 /* Resources */, - 1D60588E0D05DD3D006BFB54 /* Sources */, - 1D60588F0D05DD3D006BFB54 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - AB03631E0FEF304A007B09A9 /* PBXTargetDependency */, - ); - name = StockPlot; - productName = StockPlot; - productReference = 1D6058910D05DD3D006BFB54 /* StockPlot.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0700; - TargetAttributes = { - 1D6058900D05DD3D006BFB54 = { - DevelopmentTeam = 28ZA45DE7D; - }; - }; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "StockPlot" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - en, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = AB0363140FEF303D007B09A9 /* Products */; - ProjectRef = AB0363130FEF303D007B09A9 /* CorePlot-CocoaTouch.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 1D6058900D05DD3D006BFB54 /* StockPlot */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - F7AE27930FFFBB7A001F26F0 /* libCorePlot-CocoaTouch.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libCorePlot-CocoaTouch.a"; - remoteRef = F7AE27920FFFBB7A001F26F0 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 1D60588D0D05DD3D006BFB54 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */, - 2899E5600DE3E45000AC0155 /* RootViewController.xib in Resources */, - AB6FA55A0FEB6235008DB04A /* APYahooDataPullerGraph.xib in Resources */, - AB0363AA0FEF3681007B09A9 /* YHOO.plist in Resources */, - C3D3937019FD6CBF00148319 /* Images.xcassets in Resources */, - AB0363AB0FEF3684007B09A9 /* MSFT.plist in Resources */, - AB0363AC0FEF3687007B09A9 /* GOOG.plist in Resources */, - AB0363AD0FEF368A007B09A9 /* AAPL.plist in Resources */, - AB0364770FEF4603007B09A9 /* caution.png in Resources */, - C36157E919D79AAC0036ACDA /* Launch Screen.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 1D60588E0D05DD3D006BFB54 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 1D60589B0D05DD56006BFB54 /* main.m in Sources */, - 1D3623260D0F684500981E51 /* StockPlotAppDelegate.m in Sources */, - 28C286E10D94DF7D0034E888 /* RootViewController.m in Sources */, - AB6FA5590FEB6235008DB04A /* APYahooDataPullerGraph.m in Sources */, - AB4913C80FECC2B8008A08AB /* APYahooDataPuller.m in Sources */, - AB4913C90FECC2B8008A08AB /* NSDictionary+APFinancialData.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - AB03631E0FEF304A007B09A9 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "CorePlot-CocoaTouch"; - targetProxy = AB03631D0FEF304A007B09A9 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 1D6058940D05DD3E006BFB54 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = StockPlot_Prefix.pch; - HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = "StockPlot-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; - PRODUCT_NAME = StockPlot; - }; - name = Debug; - }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - CLANG_ENABLE_OBJC_ARC = YES; - CODE_SIGN_IDENTITY = "iPhone Distribution"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; - COPY_PHASE_STRIP = NO; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = StockPlot_Prefix.pch; - HEADER_SEARCH_PATHS = ""; - INFOPLIST_FILE = "StockPlot-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "org.CorePlot.${PRODUCT_NAME:identifier}"; - PRODUCT_NAME = StockPlot; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3CA9B5B19E203B2008DF7A3 /* CorePlotWarnings.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - SDKROOT = iphoneos; - SYMROOT = "$(SRCROOT)/../../build"; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C3CA9B5B19E203B2008DF7A3 /* CorePlotWarnings.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; - OTHER_LDFLAGS = ( - "-all_load", - "-ObjC", - ); - SDKROOT = iphoneos; - USER_HEADER_SEARCH_PATHS = "\"${PROJECT_DIR}/../../framework\"/**"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "StockPlot" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1D6058940D05DD3E006BFB54 /* Debug */, - 1D6058950D05DD3E006BFB54 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "StockPlot" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/examples/StockPlot/StockPlot.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/StockPlot/StockPlot.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 3318309c7..000000000 --- a/examples/StockPlot/StockPlot.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Contents.json b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 340f2376e..000000000 --- a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "images" : [ - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-Small@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-Spotlight-40@2x.png", - "scale" : "2x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon.png", - "scale" : "1x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "Icon@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-60@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png deleted file mode 100644 index 5ce9f6593..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png deleted file mode 100644 index 0786734de..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Small.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Small.png deleted file mode 100644 index a40598c34..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Small.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png deleted file mode 100644 index e4b5c2785..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png deleted file mode 100644 index 390cd034f..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon.png deleted file mode 100644 index ac669215a..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon@2x.png b/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon@2x.png deleted file mode 100644 index dd7353607..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/AppIcon.appiconset/Icon@2x.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot/Images.xcassets/LaunchImage.launchimage/Contents.json b/examples/StockPlot/StockPlot/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index f0fce5477..000000000 --- a/examples/StockPlot/StockPlot/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "filename" : "Default-568h@2x.png", - "minimum-system-version" : "7.0", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "scale" : "1x", - "orientation" : "portrait" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "orientation" : "portrait" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "filename" : "Default-568h@2x.png", - "subtype" : "retina4", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "minimum-system-version" : "7.0", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/examples/StockPlot/StockPlot/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png b/examples/StockPlot/StockPlot/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png deleted file mode 100644 index 0891b7aab..000000000 Binary files a/examples/StockPlot/StockPlot/Images.xcassets/LaunchImage.launchimage/Default-568h@2x.png and /dev/null differ diff --git a/examples/StockPlot/StockPlot_Prefix.pch b/examples/StockPlot/StockPlot_Prefix.pch deleted file mode 100644 index d6179e313..000000000 --- a/examples/StockPlot/StockPlot_Prefix.pch +++ /dev/null @@ -1,14 +0,0 @@ -// -// Prefix header for all source files of the 'StockPlot' target in the 'StockPlot' project -// -#import - -#ifndef __IPHONE_3_0 -#warning "This project uses features only available in iPhone SDK 3.0 and later." -#endif - - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/examples/StockPlot/YHOO.plist b/examples/StockPlot/YHOO.plist deleted file mode 100644 index 08a118eac..000000000 --- a/examples/StockPlot/YHOO.plist +++ /dev/null @@ -1,1107 +0,0 @@ - - - - - endDate - 2009-06-19T06:53:47Z - financialData - - - adjClose - 15.34 - close - 15.34 - date - 2009-06-18T04:00:00Z - high - 15.64 - low - 15.23 - open - 15.62 - volume - 16185400 - - - adjClose - 15.6 - close - 15.6 - date - 2009-06-17T04:00:00Z - high - 16.03 - low - 15.46 - open - 15.91 - volume - 16159600 - - - adjClose - 15.96 - close - 15.96 - date - 2009-06-16T04:00:00Z - high - 16.38 - low - 15.9 - open - 16.33 - volume - 15116000 - - - adjClose - 16.4 - close - 16.4 - date - 2009-06-15T04:00:00Z - high - 16.68 - low - 16.13 - open - 16.56 - volume - 23251700 - - - adjClose - 16.4 - close - 16.4 - date - 2009-06-12T04:00:00Z - high - 16.47 - low - 16.1 - open - 16.17 - volume - 16962900 - - - adjClose - 16.19 - close - 16.19 - date - 2009-06-11T04:00:00Z - high - 16.46 - low - 16.15 - open - 16.26 - volume - 14787400 - - - adjClose - 16.32 - close - 16.32 - date - 2009-06-10T04:00:00Z - high - 16.72 - low - 16.1 - open - 16.7 - volume - 15761000 - - - adjClose - 16.4 - close - 16.4 - date - 2009-06-09T04:00:00Z - high - 16.5 - low - 16.18 - open - 16.23 - volume - 13083200 - - - adjClose - 16.19 - close - 16.19 - date - 2009-06-08T04:00:00Z - high - 16.49 - low - 16.04 - open - 16.47 - volume - 13680700 - - - adjClose - 16.64 - close - 16.64 - date - 2009-06-05T04:00:00Z - high - 16.99 - low - 16.3 - open - 16.77 - volume - 17311400 - - - adjClose - 16.65 - close - 16.65 - date - 2009-06-04T04:00:00Z - high - 16.71 - low - 16.04 - open - 16.4 - volume - 19001400 - - - adjClose - 16.3 - close - 16.3 - date - 2009-06-03T04:00:00Z - high - 16.5 - low - 15.67 - open - 16.5 - volume - 26358100 - - - adjClose - 16.62 - close - 16.62 - date - 2009-06-02T04:00:00Z - high - 16.75 - low - 16.25 - open - 16.6 - volume - 15286700 - - - adjClose - 16.58 - close - 16.58 - date - 2009-06-01T04:00:00Z - high - 16.65 - low - 16.13 - open - 16.17 - volume - 27926100 - - - adjClose - 15.84 - close - 15.84 - date - 2009-05-29T04:00:00Z - high - 15.84 - low - 15.11 - open - 15.19 - volume - 29557500 - - - adjClose - 15.09 - close - 15.09 - date - 2009-05-28T04:00:00Z - high - 15.24 - low - 14.69 - open - 15.09 - volume - 19131600 - - - adjClose - 14.94 - close - 14.94 - date - 2009-05-27T04:00:00Z - high - 15.53 - low - 14.88 - open - 15.27 - volume - 18977400 - - - adjClose - 15.28 - close - 15.28 - date - 2009-05-26T04:00:00Z - high - 15.44 - low - 14.67 - open - 14.68 - volume - 19953000 - - - adjClose - 14.98 - close - 14.98 - date - 2009-05-22T04:00:00Z - high - 15.17 - low - 14.75 - open - 14.89 - volume - 19150500 - - - adjClose - 14.87 - close - 14.87 - date - 2009-05-21T04:00:00Z - high - 15.12 - low - 14.62 - open - 14.92 - volume - 15186800 - - - adjClose - 14.96 - close - 14.96 - date - 2009-05-20T04:00:00Z - high - 15.31 - low - 14.8 - open - 15.08 - volume - 15781600 - - - adjClose - 15.18 - close - 15.18 - date - 2009-05-19T04:00:00Z - high - 15.34 - low - 15.02 - open - 15.06 - volume - 13676000 - - - adjClose - 15.17 - close - 15.17 - date - 2009-05-18T04:00:00Z - high - 15.18 - low - 14.74 - open - 15.1 - volume - 18629500 - - - adjClose - 14.91 - close - 14.91 - date - 2009-05-15T04:00:00Z - high - 15.1 - low - 14.86 - open - 15 - volume - 22525900 - - - adjClose - 14.76 - close - 14.76 - date - 2009-05-14T04:00:00Z - high - 14.86 - low - 14.4 - open - 14.5 - volume - 20841800 - - - adjClose - 14.52 - close - 14.52 - date - 2009-05-13T04:00:00Z - high - 14.95 - low - 14.5 - open - 14.92 - volume - 23585400 - - - adjClose - 15.1 - close - 15.1 - date - 2009-05-12T04:00:00Z - high - 15.5 - low - 14.9 - open - 15.5 - volume - 31403300 - - - adjClose - 15.54 - close - 15.54 - date - 2009-05-11T04:00:00Z - high - 15.83 - low - 14.81 - open - 14.9 - volume - 39492400 - - - adjClose - 15.15 - close - 15.15 - date - 2009-05-08T04:00:00Z - high - 15.3 - low - 14.7 - open - 14.88 - volume - 22461200 - - - adjClose - 14.8 - close - 14.8 - date - 2009-05-07T04:00:00Z - high - 15.1 - low - 14.38 - open - 15.03 - volume - 24328500 - - - adjClose - 14.85 - close - 14.85 - date - 2009-05-06T04:00:00Z - high - 15 - low - 14.52 - open - 14.8 - volume - 19105800 - - - adjClose - 14.74 - close - 14.74 - date - 2009-05-05T04:00:00Z - high - 14.99 - low - 14.18 - open - 14.55 - volume - 35233200 - - - adjClose - 14.18 - close - 14.18 - date - 2009-05-04T04:00:00Z - high - 14.25 - low - 13.96 - open - 14.2 - volume - 25094600 - - - adjClose - 14.14 - close - 14.14 - date - 2009-05-01T04:00:00Z - high - 14.5 - low - 13.91 - open - 14.5 - volume - 23721700 - - - adjClose - 14.29 - close - 14.29 - date - 2009-04-30T04:00:00Z - high - 14.6 - low - 14.12 - open - 14.12 - volume - 25883300 - - - adjClose - 14.02 - close - 14.02 - date - 2009-04-29T04:00:00Z - high - 14.35 - low - 13.7 - open - 13.7 - volume - 16570900 - - - adjClose - 13.64 - close - 13.64 - date - 2009-04-28T04:00:00Z - high - 14.05 - low - 13.6 - open - 13.74 - volume - 18856500 - - - adjClose - 13.89 - close - 13.89 - date - 2009-04-27T04:00:00Z - high - 14.55 - low - 13.88 - open - 14.48 - volume - 22640600 - - - adjClose - 14.73 - close - 14.73 - date - 2009-04-24T04:00:00Z - high - 14.94 - low - 14.36 - open - 14.79 - volume - 25803000 - - - adjClose - 14.55 - close - 14.55 - date - 2009-04-23T04:00:00Z - high - 14.74 - low - 14.11 - open - 14.56 - volume - 32943200 - - - adjClose - 14.48 - close - 14.48 - date - 2009-04-22T04:00:00Z - high - 15.39 - low - 14.41 - open - 14.62 - volume - 65407800 - - - adjClose - 14.38 - close - 14.38 - date - 2009-04-21T04:00:00Z - high - 14.59 - low - 13.71 - open - 13.94 - volume - 54237700 - - - adjClose - 13.66 - close - 13.66 - date - 2009-04-20T04:00:00Z - high - 14.25 - low - 13.6 - open - 14.16 - volume - 13470500 - - - adjClose - 14.39 - close - 14.39 - date - 2009-04-17T04:00:00Z - high - 14.52 - low - 14.03 - open - 14.43 - volume - 19800400 - - - adjClose - 14.43 - close - 14.43 - date - 2009-04-16T04:00:00Z - high - 14.53 - low - 14.05 - open - 14.15 - volume - 19156500 - - - adjClose - 14.02 - close - 14.02 - date - 2009-04-15T04:00:00Z - high - 14.09 - low - 13.77 - open - 13.93 - volume - 12383200 - - - adjClose - 14.07 - close - 14.07 - date - 2009-04-14T04:00:00Z - high - 14.42 - low - 14 - open - 14.4 - volume - 15151700 - - - adjClose - 14.42 - close - 14.42 - date - 2009-04-13T04:00:00Z - high - 14.54 - low - 13.86 - open - 14.02 - volume - 35067600 - - - adjClose - 13.47 - close - 13.47 - date - 2009-04-09T04:00:00Z - high - 13.59 - low - 13.07 - open - 13.14 - volume - 17285800 - - - adjClose - 12.92 - close - 12.92 - date - 2009-04-08T04:00:00Z - high - 13.01 - low - 12.75 - open - 12.9 - volume - 11241000 - - - adjClose - 12.81 - close - 12.81 - date - 2009-04-07T04:00:00Z - high - 13.1 - low - 12.68 - open - 13 - volume - 12306400 - - - adjClose - 13.23 - close - 13.23 - date - 2009-04-06T04:00:00Z - high - 13.24 - low - 12.99 - open - 13.08 - volume - 11935700 - - - adjClose - 13.34 - close - 13.34 - date - 2009-04-03T04:00:00Z - high - 13.39 - low - 12.78 - open - 12.95 - volume - 18534900 - - - adjClose - 12.95 - close - 12.95 - date - 2009-04-02T04:00:00Z - high - 13.14 - low - 12.8 - open - 13.04 - volume - 28823100 - - - adjClose - 12.75 - close - 12.75 - date - 2009-04-01T04:00:00Z - high - 13.12 - low - 12.6 - open - 12.7 - volume - 14540400 - - - adjClose - 12.81 - close - 12.81 - date - 2009-03-31T04:00:00Z - high - 13.1 - low - 12.67 - open - 12.76 - volume - 11882100 - - - adjClose - 12.7 - close - 12.7 - date - 2009-03-30T04:00:00Z - high - 13.14 - low - 12.51 - open - 12.93 - volume - 16558800 - - - adjClose - 13.18 - close - 13.18 - date - 2009-03-27T04:00:00Z - high - 13.61 - low - 13.12 - open - 13.17 - volume - 22426200 - - - adjClose - 13.35 - close - 13.35 - date - 2009-03-26T04:00:00Z - high - 13.61 - low - 13 - open - 13.55 - volume - 24223400 - - - adjClose - 13.55 - close - 13.55 - date - 2009-03-25T04:00:00Z - high - 13.88 - low - 13.35 - open - 13.69 - volume - 16746400 - - - adjClose - 13.63 - close - 13.63 - date - 2009-03-24T04:00:00Z - high - 14.02 - low - 13.56 - open - 13.98 - volume - 17293600 - - - adjClose - 14.09 - close - 14.09 - date - 2009-03-23T04:00:00Z - high - 14.12 - low - 13.62 - open - 13.79 - volume - 18200000 - - - adjClose - 13.6 - close - 13.6 - date - 2009-03-20T04:00:00Z - high - 13.87 - low - 13.51 - open - 13.63 - volume - 22079300 - - - adjClose - 13.74 - close - 13.74 - date - 2009-03-19T04:00:00Z - high - 14.14 - low - 13.61 - open - 13.68 - volume - 25954300 - - - adjClose - 13.42 - close - 13.42 - date - 2009-03-18T04:00:00Z - high - 13.95 - low - 13.23 - open - 13.81 - volume - 26324300 - - - adjClose - 13.99 - close - 13.99 - date - 2009-03-17T04:00:00Z - high - 14.04 - low - 13.22 - open - 13.35 - volume - 16719400 - - - adjClose - 13.22 - close - 13.22 - date - 2009-03-16T04:00:00Z - high - 13.66 - low - 13.2 - open - 13.66 - volume - 19448800 - - - adjClose - 13.51 - close - 13.51 - date - 2009-03-13T04:00:00Z - high - 13.64 - low - 13.27 - open - 13.58 - volume - 12522600 - - - overallHigh - 16.99 - overallLow - 12.51 - startDate - 2009-03-13T06:53:47Z - symbol - YHOO - - diff --git a/examples/StockPlot/caution.png b/examples/StockPlot/caution.png deleted file mode 100644 index ec4b70669..000000000 Binary files a/examples/StockPlot/caution.png and /dev/null differ diff --git a/examples/StockPlot/main.m b/examples/StockPlot/main.m deleted file mode 100644 index 9ca0680af..000000000 --- a/examples/StockPlot/main.m +++ /dev/null @@ -1,18 +0,0 @@ -// -// main.m -// StockPlot -// -// Created by Jonathan Saggau on 6/19/09. -// Copyright __MyCompanyName__ 2009. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) -{ - @autoreleasepool { - int retVal = UIApplicationMain(argc, argv, nil, nil); - - return retVal; - } -} diff --git a/framework/CocoaPods/CorePlot.h b/framework/CocoaPods/CorePlot.h index 93a0fbd03..c3660a97e 100644 --- a/framework/CocoaPods/CorePlot.h +++ b/framework/CocoaPods/CorePlot.h @@ -1,4 +1,6 @@ -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#import "TargetConditionals.h" + +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #import #import #else @@ -36,19 +38,19 @@ #import "CPTLineCap.h" #import "CPTLineStyle.h" #import "CPTMutableLineStyle.h" -#import "CPTMutableNumericData.h" #import "CPTMutableNumericData+TypeConversion.h" +#import "CPTMutableNumericData.h" #import "CPTMutablePlotRange.h" #import "CPTMutableShadow.h" #import "CPTMutableTextStyle.h" -#import "CPTNumericData.h" #import "CPTNumericData+TypeConversion.h" +#import "CPTNumericData.h" #import "CPTNumericDataType.h" +#import "CPTPathExtensions.h" #import "CPTPieChart.h" +#import "CPTPlatformSpecificCategories.h" #import "CPTPlatformSpecificDefines.h" #import "CPTPlatformSpecificFunctions.h" -#import "CPTPlatformSpecificCategories.h" -#import "CPTPathExtensions.h" #import "CPTPlot.h" #import "CPTPlotArea.h" #import "CPTPlotAreaFrame.h" diff --git a/framework/CorePlot-CocoaTouch.h b/framework/CorePlot-CocoaTouch.h index 9be2b42d5..5b8bd9349 100644 --- a/framework/CorePlot-CocoaTouch.h +++ b/framework/CorePlot-CocoaTouch.h @@ -32,19 +32,19 @@ #import "CPTLineCap.h" #import "CPTLineStyle.h" #import "CPTMutableLineStyle.h" -#import "CPTMutableNumericData.h" #import "CPTMutableNumericData+TypeConversion.h" +#import "CPTMutableNumericData.h" #import "CPTMutablePlotRange.h" #import "CPTMutableShadow.h" #import "CPTMutableTextStyle.h" -#import "CPTNumericData.h" #import "CPTNumericData+TypeConversion.h" +#import "CPTNumericData.h" #import "CPTNumericDataType.h" +#import "CPTPathExtensions.h" #import "CPTPieChart.h" +#import "CPTPlatformSpecificCategories.h" #import "CPTPlatformSpecificDefines.h" #import "CPTPlatformSpecificFunctions.h" -#import "CPTPlatformSpecificCategories.h" -#import "CPTPathExtensions.h" #import "CPTPlot.h" #import "CPTPlotArea.h" #import "CPTPlotAreaFrame.h" diff --git a/framework/CorePlot-CocoaTouch.xcodeproj/project.pbxproj b/framework/CorePlot-CocoaTouch.xcodeproj/project.pbxproj deleted file mode 100644 index c97d4c4ef..000000000 --- a/framework/CorePlot-CocoaTouch.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1358 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXAggregateTarget section */ - 0799D97A137318CF0026072C /* Universal Library */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 0799D97D137318CF0026072C /* Build configuration list for PBXAggregateTarget "Universal Library" */; - buildPhases = ( - 0799D97F137318D80026072C /* ShellScript */, - ); - dependencies = ( - ); - name = "Universal Library"; - productName = "Universal Library"; - }; - C3566B8010EED04900FB3866 /* Documentation */ = { - isa = PBXAggregateTarget; - buildConfigurationList = C3566B8410EED06800FB3866 /* Build configuration list for PBXAggregateTarget "Documentation" */; - buildPhases = ( - C3566B7F10EED04900FB3866 /* ShellScript */, - ); - dependencies = ( - ); - name = Documentation; - productName = Documentation; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 070CB82A0FC9DE4B00F3152B /* CPTGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82990FB89E610035D8DA /* CPTGradient.m */; }; - 070CB82B0FC9DE5500F3152B /* CPTImage.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B829B0FB89E610035D8DA /* CPTImage.m */; }; - 070CB82C0FC9DE5600F3152B /* CPTLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82700FB89E610035D8DA /* CPTLayer.m */; }; - 070CB82D0FC9DE5700F3152B /* CPTLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B829D0FB89E610035D8DA /* CPTLineStyle.m */; }; - 070CB8340FC9DEA800F3152B /* CPTColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 070CB8300FC9DEA800F3152B /* CPTColor.h */; settings = {ATTRIBUTES = (); }; }; - 070CB8350FC9DEA800F3152B /* CPTColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 070CB8310FC9DEA800F3152B /* CPTColor.m */; }; - 070CB8360FC9DEA800F3152B /* CPTColorSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 070CB8320FC9DEA800F3152B /* CPTColorSpace.h */; settings = {ATTRIBUTES = (); }; }; - 070CB8370FC9DEA800F3152B /* CPTColorSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 070CB8330FC9DEA800F3152B /* CPTColorSpace.m */; }; - 070CB8430FC9DED400F3152B /* CPTAxis.h in Headers */ = {isa = PBXBuildFile; fileRef = 070CB8390FC9DED400F3152B /* CPTAxis.h */; settings = {ATTRIBUTES = (); }; }; - 070CB8440FC9DED400F3152B /* CPTAxis.m in Sources */ = {isa = PBXBuildFile; fileRef = 070CB83A0FC9DED400F3152B /* CPTAxis.m */; }; - 070CB8470FC9DED400F3152B /* CPTAxisSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 070CB83D0FC9DED400F3152B /* CPTAxisSet.h */; settings = {ATTRIBUTES = (); }; }; - 070CB8480FC9DED400F3152B /* CPTAxisSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 070CB83E0FC9DED400F3152B /* CPTAxisSet.m */; }; - 070CB85E0FC9DF4700F3152B /* CPTTextLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B829F0FB89E610035D8DA /* CPTTextLayer.m */; }; - 0718DE4D11D1EDBA00AF4851 /* CPTAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0718DE4511D1EDBA00AF4851 /* CPTAnnotation.h */; settings = {ATTRIBUTES = (); }; }; - 0718DE4E11D1EDBA00AF4851 /* CPTAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0718DE4611D1EDBA00AF4851 /* CPTAnnotation.m */; }; - 0718DE4F11D1EDBA00AF4851 /* CPTAnnotationHostLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0718DE4711D1EDBA00AF4851 /* CPTAnnotationHostLayer.h */; settings = {ATTRIBUTES = (); }; }; - 0718DE5011D1EDBA00AF4851 /* CPTAnnotationHostLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0718DE4811D1EDBA00AF4851 /* CPTAnnotationHostLayer.m */; }; - 0718DE5111D1EDBA00AF4851 /* CPTLayerAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0718DE4911D1EDBA00AF4851 /* CPTLayerAnnotation.h */; settings = {ATTRIBUTES = (); }; }; - 0718DE5211D1EDBA00AF4851 /* CPTLayerAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0718DE4A11D1EDBA00AF4851 /* CPTLayerAnnotation.m */; }; - 0718DE5311D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0718DE4B11D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.h */; settings = {ATTRIBUTES = (); }; }; - 0718DE5411D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 0718DE4C11D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.m */; }; - 072E3F9F0FE2FF7300ACF62F /* CPTTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = 072E3F9B0FE2FF7300ACF62F /* CPTTheme.h */; settings = {ATTRIBUTES = (); }; }; - 072E3FA00FE2FF7300ACF62F /* CPTTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 072E3F9C0FE2FF7300ACF62F /* CPTTheme.m */; }; - 074D7BC50FD6B65F006011BC /* CPTXYPlotSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 074D7BC30FD6B65E006011BC /* CPTXYPlotSpace.h */; settings = {ATTRIBUTES = (); }; }; - 074D7BC60FD6B65F006011BC /* CPTXYPlotSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 074D7BC40FD6B65F006011BC /* CPTXYPlotSpace.m */; }; - 074FADF9112024C500394B90 /* CPTConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 074FADF7112024C500394B90 /* CPTConstraints.h */; settings = {ATTRIBUTES = (); }; }; - 074FADFA112024C500394B90 /* CPTConstraints.m in Sources */ = {isa = PBXBuildFile; fileRef = 074FADF8112024C500394B90 /* CPTConstraints.m */; }; - 0772B4F310E26A12009CD04C /* CPTTradingRangePlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 0772B4F110E26A12009CD04C /* CPTTradingRangePlot.h */; settings = {ATTRIBUTES = (); }; }; - 0772B4F410E26A12009CD04C /* CPTTradingRangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772B4F210E26A12009CD04C /* CPTTradingRangePlot.m */; }; - 077F28550FE18048000BCA52 /* CPTBorderedLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 077F28510FE18048000BCA52 /* CPTBorderedLayer.h */; settings = {ATTRIBUTES = (); }; }; - 077F28560FE18048000BCA52 /* CPTBorderedLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 077F28520FE18048000BCA52 /* CPTBorderedLayer.m */; }; - 077F28570FE18048000BCA52 /* CPTPathExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 077F28530FE18048000BCA52 /* CPTPathExtensions.h */; settings = {ATTRIBUTES = (); }; }; - 077F28580FE18048000BCA52 /* CPTPathExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 077F28540FE18048000BCA52 /* CPTPathExtensions.m */; }; - 0789EFBE0FB9F97F00C0A613 /* CPTPlatformSpecificCategories.h in Headers */ = {isa = PBXBuildFile; fileRef = 0789EFB80FB9F97F00C0A613 /* CPTPlatformSpecificCategories.h */; settings = {ATTRIBUTES = (); }; }; - 0789EFBF0FB9F97F00C0A613 /* CPTPlatformSpecificCategories.m in Sources */ = {isa = PBXBuildFile; fileRef = 0789EFB90FB9F97F00C0A613 /* CPTPlatformSpecificCategories.m */; }; - 0789EFC00FB9F97F00C0A613 /* CPTPlatformSpecificDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0789EFBA0FB9F97F00C0A613 /* CPTPlatformSpecificDefines.h */; settings = {ATTRIBUTES = (); }; }; - 0789EFC10FB9F97F00C0A613 /* CPTPlatformSpecificDefines.m in Sources */ = {isa = PBXBuildFile; fileRef = 0789EFBB0FB9F97F00C0A613 /* CPTPlatformSpecificDefines.m */; }; - 0789EFC20FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0789EFBC0FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.h */; settings = {ATTRIBUTES = (); }; }; - 0789EFC30FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = 0789EFBD0FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.m */; }; - 07A2E71E102DFAD300809BC5 /* CPTTimeFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 07A2E71C102DFAD300809BC5 /* CPTTimeFormatter.h */; settings = {ATTRIBUTES = (); }; }; - 07A2E71F102DFAD300809BC5 /* CPTTimeFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 07A2E71D102DFAD300809BC5 /* CPTTimeFormatter.m */; }; - 07A5E24C104E47E900B7AB80 /* CPTTextLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B829E0FB89E610035D8DA /* CPTTextLayer.h */; settings = {ATTRIBUTES = (); }; }; - 07A62FB50FE2234900CD765C /* CPTTextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07A62FB30FE2234900CD765C /* CPTTextStyle.h */; settings = {ATTRIBUTES = (); }; }; - 07A62FB60FE2234900CD765C /* CPTTextStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07A62FB40FE2234900CD765C /* CPTTextStyle.m */; }; - 07AEF30310BBF99A0012BEFF /* CPTResponder.h in Headers */ = {isa = PBXBuildFile; fileRef = 07AEF30110BBF99A0012BEFF /* CPTResponder.h */; settings = {ATTRIBUTES = (); }; }; - 07B69AB912B6281100F4C16C /* CPTMutableTextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B69AB712B6281100F4C16C /* CPTMutableTextStyle.h */; settings = {ATTRIBUTES = (); }; }; - 07B69ABA12B6281100F4C16C /* CPTMutableTextStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69AB812B6281100F4C16C /* CPTMutableTextStyle.m */; }; - 07B69B7112B62E9600F4C16C /* CPTMutableLineStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B69B6F12B62E9600F4C16C /* CPTMutableLineStyle.h */; settings = {ATTRIBUTES = (); }; }; - 07B69B7212B62E9600F4C16C /* CPTMutableLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69B7012B62E9600F4C16C /* CPTMutableLineStyle.m */; }; - 07FCF2D4115B54DE00E46606 /* _CPTSlateTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 07FCF2D2115B54DE00E46606 /* _CPTSlateTheme.m */; }; - BC4FAF29100D7DF300811DD3 /* NSDecimalNumberExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82B10FB89E610035D8DA /* NSDecimalNumberExtensions.h */; settings = {ATTRIBUTES = (); }; }; - BC74A2C210FC087800E7E90D /* CPTPieChart.h in Headers */ = {isa = PBXBuildFile; fileRef = BC74A2C010FC087800E7E90D /* CPTPieChart.h */; settings = {ATTRIBUTES = (); }; }; - BC74A2C310FC087800E7E90D /* CPTPieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74A2C110FC087800E7E90D /* CPTPieChart.m */; }; - BC79F1D50FD1DC1A00510976 /* CPTGraphHostingView.h in Headers */ = {isa = PBXBuildFile; fileRef = BC79F1D30FD1DC1A00510976 /* CPTGraphHostingView.h */; settings = {ATTRIBUTES = (); }; }; - BC79F1D60FD1DC1A00510976 /* CPTGraphHostingView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC79F1D40FD1DC1A00510976 /* CPTGraphHostingView.m */; }; - BC89A79A1024AB19009D5261 /* CorePlotProbes.d in Sources */ = {isa = PBXBuildFile; fileRef = BC89A7991024AB19009D5261 /* CorePlotProbes.d */; }; - BC9B834E0FB8A1400035D8DA /* CPTPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82D30FB89E610035D8DA /* CPTPlot.m */; }; - BC9B834F0FB8A1400035D8DA /* CPTScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82D50FB89E610035D8DA /* CPTScatterPlot.m */; }; - BC9B83500FB8A1400035D8DA /* CPTBarPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82DB0FB89E610035D8DA /* CPTBarPlot.m */; }; - BC9B83510FB8A1400035D8DA /* CPTPlotSymbol.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82D10FB89E610035D8DA /* CPTPlotSymbol.m */; }; - BC9B83520FB8A1400035D8DA /* CPTPlotSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82C70FB89E610035D8DA /* CPTPlotSpace.m */; }; - BC9B83550FB8A1400035D8DA /* CPTPlotAreaFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82C20FB89E610035D8DA /* CPTPlotAreaFrame.m */; }; - BC9B83560FB8A1400035D8DA /* CPTGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82B70FB89E610035D8DA /* CPTGraph.m */; }; - BC9B83570FB8A1400035D8DA /* CPTXYGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82B90FB89E610035D8DA /* CPTXYGraph.m */; }; - BC9B835A0FB8A1400035D8DA /* NSDecimalNumberExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82B20FB89E610035D8DA /* NSDecimalNumberExtensions.m */; }; - BC9B835B0FB8A1400035D8DA /* NSNumberExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82B40FB89E610035D8DA /* NSNumberExtensions.m */; }; - BC9B835D0FB8A1400035D8DA /* CPTDefinitions.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82A40FB89E610035D8DA /* CPTDefinitions.m */; }; - BC9B835E0FB8A1400035D8DA /* CPTExceptions.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82A60FB89E610035D8DA /* CPTExceptions.m */; }; - BC9B835F0FB8A1400035D8DA /* CPTUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82A80FB89E610035D8DA /* CPTUtilities.m */; }; - BC9B83600FB8A1400035D8DA /* CPTPlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82AC0FB89E610035D8DA /* CPTPlotRange.m */; }; - BC9B83610FB8A1400035D8DA /* CPTFill.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B82890FB89E610035D8DA /* CPTFill.m */; }; - BC9B83620FB8A1400035D8DA /* _CPTFillColor.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B828B0FB89E610035D8DA /* _CPTFillColor.m */; }; - BC9B83630FB8A1400035D8DA /* _CPTFillGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B828D0FB89E610035D8DA /* _CPTFillGradient.m */; }; - BC9B83640FB8A1400035D8DA /* _CPTFillImage.m in Sources */ = {isa = PBXBuildFile; fileRef = BC9B828F0FB89E610035D8DA /* _CPTFillImage.m */; }; - BC9B836E0FB8A1700035D8DA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC9B82690FB89BD10035D8DA /* QuartzCore.framework */; }; - BC9B836F0FB8A1700035D8DA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; - BC9B83700FB8A1700035D8DA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; - BC9B83710FB8A1700035D8DA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; - BC9B83C30FB8AC4B0035D8DA /* CorePlot-CocoaTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B83C20FB8AC4B0035D8DA /* CorePlot-CocoaTouch.h */; settings = {ATTRIBUTES = (); }; }; - BCC7EA451006BF5700B39451 /* _CPTPlainBlackTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC7EA3F1006BF5700B39451 /* _CPTPlainBlackTheme.h */; settings = {ATTRIBUTES = (); }; }; - BCC7EA461006BF5700B39451 /* _CPTPlainBlackTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC7EA401006BF5700B39451 /* _CPTPlainBlackTheme.m */; }; - BCC7EA471006BF5700B39451 /* _CPTPlainWhiteTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC7EA411006BF5700B39451 /* _CPTPlainWhiteTheme.h */; settings = {ATTRIBUTES = (); }; }; - BCC7EA481006BF5700B39451 /* _CPTPlainWhiteTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC7EA421006BF5700B39451 /* _CPTPlainWhiteTheme.m */; }; - BCC7EA491006BF5700B39451 /* _CPTStocksTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC7EA431006BF5700B39451 /* _CPTStocksTheme.h */; settings = {ATTRIBUTES = (); }; }; - BCC7EA4A1006BF5700B39451 /* _CPTStocksTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BCC7EA441006BF5700B39451 /* _CPTStocksTheme.m */; }; - C304565313F4AC9A004D04BC /* _CPTDarkGradientTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = C304565213F4AC9A004D04BC /* _CPTDarkGradientTheme.h */; settings = {ATTRIBUTES = (); }; }; - C30550E91399BE2000E0151F /* CPTLegendEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = C30550E71399BE2000E0151F /* CPTLegendEntry.h */; settings = {ATTRIBUTES = (); }; }; - C30550EA1399BE2000E0151F /* CPTLegendEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = C30550E81399BE2000E0151F /* CPTLegendEntry.m */; }; - C30C85AB1047428100181766 /* CPTPlotGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C30C85A91047428100181766 /* CPTPlotGroup.h */; settings = {ATTRIBUTES = (); }; }; - C30C85AC1047428100181766 /* CPTPlotGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C30C85AA1047428100181766 /* CPTPlotGroup.m */; }; - C318F4C111EA18A400595FF9 /* CPTLimitBand.h in Headers */ = {isa = PBXBuildFile; fileRef = C318F4BF11EA18A400595FF9 /* CPTLimitBand.h */; settings = {ATTRIBUTES = (); }; }; - C318F4C211EA18A400595FF9 /* CPTLimitBand.m in Sources */ = {isa = PBXBuildFile; fileRef = C318F4C011EA18A400595FF9 /* CPTLimitBand.m */; }; - C31A40BF17ABD6C60020C5C6 /* CPTFunctionDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C31A40BD17ABD6C60020C5C6 /* CPTFunctionDataSource.h */; }; - C31A40C017ABD6C60020C5C6 /* CPTFunctionDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = C31A40BE17ABD6C60020C5C6 /* CPTFunctionDataSource.m */; }; - C3286C0715D8769800A436A8 /* _CPTMaskLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = C3286C0515D8769800A436A8 /* _CPTMaskLayer.h */; settings = {ATTRIBUTES = (); }; }; - C3286C0815D8769800A436A8 /* _CPTMaskLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3286C0615D8769800A436A8 /* _CPTMaskLayer.m */; }; - C32EE1BD13EC4AF900038266 /* CPTShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = C32EE1BB13EC4AF900038266 /* CPTShadow.h */; settings = {ATTRIBUTES = (); }; }; - C32EE1BE13EC4AF900038266 /* CPTShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = C32EE1BC13EC4AF900038266 /* CPTShadow.m */; }; - C32EE1C813EC4C7200038266 /* CPTMutableShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = C32EE1C613EC4C7200038266 /* CPTMutableShadow.h */; settings = {ATTRIBUTES = (); }; }; - C32EE1C913EC4C7200038266 /* CPTMutableShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = C32EE1C713EC4C7200038266 /* CPTMutableShadow.m */; }; - C3392A361225F63B008DA6BD /* CPTNumericData+TypeConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = C3392A351225F63B008DA6BD /* CPTNumericData+TypeConversion.m */; }; - C3408C4615FC1CA8004F1D70 /* _CPTBorderLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = C3408C4415FC1CA8004F1D70 /* _CPTBorderLayer.h */; settings = {ATTRIBUTES = (); }; }; - C3408C4715FC1CA8004F1D70 /* _CPTBorderLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3408C4515FC1CA8004F1D70 /* _CPTBorderLayer.m */; }; - C3436C4F13F4AC4400739AC2 /* _CPTDarkGradientTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = C3436C4E13F4AC4400739AC2 /* _CPTDarkGradientTheme.m */; }; - C3436C5113F4AC6000739AC2 /* _CPTSlateTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = C3436C5013F4AC6000739AC2 /* _CPTSlateTheme.h */; settings = {ATTRIBUTES = (); }; }; - C349DCB0151AAFAB00BFD6A7 /* CPTCalendarFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = C349DCAE151AAFAB00BFD6A7 /* CPTCalendarFormatter.h */; settings = {ATTRIBUTES = (); }; }; - C349DCB1151AAFAB00BFD6A7 /* CPTCalendarFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C349DCAF151AAFAB00BFD6A7 /* CPTCalendarFormatter.m */; }; - C35A65A511025EDF00FE24BB /* CPTPlotArea.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65A311025EDF00FE24BB /* CPTPlotArea.h */; settings = {ATTRIBUTES = (); }; }; - C35A65A611025EDF00FE24BB /* CPTPlotArea.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65A411025EDF00FE24BB /* CPTPlotArea.m */; }; - C35A65B311025F8A00FE24BB /* CPTGridLines.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65B111025F8A00FE24BB /* CPTGridLines.h */; settings = {ATTRIBUTES = (); }; }; - C35A65B411025F8A00FE24BB /* CPTGridLines.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65B211025F8A00FE24BB /* CPTGridLines.m */; }; - C35A65B911025FA900FE24BB /* CPTAxisLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65B511025FA900FE24BB /* CPTAxisLabel.h */; settings = {ATTRIBUTES = (); }; }; - C35A65BA11025FA900FE24BB /* CPTAxisLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65B611025FA900FE24BB /* CPTAxisLabel.m */; }; - C35A65BB11025FA900FE24BB /* CPTAxisTitle.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65B711025FA900FE24BB /* CPTAxisTitle.h */; settings = {ATTRIBUTES = (); }; }; - C35A65BC11025FA900FE24BB /* CPTAxisTitle.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65B811025FA900FE24BB /* CPTAxisTitle.m */; }; - C35A65BF11025FB300FE24BB /* CPTAxisLabelGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65BD11025FB300FE24BB /* CPTAxisLabelGroup.h */; settings = {ATTRIBUTES = (); }; }; - C35A65C011025FB300FE24BB /* CPTAxisLabelGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65BE11025FB300FE24BB /* CPTAxisLabelGroup.m */; }; - C35A65C711025FCC00FE24BB /* CPTXYAxis.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65C111025FCC00FE24BB /* CPTXYAxis.h */; settings = {ATTRIBUTES = (); }; }; - C35A65C811025FCC00FE24BB /* CPTXYAxis.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65C211025FCC00FE24BB /* CPTXYAxis.m */; }; - C35A65C911025FCC00FE24BB /* CPTXYAxisSet.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A65C311025FCC00FE24BB /* CPTXYAxisSet.h */; settings = {ATTRIBUTES = (); }; }; - C35A65CA11025FCC00FE24BB /* CPTXYAxisSet.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A65C411025FCC00FE24BB /* CPTXYAxisSet.m */; }; - C35A66071102723E00FE24BB /* CPTTextStylePlatformSpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = C35A66051102723E00FE24BB /* CPTTextStylePlatformSpecific.h */; settings = {ATTRIBUTES = (); }; }; - C35A66081102723E00FE24BB /* CPTTextStylePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C35A66061102723E00FE24BB /* CPTTextStylePlatformSpecific.m */; }; - C3791D05191D4C2F001EC514 /* CPTImagePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C3791D03191D4C2F001EC514 /* CPTImagePlatformSpecific.m */; }; - C38DD49711A04B99002A68E7 /* CPTGridLineGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C38DD49511A04B99002A68E7 /* CPTGridLineGroup.h */; settings = {ATTRIBUTES = (); }; }; - C38DD49811A04B99002A68E7 /* CPTGridLineGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C38DD49611A04B99002A68E7 /* CPTGridLineGroup.m */; }; - C3920ACF1395B7680045F3BB /* CPTLegend.h in Headers */ = {isa = PBXBuildFile; fileRef = C3920ACD1395B7680045F3BB /* CPTLegend.h */; settings = {ATTRIBUTES = (); }; }; - C3920AD01395B7680045F3BB /* CPTLegend.m in Sources */ = {isa = PBXBuildFile; fileRef = C3920ACE1395B7680045F3BB /* CPTLegend.m */; }; - C3978E1013CE65C600A420D9 /* NSCoderExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = C3978E0E13CE65C600A420D9 /* NSCoderExtensions.h */; settings = {ATTRIBUTES = (); }; }; - C3978E1113CE65C600A420D9 /* NSCoderExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = C3978E0F13CE65C600A420D9 /* NSCoderExtensions.m */; }; - C3A695E1146A196100AF5653 /* CPTMutablePlotRange.h in Headers */ = {isa = PBXBuildFile; fileRef = C3A695DF146A196100AF5653 /* CPTMutablePlotRange.h */; settings = {ATTRIBUTES = (); }; }; - C3A695E2146A196100AF5653 /* CPTMutablePlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A695E0146A196100AF5653 /* CPTMutablePlotRange.m */; }; - C3B623C0107EC9370009EF0B /* CPTBarPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82DA0FB89E610035D8DA /* CPTBarPlot.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C1107EC9400009EF0B /* CPTDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82A30FB89E610035D8DA /* CPTDefinitions.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C2107EC9430009EF0B /* CPTExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82A50FB89E610035D8DA /* CPTExceptions.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C3107EC94D0009EF0B /* CPTFill.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82880FB89E610035D8DA /* CPTFill.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C4107EC94E0009EF0B /* CPTGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82980FB89E610035D8DA /* CPTGradient.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C5107EC9500009EF0B /* CPTGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82B60FB89E610035D8DA /* CPTGraph.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C6107EC9510009EF0B /* CPTImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B829A0FB89E610035D8DA /* CPTImage.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C7107EC9540009EF0B /* CPTLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B826F0FB89E610035D8DA /* CPTLayer.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C8107EC9570009EF0B /* CPTLineStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B829C0FB89E610035D8DA /* CPTLineStyle.h */; settings = {ATTRIBUTES = (); }; }; - C3B623C9107EC95C0009EF0B /* CPTPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82D20FB89E610035D8DA /* CPTPlot.h */; settings = {ATTRIBUTES = (); }; }; - C3B623CA107EC95E0009EF0B /* CPTPlotAreaFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82C10FB89E610035D8DA /* CPTPlotAreaFrame.h */; settings = {ATTRIBUTES = (); }; }; - C3B623CB107EC9610009EF0B /* CPTPlotRange.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82AB0FB89E610035D8DA /* CPTPlotRange.h */; settings = {ATTRIBUTES = (); }; }; - C3B623CC107EC9620009EF0B /* CPTPlotSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82C60FB89E610035D8DA /* CPTPlotSpace.h */; settings = {ATTRIBUTES = (); }; }; - C3B623CD107EC9630009EF0B /* CPTPlotSymbol.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82D00FB89E610035D8DA /* CPTPlotSymbol.h */; settings = {ATTRIBUTES = (); }; }; - C3B623CF107EC9680009EF0B /* CPTScatterPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82D40FB89E610035D8DA /* CPTScatterPlot.h */; settings = {ATTRIBUTES = (); }; }; - C3B623D1107EC96E0009EF0B /* CPTUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82A70FB89E610035D8DA /* CPTUtilities.h */; settings = {ATTRIBUTES = (); }; }; - C3B623D2107EC9760009EF0B /* CPTXYGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82B80FB89E610035D8DA /* CPTXYGraph.h */; settings = {ATTRIBUTES = (); }; }; - C3B623D3107EC97A0009EF0B /* NSNumberExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B82B30FB89E610035D8DA /* NSNumberExtensions.h */; settings = {ATTRIBUTES = (); }; }; - C3B623D4107EC9800009EF0B /* _CPTFillColor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B828A0FB89E610035D8DA /* _CPTFillColor.h */; settings = {ATTRIBUTES = (); }; }; - C3B623D5107EC9820009EF0B /* _CPTFillGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B828C0FB89E610035D8DA /* _CPTFillGradient.h */; settings = {ATTRIBUTES = (); }; }; - C3B623D6107EC9830009EF0B /* _CPTFillImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9B828E0FB89E610035D8DA /* _CPTFillImage.h */; settings = {ATTRIBUTES = (); }; }; - C3C68320166138E200340E39 /* CPTAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C68318166138E200340E39 /* CPTAnimation.h */; }; - C3C68321166138E200340E39 /* CPTAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C68319166138E200340E39 /* CPTAnimation.m */; }; - C3C68322166138E200340E39 /* CPTAnimationOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C6831A166138E200340E39 /* CPTAnimationOperation.h */; }; - C3C68323166138E200340E39 /* CPTAnimationOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C6831B166138E200340E39 /* CPTAnimationOperation.m */; }; - C3C68324166138E200340E39 /* CPTAnimationPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C6831C166138E200340E39 /* CPTAnimationPeriod.h */; }; - C3C68325166138E200340E39 /* CPTAnimationPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C6831D166138E200340E39 /* CPTAnimationPeriod.m */; }; - C3C68326166138E200340E39 /* _CPTAnimationTimingFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C6831E166138E200340E39 /* _CPTAnimationTimingFunctions.h */; }; - C3C68327166138E200340E39 /* _CPTAnimationTimingFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C6831F166138E200340E39 /* _CPTAnimationTimingFunctions.m */; }; - C3C683341661391A00340E39 /* _CPTAnimationCGFloatPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C683281661391A00340E39 /* _CPTAnimationCGFloatPeriod.h */; }; - C3C683351661391A00340E39 /* _CPTAnimationCGFloatPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C683291661391A00340E39 /* _CPTAnimationCGFloatPeriod.m */; }; - C3C683361661391A00340E39 /* _CPTAnimationCGPointPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C6832A1661391A00340E39 /* _CPTAnimationCGPointPeriod.h */; }; - C3C683371661391A00340E39 /* _CPTAnimationCGPointPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C6832B1661391A00340E39 /* _CPTAnimationCGPointPeriod.m */; }; - C3C683381661391A00340E39 /* _CPTAnimationCGRectPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C6832C1661391A00340E39 /* _CPTAnimationCGRectPeriod.h */; }; - C3C683391661391A00340E39 /* _CPTAnimationCGRectPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C6832D1661391A00340E39 /* _CPTAnimationCGRectPeriod.m */; }; - C3C6833A1661391A00340E39 /* _CPTAnimationCGSizePeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C6832E1661391A00340E39 /* _CPTAnimationCGSizePeriod.h */; }; - C3C6833B1661391A00340E39 /* _CPTAnimationCGSizePeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C6832F1661391A00340E39 /* _CPTAnimationCGSizePeriod.m */; }; - C3C6833C1661391A00340E39 /* _CPTAnimationNSDecimalPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C683301661391A00340E39 /* _CPTAnimationNSDecimalPeriod.h */; }; - C3C6833D1661391A00340E39 /* _CPTAnimationNSDecimalPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C683311661391A00340E39 /* _CPTAnimationNSDecimalPeriod.m */; }; - C3C6833E1661391A00340E39 /* _CPTAnimationPlotRangePeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C683321661391A00340E39 /* _CPTAnimationPlotRangePeriod.h */; }; - C3C6833F1661391A00340E39 /* _CPTAnimationPlotRangePeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C683331661391A00340E39 /* _CPTAnimationPlotRangePeriod.m */; }; - C3CAFB3B1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CAFB391229E48200F5C989 /* CPTMutableNumericData+TypeConversion.h */; settings = {ATTRIBUTES = (); }; }; - C3CAFB3C1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CAFB3A1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.m */; }; - C3CCA04813E8D94800CE6DB1 /* _CPTConstraintsFixed.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CCA04413E8D94800CE6DB1 /* _CPTConstraintsFixed.h */; settings = {ATTRIBUTES = (); }; }; - C3CCA04913E8D94800CE6DB1 /* _CPTConstraintsFixed.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CCA04513E8D94800CE6DB1 /* _CPTConstraintsFixed.m */; }; - C3CCA04A13E8D94800CE6DB1 /* _CPTConstraintsRelative.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CCA04613E8D94800CE6DB1 /* _CPTConstraintsRelative.h */; settings = {ATTRIBUTES = (); }; }; - C3CCA04B13E8D94800CE6DB1 /* _CPTConstraintsRelative.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CCA04713E8D94800CE6DB1 /* _CPTConstraintsRelative.m */; }; - C3CD282817DE957C008EED1E /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3CD282717DE957C008EED1E /* Accelerate.framework */; }; - C3D3AD3413DF8E9D0004EA73 /* CPTLineCap.h in Headers */ = {isa = PBXBuildFile; fileRef = C3D3AD3213DF8E9D0004EA73 /* CPTLineCap.h */; settings = {ATTRIBUTES = (); }; }; - C3D3AD3513DF8E9D0004EA73 /* CPTLineCap.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D3AD3313DF8E9D0004EA73 /* CPTLineCap.m */; }; - C3D68B091221650C00EB4863 /* CPTMutableNumericData.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CADE3D11B188C500D36017 /* CPTMutableNumericData.h */; settings = {ATTRIBUTES = (); }; }; - C3D68B0A1221650D00EB4863 /* CPTMutableNumericData.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CADE3E11B188C500D36017 /* CPTMutableNumericData.m */; }; - C3D68B0B1221650E00EB4863 /* CPTNumericData+TypeConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CADE3211B188A800D36017 /* CPTNumericData+TypeConversion.h */; settings = {ATTRIBUTES = (); }; }; - C3D68B0D1221651200EB4863 /* CPTNumericData.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CADE3011B188A800D36017 /* CPTNumericData.h */; settings = {ATTRIBUTES = (); }; }; - C3D68B0E1221651200EB4863 /* CPTNumericData.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CADE3111B188A800D36017 /* CPTNumericData.m */; }; - C3D68B0F1221651500EB4863 /* CPTNumericDataType.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CADE3911B188B600D36017 /* CPTNumericDataType.h */; settings = {ATTRIBUTES = (); }; }; - C3D68B101221651600EB4863 /* CPTNumericDataType.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CADE3A11B188B600D36017 /* CPTNumericDataType.m */; }; - C3D9825116BD406600DE7977 /* CorePlot_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = C3D9825016BD406600DE7977 /* CorePlot_Prefix.pch */; }; - C40CFB94107EC1B40057E828 /* _CPTXYTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = C40CFB92107EC1B40057E828 /* _CPTXYTheme.h */; settings = {ATTRIBUTES = (); }; }; - C40CFB95107EC1B40057E828 /* _CPTXYTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = C40CFB93107EC1B40057E828 /* _CPTXYTheme.m */; }; - D0C047BF12D6568500DA8047 /* CPTRangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = D0C047BD12D6568500DA8047 /* CPTRangePlot.m */; }; - D0C047C012D6568500DA8047 /* CPTRangePlot.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C047BE12D6568500DA8047 /* CPTRangePlot.h */; settings = {ATTRIBUTES = (); }; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 070CB8300FC9DEA800F3152B /* CPTColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTColor.h; path = Source/CPTColor.h; sourceTree = ""; }; - 070CB8310FC9DEA800F3152B /* CPTColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTColor.m; path = Source/CPTColor.m; sourceTree = ""; }; - 070CB8320FC9DEA800F3152B /* CPTColorSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTColorSpace.h; path = Source/CPTColorSpace.h; sourceTree = ""; }; - 070CB8330FC9DEA800F3152B /* CPTColorSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTColorSpace.m; path = Source/CPTColorSpace.m; sourceTree = ""; }; - 070CB8390FC9DED400F3152B /* CPTAxis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAxis.h; path = Source/CPTAxis.h; sourceTree = ""; }; - 070CB83A0FC9DED400F3152B /* CPTAxis.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAxis.m; path = Source/CPTAxis.m; sourceTree = ""; }; - 070CB83D0FC9DED400F3152B /* CPTAxisSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAxisSet.h; path = Source/CPTAxisSet.h; sourceTree = ""; }; - 070CB83E0FC9DED400F3152B /* CPTAxisSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAxisSet.m; path = Source/CPTAxisSet.m; sourceTree = ""; }; - 0718DE4511D1EDBA00AF4851 /* CPTAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAnnotation.h; path = Source/CPTAnnotation.h; sourceTree = ""; }; - 0718DE4611D1EDBA00AF4851 /* CPTAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAnnotation.m; path = Source/CPTAnnotation.m; sourceTree = ""; }; - 0718DE4711D1EDBA00AF4851 /* CPTAnnotationHostLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAnnotationHostLayer.h; path = Source/CPTAnnotationHostLayer.h; sourceTree = ""; }; - 0718DE4811D1EDBA00AF4851 /* CPTAnnotationHostLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAnnotationHostLayer.m; path = Source/CPTAnnotationHostLayer.m; sourceTree = ""; }; - 0718DE4911D1EDBA00AF4851 /* CPTLayerAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLayerAnnotation.h; path = Source/CPTLayerAnnotation.h; sourceTree = ""; }; - 0718DE4A11D1EDBA00AF4851 /* CPTLayerAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLayerAnnotation.m; path = Source/CPTLayerAnnotation.m; sourceTree = ""; }; - 0718DE4B11D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotSpaceAnnotation.h; path = Source/CPTPlotSpaceAnnotation.h; sourceTree = ""; }; - 0718DE4C11D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotSpaceAnnotation.m; path = Source/CPTPlotSpaceAnnotation.m; sourceTree = ""; }; - 071F3CDF10FBAB9D00D0A7B6 /* License.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = License.txt; path = ../License.txt; sourceTree = SOURCE_ROOT; }; - 072E3F9B0FE2FF7300ACF62F /* CPTTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTTheme.h; path = Source/CPTTheme.h; sourceTree = ""; }; - 072E3F9C0FE2FF7300ACF62F /* CPTTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTTheme.m; path = Source/CPTTheme.m; sourceTree = ""; }; - 074D7BC30FD6B65E006011BC /* CPTXYPlotSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTXYPlotSpace.h; path = Source/CPTXYPlotSpace.h; sourceTree = ""; }; - 074D7BC40FD6B65F006011BC /* CPTXYPlotSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTXYPlotSpace.m; path = Source/CPTXYPlotSpace.m; sourceTree = ""; }; - 074FADF7112024C500394B90 /* CPTConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTConstraints.h; path = Source/CPTConstraints.h; sourceTree = ""; }; - 074FADF8112024C500394B90 /* CPTConstraints.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTConstraints.m; path = Source/CPTConstraints.m; sourceTree = ""; }; - 0772B4F110E26A12009CD04C /* CPTTradingRangePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTTradingRangePlot.h; path = Source/CPTTradingRangePlot.h; sourceTree = ""; }; - 0772B4F210E26A12009CD04C /* CPTTradingRangePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTTradingRangePlot.m; path = Source/CPTTradingRangePlot.m; sourceTree = ""; }; - 077F28510FE18048000BCA52 /* CPTBorderedLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTBorderedLayer.h; path = Source/CPTBorderedLayer.h; sourceTree = ""; }; - 077F28520FE18048000BCA52 /* CPTBorderedLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTBorderedLayer.m; path = Source/CPTBorderedLayer.m; sourceTree = ""; }; - 077F28530FE18048000BCA52 /* CPTPathExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPathExtensions.h; path = Source/CPTPathExtensions.h; sourceTree = ""; }; - 077F28540FE18048000BCA52 /* CPTPathExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPathExtensions.m; path = Source/CPTPathExtensions.m; sourceTree = ""; }; - 0789EFB80FB9F97F00C0A613 /* CPTPlatformSpecificCategories.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlatformSpecificCategories.h; sourceTree = ""; }; - 0789EFB90FB9F97F00C0A613 /* CPTPlatformSpecificCategories.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlatformSpecificCategories.m; sourceTree = ""; }; - 0789EFBA0FB9F97F00C0A613 /* CPTPlatformSpecificDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlatformSpecificDefines.h; sourceTree = ""; }; - 0789EFBB0FB9F97F00C0A613 /* CPTPlatformSpecificDefines.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlatformSpecificDefines.m; sourceTree = ""; }; - 0789EFBC0FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlatformSpecificFunctions.h; sourceTree = ""; }; - 0789EFBD0FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlatformSpecificFunctions.m; sourceTree = ""; }; - 07A2E71C102DFAD300809BC5 /* CPTTimeFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTTimeFormatter.h; path = Source/CPTTimeFormatter.h; sourceTree = ""; }; - 07A2E71D102DFAD300809BC5 /* CPTTimeFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTTimeFormatter.m; path = Source/CPTTimeFormatter.m; sourceTree = ""; }; - 07A62FB30FE2234900CD765C /* CPTTextStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = CPTTextStyle.h; path = Source/CPTTextStyle.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 07A62FB40FE2234900CD765C /* CPTTextStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTTextStyle.m; path = Source/CPTTextStyle.m; sourceTree = ""; }; - 07AEF30110BBF99A0012BEFF /* CPTResponder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTResponder.h; path = Source/CPTResponder.h; sourceTree = ""; }; - 07B69AB712B6281100F4C16C /* CPTMutableTextStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTMutableTextStyle.h; path = Source/CPTMutableTextStyle.h; sourceTree = ""; }; - 07B69AB812B6281100F4C16C /* CPTMutableTextStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTMutableTextStyle.m; path = Source/CPTMutableTextStyle.m; sourceTree = ""; }; - 07B69B6F12B62E9600F4C16C /* CPTMutableLineStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTMutableLineStyle.h; path = Source/CPTMutableLineStyle.h; sourceTree = ""; }; - 07B69B7012B62E9600F4C16C /* CPTMutableLineStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTMutableLineStyle.m; path = Source/CPTMutableLineStyle.m; sourceTree = ""; }; - 07FCF2D2115B54DE00E46606 /* _CPTSlateTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTSlateTheme.m; path = Source/_CPTSlateTheme.m; sourceTree = ""; }; - 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 29B97316FDCFA39411CA2CEA /* main-cocoatouch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "main-cocoatouch.m"; sourceTree = ""; }; - 8D1107310486CEB800E47090 /* Info-CocoaTouch.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-CocoaTouch.plist"; sourceTree = ""; }; - BC74A2C010FC087800E7E90D /* CPTPieChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPieChart.h; path = Source/CPTPieChart.h; sourceTree = ""; }; - BC74A2C110FC087800E7E90D /* CPTPieChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPieChart.m; path = Source/CPTPieChart.m; sourceTree = ""; }; - BC79F1D30FD1DC1A00510976 /* CPTGraphHostingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTGraphHostingView.h; sourceTree = ""; }; - BC79F1D40FD1DC1A00510976 /* CPTGraphHostingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTGraphHostingView.m; sourceTree = ""; }; - BC89A7991024AB19009D5261 /* CorePlotProbes.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; name = CorePlotProbes.d; path = TestResources/CorePlotProbes.d; sourceTree = ""; }; - BC9B82690FB89BD10035D8DA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - BC9B826F0FB89E610035D8DA /* CPTLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLayer.h; path = Source/CPTLayer.h; sourceTree = ""; }; - BC9B82700FB89E610035D8DA /* CPTLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLayer.m; path = Source/CPTLayer.m; sourceTree = ""; }; - BC9B82880FB89E610035D8DA /* CPTFill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTFill.h; path = Source/CPTFill.h; sourceTree = SOURCE_ROOT; }; - BC9B82890FB89E610035D8DA /* CPTFill.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTFill.m; path = Source/CPTFill.m; sourceTree = SOURCE_ROOT; }; - BC9B828A0FB89E610035D8DA /* _CPTFillColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTFillColor.h; path = Source/_CPTFillColor.h; sourceTree = SOURCE_ROOT; }; - BC9B828B0FB89E610035D8DA /* _CPTFillColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTFillColor.m; path = Source/_CPTFillColor.m; sourceTree = SOURCE_ROOT; }; - BC9B828C0FB89E610035D8DA /* _CPTFillGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTFillGradient.h; path = Source/_CPTFillGradient.h; sourceTree = SOURCE_ROOT; }; - BC9B828D0FB89E610035D8DA /* _CPTFillGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTFillGradient.m; path = Source/_CPTFillGradient.m; sourceTree = SOURCE_ROOT; }; - BC9B828E0FB89E610035D8DA /* _CPTFillImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTFillImage.h; path = Source/_CPTFillImage.h; sourceTree = SOURCE_ROOT; }; - BC9B828F0FB89E610035D8DA /* _CPTFillImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTFillImage.m; path = Source/_CPTFillImage.m; sourceTree = SOURCE_ROOT; }; - BC9B82980FB89E610035D8DA /* CPTGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTGradient.h; path = Source/CPTGradient.h; sourceTree = ""; }; - BC9B82990FB89E610035D8DA /* CPTGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTGradient.m; path = Source/CPTGradient.m; sourceTree = ""; }; - BC9B829A0FB89E610035D8DA /* CPTImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = CPTImage.h; path = Source/CPTImage.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - BC9B829B0FB89E610035D8DA /* CPTImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTImage.m; path = Source/CPTImage.m; sourceTree = ""; }; - BC9B829C0FB89E610035D8DA /* CPTLineStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLineStyle.h; path = Source/CPTLineStyle.h; sourceTree = ""; }; - BC9B829D0FB89E610035D8DA /* CPTLineStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLineStyle.m; path = Source/CPTLineStyle.m; sourceTree = ""; }; - BC9B829E0FB89E610035D8DA /* CPTTextLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTTextLayer.h; path = Source/CPTTextLayer.h; sourceTree = ""; }; - BC9B829F0FB89E610035D8DA /* CPTTextLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTTextLayer.m; path = Source/CPTTextLayer.m; sourceTree = ""; }; - BC9B82A30FB89E610035D8DA /* CPTDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTDefinitions.h; path = Source/CPTDefinitions.h; sourceTree = SOURCE_ROOT; }; - BC9B82A40FB89E610035D8DA /* CPTDefinitions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTDefinitions.m; path = Source/CPTDefinitions.m; sourceTree = SOURCE_ROOT; }; - BC9B82A50FB89E610035D8DA /* CPTExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTExceptions.h; path = Source/CPTExceptions.h; sourceTree = SOURCE_ROOT; }; - BC9B82A60FB89E610035D8DA /* CPTExceptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTExceptions.m; path = Source/CPTExceptions.m; sourceTree = SOURCE_ROOT; }; - BC9B82A70FB89E610035D8DA /* CPTUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTUtilities.h; path = Source/CPTUtilities.h; sourceTree = SOURCE_ROOT; }; - BC9B82A80FB89E610035D8DA /* CPTUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTUtilities.m; path = Source/CPTUtilities.m; sourceTree = SOURCE_ROOT; }; - BC9B82AB0FB89E610035D8DA /* CPTPlotRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotRange.h; path = Source/CPTPlotRange.h; sourceTree = SOURCE_ROOT; }; - BC9B82AC0FB89E610035D8DA /* CPTPlotRange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotRange.m; path = Source/CPTPlotRange.m; sourceTree = SOURCE_ROOT; }; - BC9B82B10FB89E610035D8DA /* NSDecimalNumberExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSDecimalNumberExtensions.h; path = Source/NSDecimalNumberExtensions.h; sourceTree = SOURCE_ROOT; }; - BC9B82B20FB89E610035D8DA /* NSDecimalNumberExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSDecimalNumberExtensions.m; path = Source/NSDecimalNumberExtensions.m; sourceTree = SOURCE_ROOT; }; - BC9B82B30FB89E610035D8DA /* NSNumberExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSNumberExtensions.h; path = Source/NSNumberExtensions.h; sourceTree = SOURCE_ROOT; }; - BC9B82B40FB89E610035D8DA /* NSNumberExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSNumberExtensions.m; path = Source/NSNumberExtensions.m; sourceTree = SOURCE_ROOT; }; - BC9B82B60FB89E610035D8DA /* CPTGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTGraph.h; path = Source/CPTGraph.h; sourceTree = SOURCE_ROOT; }; - BC9B82B70FB89E610035D8DA /* CPTGraph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTGraph.m; path = Source/CPTGraph.m; sourceTree = SOURCE_ROOT; }; - BC9B82B80FB89E610035D8DA /* CPTXYGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTXYGraph.h; path = Source/CPTXYGraph.h; sourceTree = SOURCE_ROOT; }; - BC9B82B90FB89E610035D8DA /* CPTXYGraph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTXYGraph.m; path = Source/CPTXYGraph.m; sourceTree = SOURCE_ROOT; }; - BC9B82C10FB89E610035D8DA /* CPTPlotAreaFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotAreaFrame.h; path = Source/CPTPlotAreaFrame.h; sourceTree = ""; }; - BC9B82C20FB89E610035D8DA /* CPTPlotAreaFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotAreaFrame.m; path = Source/CPTPlotAreaFrame.m; sourceTree = ""; }; - BC9B82C60FB89E610035D8DA /* CPTPlotSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotSpace.h; path = Source/CPTPlotSpace.h; sourceTree = SOURCE_ROOT; }; - BC9B82C70FB89E610035D8DA /* CPTPlotSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotSpace.m; path = Source/CPTPlotSpace.m; sourceTree = SOURCE_ROOT; }; - BC9B82D00FB89E610035D8DA /* CPTPlotSymbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotSymbol.h; path = Source/CPTPlotSymbol.h; sourceTree = SOURCE_ROOT; }; - BC9B82D10FB89E610035D8DA /* CPTPlotSymbol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotSymbol.m; path = Source/CPTPlotSymbol.m; sourceTree = SOURCE_ROOT; }; - BC9B82D20FB89E610035D8DA /* CPTPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlot.h; path = Source/CPTPlot.h; sourceTree = SOURCE_ROOT; }; - BC9B82D30FB89E610035D8DA /* CPTPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlot.m; path = Source/CPTPlot.m; sourceTree = SOURCE_ROOT; }; - BC9B82D40FB89E610035D8DA /* CPTScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTScatterPlot.h; path = Source/CPTScatterPlot.h; sourceTree = SOURCE_ROOT; }; - BC9B82D50FB89E610035D8DA /* CPTScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTScatterPlot.m; path = Source/CPTScatterPlot.m; sourceTree = SOURCE_ROOT; }; - BC9B82DA0FB89E610035D8DA /* CPTBarPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTBarPlot.h; path = Source/CPTBarPlot.h; sourceTree = SOURCE_ROOT; }; - BC9B82DB0FB89E610035D8DA /* CPTBarPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTBarPlot.m; path = Source/CPTBarPlot.m; sourceTree = SOURCE_ROOT; }; - BC9B83470FB8A0A40035D8DA /* libCorePlot-CocoaTouch.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libCorePlot-CocoaTouch.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - BC9B83C20FB8AC4B0035D8DA /* CorePlot-CocoaTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CorePlot-CocoaTouch.h"; sourceTree = SOURCE_ROOT; }; - BCC7EA3F1006BF5700B39451 /* _CPTPlainBlackTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTPlainBlackTheme.h; path = Source/_CPTPlainBlackTheme.h; sourceTree = ""; }; - BCC7EA401006BF5700B39451 /* _CPTPlainBlackTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTPlainBlackTheme.m; path = Source/_CPTPlainBlackTheme.m; sourceTree = ""; }; - BCC7EA411006BF5700B39451 /* _CPTPlainWhiteTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTPlainWhiteTheme.h; path = Source/_CPTPlainWhiteTheme.h; sourceTree = ""; }; - BCC7EA421006BF5700B39451 /* _CPTPlainWhiteTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTPlainWhiteTheme.m; path = Source/_CPTPlainWhiteTheme.m; sourceTree = ""; }; - BCC7EA431006BF5700B39451 /* _CPTStocksTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTStocksTheme.h; path = Source/_CPTStocksTheme.h; sourceTree = ""; }; - BCC7EA441006BF5700B39451 /* _CPTStocksTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTStocksTheme.m; path = Source/_CPTStocksTheme.m; sourceTree = ""; }; - C304565213F4AC9A004D04BC /* _CPTDarkGradientTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTDarkGradientTheme.h; path = Source/_CPTDarkGradientTheme.h; sourceTree = ""; }; - C30550E71399BE2000E0151F /* CPTLegendEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLegendEntry.h; path = Source/CPTLegendEntry.h; sourceTree = ""; }; - C30550E81399BE2000E0151F /* CPTLegendEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLegendEntry.m; path = Source/CPTLegendEntry.m; sourceTree = ""; }; - C30C85A91047428100181766 /* CPTPlotGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotGroup.h; path = Source/CPTPlotGroup.h; sourceTree = ""; }; - C30C85AA1047428100181766 /* CPTPlotGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotGroup.m; path = Source/CPTPlotGroup.m; sourceTree = ""; }; - C30E97A014B290650012204A /* DoxygenLayout.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = DoxygenLayout.xml; path = ../documentation/doxygen/DoxygenLayout.xml; sourceTree = ""; }; - C318F4BF11EA18A400595FF9 /* CPTLimitBand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLimitBand.h; path = Source/CPTLimitBand.h; sourceTree = ""; }; - C318F4C011EA18A400595FF9 /* CPTLimitBand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLimitBand.m; path = Source/CPTLimitBand.m; sourceTree = ""; }; - C31908A3199813D400B61898 /* CorePlot.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = CorePlot.xcconfig; sourceTree = ""; }; - C31A40BD17ABD6C60020C5C6 /* CPTFunctionDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTFunctionDataSource.h; path = Source/CPTFunctionDataSource.h; sourceTree = ""; }; - C31A40BE17ABD6C60020C5C6 /* CPTFunctionDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTFunctionDataSource.m; path = Source/CPTFunctionDataSource.m; sourceTree = ""; }; - C3286C0515D8769800A436A8 /* _CPTMaskLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTMaskLayer.h; path = Source/_CPTMaskLayer.h; sourceTree = ""; }; - C3286C0615D8769800A436A8 /* _CPTMaskLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTMaskLayer.m; path = Source/_CPTMaskLayer.m; sourceTree = ""; }; - C32EE1BB13EC4AF900038266 /* CPTShadow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTShadow.h; path = Source/CPTShadow.h; sourceTree = ""; }; - C32EE1BC13EC4AF900038266 /* CPTShadow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTShadow.m; path = Source/CPTShadow.m; sourceTree = ""; }; - C32EE1C613EC4C7200038266 /* CPTMutableShadow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTMutableShadow.h; path = Source/CPTMutableShadow.h; sourceTree = ""; }; - C32EE1C713EC4C7200038266 /* CPTMutableShadow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTMutableShadow.m; path = Source/CPTMutableShadow.m; sourceTree = ""; }; - C3392A351225F63B008DA6BD /* CPTNumericData+TypeConversion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CPTNumericData+TypeConversion.m"; path = "Source/CPTNumericData+TypeConversion.m"; sourceTree = ""; }; - C3408C4415FC1CA8004F1D70 /* _CPTBorderLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTBorderLayer.h; path = Source/_CPTBorderLayer.h; sourceTree = ""; }; - C3408C4515FC1CA8004F1D70 /* _CPTBorderLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTBorderLayer.m; path = Source/_CPTBorderLayer.m; sourceTree = ""; }; - C3436C4E13F4AC4400739AC2 /* _CPTDarkGradientTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTDarkGradientTheme.m; path = Source/_CPTDarkGradientTheme.m; sourceTree = ""; }; - C3436C5013F4AC6000739AC2 /* _CPTSlateTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTSlateTheme.h; path = Source/_CPTSlateTheme.h; sourceTree = ""; }; - C349DCAE151AAFAB00BFD6A7 /* CPTCalendarFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTCalendarFormatter.h; path = Source/CPTCalendarFormatter.h; sourceTree = ""; }; - C349DCAF151AAFAB00BFD6A7 /* CPTCalendarFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTCalendarFormatter.m; path = Source/CPTCalendarFormatter.m; sourceTree = ""; }; - C34F570C19D8CE4300446248 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = CorePlotWarnings.xcconfig; sourceTree = ""; }; - C3566B8C10EED17400FB3866 /* doxygen touch.config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "doxygen touch.config"; path = "../documentation/doxygen/doxygen touch.config"; sourceTree = SOURCE_ROOT; }; - C3566B8D10EED17400FB3866 /* doxygen-cocoa-touch-tags.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = "doxygen-cocoa-touch-tags.xml"; path = "../documentation/doxygen/doxygen-cocoa-touch-tags.xml"; sourceTree = SOURCE_ROOT; }; - C3566B8E10EED1B000FB3866 /* mainpage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mainpage.h; path = Source/mainpage.h; sourceTree = ""; }; - C35A65A311025EDF00FE24BB /* CPTPlotArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlotArea.h; path = Source/CPTPlotArea.h; sourceTree = ""; }; - C35A65A411025EDF00FE24BB /* CPTPlotArea.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlotArea.m; path = Source/CPTPlotArea.m; sourceTree = ""; }; - C35A65B111025F8A00FE24BB /* CPTGridLines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTGridLines.h; path = Source/CPTGridLines.h; sourceTree = ""; }; - C35A65B211025F8A00FE24BB /* CPTGridLines.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTGridLines.m; path = Source/CPTGridLines.m; sourceTree = ""; }; - C35A65B511025FA900FE24BB /* CPTAxisLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAxisLabel.h; path = Source/CPTAxisLabel.h; sourceTree = ""; }; - C35A65B611025FA900FE24BB /* CPTAxisLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAxisLabel.m; path = Source/CPTAxisLabel.m; sourceTree = ""; }; - C35A65B711025FA900FE24BB /* CPTAxisTitle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAxisTitle.h; path = Source/CPTAxisTitle.h; sourceTree = ""; }; - C35A65B811025FA900FE24BB /* CPTAxisTitle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAxisTitle.m; path = Source/CPTAxisTitle.m; sourceTree = ""; }; - C35A65BD11025FB300FE24BB /* CPTAxisLabelGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAxisLabelGroup.h; path = Source/CPTAxisLabelGroup.h; sourceTree = ""; }; - C35A65BE11025FB300FE24BB /* CPTAxisLabelGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAxisLabelGroup.m; path = Source/CPTAxisLabelGroup.m; sourceTree = ""; }; - C35A65C111025FCC00FE24BB /* CPTXYAxis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTXYAxis.h; path = Source/CPTXYAxis.h; sourceTree = ""; }; - C35A65C211025FCC00FE24BB /* CPTXYAxis.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTXYAxis.m; path = Source/CPTXYAxis.m; sourceTree = ""; }; - C35A65C311025FCC00FE24BB /* CPTXYAxisSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTXYAxisSet.h; path = Source/CPTXYAxisSet.h; sourceTree = ""; }; - C35A65C411025FCC00FE24BB /* CPTXYAxisSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTXYAxisSet.m; path = Source/CPTXYAxisSet.m; sourceTree = ""; }; - C35A66051102723E00FE24BB /* CPTTextStylePlatformSpecific.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTTextStylePlatformSpecific.h; path = iPhoneOnly/CPTTextStylePlatformSpecific.h; sourceTree = ""; }; - C35A66061102723E00FE24BB /* CPTTextStylePlatformSpecific.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CPTTextStylePlatformSpecific.m; path = iPhoneOnly/CPTTextStylePlatformSpecific.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C3791D03191D4C2F001EC514 /* CPTImagePlatformSpecific.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CPTImagePlatformSpecific.m; path = iPhoneOnly/CPTImagePlatformSpecific.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C38DD49511A04B99002A68E7 /* CPTGridLineGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTGridLineGroup.h; path = Source/CPTGridLineGroup.h; sourceTree = ""; }; - C38DD49611A04B99002A68E7 /* CPTGridLineGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTGridLineGroup.m; path = Source/CPTGridLineGroup.m; sourceTree = ""; }; - C3920ACD1395B7680045F3BB /* CPTLegend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLegend.h; path = Source/CPTLegend.h; sourceTree = ""; }; - C3920ACE1395B7680045F3BB /* CPTLegend.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLegend.m; path = Source/CPTLegend.m; sourceTree = ""; }; - C3978E0E13CE65C600A420D9 /* NSCoderExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NSCoderExtensions.h; path = Source/NSCoderExtensions.h; sourceTree = ""; }; - C3978E0F13CE65C600A420D9 /* NSCoderExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NSCoderExtensions.m; path = Source/NSCoderExtensions.m; sourceTree = ""; }; - C3A695DF146A196100AF5653 /* CPTMutablePlotRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTMutablePlotRange.h; path = Source/CPTMutablePlotRange.h; sourceTree = ""; }; - C3A695E0146A196100AF5653 /* CPTMutablePlotRange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTMutablePlotRange.m; path = Source/CPTMutablePlotRange.m; sourceTree = ""; }; - C3B25EE11AC23A930063CCD8 /* CorePlot.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CorePlot.h; sourceTree = ""; }; - C3C68318166138E200340E39 /* CPTAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAnimation.h; path = Source/CPTAnimation.h; sourceTree = ""; }; - C3C68319166138E200340E39 /* CPTAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAnimation.m; path = Source/CPTAnimation.m; sourceTree = ""; }; - C3C6831A166138E200340E39 /* CPTAnimationOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAnimationOperation.h; path = Source/CPTAnimationOperation.h; sourceTree = ""; }; - C3C6831B166138E200340E39 /* CPTAnimationOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAnimationOperation.m; path = Source/CPTAnimationOperation.m; sourceTree = ""; }; - C3C6831C166138E200340E39 /* CPTAnimationPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTAnimationPeriod.h; path = Source/CPTAnimationPeriod.h; sourceTree = ""; }; - C3C6831D166138E200340E39 /* CPTAnimationPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTAnimationPeriod.m; path = Source/CPTAnimationPeriod.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - C3C6831E166138E200340E39 /* _CPTAnimationTimingFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationTimingFunctions.h; path = Source/_CPTAnimationTimingFunctions.h; sourceTree = ""; }; - C3C6831F166138E200340E39 /* _CPTAnimationTimingFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationTimingFunctions.m; path = Source/_CPTAnimationTimingFunctions.m; sourceTree = ""; }; - C3C683281661391A00340E39 /* _CPTAnimationCGFloatPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationCGFloatPeriod.h; path = Source/_CPTAnimationCGFloatPeriod.h; sourceTree = ""; }; - C3C683291661391A00340E39 /* _CPTAnimationCGFloatPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationCGFloatPeriod.m; path = Source/_CPTAnimationCGFloatPeriod.m; sourceTree = ""; }; - C3C6832A1661391A00340E39 /* _CPTAnimationCGPointPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationCGPointPeriod.h; path = Source/_CPTAnimationCGPointPeriod.h; sourceTree = ""; }; - C3C6832B1661391A00340E39 /* _CPTAnimationCGPointPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationCGPointPeriod.m; path = Source/_CPTAnimationCGPointPeriod.m; sourceTree = ""; }; - C3C6832C1661391A00340E39 /* _CPTAnimationCGRectPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationCGRectPeriod.h; path = Source/_CPTAnimationCGRectPeriod.h; sourceTree = ""; }; - C3C6832D1661391A00340E39 /* _CPTAnimationCGRectPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationCGRectPeriod.m; path = Source/_CPTAnimationCGRectPeriod.m; sourceTree = ""; }; - C3C6832E1661391A00340E39 /* _CPTAnimationCGSizePeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationCGSizePeriod.h; path = Source/_CPTAnimationCGSizePeriod.h; sourceTree = ""; }; - C3C6832F1661391A00340E39 /* _CPTAnimationCGSizePeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationCGSizePeriod.m; path = Source/_CPTAnimationCGSizePeriod.m; sourceTree = ""; }; - C3C683301661391A00340E39 /* _CPTAnimationNSDecimalPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationNSDecimalPeriod.h; path = Source/_CPTAnimationNSDecimalPeriod.h; sourceTree = ""; }; - C3C683311661391A00340E39 /* _CPTAnimationNSDecimalPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationNSDecimalPeriod.m; path = Source/_CPTAnimationNSDecimalPeriod.m; sourceTree = ""; }; - C3C683321661391A00340E39 /* _CPTAnimationPlotRangePeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTAnimationPlotRangePeriod.h; path = Source/_CPTAnimationPlotRangePeriod.h; sourceTree = ""; }; - C3C683331661391A00340E39 /* _CPTAnimationPlotRangePeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTAnimationPlotRangePeriod.m; path = Source/_CPTAnimationPlotRangePeriod.m; sourceTree = ""; }; - C3CADE2F11B1886B00D36017 /* license.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = license.txt; path = Source/license.txt; sourceTree = ""; }; - C3CADE3011B188A800D36017 /* CPTNumericData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTNumericData.h; path = Source/CPTNumericData.h; sourceTree = ""; }; - C3CADE3111B188A800D36017 /* CPTNumericData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTNumericData.m; path = Source/CPTNumericData.m; sourceTree = ""; }; - C3CADE3211B188A800D36017 /* CPTNumericData+TypeConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CPTNumericData+TypeConversion.h"; path = "Source/CPTNumericData+TypeConversion.h"; sourceTree = ""; }; - C3CADE3411B188A800D36017 /* CPTNumericData+TypeConversions_Generation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; name = "CPTNumericData+TypeConversions_Generation.py"; path = "Source/CPTNumericData+TypeConversions_Generation.py"; sourceTree = ""; }; - C3CADE3911B188B600D36017 /* CPTNumericDataType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTNumericDataType.h; path = Source/CPTNumericDataType.h; sourceTree = ""; }; - C3CADE3A11B188B600D36017 /* CPTNumericDataType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTNumericDataType.m; path = Source/CPTNumericDataType.m; sourceTree = ""; }; - C3CADE3D11B188C500D36017 /* CPTMutableNumericData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTMutableNumericData.h; path = Source/CPTMutableNumericData.h; sourceTree = ""; }; - C3CADE3E11B188C500D36017 /* CPTMutableNumericData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTMutableNumericData.m; path = Source/CPTMutableNumericData.m; sourceTree = ""; }; - C3CAFB391229E48200F5C989 /* CPTMutableNumericData+TypeConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CPTMutableNumericData+TypeConversion.h"; path = "Source/CPTMutableNumericData+TypeConversion.h"; sourceTree = ""; }; - C3CAFB3A1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CPTMutableNumericData+TypeConversion.m"; path = "Source/CPTMutableNumericData+TypeConversion.m"; sourceTree = ""; }; - C3CCA04413E8D94800CE6DB1 /* _CPTConstraintsFixed.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTConstraintsFixed.h; path = Source/_CPTConstraintsFixed.h; sourceTree = ""; }; - C3CCA04513E8D94800CE6DB1 /* _CPTConstraintsFixed.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTConstraintsFixed.m; path = Source/_CPTConstraintsFixed.m; sourceTree = ""; }; - C3CCA04613E8D94800CE6DB1 /* _CPTConstraintsRelative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTConstraintsRelative.h; path = Source/_CPTConstraintsRelative.h; sourceTree = ""; }; - C3CCA04713E8D94800CE6DB1 /* _CPTConstraintsRelative.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTConstraintsRelative.m; path = Source/_CPTConstraintsRelative.m; sourceTree = ""; }; - C3CD282717DE957C008EED1E /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; - C3D3AD3213DF8E9D0004EA73 /* CPTLineCap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTLineCap.h; path = Source/CPTLineCap.h; sourceTree = ""; }; - C3D3AD3313DF8E9D0004EA73 /* CPTLineCap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTLineCap.m; path = Source/CPTLineCap.m; sourceTree = ""; }; - C3D9825016BD406600DE7977 /* CorePlot_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CorePlot_Prefix.pch; sourceTree = ""; }; - C40CFB92107EC1B40057E828 /* _CPTXYTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _CPTXYTheme.h; path = Source/_CPTXYTheme.h; sourceTree = ""; }; - C40CFB93107EC1B40057E828 /* _CPTXYTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = _CPTXYTheme.m; path = Source/_CPTXYTheme.m; sourceTree = ""; }; - D0C047BD12D6568500DA8047 /* CPTRangePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTRangePlot.m; path = Source/CPTRangePlot.m; sourceTree = ""; }; - D0C047BE12D6568500DA8047 /* CPTRangePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTRangePlot.h; path = Source/CPTRangePlot.h; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - BC9B83450FB8A0A40035D8DA /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - BC9B836E0FB8A1700035D8DA /* QuartzCore.framework in Frameworks */, - BC9B836F0FB8A1700035D8DA /* UIKit.framework in Frameworks */, - BC9B83700FB8A1700035D8DA /* Foundation.framework in Frameworks */, - BC9B83710FB8A1700035D8DA /* CoreGraphics.framework in Frameworks */, - C3CD282817DE957C008EED1E /* Accelerate.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 070CB80F0FC9DDD500F3152B /* Drawing */ = { - isa = PBXGroup; - children = ( - 070CB8300FC9DEA800F3152B /* CPTColor.h */, - 070CB8310FC9DEA800F3152B /* CPTColor.m */, - 070CB8320FC9DEA800F3152B /* CPTColorSpace.h */, - 070CB8330FC9DEA800F3152B /* CPTColorSpace.m */, - BC9B82980FB89E610035D8DA /* CPTGradient.h */, - BC9B82990FB89E610035D8DA /* CPTGradient.m */, - BC9B829A0FB89E610035D8DA /* CPTImage.h */, - BC9B829B0FB89E610035D8DA /* CPTImage.m */, - C3D3AD3213DF8E9D0004EA73 /* CPTLineCap.h */, - C3D3AD3313DF8E9D0004EA73 /* CPTLineCap.m */, - BC9B829C0FB89E610035D8DA /* CPTLineStyle.h */, - BC9B829D0FB89E610035D8DA /* CPTLineStyle.m */, - 07B69B6F12B62E9600F4C16C /* CPTMutableLineStyle.h */, - 07B69B7012B62E9600F4C16C /* CPTMutableLineStyle.m */, - 077F28530FE18048000BCA52 /* CPTPathExtensions.h */, - 077F28540FE18048000BCA52 /* CPTPathExtensions.m */, - C32EE1BB13EC4AF900038266 /* CPTShadow.h */, - C32EE1BC13EC4AF900038266 /* CPTShadow.m */, - C32EE1C613EC4C7200038266 /* CPTMutableShadow.h */, - C32EE1C713EC4C7200038266 /* CPTMutableShadow.m */, - BC9B82870FB89E610035D8DA /* Fills */, - C32DDEE3191C674600E0FE84 /* iPhone Specific */, - ); - name = Drawing; - sourceTree = ""; - }; - 070CB8100FC9DDED00F3152B /* Text */ = { - isa = PBXGroup; - children = ( - BC9B829E0FB89E610035D8DA /* CPTTextLayer.h */, - BC9B829F0FB89E610035D8DA /* CPTTextLayer.m */, - 07A62FB30FE2234900CD765C /* CPTTextStyle.h */, - 07A62FB40FE2234900CD765C /* CPTTextStyle.m */, - 07B69AB712B6281100F4C16C /* CPTMutableTextStyle.h */, - 07B69AB812B6281100F4C16C /* CPTMutableTextStyle.m */, - C35A6602110271EB00FE24BB /* iPhone Specific */, - ); - name = Text; - sourceTree = ""; - }; - 070CB8380FC9DEB900F3152B /* Axes */ = { - isa = PBXGroup; - children = ( - 070CB8390FC9DED400F3152B /* CPTAxis.h */, - 070CB83A0FC9DED400F3152B /* CPTAxis.m */, - 070CB83D0FC9DED400F3152B /* CPTAxisSet.h */, - 070CB83E0FC9DED400F3152B /* CPTAxisSet.m */, - C35A65B111025F8A00FE24BB /* CPTGridLines.h */, - C35A65B211025F8A00FE24BB /* CPTGridLines.m */, - C38DD49511A04B99002A68E7 /* CPTGridLineGroup.h */, - C38DD49611A04B99002A68E7 /* CPTGridLineGroup.m */, - C35A65A811025F2000FE24BB /* Labels */, - C35A65A911025F2B00FE24BB /* XY Axes */, - ); - name = Axes; - sourceTree = ""; - }; - 0718DE4411D1ED7D00AF4851 /* Annotations */ = { - isa = PBXGroup; - children = ( - 0718DE4511D1EDBA00AF4851 /* CPTAnnotation.h */, - 0718DE4611D1EDBA00AF4851 /* CPTAnnotation.m */, - 0718DE4711D1EDBA00AF4851 /* CPTAnnotationHostLayer.h */, - 0718DE4811D1EDBA00AF4851 /* CPTAnnotationHostLayer.m */, - 0718DE4911D1EDBA00AF4851 /* CPTLayerAnnotation.h */, - 0718DE4A11D1EDBA00AF4851 /* CPTLayerAnnotation.m */, - 0718DE4B11D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.h */, - 0718DE4C11D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.m */, - ); - name = Annotations; - sourceTree = ""; - }; - 072E3F980FE2FF3E00ACF62F /* Themes */ = { - isa = PBXGroup; - children = ( - 072E3F9B0FE2FF7300ACF62F /* CPTTheme.h */, - 072E3F9C0FE2FF7300ACF62F /* CPTTheme.m */, - C40CFB92107EC1B40057E828 /* _CPTXYTheme.h */, - C40CFB93107EC1B40057E828 /* _CPTXYTheme.m */, - C304565213F4AC9A004D04BC /* _CPTDarkGradientTheme.h */, - C3436C4E13F4AC4400739AC2 /* _CPTDarkGradientTheme.m */, - BCC7EA3F1006BF5700B39451 /* _CPTPlainBlackTheme.h */, - BCC7EA401006BF5700B39451 /* _CPTPlainBlackTheme.m */, - BCC7EA411006BF5700B39451 /* _CPTPlainWhiteTheme.h */, - BCC7EA421006BF5700B39451 /* _CPTPlainWhiteTheme.m */, - C3436C5013F4AC6000739AC2 /* _CPTSlateTheme.h */, - 07FCF2D2115B54DE00E46606 /* _CPTSlateTheme.m */, - BCC7EA431006BF5700B39451 /* _CPTStocksTheme.h */, - BCC7EA441006BF5700B39451 /* _CPTStocksTheme.m */, - ); - name = Themes; - sourceTree = ""; - }; - 077F28500FE18011000BCA52 /* Layers */ = { - isa = PBXGroup; - children = ( - BC9B826F0FB89E610035D8DA /* CPTLayer.h */, - BC9B82700FB89E610035D8DA /* CPTLayer.m */, - 077F28510FE18048000BCA52 /* CPTBorderedLayer.h */, - 077F28520FE18048000BCA52 /* CPTBorderedLayer.m */, - C3408C4415FC1CA8004F1D70 /* _CPTBorderLayer.h */, - C3408C4515FC1CA8004F1D70 /* _CPTBorderLayer.m */, - C3286C0515D8769800A436A8 /* _CPTMaskLayer.h */, - C3286C0615D8769800A436A8 /* _CPTMaskLayer.m */, - 07AEF30110BBF99A0012BEFF /* CPTResponder.h */, - ); - name = Layers; - sourceTree = ""; - }; - 0789EFB70FB9F97F00C0A613 /* iPhone Specific */ = { - isa = PBXGroup; - children = ( - 0789EFBA0FB9F97F00C0A613 /* CPTPlatformSpecificDefines.h */, - 0789EFBB0FB9F97F00C0A613 /* CPTPlatformSpecificDefines.m */, - 0789EFB80FB9F97F00C0A613 /* CPTPlatformSpecificCategories.h */, - 0789EFB90FB9F97F00C0A613 /* CPTPlatformSpecificCategories.m */, - 0789EFBC0FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.h */, - 0789EFBD0FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.m */, - BC79F1D30FD1DC1A00510976 /* CPTGraphHostingView.h */, - BC79F1D40FD1DC1A00510976 /* CPTGraphHostingView.m */, - ); - name = "iPhone Specific"; - path = iPhoneOnly; - sourceTree = ""; - }; - 07A2E717102DF9A500809BC5 /* Formatters */ = { - isa = PBXGroup; - children = ( - C349DCAE151AAFAB00BFD6A7 /* CPTCalendarFormatter.h */, - C349DCAF151AAFAB00BFD6A7 /* CPTCalendarFormatter.m */, - 07A2E71C102DFAD300809BC5 /* CPTTimeFormatter.h */, - 07A2E71D102DFAD300809BC5 /* CPTTimeFormatter.m */, - ); - name = Formatters; - sourceTree = ""; - }; - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - BC9B83470FB8A0A40035D8DA /* libCorePlot-CocoaTouch.a */, - ); - name = Products; - sourceTree = ""; - }; - 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { - isa = PBXGroup; - children = ( - BC9B82520FB89B420035D8DA /* Source */, - 0789EFB70FB9F97F00C0A613 /* iPhone Specific */, - C3566B8610EED12700FB3866 /* Documentation */, - C3B25EE01AC23A930063CCD8 /* CocoaPods */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - ); - indentWidth = 4; - name = CustomTemplate; - sourceTree = ""; - tabWidth = 4; - usesTabs = 0; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - BC89A7991024AB19009D5261 /* CorePlotProbes.d */, - BC9B83C20FB8AC4B0035D8DA /* CorePlot-CocoaTouch.h */, - C3D9825016BD406600DE7977 /* CorePlot_Prefix.pch */, - 29B97316FDCFA39411CA2CEA /* main-cocoatouch.m */, - C31908A3199813D400B61898 /* CorePlot.xcconfig */, - C34F570C19D8CE4300446248 /* CorePlotWarnings.xcconfig */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 071F3CDF10FBAB9D00D0A7B6 /* License.txt */, - 8D1107310486CEB800E47090 /* Info-CocoaTouch.plist */, - ); - name = Resources; - sourceTree = ""; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - BC9B82690FB89BD10035D8DA /* QuartzCore.framework */, - 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, - 1D30AB110D05D00D00671497 /* Foundation.framework */, - 288765A40DF7441C002DB57D /* CoreGraphics.framework */, - C3CD282717DE957C008EED1E /* Accelerate.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - BC9B82520FB89B420035D8DA /* Source */ = { - isa = PBXGroup; - children = ( - C3CADE2911B1885200D36017 /* Numeric Data */, - BC9B82A20FB89E610035D8DA /* Types and Functions */, - 077F28500FE18011000BCA52 /* Layers */, - C3C68316166138B500340E39 /* Animation */, - 0718DE4411D1ED7D00AF4851 /* Annotations */, - C3B623A9107EC5460009EF0B /* Layout */, - 070CB8100FC9DDED00F3152B /* Text */, - 070CB80F0FC9DDD500F3152B /* Drawing */, - 07A2E717102DF9A500809BC5 /* Formatters */, - BC9B82B00FB89E610035D8DA /* Categories */, - BC9B82B50FB89E610035D8DA /* Graphs */, - BC9B82C00FB89E610035D8DA /* Plot Areas */, - BC9B82C50FB89E610035D8DA /* Spaces */, - BC9B82CE0FB89E610035D8DA /* Plots */, - 070CB8380FC9DEB900F3152B /* Axes */, - C3920ACC1395B7410045F3BB /* Legends */, - 072E3F980FE2FF3E00ACF62F /* Themes */, - ); - name = Source; - sourceTree = ""; - }; - BC9B82870FB89E610035D8DA /* Fills */ = { - isa = PBXGroup; - children = ( - BC9B82880FB89E610035D8DA /* CPTFill.h */, - BC9B82890FB89E610035D8DA /* CPTFill.m */, - BC9B828A0FB89E610035D8DA /* _CPTFillColor.h */, - BC9B828B0FB89E610035D8DA /* _CPTFillColor.m */, - BC9B828C0FB89E610035D8DA /* _CPTFillGradient.h */, - BC9B828D0FB89E610035D8DA /* _CPTFillGradient.m */, - BC9B828E0FB89E610035D8DA /* _CPTFillImage.h */, - BC9B828F0FB89E610035D8DA /* _CPTFillImage.m */, - ); - name = Fills; - sourceTree = ""; - }; - BC9B82A20FB89E610035D8DA /* Types and Functions */ = { - isa = PBXGroup; - children = ( - BC9B82A30FB89E610035D8DA /* CPTDefinitions.h */, - BC9B82A40FB89E610035D8DA /* CPTDefinitions.m */, - BC9B82A50FB89E610035D8DA /* CPTExceptions.h */, - BC9B82A60FB89E610035D8DA /* CPTExceptions.m */, - BC9B82A70FB89E610035D8DA /* CPTUtilities.h */, - BC9B82A80FB89E610035D8DA /* CPTUtilities.m */, - BC9B82AB0FB89E610035D8DA /* CPTPlotRange.h */, - BC9B82AC0FB89E610035D8DA /* CPTPlotRange.m */, - C3A695DF146A196100AF5653 /* CPTMutablePlotRange.h */, - C3A695E0146A196100AF5653 /* CPTMutablePlotRange.m */, - C31A40BD17ABD6C60020C5C6 /* CPTFunctionDataSource.h */, - C31A40BE17ABD6C60020C5C6 /* CPTFunctionDataSource.m */, - ); - name = "Types and Functions"; - sourceTree = SOURCE_ROOT; - }; - BC9B82B00FB89E610035D8DA /* Categories */ = { - isa = PBXGroup; - children = ( - C3978E0E13CE65C600A420D9 /* NSCoderExtensions.h */, - C3978E0F13CE65C600A420D9 /* NSCoderExtensions.m */, - BC9B82B10FB89E610035D8DA /* NSDecimalNumberExtensions.h */, - BC9B82B20FB89E610035D8DA /* NSDecimalNumberExtensions.m */, - BC9B82B30FB89E610035D8DA /* NSNumberExtensions.h */, - BC9B82B40FB89E610035D8DA /* NSNumberExtensions.m */, - ); - name = Categories; - sourceTree = SOURCE_ROOT; - }; - BC9B82B50FB89E610035D8DA /* Graphs */ = { - isa = PBXGroup; - children = ( - BC9B82B60FB89E610035D8DA /* CPTGraph.h */, - BC9B82B70FB89E610035D8DA /* CPTGraph.m */, - BC9B82B80FB89E610035D8DA /* CPTXYGraph.h */, - BC9B82B90FB89E610035D8DA /* CPTXYGraph.m */, - ); - name = Graphs; - sourceTree = ""; - }; - BC9B82C00FB89E610035D8DA /* Plot Areas */ = { - isa = PBXGroup; - children = ( - BC9B82C10FB89E610035D8DA /* CPTPlotAreaFrame.h */, - BC9B82C20FB89E610035D8DA /* CPTPlotAreaFrame.m */, - C35A65A311025EDF00FE24BB /* CPTPlotArea.h */, - C35A65A411025EDF00FE24BB /* CPTPlotArea.m */, - C318F4BF11EA18A400595FF9 /* CPTLimitBand.h */, - C318F4C011EA18A400595FF9 /* CPTLimitBand.m */, - ); - name = "Plot Areas"; - sourceTree = SOURCE_ROOT; - }; - BC9B82C50FB89E610035D8DA /* Spaces */ = { - isa = PBXGroup; - children = ( - BC9B82C60FB89E610035D8DA /* CPTPlotSpace.h */, - BC9B82C70FB89E610035D8DA /* CPTPlotSpace.m */, - 074D7BC30FD6B65E006011BC /* CPTXYPlotSpace.h */, - 074D7BC40FD6B65F006011BC /* CPTXYPlotSpace.m */, - ); - name = Spaces; - sourceTree = SOURCE_ROOT; - }; - BC9B82CE0FB89E610035D8DA /* Plots */ = { - isa = PBXGroup; - children = ( - C30C85A91047428100181766 /* CPTPlotGroup.h */, - C30C85AA1047428100181766 /* CPTPlotGroup.m */, - BC9B82D20FB89E610035D8DA /* CPTPlot.h */, - BC9B82D30FB89E610035D8DA /* CPTPlot.m */, - BC9B82DA0FB89E610035D8DA /* CPTBarPlot.h */, - BC9B82DB0FB89E610035D8DA /* CPTBarPlot.m */, - BC74A2C010FC087800E7E90D /* CPTPieChart.h */, - BC74A2C110FC087800E7E90D /* CPTPieChart.m */, - D0C047BE12D6568500DA8047 /* CPTRangePlot.h */, - D0C047BD12D6568500DA8047 /* CPTRangePlot.m */, - BC9B82D40FB89E610035D8DA /* CPTScatterPlot.h */, - BC9B82D50FB89E610035D8DA /* CPTScatterPlot.m */, - 0772B4F110E26A12009CD04C /* CPTTradingRangePlot.h */, - 0772B4F210E26A12009CD04C /* CPTTradingRangePlot.m */, - BC9B82CF0FB89E610035D8DA /* Plot Symbols */, - ); - name = Plots; - sourceTree = SOURCE_ROOT; - }; - BC9B82CF0FB89E610035D8DA /* Plot Symbols */ = { - isa = PBXGroup; - children = ( - BC9B82D00FB89E610035D8DA /* CPTPlotSymbol.h */, - BC9B82D10FB89E610035D8DA /* CPTPlotSymbol.m */, - ); - name = "Plot Symbols"; - sourceTree = SOURCE_ROOT; - }; - C32DDEE3191C674600E0FE84 /* iPhone Specific */ = { - isa = PBXGroup; - children = ( - C3791D03191D4C2F001EC514 /* CPTImagePlatformSpecific.m */, - ); - name = "iPhone Specific"; - sourceTree = ""; - }; - C3566B8610EED12700FB3866 /* Documentation */ = { - isa = PBXGroup; - children = ( - C3566B8C10EED17400FB3866 /* doxygen touch.config */, - C3566B8E10EED1B000FB3866 /* mainpage.h */, - C3566B8D10EED17400FB3866 /* doxygen-cocoa-touch-tags.xml */, - C30E97A014B290650012204A /* DoxygenLayout.xml */, - ); - name = Documentation; - sourceTree = ""; - }; - C35A65A811025F2000FE24BB /* Labels */ = { - isa = PBXGroup; - children = ( - C35A65B511025FA900FE24BB /* CPTAxisLabel.h */, - C35A65B611025FA900FE24BB /* CPTAxisLabel.m */, - C35A65B711025FA900FE24BB /* CPTAxisTitle.h */, - C35A65B811025FA900FE24BB /* CPTAxisTitle.m */, - C35A65BD11025FB300FE24BB /* CPTAxisLabelGroup.h */, - C35A65BE11025FB300FE24BB /* CPTAxisLabelGroup.m */, - ); - name = Labels; - sourceTree = ""; - }; - C35A65A911025F2B00FE24BB /* XY Axes */ = { - isa = PBXGroup; - children = ( - C35A65C111025FCC00FE24BB /* CPTXYAxis.h */, - C35A65C211025FCC00FE24BB /* CPTXYAxis.m */, - C35A65C311025FCC00FE24BB /* CPTXYAxisSet.h */, - C35A65C411025FCC00FE24BB /* CPTXYAxisSet.m */, - ); - name = "XY Axes"; - sourceTree = ""; - }; - C35A6602110271EB00FE24BB /* iPhone Specific */ = { - isa = PBXGroup; - children = ( - C35A66051102723E00FE24BB /* CPTTextStylePlatformSpecific.h */, - C35A66061102723E00FE24BB /* CPTTextStylePlatformSpecific.m */, - ); - name = "iPhone Specific"; - sourceTree = ""; - }; - C3920ACC1395B7410045F3BB /* Legends */ = { - isa = PBXGroup; - children = ( - C3920ACD1395B7680045F3BB /* CPTLegend.h */, - C3920ACE1395B7680045F3BB /* CPTLegend.m */, - C30550E71399BE2000E0151F /* CPTLegendEntry.h */, - C30550E81399BE2000E0151F /* CPTLegendEntry.m */, - ); - name = Legends; - sourceTree = ""; - }; - C3B25EE01AC23A930063CCD8 /* CocoaPods */ = { - isa = PBXGroup; - children = ( - C3B25EE11AC23A930063CCD8 /* CorePlot.h */, - ); - path = CocoaPods; - sourceTree = ""; - }; - C3B623A9107EC5460009EF0B /* Layout */ = { - isa = PBXGroup; - children = ( - 074FADF7112024C500394B90 /* CPTConstraints.h */, - 074FADF8112024C500394B90 /* CPTConstraints.m */, - C3CCA04413E8D94800CE6DB1 /* _CPTConstraintsFixed.h */, - C3CCA04513E8D94800CE6DB1 /* _CPTConstraintsFixed.m */, - C3CCA04613E8D94800CE6DB1 /* _CPTConstraintsRelative.h */, - C3CCA04713E8D94800CE6DB1 /* _CPTConstraintsRelative.m */, - ); - name = Layout; - sourceTree = ""; - }; - C3C68316166138B500340E39 /* Animation */ = { - isa = PBXGroup; - children = ( - C3C68318166138E200340E39 /* CPTAnimation.h */, - C3C68319166138E200340E39 /* CPTAnimation.m */, - C3C6831A166138E200340E39 /* CPTAnimationOperation.h */, - C3C6831B166138E200340E39 /* CPTAnimationOperation.m */, - C3C6831C166138E200340E39 /* CPTAnimationPeriod.h */, - C3C6831D166138E200340E39 /* CPTAnimationPeriod.m */, - C3C683281661391A00340E39 /* _CPTAnimationCGFloatPeriod.h */, - C3C683291661391A00340E39 /* _CPTAnimationCGFloatPeriod.m */, - C3C6832A1661391A00340E39 /* _CPTAnimationCGPointPeriod.h */, - C3C6832B1661391A00340E39 /* _CPTAnimationCGPointPeriod.m */, - C3C6832C1661391A00340E39 /* _CPTAnimationCGRectPeriod.h */, - C3C6832D1661391A00340E39 /* _CPTAnimationCGRectPeriod.m */, - C3C6832E1661391A00340E39 /* _CPTAnimationCGSizePeriod.h */, - C3C6832F1661391A00340E39 /* _CPTAnimationCGSizePeriod.m */, - C3C683301661391A00340E39 /* _CPTAnimationNSDecimalPeriod.h */, - C3C683311661391A00340E39 /* _CPTAnimationNSDecimalPeriod.m */, - C3C683321661391A00340E39 /* _CPTAnimationPlotRangePeriod.h */, - C3C683331661391A00340E39 /* _CPTAnimationPlotRangePeriod.m */, - C3C6831E166138E200340E39 /* _CPTAnimationTimingFunctions.h */, - C3C6831F166138E200340E39 /* _CPTAnimationTimingFunctions.m */, - ); - name = Animation; - sourceTree = ""; - }; - C3CADE2911B1885200D36017 /* Numeric Data */ = { - isa = PBXGroup; - children = ( - C3CADE2F11B1886B00D36017 /* license.txt */, - C3CADE3911B188B600D36017 /* CPTNumericDataType.h */, - C3CADE3A11B188B600D36017 /* CPTNumericDataType.m */, - C3CADE3011B188A800D36017 /* CPTNumericData.h */, - C3CADE3111B188A800D36017 /* CPTNumericData.m */, - C3CADE3D11B188C500D36017 /* CPTMutableNumericData.h */, - C3CADE3E11B188C500D36017 /* CPTMutableNumericData.m */, - C3CADE3211B188A800D36017 /* CPTNumericData+TypeConversion.h */, - C3392A351225F63B008DA6BD /* CPTNumericData+TypeConversion.m */, - C3CAFB391229E48200F5C989 /* CPTMutableNumericData+TypeConversion.h */, - C3CAFB3A1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.m */, - C3CADE3411B188A800D36017 /* CPTNumericData+TypeConversions_Generation.py */, - ); - name = "Numeric Data"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - BC9B83430FB8A0A40035D8DA /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - BC9B83C30FB8AC4B0035D8DA /* CorePlot-CocoaTouch.h in Headers */, - 070CB8430FC9DED400F3152B /* CPTAxis.h in Headers */, - 070CB8470FC9DED400F3152B /* CPTAxisSet.h in Headers */, - 070CB8340FC9DEA800F3152B /* CPTColor.h in Headers */, - 070CB8360FC9DEA800F3152B /* CPTColorSpace.h in Headers */, - 0789EFC00FB9F97F00C0A613 /* CPTPlatformSpecificDefines.h in Headers */, - 0789EFBE0FB9F97F00C0A613 /* CPTPlatformSpecificCategories.h in Headers */, - 0789EFC20FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.h in Headers */, - BC79F1D50FD1DC1A00510976 /* CPTGraphHostingView.h in Headers */, - 074D7BC50FD6B65F006011BC /* CPTXYPlotSpace.h in Headers */, - 077F28550FE18048000BCA52 /* CPTBorderedLayer.h in Headers */, - 077F28570FE18048000BCA52 /* CPTPathExtensions.h in Headers */, - 07A62FB50FE2234900CD765C /* CPTTextStyle.h in Headers */, - 072E3F9F0FE2FF7300ACF62F /* CPTTheme.h in Headers */, - 07A2E71E102DFAD300809BC5 /* CPTTimeFormatter.h in Headers */, - 07A5E24C104E47E900B7AB80 /* CPTTextLayer.h in Headers */, - C3B623C0107EC9370009EF0B /* CPTBarPlot.h in Headers */, - BC74A2C210FC087800E7E90D /* CPTPieChart.h in Headers */, - C3B623C1107EC9400009EF0B /* CPTDefinitions.h in Headers */, - C3B623C2107EC9430009EF0B /* CPTExceptions.h in Headers */, - C3B623C3107EC94D0009EF0B /* CPTFill.h in Headers */, - C3B623C4107EC94E0009EF0B /* CPTGradient.h in Headers */, - C3B623C5107EC9500009EF0B /* CPTGraph.h in Headers */, - C3B623C6107EC9510009EF0B /* CPTImage.h in Headers */, - C3B623C7107EC9540009EF0B /* CPTLayer.h in Headers */, - C3B623C8107EC9570009EF0B /* CPTLineStyle.h in Headers */, - C3B623C9107EC95C0009EF0B /* CPTPlot.h in Headers */, - C3B623CA107EC95E0009EF0B /* CPTPlotAreaFrame.h in Headers */, - C3B623CB107EC9610009EF0B /* CPTPlotRange.h in Headers */, - C3B623CC107EC9620009EF0B /* CPTPlotSpace.h in Headers */, - C3B623CD107EC9630009EF0B /* CPTPlotSymbol.h in Headers */, - C3B623CF107EC9680009EF0B /* CPTScatterPlot.h in Headers */, - C3B623D1107EC96E0009EF0B /* CPTUtilities.h in Headers */, - C3B623D2107EC9760009EF0B /* CPTXYGraph.h in Headers */, - 07AEF30310BBF99A0012BEFF /* CPTResponder.h in Headers */, - 0772B4F310E26A12009CD04C /* CPTTradingRangePlot.h in Headers */, - 074FADF9112024C500394B90 /* CPTConstraints.h in Headers */, - C35A65A511025EDF00FE24BB /* CPTPlotArea.h in Headers */, - C35A65B911025FA900FE24BB /* CPTAxisLabel.h in Headers */, - C35A65BB11025FA900FE24BB /* CPTAxisTitle.h in Headers */, - C35A65C711025FCC00FE24BB /* CPTXYAxis.h in Headers */, - C35A65C911025FCC00FE24BB /* CPTXYAxisSet.h in Headers */, - 0718DE4D11D1EDBA00AF4851 /* CPTAnnotation.h in Headers */, - 0718DE4F11D1EDBA00AF4851 /* CPTAnnotationHostLayer.h in Headers */, - 0718DE5111D1EDBA00AF4851 /* CPTLayerAnnotation.h in Headers */, - 0718DE5311D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.h in Headers */, - C318F4C111EA18A400595FF9 /* CPTLimitBand.h in Headers */, - C3D68B091221650C00EB4863 /* CPTMutableNumericData.h in Headers */, - C3D68B0B1221650E00EB4863 /* CPTNumericData+TypeConversion.h in Headers */, - C3D68B0D1221651200EB4863 /* CPTNumericData.h in Headers */, - C3D68B0F1221651500EB4863 /* CPTNumericDataType.h in Headers */, - C3CAFB3B1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.h in Headers */, - 07B69AB912B6281100F4C16C /* CPTMutableTextStyle.h in Headers */, - 07B69B7112B62E9600F4C16C /* CPTMutableLineStyle.h in Headers */, - D0C047C012D6568500DA8047 /* CPTRangePlot.h in Headers */, - C3920ACF1395B7680045F3BB /* CPTLegend.h in Headers */, - C30550E91399BE2000E0151F /* CPTLegendEntry.h in Headers */, - C3D3AD3413DF8E9D0004EA73 /* CPTLineCap.h in Headers */, - C32EE1BD13EC4AF900038266 /* CPTShadow.h in Headers */, - C32EE1C813EC4C7200038266 /* CPTMutableShadow.h in Headers */, - C3A695E1146A196100AF5653 /* CPTMutablePlotRange.h in Headers */, - C349DCB0151AAFAB00BFD6A7 /* CPTCalendarFormatter.h in Headers */, - C35A66071102723E00FE24BB /* CPTTextStylePlatformSpecific.h in Headers */, - C3286C0715D8769800A436A8 /* _CPTMaskLayer.h in Headers */, - C3408C4615FC1CA8004F1D70 /* _CPTBorderLayer.h in Headers */, - BCC7EA451006BF5700B39451 /* _CPTPlainBlackTheme.h in Headers */, - BCC7EA471006BF5700B39451 /* _CPTPlainWhiteTheme.h in Headers */, - BCC7EA491006BF5700B39451 /* _CPTStocksTheme.h in Headers */, - C40CFB94107EC1B40057E828 /* _CPTXYTheme.h in Headers */, - C3B623D4107EC9800009EF0B /* _CPTFillColor.h in Headers */, - C3B623D5107EC9820009EF0B /* _CPTFillGradient.h in Headers */, - C3B623D6107EC9830009EF0B /* _CPTFillImage.h in Headers */, - C3CCA04813E8D94800CE6DB1 /* _CPTConstraintsFixed.h in Headers */, - C3CCA04A13E8D94800CE6DB1 /* _CPTConstraintsRelative.h in Headers */, - C3436C5113F4AC6000739AC2 /* _CPTSlateTheme.h in Headers */, - C304565313F4AC9A004D04BC /* _CPTDarkGradientTheme.h in Headers */, - C35A65BF11025FB300FE24BB /* CPTAxisLabelGroup.h in Headers */, - C38DD49711A04B99002A68E7 /* CPTGridLineGroup.h in Headers */, - C35A65B311025F8A00FE24BB /* CPTGridLines.h in Headers */, - C30C85AB1047428100181766 /* CPTPlotGroup.h in Headers */, - C3978E1013CE65C600A420D9 /* NSCoderExtensions.h in Headers */, - BC4FAF29100D7DF300811DD3 /* NSDecimalNumberExtensions.h in Headers */, - C3B623D3107EC97A0009EF0B /* NSNumberExtensions.h in Headers */, - C3C68320166138E200340E39 /* CPTAnimation.h in Headers */, - C3C68322166138E200340E39 /* CPTAnimationOperation.h in Headers */, - C3C68324166138E200340E39 /* CPTAnimationPeriod.h in Headers */, - C3C68326166138E200340E39 /* _CPTAnimationTimingFunctions.h in Headers */, - C3C683341661391A00340E39 /* _CPTAnimationCGFloatPeriod.h in Headers */, - C3C683361661391A00340E39 /* _CPTAnimationCGPointPeriod.h in Headers */, - C3C683381661391A00340E39 /* _CPTAnimationCGRectPeriod.h in Headers */, - C3C6833A1661391A00340E39 /* _CPTAnimationCGSizePeriod.h in Headers */, - C3C6833C1661391A00340E39 /* _CPTAnimationNSDecimalPeriod.h in Headers */, - C3C6833E1661391A00340E39 /* _CPTAnimationPlotRangePeriod.h in Headers */, - C3D9825116BD406600DE7977 /* CorePlot_Prefix.pch in Headers */, - C31A40BF17ABD6C60020C5C6 /* CPTFunctionDataSource.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - BC9B83460FB8A0A40035D8DA /* CorePlot-CocoaTouch */ = { - isa = PBXNativeTarget; - buildConfigurationList = BC9B834A0FB8A0AA0035D8DA /* Build configuration list for PBXNativeTarget "CorePlot-CocoaTouch" */; - buildPhases = ( - BC9B83430FB8A0A40035D8DA /* Headers */, - BC9B83440FB8A0A40035D8DA /* Sources */, - BC9B83450FB8A0A40035D8DA /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "CorePlot-CocoaTouch"; - productName = "CorePlot-CocoaTouch"; - productReference = BC9B83470FB8A0A40035D8DA /* libCorePlot-CocoaTouch.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0700; - }; - buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CorePlot-CocoaTouch" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - BC9B83460FB8A0A40035D8DA /* CorePlot-CocoaTouch */, - C3566B8010EED04900FB3866 /* Documentation */, - 0799D97A137318CF0026072C /* Universal Library */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXShellScriptBuildPhase section */ - 0799D97F137318D80026072C /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\nUFW_TARGET=${PROJECT}\nUFW_BUILD_DIR=\"${BUILD_DIR}\"\n\nif [ -z ${SDK_NAME} ]; then\n# Use the latest iphoneos SDK available\nUFW_GREP_RESULT=$(xcodebuild -showsdks | grep -o \"iphoneos.*$\")\nwhile read -r line; do\nUFW_SDK_VERSION=\"${line}\"\ndone <<< \"${UFW_GREP_RESULT}\"\nelse\n# Use the SDK specified by XCode\nUFW_SDK_VERSION=\"${SDK_NAME}\"\nfi\n\nUFW_SDK_VERSION=$(echo \"${UFW_SDK_VERSION}\" | grep -o \"[0-9].*$\")\nUFW_IPHONE_DIR=\"${UFW_BUILD_DIR}/Release-iphoneos\"\nUFW_SIMULATOR_DIR=\"${UFW_BUILD_DIR}/Release-iphonesimulator\"\nUFW_UNIVERSAL_DIR=\"${UFW_BUILD_DIR}/Release-universal\"\nUFW_HEADER_DIR=\"${UFW_UNIVERSAL_DIR}/CorePlotHeaders\"\nUFW_EXE_PATH=\"lib${PROJECT}.a\"\n\n# Build Framework\n\nrm -rf \"${UFW_UNIVERSAL_DIR}\"\n\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot-CocoaTouch.xcodeproj -configuration Release -sdk iphoneos${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot-CocoaTouch.xcodeproj -configuration Release -sdk iphonesimulator${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\n\nmkdir -p \"${UFW_UNIVERSAL_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\nlipo -create -output \"${UFW_UNIVERSAL_DIR}/${UFW_EXE_PATH}\" \"${UFW_IPHONE_DIR}/${UFW_EXE_PATH}\" \"${UFW_SIMULATOR_DIR}/${UFW_EXE_PATH}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: lipo failed\"; exit 1; fi\n\n# copy header files\nmkdir -p \"${UFW_HEADER_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\ncp \"${SOURCE_ROOT}/CorePlot-CocoaTouch.h\" \"${UFW_HEADER_DIR}\"\ncp \"${SOURCE_ROOT}/iPhoneOnly/\"[!_]*.h \"${UFW_HEADER_DIR}/\"\ncp \"${SOURCE_ROOT}/Source/\"[!_]*.h \"${UFW_HEADER_DIR}/\"\n\nrm \"${UFW_HEADER_DIR}/\"*Tests.*"; - }; - C3566B7F10EED04900FB3866 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# Build the doxygen documentation for the project and load the docset into Xcode.\n\n# Use the following to adjust the value of the $DOXYGEN_PATH User-Defined Setting:\n# Binary install location: /Applications/Doxygen.app/Contents/Resources/doxygen\n# Source build install location: /usr/local/bin/doxygen\n\n# Graphical class diagrams require Graphviz.\n# Graphviz.app is available free online\n# http://www.graphviz.org/Download_macos.php\n\n# If the config file doesn't exist, run 'doxygen -g \"${SOURCE_ROOT}/../documentation/doxygen/doxygen touch.config\"' to \n# a get default file.\n\nDOXYGEN_FOLDER=\"${SOURCE_ROOT}/../documentation/doxygen\"\n\nif ! [ -f \"${DOXYGEN_FOLDER}/doxygen.config\" ]\nthen\n echo doxygen config file does not exist\n ${DOXYGEN_PATH} -g \"${DOXYGEN_FOLDER}/doxygen.config\"\nfi\n\n# Run doxygen on the updated config file.\n# Note: doxygen creates a Makefile that does most of the heavy lifting.\n${DOXYGEN_PATH} \"${SOURCE_ROOT}/../documentation/doxygen/doxygen touch.config\"\n\n# make a copy of the html docs\nDOCS_FOLDER=\"${SOURCE_ROOT}/../documentation/html/iOS\"\nmkdir -p \"${DOCS_FOLDER}\"\ncp -R \"${SOURCE_ROOT}/CorePlotTouchDocs.docset/html/\" \"${DOCS_FOLDER}\"\nrm -f \"${DOCS_FOLDER}/Info.plist\"\nrm -f \"${DOCS_FOLDER}/Makefile\"\nrm -f \"${DOCS_FOLDER}/Nodes.xml\"\nrm -f \"${DOCS_FOLDER}/Tokens.xml\"\n\n# fix nodes.xml so the docset gets the correct index page\nsed -i 's|index.html|index.html' \"${SOURCE_ROOT}/CorePlotTouchDocs.docset/html/nodes.xml\"\n\n# make will invoke docsetutil. Take a look at the Makefile to see how this is done.\nmake -C \"${SOURCE_ROOT}/CorePlotTouchDocs.docset/html\" install\n\n# add publisher info to the docset\nDOCSET_FOLDER=\"/Users/${USER}/Library/Developer/Shared/Documentation/DocSets/com.CorePlotTouch.Framework.docset\"\n\nfind \"${DOCSET_FOLDER}/Contents/\" -type f -name Info.plist | xargs perl -pi -e 's/\\<\\/dict\\>/\\t\\DocSetPublisherIdentifier\\<\\/key\\>\\n\\t\\com.CorePlot.documentation\\<\\/string\\>\\n\\t\\DocSetPublisherName\\<\\/key\\>\\n\\t\\Core Plot\\<\\/string\\>\\n\\t\\NSHumanReadableCopyright\\<\\/key\\>\\n\\t\\Copyright © 2013 Core Plot. All rights reserved.\\<\\/string\\>\\n\\t\\isJavaScriptEnabled\\<\\/key\\>\\n\\t\\\\n\\<\\/dict\\>\\n/g'\n\n# add docset icon\ncp \"${DOXYGEN_FOLDER}/icon.png\" \"${DOCSET_FOLDER}\"\n\n# make a copy of the docset\nrm -Rf \"${SOURCE_ROOT}/CorePlotTouchDocs.docset\"\ncp -R \"${DOCSET_FOLDER}\" \"${SOURCE_ROOT}\"\n\n# Construct a temporary applescript file to tell Xcode to load a docset.\nrm -f \"${TEMP_DIR}/loadDocSet.scpt\"\n\necho \"tell application \\\"Xcode\\\"\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\necho \"load documentation set with path \\\"/Users/${USER}/Library/Developer/Shared/Documentation/DocSets/\\\"\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\necho \"end tell\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\n\n# Run the load-docset applescript command.\nosascript \"${TEMP_DIR}/loadDocSet.scpt\"\n\nexit 0"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - BC9B83440FB8A0A40035D8DA /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - BC9B834E0FB8A1400035D8DA /* CPTPlot.m in Sources */, - BC9B834F0FB8A1400035D8DA /* CPTScatterPlot.m in Sources */, - BC9B83500FB8A1400035D8DA /* CPTBarPlot.m in Sources */, - BC9B83510FB8A1400035D8DA /* CPTPlotSymbol.m in Sources */, - BC9B83520FB8A1400035D8DA /* CPTPlotSpace.m in Sources */, - BC9B83550FB8A1400035D8DA /* CPTPlotAreaFrame.m in Sources */, - BC9B83560FB8A1400035D8DA /* CPTGraph.m in Sources */, - BC9B83570FB8A1400035D8DA /* CPTXYGraph.m in Sources */, - BC9B835A0FB8A1400035D8DA /* NSDecimalNumberExtensions.m in Sources */, - BC9B835B0FB8A1400035D8DA /* NSNumberExtensions.m in Sources */, - BC9B835D0FB8A1400035D8DA /* CPTDefinitions.m in Sources */, - BC9B835E0FB8A1400035D8DA /* CPTExceptions.m in Sources */, - BC9B835F0FB8A1400035D8DA /* CPTUtilities.m in Sources */, - BC9B83600FB8A1400035D8DA /* CPTPlotRange.m in Sources */, - BC9B83610FB8A1400035D8DA /* CPTFill.m in Sources */, - BC9B83620FB8A1400035D8DA /* _CPTFillColor.m in Sources */, - BC9B83630FB8A1400035D8DA /* _CPTFillGradient.m in Sources */, - BC9B83640FB8A1400035D8DA /* _CPTFillImage.m in Sources */, - C3791D05191D4C2F001EC514 /* CPTImagePlatformSpecific.m in Sources */, - 0789EFBF0FB9F97F00C0A613 /* CPTPlatformSpecificCategories.m in Sources */, - 0789EFC10FB9F97F00C0A613 /* CPTPlatformSpecificDefines.m in Sources */, - 0789EFC30FB9F97F00C0A613 /* CPTPlatformSpecificFunctions.m in Sources */, - 070CB82A0FC9DE4B00F3152B /* CPTGradient.m in Sources */, - 070CB82B0FC9DE5500F3152B /* CPTImage.m in Sources */, - 070CB82C0FC9DE5600F3152B /* CPTLayer.m in Sources */, - 070CB82D0FC9DE5700F3152B /* CPTLineStyle.m in Sources */, - 070CB8350FC9DEA800F3152B /* CPTColor.m in Sources */, - 070CB8370FC9DEA800F3152B /* CPTColorSpace.m in Sources */, - 070CB8440FC9DED400F3152B /* CPTAxis.m in Sources */, - 070CB8480FC9DED400F3152B /* CPTAxisSet.m in Sources */, - 070CB85E0FC9DF4700F3152B /* CPTTextLayer.m in Sources */, - BC79F1D60FD1DC1A00510976 /* CPTGraphHostingView.m in Sources */, - 074D7BC60FD6B65F006011BC /* CPTXYPlotSpace.m in Sources */, - 077F28560FE18048000BCA52 /* CPTBorderedLayer.m in Sources */, - 077F28580FE18048000BCA52 /* CPTPathExtensions.m in Sources */, - 07A62FB60FE2234900CD765C /* CPTTextStyle.m in Sources */, - 072E3FA00FE2FF7300ACF62F /* CPTTheme.m in Sources */, - BCC7EA461006BF5700B39451 /* _CPTPlainBlackTheme.m in Sources */, - BCC7EA481006BF5700B39451 /* _CPTPlainWhiteTheme.m in Sources */, - BCC7EA4A1006BF5700B39451 /* _CPTStocksTheme.m in Sources */, - BC89A79A1024AB19009D5261 /* CorePlotProbes.d in Sources */, - 07A2E71F102DFAD300809BC5 /* CPTTimeFormatter.m in Sources */, - C30C85AC1047428100181766 /* CPTPlotGroup.m in Sources */, - C40CFB95107EC1B40057E828 /* _CPTXYTheme.m in Sources */, - 0772B4F410E26A12009CD04C /* CPTTradingRangePlot.m in Sources */, - BC74A2C310FC087800E7E90D /* CPTPieChart.m in Sources */, - 074FADFA112024C500394B90 /* CPTConstraints.m in Sources */, - 07FCF2D4115B54DE00E46606 /* _CPTSlateTheme.m in Sources */, - C35A65A611025EDF00FE24BB /* CPTPlotArea.m in Sources */, - C35A65B411025F8A00FE24BB /* CPTGridLines.m in Sources */, - C35A65BA11025FA900FE24BB /* CPTAxisLabel.m in Sources */, - C35A65BC11025FA900FE24BB /* CPTAxisTitle.m in Sources */, - C35A65C011025FB300FE24BB /* CPTAxisLabelGroup.m in Sources */, - C35A65C811025FCC00FE24BB /* CPTXYAxis.m in Sources */, - C35A65CA11025FCC00FE24BB /* CPTXYAxisSet.m in Sources */, - C35A66081102723E00FE24BB /* CPTTextStylePlatformSpecific.m in Sources */, - C38DD49811A04B99002A68E7 /* CPTGridLineGroup.m in Sources */, - 0718DE4E11D1EDBA00AF4851 /* CPTAnnotation.m in Sources */, - 0718DE5011D1EDBA00AF4851 /* CPTAnnotationHostLayer.m in Sources */, - 0718DE5211D1EDBA00AF4851 /* CPTLayerAnnotation.m in Sources */, - 0718DE5411D1EDBA00AF4851 /* CPTPlotSpaceAnnotation.m in Sources */, - C318F4C211EA18A400595FF9 /* CPTLimitBand.m in Sources */, - C3D68B0A1221650D00EB4863 /* CPTMutableNumericData.m in Sources */, - C3D68B0E1221651200EB4863 /* CPTNumericData.m in Sources */, - C3D68B101221651600EB4863 /* CPTNumericDataType.m in Sources */, - C3392A361225F63B008DA6BD /* CPTNumericData+TypeConversion.m in Sources */, - C3CAFB3C1229E48200F5C989 /* CPTMutableNumericData+TypeConversion.m in Sources */, - 07B69ABA12B6281100F4C16C /* CPTMutableTextStyle.m in Sources */, - 07B69B7212B62E9600F4C16C /* CPTMutableLineStyle.m in Sources */, - D0C047BF12D6568500DA8047 /* CPTRangePlot.m in Sources */, - C3920AD01395B7680045F3BB /* CPTLegend.m in Sources */, - C30550EA1399BE2000E0151F /* CPTLegendEntry.m in Sources */, - C3978E1113CE65C600A420D9 /* NSCoderExtensions.m in Sources */, - C3D3AD3513DF8E9D0004EA73 /* CPTLineCap.m in Sources */, - C3CCA04913E8D94800CE6DB1 /* _CPTConstraintsFixed.m in Sources */, - C3CCA04B13E8D94800CE6DB1 /* _CPTConstraintsRelative.m in Sources */, - C32EE1BE13EC4AF900038266 /* CPTShadow.m in Sources */, - C32EE1C913EC4C7200038266 /* CPTMutableShadow.m in Sources */, - C3436C4F13F4AC4400739AC2 /* _CPTDarkGradientTheme.m in Sources */, - C3A695E2146A196100AF5653 /* CPTMutablePlotRange.m in Sources */, - C349DCB1151AAFAB00BFD6A7 /* CPTCalendarFormatter.m in Sources */, - C3286C0815D8769800A436A8 /* _CPTMaskLayer.m in Sources */, - C3408C4715FC1CA8004F1D70 /* _CPTBorderLayer.m in Sources */, - C3C68321166138E200340E39 /* CPTAnimation.m in Sources */, - C3C68323166138E200340E39 /* CPTAnimationOperation.m in Sources */, - C3C68325166138E200340E39 /* CPTAnimationPeriod.m in Sources */, - C3C68327166138E200340E39 /* _CPTAnimationTimingFunctions.m in Sources */, - C3C683351661391A00340E39 /* _CPTAnimationCGFloatPeriod.m in Sources */, - C3C683371661391A00340E39 /* _CPTAnimationCGPointPeriod.m in Sources */, - C3C683391661391A00340E39 /* _CPTAnimationCGRectPeriod.m in Sources */, - C3C6833B1661391A00340E39 /* _CPTAnimationCGSizePeriod.m in Sources */, - C3C6833D1661391A00340E39 /* _CPTAnimationNSDecimalPeriod.m in Sources */, - C3C6833F1661391A00340E39 /* _CPTAnimationPlotRangePeriod.m in Sources */, - C31A40C017ABD6C60020C5C6 /* CPTFunctionDataSource.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin XCBuildConfiguration section */ - 0799D97B137318CF0026072C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = UniversalLibrary; - }; - name = Debug; - }; - 0799D97C137318CF0026072C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = UniversalLibrary; - }; - name = Release; - }; - BC9B83480FB8A0A50035D8DA /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C31908A3199813D400B61898 /* CorePlot.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_SYMBOL_SEPARATION = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = CorePlot_Prefix.pch; - INSTALL_PATH = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; - OTHER_CPTLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; - PRODUCT_NAME = "CorePlot-CocoaTouch"; - PUBLIC_HEADERS_FOLDER_PATH = "include/$(PROJECT_NAME)"; - }; - name = Debug; - }; - BC9B83490FB8A0A50035D8DA /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = C31908A3199813D400B61898 /* CorePlot.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_SYMBOL_SEPARATION = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = CorePlot_Prefix.pch; - INSTALL_PATH = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; - OTHER_CPTLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; - PRODUCT_NAME = "CorePlot-CocoaTouch"; - PUBLIC_HEADERS_FOLDER_PATH = "include/$(PROJECT_NAME)"; - ZERO_LINK = NO; - }; - name = Release; - }; - C01FCF4F08A954540054247B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - MACH_O_TYPE = staticlib; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "-ObjC"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "$(PROJECT_DIR)/../build"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEPLOYMENT_POSTPROCESSING = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_INLINES_ARE_PRIVATE_EXTERN = YES; - IPHONEOS_DEPLOYMENT_TARGET = 5.0; - MACH_O_TYPE = staticlib; - OTHER_LDFLAGS = "-ObjC"; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - STRIP_INSTALLED_PRODUCT = YES; - SYMROOT = "$(PROJECT_DIR)/../build"; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - C3566B8110EED04A00FB3866 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - PRODUCT_NAME = Documentation; - }; - name = Debug; - }; - C3566B8210EED04A00FB3866 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; - PRODUCT_NAME = Documentation; - ZERO_LINK = NO; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 0799D97D137318CF0026072C /* Build configuration list for PBXAggregateTarget "Universal Library" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 0799D97B137318CF0026072C /* Debug */, - 0799D97C137318CF0026072C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - BC9B834A0FB8A0AA0035D8DA /* Build configuration list for PBXNativeTarget "CorePlot-CocoaTouch" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - BC9B83480FB8A0A50035D8DA /* Debug */, - BC9B83490FB8A0A50035D8DA /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CorePlot-CocoaTouch" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C01FCF4F08A954540054247B /* Debug */, - C01FCF5008A954540054247B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C3566B8410EED06800FB3866 /* Build configuration list for PBXAggregateTarget "Documentation" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C3566B8110EED04A00FB3866 /* Debug */, - C3566B8210EED04A00FB3866 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; -} diff --git a/framework/CorePlot-CocoaTouch.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/framework/CorePlot-CocoaTouch.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 8937881b3..000000000 --- a/framework/CorePlot-CocoaTouch.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/framework/CorePlot.h b/framework/CorePlot.h index 2860628c2..fbf2740c2 100644 --- a/framework/CorePlot.h +++ b/framework/CorePlot.h @@ -1,5 +1,17 @@ +#import "TargetConditionals.h" + +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + +#import +#import + +#else + #import +#import +#endif + #import #import #import @@ -15,13 +27,13 @@ #import #import #import -#import #import #import #import #import #import #import +#import #import #import #import @@ -31,19 +43,19 @@ #import #import #import -#import #import +#import #import #import #import -#import -#import #import +#import +#import +#import #import +#import #import #import -#import -#import #import #import #import @@ -57,12 +69,11 @@ #import #import #import -#import #import #import +#import #import #import #import #import #import -#import diff --git a/framework/CorePlot.xcconfig b/framework/CorePlot.xcconfig deleted file mode 100644 index 6eb1e454f..000000000 --- a/framework/CorePlot.xcconfig +++ /dev/null @@ -1,9 +0,0 @@ -#include "CorePlotWarnings.xcconfig" - -SYMROOT = $(PROJECT_DIR)/../build -COPY_PHASE_STRIP = YES -STRIP_STYLE = debugging -SEPARATE_STRIP = YES -GCC_C_LANGUAGE_STANDARD = c99 -DEAD_CODE_STRIPPING = YES -CLANG_ENABLE_OBJC_ARC = YES diff --git a/framework/CorePlot.xcodeproj/project.pbxproj b/framework/CorePlot.xcodeproj/project.pbxproj index c57bccf90..f6971f390 100644 --- a/framework/CorePlot.xcodeproj/project.pbxproj +++ b/framework/CorePlot.xcodeproj/project.pbxproj @@ -3,19 +3,63 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 47; objects = { /* Begin PBXAggregateTarget section */ - 9021E49E0FC5C9DC00443472 /* Documentation */ = { + 9021E49E0FC5C9DC00443472 /* Documentation-Mac */ = { isa = PBXAggregateTarget; - buildConfigurationList = 9021E4A10FC5C9FB00443472 /* Build configuration list for PBXAggregateTarget "Documentation" */; + buildConfigurationList = 9021E4A10FC5C9FB00443472 /* Build configuration list for PBXAggregateTarget "Documentation-Mac" */; buildPhases = ( 9021E49D0FC5C9DC00443472 /* ShellScript */, ); dependencies = ( ); - name = Documentation; + name = "Documentation-Mac"; + productName = Documentation; + }; + C37EA5C41BC83E900091C8F7 /* Universal tvOS Framework */ = { + isa = PBXAggregateTarget; + buildConfigurationList = C37EA5C61BC83E900091C8F7 /* Build configuration list for PBXAggregateTarget "Universal tvOS Framework" */; + buildPhases = ( + C37EA5C51BC83E900091C8F7 /* ShellScript */, + ); + dependencies = ( + ); + name = "Universal tvOS Framework"; + productName = Documentation; + }; + C38A09911A4618B600D45436 /* Documentation-iOS */ = { + isa = PBXAggregateTarget; + buildConfigurationList = C38A09931A4618B600D45436 /* Build configuration list for PBXAggregateTarget "Documentation-iOS" */; + buildPhases = ( + C38A09921A4618B600D45436 /* ShellScript */, + ); + dependencies = ( + ); + name = "Documentation-iOS"; + productName = Documentation; + }; + C38A09961A46193F00D45436 /* Universal Library */ = { + isa = PBXAggregateTarget; + buildConfigurationList = C38A09981A46193F00D45436 /* Build configuration list for PBXAggregateTarget "Universal Library" */; + buildPhases = ( + C38A09971A46193F00D45436 /* ShellScript */, + ); + dependencies = ( + ); + name = "Universal Library"; + productName = Documentation; + }; + C3A5467F1BC1A817005C1BBC /* Universal iOS Framework */ = { + isa = PBXAggregateTarget; + buildConfigurationList = C3A546811BC1A817005C1BBC /* Build configuration list for PBXAggregateTarget "Universal iOS Framework" */; + buildPhases = ( + C3A546801BC1A817005C1BBC /* ShellScript */, + ); + dependencies = ( + ); + name = "Universal iOS Framework"; productName = Documentation; }; /* End PBXAggregateTarget section */ @@ -77,7 +121,6 @@ 07B69A5E12B6215000F4C16C /* CPTTextStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69A5C12B6215000F4C16C /* CPTTextStyle.m */; }; 07B69B1712B62ABB00F4C16C /* CPTMutableLineStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B69B1512B62ABB00F4C16C /* CPTMutableLineStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; 07B69B1812B62ABB00F4C16C /* CPTMutableLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69B1612B62ABB00F4C16C /* CPTMutableLineStyle.m */; }; - 07BF0D660F2B70B8002FCEA7 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07BF0D630F2B70B8002FCEA7 /* QuartzCore.framework */; }; 07BF0D720F2B718F002FCEA7 /* CPTGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D700F2B718F002FCEA7 /* CPTGraph.h */; settings = {ATTRIBUTES = (Public, ); }; }; 07BF0D730F2B718F002FCEA7 /* CPTGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D710F2B718F002FCEA7 /* CPTGraph.m */; }; 07BF0D780F2B723A002FCEA7 /* CPTPlotAreaFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D760F2B723A002FCEA7 /* CPTPlotAreaFrame.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -122,7 +165,6 @@ 4CD7E7F00F4B4FA700F9BCBB /* NSDecimalNumberExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CD7E7EE0F4B4FA700F9BCBB /* NSDecimalNumberExtensions.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4CD7E7F10F4B4FA700F9BCBB /* NSDecimalNumberExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E7EF0F4B4FA700F9BCBB /* NSDecimalNumberExtensions.m */; }; 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; - 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; }; 906156BE0F375598001B75FC /* CPTLineStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 906156BC0F375598001B75FC /* CPTLineStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; 906156BF0F375598001B75FC /* CPTLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 906156BD0F375598001B75FC /* CPTLineStyle.m */; }; 90AF4FBA0F36D39700753D26 /* CPTXYPlotSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 90AF4FB90F36D39700753D26 /* CPTXYPlotSpace.m */; }; @@ -146,13 +188,18 @@ BC74A33110FC402600E7E90D /* CPTPieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74A32F10FC402600E7E90D /* CPTPieChart.m */; }; BC79F1360FD1CD6600510976 /* CPTGraphHostingView.h in Headers */ = {isa = PBXBuildFile; fileRef = BC79F1340FD1CD6600510976 /* CPTGraphHostingView.h */; settings = {ATTRIBUTES = (Public, ); }; }; BC79F1370FD1CD6600510976 /* CPTGraphHostingView.m in Sources */ = {isa = PBXBuildFile; fileRef = BC79F1350FD1CD6600510976 /* CPTGraphHostingView.m */; }; - BC89A64110239D1D009D5261 /* CorePlotProbes.d in Sources */ = {isa = PBXBuildFile; fileRef = BC89A64010239D1D009D5261 /* CorePlotProbes.d */; }; BCFC7C3710921FDB00DAECAA /* CPTAxisTitle.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFC7C3510921FDB00DAECAA /* CPTAxisTitle.h */; settings = {ATTRIBUTES = (Public, ); }; }; BCFC7C3810921FDB00DAECAA /* CPTAxisTitle.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFC7C3610921FDB00DAECAA /* CPTAxisTitle.m */; }; C30550ED1399BE5400E0151F /* CPTLegendEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = C30550EB1399BE5400E0151F /* CPTLegendEntry.h */; settings = {ATTRIBUTES = (Public, ); }; }; C30550EE1399BE5400E0151F /* CPTLegendEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = C30550EC1399BE5400E0151F /* CPTLegendEntry.m */; }; C318F4AD11EA188700595FF9 /* CPTLimitBand.h in Headers */ = {isa = PBXBuildFile; fileRef = C318F4AB11EA188700595FF9 /* CPTLimitBand.h */; settings = {ATTRIBUTES = (Public, ); }; }; C318F4AE11EA188700595FF9 /* CPTLimitBand.m in Sources */ = {isa = PBXBuildFile; fileRef = C318F4AC11EA188700595FF9 /* CPTLimitBand.m */; }; + C3226A521A69F6DA00F77249 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A511A69F6DA00F77249 /* QuartzCore.framework */; }; + C3226A541A69F6DF00F77249 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A531A69F6DF00F77249 /* UIKit.framework */; }; + C3226A581A69F6FA00F77249 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A571A69F6FA00F77249 /* CoreGraphics.framework */; }; + C3226A5C1A69F72900F77249 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A531A69F6DF00F77249 /* UIKit.framework */; }; + C3226A5E1A69F73800F77249 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A511A69F6DA00F77249 /* QuartzCore.framework */; }; + C3226A5F1A69F75400F77249 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A571A69F6FA00F77249 /* CoreGraphics.framework */; }; C3286C0015D8740100A436A8 /* _CPTMaskLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = C3286BFE15D8740100A436A8 /* _CPTMaskLayer.h */; settings = {ATTRIBUTES = (); }; }; C3286C0115D8740100A436A8 /* _CPTMaskLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3286BFF15D8740100A436A8 /* _CPTMaskLayer.m */; }; C32EE1B613EC4AA800038266 /* CPTShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = C32EE1B413EC4AA800038266 /* CPTShadow.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -184,9 +231,554 @@ C34AFE9B1102248D0041675A /* CPTPlotArea.h in Headers */ = {isa = PBXBuildFile; fileRef = C34BF5BA10A67633007F0894 /* CPTPlotArea.h */; settings = {ATTRIBUTES = (Public, ); }; }; C34F0D58121CB3EC0020FDD3 /* CPTTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0730F64D109494D100E95162 /* CPTTestCase.m */; }; C34F0D59121CB3F00020FDD3 /* CPTDataSourceTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */; }; - C365E19B1973193A0096AAE1 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C365E19A1973193A0096AAE1 /* XCTest.framework */; }; C36E89BA11EE7F97003DE309 /* CPTPlotRangeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C36E89B911EE7F97003DE309 /* CPTPlotRangeTests.m */; }; + C370D5971A753F1C00AF4312 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A571A69F6FA00F77249 /* CoreGraphics.framework */; }; + C377B3BB1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C377B3BA1C122AA600891DF8 /* CPTCalendarFormatterTests.m */; }; + C377B3BC1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C377B3BA1C122AA600891DF8 /* CPTCalendarFormatterTests.m */; }; + C377B3BD1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C377B3BA1C122AA600891DF8 /* CPTCalendarFormatterTests.m */; }; + C377B3BE1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C377B3BA1C122AA600891DF8 /* CPTCalendarFormatterTests.m */; }; C3791D09191D4C4C001EC514 /* CPTImagePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C3791D07191D4C4C001EC514 /* CPTImagePlatformSpecific.m */; }; + C37EA5CB1BC83F2A0091C8F7 /* CPTGraphHostingView.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B281A46265300D45436 /* CPTGraphHostingView.m */; }; + C37EA5CC1BC83F2A0091C8F7 /* CPTLayerAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E10BBA11D10183000B8DAB /* CPTLayerAnnotation.m */; }; + C37EA5CD1BC83F2A0091C8F7 /* CPTLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E7EB0F4B4F9600F9BCBB /* CPTLayer.m */; }; + C37EA5CE1BC83F2A0091C8F7 /* CPTTimeFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 07A2E6FB102DF47900809BC5 /* CPTTimeFormatter.m */; }; + C37EA5CF1BC83F2A0091C8F7 /* CPTColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 079FC0B30FB975500037E990 /* CPTColor.m */; }; + C37EA5D01BC83F2A0091C8F7 /* NSCoderExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = C3978E0513CE653B00A420D9 /* NSCoderExtensions.m */; }; + C37EA5D11BC83F2A0091C8F7 /* CPTMutableNumericData.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF11104D819100B554F9 /* CPTMutableNumericData.m */; }; + C37EA5D21BC83F2A0091C8F7 /* CPTNumericData+TypeConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = C3392A371225F667008DA6BD /* CPTNumericData+TypeConversion.m */; }; + C37EA5D31BC83F2A0091C8F7 /* CPTTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772C9260FE2F71600EC4C16 /* CPTTheme.m */; }; + C37EA5D41BC83F2A0091C8F7 /* CPTDefinitions.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0DF20F2B7BFB002FCEA7 /* CPTDefinitions.m */; }; + C37EA5D51BC83F2A0091C8F7 /* _CPTFillImage.m in Sources */ = {isa = PBXBuildFile; fileRef = C342601D0FAE096C00072842 /* _CPTFillImage.m */; }; + C37EA5D61BC83F2A0091C8F7 /* CPTPlotSpaceAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E10BB011D1016B000B8DAB /* CPTPlotSpaceAnnotation.m */; }; + C37EA5D71BC83F2A0091C8F7 /* CPTXYAxis.m in Sources */ = {isa = PBXBuildFile; fileRef = 0783DD540FBF097E006C3696 /* CPTXYAxis.m */; }; + C37EA5D81BC83F2A0091C8F7 /* CPTBarPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 0799E0940F2BB5F300790525 /* CPTBarPlot.m */; }; + C37EA5D91BC83F2A0091C8F7 /* CPTAxisTitle.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFC7C3610921FDB00DAECAA /* CPTAxisTitle.m */; }; + C37EA5DA1BC83F2A0091C8F7 /* CPTPlatformSpecificDefines.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B1B1A46264500D45436 /* CPTPlatformSpecificDefines.m */; }; + C37EA5DB1BC83F2A0091C8F7 /* _CPTStocksTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BC55023110059F22005DF982 /* _CPTStocksTheme.m */; }; + C37EA5DC1BC83F2A0091C8F7 /* CPTImagePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0A591A4620B800D45436 /* CPTImagePlatformSpecific.m */; }; + C37EA5DD1BC83F2A0091C8F7 /* _CPTAnimationCGFloatPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C9CB16165DB52C00739006 /* _CPTAnimationCGFloatPeriod.m */; }; + C37EA5DE1BC83F2A0091C8F7 /* CPTExceptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 07321BC00F37370D00F423D8 /* CPTExceptions.m */; }; + C37EA5DF1BC83F2A0091C8F7 /* _CPTDarkGradientTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772C92E0FE2F89000EC4C16 /* _CPTDarkGradientTheme.m */; }; + C37EA5E01BC83F2A0091C8F7 /* _CPTPlainBlackTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BC55022D10059F22005DF982 /* _CPTPlainBlackTheme.m */; }; + C37EA5E11BC83F2A0091C8F7 /* CPTNumericData.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EEFB104D80C400B554F9 /* CPTNumericData.m */; }; + C37EA5E31BC83F2A0091C8F7 /* CPTXYAxisSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 07975C420F3B816600DE45DC /* CPTXYAxisSet.m */; }; + C37EA5E41BC83F2A0091C8F7 /* CPTLimitBand.m in Sources */ = {isa = PBXBuildFile; fileRef = C318F4AC11EA188700595FF9 /* CPTLimitBand.m */; }; + C37EA5E51BC83F2A0091C8F7 /* CPTGridLines.m in Sources */ = {isa = PBXBuildFile; fileRef = C32B391710AA4C78000470D4 /* CPTGridLines.m */; }; + C37EA5E61BC83F2A0091C8F7 /* CPTPathExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 070622310FDF1B250066A6C4 /* CPTPathExtensions.m */; }; + C37EA5E71BC83F2A0091C8F7 /* CPTXYPlotSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 90AF4FB90F36D39700753D26 /* CPTXYPlotSpace.m */; }; + C37EA5E81BC83F2A0091C8F7 /* CPTPlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = 32484B400F530E8B002151AD /* CPTPlotRange.m */; }; + C37EA5E91BC83F2A0091C8F7 /* CPTImage.m in Sources */ = {isa = PBXBuildFile; fileRef = C3AFC9D00FB62969005DFFDC /* CPTImage.m */; }; + C37EA5EA1BC83F2A0091C8F7 /* CPTPlotSymbol.m in Sources */ = {isa = PBXBuildFile; fileRef = C34AFE6A11021D010041675A /* CPTPlotSymbol.m */; }; + C37EA5EB1BC83F2A0091C8F7 /* CPTAxisSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D830F2B7340002FCEA7 /* CPTAxisSet.m */; }; + C37EA5EC1BC83F2A0091C8F7 /* CPTPlotGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F31DE71045EB470058520A /* CPTPlotGroup.m */; }; + C37EA5ED1BC83F2A0091C8F7 /* CPTAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C2847016584EB9006BA43C /* CPTAnimation.m */; }; + C37EA5EE1BC83F2A0091C8F7 /* _CPTAnimationNSDecimalPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C00B71DCB2085A92BE0A9 /* _CPTAnimationNSDecimalPeriod.m */; }; + C37EA5EF1BC83F2A0091C8F7 /* _CPTAnimationPlotRangePeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C091B8592D9F32AC384CB /* _CPTAnimationPlotRangePeriod.m */; }; + C37EA5F01BC83F2A0091C8F7 /* CPTPlotAreaFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D770F2B723A002FCEA7 /* CPTPlotAreaFrame.m */; }; + C37EA5F11BC83F2A0091C8F7 /* CPTAxisLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 073FB02F0FC991A3007A728E /* CPTAxisLabel.m */; }; + C37EA5F21BC83F2A0091C8F7 /* CPTShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = C32EE1B513EC4AA800038266 /* CPTShadow.m */; }; + C37EA5F31BC83F2A0091C8F7 /* _CPTAnimationCGPointPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C0AE447398AF62D584F9C /* _CPTAnimationCGPointPeriod.m */; }; + C37EA5F41BC83F2A0091C8F7 /* CPTPlatformSpecificFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B1D1A46264500D45436 /* CPTPlatformSpecificFunctions.m */; }; + C37EA5F51BC83F2A0091C8F7 /* CPTMutableShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = C32EE1C013EC4BE700038266 /* CPTMutableShadow.m */; }; + C37EA5F61BC83F2A0091C8F7 /* _CPTAnimationCGRectPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C0C3DB583ED8FC2EFD9DB /* _CPTAnimationCGRectPeriod.m */; }; + C37EA5F71BC83F2A0091C8F7 /* CPTPlotSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D7B0F2B72B0002FCEA7 /* CPTPlotSpace.m */; }; + C37EA5F81BC83F2A0091C8F7 /* CPTLineCap.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D3AD2C13DF8DCE0004EA73 /* CPTLineCap.m */; }; + C37EA5F91BC83F2A0091C8F7 /* CPTScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D960F2B73CA002FCEA7 /* CPTScatterPlot.m */; }; + C37EA5FA1BC83F2A0091C8F7 /* _CPTSlateTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 07FCF2C5115B54AE00E46606 /* _CPTSlateTheme.m */; }; + C37EA5FB1BC83F2A0091C8F7 /* CPTAnimationPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C9CB12165DB50300739006 /* CPTAnimationPeriod.m */; }; + C37EA5FC1BC83F2A0091C8F7 /* CPTTextStylePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0A541A461F9700D45436 /* CPTTextStylePlatformSpecific.m */; }; + C37EA5FD1BC83F2A0091C8F7 /* _CPTBorderLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3408C3D15FC1C3E004F1D70 /* _CPTBorderLayer.m */; }; + C37EA5FE1BC83F2A0091C8F7 /* CPTLegendEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = C30550EC1399BE5400E0151F /* CPTLegendEntry.m */; }; + C37EA5FF1BC83F2A0091C8F7 /* CPTTradingRangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772B43810E24D5C009CD04C /* CPTTradingRangePlot.m */; }; + C37EA6001BC83F2A0091C8F7 /* CPTTextLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E7E60F4B4F8200F9BCBB /* CPTTextLayer.m */; }; + C37EA6011BC83F2A0091C8F7 /* _CPTConstraintsRelative.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CCA03C13E8D85800CE6DB1 /* _CPTConstraintsRelative.m */; }; + C37EA6021BC83F2A0091C8F7 /* CPTAnnotationHostLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 072161EA11D1F6BD009CC871 /* CPTAnnotationHostLayer.m */; }; + C37EA6031BC83F2A0091C8F7 /* CPTAnimationOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C9CB0D165DB4D500739006 /* CPTAnimationOperation.m */; }; + C37EA6041BC83F2A0091C8F7 /* _CPTFillGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = C34260190FAE096C00072842 /* _CPTFillGradient.m */; }; + C37EA6051BC83F2A0091C8F7 /* _CPTMaskLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3286BFF15D8740100A436A8 /* _CPTMaskLayer.m */; }; + C37EA6061BC83F2A0091C8F7 /* CPTCalendarFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C349DCB3151AAFBF00BFD6A7 /* CPTCalendarFormatter.m */; }; + C37EA6071BC83F2A0091C8F7 /* CPTAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E10BB511D10177000B8DAB /* CPTAnnotation.m */; }; + C37EA6081BC83F2A0091C8F7 /* _CPTFillColor.m in Sources */ = {isa = PBXBuildFile; fileRef = C342601C0FAE096C00072842 /* _CPTFillColor.m */; }; + C37EA6091BC83F2A0091C8F7 /* _CPTAnimationTimingFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C2847416585085006BA43C /* _CPTAnimationTimingFunctions.m */; }; + C37EA60A1BC83F2A0091C8F7 /* CPTMutableLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69B1612B62ABB00F4C16C /* CPTMutableLineStyle.m */; }; + C37EA60B1BC83F2A0091C8F7 /* NSDecimalNumberExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E7EF0F4B4FA700F9BCBB /* NSDecimalNumberExtensions.m */; }; + C37EA60C1BC83F2A0091C8F7 /* CPTLegend.m in Sources */ = {isa = PBXBuildFile; fileRef = C3920AC31395B6500045F3BB /* CPTLegend.m */; }; + C37EA60D1BC83F2A0091C8F7 /* CPTAxisLabelGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C032C810B8DEDC003A11B6 /* CPTAxisLabelGroup.m */; }; + C37EA60E1BC83F2A0091C8F7 /* CPTFill.m in Sources */ = {isa = PBXBuildFile; fileRef = C342601A0FAE096C00072842 /* CPTFill.m */; }; + C37EA60F1BC83F2A0091C8F7 /* CPTMutableNumericData+TypeConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CAFB251229E41F00F5C989 /* CPTMutableNumericData+TypeConversion.m */; }; + C37EA6101BC83F2A0091C8F7 /* CPTRangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = D0C0477B12D6560900DA8047 /* CPTRangePlot.m */; }; + C37EA6111BC83F2A0091C8F7 /* CPTGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D710F2B718F002FCEA7 /* CPTGraph.m */; }; + C37EA6121BC83F2A0091C8F7 /* CPTMutablePlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A695E4146A19BC00AF5653 /* CPTMutablePlotRange.m */; }; + C37EA6131BC83F2A0091C8F7 /* _CPTPlainWhiteTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BC55022F10059F22005DF982 /* _CPTPlainWhiteTheme.m */; }; + C37EA6141BC83F2A0091C8F7 /* CPTGridLineGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C38DD49211A04B7A002A68E7 /* CPTGridLineGroup.m */; }; + C37EA6151BC83F2A0091C8F7 /* CPTNumericDataType.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EEFD104D80C400B554F9 /* CPTNumericDataType.m */; }; + C37EA6161BC83F2A0091C8F7 /* CPTPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D7F0F2B72F6002FCEA7 /* CPTPlot.m */; }; + C37EA6171BC83F2A0091C8F7 /* CPTPlatformSpecificCategories.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B191A46264500D45436 /* CPTPlatformSpecificCategories.m */; }; + C37EA6181BC83F2A0091C8F7 /* CPTConstraints.m in Sources */ = {isa = PBXBuildFile; fileRef = 070064E8111F2BAA003DE087 /* CPTConstraints.m */; }; + C37EA6191BC83F2A0091C8F7 /* CPTTextStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69A5C12B6215000F4C16C /* CPTTextStyle.m */; }; + C37EA61A1BC83F2A0091C8F7 /* CPTFunctionDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F97F1D17A9E07B00A52FF2 /* CPTFunctionDataSource.m */; }; + C37EA61B1BC83F2A0091C8F7 /* NSNumberExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 078F42DA0FACC075006E670B /* NSNumberExtensions.m */; }; + C37EA61C1BC83F2A0091C8F7 /* CPTBorderedLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0706223B0FDF215C0066A6C4 /* CPTBorderedLayer.m */; }; + C37EA61D1BC83F2A0091C8F7 /* CPTLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 906156BD0F375598001B75FC /* CPTLineStyle.m */; }; + C37EA61E1BC83F2A0091C8F7 /* _CPTAnimationCGSizePeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C087BF0913A6BA2363E40 /* _CPTAnimationCGSizePeriod.m */; }; + C37EA61F1BC83F2A0091C8F7 /* CPTPieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74A32F10FC402600E7E90D /* CPTPieChart.m */; }; + C37EA6201BC83F2A0091C8F7 /* CPTColorSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 079FC0BC0FB9762B0037E990 /* CPTColorSpace.m */; }; + C37EA6211BC83F2A0091C8F7 /* CPTGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 07CA112E0FAC8F85000861CE /* CPTGradient.m */; }; + C37EA6221BC83F2A0091C8F7 /* CPTUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 07321BC50F37382D00F423D8 /* CPTUtilities.m */; }; + C37EA6231BC83F2A0091C8F7 /* _CPTXYTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = C3DA34CA107AD7710051DA02 /* _CPTXYTheme.m */; }; + C37EA6241BC83F2A0091C8F7 /* CPTXYGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 07983EF50F2F9A3D008C8618 /* CPTXYGraph.m */; }; + C37EA6251BC83F2A0091C8F7 /* CPTPlotArea.m in Sources */ = {isa = PBXBuildFile; fileRef = C34BF5BB10A67633007F0894 /* CPTPlotArea.m */; }; + C37EA6261BC83F2A0091C8F7 /* _CPTConstraintsFixed.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CCA03A13E8D85800CE6DB1 /* _CPTConstraintsFixed.m */; }; + C37EA6271BC83F2A0091C8F7 /* CPTAxis.m in Sources */ = {isa = PBXBuildFile; fileRef = 07975C480F3B818800DE45DC /* CPTAxis.m */; }; + C37EA6281BC83F2A0091C8F7 /* CPTMutableTextStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07C4679A0FE1A24C00299939 /* CPTMutableTextStyle.m */; }; + C37EA62B1BC83F2A0091C8F7 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A571A69F6FA00F77249 /* CoreGraphics.framework */; }; + C37EA62C1BC83F2A0091C8F7 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A511A69F6DA00F77249 /* QuartzCore.framework */; }; + C37EA62D1BC83F2A0091C8F7 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A531A69F6DF00F77249 /* UIKit.framework */; }; + C37EA62F1BC83F2A0091C8F7 /* CPTLimitBand.h in Headers */ = {isa = PBXBuildFile; fileRef = C318F4AB11EA188700595FF9 /* CPTLimitBand.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6301BC83F2A0091C8F7 /* CPTDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0DF10F2B7BFB002FCEA7 /* CPTDefinitions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6311BC83F2A0091C8F7 /* CPTPlotSymbol.h in Headers */ = {isa = PBXBuildFile; fileRef = C34AFE6911021D010041675A /* CPTPlotSymbol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6321BC83F2A0091C8F7 /* CPTTradingRangePlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 0772B43710E24D5C009CD04C /* CPTTradingRangePlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6331BC83F2A0091C8F7 /* CPTGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D700F2B718F002FCEA7 /* CPTGraph.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6341BC83F2A0091C8F7 /* CPTGridLines.h in Headers */ = {isa = PBXBuildFile; fileRef = C32B391610AA4C78000470D4 /* CPTGridLines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6351BC83F2A0091C8F7 /* CPTTextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B69A5B12B6215000F4C16C /* CPTTextStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6361BC83F2A0091C8F7 /* CPTMutablePlotRange.h in Headers */ = {isa = PBXBuildFile; fileRef = C3A695E3146A19BC00AF5653 /* CPTMutablePlotRange.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6371BC83F2A0091C8F7 /* CPTPieChart.h in Headers */ = {isa = PBXBuildFile; fileRef = BC74A32E10FC402600E7E90D /* CPTPieChart.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6381BC83F2A0091C8F7 /* CPTMutableNumericData+TypeConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CAFB241229E41F00F5C989 /* CPTMutableNumericData+TypeConversion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6391BC83F2A0091C8F7 /* CPTAxisLabelGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C032C710B8DEDC003A11B6 /* CPTAxisLabelGroup.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA63A1BC83F2A0091C8F7 /* CPTPlotSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D7A0F2B72B0002FCEA7 /* CPTPlotSpace.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA63B1BC83F2A0091C8F7 /* CPTGraphHostingView.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0B271A46265300D45436 /* CPTGraphHostingView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA63C1BC83F2A0091C8F7 /* CPTColorSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 079FC0BB0FB9762B0037E990 /* CPTColorSpace.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA63D1BC83F2A0091C8F7 /* CPTXYPlotSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 0799E0970F2BB6E800790525 /* CPTXYPlotSpace.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA63E1BC83F2A0091C8F7 /* CPTLineStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 906156BC0F375598001B75FC /* CPTLineStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA63F1BC83F2A0091C8F7 /* CPTPathExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 070622300FDF1B250066A6C4 /* CPTPathExtensions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6401BC83F2A0091C8F7 /* _CPTBorderLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = C3408C3C15FC1C3E004F1D70 /* _CPTBorderLayer.h */; }; + C37EA6411BC83F2A0091C8F7 /* CPTNumericData.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C97EEFA104D80C400B554F9 /* CPTNumericData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6421BC83F2A0091C8F7 /* CPTLineCap.h in Headers */ = {isa = PBXBuildFile; fileRef = C3D3AD2B13DF8DCE0004EA73 /* CPTLineCap.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6431BC83F2A0091C8F7 /* _CPTFillGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = C342601E0FAE096C00072842 /* _CPTFillGradient.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6441BC83F2A0091C8F7 /* CPTNumericDataType.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C97EEFC104D80C400B554F9 /* CPTNumericDataType.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6451BC83F2A0091C8F7 /* CPTAnimationPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C9CB11165DB50300739006 /* CPTAnimationPeriod.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6461BC83F2A0091C8F7 /* _CPTPlainWhiteTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC55022E10059F22005DF982 /* _CPTPlainWhiteTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6471BC83F2A0091C8F7 /* CPTBorderedLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0706223A0FDF215C0066A6C4 /* CPTBorderedLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6481BC83F2A0091C8F7 /* CPTAxisSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D820F2B7340002FCEA7 /* CPTAxisSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6491BC83F2A0091C8F7 /* CPTScatterPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D950F2B73CA002FCEA7 /* CPTScatterPlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA64A1BC83F2A0091C8F7 /* CPTMutableShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = C32EE1BF13EC4BE700038266 /* CPTMutableShadow.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA64B1BC83F2A0091C8F7 /* _CPTPlainBlackTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC55022C10059F22005DF982 /* _CPTPlainBlackTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA64C1BC83F2A0091C8F7 /* _CPTAnimationNSDecimalPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0685ACE3281299F10F73 /* _CPTAnimationNSDecimalPeriod.h */; }; + C37EA64D1BC83F2A0091C8F7 /* CPTCalendarFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = C349DCB2151AAFBF00BFD6A7 /* CPTCalendarFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA64E1BC83F2A0091C8F7 /* CPTTextLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CD7E7E50F4B4F8200F9BCBB /* CPTTextLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA64F1BC83F2A0091C8F7 /* CPTResponder.h in Headers */ = {isa = PBXBuildFile; fileRef = 07AEF1FD10BBE1F10012BEFF /* CPTResponder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6501BC83F2A0091C8F7 /* CPTLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CD7E7EA0F4B4F9600F9BCBB /* CPTLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6511BC83F2A0091C8F7 /* CPTPlotAreaFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D760F2B723A002FCEA7 /* CPTPlotAreaFrame.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6521BC83F2A0091C8F7 /* CPTXYAxis.h in Headers */ = {isa = PBXBuildFile; fileRef = 0783DD530FBF097E006C3696 /* CPTXYAxis.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6531BC83F2A0091C8F7 /* _CPTStocksTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC55023010059F22005DF982 /* _CPTStocksTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6541BC83F2A0091C8F7 /* CPTImage.h in Headers */ = {isa = PBXBuildFile; fileRef = C3AFC9CF0FB62969005DFFDC /* CPTImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6551BC83F2A0091C8F7 /* CPTTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = 0772C9250FE2F71600EC4C16 /* CPTTheme.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6561BC83F2A0091C8F7 /* CPTPlatformSpecificCategories.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0B181A46264500D45436 /* CPTPlatformSpecificCategories.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6571BC83F2A0091C8F7 /* NSNumberExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 078F42D90FACC075006E670B /* NSNumberExtensions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6581BC83F2A0091C8F7 /* _CPTConstraintsRelative.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CCA03B13E8D85800CE6DB1 /* _CPTConstraintsRelative.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6591BC83F2A0091C8F7 /* CPTAnimationOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C9CB0C165DB4D500739006 /* CPTAnimationOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA65A1BC83F2A0091C8F7 /* _CPTDarkGradientTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = 0772C92D0FE2F89000EC4C16 /* _CPTDarkGradientTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA65B1BC83F2A0091C8F7 /* CPTRangePlot.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C0477C12D6560900DA8047 /* CPTRangePlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA65C1BC83F2A0091C8F7 /* _CPTAnimationCGSizePeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0563E082D1C1E249FA6F /* _CPTAnimationCGSizePeriod.h */; }; + C37EA65D1BC83F2A0091C8F7 /* CPTPlotGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C3F31DE81045EB470058520A /* CPTPlotGroup.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA65E1BC83F2A0091C8F7 /* CPTLegend.h in Headers */ = {isa = PBXBuildFile; fileRef = C3920AC21395B6500045F3BB /* CPTLegend.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA65F1BC83F2A0091C8F7 /* _CPTFillImage.h in Headers */ = {isa = PBXBuildFile; fileRef = C34260180FAE096C00072842 /* _CPTFillImage.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6601BC83F2A0091C8F7 /* _CPTAnimationCGRectPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0E876AE37EB30019586B /* _CPTAnimationCGRectPeriod.h */; }; + C37EA6611BC83F2A0091C8F7 /* CPTPlotSpaceAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E10BAF11D1016B000B8DAB /* CPTPlotSpaceAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6621BC83F2A0091C8F7 /* CPTConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 070064E7111F2BAA003DE087 /* CPTConstraints.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6631BC83F2A0091C8F7 /* NSCoderExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = C3978E0413CE653B00A420D9 /* NSCoderExtensions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6641BC83F2A0091C8F7 /* CPTNumericData+TypeConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C97EEF7104D80C400B554F9 /* CPTNumericData+TypeConversion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6651BC83F2A0091C8F7 /* _CPTFillColor.h in Headers */ = {isa = PBXBuildFile; fileRef = C342601B0FAE096C00072842 /* _CPTFillColor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6661BC83F2A0091C8F7 /* _CPTXYTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = C3DA34CB107AD7710051DA02 /* _CPTXYTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6671BC83F2A0091C8F7 /* CPTLayerAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E10BB911D10183000B8DAB /* CPTLayerAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6681BC83F2A0091C8F7 /* _CPTAnimationCGFloatPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C9CB15165DB52C00739006 /* _CPTAnimationCGFloatPeriod.h */; }; + C37EA6691BC83F2A0091C8F7 /* CPTAxisTitle.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFC7C3510921FDB00DAECAA /* CPTAxisTitle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA66A1BC83F2A0091C8F7 /* _CPTSlateTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = 07FCF2C4115B54AE00E46606 /* _CPTSlateTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA66B1BC83F2A0091C8F7 /* CPTMutableNumericData.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C97EF10104D819100B554F9 /* CPTMutableNumericData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA66C1BC83F2A0091C8F7 /* CPTGridLineGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C38DD49111A04B7A002A68E7 /* CPTGridLineGroup.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA66D1BC83F2A0091C8F7 /* CorePlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 070CF7AE0F3CA7AB0001FFF4 /* CorePlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA66E1BC83F2A0091C8F7 /* CPTMutableLineStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B69B1512B62ABB00F4C16C /* CPTMutableLineStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA66F1BC83F2A0091C8F7 /* CPTAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C2846F16584EB9006BA43C /* CPTAnimation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6701BC83F2A0091C8F7 /* CPTExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 07321BBF0F37370D00F423D8 /* CPTExceptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6711BC83F2A0091C8F7 /* CPTPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D7E0F2B72F6002FCEA7 /* CPTPlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6721BC83F2A0091C8F7 /* CPTShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = C32EE1B413EC4AA800038266 /* CPTShadow.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6731BC83F2A0091C8F7 /* CPTAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E10BB411D10177000B8DAB /* CPTAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6741BC83F2A0091C8F7 /* CPTColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 079FC0B20FB975500037E990 /* CPTColor.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6751BC83F2A0091C8F7 /* CPTTextStylePlatformSpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0A531A461F9700D45436 /* CPTTextStylePlatformSpecific.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6761BC83F2A0091C8F7 /* CPTFill.h in Headers */ = {isa = PBXBuildFile; fileRef = C342601F0FAE096C00072842 /* CPTFill.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6771BC83F2A0091C8F7 /* CPTPlotRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 32484B3F0F530E8B002151AD /* CPTPlotRange.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6781BC83F2A0091C8F7 /* CPTXYAxisSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 07975C410F3B816600DE45DC /* CPTXYAxisSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6791BC83F2A0091C8F7 /* CPTTimeFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 07A2E6FA102DF47900809BC5 /* CPTTimeFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA67A1BC83F2A0091C8F7 /* CPTLegendEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = C30550EB1399BE5400E0151F /* CPTLegendEntry.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA67B1BC83F2A0091C8F7 /* CPTPlotArea.h in Headers */ = {isa = PBXBuildFile; fileRef = C34BF5BA10A67633007F0894 /* CPTPlotArea.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA67C1BC83F2A0091C8F7 /* _CPTMaskLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = C3286BFE15D8740100A436A8 /* _CPTMaskLayer.h */; }; + C37EA67D1BC83F2A0091C8F7 /* _CPTAnimationPlotRangePeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0E16290C226BC4BE3936 /* _CPTAnimationPlotRangePeriod.h */; }; + C37EA67E1BC83F2A0091C8F7 /* CPTFunctionDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C3F97F1C17A9E07B00A52FF2 /* CPTFunctionDataSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA67F1BC83F2A0091C8F7 /* CPTGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = 07CA112D0FAC8F85000861CE /* CPTGradient.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6801BC83F2A0091C8F7 /* _CPTAnimationCGPointPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0E154E8598EDE2EDEF2F /* _CPTAnimationCGPointPeriod.h */; }; + C37EA6811BC83F2A0091C8F7 /* NSDecimalNumberExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CD7E7EE0F4B4FA700F9BCBB /* NSDecimalNumberExtensions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6821BC83F2A0091C8F7 /* CPTAxis.h in Headers */ = {isa = PBXBuildFile; fileRef = 07975C470F3B818800DE45DC /* CPTAxis.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6831BC83F2A0091C8F7 /* CPTPlatformSpecificFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0B1C1A46264500D45436 /* CPTPlatformSpecificFunctions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6841BC83F2A0091C8F7 /* CPTAnnotationHostLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 072161E911D1F6BD009CC871 /* CPTAnnotationHostLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6851BC83F2A0091C8F7 /* CPTAxisLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 073FB02E0FC991A3007A728E /* CPTAxisLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6861BC83F2A0091C8F7 /* CPTDebugQuickLook.h in Headers */ = {isa = PBXBuildFile; fileRef = C3BB93181B729BD200004527 /* CPTDebugQuickLook.h */; }; + C37EA6871BC83F2A0091C8F7 /* _CPTAnimationTimingFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C2847316585085006BA43C /* _CPTAnimationTimingFunctions.h */; }; + C37EA6881BC83F2A0091C8F7 /* CPTMutableTextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C467990FE1A24C00299939 /* CPTMutableTextStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA6891BC83F2A0091C8F7 /* CPTXYGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 07983EF40F2F9A3D008C8618 /* CPTXYGraph.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA68A1BC83F2A0091C8F7 /* CPTPlatformSpecificDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0B1A1A46264500D45436 /* CPTPlatformSpecificDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA68B1BC83F2A0091C8F7 /* CPTBarPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 0799E0930F2BB5F300790525 /* CPTBarPlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA68C1BC83F2A0091C8F7 /* CPTUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 07321BC40F37382D00F423D8 /* CPTUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C37EA68D1BC83F2A0091C8F7 /* _CPTConstraintsFixed.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CCA03913E8D85800CE6DB1 /* _CPTConstraintsFixed.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C37EA6981BC83F2D0091C8F7 /* CPTMutableNumericDataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CADDC611B167AD00D36017 /* CPTMutableNumericDataTests.m */; }; + C37EA6991BC83F2D0091C8F7 /* CPTColorSpaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979AE13D2337E00145DFF /* CPTColorSpaceTests.m */; }; + C37EA69A1BC83F2D0091C8F7 /* CPTFillTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979BA13D2347300145DFF /* CPTFillTests.m */; }; + C37EA69B1BC83F2D0091C8F7 /* CPTUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E9630F4B625900F9BCBB /* CPTUtilitiesTests.m */; }; + C37EA69C1BC83F2D0091C8F7 /* CPTGradientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979B113D233C000145DFF /* CPTGradientTests.m */; }; + C37EA69D1BC83F2D0091C8F7 /* CPTDarkGradientThemeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E1FE6051100F27EF00895A91 /* CPTDarkGradientThemeTests.m */; }; + C37EA69E1BC83F2D0091C8F7 /* CPTAxisLabelTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD23FFB0FFBE78400ADD2E2 /* CPTAxisLabelTests.m */; }; + C37EA69F1BC83F2D0091C8F7 /* CPTThemeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E1620CBD100F03A100A84E77 /* CPTThemeTests.m */; }; + C37EA6A01BC83F2D0091C8F7 /* CPTColorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979AB13D2332500145DFF /* CPTColorTests.m */; }; + C37EA6A11BC83F2D0091C8F7 /* CPTPlotSpaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979A313D2136600145DFF /* CPTPlotSpaceTests.m */; }; + C37EA6A21BC83F2D0091C8F7 /* CPTImageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979B413D2340000145DFF /* CPTImageTests.m */; }; + C37EA6A31BC83F2D0091C8F7 /* CPTDataSourceTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */; }; + C37EA6A41BC83F2D0091C8F7 /* CPTNumericDataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF06104D80D400B554F9 /* CPTNumericDataTests.m */; }; + C37EA6A51BC83F2D0091C8F7 /* CPTDerivedXYGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = E1FE611A100F3FB700895A91 /* CPTDerivedXYGraph.m */; }; + C37EA6A61BC83F2D0091C8F7 /* CPTXYPlotSpaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C422A630FB1FCD5000CAA43 /* CPTXYPlotSpaceTests.m */; }; + C37EA6A71BC83F2D0091C8F7 /* CPTTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0730F64D109494D100E95162 /* CPTTestCase.m */; }; + C37EA6A81BC83F2D0091C8F7 /* CPTPlotRangeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C36E89B911EE7F97003DE309 /* CPTPlotRangeTests.m */; }; + C37EA6A91BC83F2D0091C8F7 /* CPTNumericDataTypeConversionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF08104D80D400B554F9 /* CPTNumericDataTypeConversionTests.m */; }; + C37EA6AA1BC83F2D0091C8F7 /* CPTMutableNumericDataTypeConversionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CB561B122A9E9F00FBFB61 /* CPTMutableNumericDataTypeConversionTests.m */; }; + C37EA6AB1BC83F2D0091C8F7 /* CPTLineStyleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979B713D2344000145DFF /* CPTLineStyleTests.m */; }; + C37EA6AC1BC83F2D0091C8F7 /* CPTTextStyleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C36468A90FE5533F0064B186 /* CPTTextStyleTests.m */; }; + C37EA6AD1BC83F2D0091C8F7 /* CPTTimeFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979A813D2328000145DFF /* CPTTimeFormatterTests.m */; }; + C37EA6AE1BC83F2D0091C8F7 /* CPTLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C1C07F1790D3B400E8B1B7 /* CPTLayerTests.m */; }; + C37EA6AF1BC83F2D0091C8F7 /* CPTScatterPlotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 07FEBD61110B7E8B00E44D37 /* CPTScatterPlotTests.m */; }; + C37EA6B11BC83F2D0091C8F7 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A571A69F6FA00F77249 /* CoreGraphics.framework */; }; + C38A09831A46185300D45436 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C38A09781A46185200D45436 /* CorePlot.framework */; }; + C38A09C51A4619A900D45436 /* libCorePlot-CocoaTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C38A09BA1A4619A900D45436 /* libCorePlot-CocoaTouch.a */; }; + C38A09D11A461C1100D45436 /* CPTTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0730F64D109494D100E95162 /* CPTTestCase.m */; }; + C38A09D21A461C1300D45436 /* CPTTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 0730F64D109494D100E95162 /* CPTTestCase.m */; }; + C38A09D31A461C1800D45436 /* CPTDataSourceTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */; }; + C38A09D41A461C1900D45436 /* CPTDataSourceTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */; }; + C38A09D81A461C5800D45436 /* CPTNumericDataType.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C97EEFC104D80C400B554F9 /* CPTNumericDataType.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A09D91A461C6B00D45436 /* CPTNumericDataType.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EEFD104D80C400B554F9 /* CPTNumericDataType.m */; }; + C38A09DA1A461C6C00D45436 /* CPTNumericDataType.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EEFD104D80C400B554F9 /* CPTNumericDataType.m */; }; + C38A09DB1A461C7D00D45436 /* CPTNumericData.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EEFB104D80C400B554F9 /* CPTNumericData.m */; }; + C38A09DC1A461C7D00D45436 /* CPTNumericData.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EEFB104D80C400B554F9 /* CPTNumericData.m */; }; + C38A09DD1A461C8100D45436 /* CPTMutableNumericData.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF11104D819100B554F9 /* CPTMutableNumericData.m */; }; + C38A09DE1A461C8100D45436 /* CPTMutableNumericData.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF11104D819100B554F9 /* CPTMutableNumericData.m */; }; + C38A09DF1A461C8500D45436 /* CPTNumericData+TypeConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = C3392A371225F667008DA6BD /* CPTNumericData+TypeConversion.m */; }; + C38A09E01A461C8500D45436 /* CPTNumericData+TypeConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = C3392A371225F667008DA6BD /* CPTNumericData+TypeConversion.m */; }; + C38A09E11A461C8800D45436 /* CPTMutableNumericData+TypeConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CAFB251229E41F00F5C989 /* CPTMutableNumericData+TypeConversion.m */; }; + C38A09E21A461C8900D45436 /* CPTMutableNumericData+TypeConversion.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CAFB251229E41F00F5C989 /* CPTMutableNumericData+TypeConversion.m */; }; + C38A09E41A461CAD00D45436 /* CPTMutableNumericDataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CADDC611B167AD00D36017 /* CPTMutableNumericDataTests.m */; }; + C38A09E51A461CAE00D45436 /* CPTMutableNumericDataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CADDC611B167AD00D36017 /* CPTMutableNumericDataTests.m */; }; + C38A09E61A461CB200D45436 /* CPTMutableNumericDataTypeConversionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CB561B122A9E9F00FBFB61 /* CPTMutableNumericDataTypeConversionTests.m */; }; + C38A09E71A461CB300D45436 /* CPTMutableNumericDataTypeConversionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CB561B122A9E9F00FBFB61 /* CPTMutableNumericDataTypeConversionTests.m */; }; + C38A09E81A461CB600D45436 /* CPTNumericDataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF06104D80D400B554F9 /* CPTNumericDataTests.m */; }; + C38A09E91A461CB700D45436 /* CPTNumericDataTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF06104D80D400B554F9 /* CPTNumericDataTests.m */; }; + C38A09EA1A461CBA00D45436 /* CPTNumericDataTypeConversionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF08104D80D400B554F9 /* CPTNumericDataTypeConversionTests.m */; }; + C38A09EB1A461CBB00D45436 /* CPTNumericDataTypeConversionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF08104D80D400B554F9 /* CPTNumericDataTypeConversionTests.m */; }; + C38A09EF1A461CD000D45436 /* CPTDefinitions.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0DF10F2B7BFB002FCEA7 /* CPTDefinitions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A09F01A461CD900D45436 /* CPTDefinitions.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0DF20F2B7BFB002FCEA7 /* CPTDefinitions.m */; }; + C38A09F11A461CDA00D45436 /* CPTDefinitions.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0DF20F2B7BFB002FCEA7 /* CPTDefinitions.m */; }; + C38A09F21A461CEE00D45436 /* CPTExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 07321BBF0F37370D00F423D8 /* CPTExceptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A09F31A461CF500D45436 /* CPTExceptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 07321BC00F37370D00F423D8 /* CPTExceptions.m */; }; + C38A09F41A461CF600D45436 /* CPTExceptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 07321BC00F37370D00F423D8 /* CPTExceptions.m */; }; + C38A09F51A461CF900D45436 /* CPTUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 07321BC40F37382D00F423D8 /* CPTUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A09F61A461D0000D45436 /* CPTUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 07321BC50F37382D00F423D8 /* CPTUtilities.m */; }; + C38A09F71A461D0100D45436 /* CPTUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 07321BC50F37382D00F423D8 /* CPTUtilities.m */; }; + C38A09F81A461D0500D45436 /* CPTPlotRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 32484B3F0F530E8B002151AD /* CPTPlotRange.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A09F91A461D0B00D45436 /* CPTPlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = 32484B400F530E8B002151AD /* CPTPlotRange.m */; }; + C38A09FA1A461D0C00D45436 /* CPTPlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = 32484B400F530E8B002151AD /* CPTPlotRange.m */; }; + C38A09FB1A461D0F00D45436 /* CPTMutablePlotRange.h in Headers */ = {isa = PBXBuildFile; fileRef = C3A695E3146A19BC00AF5653 /* CPTMutablePlotRange.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A09FC1A461D1300D45436 /* CPTMutablePlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A695E4146A19BC00AF5653 /* CPTMutablePlotRange.m */; }; + C38A09FD1A461D1400D45436 /* CPTMutablePlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A695E4146A19BC00AF5653 /* CPTMutablePlotRange.m */; }; + C38A09FE1A461D1800D45436 /* CPTFunctionDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C3F97F1C17A9E07B00A52FF2 /* CPTFunctionDataSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A09FF1A461D1D00D45436 /* CPTFunctionDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F97F1D17A9E07B00A52FF2 /* CPTFunctionDataSource.m */; }; + C38A0A001A461D1D00D45436 /* CPTFunctionDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F97F1D17A9E07B00A52FF2 /* CPTFunctionDataSource.m */; }; + C38A0A011A461D2E00D45436 /* CPTPlotRangeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C36E89B911EE7F97003DE309 /* CPTPlotRangeTests.m */; }; + C38A0A021A461D2E00D45436 /* CPTPlotRangeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C36E89B911EE7F97003DE309 /* CPTPlotRangeTests.m */; }; + C38A0A031A461D3100D45436 /* CPTUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E9630F4B625900F9BCBB /* CPTUtilitiesTests.m */; }; + C38A0A041A461D3200D45436 /* CPTUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E9630F4B625900F9BCBB /* CPTUtilitiesTests.m */; }; + C38A0A051A461D3F00D45436 /* CPTLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CD7E7EA0F4B4F9600F9BCBB /* CPTLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A061A461D4400D45436 /* CPTLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E7EB0F4B4F9600F9BCBB /* CPTLayer.m */; }; + C38A0A071A461D4500D45436 /* CPTLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E7EB0F4B4F9600F9BCBB /* CPTLayer.m */; }; + C38A0A081A461D4800D45436 /* CPTBorderedLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0706223A0FDF215C0066A6C4 /* CPTBorderedLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A091A461D4D00D45436 /* CPTBorderedLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0706223B0FDF215C0066A6C4 /* CPTBorderedLayer.m */; }; + C38A0A0A1A461D4D00D45436 /* CPTBorderedLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0706223B0FDF215C0066A6C4 /* CPTBorderedLayer.m */; }; + C38A0A0B1A461D5100D45436 /* _CPTBorderLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = C3408C3C15FC1C3E004F1D70 /* _CPTBorderLayer.h */; }; + C38A0A0C1A461D5700D45436 /* _CPTBorderLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3408C3D15FC1C3E004F1D70 /* _CPTBorderLayer.m */; }; + C38A0A0D1A461D5800D45436 /* _CPTBorderLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3408C3D15FC1C3E004F1D70 /* _CPTBorderLayer.m */; }; + C38A0A0E1A461D5B00D45436 /* _CPTMaskLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = C3286BFE15D8740100A436A8 /* _CPTMaskLayer.h */; }; + C38A0A0F1A461D5E00D45436 /* _CPTMaskLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3286BFF15D8740100A436A8 /* _CPTMaskLayer.m */; }; + C38A0A101A461D5F00D45436 /* _CPTMaskLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3286BFF15D8740100A436A8 /* _CPTMaskLayer.m */; }; + C38A0A111A461D6300D45436 /* CPTResponder.h in Headers */ = {isa = PBXBuildFile; fileRef = 07AEF1FD10BBE1F10012BEFF /* CPTResponder.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A121A461D6A00D45436 /* CPTLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C1C07F1790D3B400E8B1B7 /* CPTLayerTests.m */; }; + C38A0A131A461D6B00D45436 /* CPTLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C1C07F1790D3B400E8B1B7 /* CPTLayerTests.m */; }; + C38A0A141A461E5000D45436 /* CPTAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C2846F16584EB9006BA43C /* CPTAnimation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A151A461E5800D45436 /* CPTAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C2847016584EB9006BA43C /* CPTAnimation.m */; }; + C38A0A161A461E5800D45436 /* CPTAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C2847016584EB9006BA43C /* CPTAnimation.m */; }; + C38A0A171A461E5B00D45436 /* CPTAnimationOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C9CB0C165DB4D500739006 /* CPTAnimationOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A181A461E6000D45436 /* CPTAnimationOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C9CB0D165DB4D500739006 /* CPTAnimationOperation.m */; }; + C38A0A191A461E6100D45436 /* CPTAnimationOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C9CB0D165DB4D500739006 /* CPTAnimationOperation.m */; }; + C38A0A1A1A461E6400D45436 /* CPTAnimationPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C9CB11165DB50300739006 /* CPTAnimationPeriod.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A1B1A461E6A00D45436 /* CPTAnimationPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C9CB12165DB50300739006 /* CPTAnimationPeriod.m */; }; + C38A0A1C1A461E6B00D45436 /* CPTAnimationPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C9CB12165DB50300739006 /* CPTAnimationPeriod.m */; }; + C38A0A1D1A461E6E00D45436 /* _CPTAnimationCGFloatPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C9CB15165DB52C00739006 /* _CPTAnimationCGFloatPeriod.h */; }; + C38A0A1E1A461E7A00D45436 /* _CPTAnimationCGFloatPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C9CB16165DB52C00739006 /* _CPTAnimationCGFloatPeriod.m */; }; + C38A0A1F1A461E7B00D45436 /* _CPTAnimationCGFloatPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C9CB16165DB52C00739006 /* _CPTAnimationCGFloatPeriod.m */; }; + C38A0A201A461E8800D45436 /* _CPTAnimationCGPointPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0E154E8598EDE2EDEF2F /* _CPTAnimationCGPointPeriod.h */; }; + C38A0A211A461E8B00D45436 /* _CPTAnimationCGPointPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C0AE447398AF62D584F9C /* _CPTAnimationCGPointPeriod.m */; }; + C38A0A221A461E8C00D45436 /* _CPTAnimationCGPointPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C0AE447398AF62D584F9C /* _CPTAnimationCGPointPeriod.m */; }; + C38A0A231A461E8F00D45436 /* _CPTAnimationCGSizePeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0563E082D1C1E249FA6F /* _CPTAnimationCGSizePeriod.h */; }; + C38A0A241A461E9200D45436 /* _CPTAnimationCGSizePeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C087BF0913A6BA2363E40 /* _CPTAnimationCGSizePeriod.m */; }; + C38A0A251A461E9300D45436 /* _CPTAnimationCGSizePeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C087BF0913A6BA2363E40 /* _CPTAnimationCGSizePeriod.m */; }; + C38A0A261A461E9600D45436 /* _CPTAnimationCGRectPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0E876AE37EB30019586B /* _CPTAnimationCGRectPeriod.h */; }; + C38A0A271A461E9A00D45436 /* _CPTAnimationCGRectPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C0C3DB583ED8FC2EFD9DB /* _CPTAnimationCGRectPeriod.m */; }; + C38A0A281A461E9B00D45436 /* _CPTAnimationCGRectPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C0C3DB583ED8FC2EFD9DB /* _CPTAnimationCGRectPeriod.m */; }; + C38A0A291A461EA300D45436 /* _CPTAnimationNSDecimalPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0685ACE3281299F10F73 /* _CPTAnimationNSDecimalPeriod.h */; }; + C38A0A2A1A461EA600D45436 /* _CPTAnimationNSDecimalPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C00B71DCB2085A92BE0A9 /* _CPTAnimationNSDecimalPeriod.m */; }; + C38A0A2B1A461EA600D45436 /* _CPTAnimationNSDecimalPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C00B71DCB2085A92BE0A9 /* _CPTAnimationNSDecimalPeriod.m */; }; + C38A0A2C1A461EAA00D45436 /* _CPTAnimationPlotRangePeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = A92C0E16290C226BC4BE3936 /* _CPTAnimationPlotRangePeriod.h */; }; + C38A0A2D1A461EAD00D45436 /* _CPTAnimationPlotRangePeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C091B8592D9F32AC384CB /* _CPTAnimationPlotRangePeriod.m */; }; + C38A0A2E1A461EAE00D45436 /* _CPTAnimationPlotRangePeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = A92C091B8592D9F32AC384CB /* _CPTAnimationPlotRangePeriod.m */; }; + C38A0A2F1A461EB100D45436 /* _CPTAnimationTimingFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C2847316585085006BA43C /* _CPTAnimationTimingFunctions.h */; }; + C38A0A301A461EB500D45436 /* _CPTAnimationTimingFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C2847416585085006BA43C /* _CPTAnimationTimingFunctions.m */; }; + C38A0A311A461EB600D45436 /* _CPTAnimationTimingFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C2847416585085006BA43C /* _CPTAnimationTimingFunctions.m */; }; + C38A0A321A461EBD00D45436 /* CPTAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E10BB411D10177000B8DAB /* CPTAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A331A461EC200D45436 /* CPTAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E10BB511D10177000B8DAB /* CPTAnnotation.m */; }; + C38A0A341A461EC300D45436 /* CPTAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E10BB511D10177000B8DAB /* CPTAnnotation.m */; }; + C38A0A351A461EC800D45436 /* CPTPlotSpaceAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E10BAF11D1016B000B8DAB /* CPTPlotSpaceAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A361A461ECD00D45436 /* CPTPlotSpaceAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E10BB011D1016B000B8DAB /* CPTPlotSpaceAnnotation.m */; }; + C38A0A371A461ECD00D45436 /* CPTPlotSpaceAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E10BB011D1016B000B8DAB /* CPTPlotSpaceAnnotation.m */; }; + C38A0A381A461ED000D45436 /* CPTLayerAnnotation.h in Headers */ = {isa = PBXBuildFile; fileRef = 07E10BB911D10183000B8DAB /* CPTLayerAnnotation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A391A461ED600D45436 /* CPTLayerAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E10BBA11D10183000B8DAB /* CPTLayerAnnotation.m */; }; + C38A0A3A1A461ED700D45436 /* CPTLayerAnnotation.m in Sources */ = {isa = PBXBuildFile; fileRef = 07E10BBA11D10183000B8DAB /* CPTLayerAnnotation.m */; }; + C38A0A3B1A461EDA00D45436 /* CPTAnnotationHostLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 072161E911D1F6BD009CC871 /* CPTAnnotationHostLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A3C1A461EDF00D45436 /* CPTAnnotationHostLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 072161EA11D1F6BD009CC871 /* CPTAnnotationHostLayer.m */; }; + C38A0A3D1A461EE000D45436 /* CPTAnnotationHostLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 072161EA11D1F6BD009CC871 /* CPTAnnotationHostLayer.m */; }; + C38A0A3E1A461EE600D45436 /* CPTConstraints.h in Headers */ = {isa = PBXBuildFile; fileRef = 070064E7111F2BAA003DE087 /* CPTConstraints.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A3F1A461EEB00D45436 /* CPTConstraints.m in Sources */ = {isa = PBXBuildFile; fileRef = 070064E8111F2BAA003DE087 /* CPTConstraints.m */; }; + C38A0A401A461EEB00D45436 /* CPTConstraints.m in Sources */ = {isa = PBXBuildFile; fileRef = 070064E8111F2BAA003DE087 /* CPTConstraints.m */; }; + C38A0A411A461EEE00D45436 /* _CPTConstraintsFixed.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CCA03913E8D85800CE6DB1 /* _CPTConstraintsFixed.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0A421A461EF500D45436 /* _CPTConstraintsFixed.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CCA03A13E8D85800CE6DB1 /* _CPTConstraintsFixed.m */; }; + C38A0A431A461EF600D45436 /* _CPTConstraintsFixed.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CCA03A13E8D85800CE6DB1 /* _CPTConstraintsFixed.m */; }; + C38A0A441A461EFA00D45436 /* _CPTConstraintsRelative.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CCA03B13E8D85800CE6DB1 /* _CPTConstraintsRelative.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0A451A461F0100D45436 /* _CPTConstraintsRelative.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CCA03C13E8D85800CE6DB1 /* _CPTConstraintsRelative.m */; }; + C38A0A461A461F0200D45436 /* _CPTConstraintsRelative.m in Sources */ = {isa = PBXBuildFile; fileRef = C3CCA03C13E8D85800CE6DB1 /* _CPTConstraintsRelative.m */; }; + C38A0A471A461F0C00D45436 /* CPTTextLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CD7E7E50F4B4F8200F9BCBB /* CPTTextLayer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A481A461F1100D45436 /* CPTTextLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E7E60F4B4F8200F9BCBB /* CPTTextLayer.m */; }; + C38A0A491A461F1200D45436 /* CPTTextLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E7E60F4B4F8200F9BCBB /* CPTTextLayer.m */; }; + C38A0A4A1A461F1500D45436 /* CPTTextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B69A5B12B6215000F4C16C /* CPTTextStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A4B1A461F1A00D45436 /* CPTTextStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69A5C12B6215000F4C16C /* CPTTextStyle.m */; }; + C38A0A4C1A461F1B00D45436 /* CPTTextStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69A5C12B6215000F4C16C /* CPTTextStyle.m */; }; + C38A0A4D1A461F1D00D45436 /* CPTMutableTextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C467990FE1A24C00299939 /* CPTMutableTextStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A4E1A461F2200D45436 /* CPTMutableTextStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07C4679A0FE1A24C00299939 /* CPTMutableTextStyle.m */; }; + C38A0A4F1A461F2200D45436 /* CPTMutableTextStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07C4679A0FE1A24C00299939 /* CPTMutableTextStyle.m */; }; + C38A0A501A461F3D00D45436 /* CPTTextStyleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C36468A90FE5533F0064B186 /* CPTTextStyleTests.m */; }; + C38A0A511A461F3D00D45436 /* CPTTextStyleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C36468A90FE5533F0064B186 /* CPTTextStyleTests.m */; }; + C38A0A551A461F9700D45436 /* CPTTextStylePlatformSpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0A531A461F9700D45436 /* CPTTextStylePlatformSpecific.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A561A461F9700D45436 /* CPTTextStylePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0A541A461F9700D45436 /* CPTTextStylePlatformSpecific.m */; }; + C38A0A571A461F9700D45436 /* CPTTextStylePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0A541A461F9700D45436 /* CPTTextStylePlatformSpecific.m */; }; + C38A0A5A1A4620B800D45436 /* CPTImagePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0A591A4620B800D45436 /* CPTImagePlatformSpecific.m */; }; + C38A0A5B1A4620B800D45436 /* CPTImagePlatformSpecific.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0A591A4620B800D45436 /* CPTImagePlatformSpecific.m */; }; + C38A0A5C1A4620D400D45436 /* CPTColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 079FC0B20FB975500037E990 /* CPTColor.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A5D1A4620D400D45436 /* CPTColorSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 079FC0BB0FB9762B0037E990 /* CPTColorSpace.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A5E1A4620D400D45436 /* CPTGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = 07CA112D0FAC8F85000861CE /* CPTGradient.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A5F1A4620D400D45436 /* CPTImage.h in Headers */ = {isa = PBXBuildFile; fileRef = C3AFC9CF0FB62969005DFFDC /* CPTImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A601A4620D400D45436 /* CPTLineCap.h in Headers */ = {isa = PBXBuildFile; fileRef = C3D3AD2B13DF8DCE0004EA73 /* CPTLineCap.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A611A4620D400D45436 /* CPTLineStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 906156BC0F375598001B75FC /* CPTLineStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A621A4620D400D45436 /* CPTMutableLineStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 07B69B1512B62ABB00F4C16C /* CPTMutableLineStyle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A631A4620D400D45436 /* CPTPathExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 070622300FDF1B250066A6C4 /* CPTPathExtensions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A641A4620D400D45436 /* CPTShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = C32EE1B413EC4AA800038266 /* CPTShadow.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A651A4620D400D45436 /* CPTMutableShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = C32EE1BF13EC4BE700038266 /* CPTMutableShadow.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A661A4620E200D45436 /* CPTColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 079FC0B30FB975500037E990 /* CPTColor.m */; }; + C38A0A671A4620E200D45436 /* CPTColorSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 079FC0BC0FB9762B0037E990 /* CPTColorSpace.m */; }; + C38A0A681A4620E200D45436 /* CPTGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 07CA112E0FAC8F85000861CE /* CPTGradient.m */; }; + C38A0A691A4620E200D45436 /* CPTImage.m in Sources */ = {isa = PBXBuildFile; fileRef = C3AFC9D00FB62969005DFFDC /* CPTImage.m */; }; + C38A0A6A1A4620E200D45436 /* CPTLineCap.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D3AD2C13DF8DCE0004EA73 /* CPTLineCap.m */; }; + C38A0A6B1A4620E200D45436 /* CPTLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 906156BD0F375598001B75FC /* CPTLineStyle.m */; }; + C38A0A6C1A4620E200D45436 /* CPTMutableLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69B1612B62ABB00F4C16C /* CPTMutableLineStyle.m */; }; + C38A0A6D1A4620E200D45436 /* CPTPathExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 070622310FDF1B250066A6C4 /* CPTPathExtensions.m */; }; + C38A0A6E1A4620E200D45436 /* CPTShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = C32EE1B513EC4AA800038266 /* CPTShadow.m */; }; + C38A0A6F1A4620E200D45436 /* CPTMutableShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = C32EE1C013EC4BE700038266 /* CPTMutableShadow.m */; }; + C38A0A701A4620E200D45436 /* CPTColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 079FC0B30FB975500037E990 /* CPTColor.m */; }; + C38A0A711A4620E200D45436 /* CPTColorSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 079FC0BC0FB9762B0037E990 /* CPTColorSpace.m */; }; + C38A0A721A4620E200D45436 /* CPTGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = 07CA112E0FAC8F85000861CE /* CPTGradient.m */; }; + C38A0A731A4620E200D45436 /* CPTImage.m in Sources */ = {isa = PBXBuildFile; fileRef = C3AFC9D00FB62969005DFFDC /* CPTImage.m */; }; + C38A0A741A4620E200D45436 /* CPTLineCap.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D3AD2C13DF8DCE0004EA73 /* CPTLineCap.m */; }; + C38A0A751A4620E200D45436 /* CPTLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 906156BD0F375598001B75FC /* CPTLineStyle.m */; }; + C38A0A761A4620E200D45436 /* CPTMutableLineStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 07B69B1612B62ABB00F4C16C /* CPTMutableLineStyle.m */; }; + C38A0A771A4620E200D45436 /* CPTPathExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 070622310FDF1B250066A6C4 /* CPTPathExtensions.m */; }; + C38A0A781A4620E200D45436 /* CPTShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = C32EE1B513EC4AA800038266 /* CPTShadow.m */; }; + C38A0A791A4620E200D45436 /* CPTMutableShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = C32EE1C013EC4BE700038266 /* CPTMutableShadow.m */; }; + C38A0A7A1A4620E800D45436 /* CPTFill.h in Headers */ = {isa = PBXBuildFile; fileRef = C342601F0FAE096C00072842 /* CPTFill.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A7B1A4620EF00D45436 /* _CPTFillColor.h in Headers */ = {isa = PBXBuildFile; fileRef = C342601B0FAE096C00072842 /* _CPTFillColor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0A7C1A4620EF00D45436 /* _CPTFillGradient.h in Headers */ = {isa = PBXBuildFile; fileRef = C342601E0FAE096C00072842 /* _CPTFillGradient.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0A7D1A4620EF00D45436 /* _CPTFillImage.h in Headers */ = {isa = PBXBuildFile; fileRef = C34260180FAE096C00072842 /* _CPTFillImage.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0A7E1A4620F700D45436 /* CPTFill.m in Sources */ = {isa = PBXBuildFile; fileRef = C342601A0FAE096C00072842 /* CPTFill.m */; }; + C38A0A7F1A4620F700D45436 /* _CPTFillColor.m in Sources */ = {isa = PBXBuildFile; fileRef = C342601C0FAE096C00072842 /* _CPTFillColor.m */; }; + C38A0A801A4620F700D45436 /* _CPTFillGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = C34260190FAE096C00072842 /* _CPTFillGradient.m */; }; + C38A0A811A4620F700D45436 /* _CPTFillImage.m in Sources */ = {isa = PBXBuildFile; fileRef = C342601D0FAE096C00072842 /* _CPTFillImage.m */; }; + C38A0A821A4620F800D45436 /* CPTFill.m in Sources */ = {isa = PBXBuildFile; fileRef = C342601A0FAE096C00072842 /* CPTFill.m */; }; + C38A0A831A4620F800D45436 /* _CPTFillColor.m in Sources */ = {isa = PBXBuildFile; fileRef = C342601C0FAE096C00072842 /* _CPTFillColor.m */; }; + C38A0A841A4620F800D45436 /* _CPTFillGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = C34260190FAE096C00072842 /* _CPTFillGradient.m */; }; + C38A0A851A4620F800D45436 /* _CPTFillImage.m in Sources */ = {isa = PBXBuildFile; fileRef = C342601D0FAE096C00072842 /* _CPTFillImage.m */; }; + C38A0A861A46210A00D45436 /* CPTColorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979AB13D2332500145DFF /* CPTColorTests.m */; }; + C38A0A871A46210A00D45436 /* CPTColorSpaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979AE13D2337E00145DFF /* CPTColorSpaceTests.m */; }; + C38A0A881A46210A00D45436 /* CPTFillTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979BA13D2347300145DFF /* CPTFillTests.m */; }; + C38A0A891A46210A00D45436 /* CPTGradientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979B113D233C000145DFF /* CPTGradientTests.m */; }; + C38A0A8A1A46210A00D45436 /* CPTImageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979B413D2340000145DFF /* CPTImageTests.m */; }; + C38A0A8B1A46210A00D45436 /* CPTLineStyleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979B713D2344000145DFF /* CPTLineStyleTests.m */; }; + C38A0A8C1A46210A00D45436 /* CPTColorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979AB13D2332500145DFF /* CPTColorTests.m */; }; + C38A0A8D1A46210A00D45436 /* CPTColorSpaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979AE13D2337E00145DFF /* CPTColorSpaceTests.m */; }; + C38A0A8E1A46210A00D45436 /* CPTFillTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979BA13D2347300145DFF /* CPTFillTests.m */; }; + C38A0A8F1A46210A00D45436 /* CPTGradientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979B113D233C000145DFF /* CPTGradientTests.m */; }; + C38A0A901A46210A00D45436 /* CPTImageTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979B413D2340000145DFF /* CPTImageTests.m */; }; + C38A0A911A46210A00D45436 /* CPTLineStyleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979B713D2344000145DFF /* CPTLineStyleTests.m */; }; + C38A0A951A46218B00D45436 /* CPTCalendarFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = C349DCB2151AAFBF00BFD6A7 /* CPTCalendarFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A961A46218B00D45436 /* CPTTimeFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 07A2E6FA102DF47900809BC5 /* CPTTimeFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0A971A46219100D45436 /* CPTCalendarFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C349DCB3151AAFBF00BFD6A7 /* CPTCalendarFormatter.m */; }; + C38A0A981A46219100D45436 /* CPTTimeFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 07A2E6FB102DF47900809BC5 /* CPTTimeFormatter.m */; }; + C38A0A991A46219200D45436 /* CPTCalendarFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C349DCB3151AAFBF00BFD6A7 /* CPTCalendarFormatter.m */; }; + C38A0A9A1A46219200D45436 /* CPTTimeFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 07A2E6FB102DF47900809BC5 /* CPTTimeFormatter.m */; }; + C38A0A9B1A46219600D45436 /* CPTTimeFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979A813D2328000145DFF /* CPTTimeFormatterTests.m */; }; + C38A0A9C1A46219700D45436 /* CPTTimeFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979A813D2328000145DFF /* CPTTimeFormatterTests.m */; }; + C38A0A9D1A4621A500D45436 /* NSCoderExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = C3978E0413CE653B00A420D9 /* NSCoderExtensions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0A9E1A4621A500D45436 /* NSDecimalNumberExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CD7E7EE0F4B4FA700F9BCBB /* NSDecimalNumberExtensions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0A9F1A4621A500D45436 /* NSNumberExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 078F42D90FACC075006E670B /* NSNumberExtensions.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0AA01A4621AC00D45436 /* NSCoderExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = C3978E0513CE653B00A420D9 /* NSCoderExtensions.m */; }; + C38A0AA11A4621AC00D45436 /* NSDecimalNumberExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E7EF0F4B4FA700F9BCBB /* NSDecimalNumberExtensions.m */; }; + C38A0AA21A4621AC00D45436 /* NSNumberExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 078F42DA0FACC075006E670B /* NSNumberExtensions.m */; }; + C38A0AA31A4621AD00D45436 /* NSCoderExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = C3978E0513CE653B00A420D9 /* NSCoderExtensions.m */; }; + C38A0AA41A4621AD00D45436 /* NSDecimalNumberExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E7EF0F4B4FA700F9BCBB /* NSDecimalNumberExtensions.m */; }; + C38A0AA51A4621AD00D45436 /* NSNumberExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 078F42DA0FACC075006E670B /* NSNumberExtensions.m */; }; + C38A0AA71A46240300D45436 /* CPTGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D700F2B718F002FCEA7 /* CPTGraph.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AA81A46240300D45436 /* CPTXYGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = 07983EF40F2F9A3D008C8618 /* CPTXYGraph.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AA91A46240900D45436 /* CPTGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D710F2B718F002FCEA7 /* CPTGraph.m */; }; + C38A0AAA1A46240900D45436 /* CPTXYGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 07983EF50F2F9A3D008C8618 /* CPTXYGraph.m */; }; + C38A0AAB1A46240A00D45436 /* CPTGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D710F2B718F002FCEA7 /* CPTGraph.m */; }; + C38A0AAC1A46240A00D45436 /* CPTXYGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = 07983EF50F2F9A3D008C8618 /* CPTXYGraph.m */; }; + C38A0AAD1A46241100D45436 /* CPTPlotAreaFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D760F2B723A002FCEA7 /* CPTPlotAreaFrame.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AAE1A46241100D45436 /* CPTPlotArea.h in Headers */ = {isa = PBXBuildFile; fileRef = C34BF5BA10A67633007F0894 /* CPTPlotArea.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AAF1A46241100D45436 /* CPTLimitBand.h in Headers */ = {isa = PBXBuildFile; fileRef = C318F4AB11EA188700595FF9 /* CPTLimitBand.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AB01A46241700D45436 /* CPTPlotAreaFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D770F2B723A002FCEA7 /* CPTPlotAreaFrame.m */; }; + C38A0AB11A46241700D45436 /* CPTPlotArea.m in Sources */ = {isa = PBXBuildFile; fileRef = C34BF5BB10A67633007F0894 /* CPTPlotArea.m */; }; + C38A0AB21A46241700D45436 /* CPTLimitBand.m in Sources */ = {isa = PBXBuildFile; fileRef = C318F4AC11EA188700595FF9 /* CPTLimitBand.m */; }; + C38A0AB31A46241800D45436 /* CPTPlotAreaFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D770F2B723A002FCEA7 /* CPTPlotAreaFrame.m */; }; + C38A0AB41A46241800D45436 /* CPTPlotArea.m in Sources */ = {isa = PBXBuildFile; fileRef = C34BF5BB10A67633007F0894 /* CPTPlotArea.m */; }; + C38A0AB51A46241800D45436 /* CPTLimitBand.m in Sources */ = {isa = PBXBuildFile; fileRef = C318F4AC11EA188700595FF9 /* CPTLimitBand.m */; }; + C38A0AB61A4624C200D45436 /* CPTPlotSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D7A0F2B72B0002FCEA7 /* CPTPlotSpace.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AB71A4624C200D45436 /* CPTXYPlotSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 0799E0970F2BB6E800790525 /* CPTXYPlotSpace.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AB81A46250500D45436 /* CPTPlotSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D7B0F2B72B0002FCEA7 /* CPTPlotSpace.m */; }; + C38A0AB91A46250500D45436 /* CPTXYPlotSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 90AF4FB90F36D39700753D26 /* CPTXYPlotSpace.m */; }; + C38A0ABA1A46250600D45436 /* CPTPlotSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D7B0F2B72B0002FCEA7 /* CPTPlotSpace.m */; }; + C38A0ABB1A46250600D45436 /* CPTXYPlotSpace.m in Sources */ = {isa = PBXBuildFile; fileRef = 90AF4FB90F36D39700753D26 /* CPTXYPlotSpace.m */; }; + C38A0ABC1A46250B00D45436 /* CPTPlotSpaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979A313D2136600145DFF /* CPTPlotSpaceTests.m */; }; + C38A0ABD1A46250B00D45436 /* CPTXYPlotSpaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C422A630FB1FCD5000CAA43 /* CPTXYPlotSpaceTests.m */; }; + C38A0ABE1A46250C00D45436 /* CPTPlotSpaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979A313D2136600145DFF /* CPTPlotSpaceTests.m */; }; + C38A0ABF1A46250C00D45436 /* CPTXYPlotSpaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C422A630FB1FCD5000CAA43 /* CPTXYPlotSpaceTests.m */; }; + C38A0AC01A46254E00D45436 /* CPTPlotGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C3F31DE81045EB470058520A /* CPTPlotGroup.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0AC11A46255C00D45436 /* CPTPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D7E0F2B72F6002FCEA7 /* CPTPlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AC21A46255C00D45436 /* CPTBarPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 0799E0930F2BB5F300790525 /* CPTBarPlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AC31A46255C00D45436 /* CPTPieChart.h in Headers */ = {isa = PBXBuildFile; fileRef = BC74A32E10FC402600E7E90D /* CPTPieChart.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AC41A46255C00D45436 /* CPTRangePlot.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C0477C12D6560900DA8047 /* CPTRangePlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AC51A46255C00D45436 /* CPTScatterPlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D950F2B73CA002FCEA7 /* CPTScatterPlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AC61A46255C00D45436 /* CPTTradingRangePlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 0772B43710E24D5C009CD04C /* CPTTradingRangePlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AC71A46256500D45436 /* CPTPlotGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F31DE71045EB470058520A /* CPTPlotGroup.m */; }; + C38A0AC81A46256500D45436 /* CPTPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D7F0F2B72F6002FCEA7 /* CPTPlot.m */; }; + C38A0AC91A46256500D45436 /* CPTBarPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 0799E0940F2BB5F300790525 /* CPTBarPlot.m */; }; + C38A0ACA1A46256500D45436 /* CPTPieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74A32F10FC402600E7E90D /* CPTPieChart.m */; }; + C38A0ACB1A46256500D45436 /* CPTRangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = D0C0477B12D6560900DA8047 /* CPTRangePlot.m */; }; + C38A0ACC1A46256500D45436 /* CPTScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D960F2B73CA002FCEA7 /* CPTScatterPlot.m */; }; + C38A0ACD1A46256500D45436 /* CPTTradingRangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772B43810E24D5C009CD04C /* CPTTradingRangePlot.m */; }; + C38A0ACE1A46256600D45436 /* CPTPlotGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F31DE71045EB470058520A /* CPTPlotGroup.m */; }; + C38A0ACF1A46256600D45436 /* CPTPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D7F0F2B72F6002FCEA7 /* CPTPlot.m */; }; + C38A0AD01A46256600D45436 /* CPTBarPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 0799E0940F2BB5F300790525 /* CPTBarPlot.m */; }; + C38A0AD11A46256600D45436 /* CPTPieChart.m in Sources */ = {isa = PBXBuildFile; fileRef = BC74A32F10FC402600E7E90D /* CPTPieChart.m */; }; + C38A0AD21A46256600D45436 /* CPTRangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = D0C0477B12D6560900DA8047 /* CPTRangePlot.m */; }; + C38A0AD31A46256600D45436 /* CPTScatterPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D960F2B73CA002FCEA7 /* CPTScatterPlot.m */; }; + C38A0AD41A46256600D45436 /* CPTTradingRangePlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772B43810E24D5C009CD04C /* CPTTradingRangePlot.m */; }; + C38A0AD51A46256B00D45436 /* CPTPlotSymbol.h in Headers */ = {isa = PBXBuildFile; fileRef = C34AFE6911021D010041675A /* CPTPlotSymbol.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AD61A46257100D45436 /* CPTPlotSymbol.m in Sources */ = {isa = PBXBuildFile; fileRef = C34AFE6A11021D010041675A /* CPTPlotSymbol.m */; }; + C38A0AD71A46257200D45436 /* CPTPlotSymbol.m in Sources */ = {isa = PBXBuildFile; fileRef = C34AFE6A11021D010041675A /* CPTPlotSymbol.m */; }; + C38A0AD81A46257600D45436 /* CPTScatterPlotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 07FEBD61110B7E8B00E44D37 /* CPTScatterPlotTests.m */; }; + C38A0AD91A46257700D45436 /* CPTScatterPlotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 07FEBD61110B7E8B00E44D37 /* CPTScatterPlotTests.m */; }; + C38A0ADA1A4625B100D45436 /* CPTGridLines.h in Headers */ = {isa = PBXBuildFile; fileRef = C32B391610AA4C78000470D4 /* CPTGridLines.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0ADB1A4625B100D45436 /* CPTGridLineGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C38DD49111A04B7A002A68E7 /* CPTGridLineGroup.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0ADC1A4625C100D45436 /* CPTAxisLabelGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C032C710B8DEDC003A11B6 /* CPTAxisLabelGroup.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0ADD1A4625C900D45436 /* CPTAxisLabelTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD23FFB0FFBE78400ADD2E2 /* CPTAxisLabelTests.m */; }; + C38A0ADE1A4625CA00D45436 /* CPTAxisLabelTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD23FFB0FFBE78400ADD2E2 /* CPTAxisLabelTests.m */; }; + C38A0ADF1A4625D400D45436 /* CPTAxis.m in Sources */ = {isa = PBXBuildFile; fileRef = 07975C480F3B818800DE45DC /* CPTAxis.m */; }; + C38A0AE01A4625D400D45436 /* CPTAxisSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D830F2B7340002FCEA7 /* CPTAxisSet.m */; }; + C38A0AE11A4625D400D45436 /* CPTGridLines.m in Sources */ = {isa = PBXBuildFile; fileRef = C32B391710AA4C78000470D4 /* CPTGridLines.m */; }; + C38A0AE21A4625D400D45436 /* CPTGridLineGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C38DD49211A04B7A002A68E7 /* CPTGridLineGroup.m */; }; + C38A0AE31A4625D400D45436 /* CPTAxisLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 073FB02F0FC991A3007A728E /* CPTAxisLabel.m */; }; + C38A0AE41A4625D400D45436 /* CPTAxisTitle.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFC7C3610921FDB00DAECAA /* CPTAxisTitle.m */; }; + C38A0AE51A4625D400D45436 /* CPTAxisLabelGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C032C810B8DEDC003A11B6 /* CPTAxisLabelGroup.m */; }; + C38A0AE61A4625D400D45436 /* CPTXYAxis.m in Sources */ = {isa = PBXBuildFile; fileRef = 0783DD540FBF097E006C3696 /* CPTXYAxis.m */; }; + C38A0AE71A4625D400D45436 /* CPTXYAxisSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 07975C420F3B816600DE45DC /* CPTXYAxisSet.m */; }; + C38A0AE81A4625D500D45436 /* CPTAxis.m in Sources */ = {isa = PBXBuildFile; fileRef = 07975C480F3B818800DE45DC /* CPTAxis.m */; }; + C38A0AE91A4625D500D45436 /* CPTAxisSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 07BF0D830F2B7340002FCEA7 /* CPTAxisSet.m */; }; + C38A0AEA1A4625D500D45436 /* CPTGridLines.m in Sources */ = {isa = PBXBuildFile; fileRef = C32B391710AA4C78000470D4 /* CPTGridLines.m */; }; + C38A0AEB1A4625D500D45436 /* CPTGridLineGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C38DD49211A04B7A002A68E7 /* CPTGridLineGroup.m */; }; + C38A0AEC1A4625D500D45436 /* CPTAxisLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 073FB02F0FC991A3007A728E /* CPTAxisLabel.m */; }; + C38A0AED1A4625D500D45436 /* CPTAxisTitle.m in Sources */ = {isa = PBXBuildFile; fileRef = BCFC7C3610921FDB00DAECAA /* CPTAxisTitle.m */; }; + C38A0AEE1A4625D500D45436 /* CPTAxisLabelGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C032C810B8DEDC003A11B6 /* CPTAxisLabelGroup.m */; }; + C38A0AEF1A4625D500D45436 /* CPTXYAxis.m in Sources */ = {isa = PBXBuildFile; fileRef = 0783DD540FBF097E006C3696 /* CPTXYAxis.m */; }; + C38A0AF01A4625D500D45436 /* CPTXYAxisSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 07975C420F3B816600DE45DC /* CPTXYAxisSet.m */; }; + C38A0AF11A4625E800D45436 /* CPTAxis.h in Headers */ = {isa = PBXBuildFile; fileRef = 07975C470F3B818800DE45DC /* CPTAxis.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AF21A4625E800D45436 /* CPTAxisSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 07BF0D820F2B7340002FCEA7 /* CPTAxisSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AF31A4625E800D45436 /* CPTAxisLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 073FB02E0FC991A3007A728E /* CPTAxisLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AF41A4625E800D45436 /* CPTAxisTitle.h in Headers */ = {isa = PBXBuildFile; fileRef = BCFC7C3510921FDB00DAECAA /* CPTAxisTitle.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AF51A4625E800D45436 /* CPTXYAxis.h in Headers */ = {isa = PBXBuildFile; fileRef = 0783DD530FBF097E006C3696 /* CPTXYAxis.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AF61A4625E800D45436 /* CPTXYAxisSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 07975C410F3B816600DE45DC /* CPTXYAxisSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AF71A4625F500D45436 /* CPTLegend.h in Headers */ = {isa = PBXBuildFile; fileRef = C3920AC21395B6500045F3BB /* CPTLegend.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AF81A4625F500D45436 /* CPTLegendEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = C30550EB1399BE5400E0151F /* CPTLegendEntry.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AF91A4625FA00D45436 /* CPTLegend.m in Sources */ = {isa = PBXBuildFile; fileRef = C3920AC31395B6500045F3BB /* CPTLegend.m */; }; + C38A0AFA1A4625FA00D45436 /* CPTLegendEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = C30550EC1399BE5400E0151F /* CPTLegendEntry.m */; }; + C38A0AFB1A4625FB00D45436 /* CPTLegend.m in Sources */ = {isa = PBXBuildFile; fileRef = C3920AC31395B6500045F3BB /* CPTLegend.m */; }; + C38A0AFC1A4625FB00D45436 /* CPTLegendEntry.m in Sources */ = {isa = PBXBuildFile; fileRef = C30550EC1399BE5400E0151F /* CPTLegendEntry.m */; }; + C38A0AFD1A46260300D45436 /* CPTTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = 0772C9250FE2F71600EC4C16 /* CPTTheme.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0AFE1A46260B00D45436 /* _CPTXYTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = C3DA34CB107AD7710051DA02 /* _CPTXYTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0AFF1A46260B00D45436 /* _CPTDarkGradientTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = 0772C92D0FE2F89000EC4C16 /* _CPTDarkGradientTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0B001A46260B00D45436 /* _CPTPlainBlackTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC55022C10059F22005DF982 /* _CPTPlainBlackTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0B011A46260B00D45436 /* _CPTPlainWhiteTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC55022E10059F22005DF982 /* _CPTPlainWhiteTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0B021A46260B00D45436 /* _CPTSlateTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = 07FCF2C4115B54AE00E46606 /* _CPTSlateTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0B031A46260B00D45436 /* _CPTStocksTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC55023010059F22005DF982 /* _CPTStocksTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C38A0B041A46261700D45436 /* CPTTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772C9260FE2F71600EC4C16 /* CPTTheme.m */; }; + C38A0B051A46261700D45436 /* _CPTXYTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = C3DA34CA107AD7710051DA02 /* _CPTXYTheme.m */; }; + C38A0B061A46261700D45436 /* _CPTDarkGradientTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772C92E0FE2F89000EC4C16 /* _CPTDarkGradientTheme.m */; }; + C38A0B071A46261700D45436 /* _CPTPlainBlackTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BC55022D10059F22005DF982 /* _CPTPlainBlackTheme.m */; }; + C38A0B081A46261700D45436 /* _CPTPlainWhiteTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BC55022F10059F22005DF982 /* _CPTPlainWhiteTheme.m */; }; + C38A0B091A46261700D45436 /* _CPTSlateTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 07FCF2C5115B54AE00E46606 /* _CPTSlateTheme.m */; }; + C38A0B0A1A46261700D45436 /* _CPTStocksTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BC55023110059F22005DF982 /* _CPTStocksTheme.m */; }; + C38A0B0B1A46261700D45436 /* CPTTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772C9260FE2F71600EC4C16 /* CPTTheme.m */; }; + C38A0B0C1A46261700D45436 /* _CPTXYTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = C3DA34CA107AD7710051DA02 /* _CPTXYTheme.m */; }; + C38A0B0D1A46261700D45436 /* _CPTDarkGradientTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 0772C92E0FE2F89000EC4C16 /* _CPTDarkGradientTheme.m */; }; + C38A0B0E1A46261700D45436 /* _CPTPlainBlackTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BC55022D10059F22005DF982 /* _CPTPlainBlackTheme.m */; }; + C38A0B0F1A46261700D45436 /* _CPTPlainWhiteTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BC55022F10059F22005DF982 /* _CPTPlainWhiteTheme.m */; }; + C38A0B101A46261700D45436 /* _CPTSlateTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 07FCF2C5115B54AE00E46606 /* _CPTSlateTheme.m */; }; + C38A0B111A46261700D45436 /* _CPTStocksTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = BC55023110059F22005DF982 /* _CPTStocksTheme.m */; }; + C38A0B121A46261F00D45436 /* CPTThemeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E1620CBD100F03A100A84E77 /* CPTThemeTests.m */; }; + C38A0B131A46261F00D45436 /* CPTDarkGradientThemeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E1FE6051100F27EF00895A91 /* CPTDarkGradientThemeTests.m */; }; + C38A0B141A46261F00D45436 /* CPTDerivedXYGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = E1FE611A100F3FB700895A91 /* CPTDerivedXYGraph.m */; }; + C38A0B151A46262000D45436 /* CPTThemeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E1620CBD100F03A100A84E77 /* CPTThemeTests.m */; }; + C38A0B161A46262000D45436 /* CPTDarkGradientThemeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E1FE6051100F27EF00895A91 /* CPTDarkGradientThemeTests.m */; }; + C38A0B171A46262000D45436 /* CPTDerivedXYGraph.m in Sources */ = {isa = PBXBuildFile; fileRef = E1FE611A100F3FB700895A91 /* CPTDerivedXYGraph.m */; }; + C38A0B1E1A46264500D45436 /* CPTPlatformSpecificCategories.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0B181A46264500D45436 /* CPTPlatformSpecificCategories.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0B1F1A46264500D45436 /* CPTPlatformSpecificCategories.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B191A46264500D45436 /* CPTPlatformSpecificCategories.m */; }; + C38A0B201A46264500D45436 /* CPTPlatformSpecificCategories.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B191A46264500D45436 /* CPTPlatformSpecificCategories.m */; }; + C38A0B211A46264500D45436 /* CPTPlatformSpecificDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0B1A1A46264500D45436 /* CPTPlatformSpecificDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0B221A46264500D45436 /* CPTPlatformSpecificDefines.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B1B1A46264500D45436 /* CPTPlatformSpecificDefines.m */; }; + C38A0B231A46264500D45436 /* CPTPlatformSpecificDefines.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B1B1A46264500D45436 /* CPTPlatformSpecificDefines.m */; }; + C38A0B241A46264500D45436 /* CPTPlatformSpecificFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0B1C1A46264500D45436 /* CPTPlatformSpecificFunctions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0B251A46264500D45436 /* CPTPlatformSpecificFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B1D1A46264500D45436 /* CPTPlatformSpecificFunctions.m */; }; + C38A0B261A46264500D45436 /* CPTPlatformSpecificFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B1D1A46264500D45436 /* CPTPlatformSpecificFunctions.m */; }; + C38A0B291A46265300D45436 /* CPTGraphHostingView.h in Headers */ = {isa = PBXBuildFile; fileRef = C38A0B271A46265300D45436 /* CPTGraphHostingView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C38A0B2A1A46265300D45436 /* CPTGraphHostingView.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B281A46265300D45436 /* CPTGraphHostingView.m */; }; + C38A0B2B1A46265300D45436 /* CPTGraphHostingView.m in Sources */ = {isa = PBXBuildFile; fileRef = C38A0B281A46265300D45436 /* CPTGraphHostingView.m */; }; C38DD49311A04B7A002A68E7 /* CPTGridLineGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C38DD49111A04B7A002A68E7 /* CPTGridLineGroup.h */; settings = {ATTRIBUTES = (Private, ); }; }; C38DD49411A04B7A002A68E7 /* CPTGridLineGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C38DD49211A04B7A002A68E7 /* CPTGridLineGroup.m */; }; C3920AC41395B6500045F3BB /* CPTLegend.h in Headers */ = {isa = PBXBuildFile; fileRef = C3920AC21395B6500045F3BB /* CPTLegend.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -196,7 +788,16 @@ C3A695E5146A19BC00AF5653 /* CPTMutablePlotRange.h in Headers */ = {isa = PBXBuildFile; fileRef = C3A695E3146A19BC00AF5653 /* CPTMutablePlotRange.h */; settings = {ATTRIBUTES = (Public, ); }; }; C3A695E6146A19BC00AF5653 /* CPTMutablePlotRange.m in Sources */ = {isa = PBXBuildFile; fileRef = C3A695E4146A19BC00AF5653 /* CPTMutablePlotRange.m */; }; C3AFC9D10FB62969005DFFDC /* CPTImage.h in Headers */ = {isa = PBXBuildFile; fileRef = C3AFC9CF0FB62969005DFFDC /* CPTImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C3BB7D281633408200BC9515 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3BB7D1416322F7E00BC9515 /* Accelerate.framework */; settings = {ATTRIBUTES = (Required, ); }; }; + C3B4D4971BC9983300450C37 /* CorePlot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C37EA6921BC83F2A0091C8F7 /* CorePlot.framework */; }; + C3BB3C8E1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3BB3C8C1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h */; }; + C3BB3C8F1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3BB3C8C1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h */; }; + C3BB3C901C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h in Headers */ = {isa = PBXBuildFile; fileRef = C3BB3C8C1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h */; }; + C3BB3C911C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3BB3C8D1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m */; }; + C3BB3C921C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3BB3C8D1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m */; }; + C3BB3C931C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3BB3C8D1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m */; }; + C3BB3C941C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */ = {isa = PBXBuildFile; fileRef = C3BB3C8D1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m */; }; + C3BB93191B729BD200004527 /* CPTDebugQuickLook.h in Headers */ = {isa = PBXBuildFile; fileRef = C3BB93181B729BD200004527 /* CPTDebugQuickLook.h */; }; + C3BB931A1B729BD200004527 /* CPTDebugQuickLook.h in Headers */ = {isa = PBXBuildFile; fileRef = C3BB93181B729BD200004527 /* CPTDebugQuickLook.h */; }; C3BFFD1112274CB500DE22AC /* CPTNumericDataTypeConversionTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C97EF08104D80D400B554F9 /* CPTNumericDataTypeConversionTests.m */; }; C3C1C0801790D3B400E8B1B7 /* CPTLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C1C07F1790D3B400E8B1B7 /* CPTLayerTests.m */; }; C3C9CB0E165DB4D500739006 /* CPTAnimationOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = C3C9CB0C165DB4D500739006 /* CPTAnimationOperation.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -218,6 +819,11 @@ C3D375F116594755003CC156 /* _CPTAnimationTimingFunctions.m in Sources */ = {isa = PBXBuildFile; fileRef = C3C2847416585085006BA43C /* _CPTAnimationTimingFunctions.m */; }; C3D3AD2D13DF8DCE0004EA73 /* CPTLineCap.h in Headers */ = {isa = PBXBuildFile; fileRef = C3D3AD2B13DF8DCE0004EA73 /* CPTLineCap.h */; settings = {ATTRIBUTES = (Public, ); }; }; C3D3AD2E13DF8DCE0004EA73 /* CPTLineCap.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D3AD2C13DF8DCE0004EA73 /* CPTLineCap.m */; }; + C3D414781A7D829100B6F5D6 /* CPTMutableNumericData.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C97EF10104D819100B554F9 /* CPTMutableNumericData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C3D414791A7D829D00B6F5D6 /* CPTNumericData.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C97EEFA104D80C400B554F9 /* CPTNumericData.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C3D4147A1A7D82A500B6F5D6 /* CPTNumericData+TypeConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C97EEF7104D80C400B554F9 /* CPTNumericData+TypeConversion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C3D4147B1A7D82AB00B6F5D6 /* CPTMutableNumericData+TypeConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = C3CAFB241229E41F00F5C989 /* CPTMutableNumericData+TypeConversion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C3D414E01A7D867200B6F5D6 /* CorePlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 070CF7AE0F3CA7AB0001FFF4 /* CorePlot.h */; settings = {ATTRIBUTES = (Public, ); }; }; C3D68A5B1220B27D00EB4863 /* CPTUtilitiesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD7E9630F4B625900F9BCBB /* CPTUtilitiesTests.m */; }; C3D68A5C1220B29100EB4863 /* CPTTextStyleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C36468A90FE5533F0064B186 /* CPTTextStyleTests.m */; }; C3D68A5E1220B2AC00EB4863 /* CPTXYPlotSpaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C422A630FB1FCD5000CAA43 /* CPTXYPlotSpaceTests.m */; }; @@ -236,6 +842,13 @@ C3D979BB13D2347400145DFF /* CPTFillTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C3D979BA13D2347300145DFF /* CPTFillTests.m */; }; C3DA34CC107AD7710051DA02 /* _CPTXYTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = C3DA34CA107AD7710051DA02 /* _CPTXYTheme.m */; }; C3DA34CD107AD7710051DA02 /* _CPTXYTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = C3DA34CB107AD7710051DA02 /* _CPTXYTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; + C3EE4E691A6C133D0098F4E6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A511A69F6DA00F77249 /* QuartzCore.framework */; }; + C3EE4E6A1A6C134B0098F4E6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A571A69F6FA00F77249 /* CoreGraphics.framework */; }; + C3EE4E6B1A6C13560098F4E6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3226A531A69F6DF00F77249 /* UIKit.framework */; }; + C3EE4E6E1A6C15890098F4E6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07BF0D630F2B70B8002FCEA7 /* QuartzCore.framework */; }; + C3EE4E981A6C1E890098F4E6 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3EE4E971A6C1E890098F4E6 /* Cocoa.framework */; }; + C3EE4E9A1A6C1F770098F4E6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 07BF0D630F2B70B8002FCEA7 /* QuartzCore.framework */; }; + C3EE4E9B1A6C1F8A0098F4E6 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C3EE4E971A6C1E890098F4E6 /* Cocoa.framework */; }; C3F31DE91045EB470058520A /* CPTPlotGroup.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F31DE71045EB470058520A /* CPTPlotGroup.m */; }; C3F31DEA1045EB470058520A /* CPTPlotGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = C3F31DE81045EB470058520A /* CPTPlotGroup.h */; settings = {ATTRIBUTES = (Private, ); }; }; C3F97F1E17A9E07C00A52FF2 /* CPTFunctionDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = C3F97F1C17A9E07B00A52FF2 /* CPTFunctionDataSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -252,112 +865,139 @@ remoteGlobalIDString = 8DC2EF4F0486A6940098B216; remoteInfo = CorePlot; }; + C38A09841A46185300D45436 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C38A09771A46185200D45436; + remoteInfo = "CorePlot-iOS"; + }; + C38A09C61A4619A900D45436 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C38A09B91A4619A900D45436; + remoteInfo = "CorePlot-CocoaTouch"; + }; + C3B4D4951BC997F600450C37 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C37EA5C91BC83F2A0091C8F7; + remoteInfo = "CorePlot tvOS"; + }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + C38A09B81A4619A900D45436 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ - 070064E7111F2BAA003DE087 /* CPTConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTConstraints.h; sourceTree = ""; }; - 070064E8111F2BAA003DE087 /* CPTConstraints.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTConstraints.m; sourceTree = ""; }; + 070064E7111F2BAA003DE087 /* CPTConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTConstraints.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 070064E8111F2BAA003DE087 /* CPTConstraints.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTConstraints.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 070622300FDF1B250066A6C4 /* CPTPathExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPathExtensions.h; sourceTree = ""; }; 070622310FDF1B250066A6C4 /* CPTPathExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPathExtensions.m; sourceTree = ""; }; 0706223A0FDF215C0066A6C4 /* CPTBorderedLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTBorderedLayer.h; sourceTree = ""; }; - 0706223B0FDF215C0066A6C4 /* CPTBorderedLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTBorderedLayer.m; sourceTree = ""; }; + 0706223B0FDF215C0066A6C4 /* CPTBorderedLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTBorderedLayer.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 070A73DA0F5D8C910014FA84 /* CPTDecimalNumberValueTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTDecimalNumberValueTransformer.h; path = ../MacOnly/CPTDecimalNumberValueTransformer.h; sourceTree = ""; }; 070A73DB0F5D8C910014FA84 /* CPTDecimalNumberValueTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTDecimalNumberValueTransformer.m; path = ../MacOnly/CPTDecimalNumberValueTransformer.m; sourceTree = ""; }; 070CF7AE0F3CA7AB0001FFF4 /* CorePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CorePlot.h; sourceTree = ""; }; 071F3CB810FBAB5900D0A7B6 /* License.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = License.txt; path = ../License.txt; sourceTree = SOURCE_ROOT; }; 072161E911D1F6BD009CC871 /* CPTAnnotationHostLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTAnnotationHostLayer.h; sourceTree = ""; }; - 072161EA11D1F6BD009CC871 /* CPTAnnotationHostLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTAnnotationHostLayer.m; sourceTree = ""; }; + 072161EA11D1F6BD009CC871 /* CPTAnnotationHostLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTAnnotationHostLayer.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 0730F600109492D800E95162 /* UnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 0730F601109492D800E95162 /* UnitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "UnitTests-Info.plist"; sourceTree = ""; }; 0730F64C109494D100E95162 /* CPTTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTestCase.h; sourceTree = ""; }; 0730F64D109494D100E95162 /* CPTTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTestCase.m; sourceTree = ""; }; 07321BBF0F37370D00F423D8 /* CPTExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTExceptions.h; sourceTree = ""; }; 07321BC00F37370D00F423D8 /* CPTExceptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTExceptions.m; sourceTree = ""; }; 07321BC40F37382D00F423D8 /* CPTUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTUtilities.h; sourceTree = ""; }; - 07321BC50F37382D00F423D8 /* CPTUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTUtilities.m; sourceTree = ""; }; - 073FB02E0FC991A3007A728E /* CPTAxisLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTAxisLabel.h; sourceTree = ""; }; - 073FB02F0FC991A3007A728E /* CPTAxisLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTAxisLabel.m; sourceTree = ""; }; + 07321BC50F37382D00F423D8 /* CPTUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTUtilities.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 073FB02E0FC991A3007A728E /* CPTAxisLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTAxisLabel.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 073FB02F0FC991A3007A728E /* CPTAxisLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTAxisLabel.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 0772B43710E24D5C009CD04C /* CPTTradingRangePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTradingRangePlot.h; sourceTree = ""; }; - 0772B43810E24D5C009CD04C /* CPTTradingRangePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTradingRangePlot.m; sourceTree = ""; }; - 0772C9250FE2F71600EC4C16 /* CPTTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTheme.h; sourceTree = ""; }; - 0772C9260FE2F71600EC4C16 /* CPTTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTheme.m; sourceTree = ""; }; + 0772B43810E24D5C009CD04C /* CPTTradingRangePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTTradingRangePlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 0772C9250FE2F71600EC4C16 /* CPTTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTTheme.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 0772C9260FE2F71600EC4C16 /* CPTTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTTheme.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 0772C92D0FE2F89000EC4C16 /* _CPTDarkGradientTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTDarkGradientTheme.h; sourceTree = ""; }; 0772C92E0FE2F89000EC4C16 /* _CPTDarkGradientTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTDarkGradientTheme.m; sourceTree = ""; }; 0783DD530FBF097E006C3696 /* CPTXYAxis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTXYAxis.h; sourceTree = ""; }; - 0783DD540FBF097E006C3696 /* CPTXYAxis.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTXYAxis.m; sourceTree = ""; }; + 0783DD540FBF097E006C3696 /* CPTXYAxis.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTXYAxis.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 0789EF330FB9E90700C0A613 /* CPTPlatformSpecificDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlatformSpecificDefines.h; sourceTree = ""; }; 0789EF340FB9E90700C0A613 /* CPTPlatformSpecificDefines.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlatformSpecificDefines.m; sourceTree = ""; }; 0789EF470FB9EBD600C0A613 /* CPTPlatformSpecificCategories.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlatformSpecificCategories.h; sourceTree = ""; }; - 0789EF480FB9EBD600C0A613 /* CPTPlatformSpecificCategories.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlatformSpecificCategories.m; sourceTree = ""; }; + 0789EF480FB9EBD600C0A613 /* CPTPlatformSpecificCategories.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlatformSpecificCategories.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 0789EF890FB9EE4700C0A613 /* CPTPlatformSpecificFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlatformSpecificFunctions.h; sourceTree = ""; }; 0789EF8A0FB9EE4700C0A613 /* CPTPlatformSpecificFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlatformSpecificFunctions.m; sourceTree = ""; }; - 078F42D90FACC075006E670B /* NSNumberExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSNumberExtensions.h; sourceTree = ""; }; - 078F42DA0FACC075006E670B /* NSNumberExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSNumberExtensions.m; sourceTree = ""; }; + 078F42D90FACC075006E670B /* NSNumberExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = NSNumberExtensions.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 078F42DA0FACC075006E670B /* NSNumberExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = NSNumberExtensions.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 07975C410F3B816600DE45DC /* CPTXYAxisSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTXYAxisSet.h; sourceTree = ""; }; - 07975C420F3B816600DE45DC /* CPTXYAxisSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTXYAxisSet.m; sourceTree = ""; }; - 07975C470F3B818800DE45DC /* CPTAxis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTAxis.h; sourceTree = ""; }; - 07975C480F3B818800DE45DC /* CPTAxis.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTAxis.m; sourceTree = ""; }; - 07983EF40F2F9A3D008C8618 /* CPTXYGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTXYGraph.h; sourceTree = ""; }; - 07983EF50F2F9A3D008C8618 /* CPTXYGraph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTXYGraph.m; sourceTree = ""; }; - 0799E0930F2BB5F300790525 /* CPTBarPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTBarPlot.h; sourceTree = ""; }; - 0799E0940F2BB5F300790525 /* CPTBarPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTBarPlot.m; sourceTree = ""; }; + 07975C420F3B816600DE45DC /* CPTXYAxisSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTXYAxisSet.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 07975C470F3B818800DE45DC /* CPTAxis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTAxis.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 07975C480F3B818800DE45DC /* CPTAxis.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTAxis.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 07983EF40F2F9A3D008C8618 /* CPTXYGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTXYGraph.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 07983EF50F2F9A3D008C8618 /* CPTXYGraph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTXYGraph.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 0799E0930F2BB5F300790525 /* CPTBarPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTBarPlot.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 0799E0940F2BB5F300790525 /* CPTBarPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTBarPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 0799E0970F2BB6E800790525 /* CPTXYPlotSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTXYPlotSpace.h; sourceTree = ""; }; - 079FC0B20FB975500037E990 /* CPTColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTColor.h; sourceTree = ""; }; - 079FC0B30FB975500037E990 /* CPTColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTColor.m; sourceTree = ""; }; - 079FC0BB0FB9762B0037E990 /* CPTColorSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTColorSpace.h; sourceTree = ""; }; - 079FC0BC0FB9762B0037E990 /* CPTColorSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTColorSpace.m; sourceTree = ""; }; - 07A2E6FA102DF47900809BC5 /* CPTTimeFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTimeFormatter.h; sourceTree = ""; }; - 07A2E6FB102DF47900809BC5 /* CPTTimeFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTimeFormatter.m; sourceTree = ""; }; + 079FC0B20FB975500037E990 /* CPTColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTColor.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 079FC0B30FB975500037E990 /* CPTColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTColor.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 079FC0BB0FB9762B0037E990 /* CPTColorSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTColorSpace.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 079FC0BC0FB9762B0037E990 /* CPTColorSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTColorSpace.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 07A2E6FA102DF47900809BC5 /* CPTTimeFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTTimeFormatter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 07A2E6FB102DF47900809BC5 /* CPTTimeFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTTimeFormatter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 07AEF1FD10BBE1F10012BEFF /* CPTResponder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTResponder.h; sourceTree = ""; }; 07B69A5B12B6215000F4C16C /* CPTTextStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTTextStyle.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - 07B69A5C12B6215000F4C16C /* CPTTextStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTextStyle.m; sourceTree = ""; }; + 07B69A5C12B6215000F4C16C /* CPTTextStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTTextStyle.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 07B69B1512B62ABB00F4C16C /* CPTMutableLineStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTMutableLineStyle.h; sourceTree = ""; }; - 07B69B1612B62ABB00F4C16C /* CPTMutableLineStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTMutableLineStyle.m; sourceTree = ""; }; + 07B69B1612B62ABB00F4C16C /* CPTMutableLineStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTMutableLineStyle.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 07BF0D630F2B70B8002FCEA7 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; - 07BF0D700F2B718F002FCEA7 /* CPTGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTGraph.h; sourceTree = ""; }; - 07BF0D710F2B718F002FCEA7 /* CPTGraph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTGraph.m; sourceTree = ""; }; + 07BF0D700F2B718F002FCEA7 /* CPTGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTGraph.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 07BF0D710F2B718F002FCEA7 /* CPTGraph.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTGraph.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 07BF0D760F2B723A002FCEA7 /* CPTPlotAreaFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotAreaFrame.h; sourceTree = ""; }; - 07BF0D770F2B723A002FCEA7 /* CPTPlotAreaFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlotAreaFrame.m; sourceTree = ""; }; - 07BF0D7A0F2B72B0002FCEA7 /* CPTPlotSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotSpace.h; sourceTree = ""; }; - 07BF0D7B0F2B72B0002FCEA7 /* CPTPlotSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlotSpace.m; sourceTree = ""; }; - 07BF0D7E0F2B72F6002FCEA7 /* CPTPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlot.h; sourceTree = ""; }; - 07BF0D7F0F2B72F6002FCEA7 /* CPTPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlot.m; sourceTree = ""; }; + 07BF0D770F2B723A002FCEA7 /* CPTPlotAreaFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlotAreaFrame.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 07BF0D7A0F2B72B0002FCEA7 /* CPTPlotSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTPlotSpace.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 07BF0D7B0F2B72B0002FCEA7 /* CPTPlotSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlotSpace.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 07BF0D7E0F2B72F6002FCEA7 /* CPTPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTPlot.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 07BF0D7F0F2B72F6002FCEA7 /* CPTPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 07BF0D820F2B7340002FCEA7 /* CPTAxisSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTAxisSet.h; sourceTree = ""; }; - 07BF0D830F2B7340002FCEA7 /* CPTAxisSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTAxisSet.m; sourceTree = ""; }; - 07BF0D950F2B73CA002FCEA7 /* CPTScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTScatterPlot.h; sourceTree = ""; }; - 07BF0D960F2B73CA002FCEA7 /* CPTScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTScatterPlot.m; sourceTree = ""; }; - 07BF0DF10F2B7BFB002FCEA7 /* CPTDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTDefinitions.h; sourceTree = ""; }; + 07BF0D830F2B7340002FCEA7 /* CPTAxisSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTAxisSet.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 07BF0D950F2B73CA002FCEA7 /* CPTScatterPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTScatterPlot.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 07BF0D960F2B73CA002FCEA7 /* CPTScatterPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTScatterPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 07BF0DF10F2B7BFB002FCEA7 /* CPTDefinitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTDefinitions.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 07BF0DF20F2B7BFB002FCEA7 /* CPTDefinitions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTDefinitions.m; sourceTree = ""; }; 07C467990FE1A24C00299939 /* CPTMutableTextStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTMutableTextStyle.h; sourceTree = ""; }; 07C4679A0FE1A24C00299939 /* CPTMutableTextStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTMutableTextStyle.m; sourceTree = ""; }; 07C467B60FE1A96E00299939 /* CPTTextStylePlatformSpecific.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTTextStylePlatformSpecific.h; path = MacOnly/CPTTextStylePlatformSpecific.h; sourceTree = SOURCE_ROOT; }; 07C467B70FE1A96E00299939 /* CPTTextStylePlatformSpecific.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CPTTextStylePlatformSpecific.m; path = MacOnly/CPTTextStylePlatformSpecific.m; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 07CA112D0FAC8F85000861CE /* CPTGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTGradient.h; sourceTree = ""; }; - 07CA112E0FAC8F85000861CE /* CPTGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTGradient.m; sourceTree = ""; }; - 07E10BAF11D1016B000B8DAB /* CPTPlotSpaceAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotSpaceAnnotation.h; sourceTree = ""; }; - 07E10BB011D1016B000B8DAB /* CPTPlotSpaceAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlotSpaceAnnotation.m; sourceTree = ""; }; - 07E10BB411D10177000B8DAB /* CPTAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTAnnotation.h; sourceTree = ""; }; - 07E10BB511D10177000B8DAB /* CPTAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTAnnotation.m; sourceTree = ""; }; - 07E10BB911D10183000B8DAB /* CPTLayerAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTLayerAnnotation.h; sourceTree = ""; }; - 07E10BBA11D10183000B8DAB /* CPTLayerAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTLayerAnnotation.m; sourceTree = ""; }; + 07CA112D0FAC8F85000861CE /* CPTGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTGradient.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 07CA112E0FAC8F85000861CE /* CPTGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTGradient.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 07E10BAF11D1016B000B8DAB /* CPTPlotSpaceAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTPlotSpaceAnnotation.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 07E10BB011D1016B000B8DAB /* CPTPlotSpaceAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlotSpaceAnnotation.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 07E10BB411D10177000B8DAB /* CPTAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTAnnotation.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 07E10BB511D10177000B8DAB /* CPTAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTAnnotation.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 07E10BB911D10183000B8DAB /* CPTLayerAnnotation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTLayerAnnotation.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 07E10BBA11D10183000B8DAB /* CPTLayerAnnotation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTLayerAnnotation.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 07FCF2C4115B54AE00E46606 /* _CPTSlateTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTSlateTheme.h; sourceTree = ""; }; 07FCF2C5115B54AE00E46606 /* _CPTSlateTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTSlateTheme.m; sourceTree = ""; }; 07FEBD60110B7E8B00E44D37 /* CPTScatterPlotTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTScatterPlotTests.h; sourceTree = ""; }; 07FEBD61110B7E8B00E44D37 /* CPTScatterPlotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTScatterPlotTests.m; sourceTree = ""; }; - 0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 32484B3F0F530E8B002151AD /* CPTPlotRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotRange.h; sourceTree = ""; }; - 32484B400F530E8B002151AD /* CPTPlotRange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlotRange.m; sourceTree = ""; }; + 32484B3F0F530E8B002151AD /* CPTPlotRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTPlotRange.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 32484B400F530E8B002151AD /* CPTPlotRange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlotRange.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 32DBCF5E0370ADEE00C91783 /* CorePlot_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CorePlot_Prefix.pch; sourceTree = ""; }; - 4C32D37C0F43B3CD00EDFE7A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 4C422A620FB1FCD5000CAA43 /* CPTXYPlotSpaceTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTXYPlotSpaceTests.h; sourceTree = ""; }; 4C422A630FB1FCD5000CAA43 /* CPTXYPlotSpaceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTXYPlotSpaceTests.m; sourceTree = ""; }; 4C97EEF7104D80C400B554F9 /* CPTNumericData+TypeConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CPTNumericData+TypeConversion.h"; sourceTree = ""; }; - 4C97EEF9104D80C400B554F9 /* CPTNumericData+TypeConversions_Generation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "CPTNumericData+TypeConversions_Generation.py"; sourceTree = ""; }; - 4C97EEFA104D80C400B554F9 /* CPTNumericData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTNumericData.h; sourceTree = ""; }; - 4C97EEFB104D80C400B554F9 /* CPTNumericData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTNumericData.m; sourceTree = ""; }; + 4C97EEF9104D80C400B554F9 /* CPTNumericData+TypeConversions_Generation.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; lineEnding = 0; path = "CPTNumericData+TypeConversions_Generation.py"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.python; }; + 4C97EEFA104D80C400B554F9 /* CPTNumericData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTNumericData.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 4C97EEFB104D80C400B554F9 /* CPTNumericData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTNumericData.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 4C97EEFC104D80C400B554F9 /* CPTNumericDataType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTNumericDataType.h; sourceTree = ""; }; 4C97EEFD104D80C400B554F9 /* CPTNumericDataType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTNumericDataType.m; sourceTree = ""; }; 4C97EF05104D80D400B554F9 /* CPTNumericDataTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTNumericDataTests.h; sourceTree = ""; }; @@ -365,34 +1005,32 @@ 4C97EF07104D80D400B554F9 /* CPTNumericDataTypeConversionTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTNumericDataTypeConversionTests.h; sourceTree = ""; }; 4C97EF08104D80D400B554F9 /* CPTNumericDataTypeConversionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTNumericDataTypeConversionTests.m; sourceTree = ""; }; 4C97EF10104D819100B554F9 /* CPTMutableNumericData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTMutableNumericData.h; sourceTree = ""; }; - 4C97EF11104D819100B554F9 /* CPTMutableNumericData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTMutableNumericData.m; sourceTree = ""; }; + 4C97EF11104D819100B554F9 /* CPTMutableNumericData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTMutableNumericData.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 4C97EF4C104D843E00B554F9 /* license.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = license.txt; sourceTree = ""; }; - 4C993FF00F45EE1600DC824F /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; - 4C9A745D0FB24C7200918464 /* CPTDataSourceTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTDataSourceTestCase.h; sourceTree = ""; }; - 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTDataSourceTestCase.m; sourceTree = ""; }; + 4C9A745D0FB24C7200918464 /* CPTDataSourceTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTDataSourceTestCase.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTDataSourceTestCase.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 4CD23FFA0FFBE78400ADD2E2 /* CPTAxisLabelTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTAxisLabelTests.h; sourceTree = ""; }; 4CD23FFB0FFBE78400ADD2E2 /* CPTAxisLabelTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTAxisLabelTests.m; sourceTree = ""; }; - 4CD7E7E50F4B4F8200F9BCBB /* CPTTextLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTextLayer.h; sourceTree = ""; }; - 4CD7E7E60F4B4F8200F9BCBB /* CPTTextLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTextLayer.m; sourceTree = ""; }; - 4CD7E7EA0F4B4F9600F9BCBB /* CPTLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTLayer.h; sourceTree = ""; }; - 4CD7E7EB0F4B4F9600F9BCBB /* CPTLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTLayer.m; sourceTree = ""; }; + 4CD7E7E50F4B4F8200F9BCBB /* CPTTextLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTTextLayer.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 4CD7E7E60F4B4F8200F9BCBB /* CPTTextLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTTextLayer.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 4CD7E7EA0F4B4F9600F9BCBB /* CPTLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTLayer.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 4CD7E7EB0F4B4F9600F9BCBB /* CPTLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTLayer.m; sourceTree = ""; }; 4CD7E7EE0F4B4FA700F9BCBB /* NSDecimalNumberExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDecimalNumberExtensions.h; sourceTree = ""; }; 4CD7E7EF0F4B4FA700F9BCBB /* NSDecimalNumberExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSDecimalNumberExtensions.m; sourceTree = ""; }; 4CD7E9620F4B625900F9BCBB /* CPTUtilitiesTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTUtilitiesTests.h; sourceTree = ""; }; 4CD7E9630F4B625900F9BCBB /* CPTUtilitiesTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTUtilitiesTests.m; sourceTree = ""; }; - 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8DC2EF5B0486A6940098B216 /* CorePlot.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 9021E5690FC69B2900443472 /* doxygen.config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = doxygen.config; path = ../documentation/doxygen/doxygen.config; sourceTree = SOURCE_ROOT; }; - 906156BC0F375598001B75FC /* CPTLineStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTLineStyle.h; sourceTree = ""; }; - 906156BD0F375598001B75FC /* CPTLineStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTLineStyle.m; sourceTree = ""; }; - 90AF4FB90F36D39700753D26 /* CPTXYPlotSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTXYPlotSpace.m; sourceTree = ""; }; - A92C00B71DCB2085A92BE0A9 /* _CPTAnimationNSDecimalPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTAnimationNSDecimalPeriod.m; sourceTree = ""; }; + 9021E5690FC69B2900443472 /* doxygen.config */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; lineEnding = 0; name = doxygen.config; path = ../documentation/doxygen/doxygen.config; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = ""; }; + 906156BC0F375598001B75FC /* CPTLineStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTLineStyle.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + 906156BD0F375598001B75FC /* CPTLineStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTLineStyle.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 90AF4FB90F36D39700753D26 /* CPTXYPlotSpace.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTXYPlotSpace.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + A92C00B71DCB2085A92BE0A9 /* _CPTAnimationNSDecimalPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = _CPTAnimationNSDecimalPeriod.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; A92C0563E082D1C1E249FA6F /* _CPTAnimationCGSizePeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTAnimationCGSizePeriod.h; sourceTree = ""; }; A92C0685ACE3281299F10F73 /* _CPTAnimationNSDecimalPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTAnimationNSDecimalPeriod.h; sourceTree = ""; }; - A92C087BF0913A6BA2363E40 /* _CPTAnimationCGSizePeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTAnimationCGSizePeriod.m; sourceTree = ""; }; + A92C087BF0913A6BA2363E40 /* _CPTAnimationCGSizePeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = _CPTAnimationCGSizePeriod.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; A92C091B8592D9F32AC384CB /* _CPTAnimationPlotRangePeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTAnimationPlotRangePeriod.m; sourceTree = ""; }; - A92C0AE447398AF62D584F9C /* _CPTAnimationCGPointPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTAnimationCGPointPeriod.m; sourceTree = ""; }; - A92C0C3DB583ED8FC2EFD9DB /* _CPTAnimationCGRectPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTAnimationCGRectPeriod.m; sourceTree = ""; }; + A92C0AE447398AF62D584F9C /* _CPTAnimationCGPointPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = _CPTAnimationCGPointPeriod.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + A92C0C3DB583ED8FC2EFD9DB /* _CPTAnimationCGRectPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = _CPTAnimationCGRectPeriod.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; A92C0E154E8598EDE2EDEF2F /* _CPTAnimationCGPointPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTAnimationCGPointPeriod.h; sourceTree = ""; }; A92C0E16290C226BC4BE3936 /* _CPTAnimationPlotRangePeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTAnimationPlotRangePeriod.h; sourceTree = ""; }; A92C0E876AE37EB30019586B /* _CPTAnimationCGRectPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTAnimationCGRectPeriod.h; sourceTree = ""; }; @@ -403,89 +1041,127 @@ BC55023010059F22005DF982 /* _CPTStocksTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTStocksTheme.h; sourceTree = ""; }; BC55023110059F22005DF982 /* _CPTStocksTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTStocksTheme.m; sourceTree = ""; }; BC74A32E10FC402600E7E90D /* CPTPieChart.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPieChart.h; sourceTree = ""; }; - BC74A32F10FC402600E7E90D /* CPTPieChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPieChart.m; sourceTree = ""; }; + BC74A32F10FC402600E7E90D /* CPTPieChart.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPieChart.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; BC79F1340FD1CD6600510976 /* CPTGraphHostingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTGraphHostingView.h; sourceTree = ""; }; - BC79F1350FD1CD6600510976 /* CPTGraphHostingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTGraphHostingView.m; sourceTree = ""; }; - BC89A64010239D1D009D5261 /* CorePlotProbes.d */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.dtrace; name = CorePlotProbes.d; path = TestResources/CorePlotProbes.d; sourceTree = SOURCE_ROOT; }; + BC79F1350FD1CD6600510976 /* CPTGraphHostingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTGraphHostingView.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; BCFC7C3510921FDB00DAECAA /* CPTAxisTitle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTAxisTitle.h; sourceTree = ""; }; - BCFC7C3610921FDB00DAECAA /* CPTAxisTitle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTAxisTitle.m; sourceTree = ""; }; - C30550EB1399BE5400E0151F /* CPTLegendEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTLegendEntry.h; sourceTree = ""; }; - C30550EC1399BE5400E0151F /* CPTLegendEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTLegendEntry.m; sourceTree = ""; }; + BCFC7C3610921FDB00DAECAA /* CPTAxisTitle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTAxisTitle.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C30550EB1399BE5400E0151F /* CPTLegendEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTLegendEntry.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C30550EC1399BE5400E0151F /* CPTLegendEntry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTLegendEntry.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C30E979F14B290520012204A /* DoxygenLayout.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = DoxygenLayout.xml; path = ../documentation/doxygen/DoxygenLayout.xml; sourceTree = ""; }; - C318F4AB11EA188700595FF9 /* CPTLimitBand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTLimitBand.h; sourceTree = ""; }; - C318F4AC11EA188700595FF9 /* CPTLimitBand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTLimitBand.m; sourceTree = ""; }; - C31908A41998168C00B61898 /* CorePlot.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = CorePlot.xcconfig; sourceTree = ""; }; + C318F4AB11EA188700595FF9 /* CPTLimitBand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTLimitBand.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C318F4AC11EA188700595FF9 /* CPTLimitBand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTLimitBand.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C31908A41998168C00B61898 /* CorePlot.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlot.xcconfig; path = xcconfig/CorePlot.xcconfig; sourceTree = ""; }; + C3226A451A69ED0900F77249 /* doxygen touch.config */ = {isa = PBXFileReference; lastKnownFileType = text; lineEnding = 0; name = "doxygen touch.config"; path = "../documentation/doxygen/doxygen touch.config"; sourceTree = ""; xcLanguageSpecificationIdentifier = ""; }; + C3226A461A69ED1F00F77249 /* doxygen-cocoa-touch-tags.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = "doxygen-cocoa-touch-tags.xml"; path = "../documentation/doxygen/doxygen-cocoa-touch-tags.xml"; sourceTree = ""; }; + C3226A471A69EE9200F77249 /* CorePlot-CocoaTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CorePlot-CocoaTouch.h"; sourceTree = ""; }; + C3226A511A69F6DA00F77249 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + C3226A531A69F6DF00F77249 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + C3226A551A69F6F000F77249 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Accelerate.framework; sourceTree = DEVELOPER_DIR; }; + C3226A571A69F6FA00F77249 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/CoreGraphics.framework; sourceTree = DEVELOPER_DIR; }; C3286BFE15D8740100A436A8 /* _CPTMaskLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTMaskLayer.h; sourceTree = ""; }; - C3286BFF15D8740100A436A8 /* _CPTMaskLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTMaskLayer.m; sourceTree = ""; }; + C3286BFF15D8740100A436A8 /* _CPTMaskLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = _CPTMaskLayer.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C32B391610AA4C78000470D4 /* CPTGridLines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTGridLines.h; sourceTree = ""; }; - C32B391710AA4C78000470D4 /* CPTGridLines.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTGridLines.m; sourceTree = ""; }; - C32EE1B413EC4AA800038266 /* CPTShadow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTShadow.h; sourceTree = ""; }; - C32EE1B513EC4AA800038266 /* CPTShadow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTShadow.m; sourceTree = ""; }; + C32B391710AA4C78000470D4 /* CPTGridLines.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTGridLines.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C32EE1B413EC4AA800038266 /* CPTShadow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTShadow.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C32EE1B513EC4AA800038266 /* CPTShadow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTShadow.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C32EE1BF13EC4BE700038266 /* CPTMutableShadow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTMutableShadow.h; sourceTree = ""; }; C32EE1C013EC4BE700038266 /* CPTMutableShadow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTMutableShadow.m; sourceTree = ""; }; C3392A371225F667008DA6BD /* CPTNumericData+TypeConversion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CPTNumericData+TypeConversion.m"; sourceTree = ""; }; C3408C3C15FC1C3E004F1D70 /* _CPTBorderLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTBorderLayer.h; sourceTree = ""; }; - C3408C3D15FC1C3E004F1D70 /* _CPTBorderLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTBorderLayer.m; sourceTree = ""; }; - C34260180FAE096C00072842 /* _CPTFillImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTFillImage.h; sourceTree = ""; }; - C34260190FAE096C00072842 /* _CPTFillGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTFillGradient.m; sourceTree = ""; }; - C342601A0FAE096C00072842 /* CPTFill.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTFill.m; sourceTree = ""; }; - C342601B0FAE096C00072842 /* _CPTFillColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTFillColor.h; sourceTree = ""; }; - C342601C0FAE096C00072842 /* _CPTFillColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTFillColor.m; sourceTree = ""; }; - C342601D0FAE096C00072842 /* _CPTFillImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTFillImage.m; sourceTree = ""; }; - C342601E0FAE096C00072842 /* _CPTFillGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTFillGradient.h; sourceTree = ""; }; - C342601F0FAE096C00072842 /* CPTFill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTFill.h; sourceTree = ""; }; - C349DCB2151AAFBF00BFD6A7 /* CPTCalendarFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTCalendarFormatter.h; sourceTree = ""; }; - C349DCB3151AAFBF00BFD6A7 /* CPTCalendarFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTCalendarFormatter.m; sourceTree = ""; }; - C34AFE6911021D010041675A /* CPTPlotSymbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotSymbol.h; sourceTree = ""; }; - C34AFE6A11021D010041675A /* CPTPlotSymbol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlotSymbol.m; sourceTree = ""; }; + C3408C3D15FC1C3E004F1D70 /* _CPTBorderLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = _CPTBorderLayer.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C34260180FAE096C00072842 /* _CPTFillImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = _CPTFillImage.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C34260190FAE096C00072842 /* _CPTFillGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = _CPTFillGradient.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C342601A0FAE096C00072842 /* CPTFill.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTFill.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C342601B0FAE096C00072842 /* _CPTFillColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = _CPTFillColor.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C342601C0FAE096C00072842 /* _CPTFillColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = _CPTFillColor.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C342601D0FAE096C00072842 /* _CPTFillImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = _CPTFillImage.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C342601E0FAE096C00072842 /* _CPTFillGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = _CPTFillGradient.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C342601F0FAE096C00072842 /* CPTFill.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTFill.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C3490DF120E028CF0089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-Info.plist"; sourceTree = ""; }; + C3490DF320E028D30089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-CocoaTouch-Info.plist"; sourceTree = ""; }; + C3490DF520E028D80089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-iOS-Info.plist"; sourceTree = ""; }; + C3490DF720E028DC0089F309 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-tvOS-Info.plist"; sourceTree = ""; }; + C349DCB2151AAFBF00BFD6A7 /* CPTCalendarFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTCalendarFormatter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C349DCB3151AAFBF00BFD6A7 /* CPTCalendarFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTCalendarFormatter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C34AFE6911021D010041675A /* CPTPlotSymbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTPlotSymbol.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C34AFE6A11021D010041675A /* CPTPlotSymbol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlotSymbol.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C34BF5BA10A67633007F0894 /* CPTPlotArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotArea.h; sourceTree = ""; }; - C34BF5BB10A67633007F0894 /* CPTPlotArea.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlotArea.m; sourceTree = ""; }; - C34F570D19D8CE5500446248 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = CorePlotWarnings.xcconfig; sourceTree = ""; }; + C34BF5BB10A67633007F0894 /* CPTPlotArea.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlotArea.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C34F570D19D8CE5500446248 /* CorePlotWarnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotWarnings.xcconfig; path = xcconfig/CorePlotWarnings.xcconfig; sourceTree = ""; }; + C3564CBD22A2D0E1000A54C9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; C36468A80FE5533F0064B186 /* CPTTextStyleTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTTextStyleTests.h; sourceTree = ""; }; C36468A90FE5533F0064B186 /* CPTTextStyleTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTTextStyleTests.m; sourceTree = ""; }; - C365E19A1973193A0096AAE1 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; C36E89B811EE7F97003DE309 /* CPTPlotRangeTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotRangeTests.h; sourceTree = ""; }; C36E89B911EE7F97003DE309 /* CPTPlotRangeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlotRangeTests.m; sourceTree = ""; }; + C377B3B91C122AA600891DF8 /* CPTCalendarFormatterTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTCalendarFormatterTests.h; sourceTree = ""; }; + C377B3BA1C122AA600891DF8 /* CPTCalendarFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTCalendarFormatterTests.m; sourceTree = ""; }; C3791D07191D4C4C001EC514 /* CPTImagePlatformSpecific.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CPTImagePlatformSpecific.m; path = MacOnly/CPTImagePlatformSpecific.m; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C37A406320E02B9D00C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-tvOSTests-Info.plist"; sourceTree = ""; }; + C37A406520E02BA100C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-CocoaTouchTests-Info.plist"; sourceTree = ""; }; + C37A406720E02BA500C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlot-iOSTests-Info.plist"; sourceTree = ""; }; + C37A406920E02BE900C4FF48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Base; path = "Base.lproj/CorePlotTests-Info.plist"; sourceTree = ""; }; + C37EA6921BC83F2A0091C8F7 /* CorePlot.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C37EA6B71BC83F2D0091C8F7 /* UnitTests tvOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UnitTests tvOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + C38A09781A46185200D45436 /* CorePlot.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CorePlot.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C38A09821A46185300D45436 /* UnitTests iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UnitTests iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + C38A09BA1A4619A900D45436 /* libCorePlot-CocoaTouch.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libCorePlot-CocoaTouch.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + C38A09C41A4619A900D45436 /* CorePlot-CocoaTouchTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "CorePlot-CocoaTouchTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + C38A0A531A461F9700D45436 /* CPTTextStylePlatformSpecific.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTTextStylePlatformSpecific.h; path = iPhoneOnly/CPTTextStylePlatformSpecific.h; sourceTree = SOURCE_ROOT; }; + C38A0A541A461F9700D45436 /* CPTTextStylePlatformSpecific.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CPTTextStylePlatformSpecific.m; path = iPhoneOnly/CPTTextStylePlatformSpecific.m; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C38A0A591A4620B800D45436 /* CPTImagePlatformSpecific.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CPTImagePlatformSpecific.m; path = iPhoneOnly/CPTImagePlatformSpecific.m; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C38A0B181A46264500D45436 /* CPTPlatformSpecificCategories.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlatformSpecificCategories.h; path = iPhoneOnly/CPTPlatformSpecificCategories.h; sourceTree = SOURCE_ROOT; }; + C38A0B191A46264500D45436 /* CPTPlatformSpecificCategories.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CPTPlatformSpecificCategories.m; path = iPhoneOnly/CPTPlatformSpecificCategories.m; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C38A0B1A1A46264500D45436 /* CPTPlatformSpecificDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlatformSpecificDefines.h; path = iPhoneOnly/CPTPlatformSpecificDefines.h; sourceTree = SOURCE_ROOT; }; + C38A0B1B1A46264500D45436 /* CPTPlatformSpecificDefines.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlatformSpecificDefines.m; path = iPhoneOnly/CPTPlatformSpecificDefines.m; sourceTree = SOURCE_ROOT; }; + C38A0B1C1A46264500D45436 /* CPTPlatformSpecificFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTPlatformSpecificFunctions.h; path = iPhoneOnly/CPTPlatformSpecificFunctions.h; sourceTree = SOURCE_ROOT; }; + C38A0B1D1A46264500D45436 /* CPTPlatformSpecificFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CPTPlatformSpecificFunctions.m; path = iPhoneOnly/CPTPlatformSpecificFunctions.m; sourceTree = SOURCE_ROOT; }; + C38A0B271A46265300D45436 /* CPTGraphHostingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPTGraphHostingView.h; path = iPhoneOnly/CPTGraphHostingView.h; sourceTree = SOURCE_ROOT; }; + C38A0B281A46265300D45436 /* CPTGraphHostingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; name = CPTGraphHostingView.m; path = iPhoneOnly/CPTGraphHostingView.m; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C38DD49111A04B7A002A68E7 /* CPTGridLineGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTGridLineGroup.h; sourceTree = ""; }; - C38DD49211A04B7A002A68E7 /* CPTGridLineGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTGridLineGroup.m; sourceTree = ""; }; - C3920AC21395B6500045F3BB /* CPTLegend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTLegend.h; sourceTree = ""; }; - C3920AC31395B6500045F3BB /* CPTLegend.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTLegend.m; sourceTree = ""; }; + C38DD49211A04B7A002A68E7 /* CPTGridLineGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTGridLineGroup.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C3920AC21395B6500045F3BB /* CPTLegend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTLegend.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C3920AC31395B6500045F3BB /* CPTLegend.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTLegend.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C3978E0413CE653B00A420D9 /* NSCoderExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSCoderExtensions.h; sourceTree = ""; }; C3978E0513CE653B00A420D9 /* NSCoderExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSCoderExtensions.m; sourceTree = ""; }; C3A695E3146A19BC00AF5653 /* CPTMutablePlotRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTMutablePlotRange.h; sourceTree = ""; }; C3A695E4146A19BC00AF5653 /* CPTMutablePlotRange.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTMutablePlotRange.m; sourceTree = ""; }; C3AFC9CF0FB62969005DFFDC /* CPTImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTImage.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; - C3AFC9D00FB62969005DFFDC /* CPTImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTImage.m; sourceTree = ""; }; + C3AFC9D00FB62969005DFFDC /* CPTImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTImage.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C3B235631009931400970270 /* doxygen-cocoa-tags.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; name = "doxygen-cocoa-tags.xml"; path = "../documentation/doxygen/doxygen-cocoa-tags.xml"; sourceTree = ""; }; C3B25EDF1AC23A7D0063CCD8 /* CorePlot.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CorePlot.h; sourceTree = ""; }; + C3BB3C8C1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTAnimationNSNumberPeriod.h; sourceTree = ""; }; + C3BB3C8D1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTAnimationNSNumberPeriod.m; sourceTree = ""; }; C3BB7D1416322F7E00BC9515 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; + C3BB93181B729BD200004527 /* CPTDebugQuickLook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTDebugQuickLook.h; sourceTree = ""; }; C3C032C710B8DEDC003A11B6 /* CPTAxisLabelGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTAxisLabelGroup.h; sourceTree = ""; }; - C3C032C810B8DEDC003A11B6 /* CPTAxisLabelGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTAxisLabelGroup.m; sourceTree = ""; }; - C3C1C07E1790D3B400E8B1B7 /* CPTLayerTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTLayerTests.h; sourceTree = ""; }; - C3C1C07F1790D3B400E8B1B7 /* CPTLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTLayerTests.m; sourceTree = ""; }; - C3C2846F16584EB9006BA43C /* CPTAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTAnimation.h; sourceTree = ""; }; - C3C2847016584EB9006BA43C /* CPTAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTAnimation.m; sourceTree = ""; }; + C3C032C810B8DEDC003A11B6 /* CPTAxisLabelGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTAxisLabelGroup.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C3C1C07E1790D3B400E8B1B7 /* CPTLayerTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTLayerTests.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C3C1C07F1790D3B400E8B1B7 /* CPTLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTLayerTests.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C3C2846F16584EB9006BA43C /* CPTAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTAnimation.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C3C2847016584EB9006BA43C /* CPTAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTAnimation.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C3C2847316585085006BA43C /* _CPTAnimationTimingFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTAnimationTimingFunctions.h; sourceTree = ""; }; C3C2847416585085006BA43C /* _CPTAnimationTimingFunctions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTAnimationTimingFunctions.m; sourceTree = ""; }; - C3C9CB0C165DB4D500739006 /* CPTAnimationOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTAnimationOperation.h; sourceTree = ""; }; - C3C9CB0D165DB4D500739006 /* CPTAnimationOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTAnimationOperation.m; sourceTree = ""; }; - C3C9CB11165DB50300739006 /* CPTAnimationPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTAnimationPeriod.h; sourceTree = ""; }; + C3C9CB0C165DB4D500739006 /* CPTAnimationOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTAnimationOperation.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C3C9CB0D165DB4D500739006 /* CPTAnimationOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTAnimationOperation.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C3C9CB11165DB50300739006 /* CPTAnimationPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTAnimationPeriod.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; C3C9CB12165DB50300739006 /* CPTAnimationPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTAnimationPeriod.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C3C9CB15165DB52C00739006 /* _CPTAnimationCGFloatPeriod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTAnimationCGFloatPeriod.h; sourceTree = ""; }; C3C9CB16165DB52C00739006 /* _CPTAnimationCGFloatPeriod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTAnimationCGFloatPeriod.m; sourceTree = ""; }; + C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotDebug.xcconfig; path = xcconfig/CorePlotDebug.xcconfig; sourceTree = ""; }; + C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = CorePlotRelease.xcconfig; path = xcconfig/CorePlotRelease.xcconfig; sourceTree = ""; }; C3CADDC511B167AD00D36017 /* CPTMutableNumericDataTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTMutableNumericDataTests.h; sourceTree = ""; }; C3CADDC611B167AD00D36017 /* CPTMutableNumericDataTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTMutableNumericDataTests.m; sourceTree = ""; }; C3CAFB241229E41F00F5C989 /* CPTMutableNumericData+TypeConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CPTMutableNumericData+TypeConversion.h"; sourceTree = ""; }; C3CAFB251229E41F00F5C989 /* CPTMutableNumericData+TypeConversion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CPTMutableNumericData+TypeConversion.m"; sourceTree = ""; }; C3CB561A122A9E9F00FBFB61 /* CPTMutableNumericDataTypeConversionTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTMutableNumericDataTypeConversionTests.h; sourceTree = ""; }; C3CB561B122A9E9F00FBFB61 /* CPTMutableNumericDataTypeConversionTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTMutableNumericDataTypeConversionTests.m; sourceTree = ""; }; - C3CCA03913E8D85800CE6DB1 /* _CPTConstraintsFixed.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTConstraintsFixed.h; sourceTree = ""; }; - C3CCA03A13E8D85800CE6DB1 /* _CPTConstraintsFixed.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTConstraintsFixed.m; sourceTree = ""; }; - C3CCA03B13E8D85800CE6DB1 /* _CPTConstraintsRelative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTConstraintsRelative.h; sourceTree = ""; }; - C3CCA03C13E8D85800CE6DB1 /* _CPTConstraintsRelative.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTConstraintsRelative.m; sourceTree = ""; }; - C3D3AD2B13DF8DCE0004EA73 /* CPTLineCap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTLineCap.h; sourceTree = ""; }; - C3D3AD2C13DF8DCE0004EA73 /* CPTLineCap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTLineCap.m; sourceTree = ""; }; + C3CCA03913E8D85800CE6DB1 /* _CPTConstraintsFixed.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = _CPTConstraintsFixed.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C3CCA03A13E8D85800CE6DB1 /* _CPTConstraintsFixed.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = _CPTConstraintsFixed.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C3CCA03B13E8D85800CE6DB1 /* _CPTConstraintsRelative.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = _CPTConstraintsRelative.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C3CCA03C13E8D85800CE6DB1 /* _CPTConstraintsRelative.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = _CPTConstraintsRelative.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + C3D3AD2B13DF8DCE0004EA73 /* CPTLineCap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTLineCap.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C3D3AD2C13DF8DCE0004EA73 /* CPTLineCap.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTLineCap.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C3D68B83122201A700EB4863 /* CPTNumericDataTypeConversionPerformanceTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTNumericDataTypeConversionPerformanceTests.h; sourceTree = ""; }; C3D68B84122201A700EB4863 /* CPTNumericDataTypeConversionPerformanceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTNumericDataTypeConversionPerformanceTests.m; sourceTree = ""; }; C3D979A213D2136600145DFF /* CPTPlotSpaceTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotSpaceTests.h; sourceTree = ""; }; @@ -504,14 +1180,15 @@ C3D979B713D2344000145DFF /* CPTLineStyleTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTLineStyleTests.m; sourceTree = ""; }; C3D979B913D2347300145DFF /* CPTFillTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTFillTests.h; sourceTree = ""; }; C3D979BA13D2347300145DFF /* CPTFillTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTFillTests.m; sourceTree = ""; }; - C3DA34CA107AD7710051DA02 /* _CPTXYTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = _CPTXYTheme.m; sourceTree = ""; }; + C3DA34CA107AD7710051DA02 /* _CPTXYTheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = _CPTXYTheme.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C3DA34CB107AD7710051DA02 /* _CPTXYTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _CPTXYTheme.h; sourceTree = ""; }; - C3F31DE71045EB470058520A /* CPTPlotGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTPlotGroup.m; sourceTree = ""; }; + C3EE4E971A6C1E890098F4E6 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; + C3F31DE71045EB470058520A /* CPTPlotGroup.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTPlotGroup.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C3F31DE81045EB470058520A /* CPTPlotGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTPlotGroup.h; sourceTree = ""; }; - C3F97F1C17A9E07B00A52FF2 /* CPTFunctionDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTFunctionDataSource.h; sourceTree = ""; }; - C3F97F1D17A9E07B00A52FF2 /* CPTFunctionDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTFunctionDataSource.m; sourceTree = ""; }; + C3F97F1C17A9E07B00A52FF2 /* CPTFunctionDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CPTFunctionDataSource.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; + C3F97F1D17A9E07B00A52FF2 /* CPTFunctionDataSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTFunctionDataSource.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; C3FF6EF00FFFA51D00AF0496 /* mainpage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mainpage.h; path = Source/mainpage.h; sourceTree = ""; }; - D0C0477B12D6560900DA8047 /* CPTRangePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTRangePlot.m; sourceTree = ""; }; + D0C0477B12D6560900DA8047 /* CPTRangePlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CPTRangePlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; D0C0477C12D6560900DA8047 /* CPTRangePlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTRangePlot.h; sourceTree = ""; }; E1620CBC100F03A100A84E77 /* CPTThemeTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CPTThemeTests.h; sourceTree = ""; }; E1620CBD100F03A100A84E77 /* CPTThemeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CPTThemeTests.m; sourceTree = ""; }; @@ -526,8 +1203,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C365E19B1973193A0096AAE1 /* XCTest.framework in Frameworks */, + C3EE4E9B1A6C1F8A0098F4E6 /* Cocoa.framework in Frameworks */, 0730F67C1094995000E95162 /* CorePlot.framework in Frameworks */, + C3EE4E9A1A6C1F770098F4E6 /* QuartzCore.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -535,9 +1213,67 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */, - 07BF0D660F2B70B8002FCEA7 /* QuartzCore.framework in Frameworks */, - C3BB7D281633408200BC9515 /* Accelerate.framework in Frameworks */, + C3EE4E981A6C1E890098F4E6 /* Cocoa.framework in Frameworks */, + C3EE4E6E1A6C15890098F4E6 /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C37EA6291BC83F2A0091C8F7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C37EA62B1BC83F2A0091C8F7 /* CoreGraphics.framework in Frameworks */, + C37EA62C1BC83F2A0091C8F7 /* QuartzCore.framework in Frameworks */, + C37EA62D1BC83F2A0091C8F7 /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C37EA6B01BC83F2D0091C8F7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C37EA6B11BC83F2D0091C8F7 /* CoreGraphics.framework in Frameworks */, + C3B4D4971BC9983300450C37 /* CorePlot.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C38A09741A46185200D45436 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C3226A5F1A69F75400F77249 /* CoreGraphics.framework in Frameworks */, + C3226A5E1A69F73800F77249 /* QuartzCore.framework in Frameworks */, + C3226A5C1A69F72900F77249 /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C38A097F1A46185300D45436 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C370D5971A753F1C00AF4312 /* CoreGraphics.framework in Frameworks */, + C38A09831A46185300D45436 /* CorePlot.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C38A09B71A4619A900D45436 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C3226A581A69F6FA00F77249 /* CoreGraphics.framework in Frameworks */, + C3226A521A69F6DA00F77249 /* QuartzCore.framework in Frameworks */, + C3226A541A69F6DF00F77249 /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C38A09C11A4619A900D45436 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C3EE4E6A1A6C134B0098F4E6 /* CoreGraphics.framework in Frameworks */, + C3EE4E691A6C133D0098F4E6 /* QuartzCore.framework in Frameworks */, + C3EE4E6B1A6C13560098F4E6 /* UIKit.framework in Frameworks */, + C38A09C51A4619A900D45436 /* libCorePlot-CocoaTouch.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -549,6 +1285,12 @@ children = ( 8DC2EF5B0486A6940098B216 /* CorePlot.framework */, 0730F600109492D800E95162 /* UnitTests.xctest */, + C38A09781A46185200D45436 /* CorePlot.framework */, + C38A09821A46185300D45436 /* UnitTests iOS.xctest */, + C38A09BA1A4619A900D45436 /* libCorePlot-CocoaTouch.a */, + C38A09C41A4619A900D45436 /* CorePlot-CocoaTouchTests.xctest */, + C37EA6921BC83F2A0091C8F7 /* CorePlot.framework */, + C37EA6B71BC83F2D0091C8F7 /* UnitTests tvOS.xctest */, ); name = Products; sourceTree = ""; @@ -604,6 +1346,7 @@ 07C467990FE1A24C00299939 /* CPTMutableTextStyle.h */, 07C4679A0FE1A24C00299939 /* CPTMutableTextStyle.m */, C3A959D210116FE100BF9739 /* Mac Specific */, + C38A0A521A461F5D00D45436 /* iOS Specific */, 4CC9A36C0FD98AB200CFBE5E /* Tests */, ); name = Text; @@ -812,6 +1555,7 @@ C3A695E4146A19BC00AF5653 /* CPTMutablePlotRange.m */, C3F97F1C17A9E07B00A52FF2 /* CPTFunctionDataSource.h */, C3F97F1D17A9E07B00A52FF2 /* CPTFunctionDataSource.m */, + C3BB93181B729BD200004527 /* CPTDebugQuickLook.h */, 076A775F0FBF0BFE003F6D97 /* Tests */, ); name = "Types and Functions"; @@ -847,7 +1591,7 @@ 4C99408D0F45F71100DC824F /* Testing */, 07BF0D600F2B6FE1002FCEA7 /* Source */, 07BF0D5F0F2B6FE1002FCEA7 /* Mac Specific */, - 4C32D37A0F43B3B400EDFE7A /* Test Host */, + C38A0AA61A4621BC00D45436 /* iOS Specific */, 9021E4920FC5C6DD00443472 /* Documentation */, C3B25EDE1AC23A7D0063CCD8 /* CocoaPods */, 32C88DFF0371C24200C91783 /* Other Sources */, @@ -864,8 +1608,8 @@ 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = { isa = PBXGroup; children = ( - 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */, - 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */, + 1058C7B0FEA5585E11CA2CBB /* Mac */, + C39588531A6B2F6B009F9297 /* iOS */, ); name = "External Frameworks and Libraries"; sourceTree = ""; @@ -874,31 +1618,23 @@ isa = PBXGroup; children = ( 071F3CB810FBAB5900D0A7B6 /* License.txt */, - 0730F601109492D800E95162 /* UnitTests-Info.plist */, - 8DC2EF5A0486A6940098B216 /* Info.plist */, + C3490DF220E028CF0089F309 /* CorePlot-Info.plist */, + C3490DF420E028D30089F309 /* CorePlot-CocoaTouch-Info.plist */, + C3490DF620E028D80089F309 /* CorePlot-iOS-Info.plist */, + C3490DF820E028DC0089F309 /* CorePlot-tvOS-Info.plist */, 089C1666FE841158C02AAC07 /* InfoPlist.strings */, ); name = Resources; sourceTree = ""; }; - 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = { + 1058C7B0FEA5585E11CA2CBB /* Mac */ = { isa = PBXGroup; children = ( - 07BF0D630F2B70B8002FCEA7 /* QuartzCore.framework */, - 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */, C3BB7D1416322F7E00BC9515 /* Accelerate.framework */, - C365E19A1973193A0096AAE1 /* XCTest.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 0867D6A5FE840307C02AAC07 /* AppKit.framework */, - 0867D69BFE84028FC02AAC07 /* Foundation.framework */, + C3EE4E971A6C1E890098F4E6 /* Cocoa.framework */, + 07BF0D630F2B70B8002FCEA7 /* QuartzCore.framework */, ); - name = "Other Frameworks"; + name = Mac; sourceTree = ""; }; 32C88DFF0371C24200C91783 /* Other Sources */ = { @@ -906,21 +1642,15 @@ children = ( 32DBCF5E0370ADEE00C91783 /* CorePlot_Prefix.pch */, 070CF7AE0F3CA7AB0001FFF4 /* CorePlot.h */, + C3226A471A69EE9200F77249 /* CorePlot-CocoaTouch.h */, + C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */, + C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */, C31908A41998168C00B61898 /* CorePlot.xcconfig */, C34F570D19D8CE5500446248 /* CorePlotWarnings.xcconfig */, ); name = "Other Sources"; sourceTree = ""; }; - 4C32D37A0F43B3B400EDFE7A /* Test Host */ = { - isa = PBXGroup; - children = ( - 4C32D37C0F43B3CD00EDFE7A /* main.m */, - 4C993CEA0F45E78000DC824F /* Resources */, - ); - name = "Test Host"; - sourceTree = ""; - }; 4C7D0FB60FD5DDDA00D83C0F /* Tests */ = { isa = PBXGroup; children = ( @@ -967,22 +1697,14 @@ name = Tests; sourceTree = ""; }; - 4C993CEA0F45E78000DC824F /* Resources */ = { - isa = PBXGroup; - children = ( - 4C993FF30F45EE2F00DC824F /* MainMenu.xib */, - ); - name = Resources; - sourceTree = ""; - }; 4C99408D0F45F71100DC824F /* Testing */ = { isa = PBXGroup; children = ( + C3226A4B1A69F02900F77249 /* Resources */, 0730F64C109494D100E95162 /* CPTTestCase.h */, 0730F64D109494D100E95162 /* CPTTestCase.m */, 4C9A745D0FB24C7200918464 /* CPTDataSourceTestCase.h */, 4C9A745E0FB24C7200918464 /* CPTDataSourceTestCase.m */, - BC89A64010239D1D009D5261 /* CorePlotProbes.d */, ); name = Testing; path = Source; @@ -1001,8 +1723,10 @@ isa = PBXGroup; children = ( 9021E5690FC69B2900443472 /* doxygen.config */, + C3226A451A69ED0900F77249 /* doxygen touch.config */, C3FF6EF00FFFA51D00AF0496 /* mainpage.h */, C3B235631009931400970270 /* doxygen-cocoa-tags.xml */, + C3226A461A69ED1F00F77249 /* doxygen-cocoa-touch-tags.xml */, C30E979F14B290520012204A /* DoxygenLayout.xml */, ); name = Documentation; @@ -1033,11 +1757,23 @@ C32EE1C013EC4BE700038266 /* CPTMutableShadow.m */, 0704A2100FB56B9400A09979 /* Fills */, C32DDEE2191C672700E0FE84 /* Mac Specific */, + C38A0A581A4620A700D45436 /* iOS Specific */, C3D979A613D215AD00145DFF /* Tests */, ); name = Drawing; sourceTree = ""; }; + C3226A4B1A69F02900F77249 /* Resources */ = { + isa = PBXGroup; + children = ( + C37A406A20E02BE900C4FF48 /* CorePlotTests-Info.plist */, + C37A406820E02BA500C4FF48 /* CorePlot-iOSTests-Info.plist */, + C37A406620E02BA100C4FF48 /* CorePlot-CocoaTouchTests-Info.plist */, + C37A406420E02B9D00C4FF48 /* CorePlot-tvOSTests-Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; C32B391C10AA4D1E000470D4 /* XY Axes */ = { isa = PBXGroup; children = ( @@ -1086,6 +1822,39 @@ name = "Plot Symbols"; sourceTree = ""; }; + C38A0A521A461F5D00D45436 /* iOS Specific */ = { + isa = PBXGroup; + children = ( + C38A0A531A461F9700D45436 /* CPTTextStylePlatformSpecific.h */, + C38A0A541A461F9700D45436 /* CPTTextStylePlatformSpecific.m */, + ); + name = "iOS Specific"; + sourceTree = ""; + }; + C38A0A581A4620A700D45436 /* iOS Specific */ = { + isa = PBXGroup; + children = ( + C38A0A591A4620B800D45436 /* CPTImagePlatformSpecific.m */, + ); + name = "iOS Specific"; + sourceTree = ""; + }; + C38A0AA61A4621BC00D45436 /* iOS Specific */ = { + isa = PBXGroup; + children = ( + C38A0B1A1A46264500D45436 /* CPTPlatformSpecificDefines.h */, + C38A0B1B1A46264500D45436 /* CPTPlatformSpecificDefines.m */, + C38A0B181A46264500D45436 /* CPTPlatformSpecificCategories.h */, + C38A0B191A46264500D45436 /* CPTPlatformSpecificCategories.m */, + C38A0B1C1A46264500D45436 /* CPTPlatformSpecificFunctions.h */, + C38A0B1D1A46264500D45436 /* CPTPlatformSpecificFunctions.m */, + C38A0B271A46265300D45436 /* CPTGraphHostingView.h */, + C38A0B281A46265300D45436 /* CPTGraphHostingView.m */, + ); + name = "iOS Specific"; + path = Source; + sourceTree = ""; + }; C3920AC11395B6170045F3BB /* Legends */ = { isa = PBXGroup; children = ( @@ -1097,6 +1866,17 @@ name = Legends; sourceTree = ""; }; + C39588531A6B2F6B009F9297 /* iOS */ = { + isa = PBXGroup; + children = ( + C3226A551A69F6F000F77249 /* Accelerate.framework */, + C3226A571A69F6FA00F77249 /* CoreGraphics.framework */, + C3226A511A69F6DA00F77249 /* QuartzCore.framework */, + C3226A531A69F6DF00F77249 /* UIKit.framework */, + ); + name = iOS; + sourceTree = ""; + }; C3A959D210116FE100BF9739 /* Mac Specific */ = { isa = PBXGroup; children = ( @@ -1155,6 +1935,8 @@ A92C0C3DB583ED8FC2EFD9DB /* _CPTAnimationCGRectPeriod.m */, A92C0685ACE3281299F10F73 /* _CPTAnimationNSDecimalPeriod.h */, A92C00B71DCB2085A92BE0A9 /* _CPTAnimationNSDecimalPeriod.m */, + C3BB3C8C1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h */, + C3BB3C8D1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m */, A92C0E16290C226BC4BE3936 /* _CPTAnimationPlotRangePeriod.h */, A92C091B8592D9F32AC384CB /* _CPTAnimationPlotRangePeriod.m */, C3C2847316585085006BA43C /* _CPTAnimationTimingFunctions.h */, @@ -1166,6 +1948,8 @@ C3D979A513D2159400145DFF /* Tests */ = { isa = PBXGroup; children = ( + C377B3B91C122AA600891DF8 /* CPTCalendarFormatterTests.h */, + C377B3BA1C122AA600891DF8 /* CPTCalendarFormatterTests.m */, C3D979A713D2328000145DFF /* CPTTimeFormatterTests.h */, C3D979A813D2328000145DFF /* CPTTimeFormatterTests.m */, ); @@ -1252,12 +2036,14 @@ 070622320FDF1B250066A6C4 /* CPTPathExtensions.h in Headers */, 0706223C0FDF215C0066A6C4 /* CPTBorderedLayer.h in Headers */, 07C4679B0FE1A24C00299939 /* CPTMutableTextStyle.h in Headers */, + C3BB93191B729BD200004527 /* CPTDebugQuickLook.h in Headers */, 07C467B80FE1A96E00299939 /* CPTTextStylePlatformSpecific.h in Headers */, 0772C9270FE2F71600EC4C16 /* CPTTheme.h in Headers */, 0772C92F0FE2F89000EC4C16 /* _CPTDarkGradientTheme.h in Headers */, BC55023210059F22005DF982 /* _CPTPlainBlackTheme.h in Headers */, BC55023410059F22005DF982 /* _CPTPlainWhiteTheme.h in Headers */, BC55023610059F22005DF982 /* _CPTStocksTheme.h in Headers */, + C3BB3C8E1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h in Headers */, 07A2E6FC102DF47900809BC5 /* CPTTimeFormatter.h in Headers */, 4C97EEFE104D80C400B554F9 /* CPTNumericData+TypeConversion.h in Headers */, 4C97EF01104D80C400B554F9 /* CPTNumericData.h in Headers */, @@ -1309,31 +2095,236 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C37EA62E1BC83F2A0091C8F7 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C37EA62F1BC83F2A0091C8F7 /* CPTLimitBand.h in Headers */, + C37EA6301BC83F2A0091C8F7 /* CPTDefinitions.h in Headers */, + C37EA6311BC83F2A0091C8F7 /* CPTPlotSymbol.h in Headers */, + C37EA6321BC83F2A0091C8F7 /* CPTTradingRangePlot.h in Headers */, + C37EA6331BC83F2A0091C8F7 /* CPTGraph.h in Headers */, + C37EA6341BC83F2A0091C8F7 /* CPTGridLines.h in Headers */, + C3BB3C901C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h in Headers */, + C37EA6351BC83F2A0091C8F7 /* CPTTextStyle.h in Headers */, + C37EA6361BC83F2A0091C8F7 /* CPTMutablePlotRange.h in Headers */, + C37EA6371BC83F2A0091C8F7 /* CPTPieChart.h in Headers */, + C37EA6381BC83F2A0091C8F7 /* CPTMutableNumericData+TypeConversion.h in Headers */, + C37EA6391BC83F2A0091C8F7 /* CPTAxisLabelGroup.h in Headers */, + C37EA63A1BC83F2A0091C8F7 /* CPTPlotSpace.h in Headers */, + C37EA63B1BC83F2A0091C8F7 /* CPTGraphHostingView.h in Headers */, + C37EA63C1BC83F2A0091C8F7 /* CPTColorSpace.h in Headers */, + C37EA63D1BC83F2A0091C8F7 /* CPTXYPlotSpace.h in Headers */, + C37EA63E1BC83F2A0091C8F7 /* CPTLineStyle.h in Headers */, + C37EA63F1BC83F2A0091C8F7 /* CPTPathExtensions.h in Headers */, + C37EA6401BC83F2A0091C8F7 /* _CPTBorderLayer.h in Headers */, + C37EA6411BC83F2A0091C8F7 /* CPTNumericData.h in Headers */, + C37EA6421BC83F2A0091C8F7 /* CPTLineCap.h in Headers */, + C37EA6431BC83F2A0091C8F7 /* _CPTFillGradient.h in Headers */, + C37EA6441BC83F2A0091C8F7 /* CPTNumericDataType.h in Headers */, + C37EA6451BC83F2A0091C8F7 /* CPTAnimationPeriod.h in Headers */, + C37EA6461BC83F2A0091C8F7 /* _CPTPlainWhiteTheme.h in Headers */, + C37EA6471BC83F2A0091C8F7 /* CPTBorderedLayer.h in Headers */, + C37EA6481BC83F2A0091C8F7 /* CPTAxisSet.h in Headers */, + C37EA6491BC83F2A0091C8F7 /* CPTScatterPlot.h in Headers */, + C37EA64A1BC83F2A0091C8F7 /* CPTMutableShadow.h in Headers */, + C37EA64B1BC83F2A0091C8F7 /* _CPTPlainBlackTheme.h in Headers */, + C37EA64C1BC83F2A0091C8F7 /* _CPTAnimationNSDecimalPeriod.h in Headers */, + C37EA64D1BC83F2A0091C8F7 /* CPTCalendarFormatter.h in Headers */, + C37EA64E1BC83F2A0091C8F7 /* CPTTextLayer.h in Headers */, + C37EA64F1BC83F2A0091C8F7 /* CPTResponder.h in Headers */, + C37EA6501BC83F2A0091C8F7 /* CPTLayer.h in Headers */, + C37EA6511BC83F2A0091C8F7 /* CPTPlotAreaFrame.h in Headers */, + C37EA6521BC83F2A0091C8F7 /* CPTXYAxis.h in Headers */, + C37EA6531BC83F2A0091C8F7 /* _CPTStocksTheme.h in Headers */, + C37EA6541BC83F2A0091C8F7 /* CPTImage.h in Headers */, + C37EA6551BC83F2A0091C8F7 /* CPTTheme.h in Headers */, + C37EA6561BC83F2A0091C8F7 /* CPTPlatformSpecificCategories.h in Headers */, + C37EA6571BC83F2A0091C8F7 /* NSNumberExtensions.h in Headers */, + C37EA6581BC83F2A0091C8F7 /* _CPTConstraintsRelative.h in Headers */, + C37EA6591BC83F2A0091C8F7 /* CPTAnimationOperation.h in Headers */, + C37EA65A1BC83F2A0091C8F7 /* _CPTDarkGradientTheme.h in Headers */, + C37EA65B1BC83F2A0091C8F7 /* CPTRangePlot.h in Headers */, + C37EA65C1BC83F2A0091C8F7 /* _CPTAnimationCGSizePeriod.h in Headers */, + C37EA65D1BC83F2A0091C8F7 /* CPTPlotGroup.h in Headers */, + C37EA65E1BC83F2A0091C8F7 /* CPTLegend.h in Headers */, + C37EA65F1BC83F2A0091C8F7 /* _CPTFillImage.h in Headers */, + C37EA6601BC83F2A0091C8F7 /* _CPTAnimationCGRectPeriod.h in Headers */, + C37EA6611BC83F2A0091C8F7 /* CPTPlotSpaceAnnotation.h in Headers */, + C37EA6621BC83F2A0091C8F7 /* CPTConstraints.h in Headers */, + C37EA6631BC83F2A0091C8F7 /* NSCoderExtensions.h in Headers */, + C37EA6641BC83F2A0091C8F7 /* CPTNumericData+TypeConversion.h in Headers */, + C37EA6651BC83F2A0091C8F7 /* _CPTFillColor.h in Headers */, + C37EA6661BC83F2A0091C8F7 /* _CPTXYTheme.h in Headers */, + C37EA6671BC83F2A0091C8F7 /* CPTLayerAnnotation.h in Headers */, + C37EA6681BC83F2A0091C8F7 /* _CPTAnimationCGFloatPeriod.h in Headers */, + C37EA6691BC83F2A0091C8F7 /* CPTAxisTitle.h in Headers */, + C37EA66A1BC83F2A0091C8F7 /* _CPTSlateTheme.h in Headers */, + C37EA66B1BC83F2A0091C8F7 /* CPTMutableNumericData.h in Headers */, + C37EA66C1BC83F2A0091C8F7 /* CPTGridLineGroup.h in Headers */, + C37EA66D1BC83F2A0091C8F7 /* CorePlot.h in Headers */, + C37EA66E1BC83F2A0091C8F7 /* CPTMutableLineStyle.h in Headers */, + C37EA66F1BC83F2A0091C8F7 /* CPTAnimation.h in Headers */, + C37EA6701BC83F2A0091C8F7 /* CPTExceptions.h in Headers */, + C37EA6711BC83F2A0091C8F7 /* CPTPlot.h in Headers */, + C37EA6721BC83F2A0091C8F7 /* CPTShadow.h in Headers */, + C37EA6731BC83F2A0091C8F7 /* CPTAnnotation.h in Headers */, + C37EA6741BC83F2A0091C8F7 /* CPTColor.h in Headers */, + C37EA6751BC83F2A0091C8F7 /* CPTTextStylePlatformSpecific.h in Headers */, + C37EA6761BC83F2A0091C8F7 /* CPTFill.h in Headers */, + C37EA6771BC83F2A0091C8F7 /* CPTPlotRange.h in Headers */, + C37EA6781BC83F2A0091C8F7 /* CPTXYAxisSet.h in Headers */, + C37EA6791BC83F2A0091C8F7 /* CPTTimeFormatter.h in Headers */, + C37EA67A1BC83F2A0091C8F7 /* CPTLegendEntry.h in Headers */, + C37EA67B1BC83F2A0091C8F7 /* CPTPlotArea.h in Headers */, + C37EA67C1BC83F2A0091C8F7 /* _CPTMaskLayer.h in Headers */, + C37EA67D1BC83F2A0091C8F7 /* _CPTAnimationPlotRangePeriod.h in Headers */, + C37EA67E1BC83F2A0091C8F7 /* CPTFunctionDataSource.h in Headers */, + C37EA67F1BC83F2A0091C8F7 /* CPTGradient.h in Headers */, + C37EA6801BC83F2A0091C8F7 /* _CPTAnimationCGPointPeriod.h in Headers */, + C37EA6811BC83F2A0091C8F7 /* NSDecimalNumberExtensions.h in Headers */, + C37EA6821BC83F2A0091C8F7 /* CPTAxis.h in Headers */, + C37EA6831BC83F2A0091C8F7 /* CPTPlatformSpecificFunctions.h in Headers */, + C37EA6841BC83F2A0091C8F7 /* CPTAnnotationHostLayer.h in Headers */, + C37EA6851BC83F2A0091C8F7 /* CPTAxisLabel.h in Headers */, + C37EA6861BC83F2A0091C8F7 /* CPTDebugQuickLook.h in Headers */, + C37EA6871BC83F2A0091C8F7 /* _CPTAnimationTimingFunctions.h in Headers */, + C37EA6881BC83F2A0091C8F7 /* CPTMutableTextStyle.h in Headers */, + C37EA6891BC83F2A0091C8F7 /* CPTXYGraph.h in Headers */, + C37EA68A1BC83F2A0091C8F7 /* CPTPlatformSpecificDefines.h in Headers */, + C37EA68B1BC83F2A0091C8F7 /* CPTBarPlot.h in Headers */, + C37EA68C1BC83F2A0091C8F7 /* CPTUtilities.h in Headers */, + C37EA68D1BC83F2A0091C8F7 /* _CPTConstraintsFixed.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C38A09751A46185200D45436 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C38A0AAF1A46241100D45436 /* CPTLimitBand.h in Headers */, + C38A09EF1A461CD000D45436 /* CPTDefinitions.h in Headers */, + C38A0AD51A46256B00D45436 /* CPTPlotSymbol.h in Headers */, + C38A0AC61A46255C00D45436 /* CPTTradingRangePlot.h in Headers */, + C38A0AA71A46240300D45436 /* CPTGraph.h in Headers */, + C38A0ADA1A4625B100D45436 /* CPTGridLines.h in Headers */, + C3BB3C8F1C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.h in Headers */, + C38A0A4A1A461F1500D45436 /* CPTTextStyle.h in Headers */, + C38A09FB1A461D0F00D45436 /* CPTMutablePlotRange.h in Headers */, + C38A0AC31A46255C00D45436 /* CPTPieChart.h in Headers */, + C3D4147B1A7D82AB00B6F5D6 /* CPTMutableNumericData+TypeConversion.h in Headers */, + C38A0ADC1A4625C100D45436 /* CPTAxisLabelGroup.h in Headers */, + C38A0AB61A4624C200D45436 /* CPTPlotSpace.h in Headers */, + C38A0B291A46265300D45436 /* CPTGraphHostingView.h in Headers */, + C38A0A5D1A4620D400D45436 /* CPTColorSpace.h in Headers */, + C38A0AB71A4624C200D45436 /* CPTXYPlotSpace.h in Headers */, + C38A0A611A4620D400D45436 /* CPTLineStyle.h in Headers */, + C38A0A631A4620D400D45436 /* CPTPathExtensions.h in Headers */, + C38A0A0B1A461D5100D45436 /* _CPTBorderLayer.h in Headers */, + C3D414791A7D829D00B6F5D6 /* CPTNumericData.h in Headers */, + C38A0A601A4620D400D45436 /* CPTLineCap.h in Headers */, + C38A0A7C1A4620EF00D45436 /* _CPTFillGradient.h in Headers */, + C38A09D81A461C5800D45436 /* CPTNumericDataType.h in Headers */, + C38A0A1A1A461E6400D45436 /* CPTAnimationPeriod.h in Headers */, + C38A0B011A46260B00D45436 /* _CPTPlainWhiteTheme.h in Headers */, + C38A0A081A461D4800D45436 /* CPTBorderedLayer.h in Headers */, + C38A0AF21A4625E800D45436 /* CPTAxisSet.h in Headers */, + C38A0AC51A46255C00D45436 /* CPTScatterPlot.h in Headers */, + C38A0A651A4620D400D45436 /* CPTMutableShadow.h in Headers */, + C38A0B001A46260B00D45436 /* _CPTPlainBlackTheme.h in Headers */, + C38A0A291A461EA300D45436 /* _CPTAnimationNSDecimalPeriod.h in Headers */, + C38A0A951A46218B00D45436 /* CPTCalendarFormatter.h in Headers */, + C38A0A471A461F0C00D45436 /* CPTTextLayer.h in Headers */, + C38A0A111A461D6300D45436 /* CPTResponder.h in Headers */, + C38A0A051A461D3F00D45436 /* CPTLayer.h in Headers */, + C38A0AAD1A46241100D45436 /* CPTPlotAreaFrame.h in Headers */, + C38A0AF51A4625E800D45436 /* CPTXYAxis.h in Headers */, + C38A0B031A46260B00D45436 /* _CPTStocksTheme.h in Headers */, + C38A0A5F1A4620D400D45436 /* CPTImage.h in Headers */, + C38A0AFD1A46260300D45436 /* CPTTheme.h in Headers */, + C38A0B1E1A46264500D45436 /* CPTPlatformSpecificCategories.h in Headers */, + C38A0A9F1A4621A500D45436 /* NSNumberExtensions.h in Headers */, + C38A0A441A461EFA00D45436 /* _CPTConstraintsRelative.h in Headers */, + C38A0A171A461E5B00D45436 /* CPTAnimationOperation.h in Headers */, + C38A0AFF1A46260B00D45436 /* _CPTDarkGradientTheme.h in Headers */, + C38A0AC41A46255C00D45436 /* CPTRangePlot.h in Headers */, + C38A0A231A461E8F00D45436 /* _CPTAnimationCGSizePeriod.h in Headers */, + C38A0AC01A46254E00D45436 /* CPTPlotGroup.h in Headers */, + C38A0AF71A4625F500D45436 /* CPTLegend.h in Headers */, + C38A0A7D1A4620EF00D45436 /* _CPTFillImage.h in Headers */, + C38A0A261A461E9600D45436 /* _CPTAnimationCGRectPeriod.h in Headers */, + C38A0A351A461EC800D45436 /* CPTPlotSpaceAnnotation.h in Headers */, + C38A0A3E1A461EE600D45436 /* CPTConstraints.h in Headers */, + C38A0A9D1A4621A500D45436 /* NSCoderExtensions.h in Headers */, + C3D4147A1A7D82A500B6F5D6 /* CPTNumericData+TypeConversion.h in Headers */, + C38A0A7B1A4620EF00D45436 /* _CPTFillColor.h in Headers */, + C38A0AFE1A46260B00D45436 /* _CPTXYTheme.h in Headers */, + C38A0A381A461ED000D45436 /* CPTLayerAnnotation.h in Headers */, + C38A0A1D1A461E6E00D45436 /* _CPTAnimationCGFloatPeriod.h in Headers */, + C38A0AF41A4625E800D45436 /* CPTAxisTitle.h in Headers */, + C38A0B021A46260B00D45436 /* _CPTSlateTheme.h in Headers */, + C3D414781A7D829100B6F5D6 /* CPTMutableNumericData.h in Headers */, + C38A0ADB1A4625B100D45436 /* CPTGridLineGroup.h in Headers */, + C3D414E01A7D867200B6F5D6 /* CorePlot.h in Headers */, + C38A0A621A4620D400D45436 /* CPTMutableLineStyle.h in Headers */, + C38A0A141A461E5000D45436 /* CPTAnimation.h in Headers */, + C38A09F21A461CEE00D45436 /* CPTExceptions.h in Headers */, + C38A0AC11A46255C00D45436 /* CPTPlot.h in Headers */, + C38A0A641A4620D400D45436 /* CPTShadow.h in Headers */, + C38A0A321A461EBD00D45436 /* CPTAnnotation.h in Headers */, + C38A0A5C1A4620D400D45436 /* CPTColor.h in Headers */, + C38A0A551A461F9700D45436 /* CPTTextStylePlatformSpecific.h in Headers */, + C38A0A7A1A4620E800D45436 /* CPTFill.h in Headers */, + C38A09F81A461D0500D45436 /* CPTPlotRange.h in Headers */, + C38A0AF61A4625E800D45436 /* CPTXYAxisSet.h in Headers */, + C38A0A961A46218B00D45436 /* CPTTimeFormatter.h in Headers */, + C38A0AF81A4625F500D45436 /* CPTLegendEntry.h in Headers */, + C38A0AAE1A46241100D45436 /* CPTPlotArea.h in Headers */, + C38A0A0E1A461D5B00D45436 /* _CPTMaskLayer.h in Headers */, + C38A0A2C1A461EAA00D45436 /* _CPTAnimationPlotRangePeriod.h in Headers */, + C38A09FE1A461D1800D45436 /* CPTFunctionDataSource.h in Headers */, + C38A0A5E1A4620D400D45436 /* CPTGradient.h in Headers */, + C38A0A201A461E8800D45436 /* _CPTAnimationCGPointPeriod.h in Headers */, + C38A0A9E1A4621A500D45436 /* NSDecimalNumberExtensions.h in Headers */, + C38A0AF11A4625E800D45436 /* CPTAxis.h in Headers */, + C38A0B241A46264500D45436 /* CPTPlatformSpecificFunctions.h in Headers */, + C38A0A3B1A461EDA00D45436 /* CPTAnnotationHostLayer.h in Headers */, + C38A0AF31A4625E800D45436 /* CPTAxisLabel.h in Headers */, + C3BB931A1B729BD200004527 /* CPTDebugQuickLook.h in Headers */, + C38A0A2F1A461EB100D45436 /* _CPTAnimationTimingFunctions.h in Headers */, + C38A0A4D1A461F1D00D45436 /* CPTMutableTextStyle.h in Headers */, + C38A0AA81A46240300D45436 /* CPTXYGraph.h in Headers */, + C38A0B211A46264500D45436 /* CPTPlatformSpecificDefines.h in Headers */, + C38A0AC21A46255C00D45436 /* CPTBarPlot.h in Headers */, + C38A09F51A461CF900D45436 /* CPTUtilities.h in Headers */, + C38A0A411A461EEE00D45436 /* _CPTConstraintsFixed.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 0730F5FF109492D800E95162 /* UnitTests */ = { + 0730F5FF109492D800E95162 /* UnitTests Mac */ = { isa = PBXNativeTarget; - buildConfigurationList = 0730F604109492D900E95162 /* Build configuration list for PBXNativeTarget "UnitTests" */; + buildConfigurationList = 0730F604109492D900E95162 /* Build configuration list for PBXNativeTarget "UnitTests Mac" */; buildPhases = ( 0730F5FB109492D800E95162 /* Resources */, 0730F5FC109492D800E95162 /* Sources */, 0730F5FD109492D800E95162 /* Frameworks */, - 0730F5FE109492D800E95162 /* ShellScript */, ); buildRules = ( ); dependencies = ( 0730F6221094932900E95162 /* PBXTargetDependency */, ); - name = UnitTests; + name = "UnitTests Mac"; productName = UnitTests; productReference = 0730F600109492D800E95162 /* UnitTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - 8DC2EF4F0486A6940098B216 /* CorePlot */ = { + 8DC2EF4F0486A6940098B216 /* CorePlot Mac */ = { isa = PBXNativeTarget; - buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "CorePlot" */; + buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "CorePlot Mac" */; buildPhases = ( 8DC2EF500486A6940098B216 /* Headers */, 8DC2EF520486A6940098B216 /* Resources */, @@ -1344,12 +2335,119 @@ ); dependencies = ( ); - name = CorePlot; + name = "CorePlot Mac"; productInstallPath = "$(HOME)/Library/Frameworks"; productName = CorePlot; productReference = 8DC2EF5B0486A6940098B216 /* CorePlot.framework */; productType = "com.apple.product-type.framework"; }; + C37EA5C91BC83F2A0091C8F7 /* CorePlot tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = C37EA68F1BC83F2A0091C8F7 /* Build configuration list for PBXNativeTarget "CorePlot tvOS" */; + buildPhases = ( + C37EA5CA1BC83F2A0091C8F7 /* Sources */, + C37EA6291BC83F2A0091C8F7 /* Frameworks */, + C37EA62E1BC83F2A0091C8F7 /* Headers */, + C37EA68E1BC83F2A0091C8F7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "CorePlot tvOS"; + productName = "CorePlot-iOS"; + productReference = C37EA6921BC83F2A0091C8F7 /* CorePlot.framework */; + productType = "com.apple.product-type.framework"; + }; + C37EA6941BC83F2D0091C8F7 /* UnitTests tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = C37EA6B41BC83F2D0091C8F7 /* Build configuration list for PBXNativeTarget "UnitTests tvOS" */; + buildPhases = ( + C37EA6971BC83F2D0091C8F7 /* Sources */, + C37EA6B01BC83F2D0091C8F7 /* Frameworks */, + C37EA6B31BC83F2D0091C8F7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C3B4D4961BC997F600450C37 /* PBXTargetDependency */, + ); + name = "UnitTests tvOS"; + productName = "CorePlot-iOSTests"; + productReference = C37EA6B71BC83F2D0091C8F7 /* UnitTests tvOS.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + C38A09771A46185200D45436 /* CorePlot iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = C38A098F1A46185300D45436 /* Build configuration list for PBXNativeTarget "CorePlot iOS" */; + buildPhases = ( + C38A09731A46185200D45436 /* Sources */, + C38A09741A46185200D45436 /* Frameworks */, + C38A09751A46185200D45436 /* Headers */, + C38A09761A46185200D45436 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "CorePlot iOS"; + productName = "CorePlot-iOS"; + productReference = C38A09781A46185200D45436 /* CorePlot.framework */; + productType = "com.apple.product-type.framework"; + }; + C38A09811A46185300D45436 /* UnitTests iOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = C38A09901A46185300D45436 /* Build configuration list for PBXNativeTarget "UnitTests iOS" */; + buildPhases = ( + C38A097E1A46185300D45436 /* Sources */, + C38A097F1A46185300D45436 /* Frameworks */, + C38A09801A46185300D45436 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C38A09851A46185300D45436 /* PBXTargetDependency */, + ); + name = "UnitTests iOS"; + productName = "CorePlot-iOSTests"; + productReference = C38A09821A46185300D45436 /* UnitTests iOS.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + C38A09B91A4619A900D45436 /* CorePlot-CocoaTouch */ = { + isa = PBXNativeTarget; + buildConfigurationList = C38A09CB1A4619A900D45436 /* Build configuration list for PBXNativeTarget "CorePlot-CocoaTouch" */; + buildPhases = ( + C38A09B61A4619A900D45436 /* Sources */, + C38A09B71A4619A900D45436 /* Frameworks */, + C38A09B81A4619A900D45436 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "CorePlot-CocoaTouch"; + productName = "CorePlot-CocoaTouch"; + productReference = C38A09BA1A4619A900D45436 /* libCorePlot-CocoaTouch.a */; + productType = "com.apple.product-type.library.static"; + }; + C38A09C31A4619A900D45436 /* CorePlot-CocoaTouchTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = C38A09CE1A4619A900D45436 /* Build configuration list for PBXNativeTarget "CorePlot-CocoaTouchTests" */; + buildPhases = ( + C38A09C01A4619A900D45436 /* Sources */, + C38A09C11A4619A900D45436 /* Frameworks */, + C38A09C21A4619A900D45436 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C38A09C71A4619A900D45436 /* PBXTargetDependency */, + ); + name = "CorePlot-CocoaTouchTests"; + productName = "CorePlot-CocoaTouchTests"; + productReference = C38A09C41A4619A900D45436 /* CorePlot-CocoaTouchTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -1357,26 +2455,54 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 0610; + LastUpgradeCheck = 1100; + TargetAttributes = { + 8DC2EF4F0486A6940098B216 = { + DevelopmentTeam = 28ZA45DE7D; + }; + C38A09771A46185200D45436 = { + CreatedOnToolsVersion = 6.1.1; + }; + C38A09811A46185300D45436 = { + CreatedOnToolsVersion = 6.1.1; + }; + C38A09B91A4619A900D45436 = { + CreatedOnToolsVersion = 6.1.1; + }; + C38A09C31A4619A900D45436 = { + CreatedOnToolsVersion = 6.1.1; + }; + }; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CorePlot" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + compatibilityVersion = "Xcode 6.3"; + developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( - English, - Japanese, - French, - German, + Base, + en, + de, + ja, + fr, ); mainGroup = 0867D691FE84028FC02AAC07 /* CorePlot */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 8DC2EF4F0486A6940098B216 /* CorePlot */, - 0730F5FF109492D800E95162 /* UnitTests */, - 9021E49E0FC5C9DC00443472 /* Documentation */, + 8DC2EF4F0486A6940098B216 /* CorePlot Mac */, + 0730F5FF109492D800E95162 /* UnitTests Mac */, + C38A09771A46185200D45436 /* CorePlot iOS */, + C38A09811A46185300D45436 /* UnitTests iOS */, + C38A09B91A4619A900D45436 /* CorePlot-CocoaTouch */, + C38A09C31A4619A900D45436 /* CorePlot-CocoaTouchTests */, + C37EA5C91BC83F2A0091C8F7 /* CorePlot tvOS */, + C37EA6941BC83F2D0091C8F7 /* UnitTests tvOS */, + 9021E49E0FC5C9DC00443472 /* Documentation-Mac */, + C38A09911A4618B600D45436 /* Documentation-iOS */, + C38A09961A46193F00D45436 /* Universal Library */, + C3A5467F1BC1A817005C1BBC /* Universal iOS Framework */, + C37EA5C41BC83E900091C8F7 /* Universal tvOS Framework */, ); }; /* End PBXProject section */ @@ -1398,10 +2524,45 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C37EA68E1BC83F2A0091C8F7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C37EA6B31BC83F2D0091C8F7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C38A09761A46185200D45436 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C38A09801A46185300D45436 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C38A09C21A4619A900D45436 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0730F5FE109492D800E95162 /* ShellScript */ = { + 9021E49D0FC5C9DC00443472 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -1412,9 +2573,9 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; + shellScript = "# Build the doxygen documentation for the project and load the docset into Xcode.\n\n# Use the following to adjust the value of the $DOXYGEN_PATH User-Defined Setting:\n# Binary install location: /Applications/Doxygen.app/Contents/Resources/doxygen\n# Source build install location: /usr/local/bin/doxygen\n\n# Graphical class diagrams require Graphviz.\n# Graphviz.app is available free online\n# http://www.graphviz.org/Download_macos.php\n\n# If the config file doesn't exist, run 'doxygen -g \"${SOURCE_ROOT}/../documentation/doxygen/doxygen.config\"' to \n# a get default file.\n\nDOXYGEN_FOLDER=\"${SOURCE_ROOT}/../documentation/doxygen\"\n\nif ! [ -f \"${DOXYGEN_FOLDER}/doxygen.config\" ] \nthen \n echo doxygen config file does not exist\n ${DOXYGEN_PATH} -g \"${DOXYGEN_FOLDER}/doxygen.config\"\nfi\n\n# Run doxygen on the updated config file.\n# Note: doxygen creates a Makefile that does most of the heavy lifting.\n${DOXYGEN_PATH} \"${DOXYGEN_FOLDER}/doxygen.config\"\n\n# make a copy of the html docs\nDOCS_FOLDER=\"${SOURCE_ROOT}/../documentation/html/MacOS\"\nmkdir -p \"${DOCS_FOLDER}\"\ncp -R \"${SOURCE_ROOT}/CorePlotDocs.docset/html/\" \"${DOCS_FOLDER}\"\nrm -Rf \"${SOURCE_ROOT}/CorePlotDocs.docset\"\nrm -f \"${DOCS_FOLDER}/Info.plist\"\nrm -f \"${DOCS_FOLDER}/Makefile\"\nrm -f \"${DOCS_FOLDER}/Nodes.xml\"\nrm -f \"${DOCS_FOLDER}/Tokens.xml\"\n\nexit 0"; }; - 9021E49D0FC5C9DC00443472 /* ShellScript */ = { + C37EA5C51BC83E900091C8F7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -1425,41 +2586,81 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Build the doxygen documentation for the project and load the docset into Xcode.\n\n# Use the following to adjust the value of the $DOXYGEN_PATH User-Defined Setting:\n# Binary install location: /Applications/Doxygen.app/Contents/Resources/doxygen\n# Source build install location: /usr/local/bin/doxygen\n\n# Graphical class diagrams require Graphviz.\n# Graphviz.app is available free online\n# http://www.graphviz.org/Download_macos.php\n\n# If the config file doesn't exist, run 'doxygen -g \"${SOURCE_ROOT}/../documentation/doxygen/doxygen.config\"' to \n# a get default file.\n\nDOXYGEN_FOLDER=\"${SOURCE_ROOT}/../documentation/doxygen\"\n\nif ! [ -f \"${DOXYGEN_FOLDER}/doxygen.config\" ] \nthen \n echo doxygen config file does not exist\n ${DOXYGEN_PATH} -g \"${DOXYGEN_FOLDER}/doxygen.config\"\nfi\n\n# Run doxygen on the updated config file.\n# Note: doxygen creates a Makefile that does most of the heavy lifting.\n${DOXYGEN_PATH} \"${DOXYGEN_FOLDER}/doxygen.config\"\n\n# make a copy of the html docs\nDOCS_FOLDER=\"${SOURCE_ROOT}/../documentation/html/MacOS\"\nmkdir -p \"${DOCS_FOLDER}\"\ncp -R \"${SOURCE_ROOT}/CorePlotDocs.docset/html/\" \"${DOCS_FOLDER}\"\nrm -f \"${DOCS_FOLDER}/Info.plist\"\nrm -f \"${DOCS_FOLDER}/Makefile\"\nrm -f \"${DOCS_FOLDER}/Nodes.xml\"\nrm -f \"${DOCS_FOLDER}/Tokens.xml\"\n\n# fix nodes.xml so the docset gets the correct index page\nsed -i 's|index.html|index.html' \"${SOURCE_ROOT}/CorePlotDocs.docset/html/nodes.xml\"\n\n# make will invoke docsetutil. Take a look at the Makefile to see how this is done.\nmake -C \"${SOURCE_ROOT}/CorePlotDocs.docset/html\" install\n\n# add publisher info to the docset\nDOCSET_FOLDER=\"/Users/${USER}/Library/Developer/Shared/Documentation/DocSets/com.CorePlot.Framework.docset\"\n\nfind \"${DOCSET_FOLDER}/Contents/\" -type f -name Info.plist | xargs perl -pi -e 's/\\<\\/dict\\>/\\t\\DocSetPublisherIdentifier\\<\\/key\\>\\n\\t\\com.CorePlot.documentation\\<\\/string\\>\\n\\t\\DocSetPublisherName\\<\\/key\\>\\n\\t\\Core Plot\\<\\/string\\>\\n\\t\\NSHumanReadableCopyright\\<\\/key\\>\\n\\t\\Copyright © 2013 Core Plot. All rights reserved.\\<\\/string\\>\\n\\t\\isJavaScriptEnabled\\<\\/key\\>\\n\\t\\\\n\\<\\/dict\\>\\n/g'\n\n# add docset icon\ncp \"${DOXYGEN_FOLDER}/icon.png\" \"${DOCSET_FOLDER}\"\n\n# make a copy of the docset\nrm -Rf \"${SOURCE_ROOT}/CorePlotDocs.docset\"\ncp -R \"${DOCSET_FOLDER}\" \"${SOURCE_ROOT}\"\n\n# Construct a temporary applescript file to tell Xcode to load a docset.\nrm -f \"${TEMP_DIR}/loadDocSet.scpt\"\n\necho \"tell application \\\"Xcode\\\"\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\necho \"load documentation set with path \\\"/Users/${USER}/Library/Developer/Shared/Documentation/DocSets/\\\"\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\necho \"end tell\" >> \"${TEMP_DIR}/loadDocSet.scpt\"\n\n# Run the load-docset applescript command.\nosascript \"${TEMP_DIR}/loadDocSet.scpt\"\n\nexit 0"; + shellScript = "\nUFW_TARGET=\"CorePlot tvOS\"\nUFW_BUILD_DIR=\"${PROJECT_DIR}/../build\"\n\nif [ -z ${SDK_NAME} ]; then\n# Use the latest tvOS SDK available\nUFW_GREP_RESULT=$(xcodebuild -showsdks | grep -o \"appletvos.*$\")\nwhile read -r line; do\nUFW_SDK_VERSION=\"${line}\"\ndone <<< \"${UFW_GREP_RESULT}\"\nelse\n# Use the SDK specified by XCode\nUFW_SDK_VERSION=\"${SDK_NAME}\"\nfi\n\nFRAMEWORK_NAME=\"${PROJECT_NAME}\"\nUFW_SDK_VERSION=$(echo \"${UFW_SDK_VERSION}\" | grep -o \"[0-9].*$\")\nUFW_IPHONE_PATH=\"${UFW_BUILD_DIR}/Release-appletvos/${FRAMEWORK_NAME}.framework\"\nUFW_SIMULATOR_PATH=\"${UFW_BUILD_DIR}/Release-appletvsimulator/${FRAMEWORK_NAME}.framework\"\nUFW_UNIVERSAL_DIR=\"${UFW_BUILD_DIR}/Release-appletvuniversal\"\nUFW_FRAMEWORK=\"${UFW_UNIVERSAL_DIR}/${FRAMEWORK_NAME}.framework\"\n\n# Build Framework\n\nrm -rf \"${UFW_UNIVERSAL_DIR}\"\n\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk appletvos${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk appletvsimulator${UFW_SDK_VERSION} build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\n\nmkdir -p \"${UFW_UNIVERSAL_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\ncp -r \"${UFW_IPHONE_PATH}/.\" \"${UFW_FRAMEWORK}\"\n\nlipo -create -output \"${UFW_FRAMEWORK}/${FRAMEWORK_NAME}\" \"${UFW_SIMULATOR_PATH}/${FRAMEWORK_NAME}\" \"${UFW_IPHONE_PATH}/${FRAMEWORK_NAME}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: lipo failed\"; exit 1; fi\n"; }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 0730F5FC109492D800E95162 /* Sources */ = { - isa = PBXSourcesBuildPhase; + C38A09921A4618B600D45436 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( - C36E89BA11EE7F97003DE309 /* CPTPlotRangeTests.m in Sources */, - C34F0D58121CB3EC0020FDD3 /* CPTTestCase.m in Sources */, - C34F0D59121CB3F00020FDD3 /* CPTDataSourceTestCase.m in Sources */, - C3D68A5B1220B27D00EB4863 /* CPTUtilitiesTests.m in Sources */, - C3D68A5C1220B29100EB4863 /* CPTTextStyleTests.m in Sources */, - C3D68A5E1220B2AC00EB4863 /* CPTXYPlotSpaceTests.m in Sources */, - C3D68A5F1220B2B400EB4863 /* CPTScatterPlotTests.m in Sources */, - C3D68A601220B2BE00EB4863 /* CPTAxisLabelTests.m in Sources */, - C3D68A611220B2C800EB4863 /* CPTDarkGradientThemeTests.m in Sources */, - C3D68A621220B2C900EB4863 /* CPTDerivedXYGraph.m in Sources */, - C3D68A631220B2CC00EB4863 /* CPTThemeTests.m in Sources */, - C3392A481225FB68008DA6BD /* CPTMutableNumericDataTests.m in Sources */, - C3392A491225FB69008DA6BD /* CPTNumericDataTests.m in Sources */, - C3BFFD1112274CB500DE22AC /* CPTNumericDataTypeConversionTests.m in Sources */, - C3CB561C122A9E9F00FBFB61 /* CPTMutableNumericDataTypeConversionTests.m in Sources */, - C3D979A413D2136700145DFF /* CPTPlotSpaceTests.m in Sources */, - C3D979A913D2328000145DFF /* CPTTimeFormatterTests.m in Sources */, - C3D979AC13D2332500145DFF /* CPTColorTests.m in Sources */, - C3D979AF13D2337E00145DFF /* CPTColorSpaceTests.m in Sources */, - C3D979B213D233C100145DFF /* CPTGradientTests.m in Sources */, - C3D979B513D2340000145DFF /* CPTImageTests.m in Sources */, - C3D979B813D2344100145DFF /* CPTLineStyleTests.m in Sources */, - C3D979BB13D2347400145DFF /* CPTFillTests.m in Sources */, - C3C1C0801790D3B400E8B1B7 /* CPTLayerTests.m in Sources */, ); - runOnlyForDeploymentPostprocessing = 0; + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# Build the doxygen documentation for the project and load the docset into Xcode.\n\n# Use the following to adjust the value of the $DOXYGEN_PATH User-Defined Setting:\n# Binary install location: /Applications/Doxygen.app/Contents/Resources/doxygen\n# Source build install location: /usr/local/bin/doxygen\n\n# Graphical class diagrams require Graphviz.\n# Graphviz.app is available free online\n# http://www.graphviz.org/Download_macos.php\n\n# If the config file doesn't exist, run 'doxygen -g \"${SOURCE_ROOT}/../documentation/doxygen/doxygen touch.config\"' to\n# a get default file.\n\nDOXYGEN_FOLDER=\"${SOURCE_ROOT}/../documentation/doxygen\"\n\nif ! [ -f \"${DOXYGEN_FOLDER}/doxygen.config\" ]\nthen\necho doxygen config file does not exist\n${DOXYGEN_PATH} -g \"${DOXYGEN_FOLDER}/doxygen.config\"\nfi\n\n# Run doxygen on the updated config file.\n# Note: doxygen creates a Makefile that does most of the heavy lifting.\n${DOXYGEN_PATH} \"${SOURCE_ROOT}/../documentation/doxygen/doxygen touch.config\"\n\n# make a copy of the html docs\nDOCS_FOLDER=\"${SOURCE_ROOT}/../documentation/html/iOS\"\nmkdir -p \"${DOCS_FOLDER}\"\ncp -R \"${SOURCE_ROOT}/CorePlotTouchDocs.docset/html/\" \"${DOCS_FOLDER}\"\nrm -Rf \"${SOURCE_ROOT}/CorePlotTouchDocs.docset\"\nrm -f \"${DOCS_FOLDER}/Info.plist\"\nrm -f \"${DOCS_FOLDER}/Makefile\"\nrm -f \"${DOCS_FOLDER}/Nodes.xml\"\nrm -f \"${DOCS_FOLDER}/Tokens.xml\"\n\nexit 0"; + }; + C38A09971A46193F00D45436 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\nUFW_TARGET=\"CorePlot-CocoaTouch\"\nUFW_BUILD_DIR=\"${PROJECT_DIR}/../build\"\n\nif [ -z ${SDK_NAME} ]; then\n# Use the latest iphoneos SDK available\nUFW_GREP_RESULT=$(xcodebuild -showsdks | grep -o \"iphoneos.*$\")\nwhile read -r line; do\nUFW_SDK_VERSION=\"${line}\"\ndone <<< \"${UFW_GREP_RESULT}\"\nelse\n# Use the SDK specified by XCode\nUFW_SDK_VERSION=\"${SDK_NAME}\"\nfi\n\nUFW_SDK_VERSION=$(echo \"${UFW_SDK_VERSION}\" | grep -o \"[0-9].*$\")\nUFW_IPHONE_DIR=\"${UFW_BUILD_DIR}/Release-iphoneos\"\nUFW_SIMULATOR_DIR=\"${UFW_BUILD_DIR}/Release-iphonesimulator\"\nUFW_UNIVERSAL_DIR=\"${UFW_BUILD_DIR}/Release-universal\"\nUFW_HEADER_DIR=\"${UFW_UNIVERSAL_DIR}/CorePlotHeaders\"\nUFW_EXE_PATH=\"libCorePlot-CocoaTouch.a\"\n\n# Build Framework\n\nrm -rf \"${UFW_UNIVERSAL_DIR}\"\n\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk iphoneos${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk iphonesimulator${UFW_SDK_VERSION} build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\n\nmkdir -p \"${UFW_UNIVERSAL_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\nlipo -create -output \"${UFW_UNIVERSAL_DIR}/${UFW_EXE_PATH}\" \"${UFW_IPHONE_DIR}/${UFW_EXE_PATH}\" \"${UFW_SIMULATOR_DIR}/${UFW_EXE_PATH}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: lipo failed\"; exit 1; fi\n\n# copy header files\nmkdir -p \"${UFW_HEADER_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\ncp \"${SOURCE_ROOT}/CorePlot-CocoaTouch.h\" \"${UFW_HEADER_DIR}\"\ncp \"${SOURCE_ROOT}/iPhoneOnly/\"[!_]*.h \"${UFW_HEADER_DIR}/\"\ncp \"${SOURCE_ROOT}/Source/\"[!_]*.h \"${UFW_HEADER_DIR}/\"\n\nrm \"${UFW_HEADER_DIR}/\"*Tests.*\n"; + }; + C3A546801BC1A817005C1BBC /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\nUFW_TARGET=\"CorePlot iOS\"\nUFW_BUILD_DIR=\"${PROJECT_DIR}/../build\"\n\nif [ -z ${SDK_NAME} ]; then\n# Use the latest iphoneos SDK available\nUFW_GREP_RESULT=$(xcodebuild -showsdks | grep -o \"iphoneos.*$\")\nwhile read -r line; do\nUFW_SDK_VERSION=\"${line}\"\ndone <<< \"${UFW_GREP_RESULT}\"\nelse\n# Use the SDK specified by XCode\nUFW_SDK_VERSION=\"${SDK_NAME}\"\nfi\n\nFRAMEWORK_NAME=\"${PROJECT_NAME}\"\nUFW_SDK_VERSION=$(echo \"${UFW_SDK_VERSION}\" | grep -o \"[0-9].*$\")\nUFW_IPHONE_PATH=\"${UFW_BUILD_DIR}/Release-iphoneos/${FRAMEWORK_NAME}.framework\"\nUFW_SIMULATOR_PATH=\"${UFW_BUILD_DIR}/Release-iphonesimulator/${FRAMEWORK_NAME}.framework\"\nUFW_UNIVERSAL_DIR=\"${UFW_BUILD_DIR}/Release-iphoneuniversal\"\nUFW_FRAMEWORK=\"${UFW_UNIVERSAL_DIR}/${FRAMEWORK_NAME}.framework\"\n\n# Build Framework\n\nrm -rf \"${UFW_UNIVERSAL_DIR}\"\n\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk iphoneos${UFW_SDK_VERSION} clean build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\nxcodebuild -target \"${UFW_TARGET}\" -project CorePlot.xcodeproj -configuration Release -sdk iphonesimulator${UFW_SDK_VERSION} build\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: xcodebuild failed\"; exit 1; fi\n\nmkdir -p \"${UFW_UNIVERSAL_DIR}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: mkdir failed\"; exit 1; fi\n\ncp -r \"${UFW_IPHONE_PATH}/.\" \"${UFW_FRAMEWORK}\"\n\nlipo -create -output \"${UFW_FRAMEWORK}/${FRAMEWORK_NAME}\" \"${UFW_SIMULATOR_PATH}/${FRAMEWORK_NAME}\" \"${UFW_IPHONE_PATH}/${FRAMEWORK_NAME}\"\nif [ \"$?\" != \"0\" ]; then echo >&2 \"Error: lipo failed\"; exit 1; fi\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 0730F5FC109492D800E95162 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C36E89BA11EE7F97003DE309 /* CPTPlotRangeTests.m in Sources */, + C34F0D58121CB3EC0020FDD3 /* CPTTestCase.m in Sources */, + C34F0D59121CB3F00020FDD3 /* CPTDataSourceTestCase.m in Sources */, + C3D68A5B1220B27D00EB4863 /* CPTUtilitiesTests.m in Sources */, + C3D68A5C1220B29100EB4863 /* CPTTextStyleTests.m in Sources */, + C3D68A5E1220B2AC00EB4863 /* CPTXYPlotSpaceTests.m in Sources */, + C3D68A5F1220B2B400EB4863 /* CPTScatterPlotTests.m in Sources */, + C3D68A601220B2BE00EB4863 /* CPTAxisLabelTests.m in Sources */, + C3D68A611220B2C800EB4863 /* CPTDarkGradientThemeTests.m in Sources */, + C3D68A621220B2C900EB4863 /* CPTDerivedXYGraph.m in Sources */, + C3D68A631220B2CC00EB4863 /* CPTThemeTests.m in Sources */, + C3392A481225FB68008DA6BD /* CPTMutableNumericDataTests.m in Sources */, + C3392A491225FB69008DA6BD /* CPTNumericDataTests.m in Sources */, + C3BFFD1112274CB500DE22AC /* CPTNumericDataTypeConversionTests.m in Sources */, + C3CB561C122A9E9F00FBFB61 /* CPTMutableNumericDataTypeConversionTests.m in Sources */, + C3D979A413D2136700145DFF /* CPTPlotSpaceTests.m in Sources */, + C3D979A913D2328000145DFF /* CPTTimeFormatterTests.m in Sources */, + C3D979AC13D2332500145DFF /* CPTColorTests.m in Sources */, + C3D979AF13D2337E00145DFF /* CPTColorSpaceTests.m in Sources */, + C3D979B213D233C100145DFF /* CPTGradientTests.m in Sources */, + C3D979B513D2340000145DFF /* CPTImageTests.m in Sources */, + C377B3BB1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */, + C3D979B813D2344100145DFF /* CPTLineStyleTests.m in Sources */, + C3D979BB13D2347400145DFF /* CPTFillTests.m in Sources */, + C3C1C0801790D3B400E8B1B7 /* CPTLayerTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; }; 8DC2EF540486A6940098B216 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -1509,7 +2710,6 @@ BC55023310059F22005DF982 /* _CPTPlainBlackTheme.m in Sources */, BC55023510059F22005DF982 /* _CPTPlainWhiteTheme.m in Sources */, BC55023710059F22005DF982 /* _CPTStocksTheme.m in Sources */, - BC89A64110239D1D009D5261 /* CorePlotProbes.d in Sources */, 07A2E6FD102DF47900809BC5 /* CPTTimeFormatter.m in Sources */, 4C97EF02104D80C400B554F9 /* CPTNumericData.m in Sources */, 4C97EF04104D80C400B554F9 /* CPTNumericDataType.m in Sources */, @@ -1540,6 +2740,7 @@ C3920AC51395B6500045F3BB /* CPTLegend.m in Sources */, C30550EE1399BE5400E0151F /* CPTLegendEntry.m in Sources */, C3978E0713CE653C00A420D9 /* NSCoderExtensions.m in Sources */, + C3BB3C911C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */, C3D3AD2E13DF8DCE0004EA73 /* CPTLineCap.m in Sources */, C3CCA03E13E8D85900CE6DB1 /* _CPTConstraintsFixed.m in Sources */, C3CCA04013E8D85900CE6DB1 /* _CPTConstraintsRelative.m in Sources */, @@ -1563,193 +2764,593 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C37EA5CA1BC83F2A0091C8F7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C37EA5CB1BC83F2A0091C8F7 /* CPTGraphHostingView.m in Sources */, + C37EA5CC1BC83F2A0091C8F7 /* CPTLayerAnnotation.m in Sources */, + C37EA5CD1BC83F2A0091C8F7 /* CPTLayer.m in Sources */, + C37EA5CE1BC83F2A0091C8F7 /* CPTTimeFormatter.m in Sources */, + C37EA5CF1BC83F2A0091C8F7 /* CPTColor.m in Sources */, + C37EA5D01BC83F2A0091C8F7 /* NSCoderExtensions.m in Sources */, + C37EA5D11BC83F2A0091C8F7 /* CPTMutableNumericData.m in Sources */, + C37EA5D21BC83F2A0091C8F7 /* CPTNumericData+TypeConversion.m in Sources */, + C37EA5D31BC83F2A0091C8F7 /* CPTTheme.m in Sources */, + C37EA5D41BC83F2A0091C8F7 /* CPTDefinitions.m in Sources */, + C37EA5D51BC83F2A0091C8F7 /* _CPTFillImage.m in Sources */, + C37EA5D61BC83F2A0091C8F7 /* CPTPlotSpaceAnnotation.m in Sources */, + C37EA5D71BC83F2A0091C8F7 /* CPTXYAxis.m in Sources */, + C37EA5D81BC83F2A0091C8F7 /* CPTBarPlot.m in Sources */, + C37EA5D91BC83F2A0091C8F7 /* CPTAxisTitle.m in Sources */, + C37EA5DA1BC83F2A0091C8F7 /* CPTPlatformSpecificDefines.m in Sources */, + C37EA5DB1BC83F2A0091C8F7 /* _CPTStocksTheme.m in Sources */, + C37EA5DC1BC83F2A0091C8F7 /* CPTImagePlatformSpecific.m in Sources */, + C37EA5DD1BC83F2A0091C8F7 /* _CPTAnimationCGFloatPeriod.m in Sources */, + C37EA5DE1BC83F2A0091C8F7 /* CPTExceptions.m in Sources */, + C37EA5DF1BC83F2A0091C8F7 /* _CPTDarkGradientTheme.m in Sources */, + C37EA5E01BC83F2A0091C8F7 /* _CPTPlainBlackTheme.m in Sources */, + C37EA5E11BC83F2A0091C8F7 /* CPTNumericData.m in Sources */, + C37EA5E31BC83F2A0091C8F7 /* CPTXYAxisSet.m in Sources */, + C37EA5E41BC83F2A0091C8F7 /* CPTLimitBand.m in Sources */, + C37EA5E51BC83F2A0091C8F7 /* CPTGridLines.m in Sources */, + C3BB3C941C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */, + C37EA5E61BC83F2A0091C8F7 /* CPTPathExtensions.m in Sources */, + C37EA5E71BC83F2A0091C8F7 /* CPTXYPlotSpace.m in Sources */, + C37EA5E81BC83F2A0091C8F7 /* CPTPlotRange.m in Sources */, + C37EA5E91BC83F2A0091C8F7 /* CPTImage.m in Sources */, + C37EA5EA1BC83F2A0091C8F7 /* CPTPlotSymbol.m in Sources */, + C37EA5EB1BC83F2A0091C8F7 /* CPTAxisSet.m in Sources */, + C37EA5EC1BC83F2A0091C8F7 /* CPTPlotGroup.m in Sources */, + C37EA5ED1BC83F2A0091C8F7 /* CPTAnimation.m in Sources */, + C37EA5EE1BC83F2A0091C8F7 /* _CPTAnimationNSDecimalPeriod.m in Sources */, + C37EA5EF1BC83F2A0091C8F7 /* _CPTAnimationPlotRangePeriod.m in Sources */, + C37EA5F01BC83F2A0091C8F7 /* CPTPlotAreaFrame.m in Sources */, + C37EA5F11BC83F2A0091C8F7 /* CPTAxisLabel.m in Sources */, + C37EA5F21BC83F2A0091C8F7 /* CPTShadow.m in Sources */, + C37EA5F31BC83F2A0091C8F7 /* _CPTAnimationCGPointPeriod.m in Sources */, + C37EA5F41BC83F2A0091C8F7 /* CPTPlatformSpecificFunctions.m in Sources */, + C37EA5F51BC83F2A0091C8F7 /* CPTMutableShadow.m in Sources */, + C37EA5F61BC83F2A0091C8F7 /* _CPTAnimationCGRectPeriod.m in Sources */, + C37EA5F71BC83F2A0091C8F7 /* CPTPlotSpace.m in Sources */, + C37EA5F81BC83F2A0091C8F7 /* CPTLineCap.m in Sources */, + C37EA5F91BC83F2A0091C8F7 /* CPTScatterPlot.m in Sources */, + C37EA5FA1BC83F2A0091C8F7 /* _CPTSlateTheme.m in Sources */, + C37EA5FB1BC83F2A0091C8F7 /* CPTAnimationPeriod.m in Sources */, + C37EA5FC1BC83F2A0091C8F7 /* CPTTextStylePlatformSpecific.m in Sources */, + C37EA5FD1BC83F2A0091C8F7 /* _CPTBorderLayer.m in Sources */, + C37EA5FE1BC83F2A0091C8F7 /* CPTLegendEntry.m in Sources */, + C37EA5FF1BC83F2A0091C8F7 /* CPTTradingRangePlot.m in Sources */, + C37EA6001BC83F2A0091C8F7 /* CPTTextLayer.m in Sources */, + C37EA6011BC83F2A0091C8F7 /* _CPTConstraintsRelative.m in Sources */, + C37EA6021BC83F2A0091C8F7 /* CPTAnnotationHostLayer.m in Sources */, + C37EA6031BC83F2A0091C8F7 /* CPTAnimationOperation.m in Sources */, + C37EA6041BC83F2A0091C8F7 /* _CPTFillGradient.m in Sources */, + C37EA6051BC83F2A0091C8F7 /* _CPTMaskLayer.m in Sources */, + C37EA6061BC83F2A0091C8F7 /* CPTCalendarFormatter.m in Sources */, + C37EA6071BC83F2A0091C8F7 /* CPTAnnotation.m in Sources */, + C37EA6081BC83F2A0091C8F7 /* _CPTFillColor.m in Sources */, + C37EA6091BC83F2A0091C8F7 /* _CPTAnimationTimingFunctions.m in Sources */, + C37EA60A1BC83F2A0091C8F7 /* CPTMutableLineStyle.m in Sources */, + C37EA60B1BC83F2A0091C8F7 /* NSDecimalNumberExtensions.m in Sources */, + C37EA60C1BC83F2A0091C8F7 /* CPTLegend.m in Sources */, + C37EA60D1BC83F2A0091C8F7 /* CPTAxisLabelGroup.m in Sources */, + C37EA60E1BC83F2A0091C8F7 /* CPTFill.m in Sources */, + C37EA60F1BC83F2A0091C8F7 /* CPTMutableNumericData+TypeConversion.m in Sources */, + C37EA6101BC83F2A0091C8F7 /* CPTRangePlot.m in Sources */, + C37EA6111BC83F2A0091C8F7 /* CPTGraph.m in Sources */, + C37EA6121BC83F2A0091C8F7 /* CPTMutablePlotRange.m in Sources */, + C37EA6131BC83F2A0091C8F7 /* _CPTPlainWhiteTheme.m in Sources */, + C37EA6141BC83F2A0091C8F7 /* CPTGridLineGroup.m in Sources */, + C37EA6151BC83F2A0091C8F7 /* CPTNumericDataType.m in Sources */, + C37EA6161BC83F2A0091C8F7 /* CPTPlot.m in Sources */, + C37EA6171BC83F2A0091C8F7 /* CPTPlatformSpecificCategories.m in Sources */, + C37EA6181BC83F2A0091C8F7 /* CPTConstraints.m in Sources */, + C37EA6191BC83F2A0091C8F7 /* CPTTextStyle.m in Sources */, + C37EA61A1BC83F2A0091C8F7 /* CPTFunctionDataSource.m in Sources */, + C37EA61B1BC83F2A0091C8F7 /* NSNumberExtensions.m in Sources */, + C37EA61C1BC83F2A0091C8F7 /* CPTBorderedLayer.m in Sources */, + C37EA61D1BC83F2A0091C8F7 /* CPTLineStyle.m in Sources */, + C37EA61E1BC83F2A0091C8F7 /* _CPTAnimationCGSizePeriod.m in Sources */, + C37EA61F1BC83F2A0091C8F7 /* CPTPieChart.m in Sources */, + C37EA6201BC83F2A0091C8F7 /* CPTColorSpace.m in Sources */, + C37EA6211BC83F2A0091C8F7 /* CPTGradient.m in Sources */, + C37EA6221BC83F2A0091C8F7 /* CPTUtilities.m in Sources */, + C37EA6231BC83F2A0091C8F7 /* _CPTXYTheme.m in Sources */, + C37EA6241BC83F2A0091C8F7 /* CPTXYGraph.m in Sources */, + C37EA6251BC83F2A0091C8F7 /* CPTPlotArea.m in Sources */, + C37EA6261BC83F2A0091C8F7 /* _CPTConstraintsFixed.m in Sources */, + C37EA6271BC83F2A0091C8F7 /* CPTAxis.m in Sources */, + C37EA6281BC83F2A0091C8F7 /* CPTMutableTextStyle.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C37EA6971BC83F2D0091C8F7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C37EA6981BC83F2D0091C8F7 /* CPTMutableNumericDataTests.m in Sources */, + C37EA6991BC83F2D0091C8F7 /* CPTColorSpaceTests.m in Sources */, + C37EA69A1BC83F2D0091C8F7 /* CPTFillTests.m in Sources */, + C37EA69B1BC83F2D0091C8F7 /* CPTUtilitiesTests.m in Sources */, + C37EA69C1BC83F2D0091C8F7 /* CPTGradientTests.m in Sources */, + C37EA69D1BC83F2D0091C8F7 /* CPTDarkGradientThemeTests.m in Sources */, + C37EA69E1BC83F2D0091C8F7 /* CPTAxisLabelTests.m in Sources */, + C37EA69F1BC83F2D0091C8F7 /* CPTThemeTests.m in Sources */, + C37EA6A01BC83F2D0091C8F7 /* CPTColorTests.m in Sources */, + C37EA6A11BC83F2D0091C8F7 /* CPTPlotSpaceTests.m in Sources */, + C37EA6A21BC83F2D0091C8F7 /* CPTImageTests.m in Sources */, + C37EA6A31BC83F2D0091C8F7 /* CPTDataSourceTestCase.m in Sources */, + C37EA6A41BC83F2D0091C8F7 /* CPTNumericDataTests.m in Sources */, + C37EA6A51BC83F2D0091C8F7 /* CPTDerivedXYGraph.m in Sources */, + C37EA6A61BC83F2D0091C8F7 /* CPTXYPlotSpaceTests.m in Sources */, + C37EA6A71BC83F2D0091C8F7 /* CPTTestCase.m in Sources */, + C37EA6A81BC83F2D0091C8F7 /* CPTPlotRangeTests.m in Sources */, + C37EA6A91BC83F2D0091C8F7 /* CPTNumericDataTypeConversionTests.m in Sources */, + C37EA6AA1BC83F2D0091C8F7 /* CPTMutableNumericDataTypeConversionTests.m in Sources */, + C37EA6AB1BC83F2D0091C8F7 /* CPTLineStyleTests.m in Sources */, + C37EA6AC1BC83F2D0091C8F7 /* CPTTextStyleTests.m in Sources */, + C377B3BE1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */, + C37EA6AD1BC83F2D0091C8F7 /* CPTTimeFormatterTests.m in Sources */, + C37EA6AE1BC83F2D0091C8F7 /* CPTLayerTests.m in Sources */, + C37EA6AF1BC83F2D0091C8F7 /* CPTScatterPlotTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C38A09731A46185200D45436 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C38A0B2A1A46265300D45436 /* CPTGraphHostingView.m in Sources */, + C38A0A391A461ED600D45436 /* CPTLayerAnnotation.m in Sources */, + C38A0A061A461D4400D45436 /* CPTLayer.m in Sources */, + C38A0A981A46219100D45436 /* CPTTimeFormatter.m in Sources */, + C38A0A661A4620E200D45436 /* CPTColor.m in Sources */, + C38A0AA01A4621AC00D45436 /* NSCoderExtensions.m in Sources */, + C38A09DD1A461C8100D45436 /* CPTMutableNumericData.m in Sources */, + C38A09DF1A461C8500D45436 /* CPTNumericData+TypeConversion.m in Sources */, + C38A0B041A46261700D45436 /* CPTTheme.m in Sources */, + C38A09F01A461CD900D45436 /* CPTDefinitions.m in Sources */, + C38A0A811A4620F700D45436 /* _CPTFillImage.m in Sources */, + C38A0A361A461ECD00D45436 /* CPTPlotSpaceAnnotation.m in Sources */, + C38A0AE61A4625D400D45436 /* CPTXYAxis.m in Sources */, + C38A0AC91A46256500D45436 /* CPTBarPlot.m in Sources */, + C38A0AE41A4625D400D45436 /* CPTAxisTitle.m in Sources */, + C38A0B221A46264500D45436 /* CPTPlatformSpecificDefines.m in Sources */, + C38A0B0A1A46261700D45436 /* _CPTStocksTheme.m in Sources */, + C38A0A5A1A4620B800D45436 /* CPTImagePlatformSpecific.m in Sources */, + C38A0A1E1A461E7A00D45436 /* _CPTAnimationCGFloatPeriod.m in Sources */, + C38A09F31A461CF500D45436 /* CPTExceptions.m in Sources */, + C38A0B061A46261700D45436 /* _CPTDarkGradientTheme.m in Sources */, + C38A0B071A46261700D45436 /* _CPTPlainBlackTheme.m in Sources */, + C38A09DB1A461C7D00D45436 /* CPTNumericData.m in Sources */, + C38A0AE71A4625D400D45436 /* CPTXYAxisSet.m in Sources */, + C38A0AB21A46241700D45436 /* CPTLimitBand.m in Sources */, + C38A0AE11A4625D400D45436 /* CPTGridLines.m in Sources */, + C3BB3C921C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */, + C38A0A6D1A4620E200D45436 /* CPTPathExtensions.m in Sources */, + C38A0AB91A46250500D45436 /* CPTXYPlotSpace.m in Sources */, + C38A09F91A461D0B00D45436 /* CPTPlotRange.m in Sources */, + C38A0A691A4620E200D45436 /* CPTImage.m in Sources */, + C38A0AD61A46257100D45436 /* CPTPlotSymbol.m in Sources */, + C38A0AE01A4625D400D45436 /* CPTAxisSet.m in Sources */, + C38A0AC71A46256500D45436 /* CPTPlotGroup.m in Sources */, + C38A0A151A461E5800D45436 /* CPTAnimation.m in Sources */, + C38A0A2A1A461EA600D45436 /* _CPTAnimationNSDecimalPeriod.m in Sources */, + C38A0A2D1A461EAD00D45436 /* _CPTAnimationPlotRangePeriod.m in Sources */, + C38A0AB01A46241700D45436 /* CPTPlotAreaFrame.m in Sources */, + C38A0AE31A4625D400D45436 /* CPTAxisLabel.m in Sources */, + C38A0A6E1A4620E200D45436 /* CPTShadow.m in Sources */, + C38A0A211A461E8B00D45436 /* _CPTAnimationCGPointPeriod.m in Sources */, + C38A0B251A46264500D45436 /* CPTPlatformSpecificFunctions.m in Sources */, + C38A0A6F1A4620E200D45436 /* CPTMutableShadow.m in Sources */, + C38A0A271A461E9A00D45436 /* _CPTAnimationCGRectPeriod.m in Sources */, + C38A0AB81A46250500D45436 /* CPTPlotSpace.m in Sources */, + C38A0A6A1A4620E200D45436 /* CPTLineCap.m in Sources */, + C38A0ACC1A46256500D45436 /* CPTScatterPlot.m in Sources */, + C38A0B091A46261700D45436 /* _CPTSlateTheme.m in Sources */, + C38A0A1B1A461E6A00D45436 /* CPTAnimationPeriod.m in Sources */, + C38A0A561A461F9700D45436 /* CPTTextStylePlatformSpecific.m in Sources */, + C38A0A0C1A461D5700D45436 /* _CPTBorderLayer.m in Sources */, + C38A0AFA1A4625FA00D45436 /* CPTLegendEntry.m in Sources */, + C38A0ACD1A46256500D45436 /* CPTTradingRangePlot.m in Sources */, + C38A0A481A461F1100D45436 /* CPTTextLayer.m in Sources */, + C38A0A451A461F0100D45436 /* _CPTConstraintsRelative.m in Sources */, + C38A0A3C1A461EDF00D45436 /* CPTAnnotationHostLayer.m in Sources */, + C38A0A181A461E6000D45436 /* CPTAnimationOperation.m in Sources */, + C38A0A801A4620F700D45436 /* _CPTFillGradient.m in Sources */, + C38A0A0F1A461D5E00D45436 /* _CPTMaskLayer.m in Sources */, + C38A0A971A46219100D45436 /* CPTCalendarFormatter.m in Sources */, + C38A0A331A461EC200D45436 /* CPTAnnotation.m in Sources */, + C38A0A7F1A4620F700D45436 /* _CPTFillColor.m in Sources */, + C38A0A301A461EB500D45436 /* _CPTAnimationTimingFunctions.m in Sources */, + C38A0A6C1A4620E200D45436 /* CPTMutableLineStyle.m in Sources */, + C38A0AA11A4621AC00D45436 /* NSDecimalNumberExtensions.m in Sources */, + C38A0AF91A4625FA00D45436 /* CPTLegend.m in Sources */, + C38A0AE51A4625D400D45436 /* CPTAxisLabelGroup.m in Sources */, + C38A0A7E1A4620F700D45436 /* CPTFill.m in Sources */, + C38A09E11A461C8800D45436 /* CPTMutableNumericData+TypeConversion.m in Sources */, + C38A0ACB1A46256500D45436 /* CPTRangePlot.m in Sources */, + C38A0AA91A46240900D45436 /* CPTGraph.m in Sources */, + C38A09FC1A461D1300D45436 /* CPTMutablePlotRange.m in Sources */, + C38A0B081A46261700D45436 /* _CPTPlainWhiteTheme.m in Sources */, + C38A0AE21A4625D400D45436 /* CPTGridLineGroup.m in Sources */, + C38A09D91A461C6B00D45436 /* CPTNumericDataType.m in Sources */, + C38A0AC81A46256500D45436 /* CPTPlot.m in Sources */, + C38A0B1F1A46264500D45436 /* CPTPlatformSpecificCategories.m in Sources */, + C38A0A3F1A461EEB00D45436 /* CPTConstraints.m in Sources */, + C38A0A4B1A461F1A00D45436 /* CPTTextStyle.m in Sources */, + C38A09FF1A461D1D00D45436 /* CPTFunctionDataSource.m in Sources */, + C38A0AA21A4621AC00D45436 /* NSNumberExtensions.m in Sources */, + C38A0A091A461D4D00D45436 /* CPTBorderedLayer.m in Sources */, + C38A0A6B1A4620E200D45436 /* CPTLineStyle.m in Sources */, + C38A0A241A461E9200D45436 /* _CPTAnimationCGSizePeriod.m in Sources */, + C38A0ACA1A46256500D45436 /* CPTPieChart.m in Sources */, + C38A0A671A4620E200D45436 /* CPTColorSpace.m in Sources */, + C38A0A681A4620E200D45436 /* CPTGradient.m in Sources */, + C38A09F61A461D0000D45436 /* CPTUtilities.m in Sources */, + C38A0B051A46261700D45436 /* _CPTXYTheme.m in Sources */, + C38A0AAA1A46240900D45436 /* CPTXYGraph.m in Sources */, + C38A0AB11A46241700D45436 /* CPTPlotArea.m in Sources */, + C38A0A421A461EF500D45436 /* _CPTConstraintsFixed.m in Sources */, + C38A0ADF1A4625D400D45436 /* CPTAxis.m in Sources */, + C38A0A4E1A461F2200D45436 /* CPTMutableTextStyle.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C38A097E1A46185300D45436 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C38A09E41A461CAD00D45436 /* CPTMutableNumericDataTests.m in Sources */, + C38A0A871A46210A00D45436 /* CPTColorSpaceTests.m in Sources */, + C38A0A881A46210A00D45436 /* CPTFillTests.m in Sources */, + C38A0A031A461D3100D45436 /* CPTUtilitiesTests.m in Sources */, + C38A0A891A46210A00D45436 /* CPTGradientTests.m in Sources */, + C38A0B131A46261F00D45436 /* CPTDarkGradientThemeTests.m in Sources */, + C38A0ADD1A4625C900D45436 /* CPTAxisLabelTests.m in Sources */, + C38A0B121A46261F00D45436 /* CPTThemeTests.m in Sources */, + C38A0A861A46210A00D45436 /* CPTColorTests.m in Sources */, + C38A0ABC1A46250B00D45436 /* CPTPlotSpaceTests.m in Sources */, + C38A0A8A1A46210A00D45436 /* CPTImageTests.m in Sources */, + C38A09D31A461C1800D45436 /* CPTDataSourceTestCase.m in Sources */, + C38A09E81A461CB600D45436 /* CPTNumericDataTests.m in Sources */, + C38A0B141A46261F00D45436 /* CPTDerivedXYGraph.m in Sources */, + C38A0ABD1A46250B00D45436 /* CPTXYPlotSpaceTests.m in Sources */, + C38A09D11A461C1100D45436 /* CPTTestCase.m in Sources */, + C38A0A011A461D2E00D45436 /* CPTPlotRangeTests.m in Sources */, + C38A09EA1A461CBA00D45436 /* CPTNumericDataTypeConversionTests.m in Sources */, + C38A09E61A461CB200D45436 /* CPTMutableNumericDataTypeConversionTests.m in Sources */, + C38A0A8B1A46210A00D45436 /* CPTLineStyleTests.m in Sources */, + C38A0A501A461F3D00D45436 /* CPTTextStyleTests.m in Sources */, + C377B3BC1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */, + C38A0A9B1A46219600D45436 /* CPTTimeFormatterTests.m in Sources */, + C38A0A121A461D6A00D45436 /* CPTLayerTests.m in Sources */, + C38A0AD81A46257600D45436 /* CPTScatterPlotTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C38A09B61A4619A900D45436 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C38A0A461A461F0200D45436 /* _CPTConstraintsRelative.m in Sources */, + C38A0ABB1A46250600D45436 /* CPTXYPlotSpace.m in Sources */, + C38A0A821A4620F800D45436 /* CPTFill.m in Sources */, + C38A09F41A461CF600D45436 /* CPTExceptions.m in Sources */, + C38A0AB51A46241800D45436 /* CPTLimitBand.m in Sources */, + C38A0A841A4620F800D45436 /* _CPTFillGradient.m in Sources */, + C38A0AED1A4625D500D45436 /* CPTAxisTitle.m in Sources */, + C38A0A851A4620F800D45436 /* _CPTFillImage.m in Sources */, + C38A09FA1A461D0C00D45436 /* CPTPlotRange.m in Sources */, + C38A0AEB1A4625D500D45436 /* CPTGridLineGroup.m in Sources */, + C38A0A491A461F1200D45436 /* CPTTextLayer.m in Sources */, + C38A0B111A46261700D45436 /* _CPTStocksTheme.m in Sources */, + C38A0AD71A46257200D45436 /* CPTPlotSymbol.m in Sources */, + C38A0A0A1A461D4D00D45436 /* CPTBorderedLayer.m in Sources */, + C38A0AD11A46256600D45436 /* CPTPieChart.m in Sources */, + C38A0AB41A46241800D45436 /* CPTPlotArea.m in Sources */, + C38A0A771A4620E200D45436 /* CPTPathExtensions.m in Sources */, + C38A0AE91A4625D500D45436 /* CPTAxisSet.m in Sources */, + C38A09E21A461C8900D45436 /* CPTMutableNumericData+TypeConversion.m in Sources */, + C38A0A251A461E9300D45436 /* _CPTAnimationCGSizePeriod.m in Sources */, + C38A0B201A46264500D45436 /* CPTPlatformSpecificCategories.m in Sources */, + C38A0AEF1A4625D500D45436 /* CPTXYAxis.m in Sources */, + C38A09DA1A461C6C00D45436 /* CPTNumericDataType.m in Sources */, + C38A0AD41A46256600D45436 /* CPTTradingRangePlot.m in Sources */, + C38A0ABA1A46250600D45436 /* CPTPlotSpace.m in Sources */, + C38A0A281A461E9B00D45436 /* _CPTAnimationCGRectPeriod.m in Sources */, + C38A0AEC1A4625D500D45436 /* CPTAxisLabel.m in Sources */, + C3BB3C931C1661BE00B8742D /* _CPTAnimationNSNumberPeriod.m in Sources */, + C38A0A991A46219200D45436 /* CPTCalendarFormatter.m in Sources */, + C38A0A3A1A461ED700D45436 /* CPTLayerAnnotation.m in Sources */, + C38A0B231A46264500D45436 /* CPTPlatformSpecificDefines.m in Sources */, + C38A0AD21A46256600D45436 /* CPTRangePlot.m in Sources */, + C38A0A571A461F9700D45436 /* CPTTextStylePlatformSpecific.m in Sources */, + C38A0A341A461EC300D45436 /* CPTAnnotation.m in Sources */, + C38A0AFB1A4625FB00D45436 /* CPTLegend.m in Sources */, + C38A0AA51A4621AD00D45436 /* NSNumberExtensions.m in Sources */, + C38A0A791A4620E200D45436 /* CPTMutableShadow.m in Sources */, + C38A0B0D1A46261700D45436 /* _CPTDarkGradientTheme.m in Sources */, + C38A0AE81A4625D500D45436 /* CPTAxis.m in Sources */, + C38A0AEE1A4625D500D45436 /* CPTAxisLabelGroup.m in Sources */, + C38A0AFC1A4625FB00D45436 /* CPTLegendEntry.m in Sources */, + C38A0A401A461EEB00D45436 /* CPTConstraints.m in Sources */, + C38A0A1F1A461E7B00D45436 /* _CPTAnimationCGFloatPeriod.m in Sources */, + C38A0AB31A46241800D45436 /* CPTPlotAreaFrame.m in Sources */, + C38A0B0C1A46261700D45436 /* _CPTXYTheme.m in Sources */, + C38A0A371A461ECD00D45436 /* CPTPlotSpaceAnnotation.m in Sources */, + C38A0A191A461E6100D45436 /* CPTAnimationOperation.m in Sources */, + C38A0ACF1A46256600D45436 /* CPTPlot.m in Sources */, + C38A0A101A461D5F00D45436 /* _CPTMaskLayer.m in Sources */, + C38A0ACE1A46256600D45436 /* CPTPlotGroup.m in Sources */, + C38A0A781A4620E200D45436 /* CPTShadow.m in Sources */, + C38A0B0B1A46261700D45436 /* CPTTheme.m in Sources */, + C38A0A431A461EF600D45436 /* _CPTConstraintsFixed.m in Sources */, + C38A09FD1A461D1400D45436 /* CPTMutablePlotRange.m in Sources */, + C38A09F71A461D0100D45436 /* CPTUtilities.m in Sources */, + C38A0A721A4620E200D45436 /* CPTGradient.m in Sources */, + C38A0A9A1A46219200D45436 /* CPTTimeFormatter.m in Sources */, + C38A0A161A461E5800D45436 /* CPTAnimation.m in Sources */, + C38A0AAC1A46240A00D45436 /* CPTXYGraph.m in Sources */, + C38A0A751A4620E200D45436 /* CPTLineStyle.m in Sources */, + C38A09DE1A461C8100D45436 /* CPTMutableNumericData.m in Sources */, + C38A0B0E1A46261700D45436 /* _CPTPlainBlackTheme.m in Sources */, + C38A0B2B1A46265300D45436 /* CPTGraphHostingView.m in Sources */, + C38A0B261A46264500D45436 /* CPTPlatformSpecificFunctions.m in Sources */, + C38A0A1C1A461E6B00D45436 /* CPTAnimationPeriod.m in Sources */, + C38A0AA31A4621AD00D45436 /* NSCoderExtensions.m in Sources */, + C38A0AEA1A4625D500D45436 /* CPTGridLines.m in Sources */, + C38A09DC1A461C7D00D45436 /* CPTNumericData.m in Sources */, + C38A0A2E1A461EAE00D45436 /* _CPTAnimationPlotRangePeriod.m in Sources */, + C38A0B0F1A46261700D45436 /* _CPTPlainWhiteTheme.m in Sources */, + C38A0A701A4620E200D45436 /* CPTColor.m in Sources */, + C38A09F11A461CDA00D45436 /* CPTDefinitions.m in Sources */, + C38A0AAB1A46240A00D45436 /* CPTGraph.m in Sources */, + C38A0AA41A4621AD00D45436 /* NSDecimalNumberExtensions.m in Sources */, + C38A0A4F1A461F2200D45436 /* CPTMutableTextStyle.m in Sources */, + C38A0A831A4620F800D45436 /* _CPTFillColor.m in Sources */, + C38A0A761A4620E200D45436 /* CPTMutableLineStyle.m in Sources */, + C38A0A731A4620E200D45436 /* CPTImage.m in Sources */, + C38A0AF01A4625D500D45436 /* CPTXYAxisSet.m in Sources */, + C38A09E01A461C8500D45436 /* CPTNumericData+TypeConversion.m in Sources */, + C38A0A3D1A461EE000D45436 /* CPTAnnotationHostLayer.m in Sources */, + C38A0A311A461EB600D45436 /* _CPTAnimationTimingFunctions.m in Sources */, + C38A0A5B1A4620B800D45436 /* CPTImagePlatformSpecific.m in Sources */, + C38A0A4C1A461F1B00D45436 /* CPTTextStyle.m in Sources */, + C38A0B101A46261700D45436 /* _CPTSlateTheme.m in Sources */, + C38A0AD31A46256600D45436 /* CPTScatterPlot.m in Sources */, + C38A0A0D1A461D5800D45436 /* _CPTBorderLayer.m in Sources */, + C38A0A711A4620E200D45436 /* CPTColorSpace.m in Sources */, + C38A0A001A461D1D00D45436 /* CPTFunctionDataSource.m in Sources */, + C38A0A221A461E8C00D45436 /* _CPTAnimationCGPointPeriod.m in Sources */, + C38A0A2B1A461EA600D45436 /* _CPTAnimationNSDecimalPeriod.m in Sources */, + C38A0A741A4620E200D45436 /* CPTLineCap.m in Sources */, + C38A0AD01A46256600D45436 /* CPTBarPlot.m in Sources */, + C38A0A071A461D4500D45436 /* CPTLayer.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C38A09C01A4619A900D45436 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C38A09D41A461C1900D45436 /* CPTDataSourceTestCase.m in Sources */, + C38A0ADE1A4625CA00D45436 /* CPTAxisLabelTests.m in Sources */, + C38A09EB1A461CBB00D45436 /* CPTNumericDataTypeConversionTests.m in Sources */, + C38A0A8D1A46210A00D45436 /* CPTColorSpaceTests.m in Sources */, + C38A0A8F1A46210A00D45436 /* CPTGradientTests.m in Sources */, + C38A09D21A461C1300D45436 /* CPTTestCase.m in Sources */, + C38A0ABE1A46250C00D45436 /* CPTPlotSpaceTests.m in Sources */, + C38A0AD91A46257700D45436 /* CPTScatterPlotTests.m in Sources */, + C38A0A041A461D3200D45436 /* CPTUtilitiesTests.m in Sources */, + C38A0B151A46262000D45436 /* CPTThemeTests.m in Sources */, + C38A0A901A46210A00D45436 /* CPTImageTests.m in Sources */, + C38A0A911A46210A00D45436 /* CPTLineStyleTests.m in Sources */, + C38A0A021A461D2E00D45436 /* CPTPlotRangeTests.m in Sources */, + C38A0B171A46262000D45436 /* CPTDerivedXYGraph.m in Sources */, + C38A09E71A461CB300D45436 /* CPTMutableNumericDataTypeConversionTests.m in Sources */, + C38A0A8E1A46210A00D45436 /* CPTFillTests.m in Sources */, + C38A09E91A461CB700D45436 /* CPTNumericDataTests.m in Sources */, + C38A0ABF1A46250C00D45436 /* CPTXYPlotSpaceTests.m in Sources */, + C38A09E51A461CAE00D45436 /* CPTMutableNumericDataTests.m in Sources */, + C38A0B161A46262000D45436 /* CPTDarkGradientThemeTests.m in Sources */, + C38A0A131A461D6B00D45436 /* CPTLayerTests.m in Sources */, + C377B3BD1C122AA600891DF8 /* CPTCalendarFormatterTests.m in Sources */, + C38A0A9C1A46219700D45436 /* CPTTimeFormatterTests.m in Sources */, + C38A0A511A461F3D00D45436 /* CPTTextStyleTests.m in Sources */, + C38A0A8C1A46210A00D45436 /* CPTColorTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 0730F6221094932900E95162 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 8DC2EF4F0486A6940098B216 /* CorePlot */; + target = 8DC2EF4F0486A6940098B216 /* CorePlot Mac */; targetProxy = 0730F6211094932900E95162 /* PBXContainerItemProxy */; }; + C38A09851A46185300D45436 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C38A09771A46185200D45436 /* CorePlot iOS */; + targetProxy = C38A09841A46185300D45436 /* PBXContainerItemProxy */; + }; + C38A09C71A4619A900D45436 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C38A09B91A4619A900D45436 /* CorePlot-CocoaTouch */; + targetProxy = C38A09C61A4619A900D45436 /* PBXContainerItemProxy */; + }; + C3B4D4961BC997F600450C37 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C37EA5C91BC83F2A0091C8F7 /* CorePlot tvOS */; + targetProxy = C3B4D4951BC997F600450C37 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 089C1666FE841158C02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( - 089C1667FE841158C02AAC07 /* English */, + C3564CBD22A2D0E1000A54C9 /* en */, ); name = InfoPlist.strings; sourceTree = ""; }; - 4C993FF30F45EE2F00DC824F /* MainMenu.xib */ = { + C3490DF220E028CF0089F309 /* CorePlot-Info.plist */ = { isa = PBXVariantGroup; children = ( - 4C993FF00F45EE1600DC824F /* English */, + C3490DF120E028CF0089F309 /* Base */, ); - name = MainMenu.xib; + name = "CorePlot-Info.plist"; + path = Info; sourceTree = ""; }; + C3490DF420E028D30089F309 /* CorePlot-CocoaTouch-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C3490DF320E028D30089F309 /* Base */, + ); + name = "CorePlot-CocoaTouch-Info.plist"; + path = Info/Base.lproj; + sourceTree = ""; + }; + C3490DF620E028D80089F309 /* CorePlot-iOS-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C3490DF520E028D80089F309 /* Base */, + ); + name = "CorePlot-iOS-Info.plist"; + path = Info/Base.lproj; + sourceTree = ""; + }; + C3490DF820E028DC0089F309 /* CorePlot-tvOS-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C3490DF720E028DC0089F309 /* Base */, + ); + name = "CorePlot-tvOS-Info.plist"; + path = "/Users/eskroch/Projects/Core Plot/framework/Info/Base.lproj"; + sourceTree = ""; + }; + C37A406420E02B9D00C4FF48 /* CorePlot-tvOSTests-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A406320E02B9D00C4FF48 /* Base */, + ); + name = "CorePlot-tvOSTests-Info.plist"; + path = "/Users/eskroch/Projects/Core Plot/framework/Info"; + sourceTree = ""; + }; + C37A406620E02BA100C4FF48 /* CorePlot-CocoaTouchTests-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A406520E02BA100C4FF48 /* Base */, + ); + name = "CorePlot-CocoaTouchTests-Info.plist"; + path = Info; + sourceTree = SOURCE_ROOT; + }; + C37A406820E02BA500C4FF48 /* CorePlot-iOSTests-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A406720E02BA500C4FF48 /* Base */, + ); + name = "CorePlot-iOSTests-Info.plist"; + path = Info; + sourceTree = SOURCE_ROOT; + }; + C37A406A20E02BE900C4FF48 /* CorePlotTests-Info.plist */ = { + isa = PBXVariantGroup; + children = ( + C37A406920E02BE900C4FF48 /* Base */, + ); + name = "CorePlotTests-Info.plist"; + path = Info; + sourceTree = SOURCE_ROOT; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 0730F602109492D900E95162 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C31908A41998168C00B61898 /* CorePlot.xcconfig */; + baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COMBINE_HIDPI_IMAGES = YES; - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_FRAMEWORKS_DIR)", - ); - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; - INFOPLIST_FILE = "UnitTests-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlotTests-Info.plist"; INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; - OTHER_LDFLAGS = ( - "-framework", - Cocoa, - ); PRODUCT_NAME = UnitTests; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/MacOnly"; }; name = Debug; }; 0730F603109492D900E95162 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C31908A41998168C00B61898 /* CorePlot.xcconfig */; + baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COMBINE_HIDPI_IMAGES = YES; - COPY_PHASE_STRIP = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(DEVELOPER_FRAMEWORKS_DIR)", - ); - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h"; - INFOPLIST_FILE = "UnitTests-Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlotTests-Info.plist"; INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles"; - OTHER_LDFLAGS = ( - "-framework", - Cocoa, - ); PRODUCT_NAME = UnitTests; - ZERO_LINK = NO; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/MacOnly"; }; name = Release; }; 1DEB91AE08733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C31908A41998168C00B61898 /* CorePlot.xcconfig */; + baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_SEARCH_PATHS = ""; FRAMEWORK_VERSION = A; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = CorePlot_Prefix.pch; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "@loader_path/../Frameworks"; - ONLY_ACTIVE_ARCH = YES; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-Info.plist"; + INSTALL_PATH = "@rpath"; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = CorePlot; - SKIP_INSTALL = YES; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/MacOnly"; WRAPPER_EXTENSION = framework; }; name = Debug; }; 1DEB91AF08733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C31908A41998168C00B61898 /* CorePlot.xcconfig */; + baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_SEARCH_PATHS = ""; FRAMEWORK_VERSION = A; - GCC_OPTIMIZATION_LEVEL = 3; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = CorePlot_Prefix.pch; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "@loader_path/../Frameworks"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-Info.plist"; + INSTALL_PATH = "@rpath"; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = CorePlot; - SKIP_INSTALL = YES; - "VALID_ARCHS[sdk=*]" = "i386 x86_64"; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/MacOnly"; WRAPPER_EXTENSION = framework; }; name = Release; }; 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; buildSettings = { - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ""; - LINKER_DISPLAYS_MANGLED_NAMES = NO; - MACOSX_DEPLOYMENT_TARGET = 10.7; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CURRENT_PROJECT_VERSION = 2.3; + ENABLE_TESTABILITY = YES; + GCC_NO_COMMON_BLOCKS = YES; ONLY_ACTIVE_ARCH = YES; - OTHER_CFLAGS = ( - "-Weverything", - "-Wno-unused-parameter", - "-Wno-undef", - "-Wno-switch-enum", - "-Wno-float-equal", - "-Wno-padded", - "-Wno-dollar-in-identifier-extension", - "-Wno-custom-atomic-properties", - "-Wno-gnu", - "-Wno-assign-enum", - "-Wno-pedantic", - "-Wno-documentation", - ); - OTHER_LDFLAGS = ""; - RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = macosx; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "$(PROJECT_DIR)/../build"; }; name = Debug; }; 1DEB91B308733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; buildSettings = { - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEPLOYMENT_POSTPROCESSING = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_PREPROCESSOR_DEFINITIONS = ""; - LINKER_DISPLAYS_MANGLED_NAMES = NO; - MACOSX_DEPLOYMENT_TARGET = 10.7; - OTHER_CFLAGS = ( - "-Weverything", - "-Wno-unused-parameter", - "-Wno-undef", - "-Wno-switch-enum", - "-Wno-float-equal", - "-Wno-padded", - "-Wno-dollar-in-identifier-extension", - "-Wno-custom-atomic-properties", - "-Wno-gnu", - "-Wno-assign-enum", - "-Wno-pedantic", - "-Wno-documentation", - ); - OTHER_LDFLAGS = ""; - RUN_CLANG_STATIC_ANALYZER = NO; - SDKROOT = macosx; - STRIP_INSTALLED_PRODUCT = YES; - SYMROOT = "$(PROJECT_DIR)/../build"; - "VALID_ARCHS[sdk=*]" = ""; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CURRENT_PROJECT_VERSION = 2.3; + GCC_NO_COMMON_BLOCKS = YES; }; name = Release; }; @@ -1759,7 +3360,6 @@ COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; - GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; PRODUCT_NAME = Documentation; @@ -1779,10 +3379,332 @@ }; name = Release; }; + C37EA5C71BC83E900091C8F7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SUPPORTED_PLATFORMS = "appletvsimulator appletvos"; + }; + name = Debug; + }; + C37EA5C81BC83E900091C8F7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SUPPORTED_PLATFORMS = "appletvsimulator appletvos"; + ZERO_LINK = NO; + }; + name = Release; + }; + C37EA6901BC83F2A0091C8F7 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-tvOS-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = CorePlot; + SDKROOT = appletvos; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Debug; + }; + C37EA6911BC83F2A0091C8F7 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-tvOS-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = CorePlot; + SDKROOT = appletvos; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Release; + }; + C37EA6B51BC83F2D0091C8F7 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-tvOSTests-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Debug; + }; + C37EA6B61BC83F2D0091C8F7 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-tvOSTests-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Release; + }; + C38A098B1A46185300D45436 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-iOS-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = CorePlot; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Debug; + }; + C38A098C1A46185300D45436 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-iOS-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = CorePlot; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Release; + }; + C38A098D1A46185300D45436 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-iOSTests-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Debug; + }; + C38A098E1A46185300D45436 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-iOSTests-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Release; + }; + C38A09941A4618B600D45436 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + PRODUCT_NAME = "Documentation-Mac copy"; + }; + name = Debug; + }; + C38A09951A4618B600D45436 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + PRODUCT_NAME = "Documentation-Mac copy"; + ZERO_LINK = NO; + }; + name = Release; + }; + C38A09991A46193F00D45436 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + PRODUCT_NAME = "Documentation-iOS copy"; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + }; + name = Debug; + }; + C38A099A1A46193F00D45436 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + PRODUCT_NAME = "Documentation-iOS copy"; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + ZERO_LINK = NO; + }; + name = Release; + }; + C38A09CC1A4619A900D45436 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-CocoaTouch-Info.plist"; + INSTALL_PATH = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Debug; + }; + C38A09CD1A4619A900D45436 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-CocoaTouch-Info.plist"; + INSTALL_PATH = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Release; + }; + C38A09CF1A4619A900D45436 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08C1BB5A44800931F32 /* CorePlotDebug.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-CocoaTouchTests-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Debug; + }; + C38A09D01A4619A900D45436 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = C3C9D08D1BB5A45B00931F32 /* CorePlotRelease.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + INFOPLIST_FILE = "$(SRCROOT)/Info/Base.lproj/CorePlot-CocoaTouchTests-Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = "com.CorePlot.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/Source $(SRCROOT)/iPhoneOnly"; + }; + name = Release; + }; + C3A546821BC1A817005C1BBC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + }; + name = Debug; + }; + C3A546831BC1A817005C1BBC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DOXYGEN_PATH = /Applications/Doxygen.app/Contents/Resources/doxygen; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; + ZERO_LINK = NO; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 0730F604109492D900E95162 /* Build configuration list for PBXNativeTarget "UnitTests" */ = { + 0730F604109492D900E95162 /* Build configuration list for PBXNativeTarget "UnitTests Mac" */ = { isa = XCConfigurationList; buildConfigurations = ( 0730F602109492D900E95162 /* Debug */, @@ -1791,7 +3713,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "CorePlot" */ = { + 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "CorePlot Mac" */ = { isa = XCConfigurationList; buildConfigurations = ( 1DEB91AE08733DA50010E9CD /* Debug */, @@ -1809,7 +3731,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 9021E4A10FC5C9FB00443472 /* Build configuration list for PBXAggregateTarget "Documentation" */ = { + 9021E4A10FC5C9FB00443472 /* Build configuration list for PBXAggregateTarget "Documentation-Mac" */ = { isa = XCConfigurationList; buildConfigurations = ( 9021E49F0FC5C9DD00443472 /* Debug */, @@ -1818,6 +3740,96 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + C37EA5C61BC83E900091C8F7 /* Build configuration list for PBXAggregateTarget "Universal tvOS Framework" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C37EA5C71BC83E900091C8F7 /* Debug */, + C37EA5C81BC83E900091C8F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C37EA68F1BC83F2A0091C8F7 /* Build configuration list for PBXNativeTarget "CorePlot tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C37EA6901BC83F2A0091C8F7 /* Debug */, + C37EA6911BC83F2A0091C8F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C37EA6B41BC83F2D0091C8F7 /* Build configuration list for PBXNativeTarget "UnitTests tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C37EA6B51BC83F2D0091C8F7 /* Debug */, + C37EA6B61BC83F2D0091C8F7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C38A098F1A46185300D45436 /* Build configuration list for PBXNativeTarget "CorePlot iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C38A098B1A46185300D45436 /* Debug */, + C38A098C1A46185300D45436 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C38A09901A46185300D45436 /* Build configuration list for PBXNativeTarget "UnitTests iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C38A098D1A46185300D45436 /* Debug */, + C38A098E1A46185300D45436 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C38A09931A4618B600D45436 /* Build configuration list for PBXAggregateTarget "Documentation-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C38A09941A4618B600D45436 /* Debug */, + C38A09951A4618B600D45436 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C38A09981A46193F00D45436 /* Build configuration list for PBXAggregateTarget "Universal Library" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C38A09991A46193F00D45436 /* Debug */, + C38A099A1A46193F00D45436 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C38A09CB1A4619A900D45436 /* Build configuration list for PBXNativeTarget "CorePlot-CocoaTouch" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C38A09CC1A4619A900D45436 /* Debug */, + C38A09CD1A4619A900D45436 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C38A09CE1A4619A900D45436 /* Build configuration list for PBXNativeTarget "CorePlot-CocoaTouchTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C38A09CF1A4619A900D45436 /* Debug */, + C38A09D01A4619A900D45436 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C3A546811BC1A817005C1BBC /* Build configuration list for PBXAggregateTarget "Universal iOS Framework" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C3A546821BC1A817005C1BBC /* Debug */, + C3A546831BC1A817005C1BBC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 0867D690FE84028FC02AAC07 /* Project object */; diff --git a/framework/CorePlot.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/framework/CorePlot.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/framework/CorePlot.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/framework/CorePlot.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/framework/CorePlot.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..0c67376eb --- /dev/null +++ b/framework/CorePlot.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,5 @@ + + + + + diff --git a/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot Mac.xcscheme b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot Mac.xcscheme new file mode 100644 index 000000000..6567660c2 --- /dev/null +++ b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot Mac.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot iOS.xcscheme b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot iOS.xcscheme new file mode 100644 index 000000000..c76f66453 --- /dev/null +++ b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot iOS.xcscheme @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot tvOS.xcscheme b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot tvOS.xcscheme new file mode 100644 index 000000000..d81d4d80a --- /dev/null +++ b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot tvOS.xcscheme @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot-CocoaTouch.xcscheme b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot-CocoaTouch.xcscheme new file mode 100644 index 000000000..fe0aaaaef --- /dev/null +++ b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/CorePlot-CocoaTouch.xcscheme @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Documentation-Mac.xcscheme b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Documentation-Mac.xcscheme new file mode 100644 index 000000000..659889d19 --- /dev/null +++ b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Documentation-Mac.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Documentation-iOS.xcscheme b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Documentation-iOS.xcscheme new file mode 100644 index 000000000..3442d658f --- /dev/null +++ b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Documentation-iOS.xcscheme @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Universal Library.xcscheme b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Universal Library.xcscheme new file mode 100644 index 000000000..02086de38 --- /dev/null +++ b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Universal Library.xcscheme @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Universal iOS Framework.xcscheme b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Universal iOS Framework.xcscheme new file mode 100644 index 000000000..12a6c18d2 --- /dev/null +++ b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Universal iOS Framework.xcscheme @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Universal tvOS Framework.xcscheme b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Universal tvOS Framework.xcscheme new file mode 100644 index 000000000..c45a23509 --- /dev/null +++ b/framework/CorePlot.xcodeproj/xcshareddata/xcschemes/Universal tvOS Framework.xcscheme @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/framework/CorePlotWarnings.xcconfig b/framework/CorePlotWarnings.xcconfig deleted file mode 100644 index f439551f7..000000000 --- a/framework/CorePlotWarnings.xcconfig +++ /dev/null @@ -1,33 +0,0 @@ -GCC_TREAT_WARNINGS_AS_ERRORS = YES -GCC_WARN_CHECK_SWITCH_STATEMENTS = YES -CLANG_WARN_DOCUMENTATION_COMMENTS = YES -GCC_WARN_SHADOW = YES -GCC_WARN_64_TO_32_BIT_CONVERSION = YES -CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES -GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES -GCC_WARN_ABOUT_RETURN_TYPE = YES -GCC_WARN_MISSING_PARENTHESES = YES -GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES -GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES -GCC_WARN_ABOUT_MISSING_NEWLINE = YES -GCC_WARN_SIGN_COMPARE = YES -CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES -GCC_WARN_UNINITIALIZED_AUTOS = YES -GCC_WARN_UNUSED_FUNCTION = YES -GCC_WARN_UNUSED_LABEL = YES -GCC_WARN_UNUSED_VALUE = YES -GCC_WARN_UNUSED_VARIABLE = YES -GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES -GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES -CLANG_WARN_ASSIGN_ENUM = YES -CLANG_WARN__DUPLICATE_METHOD_MATCH = YES -CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES -GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = NO -CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES -GCC_WARN_UNDECLARED_SELECTOR = YES -CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES -CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES -CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES -CLANG_WARN_OBJC_RECEIVER_WEAK = YES - -OTHER_CFLAGS = -Weverything -Wno-unused-parameter -Wno-undef -Wno-switch-enum -Wno-float-equal -Wno-padded -Wno-dollar-in-identifier-extension -Wno-custom-atomic-properties -Wno-gnu -Wno-assign-enum -Wno-pedantic -Wno-documentation -Wno-unknown-warning-option -Wno-cstring-format-directive -Wno-documentation-unknown-command -Wno-reserved-id-macro -Wno-incompatible-pointer-types-discards-qualifiers diff --git a/framework/CorePlot_Prefix.pch b/framework/CorePlot_Prefix.pch index 90cccac65..650702d34 100644 --- a/framework/CorePlot_Prefix.pch +++ b/framework/CorePlot_Prefix.pch @@ -1,13 +1,13 @@ // -// Prefix header for all source files of the 'CorePlot' target in the 'CorePlot' project. +// Prefix header for all source files in the 'CorePlot' project. // #ifdef __OBJC__ - #include + #import #import - #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE + #if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_TV #import #import #else diff --git a/framework/English.lproj/MainMenu.xib b/framework/English.lproj/MainMenu.xib deleted file mode 100644 index d208a6d34..000000000 --- a/framework/English.lproj/MainMenu.xib +++ /dev/null @@ -1,3098 +0,0 @@ - - - - 1050 - 9G55 - 670 - 949.43 - 353.00 - - YES - - - - - YES - com.apple.InterfaceBuilderKit - com.apple.InterfaceBuilder.CocoaPlugin - - - YES - - NSApplication - - - FirstResponder - - - NSApplication - - - NSFontManager - - - AMainMenu - - YES - - - NewApplication - - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - NewApplication - - YES - - - About NewApplication - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - UHJlZmVyZW5jZXPigKY - , - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Services - - 2147483647 - - - submenuAction: - - Services - - YES - - _NSServicesMenu - - - - - YES - YES - - - 2147483647 - - - - - - Hide NewApplication - h - 1048576 - 2147483647 - - - - - - Hide Others - h - 1572864 - 2147483647 - - - - - - Show All - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Quit NewApplication - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - - File - - 2147483647 - - - submenuAction: - - File - - YES - - - New - n - 1048576 - 2147483647 - - - - - - T3BlbuKApg - o - 1048576 - 2147483647 - - - - - - Open Recent - - 2147483647 - - - submenuAction: - - Open Recent - - YES - - - Clear Menu - - 2147483647 - - - - - _NSRecentDocumentsMenu - - - - - YES - YES - - - 2147483647 - - - - - - Close - w - 1048576 - 2147483647 - - - - - - Save - s - 1048576 - 2147483647 - - - - - - U2F2ZSBBc+KApg - S - 1179648 - 2147483647 - - - - - - Revert to Saved - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Page Setup... - P - 1179648 - 2147483647 - - - - - - - UHJpbnTigKY - p - 1048576 - 2147483647 - - - - - - - - - Edit - - 2147483647 - - - submenuAction: - - Edit - - YES - - - Undo - z - 1048576 - 2147483647 - - - - - - Redo - Z - 1179648 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Cut - x - 1048576 - 2147483647 - - - - - - Copy - c - 1048576 - 2147483647 - - - - - - Paste - v - 1048576 - 2147483647 - - - - - - Delete - - 2147483647 - - - - - - Select All - a - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Find - - 2147483647 - - - submenuAction: - - Find - - YES - - - RmluZOKApg - f - 1048576 - 2147483647 - - - 1 - - - - Find Next - g - 1048576 - 2147483647 - - - 2 - - - - Find Previous - G - 1179648 - 2147483647 - - - 3 - - - - Use Selection for Find - e - 1048576 - 2147483647 - - - 7 - - - - Jump to Selection - j - 1048576 - 2147483647 - - - - - - - - - Spelling and Grammar - - 2147483647 - - - submenuAction: - - Spelling and Grammar - - YES - - - U2hvdyBTcGVsbGluZ+KApg - : - 1048576 - 2147483647 - - - - - - Check Spelling - ; - 1048576 - 2147483647 - - - - - - Check Spelling While Typing - - 2147483647 - - - - - - Check Grammar With Spelling - - 2147483647 - - - - - - - - - Substitutions - - 2147483647 - - - submenuAction: - - Substitutions - - YES - - - Smart Copy/Paste - f - 1048576 - 2147483647 - - - 1 - - - - Smart Quotes - g - 1048576 - 2147483647 - - - 2 - - - - Smart Links - G - 1179648 - 2147483647 - - - 3 - - - - - - - Speech - - 2147483647 - - - submenuAction: - - Speech - - YES - - - Start Speaking - - 2147483647 - - - - - - Stop Speaking - - 2147483647 - - - - - - - - - - - - Format - - 2147483647 - - - submenuAction: - - Format - - YES - - - Font - - 2147483647 - - - submenuAction: - - Font - - YES - - - Show Fonts - t - 1048576 - 2147483647 - - - - - - Bold - b - 1048576 - 2147483647 - - - 2 - - - - Italic - i - 1048576 - 2147483647 - - - 1 - - - - Underline - u - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bigger - + - 1048576 - 2147483647 - - - 3 - - - - Smaller - - - 1048576 - 2147483647 - - - 4 - - - - YES - YES - - - 2147483647 - - - - - - Kern - - 2147483647 - - - submenuAction: - - Kern - - YES - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Tighten - - 2147483647 - - - - - - Loosen - - 2147483647 - - - - - - - - - Ligature - - 2147483647 - - - submenuAction: - - Ligature - - YES - - - Use Default - - 2147483647 - - - - - - Use None - - 2147483647 - - - - - - Use All - - 2147483647 - - - - - - - - - Baseline - - 2147483647 - - - submenuAction: - - Baseline - - YES - - - Use Default - - 2147483647 - - - - - - Superscript - - 2147483647 - - - - - - Subscript - - 2147483647 - - - - - - Raise - - 2147483647 - - - - - - Lower - - 2147483647 - - - - - - - - - YES - YES - - - 2147483647 - - - - - - Show Colors - C - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Copy Style - c - 1572864 - 2147483647 - - - - - - Paste Style - v - 1572864 - 2147483647 - - - - - _NSFontMenu - - - - - Text - - 2147483647 - - - submenuAction: - - Text - - YES - - - Align Left - { - 1048576 - 2147483647 - - - - - - Center - | - 1048576 - 2147483647 - - - - - - Justify - - 2147483647 - - - - - - Align Right - } - 1048576 - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Show Ruler - - 2147483647 - - - - - - Copy Ruler - c - 1310720 - 2147483647 - - - - - - Paste Ruler - v - 1310720 - 2147483647 - - - - - - - - - - - - View - - 2147483647 - - - submenuAction: - - View - - YES - - - Show Toolbar - t - 1572864 - 2147483647 - - - - - - Q3VzdG9taXplIFRvb2xiYXLigKY - - 2147483647 - - - - - - - - - Window - - 2147483647 - - - submenuAction: - - Window - - YES - - - Minimize - m - 1048576 - 2147483647 - - - - - - Zoom - - 2147483647 - - - - - - YES - YES - - - 2147483647 - - - - - - Bring All to Front - - 2147483647 - - - - - _NSWindowsMenu - - - - - Help - - 2147483647 - - - submenuAction: - - Help - - YES - - - NewApplication Help - ? - 1048576 - 2147483647 - - - - - - - - _NSMainMenu - - - 15 - 2 - {{196, 240}, {480, 270}} - 603979776 - Window - NSWindow - - {3.40282e+38, 3.40282e+38} - - - 256 - {480, 270} - - - {{0, 0}, {1920, 1178}} - {3.40282e+38, 3.40282e+38} - - - - - YES - - - performMiniaturize: - - - - 37 - - - - arrangeInFront: - - - - 39 - - - - print: - - - - 86 - - - - runPageLayout: - - - - 87 - - - - clearRecentDocuments: - - - - 127 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - performClose: - - - - 193 - - - - toggleContinuousSpellChecking: - - - - 222 - - - - undo: - - - - 223 - - - - copy: - - - - 224 - - - - checkSpelling: - - - - 225 - - - - paste: - - - - 226 - - - - stopSpeaking: - - - - 227 - - - - cut: - - - - 228 - - - - showGuessPanel: - - - - 230 - - - - redo: - - - - 231 - - - - selectAll: - - - - 232 - - - - startSpeaking: - - - - 233 - - - - delete: - - - - 235 - - - - performZoom: - - - - 240 - - - - performFindPanelAction: - - - - 241 - - - - centerSelectionInVisibleArea: - - - - 245 - - - - toggleGrammarChecking: - - - - 347 - - - - toggleSmartInsertDelete: - - - - 355 - - - - toggleAutomaticQuoteSubstitution: - - - - 356 - - - - toggleAutomaticLinkDetection: - - - - 357 - - - - showHelp: - - - - 360 - - - - saveDocument: - - - - 362 - - - - saveDocumentAs: - - - - 363 - - - - revertDocumentToSaved: - - - - 364 - - - - runToolbarCustomizationPalette: - - - - 365 - - - - toggleToolbarShown: - - - - 366 - - - - hide: - - - - 369 - - - - hideOtherApplications: - - - - 370 - - - - unhideAllApplications: - - - - 372 - - - - addFontTrait: - - - - 420 - - - - addFontTrait: - - - - 421 - - - - modifyFont: - - - - 422 - - - - orderFrontFontPanel: - - - - 423 - - - - modifyFont: - - - - 424 - - - - raiseBaseline: - - - - 425 - - - - lowerBaseline: - - - - 426 - - - - copyFont: - - - - 427 - - - - subscript: - - - - 428 - - - - superscript: - - - - 429 - - - - tightenKerning: - - - - 430 - - - - underline: - - - - 431 - - - - orderFrontColorPanel: - - - - 432 - - - - useAllLigatures: - - - - 433 - - - - loosenKerning: - - - - 434 - - - - pasteFont: - - - - 435 - - - - unscript: - - - - 436 - - - - useStandardKerning: - - - - 437 - - - - useStandardLigatures: - - - - 438 - - - - turnOffLigatures: - - - - 439 - - - - turnOffKerning: - - - - 440 - - - - alignLeft: - - - - 441 - - - - alignJustified: - - - - 442 - - - - copyRuler: - - - - 443 - - - - alignCenter: - - - - 444 - - - - toggleRuler: - - - - 445 - - - - alignRight: - - - - 446 - - - - pasteRuler: - - - - 447 - - - - terminate: - - - - 448 - - - - - YES - - 0 - - YES - - - - - - -2 - - - RmlsZSdzIE93bmVyA - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - YES - - - - - - - - - - MainMenu - - - 19 - - - YES - - - - - - 56 - - - YES - - - - - - 103 - - - YES - - - - - - 217 - - - YES - - - - - - 83 - - - YES - - - - - - 81 - - - YES - - - - - - - - - - - - - - - - 75 - - - - - 80 - - - - - 78 - - - - - 72 - - - - - 82 - - - - - 124 - - - YES - - - - - - 77 - - - - - 73 - - - - - 79 - - - 7 - - - 112 - - - - - 74 - - - 2 - - - 125 - - - YES - - - - - - 126 - - - - - 205 - - - YES - - - - - - - - - - - - - - - - - - 202 - - - - - 198 - - - - - 207 - - - - - 214 - - - - - 199 - - - - - 203 - - - - - 197 - - - - - 206 - - - - - 215 - - - - - 218 - - - YES - - - - - - 216 - - - YES - - - - - - 200 - - - YES - - - - - - - - - 219 - - - - - 201 - - - - - 204 - - - - - 220 - - - YES - - - - - - - - - - 213 - - - - - 210 - - - - - 221 - - - - - 208 - - - - - 209 - - - - - 106 - - - YES - - - - 2 - - - 111 - - - - - 57 - - - YES - - - - - - - - - - - - - - - - 58 - - - - - 134 - - - - - 150 - - - - - 136 - - - - - 144 - - - - - 129 - - - - - 143 - - - - - 236 - - - - - 131 - - - YES - - - - - - 149 - - - - - 145 - - - - - 130 - - - - - 24 - - - YES - - - - - - - - - 92 - - - - - 5 - - - - - 239 - - - - - 23 - - - - - 295 - - - YES - - - - - - 296 - - - YES - - - - - - - 297 - - - - - 298 - - - - - 211 - - - YES - - - - - - 212 - - - YES - - - - - - - 195 - - - - - 196 - - - - - 346 - - - - - 348 - - - YES - - - - - - 349 - - - YES - - - - - - - - 350 - - - - - 351 - - - - - 354 - - - - - 367 - - - YES - - - - - - 368 - - - - - 373 - - - - - 375 - - - YES - - - - - - 376 - - - YES - - - - - - - 377 - - - YES - - - - - - 378 - - - YES - - - - - - 379 - - - YES - - - - - - - - - - - - - 380 - - - - - 381 - - - - - 382 - - - - - 383 - - - - - 384 - - - - - 385 - - - - - 386 - - - - - 387 - - - - - 388 - - - YES - - - - - - - - - - - - - - - - - - - - - 389 - - - - - 390 - - - - - 391 - - - - - 392 - - - - - 393 - - - - - 394 - - - - - 395 - - - - - 396 - - - - - 397 - - - YES - - - - - - 398 - - - YES - - - - - - 399 - - - YES - - - - - - 400 - - - - - 401 - - - - - 402 - - - - - 403 - - - - - 404 - - - - - 405 - - - YES - - - - - - - - - - 406 - - - - - 407 - - - - - 408 - - - - - 409 - - - - - 410 - - - - - 411 - - - YES - - - - - - - - 412 - - - - - 413 - - - - - 414 - - - - - 415 - - - YES - - - - - - - - - 416 - - - - - 417 - - - - - 418 - - - - - 419 - - - - - - - YES - - YES - -1.IBPluginDependency - -2.IBPluginDependency - -3.IBPluginDependency - 103.IBPluginDependency - 103.ImportedFromIB2 - 106.IBEditorWindowLastContentRect - 106.IBPluginDependency - 106.ImportedFromIB2 - 106.editorWindowContentRectSynchronizationRect - 111.IBPluginDependency - 111.ImportedFromIB2 - 112.IBPluginDependency - 112.ImportedFromIB2 - 124.IBPluginDependency - 124.ImportedFromIB2 - 125.IBEditorWindowLastContentRect - 125.IBPluginDependency - 125.ImportedFromIB2 - 125.editorWindowContentRectSynchronizationRect - 126.IBPluginDependency - 126.ImportedFromIB2 - 129.IBPluginDependency - 129.ImportedFromIB2 - 130.IBEditorWindowLastContentRect - 130.IBPluginDependency - 130.ImportedFromIB2 - 130.editorWindowContentRectSynchronizationRect - 131.IBPluginDependency - 131.ImportedFromIB2 - 134.IBPluginDependency - 134.ImportedFromIB2 - 136.IBPluginDependency - 136.ImportedFromIB2 - 143.IBPluginDependency - 143.ImportedFromIB2 - 144.IBPluginDependency - 144.ImportedFromIB2 - 145.IBPluginDependency - 145.ImportedFromIB2 - 149.IBPluginDependency - 149.ImportedFromIB2 - 150.IBPluginDependency - 150.ImportedFromIB2 - 19.IBPluginDependency - 19.ImportedFromIB2 - 195.IBPluginDependency - 195.ImportedFromIB2 - 196.IBPluginDependency - 196.ImportedFromIB2 - 197.IBPluginDependency - 197.ImportedFromIB2 - 198.IBPluginDependency - 198.ImportedFromIB2 - 199.IBPluginDependency - 199.ImportedFromIB2 - 200.IBEditorWindowLastContentRect - 200.IBPluginDependency - 200.ImportedFromIB2 - 200.editorWindowContentRectSynchronizationRect - 201.IBPluginDependency - 201.ImportedFromIB2 - 202.IBPluginDependency - 202.ImportedFromIB2 - 203.IBPluginDependency - 203.ImportedFromIB2 - 204.IBPluginDependency - 204.ImportedFromIB2 - 205.IBEditorWindowLastContentRect - 205.IBPluginDependency - 205.ImportedFromIB2 - 205.editorWindowContentRectSynchronizationRect - 206.IBPluginDependency - 206.ImportedFromIB2 - 207.IBPluginDependency - 207.ImportedFromIB2 - 208.IBPluginDependency - 208.ImportedFromIB2 - 209.IBPluginDependency - 209.ImportedFromIB2 - 210.IBPluginDependency - 210.ImportedFromIB2 - 211.IBPluginDependency - 211.ImportedFromIB2 - 212.IBEditorWindowLastContentRect - 212.IBPluginDependency - 212.ImportedFromIB2 - 212.editorWindowContentRectSynchronizationRect - 213.IBPluginDependency - 213.ImportedFromIB2 - 214.IBPluginDependency - 214.ImportedFromIB2 - 215.IBPluginDependency - 215.ImportedFromIB2 - 216.IBPluginDependency - 216.ImportedFromIB2 - 217.IBPluginDependency - 217.ImportedFromIB2 - 218.IBPluginDependency - 218.ImportedFromIB2 - 219.IBPluginDependency - 219.ImportedFromIB2 - 220.IBEditorWindowLastContentRect - 220.IBPluginDependency - 220.ImportedFromIB2 - 220.editorWindowContentRectSynchronizationRect - 221.IBPluginDependency - 221.ImportedFromIB2 - 23.IBPluginDependency - 23.ImportedFromIB2 - 236.IBPluginDependency - 236.ImportedFromIB2 - 239.IBPluginDependency - 239.ImportedFromIB2 - 24.IBEditorWindowLastContentRect - 24.IBPluginDependency - 24.ImportedFromIB2 - 24.editorWindowContentRectSynchronizationRect - 29.IBEditorWindowLastContentRect - 29.IBPluginDependency - 29.ImportedFromIB2 - 29.WindowOrigin - 29.editorWindowContentRectSynchronizationRect - 295.IBPluginDependency - 296.IBEditorWindowLastContentRect - 296.IBPluginDependency - 296.editorWindowContentRectSynchronizationRect - 297.IBPluginDependency - 298.IBPluginDependency - 346.IBPluginDependency - 346.ImportedFromIB2 - 348.IBPluginDependency - 348.ImportedFromIB2 - 349.IBEditorWindowLastContentRect - 349.IBPluginDependency - 349.ImportedFromIB2 - 349.editorWindowContentRectSynchronizationRect - 350.IBPluginDependency - 350.ImportedFromIB2 - 351.IBPluginDependency - 351.ImportedFromIB2 - 354.IBPluginDependency - 354.ImportedFromIB2 - 367.IBEditorWindowLastContentRect - 367.IBPluginDependency - 367.IBWindowTemplateEditedContentRect - 367.NSWindowTemplate.visibleAtLaunch - 367.editorWindowContentRectSynchronizationRect - 367.windowTemplate.maxSize - 368.IBPluginDependency - 375.IBPluginDependency - 376.IBEditorWindowLastContentRect - 376.IBPluginDependency - 377.IBPluginDependency - 378.IBPluginDependency - 379.IBPluginDependency - 380.IBPluginDependency - 381.IBPluginDependency - 382.IBPluginDependency - 383.IBPluginDependency - 384.IBPluginDependency - 385.IBPluginDependency - 386.IBPluginDependency - 387.IBPluginDependency - 388.IBEditorWindowLastContentRect - 388.IBPluginDependency - 389.IBPluginDependency - 390.IBPluginDependency - 391.IBPluginDependency - 392.IBPluginDependency - 393.IBPluginDependency - 394.IBPluginDependency - 395.IBPluginDependency - 396.IBPluginDependency - 397.IBPluginDependency - 398.IBPluginDependency - 399.IBPluginDependency - 400.IBPluginDependency - 401.IBPluginDependency - 402.IBPluginDependency - 403.IBPluginDependency - 404.IBPluginDependency - 405.IBPluginDependency - 406.IBPluginDependency - 407.IBPluginDependency - 408.IBPluginDependency - 409.IBPluginDependency - 410.IBPluginDependency - 411.IBPluginDependency - 412.IBPluginDependency - 413.IBPluginDependency - 414.IBPluginDependency - 415.IBPluginDependency - 416.IBPluginDependency - 417.IBPluginDependency - 418.IBPluginDependency - 419.IBPluginDependency - 5.IBPluginDependency - 5.ImportedFromIB2 - 56.IBPluginDependency - 56.ImportedFromIB2 - 57.IBEditorWindowLastContentRect - 57.IBPluginDependency - 57.ImportedFromIB2 - 57.editorWindowContentRectSynchronizationRect - 58.IBPluginDependency - 58.ImportedFromIB2 - 72.IBPluginDependency - 72.ImportedFromIB2 - 73.IBPluginDependency - 73.ImportedFromIB2 - 74.IBPluginDependency - 74.ImportedFromIB2 - 75.IBPluginDependency - 75.ImportedFromIB2 - 77.IBPluginDependency - 77.ImportedFromIB2 - 78.IBPluginDependency - 78.ImportedFromIB2 - 79.IBPluginDependency - 79.ImportedFromIB2 - 80.IBPluginDependency - 80.ImportedFromIB2 - 81.IBEditorWindowLastContentRect - 81.IBPluginDependency - 81.ImportedFromIB2 - 81.editorWindowContentRectSynchronizationRect - 82.IBPluginDependency - 82.ImportedFromIB2 - 83.IBPluginDependency - 83.ImportedFromIB2 - 92.IBPluginDependency - 92.ImportedFromIB2 - - - YES - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilderKit - com.apple.InterfaceBuilderKit - com.apple.InterfaceBuilder.CocoaPlugin - - {{523, 629}, {216, 23}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{596, 852}, {216, 23}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{449, 589}, {132, 23}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{522, 812}, {146, 23}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{509, 573}, {64, 6}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{436, 809}, {64, 6}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{535, 389}, {275, 83}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{608, 612}, {275, 83}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{292, 409}, {243, 243}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{365, 632}, {243, 243}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{535, 389}, {153, 43}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{608, 612}, {167, 43}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{681, 376}, {241, 103}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{608, 612}, {241, 103}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{452, 579}, {197, 73}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{525, 802}, {197, 73}} - {{106, 652}, {478, 20}} - com.apple.InterfaceBuilder.CocoaPlugin - - {74, 862} - {{11, 977}, {478, 20}} - com.apple.InterfaceBuilder.CocoaPlugin - {{402, 609}, {234, 43}} - com.apple.InterfaceBuilder.CocoaPlugin - {{475, 832}, {234, 43}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{535, 389}, {215, 63}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{608, 612}, {215, 63}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{107, 350}, {480, 270}} - com.apple.InterfaceBuilder.CocoaPlugin - {{107, 350}, {480, 270}} - - {{11, 666}, {480, 270}} - {3.40282e+38, 3.40282e+38} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{336, 609}, {86, 43}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - {{422, 369}, {178, 283}} - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{118, 469}, {245, 183}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{23, 794}, {245, 183}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - {{250, 449}, {199, 203}} - com.apple.InterfaceBuilder.CocoaPlugin - - {{323, 672}, {199, 203}} - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - - - - - YES - - YES - - - YES - - - - - YES - - YES - - - YES - - - - 448 - - - - YES - - GTMLargeTypeWindow - NSPanel - - copy: - id - - - IBProjectSource - ../google-toolbox-mac-trunk/AppKit/GTMLargeTypeWindow.h - - - - NSApplication - - IBProjectSource - ../google-toolbox-mac-trunk/UnitTesting/GTMAppKit+UnitTesting.h - - - - NSControl - - - - NSMenu - - - - NSMenuItem - - - - NSObject - - IBProjectSource - ../google-toolbox-mac-trunk/AppKit/GTMCarbonEvent.h - - - - NSObject - - IBProjectSource - ../google-toolbox-mac-trunk/AppKit/GTMDelegatingTableColumn.h - - - - NSObject - - IBProjectSource - ../google-toolbox-mac-trunk/Foundation/GTMHTTPServer.h - - - - NSObject - - IBProjectSource - ../google-toolbox-mac-trunk/Foundation/GTMNSAppleEventDescriptor+Foundation.h - - - - NSObject - - IBProjectSource - ../google-toolbox-mac-trunk/Foundation/GTMNSObject+KeyValueObserving.h - - - - NSObject - - IBProjectSource - ../google-toolbox-mac-trunk/UnitTesting/GTMCALayer+UnitTesting.h - - - - NSObject - - IBProjectSource - ../google-toolbox-mac-trunk/UnitTesting/GTMNSObject+BindingUnitTesting.h - - - - NSObject - - IBProjectSource - ../google-toolbox-mac-trunk/UnitTesting/GTMNSObject+UnitTesting.h - - - - NSView - - - - NSWindow - - - - - 0 - ../CorePlot.xcodeproj - 3 - - diff --git a/framework/Info-CocoaTouch.plist b/framework/Info/Base.lproj/CorePlot-CocoaTouch-Info.plist similarity index 100% rename from framework/Info-CocoaTouch.plist rename to framework/Info/Base.lproj/CorePlot-CocoaTouch-Info.plist diff --git a/framework/Info/Base.lproj/CorePlot-CocoaTouchTests-Info.plist b/framework/Info/Base.lproj/CorePlot-CocoaTouchTests-Info.plist new file mode 100644 index 000000000..ba72822e8 --- /dev/null +++ b/framework/Info/Base.lproj/CorePlot-CocoaTouchTests-Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/framework/Info.plist b/framework/Info/Base.lproj/CorePlot-Info.plist similarity index 94% rename from framework/Info.plist rename to framework/Info/Base.lproj/CorePlot-Info.plist index 5c18bd9f9..46e9d2657 100644 --- a/framework/Info.plist +++ b/framework/Info/Base.lproj/CorePlot-Info.plist @@ -19,7 +19,7 @@ CFBundleSignature ???? CFBundleVersion - 1.0 + $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/framework/Info/Base.lproj/CorePlot-iOS-Info.plist b/framework/Info/Base.lproj/CorePlot-iOS-Info.plist new file mode 100644 index 000000000..d3de8eefb --- /dev/null +++ b/framework/Info/Base.lproj/CorePlot-iOS-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/framework/Info/Base.lproj/CorePlot-iOSTests-Info.plist b/framework/Info/Base.lproj/CorePlot-iOSTests-Info.plist new file mode 100644 index 000000000..ba72822e8 --- /dev/null +++ b/framework/Info/Base.lproj/CorePlot-iOSTests-Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/framework/Info/Base.lproj/CorePlot-tvOS-Info.plist b/framework/Info/Base.lproj/CorePlot-tvOS-Info.plist new file mode 100644 index 000000000..d3de8eefb --- /dev/null +++ b/framework/Info/Base.lproj/CorePlot-tvOS-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/framework/Info/Base.lproj/CorePlot-tvOSTests-Info.plist b/framework/Info/Base.lproj/CorePlot-tvOSTests-Info.plist new file mode 100644 index 000000000..ba72822e8 --- /dev/null +++ b/framework/Info/Base.lproj/CorePlot-tvOSTests-Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/framework/UnitTests-Info.plist b/framework/Info/Base.lproj/CorePlotTests-Info.plist similarity index 100% rename from framework/UnitTests-Info.plist rename to framework/Info/Base.lproj/CorePlotTests-Info.plist diff --git a/framework/MacOnly/CPTDecimalNumberValueTransformer.m b/framework/MacOnly/CPTDecimalNumberValueTransformer.m index edf9645ef..04477ecb9 100644 --- a/framework/MacOnly/CPTDecimalNumberValueTransformer.m +++ b/framework/MacOnly/CPTDecimalNumberValueTransformer.m @@ -19,19 +19,19 @@ +(BOOL)allowsReverseTransformation * @brief The class of the value returned for a forward transformation. * @return Transformed values will be instances of NSNumber. **/ -+(Class)transformedValueClass ++(nonnull Class)transformedValueClass { return [NSNumber class]; } /// @cond --(id)transformedValue:(id)value +-(nullable id)transformedValue:(nullable id)value { return [value copy]; } --(id)reverseTransformedValue:(id)value +-(nullable id)reverseTransformedValue:(nullable id)value { return [value decimalNumber]; } diff --git a/framework/MacOnly/CPTGraphHostingView.h b/framework/MacOnly/CPTGraphHostingView.h index 118b9a3af..bf185e21a 100644 --- a/framework/MacOnly/CPTGraphHostingView.h +++ b/framework/MacOnly/CPTGraphHostingView.h @@ -2,11 +2,11 @@ @class CPTGraph; -@interface CPTGraphHostingView : NSView +@interface CPTGraphHostingView : NSView /// @name Hosted graph /// @{ -@property (nonatomic, readwrite, strong) CPTGraph *hostedGraph; +@property (nonatomic, readwrite, strong, nullable) CPTGraph *hostedGraph; /// @} /// @name Printing @@ -16,8 +16,8 @@ /// @name Cursors /// @{ -@property (nonatomic, readwrite, strong) NSCursor *closedHandCursor; -@property (nonatomic, readwrite, strong) NSCursor *openHandCursor; +@property (nonatomic, readwrite, strong, nullable) NSCursor *closedHandCursor; +@property (nonatomic, readwrite, strong, nullable) NSCursor *openHandCursor; /// @} /// @name User Interaction diff --git a/framework/MacOnly/CPTGraphHostingView.m b/framework/MacOnly/CPTGraphHostingView.m index 2670d1a65..531d6b06b 100644 --- a/framework/MacOnly/CPTGraphHostingView.m +++ b/framework/MacOnly/CPTGraphHostingView.m @@ -29,7 +29,7 @@ -(void)plotAreaBoundsChanged; **/ @implementation CPTGraphHostingView -/** @property CPTGraph *hostedGraph +/** @property nullable CPTGraph *hostedGraph * @brief The CPTGraph hosted inside this view. **/ @synthesize hostedGraph; @@ -41,12 +41,12 @@ @implementation CPTGraphHostingView **/ @synthesize printRect; -/** @property NSCursor *closedHandCursor +/** @property nullable NSCursor *closedHandCursor * @brief The cursor displayed when the user is actively dragging any plot space. **/ @synthesize closedHandCursor; -/** @property NSCursor *openHandCursor +/** @property nullable NSCursor *openHandCursor * @brief The cursor displayed when the mouse pointer is over a plot area mapped to a plot space that allows user interaction, but not actively being dragged. **/ @synthesize openHandCursor; @@ -61,25 +61,41 @@ @implementation CPTGraphHostingView /// @cond --(instancetype)initWithFrame:(NSRect)frame +-(void)commonInit { - if ( (self = [super initWithFrame:frame]) ) { - hostedGraph = nil; - printRect = NSZeroRect; + self.hostedGraph = nil; + self.printRect = NSZeroRect; - closedHandCursor = [NSCursor closedHandCursor]; - openHandCursor = [NSCursor openHandCursor]; - allowPinchScaling = YES; + self.closedHandCursor = [NSCursor closedHandCursor]; + self.openHandCursor = [NSCursor openHandCursor]; + self.allowPinchScaling = YES; - locationInWindow = NSZeroPoint; - scrollOffset = CGPointZero; + self.locationInWindow = NSZeroPoint; + self.scrollOffset = CGPointZero; - CPTLayer *mainLayer = [[CPTLayer alloc] initWithFrame:NSRectToCGRect(frame)]; - self.layer = mainLayer; + [self addObserver:self + forKeyPath:@"effectiveAppearance" + options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld | NSKeyValueObservingOptionInitial + context:CPTGraphHostingViewKVOContext]; + + if ( !self.superview.wantsLayer ) { + self.layer = [self makeBackingLayer]; + } +} + +-(nonnull instancetype)initWithFrame:(NSRect)frame +{ + if ((self = [super initWithFrame:frame])) { + [self commonInit]; } return self; } +-(nonnull CALayer *)makeBackingLayer +{ + return [[CPTLayer alloc] initWithFrame:NSRectToCGRect(self.bounds)]; +} + -(void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; @@ -91,6 +107,8 @@ -(void)dealloc [space removeObserver:self forKeyPath:@"isDragging" context:CPTGraphHostingViewKVOContext]; } + [self removeObserver:self forKeyPath:@"effectiveAppearance" context:CPTGraphHostingViewKVOContext]; + [hostedGraph removeFromSuperlayer]; } @@ -101,7 +119,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -116,39 +134,46 @@ -(void)encodeWithCoder:(NSCoder *)coder // scrollOffset } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - CPTLayer *mainLayer = [[CPTLayer alloc] initWithFrame:NSRectToCGRect(self.frame)]; - self.layer = mainLayer; + if ((self = [super initWithCoder:coder])) { + [self commonInit]; - hostedGraph = nil; - self.hostedGraph = [coder decodeObjectForKey:@"CPTLayerHostingView.hostedGraph"]; // setup layers + self.hostedGraph = [coder decodeObjectOfClass:[CPTGraph class] + forKey:@"CPTLayerHostingView.hostedGraph"]; // setup layers self.printRect = [coder decodeRectForKey:@"CPTLayerHostingView.printRect"]; - self.closedHandCursor = [coder decodeObjectForKey:@"CPTLayerHostingView.closedHandCursor"]; - self.openHandCursor = [coder decodeObjectForKey:@"CPTLayerHostingView.openHandCursor"]; + self.closedHandCursor = [coder decodeObjectOfClass:[NSCursor class] + forKey:@"CPTLayerHostingView.closedHandCursor"]; + self.openHandCursor = [coder decodeObjectOfClass:[NSCursor class] + forKey:@"CPTLayerHostingView.openHandCursor"]; if ( [coder containsValueForKey:@"CPTLayerHostingView.allowPinchScaling"] ) { self.allowPinchScaling = [coder decodeBoolForKey:@"CPTLayerHostingView.allowPinchScaling"]; } - else { - self.allowPinchScaling = YES; - } - - self.locationInWindow = NSZeroPoint; - self.scrollOffset = CGPointZero; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing /// @cond --(void)drawRect:(NSRect)dirtyRect +-(void)drawRect:(NSRect __unused)dirtyRect { if ( self.hostedGraph ) { if ( ![NSGraphicsContext currentContextDrawingToScreen] ) { @@ -160,19 +185,19 @@ -(void)drawRect:(NSRect)dirtyRect CGRect sourceRect = NSRectToCGRect(self.frame); CGRect destinationRect = NSRectToCGRect(self.printRect); - if ( CGRectEqualToRect(destinationRect, CGRectZero) ) { + if ( CGRectEqualToRect(destinationRect, CGRectZero)) { destinationRect = sourceRect; } // scale the view isotropically so that it fits on the printed page - CGFloat widthScale = ( sourceRect.size.width != CPTFloat(0.0) ) ? destinationRect.size.width / sourceRect.size.width : CPTFloat(1.0); - CGFloat heightScale = ( sourceRect.size.height != CPTFloat(0.0) ) ? destinationRect.size.height / sourceRect.size.height : CPTFloat(1.0); + CGFloat widthScale = (sourceRect.size.width != CPTFloat(0.0)) ? destinationRect.size.width / sourceRect.size.width : CPTFloat(1.0); + CGFloat heightScale = (sourceRect.size.height != CPTFloat(0.0)) ? destinationRect.size.height / sourceRect.size.height : CPTFloat(1.0); CGFloat scale = MIN(widthScale, heightScale); // position the view so that its centered on the printed page CGPoint offset = destinationRect.origin; - offset.x += ( ( destinationRect.size.width - (sourceRect.size.width * scale) ) / CPTFloat(2.0) ); - offset.y += ( ( destinationRect.size.height - (sourceRect.size.height * scale) ) / CPTFloat(2.0) ); + offset.x += ((destinationRect.size.width - (sourceRect.size.width * scale)) / CPTFloat(2.0)); + offset.y += ((destinationRect.size.height - (sourceRect.size.height * scale)) / CPTFloat(2.0)); NSAffineTransform *transform = [NSAffineTransform transform]; [transform translateXBy:offset.x yBy:offset.y]; @@ -181,7 +206,7 @@ -(void)drawRect:(NSRect)dirtyRect // render CPTLayers recursively into the graphics context used for printing // (thanks to Brad for the tip: http://stackoverflow.com/a/2791305/132867 ) - CGContextRef context = [graphicsContext graphicsPort]; + CGContextRef context = graphicsContext.graphicsPort; [self.hostedGraph recursivelyRenderInContext:context]; [graphicsContext restoreGraphicsState]; @@ -189,7 +214,14 @@ -(void)drawRect:(NSRect)dirtyRect } } --(BOOL)knowsPageRange:(NSRangePointer)rangePointer +/// @endcond + +#pragma mark - +#pragma mark Printing + +/// @cond + +-(BOOL)knowsPageRange:(nonnull NSRangePointer)rangePointer { rangePointer->location = 1; rangePointer->length = 1; @@ -197,7 +229,7 @@ -(BOOL)knowsPageRange:(NSRangePointer)rangePointer return YES; } --(NSRect)rectForPage:(NSInteger)pageNumber +-(NSRect)rectForPage:(NSInteger __unused)pageNumber { return self.printRect; } @@ -209,12 +241,12 @@ -(NSRect)rectForPage:(NSInteger)pageNumber /// @cond --(BOOL)acceptsFirstMouse:(NSEvent *)theEvent +-(BOOL)acceptsFirstMouse:(nullable NSEvent *__unused)theEvent { return YES; } --(void)mouseDown:(NSEvent *)theEvent +-(void)mouseDown:(nonnull NSEvent *)theEvent { [super mouseDown:theEvent]; @@ -222,7 +254,7 @@ -(void)mouseDown:(NSEvent *)theEvent BOOL handled = NO; if ( theGraph ) { - CGPoint pointOfMouseDown = NSPointToCGPoint([self convertPoint:[theEvent locationInWindow] fromView:nil]); + CGPoint pointOfMouseDown = NSPointToCGPoint([self convertPoint:theEvent.locationInWindow fromView:nil]); CGPoint pointInHostedGraph = [self.layer convertPoint:pointOfMouseDown toLayer:theGraph]; handled = [theGraph pointingDeviceDownEvent:theEvent atPoint:pointInHostedGraph]; } @@ -232,13 +264,13 @@ -(void)mouseDown:(NSEvent *)theEvent } } --(void)mouseDragged:(NSEvent *)theEvent +-(void)mouseDragged:(nonnull NSEvent *)theEvent { CPTGraph *theGraph = self.hostedGraph; BOOL handled = NO; if ( theGraph ) { - CGPoint pointOfMouseDrag = NSPointToCGPoint([self convertPoint:[theEvent locationInWindow] fromView:nil]); + CGPoint pointOfMouseDrag = NSPointToCGPoint([self convertPoint:theEvent.locationInWindow fromView:nil]); CGPoint pointInHostedGraph = [self.layer convertPoint:pointOfMouseDrag toLayer:theGraph]; handled = [theGraph pointingDeviceDraggedEvent:theEvent atPoint:pointInHostedGraph]; } @@ -248,13 +280,13 @@ -(void)mouseDragged:(NSEvent *)theEvent } } --(void)mouseUp:(NSEvent *)theEvent +-(void)mouseUp:(nonnull NSEvent *)theEvent { CPTGraph *theGraph = self.hostedGraph; BOOL handled = NO; if ( theGraph ) { - CGPoint pointOfMouseUp = NSPointToCGPoint([self convertPoint:[theEvent locationInWindow] fromView:nil]); + CGPoint pointOfMouseUp = NSPointToCGPoint([self convertPoint:theEvent.locationInWindow fromView:nil]); CGPoint pointInHostedGraph = [self.layer convertPoint:pointOfMouseUp toLayer:theGraph]; handled = [theGraph pointingDeviceUpEvent:theEvent atPoint:pointInHostedGraph]; } @@ -271,13 +303,13 @@ -(void)mouseUp:(NSEvent *)theEvent /// @cond --(void)magnifyWithEvent:(NSEvent *)event +-(void)magnifyWithEvent:(nonnull NSEvent *)event { CPTGraph *theGraph = self.hostedGraph; BOOL handled = NO; if ( theGraph && self.allowPinchScaling ) { - CGPoint pointOfMagnification = NSPointToCGPoint([self convertPoint:[event locationInWindow] fromView:nil]); + CGPoint pointOfMagnification = NSPointToCGPoint([self convertPoint:event.locationInWindow fromView:nil]); CGPoint pointInHostedGraph = [self.layer convertPoint:pointOfMagnification toLayer:theGraph]; CGPoint pointInPlotArea = [theGraph convertPoint:pointInHostedGraph toLayer:theGraph.plotAreaFrame.plotArea]; @@ -296,7 +328,7 @@ -(void)magnifyWithEvent:(NSEvent *)event } } --(void)scrollWheel:(NSEvent *)theEvent +-(void)scrollWheel:(nonnull NSEvent *)theEvent { CPTGraph *theGraph = self.hostedGraph; BOOL handled = NO; @@ -387,6 +419,8 @@ -(void)scrollWheel:(NSEvent *)theEvent -(void)viewDidChangeBackingProperties { + [super viewDidChangeBackingProperties]; + NSWindow *myWindow = self.window; if ( myWindow ) { @@ -414,7 +448,7 @@ -(void)resetCursorRects NSCursor *closedCursor = self.closedHandCursor; NSCursor *openCursor = self.openHandCursor; - if ( plotArea && (closedCursor || openCursor) ) { + if ( plotArea && (closedCursor || openCursor)) { BOOL allowsInteraction = NO; BOOL isDragging = NO; @@ -446,10 +480,10 @@ -(void)resetCursorRects /** @internal * @brief Adds a KVO observer to a new plot space added to the hosted graph. **/ --(void)plotSpaceAdded:(NSNotification *)notification +-(void)plotSpaceAdded:(nonnull NSNotification *)notification { - NSDictionary *userInfo = notification.userInfo; - CPTPlotSpace *space = userInfo[CPTGraphPlotSpaceNotificationKey]; + CPTDictionary *userInfo = notification.userInfo; + CPTPlotSpace *space = userInfo[CPTGraphPlotSpaceNotificationKey]; [space addObserver:self forKeyPath:@"isDragging" @@ -460,10 +494,10 @@ -(void)plotSpaceAdded:(NSNotification *)notification /** @internal * @brief Removes the KVO observer from a plot space removed from the hosted graph. **/ --(void)plotSpaceRemoved:(NSNotification *)notification +-(void)plotSpaceRemoved:(nonnull NSNotification *)notification { - NSDictionary *userInfo = notification.userInfo; - CPTPlotSpace *space = userInfo[CPTGraphPlotSpaceNotificationKey]; + CPTDictionary *userInfo = notification.userInfo; + CPTPlotSpace *space = userInfo[CPTGraphPlotSpaceNotificationKey]; [space removeObserver:self forKeyPath:@"isDragging" context:CPTGraphHostingViewKVOContext]; [self.window invalidateCursorRectsForView:self]; @@ -477,6 +511,27 @@ -(void)plotAreaBoundsChanged [self.window invalidateCursorRectsForView:self]; } +-(void)viewWillMoveToSuperview:(nullable NSView *)newSuperview +{ + if ( self.superview.wantsLayer != newSuperview.wantsLayer ) { + self.wantsLayer = NO; + self.layer = nil; + + if ( newSuperview.wantsLayer ) { + self.wantsLayer = YES; + } + else { + self.layer = [self makeBackingLayer]; + self.wantsLayer = YES; + } + + CPTGraph *theGraph = self.hostedGraph; + if ( theGraph ) { + [self.layer addSublayer:theGraph]; + } + } +} + /// @endcond #pragma mark - @@ -484,7 +539,7 @@ -(void)plotAreaBoundsChanged /// @cond --(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +-(void)observeValueForKeyPath:(nullable NSString *)keyPath ofObject:(nullable id)object change:(nullable CPTDictionary *)change context:(nullable void *)context { if ( context == CPTGraphHostingViewKVOContext ) { CPTGraph *theGraph = self.hostedGraph; @@ -492,7 +547,7 @@ -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NS if ( [keyPath isEqualToString:@"isDragging"] && [object isKindOfClass:[CPTPlotSpace class]] ) { [self.window invalidateCursorRectsForView:self]; } - else if ( [keyPath isEqualToString:@"plotAreaFrame"] && (object == theGraph) ) { + else if ( [keyPath isEqualToString:@"plotAreaFrame"] && (object == theGraph)) { CPTPlotAreaFrame *oldPlotAreaFrame = change[NSKeyValueChangeOldKey]; CPTPlotAreaFrame *newPlotAreaFrame = change[NSKeyValueChangeNewKey]; @@ -507,7 +562,7 @@ -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NS context:CPTGraphHostingViewKVOContext]; } } - else if ( [keyPath isEqualToString:@"plotArea"] && (object == theGraph.plotAreaFrame) ) { + else if ( [keyPath isEqualToString:@"plotArea"] && (object == theGraph.plotAreaFrame)) { CPTPlotArea *oldPlotArea = change[NSKeyValueChangeOldKey]; CPTPlotArea *newPlotArea = change[NSKeyValueChangeNewKey]; @@ -524,6 +579,9 @@ -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NS object:newPlotArea]; } } + else if ( [keyPath isEqualToString:@"effectiveAppearance"] && (object == self)) { + [self.hostedGraph setNeedsDisplayAllLayers]; + } } else { [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; @@ -537,9 +595,9 @@ -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NS /// @cond --(void)setHostedGraph:(CPTGraph *)newGraph +-(void)setHostedGraph:(nullable CPTGraph *)newGraph { - NSParameterAssert( (newGraph == nil) || [newGraph isKindOfClass:[CPTGraph class]] ); + NSParameterAssert((newGraph == nil) || [newGraph isKindOfClass:[CPTGraph class]]); if ( newGraph != hostedGraph ) { self.wantsLayer = YES; @@ -563,21 +621,23 @@ -(void)setHostedGraph:(CPTGraph *)newGraph hostedGraph = newGraph; if ( newGraph ) { + CPTGraph *theGraph = newGraph; + newGraph.hostingView = self; [self viewDidChangeBackingProperties]; - [self.layer addSublayer:newGraph]; + [self.layer addSublayer:theGraph]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(plotSpaceAdded:) name:CPTGraphDidAddPlotSpaceNotification - object:newGraph]; + object:theGraph]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(plotSpaceRemoved:) name:CPTGraphDidRemovePlotSpaceNotification - object:newGraph]; + object:theGraph]; - [newGraph addObserver:self + [theGraph addObserver:self forKeyPath:@"plotAreaFrame" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld | NSKeyValueObservingOptionInitial context:CPTGraphHostingViewKVOContext]; @@ -592,7 +652,7 @@ -(void)setHostedGraph:(CPTGraph *)newGraph } } --(void)setClosedHandCursor:(NSCursor *)newCursor +-(void)setClosedHandCursor:(nullable NSCursor *)newCursor { if ( newCursor != closedHandCursor ) { closedHandCursor = newCursor; @@ -601,7 +661,7 @@ -(void)setClosedHandCursor:(NSCursor *)newCursor } } --(void)setOpenHandCursor:(NSCursor *)newCursor +-(void)setOpenHandCursor:(nullable NSCursor *)newCursor { if ( newCursor != openHandCursor ) { openHandCursor = newCursor; diff --git a/framework/MacOnly/CPTImagePlatformSpecific.m b/framework/MacOnly/CPTImagePlatformSpecific.m index dc46739e0..4b845f2ba 100644 --- a/framework/MacOnly/CPTImagePlatformSpecific.m +++ b/framework/MacOnly/CPTImagePlatformSpecific.m @@ -10,9 +10,9 @@ @implementation CPTImage(CPTPlatformSpecificImageExtensions) * @param anImage The platform-native image. * @return A CPTImage instance initialized with the provided image. **/ --(instancetype)initWithNativeImage:(CPTNativeImage *)anImage +-(nonnull instancetype)initWithNativeImage:(nullable CPTNativeImage *)anImage { - if ( (self = [self init]) ) { + if ((self = [self init])) { self.nativeImage = anImage; } @@ -28,7 +28,7 @@ -(instancetype)initWithNativeImage:(CPTNativeImage *)anImage * @param path The file system path of the file. * @return A CPTImage instance initialized with the contents of the PNG file. **/ --(instancetype)initForPNGFile:(NSString *)path +-(nonnull instancetype)initForPNGFile:(nonnull NSString *)path { CGFloat imageScale = CPTFloat(1.0); @@ -40,7 +40,7 @@ -(instancetype)initForPNGFile:(NSString *)path imageScale = MAX(imageScale, screen.backingScaleFactor); } - while ( imageScale > CPTFloat(1.0) ) { + while ( imageScale > CPTFloat(1.0)) { NSMutableString *hiDpiPath = [path mutableCopy]; NSUInteger replaceCount = [hiDpiPath replaceOccurrencesOfString:@".png" withString:[NSString stringWithFormat:@"@%dx.png", (int)imageScale] diff --git a/framework/MacOnly/CPTPlatformSpecificCategories.h b/framework/MacOnly/CPTPlatformSpecificCategories.h index 85d00758e..2102bc1bf 100644 --- a/framework/MacOnly/CPTPlatformSpecificCategories.h +++ b/framework/MacOnly/CPTPlatformSpecificCategories.h @@ -11,22 +11,11 @@ /// @name Images /// @{ --(CPTNativeImage *)imageOfLayer; +-(nonnull CPTNativeImage *)imageOfLayer; /// @} @end -#pragma mark - CPTColor - -/** @category CPTColor(CPTPlatformSpecificColorExtensions) - * @brief Platform-specific extensions to CPTColor. - **/ -@interface CPTColor(CPTPlatformSpecificColorExtensions) - -@property (nonatomic, readonly) NSColor *nsColor; - -@end - #pragma mark - NSAttributedString /** @category NSAttributedString(CPTPlatformSpecificAttributedStringExtensions) @@ -36,7 +25,12 @@ /// @name Drawing /// @{ --(void)drawInRect:(CGRect)rect inContext:(CGContextRef)context; +-(void)drawInRect:(CGRect)rect inContext:(nonnull CGContextRef)context; +/// @} + +/// @name Measurement +/// @{ +-(CGSize)sizeAsDrawn; /// @} @end diff --git a/framework/MacOnly/CPTPlatformSpecificCategories.m b/framework/MacOnly/CPTPlatformSpecificCategories.m index f53be1a3a..8b6229cc5 100644 --- a/framework/MacOnly/CPTPlatformSpecificCategories.m +++ b/framework/MacOnly/CPTPlatformSpecificCategories.m @@ -1,5 +1,7 @@ #import "CPTPlatformSpecificCategories.h" +#import "CPTGraph.h" +#import "CPTGraphHostingView.h" #import "CPTPlatformSpecificFunctions.h" #pragma mark CPTLayer @@ -9,25 +11,52 @@ @implementation CPTLayer(CPTPlatformSpecificLayerExtensions) /** @brief Gets an image of the layer contents. * @return A native image representation of the layer content. **/ --(CPTNativeImage *)imageOfLayer +-(nonnull CPTNativeImage *)imageOfLayer { CGSize boundsSize = self.bounds.size; - NSBitmapImageRep *layerImage = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL - pixelsWide:(NSInteger)boundsSize.width - pixelsHigh:(NSInteger)boundsSize.height - bitsPerSample:8 - samplesPerPixel:4 - hasAlpha:YES - isPlanar:NO - colorSpaceName:NSCalibratedRGBColorSpace - bytesPerRow:(NSInteger)boundsSize.width * 4 - bitsPerPixel:32]; + // Figure out the scale of pixels to points + CGFloat scale = 0.0; + + if ( [self respondsToSelector:@selector(hostingView)] ) { + scale = ((CPTGraph *)self).hostingView.window.backingScaleFactor; + } + if ((scale == 0.0) && [CALayer instancesRespondToSelector:@selector(contentsScale)] ) { + scale = self.contentsScale; + } + if ( scale == 0.0 ) { + NSWindow *myWindow = self.graph.hostingView.window; + + if ( myWindow ) { + scale = myWindow.backingScaleFactor; + } + else { + scale = [NSScreen mainScreen].backingScaleFactor; + } + } + scale = MAX(scale, CPTFloat(1.0)); + + NSBitmapImageRep *layerImage = [[NSBitmapImageRep alloc] + initWithBitmapDataPlanes:NULL + pixelsWide:(NSInteger)(boundsSize.width * scale) + pixelsHigh:(NSInteger)(boundsSize.height * scale) + bitsPerSample:8 + samplesPerPixel:4 + hasAlpha:YES + isPlanar:NO + colorSpaceName:NSCalibratedRGBColorSpace + bitmapFormat:NSAlphaFirstBitmapFormat + bytesPerRow:0 + bitsPerPixel:0 + ]; + + // Setting the size communicates the dpi; enables proper scaling for Retina screens + layerImage.size = NSSizeFromCGSize(boundsSize); NSGraphicsContext *bitmapContext = [NSGraphicsContext graphicsContextWithBitmapImageRep:layerImage]; - CGContextRef context = (CGContextRef)[bitmapContext graphicsPort]; + CGContextRef context = (CGContextRef)bitmapContext.graphicsPort; - CGContextClearRect( context, CPTRectMake(0.0, 0.0, boundsSize.width, boundsSize.height) ); + CGContextClearRect(context, CPTRectMake(0.0, 0.0, boundsSize.width, boundsSize.height)); CGContextSetAllowsAntialiasing(context, true); CGContextSetShouldSmoothFonts(context, false); [self layoutAndRenderInContext:context]; @@ -41,22 +70,6 @@ -(CPTNativeImage *)imageOfLayer @end -#pragma mark - CPTColor - -@implementation CPTColor(CPTPlatformSpecificColorExtensions) - -/** @property nsColor - * @brief Gets the color value as an NSColor. - **/ -@dynamic nsColor; - --(NSColor *)nsColor -{ - return [NSColor colorWithCIColor:[CIColor colorWithCGColor:self.cgColor]]; -} - -@end - #pragma mark - NSAttributedString @implementation NSAttributedString(CPTPlatformSpecificAttributedStringExtensions) @@ -65,14 +78,39 @@ @implementation NSAttributedString(CPTPlatformSpecificAttributedStringExtensions * @param rect The bounding rectangle in which to draw the text. * @param context The graphics context to draw into. **/ --(void)drawInRect:(CGRect)rect inContext:(CGContextRef)context +-(void)drawInRect:(CGRect)rect inContext:(nonnull CGContextRef)context { CPTPushCGContext(context); [self drawWithRect:NSRectFromCGRect(rect) - options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine]; + options:CPTStringDrawingOptions]; CPTPopCGContext(); } +/** + * @brief Computes the size of the styled text when drawn rounded up to the nearest whole number in each dimension. + **/ +-(CGSize)sizeAsDrawn +{ + CGRect rect = CGRectZero; + + if ( [self respondsToSelector:@selector(boundingRectWithSize:options:context:)] ) { + rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) + options:CPTStringDrawingOptions + context:nil]; + } + else { + rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) + options:CPTStringDrawingOptions]; + } + + CGSize textSize = rect.size; + + textSize.width = ceil(textSize.width); + textSize.height = ceil(textSize.height); + + return textSize; +} + @end diff --git a/framework/MacOnly/CPTPlatformSpecificDefines.h b/framework/MacOnly/CPTPlatformSpecificDefines.h index 354989f9f..24d77c3c6 100644 --- a/framework/MacOnly/CPTPlatformSpecificDefines.h +++ b/framework/MacOnly/CPTPlatformSpecificDefines.h @@ -1,4 +1,6 @@ /// @file +typedef NSColor CPTNativeColor; ///< Platform-native color. typedef NSImage CPTNativeImage; ///< Platform-native image format. typedef NSEvent CPTNativeEvent; ///< Platform-native OS event. +typedef NSFont CPTNativeFont; ///< Platform-native font. diff --git a/framework/MacOnly/CPTPlatformSpecificFunctions.h b/framework/MacOnly/CPTPlatformSpecificFunctions.h index 0808b3f02..66fc3580a 100644 --- a/framework/MacOnly/CPTPlatformSpecificFunctions.h +++ b/framework/MacOnly/CPTPlatformSpecificFunctions.h @@ -1,4 +1,5 @@ #import "CPTDefinitions.h" +#import "CPTPlatformSpecificDefines.h" /// @file @@ -8,21 +9,21 @@ extern "C" { /// @name Graphics Context Save Stack /// @{ -void CPTPushCGContext(CGContextRef context); +void CPTPushCGContext(__nonnull CGContextRef context); void CPTPopCGContext(void); /// @} -/// @name Graphics Context +/// @name Color Conversion /// @{ -CGContextRef CPTGetCurrentContext(void); +__nonnull CGColorRef CPTCreateCGColorFromNSColor(NSColor *__nonnull nsColor) CF_RETURNS_RETAINED; +CPTRGBAColor CPTRGBAColorFromNSColor(NSColor *__nonnull nsColor); /// @} -/// @name Color Conversion +/// @name Debugging /// @{ -CGColorRef CPTCreateCGColorFromNSColor(NSColor *nsColor); -CPTRGBAColor CPTRGBAColorFromNSColor(NSColor *nsColor); +CPTNativeImage *__nonnull CPTQuickLookImage(CGRect rect, __nonnull CPTQuickLookImageBlock renderBlock); /// @} diff --git a/framework/MacOnly/CPTPlatformSpecificFunctions.m b/framework/MacOnly/CPTPlatformSpecificFunctions.m index c2ba07e3e..4e5668a58 100644 --- a/framework/MacOnly/CPTPlatformSpecificFunctions.m +++ b/framework/MacOnly/CPTPlatformSpecificFunctions.m @@ -3,8 +3,8 @@ #pragma mark Graphics Context // linked list to store saved contexts -static NSMutableArray *pushedContexts = nil; -static dispatch_once_t contextOnceToken = 0; +static NSMutableArray *pushedContexts = nil; +static dispatch_once_t contextOnceToken = 0; static dispatch_queue_t contextQueue = NULL; static dispatch_once_t queueOnceToken = 0; @@ -12,7 +12,7 @@ /** @brief Pushes the current AppKit graphics context onto a stack and replaces it with the given Core Graphics context. * @param newContext The graphics context. **/ -void CPTPushCGContext(CGContextRef newContext) +void CPTPushCGContext(__nonnull CGContextRef newContext) { dispatch_once(&contextOnceToken, ^{ pushedContexts = [[NSMutableArray alloc] init]; @@ -24,12 +24,15 @@ void CPTPushCGContext(CGContextRef newContext) dispatch_sync(contextQueue, ^{ NSGraphicsContext *currentContext = [NSGraphicsContext currentContext]; - if ( newContext && currentContext ) { + if ( currentContext ) { [pushedContexts addObject:currentContext]; - [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:newContext flipped:NO]]; } else { - [pushedContexts addObject:[NSNull null]]; + [pushedContexts addObject:(NSGraphicsContext *)[NSNull null]]; + } + + if ( newContext ) { + [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:newContext flipped:NO]]; } }); } @@ -53,24 +56,15 @@ void CPTPopCGContext(void) if ( [lastContext isKindOfClass:[NSGraphicsContext class]] ) { [NSGraphicsContext setCurrentContext:lastContext]; } + else { + [NSGraphicsContext setCurrentContext:nil]; + } + [pushedContexts removeLastObject]; } }); } -#pragma mark - -#pragma mark Context - -/** - * @brief Get the default graphics context - **/ -CGContextRef CPTGetCurrentContext(void) -{ - CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort]; - - return context; -} - #pragma mark - #pragma mark Colors @@ -81,7 +75,7 @@ CGContextRef CPTGetCurrentContext(void) * @param nsColor The NSColor. * @return The @ref CGColorRef. **/ -CGColorRef CPTCreateCGColorFromNSColor(NSColor *nsColor) +__nonnull CGColorRef CPTCreateCGColorFromNSColor(NSColor *__nonnull nsColor) { NSColor *rgbColor = [nsColor colorUsingColorSpace:[NSColorSpace genericRGBColorSpace]]; CGFloat r, g, b, a; @@ -97,7 +91,7 @@ CGColorRef CPTCreateCGColorFromNSColor(NSColor *nsColor) * @param nsColor The NSColor. * @return The CPTRGBAColor. **/ -CPTRGBAColor CPTRGBAColorFromNSColor(NSColor *nsColor) +CPTRGBAColor CPTRGBAColorFromNSColor(NSColor *__nonnull nsColor) { CGFloat red, green, blue, alpha; @@ -111,3 +105,36 @@ CPTRGBAColor CPTRGBAColorFromNSColor(NSColor *nsColor) return rgbColor; } + +#pragma mark - +#pragma mark Debugging + +CPTNativeImage *__nonnull CPTQuickLookImage(CGRect rect, __nonnull CPTQuickLookImageBlock renderBlock) +{ + NSBitmapImageRep *layerImage = [[NSBitmapImageRep alloc] + initWithBitmapDataPlanes:NULL + pixelsWide:(NSInteger)rect.size.width + pixelsHigh:(NSInteger)rect.size.height + bitsPerSample:8 + samplesPerPixel:4 + hasAlpha:YES + isPlanar:NO + colorSpaceName:NSCalibratedRGBColorSpace + bytesPerRow:(NSInteger)rect.size.width * 4 + bitsPerPixel:32]; + + NSGraphicsContext *bitmapContext = [NSGraphicsContext graphicsContextWithBitmapImageRep:layerImage]; + + CGContextRef context = (CGContextRef)bitmapContext.graphicsPort; + + CGContextClearRect(context, rect); + + renderBlock(context, 1.0, rect); + + CGContextFlush(context); + + NSImage *image = [[NSImage alloc] initWithSize:NSSizeFromCGSize(rect.size)]; + [image addRepresentation:layerImage]; + + return image; +} diff --git a/framework/MacOnly/CPTTextStylePlatformSpecific.h b/framework/MacOnly/CPTTextStylePlatformSpecific.h index dcb6919af..3dbcb7fc9 100644 --- a/framework/MacOnly/CPTTextStylePlatformSpecific.h +++ b/framework/MacOnly/CPTTextStylePlatformSpecific.h @@ -3,6 +3,15 @@ /** * @brief Enumeration of paragraph alignments. **/ +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 101200) +typedef NS_ENUM (NSInteger, CPTTextAlignment) { + CPTTextAlignmentLeft = NSTextAlignmentLeft, ///< Left alignment. + CPTTextAlignmentCenter = NSTextAlignmentCenter, ///< Center alignment. + CPTTextAlignmentRight = NSTextAlignmentRight, ///< Right alignment. + CPTTextAlignmentJustified = NSTextAlignmentJustified, ///< Justified alignment. + CPTTextAlignmentNatural = NSTextAlignmentNatural ///< Natural alignment of the text's script. +}; +#else typedef NS_ENUM (NSInteger, CPTTextAlignment) { CPTTextAlignmentLeft = NSLeftTextAlignment, ///< Left alignment. CPTTextAlignmentCenter = NSCenterTextAlignment, ///< Center alignment. @@ -10,3 +19,4 @@ typedef NS_ENUM (NSInteger, CPTTextAlignment) { CPTTextAlignmentJustified = NSJustifiedTextAlignment, ///< Justified alignment. CPTTextAlignmentNatural = NSNaturalTextAlignment ///< Natural alignment of the text's script. }; +#endif diff --git a/framework/MacOnly/CPTTextStylePlatformSpecific.m b/framework/MacOnly/CPTTextStylePlatformSpecific.m index 15ca7024a..21af2ac93 100644 --- a/framework/MacOnly/CPTTextStylePlatformSpecific.m +++ b/framework/MacOnly/CPTTextStylePlatformSpecific.m @@ -6,7 +6,7 @@ @implementation CPTTextStyle(CPTPlatformSpecificTextStyleExtensions) -/** @property NSDictionary *attributes +/** @property nonnull CPTDictionary *attributes * @brief A dictionary of standard text attributes suitable for formatting an NSAttributedString. * * The dictionary will contain values for the following keys that represent the receiver's text style: @@ -32,7 +32,7 @@ @implementation CPTTextStyle(CPTPlatformSpecificTextStyleExtensions) * @param attributes A dictionary of standard text attributes. * @return A new CPTTextStyle instance. **/ -+(instancetype)textStyleWithAttributes:(NSDictionary *)attributes ++(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary *)attributes { CPTMutableTextStyle *newStyle = [CPTMutableTextStyle textStyle]; @@ -40,6 +40,7 @@ +(instancetype)textStyleWithAttributes:(NSDictionary *)attributes NSFont *styleFont = attributes[NSFontAttributeName]; if ( styleFont ) { + newStyle.font = styleFont; newStyle.fontName = styleFont.fontName; newStyle.fontSize = styleFont.pointSize; } @@ -47,17 +48,17 @@ +(instancetype)textStyleWithAttributes:(NSDictionary *)attributes // Color NSColor *styleColor = attributes[NSForegroundColorAttributeName]; if ( styleColor ) { - // CGColor property is available in Mac OS 10.8 and later + // CGColor property is available in macOS 10.8 and later if ( [styleColor respondsToSelector:@selector(CGColor)] ) { newStyle.color = [CPTColor colorWithCGColor:styleColor.CGColor]; } else { - const NSInteger numberOfComponents = [styleColor numberOfComponents]; + const NSInteger numberOfComponents = styleColor.numberOfComponents; - CGFloat *components = calloc( (size_t)numberOfComponents, sizeof(CGFloat) ); + CGFloat *components = calloc((size_t)numberOfComponents, sizeof(CGFloat)); [styleColor getComponents:components]; - CGColorSpaceRef colorSpace = [[styleColor colorSpace] CGColorSpace]; + CGColorSpaceRef colorSpace = styleColor.colorSpace.CGColorSpace; CGColorRef styleCGColor = CGColorCreate(colorSpace, components); newStyle.color = [CPTColor colorWithCGColor:styleCGColor]; @@ -82,15 +83,15 @@ +(instancetype)textStyleWithAttributes:(NSDictionary *)attributes /// @cond --(NSDictionary *)attributes +-(nonnull CPTDictionary *)attributes { - NSMutableDictionary *myAttributes = [NSMutableDictionary dictionary]; + CPTMutableDictionary *myAttributes = [NSMutableDictionary dictionary]; // Font - NSFont *styleFont = nil; + NSFont *styleFont = self.font; NSString *fontName = self.fontName; - if ( fontName ) { + if ((styleFont == nil) && fontName ) { styleFont = [NSFont fontWithName:fontName size:self.fontSize]; } @@ -125,9 +126,20 @@ -(NSDictionary *)attributes @implementation CPTMutableTextStyle(CPTPlatformSpecificMutableTextStyleExtensions) -/// @cond - -+(instancetype)textStyleWithAttributes:(NSDictionary *)attributes +/** @brief Creates and returns a new CPTMutableTextStyle instance initialized from a dictionary of text attributes. + * + * The text style will be initalized with values associated with the following keys: + * - #NSFontAttributeName: Sets the @link CPTMutableTextStyle::fontName fontName @endlink + * and @link CPTMutableTextStyle::fontSize fontSize @endlink. + * - #NSForegroundColorAttributeName: Sets the @link CPTMutableTextStyle::color color @endlink. + * - #NSParagraphStyleAttributeName: Sets the @link CPTMutableTextStyle::textAlignment textAlignment @endlink and @link CPTMutableTextStyle::lineBreakMode lineBreakMode @endlink. + * + * Properties associated with missing keys will be inialized to their default values. + * + * @param attributes A dictionary of standard text attributes. + * @return A new CPTMutableTextStyle instance. + **/ ++(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary *)attributes { CPTMutableTextStyle *newStyle = [CPTMutableTextStyle textStyle]; @@ -135,6 +147,7 @@ +(instancetype)textStyleWithAttributes:(NSDictionary *)attributes NSFont *styleFont = attributes[NSFontAttributeName]; if ( styleFont ) { + newStyle.font = styleFont; newStyle.fontName = styleFont.fontName; newStyle.fontSize = styleFont.pointSize; } @@ -142,17 +155,17 @@ +(instancetype)textStyleWithAttributes:(NSDictionary *)attributes // Color NSColor *styleColor = attributes[NSForegroundColorAttributeName]; if ( styleColor ) { - // CGColor property is available in Mac OS 10.8 and later + // CGColor property is available in macOS 10.8 and later if ( [styleColor respondsToSelector:@selector(CGColor)] ) { newStyle.color = [CPTColor colorWithCGColor:styleColor.CGColor]; } else { - const NSInteger numberOfComponents = [styleColor numberOfComponents]; + const NSInteger numberOfComponents = styleColor.numberOfComponents; - CGFloat *components = calloc( (size_t)numberOfComponents, sizeof(CGFloat) ); + CGFloat *components = calloc((size_t)numberOfComponents, sizeof(CGFloat)); [styleColor getComponents:components]; - CGColorSpaceRef colorSpace = [[styleColor colorSpace] CGColorSpace]; + CGColorSpaceRef colorSpace = styleColor.colorSpace.CGColorSpace; CGColorRef styleCGColor = CGColorCreate(colorSpace, components); newStyle.color = [CPTColor colorWithCGColor:styleCGColor]; @@ -172,8 +185,6 @@ +(instancetype)textStyleWithAttributes:(NSDictionary *)attributes return newStyle; } -/// @endcond - @end #pragma mark - @@ -187,28 +198,27 @@ @implementation NSString(CPTTextStyleExtensions) * @param style The text style. * @return The size of the text when drawn with the given style. **/ --(CGSize)sizeWithTextStyle:(CPTTextStyle *)style +-(CGSize)sizeWithTextStyle:(nullable CPTTextStyle *)style { - NSFont *theFont = nil; - NSString *fontName = style.fontName; - - if ( fontName ) { - theFont = [NSFont fontWithName:fontName size:style.fontSize]; - } - - CGSize textSize; + CGRect rect = CGRectZero; - if ( theFont ) { - NSDictionary *attributes = @{ - NSFontAttributeName: theFont - }; - - textSize = NSSizeToCGSize([self sizeWithAttributes:attributes]); + if ( [self respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)] ) { + rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) + options:CPTStringDrawingOptions + attributes:style.attributes + context:nil]; } else { - textSize = CGSizeZero; + rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) + options:CPTStringDrawingOptions + attributes:style.attributes]; } + CGSize textSize = rect.size; + + textSize.width = ceil(textSize.width); + textSize.height = ceil(textSize.height); + return textSize; } @@ -220,7 +230,7 @@ -(CGSize)sizeWithTextStyle:(CPTTextStyle *)style * @param style The text style. * @param context The graphics context to draw into. **/ --(void)drawInRect:(CGRect)rect withTextStyle:(CPTTextStyle *)style inContext:(CGContextRef)context +-(void)drawInRect:(CGRect)rect withTextStyle:(nullable CPTTextStyle *)style inContext:(nonnull CGContextRef)context { if ( style.color == nil ) { return; @@ -233,10 +243,10 @@ -(void)drawInRect:(CGRect)rect withTextStyle:(CPTTextStyle *)style inContext:(CG CPTPushCGContext(context); - NSFont *theFont = nil; + NSFont *theFont = style.font; NSString *fontName = style.fontName; - if ( fontName ) { + if ((theFont == nil) && fontName ) { theFont = [NSFont fontWithName:fontName size:style.fontSize]; } @@ -246,13 +256,13 @@ -(void)drawInRect:(CGRect)rect withTextStyle:(CPTTextStyle *)style inContext:(CG paragraphStyle.alignment = (NSTextAlignment)style.textAlignment; paragraphStyle.lineBreakMode = style.lineBreakMode; - NSDictionary *attributes = @{ - NSFontAttributeName: theFont, - NSForegroundColorAttributeName: foregroundColor, - NSParagraphStyleAttributeName: paragraphStyle + CPTDictionary *attributes = @{ + NSFontAttributeName: theFont, + NSForegroundColorAttributeName: foregroundColor, + NSParagraphStyleAttributeName: paragraphStyle }; [self drawWithRect:NSRectFromCGRect(rect) - options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine + options:CPTStringDrawingOptions attributes:attributes]; } CPTPopCGContext(); diff --git a/framework/Source/CPTAnimation.h b/framework/Source/CPTAnimation.h index 9a6a707fa..93f0e48ba 100644 --- a/framework/Source/CPTAnimation.h +++ b/framework/Source/CPTAnimation.h @@ -1,3 +1,5 @@ +#import + @class CPTAnimationOperation; @class CPTAnimationPeriod; @@ -39,10 +41,18 @@ typedef NS_ENUM (NSInteger, CPTAnimationCurve) { CPTAnimationCurveQuinticInOut ///< Quintic in and out animation curve. }; +#pragma mark - + /** * @brief Animation delegate. **/ +#if ((TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_TV) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 100000)) \ + || (TARGET_OS_MAC && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101200)) +// CAAnimationDelegate is defined by Core Animation in iOS 10.0+, macOS 10.12+, and tvOS 10.0+ +@protocol CPTAnimationDelegate +#else @protocol CPTAnimationDelegate +#endif @optional @@ -52,27 +62,27 @@ typedef NS_ENUM (NSInteger, CPTAnimationCurve) { /** @brief @optional Informs the delegate that an animation operation started animating. * @param operation The animation operation. **/ --(void)animationDidStart:(CPTAnimationOperation *)operation; +-(void)animationDidStart:(nonnull CPTAnimationOperation *)operation; /** @brief @optional Informs the delegate that an animation operation stopped after reaching its full duration. * @param operation The animation operation. **/ --(void)animationDidFinish:(CPTAnimationOperation *)operation; +-(void)animationDidFinish:(nonnull CPTAnimationOperation *)operation; /** @brief @optional Informs the delegate that an animation operation was stopped before reaching its full duration. * @param operation The animation operation. **/ --(void)animationCancelled:(CPTAnimationOperation *)operation; +-(void)animationCancelled:(nonnull CPTAnimationOperation *)operation; /** @brief @optional Informs the delegate that the animated property is about to update. * @param operation The animation operation. **/ --(void)animationWillUpdate:(CPTAnimationOperation *)operation; +-(void)animationWillUpdate:(nonnull CPTAnimationOperation *)operation; /** @brief @optional Informs the delegate that the animated property has been updated. * @param operation The animation operation. **/ --(void)animationDidUpdate:(CPTAnimationOperation *)operation; +-(void)animationDidUpdate:(nonnull CPTAnimationOperation *)operation; /// @} @@ -94,24 +104,24 @@ typedef NS_ENUM (NSInteger, CPTAnimationCurve) { /// @name Animation Controller Instance /// @{ -+(instancetype)sharedInstance; ++(nonnull instancetype)sharedInstance; /// @} /// @name Property Animation /// @{ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property period:(CPTAnimationPeriod *)period animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property period:(nonnull CPTAnimationPeriod *)period animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; /// @} /// @name Animation Management /// @{ --(CPTAnimationOperation *)addAnimationOperation:(CPTAnimationOperation *)animationOperation; --(void)removeAnimationOperation:(CPTAnimationOperation *)animationOperation; +-(nonnull CPTAnimationOperation *)addAnimationOperation:(nonnull CPTAnimationOperation *)animationOperation; +-(void)removeAnimationOperation:(nullable CPTAnimationOperation *)animationOperation; -(void)removeAllAnimationOperations; /// @} /// @name Retrieving Animation Operations /// @{ --(CPTAnimationOperation *)operationWithIdentifier:(id)identifier; +-(nullable CPTAnimationOperation *)operationWithIdentifier:(nullable id)identifier; /// @} @end diff --git a/framework/Source/CPTAnimation.m b/framework/Source/CPTAnimation.m index c906be94f..a626f2dc7 100644 --- a/framework/Source/CPTAnimation.m +++ b/framework/Source/CPTAnimation.m @@ -1,37 +1,39 @@ #import "CPTAnimation.h" +#import "_CPTAnimationTimingFunctions.h" #import "CPTAnimationOperation.h" #import "CPTAnimationPeriod.h" #import "CPTDefinitions.h" -#import "_CPTAnimationTimingFunctions.h" +#import "CPTPlotRange.h" static const CGFloat kCPTAnimationFrameRate = CPTFloat(1.0 / 60.0); // 60 frames per second -static NSString *const CPTAnimationOperationKey = @"CPTAnimationOperationKey"; -static NSString *const CPTAnimationValueKey = @"CPTAnimationValueKey"; -static NSString *const CPTAnimationStartedKey = @"CPTAnimationStartedKey"; -static NSString *const CPTAnimationFinishedKey = @"CPTAnimationFinishedKey"; +static NSString *const CPTAnimationOperationKey = @"CPTAnimationOperationKey"; +static NSString *const CPTAnimationValueKey = @"CPTAnimationValueKey"; +static NSString *const CPTAnimationValueClassKey = @"CPTAnimationValueClassKey"; +static NSString *const CPTAnimationStartedKey = @"CPTAnimationStartedKey"; +static NSString *const CPTAnimationFinishedKey = @"CPTAnimationFinishedKey"; /// @cond +typedef NSMutableArray CPTMutableAnimationArray; + @interface CPTAnimation() @property (nonatomic, readwrite, assign) CGFloat timeOffset; -@property (nonatomic, readwrite, strong) NSMutableArray *animationOperations; -@property (nonatomic, readwrite, strong) NSMutableArray *runningAnimationOperations; -@property (nonatomic, readwrite) dispatch_source_t timer; -@property (nonatomic, readwrite) dispatch_queue_t animationQueue; +@property (nonatomic, readwrite, strong, nonnull) CPTMutableAnimationArray *animationOperations; +@property (nonatomic, readwrite, strong, nonnull) CPTMutableAnimationArray *runningAnimationOperations; +@property (nonatomic, readwrite, nullable) dispatch_source_t timer; +@property (nonatomic, readwrite, nonnull) dispatch_queue_t animationQueue; -+(SEL)setterFromProperty:(NSString *)property; ++(nonnull SEL)setterFromProperty:(nonnull NSString *)property; --(CPTAnimationTimingFunction)timingFunctionForAnimationCurve:(CPTAnimationCurve)animationCurve; --(void)updateOnMainThreadWithParameters:(NSDictionary *)parameters; +-(nullable CPTAnimationTimingFunction)timingFunctionForAnimationCurve:(CPTAnimationCurve)animationCurve; +-(void)updateOnMainThreadWithParameters:(nonnull CPTDictionary *)parameters; -(void)startTimer; -(void)cancelTimer; -(void)update; -dispatch_source_t CPTCreateDispatchTimer(CGFloat interval, dispatch_queue_t queue, dispatch_block_t block); - @end /// @endcond @@ -59,20 +61,20 @@ @implementation CPTAnimation @synthesize defaultAnimationCurve; /** @internal - * @property NSMutableArray *animationOperations + * @property nonnull CPTMutableAnimationArray *animationOperations * * @brief The list of animation operations currently running or waiting to run. **/ @synthesize animationOperations; /** @internal - * @property NSMutableArray *runningAnimationOperations + * @property nonnull CPTMutableAnimationArray *runningAnimationOperations * @brief The list of running animation operations. **/ @synthesize runningAnimationOperations; /** @internal - * @property dispatch_source_t timer + * @property nullable dispatch_source_t timer * @brief The animation timer. Each tick of the timer corresponds to one animation frame. **/ @synthesize timer; @@ -80,7 +82,7 @@ @implementation CPTAnimation #pragma mark - Init/Dealloc /** @internal - * @property dispatch_queue_t animationQueue; + * @property nonnull dispatch_queue_t animationQueue; * @brief The serial dispatch queue used to synchronize animation updates. **/ @synthesize animationQueue; @@ -96,9 +98,9 @@ @implementation CPTAnimation * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { animationOperations = [[NSMutableArray alloc] init]; runningAnimationOperations = [[NSMutableArray alloc] init]; timer = NULL; @@ -119,7 +121,6 @@ -(void)dealloc { [self cancelTimer]; - dispatch_release(animationQueue); dispatch_queue_t mainQueue = dispatch_get_main_queue(); for ( CPTAnimationOperation *animationOperation in animationOperations ) { @@ -140,7 +141,7 @@ -(void)dealloc /** @brief A shared CPTAnimation instance responsible for scheduling and executing animations. * @return The shared CPTAnimation instance. **/ -+(instancetype)sharedInstance ++(nonnull instancetype)sharedInstance { static dispatch_once_t once = 0; static CPTAnimation *shared; @@ -162,19 +163,16 @@ +(instancetype)sharedInstance * @param delegate The animation delegate (can be @nil). * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property period:(CPTAnimationPeriod *)period animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property period:(nonnull CPTAnimationPeriod *)period animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate { - CPTAnimationOperation *animationOperation = [[CPTAnimationOperation alloc] init]; + CPTAnimationOperation *animationOperation = + [[CPTAnimationOperation alloc] initWithAnimationPeriod:period + animationCurve:animationCurve + object:object + getter:NSSelectorFromString(property) + setter:[CPTAnimation setterFromProperty:property]]; - animationOperation.period = period; - animationOperation.animationCurve = animationCurve; - animationOperation.delegate = delegate; - - if ( object ) { - animationOperation.boundObject = object; - animationOperation.boundGetter = NSSelectorFromString(property); - animationOperation.boundSetter = [CPTAnimation setterFromProperty:property]; - } + animationOperation.delegate = delegate; [[CPTAnimation sharedInstance] addAnimationOperation:animationOperation]; @@ -183,10 +181,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property perio /// @cond -+(SEL)setterFromProperty:(NSString *)property ++(nonnull SEL)setterFromProperty:(nonnull NSString *)property { return NSSelectorFromString([NSString stringWithFormat:@"set%@:", [property stringByReplacingCharactersInRange:NSMakeRange(0, 1) - withString:[[property substringToIndex:1] capitalizedString]]]); + withString:[property substringToIndex:1].capitalizedString]]); } /// @endcond @@ -197,12 +195,12 @@ +(SEL)setterFromProperty:(NSString *)property * @param animationOperation The animation operation to add. * @return The queued animation operation. **/ --(CPTAnimationOperation *)addAnimationOperation:(CPTAnimationOperation *)animationOperation +-(CPTAnimationOperation *)addAnimationOperation:(nonnull CPTAnimationOperation *)animationOperation { id boundObject = animationOperation.boundObject; CPTAnimationPeriod *period = animationOperation.period; - if ( animationOperation.delegate || (boundObject && period && ![period.startValue isEqual:period.endValue]) ) { + if ( animationOperation.delegate || (boundObject && period && ![period.startValue isEqual:period.endValue])) { dispatch_async(self.animationQueue, ^{ [self.animationOperations addObject:animationOperation]; @@ -217,7 +215,7 @@ -(CPTAnimationOperation *)addAnimationOperation:(CPTAnimationOperation *)animati /** @brief Removes an animation operation from the animation queue. * @param animationOperation The animation operation to remove. **/ --(void)removeAnimationOperation:(CPTAnimationOperation *)animationOperation +-(void)removeAnimationOperation:(nullable CPTAnimationOperation *)animationOperation { if ( animationOperation ) { dispatch_async(self.animationQueue, ^{ @@ -243,10 +241,10 @@ -(void)removeAllAnimationOperations * @param identifier An animation operation identifier. * @return The animation operation with the given identifier or @nil if it was not found. **/ --(CPTAnimationOperation *)operationWithIdentifier:(id)identifier +-(nullable CPTAnimationOperation *)operationWithIdentifier:(nullable id)identifier { for ( CPTAnimationOperation *operation in self.animationOperations ) { - if ( [[operation identifier] isEqual:identifier] ) { + if ( [operation.identifier isEqual:identifier] ) { return operation; } } @@ -261,12 +259,12 @@ -(void)update { self.timeOffset += kCPTAnimationFrameRate; - NSMutableArray *theAnimationOperations = self.animationOperations; - NSMutableArray *runningOperations = self.runningAnimationOperations; - NSMutableArray *expiredOperations = [[NSMutableArray alloc] init]; + CPTMutableAnimationArray *theAnimationOperations = self.animationOperations; + CPTMutableAnimationArray *runningOperations = self.runningAnimationOperations; + CPTMutableAnimationArray *expiredOperations = [[NSMutableArray alloc] init]; - CGFloat currentTime = self.timeOffset; - NSArray *runModes = @[NSRunLoopCommonModes]; + CGFloat currentTime = self.timeOffset; + CPTStringArray *runModes = @[NSRunLoopCommonModes]; dispatch_queue_t mainQueue = dispatch_get_main_queue(); @@ -279,13 +277,13 @@ -(void)update CGFloat duration = period.duration; CGFloat startTime = period.startOffset; CGFloat delay = period.delay; - if ( isnan(delay) ) { + if ( isnan(delay)) { if ( [period canStartWithValueFromObject:animationOperation.boundObject propertyGetter:animationOperation.boundGetter] ) { period.delay = currentTime - startTime; startTime = currentTime; } else { - startTime = CPTFloat(NAN); + startTime = CPTNAN; } } else { @@ -317,7 +315,7 @@ -(void)update for ( CPTAnimationOperation *operation in runningOperations ) { if ( operation.boundObject == boundObject ) { - if ( (operation.boundGetter == boundGetter) && (operation.boundSetter == boundSetter) ) { + if ((operation.boundGetter == boundGetter) && (operation.boundSetter == boundSetter)) { operation.canceled = YES; } } @@ -332,13 +330,15 @@ -(void)update [period setStartValueFromObject:animationOperation.boundObject propertyGetter:animationOperation.boundGetter]; } + Class valueClass = period.valueClass; CGFloat progress = timingFunction(currentTime - startTime, duration); - NSDictionary *parameters = @{ - CPTAnimationOperationKey: animationOperation, - CPTAnimationValueKey: [period tweenedValueForProgress:progress], - CPTAnimationStartedKey: @(started), - CPTAnimationFinishedKey: @(currentTime >= endTime) + CPTDictionary *parameters = @{ + CPTAnimationOperationKey: animationOperation, + CPTAnimationValueKey: [period tweenedValueForProgress:progress], + CPTAnimationValueClassKey: valueClass ? valueClass : [NSNull null], + CPTAnimationStartedKey: @(started), + CPTAnimationFinishedKey: @(currentTime >= endTime) }; // Used -performSelectorOnMainThread:... instead of GCD to ensure the animation continues to run in all run loop common modes. @@ -366,7 +366,7 @@ -(void)update } // This method must be called from the main thread. --(void)updateOnMainThreadWithParameters:(NSDictionary *)parameters +-(void)updateOnMainThreadWithParameters:(nonnull CPTDictionary *)parameters { CPTAnimationOperation *animationOperation = parameters[CPTAnimationOperationKey]; @@ -378,6 +378,11 @@ -(void)updateOnMainThreadWithParameters:(NSDictionary *)parameters if ( !canceled ) { @try { + Class valueClass = parameters[CPTAnimationValueClassKey]; + if ( [valueClass isKindOfClass:[NSNull class]] ) { + valueClass = Nil; + } + id delegate = animationOperation.delegate; NSNumber *started = parameters[CPTAnimationStartedKey]; @@ -395,37 +400,45 @@ -(void)updateOnMainThreadWithParameters:(NSDictionary *)parameters id boundObject = animationOperation.boundObject; id tweenedValue = parameters[CPTAnimationValueKey]; - if ( [tweenedValue isKindOfClass:[NSDecimalNumber class]] ) { - NSDecimal buffer = [(NSDecimalNumber *)tweenedValue decimalValue]; + if ( !valueClass && [tweenedValue isKindOfClass:[NSDecimalNumber class]] ) { + NSDecimal buffer = ((NSDecimalNumber *)tweenedValue).decimalValue; typedef void (*SetterType)(id, SEL, NSDecimal); - SetterType setterMethod = (SetterType)[boundObject methodForSelector : boundSetter]; + SetterType setterMethod = (SetterType)[boundObject methodForSelector:boundSetter]; setterMethod(boundObject, boundSetter, buffer); } - else if ( [tweenedValue isKindOfClass:[NSValue class]] ) { + else if ( valueClass && [tweenedValue isKindOfClass:[NSNumber class]] ) { + NSNumber *value = (NSNumber *)tweenedValue; + + typedef void (*NumberSetterType)(id, SEL, NSNumber *); + NumberSetterType setterMethod = (NumberSetterType)[boundObject methodForSelector:boundSetter]; + setterMethod(boundObject, boundSetter, value); + } + else if ( [tweenedValue isKindOfClass:[CPTPlotRange class]] ) { + CPTPlotRange *range = (CPTPlotRange *)tweenedValue; + + typedef void (*RangeSetterType)(id, SEL, CPTPlotRange *); + RangeSetterType setterMethod = (RangeSetterType)[boundObject methodForSelector:boundSetter]; + setterMethod(boundObject, boundSetter, range); + } + else { + // wrapped scalars and structs NSValue *value = (NSValue *)tweenedValue; NSUInteger bufferSize = 0; NSGetSizeAndAlignment(value.objCType, &bufferSize, NULL); NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[boundObject methodSignatureForSelector:boundSetter]]; - [invocation setTarget:boundObject]; - [invocation setSelector:boundSetter]; + invocation.target = boundObject; + invocation.selector = boundSetter; - void *buffer = malloc(bufferSize); + void *buffer = calloc(1, bufferSize); [value getValue:buffer]; [invocation setArgument:buffer atIndex:2]; free(buffer); [invocation invoke]; } - else { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Warc-performSelector-leaks" - id theObject = boundObject; - [theObject performSelector:boundSetter withObject:tweenedValue]; -#pragma clang diagnostic pop - } if ( [delegate respondsToSelector:@selector(animationDidUpdate:)] ) { [delegate animationDidUpdate:animationOperation]; @@ -449,9 +462,17 @@ -(void)updateOnMainThreadWithParameters:(NSDictionary *)parameters -(void)startTimer { - self.timer = CPTCreateDispatchTimer(kCPTAnimationFrameRate, self.animationQueue, ^{ - [self update]; - }); + dispatch_source_t newTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, self.animationQueue); + + if ( newTimer ) { + dispatch_source_set_timer(newTimer, dispatch_time(DISPATCH_TIME_NOW, 0), (uint64_t)(kCPTAnimationFrameRate * NSEC_PER_SEC), 0); + dispatch_source_set_event_handler(newTimer, ^{ + [self update]; + }); + dispatch_resume(newTimer); + + self.timer = newTimer; + } } -(void)cancelTimer @@ -460,30 +481,17 @@ -(void)cancelTimer if ( theTimer ) { dispatch_source_cancel(theTimer); - dispatch_release(theTimer); self.timer = NULL; } } -dispatch_source_t CPTCreateDispatchTimer(CGFloat interval, dispatch_queue_t queue, dispatch_block_t block) -{ - dispatch_source_t newTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); - - if ( newTimer ) { - dispatch_source_set_timer(newTimer, dispatch_time(DISPATCH_TIME_NOW, 0), (uint64_t)(interval * NSEC_PER_SEC), 0); - dispatch_source_set_event_handler(newTimer, block); - dispatch_resume(newTimer); - } - return newTimer; -} - /// @endcond #pragma mark - Timing Functions /// @cond --(CPTAnimationTimingFunction)timingFunctionForAnimationCurve:(CPTAnimationCurve)animationCurve +-(nullable CPTAnimationTimingFunction)timingFunctionForAnimationCurve:(CPTAnimationCurve)animationCurve { CPTAnimationTimingFunction timingFunction; @@ -630,11 +638,11 @@ -(CPTAnimationTimingFunction)timingFunctionForAnimationCurve:(CPTAnimationCurve) /// @cond --(NSString *)description +-(nullable NSString *)description { return [NSString stringWithFormat:@"<%@ timeOffset: %g; %lu active and %lu running operations>", - [super description], - self.timeOffset, + super.description, + (double)self.timeOffset, (unsigned long)self.animationOperations.count, (unsigned long)self.runningAnimationOperations.count]; } diff --git a/framework/Source/CPTAnimationOperation.h b/framework/Source/CPTAnimationOperation.h index ac278ae7a..b179bf210 100644 --- a/framework/Source/CPTAnimationOperation.h +++ b/framework/Source/CPTAnimationOperation.h @@ -7,20 +7,20 @@ /// @name Animation Timing /// @{ -@property (nonatomic, strong) CPTAnimationPeriod *period; +@property (nonatomic, strong, nonnull) CPTAnimationPeriod *period; @property (nonatomic, assign) CPTAnimationCurve animationCurve; /// @} /// @name Animated Property /// @{ -@property (nonatomic, strong) id boundObject; -@property (nonatomic) SEL boundGetter; -@property (nonatomic) SEL boundSetter; +@property (nonatomic, strong, nonnull) id boundObject; +@property (nonatomic, nonnull) SEL boundGetter; +@property (nonatomic, nonnull) SEL boundSetter; /// @} /// @name Delegate /// @{ -@property (nonatomic, cpt_weak_property) cpt_weak id delegate; +@property (nonatomic, cpt_weak_property, nullable) id delegate; /// @} /// @name Status @@ -30,8 +30,13 @@ /// @name Identification /// @{ -@property (nonatomic, readwrite, copy) id identifier; -@property (nonatomic, readwrite, copy) NSDictionary *userInfo; +@property (nonatomic, readwrite, copy, nullable) id identifier; +@property (nonatomic, readwrite, copy, nullable) NSDictionary *userInfo; +/// @} + +/// @name Initialization +/// @{ +-(nonnull instancetype)initWithAnimationPeriod:(nonnull CPTAnimationPeriod *)animationPeriod animationCurve:(CPTAnimationCurve)curve object:(nonnull id)object getter:(nonnull SEL)getter setter:(nonnull SEL)setter NS_DESIGNATED_INITIALIZER; /// @} @end diff --git a/framework/Source/CPTAnimationOperation.m b/framework/Source/CPTAnimationOperation.m index f99b29b43..e7047abc5 100644 --- a/framework/Source/CPTAnimationOperation.m +++ b/framework/Source/CPTAnimationOperation.m @@ -6,7 +6,7 @@ **/ @implementation CPTAnimationOperation -/** @property CPTAnimationPeriod *period +/** @property nonnull CPTAnimationPeriod *period * @brief The start value, end value, and duration of this animation operation. **/ @synthesize period; @@ -16,7 +16,7 @@ @implementation CPTAnimationOperation **/ @synthesize animationCurve; -/** @property id boundObject +/** @property nonnull id boundObject * @brief The object to update for each animation frame. **/ @synthesize boundObject; @@ -31,7 +31,7 @@ @implementation CPTAnimationOperation **/ @synthesize boundSetter; -/** @property cpt_weak iddelegate +/** @property nullable iddelegate * @brief The animation delegate. **/ @synthesize delegate; @@ -41,12 +41,12 @@ @implementation CPTAnimationOperation **/ @synthesize canceled; -/** @property id identifier - * @brief An object used to identify the layer in collections. +/** @property nullable id identifier + * @brief An object used to identify the animation operation in collections. **/ @synthesize identifier; -/** @property NSDictionary *userInfo +/** @property nullable NSDictionary *userInfo * @brief Application-specific user info that can be attached to the operation. **/ @synthesize userInfo; @@ -57,26 +57,32 @@ @implementation CPTAnimationOperation /** @brief Initializes a newly allocated CPTAnimationOperation object. * * This is the designated initializer. The initialized object will have the following properties: - * - @ref period = @nil - * - @ref animationCurve = #CPTAnimationCurveDefault - * - @ref boundObject = @nil - * - @ref boundGetter = @NULL - * - @ref boundSetter = @NULL + * - @ref period = @par{animationPeriod} + * - @ref animationCurve = @par{curve} + * - @ref boundObject = @par{object} + * - @ref boundGetter = @par{getter} + * - @ref boundSetter = @par{setter} * - @ref delegate = @nil * - @ref canceled = @NO * - @ref identifier = @nil * - @ref userInfo = @nil * + * @param animationPeriod The animation period. + * @param curve The animation curve. + * @param object The object to update for each animation frame. + * @param getter The @ref boundObject getter method for the property to update for each animation frame. + * @param setter The @ref boundObject setter method for the property to update for each animation frame. + * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)initWithAnimationPeriod:(nonnull CPTAnimationPeriod *)animationPeriod animationCurve:(CPTAnimationCurve)curve object:(nonnull id)object getter:(nonnull SEL)getter setter:(nonnull SEL)setter { - if ( (self = [super init]) ) { - period = nil; - animationCurve = CPTAnimationCurveDefault; - boundObject = nil; - boundGetter = NULL; - boundSetter = NULL; + if ((self = [super init])) { + period = animationPeriod; + animationCurve = curve; + boundObject = object; + boundGetter = getter; + boundSetter = setter; delegate = nil; canceled = NO; identifier = nil; @@ -88,14 +94,29 @@ -(instancetype)init /// @} +/// @cond + +-(nonnull instancetype)init +{ + NSAssert(NO, @"Must call -initWithAnimationPeriod:animationCurve:object:getter:setter: to initialize a CPTAnimationOperation."); + + return [self initWithAnimationPeriod:[[CPTAnimationPeriod alloc] init] + animationCurve:CPTAnimationCurveDefault + object:[[NSObject alloc] init] + getter:@selector(init) + setter:@selector(init)]; +} + +/// @endcond + #pragma mark - #pragma mark Description /// @cond --(NSString *)description +-(nullable NSString *)description { - return [NSString stringWithFormat:@"<%@ animate %@ %@ with period %@>", [super description], self.boundObject, NSStringFromSelector(self.boundGetter), self.period]; + return [NSString stringWithFormat:@"<%@ animate %@ %@ with period %@>", super.description, self.boundObject, NSStringFromSelector(self.boundGetter), self.period]; } /// @endcond diff --git a/framework/Source/CPTAnimationPeriod.h b/framework/Source/CPTAnimationPeriod.h index 14e28d78c..cfd21ac63 100644 --- a/framework/Source/CPTAnimationPeriod.h +++ b/framework/Source/CPTAnimationPeriod.h @@ -7,8 +7,9 @@ /// @name Timing Values /// @{ -@property (nonatomic, readwrite, copy) NSValue *startValue; -@property (nonatomic, readwrite, copy) NSValue *endValue; +@property (nonatomic, readwrite, copy, nullable) NSValue *startValue; +@property (nonatomic, readwrite, copy, nullable) NSValue *endValue; +@property (nonatomic, readonly, nullable) Class valueClass; @property (nonatomic, readwrite) CGFloat duration; @property (nonatomic, readwrite) CGFloat delay; @property (nonatomic, readonly) CGFloat startOffset; @@ -16,22 +17,24 @@ /// @name Factory Methods /// @{ -+(instancetype)periodWithStart:(CGFloat)aStart end:(CGFloat)anEnd duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; -+(instancetype)periodWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoint)anEndPoint duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; -+(instancetype)periodWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; -+(instancetype)periodWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; -+(instancetype)periodWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDecimal)anEndDecimal duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; -+(instancetype)periodWithStartPlotRange:(CPTPlotRange *)aStartPlotRange endPlotRange:(CPTPlotRange *)anEndPlotRange duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; ++(nonnull instancetype)periodWithStart:(CGFloat)aStart end:(CGFloat)anEnd duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; ++(nonnull instancetype)periodWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoint)anEndPoint duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; ++(nonnull instancetype)periodWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; ++(nonnull instancetype)periodWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; ++(nonnull instancetype)periodWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDecimal)anEndDecimal duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; ++(nonnull instancetype)periodWithStartNumber:(nullable NSNumber *)aStartNumber endNumber:(nonnull NSNumber *)anEndNumber duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; ++(nonnull instancetype)periodWithStartPlotRange:(nonnull CPTPlotRange *)aStartPlotRange endPlotRange:(nonnull CPTPlotRange *)anEndPlotRange duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; /// @} /// @name Initialization /// @{ --(instancetype)initWithStart:(CGFloat)aStart end:(CGFloat)anEnd duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; --(instancetype)initWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoint)anEndPoint duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; --(instancetype)initWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; --(instancetype)initWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; --(instancetype)initWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDecimal)anEndDecimal duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; --(instancetype)initWithStartPlotRange:(CPTPlotRange *)aStartPlotRange endPlotRange:(CPTPlotRange *)anEndPlotRange duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; +-(nonnull instancetype)initWithStart:(CGFloat)aStart end:(CGFloat)anEnd duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; +-(nonnull instancetype)initWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoint)anEndPoint duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; +-(nonnull instancetype)initWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; +-(nonnull instancetype)initWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; +-(nonnull instancetype)initWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDecimal)anEndDecimal duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; +-(nonnull instancetype)initWithStartNumber:(nullable NSNumber *)aStartNumber endNumber:(nonnull NSNumber *)anEndNumber duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; +-(nonnull instancetype)initWithStartPlotRange:(nonnull CPTPlotRange *)aStartPlotRange endPlotRange:(nonnull CPTPlotRange *)anEndPlotRange duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; /// @} @end @@ -45,17 +48,17 @@ /// @name Initialization /// @{ --(void)setStartValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter; +-(void)setStartValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter; /// @} /// @name Interpolation /// @{ --(NSValue *)tweenedValueForProgress:(CGFloat)progress; +-(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress; /// @} /// @name Comparison /// @{ --(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter; +-(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter; /// @} @end @@ -66,44 +69,51 @@ /// @name CGFloat Property Animation /// @{ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate; -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate; -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration; /// @} /// @name CGPoint Property Animation /// @{ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate; -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate; -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration; /// @} /// @name CGSize Property Animation /// @{ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate; -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate; -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration; /// @} /// @name CGRect Property Animation /// @{ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate; -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate; -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration; /// @} /// @name NSDecimal Property Animation /// @{ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate; -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate; -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration; +/// @} + +/// @name NSNumber Property Animation +/// @{ ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromNumber:(nullable NSNumber *)from toNumber:(nonnull NSNumber *)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromNumber:(nullable NSNumber *)from toNumber:(nonnull NSNumber *)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromNumber:(nullable NSNumber *)from toNumber:(nonnull NSNumber *)to duration:(CGFloat)duration; /// @} /// @name CPTPlotRange Property Animation /// @{ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPlotRange:(CPTPlotRange *)from toPlotRange:(CPTPlotRange *)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate; -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPlotRange:(CPTPlotRange *)from toPlotRange:(CPTPlotRange *)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate; -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPlotRange:(CPTPlotRange *)from toPlotRange:(CPTPlotRange *)to duration:(CGFloat)duration; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromPlotRange:(nonnull CPTPlotRange *)from toPlotRange:(nonnull CPTPlotRange *)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromPlotRange:(nonnull CPTPlotRange *)from toPlotRange:(nonnull CPTPlotRange *)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate; ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromPlotRange:(nonnull CPTPlotRange *)from toPlotRange:(nonnull CPTPlotRange *)to duration:(CGFloat)duration; /// @} @end diff --git a/framework/Source/CPTAnimationPeriod.m b/framework/Source/CPTAnimationPeriod.m index fd94a212c..3d781b79c 100644 --- a/framework/Source/CPTAnimationPeriod.m +++ b/framework/Source/CPTAnimationPeriod.m @@ -1,21 +1,22 @@ #import "CPTAnimationPeriod.h" -#import "CPTAnimationOperation.h" -#import "CPTPlotRange.h" -#import "NSNumberExtensions.h" #import "_CPTAnimationCGFloatPeriod.h" #import "_CPTAnimationCGPointPeriod.h" #import "_CPTAnimationCGRectPeriod.h" #import "_CPTAnimationCGSizePeriod.h" #import "_CPTAnimationNSDecimalPeriod.h" +#import "_CPTAnimationNSNumberPeriod.h" #import "_CPTAnimationPlotRangePeriod.h" +#import "CPTAnimationOperation.h" +#import "CPTPlotRange.h" +#import "NSNumberExtensions.h" /// @cond @interface CPTAnimationPeriod() -+(instancetype)periodWithStartValue:(NSValue *)aStartValue endValue:(NSValue *)anEndValue duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; ++(nonnull instancetype)periodWithStartValue:(nullable NSValue *)aStartValue endValue:(nullable NSValue *)anEndValue ofClass:(nullable Class)class duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; --(instancetype)initWithStartValue:(NSValue *)aStartValue endValue:(NSValue *)anEndValue duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; +-(nonnull instancetype)initWithStartValue:(nullable NSValue *)aStartValue endValue:(nullable NSValue *)anEndValue ofClass:(nullable Class)class duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay; @property (nonatomic, readwrite) CGFloat startOffset; @@ -33,23 +34,29 @@ -(instancetype)initWithStartValue:(NSValue *)aStartValue endValue:(NSValue *)anE * - @ref CGSize * - @ref CGRect * - @ref NSDecimal + * - @ref NSNumber * - @ref CPTPlotRange (NSValue wrapper not used) * @note The starting and ending values must be the same type. **/ @implementation CPTAnimationPeriod -/** @property NSValue *startValue +/** @property nullable NSValue *startValue * @brief The starting value of the animation. * * If @nil or the encoded value is @NAN, the animation starts from the current value of the animated property. **/ @synthesize startValue; -/** @property NSValue *endValue +/** @property nullable NSValue *endValue * @brief The ending value of the animation. **/ @synthesize endValue; +/** @property Class valueClass + * @brief The Objective-C class of the animated object. If @nil, the value is a scalar or struct wrapped in an NSValue object. + **/ +@synthesize valueClass; + /** @property CGFloat duration * @brief The duration of the animation, in seconds. **/ @@ -75,13 +82,14 @@ @implementation CPTAnimationPeriod * @brief Creates and returns a new CPTAnimationPeriod instance initialized with the provided start and end values and duration. * @param aStartValue The starting value. If @nil, the animation starts from the current value of the animated property. * @param anEndValue The ending value. + * @param class The Objective-C class of the animated object. If @Nil, the value is a scalar or struct wrapped in an NSValue object. * @param aDuration The animation duration in seconds. * @param aDelay The starting delay in seconds. * @return The initialized object. **/ -+(instancetype)periodWithStartValue:(NSValue *)aStartValue endValue:(NSValue *)anEndValue duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay ++(instancetype)periodWithStartValue:(NSValue *)aStartValue endValue:(NSValue *)anEndValue ofClass:(Class)class duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { - return [[self alloc] initWithStartValue:aStartValue endValue:anEndValue duration:aDuration withDelay:aDelay]; + return [[self alloc] initWithStartValue:aStartValue endValue:anEndValue ofClass:class duration:aDuration withDelay:aDelay]; } /// @endcond @@ -94,12 +102,13 @@ +(instancetype)periodWithStartValue:(NSValue *)aStartValue endValue:(NSValue *)a * @param aDelay The starting delay in seconds. * @return The initialized object. **/ -+(instancetype)periodWithStart:(CGFloat)aStart end:(CGFloat)anEnd duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay ++(nonnull instancetype)periodWithStart:(CGFloat)aStart end:(CGFloat)anEnd duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { NSNumber *start = isnan(aStart) ? nil : @(aStart); return [_CPTAnimationCGFloatPeriod periodWithStartValue:start endValue:@(anEnd) + ofClass:Nil duration:aDuration withDelay:aDelay]; } @@ -112,16 +121,17 @@ +(instancetype)periodWithStart:(CGFloat)aStart end:(CGFloat)anEnd duration:(CGFl * @param aDelay The starting delay in seconds. * @return The initialized object. **/ -+(instancetype)periodWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoint)anEndPoint duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay ++(nonnull instancetype)periodWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoint)anEndPoint duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { NSValue *start = nil; - if ( !isnan(aStartPoint.x) && !isnan(aStartPoint.y) ) { + if ( !isnan(aStartPoint.x) && !isnan(aStartPoint.y)) { start = [NSValue valueWithBytes:&aStartPoint objCType:@encode(CGPoint)]; } return [_CPTAnimationCGPointPeriod periodWithStartValue:start endValue:[NSValue valueWithBytes:&anEndPoint objCType:@encode(CGPoint)] + ofClass:Nil duration:aDuration withDelay:aDelay]; } @@ -134,16 +144,17 @@ +(instancetype)periodWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoint)anEnd * @param aDelay The starting delay in seconds. * @return The initialized object. **/ -+(instancetype)periodWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay ++(nonnull instancetype)periodWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { NSValue *start = nil; - if ( !isnan(aStartSize.width) && !isnan(aStartSize.height) ) { + if ( !isnan(aStartSize.width) && !isnan(aStartSize.height)) { start = [NSValue valueWithBytes:&aStartSize objCType:@encode(CGSize)]; } return [_CPTAnimationCGSizePeriod periodWithStartValue:start endValue:[NSValue valueWithBytes:&anEndSize objCType:@encode(CGSize)] + ofClass:Nil duration:aDuration withDelay:aDelay]; } @@ -156,16 +167,17 @@ +(instancetype)periodWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize * @param aDelay The starting delay in seconds. * @return The initialized object. **/ -+(instancetype)periodWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay ++(nonnull instancetype)periodWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { NSValue *start = nil; - if ( !CGRectEqualToRect(aStartRect, CGRectNull) && !isnan(aStartRect.origin.x) && !isnan(aStartRect.origin.y) && !isnan(aStartRect.size.width) && !isnan(aStartRect.size.height) ) { + if ( !CGRectEqualToRect(aStartRect, CGRectNull) && !isnan(aStartRect.origin.x) && !isnan(aStartRect.origin.y) && !isnan(aStartRect.size.width) && !isnan(aStartRect.size.height)) { start = [NSValue valueWithBytes:&aStartRect objCType:@encode(CGRect)]; } return [_CPTAnimationCGRectPeriod periodWithStartValue:start endValue:[NSValue valueWithBytes:&anEndRect objCType:@encode(CGRect)] + ofClass:Nil duration:aDuration withDelay:aDelay]; } @@ -178,16 +190,34 @@ +(instancetype)periodWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect * @param aDelay The starting delay in seconds. * @return The initialized object. **/ -+(instancetype)periodWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDecimal)anEndDecimal duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay ++(nonnull instancetype)periodWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDecimal)anEndDecimal duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { NSDecimalNumber *start = NSDecimalIsNotANumber(&aStartDecimal) ? nil : [NSDecimalNumber decimalNumberWithDecimal:aStartDecimal]; return [_CPTAnimationNSDecimalPeriod periodWithStartValue:start endValue:[NSDecimalNumber decimalNumberWithDecimal:anEndDecimal] + ofClass:Nil duration:aDuration withDelay:aDelay]; } +/** + * @brief Creates and returns a new CPTAnimationPeriod instance initialized with the provided start and end values and duration. + * @param aStartNumber The starting value. If @NAN or @nil, the animation starts from the current value of the animated property. + * @param anEndNumber The ending value. + * @param aDuration The animation duration in seconds. + * @param aDelay The starting delay in seconds. + * @return The initialized object. + **/ ++(nonnull instancetype)periodWithStartNumber:(nullable NSNumber *)aStartNumber endNumber:(nonnull NSNumber *)anEndNumber duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay +{ + return [_CPTAnimationNSNumberPeriod periodWithStartValue:aStartNumber + endValue:anEndNumber + ofClass:[NSNumber class] + duration:aDuration + withDelay:aDelay]; +} + /** * @brief Creates and returns a new CPTAnimationPeriod instance initialized with the provided start and end plot ranges and duration. * @param aStartPlotRange The starting plot range. If @nil or any component of the range is @NAN, the animation starts from the current value of the animated property. @@ -196,14 +226,17 @@ +(instancetype)periodWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDec * @param aDelay The starting delay in seconds. * @return The initialized object. **/ -+(instancetype)periodWithStartPlotRange:(CPTPlotRange *)aStartPlotRange endPlotRange:(CPTPlotRange *)anEndPlotRange duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay ++(nonnull instancetype)periodWithStartPlotRange:(nonnull CPTPlotRange *)aStartPlotRange endPlotRange:(nonnull CPTPlotRange *)anEndPlotRange duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { - if ( isnan(aStartPlotRange.locationDouble) || isnan(aStartPlotRange.lengthDouble) ) { - aStartPlotRange = nil; + CPTPlotRange *startRange = aStartPlotRange; + + if ( isnan(aStartPlotRange.locationDouble) || isnan(aStartPlotRange.lengthDouble)) { + startRange = nil; } - return [_CPTAnimationPlotRangePeriod periodWithStartValue:(NSValue *)aStartPlotRange + return [_CPTAnimationPlotRangePeriod periodWithStartValue:(NSValue *)startRange endValue:(NSValue *)anEndPlotRange + ofClass:[CPTPlotRange class] duration:aDuration withDelay:aDelay]; } @@ -216,21 +249,24 @@ +(instancetype)periodWithStartPlotRange:(CPTPlotRange *)aStartPlotRange endPlotR * This is the designated initializer. The initialized object will have the following properties: * - @ref startValue = @par{aStartValue} * - @ref endValue = @par{anEndValue} + * - @ref class = @par{class} * - @ref duration = @par{aDuration} * - @ref delay = @par{aDelay} * - @ref startOffset = The animation time clock offset when this method is called. * * @param aStartValue The starting value. If @nil, the animation starts from the current value of the animated property. * @param anEndValue The ending value. + * @param class The Objective-C class of the animated object. If @Nil, the value is a scalar or struct wrapped in an NSValue object. * @param aDuration The animation duration in seconds. * @param aDelay The starting delay in seconds. * @return The initialized object. **/ --(instancetype)initWithStartValue:(NSValue *)aStartValue endValue:(NSValue *)anEndValue duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay +-(instancetype)initWithStartValue:(NSValue *)aStartValue endValue:(NSValue *)anEndValue ofClass:(Class)class duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { - if ( (self = [super init]) ) { + if ((self = [super init])) { startValue = [aStartValue copy]; endValue = [anEndValue copy]; + valueClass = class; duration = aDuration; delay = aDelay; startOffset = [CPTAnimation sharedInstance].timeOffset; @@ -249,12 +285,13 @@ -(instancetype)initWithStartValue:(NSValue *)aStartValue endValue:(NSValue *)anE * @param aDelay The starting delay in seconds. * @return The initialized object. **/ --(instancetype)initWithStart:(CGFloat)aStart end:(CGFloat)anEnd duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay +-(nonnull instancetype)initWithStart:(CGFloat)aStart end:(CGFloat)anEnd duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { NSNumber *start = isnan(aStart) ? nil : @(aStart); self = [[_CPTAnimationCGFloatPeriod alloc] initWithStartValue:start endValue:@(anEnd) + ofClass:Nil duration:aDuration withDelay:aDelay]; @@ -269,16 +306,17 @@ -(instancetype)initWithStart:(CGFloat)aStart end:(CGFloat)anEnd duration:(CGFloa * @param aDelay The starting delay in seconds. * @return The initialized object. **/ --(instancetype)initWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoint)anEndPoint duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay +-(nonnull instancetype)initWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoint)anEndPoint duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { NSValue *start = nil; - if ( !isnan(aStartPoint.x) && !isnan(aStartPoint.y) ) { + if ( !isnan(aStartPoint.x) && !isnan(aStartPoint.y)) { start = [NSValue valueWithBytes:&aStartPoint objCType:@encode(CGPoint)]; } self = [[_CPTAnimationCGPointPeriod alloc] initWithStartValue:start endValue:[NSValue valueWithBytes:&anEndPoint objCType:@encode(CGPoint)] + ofClass:Nil duration:aDuration withDelay:aDelay]; @@ -293,16 +331,17 @@ -(instancetype)initWithStartPoint:(CGPoint)aStartPoint endPoint:(CGPoint)anEndPo * @param aDelay The starting delay in seconds. * @return The initialized object. **/ --(instancetype)initWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay +-(nonnull instancetype)initWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { NSValue *start = nil; - if ( !isnan(aStartSize.width) && !isnan(aStartSize.height) ) { + if ( !isnan(aStartSize.width) && !isnan(aStartSize.height)) { start = [NSValue valueWithBytes:&aStartSize objCType:@encode(CGSize)]; } self = [[_CPTAnimationCGSizePeriod alloc] initWithStartValue:start endValue:[NSValue valueWithBytes:&anEndSize objCType:@encode(CGSize)] + ofClass:Nil duration:aDuration withDelay:aDelay]; @@ -317,16 +356,17 @@ -(instancetype)initWithStartSize:(CGSize)aStartSize endSize:(CGSize)anEndSize du * @param aDelay The starting delay in seconds. * @return The initialized object. **/ --(instancetype)initWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay +-(nonnull instancetype)initWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { NSValue *start = nil; - if ( !CGRectEqualToRect(aStartRect, CGRectNull) && !isnan(aStartRect.origin.x) && !isnan(aStartRect.origin.y) && !isnan(aStartRect.size.width) && !isnan(aStartRect.size.height) ) { + if ( !CGRectEqualToRect(aStartRect, CGRectNull) && !isnan(aStartRect.origin.x) && !isnan(aStartRect.origin.y) && !isnan(aStartRect.size.width) && !isnan(aStartRect.size.height)) { start = [NSValue valueWithBytes:&aStartRect objCType:@encode(CGRect)]; } self = [[_CPTAnimationCGRectPeriod alloc] initWithStartValue:start endValue:[NSValue valueWithBytes:&anEndRect objCType:@encode(CGRect)] + ofClass:Nil duration:aDuration withDelay:aDelay]; @@ -341,18 +381,38 @@ -(instancetype)initWithStartRect:(CGRect)aStartRect endRect:(CGRect)anEndRect du * @param aDelay The starting delay in seconds. * @return The initialized object. **/ --(instancetype)initWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDecimal)anEndDecimal duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay +-(nonnull instancetype)initWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDecimal)anEndDecimal duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { NSDecimalNumber *start = NSDecimalIsNotANumber(&aStartDecimal) ? nil : [NSDecimalNumber decimalNumberWithDecimal:aStartDecimal]; self = [[_CPTAnimationNSDecimalPeriod alloc] initWithStartValue:start endValue:[NSDecimalNumber decimalNumberWithDecimal:anEndDecimal] + ofClass:Nil duration:aDuration withDelay:aDelay]; return self; } +/** + * @brief Initializes a newly allocated CPTAnimationPeriod object with the provided start and end values and duration. + * @param aStartNumber The starting value. If @NAN or @nil, the animation starts from the current value of the animated property. + * @param anEndNumber The ending value. + * @param aDuration The animation duration in seconds. + * @param aDelay The starting delay in seconds. + * @return The initialized object. + **/ +-(nonnull instancetype)initWithStartNumber:(nullable NSNumber *)aStartNumber endNumber:(nonnull NSNumber *)anEndNumber duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay +{ + self = [[_CPTAnimationNSNumberPeriod alloc] initWithStartValue:aStartNumber + endValue:anEndNumber + ofClass:[NSNumber class] + duration:aDuration + withDelay:aDelay]; + + return self; +} + /** * @brief Initializes a newly allocated CPTAnimationPeriod object with the provided start and end plot ranges and duration. * @param aStartPlotRange The starting plot range. If @nil or any component of the range is @NAN, the animation starts from the current value of the animated property. @@ -361,14 +421,17 @@ -(instancetype)initWithStartDecimal:(NSDecimal)aStartDecimal endDecimal:(NSDecim * @param aDelay The starting delay in seconds. * @return The initialized object. **/ --(instancetype)initWithStartPlotRange:(CPTPlotRange *)aStartPlotRange endPlotRange:(CPTPlotRange *)anEndPlotRange duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay +-(nonnull instancetype)initWithStartPlotRange:(nonnull CPTPlotRange *)aStartPlotRange endPlotRange:(nonnull CPTPlotRange *)anEndPlotRange duration:(CGFloat)aDuration withDelay:(CGFloat)aDelay { - if ( isnan(aStartPlotRange.locationDouble) || isnan(aStartPlotRange.lengthDouble) ) { - aStartPlotRange = nil; + CPTPlotRange *startRange = aStartPlotRange; + + if ( isnan(aStartPlotRange.locationDouble) || isnan(aStartPlotRange.lengthDouble)) { + startRange = nil; } - self = [[_CPTAnimationPlotRangePeriod alloc] initWithStartValue:(NSValue *)aStartPlotRange + self = [[_CPTAnimationPlotRangePeriod alloc] initWithStartValue:(NSValue *)startRange endValue:(NSValue *)anEndPlotRange + ofClass:[CPTPlotRange class] duration:aDuration withDelay:aDelay]; @@ -380,9 +443,9 @@ -(instancetype)initWithStartPlotRange:(CPTPlotRange *)aStartPlotRange endPlotRan /** @brief Initializes a newly allocated CPTAnimationPeriod object with no start or end values and a @par{duration} and @par{delay} of zero (@num{0}). * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - return [self initWithStartValue:nil endValue:nil duration:CPTFloat(0.0) withDelay:CPTFloat(0.0)]; + return [self initWithStartValue:nil endValue:@0.0 ofClass:Nil duration:CPTFloat(0.0) withDelay:CPTFloat(0.0)]; } /// @endcond @@ -395,7 +458,7 @@ -(instancetype)init * @param boundObject The object to update for each animation frame. * @param boundGetter The getter method for the property to update. **/ --(void)setStartValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(void)setStartValueFromObject:(nonnull id __unused)boundObject propertyGetter:(nonnull SEL __unused)boundGetter { [NSException raise:NSGenericException format:@"The -initializeStartValue method must be implemented by CPTAnimationPeriod subclasses."]; @@ -409,7 +472,7 @@ -(void)setStartValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter * @param progress The fraction of the animation progress. * @return The computed value. **/ --(NSValue *)tweenedValueForProgress:(CGFloat)progress +-(nonnull NSValue *)tweenedValueForProgress:(CGFloat __unused)progress { [NSException raise:NSGenericException format:@"The -tweenedValueForProgress: method must be implemented by CPTAnimationPeriod subclasses."]; @@ -422,7 +485,7 @@ -(NSValue *)tweenedValueForProgress:(CGFloat)progress * @param boundGetter The getter method for the property to update. * @return @YES if the current value of the bound property is between the start and end value. **/ --(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(BOOL)canStartWithValueFromObject:(nonnull id __unused)boundObject propertyGetter:(nonnull SEL __unused)boundGetter { [NSException raise:NSGenericException format:@"The -canStartWithValueFromObject:propertyGetter: method must be implemented by CPTAnimationPeriod subclasses."]; @@ -434,9 +497,9 @@ -(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGett /// @cond --(NSString *)description +-(nullable NSString *)description { - return [NSString stringWithFormat:@"<%@ from: %@; to: %@; duration: %g, delay: %g>", [super description], self.startValue, self.endValue, self.duration, self.delay]; + return [NSString stringWithFormat:@"<%@ from: %@; to: %@; duration: %g, delay: %g>", super.description, self.startValue, self.endValue, (double)self.duration, (double)self.delay]; } /// @endcond @@ -460,7 +523,7 @@ @implementation CPTAnimation(CPTAnimationPeriodAdditions) * @param delegate The animation delegate (can be @nil). * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStart:from end:to @@ -468,10 +531,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from: withDelay:delay]; return [self animate:object - property:property - period:period - animationCurve:animationCurve - delegate:delegate + property:property + period:period + animationCurve:animationCurve + delegate:delegate ]; } @@ -485,7 +548,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from: * @param delegate The animation delegate (can be @nil). * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStart:from end:to @@ -493,10 +556,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from: withDelay:CPTFloat(0.0)]; return [self animate:object - property:property - period:period - animationCurve:animationCurve - delegate:delegate + property:property + period:period + animationCurve:animationCurve + delegate:delegate ]; } @@ -508,7 +571,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from: * @param duration The duration of the animation. * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property from:(CGFloat)from to:(CGFloat)to duration:(CGFloat)duration { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStart:from end:to @@ -516,10 +579,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from: withDelay:CPTFloat(0.0)]; return [self animate:object - property:property - period:period - animationCurve:CPTAnimationCurveDefault - delegate:nil]; + property:property + period:period + animationCurve:CPTAnimationCurveDefault + delegate:nil]; } // CGPoint @@ -535,7 +598,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property from: * @param delegate The animation delegate (can be @nil). * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartPoint:from endPoint:to @@ -543,10 +606,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromP withDelay:delay]; return [self animate:object - property:property - period:period - animationCurve:animationCurve - delegate:delegate + property:property + period:period + animationCurve:animationCurve + delegate:delegate ]; } @@ -560,7 +623,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromP * @param delegate The animation delegate (can be @nil). * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartPoint:from endPoint:to @@ -568,10 +631,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromP withDelay:CPTFloat(0.0)]; return [self animate:object - property:property - period:period - animationCurve:animationCurve - delegate:delegate + property:property + period:period + animationCurve:animationCurve + delegate:delegate ]; } @@ -583,7 +646,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromP * @param duration The duration of the animation. * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromPoint:(CGPoint)from toPoint:(CGPoint)to duration:(CGFloat)duration { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartPoint:from endPoint:to @@ -591,10 +654,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromP withDelay:CPTFloat(0.0)]; return [self animate:object - property:property - period:period - animationCurve:CPTAnimationCurveDefault - delegate:nil]; + property:property + period:period + animationCurve:CPTAnimationCurveDefault + delegate:nil]; } // CGSize @@ -610,7 +673,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromP * @param delegate The animation delegate (can be @nil). * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartSize:from endSize:to @@ -618,10 +681,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromS withDelay:delay]; return [self animate:object - property:property - period:period - animationCurve:animationCurve - delegate:delegate + property:property + period:period + animationCurve:animationCurve + delegate:delegate ]; } @@ -635,7 +698,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromS * @param delegate The animation delegate (can be @nil). * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartSize:from endSize:to @@ -643,10 +706,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromS withDelay:CPTFloat(0.0)]; return [self animate:object - property:property - period:period - animationCurve:animationCurve - delegate:delegate + property:property + period:period + animationCurve:animationCurve + delegate:delegate ]; } @@ -658,7 +721,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromS * @param duration The duration of the animation. * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromSize:(CGSize)from toSize:(CGSize)to duration:(CGFloat)duration { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartSize:from endSize:to @@ -666,10 +729,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromS withDelay:CPTFloat(0.0)]; return [self animate:object - property:property - period:period - animationCurve:CPTAnimationCurveDefault - delegate:nil]; + property:property + period:period + animationCurve:CPTAnimationCurveDefault + delegate:nil]; } // CGRect @@ -685,7 +748,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromS * @param delegate The animation delegate (can be @nil). * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartRect:from endRect:to @@ -693,10 +756,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromR withDelay:delay]; return [self animate:object - property:property - period:period - animationCurve:animationCurve - delegate:delegate + property:property + period:period + animationCurve:animationCurve + delegate:delegate ]; } @@ -710,7 +773,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromR * @param delegate The animation delegate (can be @nil). * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartRect:from endRect:to @@ -718,10 +781,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromR withDelay:CPTFloat(0.0)]; return [self animate:object - property:property - period:period - animationCurve:animationCurve - delegate:delegate + property:property + period:period + animationCurve:animationCurve + delegate:delegate ]; } @@ -733,7 +796,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromR * @param duration The duration of the animation. * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromRect:(CGRect)from toRect:(CGRect)to duration:(CGFloat)duration { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartRect:from endRect:to @@ -741,10 +804,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromR withDelay:CPTFloat(0.0)]; return [self animate:object - property:property - period:period - animationCurve:CPTAnimationCurveDefault - delegate:nil]; + property:property + period:period + animationCurve:CPTAnimationCurveDefault + delegate:nil]; } // NSDecimal @@ -760,7 +823,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromR * @param delegate The animation delegate (can be @nil). * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartDecimal:from endDecimal:to @@ -768,10 +831,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromD withDelay:delay]; return [self animate:object - property:property - period:period - animationCurve:animationCurve - delegate:delegate + property:property + period:period + animationCurve:animationCurve + delegate:delegate ]; } @@ -785,7 +848,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromD * @param delegate The animation delegate (can be @nil). * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartDecimal:from endDecimal:to @@ -793,10 +856,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromD withDelay:CPTFloat(0.0)]; return [self animate:object - property:property - period:period - animationCurve:animationCurve - delegate:delegate + property:property + period:period + animationCurve:animationCurve + delegate:delegate ]; } @@ -808,7 +871,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromD * @param duration The duration of the animation. * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromDecimal:(NSDecimal)from toDecimal:(NSDecimal)to duration:(CGFloat)duration { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartDecimal:from endDecimal:to @@ -816,10 +879,85 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromD withDelay:CPTFloat(0.0)]; return [self animate:object - property:property - period:period - animationCurve:CPTAnimationCurveDefault - delegate:nil]; + property:property + period:period + animationCurve:CPTAnimationCurveDefault + delegate:nil]; +} + +// NSNumber + +/** @brief Creates an animation operation with the given properties and adds it to the animation queue. + * @param object The object to animate. + * @param property The name of the property of @par{object} to animate. The property must have both getter and setter methods. + * @param from The starting value. If @NAN or @nil, the animation starts from the current value of the animated property. + * @param to The ending value. + * @param duration The duration of the animation. + * @param delay The starting delay of the animation in seconds. + * @param animationCurve The animation curve used to animate the new operation. + * @param delegate The animation delegate (can be @nil). + * @return The queued animation operation. + **/ ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromNumber:(nullable NSNumber *)from toNumber:(nonnull NSNumber *)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate +{ + CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartNumber:from + endNumber:to + duration:duration + withDelay:delay]; + + return [self animate:object + property:property + period:period + animationCurve:animationCurve + delegate:delegate + ]; +} + +/** @brief Creates an animation operation with the given properties and adds it to the animation queue. + * @param object The object to animate. + * @param property The name of the property of @par{object} to animate. The property must have both getter and setter methods. + * @param from The starting value. If @NAN or @nil, the animation starts from the current value of the animated property. + * @param to The ending value. + * @param duration The duration of the animation. + * @param animationCurve The animation curve used to animate the new operation. + * @param delegate The animation delegate (can be @nil). + * @return The queued animation operation. + **/ ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromNumber:(nullable NSNumber *)from toNumber:(nonnull NSNumber *)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate +{ + CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartNumber:from + endNumber:to + duration:duration + withDelay:CPTFloat(0.0)]; + + return [self animate:object + property:property + period:period + animationCurve:animationCurve + delegate:delegate + ]; +} + +/** @brief Creates an animation operation with the given properties and adds it to the animation queue. + * @param object The object to animate. + * @param property The name of the property of @par{object} to animate. The property must have both getter and setter methods. + * @param from The starting value. If @NAN or @nil, the animation starts from the current value of the animated property. + * @param to The ending value. + * @param duration The duration of the animation. + * @return The queued animation operation. + **/ ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromNumber:(nullable NSNumber *)from toNumber:(nonnull NSNumber *)to duration:(CGFloat)duration +{ + CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartNumber:from + endNumber:to + duration:duration + withDelay:CPTFloat(0.0)]; + + return [self animate:object + property:property + period:period + animationCurve:CPTAnimationCurveDefault + delegate:nil]; } // CPTPlotRange @@ -835,7 +973,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromD * @param delegate The animation delegate (can be @nil). * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPlotRange:(CPTPlotRange *)from toPlotRange:(CPTPlotRange *)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromPlotRange:(nonnull CPTPlotRange *)from toPlotRange:(nonnull CPTPlotRange *)to duration:(CGFloat)duration withDelay:(CGFloat)delay animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartPlotRange:from endPlotRange:to @@ -843,10 +981,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromP withDelay:delay]; return [self animate:object - property:property - period:period - animationCurve:animationCurve - delegate:delegate + property:property + period:period + animationCurve:animationCurve + delegate:delegate ]; } @@ -860,7 +998,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromP * @param delegate The animation delegate (can be @nil). * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPlotRange:(CPTPlotRange *)from toPlotRange:(CPTPlotRange *)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(id)delegate ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromPlotRange:(nonnull CPTPlotRange *)from toPlotRange:(nonnull CPTPlotRange *)to duration:(CGFloat)duration animationCurve:(CPTAnimationCurve)animationCurve delegate:(nullable id)delegate { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartPlotRange:from endPlotRange:to @@ -868,10 +1006,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromP withDelay:CPTFloat(0.0)]; return [self animate:object - property:property - period:period - animationCurve:animationCurve - delegate:delegate + property:property + period:period + animationCurve:animationCurve + delegate:delegate ]; } @@ -883,7 +1021,7 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromP * @param duration The duration of the animation. * @return The queued animation operation. **/ -+(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromPlotRange:(CPTPlotRange *)from toPlotRange:(CPTPlotRange *)to duration:(CGFloat)duration ++(nonnull CPTAnimationOperation *)animate:(nonnull id)object property:(nonnull NSString *)property fromPlotRange:(nonnull CPTPlotRange *)from toPlotRange:(nonnull CPTPlotRange *)to duration:(CGFloat)duration { CPTAnimationPeriod *period = [CPTAnimationPeriod periodWithStartPlotRange:from endPlotRange:to @@ -891,10 +1029,10 @@ +(CPTAnimationOperation *)animate:(id)object property:(NSString *)property fromP withDelay:CPTFloat(0.0)]; return [self animate:object - property:property - period:period - animationCurve:CPTAnimationCurveDefault - delegate:nil]; + property:property + period:period + animationCurve:CPTAnimationCurveDefault + delegate:nil]; } @end diff --git a/framework/Source/CPTAnnotation.h b/framework/Source/CPTAnnotation.h index 8dcf1b377..cda5d79bc 100644 --- a/framework/Source/CPTAnnotation.h +++ b/framework/Source/CPTAnnotation.h @@ -1,16 +1,35 @@ #import "CPTDefinitions.h" +/// @file + +@class CPTAnnotation; @class CPTAnnotationHostLayer; @class CPTLayer; -@interface CPTAnnotation : NSObject +/** + * @brief An array of annotations. + **/ +typedef NSArray<__kindof CPTAnnotation *> CPTAnnotationArray; + +/** + * @brief A mutable array of annotations. + **/ +typedef NSMutableArray<__kindof CPTAnnotation *> CPTMutableAnnotationArray; + +@interface CPTAnnotation : NSObject -@property (nonatomic, readwrite, strong) CPTLayer *contentLayer; -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTAnnotationHostLayer *annotationHostLayer; +@property (nonatomic, readwrite, strong, nullable) CPTLayer *contentLayer; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTAnnotationHostLayer *annotationHostLayer; @property (nonatomic, readwrite, assign) CGPoint contentAnchorPoint; @property (nonatomic, readwrite, assign) CGPoint displacement; @property (nonatomic, readwrite, assign) CGFloat rotation; +/// @name Initialization +/// @{ +-(nonnull instancetype)init NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; +/// @} + @end #pragma mark - diff --git a/framework/Source/CPTAnnotation.m b/framework/Source/CPTAnnotation.m index 1662d9780..18483ec57 100644 --- a/framework/Source/CPTAnnotation.m +++ b/framework/Source/CPTAnnotation.m @@ -11,12 +11,12 @@ **/ @implementation CPTAnnotation -/** @property CPTLayer *contentLayer +/** @property nullable CPTLayer *contentLayer * @brief The annotation content. **/ @synthesize contentLayer; -/** @property cpt_weak CPTAnnotationHostLayer *annotationHostLayer +/** @property nullable CPTAnnotationHostLayer *annotationHostLayer * @brief The host layer for the annotation content. **/ @synthesize annotationHostLayer; @@ -53,9 +53,9 @@ @implementation CPTAnnotation * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { annotationHostLayer = nil; contentLayer = nil; displacement = CGPointZero; @@ -72,7 +72,7 @@ -(instancetype)init /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeConditionalObject:self.annotationHostLayer forKey:@"CPTAnnotation.annotationHostLayer"]; [coder encodeObject:self.contentLayer forKey:@"CPTAnnotation.contentLayer"]; @@ -81,28 +81,42 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeCGFloat:self.rotation forKey:@"CPTAnnotation.rotation"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - annotationHostLayer = [coder decodeObjectForKey:@"CPTAnnotation.annotationHostLayer"]; - contentLayer = [coder decodeObjectForKey:@"CPTAnnotation.contentLayer"]; - contentAnchorPoint = [coder decodeCPTPointForKey:@"CPTAnnotation.contentAnchorPoint"]; - displacement = [coder decodeCPTPointForKey:@"CPTAnnotation.displacement"]; - rotation = [coder decodeCGFloatForKey:@"CPTAnnotation.rotation"]; + if ((self = [super init])) { + annotationHostLayer = [coder decodeObjectOfClass:[CPTAnnotationHostLayer class] + forKey:@"CPTAnnotation.annotationHostLayer"]; + contentLayer = [coder decodeObjectOfClass:[CPTLayer class] + forKey:@"CPTAnnotation.contentLayer"]; + contentAnchorPoint = [coder decodeCPTPointForKey:@"CPTAnnotation.contentAnchorPoint"]; + displacement = [coder decodeCPTPointForKey:@"CPTAnnotation.displacement"]; + rotation = [coder decodeCGFloatForKey:@"CPTAnnotation.rotation"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Description /// @cond --(NSString *)description +-(nullable NSString *)description { - return [NSString stringWithFormat:@"<%@ {%@}>", [super description], self.contentLayer]; + return [NSString stringWithFormat:@"<%@ {%@}>", super.description, self.contentLayer]; } /// @endcond @@ -112,19 +126,21 @@ -(NSString *)description /// @cond --(void)setContentLayer:(CPTLayer *)newLayer +-(void)setContentLayer:(nullable CPTLayer *)newLayer { if ( newLayer != contentLayer ) { [contentLayer removeFromSuperlayer]; contentLayer = newLayer; if ( newLayer ) { + CPTLayer *layer = newLayer; + CPTAnnotationHostLayer *hostLayer = self.annotationHostLayer; - [hostLayer addSublayer:newLayer]; + [hostLayer addSublayer:layer]; } } } --(void)setAnnotationHostLayer:(CPTAnnotationHostLayer *)newLayer +-(void)setAnnotationHostLayer:(nullable CPTAnnotationHostLayer *)newLayer { if ( newLayer != annotationHostLayer ) { CPTLayer *myContent = self.contentLayer; @@ -139,17 +155,17 @@ -(void)setAnnotationHostLayer:(CPTAnnotationHostLayer *)newLayer -(void)setDisplacement:(CGPoint)newDisplacement { - if ( !CGPointEqualToPoint(newDisplacement, displacement) ) { + if ( !CGPointEqualToPoint(newDisplacement, displacement)) { displacement = newDisplacement; - [[self.contentLayer superlayer] setNeedsLayout]; + [self.contentLayer.superlayer setNeedsLayout]; } } -(void)setContentAnchorPoint:(CGPoint)newAnchorPoint { - if ( !CGPointEqualToPoint(newAnchorPoint, contentAnchorPoint) ) { + if ( !CGPointEqualToPoint(newAnchorPoint, contentAnchorPoint)) { contentAnchorPoint = newAnchorPoint; - [[self.contentLayer superlayer] setNeedsLayout]; + [self.contentLayer.superlayer setNeedsLayout]; } } @@ -157,7 +173,7 @@ -(void)setRotation:(CGFloat)newRotation { if ( newRotation != rotation ) { rotation = newRotation; - [[self.contentLayer superlayer] setNeedsLayout]; + [self.contentLayer.superlayer setNeedsLayout]; } } diff --git a/framework/Source/CPTAnnotationHostLayer.h b/framework/Source/CPTAnnotationHostLayer.h index 171e93b23..a8217fa32 100644 --- a/framework/Source/CPTAnnotationHostLayer.h +++ b/framework/Source/CPTAnnotationHostLayer.h @@ -1,15 +1,14 @@ +#import "CPTAnnotation.h" #import "CPTLayer.h" -@class CPTAnnotation; - @interface CPTAnnotationHostLayer : CPTLayer -@property (nonatomic, readonly) NSArray *annotations; +@property (nonatomic, readonly, nonnull) CPTAnnotationArray *annotations; /// @name Annotations /// @{ --(void)addAnnotation:(CPTAnnotation *)annotation; --(void)removeAnnotation:(CPTAnnotation *)annotation; +-(void)addAnnotation:(nullable CPTAnnotation *)annotation; +-(void)removeAnnotation:(nullable CPTAnnotation *)annotation; -(void)removeAllAnnotations; /// @} diff --git a/framework/Source/CPTAnnotationHostLayer.m b/framework/Source/CPTAnnotationHostLayer.m index 03ef6063d..6fa9af69b 100644 --- a/framework/Source/CPTAnnotationHostLayer.m +++ b/framework/Source/CPTAnnotationHostLayer.m @@ -1,12 +1,11 @@ #import "CPTAnnotationHostLayer.h" -#import "CPTAnnotation.h" #import "CPTExceptions.h" /// @cond @interface CPTAnnotationHostLayer() -@property (nonatomic, readwrite, strong) NSMutableArray *mutableAnnotations; +@property (nonatomic, readwrite, strong, nonnull) CPTMutableAnnotationArray *mutableAnnotations; @end @@ -21,7 +20,7 @@ @interface CPTAnnotationHostLayer() **/ @implementation CPTAnnotationHostLayer -/** @property NSArray *annotations +/** @property nonnull CPTAnnotationArray *annotations * @brief An array of annotations attached to this layer. **/ @dynamic annotations; @@ -42,9 +41,9 @@ @implementation CPTAnnotationHostLayer * @param newFrame The frame rectangle. * @return The initialized CPTAnnotationHostLayer object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { mutableAnnotations = [[NSMutableArray alloc] init]; } return self; @@ -54,9 +53,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTAnnotationHostLayer *theLayer = (CPTAnnotationHostLayer *)layer; mutableAnnotations = theLayer->mutableAnnotations; @@ -71,17 +70,18 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; [coder encodeObject:self.mutableAnnotations forKey:@"CPTAnnotationHostLayer.mutableAnnotations"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - NSArray *annotations = [coder decodeObjectForKey:@"CPTAnnotationHostLayer.mutableAnnotations"]; + if ((self = [super initWithCoder:coder])) { + CPTAnnotationArray *annotations = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTAnnotation class]]] + forKey:@"CPTAnnotationHostLayer.mutableAnnotations"]; if ( annotations ) { mutableAnnotations = [annotations mutableCopy]; } @@ -94,41 +94,63 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Annotations --(NSArray *)annotations +/// @cond + +-(nonnull CPTAnnotationArray *)annotations { return [self.mutableAnnotations copy]; } +/// @endcond + /** * @brief Adds an annotation to the receiver. **/ --(void)addAnnotation:(CPTAnnotation *)annotation +-(void)addAnnotation:(nullable CPTAnnotation *)annotation { if ( annotation ) { - NSMutableArray *annotationArray = self.mutableAnnotations; - if ( ![annotationArray containsObject:annotation] ) { - [annotationArray addObject:annotation]; + CPTAnnotation *theAnnotation = annotation; + + CPTMutableAnnotationArray *annotationArray = self.mutableAnnotations; + if ( ![annotationArray containsObject:theAnnotation] ) { + [annotationArray addObject:theAnnotation]; } - annotation.annotationHostLayer = self; - [annotation positionContentLayer]; + theAnnotation.annotationHostLayer = self; + [theAnnotation positionContentLayer]; } } /** * @brief Removes an annotation from the receiver. **/ --(void)removeAnnotation:(CPTAnnotation *)annotation +-(void)removeAnnotation:(nullable CPTAnnotation *)annotation { - if ( [self.mutableAnnotations containsObject:annotation] ) { - annotation.annotationHostLayer = nil; - [self.mutableAnnotations removeObject:annotation]; - } - else { - CPTAnnotationHostLayer *hostLayer = annotation.annotationHostLayer; - [NSException raise:CPTException format:@"Tried to remove CPTAnnotation from %@. Host layer was %@.", self, hostLayer]; + if ( annotation ) { + CPTAnnotation *theAnnotation = annotation; + + if ( [self.mutableAnnotations containsObject:theAnnotation] ) { + theAnnotation.annotationHostLayer = nil; + [self.mutableAnnotations removeObject:theAnnotation]; + } + else { + CPTAnnotationHostLayer *hostLayer = theAnnotation.annotationHostLayer; + [NSException raise:CPTException format:@"Tried to remove CPTAnnotation from %@. Host layer was %@.", self, hostLayer]; + } } } @@ -137,7 +159,7 @@ -(void)removeAnnotation:(CPTAnnotation *)annotation **/ -(void)removeAllAnnotations { - NSMutableArray *allAnnotations = self.mutableAnnotations; + CPTMutableAnnotationArray *allAnnotations = self.mutableAnnotations; for ( CPTAnnotation *annotation in allAnnotations ) { annotation.annotationHostLayer = nil; @@ -150,12 +172,12 @@ -(void)removeAllAnnotations /// @cond --(NSSet *)sublayersExcludedFromAutomaticLayout +-(nullable CPTSublayerSet *)sublayersExcludedFromAutomaticLayout { - NSMutableArray *annotations = self.mutableAnnotations; + CPTMutableAnnotationArray *annotations = self.mutableAnnotations; if ( annotations.count > 0 ) { - NSMutableSet *excludedSublayers = [[super sublayersExcludedFromAutomaticLayout] mutableCopy]; + CPTMutableSublayerSet *excludedSublayers = [super.sublayersExcludedFromAutomaticLayout mutableCopy]; if ( !excludedSublayers ) { excludedSublayers = [NSMutableSet set]; @@ -171,7 +193,7 @@ -(NSSet *)sublayersExcludedFromAutomaticLayout return excludedSublayers; } else { - return [super sublayersExcludedFromAutomaticLayout]; + return super.sublayersExcludedFromAutomaticLayout; } } @@ -203,12 +225,12 @@ -(void)layoutSublayers * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { for ( CPTAnnotation *annotation in self.annotations ) { CPTLayer *content = annotation.contentLayer; if ( content ) { - if ( CGRectContainsPoint(content.frame, interactionPoint) ) { + if ( CGRectContainsPoint(content.frame, interactionPoint)) { BOOL handled = [content pointingDeviceDownEvent:event atPoint:interactionPoint]; if ( handled ) { return YES; @@ -234,12 +256,12 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { for ( CPTAnnotation *annotation in self.annotations ) { CPTLayer *content = annotation.contentLayer; if ( content ) { - if ( CGRectContainsPoint(content.frame, interactionPoint) ) { + if ( CGRectContainsPoint(content.frame, interactionPoint)) { BOOL handled = [content pointingDeviceUpEvent:event atPoint:interactionPoint]; if ( handled ) { return YES; @@ -265,12 +287,12 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDraggedEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { for ( CPTAnnotation *annotation in self.annotations ) { CPTLayer *content = annotation.contentLayer; if ( content ) { - if ( CGRectContainsPoint(content.frame, interactionPoint) ) { + if ( CGRectContainsPoint(content.frame, interactionPoint)) { BOOL handled = [content pointingDeviceDraggedEvent:event atPoint:interactionPoint]; if ( handled ) { return YES; @@ -296,7 +318,7 @@ -(BOOL)pointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)inter * @param event The OS event. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceCancelledEvent:(CPTNativeEvent *)event +-(BOOL)pointingDeviceCancelledEvent:(nonnull CPTNativeEvent *)event { for ( CPTAnnotation *annotation in self.annotations ) { CPTLayer *content = annotation.contentLayer; diff --git a/framework/Source/CPTAxis.h b/framework/Source/CPTAxis.h index 5babf3ef7..65bec6a8a 100644 --- a/framework/Source/CPTAxis.h +++ b/framework/Source/CPTAxis.h @@ -1,19 +1,20 @@ +#import "CPTAxisLabel.h" #import "CPTDefinitions.h" +#import "CPTFill.h" #import "CPTLayer.h" +#import "CPTLimitBand.h" +#import "CPTPlotRange.h" #import "CPTTextStyle.h" /// @file @class CPTAxis; -@class CPTAxisLabel; @class CPTAxisSet; @class CPTAxisTitle; @class CPTGridLines; -@class CPTLimitBand; @class CPTLineCap; @class CPTLineStyle; @class CPTPlotSpace; -@class CPTPlotRange; @class CPTPlotArea; @class CPTShadow; @@ -28,12 +29,22 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { CPTAxisLabelingPolicyEqualDivisions ///< Divide the plot range into equal parts. }; +/** + * @brief An array of axes. + **/ +typedef NSArray<__kindof CPTAxis *> CPTAxisArray; + +/** + * @brief A mutable array of axes. + **/ +typedef NSMutableArray<__kindof CPTAxis *> CPTMutableAxisArray; + #pragma mark - /** * @brief Axis labeling delegate. **/ -@protocol CPTAxisDelegate +@protocol CPTAxisDelegate @optional @@ -44,13 +55,13 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param axis The axis. * @return @YES if the axis should relabel now. **/ --(BOOL)axisShouldRelabel:(CPTAxis *)axis; +-(BOOL)axisShouldRelabel:(nonnull CPTAxis *)axis; /** @brief @optional The method is called after the axis is relabeled to allow the delegate to perform any * necessary cleanup or further labeling actions. * @param axis The axis. **/ --(void)axisDidRelabel:(CPTAxis *)axis; +-(void)axisDidRelabel:(nonnull CPTAxis *)axis; /** @brief @optional This method gives the delegate a chance to create custom labels for each tick. * It can be used with any labeling policy. Returning @NO will cause the axis not @@ -59,7 +70,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param locations The locations of the major ticks. * @return @YES if the axis class should proceed with automatic labeling. **/ --(BOOL)axis:(CPTAxis *)axis shouldUpdateAxisLabelsAtLocations:(NSSet *)locations; +-(BOOL)axis:(nonnull CPTAxis *)axis shouldUpdateAxisLabelsAtLocations:(nonnull CPTNumberSet *)locations; /** @brief @optional This method gives the delegate a chance to create custom labels for each minor tick. * It can be used with any labeling policy. Returning @NO will cause the axis not @@ -68,7 +79,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param locations The locations of the minor ticks. * @return @YES if the axis class should proceed with automatic labeling. **/ --(BOOL)axis:(CPTAxis *)axis shouldUpdateMinorAxisLabelsAtLocations:(NSSet *)locations; +-(BOOL)axis:(nonnull CPTAxis *)axis shouldUpdateMinorAxisLabelsAtLocations:(nonnull CPTNumberSet *)locations; /// @} @@ -81,7 +92,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param axis The axis. * @param label The selected axis label. **/ --(void)axis:(CPTAxis *)axis labelWasSelected:(CPTAxisLabel *)label; +-(void)axis:(nonnull CPTAxis *)axis labelWasSelected:(nonnull CPTAxisLabel *)label; /** @brief @optional Informs the delegate that an axis label * @if MacOnly was both pressed and released. @endif @@ -90,7 +101,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param label The selected axis label. * @param event The event that triggered the selection. **/ --(void)axis:(CPTAxis *)axis labelWasSelected:(CPTAxisLabel *)label withEvent:(CPTNativeEvent *)event; +-(void)axis:(nonnull CPTAxis *)axis labelWasSelected:(nonnull CPTAxisLabel *)label withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a minor tick axis label * @if MacOnly was both pressed and released. @endif @@ -98,7 +109,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param axis The axis. * @param label The selected minor tick axis label. **/ --(void)axis:(CPTAxis *)axis minorTickLabelWasSelected:(CPTAxisLabel *)label; +-(void)axis:(nonnull CPTAxis *)axis minorTickLabelWasSelected:(nonnull CPTAxisLabel *)label; /** @brief @optional Informs the delegate that a minor tick axis label * @if MacOnly was both pressed and released. @endif @@ -107,7 +118,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param label The selected minor tick axis label. * @param event The event that triggered the selection. **/ --(void)axis:(CPTAxis *)axis minorTickLabelWasSelected:(CPTAxisLabel *)label withEvent:(CPTNativeEvent *)event; +-(void)axis:(nonnull CPTAxis *)axis minorTickLabelWasSelected:(nonnull CPTAxisLabel *)label withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that an axis label * @if MacOnly was pressed. @endif @@ -115,7 +126,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param axis The axis. * @param label The selected axis label. **/ --(void)axis:(CPTAxis *)axis labelTouchDown:(CPTAxisLabel *)label; +-(void)axis:(nonnull CPTAxis *)axis labelTouchDown:(nonnull CPTAxisLabel *)label; /** @brief @optional Informs the delegate that an axis label * @if MacOnly was pressed. @endif @@ -124,7 +135,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param label The selected axis label. * @param event The event that triggered the selection. **/ --(void)axis:(CPTAxis *)axis labelTouchDown:(CPTAxisLabel *)label withEvent:(CPTNativeEvent *)event; +-(void)axis:(nonnull CPTAxis *)axis labelTouchDown:(nonnull CPTAxisLabel *)label withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that an axis label * @if MacOnly was released. @endif @@ -132,7 +143,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param axis The axis. * @param label The selected axis label. **/ --(void)axis:(CPTAxis *)axis labelTouchUp:(CPTAxisLabel *)label; +-(void)axis:(nonnull CPTAxis *)axis labelTouchUp:(nonnull CPTAxisLabel *)label; /** @brief @optional Informs the delegate that an axis label * @if MacOnly was released. @endif @@ -141,7 +152,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param label The selected axis label. * @param event The event that triggered the selection. **/ --(void)axis:(CPTAxis *)axis labelTouchUp:(CPTAxisLabel *)label withEvent:(CPTNativeEvent *)event; +-(void)axis:(nonnull CPTAxis *)axis labelTouchUp:(nonnull CPTAxisLabel *)label withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a minor tick axis label * @if MacOnly was pressed. @endif @@ -149,7 +160,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param axis The axis. * @param label The selected minor tick axis label. **/ --(void)axis:(CPTAxis *)axis minorTickTouchDown:(CPTAxisLabel *)label; +-(void)axis:(nonnull CPTAxis *)axis minorTickTouchDown:(nonnull CPTAxisLabel *)label; /** @brief @optional Informs the delegate that a minor tick axis label * @if MacOnly was pressed. @endif @@ -158,7 +169,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param label The selected minor tick axis label. * @param event The event that triggered the selection. **/ --(void)axis:(CPTAxis *)axis minorTickTouchDown:(CPTAxisLabel *)label withEvent:(CPTNativeEvent *)event; +-(void)axis:(nonnull CPTAxis *)axis minorTickTouchDown:(nonnull CPTAxisLabel *)label withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a minor tick axis label * @if MacOnly was released. @endif @@ -166,7 +177,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param axis The axis. * @param label The selected minor tick axis label. **/ --(void)axis:(CPTAxis *)axis minorTickTouchUp:(CPTAxisLabel *)label; +-(void)axis:(nonnull CPTAxis *)axis minorTickTouchUp:(nonnull CPTAxisLabel *)label; /** @brief @optional Informs the delegate that a minor tick axis label * @if MacOnly was released. @endif @@ -175,7 +186,7 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { * @param label The selected minor tick axis label. * @param event The event that triggered the selection. **/ --(void)axis:(CPTAxis *)axis minorTickTouchUp:(CPTAxisLabel *)label withEvent:(CPTNativeEvent *)event; +-(void)axis:(nonnull CPTAxis *)axis minorTickTouchUp:(nonnull CPTAxisLabel *)label withEvent:(nonnull CPTNativeEvent *)event; /// @} @@ -187,27 +198,27 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { /// @name Axis /// @{ -@property (nonatomic, readwrite, copy) CPTLineStyle *axisLineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *axisLineStyle; @property (nonatomic, readwrite, assign) CPTCoordinate coordinate; -@property (nonatomic, readwrite, assign) NSDecimal labelingOrigin; +@property (nonatomic, readwrite, strong, nonnull) NSNumber *labelingOrigin; @property (nonatomic, readwrite, assign) CPTSign tickDirection; -@property (nonatomic, readwrite, copy) CPTPlotRange *visibleRange; -@property (nonatomic, readwrite, copy) CPTPlotRange *visibleAxisRange; -@property (nonatomic, readwrite, copy) CPTLineCap *axisLineCapMin; -@property (nonatomic, readwrite, copy) CPTLineCap *axisLineCapMax; +@property (nonatomic, readwrite, copy, nullable) CPTPlotRange *visibleRange; +@property (nonatomic, readwrite, copy, nullable) CPTPlotRange *visibleAxisRange; +@property (nonatomic, readwrite, copy, nullable) CPTLineCap *axisLineCapMin; +@property (nonatomic, readwrite, copy, nullable) CPTLineCap *axisLineCapMax; /// @} /// @name Title /// @{ -@property (nonatomic, readwrite, copy) CPTTextStyle *titleTextStyle; -@property (nonatomic, readwrite, strong) CPTAxisTitle *axisTitle; +@property (nonatomic, readwrite, copy, nullable) CPTTextStyle *titleTextStyle; +@property (nonatomic, readwrite, strong, nullable) CPTAxisTitle *axisTitle; @property (nonatomic, readwrite, assign) CGFloat titleOffset; -@property (nonatomic, readwrite, copy) NSString *title; -@property (nonatomic, readwrite, copy) NSAttributedString *attributedTitle; +@property (nonatomic, readwrite, copy, nullable) NSString *title; +@property (nonatomic, readwrite, copy, nullable) NSAttributedString *attributedTitle; @property (nonatomic, readwrite, assign) CGFloat titleRotation; @property (nonatomic, readwrite, assign) CPTSign titleDirection; -@property (nonatomic, readwrite, assign) NSDecimal titleLocation; -@property (nonatomic, readonly) NSDecimal defaultTitleLocation; +@property (nonatomic, readwrite, strong, nullable) NSNumber *titleLocation; +@property (nonatomic, readonly, nonnull) NSNumber *defaultTitleLocation; /// @} /// @name Labels @@ -219,26 +230,26 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { @property (nonatomic, readwrite, assign) CGFloat minorTickLabelRotation; @property (nonatomic, readwrite, assign) CPTAlignment labelAlignment; @property (nonatomic, readwrite, assign) CPTAlignment minorTickLabelAlignment; -@property (nonatomic, readwrite, copy) CPTTextStyle *labelTextStyle; -@property (nonatomic, readwrite, copy) CPTTextStyle *minorTickLabelTextStyle; +@property (nonatomic, readwrite, copy, nullable) CPTTextStyle *labelTextStyle; +@property (nonatomic, readwrite, copy, nullable) CPTTextStyle *minorTickLabelTextStyle; @property (nonatomic, readwrite, assign) CPTSign tickLabelDirection; @property (nonatomic, readwrite, assign) CPTSign minorTickLabelDirection; -@property (nonatomic, readwrite, strong) NSFormatter *labelFormatter; -@property (nonatomic, readwrite, strong) NSFormatter *minorTickLabelFormatter; -@property (nonatomic, readwrite, strong) NSSet *axisLabels; -@property (nonatomic, readwrite, strong) NSSet *minorTickAxisLabels; +@property (nonatomic, readwrite, strong, nullable) NSFormatter *labelFormatter; +@property (nonatomic, readwrite, strong, nullable) NSFormatter *minorTickLabelFormatter; +@property (nonatomic, readwrite, strong, nullable) CPTAxisLabelSet *axisLabels; +@property (nonatomic, readwrite, strong, nullable) CPTAxisLabelSet *minorTickAxisLabels; @property (nonatomic, readonly) BOOL needsRelabel; -@property (nonatomic, readwrite, strong) NSArray *labelExclusionRanges; -@property (nonatomic, readwrite, strong) CPTShadow *labelShadow; -@property (nonatomic, readwrite, strong) CPTShadow *minorTickLabelShadow; +@property (nonatomic, readwrite, strong, nullable) CPTPlotRangeArray *labelExclusionRanges; +@property (nonatomic, readwrite, strong, nullable) CPTShadow *labelShadow; +@property (nonatomic, readwrite, strong, nullable) CPTShadow *minorTickLabelShadow; /// @} /// @name Major Ticks /// @{ -@property (nonatomic, readwrite, assign) NSDecimal majorIntervalLength; +@property (nonatomic, readwrite, strong, nullable) NSNumber *majorIntervalLength; @property (nonatomic, readwrite, assign) CGFloat majorTickLength; -@property (nonatomic, readwrite, copy) CPTLineStyle *majorTickLineStyle; -@property (nonatomic, readwrite, strong) NSSet *majorTickLocations; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *majorTickLineStyle; +@property (nonatomic, readwrite, strong, nullable) CPTNumberSet *majorTickLocations; @property (nonatomic, readwrite, assign) NSUInteger preferredNumberOfMajorTicks; /// @} @@ -246,35 +257,36 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { /// @{ @property (nonatomic, readwrite, assign) NSUInteger minorTicksPerInterval; @property (nonatomic, readwrite, assign) CGFloat minorTickLength; -@property (nonatomic, readwrite, copy) CPTLineStyle *minorTickLineStyle; -@property (nonatomic, readwrite, strong) NSSet *minorTickLocations; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *minorTickLineStyle; +@property (nonatomic, readwrite, strong, nullable) CPTNumberSet *minorTickLocations; /// @} /// @name Grid Lines /// @{ -@property (nonatomic, readwrite, copy) CPTLineStyle *majorGridLineStyle; -@property (nonatomic, readwrite, copy) CPTLineStyle *minorGridLineStyle; -@property (nonatomic, readwrite, copy) CPTPlotRange *gridLinesRange; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *majorGridLineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *minorGridLineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTPlotRange *gridLinesRange; /// @} /// @name Background Bands /// @{ -@property (nonatomic, readwrite, copy) NSArray *alternatingBandFills; -@property (nonatomic, readonly) NSArray *backgroundLimitBands; +@property (nonatomic, readwrite, copy, nullable) CPTFillArray *alternatingBandFills; +@property (nonatomic, readwrite, strong, nullable) NSNumber *alternatingBandAnchor; +@property (nonatomic, readonly, nullable) CPTLimitBandArray *backgroundLimitBands; /// @} /// @name Plot Space /// @{ -@property (nonatomic, readwrite, strong) CPTPlotSpace *plotSpace; +@property (nonatomic, readwrite, strong, nullable) CPTPlotSpace *plotSpace; /// @} /// @name Layers /// @{ @property (nonatomic, readwrite, assign) BOOL separateLayers; -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTPlotArea *plotArea; -@property (nonatomic, readonly) cpt_weak CPTGridLines *minorGridLines; -@property (nonatomic, readonly) cpt_weak CPTGridLines *majorGridLines; -@property (nonatomic, readonly) CPTAxisSet *axisSet; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTPlotArea *plotArea; +@property (nonatomic, readonly, cpt_weak_property, nullable) CPTGridLines *minorGridLines; +@property (nonatomic, readonly, cpt_weak_property, nullable) CPTGridLines *majorGridLines; +@property (nonatomic, readonly, nullable) CPTAxisSet *axisSet; /// @} /// @name Title @@ -292,14 +304,14 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { /// @name Ticks /// @{ --(NSSet *)filteredMajorTickLocations:(NSSet *)allLocations; --(NSSet *)filteredMinorTickLocations:(NSSet *)allLocations; +-(nullable CPTNumberSet *)filteredMajorTickLocations:(nullable CPTNumberSet *)allLocations; +-(nullable CPTNumberSet *)filteredMinorTickLocations:(nullable CPTNumberSet *)allLocations; /// @} /// @name Background Bands /// @{ --(void)addBackgroundLimitBand:(CPTLimitBand *)limitBand; --(void)removeBackgroundLimitBand:(CPTLimitBand *)limitBand; +-(void)addBackgroundLimitBand:(nullable CPTLimitBand *)limitBand; +-(void)removeBackgroundLimitBand:(nullable CPTLimitBand *)limitBand; -(void)removeAllBackgroundLimitBands; /// @} @@ -314,18 +326,18 @@ typedef NS_ENUM (NSInteger, CPTAxisLabelingPolicy) { /// @name Coordinate Space Conversions /// @{ --(CGPoint)viewPointForCoordinateDecimalNumber:(NSDecimal)coordinateDecimalNumber; +-(CGPoint)viewPointForCoordinateValue:(nullable NSNumber *)coordinateValue; /// @} /// @name Grid Lines /// @{ --(void)drawGridLinesInContext:(CGContextRef)context isMajor:(BOOL)major; +-(void)drawGridLinesInContext:(nonnull CGContextRef)context isMajor:(BOOL)major; /// @} /// @name Background Bands /// @{ --(void)drawBackgroundBandsInContext:(CGContextRef)context; --(void)drawBackgroundLimitsInContext:(CGContextRef)context; +-(void)drawBackgroundBandsInContext:(nonnull CGContextRef)context; +-(void)drawBackgroundLimitsInContext:(nonnull CGContextRef)context; /// @} @end diff --git a/framework/Source/CPTAxis.m b/framework/Source/CPTAxis.m index d863af232..102318084 100644 --- a/framework/Source/CPTAxis.m +++ b/framework/Source/CPTAxis.m @@ -1,17 +1,14 @@ #import "CPTAxis.h" -#import "CPTAxisLabel.h" #import "CPTAxisLabelGroup.h" #import "CPTAxisSet.h" #import "CPTAxisTitle.h" #import "CPTColor.h" #import "CPTExceptions.h" -#import "CPTFill.h" #import "CPTGradient.h" #import "CPTGridLineGroup.h" #import "CPTGridLines.h" #import "CPTImage.h" -#import "CPTLimitBand.h" #import "CPTLineCap.h" #import "CPTLineStyle.h" #import "CPTMutablePlotRange.h" @@ -25,7 +22,7 @@ /** @defgroup axisAnimation Axes * @brief Axis properties that can be animated using Core Animation. * @if MacOnly - * @since Custom layer property animation is supported on MacOS 10.6 and later. + * @since Custom layer property animation is supported on macOS 10.6 and later. * @endif * @ingroup animation **/ @@ -35,22 +32,22 @@ @interface CPTAxis() @property (nonatomic, readwrite, assign) BOOL needsRelabel; -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTGridLines *minorGridLines; -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTGridLines *majorGridLines; -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTAxisLabel *pointingDeviceDownLabel; -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTAxisLabel *pointingDeviceDownTickLabel; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGridLines *minorGridLines; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGridLines *majorGridLines; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTAxisLabel *pointingDeviceDownLabel; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTAxisLabel *pointingDeviceDownTickLabel; @property (nonatomic, readwrite, assign) BOOL labelFormatterChanged; @property (nonatomic, readwrite, assign) BOOL minorLabelFormatterChanged; -@property (nonatomic, readwrite, strong) NSMutableArray *mutableBackgroundLimitBands; +@property (nonatomic, readwrite, strong, nullable) CPTMutableLimitBandArray *mutableBackgroundLimitBands; @property (nonatomic, readonly) CGFloat tickOffset; @property (nonatomic, readwrite, assign) BOOL inTitleUpdate; @property (nonatomic, readwrite, assign) BOOL labelsUpdated; --(void)generateFixedIntervalMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocations minorTickLocations:(NSSet *__autoreleasing *)newMinorLocations; --(void)autoGenerateMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocations minorTickLocations:(NSSet *__autoreleasing *)newMinorLocations; --(void)generateEqualMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocations minorTickLocations:(NSSet *__autoreleasing *)newMinorLocations; --(NSSet *)filteredTickLocations:(NSSet *)allLocations; --(void)updateAxisLabelsAtLocations:(NSSet *)locations inRange:(CPTPlotRange *)labeledRange useMajorAxisLabels:(BOOL)useMajorAxisLabels; +-(void)generateFixedIntervalMajorTickLocations:(CPTNumberSet *__nonnull __autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet *__nonnull __autoreleasing *)newMinorLocations; +-(void)autoGenerateMajorTickLocations:(CPTNumberSet *__nonnull __autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet *__nonnull __autoreleasing *)newMinorLocations; +-(void)generateEqualMajorTickLocations:(CPTNumberSet *__nonnull __autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet *__nonnull __autoreleasing *)newMinorLocations; +-(nullable CPTNumberSet *)filteredTickLocations:(nullable CPTNumberSet *)allLocations; +-(void)updateAxisLabelsAtLocations:(nullable CPTNumberSet *)locations inRange:(nullable CPTPlotRange *)labeledRange useMajorAxisLabels:(BOOL)useMajorAxisLabels; -(void)updateCustomTickLabels; -(void)updateMajorTickLabelOffsets; -(void)updateMinorTickLabelOffsets; @@ -76,7 +73,7 @@ @implementation CPTAxis // Axis -/** @property CPTLineStyle *axisLineStyle +/** @property nullable CPTLineStyle *axisLineStyle * @brief The line style for the axis line. * If @nil, the line is not drawn. **/ @@ -87,9 +84,9 @@ @implementation CPTAxis **/ @synthesize coordinate; -/** @property NSDecimal labelingOrigin +/** @property nonnull NSNumber *labelingOrigin * @brief The origin used for axis labels. - * The default value is 0. It is only used when the axis labeling + * The default value is @num{0}. It is only used when the axis labeling * policy is #CPTAxisLabelingPolicyFixedInterval. The origin is * a reference point used to being labeling. Labels are added * at the origin, as well as at fixed intervals above and below @@ -104,7 +101,7 @@ @implementation CPTAxis **/ @synthesize tickDirection; -/** @property CPTPlotRange *visibleRange +/** @property nullable CPTPlotRange *visibleRange * @brief The plot range over which the axis and ticks are visible. * Use this to restrict an axis and its grid lines to less than the full plot area width. * Use the @ref visibleAxisRange to specify a separate range for the axis line, if needed. @@ -112,7 +109,7 @@ @implementation CPTAxis **/ @synthesize visibleRange; -/** @property CPTPlotRange *visibleAxisRange; +/** @property nullable CPTPlotRange *visibleAxisRange; * @brief The plot range over which the axis itself is visible. * Use this to restrict an axis line to less than the full plot area width. This range is independent * of the @ref visibleRange and overrides it for the axis line and line cap. @@ -120,13 +117,13 @@ @implementation CPTAxis **/ @synthesize visibleAxisRange; -/** @property CPTLineCap *axisLineCapMin +/** @property nullable CPTLineCap *axisLineCapMin * @brief The line cap for the end of the axis line with the minimum value. * @see axisLineCapMax **/ @synthesize axisLineCapMin; -/** @property CPTLineCap *axisLineCapMax +/** @property nullable CPTLineCap *axisLineCapMax * @brief The line cap for the end of the axis line with the maximum value. * @see axisLineCapMin **/ @@ -134,14 +131,14 @@ @implementation CPTAxis // Title -/** @property CPTTextStyle *titleTextStyle +/** @property nullable CPTTextStyle *titleTextStyle * @brief The text style used to draw the axis title text. * * Assigning a new value to this property also sets the value of the @ref attributedTitle property to @nil. **/ @synthesize titleTextStyle; -/** @property CPTAxisTitle *axisTitle +/** @property nullable CPTAxisTitle *axisTitle * @brief The axis title. * If @nil, no title is drawn. **/ @@ -153,14 +150,14 @@ @implementation CPTAxis **/ @synthesize titleOffset; -/** @property NSString *title +/** @property nullable NSString *title * @brief A convenience property for setting the text title of the axis. * * Assigning a new value to this property also sets the value of the @ref attributedTitle property to @nil. **/ @synthesize title; -/** @property NSAttributedString *attributedTitle +/** @property nullable NSAttributedString *attributedTitle * @brief A convenience property for setting the styled text title of the axis. * * Assigning a new value to this property also sets the value of the @ref title property to the @@ -186,13 +183,13 @@ @implementation CPTAxis **/ @synthesize titleDirection; -/** @property NSDecimal titleLocation +/** @property nullable NSNumber *titleLocation * @brief The position along the axis where the axis title should be centered. * If @NAN (the default), the @ref defaultTitleLocation will be used. **/ @synthesize titleLocation; -/** @property NSDecimal defaultTitleLocation +/** @property nonnull NSNumber *defaultTitleLocation * @brief The position along the axis where the axis title should be centered * if @ref titleLocation is @NAN. **/ @@ -200,7 +197,7 @@ @implementation CPTAxis // Plot space -/** @property CPTPlotSpace *plotSpace +/** @property nullable CPTPlotSpace *plotSpace * @brief The plot space for the axis. **/ @synthesize plotSpace; @@ -248,12 +245,12 @@ @implementation CPTAxis **/ @synthesize minorTickLabelAlignment; -/** @property CPTTextStyle *labelTextStyle +/** @property nullable CPTTextStyle *labelTextStyle * @brief The text style used to draw the label text. **/ @synthesize labelTextStyle; -/** @property CPTTextStyle *minorTickLabelTextStyle +/** @property nullable CPTTextStyle *minorTickLabelTextStyle * @brief The text style used to draw the label text of minor tick labels. **/ @synthesize minorTickLabelTextStyle; @@ -276,7 +273,7 @@ @implementation CPTAxis **/ @synthesize minorTickLabelDirection; -/** @property NSFormatter *labelFormatter +/** @property nullable NSFormatter *labelFormatter * @brief The number formatter used to format the label text. * If you need a non-numerical label, such as a date, you can use a formatter than turns * the numerical plot coordinate into a string (e.g., @quote{Jan 10, 2010}). @@ -284,7 +281,7 @@ @implementation CPTAxis **/ @synthesize labelFormatter; -/** @property NSFormatter *minorTickLabelFormatter +/** @property nullable NSFormatter *minorTickLabelFormatter * @brief The number formatter used to format the label text of minor ticks. * If you need a non-numerical label, such as a date, you can use a formatter than turns * the numerical plot coordinate into a string (e.g., @quote{Jan 10, 2010}). @@ -296,12 +293,12 @@ @implementation CPTAxis @synthesize minorLabelFormatterChanged; @dynamic tickOffset; -/** @property NSSet *axisLabels +/** @property nullable CPTAxisLabelSet *axisLabels * @brief The set of axis labels. **/ @synthesize axisLabels; -/** @property NSSet *minorTickAxisLabels +/** @property nullable CPTAxisLabelSet *minorTickAxisLabels * @brief The set of minor tick axis labels. **/ @synthesize minorTickAxisLabels; @@ -311,29 +308,29 @@ @implementation CPTAxis **/ @synthesize needsRelabel; -/** @property NSArray *labelExclusionRanges +/** @property nullable CPTPlotRangeArray *labelExclusionRanges * @brief An array of CPTPlotRange objects. Any tick marks and labels falling inside any of the ranges in the array will not be drawn. **/ @synthesize labelExclusionRanges; -/** @property CPTShadow *labelShadow +/** @property nullable CPTShadow *labelShadow * @brief The shadow applied to each axis label. **/ @synthesize labelShadow; -/** @property CPTShadow *minorTickLabelShadow +/** @property nullable CPTShadow *minorTickLabelShadow * @brief The shadow applied to each minor tick axis label. **/ @synthesize minorTickLabelShadow; // Major ticks -/** @property NSDecimal majorIntervalLength +/** @property nullable NSNumber *majorIntervalLength * @brief The distance between major tick marks expressed in data coordinates. **/ @synthesize majorIntervalLength; -/** @property CPTLineStyle *majorTickLineStyle +/** @property nullable CPTLineStyle *majorTickLineStyle * @brief The line style for the major tick marks. * If @nil, the major ticks are not drawn. **/ @@ -344,7 +341,7 @@ @implementation CPTAxis **/ @synthesize majorTickLength; -/** @property NSSet *majorTickLocations +/** @property nullable CPTNumberSet *majorTickLocations * @brief A set of axis coordinates for all major tick marks. **/ @synthesize majorTickLocations; @@ -364,7 +361,7 @@ @implementation CPTAxis **/ @synthesize minorTicksPerInterval; -/** @property CPTLineStyle *minorTickLineStyle +/** @property nullable CPTLineStyle *minorTickLineStyle * @brief The line style for the minor tick marks. * If @nil, the minor ticks are not drawn. **/ @@ -375,26 +372,26 @@ @implementation CPTAxis **/ @synthesize minorTickLength; -/** @property NSSet *minorTickLocations +/** @property nullable CPTNumberSet *minorTickLocations * @brief A set of axis coordinates for all minor tick marks. **/ @synthesize minorTickLocations; // Grid Lines -/** @property CPTLineStyle *majorGridLineStyle +/** @property nullable CPTLineStyle *majorGridLineStyle * @brief The line style for the major grid lines. * If @nil, the major grid lines are not drawn. **/ @synthesize majorGridLineStyle; -/** @property CPTLineStyle *minorGridLineStyle +/** @property nullable CPTLineStyle *minorGridLineStyle * @brief The line style for the minor grid lines. * If @nil, the minor grid lines are not drawn. **/ @synthesize minorGridLineStyle; -/** @property CPTPlotRange *CPTPlotRange *gridLinesRange +/** @property nullable CPTPlotRange *CPTPlotRange *gridLinesRange * @brief The plot range over which the grid lines are visible. * Note that this range applies to the orthogonal coordinate, not * the axis coordinate itself. @@ -404,7 +401,7 @@ @implementation CPTAxis // Background Bands -/** @property NSArray *alternatingBandFills +/** @property nullable CPTFillArray *alternatingBandFills * @brief An array of two or more fills to be drawn between successive major tick marks. * * When initializing the fills, provide an NSArray containing any combination of CPTFill, @@ -413,7 +410,16 @@ @implementation CPTAxis **/ @synthesize alternatingBandFills; -/** @property NSArray *backgroundLimitBands +/** @property nullable NSNumber *alternatingBandAnchor + * @brief The starting location of the first band fill. + * + * If @nil (the default), the first fill is drawn between the bottom left corner of the plot area + * and the first major tick location inside the plot area. If the anchor falls between two + * major tick locations, the first band fill wiil be drawn between those locations. + **/ +@synthesize alternatingBandAnchor; + +/** @property nullable CPTLimitBandArray *backgroundLimitBands * @brief An array of CPTLimitBand objects. * * The limit bands are drawn on top of the alternating band fills. @@ -432,34 +438,34 @@ @implementation CPTAxis **/ @synthesize separateLayers; -/** @property cpt_weak CPTPlotArea *plotArea +/** @property nullable CPTPlotArea *plotArea * @brief The plot area that the axis belongs to. **/ @synthesize plotArea; -/** @property cpt_weak CPTGridLines *minorGridLines +/** @property nullable CPTGridLines *minorGridLines * @brief The layer that draws the minor grid lines. **/ @synthesize minorGridLines; -/** @property cpt_weak CPTGridLines *majorGridLines +/** @property nullable CPTGridLines *majorGridLines * @brief The layer that draws the major grid lines. **/ @synthesize majorGridLines; -/** @property CPTAxisSet *axisSet +/** @property nullable CPTAxisSet *axisSet * @brief The axis set that the axis belongs to. **/ @dynamic axisSet; /** @internal - * @property cpt_weak CPTAxisLabel *pointingDeviceDownLabel + * @property nullable CPTAxisLabel *pointingDeviceDownLabel * @brief The label that was selected on the pointing device down event. **/ @synthesize pointingDeviceDownLabel; /** @internal - * @property cpt_weak CPTAxisLabel *pointingDeviceDownTickLabel + * @property nullable CPTAxisLabel *pointingDeviceDownTickLabel * @brief The tick label that was selected on the pointing device down event. **/ @synthesize pointingDeviceDownTickLabel; @@ -524,6 +530,7 @@ @implementation CPTAxis * - @ref labelShadow = @nil * - @ref minorTickLabelShadow = @nil * - @ref alternatingBandFills = @nil + * - @ref alternatingBandAnchor = @nil * - @ref minorGridLines = @nil * - @ref majorGridLines = @nil * - @ref needsDisplayOnBoundsChange = @YES @@ -531,9 +538,9 @@ @implementation CPTAxis * @param newFrame The frame rectangle. * @return The initialized CPTAxis object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { plotSpace = nil; majorTickLocations = [NSSet set]; minorTickLocations = [NSSet set]; @@ -558,8 +565,8 @@ -(instancetype)initWithFrame:(CGRect)newFrame minorGridLineStyle = nil; axisLineCapMin = nil; axisLineCapMax = nil; - labelingOrigin = [[NSDecimalNumber zero] decimalValue]; - majorIntervalLength = [[NSDecimalNumber one] decimalValue]; + labelingOrigin = @0.0; + majorIntervalLength = @1.0; minorTicksPerInterval = 1; coordinate = CPTCoordinateX; labelingPolicy = CPTAxisLabelingPolicyFixedInterval; @@ -580,8 +587,8 @@ -(instancetype)initWithFrame:(CGRect)newFrame tickDirection = CPTSignNone; axisTitle = nil; titleTextStyle = [[CPTTextStyle alloc] init]; - titleRotation = NAN; - titleLocation = CPTDecimalNaN(); + titleRotation = CPTNAN; + titleLocation = @(NAN); needsRelabel = YES; labelExclusionRanges = nil; plotArea = nil; @@ -592,6 +599,7 @@ -(instancetype)initWithFrame:(CGRect)newFrame visibleAxisRange = nil; gridLinesRange = nil; alternatingBandFills = nil; + alternatingBandAnchor = nil; mutableBackgroundLimitBands = nil; minorGridLines = nil; majorGridLines = nil; @@ -609,9 +617,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTAxis *theLayer = (CPTAxis *)layer; plotSpace = theLayer->plotSpace; @@ -665,6 +673,7 @@ -(instancetype)initWithLayer:(id)layer visibleAxisRange = theLayer->visibleAxisRange; gridLinesRange = theLayer->gridLinesRange; alternatingBandFills = theLayer->alternatingBandFills; + alternatingBandAnchor = theLayer->alternatingBandAnchor; mutableBackgroundLimitBands = theLayer->mutableBackgroundLimitBands; minorGridLines = theLayer->minorGridLines; majorGridLines = theLayer->majorGridLines; @@ -694,7 +703,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -719,8 +728,8 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeObject:self.minorGridLineStyle forKey:@"CPTAxis.minorGridLineStyle"]; [coder encodeObject:self.axisLineCapMin forKey:@"CPTAxis.axisLineCapMin"]; [coder encodeObject:self.axisLineCapMax forKey:@"CPTAxis.axisLineCapMax"]; - [coder encodeDecimal:self.labelingOrigin forKey:@"CPTAxis.labelingOrigin"]; - [coder encodeDecimal:self.majorIntervalLength forKey:@"CPTAxis.majorIntervalLength"]; + [coder encodeObject:self.labelingOrigin forKey:@"CPTAxis.labelingOrigin"]; + [coder encodeObject:self.majorIntervalLength forKey:@"CPTAxis.majorIntervalLength"]; [coder encodeInteger:(NSInteger)self.minorTicksPerInterval forKey:@"CPTAxis.minorTicksPerInterval"]; [coder encodeInteger:(NSInteger)self.preferredNumberOfMajorTicks forKey:@"CPTAxis.preferredNumberOfMajorTicks"]; [coder encodeInteger:self.labelingPolicy forKey:@"CPTAxis.labelingPolicy"]; @@ -739,7 +748,7 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeCGFloat:self.titleOffset forKey:@"CPTAxis.titleOffset"]; [coder encodeCGFloat:self.titleRotation forKey:@"CPTAxis.titleRotation"]; [coder encodeInteger:self.titleDirection forKey:@"CPTAxis.titleDirection"]; - [coder encodeDecimal:self.titleLocation forKey:@"CPTAxis.titleLocation"]; + [coder encodeObject:self.titleLocation forKey:@"CPTAxis.titleLocation"]; [coder encodeInteger:self.tickDirection forKey:@"CPTAxis.tickDirection"]; [coder encodeBool:self.needsRelabel forKey:@"CPTAxis.needsRelabel"]; [coder encodeObject:self.labelExclusionRanges forKey:@"CPTAxis.labelExclusionRanges"]; @@ -747,6 +756,7 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeObject:self.visibleAxisRange forKey:@"CPTAxis.visibleAxisRange"]; [coder encodeObject:self.gridLinesRange forKey:@"CPTAxis.gridLinesRange"]; [coder encodeObject:self.alternatingBandFills forKey:@"CPTAxis.alternatingBandFills"]; + [coder encodeObject:self.alternatingBandAnchor forKey:@"CPTAxis.alternatingBandAnchor"]; [coder encodeObject:self.mutableBackgroundLimitBands forKey:@"CPTAxis.mutableBackgroundLimitBands"]; [coder encodeBool:self.separateLayers forKey:@"CPTAxis.separateLayers"]; [coder encodeObject:self.labelShadow forKey:@"CPTAxis.labelShadow"]; @@ -762,65 +772,102 @@ -(void)encodeWithCoder:(NSCoder *)coder // labelsUpdated } --(instancetype)initWithCoder:(NSCoder *)coder -{ - if ( (self = [super initWithCoder:coder]) ) { - coordinate = (CPTCoordinate)[coder decodeIntegerForKey : @"CPTAxis.coordinate"]; - plotSpace = [coder decodeObjectForKey:@"CPTAxis.plotSpace"]; - majorTickLocations = [coder decodeObjectForKey:@"CPTAxis.majorTickLocations"]; - minorTickLocations = [coder decodeObjectForKey:@"CPTAxis.minorTickLocations"]; - majorTickLength = [coder decodeCGFloatForKey:@"CPTAxis.majorTickLength"]; - minorTickLength = [coder decodeCGFloatForKey:@"CPTAxis.minorTickLength"]; - labelOffset = [coder decodeCGFloatForKey:@"CPTAxis.labelOffset"]; - minorTickLabelOffset = [coder decodeCGFloatForKey:@"CPTAxis.minorTickLabelOffset"]; - labelRotation = [coder decodeCGFloatForKey:@"CPTAxis.labelRotation"]; - minorTickLabelRotation = [coder decodeCGFloatForKey:@"CPTAxis.minorTickLabelRotation"]; - labelAlignment = (CPTAlignment)[coder decodeIntegerForKey : @"CPTAxis.labelAlignment"]; - minorTickLabelAlignment = (CPTAlignment)[coder decodeIntegerForKey : @"CPTAxis.minorTickLabelAlignment"]; - axisLineStyle = [[coder decodeObjectForKey:@"CPTAxis.axisLineStyle"] copy]; - majorTickLineStyle = [[coder decodeObjectForKey:@"CPTAxis.majorTickLineStyle"] copy]; - minorTickLineStyle = [[coder decodeObjectForKey:@"CPTAxis.minorTickLineStyle"] copy]; - tickLabelDirection = (CPTSign)[coder decodeIntegerForKey : @"CPTAxis.tickLabelDirection"]; - minorTickLabelDirection = (CPTSign)[coder decodeIntegerForKey : @"CPTAxis.minorTickLabelDirection"]; - majorGridLineStyle = [[coder decodeObjectForKey:@"CPTAxis.majorGridLineStyle"] copy]; - minorGridLineStyle = [[coder decodeObjectForKey:@"CPTAxis.minorGridLineStyle"] copy]; - axisLineCapMin = [[coder decodeObjectForKey:@"CPTAxis.axisLineCapMin"] copy]; - axisLineCapMax = [[coder decodeObjectForKey:@"CPTAxis.axisLineCapMax"] copy]; - labelingOrigin = [coder decodeDecimalForKey:@"CPTAxis.labelingOrigin"]; - majorIntervalLength = [coder decodeDecimalForKey:@"CPTAxis.majorIntervalLength"]; - minorTicksPerInterval = (NSUInteger)[coder decodeIntegerForKey : @"CPTAxis.minorTicksPerInterval"]; - preferredNumberOfMajorTicks = (NSUInteger)[coder decodeIntegerForKey : @"CPTAxis.preferredNumberOfMajorTicks"]; - labelingPolicy = (CPTAxisLabelingPolicy)[coder decodeIntegerForKey : @"CPTAxis.labelingPolicy"]; - labelTextStyle = [[coder decodeObjectForKey:@"CPTAxis.labelTextStyle"] copy]; - minorTickLabelTextStyle = [[coder decodeObjectForKey:@"CPTAxis.minorTickLabelTextStyle"] copy]; - titleTextStyle = [[coder decodeObjectForKey:@"CPTAxis.titleTextStyle"] copy]; - labelFormatter = [coder decodeObjectForKey:@"CPTAxis.labelFormatter"]; - minorTickLabelFormatter = [coder decodeObjectForKey:@"CPTAxis.minorTickLabelFormatter"]; - labelFormatterChanged = [coder decodeBoolForKey:@"CPTAxis.labelFormatterChanged"]; - minorLabelFormatterChanged = [coder decodeBoolForKey:@"CPTAxis.minorLabelFormatterChanged"]; - axisLabels = [coder decodeObjectForKey:@"CPTAxis.axisLabels"]; - minorTickAxisLabels = [coder decodeObjectForKey:@"CPTAxis.minorTickAxisLabels"]; - axisTitle = [coder decodeObjectForKey:@"CPTAxis.axisTitle"]; - title = [[coder decodeObjectForKey:@"CPTAxis.title"] copy]; - attributedTitle = [[coder decodeObjectForKey:@"CPTAxis.attributedTitle"] copy]; - titleOffset = [coder decodeCGFloatForKey:@"CPTAxis.titleOffset"]; - titleRotation = [coder decodeCGFloatForKey:@"CPTAxis.titleRotation"]; - titleDirection = (CPTSign)[coder decodeIntegerForKey : @"CPTAxis.titleDirection"]; - titleLocation = [coder decodeDecimalForKey:@"CPTAxis.titleLocation"]; - tickDirection = (CPTSign)[coder decodeIntegerForKey : @"CPTAxis.tickDirection"]; - needsRelabel = [coder decodeBoolForKey:@"CPTAxis.needsRelabel"]; - labelExclusionRanges = [coder decodeObjectForKey:@"CPTAxis.labelExclusionRanges"]; - visibleRange = [[coder decodeObjectForKey:@"CPTAxis.visibleRange"] copy]; - visibleAxisRange = [[coder decodeObjectForKey:@"CPTAxis.visibleAxisRange"] copy]; - gridLinesRange = [[coder decodeObjectForKey:@"CPTAxis.gridLinesRange"] copy]; - alternatingBandFills = [[coder decodeObjectForKey:@"CPTAxis.alternatingBandFills"] copy]; - mutableBackgroundLimitBands = [[coder decodeObjectForKey:@"CPTAxis.mutableBackgroundLimitBands"] mutableCopy]; - separateLayers = [coder decodeBoolForKey:@"CPTAxis.separateLayers"]; - labelShadow = [coder decodeObjectForKey:@"CPTAxis.labelShadow"]; - minorTickLabelShadow = [coder decodeObjectForKey:@"CPTAxis.minorTickLabelShadow"]; - plotArea = [coder decodeObjectForKey:@"CPTAxis.plotArea"]; - minorGridLines = [coder decodeObjectForKey:@"CPTAxis.minorGridLines"]; - majorGridLines = [coder decodeObjectForKey:@"CPTAxis.majorGridLines"]; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder +{ + if ((self = [super initWithCoder:coder])) { + coordinate = (CPTCoordinate)[coder decodeIntegerForKey:@"CPTAxis.coordinate"]; + plotSpace = [coder decodeObjectOfClass:[CPTPlotSpace class] + forKey:@"CPTAxis.plotSpace"]; + majorTickLocations = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSSet class], [NSNumber class]]] + forKey:@"CPTAxis.majorTickLocations"]; + minorTickLocations = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSSet class], [NSNumber class]]] + forKey:@"CPTAxis.minorTickLocations"]; + majorTickLength = [coder decodeCGFloatForKey:@"CPTAxis.majorTickLength"]; + minorTickLength = [coder decodeCGFloatForKey:@"CPTAxis.minorTickLength"]; + labelOffset = [coder decodeCGFloatForKey:@"CPTAxis.labelOffset"]; + minorTickLabelOffset = [coder decodeCGFloatForKey:@"CPTAxis.minorTickLabelOffset"]; + labelRotation = [coder decodeCGFloatForKey:@"CPTAxis.labelRotation"]; + minorTickLabelRotation = [coder decodeCGFloatForKey:@"CPTAxis.minorTickLabelRotation"]; + labelAlignment = (CPTAlignment)[coder decodeIntegerForKey:@"CPTAxis.labelAlignment"]; + minorTickLabelAlignment = (CPTAlignment)[coder decodeIntegerForKey:@"CPTAxis.minorTickLabelAlignment"]; + axisLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTAxis.axisLineStyle"] copy]; + majorTickLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTAxis.majorTickLineStyle"] copy]; + minorTickLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTAxis.minorTickLineStyle"] copy]; + tickLabelDirection = (CPTSign)[coder decodeIntegerForKey:@"CPTAxis.tickLabelDirection"]; + minorTickLabelDirection = (CPTSign)[coder decodeIntegerForKey:@"CPTAxis.minorTickLabelDirection"]; + majorGridLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTAxis.majorGridLineStyle"] copy]; + minorGridLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTAxis.minorGridLineStyle"] copy]; + axisLineCapMin = [[coder decodeObjectOfClass:[CPTLineCap class] + forKey:@"CPTAxis.axisLineCapMin"] copy]; + axisLineCapMax = [[coder decodeObjectOfClass:[CPTLineCap class] + forKey:@"CPTAxis.axisLineCapMax"] copy]; + NSNumber *origin = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTAxis.labelingOrigin"]; + labelingOrigin = origin ? origin : @0.0; + majorIntervalLength = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTAxis.majorIntervalLength"]; + minorTicksPerInterval = (NSUInteger)[coder decodeIntegerForKey:@"CPTAxis.minorTicksPerInterval"]; + preferredNumberOfMajorTicks = (NSUInteger)[coder decodeIntegerForKey:@"CPTAxis.preferredNumberOfMajorTicks"]; + labelingPolicy = (CPTAxisLabelingPolicy)[coder decodeIntegerForKey:@"CPTAxis.labelingPolicy"]; + labelTextStyle = [[coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTAxis.labelTextStyle"] copy]; + minorTickLabelTextStyle = [[coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTAxis.minorTickLabelTextStyle"] copy]; + titleTextStyle = [[coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTAxis.titleTextStyle"] copy]; + labelFormatter = [coder decodeObjectOfClass:[NSFormatter class] + forKey:@"CPTAxis.labelFormatter"]; + minorTickLabelFormatter = [coder decodeObjectOfClass:[NSFormatter class] + forKey:@"CPTAxis.minorTickLabelFormatter"]; + labelFormatterChanged = [coder decodeBoolForKey:@"CPTAxis.labelFormatterChanged"]; + minorLabelFormatterChanged = [coder decodeBoolForKey:@"CPTAxis.minorLabelFormatterChanged"]; + axisLabels = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSSet class], [CPTAxisLabel class]]] + forKey:@"CPTAxis.axisLabels"]; + minorTickAxisLabels = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSSet class], [CPTAxisLabel class]]] + forKey:@"CPTAxis.minorTickAxisLabels"]; + axisTitle = [coder decodeObjectOfClass:[NSString class] + forKey:@"CPTAxis.axisTitle"]; + title = [[coder decodeObjectOfClass:[NSString class] + forKey:@"CPTAxis.title"] copy]; + attributedTitle = [[coder decodeObjectOfClass:[NSAttributedString class] + forKey:@"CPTAxis.attributedTitle"] copy]; + titleOffset = [coder decodeCGFloatForKey:@"CPTAxis.titleOffset"]; + titleRotation = [coder decodeCGFloatForKey:@"CPTAxis.titleRotation"]; + titleDirection = (CPTSign)[coder decodeIntegerForKey:@"CPTAxis.titleDirection"]; + titleLocation = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTAxis.titleLocation"]; + tickDirection = (CPTSign)[coder decodeIntegerForKey:@"CPTAxis.tickDirection"]; + needsRelabel = [coder decodeBoolForKey:@"CPTAxis.needsRelabel"]; + labelExclusionRanges = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTPlotRange class]]] + forKey:@"CPTAxis.labelExclusionRanges"]; + visibleRange = [[coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTAxis.visibleRange"] copy]; + visibleAxisRange = [[coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTAxis.visibleAxisRange"] copy]; + gridLinesRange = [[coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTAxis.gridLinesRange"] copy]; + alternatingBandFills = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTFill class]]] + forKey:@"CPTAxis.alternatingBandFills"] copy]; + alternatingBandAnchor = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTAxis.alternatingBandAnchor"]; + mutableBackgroundLimitBands = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTLimitBand class]]] + forKey:@"CPTAxis.mutableBackgroundLimitBands"] mutableCopy]; + separateLayers = [coder decodeBoolForKey:@"CPTAxis.separateLayers"]; + labelShadow = [coder decodeObjectOfClass:[CPTShadow class] + forKey:@"CPTAxis.labelShadow"]; + minorTickLabelShadow = [coder decodeObjectOfClass:[CPTShadow class] + forKey:@"CPTAxis.minorTickLabelShadow"]; + plotArea = [coder decodeObjectOfClass:[CPTPlotArea class] + forKey:@"CPTAxis.plotArea"]; + minorGridLines = [coder decodeObjectOfClass:[CPTGridLines class] + forKey:@"CPTAxis.minorGridLines"]; + majorGridLines = [coder decodeObjectOfClass:[CPTGridLines class] + forKey:@"CPTAxis.majorGridLines"]; pointingDeviceDownLabel = nil; pointingDeviceDownTickLabel = nil; @@ -833,14 +880,26 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Animation /// @cond -+(BOOL)needsDisplayForKey:(NSString *)aKey ++(BOOL)needsDisplayForKey:(nonnull NSString *)aKey { - static NSSet *keys = nil; + static NSSet *keys = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ @@ -873,15 +932,15 @@ +(BOOL)needsDisplayForKey:(NSString *)aKey * @param newMajorLocations A new NSSet containing the major tick locations. * @param newMinorLocations A new NSSet containing the minor tick locations. */ --(void)generateFixedIntervalMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocations minorTickLocations:(NSSet *__autoreleasing *)newMinorLocations +-(void)generateFixedIntervalMajorTickLocations:(CPTNumberSet *__autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet *__autoreleasing *)newMinorLocations { - NSMutableSet *majorLocations = [NSMutableSet set]; - NSMutableSet *minorLocations = [NSMutableSet set]; + CPTMutableNumberSet *majorLocations = [NSMutableSet set]; + CPTMutableNumberSet *minorLocations = [NSMutableSet set]; NSDecimal zero = CPTDecimalFromInteger(0); - NSDecimal majorInterval = self.majorIntervalLength; + NSDecimal majorInterval = self.majorIntervalLength.decimalValue; - if ( CPTDecimalGreaterThan(majorInterval, zero) ) { + if ( CPTDecimalGreaterThan(majorInterval, zero)) { CPTMutablePlotRange *range = [[self.plotSpace plotRangeForCoordinate:self.coordinate] mutableCopy]; if ( range ) { CPTPlotRange *theVisibleRange = self.visibleRange; @@ -889,29 +948,30 @@ -(void)generateFixedIntervalMajorTickLocations:(NSSet *__autoreleasing *)newMajo [range intersectionPlotRange:theVisibleRange]; } - NSDecimal rangeMin = range.minLimit; - NSDecimal rangeMax = range.maxLimit; + NSDecimal rangeMin = range.minLimitDecimal; + NSDecimal rangeMax = range.maxLimitDecimal; NSDecimal minorInterval; NSUInteger minorTickCount = self.minorTicksPerInterval; if ( minorTickCount > 0 ) { - minorInterval = CPTDecimalDivide( majorInterval, CPTDecimalFromUnsignedInteger(minorTickCount + 1) ); + minorInterval = CPTDecimalDivide(majorInterval, CPTDecimalFromUnsignedInteger(minorTickCount + 1)); } else { minorInterval = zero; } // Set starting coord--should be the smallest value >= rangeMin that is a whole multiple of majorInterval away from the labelingOrigin - NSDecimal coord = CPTDecimalDivide(CPTDecimalSubtract(rangeMin, self.labelingOrigin), majorInterval); + NSDecimal origin = self.labelingOrigin.decimalValue; + NSDecimal coord = CPTDecimalDivide(CPTDecimalSubtract(rangeMin, origin), majorInterval); NSDecimalRound(&coord, &coord, 0, NSRoundUp); - coord = CPTDecimalAdd(CPTDecimalMultiply(coord, majorInterval), self.labelingOrigin); + coord = CPTDecimalAdd(CPTDecimalMultiply(coord, majorInterval), origin); // Set minor ticks between the starting point and rangeMin if ( minorTickCount > 0 ) { NSDecimal minorCoord = CPTDecimalSubtract(coord, minorInterval); for ( NSUInteger minorTickIndex = 0; minorTickIndex < minorTickCount; minorTickIndex++ ) { - if ( CPTDecimalLessThan(minorCoord, rangeMin) ) { + if ( CPTDecimalLessThan(minorCoord, rangeMin)) { break; } [minorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:minorCoord]]; @@ -920,7 +980,7 @@ -(void)generateFixedIntervalMajorTickLocations:(NSSet *__autoreleasing *)newMajo } // Set tick locations - while ( CPTDecimalLessThanOrEqualTo(coord, rangeMax) ) { + while ( CPTDecimalLessThanOrEqualTo(coord, rangeMax)) { // Major tick [majorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:coord]]; @@ -929,7 +989,7 @@ -(void)generateFixedIntervalMajorTickLocations:(NSSet *__autoreleasing *)newMajo NSDecimal minorCoord = CPTDecimalAdd(coord, minorInterval); for ( NSUInteger minorTickIndex = 0; minorTickIndex < minorTickCount; minorTickIndex++ ) { - if ( CPTDecimalGreaterThan(minorCoord, rangeMax) ) { + if ( CPTDecimalGreaterThan(minorCoord, rangeMax)) { break; } [minorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:minorCoord]]; @@ -952,11 +1012,11 @@ -(void)generateFixedIntervalMajorTickLocations:(NSSet *__autoreleasing *)newMajo * @param newMajorLocations A new NSSet containing the major tick locations. * @param newMinorLocations A new NSSet containing the minor tick locations. */ --(void)autoGenerateMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocations minorTickLocations:(NSSet *__autoreleasing *)newMinorLocations +-(void)autoGenerateMajorTickLocations:(CPTNumberSet *__autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet *__autoreleasing *)newMinorLocations { // Create sets for locations - NSMutableSet *majorLocations = [NSMutableSet set]; - NSMutableSet *minorLocations = [NSMutableSet set]; + CPTMutableNumberSet *majorLocations = [NSMutableSet set]; + CPTMutableNumberSet *minorLocations = [NSMutableSet set]; // Get plot range CPTMutablePlotRange *range = [[self.plotSpace plotRangeForCoordinate:self.coordinate] mutableCopy]; @@ -977,11 +1037,15 @@ -(void)autoGenerateMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocation case CPTScaleTypeLog: // supported scale type--check range - if ( (range.minLimitDouble <= 0.0) || (range.maxLimitDouble <= 0.0) ) { + if ((range.minLimitDouble <= 0.0) || (range.maxLimitDouble <= 0.0)) { valid = NO; } break; + case CPTScaleTypeLogModulus: + // supported scale type + break; + default: // unsupported scale type--bail out valid = NO; @@ -1000,7 +1064,7 @@ -(void)autoGenerateMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocation double length = fabs(range.lengthDouble); // Filter troublesome values and return empty sets - if ( length != 0.0 ) { + if ((length != 0.0) && !isinf(length)) { switch ( scaleType ) { case CPTScaleTypeLinear: { @@ -1024,27 +1088,27 @@ -(void)autoGenerateMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocation NSDecimal majorInterval; if ( numTicks == 2 ) { - majorInterval = CPTNiceLength(range.length); + majorInterval = CPTNiceLength(range.lengthDecimal); } else { - majorInterval = CPTDecimalDivide( range.length, CPTDecimalFromUnsignedInteger(numTicks - 1) ); + majorInterval = CPTDecimalDivide(range.lengthDecimal, CPTDecimalFromUnsignedInteger(numTicks - 1)); majorInterval = CPTNiceNum(majorInterval); } - if ( CPTDecimalLessThan(majorInterval, zero) ) { - majorInterval = CPTDecimalMultiply( majorInterval, CPTDecimalFromInteger(-1) ); + if ( CPTDecimalLessThan(majorInterval, zero)) { + majorInterval = CPTDecimalMultiply(majorInterval, CPTDecimalFromInteger(-1)); } NSDecimal minorInterval; if ( minorTicks > 1 ) { - minorInterval = CPTDecimalDivide( majorInterval, CPTDecimalFromUnsignedInteger(minorTicks) ); + minorInterval = CPTDecimalDivide(majorInterval, CPTDecimalFromUnsignedInteger(minorTicks)); } else { minorInterval = zero; } // Calculate actual range limits - NSDecimal minLimit = range.minLimit; - NSDecimal maxLimit = range.maxLimit; + NSDecimal minLimit = range.minLimitDecimal; + NSDecimal maxLimit = range.maxLimitDecimal; // Determine the initial and final major indexes for the actual visible range NSDecimal initialIndex = CPTDecimalDivide(minLimit, majorInterval); @@ -1054,26 +1118,26 @@ -(void)autoGenerateMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocation NSDecimalRound(&finalIndex, &finalIndex, 0, NSRoundUp); // Iterate through the indexes with visible ticks and build the locations sets - for ( NSDecimal i = initialIndex; CPTDecimalLessThanOrEqualTo(i, finalIndex); i = CPTDecimalAdd(i, one) ) { + for ( NSDecimal i = initialIndex; CPTDecimalLessThanOrEqualTo(i, finalIndex); i = CPTDecimalAdd(i, one)) { NSDecimal pointLocation = CPTDecimalMultiply(majorInterval, i); NSDecimal minorPointLocation = pointLocation; for ( NSUInteger j = 1; j < minorTicks; j++ ) { minorPointLocation = CPTDecimalAdd(minorPointLocation, minorInterval); - if ( CPTDecimalLessThan(minorPointLocation, minLimit) ) { + if ( CPTDecimalLessThan(minorPointLocation, minLimit)) { continue; } - if ( CPTDecimalGreaterThan(minorPointLocation, maxLimit) ) { + if ( CPTDecimalGreaterThan(minorPointLocation, maxLimit)) { continue; } [minorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:minorPointLocation]]; } - if ( CPTDecimalLessThan(pointLocation, minLimit) ) { + if ( CPTDecimalLessThan(pointLocation, minLimit)) { continue; } - if ( CPTDecimalGreaterThan(pointLocation, maxLimit) ) { + if ( CPTDecimalGreaterThan(pointLocation, maxLimit)) { continue; } [majorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:pointLocation]]; @@ -1086,30 +1150,19 @@ -(void)autoGenerateMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocation double minLimit = range.minLimitDouble; double maxLimit = range.maxLimitDouble; - if ( (minLimit > 0.0) && (maxLimit > 0.0) ) { + if ((minLimit > 0.0) && (maxLimit > 0.0)) { // Determine interval value - if ( numTicks == 0 ) { - numTicks = 5; - } - - double interval; - length = log10(maxLimit / minLimit); - if ( fabs(length) >= numTicks ) { - interval = CPTDecimalDoubleValue( CPTNiceNum( CPTDecimalFromDouble( length / (numTicks - 1) ) ) ); - } - else { - interval = signbit(length) ? -1.0 : 1.0; - } - double intervalStep = pow( 10.0, fabs(interval) ); + double interval = signbit(length) ? -1.0 : 1.0; + double intervalStep = pow(10.0, fabs(interval)); // Determine minor interval - double minorInterval = intervalStep * 0.9 * pow( 10.0, floor( log10(minLimit) ) ) / minorTicks; + double minorInterval = intervalStep * 0.9 * pow(10.0, floor(log10(minLimit))) / minorTicks; // Determine the initial and final major indexes for the actual visible range - NSInteger initialIndex = (NSInteger)lrint( floor( log10( minLimit / fabs(interval) ) ) ); // can be negative - NSInteger finalIndex = (NSInteger)lrint( ceil( log10( maxLimit / fabs(interval) ) ) ); // can be negative + NSInteger initialIndex = (NSInteger)lrint(floor(log10(minLimit / fabs(interval)))); // can be negative + NSInteger finalIndex = (NSInteger)lrint(ceil(log10(maxLimit / fabs(interval)))); // can be negative // Iterate through the indexes with visible ticks and build the locations sets for ( NSInteger i = initialIndex; i <= finalIndex; i++ ) { @@ -1138,6 +1191,106 @@ -(void)autoGenerateMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocation } break; + case CPTScaleTypeLogModulus: + { + double minLimit = range.minLimitDouble; + double maxLimit = range.maxLimitDouble; + + // Determine interval value + double modMinLimit = CPTLogModulus(minLimit); + double modMaxLimit = CPTLogModulus(maxLimit); + + double multiplier = pow(10.0, floor(log10(length))); + multiplier = (multiplier < 1.0) ? multiplier : 1.0; + + double intervalStep = 10.0; + + // Determine the initial and final major indexes for the actual visible range + NSInteger initialIndex = (NSInteger)lrint(floor(modMinLimit / multiplier)); // can be negative + NSInteger finalIndex = (NSInteger)lrint(ceil(modMaxLimit / multiplier)); // can be negative + + if ( initialIndex < 0 ) { + // Determine minor interval + double minorInterval = intervalStep * 0.9 * multiplier / minorTicks; + + for ( NSInteger i = MIN(0, finalIndex); i >= initialIndex; i-- ) { + double pointLocation; + double sign = -multiplier; + + if ( multiplier < 1.0 ) { + pointLocation = sign * pow(10.0, fabs((double)i) - 1.0); + } + else { + pointLocation = sign * pow(10.0, fabs((double)i)); + } + + for ( NSUInteger j = 1; j < minorTicks; j++ ) { + double minorPointLocation = pointLocation + sign * minorInterval * j; + if ( minorPointLocation < minLimit ) { + continue; + } + if ( minorPointLocation > maxLimit ) { + continue; + } + [minorLocations addObject:@(minorPointLocation)]; + } + minorInterval *= intervalStep; + + if ( i == 0 ) { + pointLocation = 0.0; + } + if ( pointLocation < minLimit ) { + continue; + } + if ( pointLocation > maxLimit ) { + continue; + } + [majorLocations addObject:@(pointLocation)]; + } + } + + if ( finalIndex >= 0 ) { + // Determine minor interval + double minorInterval = intervalStep * 0.9 * multiplier / minorTicks; + + for ( NSInteger i = MAX(0, initialIndex); i <= finalIndex; i++ ) { + double pointLocation; + double sign = multiplier; + + if ( multiplier < 1.0 ) { + pointLocation = sign * pow(10.0, fabs((double)i) - 1.0); + } + else { + pointLocation = sign * pow(10.0, fabs((double)i)); + } + + for ( NSUInteger j = 1; j < minorTicks; j++ ) { + double minorPointLocation = pointLocation + sign * minorInterval * j; + if ( minorPointLocation < minLimit ) { + continue; + } + if ( minorPointLocation > maxLimit ) { + continue; + } + [minorLocations addObject:@(minorPointLocation)]; + } + minorInterval *= intervalStep; + + if ( i == 0 ) { + pointLocation = 0.0; + } + if ( pointLocation < minLimit ) { + continue; + } + if ( pointLocation > maxLimit ) { + continue; + } + [majorLocations addObject:@(pointLocation)]; + } + } + } + break; + default: break; } @@ -1154,10 +1307,10 @@ -(void)autoGenerateMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocation * @param newMajorLocations A new NSSet containing the major tick locations. * @param newMinorLocations A new NSSet containing the minor tick locations. */ --(void)generateEqualMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocations minorTickLocations:(NSSet *__autoreleasing *)newMinorLocations +-(void)generateEqualMajorTickLocations:(CPTNumberSet *__autoreleasing *)newMajorLocations minorTickLocations:(CPTNumberSet *__autoreleasing *)newMinorLocations { - NSMutableSet *majorLocations = [NSMutableSet set]; - NSMutableSet *minorLocations = [NSMutableSet set]; + CPTMutableNumberSet *majorLocations = [NSMutableSet set]; + CPTMutableNumberSet *minorLocations = [NSMutableSet set]; CPTMutablePlotRange *range = [[self.plotSpace plotRangeForCoordinate:self.coordinate] mutableCopy]; @@ -1169,23 +1322,23 @@ -(void)generateEqualMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocatio if ( range.lengthDouble != 0.0 ) { NSDecimal zero = CPTDecimalFromInteger(0); - NSDecimal rangeMin = range.minLimit; - NSDecimal rangeMax = range.maxLimit; + NSDecimal rangeMin = range.minLimitDecimal; + NSDecimal rangeMax = range.maxLimitDecimal; NSUInteger majorTickCount = self.preferredNumberOfMajorTicks; if ( majorTickCount < 2 ) { majorTickCount = 2; } - NSDecimal majorInterval = CPTDecimalDivide( range.length, CPTDecimalFromUnsignedInteger(majorTickCount - 1) ); - if ( CPTDecimalLessThan(majorInterval, zero) ) { - majorInterval = CPTDecimalMultiply( majorInterval, CPTDecimalFromInteger(-1) ); + NSDecimal majorInterval = CPTDecimalDivide(range.lengthDecimal, CPTDecimalFromUnsignedInteger(majorTickCount - 1)); + if ( CPTDecimalLessThan(majorInterval, zero)) { + majorInterval = CPTDecimalMultiply(majorInterval, CPTDecimalFromInteger(-1)); } NSDecimal minorInterval; NSUInteger minorTickCount = self.minorTicksPerInterval; if ( minorTickCount > 0 ) { - minorInterval = CPTDecimalDivide( majorInterval, CPTDecimalFromUnsignedInteger(minorTickCount + 1) ); + minorInterval = CPTDecimalDivide(majorInterval, CPTDecimalFromUnsignedInteger(minorTickCount + 1)); } else { minorInterval = zero; @@ -1194,7 +1347,7 @@ -(void)generateEqualMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocatio NSDecimal coord = rangeMin; // Set tick locations - while ( CPTDecimalLessThanOrEqualTo(coord, rangeMax) ) { + while ( CPTDecimalLessThanOrEqualTo(coord, rangeMax)) { // Major tick [majorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:coord]]; @@ -1203,7 +1356,7 @@ -(void)generateEqualMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocatio NSDecimal minorCoord = CPTDecimalAdd(coord, minorInterval); for ( NSUInteger minorTickIndex = 0; minorTickIndex < minorTickCount; minorTickIndex++ ) { - if ( CPTDecimalGreaterThan(minorCoord, rangeMax) ) { + if ( CPTDecimalGreaterThan(minorCoord, rangeMax)) { break; } [minorLocations addObject:[NSDecimalNumber decimalNumberWithDecimal:minorCoord]]; @@ -1228,32 +1381,32 @@ -(void)generateEqualMajorTickLocations:(NSSet *__autoreleasing *)newMajorLocatio NSDecimal CPTNiceNum(NSDecimal x) { NSDecimal zero = CPTDecimalFromInteger(0); - NSDecimal minusOne; - if ( CPTDecimalEquals(x, zero) ) { + if ( CPTDecimalEquals(x, zero)) { return zero; } + NSDecimal minusOne = CPTDecimalFromInteger(-1); + BOOL xIsNegative = CPTDecimalLessThan(x, zero); if ( xIsNegative ) { - minusOne = CPTDecimalFromInteger(-1); - x = CPTDecimalMultiply(x, minusOne); + x = CPTDecimalMultiply(x, minusOne); } - short exponent = (short)lrint( floor( log10( CPTDecimalDoubleValue(x) ) ) ); + short exponent = (short)lrint(floor(log10(CPTDecimalDoubleValue(x)))); NSDecimal fractionPart; NSDecimalMultiplyByPowerOf10(&fractionPart, &x, -exponent, NSRoundPlain); NSDecimal roundedFraction; - if ( CPTDecimalLessThan( fractionPart, CPTDecimalFromDouble(1.5) ) ) { + if ( CPTDecimalLessThan(fractionPart, CPTDecimalFromDouble(1.5))) { roundedFraction = CPTDecimalFromInteger(1); } - else if ( CPTDecimalLessThan( fractionPart, CPTDecimalFromInteger(3) ) ) { + else if ( CPTDecimalLessThan(fractionPart, CPTDecimalFromInteger(3))) { roundedFraction = CPTDecimalFromInteger(2); } - else if ( CPTDecimalLessThan( fractionPart, CPTDecimalFromInteger(7) ) ) { + else if ( CPTDecimalLessThan(fractionPart, CPTDecimalFromInteger(7))) { roundedFraction = CPTDecimalFromInteger(5); } else { @@ -1273,30 +1426,30 @@ NSDecimal CPTNiceNum(NSDecimal x) /** * @internal * @brief Determines a @quote{nice} range length (a multiple of @num{2}, @num{5}, or @num{10}) less than or equal to the given length. - * @param x The length to round. + * @param length The length to round. */ NSDecimal CPTNiceLength(NSDecimal length) { NSDecimal zero = CPTDecimalFromInteger(0); - NSDecimal minusOne; - if ( CPTDecimalEquals(length, zero) ) { + if ( CPTDecimalEquals(length, zero)) { return zero; } + NSDecimal minusOne = CPTDecimalFromInteger(-1); + BOOL isNegative = CPTDecimalLessThan(length, zero); if ( isNegative ) { - minusOne = CPTDecimalFromInteger(-1); - length = CPTDecimalMultiply(length, minusOne); + length = CPTDecimalMultiply(length, minusOne); } NSDecimal roundedNumber; - if ( CPTDecimalGreaterThan( length, CPTDecimalFromInteger(10) ) ) { + if ( CPTDecimalGreaterThan(length, CPTDecimalFromInteger(10))) { NSDecimalRound(&roundedNumber, &length, 0, NSRoundDown); } else { - short exponent = (short)lrint( floor( log10( CPTDecimalDoubleValue(length) ) ) ) - 1; + short exponent = (short)lrint(floor(log10(CPTDecimalDoubleValue(length)))) - 1; NSDecimalRound(&roundedNumber, &length, -exponent, NSRoundDown); } @@ -1313,12 +1466,12 @@ NSDecimal CPTNiceLength(NSDecimal length) * @param allLocations A set of tick locations. * @return The filtered set of tick locations. */ --(NSSet *)filteredTickLocations:(NSSet *)allLocations +-(nullable CPTNumberSet *)filteredTickLocations:(nullable CPTNumberSet *)allLocations { - NSArray *exclusionRanges = self.labelExclusionRanges; + CPTPlotRangeArray *exclusionRanges = self.labelExclusionRanges; if ( exclusionRanges ) { - NSMutableSet *filteredLocations = [allLocations mutableCopy]; + CPTMutableNumberSet *filteredLocations = [allLocations mutableCopy]; for ( CPTPlotRange *range in exclusionRanges ) { for ( NSNumber *location in allLocations ) { if ( [range containsNumber:location] ) { @@ -1339,7 +1492,7 @@ -(NSSet *)filteredTickLocations:(NSSet *)allLocations * @param allLocations A set of major tick locations. * @return The filtered set. **/ --(NSSet *)filteredMajorTickLocations:(NSSet *)allLocations +-(nullable CPTNumberSet *)filteredMajorTickLocations:(nullable CPTNumberSet *)allLocations { return [self filteredTickLocations:allLocations]; } @@ -1348,7 +1501,7 @@ -(NSSet *)filteredMajorTickLocations:(NSSet *)allLocations * @param allLocations A set of minor tick locations. * @return The filtered set. **/ --(NSSet *)filteredMinorTickLocations:(NSSet *)allLocations +-(nullable CPTNumberSet *)filteredMinorTickLocations:(nullable CPTNumberSet *)allLocations { return [self filteredTickLocations:allLocations]; } @@ -1384,7 +1537,7 @@ -(CGFloat)tickOffset * @param labeledRange A plot range used to filter the generated labels. If @nil, no filtering is done. * @param useMajorAxisLabels If @YES, label the major ticks, otherwise label the minor ticks. **/ --(void)updateAxisLabelsAtLocations:(NSSet *)locations inRange:(CPTPlotRange *)labeledRange useMajorAxisLabels:(BOOL)useMajorAxisLabels +-(void)updateAxisLabelsAtLocations:(nullable CPTNumberSet *)locations inRange:(nullable CPTPlotRange *)labeledRange useMajorAxisLabels:(BOOL)useMajorAxisLabels { CPTAlignment theLabelAlignment; CPTSign theLabelDirection; @@ -1395,13 +1548,16 @@ -(void)updateAxisLabelsAtLocations:(NSSet *)locations inRange:(CPTPlotRange *)la BOOL theLabelFormatterChanged; CPTShadow *theShadow; - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( useMajorAxisLabels ) { - if ( [theDelegate respondsToSelector:@selector(axis:shouldUpdateAxisLabelsAtLocations:)] ) { - BOOL shouldContinue = [theDelegate axis:self shouldUpdateAxisLabelsAtLocations:locations]; - if ( !shouldContinue ) { - return; + if ( locations.count > 0 ) { + if ( [theDelegate respondsToSelector:@selector(axis:shouldUpdateAxisLabelsAtLocations:)] ) { + CPTNumberSet *locationSet = locations; + BOOL shouldContinue = [theDelegate axis:self shouldUpdateAxisLabelsAtLocations:locationSet]; + if ( !shouldContinue ) { + return; + } } } theLabelAlignment = self.labelAlignment; @@ -1414,10 +1570,13 @@ -(void)updateAxisLabelsAtLocations:(NSSet *)locations inRange:(CPTPlotRange *)la theShadow = self.labelShadow; } else { - if ( [theDelegate respondsToSelector:@selector(axis:shouldUpdateMinorAxisLabelsAtLocations:)] ) { - BOOL shouldContinue = [theDelegate axis:self shouldUpdateMinorAxisLabelsAtLocations:locations]; - if ( !shouldContinue ) { - return; + if ( locations.count > 0 ) { + if ( [theDelegate respondsToSelector:@selector(axis:shouldUpdateMinorAxisLabelsAtLocations:)] ) { + CPTNumberSet *locationSet = locations; + BOOL shouldContinue = [theDelegate axis:self shouldUpdateMinorAxisLabelsAtLocations:locationSet]; + if ( !shouldContinue ) { + return; + } } } theLabelAlignment = self.minorTickLabelAlignment; @@ -1430,7 +1589,7 @@ -(void)updateAxisLabelsAtLocations:(NSSet *)locations inRange:(CPTPlotRange *)la theShadow = self.minorTickLabelShadow; } - if ( (locations.count == 0) || !theLabelTextStyle || !theLabelFormatter ) { + if ((locations.count == 0) || !theLabelTextStyle || !theLabelFormatter ) { if ( useMajorAxisLabels ) { self.axisLabels = nil; } @@ -1440,9 +1599,9 @@ -(void)updateAxisLabelsAtLocations:(NSSet *)locations inRange:(CPTPlotRange *)la return; } - NSDictionary *textAttributes = [theLabelTextStyle attributes]; - BOOL hasAttributedFormatter = ([theLabelFormatter attributedStringForObjectValue:[NSDecimalNumber zero] - withDefaultAttributes:textAttributes] != nil); + CPTDictionary *textAttributes = theLabelTextStyle.attributes; + BOOL hasAttributedFormatter = ([theLabelFormatter attributedStringForObjectValue:[NSDecimalNumber zero] + withDefaultAttributes:textAttributes] != nil); CPTPlotSpace *thePlotSpace = self.plotSpace; CPTCoordinate myCoordinate = self.coordinate; @@ -1454,14 +1613,14 @@ -(void)updateAxisLabelsAtLocations:(NSSet *)locations inRange:(CPTPlotRange *)la theLabelDirection = direction; } - if ( (direction == CPTSignNone) || (theLabelDirection == direction) ) { + if ((direction == CPTSignNone) || (theLabelDirection == direction)) { theLabelOffset += self.tickOffset; } CPTPlotArea *thePlotArea = self.plotArea; [thePlotArea setAxisSetLayersForType:CPTGraphLayerTypeAxisLabels]; - NSMutableSet *oldAxisLabels; + CPTMutableAxisLabelSet *oldAxisLabels; if ( useMajorAxisLabels ) { oldAxisLabels = [self.axisLabels mutableCopy]; } @@ -1469,15 +1628,13 @@ -(void)updateAxisLabelsAtLocations:(NSSet *)locations inRange:(CPTPlotRange *)la oldAxisLabels = [self.minorTickAxisLabels mutableCopy]; } - NSMutableSet *newAxisLabels = [[NSMutableSet alloc] initWithCapacity:locations.count]; - CPTAxisLabel *blankLabel = [[CPTAxisLabel alloc] initWithText:nil textStyle:nil]; - CPTAxisLabelGroup *axisLabelGroup = thePlotArea.axisLabelGroup; - CPTLayer *lastLayer = nil; + CPTMutableAxisLabelSet *newAxisLabels = [[NSMutableSet alloc] initWithCapacity:locations.count]; + CPTAxisLabel *blankLabel = [[CPTAxisLabel alloc] initWithText:nil textStyle:nil]; + CPTAxisLabelGroup *axisLabelGroup = thePlotArea.axisLabelGroup; + CPTLayer *lastLayer = nil; for ( NSDecimalNumber *tickLocation in locations ) { - NSDecimal locationDecimal = tickLocation.decimalValue; - - if ( labeledRange && ![labeledRange contains:locationDecimal] ) { + if ( labeledRange && ![labeledRange containsNumber:tickLocation] ) { continue; } @@ -1485,7 +1642,7 @@ -(void)updateAxisLabelsAtLocations:(NSSet *)locations inRange:(CPTPlotRange *)la BOOL needsNewContentLayer = NO; // reuse axis labels where possible--will prevent flicker when updating layers - blankLabel.tickLocation = locationDecimal; + blankLabel.tickLocation = tickLocation; CPTAxisLabel *oldAxisLabel = [oldAxisLabels member:blankLabel]; if ( oldAxisLabel ) { @@ -1493,7 +1650,7 @@ -(void)updateAxisLabelsAtLocations:(NSSet *)locations inRange:(CPTPlotRange *)la } else { newAxisLabel = [[CPTAxisLabel alloc] initWithText:nil textStyle:nil]; - newAxisLabel.tickLocation = locationDecimal; + newAxisLabel.tickLocation = tickLocation; needsNewContentLayer = YES; } @@ -1575,14 +1732,14 @@ -(void)relabel if ( !self.plotSpace ) { return; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(axisShouldRelabel:)] && ![theDelegate axisShouldRelabel:self] ) { self.needsRelabel = NO; return; } - NSSet *newMajorLocations = nil; - NSSet *newMinorLocations = nil; + CPTNumberSet *newMajorLocations = nil; + CPTNumberSet *newMinorLocations = nil; switch ( self.labelingPolicy ) { case CPTAxisLabelingPolicyNone: @@ -1679,22 +1836,27 @@ -(void)updateCustomTickLabels if ( range.lengthDouble != 0.0 ) { CPTCoordinate orthogonalCoordinate = CPTOrthogonalCoordinate(self.coordinate); - CPTSign direction = self.tickDirection; + + CPTSign direction = self.tickLabelDirection; + + if ( direction == CPTSignNone ) { + direction = self.tickDirection; + } for ( CPTAxisLabel *label in self.axisLabels ) { - BOOL visible = [range contains:label.tickLocation]; + BOOL visible = [range containsNumber:label.tickLocation]; label.contentLayer.hidden = !visible; if ( visible ) { - CGPoint tickBasePoint = [self viewPointForCoordinateDecimalNumber:label.tickLocation]; + CGPoint tickBasePoint = [self viewPointForCoordinateValue:label.tickLocation]; [label positionRelativeToViewPoint:tickBasePoint forCoordinate:orthogonalCoordinate inDirection:direction]; } } for ( CPTAxisLabel *label in self.minorTickAxisLabels ) { - BOOL visible = [range contains:label.tickLocation]; + BOOL visible = [range containsNumber:label.tickLocation]; label.contentLayer.hidden = !visible; if ( visible ) { - CGPoint tickBasePoint = [self viewPointForCoordinateDecimalNumber:label.tickLocation]; + CGPoint tickBasePoint = [self viewPointForCoordinateValue:label.tickLocation]; [label positionRelativeToViewPoint:tickBasePoint forCoordinate:orthogonalCoordinate inDirection:direction]; } } @@ -1713,7 +1875,7 @@ -(void)updateMajorTickLabelOffsets CGFloat majorOffset = self.labelOffset; - if ( (direction == CPTSignNone) || (labelDirection == direction) ) { + if ((direction == CPTSignNone) || (labelDirection == direction)) { majorOffset += self.tickOffset; } @@ -1733,7 +1895,7 @@ -(void)updateMinorTickLabelOffsets CGFloat minorOffset = self.minorTickLabelOffset; - if ( (direction == CPTSignNone) || (labelDirection == direction) ) { + if ((direction == CPTSignNone) || (labelDirection == direction)) { minorOffset += self.tickOffset; } @@ -1758,7 +1920,7 @@ -(void)updateMajorTickLabels } for ( CPTAxisLabel *label in self.axisLabels ) { - CGPoint tickBasePoint = [self viewPointForCoordinateDecimalNumber:label.tickLocation]; + CGPoint tickBasePoint = [self viewPointForCoordinateValue:label.tickLocation]; [label positionRelativeToViewPoint:tickBasePoint forCoordinate:orthogonalCoordinate inDirection:direction]; } } @@ -1777,7 +1939,7 @@ -(void)updateMinorTickLabels } for ( CPTAxisLabel *label in self.minorTickAxisLabels ) { - CGPoint tickBasePoint = [self viewPointForCoordinateDecimalNumber:label.tickLocation]; + CGPoint tickBasePoint = [self viewPointForCoordinateValue:label.tickLocation]; [label positionRelativeToViewPoint:tickBasePoint forCoordinate:orthogonalCoordinate inDirection:direction]; } } @@ -1785,9 +1947,9 @@ -(void)updateMinorTickLabels #pragma mark - #pragma mark Titles --(NSDecimal)defaultTitleLocation +-(nonnull NSNumber *)defaultTitleLocation { - return CPTDecimalNaN(); + return @(NAN); } /** @@ -1801,7 +1963,7 @@ -(void)updateAxisTitle direction = self.tickDirection; } - [self.axisTitle positionRelativeToViewPoint:[self viewPointForCoordinateDecimalNumber:self.titleLocation] + [self.axisTitle positionRelativeToViewPoint:[self viewPointForCoordinateValue:self.titleLocation] forCoordinate:CPTOrthogonalCoordinate(self.coordinate) inDirection:direction]; } @@ -1838,14 +2000,15 @@ -(void)layoutSublayers /** @brief Add a background limit band. * @param limitBand The new limit band. **/ --(void)addBackgroundLimitBand:(CPTLimitBand *)limitBand +-(void)addBackgroundLimitBand:(nullable CPTLimitBand *)limitBand { if ( limitBand ) { if ( !self.mutableBackgroundLimitBands ) { self.mutableBackgroundLimitBands = [NSMutableArray array]; } - [self.mutableBackgroundLimitBands addObject:limitBand]; + CPTLimitBand *band = limitBand; + [self.mutableBackgroundLimitBands addObject:band]; CPTPlotArea *thePlotArea = self.plotArea; [thePlotArea setNeedsDisplay]; @@ -1855,10 +2018,11 @@ -(void)addBackgroundLimitBand:(CPTLimitBand *)limitBand /** @brief Remove a background limit band. * @param limitBand The limit band to be removed. **/ --(void)removeBackgroundLimitBand:(CPTLimitBand *)limitBand +-(void)removeBackgroundLimitBand:(nullable CPTLimitBand *)limitBand { if ( limitBand ) { - [self.mutableBackgroundLimitBands removeObject:limitBand]; + CPTLimitBand *band = limitBand; + [self.mutableBackgroundLimitBands removeObject:band]; CPTPlotArea *thePlotArea = self.plotArea; [thePlotArea setNeedsDisplay]; @@ -1876,7 +2040,7 @@ -(void)removeAllBackgroundLimitBands } #pragma mark - -#pragma mark Responder Chain and User interaction +#pragma mark Responder Chain and User Interaction /// @name User Interaction /// @{ @@ -1905,7 +2069,7 @@ -(void)removeAllBackgroundLimitBands * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { CPTGraph *theGraph = self.graph; @@ -1913,7 +2077,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; // Tick labels if ( [theDelegate respondsToSelector:@selector(axis:labelTouchDown:)] || @@ -1925,7 +2089,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact if ( contentLayer && !contentLayer.hidden ) { CGPoint labelPoint = [theGraph convertPoint:interactionPoint toLayer:contentLayer]; - if ( CGRectContainsPoint(contentLayer.bounds, labelPoint) ) { + if ( CGRectContainsPoint(contentLayer.bounds, labelPoint)) { self.pointingDeviceDownLabel = label; BOOL handled = NO; @@ -1957,7 +2121,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact if ( contentLayer && !contentLayer.hidden ) { CGPoint labelPoint = [theGraph convertPoint:interactionPoint toLayer:contentLayer]; - if ( CGRectContainsPoint(contentLayer.bounds, labelPoint) ) { + if ( CGRectContainsPoint(contentLayer.bounds, labelPoint)) { self.pointingDeviceDownTickLabel = label; BOOL handled = NO; @@ -2010,7 +2174,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { CPTAxisLabel *selectedDownLabel = self.pointingDeviceDownLabel; CPTAxisLabel *selectedDownTickLabel = self.pointingDeviceDownTickLabel; @@ -2024,7 +2188,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; // Tick labels if ( [theDelegate respondsToSelector:@selector(axis:labelTouchUp:)] || @@ -2036,7 +2200,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio if ( contentLayer && !contentLayer.hidden ) { CGPoint labelPoint = [theGraph convertPoint:interactionPoint toLayer:contentLayer]; - if ( CGRectContainsPoint(contentLayer.bounds, labelPoint) ) { + if ( CGRectContainsPoint(contentLayer.bounds, labelPoint)) { BOOL handled = NO; if ( [theDelegate respondsToSelector:@selector(axis:labelTouchUp:)] ) { @@ -2079,7 +2243,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio if ( contentLayer && !contentLayer.hidden ) { CGPoint labelPoint = [theGraph convertPoint:interactionPoint toLayer:contentLayer]; - if ( CGRectContainsPoint(contentLayer.bounds, labelPoint) ) { + if ( CGRectContainsPoint(contentLayer.bounds, labelPoint)) { BOOL handled = NO; if ( [theDelegate respondsToSelector:@selector(axis:minorTickTouchUp:)] ) { @@ -2122,7 +2286,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio /// @cond --(void)setAxisLabels:(NSSet *)newLabels +-(void)setAxisLabels:(nullable CPTAxisLabelSet *)newLabels { if ( newLabels != axisLabels ) { if ( self.labelsUpdated ) { @@ -2158,11 +2322,16 @@ -(void)setAxisLabels:(NSSet *)newLabels } } - [self updateMajorTickLabels]; + if ( self.labelingPolicy == CPTAxisLabelingPolicyNone ) { + [self updateCustomTickLabels]; + } + else { + [self updateMajorTickLabels]; + } } } --(void)setMinorTickAxisLabels:(NSSet *)newLabels +-(void)setMinorTickAxisLabels:(nullable CPTAxisLabelSet *)newLabels { if ( newLabels != minorTickAxisLabels ) { if ( self.labelsUpdated ) { @@ -2198,20 +2367,25 @@ -(void)setMinorTickAxisLabels:(NSSet *)newLabels } } - [self updateMinorTickLabels]; + if ( self.labelingPolicy == CPTAxisLabelingPolicyNone ) { + [self updateCustomTickLabels]; + } + else { + [self updateMinorTickLabels]; + } } } --(void)setLabelTextStyle:(CPTTextStyle *)newStyle +-(void)setLabelTextStyle:(nullable CPTTextStyle *)newStyle { - if ( newStyle != labelTextStyle ) { + if ( labelTextStyle != newStyle ) { labelTextStyle = [newStyle copy]; Class textLayerClass = [CPTTextLayer class]; for ( CPTAxisLabel *axisLabel in self.axisLabels ) { CPTLayer *contentLayer = axisLabel.contentLayer; if ( [contentLayer isKindOfClass:textLayerClass] ) { - [(CPTTextLayer *)contentLayer setTextStyle : labelTextStyle]; + ((CPTTextLayer *)contentLayer).textStyle = labelTextStyle; } } @@ -2219,16 +2393,16 @@ -(void)setLabelTextStyle:(CPTTextStyle *)newStyle } } --(void)setMinorTickLabelTextStyle:(CPTTextStyle *)newStyle +-(void)setMinorTickLabelTextStyle:(nullable CPTTextStyle *)newStyle { - if ( newStyle != minorTickLabelTextStyle ) { + if ( minorTickLabelTextStyle != newStyle ) { minorTickLabelTextStyle = [newStyle copy]; Class textLayerClass = [CPTTextLayer class]; for ( CPTAxisLabel *axisLabel in self.minorTickAxisLabels ) { CPTLayer *contentLayer = axisLabel.contentLayer; if ( [contentLayer isKindOfClass:textLayerClass] ) { - [(CPTTextLayer *)contentLayer setTextStyle : minorTickLabelTextStyle]; + ((CPTTextLayer *)contentLayer).textStyle = minorTickLabelTextStyle; } } @@ -2236,7 +2410,7 @@ -(void)setMinorTickLabelTextStyle:(CPTTextStyle *)newStyle } } --(void)setAxisTitle:(CPTAxisTitle *)newTitle +-(void)setAxisTitle:(nullable CPTAxisTitle *)newTitle { if ( newTitle != axisTitle ) { [axisTitle.contentLayer removeFromSuperlayer]; @@ -2256,7 +2430,7 @@ -(void)setAxisTitle:(CPTAxisTitle *)newTitle } } --(CPTAxisTitle *)axisTitle +-(nullable CPTAxisTitle *)axisTitle { if ( !axisTitle ) { CPTAxisTitle *newTitle = nil; @@ -2277,7 +2451,7 @@ -(CPTAxisTitle *)axisTitle return axisTitle; } --(void)setTitleTextStyle:(CPTTextStyle *)newStyle +-(void)setTitleTextStyle:(nullable CPTTextStyle *)newStyle { if ( newStyle != titleTextStyle ) { titleTextStyle = [newStyle copy]; @@ -2289,7 +2463,7 @@ -(void)setTitleTextStyle:(CPTTextStyle *)newStyle CPTLayer *contentLayer = self.axisTitle.contentLayer; if ( [contentLayer isKindOfClass:[CPTTextLayer class]] ) { - ( (CPTTextLayer *)contentLayer ).textStyle = titleTextStyle; + ((CPTTextLayer *)contentLayer).textStyle = titleTextStyle; [self updateAxisTitle]; } } @@ -2325,7 +2499,7 @@ -(void)setTitleDirection:(CPTSign)newDirection } } --(void)setTitle:(NSString *)newTitle +-(void)setTitle:(nullable NSString *)newTitle { if ( newTitle != title ) { title = [newTitle copy]; @@ -2338,7 +2512,7 @@ -(void)setTitle:(NSString *)newTitle if ( title ) { CPTLayer *contentLayer = self.axisTitle.contentLayer; if ( [contentLayer isKindOfClass:[CPTTextLayer class]] ) { - ( (CPTTextLayer *)contentLayer ).text = title; + ((CPTTextLayer *)contentLayer).text = title; [self updateAxisTitle]; } } @@ -2349,7 +2523,7 @@ -(void)setTitle:(NSString *)newTitle } } --(void)setAttributedTitle:(NSAttributedString *)newTitle +-(void)setAttributedTitle:(nullable NSAttributedString *)newTitle { if ( newTitle != attributedTitle ) { attributedTitle = [newTitle copy]; @@ -2364,7 +2538,7 @@ -(void)setAttributedTitle:(NSAttributedString *)newTitle CPTLayer *contentLayer = self.axisTitle.contentLayer; if ( [contentLayer isKindOfClass:[CPTTextLayer class]] ) { - ( (CPTTextLayer *)contentLayer ).attributedText = attributedTitle; + ((CPTTextLayer *)contentLayer).attributedText = attributedTitle; [self updateAxisTitle]; } } @@ -2380,17 +2554,24 @@ -(void)setAttributedTitle:(NSAttributedString *)newTitle } } --(void)setTitleLocation:(NSDecimal)newLocation +-(void)setTitleLocation:(nullable NSNumber *)newLocation { - if ( NSDecimalCompare(&newLocation, &titleLocation) != NSOrderedSame ) { + BOOL needsUpdate = YES; + + if ( newLocation ) { + NSNumber *location = newLocation; + needsUpdate = ![titleLocation isEqualToNumber:location]; + } + + if ( needsUpdate ) { titleLocation = newLocation; [self updateAxisTitle]; } } --(NSDecimal)titleLocation +-(nullable NSNumber *)titleLocation { - if ( NSDecimalIsNotANumber(&titleLocation) ) { + if ( isnan(titleLocation.doubleValue)) { return self.defaultTitleLocation; } else { @@ -2398,7 +2579,7 @@ -(NSDecimal)titleLocation } } --(void)setLabelExclusionRanges:(NSArray *)ranges +-(void)setLabelExclusionRanges:(nullable CPTPlotRangeArray *)ranges { if ( ranges != labelExclusionRanges ) { labelExclusionRanges = ranges; @@ -2428,7 +2609,7 @@ -(void)setNeedsRelabel:(BOOL)newNeedsRelabel } } --(void)setMajorTickLocations:(NSSet *)newLocations +-(void)setMajorTickLocations:(nullable CPTNumberSet *)newLocations { if ( newLocations != majorTickLocations ) { majorTickLocations = newLocations; @@ -2445,7 +2626,7 @@ -(void)setMajorTickLocations:(NSSet *)newLocations } } --(void)setMinorTickLocations:(NSSet *)newLocations +-(void)setMinorTickLocations:(nullable CPTNumberSet *)newLocations { if ( newLocations != minorTickLocations ) { minorTickLocations = newLocations; @@ -2542,7 +2723,7 @@ -(void)setMinorTickLabelAlignment:(CPTAlignment)newAlignment } } --(void)setLabelShadow:(CPTShadow *)newLabelShadow +-(void)setLabelShadow:(nullable CPTShadow *)newLabelShadow { if ( newLabelShadow != labelShadow ) { labelShadow = newLabelShadow; @@ -2553,7 +2734,7 @@ -(void)setLabelShadow:(CPTShadow *)newLabelShadow } } --(void)setMinorTickLabelShadow:(CPTShadow *)newLabelShadow +-(void)setMinorTickLabelShadow:(nullable CPTShadow *)newLabelShadow { if ( newLabelShadow != minorTickLabelShadow ) { minorTickLabelShadow = newLabelShadow; @@ -2564,7 +2745,7 @@ -(void)setMinorTickLabelShadow:(CPTShadow *)newLabelShadow } } --(void)setPlotSpace:(CPTPlotSpace *)newSpace +-(void)setPlotSpace:(nullable CPTPlotSpace *)newSpace { if ( newSpace != plotSpace ) { plotSpace = newSpace; @@ -2580,7 +2761,7 @@ -(void)setCoordinate:(CPTCoordinate)newCoordinate } } --(void)setAxisLineStyle:(CPTLineStyle *)newLineStyle +-(void)setAxisLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( newLineStyle != axisLineStyle ) { axisLineStyle = [newLineStyle copy]; @@ -2588,7 +2769,7 @@ -(void)setAxisLineStyle:(CPTLineStyle *)newLineStyle } } --(void)setMajorTickLineStyle:(CPTLineStyle *)newLineStyle +-(void)setMajorTickLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( newLineStyle != majorTickLineStyle ) { majorTickLineStyle = [newLineStyle copy]; @@ -2596,7 +2777,7 @@ -(void)setMajorTickLineStyle:(CPTLineStyle *)newLineStyle } } --(void)setMinorTickLineStyle:(CPTLineStyle *)newLineStyle +-(void)setMinorTickLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( newLineStyle != minorTickLineStyle ) { minorTickLineStyle = [newLineStyle copy]; @@ -2604,7 +2785,7 @@ -(void)setMinorTickLineStyle:(CPTLineStyle *)newLineStyle } } --(void)setMajorGridLineStyle:(CPTLineStyle *)newLineStyle +-(void)setMajorGridLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( newLineStyle != majorGridLineStyle ) { majorGridLineStyle = [newLineStyle copy]; @@ -2634,7 +2815,7 @@ -(void)setMajorGridLineStyle:(CPTLineStyle *)newLineStyle } } --(void)setMinorGridLineStyle:(CPTLineStyle *)newLineStyle +-(void)setMinorGridLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( newLineStyle != minorGridLineStyle ) { minorGridLineStyle = [newLineStyle copy]; @@ -2664,7 +2845,7 @@ -(void)setMinorGridLineStyle:(CPTLineStyle *)newLineStyle } } --(void)setAxisLineCapMin:(CPTLineCap *)newAxisLineCapMin +-(void)setAxisLineCapMin:(nullable CPTLineCap *)newAxisLineCapMin { if ( newAxisLineCapMin != axisLineCapMin ) { axisLineCapMin = [newAxisLineCapMin copy]; @@ -2672,7 +2853,7 @@ -(void)setAxisLineCapMin:(CPTLineCap *)newAxisLineCapMin } } --(void)setAxisLineCapMax:(CPTLineCap *)newAxisLineCapMax +-(void)setAxisLineCapMax:(nullable CPTLineCap *)newAxisLineCapMax { if ( newAxisLineCapMax != axisLineCapMax ) { axisLineCapMax = [newAxisLineCapMax copy]; @@ -2680,18 +2861,31 @@ -(void)setAxisLineCapMax:(CPTLineCap *)newAxisLineCapMax } } --(void)setLabelingOrigin:(NSDecimal)newLabelingOrigin +-(void)setLabelingOrigin:(nonnull NSNumber *)newLabelingOrigin { - if ( !CPTDecimalEquals(labelingOrigin, newLabelingOrigin) ) { + BOOL needsUpdate = YES; + + if ( newLabelingOrigin ) { + needsUpdate = ![labelingOrigin isEqualToNumber:newLabelingOrigin]; + } + + if ( needsUpdate ) { labelingOrigin = newLabelingOrigin; self.needsRelabel = YES; } } --(void)setMajorIntervalLength:(NSDecimal)newIntervalLength +-(void)setMajorIntervalLength:(nullable NSNumber *)newIntervalLength { - if ( !CPTDecimalEquals(majorIntervalLength, newIntervalLength) ) { + BOOL needsUpdate = YES; + + if ( newIntervalLength ) { + NSNumber *interval = newIntervalLength; + needsUpdate = ![majorIntervalLength isEqualToNumber:interval]; + } + + if ( needsUpdate ) { majorIntervalLength = newIntervalLength; self.needsRelabel = YES; @@ -2725,7 +2919,7 @@ -(void)setPreferredNumberOfMajorTicks:(NSUInteger)newPreferredNumberOfMajorTicks } } --(void)setLabelFormatter:(NSFormatter *)newTickLabelFormatter +-(void)setLabelFormatter:(nullable NSFormatter *)newTickLabelFormatter { if ( newTickLabelFormatter != labelFormatter ) { labelFormatter = newTickLabelFormatter; @@ -2735,7 +2929,7 @@ -(void)setLabelFormatter:(NSFormatter *)newTickLabelFormatter } } --(void)setMinorTickLabelFormatter:(NSFormatter *)newMinorTickLabelFormatter +-(void)setMinorTickLabelFormatter:(nullable NSFormatter *)newMinorTickLabelFormatter { if ( newMinorTickLabelFormatter != minorTickLabelFormatter ) { minorTickLabelFormatter = newMinorTickLabelFormatter; @@ -2779,9 +2973,9 @@ -(void)setMinorTickLabelDirection:(CPTSign)newDirection } } --(void)setGridLinesRange:(CPTPlotRange *)newRange +-(void)setGridLinesRange:(nullable CPTPlotRange *)newRange { - if ( newRange != gridLinesRange ) { + if ( gridLinesRange != newRange ) { gridLinesRange = [newRange copy]; if ( self.separateLayers ) { CPTGridLines *gridlines = self.majorGridLines; @@ -2798,7 +2992,7 @@ -(void)setGridLinesRange:(CPTPlotRange *)newRange } } --(void)setPlotArea:(CPTPlotArea *)newPlotArea +-(void)setPlotArea:(nullable CPTPlotArea *)newPlotArea { if ( newPlotArea != plotArea ) { plotArea = newPlotArea; @@ -2876,12 +3070,15 @@ -(void)setPlotArea:(CPTPlotArea *)newPlotArea for ( CPTAxisLabel *label in self.axisLabels ) { [label.contentLayer removeFromSuperlayer]; } + for ( CPTAxisLabel *label in self.minorTickAxisLabels ) { + [label.contentLayer removeFromSuperlayer]; + } [self.axisTitle.contentLayer removeFromSuperlayer]; } } } --(void)setVisibleRange:(CPTPlotRange *)newRange +-(void)setVisibleRange:(nullable CPTPlotRange *)newRange { if ( newRange != visibleRange ) { visibleRange = [newRange copy]; @@ -2889,7 +3086,7 @@ -(void)setVisibleRange:(CPTPlotRange *)newRange } } --(void)setVisibleAxisRange:(CPTPlotRange *)newRange +-(void)setVisibleAxisRange:(nullable CPTPlotRange *)newRange { if ( newRange != visibleAxisRange ) { visibleAxisRange = [newRange copy]; @@ -2925,7 +3122,7 @@ -(void)setSeparateLayers:(BOOL)newSeparateLayers } } --(void)setMinorGridLines:(CPTGridLines *)newGridLines +-(void)setMinorGridLines:(nullable CPTGridLines *)newGridLines { CPTGridLines *oldGridLines = minorGridLines; @@ -2934,16 +3131,18 @@ -(void)setMinorGridLines:(CPTGridLines *)newGridLines minorGridLines = newGridLines; if ( newGridLines ) { - newGridLines.major = NO; - newGridLines.axis = self; + CPTGridLines *gridLines = newGridLines; + + gridLines.major = NO; + gridLines.axis = self; CPTPlotArea *thePlotArea = self.plotArea; - [thePlotArea.minorGridLineGroup insertSublayer:newGridLines atIndex:[thePlotArea sublayerIndexForAxis:self layerType:CPTGraphLayerTypeMinorGridLines]]; + [thePlotArea.minorGridLineGroup insertSublayer:gridLines atIndex:[thePlotArea sublayerIndexForAxis:self layerType:CPTGraphLayerTypeMinorGridLines]]; } } } --(void)setMajorGridLines:(CPTGridLines *)newGridLines +-(void)setMajorGridLines:(nullable CPTGridLines *)newGridLines { CPTGridLines *oldGridLines = majorGridLines; @@ -2952,16 +3151,18 @@ -(void)setMajorGridLines:(CPTGridLines *)newGridLines majorGridLines = newGridLines; if ( newGridLines ) { - newGridLines.major = YES; - newGridLines.axis = self; + CPTGridLines *gridLines = newGridLines; + + gridLines.major = YES; + gridLines.axis = self; CPTPlotArea *thePlotArea = self.plotArea; - [thePlotArea.majorGridLineGroup insertSublayer:newGridLines atIndex:[thePlotArea sublayerIndexForAxis:self layerType:CPTGraphLayerTypeMajorGridLines]]; + [thePlotArea.majorGridLineGroup insertSublayer:gridLines atIndex:[thePlotArea sublayerIndexForAxis:self layerType:CPTGraphLayerTypeMajorGridLines]]; } } } --(void)setAlternatingBandFills:(NSArray *)newFills +-(void)setAlternatingBandFills:(nullable CPTFillArray *)newFills { if ( newFills != alternatingBandFills ) { Class nullClass = [NSNull class]; @@ -2983,9 +3184,9 @@ -(void)setAlternatingBandFills:(NSArray *)newFills Class gradientClass = [CPTGradient class]; Class imageClass = [CPTImage class]; - NSMutableArray *fillArray = [newFills mutableCopy]; - NSUInteger i = 0; - CPTFill *newFill = nil; + CPTMutableFillArray *fillArray = [newFills mutableCopy]; + NSUInteger i = 0; + CPTFill *newFill = nil; for ( id obj in newFills ) { if ( [obj isKindOfClass:nullClass] || [obj isKindOfClass:fillClass] ) { @@ -3021,12 +3222,22 @@ -(void)setAlternatingBandFills:(NSArray *)newFills } } --(NSArray *)backgroundLimitBands +-(void)setAlternatingBandAnchor:(nullable NSNumber *)newBandAnchor +{ + if ( newBandAnchor != alternatingBandAnchor ) { + alternatingBandAnchor = newBandAnchor; + + CPTPlotArea *thePlotArea = self.plotArea; + [thePlotArea setNeedsDisplay]; + } +} + +-(nullable CPTLimitBandArray *)backgroundLimitBands { return [self.mutableBackgroundLimitBands copy]; } --(CPTAxisSet *)axisSet +-(nullable CPTAxisSet *)axisSet { CPTPlotArea *thePlotArea = self.plotArea; @@ -3036,7 +3247,7 @@ -(CPTAxisSet *)axisSet -(void)setHidden:(BOOL)newHidden { if ( newHidden != self.hidden ) { - [super setHidden:newHidden]; + super.hidden = newHidden; [self setNeedsRelabel]; } } @@ -3050,10 +3261,10 @@ -(void)setHidden:(BOOL)newHidden @implementation CPTAxis(AbstractMethods) /** @brief Converts a position on the axis to drawing coordinates. - * @param coordinateDecimalNumber The axis value in data coordinate space. + * @param coordinateValue The axis value in data coordinate space. * @return The drawing coordinates of the point. **/ --(CGPoint)viewPointForCoordinateDecimalNumber:(NSDecimal)coordinateDecimalNumber +-(CGPoint)viewPointForCoordinateValue:(nullable NSNumber *__unused)coordinateValue { return CGPointZero; } @@ -3062,7 +3273,7 @@ -(CGPoint)viewPointForCoordinateDecimalNumber:(NSDecimal)coordinateDecimalNumber * @param context The graphics context to draw into. * @param major Draw the major grid lines If @YES, minor grid lines otherwise. **/ --(void)drawGridLinesInContext:(CGContextRef)context isMajor:(BOOL)major +-(void)drawGridLinesInContext:(nonnull CGContextRef __unused)context isMajor:(BOOL __unused)major { // do nothing--subclasses must override to do their drawing } @@ -3070,7 +3281,7 @@ -(void)drawGridLinesInContext:(CGContextRef)context isMajor:(BOOL)major /** @brief Draws alternating background bands into the provided graphics context. * @param context The graphics context to draw into. **/ --(void)drawBackgroundBandsInContext:(CGContextRef)context +-(void)drawBackgroundBandsInContext:(nonnull CGContextRef __unused)context { // do nothing--subclasses must override to do their drawing } @@ -3078,7 +3289,7 @@ -(void)drawBackgroundBandsInContext:(CGContextRef)context /** @brief Draws background limit ranges into the provided graphics context. * @param context The graphics context to draw into. **/ --(void)drawBackgroundLimitsInContext:(CGContextRef)context +-(void)drawBackgroundLimitsInContext:(nonnull CGContextRef __unused)context { // do nothing--subclasses must override to do their drawing } diff --git a/framework/Source/CPTAxisLabel.h b/framework/Source/CPTAxisLabel.h index de15e8c70..b78d2ebd9 100644 --- a/framework/Source/CPTAxisLabel.h +++ b/framework/Source/CPTAxisLabel.h @@ -1,21 +1,34 @@ #import "CPTDefinitions.h" +/// @file + +@class CPTAxisLabel; @class CPTLayer; @class CPTTextStyle; -@interface CPTAxisLabel : NSObject +/** + * @brief A set of CPTAxisLabel objects. + **/ +typedef NSSet CPTAxisLabelSet; + +/** + * @brief A mutable set of CPTAxisLabel objects. + **/ +typedef NSMutableSet CPTMutableAxisLabelSet; + +@interface CPTAxisLabel : NSObject -@property (nonatomic, readwrite, strong) CPTLayer *contentLayer; +@property (nonatomic, readwrite, strong, nullable) CPTLayer *contentLayer; @property (nonatomic, readwrite, assign) CGFloat offset; @property (nonatomic, readwrite, assign) CGFloat rotation; @property (nonatomic, readwrite, assign) CPTAlignment alignment; -@property (nonatomic, readwrite) NSDecimal tickLocation; +@property (nonatomic, readwrite, strong, nonnull) NSNumber *tickLocation; /// @name Initialization /// @{ --(instancetype)initWithText:(NSString *)newText textStyle:(CPTTextStyle *)style; --(instancetype)initWithContentLayer:(CPTLayer *)layer NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithText:(nullable NSString *)newText textStyle:(nullable CPTTextStyle *)style; +-(nonnull instancetype)initWithContentLayer:(nonnull CPTLayer *)layer NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER; /// @} /// @name Layout diff --git a/framework/Source/CPTAxisLabel.m b/framework/Source/CPTAxisLabel.m index 4db358e5d..2f9f23f5e 100644 --- a/framework/Source/CPTAxisLabel.m +++ b/framework/Source/CPTAxisLabel.m @@ -13,7 +13,7 @@ **/ @implementation CPTAxisLabel -/** @property CPTLayer *contentLayer +/** @property nullable CPTLayer *contentLayer * @brief The label content. **/ @synthesize contentLayer; @@ -33,7 +33,7 @@ @implementation CPTAxisLabel **/ @synthesize alignment; -/** @property NSDecimal tickLocation +/** @property nonnull NSNumber *tickLocation * @brief The data coordinate of the tick location. **/ @synthesize tickLocation; @@ -47,7 +47,7 @@ @implementation CPTAxisLabel * @param newStyle The text style for the label. * @return The initialized CPTAxisLabel object. **/ --(instancetype)initWithText:(NSString *)newText textStyle:(CPTTextStyle *)newStyle +-(nonnull instancetype)initWithText:(nullable NSString *)newText textStyle:(nullable CPTTextStyle *)newStyle { CPTTextLayer *newLayer = [[CPTTextLayer alloc] initWithText:newText style:newStyle]; @@ -61,26 +61,22 @@ -(instancetype)initWithText:(NSString *)newText textStyle:(CPTTextStyle *)newSty * @param layer The label content. * @return The initialized CPTAxisLabel object. **/ --(instancetype)initWithContentLayer:(CPTLayer *)layer +-(nonnull instancetype)initWithContentLayer:(nonnull CPTLayer *)layer { - if ( layer ) { - if ( (self = [super init]) ) { - contentLayer = layer; - offset = CPTFloat(20.0); - rotation = CPTFloat(0.0); - alignment = CPTAlignmentCenter; - tickLocation = CPTDecimalFromInteger(0); - } - } - else { - self = nil; + if ((self = [super init])) { + contentLayer = layer; + offset = CPTFloat(20.0); + rotation = CPTFloat(0.0); + alignment = CPTAlignmentCenter; + tickLocation = @0.0; } + return self; } /// @cond --(instancetype)init +-(nonnull instancetype)init { return [self initWithText:nil textStyle:nil]; } @@ -92,13 +88,13 @@ -(instancetype)init /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeObject:self.contentLayer forKey:@"CPTAxisLabel.contentLayer"]; [coder encodeCGFloat:self.offset forKey:@"CPTAxisLabel.offset"]; [coder encodeCGFloat:self.rotation forKey:@"CPTAxisLabel.rotation"]; [coder encodeInteger:self.alignment forKey:@"CPTAxisLabel.alignment"]; - [coder encodeDecimal:self.tickLocation forKey:@"CPTAxisLabel.tickLocation"]; + [coder encodeObject:self.tickLocation forKey:@"CPTAxisLabel.tickLocation"]; } /// @endcond @@ -107,18 +103,33 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - contentLayer = [coder decodeObjectForKey:@"CPTAxisLabel.contentLayer"]; - offset = [coder decodeCGFloatForKey:@"CPTAxisLabel.offset"]; - rotation = [coder decodeCGFloatForKey:@"CPTAxisLabel.rotation"]; - alignment = (CPTAlignment)[coder decodeIntegerForKey : @"CPTAxisLabel.alignment"]; - tickLocation = [coder decodeDecimalForKey:@"CPTAxisLabel.tickLocation"]; + if ((self = [super init])) { + contentLayer = [coder decodeObjectOfClass:[CPTLayer class] + forKey:@"CPTAxisLabel.contentLayer"]; + offset = [coder decodeCGFloatForKey:@"CPTAxisLabel.offset"]; + rotation = [coder decodeCGFloatForKey:@"CPTAxisLabel.rotation"]; + alignment = (CPTAlignment)[coder decodeIntegerForKey:@"CPTAxisLabel.alignment"]; + NSNumber *location = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTAxisLabel.tickLocation"]; + tickLocation = location ? location : @0.0; } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Layout @@ -140,14 +151,14 @@ -(void)positionRelativeToViewPoint:(CGPoint)point forCoordinate:(CPTCoordinate)c } CGPoint newPosition = point; - CGFloat *value = ( coordinate == CPTCoordinateX ? &(newPosition.x) : &(newPosition.y) ); + CGFloat *value = (coordinate == CPTCoordinateX ? &(newPosition.x) : &(newPosition.y)); CGFloat angle = CPTFloat(0.0); CGFloat labelRotation = self.rotation; - if ( isnan(labelRotation) ) { - labelRotation = ( coordinate == CPTCoordinateX ? CPTFloat(M_PI_2) : CPTFloat(0.0) ); + if ( isnan(labelRotation)) { + labelRotation = (coordinate == CPTCoordinateX ? CPTFloat(M_PI_2) : CPTFloat(0.0)); } - content.transform = CATransform3DMakeRotation( labelRotation, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0) ); + content.transform = CATransform3DMakeRotation(labelRotation, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0)); CGRect contentFrame = content.frame; // Position the anchor point along the closest edge. @@ -261,7 +272,7 @@ -(void)positionRelativeToViewPoint:(CGPoint)point forCoordinate:(CPTCoordinate)c CGFloat newAnchorX = cos(angle); CGFloat newAnchorY = sin(angle); - if ( ABS(newAnchorX) <= ABS(newAnchorY) ) { + if ( ABS(newAnchorX) <= ABS(newAnchorY)) { newAnchorX /= ABS(newAnchorY); newAnchorY = signbit(newAnchorY) ? CPTFloat(-1.0) : CPTFloat(1.0); } @@ -269,7 +280,7 @@ -(void)positionRelativeToViewPoint:(CGPoint)point forCoordinate:(CPTCoordinate)c newAnchorY /= ABS(newAnchorX); newAnchorX = signbit(newAnchorX) ? CPTFloat(-1.0) : CPTFloat(1.0); } - CGPoint anchor = CPTPointMake( ( newAnchorX + CPTFloat(1.0) ) / CPTFloat(2.0), ( newAnchorY + CPTFloat(1.0) ) / CPTFloat(2.0) ); + CGPoint anchor = CPTPointMake((newAnchorX + CPTFloat(1.0)) / CPTFloat(2.0), (newAnchorY + CPTFloat(1.0)) / CPTFloat(2.0)); content.anchorPoint = anchor; content.position = newPosition; @@ -284,7 +295,7 @@ -(void)positionRelativeToViewPoint:(CGPoint)point forCoordinate:(CPTCoordinate)c **/ -(void)positionBetweenViewPoint:(CGPoint)firstPoint andViewPoint:(CGPoint)secondPoint forCoordinate:(CPTCoordinate)coordinate inDirection:(CPTSign)direction { - [self positionRelativeToViewPoint:CPTPointMake( (firstPoint.x + secondPoint.x) / CPTFloat(2.0), (firstPoint.y + secondPoint.y) / CPTFloat(2.0) ) + [self positionRelativeToViewPoint:CPTPointMake((firstPoint.x + secondPoint.x) / CPTFloat(2.0), (firstPoint.y + secondPoint.y) / CPTFloat(2.0)) forCoordinate:coordinate inDirection:direction]; } @@ -294,9 +305,9 @@ -(void)positionBetweenViewPoint:(CGPoint)firstPoint andViewPoint:(CGPoint)second /// @cond --(NSString *)description +-(nullable NSString *)description { - return [NSString stringWithFormat:@"<%@ {%@}>", [super description], self.contentLayer]; + return [NSString stringWithFormat:@"<%@ {%@}>", super.description, self.contentLayer]; } /// @endcond @@ -312,13 +323,20 @@ -(NSString *)description * @param object The object to be compared with the receiver. * @return @YES if @par{object} is equal to the receiver, @NO otherwise. **/ --(BOOL)isEqual:(id)object +-(BOOL)isEqual:(nullable id)object { if ( self == object ) { return YES; } else if ( [object isKindOfClass:[self class]] ) { - return CPTDecimalEquals(self.tickLocation, ( (CPTAxisLabel *)object ).tickLocation); + NSNumber *location = ((CPTAxisLabel *)object).tickLocation; + + if ( location ) { + return [self.tickLocation isEqualToNumber:location]; + } + else { + return NO; + } } else { return NO; @@ -334,10 +352,10 @@ -(NSUInteger)hash NSUInteger hashValue = 0; // Equal objects must hash the same. - double tickLocationAsDouble = CPTDecimalDoubleValue(self.tickLocation); + double tickLocationAsDouble = self.tickLocation.doubleValue; - if ( !isnan(tickLocationAsDouble) ) { - hashValue = (NSUInteger)lrint( fmod(ABS(tickLocationAsDouble), (double)NSUIntegerMax) ); + if ( !isnan(tickLocationAsDouble)) { + hashValue = (NSUInteger)lrint(fmod(ABS(tickLocationAsDouble), (double)NSUIntegerMax)); } return hashValue; diff --git a/framework/Source/CPTAxisLabelGroup.m b/framework/Source/CPTAxisLabelGroup.m index 2603369a2..1693c7a78 100644 --- a/framework/Source/CPTAxisLabelGroup.m +++ b/framework/Source/CPTAxisLabelGroup.m @@ -15,7 +15,7 @@ -(void)display // nothing to draw } --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef __unused)context { // nothing to draw } diff --git a/framework/Source/CPTAxisLabelTests.m b/framework/Source/CPTAxisLabelTests.m index b3a5f85a6..ff3248137 100644 --- a/framework/Source/CPTAxisLabelTests.m +++ b/framework/Source/CPTAxisLabelTests.m @@ -1,11 +1,12 @@ -#import "CPTAxisLabel.h" #import "CPTAxisLabelTests.h" + +#import "CPTAxisLabel.h" #import "CPTBorderedLayer.h" #import "CPTMutableTextStyle.h" #import "CPTUtilities.h" #import -static const double precision = 1.0e-6; +static const CGFloat precision = CPTFloat(1.0e-6); @implementation CPTAxisLabelTests @@ -18,8 +19,8 @@ static CGPoint roundPoint(CGPoint position, CGSize contentSize, CGPoint anchor) CGPoint newAnchor = CGPointMake(contentSize.width * anchor.x, contentSize.height * anchor.y); - newPosition.x = ceil( position.x - newAnchor.x - CPTFloat(0.5) ) + newAnchor.x; - newPosition.y = ceil( position.y - newAnchor.y - CPTFloat(0.5) ) + newAnchor.y; + newPosition.x = ceil(position.x - newAnchor.x - CPTFloat(0.5)) + newAnchor.x; + newPosition.y = ceil(position.y - newAnchor.y - CPTFloat(0.5)) + newAnchor.y; return newPosition; } @@ -31,7 +32,12 @@ -(void)testPositionRelativeToViewPointRaisesForInvalidDirection @try { label = [[CPTAxisLabel alloc] initWithText:@"CPTAxisLabelTests-testPositionRelativeToViewPointRaisesForInvalidDirection" textStyle:[CPTTextStyle textStyle]]; - XCTAssertThrowsSpecificNamed([label positionRelativeToViewPoint:CGPointZero forCoordinate:CPTCoordinateX inDirection:INT_MAX], NSException, NSInvalidArgumentException, @"Should raise NSInvalidArgumentException for invalid direction (type CPTSign)"); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wassign-enum" + + XCTAssertThrowsSpecificNamed([label positionRelativeToViewPoint:CGPointZero forCoordinate:CPTCoordinateX inDirection:NSIntegerMax], NSException, NSInvalidArgumentException, @"Should raise NSInvalidArgumentException for invalid direction (type CPTSign)"); + +#pragma clang diagnostic pop } @finally { label = nil; @@ -59,8 +65,8 @@ -(void)testPositionRelativeToViewPointPositionsForXCoordinate CGPoint newPosition = roundPoint(CGPointMake(start - label.offset, start), contentSize, contentLayer.anchorPoint); - XCTAssertEqualWithAccuracy( contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); - XCTAssertEqualWithAccuracy( contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); + XCTAssertEqualWithAccuracy(contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); + XCTAssertEqualWithAccuracy(contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.x, CPTFloat(1.0), precision, @"Should anchor at (1.0, 0.5)"); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.y, CPTFloat(0.5), precision, @"Should anchor at (1.0, 0.5)"); @@ -72,8 +78,8 @@ -(void)testPositionRelativeToViewPointPositionsForXCoordinate newPosition = roundPoint(CGPointMake(start - label.offset, start), contentSize, contentLayer.anchorPoint); - XCTAssertEqualWithAccuracy( contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); - XCTAssertEqualWithAccuracy( contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); + XCTAssertEqualWithAccuracy(contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); + XCTAssertEqualWithAccuracy(contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.x, CPTFloat(1.0), precision, @"Should anchor at (1.0, 0.5)"); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.y, CPTFloat(0.5), precision, @"Should anchor at (1.0, 0.5)"); @@ -85,8 +91,8 @@ -(void)testPositionRelativeToViewPointPositionsForXCoordinate newPosition = roundPoint(CGPointMake(start + label.offset, start), contentSize, contentLayer.anchorPoint); - XCTAssertEqualWithAccuracy( contentLayer.position.x, newPosition.x, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); - XCTAssertEqualWithAccuracy( contentLayer.position.y, newPosition.y, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); + XCTAssertEqualWithAccuracy(contentLayer.position.x, newPosition.x, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); + XCTAssertEqualWithAccuracy(contentLayer.position.y, newPosition.y, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.x, CPTFloat(0.0), precision, @"Should anchor at (0.0, 0.5)"); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.y, CPTFloat(0.5), precision, @"Should anchor at (0.0, 0.5)"); } @@ -116,8 +122,8 @@ -(void)testPositionRelativeToViewPointPositionsForYCoordinate CGPoint newPosition = roundPoint(CGPointMake(start, start - label.offset), contentSize, contentLayer.anchorPoint); - XCTAssertEqualWithAccuracy( contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); - XCTAssertEqualWithAccuracy( contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); + XCTAssertEqualWithAccuracy(contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); + XCTAssertEqualWithAccuracy(contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.x, CPTFloat(0.5), precision, @"Should anchor at (0.5, 1.0)"); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.y, CPTFloat(1.0), precision, @"Should anchor at (0.5, 1.0)"); @@ -129,8 +135,8 @@ -(void)testPositionRelativeToViewPointPositionsForYCoordinate newPosition = roundPoint(CGPointMake(start, start - label.offset), contentSize, contentLayer.anchorPoint); - XCTAssertEqualWithAccuracy( contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); - XCTAssertEqualWithAccuracy( contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); + XCTAssertEqualWithAccuracy(contentLayer.position.x, newPosition.x, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); + XCTAssertEqualWithAccuracy(contentLayer.position.y, newPosition.y, precision, @"Should add negative offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.x, CPTFloat(0.5), precision, @"Should anchor at (0.5, 1.0)"); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.y, CPTFloat(1.0), precision, @"Should anchor at (0.5, 1.0)"); @@ -142,8 +148,8 @@ -(void)testPositionRelativeToViewPointPositionsForYCoordinate newPosition = roundPoint(CGPointMake(start, start + label.offset), contentSize, contentLayer.anchorPoint); - XCTAssertEqualWithAccuracy( contentLayer.position.x, newPosition.x, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); - XCTAssertEqualWithAccuracy( contentLayer.position.y, newPosition.y, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition) ); + XCTAssertEqualWithAccuracy(contentLayer.position.x, newPosition.x, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); + XCTAssertEqualWithAccuracy(contentLayer.position.y, newPosition.y, precision, @"Should add positive offset, %@ != %@", CPTStringFromPoint(contentLayer.position), CPTStringFromPoint(newPosition)); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.x, CPTFloat(0.5), precision, @"Should anchor at (0.5, 0.0)"); XCTAssertEqualWithAccuracy(contentLayer.anchorPoint.y, CPTFloat(0.0), precision, @"Should anchor at (0.5, 0.0)"); } diff --git a/framework/Source/CPTAxisSet.h b/framework/Source/CPTAxisSet.h index e75cb05ae..93bf35cda 100644 --- a/framework/Source/CPTAxisSet.h +++ b/framework/Source/CPTAxisSet.h @@ -1,18 +1,18 @@ +#import "CPTAxis.h" #import "CPTLayer.h" -@class CPTAxis; @class CPTLineStyle; @interface CPTAxisSet : CPTLayer /// @name Axes /// @{ -@property (nonatomic, readwrite, strong) NSArray *axes; +@property (nonatomic, readwrite, strong, nullable) CPTAxisArray *axes; /// @} /// @name Drawing /// @{ -@property (nonatomic, readwrite, copy) CPTLineStyle *borderLineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *borderLineStyle; /// @} /// @name Labels @@ -22,7 +22,7 @@ /// @name Axes /// @{ --(CPTAxis *)axisForCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx; +-(nullable CPTAxis *)axisForCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx; /// @} @end diff --git a/framework/Source/CPTAxisSet.m b/framework/Source/CPTAxisSet.m index b9589a76c..0f37e6cb5 100644 --- a/framework/Source/CPTAxisSet.m +++ b/framework/Source/CPTAxisSet.m @@ -1,6 +1,5 @@ #import "CPTAxisSet.h" -#import "CPTAxis.h" #import "CPTGraph.h" #import "CPTLineStyle.h" #import "CPTPlotArea.h" @@ -10,12 +9,12 @@ **/ @implementation CPTAxisSet -/** @property NSArray *axes +/** @property nullable CPTAxisArray *axes * @brief The axes in the axis set. **/ @synthesize axes; -/** @property CPTLineStyle *borderLineStyle +/** @property nullable CPTLineStyle *borderLineStyle * @brief The line style for the layer border. * If @nil, the border is not drawn. **/ @@ -37,9 +36,9 @@ @implementation CPTAxisSet * @param newFrame The frame rectangle. * @return The initialized CPTAxisSet object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { axes = @[]; borderLineStyle = nil; @@ -52,9 +51,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTAxisSet *theLayer = (CPTAxisSet *)layer; axes = theLayer->axes; @@ -70,7 +69,7 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -78,17 +77,31 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeObject:self.borderLineStyle forKey:@"CPTAxisSet.borderLineStyle"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - axes = [[coder decodeObjectForKey:@"CPTAxisSet.axes"] copy]; - borderLineStyle = [[coder decodeObjectForKey:@"CPTAxisSet.borderLineStyle"] copy]; + if ((self = [super initWithCoder:coder])) { + axes = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTAxis class]]] + forKey:@"CPTAxisSet.axes"] copy]; + borderLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTAxisSet.borderLineStyle"] copy]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing @@ -111,7 +124,7 @@ -(void)display **/ -(void)relabelAxes { - NSArray *theAxes = self.axes; + CPTAxisArray *theAxes = self.axes; [theAxes makeObjectsPerformSelector:@selector(setNeedsLayout)]; [theAxes makeObjectsPerformSelector:@selector(setNeedsRelabel)]; @@ -130,7 +143,7 @@ -(void)relabelAxes * @param idx The zero-based index. * @return The axis matching the given coordinate and index, or @nil if no match is found. **/ --(CPTAxis *)axisForCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx +-(nullable CPTAxis *)axisForCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx { CPTAxis *foundAxis = nil; NSUInteger count = 0; @@ -169,7 +182,7 @@ -(CPTAxis *)axisForCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { for ( CPTAxis *axis in self.axes ) { if ( [axis pointingDeviceDownEvent:event atPoint:interactionPoint] ) { @@ -193,7 +206,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { for ( CPTAxis *axis in self.axes ) { if ( [axis pointingDeviceUpEvent:event atPoint:interactionPoint] ) { @@ -211,7 +224,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio /// @cond --(void)setAxes:(NSArray *)newAxes +-(void)setAxes:(nullable CPTAxisArray *)newAxes { if ( newAxes != axes ) { for ( CPTAxis *axis in axes ) { @@ -232,7 +245,7 @@ -(void)setAxes:(NSArray *)newAxes } } --(void)setBorderLineStyle:(CPTLineStyle *)newLineStyle +-(void)setBorderLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( newLineStyle != borderLineStyle ) { borderLineStyle = [newLineStyle copy]; diff --git a/framework/Source/CPTAxisTitle.m b/framework/Source/CPTAxisTitle.m index d3aab919f..99b26a321 100644 --- a/framework/Source/CPTAxisTitle.m +++ b/framework/Source/CPTAxisTitle.m @@ -13,14 +13,13 @@ @implementation CPTAxisTitle #pragma mark - #pragma mark Init/Dealloc -/// @name Initialization -/// @{ +/// @cond --(instancetype)initWithContentLayer:(CPTLayer *)layer +-(nonnull instancetype)initWithContentLayer:(nonnull CPTLayer *)layer { if ( layer ) { - if ( (self = [super initWithContentLayer:layer]) ) { - self.rotation = NAN; + if ((self = [super initWithContentLayer:layer])) { + self.rotation = CPTNAN; } } else { @@ -29,7 +28,7 @@ -(instancetype)initWithContentLayer:(CPTLayer *)layer return self; } -/// @} +/// @endcond #pragma mark - #pragma mark Label comparison @@ -42,7 +41,7 @@ -(instancetype)initWithContentLayer:(CPTLayer *)layer * @param object The object to be compared with the receiver. * @return @YES if @par{object} is equal to the receiver, @NO otherwise. **/ --(BOOL)isEqual:(id)object +-(BOOL)isEqual:(nullable id)object { if ( self == object ) { return YES; @@ -50,13 +49,21 @@ -(BOOL)isEqual:(id)object else if ( [object isKindOfClass:[self class]] ) { CPTAxisTitle *otherTitle = object; - if ( (self.rotation != otherTitle.rotation) || (self.offset != otherTitle.offset) ) { + if ((self.rotation != otherTitle.rotation) || (self.offset != otherTitle.offset)) { return NO; } if ( ![self.contentLayer isEqual:otherTitle] ) { return NO; } - return CPTDecimalEquals(self.tickLocation, ( (CPTAxisLabel *)object ).tickLocation); + + NSNumber *location = ((CPTAxisLabel *)object).tickLocation; + + if ( location ) { + return [self.tickLocation isEqualToNumber:location]; + } + else { + return NO; + } } else { return NO; @@ -72,13 +79,13 @@ -(NSUInteger)hash NSUInteger hashValue = 0; // Equal objects must hash the same. - double tickLocationAsDouble = CPTDecimalDoubleValue(self.tickLocation); + double tickLocationAsDouble = self.tickLocation.doubleValue; - if ( !isnan(tickLocationAsDouble) ) { - hashValue = (NSUInteger)lrint( fmod(ABS(tickLocationAsDouble), (double)NSUIntegerMax) ); + if ( !isnan(tickLocationAsDouble)) { + hashValue = (NSUInteger)lrint(fmod(ABS(tickLocationAsDouble), (double)NSUIntegerMax)); } - hashValue += (NSUInteger)lrint( fmod(ABS(self.rotation), (double)NSUIntegerMax) ); - hashValue += (NSUInteger)lrint( fmod(ABS(self.offset), (double)NSUIntegerMax) ); + hashValue += (NSUInteger)lrint(fmod(ABS(self.rotation), (double)NSUIntegerMax)); + hashValue += (NSUInteger)lrint(fmod(ABS(self.offset), (double)NSUIntegerMax)); return hashValue; } diff --git a/framework/Source/CPTBarPlot.h b/framework/Source/CPTBarPlot.h index 7b21832b7..282fd873d 100644 --- a/framework/Source/CPTBarPlot.h +++ b/framework/Source/CPTBarPlot.h @@ -1,25 +1,31 @@ #import "CPTDefinitions.h" +#import "CPTFill.h" +#import "CPTLineStyle.h" #import "CPTPlot.h" /// @file -@class CPTLineStyle; @class CPTMutableNumericData; @class CPTNumericData; -@class CPTFill; @class CPTPlotRange; @class CPTColor; @class CPTBarPlot; @class CPTTextLayer; @class CPTTextStyle; +/** + * @brief Bar plot bindings. + **/ +typedef NSString *CPTBarPlotBinding cpt_swift_struct; + /// @ingroup plotBindingsBarPlot /// @{ -extern NSString *const CPTBarPlotBindingBarLocations; -extern NSString *const CPTBarPlotBindingBarTips; -extern NSString *const CPTBarPlotBindingBarBases; -extern NSString *const CPTBarPlotBindingBarFills; -extern NSString *const CPTBarPlotBindingBarLineStyles; +extern CPTBarPlotBinding __nonnull const CPTBarPlotBindingBarLocations; +extern CPTBarPlotBinding __nonnull const CPTBarPlotBindingBarTips; +extern CPTBarPlotBinding __nonnull const CPTBarPlotBindingBarBases; +extern CPTBarPlotBinding __nonnull const CPTBarPlotBindingBarFills; +extern CPTBarPlotBinding __nonnull const CPTBarPlotBindingBarLineStyles; +extern CPTBarPlotBinding __nonnull const CPTBarPlotBindingBarWidths; /// @} /** @@ -47,7 +53,7 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { * @param indexRange The range of the data indexes of interest. * @return An array of bar fills. **/ --(NSArray *)barFillsForBarPlot:(CPTBarPlot *)barPlot recordIndexRange:(NSRange)indexRange; +-(nullable CPTFillArray *)barFillsForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a bar fill for the given bar plot. * This method will not be called if @@ -58,14 +64,14 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { * @return The bar fill for the bar with the given index. If the data source returns @nil, the default fill is used. * If the data source returns an NSNull object, no fill is drawn. **/ --(CPTFill *)barFillForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)idx; +-(nullable CPTFill *)barFillForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndex:(NSUInteger)idx; /** @brief @optional Gets an array of bar line styles for the given bar plot. * @param barPlot The bar plot. * @param indexRange The range of the data indexes of interest. * @return An array of line styles. **/ --(NSArray *)barLineStylesForBarPlot:(CPTBarPlot *)barPlot recordIndexRange:(NSRange)indexRange; +-(nullable CPTLineStyleArray *)barLineStylesForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a bar line style for the given bar plot. * This method will not be called if @@ -76,7 +82,24 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { * @return The bar line style for the bar with the given index. If the data source returns @nil, the default line style is used. * If the data source returns an NSNull object, no line is drawn. **/ --(CPTLineStyle *)barLineStyleForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)idx; +-(nullable CPTLineStyle *)barLineStyleForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndex:(NSUInteger)idx; + +/** @brief @optional Gets an array of bar widths for the given bar plot. + * @param barPlot The bar plot. + * @param indexRange The range of the data indexes of interest. + * @return An array of bar widths. + **/ +-(nullable CPTNumberArray *)barWidthsForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndexRange:(NSRange)indexRange; + +/** @brief @optional Gets a bar width for the given bar plot. + * This method will not be called if + * @link CPTBarPlotDataSource::barWidthsForBarPlot:recordIndexRange: -barWidthsForBarPlot:recordIndexRange: @endlink + * is also implemented in the datasource. + * @param barPlot The bar plot. + * @param idx The data index of interest. + * @return The bar width for the bar with the given index. If the data source returns @nil, the default barWidth is used. + **/ +-(nullable NSNumber *)barWidthForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndex:(NSUInteger)idx; /// @} @@ -88,14 +111,14 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { * @param idx The data index of interest. * @return The title text for the legend entry for the point with the given index. **/ --(NSString *)legendTitleForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)idx; +-(nullable NSString *)legendTitleForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndex:(NSUInteger)idx; /** @brief @optional Gets the styled legend title for the given bar plot bar. * @param barPlot The bar plot. * @param idx The data index of interest. * @return The styled title text for the legend entry for the point with the given index. **/ --(NSAttributedString *)attributedLegendTitleForBarPlot:(CPTBarPlot *)barPlot recordIndex:(NSUInteger)idx; +-(nullable NSAttributedString *)attributedLegendTitleForBarPlot:(nonnull CPTBarPlot *)barPlot recordIndex:(NSUInteger)idx; /// @} @end @@ -121,7 +144,7 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { * @if MacOnly clicked bar. @endif * @if iOSOnly touched bar. @endif **/ --(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)idx; +-(void)barPlot:(nonnull CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a bar * @if MacOnly was both pressed and released. @endif @@ -133,7 +156,7 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { * @if iOSOnly touched bar. @endif * @param event The event that triggered the selection. **/ --(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)barPlot:(nonnull CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a bar * @if MacOnly was pressed. @endif @@ -143,7 +166,7 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { * @if MacOnly clicked bar. @endif * @if iOSOnly touched bar. @endif **/ --(void)barPlot:(CPTBarPlot *)plot barTouchDownAtRecordIndex:(NSUInteger)idx; +-(void)barPlot:(nonnull CPTBarPlot *)plot barTouchDownAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a bar * @if MacOnly was pressed. @endif @@ -154,7 +177,7 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { * @if iOSOnly touched bar. @endif * @param event The event that triggered the selection. **/ --(void)barPlot:(CPTBarPlot *)plot barTouchDownAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)barPlot:(nonnull CPTBarPlot *)plot barTouchDownAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a bar * @if MacOnly was released. @endif @@ -164,7 +187,7 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { * @if MacOnly clicked bar. @endif * @if iOSOnly touched bar. @endif **/ --(void)barPlot:(CPTBarPlot *)plot barTouchUpAtRecordIndex:(NSUInteger)idx; +-(void)barPlot:(nonnull CPTBarPlot *)plot barTouchUpAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a bar * @if MacOnly was released. @endif @@ -175,7 +198,7 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { * @if iOSOnly touched bar. @endif * @param event The event that triggered the selection. **/ --(void)barPlot:(CPTBarPlot *)plot barTouchUpAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)barPlot:(nonnull CPTBarPlot *)plot barTouchUpAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /// @} @@ -188,32 +211,30 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { /// @name Appearance /// @{ @property (nonatomic, readwrite, assign) BOOL barWidthsAreInViewCoordinates; -@property (nonatomic, readwrite, assign) NSDecimal barWidth; -@property (nonatomic, readwrite, assign) CGFloat barWidthScale; -@property (nonatomic, readwrite, assign) NSDecimal barOffset; -@property (nonatomic, readwrite, assign) CGFloat barOffsetScale; +@property (nonatomic, readwrite, strong, nonnull) NSNumber *barWidth; +@property (nonatomic, readwrite, strong, nonnull) NSNumber *barOffset; @property (nonatomic, readwrite, assign) CGFloat barCornerRadius; @property (nonatomic, readwrite, assign) CGFloat barBaseCornerRadius; @property (nonatomic, readwrite, assign) BOOL barsAreHorizontal; -@property (nonatomic, readwrite, assign) NSDecimal baseValue; +@property (nonatomic, readwrite, strong, nonnull) NSNumber *baseValue; @property (nonatomic, readwrite, assign) BOOL barBasesVary; -@property (nonatomic, readwrite, copy) CPTPlotRange *plotRange; +@property (nonatomic, readwrite, copy, nullable) CPTPlotRange *plotRange; /// @} /// @name Drawing /// @{ -@property (nonatomic, readwrite, copy) CPTLineStyle *lineStyle; -@property (nonatomic, readwrite, copy) CPTFill *fill; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *lineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTFill *fill; /// @} /// @name Factory Methods /// @{ -+(instancetype)tubularBarPlotWithColor:(CPTColor *)color horizontalBars:(BOOL)horizontal; ++(nonnull instancetype)tubularBarPlotWithColor:(nonnull CPTColor *)color horizontalBars:(BOOL)horizontal; /// @} /// @name Data Ranges /// @{ --(CPTPlotRange *)plotRangeEnclosingBars; +-(nullable CPTPlotRange *)plotRangeEnclosingBars; /// @} /// @name Bar Style @@ -222,6 +243,8 @@ typedef NS_ENUM (NSInteger, CPTBarPlotField) { -(void)reloadBarFillsInIndexRange:(NSRange)indexRange; -(void)reloadBarLineStyles; -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange; +-(void)reloadBarWidths; +-(void)reloadBarWidthsInIndexRange:(NSRange)indexRange; /// @} @end diff --git a/framework/Source/CPTBarPlot.m b/framework/Source/CPTBarPlot.m index 155016a88..e667773e3 100644 --- a/framework/Source/CPTBarPlot.m +++ b/framework/Source/CPTBarPlot.m @@ -2,7 +2,6 @@ #import "CPTColor.h" #import "CPTExceptions.h" -#import "CPTFill.h" #import "CPTGradient.h" #import "CPTLegend.h" #import "CPTMutableLineStyle.h" @@ -28,33 +27,36 @@ * @endif **/ -NSString *const CPTBarPlotBindingBarLocations = @"barLocations"; ///< Bar locations. -NSString *const CPTBarPlotBindingBarTips = @"barTips"; ///< Bar tips. -NSString *const CPTBarPlotBindingBarBases = @"barBases"; ///< Bar bases. -NSString *const CPTBarPlotBindingBarFills = @"barFills"; ///< Bar fills. -NSString *const CPTBarPlotBindingBarLineStyles = @"barLineStyles"; ///< Bar line styles. +CPTBarPlotBinding const CPTBarPlotBindingBarLocations = @"barLocations"; ///< Bar locations. +CPTBarPlotBinding const CPTBarPlotBindingBarTips = @"barTips"; ///< Bar tips. +CPTBarPlotBinding const CPTBarPlotBindingBarBases = @"barBases"; ///< Bar bases. +CPTBarPlotBinding const CPTBarPlotBindingBarFills = @"barFills"; ///< Bar fills. +CPTBarPlotBinding const CPTBarPlotBindingBarLineStyles = @"barLineStyles"; ///< Bar line styles. +CPTBarPlotBinding const CPTBarPlotBindingBarWidths = @"barWidths"; ///< Bar widths. /// @cond @interface CPTBarPlot() -@property (nonatomic, readwrite, copy) NSArray *barLocations; -@property (nonatomic, readwrite, copy) NSArray *barTips; -@property (nonatomic, readwrite, copy) NSArray *barBases; -@property (nonatomic, readwrite, copy) NSArray *barFills; -@property (nonatomic, readwrite, copy) NSArray *barLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *barLocations; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *barTips; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *barBases; +@property (nonatomic, readwrite, copy, nullable) CPTFillArray *barFills; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *barLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *barWidths; @property (nonatomic, readwrite, assign) NSUInteger pointingDeviceDownIndex; --(BOOL)barAtRecordIndex:(NSUInteger)idx basePoint:(CGPoint *)basePoint tipPoint:(CGPoint *)tipPoint; --(CGMutablePathRef)newBarPathWithContext:(CGContextRef)context recordIndex:(NSUInteger)recordIndex; --(CGMutablePathRef)newBarPathWithContext:(CGContextRef)context basePoint:(CGPoint)basePoint tipPoint:(CGPoint)tipPoint; --(CPTFill *)barFillForIndex:(NSUInteger)idx; --(CPTLineStyle *)barLineStyleForIndex:(NSUInteger)idx; --(void)drawBarInContext:(CGContextRef)context recordIndex:(NSUInteger)idx; +-(BOOL)barAtRecordIndex:(NSUInteger)idx basePoint:(nonnull CGPoint *)basePoint tipPoint:(nonnull CGPoint *)tipPoint; +-(nullable CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context recordIndex:(NSUInteger)recordIndex; +-(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context basePoint:(CGPoint)basePoint tipPoint:(CGPoint)tipPoint width:(NSNumber *)width; +-(nullable CPTFill *)barFillForIndex:(NSUInteger)idx; +-(nullable CPTLineStyle *)barLineStyleForIndex:(NSUInteger)idx; +-(nonnull NSNumber *)barWidthForIndex:(NSUInteger)idx; +-(void)drawBarInContext:(nonnull CGContextRef)context recordIndex:(NSUInteger)idx; -(CGFloat)lengthInView:(NSDecimal)plotLength; -(double)doubleLengthInPlotCoordinates:(NSDecimal)decimalLength; --(BOOL)barIsVisibleWithBasePoint:(CGPoint)basePoint; +-(BOOL)barIsVisibleWithBasePoint:(CGPoint)basePoint width:(NSNumber *)width; @end @@ -76,6 +78,7 @@ @implementation CPTBarPlot @dynamic barBases; @dynamic barFills; @dynamic barLineStyles; +@dynamic barWidths; /** @property CGFloat barCornerRadius * @brief The corner radius for the end of the bars. Default is @num{0.0} for square corners. @@ -89,16 +92,11 @@ @implementation CPTBarPlot **/ @synthesize barBaseCornerRadius; -/** @property NSDecimal barOffset +/** @property nonnull NSNumber *barOffset * @brief The starting offset of the first bar in location data units. - **/ -@synthesize barOffset; - -/** @property CGFloat barOffsetScale - * @brief An animatable scaling factor for the bar offset. Default is @num{1.0}. * @ingroup plotAnimationBarPlot **/ -@synthesize barOffsetScale; +@synthesize barOffset; /** @property BOOL barWidthsAreInViewCoordinates * @brief Whether the bar width and bar offset is in view coordinates, or in plot coordinates. @@ -106,7 +104,7 @@ @implementation CPTBarPlot **/ @synthesize barWidthsAreInViewCoordinates; -/** @property NSDecimal barWidth +/** @property nonnull NSNumber *barWidth * @brief The width of each bar. Either view or plot coordinates can be used. * * With plot coordinates, the bar locations are one data unit apart (e.g., 1, 2, 3, etc.), @@ -114,22 +112,17 @@ @implementation CPTBarPlot * as the gap between them. * * @see barWidthsAreInViewCoordinates - **/ -@synthesize barWidth; - -/** @property CGFloat barWidthScale - * @brief An animatable scaling factor for the bar width. Default is @num{1.0}. * @ingroup plotAnimationBarPlot **/ -@synthesize barWidthScale; +@synthesize barWidth; -/** @property CPTLineStyle *lineStyle +/** @property nullable CPTLineStyle *lineStyle * @brief The line style for the bar outline. * If @nil, the outline is not drawn. **/ @synthesize lineStyle; -/** @property CPTFill *fill +/** @property nullable CPTFill *fill * @brief The fill style for the bars. * If @nil, the bars are not filled. **/ @@ -140,10 +133,11 @@ @implementation CPTBarPlot **/ @synthesize barsAreHorizontal; -/** @property NSDecimal baseValue +/** @property nonnull NSNumber *baseValue * @brief The coordinate value of the fixed end of the bars. * This is only used if @ref barBasesVary is @NO. Otherwise, the data source * will be queried for an appropriate value of #CPTBarPlotFieldBarBase. + * @ingroup plotAnimationBarPlot **/ @synthesize baseValue; @@ -154,7 +148,7 @@ @implementation CPTBarPlot **/ @synthesize barBasesVary; -/** @property CPTPlotRange *plotRange +/** @property nullable CPTPlotRange *plotRange * @brief Sets the plot range for the independent axis. * * If a plot range is provided, the bars are spaced evenly throughout the plot range. If @ref plotRange is @nil, @@ -178,9 +172,9 @@ @implementation CPTBarPlot * @param horizontal If @YES, the bars will have a horizontal orientation, otherwise they will be vertical. * @return A new CPTBarPlot instance initialized with a linear gradient bar fill. **/ -+(instancetype)tubularBarPlotWithColor:(CPTColor *)color horizontalBars:(BOOL)horizontal ++(nonnull instancetype)tubularBarPlotWithColor:(nonnull CPTColor *)color horizontalBars:(BOOL)horizontal { - CPTBarPlot *barPlot = [[CPTBarPlot alloc] init]; + CPTBarPlot *barPlot = [[self alloc] init]; CPTMutableLineStyle *barLineStyle = [[CPTMutableLineStyle alloc] init]; barLineStyle.lineWidth = CPTFloat(1.0); @@ -188,7 +182,7 @@ +(instancetype)tubularBarPlotWithColor:(CPTColor *)color horizontalBars:(BOOL)ho barPlot.lineStyle = barLineStyle; barPlot.barsAreHorizontal = horizontal; - barPlot.barWidth = CPTDecimalFromDouble(0.8); + barPlot.barWidth = @0.8; barPlot.barCornerRadius = CPTFloat(2.0); CPTGradient *fillGradient = [CPTGradient gradientWithBeginningColor:color endingColor:[CPTColor blackColor]]; @@ -205,7 +199,7 @@ +(instancetype)tubularBarPlotWithColor:(CPTColor *)color horizontalBars:(BOOL)ho /// @cond -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else +(void)initialize { @@ -215,8 +209,10 @@ +(void)initialize [self exposeBinding:CPTBarPlotBindingBarBases]; [self exposeBinding:CPTBarPlotBindingBarFills]; [self exposeBinding:CPTBarPlotBindingBarLineStyles]; + [self exposeBinding:CPTBarPlotBindingBarWidths]; } } + #endif /// @endcond @@ -230,10 +226,8 @@ +(void)initialize * - @ref lineStyle = default line style * - @ref fill = solid black fill * - @ref barWidth = @num{0.5} - * - @ref barWidthScale = @num{1.0} * - @ref barWidthsAreInViewCoordinates = @NO * - @ref barOffset = @num{0.0} - * - @ref barOffsetScale = @num{1.0} * - @ref barCornerRadius = @num{0.0} * - @ref barBaseCornerRadius = @num{0.0} * - @ref baseValue = @num{0} @@ -246,19 +240,17 @@ +(void)initialize * @param newFrame The frame rectangle. * @return The initialized CPTBarPlot object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { lineStyle = [[CPTLineStyle alloc] init]; fill = [CPTFill fillWithColor:[CPTColor blackColor]]; - barWidth = CPTDecimalFromDouble(0.5); - barWidthScale = CPTFloat(1.0); + barWidth = @0.5; barWidthsAreInViewCoordinates = NO; - barOffset = CPTDecimalFromDouble(0.0); - barOffsetScale = CPTFloat(1.0); + barOffset = @0.0; barCornerRadius = CPTFloat(0.0); barBaseCornerRadius = CPTFloat(0.0); - baseValue = CPTDecimalFromInteger(0); + baseValue = @0.0; barsAreHorizontal = NO; barBasesVary = NO; plotRange = nil; @@ -274,18 +266,16 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTBarPlot *theLayer = (CPTBarPlot *)layer; lineStyle = theLayer->lineStyle; fill = theLayer->fill; barWidth = theLayer->barWidth; - barWidthScale = theLayer->barWidthScale; barWidthsAreInViewCoordinates = theLayer->barWidthsAreInViewCoordinates; barOffset = theLayer->barOffset; - barOffsetScale = theLayer->barOffsetScale; barCornerRadius = theLayer->barCornerRadius; barBaseCornerRadius = theLayer->barBaseCornerRadius; baseValue = theLayer->baseValue; @@ -304,19 +294,17 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; [coder encodeObject:self.lineStyle forKey:@"CPTBarPlot.lineStyle"]; [coder encodeObject:self.fill forKey:@"CPTBarPlot.fill"]; - [coder encodeDecimal:self.barWidth forKey:@"CPTBarPlot.barWidth"]; - [coder encodeCGFloat:self.barWidthScale forKey:@"CPTBarPlot.barWidthScale"]; - [coder encodeDecimal:self.barOffset forKey:@"CPTBarPlot.barOffset"]; - [coder encodeCGFloat:self.barOffsetScale forKey:@"CPTBarPlot.barOffsetScale"]; + [coder encodeObject:self.barWidth forKey:@"CPTBarPlot.barWidth"]; + [coder encodeObject:self.barOffset forKey:@"CPTBarPlot.barOffset"]; [coder encodeCGFloat:self.barCornerRadius forKey:@"CPTBarPlot.barCornerRadius"]; [coder encodeCGFloat:self.barBaseCornerRadius forKey:@"CPTBarPlot.barBaseCornerRadius"]; - [coder encodeDecimal:self.baseValue forKey:@"CPTBarPlot.baseValue"]; + [coder encodeObject:self.baseValue forKey:@"CPTBarPlot.baseValue"]; [coder encodeBool:self.barsAreHorizontal forKey:@"CPTBarPlot.barsAreHorizontal"]; [coder encodeBool:self.barBasesVary forKey:@"CPTBarPlot.barBasesVary"]; [coder encodeBool:self.barWidthsAreInViewCoordinates forKey:@"CPTBarPlot.barWidthsAreInViewCoordinates"]; @@ -326,29 +314,50 @@ -(void)encodeWithCoder:(NSCoder *)coder // pointingDeviceDownIndex } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - lineStyle = [[coder decodeObjectForKey:@"CPTBarPlot.lineStyle"] copy]; - fill = [[coder decodeObjectForKey:@"CPTBarPlot.fill"] copy]; - barWidth = [coder decodeDecimalForKey:@"CPTBarPlot.barWidth"]; - barWidthScale = [coder decodeCGFloatForKey:@"CPTBarPlot.barWidthScale"]; - barOffset = [coder decodeDecimalForKey:@"CPTBarPlot.barOffset"]; - barOffsetScale = [coder decodeCGFloatForKey:@"CPTBarPlot.barOffsetScale"]; - barCornerRadius = [coder decodeCGFloatForKey:@"CPTBarPlot.barCornerRadius"]; - barBaseCornerRadius = [coder decodeCGFloatForKey:@"CPTBarPlot.barBaseCornerRadius"]; - baseValue = [coder decodeDecimalForKey:@"CPTBarPlot.baseValue"]; + if ((self = [super initWithCoder:coder])) { + NSNumber *num; + + lineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTBarPlot.lineStyle"] copy]; + fill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTBarPlot.fill"] copy]; + num = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTBarPlot.barWidth"]; + barWidth = num ? num : @0.0; + num = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTBarPlot.barOffset"]; + barOffset = num ? num : @0.0; + barCornerRadius = [coder decodeCGFloatForKey:@"CPTBarPlot.barCornerRadius"]; + barBaseCornerRadius = [coder decodeCGFloatForKey:@"CPTBarPlot.barBaseCornerRadius"]; + num = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTBarPlot.baseValue"]; + baseValue = num ? num : @0.0; barsAreHorizontal = [coder decodeBoolForKey:@"CPTBarPlot.barsAreHorizontal"]; barBasesVary = [coder decodeBoolForKey:@"CPTBarPlot.barBasesVary"]; barWidthsAreInViewCoordinates = [coder decodeBoolForKey:@"CPTBarPlot.barWidthsAreInViewCoordinates"]; - plotRange = [[coder decodeObjectForKey:@"CPTBarPlot.plotRange"] copy]; - pointingDeviceDownIndex = NSNotFound; + plotRange = [[coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTBarPlot.plotRange"] copy]; + pointingDeviceDownIndex = NSNotFound; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Data Loading @@ -364,6 +373,9 @@ -(void)reloadDataInIndexRange:(NSRange)indexRange // Bar line styles [self reloadBarLineStylesInIndexRange:indexRange]; + // Bar widths + [self reloadBarWidthsInIndexRange:indexRange]; + // Legend id theDataSource = (id)self.dataSource; @@ -402,7 +414,7 @@ -(void)reloadPlotDataInIndexRange:(NSRange)indexRange CPTMutableNumericData *locationData = nil; if ( self.doublePrecisionCache ) { locationData = [[CPTMutableNumericData alloc] initWithData:[NSData data] - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()) shape:nil]; locationData.shape = @[@(indexRange.length)]; @@ -421,16 +433,16 @@ -(void)reloadPlotDataInIndexRange:(NSRange)indexRange } else { locationData = [[CPTMutableNumericData alloc] initWithData:[NSData data] - dataType:CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent()) shape:nil]; locationData.shape = @[@(indexRange.length)]; NSDecimal delta = CPTDecimalFromInteger(1); if ( indexRange.length > 1 ) { - delta = CPTDecimalDivide( self.plotRange.length, CPTDecimalFromUnsignedInteger(indexRange.length - 1) ); + delta = CPTDecimalDivide(self.plotRange.lengthDecimal, CPTDecimalFromUnsignedInteger(indexRange.length - 1)); } - NSDecimal locationDecimal = self.plotRange.location; + NSDecimal locationDecimal = self.plotRange.locationDecimal; NSDecimal *dataBytes = (NSDecimal *)locationData.mutableBytes; NSDecimal *dataEnd = dataBytes + indexRange.length; while ( dataBytes < dataEnd ) { @@ -450,7 +462,7 @@ -(void)reloadPlotDataInIndexRange:(NSRange)indexRange CPTMutableNumericData *locationData = nil; if ( self.doublePrecisionCache ) { locationData = [[CPTMutableNumericData alloc] initWithData:[NSData data] - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()) shape:nil]; locationData.shape = @[@(indexRange.length)]; @@ -464,7 +476,7 @@ -(void)reloadPlotDataInIndexRange:(NSRange)indexRange } else { locationData = [[CPTMutableNumericData alloc] initWithData:[NSData data] - dataType:CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent()) shape:nil]; locationData.shape = @[@(indexRange.length)]; @@ -511,9 +523,9 @@ -(void)reloadBarFillsInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(barFillForBarPlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableFillArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTFill *dataSourceFill = [theDataSource barFillForBarPlot:self recordIndex:idx]; @@ -525,7 +537,9 @@ -(void)reloadBarFillsInIndexRange:(NSRange)indexRange } } - [self cacheArray:array forKey:CPTBarPlotBindingBarFills atRecordIndex:indexRange.location]; + [self cacheArray:array + forKey:CPTBarPlotBindingBarFills + atRecordIndex:indexRange.location]; } // Legend @@ -563,9 +577,9 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(barLineStyleForBarPlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableLineStyleArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTLineStyle *dataSourceLineStyle = [theDataSource barLineStyleForBarPlot:self recordIndex:idx]; @@ -577,7 +591,9 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange } } - [self cacheArray:array forKey:CPTBarPlotBindingBarLineStyles atRecordIndex:indexRange.location]; + [self cacheArray:array + forKey:CPTBarPlotBindingBarLineStyles + atRecordIndex:indexRange.location]; } // Legend @@ -588,6 +604,49 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange [self setNeedsDisplay]; } +/** + * @brief Reload all bar widths from the data source immediately. + **/ +-(void)reloadBarWidths +{ + [self reloadBarWidthsInIndexRange:NSMakeRange(0, self.cachedDataCount)]; +} + +/** @brief Reload bar widths in the given index range from the data source immediately. + * @param indexRange The index range to load. + **/ +-(void)reloadBarWidthsInIndexRange:(NSRange)indexRange +{ + id theDataSource = (id)self.dataSource; + + if ( [theDataSource respondsToSelector:@selector(barWidthsForBarPlot:recordIndexRange:)] ) { + [self cacheArray:[theDataSource barWidthsForBarPlot:self recordIndexRange:indexRange] + forKey:CPTBarPlotBindingBarWidths + atRecordIndex:indexRange.location]; + } + else if ( [theDataSource respondsToSelector:@selector(barWidthForBarPlot:recordIndex:)] ) { + id nilObject = [CPTPlot nilData]; + CPTMutableNumberArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); + + for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { + NSNumber *width = [theDataSource barWidthForBarPlot:self recordIndex:idx]; + if ( width ) { + [array addObject:width]; + } + else { + [array addObject:nilObject]; + } + } + + [self cacheArray:array + forKey:CPTBarPlotBindingBarWidths + atRecordIndex:indexRange.location]; + } + + [self setNeedsDisplay]; +} + #pragma mark - #pragma mark Length Conversions for Independent Coordinate (e.g., widths, offsets) @@ -603,8 +662,8 @@ -(CGFloat)lengthInView:(NSDecimal)decimalLength else { CPTCoordinate coordinate = (self.barsAreHorizontal ? CPTCoordinateY : CPTCoordinateX); CPTXYPlotSpace *thePlotSpace = (CPTXYPlotSpace *)self.plotSpace; - NSDecimal xLocation = thePlotSpace.xRange.location; - NSDecimal yLocation = thePlotSpace.yRange.location; + NSDecimal xLocation = thePlotSpace.xRange.locationDecimal; + NSDecimal yLocation = thePlotSpace.yRange.locationDecimal; NSDecimal originPlotPoint[2]; NSDecimal displacedPlotPoint[2]; @@ -653,8 +712,8 @@ -(double)doubleLengthInPlotCoordinates:(NSDecimal)decimalLength double length; if ( self.barWidthsAreInViewCoordinates ) { - CGFloat floatLength = CPTDecimalCGFloatValue(decimalLength); - CGPoint originViewPoint = CGPointZero; + CGFloat floatLength = CPTDecimalCGFloatValue(decimalLength); + CGPoint originViewPoint = CGPointZero; CGPoint displacedViewPoint = CPTPointMake(floatLength, floatLength); double originPlotPoint[2], displacedPlotPoint[2]; CPTPlotSpace *thePlotSpace = self.plotSpace; @@ -678,8 +737,8 @@ -(NSDecimal)lengthInPlotCoordinates:(NSDecimal)decimalLength NSDecimal length; if ( self.barWidthsAreInViewCoordinates ) { - CGFloat floatLength = CPTDecimalCGFloatValue(decimalLength); - CGPoint originViewPoint = CGPointZero; + CGFloat floatLength = CPTDecimalCGFloatValue(decimalLength); + CGPoint originViewPoint = CGPointZero; CGPoint displacedViewPoint = CPTPointMake(floatLength, floatLength); NSDecimal originPlotPoint[2], displacedPlotPoint[2]; CPTPlotSpace *thePlotSpace = self.plotSpace; @@ -705,7 +764,7 @@ -(NSDecimal)lengthInPlotCoordinates:(NSDecimal)decimalLength /// @cond --(CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord +-(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord { CPTPlotRange *range = [super plotRangeForCoordinate:coord]; @@ -713,10 +772,10 @@ -(CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord switch ( coord ) { case CPTCoordinateX: if ( self.barsAreHorizontal ) { - NSDecimal base = self.baseValue; + NSDecimal base = self.baseValue.decimalValue; if ( ![range contains:base] ) { CPTMutablePlotRange *newRange = [range mutableCopy]; - [newRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:base length:CPTDecimalFromInteger(0)]]; + [newRange unionPlotRange:[CPTPlotRange plotRangeWithLocationDecimal:base lengthDecimal:CPTDecimalFromInteger(0)]]; range = newRange; } } @@ -724,10 +783,10 @@ -(CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord case CPTCoordinateY: if ( !self.barsAreHorizontal ) { - NSDecimal base = self.baseValue; + NSDecimal base = self.baseValue.decimalValue; if ( ![range contains:base] ) { CPTMutablePlotRange *newRange = [range mutableCopy]; - [newRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:base length:CPTDecimalFromInteger(0)]]; + [newRange unionPlotRange:[CPTPlotRange plotRangeWithLocationDecimal:base lengthDecimal:CPTDecimalFromInteger(0)]]; range = newRange; } } @@ -740,6 +799,27 @@ -(CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord return range; } +-(nullable CPTPlotRange *)plotRangeEnclosingField:(NSUInteger)fieldEnum +{ + CPTPlotRange *range = nil; + + switch ( fieldEnum ) { + case CPTBarPlotFieldBarLocation: + range = [self plotRangeEnclosingBars]; + break; + + case CPTBarPlotFieldBarTip: + case CPTBarPlotFieldBarBase: + range = [self plotRangeForField:fieldEnum]; + break; + + default: + break; + } + + return range; +} + /// @endcond /** @brief Computes a plot range that completely encloses all of the bars. @@ -750,7 +830,7 @@ -(CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord * * @return A plot range that completely encloses all of the bars. **/ --(CPTPlotRange *)plotRangeEnclosingBars +-(nullable CPTPlotRange *)plotRangeEnclosingBars { BOOL horizontalBars = self.barsAreHorizontal; CPTMutablePlotRange *range; @@ -762,22 +842,24 @@ -(CPTPlotRange *)plotRangeEnclosingBars range = [[self plotRangeForCoordinate:CPTCoordinateX] mutableCopy]; } - NSDecimal barOffsetLength = [self lengthInPlotCoordinates:self.barOffset]; - NSDecimal barWidthLength = [self lengthInPlotCoordinates:self.barWidth]; - NSDecimal halfBarWidth = CPTDecimalDivide( barWidthLength, CPTDecimalFromInteger(2) ); + NSDecimal barOffsetLength = [self lengthInPlotCoordinates:self.barOffset.decimalValue]; + NSDecimal barWidthLength = [self lengthInPlotCoordinates:self.barWidth.decimalValue]; + NSDecimal halfBarWidth = CPTDecimalDivide(barWidthLength, CPTDecimalFromInteger(2)); - NSDecimal rangeLocation = range.location; - NSDecimal rangeLength = range.length; + NSDecimal rangeLocation = range.locationDecimal; + NSDecimal rangeLength = range.lengthDecimal; - if ( CPTDecimalGreaterThanOrEqualTo( rangeLength, CPTDecimalFromInteger(0) ) ) { - rangeLocation = CPTDecimalSubtract(rangeLocation, halfBarWidth); - range.location = CPTDecimalAdd(rangeLocation, barOffsetLength); - range.length = CPTDecimalAdd(rangeLength, barWidthLength); + if ( CPTDecimalGreaterThanOrEqualTo(rangeLength, CPTDecimalFromInteger(0))) { + rangeLocation = CPTDecimalSubtract(rangeLocation, halfBarWidth); + + range.locationDecimal = CPTDecimalAdd(rangeLocation, barOffsetLength); + range.lengthDecimal = CPTDecimalAdd(rangeLength, barWidthLength); } else { - rangeLocation = CPTDecimalAdd(rangeLocation, halfBarWidth); - range.location = CPTDecimalSubtract(rangeLocation, barOffsetLength); - range.length = CPTDecimalSubtract(rangeLength, barWidthLength); + rangeLocation = CPTDecimalAdd(rangeLocation, halfBarWidth); + + range.locationDecimal = CPTDecimalSubtract(rangeLocation, barOffsetLength); + range.lengthDecimal = CPTDecimalSubtract(rangeLength, barWidthLength); } return range; @@ -788,7 +870,7 @@ -(CPTPlotRange *)plotRangeEnclosingBars /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden ) { return; @@ -796,13 +878,13 @@ -(void)renderAsVectorInContext:(CGContextRef)context CPTMutableNumericData *cachedLocations = [self cachedNumbersForField:CPTBarPlotFieldBarLocation]; CPTMutableNumericData *cachedLengths = [self cachedNumbersForField:CPTBarPlotFieldBarTip]; - if ( (cachedLocations == nil) || (cachedLengths == nil) ) { + if ((cachedLocations == nil) || (cachedLengths == nil)) { return; } BOOL basesVary = self.barBasesVary; CPTMutableNumericData *cachedBases = [self cachedNumbersForField:CPTBarPlotFieldBarBase]; - if ( basesVary && (cachedBases == nil) ) { + if ( basesVary && (cachedBases == nil)) { return; } @@ -815,7 +897,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context [NSException raise:CPTException format:@"Number of bar locations and lengths do not match"]; } - if ( basesVary && (cachedLengths.numberOfSamples != cachedBases.numberOfSamples) ) { + if ( basesVary && (cachedLengths.numberOfSamples != cachedBases.numberOfSamples)) { [NSException raise:CPTException format:@"Number of bar lengths and bases do not match"]; } @@ -831,7 +913,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context CGContextEndTransparencyLayer(context); } --(BOOL)barAtRecordIndex:(NSUInteger)idx basePoint:(CGPoint *)basePoint tipPoint:(CGPoint *)tipPoint +-(BOOL)barAtRecordIndex:(NSUInteger)idx basePoint:(nonnull CGPoint *)basePoint tipPoint:(nonnull CGPoint *)tipPoint { BOOL horizontalBars = self.barsAreHorizontal; CPTCoordinate independentCoord = (horizontalBars ? CPTCoordinateY : CPTCoordinateX); @@ -842,25 +924,25 @@ -(BOOL)barAtRecordIndex:(NSUInteger)idx basePoint:(CGPoint *)basePoint tipPoint: if ( self.doublePrecisionCache ) { double plotPoint[2]; plotPoint[independentCoord] = [self cachedDoubleForField:CPTBarPlotFieldBarLocation recordIndex:idx]; - if ( isnan(plotPoint[independentCoord]) ) { + if ( isnan(plotPoint[independentCoord])) { return NO; } // Tip point plotPoint[dependentCoord] = [self cachedDoubleForField:CPTBarPlotFieldBarTip recordIndex:idx]; - if ( isnan(plotPoint[dependentCoord]) ) { + if ( isnan(plotPoint[dependentCoord])) { return NO; } *tipPoint = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; // Base point if ( !self.barBasesVary ) { - plotPoint[dependentCoord] = CPTDecimalDoubleValue(self.baseValue); + plotPoint[dependentCoord] = self.baseValue.doubleValue; } else { plotPoint[dependentCoord] = [self cachedDoubleForField:CPTBarPlotFieldBarBase recordIndex:idx]; } - if ( isnan(plotPoint[dependentCoord]) ) { + if ( isnan(plotPoint[dependentCoord])) { return NO; } *basePoint = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; @@ -868,32 +950,32 @@ -(BOOL)barAtRecordIndex:(NSUInteger)idx basePoint:(CGPoint *)basePoint tipPoint: else { NSDecimal plotPoint[2]; plotPoint[independentCoord] = [self cachedDecimalForField:CPTBarPlotFieldBarLocation recordIndex:idx]; - if ( NSDecimalIsNotANumber(&plotPoint[independentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[independentCoord])) { return NO; } // Tip point plotPoint[dependentCoord] = [self cachedDecimalForField:CPTBarPlotFieldBarTip recordIndex:idx]; - if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord])) { return NO; } *tipPoint = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; // Base point if ( !self.barBasesVary ) { - plotPoint[dependentCoord] = self.baseValue; + plotPoint[dependentCoord] = self.baseValue.decimalValue; } else { plotPoint[dependentCoord] = [self cachedDecimalForField:CPTBarPlotFieldBarBase recordIndex:idx]; } - if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord])) { return NO; } *basePoint = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; } // Determine bar width and offset. - CGFloat barOffsetLength = [self lengthInView:self.barOffset] * self.barOffsetScale; + CGFloat barOffsetLength = [self lengthInView:self.barOffset.decimalValue]; // Offset if ( horizontalBars ) { @@ -908,7 +990,7 @@ -(BOOL)barAtRecordIndex:(NSUInteger)idx basePoint:(CGPoint *)basePoint tipPoint: return YES; } --(CGMutablePathRef)newBarPathWithContext:(CGContextRef)context recordIndex:(NSUInteger)recordIndex +-(nullable CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context recordIndex:(NSUInteger)recordIndex { // Get base and tip points CGPoint basePoint, tipPoint; @@ -918,18 +1000,23 @@ -(CGMutablePathRef)newBarPathWithContext:(CGContextRef)context recordIndex:(NSUI return NULL; } - CGMutablePathRef path = [self newBarPathWithContext:context basePoint:basePoint tipPoint:tipPoint]; + NSNumber *width = [self barWidthForIndex:recordIndex]; + + CGMutablePathRef path = [self newBarPathWithContext:context + basePoint:basePoint + tipPoint:tipPoint + width:width]; return path; } --(CGMutablePathRef)newBarPathWithContext:(CGContextRef)context basePoint:(CGPoint)basePoint tipPoint:(CGPoint)tipPoint +-(nonnull CGMutablePathRef)newBarPathWithContext:(nullable CGContextRef)context basePoint:(CGPoint)basePoint tipPoint:(CGPoint)tipPoint width:(NSNumber *)width { // This function is used to create a path which is used for both // drawing a bar and for doing hit-testing on a click/touch event BOOL horizontalBars = self.barsAreHorizontal; - CGFloat barWidthLength = [self lengthInView:self.barWidth] * self.barWidthScale; + CGFloat barWidthLength = [self lengthInView:width.decimalValue]; CGFloat halfBarWidth = CPTFloat(0.5) * barWidthLength; CGRect barRect; @@ -956,29 +1043,31 @@ -(CGMutablePathRef)newBarPathWithContext:(CGContextRef)context basePoint:(CGPoin barRect.size.width = round(barRect.size.width * roundingPrecision) / roundingPrecision; barRect.size.height = round(barRect.size.height * roundingPrecision) / roundingPrecision; - if ( self.lineStyle.lineWidth > 0.0 ) { - barRect = CPTAlignRectToUserSpace(context, barRect); + CGContextRef theContext = context; + + if ( self.lineStyle.lineWidth > CPTFloat(0.0)) { + barRect = CPTAlignRectToUserSpace(theContext, barRect); } else { - barRect = CPTAlignIntegralRectToUserSpace(context, barRect); + barRect = CPTAlignIntegralRectToUserSpace(theContext, barRect); } } - CGFloat radius = MIN( MIN( self.barCornerRadius, ABS(barRect.size.width) * CPTFloat(0.5) ), ABS(barRect.size.height) * CPTFloat(0.5) ); - CGFloat baseRadius = MIN( MIN( self.barBaseCornerRadius, ABS(barRect.size.width) * CPTFloat(0.5) ), ABS(barRect.size.height) * CPTFloat(0.5) ); + CGFloat radius = MIN(MIN(self.barCornerRadius, ABS(barRect.size.width) * CPTFloat(0.5)), ABS(barRect.size.height) * CPTFloat(0.5)); + CGFloat baseRadius = MIN(MIN(self.barBaseCornerRadius, ABS(barRect.size.width) * CPTFloat(0.5)), ABS(barRect.size.height) * CPTFloat(0.5)); - if ( widthNegative && (barRect.size.width > 0.0) ) { + if ( widthNegative && (barRect.size.width > CPTFloat(0.0))) { barRect.origin.x += barRect.size.width; barRect.size.width = -barRect.size.width; } - if ( heightNegative && (barRect.size.height > 0.0) ) { + if ( heightNegative && (barRect.size.height > CPTFloat(0.0))) { barRect.origin.y += barRect.size.height; barRect.size.height = -barRect.size.height; } CGMutablePathRef path = CGPathCreateMutable(); - if ( radius == 0.0 ) { - if ( baseRadius == 0.0 ) { + if ( radius == CPTFloat(0.0)) { + if ( baseRadius == CPTFloat(0.0)) { // square corners CGPathAddRect(path, NULL, barRect); } @@ -1006,7 +1095,7 @@ -(CGMutablePathRef)newBarPathWithContext:(CGContextRef)context basePoint:(CGPoin CGFloat tipX = barRect.origin.x + barRect.size.width; CGFloat tipY = barRect.origin.y + barRect.size.height; - if ( baseRadius == 0.0 ) { + if ( baseRadius == CPTFloat(0.0)) { // rounded at tip end only CGPathMoveToPoint(path, NULL, barRect.origin.x, barRect.origin.y); if ( horizontalBars ) { @@ -1024,14 +1113,14 @@ -(CGMutablePathRef)newBarPathWithContext:(CGContextRef)context basePoint:(CGPoin else { // rounded at both ends if ( horizontalBars ) { - CGPathMoveToPoint( path, NULL, barRect.origin.x, CGRectGetMidY(barRect) ); + CGPathMoveToPoint(path, NULL, barRect.origin.x, CGRectGetMidY(barRect)); CGPathAddArcToPoint(path, NULL, barRect.origin.x, tipY, CGRectGetMidX(barRect), tipY, baseRadius); CGPathAddArcToPoint(path, NULL, tipX, tipY, tipX, CGRectGetMidY(barRect), radius); CGPathAddArcToPoint(path, NULL, tipX, barRect.origin.y, CGRectGetMidX(barRect), barRect.origin.y, radius); CGPathAddArcToPoint(path, NULL, barRect.origin.x, barRect.origin.y, barRect.origin.x, CGRectGetMidY(barRect), baseRadius); } else { - CGPathMoveToPoint( path, NULL, barRect.origin.x, CGRectGetMidY(barRect) ); + CGPathMoveToPoint(path, NULL, barRect.origin.x, CGRectGetMidY(barRect)); CGPathAddArcToPoint(path, NULL, barRect.origin.x, tipY, CGRectGetMidX(barRect), tipY, radius); CGPathAddArcToPoint(path, NULL, tipX, tipY, tipX, CGRectGetMidY(barRect), radius); CGPathAddArcToPoint(path, NULL, tipX, barRect.origin.y, CGRectGetMidX(barRect), barRect.origin.y, baseRadius); @@ -1044,44 +1133,55 @@ -(CGMutablePathRef)newBarPathWithContext:(CGContextRef)context basePoint:(CGPoin return path; } --(BOOL)barIsVisibleWithBasePoint:(CGPoint)basePoint +-(BOOL)barIsVisibleWithBasePoint:(CGPoint)basePoint width:(NSNumber *)width { BOOL horizontalBars = self.barsAreHorizontal; - CGFloat barWidthLength = [self lengthInView:self.barWidth] * self.barWidthScale; + CGFloat barWidthLength = [self lengthInView:width.decimalValue]; CGFloat halfBarWidth = CPTFloat(0.5) * barWidthLength; CPTPlotArea *thePlotArea = self.plotArea; - CGFloat lowerBound = ( horizontalBars ? CGRectGetMinY(thePlotArea.bounds) : CGRectGetMinX(thePlotArea.bounds) ); - CGFloat upperBound = ( horizontalBars ? CGRectGetMaxY(thePlotArea.bounds) : CGRectGetMaxX(thePlotArea.bounds) ); + CGFloat lowerBound = (horizontalBars ? CGRectGetMinY(thePlotArea.bounds) : CGRectGetMinX(thePlotArea.bounds)); + CGFloat upperBound = (horizontalBars ? CGRectGetMaxY(thePlotArea.bounds) : CGRectGetMaxX(thePlotArea.bounds)); CGFloat base = (horizontalBars ? basePoint.y : basePoint.x); return (base + halfBarWidth >= lowerBound) && (base - halfBarWidth <= upperBound); } --(CPTFill *)barFillForIndex:(NSUInteger)idx +-(nullable CPTFill *)barFillForIndex:(NSUInteger)idx { CPTFill *theBarFill = [self cachedValueForKey:CPTBarPlotBindingBarFills recordIndex:idx]; - if ( (theBarFill == nil) || (theBarFill == [CPTPlot nilData]) ) { + if ((theBarFill == nil) || (theBarFill == [CPTPlot nilData])) { theBarFill = self.fill; } return theBarFill; } --(CPTLineStyle *)barLineStyleForIndex:(NSUInteger)idx +-(nullable CPTLineStyle *)barLineStyleForIndex:(NSUInteger)idx { CPTLineStyle *theBarLineStyle = [self cachedValueForKey:CPTBarPlotBindingBarLineStyles recordIndex:idx]; - if ( (theBarLineStyle == nil) || (theBarLineStyle == [CPTPlot nilData]) ) { + if ((theBarLineStyle == nil) || (theBarLineStyle == [CPTPlot nilData])) { theBarLineStyle = self.lineStyle; } return theBarLineStyle; } --(void)drawBarInContext:(CGContextRef)context recordIndex:(NSUInteger)idx +-(nonnull NSNumber *)barWidthForIndex:(NSUInteger)idx +{ + NSNumber *theBarWidth = [self cachedValueForKey:CPTBarPlotBindingBarWidths recordIndex:idx]; + + if ((theBarWidth == nil) || (theBarWidth == [CPTPlot nilData])) { + theBarWidth = self.barWidth; + } + + return theBarWidth; +} + +-(void)drawBarInContext:(nonnull CGContextRef)context recordIndex:(NSUInteger)idx { // Get base and tip points CGPoint basePoint, tipPoint; @@ -1091,12 +1191,17 @@ -(void)drawBarInContext:(CGContextRef)context recordIndex:(NSUInteger)idx return; } + NSNumber *width = [self barWidthForIndex:idx]; + // Return if bar is off screen - if ( ![self barIsVisibleWithBasePoint:basePoint] ) { + if ( ![self barIsVisibleWithBasePoint:basePoint width:width] ) { return; } - CGMutablePathRef path = [self newBarPathWithContext:context basePoint:basePoint tipPoint:tipPoint]; + CGMutablePathRef path = [self newBarPathWithContext:context + basePoint:basePoint + tipPoint:tipPoint + width:width]; if ( path ) { CGContextSaveGState(context); @@ -1122,7 +1227,7 @@ -(void)drawBarInContext:(CGContextRef)context recordIndex:(NSUInteger)idx } } --(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(CGContextRef)context +-(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(nonnull CGContextRef)context { [super drawSwatchForLegend:legend atIndex:idx inRect:rect inContext:context]; @@ -1156,16 +1261,17 @@ -(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(C /// @cond -+(BOOL)needsDisplayForKey:(NSString *)aKey ++(BOOL)needsDisplayForKey:(nonnull NSString *)aKey { - static NSSet *keys = nil; + static NSSet *keys = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ keys = [NSSet setWithArray:@[@"barCornerRadius", @"barBaseCornerRadius", - @"barOffsetScale", - @"barWidthScale"]]; + @"barOffset", + @"barWidth", + @"baseValue"]]; }); if ( [keys containsObject:aKey] ) { @@ -1183,12 +1289,12 @@ +(BOOL)needsDisplayForKey:(NSString *)aKey /// @cond --(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx +-(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx { NSDecimal theBaseDecimalValue; if ( !self.barBasesVary ) { - theBaseDecimalValue = self.baseValue; + theBaseDecimalValue = self.baseValue.decimalValue; } else { theBaseDecimalValue = [self cachedDecimalForField:CPTBarPlotFieldBarBase recordIndex:idx]; @@ -1197,21 +1303,21 @@ -(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInte NSNumber *location = [self cachedNumberForField:CPTBarPlotFieldBarLocation recordIndex:idx]; NSNumber *length = [self cachedNumberForField:CPTBarPlotFieldBarTip recordIndex:idx]; - BOOL positiveDirection = CPTDecimalGreaterThanOrEqualTo([length decimalValue], theBaseDecimalValue); + BOOL positiveDirection = CPTDecimalGreaterThanOrEqualTo(length.decimalValue, theBaseDecimalValue); BOOL horizontalBars = self.barsAreHorizontal; CPTCoordinate coordinate = (horizontalBars ? CPTCoordinateX : CPTCoordinateY); CPTPlotRange *lengthRange = [self.plotSpace plotRangeForCoordinate:coordinate]; - if ( CPTDecimalLessThan( lengthRange.length, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalLessThan(lengthRange.lengthDecimal, CPTDecimalFromInteger(0))) { positiveDirection = !positiveDirection; } NSNumber *offsetLocation; if ( self.doublePrecisionCache ) { - offsetLocation = @([location doubleValue] + [self doubleLengthInPlotCoordinates:self.barOffset] * self.barOffsetScale); + offsetLocation = @(location.doubleValue + [self doubleLengthInPlotCoordinates:self.barOffset.decimalValue]); } else { - NSDecimal decimalLocation = [location decimalValue]; - NSDecimal offset = CPTDecimalMultiply( [self lengthInPlotCoordinates:self.barOffset], CPTDecimalFromCGFloat(self.barOffsetScale) ); + NSDecimal decimalLocation = location.decimalValue; + NSDecimal offset = [self lengthInPlotCoordinates:self.barOffset.decimalValue]; offsetLocation = [NSDecimalNumber decimalNumberWithDecimal:CPTDecimalAdd(decimalLocation, offset)]; } @@ -1271,7 +1377,7 @@ -(NSUInteger)numberOfLegendEntries * @param idx The index of the desired title. * @return The title of the legend entry at the requested index. **/ --(NSString *)titleForLegendEntryAtIndex:(NSUInteger)idx +-(nullable NSString *)titleForLegendEntryAtIndex:(NSUInteger)idx { NSString *legendTitle = nil; @@ -1292,7 +1398,7 @@ -(NSString *)titleForLegendEntryAtIndex:(NSUInteger)idx * @param idx The index of the desired title. * @return The styled title of the legend entry at the requested index. **/ --(NSAttributedString *)attributedTitleForLegendEntryAtIndex:(NSUInteger)idx +-(nullable NSAttributedString *)attributedTitleForLegendEntryAtIndex:(NSUInteger)idx { NSAttributedString *legendTitle = nil; @@ -1321,10 +1427,10 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point NSUInteger barCount = self.cachedDataCount; NSUInteger ii = 0; - while ( (ii < barCount) && (idx == NSNotFound) ) { + while ((ii < barCount) && (idx == NSNotFound)) { CGMutablePathRef path = [self newBarPathWithContext:NULL recordIndex:ii]; - if ( CGPathContainsPoint(path, NULL, point, false) ) { + if ( CGPathContainsPoint(path, NULL, point, false)) { idx = ii; } @@ -1359,7 +1465,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { CPTGraph *theGraph = self.graph; CPTPlotArea *thePlotArea = self.plotArea; @@ -1368,7 +1474,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(barPlot:barTouchDownAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(barPlot:barTouchDownAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(barPlot:barWasSelectedAtRecordIndex:)] || @@ -1424,7 +1530,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { NSUInteger selectedDownIndex = self.pointingDeviceDownIndex; @@ -1437,7 +1543,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(barPlot:barTouchUpAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(barPlot:barTouchUpAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(barPlot:barWasSelectedAtRecordIndex:)] || @@ -1487,59 +1593,59 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio /// @cond --(NSArray *)barTips +-(nullable CPTNumberArray *)barTips { return [[self cachedNumbersForField:CPTBarPlotFieldBarTip] sampleArray]; } --(void)setBarTips:(NSArray *)newTips +-(void)setBarTips:(nullable CPTNumberArray *)newTips { [self cacheNumbers:newTips forField:CPTBarPlotFieldBarTip]; } --(NSArray *)barBases +-(nullable CPTNumberArray *)barBases { return [[self cachedNumbersForField:CPTBarPlotFieldBarBase] sampleArray]; } --(void)setBarBases:(NSArray *)newBases +-(void)setBarBases:(nullable CPTNumberArray *)newBases { [self cacheNumbers:newBases forField:CPTBarPlotFieldBarBase]; } --(NSArray *)barLocations +-(nullable CPTNumberArray *)barLocations { return [[self cachedNumbersForField:CPTBarPlotFieldBarLocation] sampleArray]; } --(void)setBarLocations:(NSArray *)newLocations +-(void)setBarLocations:(nullable CPTNumberArray *)newLocations { [self cacheNumbers:newLocations forField:CPTBarPlotFieldBarLocation]; } --(NSArray *)barFills +-(nullable CPTFillArray *)barFills { return [self cachedArrayForKey:CPTBarPlotBindingBarFills]; } --(void)setBarFills:(NSArray *)newBarFills +-(void)setBarFills:(nullable CPTFillArray *)newBarFills { [self cacheArray:newBarFills forKey:CPTBarPlotBindingBarFills]; [self setNeedsDisplay]; } --(NSArray *)barLineStyles +-(nullable CPTLineStyleArray *)barLineStyles { return [self cachedArrayForKey:CPTBarPlotBindingBarLineStyles]; } --(void)setBarLineStyles:(NSArray *)newBarLineStyles +-(void)setBarLineStyles:(nullable CPTLineStyleArray *)newBarLineStyles { [self cacheArray:newBarLineStyles forKey:CPTBarPlotBindingBarLineStyles]; [self setNeedsDisplay]; } --(void)setLineStyle:(CPTLineStyle *)newLineStyle +-(void)setLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( lineStyle != newLineStyle ) { lineStyle = [newLineStyle copy]; @@ -1548,7 +1654,7 @@ -(void)setLineStyle:(CPTLineStyle *)newLineStyle } } --(void)setFill:(CPTFill *)newFill +-(void)setFill:(nullable CPTFill *)newFill { if ( fill != newFill ) { fill = [newFill copy]; @@ -1557,40 +1663,23 @@ -(void)setFill:(CPTFill *)newFill } } --(void)setBarWidth:(NSDecimal)newBarWidth +-(void)setBarWidth:(nonnull NSNumber *)newBarWidth { - if ( NSDecimalCompare(&barWidth, &newBarWidth) != NSOrderedSame ) { + if ( ![barWidth isEqualToNumber:newBarWidth] ) { barWidth = newBarWidth; [self setNeedsDisplay]; } } --(void)setBarWidthScale:(CGFloat)newBarWidthScale +-(void)setBarOffset:(nonnull NSNumber *)newBarOffset { - if ( barWidthScale != newBarWidthScale ) { - barWidthScale = newBarWidthScale; - [self setNeedsDisplay]; - } -} - --(void)setBarOffset:(NSDecimal)newBarOffset -{ - if ( NSDecimalCompare(&barOffset, &newBarOffset) != NSOrderedSame ) { + if ( ![barOffset isEqualToNumber:newBarOffset] ) { barOffset = newBarOffset; [self setNeedsDisplay]; [self repositionAllLabelAnnotations]; } } --(void)setBarOffsetScale:(CGFloat)newBarOffsetScale -{ - if ( barOffsetScale != newBarOffsetScale ) { - barOffsetScale = newBarOffsetScale; - [self setNeedsDisplay]; - [self repositionAllLabelAnnotations]; - } -} - -(void)setBarCornerRadius:(CGFloat)newCornerRadius { if ( barCornerRadius != newCornerRadius ) { @@ -1609,9 +1698,9 @@ -(void)setBarBaseCornerRadius:(CGFloat)newCornerRadius } } --(void)setBaseValue:(NSDecimal)newBaseValue +-(void)setBaseValue:(nonnull NSNumber *)newBaseValue { - if ( !CPTDecimalEquals(baseValue, newBaseValue) ) { + if ( ![baseValue isEqualToNumber:newBaseValue] ) { baseValue = newBaseValue; [self setNeedsDisplay]; [self setNeedsLayout]; @@ -1649,16 +1738,16 @@ -(NSUInteger)numberOfFields return 3; } --(NSArray *)fieldIdentifiers +-(nonnull CPTNumberArray *)fieldIdentifiers { return @[@(CPTBarPlotFieldBarLocation), @(CPTBarPlotFieldBarTip), @(CPTBarPlotFieldBarBase)]; } --(NSArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord +-(nonnull CPTNumberArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord { - NSArray *result = nil; + CPTNumberArray *result = nil; switch ( coord ) { case CPTCoordinateX: diff --git a/framework/Source/CPTBorderedLayer.h b/framework/Source/CPTBorderedLayer.h index 9af0114ac..617d7bd79 100644 --- a/framework/Source/CPTBorderedLayer.h +++ b/framework/Source/CPTBorderedLayer.h @@ -7,8 +7,8 @@ /// @name Drawing /// @{ -@property (nonatomic, readwrite, copy) CPTLineStyle *borderLineStyle; -@property (nonatomic, readwrite, copy) CPTFill *fill; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *borderLineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTFill *fill; /// @} /// @name Layout @@ -18,7 +18,7 @@ /// @name Drawing /// @{ --(void)renderBorderedLayerAsVectorInContext:(CGContextRef)context; +-(void)renderBorderedLayerAsVectorInContext:(nonnull CGContextRef)context; /// @} @end diff --git a/framework/Source/CPTBorderedLayer.m b/framework/Source/CPTBorderedLayer.m index 63910ba72..7a6126c00 100644 --- a/framework/Source/CPTBorderedLayer.m +++ b/framework/Source/CPTBorderedLayer.m @@ -1,16 +1,16 @@ #import "CPTBorderedLayer.h" +#import "_CPTBorderLayer.h" +#import "_CPTMaskLayer.h" #import "CPTFill.h" #import "CPTLineStyle.h" #import "CPTPathExtensions.h" -#import "_CPTBorderLayer.h" -#import "_CPTMaskLayer.h" /// @cond @interface CPTBorderedLayer() -@property (nonatomic, readonly) CPTLayer *borderLayer; +@property (nonatomic, readonly, nullable) CPTLayer *borderLayer; -(void)updateOpacity; @@ -27,14 +27,14 @@ -(void)updateOpacity; **/ @implementation CPTBorderedLayer -/** @property CPTLineStyle *borderLineStyle +/** @property nullable CPTLineStyle *borderLineStyle * @brief The line style for the layer border. * * If @nil, the border is not drawn. **/ @synthesize borderLineStyle; -/** @property CPTFill *fill +/** @property nullable CPTFill *fill * @brief The fill for the layer background. * * If @nil, the layer background is not filled. @@ -66,9 +66,9 @@ @implementation CPTBorderedLayer * @param newFrame The frame rectangle. * @return The initialized CPTBorderedLayer object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { borderLineStyle = nil; fill = nil; inLayout = NO; @@ -82,9 +82,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTBorderedLayer *theLayer = (CPTBorderedLayer *)layer; borderLineStyle = theLayer->borderLineStyle; @@ -101,7 +101,7 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -112,11 +112,13 @@ -(void)encodeWithCoder:(NSCoder *)coder // inLayout } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - borderLineStyle = [[coder decodeObjectForKey:@"CPTBorderedLayer.borderLineStyle"] copy]; - fill = [[coder decodeObjectForKey:@"CPTBorderedLayer.fill"] copy]; + if ((self = [super initWithCoder:coder])) { + borderLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTBorderedLayer.borderLineStyle"] copy]; + fill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTBorderedLayer.fill"] copy]; inLayout = NO; } @@ -125,12 +127,24 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden || self.masksToBorder ) { return; @@ -145,7 +159,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context /** @brief Draws the fill and border of a CPTBorderedLayer into the given graphics context. * @param context The graphics context to draw into. **/ --(void)renderBorderedLayerAsVectorInContext:(CGContextRef)context +-(void)renderBorderedLayerAsVectorInContext:(nonnull CGContextRef)context { if ( !self.backgroundColor || !self.useFastRendering ) { CPTFill *theFill = self.fill; @@ -169,7 +183,7 @@ -(void)renderBorderedLayerAsVectorInContext:(CGContextRef)context CGFloat radius = self.cornerRadius; - if ( radius > CPTFloat(0.0) ) { + if ( radius > CPTFloat(0.0)) { CGContextBeginPath(context); CPTAddRoundedRectPath(context, layerBounds, radius); [theLineStyle strokePathInContext:context]; @@ -192,13 +206,13 @@ -(void)renderBorderedLayerAsVectorInContext:(CGContextRef)context * @param right The right margin. * @param bottom The bottom margin. **/ --(void)sublayerMarginLeft:(CGFloat *)left top:(CGFloat *)top right:(CGFloat *)right bottom:(CGFloat *)bottom +-(void)sublayerMarginLeft:(nonnull CGFloat *)left top:(nonnull CGFloat *)top right:(nonnull CGFloat *)right bottom:(nonnull CGFloat *)bottom { [super sublayerMarginLeft:left top:top right:right bottom:bottom]; CGFloat inset = self.borderLineStyle.lineWidth * CPTFloat(0.5); - if ( inset > CPTFloat(0.0) ) { + if ( inset > CPTFloat(0.0)) { *left += inset; *top += inset; *right += inset; @@ -224,7 +238,7 @@ -(void)layoutSublayers /// @cond --(CGPathRef)maskingPath +-(nullable CGPathRef)maskingPath { if ( self.masksToBounds ) { CGPathRef path = self.outerBorderPath; @@ -246,7 +260,7 @@ -(CGPathRef)maskingPath } } --(CGPathRef)sublayerMaskingPath +-(nullable CGPathRef)sublayerMaskingPath { if ( self.masksToBorder ) { CGPathRef path = self.innerBorderPath; @@ -257,7 +271,7 @@ -(CGPathRef)sublayerMaskingPath CGFloat lineWidth = self.borderLineStyle.lineWidth; CGRect selfBounds = CGRectInset(self.bounds, lineWidth, lineWidth); - path = CPTCreateRoundedRectPath( selfBounds, self.cornerRadius - lineWidth * CPTFloat(0.5) ); + path = CPTCreateRoundedRectPath(selfBounds, self.cornerRadius - lineWidth * CPTFloat(0.5)); self.innerBorderPath = path; CGPathRelease(path); @@ -292,7 +306,7 @@ -(void)removeFromSuperlayer -(void)updateOpacity { - BOOL opaqueLayer = ( self.cornerRadius <= CPTFloat(0.0) ); + BOOL opaqueLayer = (self.cornerRadius <= CPTFloat(0.0)); CPTFill *theFill = self.fill; @@ -316,7 +330,7 @@ -(void)updateOpacity /// @cond --(void)setBorderLineStyle:(CPTLineStyle *)newLineStyle +-(void)setBorderLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( newLineStyle != borderLineStyle ) { if ( newLineStyle.lineWidth != borderLineStyle.lineWidth ) { @@ -333,13 +347,13 @@ -(void)setBorderLineStyle:(CPTLineStyle *)newLineStyle } } --(void)setFill:(CPTFill *)newFill +-(void)setFill:(nullable CPTFill *)newFill { if ( newFill != fill ) { fill = [newFill copy]; CPTLayer *border = self.borderLayer; - if ( self.cornerRadius != CPTFloat(0.0) ) { + if ( self.cornerRadius != CPTFloat(0.0)) { border.backgroundColor = NULL; } else { @@ -365,7 +379,7 @@ -(void)setCornerRadius:(CGFloat)newRadius -(void)setMasksToBorder:(BOOL)newMasksToBorder { if ( newMasksToBorder != self.masksToBorder ) { - [super setMasksToBorder:newMasksToBorder]; + super.masksToBorder = newMasksToBorder; if ( newMasksToBorder ) { CPTMaskLayer *maskLayer = [[CPTMaskLayer alloc] initWithFrame:self.bounds]; @@ -381,7 +395,7 @@ -(void)setMasksToBorder:(BOOL)newMasksToBorder } } --(CPTLayer *)borderLayer +-(nullable CPTLayer *)borderLayer { CPTLayer *theBorderLayer = nil; CPTBorderLayer *superLayer = (CPTBorderLayer *)self.superlayer; @@ -438,57 +452,57 @@ -(CPTLayer *)borderLayer -(void)setBounds:(CGRect)newBounds { if ( self.masksToBorder && !self.inLayout ) { - [self.borderLayer setBounds:newBounds]; + self.borderLayer.bounds = newBounds; } else { - [super setBounds:newBounds]; + super.bounds = newBounds; } } -(void)setPosition:(CGPoint)newPosition { if ( self.masksToBorder && !self.inLayout ) { - [self.borderLayer setPosition:newPosition]; + self.borderLayer.position = newPosition; } else { - [super setPosition:newPosition]; + super.position = newPosition; } } -(void)setAnchorPoint:(CGPoint)newAnchorPoint { if ( self.masksToBorder && !self.inLayout ) { - [self.borderLayer setAnchorPoint:newAnchorPoint]; + self.borderLayer.anchorPoint = newAnchorPoint; } else { - [super setAnchorPoint:newAnchorPoint]; + super.anchorPoint = newAnchorPoint; } } -(void)setHidden:(BOOL)newHidden { if ( self.masksToBorder ) { - [self.borderLayer setHidden:newHidden]; + self.borderLayer.hidden = newHidden; } else { - [super setHidden:newHidden]; + super.hidden = newHidden; } } -(void)setTransform:(CATransform3D)newTransform { if ( self.masksToBorder ) { - [self.borderLayer setTransform:newTransform]; + self.borderLayer.transform = newTransform; } else { - [super setTransform:newTransform]; + super.transform = newTransform; } } --(void)setShadow:(CPTShadow *)newShadow +-(void)setShadow:(nullable CPTShadow *)newShadow { if ( newShadow != self.shadow ) { - [super setShadow:newShadow]; + super.shadow = newShadow; if ( self.masksToBorder ) { self.borderLayer.shadow = newShadow; @@ -496,13 +510,13 @@ -(void)setShadow:(CPTShadow *)newShadow } } --(void)setBackgroundColor:(CGColorRef)newColor +-(void)setBackgroundColor:(nullable CGColorRef)newColor { if ( self.masksToBorder ) { - [self.borderLayer setBackgroundColor:newColor]; + self.borderLayer.backgroundColor = newColor; } else { - [super setBackgroundColor:newColor]; + super.backgroundColor = newColor; } } diff --git a/framework/Source/CPTCalendarFormatter.h b/framework/Source/CPTCalendarFormatter.h index f24fd09e8..89dc656ea 100644 --- a/framework/Source/CPTCalendarFormatter.h +++ b/framework/Source/CPTCalendarFormatter.h @@ -1,14 +1,14 @@ @interface CPTCalendarFormatter : NSNumberFormatter -@property (nonatomic, readwrite, strong) NSDateFormatter *dateFormatter; -@property (nonatomic, readwrite, copy) NSDate *referenceDate; -@property (nonatomic, readwrite, copy) NSCalendar *referenceCalendar; +@property (nonatomic, readwrite, strong, nullable) NSDateFormatter *dateFormatter; +@property (nonatomic, readwrite, copy, nullable) NSDate *referenceDate; +@property (nonatomic, readwrite, copy, nullable) NSCalendar *referenceCalendar; @property (nonatomic, readwrite, assign) NSCalendarUnit referenceCalendarUnit; /// @name Initialization /// @{ --(instancetype)initWithDateFormatter:(NSDateFormatter *)aDateFormatter NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithDateFormatter:(nullable NSDateFormatter *)aDateFormatter NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER; /// @} @end diff --git a/framework/Source/CPTCalendarFormatter.m b/framework/Source/CPTCalendarFormatter.m index 08168baa4..928263b4e 100644 --- a/framework/Source/CPTCalendarFormatter.m +++ b/framework/Source/CPTCalendarFormatter.m @@ -14,18 +14,18 @@ **/ @implementation CPTCalendarFormatter -/** @property NSDateFormatter *dateFormatter +/** @property nullable NSDateFormatter *dateFormatter * @brief The date formatter used to generate strings from date calculations. **/ @synthesize dateFormatter; -/** @property NSDate *referenceDate +/** @property nullable NSDate *referenceDate * @brief Date from which time intervals are computed. * If @nil, the standard reference date (1 January 2001, GMT) is used. **/ @synthesize referenceDate; -/** @property NSCalendar *referenceCalendar +/** @property nullable NSCalendar *referenceCalendar * @brief Calendar which is used for date calculations. * If @nil, the current calendar is used. **/ @@ -47,7 +47,7 @@ @implementation CPTCalendarFormatter * The default formatter uses @ref NSDateFormatterMediumStyle for dates and times. * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { NSDateFormatter *newDateFormatter = [[NSDateFormatter alloc] init]; @@ -65,9 +65,9 @@ -(instancetype)init * @param aDateFormatter The date formatter. * @return The new instance. **/ --(instancetype)initWithDateFormatter:(NSDateFormatter *)aDateFormatter +-(nonnull instancetype)initWithDateFormatter:(nullable NSDateFormatter *)aDateFormatter { - if ( (self = [super init]) ) { + if ((self = [super init])) { dateFormatter = aDateFormatter; referenceDate = nil; referenceCalendar = nil; @@ -81,7 +81,7 @@ -(instancetype)initWithDateFormatter:(NSDateFormatter *)aDateFormatter /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -97,13 +97,13 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { dateFormatter = [coder decodeObjectForKey:@"CPTCalendarFormatter.dateFormatter"]; referenceDate = [[coder decodeObjectForKey:@"CPTCalendarFormatter.referenceDate"] copy]; referenceCalendar = [[coder decodeObjectForKey:@"CPTCalendarFormatter.referenceCalendar"] copy]; - referenceCalendarUnit = (NSCalendarUnit)[coder decodeIntegerForKey : @"CPTCalendarFormatter.referenceCalendarUnit"]; + referenceCalendarUnit = (NSCalendarUnit)[coder decodeIntegerForKey:@"CPTCalendarFormatter.referenceCalendarUnit"]; } return self; } @@ -113,7 +113,7 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { CPTCalendarFormatter *newFormatter = [[CPTCalendarFormatter allocWithZone:zone] init]; @@ -142,7 +142,7 @@ -(id)copyWithZone:(NSZone *)zone * @param coordinateValue The time value. * @return The date string. **/ --(NSString *)stringForObjectValue:(id)coordinateValue +-(nullable NSString *)stringForObjectValue:(nullable id)coordinateValue { NSInteger componentIncrement = 0; diff --git a/framework/Source/CPTCalendarFormatterTests.h b/framework/Source/CPTCalendarFormatterTests.h new file mode 100644 index 000000000..21b6d4c2e --- /dev/null +++ b/framework/Source/CPTCalendarFormatterTests.h @@ -0,0 +1,5 @@ +#import "CPTTestCase.h" + +@interface CPTCalendarFormatterTests : CPTTestCase + +@end diff --git a/framework/Source/CPTCalendarFormatterTests.m b/framework/Source/CPTCalendarFormatterTests.m new file mode 100644 index 000000000..ce3a609d5 --- /dev/null +++ b/framework/Source/CPTCalendarFormatterTests.m @@ -0,0 +1,29 @@ +#import "CPTCalendarFormatterTests.h" + +#import "CPTCalendarFormatter.h" + +@implementation CPTCalendarFormatterTests + +#pragma mark - +#pragma mark NSCoding Methods + +-(void)testKeyedArchivingRoundTrip +{ + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + + NSDate *refDate = [dateFormatter dateFromString:@"12:00 Oct 29, 2009"]; + + dateFormatter.dateStyle = NSDateFormatterShortStyle; + + CPTCalendarFormatter *calendarFormatter = [[CPTCalendarFormatter alloc] initWithDateFormatter:dateFormatter]; + calendarFormatter.referenceDate = refDate; + + CPTCalendarFormatter *newCalendarFormatter = [self archiveRoundTrip:calendarFormatter]; + + XCTAssertEqualObjects(calendarFormatter.dateFormatter.dateFormat, newCalendarFormatter.dateFormatter.dateFormat, @"Date formatter not equal"); + XCTAssertEqualObjects(calendarFormatter.referenceDate, newCalendarFormatter.referenceDate, @"Reference date not equal"); + XCTAssertEqualObjects(calendarFormatter.referenceCalendar, newCalendarFormatter.referenceCalendar, @"Reference calendar not equal"); + XCTAssertEqual(calendarFormatter.referenceCalendarUnit, newCalendarFormatter.referenceCalendarUnit, @"Reference calendar unit not equal"); +} + +@end diff --git a/framework/Source/CPTColor.h b/framework/Source/CPTColor.h index 2ddfca1da..8ae9a7611 100644 --- a/framework/Source/CPTColor.h +++ b/framework/Source/CPTColor.h @@ -1,38 +1,65 @@ -@interface CPTColor : NSObject +#import "CPTPlatformSpecificDefines.h" -@property (nonatomic, readonly) CGColorRef cgColor; +@interface CPTColor : NSObject + +@property (nonatomic, readonly, nonnull) CGColorRef cgColor; @property (nonatomic, readonly, getter = isOpaque) BOOL opaque; +#if TARGET_OS_OSX +@property (nonatomic, readonly, nonnull) NSColor *nsColor; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE +@property (nonatomic, readonly, nonnull) UIColor *uiColor; +#endif +@property (nonatomic, readonly, nonnull) CPTNativeColor *nativeColor; + +/// @name Standard Colors +/// @{ ++(nonnull instancetype)clearColor; ++(nonnull instancetype)whiteColor; ++(nonnull instancetype)lightGrayColor; ++(nonnull instancetype)grayColor; ++(nonnull instancetype)darkGrayColor; ++(nonnull instancetype)blackColor; ++(nonnull instancetype)redColor; ++(nonnull instancetype)greenColor; ++(nonnull instancetype)blueColor; ++(nonnull instancetype)cyanColor; ++(nonnull instancetype)yellowColor; ++(nonnull instancetype)magentaColor; ++(nonnull instancetype)orangeColor; ++(nonnull instancetype)purpleColor; ++(nonnull instancetype)brownColor; +/// @} + /// @name Factory Methods /// @{ -+(instancetype)clearColor; -+(instancetype)whiteColor; -+(instancetype)lightGrayColor; -+(instancetype)grayColor; -+(instancetype)darkGrayColor; -+(instancetype)blackColor; -+(instancetype)redColor; -+(instancetype)greenColor; -+(instancetype)blueColor; -+(instancetype)cyanColor; -+(instancetype)yellowColor; -+(instancetype)magentaColor; -+(instancetype)orangeColor; -+(instancetype)purpleColor; -+(instancetype)brownColor; - -+(instancetype)colorWithCGColor:(CGColorRef)newCGColor; -+(instancetype)colorWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; -+(instancetype)colorWithGenericGray:(CGFloat)gray; ++(nonnull instancetype)colorWithCGColor:(nonnull CGColorRef)newCGColor; ++(nonnull instancetype)colorWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; ++(nonnull instancetype)colorWithGenericGray:(CGFloat)gray; + +#if TARGET_OS_OSX ++(nonnull instancetype)colorWithNSColor:(nonnull NSColor *)newNSColor; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE ++(nonnull instancetype)colorWithUIColor:(nonnull UIColor *)newUIColor; +#endif ++(nonnull instancetype)colorWithNativeColor:(nonnull CPTNativeColor *)newColor; + /// @} /// @name Initialization /// @{ --(instancetype)initWithCGColor:(CGColorRef)cgColor NS_DESIGNATED_INITIALIZER; --(instancetype)initWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; --(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithCGColor:(nonnull CGColorRef)cgColor NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER; + +#if TARGET_OS_OSX +-(nonnull instancetype)initWithNSColor:(nonnull NSColor *)newNSColor NS_DESIGNATED_INITIALIZER; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE +-(nonnull instancetype)initWithUIColor:(nonnull UIColor *)newUIColor NS_DESIGNATED_INITIALIZER; +#endif +-(nonnull instancetype)initWithNativeColor:(nonnull CPTNativeColor *)newColor; --(instancetype)colorWithAlphaComponent:(CGFloat)alpha; +-(nonnull instancetype)colorWithAlphaComponent:(CGFloat)alpha; /// @} @end diff --git a/framework/Source/CPTColor.m b/framework/Source/CPTColor.m index 96ff7e937..2be62efdf 100644 --- a/framework/Source/CPTColor.m +++ b/framework/Source/CPTColor.m @@ -2,8 +2,25 @@ #import "CPTColorSpace.h" #import "CPTDefinitions.h" +#import "CPTPlatformSpecificCategories.h" #import "NSCoderExtensions.h" +/// @cond + +@interface CPTColor() + +#if TARGET_OS_OSX +@property (nonatomic, readonly, nullable) NSColor *nsColorCache; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE +@property (nonatomic, readonly, nullable) UIColor *uiColorCache; +#endif + +@end + +/// @endcond + +#pragma mark - + /** @brief An immutable color. * * An immutable object wrapper class around @ref CGColorRef. @@ -13,24 +30,106 @@ **/ @implementation CPTColor -/** @property CGColorRef cgColor +#if TARGET_OS_OSX + +/** @internal + * @property nullable NSColor *nsColorCache + * @brief The NSColor to wrap around. + **/ +@synthesize nsColorCache; + +/** @property nonnull NSColor *nsColor + * @brief The NSColor to wrap around. + **/ +@dynamic nsColor; + +-(NSColor *)nsColor +{ + NSColor *theNSColor = self.nsColorCache; + + if ( theNSColor ) { + return theNSColor; + } + else { + return [NSColor colorWithCIColor:[CIColor colorWithCGColor:self.cgColor]]; + } +} + +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + +/** @internal + * @property nullable UIColor *uiColorCache + * @brief The UIColor to wrap around. + **/ +@synthesize uiColorCache; + +/** @property nonnull UIColor *uiColor + * @brief The UIColor to wrap around. + **/ +@dynamic uiColor; + +-(UIColor *)uiColor +{ + UIColor *theUIColor = self.uiColorCache; + + if ( theUIColor ) { + return theUIColor; + } + else { + return [UIColor colorWithCGColor:self.cgColor]; + } +} + +#endif + +/** @property nonnull CPTNativeColor *nativeColor + * @brief The platform-native color to wrap around. + **/ +@dynamic nativeColor; + +-(CPTNativeColor *)nativeColor +{ +#if TARGET_OS_OSX + return self.nsColor; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + return self.uiColor; +#endif +} + +/** @property nonnull CGColorRef cgColor * @brief The @ref CGColorRef to wrap around. **/ @synthesize cgColor; +-(CGColorRef)cgColor +{ +#if TARGET_OS_OSX + NSColor *theNSColor = self.nsColorCache; + if ( theNSColor ) { + return theNSColor.CGColor; + } +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + UIColor *theUIColor = self.uiColorCache; + if ( theUIColor ) { + return theUIColor.CGColor; + } +#endif + return cgColor; +} + /** @property BOOL opaque * @brief If @YES, the color is completely opaque. */ @dynamic opaque; #pragma mark - -#pragma mark Factory Methods +#pragma mark Standard Colors /** @brief Returns a shared instance of CPTColor initialized with a fully transparent color. * * @return A shared CPTColor object initialized with a fully transparent color. **/ -+(instancetype)clearColor ++(nonnull instancetype)clearColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; @@ -40,7 +139,7 @@ +(instancetype)clearColor CGColorRef clear = CGColorCreate([CPTColorSpace genericRGBSpace].cgColorSpace, values); - color = [[CPTColor alloc] initWithCGColor:clear]; + color = [[self alloc] initWithCGColor:clear]; CGColorRelease(clear); }); @@ -52,7 +151,7 @@ +(instancetype)clearColor * * @return A shared CPTColor object initialized with a fully opaque white color. **/ -+(instancetype)whiteColor ++(nonnull instancetype)whiteColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; @@ -68,7 +167,7 @@ +(instancetype)whiteColor * * @return A shared CPTColor object initialized with a fully opaque 67% gray color. **/ -+(instancetype)lightGrayColor ++(nonnull instancetype)lightGrayColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; @@ -84,7 +183,7 @@ +(instancetype)lightGrayColor * * @return A shared CPTColor object initialized with a fully opaque 50% gray color. **/ -+(instancetype)grayColor ++(nonnull instancetype)grayColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; @@ -100,7 +199,7 @@ +(instancetype)grayColor * * @return A shared CPTColor object initialized with a fully opaque 33% gray color. **/ -+(instancetype)darkGrayColor ++(nonnull instancetype)darkGrayColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; @@ -116,7 +215,7 @@ +(instancetype)darkGrayColor * * @return A shared CPTColor object initialized with a fully opaque black color. **/ -+(instancetype)blackColor ++(nonnull instancetype)blackColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; @@ -132,16 +231,16 @@ +(instancetype)blackColor * * @return A shared CPTColor object initialized with a fully opaque red color. **/ -+(instancetype)redColor ++(nonnull instancetype)redColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(1.0) - green:CPTFloat(0.0) - blue:CPTFloat(0.0) - alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(1.0) + green:CPTFloat(0.0) + blue:CPTFloat(0.0) + alpha:CPTFloat(1.0)]; }); return color; @@ -151,16 +250,16 @@ +(instancetype)redColor * * @return A shared CPTColor object initialized with a fully opaque green color. **/ -+(instancetype)greenColor ++(nonnull instancetype)greenColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(0.0) - green:CPTFloat(1.0) - blue:CPTFloat(0.0) - alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(0.0) + green:CPTFloat(1.0) + blue:CPTFloat(0.0) + alpha:CPTFloat(1.0)]; }); return color; @@ -170,16 +269,16 @@ +(instancetype)greenColor * * @return A shared CPTColor object initialized with a fully opaque blue color. **/ -+(instancetype)blueColor ++(nonnull instancetype)blueColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(0.0) - green:CPTFloat(0.0) - blue:CPTFloat(1.0) - alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(0.0) + green:CPTFloat(0.0) + blue:CPTFloat(1.0) + alpha:CPTFloat(1.0)]; }); return color; @@ -189,16 +288,16 @@ +(instancetype)blueColor * * @return A shared CPTColor object initialized with a fully opaque cyan color. **/ -+(instancetype)cyanColor ++(nonnull instancetype)cyanColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(0.0) - green:CPTFloat(1.0) - blue:CPTFloat(1.0) - alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(0.0) + green:CPTFloat(1.0) + blue:CPTFloat(1.0) + alpha:CPTFloat(1.0)]; }); return color; @@ -208,13 +307,13 @@ +(instancetype)cyanColor * * @return A shared CPTColor object initialized with a fully opaque yellow color. **/ -+(instancetype)yellowColor ++(nonnull instancetype)yellowColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(1.0) green:CPTFloat(1.0) blue:CPTFloat(0.0) alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(1.0) green:CPTFloat(1.0) blue:CPTFloat(0.0) alpha:CPTFloat(1.0)]; }); return color; @@ -224,12 +323,12 @@ +(instancetype)yellowColor * * @return A shared CPTColor object initialized with a fully opaque magenta color. **/ -+(instancetype)magentaColor ++(nonnull instancetype)magentaColor { static CPTColor *color = nil; if ( nil == color ) { - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(1.0) green:CPTFloat(0.0) blue:CPTFloat(1.0) alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(1.0) green:CPTFloat(0.0) blue:CPTFloat(1.0) alpha:CPTFloat(1.0)]; } return color; } @@ -238,13 +337,13 @@ +(instancetype)magentaColor * * @return A shared CPTColor object initialized with a fully opaque orange color. **/ -+(instancetype)orangeColor ++(nonnull instancetype)orangeColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(1.0) green:CPTFloat(0.5) blue:CPTFloat(0.0) alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(1.0) green:CPTFloat(0.5) blue:CPTFloat(0.0) alpha:CPTFloat(1.0)]; }); return color; @@ -254,13 +353,13 @@ +(instancetype)orangeColor * * @return A shared CPTColor object initialized with a fully opaque purple color. **/ -+(instancetype)purpleColor ++(nonnull instancetype)purpleColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(0.5) green:CPTFloat(0.0) blue:CPTFloat(0.5) alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(0.5) green:CPTFloat(0.0) blue:CPTFloat(0.5) alpha:CPTFloat(1.0)]; }); return color; @@ -270,25 +369,28 @@ +(instancetype)purpleColor * * @return A shared CPTColor object initialized with a fully opaque brown color. **/ -+(instancetype)brownColor ++(nonnull instancetype)brownColor { static CPTColor *color = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - color = [[CPTColor alloc] initWithComponentRed:CPTFloat(0.6) green:CPTFloat(0.4) blue:CPTFloat(0.2) alpha:CPTFloat(1.0)]; + color = [[self alloc] initWithComponentRed:CPTFloat(0.6) green:CPTFloat(0.4) blue:CPTFloat(0.2) alpha:CPTFloat(1.0)]; }); return color; } +#pragma mark - +#pragma mark Factory Methods + /** @brief Creates and returns a new CPTColor instance initialized with the provided @ref CGColorRef. * @param newCGColor The color to wrap. * @return A new CPTColor instance initialized with the provided @ref CGColorRef. **/ -+(instancetype)colorWithCGColor:(CGColorRef)newCGColor ++(nonnull instancetype)colorWithCGColor:(nonnull CGColorRef)newCGColor { - return [[CPTColor alloc] initWithCGColor:newCGColor]; + return [[self alloc] initWithCGColor:newCGColor]; } /** @brief Creates and returns a new CPTColor instance initialized with the provided RGBA color components. @@ -298,25 +400,71 @@ +(instancetype)colorWithCGColor:(CGColorRef)newCGColor * @param alpha The alpha component (@num{0} ≤ @par{alpha} ≤ @num{1}). * @return A new CPTColor instance initialized with the provided RGBA color components. **/ -+(instancetype)colorWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha ++(nonnull instancetype)colorWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha { - return [[CPTColor alloc] initWithComponentRed:red green:green blue:blue alpha:alpha]; + return [[self alloc] initWithComponentRed:red green:green blue:blue alpha:alpha]; } /** @brief Creates and returns a new CPTColor instance initialized with the provided gray level. * @param gray The gray level (@num{0} ≤ @par{gray} ≤ @num{1}). * @return A new CPTColor instance initialized with the provided gray level. **/ -+(instancetype)colorWithGenericGray:(CGFloat)gray ++(nonnull instancetype)colorWithGenericGray:(CGFloat)gray { CGFloat values[4] = { gray, gray, gray, CPTFloat(1.0) }; CGColorRef colorRef = CGColorCreate([CPTColorSpace genericRGBSpace].cgColorSpace, values); - CPTColor *color = [[CPTColor alloc] initWithCGColor:colorRef]; + CPTColor *color = [[self alloc] initWithCGColor:colorRef]; CGColorRelease(colorRef); return color; } +#if TARGET_OS_OSX + +/** @brief Creates and returns a new CPTColor instance initialized with the provided NSColor. + * + * The NSColor can be a dynamic system color or catalog color. This adds support for Dark Mode in macOS 10.14. + * + * @param newNSColor The color to wrap. + * @return A new CPTColor instance initialized with the provided NSColor. + **/ ++(nonnull instancetype)colorWithNSColor:(nonnull NSColor *)newNSColor +{ + return [[self alloc] initWithNSColor:newNSColor]; +} + +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + +/** @brief Creates and returns a new CPTColor instance initialized with the provided UIColor. + * + * The UIColor can be a dynamic system color or catalog color. This adds support for Dark Mode in iOS 13. + * + * @param newUIColor The color to wrap. + * @return A new CPTColor instance initialized with the provided UIColor. + **/ ++(nonnull instancetype)colorWithUIColor:(nonnull UIColor *)newUIColor +{ + return [[self alloc] initWithUIColor:newUIColor]; +} + +#endif + +/** @brief Creates and returns a new CPTColor instance initialized with the provided platform-native color. + * + * The color can be a dynamic system color or catalog color. This adds support for Dark Mode in iOS13. + * + * @param newColor The color to wrap. + * @return A new CPTColor instance initialized with the provided platform-native color. + **/ ++(nonnull instancetype)colorWithNativeColor:(nonnull CPTNativeColor *)newColor +{ +#if TARGET_OS_OSX + return [[self alloc] initWithNSColor:newColor]; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + return [[self alloc] initWithUIColor:newColor]; +#endif +} + #pragma mark - #pragma mark Init/Dealloc @@ -325,9 +473,9 @@ +(instancetype)colorWithGenericGray:(CGFloat)gray * @param newCGColor The color to wrap. * @return The initialized CPTColor object. **/ --(instancetype)initWithCGColor:(CGColorRef)newCGColor +-(nonnull instancetype)initWithCGColor:(nonnull CGColorRef)newCGColor { - if ( (self = [super init]) ) { + if ((self = [super init])) { CGColorRetain(newCGColor); cgColor = newCGColor; } @@ -342,7 +490,7 @@ -(instancetype)initWithCGColor:(CGColorRef)newCGColor * @param alpha The alpha component (@num{0} ≤ @par{alpha} ≤ @num{1}). * @return The initialized CPTColor object. **/ --(instancetype)initWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha +-(nonnull instancetype)initWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha { CGFloat colorComponents[4]; @@ -356,9 +504,61 @@ -(instancetype)initWithComponentRed:(CGFloat)red green:(CGFloat)green blue:(CGFl return self; } +#if TARGET_OS_OSX + +/** @brief Initializes a newly allocated CPTColor object with the provided NSColor. + * + * The NSColor can be a dynamic system color or catalog color. This adds support for Dark Mode in macOS 10.14. + * + * @param newNSColor The color to wrap. + * @return The initialized CPTColor object. + **/ +-(nonnull instancetype)initWithNSColor:(nonnull NSColor *)newNSColor +{ + if ((self = [super init])) { + nsColorCache = newNSColor; + } + return self; +} + +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + +/** @brief Initializes a newly allocated CPTColor object with the provided UIColor. + * + * The UIColor can be a dynamic system color or catalog color. This adds support for Dark Mode in iOS 13. + * + * @param newUIColor The color to wrap. + * @return The initialized CPTColor object. + **/ +-(nonnull instancetype)initWithUIColor:(nonnull UIColor *)newUIColor +{ + if ((self = [super init])) { + uiColorCache = newUIColor; + } + return self; +} + +#endif + +/** @brief Initializes a newly allocated CPTColor object with the provided platform-native color. + * + * The color can be a dynamic system color or catalog color. This adds support for Dark Mode in macOS 10.14 and iOS 13. + * + * @param newColor The color to wrap. + * @return The initialized CPTColor object. + **/ +-(nonnull instancetype)initWithNativeColor:(nonnull CPTNativeColor *)newColor +{ +#if TARGET_OS_OSX + return [self initWithNSColor:newColor]; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + return [self initWithUIColor:newColor]; +#endif +} + /// @cond --(instancetype)init +-(nonnull instancetype)init { return [self initWithComponentRed:0.0 green:0.0 blue:0.0 alpha:0.0]; } @@ -378,10 +578,23 @@ -(void)dealloc * @param alpha The alpha component (@num{0} ≤ @par{alpha} ≤ @num{1}). * @return A new CPTColor instance having the provided alpha component. **/ --(instancetype)colorWithAlphaComponent:(CGFloat)alpha +-(nonnull instancetype)colorWithAlphaComponent:(CGFloat)alpha { +#if TARGET_OS_OSX + NSColor *theNSColor = self.nsColorCache; + if ( theNSColor ) { + NSColor *newNSColor = [theNSColor colorWithAlphaComponent:alpha]; + return [[self class] colorWithNSColor:newNSColor]; + } +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + UIColor *theUIColor = self.uiColorCache; + if ( theUIColor ) { + UIColor *newUIColor = [theUIColor colorWithAlphaComponent:alpha]; + return [[self class] colorWithUIColor:newUIColor]; + } +#endif CGColorRef newCGColor = CGColorCreateCopyWithAlpha(self.cgColor, alpha); - CPTColor *newColor = [CPTColor colorWithCGColor:newCGColor]; + CPTColor *newColor = [[self class] colorWithCGColor:newCGColor]; CGColorRelease(newCGColor); return newColor; @@ -390,18 +603,28 @@ -(instancetype)colorWithAlphaComponent:(CGFloat)alpha #pragma mark - #pragma mark Opacity +/// @cond + -(BOOL)isOpaque { return CGColorGetAlpha(self.cgColor) >= CPTFloat(1.0); } +/// @endcond + #pragma mark - #pragma mark NSCoding Methods /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { +#if TARGET_OS_OSX + [coder encodeConditionalObject:self.nsColorCache forKey:@"CPTColor.nsColorCache"]; +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + [coder encodeConditionalObject:self.uiColorCache forKey:@"CPTColor.uiColorCache"]; +#endif + CGColorRef theColor = self.cgColor; [coder encodeCGColorSpace:CGColorGetColorSpace(theColor) forKey:@"CPTColor.colorSpace"]; @@ -423,14 +646,27 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { +#if TARGET_OS_OSX + NSColor *decodedNSColor = [coder decodeObjectOfClass:[NSColor class] + forKey:@"CPTColor.nsColorCache"]; + if ( decodedNSColor ) { + nsColorCache = decodedNSColor; + } +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + UIColor *decodedUIColor = [coder decodeObjectOfClass:[UIColor class] + forKey:@"CPTColor.uiColorCache"]; + if ( decodedUIColor ) { + uiColorCache = decodedUIColor; + } +#endif CGColorSpaceRef colorSpace = [coder newCGColorSpaceDecodeForKey:@"CPTColor.colorSpace"]; - size_t numberOfComponents = (size_t)[coder decodeInt64ForKey : @"CPTColor.numberOfComponents"]; + size_t numberOfComponents = (size_t)[coder decodeInt64ForKey:@"CPTColor.numberOfComponents"]; - CGFloat *colorComponents = malloc( numberOfComponents * sizeof(CGFloat) ); + CGFloat *colorComponents = calloc(numberOfComponents, sizeof(CGFloat)); for ( size_t i = 0; i < numberOfComponents; i++ ) { NSString *newKey = [[NSString alloc] initWithFormat:@"CPTColor.component[%zu]", i]; @@ -446,23 +682,51 @@ -(instancetype)initWithCoder:(NSCoder *)coder return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark NSCopying Methods /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { +#if TARGET_OS_OSX + NSColor *nsColorCopy = [self.nsColorCache copyWithZone:zone]; + if ( nsColorCopy ) { + CPTColor *colorCopy = [[[self class] allocWithZone:zone] initWithNSColor:nsColorCopy]; + return colorCopy; + } +#elif TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + UIColor *uiColorCopy = [self.uiColorCache copyWithZone:zone]; + if ( uiColorCopy ) { + CPTColor *colorCopy = [[[self class] allocWithZone:zone] initWithUIColor:uiColorCopy]; + return colorCopy; + } +#endif CGColorRef cgColorCopy = NULL; CGColorRef myColor = self.cgColor; if ( myColor ) { cgColorCopy = CGColorCreateCopy(myColor); + CPTColor *colorCopy = [[[self class] allocWithZone:zone] initWithCGColor:cgColorCopy]; + CGColorRelease(cgColorCopy); + return colorCopy; + } + else { + return nil; } - CPTColor *colorCopy = [[[self class] allocWithZone:zone] initWithCGColor:cgColorCopy]; - CGColorRelease(cgColorCopy); - return colorCopy; } /// @endcond @@ -478,13 +742,13 @@ -(id)copyWithZone:(NSZone *)zone * @param object The object to be compared with the receiver. * @return @YES if @par{object} is equal to the receiver, @NO otherwise. **/ --(BOOL)isEqual:(id)object +-(BOOL)isEqual:(nullable id)object { if ( self == object ) { return YES; } else if ( [object isKindOfClass:[self class]] ) { - return CGColorEqualToColor(self.cgColor, ( (CPTColor *)object ).cgColor); + return CGColorEqualToColor(self.cgColor, ((CPTColor *)object).cgColor); } else { return NO; @@ -515,4 +779,20 @@ -(NSUInteger)hash /// @endcond +#pragma mark - +#pragma mark Debugging + +/// @cond + +-(nullable id)debugQuickLookObject +{ +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + return self.uiColor; +#else + return self.nsColor; +#endif +} + +/// @endcond + @end diff --git a/framework/Source/CPTColorSpace.h b/framework/Source/CPTColorSpace.h index e2f52026f..bb38bb379 100644 --- a/framework/Source/CPTColorSpace.h +++ b/framework/Source/CPTColorSpace.h @@ -1,16 +1,16 @@ -@interface CPTColorSpace : NSObject +@interface CPTColorSpace : NSObject -@property (nonatomic, readonly) CGColorSpaceRef cgColorSpace; +@property (nonatomic, readonly, nonnull) CGColorSpaceRef cgColorSpace; /// @name Factory Methods /// @{ -+(instancetype)genericRGBSpace; ++(nonnull instancetype)genericRGBSpace; /// @} /// @name Initialization /// @{ --(instancetype)initWithCGColorSpace:(CGColorSpaceRef)colorSpace NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithCGColorSpace:(nonnull CGColorSpaceRef)colorSpace NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER; /// @} @end diff --git a/framework/Source/CPTColorSpace.m b/framework/Source/CPTColorSpace.m index 0f184e7cd..6086f09ef 100644 --- a/framework/Source/CPTColorSpace.m +++ b/framework/Source/CPTColorSpace.m @@ -9,7 +9,7 @@ @implementation CPTColorSpace -/** @property CGColorSpaceRef cgColorSpace +/** @property nonnull CGColorSpaceRef cgColorSpace * @brief The @ref CGColorSpaceRef to wrap around. **/ @synthesize cgColorSpace; @@ -25,19 +25,19 @@ @implementation CPTColorSpace * * @return A shared CPTColorSpace object initialized with the standard RGB colorspace. **/ -+(instancetype)genericRGBSpace ++(nonnull instancetype)genericRGBSpace { static CPTColorSpace *space = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ CGColorSpaceRef cgSpace = NULL; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE cgSpace = CGColorSpaceCreateDeviceRGB(); #else cgSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); #endif - space = [[CPTColorSpace alloc] initWithCGColorSpace:cgSpace]; + space = [[self alloc] initWithCGColorSpace:cgSpace]; CGColorSpaceRelease(cgSpace); }); @@ -53,9 +53,9 @@ +(instancetype)genericRGBSpace * @param colorSpace The color space. * @return The initialized CPTColorSpace object. **/ --(instancetype)initWithCGColorSpace:(CGColorSpaceRef)colorSpace +-(nonnull instancetype)initWithCGColorSpace:(nonnull CGColorSpaceRef)colorSpace { - if ( (self = [super init]) ) { + if ((self = [super init])) { CGColorSpaceRetain(colorSpace); cgColorSpace = colorSpace; } @@ -64,11 +64,11 @@ -(instancetype)initWithCGColorSpace:(CGColorSpaceRef)colorSpace /// @cond --(instancetype)init +-(nonnull instancetype)init { CGColorSpaceRef cgSpace = NULL; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE cgSpace = CGColorSpaceCreateDeviceRGB(); #else cgSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); @@ -93,7 +93,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeCGColorSpace:self.cgColorSpace forKey:@"CPTColorSpace.cgColorSpace"]; } @@ -104,12 +104,31 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - cgColorSpace = [coder newCGColorSpaceDecodeForKey:@"CPTColorSpace.cgColorSpace"]; + if ((self = [super init])) { + CGColorSpaceRef colorSpace = [coder newCGColorSpaceDecodeForKey:@"CPTColorSpace.cgColorSpace"]; + + if ( colorSpace ) { + cgColorSpace = colorSpace; + } + else { + self = nil; + } } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/CPTColorSpaceTests.m b/framework/Source/CPTColorSpaceTests.m index b3f49c5d7..40fecd110 100644 --- a/framework/Source/CPTColorSpaceTests.m +++ b/framework/Source/CPTColorSpaceTests.m @@ -1,6 +1,7 @@ -#import "CPTColorSpace.h" #import "CPTColorSpaceTests.h" +#import "CPTColorSpace.h" + @implementation CPTColorSpaceTests #pragma mark - @@ -10,15 +11,31 @@ -(void)testKeyedArchivingRoundTrip { CPTColorSpace *colorSpace = [CPTColorSpace genericRGBSpace]; - CPTColorSpace *newColorSpace = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:colorSpace]]; - - CFDataRef iccProfile = CGColorSpaceCopyICCProfile(colorSpace.cgColorSpace); - CFDataRef newIccProfile = CGColorSpaceCopyICCProfile(newColorSpace.cgColorSpace); - - XCTAssertTrue([(__bridge NSData *)iccProfile isEqualToData: (__bridge NSData *)newIccProfile], @"Color spaces not equal"); - - CFRelease(iccProfile); - CFRelease(newIccProfile); + CPTColorSpace *newColorSpace = [self archiveRoundTrip:colorSpace]; + + CFDataRef iccProfile = NULL; + CFDataRef newIccProfile = NULL; + + // CGColorSpaceCopyICCProfile() is deprecated as of macOS 10.13 + if ( CGColorSpaceCopyICCData ) { + iccProfile = CGColorSpaceCopyICCData(colorSpace.cgColorSpace); + newIccProfile = CGColorSpaceCopyICCData(newColorSpace.cgColorSpace); + } + else { + iccProfile = CGColorSpaceCopyICCProfile(colorSpace.cgColorSpace); + newIccProfile = CGColorSpaceCopyICCProfile(newColorSpace.cgColorSpace); + } + + if ( iccProfile && newIccProfile ) { + XCTAssertTrue([(__bridge NSData *) iccProfile isEqualToData:(__bridge NSData *)newIccProfile], @"Color spaces not equal"); + } + + if ( iccProfile ) { + CFRelease(iccProfile); + } + if ( newIccProfile ) { + CFRelease(newIccProfile); + } } @end diff --git a/framework/Source/CPTColorTests.m b/framework/Source/CPTColorTests.m index 5ecbd569a..ea7a9fb8c 100644 --- a/framework/Source/CPTColorTests.m +++ b/framework/Source/CPTColorTests.m @@ -1,6 +1,7 @@ -#import "CPTColor.h" #import "CPTColorTests.h" +#import "CPTColor.h" + @implementation CPTColorTests #pragma mark - @@ -10,9 +11,23 @@ -(void)testKeyedArchivingRoundTrip { CPTColor *color = [CPTColor redColor]; - CPTColor *newColor = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:color]]; + CPTColor *newColor = [self archiveRoundTrip:color]; XCTAssertEqualObjects(color, newColor, @"Colors not equal"); + +#if TARGET_OS_OSX +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundeclared-selector" + // Workaround since @available macro is not there + if ( [NSColor respondsToSelector:@selector(systemRedColor)] ) { + color = [CPTColor colorWithNSColor:[NSColor systemRedColor]]; + + newColor = [self archiveRoundTrip:color]; + + XCTAssertEqualObjects(color, newColor, @"Colors not equal"); + } +#pragma clang diagnostic pop +#endif } @end diff --git a/framework/Source/CPTConstraints.h b/framework/Source/CPTConstraints.h index 2643af39f..d6bf75bd3 100644 --- a/framework/Source/CPTConstraints.h +++ b/framework/Source/CPTConstraints.h @@ -1,17 +1,17 @@ -@interface CPTConstraints : NSObject +@interface CPTConstraints : NSObject /// @name Factory Methods /// @{ -+(instancetype)constraintWithLowerOffset:(CGFloat)newOffset; -+(instancetype)constraintWithUpperOffset:(CGFloat)newOffset; -+(instancetype)constraintWithRelativeOffset:(CGFloat)newOffset; ++(nonnull instancetype)constraintWithLowerOffset:(CGFloat)newOffset; ++(nonnull instancetype)constraintWithUpperOffset:(CGFloat)newOffset; ++(nonnull instancetype)constraintWithRelativeOffset:(CGFloat)newOffset; /// @} /// @name Initialization /// @{ --(instancetype)initWithLowerOffset:(CGFloat)newOffset; --(instancetype)initWithUpperOffset:(CGFloat)newOffset; --(instancetype)initWithRelativeOffset:(CGFloat)newOffset; +-(nonnull instancetype)initWithLowerOffset:(CGFloat)newOffset; +-(nonnull instancetype)initWithUpperOffset:(CGFloat)newOffset; +-(nonnull instancetype)initWithRelativeOffset:(CGFloat)newOffset; /// @} @end @@ -23,7 +23,7 @@ /// @name Comparison /// @{ --(BOOL)isEqualToConstraint:(CPTConstraints *)otherConstraint; +-(BOOL)isEqualToConstraint:(nullable CPTConstraints *)otherConstraint; /// @} /// @name Position diff --git a/framework/Source/CPTConstraints.m b/framework/Source/CPTConstraints.m index 261148c33..c9896ea25 100644 --- a/framework/Source/CPTConstraints.m +++ b/framework/Source/CPTConstraints.m @@ -1,8 +1,9 @@ #import "CPTConstraints.h" -#import "NSCoderExtensions.h" #import "_CPTConstraintsFixed.h" #import "_CPTConstraintsRelative.h" +#import "CPTDefinitions.h" +#import "NSCoderExtensions.h" /** @brief Implements a one-dimensional constrained position within a given numeric range. * @@ -17,7 +18,7 @@ @implementation CPTConstraints * @param newOffset The offset. * @return A new CPTConstraints instance initialized with the given offset. **/ -+(instancetype)constraintWithLowerOffset:(CGFloat)newOffset ++(nonnull instancetype)constraintWithLowerOffset:(CGFloat)newOffset { return [[_CPTConstraintsFixed alloc] initWithLowerOffset:newOffset]; } @@ -26,7 +27,7 @@ +(instancetype)constraintWithLowerOffset:(CGFloat)newOffset * @param newOffset The offset. * @return A new CPTConstraints instance initialized with the given offset. **/ -+(instancetype)constraintWithUpperOffset:(CGFloat)newOffset ++(nonnull instancetype)constraintWithUpperOffset:(CGFloat)newOffset { return [[_CPTConstraintsFixed alloc] initWithUpperOffset:newOffset]; } @@ -39,7 +40,7 @@ +(instancetype)constraintWithUpperOffset:(CGFloat)newOffset * @param newOffset The offset. * @return A new CPTConstraints instance initialized with the given offset. **/ -+(instancetype)constraintWithRelativeOffset:(CGFloat)newOffset ++(nonnull instancetype)constraintWithRelativeOffset:(CGFloat)newOffset { return [[_CPTConstraintsRelative alloc] initWithRelativeOffset:newOffset]; } @@ -51,7 +52,7 @@ +(instancetype)constraintWithRelativeOffset:(CGFloat)newOffset * @param newOffset The offset. * @return The initialized CPTConstraints object. **/ --(instancetype)initWithLowerOffset:(CGFloat)newOffset +-(nonnull instancetype)initWithLowerOffset:(CGFloat)newOffset { self = [[_CPTConstraintsFixed alloc] initWithLowerOffset:newOffset]; @@ -62,7 +63,7 @@ -(instancetype)initWithLowerOffset:(CGFloat)newOffset * @param newOffset The offset. * @return The initialized CPTConstraints object. **/ --(instancetype)initWithUpperOffset:(CGFloat)newOffset +-(nonnull instancetype)initWithUpperOffset:(CGFloat)newOffset { self = [[_CPTConstraintsFixed alloc] initWithUpperOffset:newOffset]; @@ -77,7 +78,7 @@ -(instancetype)initWithUpperOffset:(CGFloat)newOffset * @param newOffset The offset. * @return The initialized CPTConstraints object. **/ --(instancetype)initWithRelativeOffset:(CGFloat)newOffset +-(nonnull instancetype)initWithRelativeOffset:(CGFloat)newOffset { self = [[_CPTConstraintsRelative alloc] initWithRelativeOffset:newOffset]; @@ -89,7 +90,7 @@ -(instancetype)initWithRelativeOffset:(CGFloat)newOffset /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *__unused)zone { // do nothing--implemented in subclasses return nil; @@ -102,12 +103,12 @@ -(id)copyWithZone:(NSZone *)zone /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *__unused)coder { // do nothing--implemented in subclasses } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { if ( [coder containsValueForKey:@"_CPTConstraintsFixed.offset"] ) { CGFloat offset = [coder decodeCGFloatForKey:@"_CPTConstraintsFixed.offset"]; @@ -129,6 +130,18 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end #pragma mark - @@ -142,7 +155,7 @@ @implementation CPTConstraints(AbstractMethods) * @param otherConstraint The constraint to check. * @return @YES if the constraints are equal. **/ --(BOOL)isEqualToConstraint:(CPTConstraints *)otherConstraint +-(BOOL)isEqualToConstraint:(nullable CPTConstraints *)otherConstraint { // subclasses override to do comparison here return [super isEqual:otherConstraint]; @@ -156,10 +169,10 @@ -(BOOL)isEqualToConstraint:(CPTConstraints *)otherConstraint * @param upperBound The upper bound; must be greater than or equal to the @par{lowerBound}. * @return The calculated position. **/ --(CGFloat)positionForLowerBound:(CGFloat)lowerBound upperBound:(CGFloat)upperBound +-(CGFloat)positionForLowerBound:(CGFloat __unused)lowerBound upperBound:(CGFloat __unused)upperBound { // subclasses override to do position calculation here - return NAN; + return CPTNAN; } @end diff --git a/framework/Source/CPTDarkGradientThemeTests.m b/framework/Source/CPTDarkGradientThemeTests.m index 306f20685..71b64df7a 100644 --- a/framework/Source/CPTDarkGradientThemeTests.m +++ b/framework/Source/CPTDarkGradientThemeTests.m @@ -1,6 +1,7 @@ #import "CPTDarkGradientThemeTests.h" -#import "CPTDerivedXYGraph.h" + #import "_CPTDarkGradientTheme.h" +#import "CPTDerivedXYGraph.h" @implementation CPTDarkGradientThemeTests @@ -21,7 +22,7 @@ -(void)testNewThemeSetGraphClassReturnedClassShouldBeOfCorrectType // Arrange _CPTDarkGradientTheme *theme = [[_CPTDarkGradientTheme alloc] init]; - [theme setGraphClass:[CPTDerivedXYGraph class]]; + theme.graphClass = [CPTDerivedXYGraph class]; // Act CPTGraph *graph = [theme newGraph]; diff --git a/framework/Source/CPTDataSourceTestCase.h b/framework/Source/CPTDataSourceTestCase.h index ea0f00f28..3847a3cb0 100644 --- a/framework/Source/CPTDataSourceTestCase.h +++ b/framework/Source/CPTDataSourceTestCase.h @@ -6,15 +6,15 @@ @interface CPTDataSourceTestCase : CPTTestCase -@property (nonatomic, readwrite, copy) NSArray *xData; -@property (nonatomic, readwrite, copy) NSArray *yData; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *xData; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *yData; @property (nonatomic, readwrite, assign) NSUInteger nRecords; -@property (nonatomic, readonly, strong) CPTPlotRange *xRange; -@property (nonatomic, readonly, strong) CPTPlotRange *yRange; -@property (nonatomic, readwrite, strong) NSMutableArray *plots; +@property (nonatomic, readonly, strong, nonnull) CPTPlotRange *xRange; +@property (nonatomic, readonly, strong, nonnull) CPTPlotRange *yRange; +@property (nonatomic, readwrite, strong, nonnull) CPTMutablePlotArray *plots; -(void)buildData; --(void)addPlot:(CPTPlot *)newPlot; +-(void)addPlot:(nonnull CPTPlot *)newPlot; @end diff --git a/framework/Source/CPTDataSourceTestCase.m b/framework/Source/CPTDataSourceTestCase.m index 888147649..1c71e3e1d 100644 --- a/framework/Source/CPTDataSourceTestCase.m +++ b/framework/Source/CPTDataSourceTestCase.m @@ -1,4 +1,5 @@ #import "CPTDataSourceTestCase.h" + #import "CPTExceptions.h" #import "CPTMutablePlotRange.h" #import "CPTScatterPlot.h" @@ -9,7 +10,7 @@ /// @cond @interface CPTDataSourceTestCase() --(CPTMutablePlotRange *)plotRangeForData:(NSArray *)dataArray; +-(nonnull CPTMutablePlotRange *)plotRangeForData:(nonnull CPTNumberArray *)dataArray; @end @@ -26,7 +27,7 @@ @implementation CPTDataSourceTestCase -(void)setUp { - //check CPTDataSource conformance + // check CPTDataSource conformance XCTAssertTrue([self conformsToProtocol:@protocol(CPTPlotDataSource)], @"CPTDataSourceTestCase should conform to "); } @@ -34,14 +35,14 @@ -(void)tearDown { self.xData = nil; self.yData = nil; - [[self plots] removeAllObjects]; + [self.plots removeAllObjects]; } -(void)buildData { NSUInteger recordCount = self.nRecords; - NSMutableArray *arr = [NSMutableArray arrayWithCapacity:recordCount]; + CPTMutableNumberArray *arr = [NSMutableArray arrayWithCapacity:recordCount]; for ( NSUInteger i = 0; i < recordCount; i++ ) { [arr insertObject:@(i) atIndex:i]; @@ -50,74 +51,78 @@ -(void)buildData arr = [NSMutableArray arrayWithCapacity:recordCount]; for ( NSUInteger i = 0; i < recordCount; i++ ) { - [arr insertObject:@( sin(2 * M_PI * (double)i / (double)recordCount) ) atIndex:i]; + [arr insertObject:@(sin(2 * M_PI * (double)i / (double)recordCount)) atIndex:i]; } self.yData = arr; } --(void)addPlot:(CPTPlot *)newPlot +-(void)addPlot:(nonnull CPTPlot *)newPlot { if ( nil == self.plots ) { self.plots = [NSMutableArray array]; } - [[self plots] addObject:newPlot]; + [self.plots addObject:newPlot]; } --(CPTPlotRange *)xRange +-(nonnull CPTPlotRange *)xRange { [self buildData]; - return [self plotRangeForData:self.xData]; + + CPTNumberArray *data = self.xData; + return [self plotRangeForData:data]; } --(CPTPlotRange *)yRange +-(nonnull CPTPlotRange *)yRange { [self buildData]; - CPTMutablePlotRange *range = [self plotRangeForData:self.yData]; + + CPTNumberArray *data = self.yData; + CPTMutablePlotRange *range = [self plotRangeForData:data]; if ( self.plots.count > 1 ) { - range.length = CPTDecimalAdd( [range length], CPTDecimalFromDouble(self.plots.count) ); + range.lengthDecimal = CPTDecimalAdd(range.lengthDecimal, CPTDecimalFromUnsignedInteger(self.plots.count)); } return range; } --(CPTMutablePlotRange *)plotRangeForData:(NSArray *)dataArray +-(nonnull CPTMutablePlotRange *)plotRangeForData:(nonnull CPTNumberArray *)dataArray { double min = [[dataArray valueForKeyPath:@"@min.doubleValue"] doubleValue]; double max = [[dataArray valueForKeyPath:@"@max.doubleValue"] doubleValue]; double range = max - min; - return [CPTMutablePlotRange plotRangeWithLocation:CPTDecimalFromDouble(min - 0.05 * range) - length:CPTDecimalFromDouble(range + 0.1 * range)]; + return [CPTMutablePlotRange plotRangeWithLocation:@(min - 0.05 * range) + length:@(range + 0.1 * range)]; } #pragma mark - #pragma mark Plot Data Source Methods --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *__unused)plot { return self.nRecords; } --(NSArray *)numbersForPlot:(CPTPlot *)plot - field:(NSUInteger)fieldEnum - recordIndexRange:(NSRange)indexRange +-(nullable CPTNumberArray *)numbersForPlot:(nonnull CPTPlot *)plot + field:(NSUInteger)fieldEnum + recordIndexRange:(NSRange)indexRange { - NSArray *result; + CPTNumberArray *result; switch ( fieldEnum ) { case CPTScatterPlotFieldX: - result = [[self xData] objectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:indexRange]]; + result = [self.xData objectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:indexRange]]; break; case CPTScatterPlotFieldY: - result = [[self yData] objectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:indexRange]]; + result = [self.yData objectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:indexRange]]; if ( self.plots.count > 1 ) { XCTAssertTrue([[self plots] containsObject:plot], @"Plot missing"); - NSMutableArray *shiftedResult = [NSMutableArray arrayWithCapacity:result.count]; + CPTMutableNumberArray *shiftedResult = [NSMutableArray arrayWithCapacity:result.count]; for ( NSDecimalNumber *d in result ) { - [shiftedResult addObject:[d decimalNumberByAdding:[NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromDouble( CPTDataSourceTestCasePlotOffset * ([[self plots] indexOfObject:plot] + 1) )]]]; + [shiftedResult addObject:[d decimalNumberByAdding:[NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromCGFloat(CPTDataSourceTestCasePlotOffset * ([self.plots indexOfObject:plot] + 1))]]]; } result = shiftedResult; diff --git a/framework/Source/CPTDebugQuickLook.h b/framework/Source/CPTDebugQuickLook.h new file mode 100644 index 000000000..62afb37c9 --- /dev/null +++ b/framework/Source/CPTDebugQuickLook.h @@ -0,0 +1,27 @@ +/** + * @brief Methods used to show QuickLook previews of objects in the Xcode debugger and Swift playgrounds. + **/ +@protocol CPTDebugQuickLook + +/// @name Debugging +/// @{ + +/** + * @brief Used to show QuickLook previews of objects in the Xcode debugger and Swift playgrounds. + **/ +-(nullable id)debugQuickLookObject; + +/// @} + +@end + +#pragma mark - + +/** @category NSObject(CPTDebugQuickLookExtension) + * @brief Debugging extensions to NSObject. + **/ +@interface NSObject(CPTDebugQuickLookExtension) +{ +} + +@end diff --git a/framework/Source/CPTDefinitions.h b/framework/Source/CPTDefinitions.h index 00c7a0dd7..ff6f39eb7 100644 --- a/framework/Source/CPTDefinitions.h +++ b/framework/Source/CPTDefinitions.h @@ -9,13 +9,6 @@ * @brief Defined as @num{1} if the compiler and active SDK support weak references, @num{0} otherwise. **/ -/** - * @def cpt_weak - * @hideinitializer - * @brief A custom definition for automatic reference counting (ARC) weak references that falls back to - * __unsafe_unretained values on older platforms. - **/ - /** * @def cpt_weak_property * @hideinitializer @@ -34,15 +27,9 @@ #endif #if CPT_SDK_SUPPORTS_WEAK -#define cpt_weak __weak #define cpt_weak_property weak #else -#if __clang__ && (__clang_major__ >= 3) -#define cpt_weak __unsafe_unretained -#else -#define cpt_weak -#endif -#define cpt_weak_property assign +#define cpt_weak_property unsafe_unretained #endif // Deprecated method attribute @@ -53,7 +40,37 @@ * @brief Marks a method declaration as deprecated. **/ -#define cpt_deprecated __attribute__( (deprecated) ) +#define cpt_deprecated __attribute__((deprecated)) + +// Unused parameter attribute (DEBUG only) + +/** + * @def cpt_unused + * @hideinitializer + * @brief Marks a parameter value as unused only in RELEASE builds. + **/ + +#ifdef DEBUG +#define cpt_unused +#else +#define cpt_unused __unused +#endif + +// Swift wrappers + +/** + * @def cpt_swift_enum + * @hideinitializer + * @brief Marks a type definition to be imported into Swift as an enumeration. + **/ +#define cpt_swift_enum __attribute__((swift_wrapper(enum))) + +/** + * @def cpt_swift_struct + * @hideinitializer + * @brief Marks a type definition to be imported into Swift as a structure. + **/ +#define cpt_swift_struct __attribute__((swift_wrapper(struct))) // Type safety defines @@ -63,7 +80,7 @@ * @param x The number to cast. * @brief Casts a number to @ref CGFloat. **/ -#define CPTFloat(x) ( (CGFloat)(x) ) +#define CPTFloat(x) ((CGFloat)(x)) /** * @def CPTPointMake @@ -72,7 +89,7 @@ * @param y The y-coordinate of the point. * @brief A replacement for @ref CGPointMake(), casting each parameter to @ref CGFloat. **/ -#define CPTPointMake(x, y) CGPointMake( (CGFloat)(x), (CGFloat)(y) ) +#define CPTPointMake(x, y) CGPointMake((CGFloat)(x), (CGFloat)(y)) /** * @def CPTSizeMake @@ -81,7 +98,7 @@ * @param h The height of the size. * @brief A replacement for @ref CGSizeMake(), casting each parameter to @ref CGFloat. **/ -#define CPTSizeMake(w, h) CGSizeMake( (CGFloat)(w), (CGFloat)(h) ) +#define CPTSizeMake(w, h) CGSizeMake((CGFloat)(w), (CGFloat)(h)) /** * @def CPTRectMake @@ -92,7 +109,7 @@ * @param h The height of the rectangle. * @brief A replacement for @ref CGRectMake(), casting each parameter to @ref CGFloat. **/ -#define CPTRectMake(x, y, w, h) CGRectMake( (CGFloat)(x), (CGFloat)(y), (CGFloat)(w), (CGFloat)(h) ) +#define CPTRectMake(x, y, w, h) CGRectMake((CGFloat)(x), (CGFloat)(y), (CGFloat)(w), (CGFloat)(h)) /** * @def CPTRectInset @@ -102,7 +119,14 @@ * @param dy The y-offset. * @brief A replacement for @ref CGRectInset(), casting each offset parameter to @ref CGFloat. **/ -#define CPTRectInset(rect, dx, dy) CGRectInset( rect, (CGFloat)(dx), (CGFloat)(dy) ) +#define CPTRectInset(rect, dx, dy) CGRectInset(rect, (CGFloat)(dx), (CGFloat)(dy)) + +/** + * @def CPTNAN + * @hideinitializer + * @brief The not-a-number constant (@NAN), cast to @ref CGFloat. + **/ +#define CPTNAN ((CGFloat)NAN) /** * @brief Enumeration of numeric types @@ -126,11 +150,12 @@ typedef NS_ENUM (NSInteger, CPTErrorBarType) { * @brief Enumeration of axis scale types **/ typedef NS_ENUM (NSInteger, CPTScaleType) { - CPTScaleTypeLinear, ///< Linear axis scale - CPTScaleTypeLog, ///< Logarithmic axis scale - CPTScaleTypeAngular, ///< Angular axis scale (not implemented) - CPTScaleTypeDateTime, ///< Date/time axis scale (not implemented) - CPTScaleTypeCategory ///< Category axis scale + CPTScaleTypeLinear, ///< Linear axis scale + CPTScaleTypeLog, ///< Logarithmic axis scale + CPTScaleTypeAngular, ///< Angular axis scale (not implemented) + CPTScaleTypeDateTime, ///< Date/time axis scale (not implemented) + CPTScaleTypeCategory, ///< Category axis scale + CPTScaleTypeLogModulus ///< Log-modulus axis scale }; /** @@ -157,7 +182,7 @@ CPTRGBAColor; /** * @brief Enumeration of label positioning offset directions **/ -typedef NS_ENUM (NSInteger, CPTSign) { +typedef NS_CLOSED_ENUM(NSInteger, CPTSign) { CPTSignNone = 0, ///< No offset CPTSignPositive = +1, ///< Positive offset CPTSignNegative = -1 ///< Negative offset @@ -202,3 +227,60 @@ typedef struct _CPTEdgeInsets { CPTEdgeInsets; extern const CPTEdgeInsets CPTEdgeInsetsZero; ///< Defines a set of stretchable image edge insets where all of the values are zero (@num{0}). + +extern const NSStringDrawingOptions CPTStringDrawingOptions; ///< String drawing options used when measuring and drawing text. + +/** + * @brief An array of numbers. + **/ +typedef NSArray CPTNumberArray; + +/** + * @brief A mutable array of numbers. + **/ +typedef NSMutableArray CPTMutableNumberArray; + +/** + * @brief A set of numbers. + **/ +typedef NSSet CPTNumberSet; + +/** + * @brief A mutable set of numbers. + **/ +typedef NSMutableSet CPTMutableNumberSet; + +/** + * @brief An array of strings. + **/ +typedef NSArray CPTStringArray; + +/** + * @brief A mutable array of strings. + **/ +typedef NSMutableArray CPTMutableStringArray; + +/** + * @brief An array of values. + **/ +typedef NSArray CPTValueArray; + +/** + * @brief A mutable array of values. + **/ +typedef NSMutableArray CPTMutableValueArray; + +/** + * @brief An array of strings. + **/ +typedef NSDictionary CPTDictionary; + +/** + * @brief A mutable array of strings. + **/ +typedef NSMutableDictionary CPTMutableDictionary; + +/** + * @brief Render a Quick Look image into the given context. + **/ +typedef void (^CPTQuickLookImageBlock)(__nonnull CGContextRef context, CGFloat scale, CGRect bounds); diff --git a/framework/Source/CPTDefinitions.m b/framework/Source/CPTDefinitions.m index 7b54f79ab..5af8aaada 100644 --- a/framework/Source/CPTDefinitions.m +++ b/framework/Source/CPTDefinitions.m @@ -1,3 +1,7 @@ #import "CPTDefinitions.h" const CPTEdgeInsets CPTEdgeInsetsZero = { CPTFloat(0.0), CPTFloat(0.0), CPTFloat(0.0), CPTFloat(0.0) }; + +const NSStringDrawingOptions CPTStringDrawingOptions = NSStringDrawingUsesLineFragmentOrigin | + NSStringDrawingUsesFontLeading | + NSStringDrawingTruncatesLastVisibleLine; diff --git a/framework/Source/CPTExceptions.h b/framework/Source/CPTExceptions.h index c7d22e30c..67eed530c 100644 --- a/framework/Source/CPTExceptions.h +++ b/framework/Source/CPTExceptions.h @@ -1,8 +1,15 @@ /// @file +#import "CPTDefinitions.h" + +/** + * @brief Custom exception type. + **/ +typedef NSString *CPTExceptionType cpt_swift_struct; + /// @name Custom Exception Identifiers /// @{ -extern NSString *const CPTException; -extern NSString *const CPTDataException; -extern NSString *const CPTNumericDataException; +extern CPTExceptionType __nonnull const CPTException; +extern CPTExceptionType __nonnull const CPTDataException; +extern CPTExceptionType __nonnull const CPTNumericDataException; /// @} diff --git a/framework/Source/CPTExceptions.m b/framework/Source/CPTExceptions.m index 349839242..efe533257 100644 --- a/framework/Source/CPTExceptions.m +++ b/framework/Source/CPTExceptions.m @@ -1,5 +1,5 @@ #import "CPTExceptions.h" -NSString *const CPTException = @"CPTException"; ///< General Core Plot exceptions. -NSString *const CPTDataException = @"CPTDataException"; ///< Core Plot data exceptions. -NSString *const CPTNumericDataException = @"CPTNumericDataException"; ///< Core Plot numeric data exceptions. +CPTExceptionType const CPTException = @"CPTException"; ///< General Core Plot exceptions. +CPTExceptionType const CPTDataException = @"CPTDataException"; ///< Core Plot data exceptions. +CPTExceptionType const CPTNumericDataException = @"CPTNumericDataException"; ///< Core Plot numeric data exceptions. diff --git a/framework/Source/CPTFill.h b/framework/Source/CPTFill.h index aafc1e60c..a011c8feb 100644 --- a/framework/Source/CPTFill.h +++ b/framework/Source/CPTFill.h @@ -1,21 +1,34 @@ +/// @file + @class CPTGradient; @class CPTImage; @class CPTColor; +@class CPTFill; + +/** + * @brief An array of fills. + **/ +typedef NSArray CPTFillArray; + +/** + * @brief A mutable array of fills. + **/ +typedef NSMutableArray CPTMutableFillArray; -@interface CPTFill : NSObject +@interface CPTFill : NSObject /// @name Factory Methods /// @{ -+(instancetype)fillWithColor:(CPTColor *)aColor; -+(instancetype)fillWithGradient:(CPTGradient *)aGradient; -+(instancetype)fillWithImage:(CPTImage *)anImage; ++(nonnull instancetype)fillWithColor:(nonnull CPTColor *)aColor; ++(nonnull instancetype)fillWithGradient:(nonnull CPTGradient *)aGradient; ++(nonnull instancetype)fillWithImage:(nonnull CPTImage *)anImage; /// @} /// @name Initialization /// @{ --(instancetype)initWithColor:(CPTColor *)aColor; --(instancetype)initWithGradient:(CPTGradient *)aGradient; --(instancetype)initWithImage:(CPTImage *)anImage; +-(nonnull instancetype)initWithColor:(nonnull CPTColor *)aColor; +-(nonnull instancetype)initWithGradient:(nonnull CPTGradient *)aGradient; +-(nonnull instancetype)initWithImage:(nonnull CPTImage *)anImage; /// @} @end @@ -26,12 +39,12 @@ @interface CPTFill(AbstractMethods) @property (nonatomic, readonly, getter = isOpaque) BOOL opaque; -@property (nonatomic, readonly) CGColorRef cgColor; +@property (nonatomic, readonly, nullable) CGColorRef cgColor; /// @name Drawing /// @{ --(void)fillRect:(CGRect)rect inContext:(CGContextRef)context; --(void)fillPathInContext:(CGContextRef)context; +-(void)fillRect:(CGRect)rect inContext:(nonnull CGContextRef)context; +-(void)fillPathInContext:(nonnull CGContextRef)context; /// @} @end diff --git a/framework/Source/CPTFill.m b/framework/Source/CPTFill.m index 6d2ebb157..b884fdd99 100644 --- a/framework/Source/CPTFill.m +++ b/framework/Source/CPTFill.m @@ -1,10 +1,12 @@ #import "CPTFill.h" -#import "CPTColor.h" -#import "CPTImage.h" #import "_CPTFillColor.h" #import "_CPTFillGradient.h" #import "_CPTFillImage.h" +#import "CPTColor.h" +#import "CPTGradient.h" +#import "CPTImage.h" +#import "CPTPlatformSpecificFunctions.h" /** @brief Draws area fills. * @@ -22,7 +24,7 @@ @implementation CPTFill * @param aColor The color. * @return A new CPTFill instance initialized with the given color. **/ -+(instancetype)fillWithColor:(CPTColor *)aColor ++(nonnull instancetype)fillWithColor:(nonnull CPTColor *)aColor { return [[_CPTFillColor alloc] initWithColor:aColor]; } @@ -31,7 +33,7 @@ +(instancetype)fillWithColor:(CPTColor *)aColor * @param aGradient The gradient. * @return A new CPTFill instance initialized with the given gradient. **/ -+(instancetype)fillWithGradient:(CPTGradient *)aGradient ++(nonnull instancetype)fillWithGradient:(nonnull CPTGradient *)aGradient { return [[_CPTFillGradient alloc] initWithGradient:aGradient]; } @@ -40,7 +42,7 @@ +(instancetype)fillWithGradient:(CPTGradient *)aGradient * @param anImage The image. * @return A new CPTFill instance initialized with the given image. **/ -+(instancetype)fillWithImage:(CPTImage *)anImage ++(nonnull instancetype)fillWithImage:(nonnull CPTImage *)anImage { return [[_CPTFillImage alloc] initWithImage:anImage]; } @@ -49,7 +51,7 @@ +(instancetype)fillWithImage:(CPTImage *)anImage * @param aColor The color. * @return The initialized CPTFill object. **/ --(instancetype)initWithColor:(CPTColor *)aColor +-(nonnull instancetype)initWithColor:(nonnull CPTColor *)aColor { self = [[_CPTFillColor alloc] initWithColor:aColor]; @@ -60,7 +62,7 @@ -(instancetype)initWithColor:(CPTColor *)aColor * @param aGradient The gradient. * @return The initialized CPTFill object. **/ --(instancetype)initWithGradient:(CPTGradient *)aGradient +-(nonnull instancetype)initWithGradient:(nonnull CPTGradient *)aGradient { self = [[_CPTFillGradient alloc] initWithGradient:aGradient]; @@ -71,7 +73,7 @@ -(instancetype)initWithGradient:(CPTGradient *)aGradient * @param anImage The image. * @return The initialized CPTFill object. **/ --(instancetype)initWithImage:(CPTImage *)anImage +-(nonnull instancetype)initWithImage:(nonnull CPTImage *)anImage { self = [[_CPTFillImage alloc] initWithImage:anImage]; @@ -83,7 +85,7 @@ -(instancetype)initWithImage:(CPTImage *)anImage /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *__unused)zone { // do nothing--implemented in subclasses return nil; @@ -96,25 +98,28 @@ -(id)copyWithZone:(NSZone *)zone /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *__unused)coder { // do nothing--implemented in subclasses } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - id fill = [coder decodeObjectForKey:@"_CPTFillColor.fillColor"]; + id fill = [coder decodeObjectOfClass:[CPTColor class] + forKey:@"_CPTFillColor.fillColor"]; if ( fill ) { return [self initWithColor:fill]; } - id gradient = [coder decodeObjectForKey:@"_CPTFillGradient.fillGradient"]; + id gradient = [coder decodeObjectOfClass:[CPTGradient class] + forKey:@"_CPTFillGradient.fillGradient"]; if ( gradient ) { return [self initWithGradient:gradient]; } - id image = [coder decodeObjectForKey:@"_CPTFillImage.fillImage"]; + id image = [coder decodeObjectOfClass:[CPTImage class] + forKey:@"_CPTFillImage.fillImage"]; if ( image ) { return [self initWithImage:image]; } @@ -124,6 +129,18 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end #pragma mark - @@ -135,7 +152,7 @@ @implementation CPTFill(AbstractMethods) */ @dynamic opaque; -/** @property CGColorRef cgColor +/** @property nullable CGColorRef cgColor * @brief Returns a @ref CGColorRef describing the fill if the fill can be represented as a color, @NULL otherwise. */ @dynamic cgColor; @@ -143,16 +160,20 @@ @implementation CPTFill(AbstractMethods) #pragma mark - #pragma mark Opacity +/// @cond + -(BOOL)isOpaque { // do nothing--subclasses override to describe the fill opacity return NO; } +/// @endcond + #pragma mark - #pragma mark Color --(CGColorRef)cgColor +-(nullable CGColorRef)cgColor { // do nothing--subclasses override to describe the color return NULL; @@ -165,7 +186,7 @@ -(CGColorRef)cgColor * @param rect The rectangle to draw into. * @param context The graphics context to draw into. **/ --(void)fillRect:(CGRect)rect inContext:(CGContextRef)context +-(void)fillRect:(CGRect __unused)rect inContext:(nonnull CGContextRef __unused)context { // do nothing--subclasses override to do drawing here } @@ -173,9 +194,25 @@ -(void)fillRect:(CGRect)rect inContext:(CGContextRef)context /** @brief Draws the gradient into the given graphics context clipped to the current drawing path. * @param context The graphics context to draw into. **/ --(void)fillPathInContext:(CGContextRef)context +-(void)fillPathInContext:(nonnull CGContextRef __unused)context { // do nothing--subclasses override to do drawing here } +#pragma mark - +#pragma mark Debugging + +/// @cond + +-(nullable id)debugQuickLookObject +{ + const CGRect rect = CGRectMake(0.0, 0.0, 100.0, 100.0); + + return CPTQuickLookImage(rect, ^(CGContextRef context, CGFloat __unused scale, CGRect bounds) { + [self fillRect:bounds inContext:context]; + }); +} + +/// @endcond + @end diff --git a/framework/Source/CPTFillTests.m b/framework/Source/CPTFillTests.m index 918a3e907..8029b0a73 100644 --- a/framework/Source/CPTFillTests.m +++ b/framework/Source/CPTFillTests.m @@ -1,15 +1,16 @@ -#import "CPTColor.h" -#import "CPTFill.h" #import "CPTFillTests.h" -#import "CPTGradient.h" -#import "CPTImage.h" + #import "_CPTFillColor.h" #import "_CPTFillGradient.h" #import "_CPTFillImage.h" +#import "CPTColor.h" +#import "CPTFill.h" +#import "CPTGradient.h" +#import "CPTImage.h" @interface _CPTFillColor() -@property (nonatomic, readwrite, copy) CPTColor *fillColor; +@property (nonatomic, readwrite, copy, nonnull) CPTColor *fillColor; @end @@ -17,7 +18,7 @@ @interface _CPTFillColor() @interface _CPTFillGradient() -@property (nonatomic, readwrite, copy) CPTGradient *fillGradient; +@property (nonatomic, readwrite, copy, nonnull) CPTGradient *fillGradient; @end @@ -25,7 +26,7 @@ @interface _CPTFillGradient() @interface _CPTFillImage() -@property (nonatomic, readwrite, copy) CPTImage *fillImage; +@property (nonatomic, readwrite, copy, nonnull) CPTImage *fillImage; @end @@ -40,7 +41,7 @@ -(void)testKeyedArchivingRoundTripColor { _CPTFillColor *fill = (_CPTFillColor *)[CPTFill fillWithColor:[CPTColor redColor]]; - _CPTFillColor *newFill = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:fill]]; + _CPTFillColor *newFill = [self archiveRoundTrip:fill toClass:[CPTFill class]]; XCTAssertEqualObjects(fill.fillColor, newFill.fillColor, @"Fill with color not equal"); } @@ -49,7 +50,7 @@ -(void)testKeyedArchivingRoundTripGradient { _CPTFillGradient *fill = (_CPTFillGradient *)[CPTFill fillWithGradient:[CPTGradient rainbowGradient]]; - _CPTFillGradient *newFill = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:fill]]; + _CPTFillGradient *newFill = [self archiveRoundTrip:fill toClass:[CPTFill class]]; XCTAssertEqualObjects(fill.fillGradient, newFill.fillGradient, @"Fill with gradient not equal"); } @@ -59,10 +60,15 @@ -(void)testKeyedArchivingRoundTripImage const size_t width = 100; const size_t height = 100; - size_t bytesPerRow = (4 * width + 15) & ~15ul; + size_t bytesPerRow = (4 * width + 15) & ~15ul; + +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); +#else CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); - CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, bytesPerRow, colorSpace, (CGBitmapInfo)kCGImageAlphaNoneSkipLast); - CGImageRef cgImage = CGBitmapContextCreateImage(context); +#endif + CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, bytesPerRow, colorSpace, (CGBitmapInfo)kCGImageAlphaNoneSkipLast); + CGImageRef cgImage = CGBitmapContextCreateImage(context); CPTImage *image = [CPTImage imageWithCGImage:cgImage]; @@ -74,7 +80,7 @@ -(void)testKeyedArchivingRoundTripImage _CPTFillImage *fill = (_CPTFillImage *)[CPTFill fillWithImage:image]; - _CPTFillImage *newFill = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:fill]]; + _CPTFillImage *newFill = [self archiveRoundTrip:fill toClass:[CPTFill class]]; XCTAssertEqualObjects(fill.fillImage, newFill.fillImage, @"Fill with image not equal"); } diff --git a/framework/Source/CPTFunctionDataSource.h b/framework/Source/CPTFunctionDataSource.h index 4912d71a6..251919c40 100644 --- a/framework/Source/CPTFunctionDataSource.h +++ b/framework/Source/CPTFunctionDataSource.h @@ -16,23 +16,27 @@ typedef double (^CPTDataSourceBlock)(double); @interface CPTFunctionDataSource : NSObject -@property (nonatomic, readonly) CPTDataSourceFunction dataSourceFunction; -@property (nonatomic, readonly) CPTDataSourceBlock dataSourceBlock; -@property (nonatomic, readonly) CPTPlot *dataPlot; +@property (nonatomic, readonly, nullable) CPTDataSourceFunction dataSourceFunction; +@property (nonatomic, readonly, nullable) CPTDataSourceBlock dataSourceBlock; +@property (nonatomic, readonly, nonnull) CPTPlot *dataPlot; @property (nonatomic, readwrite) CGFloat resolution; -@property (nonatomic, readwrite, strong) CPTPlotRange *dataRange; +@property (nonatomic, readwrite, strong, nullable) CPTPlotRange *dataRange; /// @name Factory Methods /// @{ -+(instancetype)dataSourceForPlot:(CPTPlot *)plot withFunction:(CPTDataSourceFunction)function; -+(instancetype)dataSourceForPlot:(CPTPlot *)plot withBlock:(CPTDataSourceBlock)block; ++(nonnull instancetype)dataSourceForPlot:(nonnull CPTPlot *)plot withFunction:(nonnull CPTDataSourceFunction) function NS_SWIFT_NAME(init(for:withFunction:)); + ++(nonnull instancetype)dataSourceForPlot:(nonnull CPTPlot *)plot withBlock:(nonnull CPTDataSourceBlock) block NS_SWIFT_NAME(init(for:withBlock:)); + /// @} /// @name Initialization /// @{ --(instancetype)initForPlot:(CPTPlot *)plot withFunction:(CPTDataSourceFunction)function; --(instancetype)initForPlot:(CPTPlot *)plot withBlock:(CPTDataSourceBlock)block; +-(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withFunction:(nonnull CPTDataSourceFunction) function NS_SWIFT_NAME(init(forPlot:withFunction:)); + +-(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withBlock:(nonnull CPTDataSourceBlock) block NS_SWIFT_NAME(init(forPlot:withBlock:)); + /// @} @end diff --git a/framework/Source/CPTFunctionDataSource.m b/framework/Source/CPTFunctionDataSource.m index 4f227046e..0e038673a 100644 --- a/framework/Source/CPTFunctionDataSource.m +++ b/framework/Source/CPTFunctionDataSource.m @@ -1,5 +1,6 @@ #import "CPTFunctionDataSource.h" +#import "CPTExceptions.h" #import "CPTMutablePlotRange.h" #import "CPTNumericData.h" #import "CPTScatterPlot.h" @@ -13,13 +14,13 @@ @interface CPTFunctionDataSource() -@property (nonatomic, readwrite) CPTPlot *dataPlot; +@property (nonatomic, readwrite, nonnull) CPTPlot *dataPlot; @property (nonatomic, readwrite) double cachedStep; @property (nonatomic, readwrite) NSUInteger dataCount; @property (nonatomic, readwrite) NSUInteger cachedCount; -@property (nonatomic, readwrite, strong) CPTMutablePlotRange *cachedPlotRange; +@property (nonatomic, readwrite, strong, nullable) CPTMutablePlotRange *cachedPlotRange; --(instancetype)initForPlot:(CPTPlot *)plot NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot NS_DESIGNATED_INITIALIZER; -(void)plotBoundsChanged; -(void)plotSpaceChanged; @@ -34,17 +35,17 @@ -(void)plotSpaceChanged; **/ @implementation CPTFunctionDataSource -/** @property CPTDataSourceFunction dataSourceFunction +/** @property nullable CPTDataSourceFunction dataSourceFunction * @brief The function used to generate plot data. **/ @synthesize dataSourceFunction; -/** @property CPTDataSourceBlock dataSourceBlock +/** @property nullable CPTDataSourceBlock dataSourceBlock * @brief The Objective-C block used to generate plot data. **/ @synthesize dataSourceBlock; -/** @property CPTPlot *dataPlot +/** @property nonnull CPTPlot *dataPlot * @brief The plot that will display the function values. Must be an instance of CPTScatterPlot. **/ @synthesize dataPlot; @@ -54,7 +55,7 @@ @implementation CPTFunctionDataSource **/ @synthesize resolution; -/** @property CPTPlotRange *dataRange +/** @property nullable CPTPlotRange *dataRange * @brief The maximum range of x-values that will be plotted. If @nil (the default), the function will be plotted for all visible x-values. **/ @synthesize dataRange; @@ -72,7 +73,7 @@ @implementation CPTFunctionDataSource * @param function The function used to generate plot data. * @return A new CPTFunctionDataSource instance initialized with the provided function and plot. **/ -+(instancetype)dataSourceForPlot:(CPTPlot *)plot withFunction:(CPTDataSourceFunction)function ++(nonnull instancetype)dataSourceForPlot:(nonnull CPTPlot *)plot withFunction:(nonnull CPTDataSourceFunction)function { return [[self alloc] initForPlot:plot withFunction:function]; } @@ -82,7 +83,7 @@ +(instancetype)dataSourceForPlot:(CPTPlot *)plot withFunction:(CPTDataSourceFunc * @param block The Objective-C block used to generate plot data. * @return A new CPTFunctionDataSource instance initialized with the provided block and plot. **/ -+(instancetype)dataSourceForPlot:(CPTPlot *)plot withBlock:(CPTDataSourceBlock)block ++(nonnull instancetype)dataSourceForPlot:(nonnull CPTPlot *)plot withBlock:(nonnull CPTDataSourceBlock)block { return [[self alloc] initForPlot:plot withBlock:block]; } @@ -92,11 +93,11 @@ +(instancetype)dataSourceForPlot:(CPTPlot *)plot withBlock:(CPTDataSourceBlock)b * @param function The function used to generate plot data. * @return The initialized CPTFunctionDataSource object. **/ --(instancetype)initForPlot:(CPTPlot *)plot withFunction:(CPTDataSourceFunction)function +-(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withFunction:(nonnull CPTDataSourceFunction)function { NSParameterAssert(function); - if ( (self = [self initForPlot:plot]) ) { + if ((self = [self initForPlot:plot])) { dataSourceFunction = function; plot.dataSource = self; @@ -109,11 +110,11 @@ -(instancetype)initForPlot:(CPTPlot *)plot withFunction:(CPTDataSourceFunction)f * @param block The Objective-C block used to generate plot data. * @return The initialized CPTFunctionDataSource object. **/ --(instancetype)initForPlot:(CPTPlot *)plot withBlock:(CPTDataSourceBlock)block +-(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot withBlock:(nonnull CPTDataSourceBlock)block { NSParameterAssert(block); - if ( (self = [self initForPlot:plot]) ) { + if ((self = [self initForPlot:plot])) { dataSourceBlock = block; plot.dataSource = self; @@ -123,11 +124,11 @@ -(instancetype)initForPlot:(CPTPlot *)plot withBlock:(CPTDataSourceBlock)block /// @cond --(instancetype)initForPlot:(CPTPlot *)plot +-(nonnull instancetype)initForPlot:(nonnull CPTPlot *)plot { NSParameterAssert([plot isKindOfClass:[CPTScatterPlot class]]); - if ( (self = [super init]) ) { + if ((self = [super init])) { dataPlot = plot; dataSourceFunction = NULL; dataSourceBlock = nil; @@ -153,9 +154,10 @@ -(instancetype)initForPlot:(CPTPlot *)plot } // function and plot are required; this will fail the assertions in -initForPlot:withFunction: --(instancetype)init +-(nonnull instancetype)init { - return [self initForPlot:nil withFunction:NULL]; + [NSException raise:CPTException format:@"%@ must be initialized with a function or a block.", NSStringFromClass([self class])]; + return [self initForPlot:[CPTScatterPlot layer] withFunction:sin]; } -(void)dealloc @@ -174,7 +176,7 @@ -(void)dealloc -(void)setResolution:(CGFloat)newResolution { - NSParameterAssert( newResolution > CPTFloat(0.0) ); + NSParameterAssert(newResolution > CPTFloat(0.0)); if ( newResolution != resolution ) { resolution = newResolution; @@ -186,7 +188,7 @@ -(void)setResolution:(CGFloat)newResolution } } --(void)setDataRange:(CPTPlotRange *)newRange +-(void)setDataRange:(nullable CPTPlotRange *)newRange { if ( newRange != dataRange ) { dataRange = newRange; @@ -219,8 +221,8 @@ -(void)plotBoundsChanged if ( plotSpace ) { CGFloat width = plot.bounds.size.width; - if ( width > CPTFloat(0.0) ) { - NSUInteger count = (NSUInteger)lrint( ceil(width / self.resolution) ) + 1; + if ( width > CPTFloat(0.0)) { + NSUInteger count = (NSUInteger)lrint(ceil(width / self.resolution)) + 1; if ( count > self.cachedCount ) { self.dataCount = count; @@ -259,7 +261,7 @@ -(void)plotSpaceChanged if ( [cachedRange containsRange:plotRange] ) { // no new data needed } - else if ( ![cachedRange intersectsRange:plotRange] || (step == 0.0) ) { + else if ( ![cachedRange intersectsRange:plotRange] || (step == 0.0)) { self.cachedCount = 0; self.cachedPlotRange = plotRange; @@ -269,11 +271,11 @@ -(void)plotSpaceChanged if ( step > 0.0 ) { double minLimit = plotRange.minLimitDouble; if ( ![cachedRange containsDouble:minLimit] ) { - NSUInteger numPoints = (NSUInteger)lrint( ( ceil( (cachedRange.minLimitDouble - minLimit) / step ) ) ); + NSUInteger numPoints = (NSUInteger)lrint((ceil((cachedRange.minLimitDouble - minLimit) / step))); NSDecimal offset = CPTDecimalFromDouble(step * numPoints); - cachedRange.location = CPTDecimalSubtract(cachedRange.location, offset); - cachedRange.length = CPTDecimalAdd(cachedRange.length, offset); + cachedRange.locationDecimal = CPTDecimalSubtract(cachedRange.locationDecimal, offset); + cachedRange.lengthDecimal = CPTDecimalAdd(cachedRange.lengthDecimal, offset); self.dataCount += numPoints; @@ -282,10 +284,10 @@ -(void)plotSpaceChanged double maxLimit = plotRange.maxLimitDouble; if ( ![cachedRange containsDouble:maxLimit] ) { - NSUInteger numPoints = (NSUInteger)lrint( ceil( (maxLimit - cachedRange.maxLimitDouble) / step ) ); + NSUInteger numPoints = (NSUInteger)lrint(ceil((maxLimit - cachedRange.maxLimitDouble) / step)); NSDecimal offset = CPTDecimalFromDouble(step * numPoints); - cachedRange.length = CPTDecimalAdd(cachedRange.length, offset); + cachedRange.lengthDecimal = CPTDecimalAdd(cachedRange.lengthDecimal, offset); self.dataCount += numPoints; @@ -295,11 +297,11 @@ -(void)plotSpaceChanged else { double maxLimit = plotRange.maxLimitDouble; if ( ![cachedRange containsDouble:maxLimit] ) { - NSUInteger numPoints = (NSUInteger)lrint( ceil( (cachedRange.maxLimitDouble - maxLimit) / step ) ); + NSUInteger numPoints = (NSUInteger)lrint(ceil((cachedRange.maxLimitDouble - maxLimit) / step)); NSDecimal offset = CPTDecimalFromDouble(step * numPoints); - cachedRange.location = CPTDecimalSubtract(cachedRange.location, offset); - cachedRange.length = CPTDecimalAdd(cachedRange.length, offset); + cachedRange.locationDecimal = CPTDecimalSubtract(cachedRange.locationDecimal, offset); + cachedRange.lengthDecimal = CPTDecimalAdd(cachedRange.lengthDecimal, offset); self.dataCount += numPoints; @@ -308,10 +310,10 @@ -(void)plotSpaceChanged double minLimit = plotRange.minLimitDouble; if ( ![cachedRange containsDouble:minLimit] ) { - NSUInteger numPoints = (NSUInteger)lrint( ceil( (minLimit - cachedRange.minLimitDouble) / step ) ); + NSUInteger numPoints = (NSUInteger)lrint(ceil((minLimit - cachedRange.minLimitDouble) / step)); NSDecimal offset = CPTDecimalFromDouble(step * numPoints); - cachedRange.length = CPTDecimalAdd(cachedRange.length, offset); + cachedRange.lengthDecimal = CPTDecimalAdd(cachedRange.lengthDecimal, offset); self.dataCount += numPoints; @@ -328,9 +330,9 @@ -(void)plotSpaceChanged /// @cond --(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context +-(void)observeValueForKeyPath:(nullable NSString *)keyPath ofObject:(nullable id)object change:(NSDictionary *)change context:(nullable void *)context { - if ( (context == CPTFunctionDataSourceKVOContext) && [keyPath isEqualToString:@"plotSpace"] && [object isEqual:self.dataPlot] ) { + if ((context == CPTFunctionDataSourceKVOContext) && [keyPath isEqualToString:@"plotSpace"] && [object isEqual:self.dataPlot] ) { CPTPlotSpace *oldSpace = change[NSKeyValueChangeOldKey]; CPTPlotSpace *newSpace = change[NSKeyValueChangeNewKey]; @@ -362,7 +364,7 @@ -(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NS /// @cond --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot { NSUInteger count = 0; @@ -373,58 +375,60 @@ -(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot return count; } --(CPTNumericData *)dataForPlot:(CPTPlot *)plot recordIndexRange:(NSRange)indexRange +-(nullable CPTNumericData *)dataForPlot:(nonnull CPTPlot *)plot recordIndexRange:(NSRange)indexRange { CPTNumericData *numericData = nil; - NSUInteger count = self.dataCount; + if ( [plot isEqual:self.dataPlot] ) { + NSUInteger count = self.dataCount; - if ( count > 0 ) { - CPTPlotRange *xRange = self.cachedPlotRange; + if ( count > 0 ) { + CPTPlotRange *xRange = self.cachedPlotRange; - if ( !xRange ) { - [self plotSpaceChanged]; - xRange = self.cachedPlotRange; - } + if ( !xRange ) { + [self plotSpaceChanged]; + xRange = self.cachedPlotRange; + } - NSMutableData *data = [[NSMutableData alloc] initWithLength:indexRange.length * 2 * sizeof(double)]; + NSMutableData *data = [[NSMutableData alloc] initWithLength:indexRange.length * 2 * sizeof(double)]; - double *xBytes = data.mutableBytes; - double *yBytes = data.mutableBytes + ( indexRange.length * sizeof(double) ); + double *xBytes = data.mutableBytes; + double *yBytes = data.mutableBytes + (indexRange.length * sizeof(double)); - double location = xRange.locationDouble; - double length = xRange.lengthDouble; - double denom = (double)( count - ( (count > 1) ? 1 : 0 ) ); + double location = xRange.locationDouble; + double length = xRange.lengthDouble; + double denom = (double)(count - ((count > 1) ? 1 : 0)); - NSUInteger lastIndex = NSMaxRange(indexRange); + NSUInteger lastIndex = NSMaxRange(indexRange); - CPTDataSourceFunction function = self.dataSourceFunction; + CPTDataSourceFunction function = self.dataSourceFunction; - if ( function ) { - for ( NSUInteger i = indexRange.location; i < lastIndex; i++ ) { - double x = location + ( (double)i / denom ) * length; + if ( function ) { + for ( NSUInteger i = indexRange.location; i < lastIndex; i++ ) { + double x = location + ((double)i / denom) * length; - *xBytes++ = x; - *yBytes++ = function(x); + *xBytes++ = x; + *yBytes++ = function(x); + } } - } - else { - CPTDataSourceBlock functionBlock = self.dataSourceBlock; + else { + CPTDataSourceBlock functionBlock = self.dataSourceBlock; - if ( functionBlock ) { - for ( NSUInteger i = indexRange.location; i < lastIndex; i++ ) { - double x = location + ( (double)i / denom ) * length; + if ( functionBlock ) { + for ( NSUInteger i = indexRange.location; i < lastIndex; i++ ) { + double x = location + ((double)i / denom) * length; - *xBytes++ = x; - *yBytes++ = functionBlock(x); + *xBytes++ = x; + *yBytes++ = functionBlock(x); + } } } - } - numericData = [CPTNumericData numericDataWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ) - shape:@[@(indexRange.length), @2] - dataOrder:CPTDataOrderColumnsFirst]; + numericData = [CPTNumericData numericDataWithData:data + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()) + shape:@[@(indexRange.length), @2] + dataOrder:CPTDataOrderColumnsFirst]; + } } return numericData; diff --git a/framework/Source/CPTGradient.h b/framework/Source/CPTGradient.h index cbc06f127..b07f6d920 100644 --- a/framework/Source/CPTGradient.h +++ b/framework/Source/CPTGradient.h @@ -9,10 +9,10 @@ * @brief A structure representing one node in a linked list of RGBA colors. **/ typedef struct _CPTGradientElement { - CPTRGBAColor color; ///< Color - CGFloat position; ///< Gradient position (0 ≤ @par{position} ≤ 1) + CPTRGBAColor color; ///< Color + CGFloat position; ///< Gradient position (0 ≤ @par{position} ≤ 1) - struct _CPTGradientElement *nextElement; ///< Pointer to the next CPTGradientElement in the list (last element == @NULL) + struct _CPTGradientElement *__nullable nextElement; ///< Pointer to the next CPTGradientElement in the list (last element == @NULL) } CPTGradientElement; @@ -36,7 +36,7 @@ typedef NS_ENUM (NSInteger, CPTGradientType) { @class CPTColorSpace; @class CPTColor; -@interface CPTGradient : NSObject +@interface CPTGradient : NSObject @property (nonatomic, readonly, getter = isOpaque) BOOL opaque; @@ -59,46 +59,46 @@ typedef NS_ENUM (NSInteger, CPTGradientType) { /// @name Factory Methods /// @{ -+(instancetype)gradientWithBeginningColor:(CPTColor *)begin endingColor:(CPTColor *)end; -+(instancetype)gradientWithBeginningColor:(CPTColor *)begin endingColor:(CPTColor *)end beginningPosition:(CGFloat)beginningPosition endingPosition:(CGFloat)endingPosition; ++(nonnull instancetype)gradientWithBeginningColor:(nonnull CPTColor *)begin endingColor:(nonnull CPTColor *)end; ++(nonnull instancetype)gradientWithBeginningColor:(nonnull CPTColor *)begin endingColor:(nonnull CPTColor *)end beginningPosition:(CGFloat)beginningPosition endingPosition:(CGFloat)endingPosition; -+(instancetype)aquaSelectedGradient; -+(instancetype)aquaNormalGradient; -+(instancetype)aquaPressedGradient; ++(nonnull instancetype)aquaSelectedGradient; ++(nonnull instancetype)aquaNormalGradient; ++(nonnull instancetype)aquaPressedGradient; -+(instancetype)unifiedSelectedGradient; -+(instancetype)unifiedNormalGradient; -+(instancetype)unifiedPressedGradient; -+(instancetype)unifiedDarkGradient; ++(nonnull instancetype)unifiedSelectedGradient; ++(nonnull instancetype)unifiedNormalGradient; ++(nonnull instancetype)unifiedPressedGradient; ++(nonnull instancetype)unifiedDarkGradient; -+(instancetype)sourceListSelectedGradient; -+(instancetype)sourceListUnselectedGradient; ++(nonnull instancetype)sourceListSelectedGradient; ++(nonnull instancetype)sourceListUnselectedGradient; -+(instancetype)rainbowGradient; -+(instancetype)hydrogenSpectrumGradient; ++(nonnull instancetype)rainbowGradient; ++(nonnull instancetype)hydrogenSpectrumGradient; /// @} /// @name Modification /// @{ --(CPTGradient *)gradientWithAlphaComponent:(CGFloat)alpha; --(CPTGradient *)gradientWithBlendingMode:(CPTGradientBlendingMode)mode; +-(nonnull CPTGradient *)gradientWithAlphaComponent:(CGFloat)alpha; +-(nonnull CPTGradient *)gradientWithBlendingMode:(CPTGradientBlendingMode)mode; --(CPTGradient *)addColorStop:(CPTColor *)color atPosition:(CGFloat)position; // positions given relative to [0,1] --(CPTGradient *)removeColorStopAtIndex:(NSUInteger)idx; --(CPTGradient *)removeColorStopAtPosition:(CGFloat)position; +-(nonnull CPTGradient *)addColorStop:(nonnull CPTColor *)color atPosition:(CGFloat)position; // positions given relative to [0,1] +-(nonnull CPTGradient *)removeColorStopAtIndex:(NSUInteger)idx; +-(nonnull CPTGradient *)removeColorStopAtPosition:(CGFloat)position; /// @} /// @name Information /// @{ --(CGColorRef)newColorStopAtIndex:(NSUInteger)idx; --(CGColorRef)newColorAtPosition:(CGFloat)position; +-(nullable CGColorRef)newColorStopAtIndex:(NSUInteger)idx CF_RETURNS_RETAINED; +-(nonnull CGColorRef)newColorAtPosition:(CGFloat)position CF_RETURNS_RETAINED; /// @} /// @name Drawing /// @{ --(void)drawSwatchInRect:(CGRect)rect inContext:(CGContextRef)context; --(void)fillRect:(CGRect)rect inContext:(CGContextRef)context; --(void)fillPathInContext:(CGContextRef)context; +-(void)drawSwatchInRect:(CGRect)rect inContext:(nonnull CGContextRef)context; +-(void)fillRect:(CGRect)rect inContext:(nonnull CGContextRef)context; +-(void)fillPathInContext:(nonnull CGContextRef)context; /// @} @end diff --git a/framework/Source/CPTGradient.m b/framework/Source/CPTGradient.m index dbc7cb7f8..3d6028025 100644 --- a/framework/Source/CPTGradient.m +++ b/framework/Source/CPTGradient.m @@ -2,6 +2,7 @@ #import "CPTColor.h" #import "CPTColorSpace.h" +#import "CPTPlatformSpecificFunctions.h" #import "CPTUtilities.h" #import "NSCoderExtensions.h" #import @@ -9,18 +10,18 @@ /// @cond @interface CPTGradient() -@property (nonatomic, readwrite, strong) CPTColorSpace *colorspace; +@property (nonatomic, readwrite, strong, nonnull) CPTColorSpace *colorspace; @property (nonatomic, readwrite, assign) CPTGradientBlendingMode blendingMode; @property (nonatomic, readwrite, assign) CPTGradientElement *elementList; -@property (nonatomic, readwrite, assign) CGFunctionRef gradientFunction; +@property (nonatomic, readwrite, assign, nonnull) CGFunctionRef gradientFunction; -(void)commonInit; --(void)addElement:(CPTGradientElement *)newElement; +-(void)addElement:(nonnull CPTGradientElement *)newElement; --(CGShadingRef)newAxialGradientInRect:(CGRect)rect; --(CGShadingRef)newRadialGradientInRect:(CGRect)rect context:(CGContextRef)context; +-(nonnull CGShadingRef)newAxialGradientInRect:(CGRect)rect; +-(nonnull CGShadingRef)newRadialGradientInRect:(CGRect)rect context:(nonnull CGContextRef)context; --(CPTGradientElement *)elementAtIndex:(NSUInteger)idx; +-(nullable CPTGradientElement *)elementAtIndex:(NSUInteger)idx NS_RETURNS_INNER_POINTER; -(NSUInteger)elementCount; -(CPTGradientElement)removeElementAtIndex:(NSUInteger)idx; @@ -30,12 +31,12 @@ -(void)removeAllElements; @end // C Functions for color blending -static void CPTLinearEvaluation(void *info, const CGFloat *in, CGFloat *out); -static void CPTChromaticEvaluation(void *info, const CGFloat *in, CGFloat *out); -static void CPTInverseChromaticEvaluation(void *info, const CGFloat *in, CGFloat *out); -static void CPTTransformRGB_HSV(CGFloat *components); -static void CPTTransformHSV_RGB(CGFloat *components); -static void CPTResolveHSV(CGFloat *color1, CGFloat *color2); +static void CPTLinearEvaluation(void *__nullable info, const CGFloat *__nonnull in, CGFloat *__nonnull out); +static void CPTChromaticEvaluation(void *__nullable info, const CGFloat *__nonnull in, CGFloat *__nonnull out); +static void CPTInverseChromaticEvaluation(void *__nullable info, const CGFloat *__nonnull in, CGFloat *__nonnull out); +static void CPTTransformRGB_HSV(CGFloat *__nonnull components); +static void CPTTransformHSV_RGB(CGFloat *__nonnull components); +static void CPTResolveHSV(CGFloat *__nonnull color1, CGFloat *__nonnull color2); /// @endcond @@ -57,7 +58,7 @@ @implementation CPTGradient /// @cond -/** @property CPTColorSpace *colorspace; +/** @property nonnull CPTColorSpace *colorspace; * @brief The colorspace for the gradient colors. **/ @synthesize colorspace; @@ -114,9 +115,9 @@ @implementation CPTGradient * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { [self commonInit]; self.blendingMode = CPTLinearBlendingMode; @@ -152,7 +153,7 @@ -(void)dealloc /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { CPTGradient *copy = [[[self class] allocWithZone:zone] init]; @@ -179,56 +180,53 @@ -(id)copyWithZone:(NSZone *)zone /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { - if ( [coder allowsKeyedCoding] ) { - NSUInteger count = 0; - CPTGradientElement *currentElement = self.elementList; - while ( currentElement != NULL ) { - [coder encodeValueOfObjCType:@encode(CGFloat) at:&(currentElement->color.red)]; - [coder encodeValueOfObjCType:@encode(CGFloat) at:&(currentElement->color.green)]; - [coder encodeValueOfObjCType:@encode(CGFloat) at:&(currentElement->color.blue)]; - [coder encodeValueOfObjCType:@encode(CGFloat) at:&(currentElement->color.alpha)]; - [coder encodeValueOfObjCType:@encode(CGFloat) at:&(currentElement->position)]; + NSUInteger count = 0; - count++; - currentElement = currentElement->nextElement; - } - [coder encodeInteger:(NSInteger)count forKey:@"CPTGradient.elementCount"]; - [coder encodeInteger:self.blendingMode forKey:@"CPTGradient.blendingMode"]; - [coder encodeCGFloat:self.angle forKey:@"CPTGradient.angle"]; - [coder encodeInteger:self.gradientType forKey:@"CPTGradient.type"]; - [coder encodeCPTPoint:self.startAnchor forKey:@"CPTPlotSymbol.startAnchor"]; - [coder encodeCPTPoint:self.endAnchor forKey:@"CPTPlotSymbol.endAnchor"]; - } - else { - [NSException raise:NSInvalidArchiveOperationException format:@"Only supports NSKeyedArchiver coders"]; + CPTGradientElement *currentElement = self.elementList; + + while ( currentElement != NULL ) { + [coder encodeCGFloat:currentElement->color.red forKey:[NSString stringWithFormat:@"red%lu", (unsigned long)count]]; + [coder encodeCGFloat:currentElement->color.green forKey:[NSString stringWithFormat:@"green%lu", (unsigned long)count]]; + [coder encodeCGFloat:currentElement->color.blue forKey:[NSString stringWithFormat:@"blue%lu", (unsigned long)count]]; + [coder encodeCGFloat:currentElement->color.alpha forKey:[NSString stringWithFormat:@"alpha%lu", (unsigned long)count]]; + [coder encodeCGFloat:currentElement->position forKey:[NSString stringWithFormat:@"position%lu", (unsigned long)count]]; + + count++; + currentElement = currentElement->nextElement; } + + [coder encodeInteger:(NSInteger)count forKey:@"CPTGradient.elementCount"]; + [coder encodeInteger:self.blendingMode forKey:@"CPTGradient.blendingMode"]; + [coder encodeCGFloat:self.angle forKey:@"CPTGradient.angle"]; + [coder encodeInteger:self.gradientType forKey:@"CPTGradient.type"]; + [coder encodeCPTPoint:self.startAnchor forKey:@"CPTPlotSymbol.startAnchor"]; + [coder encodeCPTPoint:self.endAnchor forKey:@"CPTPlotSymbol.endAnchor"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { [self commonInit]; - gradientType = (CPTGradientType)[coder decodeIntegerForKey : @"CPTGradient.type"]; + gradientType = (CPTGradientType)[coder decodeIntegerForKey:@"CPTGradient.type"]; angle = [coder decodeCGFloatForKey:@"CPTGradient.angle"]; - self.blendingMode = (CPTGradientBlendingMode)[coder decodeIntegerForKey : @"CPTGradient.blendingMode"]; + self.blendingMode = (CPTGradientBlendingMode)[coder decodeIntegerForKey:@"CPTGradient.blendingMode"]; startAnchor = [coder decodeCPTPointForKey:@"CPTPlotSymbol.startAnchor"]; endAnchor = [coder decodeCPTPointForKey:@"CPTPlotSymbol.endAnchor"]; - NSUInteger count = (NSUInteger)[coder decodeIntegerForKey : @"CPTGradient.elementCount"]; + NSUInteger count = (NSUInteger)[coder decodeIntegerForKey:@"CPTGradient.elementCount"]; - while ( count != 0 ) { + for ( NSUInteger i = 0; i < count; i++ ) { CPTGradientElement newElement; - [coder decodeValueOfObjCType:@encode(CGFloat) at:&(newElement.color.red)]; - [coder decodeValueOfObjCType:@encode(CGFloat) at:&(newElement.color.green)]; - [coder decodeValueOfObjCType:@encode(CGFloat) at:&(newElement.color.blue)]; - [coder decodeValueOfObjCType:@encode(CGFloat) at:&(newElement.color.alpha)]; - [coder decodeValueOfObjCType:@encode(CGFloat) at:&(newElement.position)]; + newElement.color.red = [coder decodeCGFloatForKey:[NSString stringWithFormat:@"red%lu", (unsigned long)i]]; + newElement.color.green = [coder decodeCGFloatForKey:[NSString stringWithFormat:@"green%lu", (unsigned long)i]]; + newElement.color.blue = [coder decodeCGFloatForKey:[NSString stringWithFormat:@"blue%lu", (unsigned long)i]]; + newElement.color.alpha = [coder decodeCGFloatForKey:[NSString stringWithFormat:@"alpha%lu", (unsigned long)i]]; + newElement.position = [coder decodeCGFloatForKey:[NSString stringWithFormat:@"position%lu", (unsigned long)i]]; - count--; [self addElement:&newElement]; } } @@ -237,6 +235,18 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Factory Methods @@ -245,7 +255,7 @@ -(instancetype)initWithCoder:(NSCoder *)coder * @param end The ending color. * @return A new CPTGradient instance initialized with an axial linear gradient between the two given colors. **/ -+(instancetype)gradientWithBeginningColor:(CPTColor *)begin endingColor:(CPTColor *)end ++(nonnull instancetype)gradientWithBeginningColor:(nonnull CPTColor *)begin endingColor:(nonnull CPTColor *)end { return [self gradientWithBeginningColor:begin endingColor:end beginningPosition:CPTFloat(0.0) endingPosition:CPTFloat(1.0)]; } @@ -257,7 +267,7 @@ +(instancetype)gradientWithBeginningColor:(CPTColor *)begin endingColor:(CPTColo * @param endingPosition The ending position (@num{0} ≤ @par{endingPosition} ≤ @num{1}). * @return A new CPTGradient instance initialized with an axial linear gradient between the two given colors, at two given normalized positions. **/ -+(instancetype)gradientWithBeginningColor:(CPTColor *)begin endingColor:(CPTColor *)end beginningPosition:(CGFloat)beginningPosition endingPosition:(CGFloat)endingPosition ++(nonnull instancetype)gradientWithBeginningColor:(nonnull CPTColor *)begin endingColor:(nonnull CPTColor *)end beginningPosition:(CGFloat)beginningPosition endingPosition:(CGFloat)endingPosition { CPTGradient *newInstance = [[self alloc] init]; @@ -279,7 +289,7 @@ +(instancetype)gradientWithBeginningColor:(CPTColor *)begin endingColor:(CPTColo /** @brief Creates and returns a new CPTGradient instance initialized with the Aqua selected gradient. * @return A new CPTGradient instance initialized with the Aqua selected gradient. **/ -+(instancetype)aquaSelectedGradient ++(nonnull instancetype)aquaSelectedGradient { CPTGradient *newInstance = [[self alloc] init]; @@ -323,7 +333,7 @@ +(instancetype)aquaSelectedGradient /** @brief Creates and returns a new CPTGradient instance initialized with the Aqua normal gradient. * @return A new CPTGradient instance initialized with the Aqua normal gradient. **/ -+(instancetype)aquaNormalGradient ++(nonnull instancetype)aquaNormalGradient { CPTGradient *newInstance = [[self alloc] init]; @@ -359,7 +369,7 @@ +(instancetype)aquaNormalGradient /** @brief Creates and returns a new CPTGradient instance initialized with the Aqua pressed gradient. * @return A new CPTGradient instance initialized with the Aqua pressed gradient. **/ -+(instancetype)aquaPressedGradient ++(nonnull instancetype)aquaPressedGradient { CPTGradient *newInstance = [[self alloc] init]; @@ -395,7 +405,7 @@ +(instancetype)aquaPressedGradient /** @brief Creates and returns a new CPTGradient instance initialized with the unified selected gradient. * @return A new CPTGradient instance initialized with the unified selected gradient. **/ -+(instancetype)unifiedSelectedGradient ++(nonnull instancetype)unifiedSelectedGradient { CPTGradient *newInstance = [[self alloc] init]; @@ -419,7 +429,7 @@ +(instancetype)unifiedSelectedGradient /** @brief Creates and returns a new CPTGradient instance initialized with the unified normal gradient. * @return A new CPTGradient instance initialized with the unified normal gradient. **/ -+(instancetype)unifiedNormalGradient ++(nonnull instancetype)unifiedNormalGradient { CPTGradient *newInstance = [[self alloc] init]; @@ -443,7 +453,7 @@ +(instancetype)unifiedNormalGradient /** @brief Creates and returns a new CPTGradient instance initialized with the unified pressed gradient. * @return A new CPTGradient instance initialized with the unified pressed gradient. **/ -+(instancetype)unifiedPressedGradient ++(nonnull instancetype)unifiedPressedGradient { CPTGradient *newInstance = [[self alloc] init]; @@ -467,7 +477,7 @@ +(instancetype)unifiedPressedGradient /** @brief Creates and returns a new CPTGradient instance initialized with the unified dark gradient. * @return A new CPTGradient instance initialized with the unified dark gradient. **/ -+(instancetype)unifiedDarkGradient ++(nonnull instancetype)unifiedDarkGradient { CPTGradient *newInstance = [[self alloc] init]; @@ -491,7 +501,7 @@ +(instancetype)unifiedDarkGradient /** @brief Creates and returns a new CPTGradient instance initialized with the source list selected gradient. * @return A new CPTGradient instance initialized with the source list selected gradient. **/ -+(instancetype)sourceListSelectedGradient ++(nonnull instancetype)sourceListSelectedGradient { CPTGradient *newInstance = [[self alloc] init]; @@ -519,7 +529,7 @@ +(instancetype)sourceListSelectedGradient /** @brief Creates and returns a new CPTGradient instance initialized with the source list unselected gradient. * @return A new CPTGradient instance initialized with the source list unselected gradient. **/ -+(instancetype)sourceListUnselectedGradient ++(nonnull instancetype)sourceListUnselectedGradient { CPTGradient *newInstance = [[self alloc] init]; @@ -547,7 +557,7 @@ +(instancetype)sourceListUnselectedGradient /** @brief Creates and returns a new CPTGradient instance initialized with a rainbow gradient. * @return A new CPTGradient instance initialized with a rainbow gradient. **/ -+(instancetype)rainbowGradient ++(nonnull instancetype)rainbowGradient { CPTGradient *newInstance = [[self alloc] init]; @@ -577,7 +587,7 @@ +(instancetype)rainbowGradient /** @brief Creates and returns a new CPTGradient instance initialized with a hydrogen spectrum gradient. * @return A new CPTGradient instance initialized with a hydrogen spectrum gradient. **/ -+(instancetype)hydrogenSpectrumGradient ++(nonnull instancetype)hydrogenSpectrumGradient { CPTGradient *newInstance = [[self alloc] init]; @@ -705,16 +715,16 @@ -(CPTGradient *)gradientWithBlendingMode:(CPTGradientBlendingMode)mode * @param position The color stop position (@num{0} ≤ @par{position} ≤ @num{1}). * @return A copy of the current gradient with the new color stop. **/ --(CPTGradient *)addColorStop:(CPTColor *)color atPosition:(CGFloat)position +-(CPTGradient *)addColorStop:(nonnull CPTColor *)color atPosition:(CGFloat)position { CPTGradient *newGradient = [self copy]; CPTGradientElement newGradientElement; - //put the components of color into the newGradientElement - must make sure it is a RGB color (not Gray or CMYK) + // put the components of color into the newGradientElement - must make sure it is a RGB color (not Gray or CMYK) newGradientElement.color = CPTRGBAColorFromCGColor(color.cgColor); newGradientElement.position = position; - //Pass it off to addElement to take care of adding it to the elementList + // Pass it off to addElement to take care of adding it to the elementList [newGradient addElement:&newGradientElement]; return newGradient; @@ -729,14 +739,14 @@ -(CPTGradient *)removeColorStopAtPosition:(CGFloat)position CPTGradient *newGradient = [self copy]; CPTGradientElement removedElement = [newGradient removeElementAtPosition:position]; - if ( isnan(removedElement.position) ) { - [NSException raise:NSRangeException format:@"-[%@ removeColorStopAtPosition:]: no such colorStop at position (%g)", [self class], position]; + if ( isnan(removedElement.position)) { + [NSException raise:NSRangeException format:@"-[%@ removeColorStopAtPosition:]: no such colorStop at position (%g)", [self class], (double)position]; } return newGradient; } -/** @brief Copies the current gradient and removes the color stop at @par{index} from the list of color stops. +/** @brief Copies the current gradient and removes the color stop at @par{idx} from the list of color stops. * @param idx The color stop index. * @return A copy of the current gradient with the color stop removed. **/ @@ -745,7 +755,7 @@ -(CPTGradient *)removeColorStopAtIndex:(NSUInteger)idx CPTGradient *newGradient = [self copy]; CPTGradientElement removedElement = [newGradient removeElementAtIndex:idx]; - if ( isnan(removedElement.position) ) { + if ( isnan(removedElement.position)) { [NSException raise:NSRangeException format:@"-[%@ removeColorStopAtIndex:]: index (%lu) beyond bounds", [self class], (unsigned long)idx]; } @@ -755,19 +765,18 @@ -(CPTGradient *)removeColorStopAtIndex:(NSUInteger)idx #pragma mark - #pragma mark Information -/** @brief Gets the color at color stop @par{index} from the list of color stops. +/** @brief Gets the color at color stop @par{idx} from the list of color stops. * @param idx The color stop index. - * @return The color at color stop @par{index}. + * @return The color at color stop @par{idx}. **/ -(CGColorRef)newColorStopAtIndex:(NSUInteger)idx { CPTGradientElement *element = [self elementAtIndex:idx]; if ( element != NULL ) { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGFloat colorComponents[4] = { element->color.red, element->color.green, element->color.blue, element->color.alpha }; return CGColorCreate(self.colorspace.cgColorSpace, colorComponents); - #else return CGColorCreateGenericRGB(element->color.red, element->color.green, element->color.blue, element->color.alpha); #endif @@ -789,19 +798,19 @@ -(CGColorRef)newColorAtPosition:(CGFloat)position switch ( self.blendingMode ) { case CPTLinearBlendingMode: - CPTLinearEvaluation( (__bridge void *)(self), &position, components ); + CPTLinearEvaluation((__bridge void *)(self), &position, components); break; case CPTChromaticBlendingMode: - CPTChromaticEvaluation( (__bridge void *)(self), &position, components ); + CPTChromaticEvaluation((__bridge void *)(self), &position, components); break; case CPTInverseChromaticBlendingMode: - CPTInverseChromaticEvaluation( (__bridge void *)(self), &position, components ); + CPTInverseChromaticEvaluation((__bridge void *)(self), &position, components); break; } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGFloat colorComponents[4] = { components[0], components[1], components[2], components[3] }; gradientColor = CGColorCreate(self.colorspace.cgColorSpace, colorComponents); #else @@ -818,7 +827,7 @@ -(CGColorRef)newColorAtPosition:(CGFloat)position * @param rect The rectangle to draw into. * @param context The graphics context to draw into. **/ --(void)drawSwatchInRect:(CGRect)rect inContext:(CGContextRef)context +-(void)drawSwatchInRect:(CGRect)rect inContext:(nonnull CGContextRef)context { [self fillRect:rect inContext:context]; } @@ -827,7 +836,7 @@ -(void)drawSwatchInRect:(CGRect)rect inContext:(CGContextRef)context * @param rect The rectangle to draw into. * @param context The graphics context to draw into. **/ --(void)fillRect:(CGRect)rect inContext:(CGContextRef)context +-(void)fillRect:(CGRect)rect inContext:(nonnull CGContextRef)context { CGShadingRef myCGShading = NULL; @@ -854,9 +863,9 @@ -(void)fillRect:(CGRect)rect inContext:(CGContextRef)context /** @brief Draws the gradient into the given graphics context clipped to the current drawing path. * @param context The graphics context to draw into. **/ --(void)fillPathInContext:(CGContextRef)context +-(void)fillPathInContext:(nonnull CGContextRef)context { - if ( !CGContextIsPathEmpty(context) ) { + if ( !CGContextIsPathEmpty(context)) { CGShadingRef myCGShading = NULL; CGContextSaveGState(context); @@ -884,20 +893,24 @@ -(void)fillPathInContext:(CGContextRef)context #pragma mark - #pragma mark Opacity +/// @cond + -(BOOL)isOpaque { BOOL opaqueGradient = YES; CPTGradientElement *list = self.elementList; - while ( opaqueGradient && (list != NULL) ) { - opaqueGradient = opaqueGradient && ( list->color.alpha >= CPTFloat(1.0) ); + while ( opaqueGradient && (list != NULL)) { + opaqueGradient = opaqueGradient && (list->color.alpha >= CPTFloat(1.0)); list = list->nextElement; } return opaqueGradient; } +/// @endcond + #pragma mark - #pragma mark Gradient comparison @@ -909,7 +922,7 @@ -(BOOL)isOpaque * @param object The object to be compared with the receiver. * @return @YES if @par{object} is equal to the receiver, @NO otherwise. **/ --(BOOL)isEqual:(id)object +-(BOOL)isEqual:(nullable id)object { if ( self == object ) { return YES; @@ -989,7 +1002,7 @@ -(NSUInteger)hash return (NSUInteger)theHash; } else { - return self.blendingMode + self.gradientType; + return (NSUInteger)(self.blendingMode + self.gradientType); } } @@ -998,7 +1011,9 @@ -(NSUInteger)hash #pragma mark - #pragma mark Accessors --(void)setGradientFunction:(CGFunctionRef)newGradientFunction +/// @cond + +-(void)setGradientFunction:(nonnull CGFunctionRef)newGradientFunction { if ( newGradientFunction != gradientFunction ) { CGFunctionRelease(gradientFunction); @@ -1006,23 +1021,25 @@ -(void)setGradientFunction:(CGFunctionRef)newGradientFunction } } +/// @endcond + #pragma mark - #pragma mark Private Methods /// @cond --(CGShadingRef)newAxialGradientInRect:(CGRect)rect +-(nonnull CGShadingRef)newAxialGradientInRect:(CGRect)rect { // First Calculate where the beginning and ending points should be CGPoint startPoint, endPoint; - if ( self.angle == 0.0 ) { - startPoint = CPTPointMake( CGRectGetMinX(rect), CGRectGetMinY(rect) ); // right of rect - endPoint = CPTPointMake( CGRectGetMaxX(rect), CGRectGetMinY(rect) ); // left of rect + if ( self.angle == CPTFloat(0.0)) { + startPoint = CPTPointMake(CGRectGetMinX(rect), CGRectGetMinY(rect)); // right of rect + endPoint = CPTPointMake(CGRectGetMaxX(rect), CGRectGetMinY(rect)); // left of rect } - else if ( self.angle == 90.0 ) { - startPoint = CPTPointMake( CGRectGetMinX(rect), CGRectGetMinY(rect) ); // bottom of rect - endPoint = CPTPointMake( CGRectGetMinX(rect), CGRectGetMaxY(rect) ); // top of rect + else if ( self.angle == CPTFloat(90.0)) { + startPoint = CPTPointMake(CGRectGetMinX(rect), CGRectGetMinY(rect)); // bottom of rect + endPoint = CPTPointMake(CGRectGetMinX(rect), CGRectGetMaxY(rect)); // top of rect } else { // ok, we'll do the calculations now CGFloat x, y; @@ -1031,9 +1048,9 @@ -(CGShadingRef)newAxialGradientInRect:(CGRect)rect CGFloat length; CGFloat deltaX, deltaY; - CGFloat rAngle = self.angle * CPTFloat(M_PI / 180.0); //convert the angle to radians + CGFloat rAngle = self.angle * CPTFloat(M_PI / 180.0); // convert the angle to radians - if ( fabs( tan(rAngle) ) <= CPTFloat(1.0) ) { //for range [-45,45], [135,225] + if ( fabs(tan(rAngle)) <= CPTFloat(1.0)) { // for range [-45,45], [135,225] x = CGRectGetWidth(rect); y = CGRectGetHeight(rect); @@ -1041,12 +1058,12 @@ -(CGShadingRef)newAxialGradientInRect:(CGRect)rect cosA = cos(rAngle); tanA = tan(rAngle); - length = x / fabs(cosA) + ( y - x * fabs(tanA) ) * fabs(sinA); + length = x / fabs(cosA) + (y - x * fabs(tanA)) * fabs(sinA); deltaX = length * cosA / CPTFloat(2.0); deltaY = length * sinA / CPTFloat(2.0); } - else { //for range [45,135], [225,315] + else { // for range [45,135], [225,315] x = CGRectGetHeight(rect); y = CGRectGetWidth(rect); @@ -1056,7 +1073,7 @@ -(CGShadingRef)newAxialGradientInRect:(CGRect)rect cosA = cos(rAngle); tanA = tan(rAngle); - length = x / fabs(cosA) + ( y - x * fabs(tanA) ) * fabs(sinA); + length = x / fabs(cosA) + (y - x * fabs(tanA)) * fabs(sinA); deltaX = -length * sinA / CPTFloat(2.0); deltaY = length * cosA / CPTFloat(2.0); @@ -1071,7 +1088,7 @@ -(CGShadingRef)newAxialGradientInRect:(CGRect)rect return myCGShading; } --(CGShadingRef)newRadialGradientInRect:(CGRect)rect context:(CGContextRef)context +-(nonnull CGShadingRef)newRadialGradientInRect:(CGRect)rect context:(nonnull CGContextRef)context { CGPoint startPoint, endPoint; CGFloat startRadius, endRadius; @@ -1079,15 +1096,15 @@ -(CGShadingRef)newRadialGradientInRect:(CGRect)rect context:(CGContextRef)contex CGPoint theStartAnchor = self.startAnchor; - startPoint = CPTPointMake( fma( CGRectGetWidth(rect), theStartAnchor.x, CGRectGetMinX(rect) ), - fma( CGRectGetHeight(rect), theStartAnchor.y, CGRectGetMinY(rect) ) ); + startPoint = CPTPointMake(fma(CGRectGetWidth(rect), theStartAnchor.x, CGRectGetMinX(rect)), + fma(CGRectGetHeight(rect), theStartAnchor.y, CGRectGetMinY(rect))); CGPoint theEndAnchor = self.endAnchor; - endPoint = CPTPointMake( fma( CGRectGetWidth(rect), theEndAnchor.x, CGRectGetMinX(rect) ), - fma( CGRectGetHeight(rect), theEndAnchor.y, CGRectGetMinY(rect) ) ); + endPoint = CPTPointMake(fma(CGRectGetWidth(rect), theEndAnchor.x, CGRectGetMinX(rect)), + fma(CGRectGetHeight(rect), theEndAnchor.y, CGRectGetMinY(rect))); startRadius = CPTFloat(-1.0); - if ( CGRectGetHeight(rect) > CGRectGetWidth(rect) ) { + if ( CGRectGetHeight(rect) > CGRectGetWidth(rect)) { scaleX = CGRectGetWidth(rect) / CGRectGetHeight(rect); startPoint.x /= scaleX; endPoint.x /= scaleX; @@ -1134,19 +1151,23 @@ -(void)setBlendingMode:(CPTGradientBlendingMode)mode static const CGFloat input_value_range[2] = { 0, 1 }; // range for the evaluator input static const CGFloat output_value_ranges[8] = { 0, 1, 0, 1, 0, 1, 0, 1 }; // ranges for the evaluator output (4 returned values) - self.gradientFunction = CGFunctionCreate( (__bridge void *)(self), //the two transition colors - 1, input_value_range, //number of inputs (just fraction of progression) - 4, output_value_ranges, //number of outputs (4 - RGBa) - &evaluationCallbackInfo ); //info for using the evaluator function + CGFunctionRef cgFunction = CGFunctionCreate((__bridge void *)(self), // the two transition colors + 1, input_value_range, // number of inputs (just fraction of progression) + 4, output_value_ranges, // number of outputs (4 - RGBa) + &evaluationCallbackInfo); // info for using the evaluator function + + if ( cgFunction ) { + self.gradientFunction = cgFunction; + } } --(void)addElement:(CPTGradientElement *)newElement +-(void)addElement:(nonnull CPTGradientElement *)newElement { CPTGradientElement *curElement = self.elementList; - if ( (curElement == NULL) || (newElement->position < curElement->position) ) { + if ((curElement == NULL) || (newElement->position < curElement->position)) { CPTGradientElement *tmpNext = curElement; - CPTGradientElement *newElementList = malloc( sizeof(CPTGradientElement) ); + CPTGradientElement *newElementList = calloc(1, sizeof(CPTGradientElement)); if ( newElementList ) { *newElementList = *newElement; newElementList->nextElement = tmpNext; @@ -1155,13 +1176,13 @@ -(void)addElement:(CPTGradientElement *)newElement } else { while ( curElement->nextElement != NULL && - !( (curElement->position <= newElement->position) && - (newElement->position < curElement->nextElement->position) ) ) { + !((curElement->position <= newElement->position) && + (newElement->position < curElement->nextElement->position))) { curElement = curElement->nextElement; } CPTGradientElement *tmpNext = curElement->nextElement; - curElement->nextElement = malloc( sizeof(CPTGradientElement) ); + curElement->nextElement = calloc(1, sizeof(CPTGradientElement)); *(curElement->nextElement) = *newElement; curElement->nextElement->nextElement = tmpNext; } @@ -1182,7 +1203,7 @@ -(CPTGradientElement)removeElementAtIndex:(NSUInteger)idx return removedElement; } - NSUInteger count = 1; //we want to start one ahead + NSUInteger count = 1; // we want to start one ahead CPTGradientElement *currentElement = self.elementList; while ( currentElement->nextElement != NULL ) { if ( count == idx ) { @@ -1205,7 +1226,7 @@ -(CPTGradientElement)removeElementAtIndex:(NSUInteger)idx removedElement.color.green = CPTFloat(0.0); removedElement.color.blue = CPTFloat(0.0); removedElement.color.alpha = CPTFloat(0.0); - removedElement.position = NAN; + removedElement.position = CPTNAN; removedElement.nextElement = NULL; return removedElement; @@ -1246,7 +1267,7 @@ -(CPTGradientElement)removeElementAtPosition:(CGFloat)position removedElement.color.green = CPTFloat(0.0); removedElement.color.blue = CPTFloat(0.0); removedElement.color.alpha = CPTFloat(0.0); - removedElement.position = NAN; + removedElement.position = CPTNAN; removedElement.nextElement = NULL; return removedElement; @@ -1265,7 +1286,7 @@ -(void)removeAllElements self.elementList = NULL; } --(CPTGradientElement *)elementAtIndex:(NSUInteger)idx +-(nullable CPTGradientElement *)elementAtIndex:(NSUInteger)idx { NSUInteger count = 0; CPTGradientElement *currentElement = self.elementList; @@ -1302,12 +1323,12 @@ -(NSUInteger)elementCount /// @cond -void CPTLinearEvaluation(void *info, const CGFloat *in, CGFloat *out) +void CPTLinearEvaluation(void *__nullable info, const CGFloat *__nonnull in, CGFloat *__nonnull out) { CGFloat position = *in; CPTGradient *gradient = (__bridge CPTGradient *)info; - //This grabs the first two colors in the sequence + // This grabs the first two colors in the sequence CPTGradientElement *color1 = gradient.elementList; if ( color1 == NULL ) { @@ -1317,24 +1338,24 @@ void CPTLinearEvaluation(void *info, const CGFloat *in, CGFloat *out) CPTGradientElement *color2 = color1->nextElement; - //make sure first color and second color are on other sides of position + // make sure first color and second color are on other sides of position while ( color2 != NULL && color2->position < position ) { color1 = color2; color2 = color1->nextElement; } - //if we don't have another color then make next color the same color + // if we don't have another color then make next color the same color if ( color2 == NULL ) { color2 = color1; } - //----------FailSafe settings---------- - //color1->red = 1; color2->red = 0; - //color1->green = 1; color2->green = 0; - //color1->blue = 1; color2->blue = 0; - //color1->alpha = 1; color2->alpha = 1; - //color1->position = 0.5; - //color2->position = 0.5; - //------------------------------------- + // ----------FailSafe settings---------- + // color1->red = 1; color2->red = 0; + // color1->green = 1; color2->green = 0; + // color1->blue = 1; color2->blue = 0; + // color1->alpha = 1; color2->alpha = 1; + // color1->position = 0.5; + // color2->position = 0.5; + // ------------------------------------- if ( position <= color1->position ) { out[0] = color1->color.red; @@ -1349,7 +1370,7 @@ void CPTLinearEvaluation(void *info, const CGFloat *in, CGFloat *out) out[3] = color2->color.alpha; } else { - //adjust position so that it goes from 0 to 1 in the range from color 1 & 2's position + // adjust position so that it goes from 0 to 1 in the range from color 1 & 2's position position = (position - color1->position) / (color2->position - color1->position); out[0] = (color2->color.red - color1->color.red) * position + color1->color.red; @@ -1359,21 +1380,21 @@ void CPTLinearEvaluation(void *info, const CGFloat *in, CGFloat *out) } } -// Chromatic Evaluation - -// This blends colors by their Hue, Saturation, and Value(Brightness) right now I just -// transform the RGB values stored in the CPTGradientElements to HSB, in the future I may -// streamline it to avoid transforming in and out of HSB colorspace *for later* +// Chromatic Evaluation - +// This blends colors by their Hue, Saturation, and Value(Brightness) right now I just +// transform the RGB values stored in the CPTGradientElements to HSB, in the future I may +// streamline it to avoid transforming in and out of HSB colorspace *for later* // -// For the chromatic blend we shift the hue of color1 to meet the hue of color2. To do -// this we will add to the hue's angle (if we subtract we'll be doing the inverse -// chromatic...scroll down more for that). All we need to do is keep adding to the hue -// until we wrap around the color wheel and get to color2. -void CPTChromaticEvaluation(void *info, const CGFloat *in, CGFloat *out) +// For the chromatic blend we shift the hue of color1 to meet the hue of color2. To do +// this we will add to the hue's angle (if we subtract we'll be doing the inverse +// chromatic...scroll down more for that). All we need to do is keep adding to the hue +// until we wrap around the color wheel and get to color2. +void CPTChromaticEvaluation(void *__nullable info, const CGFloat *__nonnull in, CGFloat *__nonnull out) { CGFloat position = *in; CPTGradient *gradient = (__bridge CPTGradient *)info; - //This grabs the first two colors in the sequence + // This grabs the first two colors in the sequence CPTGradientElement *color1 = gradient.elementList; if ( color1 == NULL ) { @@ -1428,7 +1449,7 @@ void CPTChromaticEvaluation(void *info, const CGFloat *in, CGFloat *out) out[3] = c2[3]; } else { - //adjust position so that it goes from 0 to 1 in the range from color 1 & 2's position + // adjust position so that it goes from 0 to 1 in the range from color 1 & 2's position position = (position - color1->position) / (color2->position - color1->position); out[0] = (c2[0] - c1[0]) * position + c1[0]; @@ -1440,17 +1461,17 @@ void CPTChromaticEvaluation(void *info, const CGFloat *in, CGFloat *out) CPTTransformHSV_RGB(out); } -// Inverse Chromatic Evaluation - -// Inverse Chromatic is about the same story as Chromatic Blend, but here the Hue -// is strictly decreasing, that is we need to get from color1 to color2 by decreasing -// the 'angle' (i.e. 90º -> 180º would be done by subtracting 270º and getting -180º... -// which is equivalent to 180º mod 360º -void CPTInverseChromaticEvaluation(void *info, const CGFloat *in, CGFloat *out) +// Inverse Chromatic Evaluation - +// Inverse Chromatic is about the same story as Chromatic Blend, but here the Hue +// is strictly decreasing, that is we need to get from color1 to color2 by decreasing +// the 'angle' (i.e. 90º -> 180º would be done by subtracting 270º and getting -180º... +// which is equivalent to 180º mod 360º +void CPTInverseChromaticEvaluation(void *__nullable info, const CGFloat *__nonnull in, CGFloat *__nonnull out) { CGFloat position = *in; CPTGradient *gradient = (__bridge CPTGradient *)info; - //This grabs the first two colors in the sequence + // This grabs the first two colors in the sequence CPTGradientElement *color1 = gradient.elementList; if ( color1 == NULL ) { @@ -1463,7 +1484,7 @@ void CPTInverseChromaticEvaluation(void *info, const CGFloat *in, CGFloat *out) CGFloat c1[4]; CGFloat c2[4]; - //make sure first color and second color are on other sides of position + // make sure first color and second color are on other sides of position while ( color2 != NULL && color2->position < position ) { color1 = color2; color2 = color1->nextElement; @@ -1488,8 +1509,8 @@ void CPTInverseChromaticEvaluation(void *info, const CGFloat *in, CGFloat *out) CPTTransformRGB_HSV(c2); CPTResolveHSV(c1, c2); - if ( c1[0] < c2[0] ) { //if color1's hue is higher than color2's hue then - c1[0] += CPTFloat(360.0); // we need to move c2 one revolution back on the wheel + if ( c1[0] < c2[0] ) { // if color1's hue is higher than color2's hue then + c1[0] += CPTFloat(360.0); // we need to move c2 one revolution back on the wheel } if ( position <= color1->position ) { out[0] = c1[0]; @@ -1504,7 +1525,7 @@ void CPTInverseChromaticEvaluation(void *info, const CGFloat *in, CGFloat *out) out[3] = c2[3]; } else { - //adjust position so that it goes from 0 to 1 in the range from color 1 & 2's position + // adjust position so that it goes from 0 to 1 in the range from color 1 & 2's position position = (position - color1->position) / (color2->position - color1->position); out[0] = (c2[0] - c1[0]) * position + c1[0]; @@ -1516,9 +1537,9 @@ void CPTInverseChromaticEvaluation(void *info, const CGFloat *in, CGFloat *out) CPTTransformHSV_RGB(out); } -void CPTTransformRGB_HSV(CGFloat *components) //H,S,B -> R,G,B +void CPTTransformRGB_HSV(CGFloat *__nonnull components) // H,S,B -> R,G,B { - CGFloat H = NAN, S, V; + CGFloat H = CPTNAN, S, V; CGFloat R = components[0]; CGFloat G = components[1]; CGFloat B = components[2]; @@ -1549,14 +1570,14 @@ void CPTTransformRGB_HSV(CGFloat *components) //H,S,B -> R,G,B components[2] = V; } -void CPTTransformHSV_RGB(CGFloat *components) //H,S,B -> R,G,B +void CPTTransformHSV_RGB(CGFloat *__nonnull components) // H,S,B -> R,G,B { CGFloat R = CPTFloat(0.0), G = CPTFloat(0.0), B = CPTFloat(0.0); - CGFloat H = fmod( components[0], CPTFloat(360.0) ); //map to [0,360) + CGFloat H = fmod(components[0], CPTFloat(360.0)); // map to [0,360) CGFloat S = components[1]; CGFloat V = components[2]; - int Hi = (int)lrint( floor( H / CPTFloat(60.0) ) ) % 6; + int Hi = (int)lrint(floor(H / CPTFloat(60.0))) % 6; CGFloat f = H / CPTFloat(60.0) - Hi; CGFloat p = V * (CPTFloat(1.0) - S); CGFloat q = V * (CPTFloat(1.0) - f * S); @@ -1608,19 +1629,44 @@ void CPTTransformHSV_RGB(CGFloat *components) //H,S,B -> R,G,B components[2] = B; } -void CPTResolveHSV(CGFloat *color1, CGFloat *color2) // H value may be undefined (i.e. grayscale color) -{ // we want to fill it with a sensible value - if ( isnan(color1[0]) && isnan(color2[0]) ) { +void CPTResolveHSV(CGFloat *__nonnull color1, CGFloat *__nonnull color2) // H value may be undefined (i.e. grayscale color) +{ // we want to fill it with a sensible value + if ( isnan(color1[0]) && isnan(color2[0])) { color1[0] = color2[0] = 0; } - else if ( isnan(color1[0]) ) { + else if ( isnan(color1[0])) { color1[0] = color2[0]; } - else if ( isnan(color2[0]) ) { + else if ( isnan(color2[0])) { color2[0] = color1[0]; } } /// @endcond +#pragma mark - +#pragma mark Debugging + +/// @cond + +-(nullable id)debugQuickLookObject +{ + const CGRect rect = CGRectMake(0.0, 0.0, 100.0, 100.0); + + return CPTQuickLookImage(rect, ^(CGContextRef context, CGFloat __unused scale, CGRect bounds) { + switch ( self.gradientType ) { + case CPTGradientTypeAxial: + CGContextAddRect(context, bounds); + break; + + case CPTGradientTypeRadial: + CGContextAddEllipseInRect(context, bounds); + break; + } + [self fillPathInContext:context]; + }); +} + +/// @endcond + @end diff --git a/framework/Source/CPTGradientTests.m b/framework/Source/CPTGradientTests.m index 5e4118c3d..12fb1d2e3 100644 --- a/framework/Source/CPTGradientTests.m +++ b/framework/Source/CPTGradientTests.m @@ -1,6 +1,7 @@ -#import "CPTGradient.h" #import "CPTGradientTests.h" +#import "CPTGradient.h" + @implementation CPTGradientTests #pragma mark - @@ -10,7 +11,7 @@ -(void)testKeyedArchivingRoundTrip { CPTGradient *gradient = [CPTGradient rainbowGradient]; - CPTGradient *newGradient = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:gradient]]; + CPTGradient *newGradient = [self archiveRoundTrip:gradient]; XCTAssertEqualObjects(gradient, newGradient, @"Gradients not equal"); } diff --git a/framework/Source/CPTGraph.h b/framework/Source/CPTGraph.h index 30f56a1a4..7c4c397ac 100644 --- a/framework/Source/CPTGraph.h +++ b/framework/Source/CPTGraph.h @@ -1,48 +1,58 @@ // Abstract class #import "CPTBorderedLayer.h" #import "CPTDefinitions.h" +#import "CPTPlot.h" +#import "CPTPlotSpace.h" /// @file @class CPTAxisSet; @class CPTGraphHostingView; @class CPTLegend; -@class CPTPlot; @class CPTPlotAreaFrame; -@class CPTPlotSpace; @class CPTTheme; @class CPTTextStyle; @class CPTLayerAnnotation; +/** + * @brief Graph notification type. + **/ +typedef NSString *CPTGraphNotification cpt_swift_struct; + +/** + * @brief The userInfo dictionary keys used by CPTGraph plot space notifications. + **/ +typedef NSString *CPTGraphPlotSpaceKey cpt_swift_struct; + /// @name Graph /// @{ /** @brief Notification sent by various objects to tell the graph it should redraw itself. * @ingroup notification **/ -extern NSString *const CPTGraphNeedsRedrawNotification; +extern CPTGraphNotification __nonnull const CPTGraphNeedsRedrawNotification NS_SWIFT_NAME(needsRedraw); /** @brief Notification sent by a graph after adding a new plot space. * @ingroup notification * * The notification userInfo dictionary will include the new plot space under the - * CPTGraphPlotSpaceNotificationKey key. + * #CPTGraphPlotSpaceNotificationKey key. **/ -extern NSString *const CPTGraphDidAddPlotSpaceNotification; +extern CPTGraphNotification __nonnull const CPTGraphDidAddPlotSpaceNotification NS_SWIFT_NAME(didAddPlotSpace); /** @brief Notification sent by a graph after removing a plot space. * @ingroup notification * * The notification userInfo dictionary will include the removed plot space under the - * CPTGraphPlotSpaceNotificationKey key. + * #CPTGraphPlotSpaceNotificationKey key. **/ -extern NSString *const CPTGraphDidRemovePlotSpaceNotification; +extern CPTGraphNotification __nonnull const CPTGraphDidRemovePlotSpaceNotification NS_SWIFT_NAME(didRemovePlotSpace); -/** @brief The userInfo dictionary key used by the CPTGraphDidAddPlotSpaceNotification - * and CPTGraphDidRemovePlotSpaceNotification notifications for the plot space. +/** @brief The userInfo dictionary key used by the #CPTGraphDidAddPlotSpaceNotification + * and #CPTGraphDidRemovePlotSpaceNotification notifications for the plot space. * @ingroup notification **/ -extern NSString *const CPTGraphPlotSpaceNotificationKey; +extern CPTGraphPlotSpaceKey __nonnull const CPTGraphPlotSpaceNotificationKey; /// @} @@ -64,29 +74,29 @@ typedef NS_ENUM (NSInteger, CPTGraphLayerType) { /// @name Hosting View /// @{ -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTGraphHostingView *hostingView; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGraphHostingView *hostingView; /// @} /// @name Title /// @{ -@property (nonatomic, readwrite, copy) NSString *title; -@property (nonatomic, readwrite, copy) NSAttributedString *attributedTitle; -@property (nonatomic, readwrite, copy) CPTTextStyle *titleTextStyle; +@property (nonatomic, readwrite, copy, nullable) NSString *title; +@property (nonatomic, readwrite, copy, nullable) NSAttributedString *attributedTitle; +@property (nonatomic, readwrite, copy, nullable) CPTTextStyle *titleTextStyle; @property (nonatomic, readwrite, assign) CGPoint titleDisplacement; @property (nonatomic, readwrite, assign) CPTRectAnchor titlePlotAreaFrameAnchor; /// @} /// @name Layers /// @{ -@property (nonatomic, readwrite, strong) CPTAxisSet *axisSet; -@property (nonatomic, readwrite, strong) CPTPlotAreaFrame *plotAreaFrame; -@property (nonatomic, readonly) CPTPlotSpace *defaultPlotSpace; -@property (nonatomic, readwrite, strong) NSArray *topDownLayerOrder; +@property (nonatomic, readwrite, strong, nullable) CPTAxisSet *axisSet; +@property (nonatomic, readwrite, strong, nullable) CPTPlotAreaFrame *plotAreaFrame; +@property (nonatomic, readonly, nullable) CPTPlotSpace *defaultPlotSpace; +@property (nonatomic, readwrite, strong, nullable) CPTNumberArray *topDownLayerOrder; /// @} /// @name Legend /// @{ -@property (nonatomic, readwrite, strong) CPTLegend *legend; +@property (nonatomic, readwrite, strong, nullable) CPTLegend *legend; @property (nonatomic, readwrite, assign) CPTRectAnchor legendAnchor; @property (nonatomic, readwrite, assign) CGPoint legendDisplacement; /// @} @@ -99,37 +109,37 @@ typedef NS_ENUM (NSInteger, CPTGraphLayerType) { /// @name Retrieving Plots /// @{ --(NSArray *)allPlots; --(CPTPlot *)plotAtIndex:(NSUInteger)idx; --(CPTPlot *)plotWithIdentifier:(id)identifier; +-(nonnull CPTPlotArray *)allPlots; +-(nullable CPTPlot *)plotAtIndex:(NSUInteger)idx; +-(nullable CPTPlot *)plotWithIdentifier:(nullable id)identifier; /// @} /// @name Adding and Removing Plots /// @{ --(void)addPlot:(CPTPlot *)plot; --(void)addPlot:(CPTPlot *)plot toPlotSpace:(CPTPlotSpace *)space; --(void)removePlot:(CPTPlot *)plot; --(void)removePlotWithIdentifier:(id)identifier; --(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx; --(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx intoPlotSpace:(CPTPlotSpace *)space; +-(void)addPlot:(nonnull CPTPlot *)plot; +-(void)addPlot:(nonnull CPTPlot *)plot toPlotSpace:(nullable CPTPlotSpace *)space; +-(void)removePlot:(nullable CPTPlot *)plot; +-(void)removePlotWithIdentifier:(nullable id)identifier; +-(void)insertPlot:(nonnull CPTPlot *)plot atIndex:(NSUInteger)idx; +-(void)insertPlot:(nonnull CPTPlot *)plot atIndex:(NSUInteger)idx intoPlotSpace:(nullable CPTPlotSpace *)space; /// @} /// @name Retrieving Plot Spaces /// @{ --(NSArray *)allPlotSpaces; --(CPTPlotSpace *)plotSpaceAtIndex:(NSUInteger)idx; --(CPTPlotSpace *)plotSpaceWithIdentifier:(id)identifier; +-(nonnull CPTPlotSpaceArray *)allPlotSpaces; +-(nullable CPTPlotSpace *)plotSpaceAtIndex:(NSUInteger)idx; +-(nullable CPTPlotSpace *)plotSpaceWithIdentifier:(nullable id)identifier; /// @} /// @name Adding and Removing Plot Spaces /// @{ --(void)addPlotSpace:(CPTPlotSpace *)space; --(void)removePlotSpace:(CPTPlotSpace *)plotSpace; +-(void)addPlotSpace:(nonnull CPTPlotSpace *)space; +-(void)removePlotSpace:(nullable CPTPlotSpace *)plotSpace; /// @} /// @name Themes /// @{ --(void)applyTheme:(CPTTheme *)theme; +-(void)applyTheme:(nullable CPTTheme *)theme; /// @} @end @@ -143,8 +153,8 @@ typedef NS_ENUM (NSInteger, CPTGraphLayerType) { /// @name Factory Methods /// @{ --(CPTPlotSpace *)newPlotSpace; --(CPTAxisSet *)newAxisSet; +-(nullable CPTPlotSpace *)newPlotSpace; +-(nullable CPTAxisSet *)newAxisSet; /// @} @end diff --git a/framework/Source/CPTGraph.m b/framework/Source/CPTGraph.m index 71f711547..9255efe02 100644 --- a/framework/Source/CPTGraph.m +++ b/framework/Source/CPTGraph.m @@ -7,11 +7,9 @@ #import "CPTLayerAnnotation.h" #import "CPTLegend.h" #import "CPTMutableTextStyle.h" -#import "CPTPlot.h" #import "CPTPlotArea.h" #import "CPTPlotAreaFrame.h" #import "CPTPlotGroup.h" -#import "CPTPlotSpace.h" #import "CPTTextLayer.h" #import "CPTTheme.h" #import "NSCoderExtensions.h" @@ -19,26 +17,26 @@ /** @defgroup graphAnimation Graphs * @brief Graph properties that can be animated using Core Animation. * @if MacOnly - * @since Custom layer property animation is supported on MacOS 10.6 and later. + * @since Custom layer property animation is supported on macOS 10.6 and later. * @endif * @ingroup animation **/ -NSString *const CPTGraphNeedsRedrawNotification = @"CPTGraphNeedsRedrawNotification"; -NSString *const CPTGraphDidAddPlotSpaceNotification = @"CPTGraphDidAddPlotSpaceNotification"; -NSString *const CPTGraphDidRemovePlotSpaceNotification = @"CPTGraphDidRemovePlotSpaceNotification"; -NSString *const CPTGraphPlotSpaceNotificationKey = @"CPTGraphPlotSpaceNotificationKey"; +CPTGraphNotification const CPTGraphNeedsRedrawNotification = @"CPTGraphNeedsRedrawNotification"; +CPTGraphNotification const CPTGraphDidAddPlotSpaceNotification = @"CPTGraphDidAddPlotSpaceNotification"; +CPTGraphNotification const CPTGraphDidRemovePlotSpaceNotification = @"CPTGraphDidRemovePlotSpaceNotification"; +CPTGraphPlotSpaceKey const CPTGraphPlotSpaceNotificationKey = @"CPTGraphPlotSpaceNotificationKey"; /// @cond @interface CPTGraph() -@property (nonatomic, readwrite, strong) NSMutableArray *plots; -@property (nonatomic, readwrite, strong) NSMutableArray *plotSpaces; -@property (nonatomic, readwrite, strong) CPTLayerAnnotation *titleAnnotation; -@property (nonatomic, readwrite, strong) CPTLayerAnnotation *legendAnnotation; +@property (nonatomic, readwrite, strong, nonnull) CPTMutablePlotArray *plots; +@property (nonatomic, readwrite, strong, nonnull) CPTMutablePlotSpaceArray *plotSpaces; +@property (nonatomic, readwrite, strong, nullable) CPTLayerAnnotation *titleAnnotation; +@property (nonatomic, readwrite, strong, nullable) CPTLayerAnnotation *legendAnnotation; @property (nonatomic, readwrite, assign) BOOL inTitleUpdate; --(void)plotSpaceMappingDidChange:(NSNotification *)notif; +-(void)plotSpaceMappingDidChange:(nonnull NSNotification *)notif; -(CGPoint)contentAnchorForRectAnchor:(CPTRectAnchor)anchor; @end @@ -68,54 +66,54 @@ -(CGPoint)contentAnchorForRectAnchor:(CPTRectAnchor)anchor; **/ @implementation CPTGraph -/** @property cpt_weak CPTGraphHostingView *hostingView +/** @property nullable CPTGraphHostingView *hostingView * @brief The hosting view that contains the graph. **/ @synthesize hostingView; -/** @property CPTAxisSet *axisSet +/** @property nullable CPTAxisSet *axisSet * @brief The axis set. **/ @dynamic axisSet; -/** @property CPTPlotAreaFrame *plotAreaFrame +/** @property nullable CPTPlotAreaFrame *plotAreaFrame * @brief The plot area frame. **/ @synthesize plotAreaFrame; /// @cond -/** @property NSMutableArray *plots +/** @property nonnull CPTMutablePlotArray *plots * @brief An array of all plots associated with the graph. **/ @synthesize plots; -/** @property NSMutableArray *plotSpaces +/** @property nonnull CPTMutablePlotSpaceArray *plotSpaces * @brief An array of all plot spaces associated with the graph. **/ @synthesize plotSpaces; /// @endcond -/** @property CPTPlotSpace *defaultPlotSpace +/** @property nullable CPTPlotSpace *defaultPlotSpace * @brief The default plot space. **/ @dynamic defaultPlotSpace; -/** @property NSArray *topDownLayerOrder +/** @property nullable CPTNumberArray *topDownLayerOrder * @brief An array of graph layers to be drawn in an order other than the default. * @see CPTPlotArea @link CPTPlotArea::topDownLayerOrder topDownLayerOrder @endlink property. **/ @dynamic topDownLayerOrder; -/** @property NSString *title +/** @property nullable NSString *title * @brief The title string. * * Assigning a new value to this property also sets the value of the @ref attributedTitle property to @nil. **/ @synthesize title; -/** @property NSAttributedString *attributedTitle +/** @property nullable NSAttributedString *attributedTitle * @brief The styled title string. * * Assigning a new value to this property also sets the value of the @ref title property to the @@ -125,7 +123,7 @@ @implementation CPTGraph **/ @synthesize attributedTitle; -/** @property CPTTextStyle *titleTextStyle +/** @property nullable CPTTextStyle *titleTextStyle * @brief The text style of the title. * * Assigning a new value to this property also sets the value of the @ref attributedTitle property to @nil. @@ -144,7 +142,7 @@ @implementation CPTGraph **/ @synthesize titleDisplacement; -/** @property CPTLegend *legend +/** @property nullable CPTLegend *legend * @brief The graph legend. * Setting this property will automatically anchor the legend to the graph and position it * using the @ref legendAnchor and @ref legendDisplacement properties. This is a convenience property @@ -200,9 +198,9 @@ @implementation CPTGraph * @param newFrame The frame rectangle. * @return The initialized CPTGraph object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { hostingView = nil; plots = [[NSMutableArray alloc] init]; @@ -250,9 +248,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTGraph *theLayer = (CPTGraph *)layer; hostingView = theLayer->hostingView; @@ -286,7 +284,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -309,13 +307,16 @@ -(void)encodeWithCoder:(NSCoder *)coder // inTitleUpdate } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - hostingView = [coder decodeObjectForKey:@"CPTGraph.hostingView"]; - plotAreaFrame = [coder decodeObjectForKey:@"CPTGraph.plotAreaFrame"]; - - NSArray *plotArray = [coder decodeObjectForKey:@"CPTGraph.plots"]; + if ((self = [super initWithCoder:coder])) { + hostingView = [coder decodeObjectOfClass:[CPTGraphHostingView class] + forKey:@"CPTGraph.hostingView"]; + plotAreaFrame = [coder decodeObjectOfClass:[CPTPlotAreaFrame class] + forKey:@"CPTGraph.plotAreaFrame"]; + + CPTPlotArray *plotArray = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTPlot class]]] + forKey:@"CPTGraph.plots"]; if ( plotArray ) { plots = [plotArray mutableCopy]; } @@ -323,24 +324,32 @@ -(instancetype)initWithCoder:(NSCoder *)coder plots = [[NSMutableArray alloc] init]; } - NSArray *plotSpaceArray = [coder decodeObjectForKey:@"CPTGraph.plotSpaces"]; + plotSpaces = [[NSMutableArray alloc] init]; + + CPTPlotSpaceArray *plotSpaceArray = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTPlotSpace class]]] + forKey:@"CPTGraph.plotSpaces"]; if ( plotSpaceArray ) { - plotSpaces = [plotSpaceArray mutableCopy]; - } - else { - plotSpaces = [[NSMutableArray alloc] init]; + for ( CPTPlotSpace *space in plotSpaceArray ) { + [self addPlotSpace:space]; + } } - title = [[coder decodeObjectForKey:@"CPTGraph.title"] copy]; - attributedTitle = [[coder decodeObjectForKey:@"CPTGraph.attributedTitle"] copy]; - titleTextStyle = [[coder decodeObjectForKey:@"CPTGraph.titleTextStyle"] copy]; - titlePlotAreaFrameAnchor = (CPTRectAnchor)[coder decodeIntegerForKey : @"CPTGraph.titlePlotAreaFrameAnchor"]; + title = [[coder decodeObjectOfClass:[NSString class] + forKey:@"CPTGraph.title"] copy]; + attributedTitle = [[coder decodeObjectOfClass:[NSAttributedString class] + forKey:@"CPTGraph.attributedTitle"] copy]; + titleTextStyle = [[coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTGraph.titleTextStyle"] copy]; + titlePlotAreaFrameAnchor = (CPTRectAnchor)[coder decodeIntegerForKey:@"CPTGraph.titlePlotAreaFrameAnchor"]; titleDisplacement = [coder decodeCPTPointForKey:@"CPTGraph.titleDisplacement"]; - titleAnnotation = [coder decodeObjectForKey:@"CPTGraph.titleAnnotation"]; - legend = [coder decodeObjectForKey:@"CPTGraph.legend"]; - legendAnnotation = [coder decodeObjectForKey:@"CPTGraph.legendAnnotation"]; - legendAnchor = (CPTRectAnchor)[coder decodeIntegerForKey : @"CPTGraph.legendAnchor"]; - legendDisplacement = [coder decodeCPTPointForKey:@"CPTGraph.legendDisplacement"]; + titleAnnotation = [coder decodeObjectOfClass:[CPTLayerAnnotation class] + forKey:@"CPTGraph.titleAnnotation"]; + legend = [coder decodeObjectOfClass:[CPTLegend class] + forKey:@"CPTGraph.legend"]; + legendAnnotation = [coder decodeObjectOfClass:[CPTLayerAnnotation class] + forKey:@"CPTGraph.legendAnnotation"]; + legendAnchor = (CPTRectAnchor)[coder decodeIntegerForKey:@"CPTGraph.legendAnchor"]; + legendDisplacement = [coder decodeCPTPointForKey:@"CPTGraph.legendDisplacement"]; inTitleUpdate = NO; } @@ -349,16 +358,64 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing /// @cond --(void)layoutAndRenderInContext:(CGContextRef)context +-(void)layoutAndRenderInContext:(nonnull CGContextRef)context { [self reloadDataIfNeeded]; [self.axisSet.axes makeObjectsPerformSelector:@selector(relabel)]; - [super layoutAndRenderInContext:context]; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundeclared-selector" +#if TARGET_OS_OSX + // Workaround since @available macro is not there + if ( [NSView instancesRespondToSelector:@selector(effectiveAppearance)] ) { + NSAppearance *oldAppearance = NSAppearance.currentAppearance; + NSView *view = (NSView *)self.hostingView; + NSAppearance.currentAppearance = view.effectiveAppearance; + [super layoutAndRenderInContext:context]; + NSAppearance.currentAppearance = oldAppearance; + } + else { + [super layoutAndRenderInContext:context]; + } +#else + if ( @available(iOS 13, *)) { + if ( [UITraitCollection instancesRespondToSelector:@selector(performAsCurrentTraitCollection:)] ) { + UITraitCollection *traitCollection = ((UIView *)self.hostingView).traitCollection; + if ( traitCollection ) { + [traitCollection performAsCurrentTraitCollection: ^{ + [super layoutAndRenderInContext:context]; + }]; + } + else { + [super layoutAndRenderInContext:context]; + } + } + else { + [super layoutAndRenderInContext:context]; + } + } + else { + [super layoutAndRenderInContext:context]; + } +#endif +#pragma clang diagnostic pop } /// @endcond @@ -368,9 +425,9 @@ -(void)layoutAndRenderInContext:(CGContextRef)context /// @cond -+(BOOL)needsDisplayForKey:(NSString *)aKey ++(BOOL)needsDisplayForKey:(nonnull NSString *)aKey { - static NSSet *keys = nil; + static NSSet *keys = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ @@ -411,7 +468,7 @@ -(void)reloadDataIfNeeded /** @brief All plots associated with the graph. * @return An array of all plots associated with the graph. **/ --(NSArray *)allPlots +-(nonnull CPTPlotArray *)allPlots { return [NSArray arrayWithArray:self.plots]; } @@ -420,19 +477,24 @@ -(NSArray *)allPlots * @param idx An index within the bounds of the plot array. * @return The plot at the given index. **/ --(CPTPlot *)plotAtIndex:(NSUInteger)idx +-(nullable CPTPlot *)plotAtIndex:(NSUInteger)idx { - return (self.plots)[idx]; + if ( idx < self.plots.count ) { + return (self.plots)[idx]; + } + else { + return nil; + } } /** @brief Gets the plot with the given identifier from the plot array. * @param identifier A plot identifier. * @return The plot with the given identifier or @nil if it was not found. **/ --(CPTPlot *)plotWithIdentifier:(id)identifier +-(nullable CPTPlot *)plotWithIdentifier:(nullable id)identifier { for ( CPTPlot *plot in self.plots ) { - if ( [[plot identifier] isEqual:identifier] ) { + if ( [plot.identifier isEqual:identifier] ) { return plot; } } @@ -445,7 +507,7 @@ -(CPTPlot *)plotWithIdentifier:(id)identifier /** @brief Add a plot to the default plot space. * @param plot The plot. **/ --(void)addPlot:(CPTPlot *)plot +-(void)addPlot:(nonnull CPTPlot *)plot { [self addPlot:plot toPlotSpace:self.defaultPlotSpace]; } @@ -454,7 +516,7 @@ -(void)addPlot:(CPTPlot *)plot * @param plot The plot. * @param space The plot space. **/ --(void)addPlot:(CPTPlot *)plot toPlotSpace:(CPTPlotSpace *)space +-(void)addPlot:(nonnull CPTPlot *)plot toPlotSpace:(nullable CPTPlotSpace *)space { if ( plot ) { [self.plots addObject:plot]; @@ -467,16 +529,20 @@ -(void)addPlot:(CPTPlot *)plot toPlotSpace:(CPTPlotSpace *)space /** @brief Remove a plot from the graph. * @param plot The plot to remove. **/ --(void)removePlot:(CPTPlot *)plot +-(void)removePlot:(nullable CPTPlot *)plot { - if ( [self.plots containsObject:plot] ) { - plot.plotSpace = nil; - plot.graph = nil; - [self.plotAreaFrame.plotGroup removePlot:plot]; - [self.plots removeObject:plot]; - } - else { - [NSException raise:CPTException format:@"Tried to remove CPTPlot which did not exist."]; + if ( plot ) { + CPTPlot *thePlot = plot; + + if ( [self.plots containsObject:thePlot] ) { + thePlot.plotSpace = nil; + thePlot.graph = nil; + [self.plotAreaFrame.plotGroup removePlot:thePlot]; + [self.plots removeObject:thePlot]; + } + else { + [NSException raise:CPTException format:@"Tried to remove CPTPlot which did not exist."]; + } } } @@ -484,7 +550,7 @@ -(void)removePlot:(CPTPlot *)plot * @param plot The plot. * @param idx An index within the bounds of the plot array. **/ --(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx +-(void)insertPlot:(nonnull CPTPlot *)plot atIndex:(NSUInteger)idx { [self insertPlot:plot atIndex:idx intoPlotSpace:self.defaultPlotSpace]; } @@ -494,7 +560,7 @@ -(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx * @param idx An index within the bounds of the plot array. * @param space The plot space. **/ --(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx intoPlotSpace:(CPTPlotSpace *)space +-(void)insertPlot:(nonnull CPTPlot *)plot atIndex:(NSUInteger)idx intoPlotSpace:(nullable CPTPlotSpace *)space { if ( plot ) { [self.plots insertObject:plot atIndex:idx]; @@ -507,7 +573,7 @@ -(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx intoPlotSpace:(CPTPlot /** @brief Remove a plot from the graph. * @param identifier The identifier of the plot to remove. **/ --(void)removePlotWithIdentifier:(id)identifier +-(void)removePlotWithIdentifier:(nullable id)identifier { CPTPlot *plotToRemove = [self plotWithIdentifier:identifier]; @@ -522,7 +588,7 @@ -(void)removePlotWithIdentifier:(id)identifier #pragma mark - #pragma mark Retrieving Plot Spaces --(CPTPlotSpace *)defaultPlotSpace +-(nullable CPTPlotSpace *)defaultPlotSpace { return self.plotSpaces.count > 0 ? (self.plotSpaces)[0] : nil; } @@ -530,7 +596,7 @@ -(CPTPlotSpace *)defaultPlotSpace /** @brief All plot spaces associated with the graph. * @return An array of all plot spaces associated with the graph. **/ --(NSArray *)allPlotSpaces +-(nonnull CPTPlotSpaceArray *)allPlotSpaces { return [NSArray arrayWithArray:self.plotSpaces]; } @@ -539,7 +605,7 @@ -(NSArray *)allPlotSpaces * @param idx An index within the bounds of the plot space array. * @return The plot space at the given index. **/ --(CPTPlotSpace *)plotSpaceAtIndex:(NSUInteger)idx +-(nullable CPTPlotSpace *)plotSpaceAtIndex:(NSUInteger)idx { return self.plotSpaces.count > idx ? (self.plotSpaces)[idx] : nil; } @@ -548,10 +614,10 @@ -(CPTPlotSpace *)plotSpaceAtIndex:(NSUInteger)idx * @param identifier A plot space identifier. * @return The plot space with the given identifier or @nil if it was not found. **/ --(CPTPlotSpace *)plotSpaceWithIdentifier:(id)identifier +-(nullable CPTPlotSpace *)plotSpaceWithIdentifier:(nullable id)identifier { for ( CPTPlotSpace *plotSpace in self.plotSpaces ) { - if ( [[plotSpace identifier] isEqual:identifier] ) { + if ( [plotSpace.identifier isEqual:identifier] ) { return plotSpace; } } @@ -563,14 +629,21 @@ -(CPTPlotSpace *)plotSpaceWithIdentifier:(id)identifier /// @cond --(void)setPlotAreaFrame:(CPTPlotAreaFrame *)newArea +-(void)setPlotAreaFrame:(nullable CPTPlotAreaFrame *)newArea { if ( plotAreaFrame != newArea ) { plotAreaFrame.graph = nil; [plotAreaFrame removeFromSuperlayer]; + plotAreaFrame = newArea; - [self addSublayer:newArea]; - plotAreaFrame.graph = self; + + if ( newArea ) { + CPTPlotAreaFrame *theFrame = newArea; + + [self addSublayer:theFrame]; + theFrame.graph = self; + } + for ( CPTPlotSpace *space in self.plotSpaces ) { space.graph = self; } @@ -585,8 +658,10 @@ -(void)setPlotAreaFrame:(CPTPlotAreaFrame *)newArea /** @brief Add a plot space to the graph. * @param space The plot space. **/ --(void)addPlotSpace:(CPTPlotSpace *)space +-(void)addPlotSpace:(nonnull CPTPlotSpace *)space { + NSParameterAssert(space); + [self.plotSpaces addObject:space]; space.graph = self; @@ -604,31 +679,35 @@ -(void)addPlotSpace:(CPTPlotSpace *)space /** @brief Remove a plot space from the graph. * @param plotSpace The plot space. **/ --(void)removePlotSpace:(CPTPlotSpace *)plotSpace +-(void)removePlotSpace:(nullable CPTPlotSpace *)plotSpace { - if ( [self.plotSpaces containsObject:plotSpace] ) { - [[NSNotificationCenter defaultCenter] removeObserver:self - name:CPTPlotSpaceCoordinateMappingDidChangeNotification - object:plotSpace]; - - // Remove space - plotSpace.graph = nil; - [self.plotSpaces removeObject:plotSpace]; - - // Update axes that referenced space - for ( CPTAxis *axis in self.axisSet.axes ) { - if ( axis.plotSpace == plotSpace ) { - axis.plotSpace = nil; + if ( plotSpace ) { + CPTPlotSpace *thePlotSpace = plotSpace; + + if ( [self.plotSpaces containsObject:thePlotSpace] ) { + [[NSNotificationCenter defaultCenter] removeObserver:self + name:CPTPlotSpaceCoordinateMappingDidChangeNotification + object:thePlotSpace]; + + // Remove space + thePlotSpace.graph = nil; + [self.plotSpaces removeObject:thePlotSpace]; + + // Update axes that referenced space + for ( CPTAxis *axis in self.axisSet.axes ) { + if ( axis.plotSpace == thePlotSpace ) { + axis.plotSpace = nil; + } } - } - [[NSNotificationCenter defaultCenter] postNotificationName:CPTGraphDidRemovePlotSpaceNotification - object:self - userInfo:@{ CPTGraphPlotSpaceNotificationKey: plotSpace } - ]; - } - else { - [NSException raise:CPTException format:@"Tried to remove CPTPlotSpace which did not exist."]; + [[NSNotificationCenter defaultCenter] postNotificationName:CPTGraphDidRemovePlotSpaceNotification + object:self + userInfo:@{ CPTGraphPlotSpaceNotificationKey: thePlotSpace } + ]; + } + else { + [NSException raise:CPTException format:@"Tried to remove CPTPlotSpace which did not exist."]; + } } } @@ -637,7 +716,7 @@ -(void)removePlotSpace:(CPTPlotSpace *)plotSpace /// @cond --(void)plotSpaceMappingDidChange:(NSNotification *)notif +-(void)plotSpaceMappingDidChange:(nonnull NSNotification *)notif { CPTPlotSpace *plotSpace = notif.object; BOOL backgroundBandsNeedRedraw = NO; @@ -669,12 +748,12 @@ -(void)plotSpaceMappingDidChange:(NSNotification *)notif /// @cond --(CPTAxisSet *)axisSet +-(nullable CPTAxisSet *)axisSet { return self.plotAreaFrame.axisSet; } --(void)setAxisSet:(CPTAxisSet *)newSet +-(void)setAxisSet:(nullable CPTAxisSet *)newSet { self.plotAreaFrame.axisSet = newSet; } @@ -687,7 +766,7 @@ -(void)setAxisSet:(CPTAxisSet *)newSet /** @brief Apply a theme to style the graph. * @param theme The theme object used to style the graph. **/ --(void)applyTheme:(CPTTheme *)theme +-(void)applyTheme:(nullable CPTTheme *)theme { [theme applyThemeToGraph:self]; } @@ -697,7 +776,7 @@ -(void)applyTheme:(CPTTheme *)theme /// @cond --(void)setLegend:(CPTLegend *)newLegend +-(void)setLegend:(nullable CPTLegend *)newLegend { if ( newLegend != legend ) { legend = newLegend; @@ -739,7 +818,7 @@ -(void)setLegendAnchor:(CPTRectAnchor)newLegendAnchor -(void)setLegendDisplacement:(CGPoint)newLegendDisplacement { - if ( !CGPointEqualToPoint(newLegendDisplacement, legendDisplacement) ) { + if ( !CGPointEqualToPoint(newLegendDisplacement, legendDisplacement)) { legendDisplacement = newLegendDisplacement; self.legendAnnotation.displacement = newLegendDisplacement; } @@ -800,7 +879,7 @@ -(CGPoint)contentAnchorForRectAnchor:(CPTRectAnchor)anchor -(void)setPaddingLeft:(CGFloat)newPadding { if ( newPadding != self.paddingLeft ) { - [super setPaddingLeft:newPadding]; + super.paddingLeft = newPadding; [self.axisSet.axes makeObjectsPerformSelector:@selector(setNeedsDisplay)]; } } @@ -808,7 +887,7 @@ -(void)setPaddingLeft:(CGFloat)newPadding -(void)setPaddingRight:(CGFloat)newPadding { if ( newPadding != self.paddingRight ) { - [super setPaddingRight:newPadding]; + super.paddingRight = newPadding; [self.axisSet.axes makeObjectsPerformSelector:@selector(setNeedsDisplay)]; } } @@ -816,7 +895,7 @@ -(void)setPaddingRight:(CGFloat)newPadding -(void)setPaddingTop:(CGFloat)newPadding { if ( newPadding != self.paddingTop ) { - [super setPaddingTop:newPadding]; + super.paddingTop = newPadding; [self.axisSet.axes makeObjectsPerformSelector:@selector(setNeedsDisplay)]; } } @@ -824,22 +903,22 @@ -(void)setPaddingTop:(CGFloat)newPadding -(void)setPaddingBottom:(CGFloat)newPadding { if ( newPadding != self.paddingBottom ) { - [super setPaddingBottom:newPadding]; + super.paddingBottom = newPadding; [self.axisSet.axes makeObjectsPerformSelector:@selector(setNeedsDisplay)]; } } --(NSArray *)topDownLayerOrder +-(nullable CPTNumberArray *)topDownLayerOrder { return self.plotAreaFrame.plotArea.topDownLayerOrder; } --(void)setTopDownLayerOrder:(NSArray *)newArray +-(void)setTopDownLayerOrder:(nullable CPTNumberArray *)newArray { self.plotAreaFrame.plotArea.topDownLayerOrder = newArray; } --(void)setTitle:(NSString *)newTitle +-(void)setTitle:(nullable NSString *)newTitle { if ( newTitle != title ) { title = [newTitle copy]; @@ -853,17 +932,20 @@ -(void)setTitle:(NSString *)newTitle if ( title ) { if ( theTitleAnnotation ) { - ( (CPTTextLayer *)theTitleAnnotation.contentLayer ).text = title; + ((CPTTextLayer *)theTitleAnnotation.contentLayer).text = title; } else { - CPTLayerAnnotation *newTitleAnnotation = [[CPTLayerAnnotation alloc] initWithAnchorLayer:self.plotAreaFrame]; - CPTTextLayer *newTextLayer = [[CPTTextLayer alloc] initWithText:title style:self.titleTextStyle]; - newTitleAnnotation.contentLayer = newTextLayer; - newTitleAnnotation.displacement = self.titleDisplacement; - newTitleAnnotation.rectAnchor = self.titlePlotAreaFrameAnchor; - newTitleAnnotation.contentAnchorPoint = [self contentAnchorForRectAnchor:self.titlePlotAreaFrameAnchor]; - [self addAnnotation:newTitleAnnotation]; - self.titleAnnotation = newTitleAnnotation; + CPTPlotAreaFrame *frameLayer = self.plotAreaFrame; + if ( frameLayer ) { + CPTLayerAnnotation *newTitleAnnotation = [[CPTLayerAnnotation alloc] initWithAnchorLayer:frameLayer]; + CPTTextLayer *newTextLayer = [[CPTTextLayer alloc] initWithText:title style:self.titleTextStyle]; + newTitleAnnotation.contentLayer = newTextLayer; + newTitleAnnotation.displacement = self.titleDisplacement; + newTitleAnnotation.rectAnchor = self.titlePlotAreaFrameAnchor; + newTitleAnnotation.contentAnchorPoint = [self contentAnchorForRectAnchor:self.titlePlotAreaFrameAnchor]; + [self addAnnotation:newTitleAnnotation]; + self.titleAnnotation = newTitleAnnotation; + } } } else { @@ -876,7 +958,7 @@ -(void)setTitle:(NSString *)newTitle } } --(void)setAttributedTitle:(NSAttributedString *)newTitle +-(void)setAttributedTitle:(nullable NSAttributedString *)newTitle { if ( newTitle != attributedTitle ) { attributedTitle = [newTitle copy]; @@ -892,17 +974,20 @@ -(void)setAttributedTitle:(NSAttributedString *)newTitle self.title = [attributedTitle.string copy]; if ( theTitleAnnotation ) { - ( (CPTTextLayer *)theTitleAnnotation.contentLayer ).attributedText = attributedTitle; + ((CPTTextLayer *)theTitleAnnotation.contentLayer).attributedText = attributedTitle; } else { - CPTLayerAnnotation *newTitleAnnotation = [[CPTLayerAnnotation alloc] initWithAnchorLayer:self.plotAreaFrame]; - CPTTextLayer *newTextLayer = [[CPTTextLayer alloc] initWithAttributedText:attributedTitle]; - newTitleAnnotation.contentLayer = newTextLayer; - newTitleAnnotation.displacement = self.titleDisplacement; - newTitleAnnotation.rectAnchor = self.titlePlotAreaFrameAnchor; - newTitleAnnotation.contentAnchorPoint = [self contentAnchorForRectAnchor:self.titlePlotAreaFrameAnchor]; - [self addAnnotation:newTitleAnnotation]; - self.titleAnnotation = newTitleAnnotation; + CPTPlotAreaFrame *frameLayer = self.plotAreaFrame; + if ( frameLayer ) { + CPTLayerAnnotation *newTitleAnnotation = [[CPTLayerAnnotation alloc] initWithAnchorLayer:frameLayer]; + CPTTextLayer *newTextLayer = [[CPTTextLayer alloc] initWithAttributedText:attributedTitle]; + newTitleAnnotation.contentLayer = newTextLayer; + newTitleAnnotation.displacement = self.titleDisplacement; + newTitleAnnotation.rectAnchor = self.titlePlotAreaFrameAnchor; + newTitleAnnotation.contentAnchorPoint = [self contentAnchorForRectAnchor:self.titlePlotAreaFrameAnchor]; + [self addAnnotation:newTitleAnnotation]; + self.titleAnnotation = newTitleAnnotation; + } } } else { @@ -920,7 +1005,7 @@ -(void)setAttributedTitle:(NSAttributedString *)newTitle } } --(void)setTitleTextStyle:(CPTTextStyle *)newStyle +-(void)setTitleTextStyle:(nullable CPTTextStyle *)newStyle { if ( newStyle != titleTextStyle ) { titleTextStyle = [newStyle copy]; @@ -940,7 +1025,7 @@ -(void)setTitleTextStyle:(CPTTextStyle *)newStyle -(void)setTitleDisplacement:(CGPoint)newDisplace { - if ( !CGPointEqualToPoint(newDisplace, titleDisplacement) ) { + if ( !CGPointEqualToPoint(newDisplace, titleDisplacement)) { titleDisplacement = newDisplace; self.titleAnnotation.displacement = newDisplace; @@ -988,7 +1073,7 @@ -(void)setTitlePlotAreaFrameAnchor:(CPTRectAnchor)newAnchor * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { // Plots for ( CPTPlot *plot in [self.plots reverseObjectEnumerator] ) { @@ -1049,7 +1134,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { BOOL handledEvent = NO; @@ -1080,7 +1165,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio // Plot spaces do not block events, because several spaces may need to receive // the same event sequence (e.g., dragging coordinate translation) for ( CPTPlotSpace *space in self.plotSpaces ) { - if ( !handledEvent || (handledEvent && space.isDragging) ) { + if ( !handledEvent || (handledEvent && space.isDragging)) { BOOL handled = [space pointingDeviceUpEvent:event atPoint:interactionPoint]; handledEvent |= handled; } @@ -1114,7 +1199,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDraggedEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { // Plots for ( CPTPlot *plot in [self.plots reverseObjectEnumerator] ) { @@ -1175,7 +1260,7 @@ -(BOOL)pointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)inter * @param event The OS event. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceCancelledEvent:(CPTNativeEvent *)event +-(BOOL)pointingDeviceCancelledEvent:(nonnull CPTNativeEvent *)event { // Plots for ( CPTPlot *plot in [self.plots reverseObjectEnumerator] ) { @@ -1214,7 +1299,7 @@ -(BOOL)pointingDeviceCancelledEvent:(CPTNativeEvent *)event } } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else /** @@ -1236,7 +1321,7 @@ -(BOOL)pointingDeviceCancelledEvent:(CPTNativeEvent *)event * @param toPoint The ending coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)scrollWheelEvent:(CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint +-(BOOL)scrollWheelEvent:(nonnull CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint { // Plots for ( CPTPlot *plot in [self.plots reverseObjectEnumerator] ) { @@ -1274,6 +1359,7 @@ -(BOOL)scrollWheelEvent:(CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toP return [super scrollWheelEvent:event fromPoint:fromPoint toPoint:toPoint]; } } + #endif /// @} @@ -1287,7 +1373,7 @@ @implementation CPTGraph(AbstractFactoryMethods) /** @brief Creates a new plot space for the graph. * @return A new plot space. **/ --(CPTPlotSpace *)newPlotSpace +-(nullable CPTPlotSpace *)newPlotSpace { return nil; } @@ -1295,7 +1381,7 @@ -(CPTPlotSpace *)newPlotSpace /** @brief Creates a new axis set for the graph. * @return A new axis set. **/ --(CPTAxisSet *)newAxisSet +-(nullable CPTAxisSet *)newAxisSet { return nil; } diff --git a/framework/Source/CPTGridLineGroup.h b/framework/Source/CPTGridLineGroup.h index f083054d8..bca74c4cd 100644 --- a/framework/Source/CPTGridLineGroup.h +++ b/framework/Source/CPTGridLineGroup.h @@ -4,7 +4,7 @@ @interface CPTGridLineGroup : CPTLayer -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTPlotArea *plotArea; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTPlotArea *plotArea; @property (nonatomic, readwrite) BOOL major; @end diff --git a/framework/Source/CPTGridLineGroup.m b/framework/Source/CPTGridLineGroup.m index cc5f18c04..d68f67fc4 100644 --- a/framework/Source/CPTGridLineGroup.m +++ b/framework/Source/CPTGridLineGroup.m @@ -12,7 +12,7 @@ **/ @implementation CPTGridLineGroup -/** @property cpt_weak CPTPlotArea *plotArea +/** @property nullable CPTPlotArea *plotArea * @brief The plot area that this grid line group belongs to. **/ @synthesize plotArea; @@ -38,9 +38,9 @@ @implementation CPTGridLineGroup * @param newFrame The frame rectangle. * @return The initialized CPTGridLineGroup object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { plotArea = nil; major = NO; @@ -53,9 +53,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTGridLineGroup *theLayer = (CPTGridLineGroup *)layer; plotArea = theLayer->plotArea; @@ -71,7 +71,7 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -79,23 +79,36 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeBool:self.major forKey:@"CPTGridLineGroup.major"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - plotArea = [coder decodeObjectForKey:@"CPTGridLineGroup.plotArea"]; - major = [coder decodeBoolForKey:@"CPTGridLineGroup.major"]; + if ((self = [super initWithCoder:coder])) { + plotArea = [coder decodeObjectOfClass:[CPTPlotArea class] + forKey:@"CPTGridLineGroup.plotArea"]; + major = [coder decodeBoolForKey:@"CPTGridLineGroup.major"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden ) { return; @@ -116,7 +129,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context /// @cond --(void)setPlotArea:(CPTPlotArea *)newPlotArea +-(void)setPlotArea:(nullable CPTPlotArea *)newPlotArea { if ( newPlotArea != plotArea ) { plotArea = newPlotArea; diff --git a/framework/Source/CPTGridLines.h b/framework/Source/CPTGridLines.h index 0c48e2033..f5ee267a7 100644 --- a/framework/Source/CPTGridLines.h +++ b/framework/Source/CPTGridLines.h @@ -4,7 +4,7 @@ @interface CPTGridLines : CPTLayer -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTAxis *axis; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTAxis *axis; @property (nonatomic, readwrite) BOOL major; @end diff --git a/framework/Source/CPTGridLines.m b/framework/Source/CPTGridLines.m index f96777129..6c0992e6b 100644 --- a/framework/Source/CPTGridLines.m +++ b/framework/Source/CPTGridLines.m @@ -7,7 +7,7 @@ **/ @implementation CPTGridLines -/** @property cpt_weak CPTAxis *axis +/** @property nullable CPTAxis *axis * @brief The axis. **/ @synthesize axis; @@ -33,9 +33,9 @@ @implementation CPTGridLines * @param newFrame The frame rectangle. * @return The initialized CPTGridLines object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { axis = nil; major = NO; @@ -48,9 +48,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTGridLines *theLayer = (CPTGridLines *)layer; axis = theLayer->axis; @@ -66,7 +66,7 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -74,10 +74,11 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeBool:self.major forKey:@"CPTGridLines.major"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - axis = [coder decodeObjectForKey:@"CPTGridLines.axis"]; + if ((self = [super initWithCoder:coder])) { + axis = [coder decodeObjectOfClass:[CPTAxis class] + forKey:@"CPTGridLines.axis"]; major = [coder decodeBoolForKey:@"CPTGridLines.major"]; } return self; @@ -85,12 +86,24 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden ) { return; @@ -107,7 +120,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context /// @cond --(void)setAxis:(CPTAxis *)newAxis +-(void)setAxis:(nullable CPTAxis *)newAxis { if ( newAxis != axis ) { axis = newAxis; diff --git a/framework/Source/CPTImage.h b/framework/Source/CPTImage.h index fb9ea56b0..2708be9a5 100644 --- a/framework/Source/CPTImage.h +++ b/framework/Source/CPTImage.h @@ -1,10 +1,10 @@ #import "CPTDefinitions.h" #import "CPTPlatformSpecificDefines.h" -@interface CPTImage : NSObject +@interface CPTImage : NSObject -@property (nonatomic, readwrite, copy) CPTNativeImage *nativeImage; -@property (nonatomic, readwrite, assign) CGImageRef image; +@property (nonatomic, readwrite, copy, nullable) CPTNativeImage *nativeImage; +@property (nonatomic, readwrite, assign, nullable) CGImageRef image; @property (nonatomic, readwrite, assign) CGFloat scale; @property (nonatomic, readwrite, assign, getter = isTiled) BOOL tiled; @property (nonatomic, readwrite, assign) CPTEdgeInsets edgeInsets; @@ -13,26 +13,26 @@ /// @name Factory Methods /// @{ -+(instancetype)imageNamed:(NSString *)name; ++(nonnull instancetype)imageNamed:(nonnull NSString *)name; -+(instancetype)imageWithNativeImage:(CPTNativeImage *)anImage; -+(instancetype)imageWithContentsOfFile:(NSString *)path; -+(instancetype)imageWithCGImage:(CGImageRef)anImage scale:(CGFloat)newScale; -+(instancetype)imageWithCGImage:(CGImageRef)anImage; -+(instancetype)imageForPNGFile:(NSString *)path; ++(nonnull instancetype)imageWithNativeImage:(nullable CPTNativeImage *)anImage; ++(nonnull instancetype)imageWithContentsOfFile:(nonnull NSString *)path; ++(nonnull instancetype)imageWithCGImage:(nullable CGImageRef)anImage scale:(CGFloat)newScale; ++(nonnull instancetype)imageWithCGImage:(nullable CGImageRef)anImage; ++(nonnull instancetype)imageForPNGFile:(nonnull NSString *)path; /// @} /// @name Initialization /// @{ --(instancetype)initWithContentsOfFile:(NSString *)path; --(instancetype)initWithCGImage:(CGImageRef)anImage scale:(CGFloat)newScale NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCGImage:(CGImageRef)anImage; --(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithContentsOfFile:(nonnull NSString *)path; +-(nonnull instancetype)initWithCGImage:(nullable CGImageRef)anImage scale:(CGFloat)newScale NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithCGImage:(nullable CGImageRef)anImage; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER; /// @} /// @name Drawing /// @{ --(void)drawInRect:(CGRect)rect inContext:(CGContextRef)context; +-(void)drawInRect:(CGRect)rect inContext:(nonnull CGContextRef)context; /// @} @end @@ -46,8 +46,8 @@ /// @name Initialization /// @{ --(instancetype)initWithNativeImage:(CPTNativeImage *)anImage; --(instancetype)initForPNGFile:(NSString *)path; +-(nonnull instancetype)initWithNativeImage:(nullable CPTNativeImage *)anImage; +-(nonnull instancetype)initForPNGFile:(nonnull NSString *)path; /// @} @end diff --git a/framework/Source/CPTImage.m b/framework/Source/CPTImage.m index dc29db743..baebbc284 100644 --- a/framework/Source/CPTImage.m +++ b/framework/Source/CPTImage.m @@ -1,5 +1,6 @@ #import "CPTImage.h" +#import "CPTPlatformSpecificDefines.h" #import "CPTUtilities.h" #import "NSCoderExtensions.h" @@ -18,7 +19,7 @@ typedef NS_ENUM (NSInteger, CPTSlice) { }; typedef struct _CPTImageSlices { - CGImageRef slice[9]; ///< The image slices used to render a stretchable image. + __nonnull CGImageRef slice[9]; ///< The image slices used to render a stretchable image. } CPTImageSlices; @@ -28,7 +29,7 @@ @interface CPTImage() @property (nonatomic, readwrite, assign) CPTImageSlices slices; -(void)makeImageSlices; --(void)drawImage:(CGImageRef)theImage inContext:(CGContextRef)context rect:(CGRect)rect scaleRatio:(CGFloat)scaleRatio; +-(void)drawImage:(nonnull CGImageRef)theImage inContext:(nonnull CGContextRef)context rect:(CGRect)rect scaleRatio:(CGFloat)scaleRatio; @end @@ -47,12 +48,12 @@ -(void)drawImage:(CGImageRef)theImage inContext:(CGContextRef)context rect:(CGRe @implementation CPTImage -/** @property CPTNativeImage *nativeImage +/** @property nullable CPTNativeImage *nativeImage * @brief A platform-native representation of the image. **/ @synthesize nativeImage; -/** @property CGImageRef image +/** @property nullable CGImageRef image * @brief The image drawn into a @ref CGImageRef. **/ @synthesize image; @@ -118,7 +119,7 @@ @implementation CPTImage * @param path The full or partial path to the image file. * @return A CPTImage instance initialized from the file at the given path. **/ --(instancetype)initWithContentsOfFile:(NSString *)path +-(nonnull instancetype)initWithContentsOfFile:(nonnull NSString *)path { return [self initWithNativeImage:[[CPTNativeImage alloc] initWithContentsOfFile:path]]; } @@ -131,11 +132,11 @@ -(instancetype)initWithContentsOfFile:(NSString *)path * @param newScale The image scale. Must be greater than zero. * @return A CPTImage instance initialized with the provided @ref CGImageRef. **/ --(instancetype)initWithCGImage:(CGImageRef)anImage scale:(CGFloat)newScale +-(nonnull instancetype)initWithCGImage:(nullable CGImageRef)anImage scale:(CGFloat)newScale { - NSParameterAssert(newScale > 0.0); + NSParameterAssert(newScale > CPTFloat(0.0)); - if ( (self = [super init]) ) { + if ((self = [super init])) { CGImageRetain(anImage); nativeImage = nil; image = anImage; @@ -152,7 +153,7 @@ -(instancetype)initWithCGImage:(CGImageRef)anImage scale:(CGFloat)newScale * @param anImage The image to wrap. * @return A CPTImage instance initialized with the provided @ref CGImageRef. **/ --(instancetype)initWithCGImage:(CGImageRef)anImage +-(nonnull instancetype)initWithCGImage:(nullable CGImageRef)anImage { return [self initWithCGImage:anImage scale:CPTFloat(1.0)]; } @@ -163,7 +164,7 @@ -(instancetype)initWithCGImage:(CGImageRef)anImage /** @brief Initializes a newly allocated CPTImage object with a @NULL image. * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { return [self initWithCGImage:NULL]; } @@ -188,7 +189,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeObject:self.nativeImage forKey:@"CPTImage.nativeImage"]; [coder encodeCGImage:self.image forKey:@"CPTImage.image"]; @@ -212,10 +213,11 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - nativeImage = [[coder decodeObjectForKey:@"CPTImage.nativeImage"] copy]; + if ((self = [super init])) { + nativeImage = [[coder decodeObjectOfClass:[CPTNativeImage class] + forKey:@"CPTImage.nativeImage"] copy]; image = [coder newCGImageDecodeForKey:@"CPTImage.image"]; scale = [coder decodeCGFloatForKey:@"CPTImage.scale"]; tiled = [coder decodeBoolForKey:@"CPTImage.tiled"]; @@ -230,12 +232,24 @@ -(instancetype)initWithCoder:(NSCoder *)coder return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark NSCopying Methods /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { CPTImage *copy = [[[self class] allocWithZone:zone] init]; @@ -268,7 +282,7 @@ -(id)copyWithZone:(NSZone *)zone * @param name The name of the image to load. * @return A new CPTImage instance initialized with the named image. **/ -+(instancetype)imageNamed:(NSString *)name ++(nonnull instancetype)imageNamed:(nonnull NSString *)name { return [self imageWithNativeImage:[CPTNativeImage imageNamed:name]]; } @@ -278,7 +292,7 @@ +(instancetype)imageNamed:(NSString *)name * @param anImage The platform-native image. * @return A new CPTImage instance initialized with the provided image. **/ -+(instancetype)imageWithNativeImage:(CPTNativeImage *)anImage ++(nonnull instancetype)imageWithNativeImage:(nullable CPTNativeImage *)anImage { return [[self alloc] initWithNativeImage:anImage]; } @@ -288,7 +302,7 @@ +(instancetype)imageWithNativeImage:(CPTNativeImage *)anImage * @param path The full or partial path to the image file. * @return A new CPTImage instance initialized from the file at the given path. **/ -+(instancetype)imageWithContentsOfFile:(NSString *)path ++(nonnull instancetype)imageWithContentsOfFile:(nonnull NSString *)path { return [[self alloc] initWithContentsOfFile:path]; } @@ -298,7 +312,7 @@ +(instancetype)imageWithContentsOfFile:(NSString *)path * @param newScale The image scale. * @return A new CPTImage instance initialized with the provided @ref CGImageRef. **/ -+(instancetype)imageWithCGImage:(CGImageRef)anImage scale:(CGFloat)newScale ++(nonnull instancetype)imageWithCGImage:(nullable CGImageRef)anImage scale:(CGFloat)newScale { return [[self alloc] initWithCGImage:anImage scale:newScale]; } @@ -307,7 +321,7 @@ +(instancetype)imageWithCGImage:(CGImageRef)anImage scale:(CGFloat)newScale * @param anImage The image to wrap. * @return A new CPTImage instance initialized with the provided @ref CGImageRef. **/ -+(instancetype)imageWithCGImage:(CGImageRef)anImage ++(nonnull instancetype)imageWithCGImage:(nullable CGImageRef)anImage { return [self imageWithCGImage:anImage scale:CPTFloat(1.0)]; } @@ -321,7 +335,7 @@ +(instancetype)imageWithCGImage:(CGImageRef)anImage * @param path The file system path of the file. * @return A new CPTImage instance initialized with the contents of the PNG file. **/ -+(instancetype)imageForPNGFile:(NSString *)path ++(nonnull instancetype)imageForPNGFile:(nonnull NSString *)path { return [[self alloc] initForPNGFile:path]; } @@ -337,7 +351,7 @@ +(instancetype)imageForPNGFile:(NSString *)path * @param object The object to be compared with the receiver. * @return @YES if @par{object} is equal to the receiver, @NO otherwise. **/ --(BOOL)isEqual:(id)object +-(BOOL)isEqual:(nullable id)object { if ( self == object ) { return YES; @@ -357,35 +371,35 @@ -(BOOL)isEqual:(id)object CGColorSpaceRef otherColorSpace = CGImageGetColorSpace(otherCGImage); if ( equalImages ) { - equalImages = ( CGImageGetWidth(selfCGImage) == CGImageGetWidth(otherCGImage) ); + equalImages = (CGImageGetWidth(selfCGImage) == CGImageGetWidth(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetHeight(selfCGImage) == CGImageGetHeight(otherCGImage) ); + equalImages = (CGImageGetHeight(selfCGImage) == CGImageGetHeight(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetBitsPerComponent(selfCGImage) == CGImageGetBitsPerComponent(otherCGImage) ); + equalImages = (CGImageGetBitsPerComponent(selfCGImage) == CGImageGetBitsPerComponent(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetBitsPerPixel(selfCGImage) == CGImageGetBitsPerPixel(otherCGImage) ); + equalImages = (CGImageGetBitsPerPixel(selfCGImage) == CGImageGetBitsPerPixel(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetBytesPerRow(selfCGImage) == CGImageGetBytesPerRow(otherCGImage) ); + equalImages = (CGImageGetBytesPerRow(selfCGImage) == CGImageGetBytesPerRow(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetBitmapInfo(selfCGImage) == CGImageGetBitmapInfo(otherCGImage) ); + equalImages = (CGImageGetBitmapInfo(selfCGImage) == CGImageGetBitmapInfo(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetShouldInterpolate(selfCGImage) == CGImageGetShouldInterpolate(otherCGImage) ); + equalImages = (CGImageGetShouldInterpolate(selfCGImage) == CGImageGetShouldInterpolate(otherCGImage)); } if ( equalImages ) { - equalImages = ( CGImageGetRenderingIntent(selfCGImage) == CGImageGetRenderingIntent(otherCGImage) ); + equalImages = (CGImageGetRenderingIntent(selfCGImage) == CGImageGetRenderingIntent(otherCGImage)); } // decode array @@ -409,15 +423,15 @@ -(BOOL)isEqual:(id)object equalImages = NO; } } - else if ( (selfDecodeArray && !otherDecodeArray) || (!selfDecodeArray && otherDecodeArray) ) { + else if ((selfDecodeArray && !otherDecodeArray) || (!selfDecodeArray && otherDecodeArray)) { equalImages = NO; } } // color space if ( equalImages ) { - equalImages = ( CGColorSpaceGetModel(selfColorSpace) == CGColorSpaceGetModel(otherColorSpace) ) && - ( CGColorSpaceGetNumberOfComponents(selfColorSpace) == CGColorSpaceGetNumberOfComponents(otherColorSpace) ); + equalImages = (CGColorSpaceGetModel(selfColorSpace) == CGColorSpaceGetModel(otherColorSpace)) && + (CGColorSpaceGetNumberOfComponents(selfColorSpace) == CGColorSpaceGetNumberOfComponents(otherColorSpace)); } // data provider @@ -428,7 +442,7 @@ -(BOOL)isEqual:(id)object CFDataRef otherProviderData = CGDataProviderCopyData(otherProvider); if ( selfProviderData && otherProviderData ) { - equalImages = [(__bridge NSData *)selfProviderData isEqualToData : (__bridge NSData *)otherProviderData]; + equalImages = [(__bridge NSData *) selfProviderData isEqualToData:(__bridge NSData *)otherProviderData]; } else { equalImages = (selfProviderData == otherProviderData); @@ -458,13 +472,13 @@ -(NSUInteger)hash // Equal objects must hash the same. CGImageRef selfCGImage = self.image; - return ( CGImageGetWidth(selfCGImage) * CGImageGetHeight(selfCGImage) ) + + return (CGImageGetWidth(selfCGImage) * CGImageGetHeight(selfCGImage)) + CGImageGetBitsPerComponent(selfCGImage) + CGImageGetBitsPerPixel(selfCGImage) + CGImageGetBytesPerRow(selfCGImage) + CGImageGetBitmapInfo(selfCGImage) + CGImageGetShouldInterpolate(selfCGImage) + - CGImageGetRenderingIntent(selfCGImage) * (NSUInteger)self.scale; + (NSUInteger)(CGImageGetRenderingIntent(selfCGImage) * self.scale); } /// @endcond @@ -486,7 +500,7 @@ -(BOOL)isOpaque /// @cond --(void)setImage:(CGImageRef)newImage +-(void)setImage:(nullable CGImageRef)newImage { if ( newImage != image ) { CGImageRetain(newImage); @@ -495,7 +509,7 @@ -(void)setImage:(CGImageRef)newImage } } --(void)setNativeImage:(CPTNativeImage *)newImage +-(void)setNativeImage:(nullable CPTNativeImage *)newImage { if ( newImage != nativeImage ) { nativeImage = [newImage copy]; @@ -504,15 +518,15 @@ -(void)setNativeImage:(CPTNativeImage *)newImage } } --(CPTNativeImage *)nativeImage +-(nullable CPTNativeImage *)nativeImage { if ( !nativeImage ) { CGImageRef imageRef = self.image; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGFloat theScale = self.scale; - if ( imageRef && ( theScale > CPTFloat(0.0) ) ) { + if ( imageRef && (theScale > CPTFloat(0.0))) { nativeImage = [UIImage imageWithCGImage:imageRef scale:theScale orientation:UIImageOrientationUp]; @@ -522,7 +536,7 @@ -(CPTNativeImage *)nativeImage nativeImage = [[NSImage alloc] initWithCGImage:imageRef size:NSZeroSize]; } else { - CGSize imageSize = CGSizeMake( CGImageGetWidth(imageRef), CGImageGetHeight(imageRef) ); + CGSize imageSize = CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)); NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:(NSInteger)imageSize.width @@ -536,7 +550,7 @@ -(CPTNativeImage *)nativeImage bitsPerPixel:32]; NSGraphicsContext *bitmapContext = [NSGraphicsContext graphicsContextWithBitmapImageRep:imageRep]; - CGContextRef context = (CGContextRef)[bitmapContext graphicsPort]; + CGContextRef context = (CGContextRef)bitmapContext.graphicsPort; CGContextDrawImage(context, CPTRectMake(0.0, 0.0, imageSize.width, imageSize.height), imageRef); @@ -551,7 +565,7 @@ -(CPTNativeImage *)nativeImage -(void)setScale:(CGFloat)newScale { - NSParameterAssert(newScale > 0.0); + NSParameterAssert(newScale > CPTFloat(0.0)); if ( newScale != scale ) { scale = newScale; @@ -560,10 +574,10 @@ -(void)setScale:(CGFloat)newScale -(void)setEdgeInsets:(CPTEdgeInsets)newEdgeInsets { - if ( !CPTEdgeInsetsEqualToEdgeInsets(edgeInsets, newEdgeInsets) ) { + if ( !CPTEdgeInsetsEqualToEdgeInsets(edgeInsets, newEdgeInsets)) { edgeInsets = newEdgeInsets; - CPTImageSlices imageSlices; + CPTImageSlices imageSlices = {}; for ( NSUInteger i = 0; i < 9; i++ ) { imageSlices.slice[i] = NULL; @@ -578,7 +592,10 @@ -(void)setSlices:(CPTImageSlices)newSlices for ( NSUInteger i = 0; i < 9; i++ ) { CGImageRelease(slices.slice[i]); - slices.slice[i] = CGImageRetain(newSlices.slice[i]); + CGImageRef slice = CGImageRetain(newSlices.slice[i]); + if ( slice ) { + slices.slice[i] = slice; + } } } @@ -607,54 +624,63 @@ -(void)makeImageSlices CGSize centerSize = CGSizeMake(width - capLeft - capRight, height - capTop - capBottom); - CPTImageSlices imageSlices; + CPTImageSlices imageSlices = {}; for ( NSUInteger i = 0; i < 9; i++ ) { imageSlices.slice[i] = NULL; } // top row - if ( capTop > CPTFloat(0.0) ) { - if ( capLeft > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceTopLeft] = CGImageCreateWithImageInRect( theImage, CPTRectMake(0.0, 0.0, capLeft, capTop) ); + if ( capTop > CPTFloat(0.0)) { + if ( capLeft > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(0.0, 0.0, capLeft, capTop)); + imageSlices.slice[CPTSliceTopLeft] = sliceImage; } - if ( centerSize.width > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceTop] = CGImageCreateWithImageInRect( theImage, CPTRectMake(capLeft, 0.0, centerSize.width, capTop) ); + if ( centerSize.width > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(capLeft, 0.0, centerSize.width, capTop)); + imageSlices.slice[CPTSliceTop] = sliceImage; } - if ( capRight > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceTopRight] = CGImageCreateWithImageInRect( theImage, CPTRectMake(width - capRight, 0.0, capRight, capTop) ); + if ( capRight > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(width - capRight, 0.0, capRight, capTop)); + imageSlices.slice[CPTSliceTopRight] = sliceImage; } } // middle row - if ( centerSize.height > CPTFloat(0.0) ) { - if ( capLeft > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceLeft] = CGImageCreateWithImageInRect( theImage, CPTRectMake(0.0, capTop, capLeft, centerSize.height) ); + if ( centerSize.height > CPTFloat(0.0)) { + if ( capLeft > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(0.0, capTop, capLeft, centerSize.height)); + imageSlices.slice[CPTSliceLeft] = sliceImage; } - if ( centerSize.width > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceMiddle] = CGImageCreateWithImageInRect( theImage, CPTRectMake(capLeft, capTop, centerSize.width, centerSize.height) ); + if ( centerSize.width > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(capLeft, capTop, centerSize.width, centerSize.height)); + imageSlices.slice[CPTSliceMiddle] = sliceImage; } - if ( capRight > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceRight] = CGImageCreateWithImageInRect( theImage, CPTRectMake(width - capRight, capTop, capRight, centerSize.height) ); + if ( capRight > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(width - capRight, capTop, capRight, centerSize.height)); + imageSlices.slice[CPTSliceRight] = sliceImage; } } // bottom row - if ( capBottom > CPTFloat(0.0) ) { - if ( capLeft > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceBottomLeft] = CGImageCreateWithImageInRect( theImage, CPTRectMake(0.0, height - capBottom, capLeft, capBottom) ); + if ( capBottom > CPTFloat(0.0)) { + if ( capLeft > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(0.0, height - capBottom, capLeft, capBottom)); + imageSlices.slice[CPTSliceBottomLeft] = sliceImage; } - if ( centerSize.width > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceBottom] = CGImageCreateWithImageInRect( theImage, CPTRectMake(capLeft, height - capBottom, centerSize.width, capBottom) ); + if ( centerSize.width > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(capLeft, height - capBottom, centerSize.width, capBottom)); + imageSlices.slice[CPTSliceBottom] = sliceImage; } - if ( capRight > CPTFloat(0.0) ) { - imageSlices.slice[CPTSliceBottomRight] = CGImageCreateWithImageInRect( theImage, CPTRectMake(width - capRight, height - capBottom, capRight, capBottom) ); + if ( capRight > CPTFloat(0.0)) { + CGImageRef sliceImage = CGImageCreateWithImageInRect(theImage, CPTRectMake(width - capRight, height - capBottom, capRight, capBottom)); + imageSlices.slice[CPTSliceBottomRight] = sliceImage; } } @@ -664,9 +690,9 @@ -(void)makeImageSlices } } --(void)drawImage:(CGImageRef)theImage inContext:(CGContextRef)context rect:(CGRect)rect scaleRatio:(CGFloat)scaleRatio +-(void)drawImage:(nonnull CGImageRef)theImage inContext:(nonnull CGContextRef)context rect:(CGRect)rect scaleRatio:(CGFloat)scaleRatio { - if ( theImage && ( rect.size.width > CPTFloat(0.0) ) && ( rect.size.height > CPTFloat(0.0) ) ) { + if ( theImage && (rect.size.width > CPTFloat(0.0)) && (rect.size.height > CPTFloat(0.0))) { CGFloat imageScale = self.scale; CGContextSaveGState(context); @@ -701,7 +727,7 @@ -(void)drawImage:(CGImageRef)theImage inContext:(CGContextRef)context rect:(CGRe * @param rect The rectangle to draw into. * @param context The graphics context to draw into. **/ --(void)drawInRect:(CGRect)rect inContext:(CGContextRef)context +-(void)drawInRect:(CGRect)rect inContext:(nonnull CGContextRef)context { CGImageRef theImage = self.image; @@ -709,26 +735,23 @@ -(void)drawInRect:(CGRect)rect inContext:(CGContextRef)context CGFloat lastScale = self.lastDrawnScale; CGFloat contextScale = CPTFloat(1.0); - if ( rect.size.height != CPTFloat(0.0) ) { + if ( rect.size.height != CPTFloat(0.0)) { CGRect deviceRect = CGContextConvertRectToDeviceSpace(context, rect); contextScale = deviceRect.size.height / rect.size.height; } // generate a Core Graphics image if needed - if ( !theImage || (contextScale != lastScale) ) { + if ( !theImage || (contextScale != lastScale)) { CPTNativeImage *theNativeImage = self.nativeImage; if ( theNativeImage ) { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE theImage = theNativeImage.CGImage; self.scale = theNativeImage.scale; #else - NSSize imageSize = theNativeImage.size; - CGFloat sizeScale = CPTFloat(theNativeImage.representations.count + 1) - contextScale; - imageSize.width /= sizeScale; - imageSize.height /= sizeScale; - + NSSize imageSize = theNativeImage.size; NSRect drawingRect = NSMakeRect(0.0, 0.0, imageSize.width, imageSize.height); + theImage = [theNativeImage CGImageForProposedRect:&drawingRect context:[NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:NO] hints:nil]; @@ -738,13 +761,17 @@ -(void)drawInRect:(CGRect)rect inContext:(CGContextRef)context } } + if ( !theImage ) { + return; + } + // draw the image CGFloat imageScale = self.scale; CGFloat scaleRatio = contextScale / imageScale; CPTEdgeInsets insets = self.edgeInsets; - if ( CPTEdgeInsetsEqualToEdgeInsets(insets, CPTEdgeInsetsZero) ) { + if ( CPTEdgeInsetsEqualToEdgeInsets(insets, CPTEdgeInsetsZero)) { [self drawImage:theImage inContext:context rect:rect scaleRatio:scaleRatio]; } else { @@ -759,7 +786,7 @@ -(void)drawInRect:(CGRect)rect inContext:(CGContextRef)context } // create new slices if needed - if ( !hasSlices || (contextScale != lastScale) ) { + if ( !hasSlices || (contextScale != lastScale)) { [self makeImageSlices]; imageSlices = self.slices; } @@ -818,4 +845,16 @@ -(void)drawInRect:(CGRect)rect inContext:(CGContextRef)context self.lastDrawnScale = contextScale; } +#pragma mark - +#pragma mark Debugging + +/// @cond + +-(nullable id)debugQuickLookObject +{ + return self.nativeImage; +} + +/// @endcond + @end diff --git a/framework/Source/CPTImageTests.m b/framework/Source/CPTImageTests.m index a51fff00b..b106c54f2 100644 --- a/framework/Source/CPTImageTests.m +++ b/framework/Source/CPTImageTests.m @@ -1,6 +1,7 @@ -#import "CPTImage.h" #import "CPTImageTests.h" +#import "CPTImage.h" + @implementation CPTImageTests #pragma mark - @@ -11,10 +12,15 @@ -(void)testKeyedArchivingRoundTrip const size_t width = 100; const size_t height = 100; - size_t bytesPerRow = (4 * width + 15) & ~15ul; + size_t bytesPerRow = (4 * width + 15) & ~15ul; + +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); +#else CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); - CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, bytesPerRow, colorSpace, (CGBitmapInfo)kCGImageAlphaNoneSkipLast); - CGImageRef cgImage = CGBitmapContextCreateImage(context); +#endif + CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, bytesPerRow, colorSpace, (CGBitmapInfo)kCGImageAlphaNoneSkipLast); + CGImageRef cgImage = CGBitmapContextCreateImage(context); CPTImage *image = [CPTImage imageWithCGImage:cgImage]; @@ -24,7 +30,7 @@ -(void)testKeyedArchivingRoundTrip CGColorSpaceRelease(colorSpace); CGImageRelease(cgImage); - CPTImage *newImage = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:image]]; + CPTImage *newImage = [self archiveRoundTrip:image]; XCTAssertEqualObjects(image, newImage, @"Images not equal"); } diff --git a/framework/Source/CPTLayer.h b/framework/Source/CPTLayer.h index 791e31cf5..4cca2d8b4 100644 --- a/framework/Source/CPTLayer.h +++ b/framework/Source/CPTLayer.h @@ -2,24 +2,89 @@ #import "CPTResponder.h" #import +/// @file + @class CPTGraph; +@class CPTLayer; @class CPTShadow; +/** + * @brief Layer notification type. + **/ +typedef NSString *CPTLayerNotification cpt_swift_struct; + /// @name Layout /// @{ /** @brief Notification sent by all layers when the layer @link CALayer::bounds bounds @endlink change. * @ingroup notification **/ -extern NSString *const CPTLayerBoundsDidChangeNotification; +extern CPTLayerNotification __nonnull const CPTLayerBoundsDidChangeNotification NS_SWIFT_NAME(boundsDidChange); /// @} -@interface CPTLayer : CALayer +/** + * @brief An array of CPTLayer objects. + **/ +typedef NSArray CPTLayerArray; + +/** + * @brief A mutable array of CPTLayer objects. + **/ +typedef NSMutableArray CPTMutableLayerArray; + +/** + * @brief A set of CPTLayer objects. + **/ +typedef NSSet CPTLayerSet; + +/** + * @brief A mutable set of CPTLayer objects. + **/ +typedef NSMutableSet CPTMutableLayerSet; + +/** + * @brief An array of CALayer objects. + **/ +typedef NSArray CPTSublayerArray; + +/** + * @brief A mutable array of CALayer objects. + **/ +typedef NSMutableArray CPTMutableSublayerArray; + +/** + * @brief A set of CALayer objects. + **/ +typedef NSSet CPTSublayerSet; + +/** + * @brief A mutable set of CALayer objects. + **/ +typedef NSMutableSet CPTMutableSublayerSet; + +#pragma mark - + +/** + * @brief Layer delegate. + **/ +#if ((TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_TV) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 100000)) \ + || (TARGET_OS_MAC && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101200)) +// CALayerDelegate is defined by Core Animation in iOS 10.0+, macOS 10.12+, and tvOS 10.0+ +@protocol CPTLayerDelegate +#else +@protocol CPTLayerDelegate +#endif + +@end + +#pragma mark - + +@interface CPTLayer : CALayer /// @name Graph /// @{ -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTGraph *graph; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGraph *graph; /// @} /// @name Padding @@ -34,54 +99,55 @@ extern NSString *const CPTLayerBoundsDidChangeNotification; /// @{ @property (readwrite) CGFloat contentsScale; @property (nonatomic, readonly) BOOL useFastRendering; -@property (nonatomic, readwrite, copy) CPTShadow *shadow; +@property (nonatomic, readwrite, copy, nullable) CPTShadow *shadow; @property (nonatomic, readonly) CGSize shadowMargin; /// @} /// @name Masking /// @{ @property (nonatomic, readwrite, assign) BOOL masksToBorder; -@property (nonatomic, readwrite, assign) CGPathRef outerBorderPath; -@property (nonatomic, readwrite, assign) CGPathRef innerBorderPath; -@property (nonatomic, readonly) CGPathRef maskingPath; -@property (nonatomic, readonly) CGPathRef sublayerMaskingPath; +@property (nonatomic, readwrite, assign, nullable) CGPathRef outerBorderPath; +@property (nonatomic, readwrite, assign, nullable) CGPathRef innerBorderPath; +@property (nonatomic, readonly, nullable) CGPathRef maskingPath; +@property (nonatomic, readonly, nullable) CGPathRef sublayerMaskingPath; /// @} /// @name Identification /// @{ -@property (nonatomic, readwrite, copy) id identifier; +@property (nonatomic, readwrite, copy, nullable) id identifier; /// @} /// @name Layout /// @{ -@property (nonatomic, readonly) NSSet *sublayersExcludedFromAutomaticLayout; +@property (nonatomic, readonly, nullable) CPTSublayerSet *sublayersExcludedFromAutomaticLayout; /// @} /// @name Initialization /// @{ --(instancetype)initWithFrame:(CGRect)newFrame NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; --(instancetype)initWithLayer:(id)layer NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithFrame:(CGRect)newFrame NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithLayer:(nonnull id)layer NS_DESIGNATED_INITIALIZER; /// @} /// @name Drawing /// @{ --(void)renderAsVectorInContext:(CGContextRef)context; --(void)recursivelyRenderInContext:(CGContextRef)context; --(void)layoutAndRenderInContext:(CGContextRef)context; --(NSData *)dataForPDFRepresentationOfLayer; +-(void)setNeedsDisplayAllLayers; +-(void)renderAsVectorInContext:(nonnull CGContextRef)context; +-(void)recursivelyRenderInContext:(nonnull CGContextRef)context; +-(void)layoutAndRenderInContext:(nonnull CGContextRef)context; +-(nonnull NSData *)dataForPDFRepresentationOfLayer; /// @} /// @name Masking /// @{ --(void)applySublayerMaskToContext:(CGContextRef)context forSublayer:(CPTLayer *)sublayer withOffset:(CGPoint)offset; --(void)applyMaskToContext:(CGContextRef)context; +-(void)applySublayerMaskToContext:(nonnull CGContextRef)context forSublayer:(nonnull CPTLayer *)sublayer withOffset:(CGPoint)offset; +-(void)applyMaskToContext:(nonnull CGContextRef)context; /// @} /// @name Layout /// @{ -(void)pixelAlign; --(void)sublayerMarginLeft:(CGFloat *)left top:(CGFloat *)top right:(CGFloat *)right bottom:(CGFloat *)bottom; +-(void)sublayerMarginLeft:(nonnull CGFloat *)left top:(nonnull CGFloat *)top right:(nonnull CGFloat *)right bottom:(nonnull CGFloat *)bottom; /// @} /// @name Information diff --git a/framework/Source/CPTLayer.m b/framework/Source/CPTLayer.m index 316d816e9..eef476e9a 100644 --- a/framework/Source/CPTLayer.m +++ b/framework/Source/CPTLayer.m @@ -2,20 +2,20 @@ #import "CPTGraph.h" #import "CPTPathExtensions.h" +#import "CPTPlatformSpecificCategories.h" #import "CPTPlatformSpecificFunctions.h" #import "CPTShadow.h" #import "CPTUtilities.h" -#import "CorePlotProbes.h" #import "NSCoderExtensions.h" #import #import -NSString *const CPTLayerBoundsDidChangeNotification = @"CPTLayerBoundsDidChangeNotification"; +CPTLayerNotification const CPTLayerBoundsDidChangeNotification = @"CPTLayerBoundsDidChangeNotification"; /** @defgroup animation Animatable Properties * @brief Custom layer properties that can be animated using Core Animation. * @if MacOnly - * @since Custom layer property animation is supported on MacOS 10.6 and later. + * @since Custom layer property animation is supported on macOS 10.6 and later. * @endif **/ @@ -24,13 +24,14 @@ **/ /// @cond + @interface CPTLayer() @property (nonatomic, readwrite, getter = isRenderingRecursively) BOOL renderingRecursively; @property (nonatomic, readwrite, assign) BOOL useFastRendering; --(void)applyTransform:(CATransform3D)transform toContext:(CGContextRef)context; --(NSString *)subLayersAtIndex:(NSUInteger)idx; +-(void)applyTransform:(CATransform3D)transform toContext:(nonnull CGContextRef)context; +-(nonnull NSString *)subLayersAtIndex:(NSUInteger)idx; @end @@ -49,7 +50,7 @@ -(NSString *)subLayersAtIndex:(NSUInteger)idx; **/ @implementation CPTLayer -/** @property cpt_weak CPTGraph *graph +/** @property nullable CPTGraph *graph * @brief The graph for the layer. **/ @synthesize graph; @@ -94,17 +95,17 @@ @implementation CPTLayer **/ @dynamic shadowMargin; -/** @property CGPathRef outerBorderPath +/** @property nullable CGPathRef outerBorderPath * @brief A drawing path that encompasses the outer boundary of the layer border. **/ @synthesize outerBorderPath; -/** @property CGPathRef innerBorderPath +/** @property nullable CGPathRef innerBorderPath * @brief A drawing path that encompasses the inner boundary of the layer border. **/ @synthesize innerBorderPath; -/** @property CGPathRef maskingPath +/** @property nullable CGPathRef maskingPath * @brief A drawing path that encompasses the layer content including any borders. Set to @NULL when no masking is desired. * * This path defines the outline of the layer and is used to mask all drawing. Set to @NULL when no masking is desired. @@ -112,7 +113,7 @@ @implementation CPTLayer **/ @dynamic maskingPath; -/** @property CGPathRef sublayerMaskingPath +/** @property nullable CGPathRef sublayerMaskingPath * @brief A drawing path that encompasses the layer content excluding any borders. Set to @NULL when no masking is desired. * * This path defines the outline of the part of the layer where sublayers should draw and is used to mask all sublayer drawing. @@ -121,7 +122,7 @@ @implementation CPTLayer **/ @dynamic sublayerMaskingPath; -/** @property NSSet *sublayersExcludedFromAutomaticLayout +/** @property nullable CPTSublayerSet *sublayersExcludedFromAutomaticLayout * @brief A set of sublayers that should be excluded from the automatic sublayer layout. **/ @dynamic sublayersExcludedFromAutomaticLayout; @@ -131,7 +132,7 @@ @implementation CPTLayer **/ @synthesize useFastRendering; -/** @property id identifier +/** @property nullable id identifier * @brief An object used to identify the layer in collections. **/ @synthesize identifier; @@ -163,9 +164,9 @@ @implementation CPTLayer * @param newFrame The frame rectangle. * @return The initialized object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super init]) ) { + if ((self = [super init])) { paddingLeft = CPTFloat(0.0); paddingTop = CPTFloat(0.0); paddingRight = CPTFloat(0.0); @@ -193,7 +194,7 @@ -(instancetype)initWithFrame:(CGRect)newFrame /** @brief Initializes a newly allocated CPTLayer object with an empty frame rectangle. * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { return [self initWithFrame:CGRectZero]; } @@ -204,9 +205,9 @@ -(instancetype)init * @param layer The layer from which custom fields should be copied. * @return A layer instance with any custom instance variables copied from @par{layer}. */ --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTLayer *theLayer = (CPTLayer *)layer; paddingLeft = theLayer->paddingLeft; @@ -240,7 +241,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -265,17 +266,20 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { + if ((self = [super initWithCoder:coder])) { paddingLeft = [coder decodeCGFloatForKey:@"CPTLayer.paddingLeft"]; paddingTop = [coder decodeCGFloatForKey:@"CPTLayer.paddingTop"]; paddingRight = [coder decodeCGFloatForKey:@"CPTLayer.paddingRight"]; paddingBottom = [coder decodeCGFloatForKey:@"CPTLayer.paddingBottom"]; masksToBorder = [coder decodeBoolForKey:@"CPTLayer.masksToBorder"]; - shadow = [[coder decodeObjectForKey:@"CPTLayer.shadow"] copy]; - graph = [coder decodeObjectForKey:@"CPTLayer.graph"]; - identifier = [[coder decodeObjectForKey:@"CPTLayer.identifier"] copy]; + shadow = [[coder decodeObjectOfClass:[CPTShadow class] + forKey:@"CPTLayer.shadow"] copy]; + graph = [coder decodeObjectOfClass:[CPTGraph class] + forKey:@"CPTLayer.graph"]; + identifier = [[coder decodeObjectOfClass:[NSObject class] + forKey:@"CPTLayer.identifier"] copy]; renderingRecursively = NO; outerBorderPath = NULL; @@ -284,12 +288,24 @@ -(instancetype)initWithCoder:(NSCoder *)coder return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Animation /// @cond --(id)actionForKey:(NSString *)aKey +-(id)actionForKey:(nonnull NSString *__unused)aKey { return nil; } @@ -307,11 +323,46 @@ -(void)display return; } else { - [super display]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wundeclared-selector" +#if TARGET_OS_OSX + // Workaround since @available macro is not there + + if ( [NSView instancesRespondToSelector:@selector(effectiveAppearance)] ) { + NSAppearance *oldAppearance = NSAppearance.currentAppearance; + NSAppearance.currentAppearance = ((NSView *)self.graph.hostingView).effectiveAppearance; + [super display]; + NSAppearance.currentAppearance = oldAppearance; + } + else { + [super display]; + } +#else + if ( @available(iOS 13, *)) { + if ( [UITraitCollection instancesRespondToSelector:@selector(performAsCurrentTraitCollection:)] ) { + UITraitCollection *traitCollection = ((UIView *)self.graph.hostingView).traitCollection; + if ( traitCollection ) { + [traitCollection performAsCurrentTraitCollection: ^{ + [super display]; + }]; + } + else { + [super display]; + } + } + else { + [super display]; + } + } + else { + [super display]; + } +#endif +#pragma clang diagnostic pop } } --(void)drawInContext:(CGContextRef)context +-(void)drawInContext:(nonnull CGContextRef)context { if ( context ) { self.useFastRendering = YES; @@ -325,6 +376,23 @@ -(void)drawInContext:(CGContextRef)context /// @endcond +/** + * @brief Recursively marks this layer and all sublayers as needing to be redrawn. + **/ +-(void)setNeedsDisplayAllLayers +{ + [self setNeedsDisplay]; + + for ( CPTLayer *subLayer in self.sublayers ) { + if ( [subLayer respondsToSelector:@selector(setNeedsDisplayAllLayers)] ) { + [subLayer setNeedsDisplayAllLayers]; + } + else { + [subLayer setNeedsDisplay]; + } + } +} + /** @brief Draws layer content into the provided graphics context. * * This method replaces the CALayer @link CALayer::drawInContext: -drawInContext: @endlink method @@ -334,7 +402,7 @@ -(void)drawInContext:(CGContextRef)context * * @param context The graphics context to draw into. **/ --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { // This is where subclasses do their drawing if ( self.renderingRecursively ) { @@ -346,7 +414,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context /** @brief Draws layer content and the content of all sublayers into the provided graphics context. * @param context The graphics context to draw into. **/ --(void)recursivelyRenderInContext:(CGContextRef)context +-(void)recursivelyRenderInContext:(nonnull CGContextRef)context { if ( !self.hidden ) { // render self @@ -365,7 +433,7 @@ -(void)recursivelyRenderInContext:(CGContextRef)context self.renderingRecursively = NO; // render sublayers - NSArray *sublayersCopy = [self.sublayers copy]; + CPTSublayerArray *sublayersCopy = [self.sublayers copy]; for ( CALayer *currentSublayer in sublayersCopy ) { CGContextSaveGState(context); @@ -377,7 +445,7 @@ -(void)recursivelyRenderInContext:(CGContextRef)context currentSublayerFrameOrigin.y - currentSublayerBounds.origin.y); [self applyTransform:self.sublayerTransform toContext:context]; if ( [currentSublayer isKindOfClass:[CPTLayer class]] ) { - [(CPTLayer *)currentSublayer recursivelyRenderInContext : context]; + [(CPTLayer *) currentSublayer recursivelyRenderInContext:context]; } else { if ( self.masksToBounds ) { @@ -394,17 +462,17 @@ -(void)recursivelyRenderInContext:(CGContextRef)context /// @cond --(void)applyTransform:(CATransform3D)transform3D toContext:(CGContextRef)context +-(void)applyTransform:(CATransform3D)transform3D toContext:(nonnull CGContextRef)context { - if ( !CATransform3DIsIdentity(transform3D) ) { - if ( CATransform3DIsAffine(transform3D) ) { + if ( !CATransform3DIsIdentity(transform3D)) { + if ( CATransform3DIsAffine(transform3D)) { CGRect selfBounds = self.bounds; CGPoint anchorPoint = self.anchorPoint; CGPoint anchorOffset = CPTPointMake(anchorOffset.x = selfBounds.origin.x + anchorPoint.x * selfBounds.size.width, anchorOffset.y = selfBounds.origin.y + anchorPoint.y * selfBounds.size.height); CGAffineTransform affineTransform = CGAffineTransformMakeTranslation(-anchorOffset.x, -anchorOffset.y); - affineTransform = CGAffineTransformConcat( affineTransform, CATransform3DGetAffineTransform(transform3D) ); + affineTransform = CGAffineTransformConcat(affineTransform, CATransform3DGetAffineTransform(transform3D)); affineTransform = CGAffineTransformTranslate(affineTransform, anchorOffset.x, anchorOffset.y); CGRect transformedBounds = CGRectApplyAffineTransform(selfBounds, affineTransform); @@ -420,7 +488,7 @@ -(void)applyTransform:(CATransform3D)transform3D toContext:(CGContextRef)context /** @brief Updates the layer layout if needed and then draws layer content and the content of all sublayers into the provided graphics context. * @param context The graphics context to draw into. */ --(void)layoutAndRenderInContext:(CGContextRef)context +-(void)layoutAndRenderInContext:(nonnull CGContextRef)context { [self layoutIfNeeded]; [self recursivelyRenderInContext:context]; @@ -429,10 +497,10 @@ -(void)layoutAndRenderInContext:(CGContextRef)context /** @brief Draws layer content and the content of all sublayers into a PDF document. * @return PDF representation of the layer content. **/ --(NSData *)dataForPDFRepresentationOfLayer +-(nonnull NSData *)dataForPDFRepresentationOfLayer { NSMutableData *pdfData = [[NSMutableData alloc] init]; - CGDataConsumerRef dataConsumer = CGDataConsumerCreateWithCFData( (__bridge CFMutableDataRef)pdfData ); + CGDataConsumerRef dataConsumer = CGDataConsumerCreateWithCFData((__bridge CFMutableDataRef)pdfData); const CGRect mediaBox = CPTRectMake(0.0, 0.0, self.bounds.size.width, self.bounds.size.height); CGContextRef pdfContext = CGPDFContextCreate(dataConsumer, &mediaBox, NULL); @@ -458,32 +526,33 @@ -(NSData *)dataForPDFRepresentationOfLayer /// @name User Interaction /// @{ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint __unused)interactionPoint { return NO; } --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint __unused)interactionPoint { return NO; } --(BOOL)pointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDraggedEvent:(nonnull CPTNativeEvent *__unused)event atPoint:(CGPoint __unused)interactionPoint { return NO; } --(BOOL)pointingDeviceCancelledEvent:(CPTNativeEvent *)event +-(BOOL)pointingDeviceCancelledEvent:(nonnull CPTNativeEvent *__unused)event { return NO; } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else --(BOOL)scrollWheelEvent:(CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint +-(BOOL)scrollWheelEvent:(nonnull CPTNativeEvent *__unused)event fromPoint:(CGPoint __unused)fromPoint toPoint:(CGPoint __unused)toPoint { return NO; } + #endif /// @} @@ -504,38 +573,38 @@ -(void)pixelAlign CGPoint newPosition; - if ( CGSizeEqualToSize(boundsSize, frameSize) ) { // rotated 0° or 180° + if ( CGSizeEqualToSize(boundsSize, frameSize)) { // rotated 0° or 180° CGPoint anchor = self.anchorPoint; CGPoint newAnchor = CGPointMake(boundsSize.width * anchor.x, boundsSize.height * anchor.y); - if ( scale == CPTFloat(1.0) ) { - newPosition.x = ceil( currentPosition.x - newAnchor.x - CPTFloat(0.5) ) + newAnchor.x; - newPosition.y = ceil( currentPosition.y - newAnchor.y - CPTFloat(0.5) ) + newAnchor.y; + if ( scale == CPTFloat(1.0)) { + newPosition.x = ceil(currentPosition.x - newAnchor.x - CPTFloat(0.5)) + newAnchor.x; + newPosition.y = ceil(currentPosition.y - newAnchor.y - CPTFloat(0.5)) + newAnchor.y; } else { - newPosition.x = ceil( (currentPosition.x - newAnchor.x) * scale - CPTFloat(0.5) ) / scale + newAnchor.x; - newPosition.y = ceil( (currentPosition.y - newAnchor.y) * scale - CPTFloat(0.5) ) / scale + newAnchor.y; + newPosition.x = ceil((currentPosition.x - newAnchor.x) * scale - CPTFloat(0.5)) / scale + newAnchor.x; + newPosition.y = ceil((currentPosition.y - newAnchor.y) * scale - CPTFloat(0.5)) / scale + newAnchor.y; } } - else if ( (boundsSize.width == frameSize.height) && (boundsSize.height == frameSize.width) ) { // rotated 90° or 270° + else if ((boundsSize.width == frameSize.height) && (boundsSize.height == frameSize.width)) { // rotated 90° or 270° CGPoint anchor = self.anchorPoint; CGPoint newAnchor = CGPointMake(boundsSize.height * anchor.y, boundsSize.width * anchor.x); - if ( scale == CPTFloat(1.0) ) { - newPosition.x = ceil( currentPosition.x - newAnchor.x - CPTFloat(0.5) ) + newAnchor.x; - newPosition.y = ceil( currentPosition.y - newAnchor.y - CPTFloat(0.5) ) + newAnchor.y; + if ( scale == CPTFloat(1.0)) { + newPosition.x = ceil(currentPosition.x - newAnchor.x - CPTFloat(0.5)) + newAnchor.x; + newPosition.y = ceil(currentPosition.y - newAnchor.y - CPTFloat(0.5)) + newAnchor.y; } else { - newPosition.x = ceil( (currentPosition.x - newAnchor.x) * scale - CPTFloat(0.5) ) / scale + newAnchor.x; - newPosition.y = ceil( (currentPosition.y - newAnchor.y) * scale - CPTFloat(0.5) ) / scale + newAnchor.y; + newPosition.x = ceil((currentPosition.x - newAnchor.x) * scale - CPTFloat(0.5)) / scale + newAnchor.x; + newPosition.y = ceil((currentPosition.y - newAnchor.y) * scale - CPTFloat(0.5)) / scale + newAnchor.y; } } else { - if ( scale == CPTFloat(1.0) ) { + if ( scale == CPTFloat(1.0)) { newPosition.x = round(currentPosition.x); newPosition.y = round(currentPosition.y); } @@ -592,7 +661,7 @@ -(CGSize)shadowMargin CGSize shadowOffset = myShadow.shadowOffset; CGFloat shadowRadius = myShadow.shadowBlurRadius; - margin = CGSizeMake( ceil( ABS(shadowOffset.width) + ABS(shadowRadius) ), ceil( ABS(shadowOffset.height) + ABS(shadowRadius) ) ); + margin = CGSizeMake(ceil(ABS(shadowOffset.width) + ABS(shadowRadius)), ceil(ABS(shadowOffset.height) + ABS(shadowRadius))); } return margin; @@ -611,8 +680,9 @@ -(CGSize)shadowMargin **/ -(void)layoutSublayers { - CGRect selfBounds = self.bounds; - NSArray *mySublayers = self.sublayers; + CGRect selfBounds = self.bounds; + + CPTSublayerArray *mySublayers = self.sublayers; if ( mySublayers.count > 0 ) { CGFloat leftPadding, topPadding, rightPadding, bottomPadding; @@ -621,18 +691,18 @@ -(void)layoutSublayers CGSize subLayerSize = selfBounds.size; subLayerSize.width -= leftPadding + rightPadding; - subLayerSize.width = MAX( subLayerSize.width, CPTFloat(0.0) ); + subLayerSize.width = MAX(subLayerSize.width, CPTFloat(0.0)); subLayerSize.width = round(subLayerSize.width); subLayerSize.height -= topPadding + bottomPadding; - subLayerSize.height = MAX( subLayerSize.height, CPTFloat(0.0) ); + subLayerSize.height = MAX(subLayerSize.height, CPTFloat(0.0)); subLayerSize.height = round(subLayerSize.height); CGRect subLayerFrame; - subLayerFrame.origin = CGPointMake( round(leftPadding), round(bottomPadding) ); + subLayerFrame.origin = CGPointMake(round(leftPadding), round(bottomPadding)); subLayerFrame.size = subLayerSize; - NSSet *excludedSublayers = [self sublayersExcludedFromAutomaticLayout]; - Class layerClass = [CPTLayer class]; + CPTSublayerSet *excludedSublayers = self.sublayersExcludedFromAutomaticLayout; + Class layerClass = [CPTLayer class]; for ( CALayer *subLayer in mySublayers ) { if ( [subLayer isKindOfClass:layerClass] && ![excludedSublayers containsObject:subLayer] ) { subLayer.frame = subLayerFrame; @@ -643,18 +713,22 @@ -(void)layoutSublayers /// @} --(NSSet *)sublayersExcludedFromAutomaticLayout +/// @cond + +-(nullable CPTSublayerSet *)sublayersExcludedFromAutomaticLayout { return nil; } +/// @endcond + /** @brief Returns the margins that should be left between the bounds of the receiver and all sublayers. * @param left The left margin. * @param top The top margin. * @param right The right margin. * @param bottom The bottom margin. **/ --(void)sublayerMarginLeft:(CGFloat *)left top:(CGFloat *)top right:(CGFloat *)right bottom:(CGFloat *)bottom +-(void)sublayerMarginLeft:(nonnull CGFloat *)left top:(nonnull CGFloat *)top right:(nonnull CGFloat *)right bottom:(nonnull CGFloat *)bottom { *left = self.paddingLeft; *top = self.paddingTop; @@ -667,61 +741,61 @@ -(void)sublayerMarginLeft:(CGFloat *)left top:(CGFloat *)top right:(CGFloat *)ri /// @cond --(void)setSublayers:(NSArray *)sublayers +-(void)setSublayers:(nullable CPTSublayerArray *)sublayers { - [super setSublayers:sublayers]; + super.sublayers = sublayers; Class layerClass = [CPTLayer class]; CGFloat scale = self.contentsScale; for ( CALayer *layer in sublayers ) { if ( [layer isKindOfClass:layerClass] ) { - ( (CPTLayer *)layer ).contentsScale = scale; + ((CPTLayer *)layer).contentsScale = scale; } } } --(void)addSublayer:(CALayer *)layer +-(void)addSublayer:(nonnull CALayer *)layer { [super addSublayer:layer]; if ( [layer isKindOfClass:[CPTLayer class]] ) { - ( (CPTLayer *)layer ).contentsScale = self.contentsScale; + ((CPTLayer *)layer).contentsScale = self.contentsScale; } } --(void)insertSublayer:(CALayer *)layer atIndex:(unsigned)idx +-(void)insertSublayer:(nonnull CALayer *)layer atIndex:(unsigned)idx { [super insertSublayer:layer atIndex:idx]; if ( [layer isKindOfClass:[CPTLayer class]] ) { - ( (CPTLayer *)layer ).contentsScale = self.contentsScale; + ((CPTLayer *)layer).contentsScale = self.contentsScale; } } --(void)insertSublayer:(CALayer *)layer below:(CALayer *)sibling +-(void)insertSublayer:(nonnull CALayer *)layer below:(nullable CALayer *)sibling { [super insertSublayer:layer below:sibling]; if ( [layer isKindOfClass:[CPTLayer class]] ) { - ( (CPTLayer *)layer ).contentsScale = self.contentsScale; + ((CPTLayer *)layer).contentsScale = self.contentsScale; } } --(void)insertSublayer:(CALayer *)layer above:(CALayer *)sibling +-(void)insertSublayer:(nonnull CALayer *)layer above:(nullable CALayer *)sibling { [super insertSublayer:layer above:sibling]; if ( [layer isKindOfClass:[CPTLayer class]] ) { - ( (CPTLayer *)layer ).contentsScale = self.contentsScale; + ((CPTLayer *)layer).contentsScale = self.contentsScale; } } --(void)replaceSublayer:(CALayer *)layer with:(CALayer *)layer2 +-(void)replaceSublayer:(nonnull CALayer *)layer with:(nonnull CALayer *)layer2 { [super replaceSublayer:layer with:layer2]; if ( [layer2 isKindOfClass:[CPTLayer class]] ) { - ( (CPTLayer *)layer2 ).contentsScale = self.contentsScale; + ((CPTLayer *)layer2).contentsScale = self.contentsScale; } } @@ -730,8 +804,10 @@ -(void)replaceSublayer:(CALayer *)layer with:(CALayer *)layer2 #pragma mark - #pragma mark Masking +/// @cond + // default path is the rounded rect layer bounds --(CGPathRef)maskingPath +-(nullable CGPathRef)maskingPath { if ( self.masksToBounds ) { CGPathRef path = self.outerBorderPath; @@ -750,11 +826,13 @@ -(CGPathRef)maskingPath } } --(CGPathRef)sublayerMaskingPath +-(nullable CGPathRef)sublayerMaskingPath { return self.innerBorderPath; } +/// @endcond + /** @brief Recursively sets the clipping path of the given graphics context to the sublayer masking paths of its superlayers. * * The clipping path is built by recursively climbing the layer tree and combining the sublayer masks from @@ -764,7 +842,7 @@ -(CGPathRef)sublayerMaskingPath * @param sublayer The sublayer that called this method. * @param offset The cumulative position offset between the receiver and the first layer in the recursive calling chain. **/ --(void)applySublayerMaskToContext:(CGContextRef)context forSublayer:(CPTLayer *)sublayer withOffset:(CGPoint)offset +-(void)applySublayerMaskToContext:(nonnull CGContextRef)context forSublayer:(nonnull CPTLayer *)sublayer withOffset:(CGPoint)offset { CGPoint sublayerBoundsOrigin = sublayer.bounds.origin; CGPoint layerOffset = offset; @@ -776,11 +854,11 @@ -(void)applySublayerMaskToContext:(CGContextRef)context forSublayer:(CPTLayer *) } CGAffineTransform sublayerTransform = CATransform3DGetAffineTransform(sublayer.transform); - CGContextConcatCTM( context, CGAffineTransformInvert(sublayerTransform) ); + CGContextConcatCTM(context, CGAffineTransformInvert(sublayerTransform)); CALayer *superlayer = self.superlayer; if ( [superlayer isKindOfClass:[CPTLayer class]] ) { - [(CPTLayer *)superlayer applySublayerMaskToContext : context forSublayer : self withOffset : layerOffset]; + [(CPTLayer *) superlayer applySublayerMaskToContext:context forSublayer:self withOffset:layerOffset]; } CGPathRef maskPath = self.sublayerMaskingPath; @@ -801,7 +879,7 @@ -(void)applySublayerMaskToContext:(CGContextRef)context forSublayer:(CPTLayer *) * * @param context The graphics context to clip. **/ --(void)applyMaskToContext:(CGContextRef)context +-(void)applyMaskToContext:(nonnull CGContextRef)context { CPTLayer *mySuperlayer = (CPTLayer *)self.superlayer; @@ -849,23 +927,13 @@ -(void)setNeedsDisplay -(void)setPosition:(CGPoint)newPosition { - [super setPosition:newPosition]; - if ( COREPLOT_LAYER_POSITION_CHANGE_ENABLED() ) { - CGRect currentFrame = self.frame; - if ( !CGRectEqualToRect( currentFrame, CGRectIntegral(self.frame) ) ) { - COREPLOT_LAYER_POSITION_CHANGE( (const char *)class_getName([self class]), - (int)lrint( ceil(currentFrame.origin.x * 1000.0) ), - (int)lrint( ceil(currentFrame.origin.y * 1000.0) ), - (int)lrint( ceil(currentFrame.size.width * 1000.0) ), - (int)lrint( ceil(currentFrame.size.height * 1000.0) ) ); - } - } + super.position = newPosition; } -(void)setHidden:(BOOL)newHidden { if ( newHidden != self.hidden ) { - [super setHidden:newHidden]; + super.hidden = newHidden; if ( !newHidden ) { [self setNeedsDisplay]; } @@ -874,7 +942,7 @@ -(void)setHidden:(BOOL)newHidden -(void)setContentsScale:(CGFloat)newContentsScale { - NSParameterAssert(newContentsScale > 0.0); + NSParameterAssert(newContentsScale > CPTFloat(0.0)); if ( self.contentsScale != newContentsScale ) { if ( [CALayer instancesRespondToSelector:@selector(setContentsScale:)] ) { @@ -902,7 +970,7 @@ -(CGFloat)contentsScale return scale; } --(void)setShadow:(CPTShadow *)newShadow +-(void)setShadow:(nullable CPTShadow *)newShadow { if ( newShadow != shadow ) { shadow = [newShadow copy]; @@ -911,7 +979,7 @@ -(void)setShadow:(CPTShadow *)newShadow } } --(void)setOuterBorderPath:(CGPathRef)newPath +-(void)setOuterBorderPath:(nullable CGPathRef)newPath { if ( newPath != outerBorderPath ) { CGPathRelease(outerBorderPath); @@ -919,7 +987,7 @@ -(void)setOuterBorderPath:(CGPathRef)newPath } } --(void)setInnerBorderPath:(CGPathRef)newPath +-(void)setInnerBorderPath:(nullable CGPathRef)newPath { if ( newPath != innerBorderPath ) { CGPathRelease(innerBorderPath); @@ -946,7 +1014,7 @@ -(CGRect)bounds -(void)setBounds:(CGRect)newBounds { - if ( !CGRectEqualToRect(self.bounds, newBounds) ) { + if ( !CGRectEqualToRect(self.bounds, newBounds)) { if ( self.shadow ) { CGSize sizeOffset = self.shadowMargin; @@ -956,7 +1024,7 @@ -(void)setBounds:(CGRect)newBounds newBounds.size.height += sizeOffset.height * CPTFloat(2.0); } - [super setBounds:newBounds]; + super.bounds = newBounds; self.outerBorderPath = NULL; self.innerBorderPath = NULL; @@ -973,14 +1041,14 @@ -(CGPoint)anchorPoint if ( self.shadow ) { CGSize sizeOffset = self.shadowMargin; CGRect selfBounds = self.bounds; - CGSize adjustedSize = CGSizeMake( selfBounds.size.width + sizeOffset.width * CPTFloat(2.0), - selfBounds.size.height + sizeOffset.height * CPTFloat(2.0) ); + CGSize adjustedSize = CGSizeMake(selfBounds.size.width + sizeOffset.width * CPTFloat(2.0), + selfBounds.size.height + sizeOffset.height * CPTFloat(2.0)); - if ( selfBounds.size.width > CPTFloat(0.0) ) { - adjustedAnchor.x = ( adjustedAnchor.x - CPTFloat(0.5) ) * (adjustedSize.width / selfBounds.size.width) + CPTFloat(0.5); + if ( selfBounds.size.width > CPTFloat(0.0)) { + adjustedAnchor.x = (adjustedAnchor.x - CPTFloat(0.5)) * (adjustedSize.width / selfBounds.size.width) + CPTFloat(0.5); } - if ( selfBounds.size.height > CPTFloat(0.0) ) { - adjustedAnchor.y = ( adjustedAnchor.y - CPTFloat(0.5) ) * (adjustedSize.height / selfBounds.size.height) + CPTFloat(0.5); + if ( selfBounds.size.height > CPTFloat(0.0)) { + adjustedAnchor.y = (adjustedAnchor.y - CPTFloat(0.5)) * (adjustedSize.height / selfBounds.size.height) + CPTFloat(0.5); } } @@ -992,18 +1060,18 @@ -(void)setAnchorPoint:(CGPoint)newAnchorPoint if ( self.shadow ) { CGSize sizeOffset = self.shadowMargin; CGRect selfBounds = self.bounds; - CGSize adjustedSize = CGSizeMake( selfBounds.size.width + sizeOffset.width * CPTFloat(2.0), - selfBounds.size.height + sizeOffset.height * CPTFloat(2.0) ); + CGSize adjustedSize = CGSizeMake(selfBounds.size.width + sizeOffset.width * CPTFloat(2.0), + selfBounds.size.height + sizeOffset.height * CPTFloat(2.0)); - if ( adjustedSize.width > CPTFloat(0.0) ) { - newAnchorPoint.x = ( newAnchorPoint.x - CPTFloat(0.5) ) * (selfBounds.size.width / adjustedSize.width) + CPTFloat(0.5); + if ( adjustedSize.width > CPTFloat(0.0)) { + newAnchorPoint.x = (newAnchorPoint.x - CPTFloat(0.5)) * (selfBounds.size.width / adjustedSize.width) + CPTFloat(0.5); } - if ( adjustedSize.height > CPTFloat(0.0) ) { - newAnchorPoint.y = ( newAnchorPoint.y - CPTFloat(0.5) ) * (selfBounds.size.height / adjustedSize.height) + CPTFloat(0.5); + if ( adjustedSize.height > CPTFloat(0.0)) { + newAnchorPoint.y = (newAnchorPoint.y - CPTFloat(0.5)) * (selfBounds.size.height / adjustedSize.height) + CPTFloat(0.5); } } - [super setAnchorPoint:newAnchorPoint]; + super.anchorPoint = newAnchorPoint; } -(void)setCornerRadius:(CGFloat)newRadius @@ -1025,9 +1093,9 @@ -(void)setCornerRadius:(CGFloat)newRadius /// @cond --(NSString *)description +-(nullable NSString *)description { - return [NSString stringWithFormat:@"<%@ bounds: %@>", [super description], CPTStringFromRect(self.bounds)]; + return [NSString stringWithFormat:@"<%@ bounds: %@>", super.description, CPTStringFromRect(self.bounds)]; } /// @endcond @@ -1042,14 +1110,14 @@ -(void)logLayers /// @cond --(NSString *)subLayersAtIndex:(NSUInteger)idx +-(nonnull NSString *)subLayersAtIndex:(NSUInteger)idx { NSMutableString *result = [NSMutableString string]; for ( NSUInteger i = 0; i < idx; i++ ) { [result appendString:@". "]; } - [result appendString:[self description]]; + [result appendString:self.description]; for ( CPTLayer *sublayer in self.sublayers ) { [result appendString:@"\n"]; @@ -1058,7 +1126,7 @@ -(NSString *)subLayersAtIndex:(NSUInteger)idx [result appendString:[sublayer subLayersAtIndex:idx + 1]]; } else { - [result appendString:[sublayer description]]; + [result appendString:sublayer.description]; } } @@ -1067,4 +1135,16 @@ -(NSString *)subLayersAtIndex:(NSUInteger)idx /// @endcond +#pragma mark - +#pragma mark Debugging + +/// @cond + +-(nullable id)debugQuickLookObject +{ + return [self imageOfLayer]; +} + +/// @endcond + @end diff --git a/framework/Source/CPTLayerAnnotation.h b/framework/Source/CPTLayerAnnotation.h index e5795c8ec..23e1afeea 100644 --- a/framework/Source/CPTLayerAnnotation.h +++ b/framework/Source/CPTLayerAnnotation.h @@ -5,10 +5,15 @@ @interface CPTLayerAnnotation : CPTAnnotation -@property (nonatomic, readonly) cpt_weak CPTLayer *anchorLayer; +@property (nonatomic, readonly, cpt_weak_property, nullable) CPTLayer *anchorLayer; @property (nonatomic, readwrite, assign) CPTRectAnchor rectAnchor; +@property (nonatomic, readwrite, strong, nullable) CPTConstraints *xConstraints; +@property (nonatomic, readwrite, strong, nullable) CPTConstraints *yConstraints; --(instancetype)initWithAnchorLayer:(CPTLayer *)anchorLayer NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; +/// @name Initialization +/// @{ +-(nonnull instancetype)initWithAnchorLayer:(nonnull CPTLayer *)anchorLayer NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; +/// @} @end diff --git a/framework/Source/CPTLayerAnnotation.m b/framework/Source/CPTLayerAnnotation.m index 70f2d072c..69c68d6da 100644 --- a/framework/Source/CPTLayerAnnotation.m +++ b/framework/Source/CPTLayerAnnotation.m @@ -2,13 +2,11 @@ #import "CPTAnnotationHostLayer.h" #import "CPTConstraints.h" +#import "CPTExceptions.h" /// @cond @interface CPTLayerAnnotation() -@property (nonatomic, readwrite, strong) CPTConstraints *xConstraints; -@property (nonatomic, readwrite, strong) CPTConstraints *yConstraints; - -(void)setConstraints; @end @@ -25,7 +23,7 @@ -(void)setConstraints; **/ @implementation CPTLayerAnnotation -/** @property cpt_weak CPTLayer *anchorLayer +/** @property nullable CPTLayer *anchorLayer * @brief The reference layer. **/ @synthesize anchorLayer; @@ -35,7 +33,14 @@ @implementation CPTLayerAnnotation **/ @synthesize rectAnchor; +/** @property CPTConstraints *xConstraints + * @brief The constraints used to position the content layer relative to the reference layer in the x-direction. Setting the @ref rectAnchor resets the constraints. + **/ @synthesize xConstraints; + +/** @property CPTConstraints *yConstraints + * @brief The constraints used to position the content layer relative to the reference layer in the y-direction. Setting the @ref rectAnchor resets the constraints. + **/ @synthesize yConstraints; #pragma mark - @@ -52,11 +57,11 @@ @implementation CPTLayerAnnotation * @param newAnchorLayer The reference layer. Must be non-@nil. * @return The initialized CPTLayerAnnotation object. **/ --(instancetype)initWithAnchorLayer:(CPTLayer *)newAnchorLayer +-(nonnull instancetype)initWithAnchorLayer:(nonnull CPTLayer *)newAnchorLayer { NSParameterAssert(newAnchorLayer); - if ( (self = [super init]) ) { + if ((self = [super init])) { anchorLayer = newAnchorLayer; rectAnchor = CPTRectAnchorTop; xConstraints = nil; @@ -75,10 +80,11 @@ -(instancetype)initWithAnchorLayer:(CPTLayer *)newAnchorLayer /// @cond -// anchorLayer is required; this will fail the assertion in -initWithAnchorLayer: --(instancetype)init +// anchorLayer is required +-(nonnull instancetype)init { - return [self initWithAnchorLayer:nil]; + [NSException raise:CPTException format:@"%@ must be initialized with an anchor layer.", NSStringFromClass([self class])]; + return [self initWithAnchorLayer:[CPTLayer layer]]; } -(void)dealloc @@ -94,7 +100,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -110,13 +116,25 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - anchorLayer = [coder decodeObjectForKey:@"CPTLayerAnnotation.anchorLayer"]; - xConstraints = [coder decodeObjectForKey:@"CPTLayerAnnotation.xConstraints"]; - yConstraints = [coder decodeObjectForKey:@"CPTLayerAnnotation.yConstraints"]; - rectAnchor = (CPTRectAnchor)[coder decodeIntegerForKey : @"CPTLayerAnnotation.rectAnchor"]; + if ((self = [super initWithCoder:coder])) { + CPTLayer *anchor = [coder decodeObjectOfClass:[CPTLayer class] + forKey:@"CPTLayerAnnotation.anchorLayer"]; + xConstraints = [coder decodeObjectOfClass:[CPTConstraints class] + forKey:@"CPTLayerAnnotation.xConstraints"]; + yConstraints = [coder decodeObjectOfClass:[CPTConstraints class] + forKey:@"CPTLayerAnnotation.yConstraints"]; + rectAnchor = (CPTRectAnchor)[coder decodeIntegerForKey:@"CPTLayerAnnotation.rectAnchor"]; + + if ( anchor ) { + anchorLayer = anchor; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(positionContentLayer) + name:CPTLayerBoundsDidChangeNotification + object:anchor]; + } } return self; } @@ -150,7 +168,7 @@ -(void)positionContentLayer content.anchorPoint = self.contentAnchorPoint; content.position = newPosition; - content.transform = CATransform3DMakeRotation( self.rotation, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0) ); + content.transform = CATransform3DMakeRotation(self.rotation, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0)); [content pixelAlign]; } } @@ -158,6 +176,18 @@ -(void)positionContentLayer /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Constraints @@ -232,6 +262,21 @@ -(void)setRectAnchor:(CPTRectAnchor)newAnchor if ( newAnchor != rectAnchor ) { rectAnchor = newAnchor; [self setConstraints]; + } +} + +-(void)setXConstraints:(CPTConstraints *)newConstraints +{ + if ( newConstraints != xConstraints ) { + xConstraints = newConstraints; + [self positionContentLayer]; + } +} + +-(void)setYConstraints:(CPTConstraints *)newConstraints +{ + if ( newConstraints != yConstraints ) { + yConstraints = newConstraints; [self positionContentLayer]; } } diff --git a/framework/Source/CPTLayerTests.h b/framework/Source/CPTLayerTests.h index a000a6901..fa9b9ba33 100644 --- a/framework/Source/CPTLayerTests.h +++ b/framework/Source/CPTLayerTests.h @@ -1,10 +1,12 @@ #import "CPTTestCase.h" +#import "CPTDefinitions.h" + @class CPTLayer; @interface CPTLayerTests : CPTTestCase -@property (nonatomic, readwrite, strong) CPTLayer *layer; -@property (nonatomic, readwrite, strong) NSArray *positions; +@property (nonatomic, readwrite, strong, nonnull) CPTLayer *layer; +@property (nonatomic, readwrite, strong, nonnull) CPTNumberArray *positions; @end diff --git a/framework/Source/CPTLayerTests.m b/framework/Source/CPTLayerTests.m index bb2c927a0..d94be1dc5 100644 --- a/framework/Source/CPTLayerTests.m +++ b/framework/Source/CPTLayerTests.m @@ -4,11 +4,11 @@ #import "CPTUtilities.h" #import "NSNumberExtensions.h" -static const double precision = 1.0e-6; +static const CGFloat precision = CPTFloat(1.0e-6); @interface CPTLayerTests() --(void)testPositionsWithScale:(CGFloat)scale anchorPoint:(CGPoint)anchor expected:(NSArray *)expected; +-(void)testPositionsWithScale:(CGFloat)scale anchorPoint:(CGPoint)anchor expected:(CPTNumberArray *)expected; @end @@ -40,7 +40,7 @@ -(void)tearDown -(void)testPixelAlign1xLeft { - NSArray *expected = @[@10.0, @10.0, @11.0, @11.0, @11.0, @11.0]; + CPTNumberArray *expected = @[@10.0, @10.0, @11.0, @11.0, @11.0, @11.0]; [self testPositionsWithScale:CPTFloat(1.0) anchorPoint:CGPointZero @@ -49,7 +49,7 @@ -(void)testPixelAlign1xLeft -(void)testPixelAlign1xLeftMiddle { - NSArray *expected = @[@10.75, @10.75, @10.75, @10.75, @10.75, @10.75]; + CPTNumberArray *expected = @[@10.75, @10.75, @10.75, @10.75, @10.75, @10.75]; [self testPositionsWithScale:CPTFloat(1.0) anchorPoint:CPTPointMake(0.25, 0.25) @@ -58,7 +58,7 @@ -(void)testPixelAlign1xLeftMiddle -(void)testPixelAlign1xMiddle { - NSArray *expected = @[@10.5, @10.5, @10.5, @10.5, @10.5, @11.5]; + CPTNumberArray *expected = @[@10.5, @10.5, @10.5, @10.5, @10.5, @11.5]; [self testPositionsWithScale:CPTFloat(1.0) anchorPoint:CPTPointMake(0.5, 0.5) @@ -67,7 +67,7 @@ -(void)testPixelAlign1xMiddle -(void)testPixelAlign1xRightMiddle { - NSArray *expected = @[@10.25, @10.25, @10.25, @11.25, @11.25, @11.25]; + CPTNumberArray *expected = @[@10.25, @10.25, @10.25, @11.25, @11.25, @11.25]; [self testPositionsWithScale:CPTFloat(1.0) anchorPoint:CPTPointMake(0.75, 0.75) @@ -76,7 +76,7 @@ -(void)testPixelAlign1xRightMiddle -(void)testPixelAlign1xRight { - NSArray *expected = @[@10.0, @10.0, @11.0, @11.0, @11.0, @11.0]; + CPTNumberArray *expected = @[@10.0, @10.0, @11.0, @11.0, @11.0, @11.0]; [self testPositionsWithScale:CPTFloat(1.0) anchorPoint:CPTPointMake(1.0, 1.0) @@ -87,7 +87,7 @@ -(void)testPixelAlign1xRight -(void)testPixelAlign2xLeft { - NSArray *expected = @[@10.5, @10.5, @10.5, @11.0, @11.0, @11.0]; + CPTNumberArray *expected = @[@10.5, @10.5, @10.5, @11.0, @11.0, @11.0]; [self testPositionsWithScale:CPTFloat(2.0) anchorPoint:CGPointZero @@ -96,7 +96,7 @@ -(void)testPixelAlign2xLeft -(void)testPixelAlign2xLeftMiddle { - NSArray *expected = @[@10.25, @10.25, @10.75, @10.75, @10.75, @11.25]; + CPTNumberArray *expected = @[@10.25, @10.25, @10.75, @10.75, @10.75, @11.25]; [self testPositionsWithScale:CPTFloat(2.0) anchorPoint:CPTPointMake(0.25, 0.25) @@ -105,7 +105,7 @@ -(void)testPixelAlign2xLeftMiddle -(void)testPixelAlign2xMiddle { - NSArray *expected = @[@10.5, @10.5, @10.5, @11.0, @11.0, @11.0]; + CPTNumberArray *expected = @[@10.5, @10.5, @10.5, @11.0, @11.0, @11.0]; [self testPositionsWithScale:CPTFloat(2.0) anchorPoint:CPTPointMake(0.5, 0.5) @@ -114,7 +114,7 @@ -(void)testPixelAlign2xMiddle -(void)testPixelAlign2xRightMiddle { - NSArray *expected = @[@10.25, @10.25, @10.75, @10.75, @10.75, @11.25]; + CPTNumberArray *expected = @[@10.25, @10.25, @10.75, @10.75, @10.75, @11.25]; [self testPositionsWithScale:CPTFloat(2.0) anchorPoint:CPTPointMake(0.75, 0.75) @@ -123,7 +123,7 @@ -(void)testPixelAlign2xRightMiddle -(void)testPixelAlign2xRight { - NSArray *expected = @[@10.5, @10.5, @10.5, @11.0, @11.0, @11.0]; + CPTNumberArray *expected = @[@10.5, @10.5, @10.5, @11.0, @11.0, @11.0]; [self testPositionsWithScale:CPTFloat(2.0) anchorPoint:CPTPointMake(1.0, 1.0) @@ -132,7 +132,7 @@ -(void)testPixelAlign2xRight #pragma mark - Utility methods --(void)testPositionsWithScale:(CGFloat)scale anchorPoint:(CGPoint)anchor expected:(NSArray *)expectedValues +-(void)testPositionsWithScale:(CGFloat)scale anchorPoint:(CGPoint)anchor expected:(CPTNumberArray *)expectedValues { NSUInteger positionCount = self.positions.count; @@ -142,20 +142,20 @@ -(void)testPositionsWithScale:(CGFloat)scale anchorPoint:(CGPoint)anchor expecte self.layer.anchorPoint = anchor; for ( NSUInteger i = 0; i < positionCount; i++ ) { - CGFloat position = ( (NSNumber *)( (self.positions)[i] ) ).cgFloatValue; + CGFloat position = ((NSNumber *)((self.positions)[i])).cgFloatValue; CGPoint layerPosition = CGPointMake(position, position); self.layer.position = layerPosition; [self.layer pixelAlign]; CGPoint alignedPoint = self.layer.position; - CGFloat expected = ( (NSNumber *)(expectedValues[i]) ).cgFloatValue; + CGFloat expected = ((NSNumber *)(expectedValues[i])).cgFloatValue; NSString *errMessage; - errMessage = [NSString stringWithFormat:@"pixelAlign at x = %g with scale %g and anchor %@", position, scale, CPTStringFromPoint(anchor)]; + errMessage = [NSString stringWithFormat:@"pixelAlign at x = %g with scale %g and anchor %@", (double)position, (double)scale, CPTStringFromPoint(anchor)]; XCTAssertEqualWithAccuracy(alignedPoint.x, expected, precision, @"%@", errMessage); - errMessage = [NSString stringWithFormat:@"pixelAlign at y = %g with scale %g and anchor %@", position, scale, CPTStringFromPoint(anchor)]; + errMessage = [NSString stringWithFormat:@"pixelAlign at y = %g with scale %g and anchor %@", (double)position, (double)scale, CPTStringFromPoint(anchor)]; XCTAssertEqualWithAccuracy(alignedPoint.y, expected, precision, @"%@", errMessage); } } diff --git a/framework/Source/CPTLegend.h b/framework/Source/CPTLegend.h index 5b5485ffc..d865a3e21 100644 --- a/framework/Source/CPTLegend.h +++ b/framework/Source/CPTLegend.h @@ -1,37 +1,54 @@ #import "CPTBorderedLayer.h" +#import "CPTPlot.h" /// @file @class CPTFill; @class CPTLegend; @class CPTLineStyle; -@class CPTPlot; @class CPTTextStyle; +/** + * @brief Graph notification type. + **/ +typedef NSString *CPTLegendNotification cpt_swift_struct; + /// @name Legend /// @{ /** @brief Notification sent by plots to tell the legend it should redraw itself. * @ingroup notification **/ -extern NSString *const CPTLegendNeedsRedrawForPlotNotification; +extern CPTLegendNotification __nonnull const CPTLegendNeedsRedrawForPlotNotification NS_SWIFT_NAME(needsRedrawForPlot); /** @brief Notification sent by plots to tell the legend it should update its layout and redraw itself. * @ingroup notification **/ -extern NSString *const CPTLegendNeedsLayoutForPlotNotification; +extern CPTLegendNotification __nonnull const CPTLegendNeedsLayoutForPlotNotification NS_SWIFT_NAME(needsLayoutForPlot); /** @brief Notification sent by plots to tell the legend it should reload all legend entries. * @ingroup notification **/ -extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; +extern CPTLegendNotification __nonnull const CPTLegendNeedsReloadEntriesForPlotNotification NS_SWIFT_NAME(needsReloadEntriesForPlot); /// @} +/** + * @brief Enumeration of legend layout options. + **/ +typedef NS_ENUM (NSInteger, CPTLegendSwatchLayout) { + CPTLegendSwatchLayoutLeft, ///< Lay out the swatch to the left side of the title. + CPTLegendSwatchLayoutRight, ///< Lay out the swatch to the right side of the title. + CPTLegendSwatchLayoutTop, ///< Lay out the swatch above the title. + CPTLegendSwatchLayoutBottom ///< Lay out the swatch below the title. +}; + +#pragma mark - + /** * @brief Legend delegate. **/ -@protocol CPTLegendDelegate +@protocol CPTLegendDelegate @optional @@ -44,7 +61,7 @@ extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; * @param plot The plot. * @return The fill for the legend entry background or @nil to use the default @link CPTLegend::entryFill entryFill @endlink . **/ --(CPTFill *)legend:(CPTLegend *)legend fillForEntryAtIndex:(NSUInteger)idx forPlot:(CPTPlot *)plot; +-(nullable CPTFill *)legend:(nonnull CPTLegend *)legend fillForEntryAtIndex:(NSUInteger)idx forPlot:(nonnull CPTPlot *)plot; /** @brief @optional This method gives the delegate a chance to provide a border line style for each legend entry. * @param legend The legend. @@ -52,7 +69,7 @@ extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; * @param plot The plot. * @return The line style for the legend entry border or @nil to use the default @link CPTLegend::entryBorderLineStyle entryBorderLineStyle @endlink . **/ --(CPTLineStyle *)legend:(CPTLegend *)legend lineStyleForEntryAtIndex:(NSUInteger)idx forPlot:(CPTPlot *)plot; +-(nullable CPTLineStyle *)legend:(nonnull CPTLegend *)legend lineStyleForEntryAtIndex:(NSUInteger)idx forPlot:(nonnull CPTPlot *)plot; /** @brief @optional This method gives the delegate a chance to provide a custom swatch fill for each legend entry. * @param legend The legend. @@ -60,7 +77,7 @@ extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; * @param plot The plot. * @return The fill for the legend swatch or @nil to use the default @link CPTLegend::swatchFill swatchFill @endlink . **/ --(CPTFill *)legend:(CPTLegend *)legend fillForSwatchAtIndex:(NSUInteger)idx forPlot:(CPTPlot *)plot; +-(nullable CPTFill *)legend:(nonnull CPTLegend *)legend fillForSwatchAtIndex:(NSUInteger)idx forPlot:(nonnull CPTPlot *)plot; /** @brief @optional This method gives the delegate a chance to provide a custom swatch border line style for each legend entry. * @param legend The legend. @@ -68,7 +85,7 @@ extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; * @param plot The plot. * @return The line style for the legend swatch border or @nil to use the default @link CPTLegend::swatchBorderLineStyle swatchBorderLineStyle @endlink . **/ --(CPTLineStyle *)legend:(CPTLegend *)legend lineStyleForSwatchAtIndex:(NSUInteger)idx forPlot:(CPTPlot *)plot; +-(nullable CPTLineStyle *)legend:(nonnull CPTLegend *)legend lineStyleForSwatchAtIndex:(NSUInteger)idx forPlot:(nonnull CPTPlot *)plot; /** @brief @optional This method gives the delegate a chance to draw custom swatches for each legend entry. * @@ -82,7 +99,7 @@ extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; * @param context The graphics context to draw into. * @return @YES if the legend should draw the default swatch or @NO if the delegate handled the drawing. **/ --(BOOL)legend:(CPTLegend *)legend shouldDrawSwatchAtIndex:(NSUInteger)idx forPlot:(CPTPlot *)plot inRect:(CGRect)rect inContext:(CGContextRef)context; +-(BOOL)legend:(nonnull CPTLegend *)legend shouldDrawSwatchAtIndex:(NSUInteger)idx forPlot:(nonnull CPTPlot *)plot inRect:(CGRect)rect inContext:(nonnull CGContextRef)context; /// @} @@ -98,7 +115,7 @@ extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; * @if MacOnly clicked legend entry. @endif * @if iOSOnly touched legend entry. @endif **/ --(void)legend:(CPTLegend *)legend legendEntryForPlot:(CPTPlot *)plot wasSelectedAtIndex:(NSUInteger)idx; +-(void)legend:(nonnull CPTLegend *)legend legendEntryForPlot:(nonnull CPTPlot *)plot wasSelectedAtIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that the swatch or label of a legend entry * @if MacOnly was both pressed and released. @endif @@ -110,7 +127,7 @@ extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; * @if iOSOnly touched legend entry. @endif * @param event The event that triggered the selection. **/ --(void)legend:(CPTLegend *)legend legendEntryForPlot:(CPTPlot *)plot wasSelectedAtIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)legend:(nonnull CPTLegend *)legend legendEntryForPlot:(nonnull CPTPlot *)plot wasSelectedAtIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that the swatch or label of a legend entry * @if MacOnly was pressed. @endif @@ -121,7 +138,7 @@ extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; * @if MacOnly clicked legend entry. @endif * @if iOSOnly touched legend entry. @endif **/ --(void)legend:(CPTLegend *)legend legendEntryForPlot:(CPTPlot *)plot touchDownAtIndex:(NSUInteger)idx; +-(void)legend:(nonnull CPTLegend *)legend legendEntryForPlot:(nonnull CPTPlot *)plot touchDownAtIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that the swatch or label of a legend entry * @if MacOnly was pressed. @endif @@ -133,7 +150,7 @@ extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; * @if iOSOnly touched legend entry. @endif * @param event The event that triggered the selection. **/ --(void)legend:(CPTLegend *)legend legendEntryForPlot:(CPTPlot *)plot touchDownAtIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)legend:(nonnull CPTLegend *)legend legendEntryForPlot:(nonnull CPTPlot *)plot touchDownAtIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that the swatch or label of a legend entry * @if MacOnly was released. @endif @@ -144,7 +161,7 @@ extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; * @if MacOnly clicked legend entry. @endif * @if iOSOnly touched legend entry. @endif **/ --(void)legend:(CPTLegend *)legend legendEntryForPlot:(CPTPlot *)plot touchUpAtIndex:(NSUInteger)idx; +-(void)legend:(nonnull CPTLegend *)legend legendEntryForPlot:(nonnull CPTPlot *)plot touchUpAtIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that the swatch or label of a legend entry * @if MacOnly was released. @endif @@ -156,7 +173,7 @@ extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; * @if iOSOnly touched legend entry. @endif * @param event The event that triggered the selection. **/ --(void)legend:(CPTLegend *)legend legendEntryForPlot:(CPTPlot *)plot touchUpAtIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)legend:(nonnull CPTLegend *)legend legendEntryForPlot:(nonnull CPTPlot *)plot touchUpAtIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /// @} @@ -168,15 +185,15 @@ extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; /// @name Formatting /// @{ -@property (nonatomic, readwrite, copy) CPTTextStyle *textStyle; +@property (nonatomic, readwrite, copy, nullable) CPTTextStyle *textStyle; @property (nonatomic, readwrite, assign) CGSize swatchSize; -@property (nonatomic, readwrite, copy) CPTLineStyle *swatchBorderLineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *swatchBorderLineStyle; @property (nonatomic, readwrite, assign) CGFloat swatchCornerRadius; -@property (nonatomic, readwrite, copy) CPTFill *swatchFill; +@property (nonatomic, readwrite, copy, nullable) CPTFill *swatchFill; -@property (nonatomic, readwrite, copy) CPTLineStyle *entryBorderLineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *entryBorderLineStyle; @property (nonatomic, readwrite, assign) CGFloat entryCornerRadius; -@property (nonatomic, readwrite, copy) CPTFill *entryFill; +@property (nonatomic, readwrite, copy, nullable) CPTFill *entryFill; @property (nonatomic, readwrite, assign) CGFloat entryPaddingLeft; @property (nonatomic, readwrite, assign) CGFloat entryPaddingTop; @property (nonatomic, readwrite, assign) CGFloat entryPaddingRight; @@ -190,37 +207,38 @@ extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification; @property (nonatomic, readwrite, assign) NSUInteger numberOfColumns; @property (nonatomic, readwrite, assign) BOOL equalRows; @property (nonatomic, readwrite, assign) BOOL equalColumns; -@property (nonatomic, readwrite, copy) NSArray *rowHeights; -@property (nonatomic, readonly) NSArray *rowHeightsThatFit; -@property (nonatomic, readwrite, copy) NSArray *columnWidths; -@property (nonatomic, readonly) NSArray *columnWidthsThatFit; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *rowHeights; +@property (nonatomic, readonly, nullable) CPTNumberArray *rowHeightsThatFit; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *columnWidths; +@property (nonatomic, readonly, nullable) CPTNumberArray *columnWidthsThatFit; @property (nonatomic, readwrite, assign) CGFloat columnMargin; @property (nonatomic, readwrite, assign) CGFloat rowMargin; @property (nonatomic, readwrite, assign) CGFloat titleOffset; +@property (nonatomic, readwrite, assign) CPTLegendSwatchLayout swatchLayout; /// @} /// @name Factory Methods /// @{ -+(instancetype)legendWithPlots:(NSArray *)newPlots; -+(instancetype)legendWithGraph:(CPTGraph *)graph; ++(nonnull instancetype)legendWithPlots:(nullable CPTPlotArray *)newPlots; ++(nonnull instancetype)legendWithGraph:(nullable __kindof CPTGraph *)graph; /// @} /// @name Initialization /// @{ --(instancetype)initWithPlots:(NSArray *)newPlots; --(instancetype)initWithGraph:(CPTGraph *)graph; +-(nonnull instancetype)initWithPlots:(nullable CPTPlotArray *)newPlots; +-(nonnull instancetype)initWithGraph:(nullable __kindof CPTGraph *)graph; /// @} /// @name Plots /// @{ --(NSArray *)allPlots; --(CPTPlot *)plotAtIndex:(NSUInteger)idx; --(CPTPlot *)plotWithIdentifier:(id)identifier; - --(void)addPlot:(CPTPlot *)plot; --(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx; --(void)removePlot:(CPTPlot *)plot; --(void)removePlotWithIdentifier:(id)identifier; +-(nonnull CPTPlotArray *)allPlots; +-(nullable CPTPlot *)plotAtIndex:(NSUInteger)idx; +-(nullable CPTPlot *)plotWithIdentifier:(nullable id)identifier; + +-(void)addPlot:(nonnull CPTPlot *)plot; +-(void)insertPlot:(nonnull CPTPlot *)plot atIndex:(NSUInteger)idx; +-(void)removePlot:(nonnull CPTPlot *)plot; +-(void)removePlotWithIdentifier:(nullable id)identifier; /// @} /// @name Layout diff --git a/framework/Source/CPTLegend.m b/framework/Source/CPTLegend.m index 3197a0249..c5fcb69c4 100644 --- a/framework/Source/CPTLegend.m +++ b/framework/Source/CPTLegend.m @@ -6,7 +6,6 @@ #import "CPTLegendEntry.h" #import "CPTLineStyle.h" #import "CPTPathExtensions.h" -#import "CPTPlot.h" #import "CPTTextStyle.h" #import "CPTUtilities.h" #import "NSCoderExtensions.h" @@ -16,33 +15,33 @@ /** @defgroup legendAnimation Legends * @brief Legend properties that can be animated using Core Animation. * @if MacOnly - * @since Custom layer property animation is supported on MacOS 10.6 and later. + * @since Custom layer property animation is supported on macOS 10.6 and later. * @endif * @ingroup animation **/ -NSString *const CPTLegendNeedsRedrawForPlotNotification = @"CPTLegendNeedsRedrawForPlotNotification"; -NSString *const CPTLegendNeedsLayoutForPlotNotification = @"CPTLegendNeedsLayoutForPlotNotification"; -NSString *const CPTLegendNeedsReloadEntriesForPlotNotification = @"CPTLegendNeedsReloadEntriesForPlotNotification"; +CPTLegendNotification const CPTLegendNeedsRedrawForPlotNotification = @"CPTLegendNeedsRedrawForPlotNotification"; +CPTLegendNotification const CPTLegendNeedsLayoutForPlotNotification = @"CPTLegendNeedsLayoutForPlotNotification"; +CPTLegendNotification const CPTLegendNeedsReloadEntriesForPlotNotification = @"CPTLegendNeedsReloadEntriesForPlotNotification"; /// @cond @interface CPTLegend() -@property (nonatomic, readwrite, strong) NSMutableArray *plots; -@property (nonatomic, readwrite, strong) NSMutableArray *legendEntries; -@property (nonatomic, readwrite, strong) NSArray *rowHeightsThatFit; -@property (nonatomic, readwrite, strong) NSArray *columnWidthsThatFit; +@property (nonatomic, readwrite, strong, nonnull) CPTMutablePlotArray *plots; +@property (nonatomic, readwrite, strong, nonnull) CPTMutableLegendEntryArray *legendEntries; +@property (nonatomic, readwrite, strong, nullable) CPTNumberArray *rowHeightsThatFit; +@property (nonatomic, readwrite, strong, nullable) CPTNumberArray *columnWidthsThatFit; @property (nonatomic, readwrite, assign) BOOL layoutChanged; -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTLegendEntry *pointingDeviceDownEntry; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTLegendEntry *pointingDeviceDownEntry; -(void)recalculateLayout; --(void)removeLegendEntriesForPlot:(CPTPlot *)plot; +-(void)removeLegendEntriesForPlot:(nonnull CPTPlot *)plot; --(void)legendEntryForInteractionPoint:(CGPoint)interactionPoint row:(NSUInteger *)row col:(NSUInteger *)col; +-(void)legendEntryForInteractionPoint:(CGPoint)interactionPoint row:(nonnull NSUInteger *)row col:(nonnull NSUInteger *)col; --(void)legendNeedsRedraw:(NSNotification *)notif; --(void)legendNeedsLayout:(NSNotification *)notif; --(void)legendNeedsReloadEntries:(NSNotification *)notif; +-(void)legendNeedsRedraw:(nonnull NSNotification *)notif; +-(void)legendNeedsLayout:(nonnull NSNotification *)notif; +-(void)legendNeedsReloadEntries:(nonnull NSNotification *)notif; @end @@ -67,7 +66,7 @@ -(void)legendNeedsReloadEntries:(NSNotification *)notif; **/ @implementation CPTLegend -/** @property CPTTextStyle *textStyle +/** @property nullable CPTTextStyle *textStyle * @brief The text style used to draw all legend entry titles. **/ @synthesize textStyle; @@ -78,7 +77,7 @@ @implementation CPTLegend **/ @synthesize swatchSize; -/** @property CPTLineStyle *swatchBorderLineStyle +/** @property nullable CPTLineStyle *swatchBorderLineStyle * @brief The line style for the border drawn around each swatch. * If @nil (the default), no border is drawn. **/ @@ -90,13 +89,13 @@ @implementation CPTLegend **/ @synthesize swatchCornerRadius; -/** @property CPTFill *swatchFill +/** @property nullable CPTFill *swatchFill * @brief The background fill drawn behind each swatch. * If @nil (the default), no fill is drawn. **/ @synthesize swatchFill; -/** @property CPTLineStyle *entryBorderLineStyle +/** @property nullable CPTLineStyle *entryBorderLineStyle * @brief The line style for the border drawn around each legend entry. * If @nil (the default), no border is drawn. **/ @@ -108,7 +107,7 @@ @implementation CPTLegend **/ @synthesize entryCornerRadius; -/** @property CPTFill *entryFill +/** @property nullable CPTFill *entryFill * @brief The background fill drawn behind each legend entry. * If @nil (the default), no fill is drawn. **/ @@ -161,7 +160,7 @@ @implementation CPTLegend **/ @synthesize equalColumns; -/** @property NSArray *rowHeights +/** @property nullable CPTNumberArray *rowHeights * @brief The desired height of each row of legend entries, including the swatch and title. * Each element in this array should be an NSNumber representing the height of the corresponding row in device units. * Rows are numbered from top to bottom starting from zero (@num{0}). If @nil, all rows will be sized automatically. @@ -170,14 +169,14 @@ @implementation CPTLegend **/ @synthesize rowHeights; -/** @property NSArray *rowHeightsThatFit +/** @property nullable CPTNumberArray *rowHeightsThatFit * @brief The computed best-fit height of each row of legend entries, including the swatch and title. * Each element in this array is an NSNumber representing the height of the corresponding row in device units. * Rows are numbered from top to bottom starting from zero (@num{0}). **/ @synthesize rowHeightsThatFit; -/** @property NSArray *columnWidths +/** @property nullable CPTNumberArray *columnWidths * @brief The desired width of each column of legend entries, including the swatch, title, and title offset. * Each element in this array should be an NSNumber representing the width of the corresponding column in device units. * Columns are numbered from left to right starting from zero (@num{0}). If @nil, all columns will be sized automatically. @@ -186,7 +185,7 @@ @implementation CPTLegend **/ @synthesize columnWidths; -/** @property NSArray *columnWidthsThatFit +/** @property nullable CPTNumberArray *columnWidthsThatFit * @brief The computed best-fit width of each column of legend entries, including the swatch, title, and title offset. * Each element in this array is an NSNumber representing the width of the corresponding column in device units. * Columns are numbered from left to right starting from zero (@num{0}). @@ -208,12 +207,19 @@ @implementation CPTLegend **/ @synthesize titleOffset; -/** @property NSMutableArray *plots +/** @property CPTLegendSwatchLayout swatchLayout + * @brief Where to draw the legend swatch relative to the title. Default is #CPTLegendSwatchLayoutLeft. + **/ +@synthesize swatchLayout; + +/** @internal + * @property nonnull CPTMutablePlotArray *plots * @brief An array of all plots associated with the legend. **/ @synthesize plots; -/** @property NSMutableArray *legendEntries +/** @internal + * @property nonnull CPTMutableLegendEntryArray *legendEntries * @brief An array of all legend entries. **/ @synthesize legendEntries; @@ -224,7 +230,7 @@ @implementation CPTLegend @synthesize layoutChanged; /** @internal - * @property cpt_weak CPTLegendEntry *pointingDeviceDownEntry + * @property nullable CPTLegendEntry *pointingDeviceDownEntry * @brief The legend entry that was selected on the pointing device down event. **/ @synthesize pointingDeviceDownEntry; @@ -236,7 +242,7 @@ @implementation CPTLegend * @param newPlots An array of plots. * @return A new CPTLegend instance. **/ -+(instancetype)legendWithPlots:(NSArray *)newPlots ++(nonnull instancetype)legendWithPlots:(nullable CPTPlotArray *)newPlots { return [[self alloc] initWithPlots:newPlots]; } @@ -245,7 +251,7 @@ +(instancetype)legendWithPlots:(NSArray *)newPlots * @param graph The graph. * @return A new CPTLegend instance. **/ -+(instancetype)legendWithGraph:(CPTGraph *)graph ++(nonnull instancetype)legendWithGraph:(nullable __kindof CPTGraph *)graph { return [[self alloc] initWithGraph:graph]; } @@ -283,6 +289,7 @@ +(instancetype)legendWithGraph:(CPTGraph *)graph * - @ref columnMargin = @num{10.0} * - @ref rowMargin = @num{5.0} * - @ref titleOffset = @num{5.0} + * - @ref swatchLayout = #CPTLegendSwatchLayoutLeft * - @ref paddingLeft = @num{5.0} * - @ref paddingTop = @num{5.0} * - @ref paddingRight = @num{5.0} @@ -292,9 +299,9 @@ +(instancetype)legendWithGraph:(CPTGraph *)graph * @param newFrame The frame rectangle. * @return The initialized CPTLegend object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { plots = [[NSMutableArray alloc] init]; legendEntries = [[NSMutableArray alloc] init]; layoutChanged = YES; @@ -321,6 +328,7 @@ -(instancetype)initWithFrame:(CGRect)newFrame columnMargin = CPTFloat(10.0); rowMargin = CPTFloat(5.0); titleOffset = CPTFloat(5.0); + swatchLayout = CPTLegendSwatchLayoutLeft; pointingDeviceDownEntry = nil; @@ -340,9 +348,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame * @param newPlots An array of plots. * @return The initialized CPTLegend object. **/ --(instancetype)initWithPlots:(NSArray *)newPlots +-(nonnull instancetype)initWithPlots:(nullable CPTPlotArray *)newPlots { - if ( (self = [self initWithFrame:CGRectZero]) ) { + if ((self = [self initWithFrame:CGRectZero])) { for ( CPTPlot *plot in newPlots ) { [self addPlot:plot]; } @@ -354,9 +362,9 @@ -(instancetype)initWithPlots:(NSArray *)newPlots * @param graph A graph. * @return The initialized CPTLegend object. **/ --(instancetype)initWithGraph:(CPTGraph *)graph +-(nonnull instancetype)initWithGraph:(nullable __kindof CPTGraph *)graph { - if ( (self = [self initWithFrame:CGRectZero]) ) { + if ((self = [self initWithFrame:CGRectZero])) { for ( CPTPlot *plot in [graph allPlots] ) { [self addPlot:plot]; } @@ -366,9 +374,9 @@ -(instancetype)initWithGraph:(CPTGraph *)graph /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTLegend *theLayer = (CPTLegend *)layer; plots = theLayer->plots; @@ -397,6 +405,7 @@ -(instancetype)initWithLayer:(id)layer columnMargin = theLayer->columnMargin; rowMargin = theLayer->rowMargin; titleOffset = theLayer->titleOffset; + swatchLayout = theLayer->swatchLayout; pointingDeviceDownEntry = theLayer->pointingDeviceDownEntry; } @@ -415,7 +424,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -445,40 +454,67 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeCGFloat:self.columnMargin forKey:@"CPTLegend.columnMargin"]; [coder encodeCGFloat:self.rowMargin forKey:@"CPTLegend.rowMargin"]; [coder encodeCGFloat:self.titleOffset forKey:@"CPTLegend.titleOffset"]; + [coder encodeInteger:(NSInteger)self.swatchLayout forKey:@"CPTLegend.swatchLayout"]; // No need to archive these properties: // pointingDeviceDownEntry } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - plots = [[coder decodeObjectForKey:@"CPTLegend.plots"] mutableCopy]; - legendEntries = [[coder decodeObjectForKey:@"CPTLegend.legendEntries"] mutableCopy]; - layoutChanged = [coder decodeBoolForKey:@"CPTLegend.layoutChanged"]; - textStyle = [[coder decodeObjectForKey:@"CPTLegend.textStyle"] copy]; + if ((self = [super initWithCoder:coder])) { + NSArray *plotArray = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTPlot class]]] + forKey:@"CPTLegend.plots"]; + if ( plotArray ) { + plots = [plotArray mutableCopy]; + } + else { + plots = [[NSMutableArray alloc] init]; + } + + NSArray *entries = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTLegendEntry class]]] + forKey:@"CPTLegend.legendEntries"]; + if ( entries ) { + legendEntries = [entries mutableCopy]; + } + else { + legendEntries = [[NSMutableArray alloc] init]; + } + + layoutChanged = [coder decodeBoolForKey:@"CPTLegend.layoutChanged"]; + textStyle = [[coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTLegend.textStyle"] copy]; swatchSize = [coder decodeCPTSizeForKey:@"CPTLegend.swatchSize"]; - swatchBorderLineStyle = [[coder decodeObjectForKey:@"CPTLegend.swatchBorderLineStyle"] copy]; - swatchCornerRadius = [coder decodeCGFloatForKey:@"CPTLegend.swatchCornerRadius"]; - swatchFill = [[coder decodeObjectForKey:@"CPTLegend.swatchFill"] copy]; - entryBorderLineStyle = [[coder decodeObjectForKey:@"CPTLegend.entryBorderLineStyle"] copy]; - entryCornerRadius = [coder decodeCGFloatForKey:@"CPTLegend.entryCornerRadius"]; - entryFill = [[coder decodeObjectForKey:@"CPTLegend.entryFill"] copy]; - entryPaddingLeft = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingLeft"]; - entryPaddingTop = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingTop"]; - entryPaddingRight = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingRight"]; - entryPaddingBottom = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingBottom"]; - numberOfRows = (NSUInteger)[coder decodeIntegerForKey : @"CPTLegend.numberOfRows"]; - numberOfColumns = (NSUInteger)[coder decodeIntegerForKey : @"CPTLegend.numberOfColumns"]; - equalRows = [coder decodeBoolForKey:@"CPTLegend.equalRows"]; - equalColumns = [coder decodeBoolForKey:@"CPTLegend.equalColumns"]; - rowHeights = [[coder decodeObjectForKey:@"CPTLegend.rowHeights"] copy]; - rowHeightsThatFit = [coder decodeObjectForKey:@"CPTLegend.rowHeightsThatFit"]; - columnWidths = [[coder decodeObjectForKey:@"CPTLegend.columnWidths"] copy]; - columnWidthsThatFit = [coder decodeObjectForKey:@"CPTLegend.columnWidthsThatFit"]; - columnMargin = [coder decodeCGFloatForKey:@"CPTLegend.columnMargin"]; - rowMargin = [coder decodeCGFloatForKey:@"CPTLegend.rowMargin"]; - titleOffset = [coder decodeCGFloatForKey:@"CPTLegend.titleOffset"]; + swatchBorderLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTLegend.swatchBorderLineStyle"] copy]; + swatchCornerRadius = [coder decodeCGFloatForKey:@"CPTLegend.swatchCornerRadius"]; + swatchFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTLegend.swatchFill"] copy]; + entryBorderLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTLegend.entryBorderLineStyle"] copy]; + entryCornerRadius = [coder decodeCGFloatForKey:@"CPTLegend.entryCornerRadius"]; + entryFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTLegend.entryFill"] copy]; + entryPaddingLeft = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingLeft"]; + entryPaddingTop = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingTop"]; + entryPaddingRight = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingRight"]; + entryPaddingBottom = [coder decodeCGFloatForKey:@"CPTLegend.entryPaddingBottom"]; + numberOfRows = (NSUInteger)[coder decodeIntegerForKey:@"CPTLegend.numberOfRows"]; + numberOfColumns = (NSUInteger)[coder decodeIntegerForKey:@"CPTLegend.numberOfColumns"]; + equalRows = [coder decodeBoolForKey:@"CPTLegend.equalRows"]; + equalColumns = [coder decodeBoolForKey:@"CPTLegend.equalColumns"]; + rowHeights = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTLegend.rowHeights"] copy]; + rowHeightsThatFit = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTLegend.rowHeightsThatFit"]; + columnWidths = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTLegend.columnWidths"] copy]; + columnWidthsThatFit = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTLegend.columnWidthsThatFit"]; + columnMargin = [coder decodeCGFloatForKey:@"CPTLegend.columnMargin"]; + rowMargin = [coder decodeCGFloatForKey:@"CPTLegend.rowMargin"]; + titleOffset = [coder decodeCGFloatForKey:@"CPTLegend.titleOffset"]; + swatchLayout = (CPTLegendSwatchLayout)[coder decodeIntegerForKey:@"CPTLegend.swatchLayout"]; pointingDeviceDownEntry = nil; } @@ -487,12 +523,24 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden ) { return; @@ -504,11 +552,25 @@ -(void)renderAsVectorInContext:(CGContextRef)context return; } + BOOL isHorizontalLayout; + + switch ( self.swatchLayout ) { + case CPTLegendSwatchLayoutLeft: + case CPTLegendSwatchLayoutRight: + isHorizontalLayout = YES; + break; + + case CPTLegendSwatchLayoutTop: + case CPTLegendSwatchLayoutBottom: + isHorizontalLayout = NO; + break; + } + // calculate column positions - NSArray *computedColumnWidths = self.columnWidthsThatFit; - NSUInteger columnCount = computedColumnWidths.count; - CGFloat *actualColumnWidths = malloc(sizeof(CGFloat) * columnCount); - CGFloat *columnPositions = malloc(sizeof(CGFloat) * columnCount); + CPTNumberArray *computedColumnWidths = self.columnWidthsThatFit; + NSUInteger columnCount = computedColumnWidths.count; + CGFloat *actualColumnWidths = calloc(columnCount, sizeof(CGFloat)); + CGFloat *columnPositions = calloc(columnCount, sizeof(CGFloat)); columnPositions[0] = self.paddingLeft; CGFloat theOffset = self.titleOffset; CGSize theSwatchSize = self.swatchSize; @@ -524,15 +586,15 @@ -(void)renderAsVectorInContext:(CGContextRef)context CGFloat width = [colWidth cgFloatValue]; actualColumnWidths[col] = width; if ( col < columnCount - 1 ) { - columnPositions[col + 1] = columnPositions[col] + padLeft + width + padRight + theOffset + theSwatchSize.width + theColumnMargin; + columnPositions[col + 1] = columnPositions[col] + padLeft + width + padRight + (isHorizontalLayout ? theOffset + theSwatchSize.width : CPTFloat(0.0)) + theColumnMargin; } } // calculate row positions - NSArray *computedRowHeights = self.rowHeightsThatFit; - NSUInteger rowCount = computedRowHeights.count; - CGFloat *actualRowHeights = malloc(sizeof(CGFloat) * rowCount); - CGFloat *rowPositions = malloc(sizeof(CGFloat) * rowCount); + CPTNumberArray *computedRowHeights = self.rowHeightsThatFit; + NSUInteger rowCount = computedRowHeights.count; + CGFloat *actualRowHeights = calloc(rowCount, sizeof(CGFloat)); + CGFloat *rowPositions = calloc(rowCount, sizeof(CGFloat)); rowPositions[rowCount - 1] = self.paddingBottom; CGFloat theRowMargin = self.rowMargin; CGFloat lastRowHeight = 0.0; @@ -543,7 +605,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context CGFloat height = [rowHeight cgFloatValue]; actualRowHeights[row] = height; if ( row < rowCount - 1 ) { - rowPositions[row] = rowPositions[row + 1] + padBottom + lastRowHeight + padTop + theRowMargin; + rowPositions[row] = rowPositions[row + 1] + padBottom + lastRowHeight + padTop + (isHorizontalLayout ? CPTFloat(0.0) : theOffset + theSwatchSize.height) + theRowMargin; } lastRowHeight = height; } @@ -565,17 +627,28 @@ -(void)renderAsVectorInContext:(CGContextRef)context NSUInteger row = legendEntry.row; NSUInteger col = legendEntry.column; - if ( ( (desiredRowCount == 0) || (row < desiredRowCount) ) && - ( (desiredColumnCount == 0) || (col < desiredColumnCount) ) ) { + if (((desiredRowCount == 0) || (row < desiredRowCount)) && + ((desiredColumnCount == 0) || (col < desiredColumnCount))) { NSUInteger entryIndex = legendEntry.index; CPTPlot *entryPlot = legendEntry.plot; CGFloat left = columnPositions[col]; CGFloat rowPosition = rowPositions[row]; - CGRect entryRect = CPTRectMake(left, - rowPosition, - padLeft + theSwatchSize.width + theOffset + actualColumnWidths[col] + CPTFloat(1.0) + padRight, - padBottom + actualRowHeights[row] + padTop); + + CGRect entryRect; + + if ( isHorizontalLayout ) { + entryRect = CPTRectMake(left, + rowPosition, + padLeft + theSwatchSize.width + theOffset + actualColumnWidths[col] + CPTFloat(1.0) + padRight, + padBottom + actualRowHeights[row] + padTop); + } + else { + entryRect = CPTRectMake(left, + rowPosition, + padLeft + MAX(theSwatchSize.width, actualColumnWidths[col]) + CPTFloat(1.0) + padRight, + padBottom + theSwatchSize.height + theOffset + actualRowHeights[row] + padTop); + } // draw background CPTFill *theFill = nil; @@ -605,19 +678,57 @@ -(void)renderAsVectorInContext:(CGContextRef)context [theLineStyle strokePathInContext:context]; } + // lay out swatch and title + CGFloat swatchLeft, swatchBottom; + CGFloat titleLeft, titleBottom; + + switch ( self.swatchLayout ) { + case CPTLegendSwatchLayoutLeft: + swatchLeft = CGRectGetMinX(entryRect) + padLeft; + swatchBottom = CGRectGetMinY(entryRect) + (entryRect.size.height - theSwatchSize.height) * CPTFloat(0.5); + + titleLeft = swatchLeft + theSwatchSize.width + theOffset; + titleBottom = CGRectGetMinY(entryRect) + padBottom; + break; + + case CPTLegendSwatchLayoutRight: + swatchLeft = CGRectGetMaxX(entryRect) - padRight - theSwatchSize.width; + swatchBottom = CGRectGetMinY(entryRect) + (entryRect.size.height - theSwatchSize.height) * CPTFloat(0.5); + + titleLeft = CGRectGetMinX(entryRect) + padLeft; + titleBottom = CGRectGetMinY(entryRect) + padBottom; + break; + + case CPTLegendSwatchLayoutTop: + swatchLeft = CGRectGetMidX(entryRect) - theSwatchSize.width * CPTFloat(0.5); + swatchBottom = CGRectGetMaxY(entryRect) - padTop - theSwatchSize.height; + + titleLeft = CGRectGetMidX(entryRect) - actualColumnWidths[col] * CPTFloat(0.5); + titleBottom = CGRectGetMinY(entryRect) + padBottom; + break; + + case CPTLegendSwatchLayoutBottom: + swatchLeft = CGRectGetMidX(entryRect) - theSwatchSize.width * CPTFloat(0.5); + swatchBottom = CGRectGetMinY(entryRect) + padBottom; + + titleLeft = CGRectGetMidX(entryRect) - actualColumnWidths[col] * CPTFloat(0.5); + titleBottom = swatchBottom + theOffset + theSwatchSize.height; + break; + } + // draw swatch - left += padLeft; - CGRect swatchRect = CPTRectMake(left, - rowPosition + (entryRect.size.height - theSwatchSize.height) * CPTFloat(0.5), + CGRect swatchRect = CPTRectMake(swatchLeft, + swatchBottom, theSwatchSize.width, theSwatchSize.height); + BOOL legendShouldDrawSwatch = YES; if ( delegateCanDraw ) { legendShouldDrawSwatch = [theDelegate legend:self - shouldDrawSwatchAtIndex:entryIndex - forPlot:entryPlot - inRect:swatchRect - inContext:context]; + shouldDrawSwatchAtIndex:entryIndex + forPlot:entryPlot + inRect:swatchRect + inContext:context]; } if ( legendShouldDrawSwatch ) { [entryPlot drawSwatchForLegend:self @@ -627,9 +738,12 @@ -(void)renderAsVectorInContext:(CGContextRef)context } // draw title - left += theSwatchSize.width + theOffset; + CGRect titleRect = CPTRectMake(titleLeft, + titleBottom, + actualColumnWidths[col] + CPTFloat(1.0), + actualRowHeights[row]); - [legendEntry drawTitleInRect:CPTAlignRectToUserSpace( context, CPTRectMake(left, rowPosition + padBottom, actualColumnWidths[col] + CPTFloat(1.0), actualRowHeights[row]) ) + [legendEntry drawTitleInRect:CPTAlignRectToUserSpace(context, titleRect) inContext:context scale:self.contentsScale]; } @@ -648,9 +762,9 @@ -(void)renderAsVectorInContext:(CGContextRef)context /// @cond -+(BOOL)needsDisplayForKey:(NSString *)aKey ++(BOOL)needsDisplayForKey:(nonnull NSString *)aKey { - static NSSet *keys = nil; + static NSSet *keys = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ @@ -693,6 +807,20 @@ -(void)recalculateLayout return; } + BOOL isHorizontalLayout; + + switch ( self.swatchLayout ) { + case CPTLegendSwatchLayoutLeft: + case CPTLegendSwatchLayoutRight: + isHorizontalLayout = YES; + break; + + case CPTLegendSwatchLayoutTop: + case CPTLegendSwatchLayoutBottom: + isHorizontalLayout = NO; + break; + } + // compute the number of rows and columns needed to hold the legend entries NSUInteger rowCount = self.numberOfRows; NSUInteger columnCount = self.numberOfColumns; @@ -700,8 +828,8 @@ -(void)recalculateLayout NSUInteger desiredColumnCount = columnCount; NSUInteger legendEntryCount = self.legendEntries.count; - if ( (rowCount == 0) && (columnCount == 0) ) { - rowCount = (NSUInteger)lrint( sqrt( (double)legendEntryCount ) ); + if ((rowCount == 0) && (columnCount == 0)) { + rowCount = (NSUInteger)lrint(sqrt((double)legendEntryCount)); columnCount = rowCount; if ( rowCount * columnCount < legendEntryCount ) { columnCount++; @@ -710,13 +838,13 @@ -(void)recalculateLayout rowCount++; } } - else if ( (rowCount == 0) && (columnCount > 0) ) { + else if ((rowCount == 0) && (columnCount > 0)) { rowCount = legendEntryCount / columnCount; if ( legendEntryCount % columnCount ) { rowCount++; } } - else if ( (rowCount > 0) && (columnCount == 0) ) { + else if ((rowCount > 0) && (columnCount == 0)) { columnCount = legendEntryCount / rowCount; if ( legendEntryCount % rowCount ) { columnCount++; @@ -724,38 +852,44 @@ -(void)recalculateLayout } // compute row heights and column widths - NSUInteger row = 0; - NSUInteger col = 0; - CGFloat *maxTitleHeight = calloc( rowCount, sizeof(CGFloat) ); - CGFloat *maxTitleWidth = calloc( columnCount, sizeof(CGFloat) ); - CGSize theSwatchSize = self.swatchSize; - NSArray *desiredRowHeights = self.rowHeights; - NSArray *desiredColumnWidths = self.columnWidths; - Class numberClass = [NSNumber class]; + NSUInteger row = 0; + NSUInteger col = 0; + CGFloat *maxTitleHeight = calloc(rowCount, sizeof(CGFloat)); + CGFloat *maxTitleWidth = calloc(columnCount, sizeof(CGFloat)); + CGSize theSwatchSize = self.swatchSize; + CPTNumberArray *desiredRowHeights = self.rowHeights; + CPTNumberArray *desiredColumnWidths = self.columnWidths; + Class numberClass = [NSNumber class]; for ( CPTLegendEntry *legendEntry in self.legendEntries ) { legendEntry.row = row; legendEntry.column = col; CGSize titleSize = legendEntry.titleSize; - if ( (desiredRowCount == 0) || (row < desiredRowCount) ) { - maxTitleHeight[row] = MAX(MAX(maxTitleHeight[row], titleSize.height), theSwatchSize.height); + if ((desiredRowCount == 0) || (row < desiredRowCount)) { + maxTitleHeight[row] = MAX(maxTitleHeight[row], titleSize.height); + if ( isHorizontalLayout ) { + maxTitleHeight[row] = MAX(maxTitleHeight[row], theSwatchSize.height); + } if ( row < desiredRowHeights.count ) { id desiredRowHeight = desiredRowHeights[row]; if ( [desiredRowHeight isKindOfClass:numberClass] ) { - maxTitleHeight[row] = MAX(maxTitleHeight[row], [(NSNumber *)desiredRowHeight cgFloatValue]); + maxTitleHeight[row] = MAX(maxTitleHeight[row], [(NSNumber *) desiredRowHeight cgFloatValue]); } } } - if ( (desiredColumnCount == 0) || (col < desiredColumnCount) ) { - maxTitleWidth[col] = MAX(MAX(maxTitleWidth[col], titleSize.width), theSwatchSize.width); + if ((desiredColumnCount == 0) || (col < desiredColumnCount)) { + maxTitleWidth[col] = MAX(maxTitleWidth[col], titleSize.width); + if ( !isHorizontalLayout ) { + maxTitleWidth[col] = MAX(maxTitleWidth[col], theSwatchSize.width); + } if ( col < desiredColumnWidths.count ) { id desiredColumnWidth = desiredColumnWidths[col]; if ( [desiredColumnWidth isKindOfClass:numberClass] ) { - maxTitleWidth[col] = MAX(maxTitleWidth[col], [(NSNumber *)desiredColumnWidth cgFloatValue]); + maxTitleWidth[col] = MAX(maxTitleWidth[col], [(NSNumber *) desiredColumnWidth cgFloatValue]); } } } @@ -771,13 +905,13 @@ -(void)recalculateLayout } // save row heights and column widths - NSMutableArray *maxRowHeights = [[NSMutableArray alloc] initWithCapacity:rowCount]; + CPTMutableNumberArray *maxRowHeights = [[NSMutableArray alloc] initWithCapacity:rowCount]; for ( NSUInteger i = 0; i < rowCount; i++ ) { [maxRowHeights addObject:@(maxTitleHeight[i])]; } self.rowHeightsThatFit = maxRowHeights; - NSMutableArray *maxColumnWidths = [[NSMutableArray alloc] initWithCapacity:columnCount]; + CPTMutableNumberArray *maxColumnWidths = [[NSMutableArray alloc] initWithCapacity:columnCount]; for ( NSUInteger i = 0; i < columnCount; i++ ) { [maxColumnWidths addObject:@(maxTitleWidth[i])]; } @@ -803,7 +937,10 @@ -(void)recalculateLayout } } if ( columnCount > 0 ) { - legendSize.width += ( (theSwatchSize.width + self.titleOffset + self.entryPaddingLeft + self.entryPaddingRight) * columnCount ) + ( self.columnMargin * (columnCount - 1) ); + legendSize.width += ((self.entryPaddingLeft + self.entryPaddingRight) * columnCount) + (self.columnMargin * (columnCount - 1)); + if ( isHorizontalLayout ) { + legendSize.width += (theSwatchSize.width + self.titleOffset) * columnCount; + } } NSUInteger rows = row; @@ -814,10 +951,13 @@ -(void)recalculateLayout legendSize.height += [height cgFloatValue]; } if ( rows > 0 ) { - legendSize.height += ( (self.entryPaddingBottom + self.entryPaddingTop) * rowCount ) + ( self.rowMargin * (rows - 1) ); + legendSize.height += ((self.entryPaddingBottom + self.entryPaddingTop) * rowCount) + (self.rowMargin * (rows - 1)); + if ( !isHorizontalLayout ) { + legendSize.height += (theSwatchSize.height + self.titleOffset) * rowCount; + } } - self.bounds = CPTRectMake( 0.0, 0.0, ceil(legendSize.width), ceil(legendSize.height) ); + self.bounds = CPTRectMake(0.0, 0.0, ceil(legendSize.width), ceil(legendSize.height)); [self pixelAlign]; self.layoutChanged = NO; @@ -831,7 +971,7 @@ -(void)recalculateLayout /** @brief All plots associated with the legend. * @return An array of all plots associated with the legend. **/ --(NSArray *)allPlots +-(nonnull CPTPlotArray *)allPlots { return [NSArray arrayWithArray:self.plots]; } @@ -840,19 +980,24 @@ -(NSArray *)allPlots * @param idx An index within the bounds of the plot array. * @return The plot at the given index. **/ --(CPTPlot *)plotAtIndex:(NSUInteger)idx +-(nullable CPTPlot *)plotAtIndex:(NSUInteger)idx { - return (self.plots)[idx]; + if ( idx < self.plots.count ) { + return (self.plots)[idx]; + } + else { + return nil; + } } /** @brief Gets the plot with the given identifier from the plot array. * @param identifier A plot identifier. * @return The plot with the given identifier or nil if it was not found. **/ --(CPTPlot *)plotWithIdentifier:(id)identifier +-(nullable CPTPlot *)plotWithIdentifier:(nullable id)identifier { for ( CPTPlot *plot in self.plots ) { - if ( [[plot identifier] isEqual:identifier] ) { + if ( [plot.identifier isEqual:identifier] ) { return plot; } } @@ -865,15 +1010,15 @@ -(CPTPlot *)plotWithIdentifier:(id)identifier /** @brief Add a plot to the legend. * @param plot The plot. **/ --(void)addPlot:(CPTPlot *)plot +-(void)addPlot:(nonnull CPTPlot *)plot { if ( [plot isKindOfClass:[CPTPlot class]] ) { [self.plots addObject:plot]; self.layoutChanged = YES; - NSMutableArray *theLegendEntries = self.legendEntries; - CPTTextStyle *theTextStyle = self.textStyle; - NSUInteger numberOfLegendEntries = [plot numberOfLegendEntries]; + CPTMutableLegendEntryArray *theLegendEntries = self.legendEntries; + CPTTextStyle *theTextStyle = self.textStyle; + NSUInteger numberOfLegendEntries = [plot numberOfLegendEntries]; for ( NSUInteger i = 0; i < numberOfLegendEntries; i++ ) { NSString *newTitle = [plot titleForLegendEntryAtIndex:i]; if ( newTitle ) { @@ -894,14 +1039,14 @@ -(void)addPlot:(CPTPlot *)plot * @param plot The plot. * @param idx An index within the bounds of the plot array. **/ --(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx +-(void)insertPlot:(nonnull CPTPlot *)plot atIndex:(NSUInteger)idx { if ( [plot isKindOfClass:[CPTPlot class]] ) { - NSMutableArray *thePlots = self.plots; + CPTMutablePlotArray *thePlots = self.plots; NSAssert(idx <= thePlots.count, @"index greater than the number of plots"); - NSMutableArray *theLegendEntries = self.legendEntries; - NSUInteger legendEntryIndex = 0; + CPTMutableLegendEntryArray *theLegendEntries = self.legendEntries; + NSUInteger legendEntryIndex = 0; if ( idx == thePlots.count ) { legendEntryIndex = theLegendEntries.count; } @@ -939,7 +1084,7 @@ -(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx /** @brief Remove a plot from the legend. * @param plot The plot to remove. **/ --(void)removePlot:(CPTPlot *)plot +-(void)removePlot:(nonnull CPTPlot *)plot { if ( [self.plots containsObject:plot] ) { [self.plots removeObjectIdenticalTo:plot]; @@ -957,7 +1102,7 @@ -(void)removePlot:(CPTPlot *)plot /** @brief Remove a plot from the legend. * @param identifier The identifier of the plot to remove. **/ --(void)removePlotWithIdentifier:(id)identifier +-(void)removePlotWithIdentifier:(nullable id)identifier { CPTPlot *plotToRemove = [self plotWithIdentifier:identifier]; @@ -977,10 +1122,10 @@ -(void)removePlotWithIdentifier:(id)identifier * @brief Remove all legend entries for the given plot from the legend. * @param plot The plot. **/ --(void)removeLegendEntriesForPlot:(CPTPlot *)plot +-(void)removeLegendEntriesForPlot:(nonnull CPTPlot *)plot { - NSMutableArray *theLegendEntries = self.legendEntries; - NSMutableArray *entriesToRemove = [[NSMutableArray alloc] init]; + CPTMutableLegendEntryArray *theLegendEntries = self.legendEntries; + CPTMutableLegendEntryArray *entriesToRemove = [[NSMutableArray alloc] init]; for ( CPTLegendEntry *legendEntry in theLegendEntries ) { if ( legendEntry.plot == plot ) { @@ -997,21 +1142,22 @@ -(void)removeLegendEntriesForPlot:(CPTPlot *)plot /// @cond --(void)legendNeedsRedraw:(NSNotification *)notif +-(void)legendNeedsRedraw:(nonnull NSNotification *__unused)notif { [self setNeedsDisplay]; } --(void)legendNeedsLayout:(NSNotification *)notif +-(void)legendNeedsLayout:(nonnull NSNotification *__unused)notif { self.layoutChanged = YES; [self setNeedsDisplay]; } --(void)legendNeedsReloadEntries:(NSNotification *)notif +-(void)legendNeedsReloadEntries:(nonnull NSNotification *)notif { - CPTPlot *thePlot = (CPTPlot *)notif.object; - NSMutableArray *theLegendEntries = self.legendEntries; + CPTPlot *thePlot = (CPTPlot *)notif.object; + + CPTMutableLegendEntryArray *theLegendEntries = self.legendEntries; NSUInteger legendEntryIndex = 0; @@ -1046,7 +1192,7 @@ -(void)legendNeedsReloadEntries:(NSNotification *)notif /// @cond --(void)legendEntryForInteractionPoint:(CGPoint)interactionPoint row:(NSUInteger *)row col:(NSUInteger *)col +-(void)legendEntryForInteractionPoint:(CGPoint)interactionPoint row:(nonnull NSUInteger *)row col:(nonnull NSUInteger *)col { // Convert the interaction point to the local coordinate system CPTGraph *theGraph = self.graph; @@ -1084,7 +1230,7 @@ -(void)legendEntryForInteractionPoint:(CGPoint)interactionPoint row:(NSUInteger for ( NSNumber *height in self.rowHeightsThatFit ) { CGFloat rowHeight = height.cgFloatValue + padVertical; - if ( (interactionPoint.y <= position) && (interactionPoint.y >= position - rowHeight) ) { + if ((interactionPoint.y <= position) && (interactionPoint.y >= position - rowHeight)) { *row = i; break; } @@ -1100,7 +1246,7 @@ -(void)legendEntryForInteractionPoint:(CGPoint)interactionPoint row:(NSUInteger for ( NSNumber *width in self.columnWidthsThatFit ) { CGFloat colWidth = width.cgFloatValue + swatchWidth + padHorizontal; - if ( (interactionPoint.x >= position) && (interactionPoint.x <= position + colWidth) ) { + if ((interactionPoint.x >= position) && (interactionPoint.x <= position + colWidth)) { *col = i; break; } @@ -1132,13 +1278,13 @@ -(void)legendEntryForInteractionPoint:(CGPoint)interactionPoint row:(NSUInteger * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { - if ( self.hidden || (self.plots.count == 0) ) { + if ( self.hidden || (self.plots.count == 0)) { return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(legend:legendEntryForPlot:touchDownAtIndex:)] || [theDelegate respondsToSelector:@selector(legend:legendEntryForPlot:touchDownAtIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(legend:legendEntryForPlot:wasSelectedAtIndex:)] || @@ -1148,9 +1294,9 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact [self legendEntryForInteractionPoint:interactionPoint row:&row col:&col]; // Notify the delegate if we found a hit - if ( (row != NSNotFound) && (col != NSNotFound) ) { + if ((row != NSNotFound) && (col != NSNotFound)) { for ( CPTLegendEntry *legendEntry in self.legendEntries ) { - if ( (legendEntry.row == row) && (legendEntry.column == col) ) { + if ((legendEntry.row == row) && (legendEntry.column == col)) { self.pointingDeviceDownEntry = legendEntry; CPTPlot *legendPlot = legendEntry.plot; @@ -1199,17 +1345,17 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { CPTLegendEntry *selectedDownEntry = self.pointingDeviceDownEntry; self.pointingDeviceDownEntry = nil; - if ( self.hidden || (self.plots.count == 0) ) { + if ( self.hidden || (self.plots.count == 0)) { return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(legend:legendEntryForPlot:touchUpAtIndex:)] || [theDelegate respondsToSelector:@selector(legend:legendEntryForPlot:touchUpAtIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(legend:legendEntryForPlot:wasSelectedAtIndex:)] || @@ -1219,9 +1365,9 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio [self legendEntryForInteractionPoint:interactionPoint row:&row col:&col]; // Notify the delegate if we found a hit - if ( (row != NSNotFound) && (col != NSNotFound) ) { + if ((row != NSNotFound) && (col != NSNotFound)) { for ( CPTLegendEntry *legendEntry in self.legendEntries ) { - if ( (legendEntry.row == row) && (legendEntry.column == col) ) { + if ((legendEntry.row == row) && (legendEntry.column == col)) { BOOL handled = NO; CPTPlot *entryPlot = legendEntry.plot; @@ -1265,9 +1411,9 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio /// @cond --(NSString *)description +-(nullable NSString *)description { - return [NSString stringWithFormat:@"<%@ for plots %@>", [super description], self.plots]; + return [NSString stringWithFormat:@"<%@ for plots %@>", super.description, self.plots]; } /// @endcond @@ -1277,7 +1423,7 @@ -(NSString *)description /// @cond --(void)setTextStyle:(CPTTextStyle *)newTextStyle +-(void)setTextStyle:(nullable CPTTextStyle *)newTextStyle { if ( newTextStyle != textStyle ) { textStyle = [newTextStyle copy]; @@ -1288,7 +1434,7 @@ -(void)setTextStyle:(CPTTextStyle *)newTextStyle -(void)setSwatchSize:(CGSize)newSwatchSize { - if ( !CGSizeEqualToSize(newSwatchSize, swatchSize) ) { + if ( !CGSizeEqualToSize(newSwatchSize, swatchSize)) { swatchSize = newSwatchSize; self.layoutChanged = YES; } @@ -1298,10 +1444,10 @@ -(CGSize)swatchSize { CGSize theSwatchSize = swatchSize; - if ( CGSizeEqualToSize(theSwatchSize, CGSizeZero) ) { + if ( CGSizeEqualToSize(theSwatchSize, CGSizeZero)) { CPTTextStyle *theTextStyle = self.textStyle; CGFloat fontSize = theTextStyle.fontSize; - if ( fontSize > 0.0 ) { + if ( fontSize > CPTFloat(0.0)) { fontSize *= CPTFloat(1.5); fontSize = round(fontSize); theSwatchSize = CPTSizeMake(fontSize, fontSize); @@ -1313,7 +1459,7 @@ -(CGSize)swatchSize return theSwatchSize; } --(void)setSwatchBorderLineStyle:(CPTLineStyle *)newSwatchBorderLineStyle +-(void)setSwatchBorderLineStyle:(nullable CPTLineStyle *)newSwatchBorderLineStyle { if ( newSwatchBorderLineStyle != swatchBorderLineStyle ) { swatchBorderLineStyle = [newSwatchBorderLineStyle copy]; @@ -1329,7 +1475,7 @@ -(void)setSwatchCornerRadius:(CGFloat)newSwatchCornerRadius } } --(void)setSwatchFill:(CPTFill *)newSwatchFill +-(void)setSwatchFill:(nullable CPTFill *)newSwatchFill { if ( newSwatchFill != swatchFill ) { swatchFill = [newSwatchFill copy]; @@ -1337,7 +1483,7 @@ -(void)setSwatchFill:(CPTFill *)newSwatchFill } } --(void)setEntryBorderLineStyle:(CPTLineStyle *)newEntryBorderLineStyle +-(void)setEntryBorderLineStyle:(nullable CPTLineStyle *)newEntryBorderLineStyle { if ( newEntryBorderLineStyle != entryBorderLineStyle ) { entryBorderLineStyle = [newEntryBorderLineStyle copy]; @@ -1353,7 +1499,7 @@ -(void)setEntryCornerRadius:(CGFloat)newEntryCornerRadius } } --(void)setEntryFill:(CPTFill *)newEntryFill +-(void)setEntryFill:(nullable CPTFill *)newEntryFill { if ( newEntryFill != entryFill ) { entryFill = [newEntryFill copy]; @@ -1425,7 +1571,7 @@ -(void)setEqualColumns:(BOOL)newEqualColumns } } --(void)setRowHeights:(NSArray *)newRowHeights +-(void)setRowHeights:(nullable CPTNumberArray *)newRowHeights { if ( newRowHeights != rowHeights ) { rowHeights = [newRowHeights copy]; @@ -1433,7 +1579,7 @@ -(void)setRowHeights:(NSArray *)newRowHeights } } --(void)setColumnWidths:(NSArray *)newColumnWidths +-(void)setColumnWidths:(nullable CPTNumberArray *)newColumnWidths { if ( newColumnWidths != columnWidths ) { columnWidths = [newColumnWidths copy]; @@ -1465,6 +1611,14 @@ -(void)setTitleOffset:(CGFloat)newTitleOffset } } +-(void)setSwatchLayout:(CPTLegendSwatchLayout)newSwatchLayout +{ + if ( newSwatchLayout != swatchLayout ) { + swatchLayout = newSwatchLayout; + self.layoutChanged = YES; + } +} + -(void)setLayoutChanged:(BOOL)newLayoutChanged { if ( newLayoutChanged != layoutChanged ) { @@ -1480,7 +1634,7 @@ -(void)setLayoutChanged:(BOOL)newLayoutChanged -(void)setPaddingLeft:(CGFloat)newPadding { if ( newPadding != self.paddingLeft ) { - [super setPaddingLeft:newPadding]; + super.paddingLeft = newPadding; self.layoutChanged = YES; } } @@ -1488,7 +1642,7 @@ -(void)setPaddingLeft:(CGFloat)newPadding -(void)setPaddingTop:(CGFloat)newPadding { if ( newPadding != self.paddingTop ) { - [super setPaddingTop:newPadding]; + super.paddingTop = newPadding; self.layoutChanged = YES; } } @@ -1496,7 +1650,7 @@ -(void)setPaddingTop:(CGFloat)newPadding -(void)setPaddingRight:(CGFloat)newPadding { if ( newPadding != self.paddingRight ) { - [super setPaddingRight:newPadding]; + super.paddingRight = newPadding; self.layoutChanged = YES; } } @@ -1504,17 +1658,17 @@ -(void)setPaddingRight:(CGFloat)newPadding -(void)setPaddingBottom:(CGFloat)newPadding { if ( newPadding != self.paddingBottom ) { - [super setPaddingBottom:newPadding]; - self.layoutChanged = YES; + super.paddingBottom = newPadding; + self.layoutChanged = YES; } } --(void)setBorderLineStyle:(CPTLineStyle *)newLineStyle +-(void)setBorderLineStyle:(nullable CPTLineStyle *)newLineStyle { CPTLineStyle *oldLineStyle = self.borderLineStyle; if ( newLineStyle != oldLineStyle ) { - [super setBorderLineStyle:newLineStyle]; + super.borderLineStyle = newLineStyle; if ( newLineStyle.lineWidth != oldLineStyle.lineWidth ) { self.layoutChanged = YES; @@ -1522,7 +1676,7 @@ -(void)setBorderLineStyle:(CPTLineStyle *)newLineStyle } } --(NSArray *)rowHeightsThatFit +-(nullable CPTNumberArray *)rowHeightsThatFit { if ( !rowHeightsThatFit ) { [self recalculateLayout]; @@ -1530,7 +1684,7 @@ -(NSArray *)rowHeightsThatFit return rowHeightsThatFit; } --(NSArray *)columnWidthsThatFit +-(nullable CPTNumberArray *)columnWidthsThatFit { if ( !columnWidthsThatFit ) { [self recalculateLayout]; diff --git a/framework/Source/CPTLegendEntry.h b/framework/Source/CPTLegendEntry.h index e9204cde1..ce7af2388 100644 --- a/framework/Source/CPTLegendEntry.h +++ b/framework/Source/CPTLegendEntry.h @@ -1,19 +1,32 @@ #import "CPTDefinitions.h" +/// @file + +@class CPTLegendEntry; @class CPTPlot; @class CPTTextStyle; -@interface CPTLegendEntry : NSObject +/** + * @brief An array of CPTLegendEntry objects. + **/ +typedef NSArray CPTLegendEntryArray; + +/** + * @brief A mutable array of CPTLegendEntry objects. + **/ +typedef NSMutableArray CPTMutableLegendEntryArray; + +@interface CPTLegendEntry : NSObject /// @name Plot Info /// @{ -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTPlot *plot; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTPlot *plot; @property (nonatomic, readwrite, assign) NSUInteger index; /// @} /// @name Formatting /// @{ -@property (nonatomic, readwrite, strong) CPTTextStyle *textStyle; +@property (nonatomic, readwrite, strong, nullable) CPTTextStyle *textStyle; /// @} /// @name Layout @@ -25,7 +38,7 @@ /// @name Drawing /// @{ --(void)drawTitleInRect:(CGRect)rect inContext:(CGContextRef)context scale:(CGFloat)scale; +-(void)drawTitleInRect:(CGRect)rect inContext:(nonnull CGContextRef)context scale:(CGFloat)scale; /// @} @end diff --git a/framework/Source/CPTLegendEntry.m b/framework/Source/CPTLegendEntry.m index 380a885a8..02f5bc365 100644 --- a/framework/Source/CPTLegendEntry.m +++ b/framework/Source/CPTLegendEntry.m @@ -9,8 +9,8 @@ /// @cond @interface CPTLegendEntry() -@property (nonatomic, readonly) NSString *title; -@property (nonatomic, readonly) NSAttributedString *attributedTitle; +@property (nonatomic, readonly, nullable) NSString *title; +@property (nonatomic, readonly, nullable) NSAttributedString *attributedTitle; @end @@ -23,7 +23,7 @@ @interface CPTLegendEntry() **/ @implementation CPTLegendEntry -/** @property cpt_weak CPTPlot *plot +/** @property nullable CPTPlot *plot * @brief The plot associated with this legend entry. **/ @synthesize plot; @@ -45,14 +45,19 @@ @implementation CPTLegendEntry /// @cond -/** @property NSString *title +/** @property nullable NSString *title * @brief The legend entry title. **/ @dynamic title; +/** @property nullable NSAttributedString *attributedTitle + * @brief The legend entry attributed title. + **/ +@dynamic attributedTitle; + /// @endcond -/** @property CPTTextStyle *textStyle +/** @property nullable CPTTextStyle *textStyle * @brief The text style used to draw the legend entry title. **/ @synthesize textStyle; @@ -79,9 +84,9 @@ @implementation CPTLegendEntry * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { plot = nil; index = 0; row = 0; @@ -98,7 +103,7 @@ -(instancetype)init /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeConditionalObject:self.plot forKey:@"CPTLegendEntry.plot"]; [coder encodeInteger:(NSInteger)self.index forKey:@"CPTLegendEntry.index"]; @@ -107,20 +112,34 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeObject:self.textStyle forKey:@"CPTLegendEntry.textStyle"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - plot = [coder decodeObjectForKey:@"CPTLegendEntry.plot"]; - index = (NSUInteger)[coder decodeIntegerForKey : @"CPTLegendEntry.index"]; - row = (NSUInteger)[coder decodeIntegerForKey : @"CPTLegendEntry.row"]; - column = (NSUInteger)[coder decodeIntegerForKey : @"CPTLegendEntry.column"]; - textStyle = [coder decodeObjectForKey:@"CPTLegendEntry.textStyle"]; + if ((self = [super init])) { + plot = [coder decodeObjectOfClass:[CPTPlot class] + forKey:@"CPTLegendEntry.plot"]; + index = (NSUInteger)[coder decodeIntegerForKey:@"CPTLegendEntry.index"]; + row = (NSUInteger)[coder decodeIntegerForKey:@"CPTLegendEntry.row"]; + column = (NSUInteger)[coder decodeIntegerForKey:@"CPTLegendEntry.column"]; + textStyle = [coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTLegendEntry.textStyle"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing @@ -129,20 +148,20 @@ -(instancetype)initWithCoder:(NSCoder *)coder * @param context The graphics context to draw into. * @param scale The drawing scale factor. Must be greater than zero (@num{0}). **/ --(void)drawTitleInRect:(CGRect)rect inContext:(CGContextRef)context scale:(CGFloat)scale +-(void)drawTitleInRect:(CGRect)rect inContext:(nonnull CGContextRef)context scale:(CGFloat)scale { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGContextSaveGState(context); CGContextTranslateCTM(context, CPTFloat(0.0), rect.origin.y); - CGContextScaleCTM( context, CPTFloat(1.0), CPTFloat(-1.0) ); - CGContextTranslateCTM( context, CPTFloat(0.0), -CGRectGetMaxY(rect) ); + CGContextScaleCTM(context, CPTFloat(1.0), CPTFloat(-1.0)); + CGContextTranslateCTM(context, CPTFloat(0.0), -CGRectGetMaxY(rect)); #endif // center the title vertically CGRect textRect = rect; CGSize theTitleSize = self.titleSize; if ( theTitleSize.height < textRect.size.height ) { CGFloat offset = (textRect.size.height - theTitleSize.height) / CPTFloat(2.0); - if ( scale == 1.0 ) { + if ( scale == CPTFloat(1.0)) { offset = round(offset); } else { @@ -154,7 +173,7 @@ -(void)drawTitleInRect:(CGRect)rect inContext:(CGContextRef)context scale:(CGFlo NSAttributedString *styledTitle = self.attributedTitle; - if ( (styledTitle.length > 0) && [styledTitle respondsToSelector:@selector(drawInRect:)] ) { + if ((styledTitle.length > 0) && [styledTitle respondsToSelector:@selector(drawInRect:)] ) { [styledTitle drawInRect:textRect inContext:context]; } @@ -170,7 +189,7 @@ -(void)drawTitleInRect:(CGRect)rect inContext:(CGContextRef)context scale:(CGFlo inContext:context]; } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGContextRestoreGState(context); #endif } @@ -180,14 +199,14 @@ -(void)drawTitleInRect:(CGRect)rect inContext:(CGContextRef)context scale:(CGFlo /// @cond --(NSString *)title +-(nullable NSString *)title { CPTPlot *thePlot = self.plot; return [thePlot titleForLegendEntryAtIndex:self.index]; } --(NSAttributedString *)attributedTitle +-(nullable NSAttributedString *)attributedTitle { CPTPlot *thePlot = self.plot; @@ -200,12 +219,8 @@ -(CGSize)titleSize NSAttributedString *styledTitle = self.attributedTitle; - if ( (styledTitle.length > 0) && [styledTitle respondsToSelector:@selector(size)] ) { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - theTitleSize = styledTitle.size; -#else - theTitleSize = NSSizeToCGSize(styledTitle.size); -#endif + if ( styledTitle.length > 0 ) { + theTitleSize = [styledTitle sizeAsDrawn]; } else { NSString *theTitle = styledTitle.string; diff --git a/framework/Source/CPTLimitBand.h b/framework/Source/CPTLimitBand.h index 88413d184..e4c7700a3 100644 --- a/framework/Source/CPTLimitBand.h +++ b/framework/Source/CPTLimitBand.h @@ -1,20 +1,33 @@ -@class CPTPlotRange; +/// @file + @class CPTFill; +@class CPTLimitBand; +@class CPTPlotRange; + +/** + * @brief An array of limit bands. + **/ +typedef NSArray CPTLimitBandArray; + +/** + * @brief A mutable array of limit bands. + **/ +typedef NSMutableArray CPTMutableLimitBandArray; -@interface CPTLimitBand : NSObject +@interface CPTLimitBand : NSObject -@property (nonatomic, readwrite, strong) CPTPlotRange *range; -@property (nonatomic, readwrite, strong) CPTFill *fill; +@property (nonatomic, readwrite, strong, nullable) CPTPlotRange *range; +@property (nonatomic, readwrite, strong, nullable) CPTFill *fill; /// @name Factory Methods /// @{ -+(instancetype)limitBandWithRange:(CPTPlotRange *)newRange fill:(CPTFill *)newFill; ++(nonnull instancetype)limitBandWithRange:(nullable CPTPlotRange *)newRange fill:(nullable CPTFill *)newFill; /// @} /// @name Initialization /// @{ --(instancetype)initWithRange:(CPTPlotRange *)newRange fill:(CPTFill *)newFill NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithRange:(nullable CPTPlotRange *)newRange fill:(nullable CPTFill *)newFill NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER; /// @} @end diff --git a/framework/Source/CPTLimitBand.m b/framework/Source/CPTLimitBand.m index 5e4a17017..2f75847c5 100644 --- a/framework/Source/CPTLimitBand.m +++ b/framework/Source/CPTLimitBand.m @@ -8,12 +8,12 @@ **/ @implementation CPTLimitBand -/** @property CPTPlotRange *range +/** @property nullable CPTPlotRange *range * @brief The data range for the band. **/ @synthesize range; -/** @property CPTFill *fill +/** @property nullable CPTFill *fill * @brief The fill used to draw the band. **/ @synthesize fill; @@ -26,9 +26,9 @@ @implementation CPTLimitBand * @param newFill The fill used to draw the interior of the band. * @return A new CPTLimitBand instance initialized with the provided range and fill. **/ -+(instancetype)limitBandWithRange:(CPTPlotRange *)newRange fill:(CPTFill *)newFill ++(nonnull instancetype)limitBandWithRange:(nullable CPTPlotRange *)newRange fill:(nullable CPTFill *)newFill { - return [[CPTLimitBand alloc] initWithRange:newRange fill:newFill]; + return [[self alloc] initWithRange:newRange fill:newFill]; } /** @brief Initializes a newly allocated CPTLimitBand object with the provided range and fill. @@ -36,9 +36,9 @@ +(instancetype)limitBandWithRange:(CPTPlotRange *)newRange fill:(CPTFill *)newFi * @param newFill The fill used to draw the interior of the band. * @return The initialized CPTLimitBand object. **/ --(instancetype)initWithRange:(CPTPlotRange *)newRange fill:(CPTFill *)newFill +-(nonnull instancetype)initWithRange:(nullable CPTPlotRange *)newRange fill:(nullable CPTFill *)newFill { - if ( (self = [super init]) ) { + if ((self = [super init])) { range = newRange; fill = newFill; } @@ -47,7 +47,7 @@ -(instancetype)initWithRange:(CPTPlotRange *)newRange fill:(CPTFill *)newFill /// @cond --(instancetype)init +-(nonnull instancetype)init { return [self initWithRange:nil fill:nil]; } @@ -59,7 +59,7 @@ -(instancetype)init /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { CPTLimitBand *newBand = [[CPTLimitBand allocWithZone:zone] init]; @@ -77,16 +77,10 @@ -(id)copyWithZone:(NSZone *)zone /// @cond --(void)encodeWithCoder:(NSCoder *)encoder +-(void)encodeWithCoder:(nonnull NSCoder *)encoder { - if ( [encoder allowsKeyedCoding] ) { - [encoder encodeObject:self.range forKey:@"CPTLimitBand.range"]; - [encoder encodeObject:self.fill forKey:@"CPTLimitBand.fill"]; - } - else { - [encoder encodeObject:self.range]; - [encoder encodeObject:self.fill]; - } + [encoder encodeObject:self.range forKey:@"CPTLimitBand.range"]; + [encoder encodeObject:self.fill forKey:@"CPTLimitBand.fill"]; } /// @endcond @@ -95,29 +89,37 @@ -(void)encodeWithCoder:(NSCoder *)encoder * @param decoder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)decoder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder { - if ( (self = [super init]) ) { - if ( [decoder allowsKeyedCoding] ) { - range = [decoder decodeObjectForKey:@"CPTLimitBand.range"]; - fill = [decoder decodeObjectForKey:@"CPTLimitBand.fill"]; - } - else { - range = [decoder decodeObject]; - fill = [decoder decodeObject]; - } + if ((self = [super init])) { + range = [decoder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTLimitBand.range"]; + fill = [decoder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTLimitBand.fill"]; } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Description /// @cond --(NSString *)description +-(nullable NSString *)description { - return [NSString stringWithFormat:@"<%@ with range: %@ and fill: %@>", [super description], self.range, self.fill]; + return [NSString stringWithFormat:@"<%@ with range: %@ and fill: %@>", super.description, self.range, self.fill]; } /// @endcond diff --git a/framework/Source/CPTLineCap.h b/framework/Source/CPTLineCap.h index 98411d5be..e6c0605ac 100644 --- a/framework/Source/CPTLineCap.h +++ b/framework/Source/CPTLineCap.h @@ -22,35 +22,35 @@ typedef NS_ENUM (NSInteger, CPTLineCapType) { CPTLineCapTypeCustom ///< Custom line cap. }; -@interface CPTLineCap : NSObject +@interface CPTLineCap : NSObject @property (nonatomic, readwrite, assign) CGSize size; @property (nonatomic, readwrite, assign) CPTLineCapType lineCapType; -@property (nonatomic, readwrite, strong) CPTLineStyle *lineStyle; -@property (nonatomic, readwrite, strong) CPTFill *fill; -@property (nonatomic, readwrite, assign) CGPathRef customLineCapPath; +@property (nonatomic, readwrite, strong, nullable) CPTLineStyle *lineStyle; +@property (nonatomic, readwrite, strong, nullable) CPTFill *fill; +@property (nonatomic, readwrite, assign, nullable) CGPathRef customLineCapPath; @property (nonatomic, readwrite, assign) BOOL usesEvenOddClipRule; /// @name Factory Methods /// @{ -+(instancetype)lineCap; -+(instancetype)openArrowPlotLineCap; -+(instancetype)solidArrowPlotLineCap; -+(instancetype)sweptArrowPlotLineCap; -+(instancetype)rectanglePlotLineCap; -+(instancetype)ellipsePlotLineCap; -+(instancetype)diamondPlotLineCap; -+(instancetype)pentagonPlotLineCap; -+(instancetype)hexagonPlotLineCap; -+(instancetype)barPlotLineCap; -+(instancetype)crossPlotLineCap; -+(instancetype)snowPlotLineCap; -+(instancetype)customLineCapWithPath:(CGPathRef)aPath; ++(nonnull instancetype)lineCap; ++(nonnull instancetype)openArrowPlotLineCap; ++(nonnull instancetype)solidArrowPlotLineCap; ++(nonnull instancetype)sweptArrowPlotLineCap; ++(nonnull instancetype)rectanglePlotLineCap; ++(nonnull instancetype)ellipsePlotLineCap; ++(nonnull instancetype)diamondPlotLineCap; ++(nonnull instancetype)pentagonPlotLineCap; ++(nonnull instancetype)hexagonPlotLineCap; ++(nonnull instancetype)barPlotLineCap; ++(nonnull instancetype)crossPlotLineCap; ++(nonnull instancetype)snowPlotLineCap; ++(nonnull instancetype)customLineCapWithPath:(nullable CGPathRef)aPath; /// @} /// @name Drawing /// @{ --(void)renderAsVectorInContext:(CGContextRef)context atPoint:(CGPoint)center inDirection:(CGPoint)direction; +-(void)renderAsVectorInContext:(nonnull CGContextRef)context atPoint:(CGPoint)center inDirection:(CGPoint)direction; /// @} @end diff --git a/framework/Source/CPTLineCap.m b/framework/Source/CPTLineCap.m index d69309600..5350d1149 100644 --- a/framework/Source/CPTLineCap.m +++ b/framework/Source/CPTLineCap.m @@ -3,15 +3,16 @@ #import "CPTDefinitions.h" #import "CPTFill.h" #import "CPTLineStyle.h" +#import "CPTPlatformSpecificFunctions.h" #import "NSCoderExtensions.h" #import /// @cond @interface CPTLineCap() -@property (nonatomic, readwrite, assign) CGPathRef cachedLineCapPath; +@property (nonatomic, readwrite, assign, nullable) CGPathRef cachedLineCapPath; --(CGPathRef)newLineCapPath; +-(nonnull CGPathRef)newLineCapPath; @end @@ -34,19 +35,19 @@ @implementation CPTLineCap **/ @synthesize lineCapType; -/** @property CPTLineStyle *lineStyle +/** @property nullable CPTLineStyle *lineStyle * @brief The line style for the border of the line cap. * If @nil, the border is not drawn. **/ @synthesize lineStyle; -/** @property CPTFill *fill +/** @property nullable CPTFill *fill * @brief The fill for the interior of the line cap. * If @nil, the symbol is not filled. **/ @synthesize fill; -/** @property CGPathRef customLineCapPath +/** @property nullable CGPathRef customLineCapPath * @brief The drawing path for a custom line cap. It will be scaled to size before being drawn. **/ @synthesize customLineCapPath; @@ -77,9 +78,9 @@ @implementation CPTLineCap * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { size = CPTSizeMake(5.0, 5.0); lineCapType = CPTLineCapTypeNone; lineStyle = [[CPTLineStyle alloc] init]; @@ -108,7 +109,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeCPTSize:self.size forKey:@"CPTLineCap.size"]; [coder encodeInteger:self.lineCapType forKey:@"CPTLineCap.lineCapType"]; @@ -121,13 +122,15 @@ -(void)encodeWithCoder:(NSCoder *)coder // cachedLineCapPath } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - size = [coder decodeCPTSizeForKey:@"CPTLineCap.size"]; - lineCapType = (CPTLineCapType)[coder decodeIntegerForKey : @"CPTLineCap.lineCapType"]; - lineStyle = [coder decodeObjectForKey:@"CPTLineCap.lineStyle"]; - fill = [coder decodeObjectForKey:@"CPTLineCap.fill"]; + if ((self = [super init])) { + size = [coder decodeCPTSizeForKey:@"CPTLineCap.size"]; + lineCapType = (CPTLineCapType)[coder decodeIntegerForKey:@"CPTLineCap.lineCapType"]; + lineStyle = [coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTLineCap.lineStyle"]; + fill = [coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTLineCap.fill"]; customLineCapPath = [coder newCGPathDecodeForKey:@"CPTLineCap.customLineCapPath"]; usesEvenOddClipRule = [coder decodeBoolForKey:@"CPTLineCap.usesEvenOddClipRule"]; @@ -138,6 +141,18 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Accessors @@ -145,7 +160,7 @@ -(instancetype)initWithCoder:(NSCoder *)coder -(void)setSize:(CGSize)newSize { - if ( !CGSizeEqualToSize(newSize, size) ) { + if ( !CGSizeEqualToSize(newSize, size)) { size = newSize; self.cachedLineCapPath = NULL; } @@ -159,7 +174,7 @@ -(void)setLineCapType:(CPTLineCapType)newType } } --(void)setCustomLineCapPath:(CGPathRef)newPath +-(void)setCustomLineCapPath:(nullable CGPathRef)newPath { if ( customLineCapPath != newPath ) { CGPathRelease(customLineCapPath); @@ -168,7 +183,7 @@ -(void)setCustomLineCapPath:(CGPathRef)newPath } } --(CGPathRef)cachedLineCapPath +-(nullable CGPathRef)cachedLineCapPath { if ( !cachedLineCapPath ) { cachedLineCapPath = [self newLineCapPath]; @@ -176,7 +191,7 @@ -(CGPathRef)cachedLineCapPath return cachedLineCapPath; } --(void)setCachedLineCapPath:(CGPathRef)newPath +-(void)setCachedLineCapPath:(nullable CGPathRef)newPath { if ( cachedLineCapPath != newPath ) { CGPathRelease(cachedLineCapPath); @@ -192,7 +207,7 @@ -(void)setCachedLineCapPath:(CGPathRef)newPath /** @brief Creates and returns a new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeNone. * @return A new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeNone. **/ -+(instancetype)lineCap ++(nonnull instancetype)lineCap { CPTLineCap *lineCap = [[self alloc] init]; @@ -204,7 +219,7 @@ +(instancetype)lineCap /** @brief Creates and returns a new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeOpenArrow. * @return A new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeOpenArrow. **/ -+(instancetype)openArrowPlotLineCap ++(nonnull instancetype)openArrowPlotLineCap { CPTLineCap *lineCap = [[self alloc] init]; @@ -216,7 +231,7 @@ +(instancetype)openArrowPlotLineCap /** @brief Creates and returns a new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeSolidArrow. * @return A new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeSolidArrow. **/ -+(instancetype)solidArrowPlotLineCap ++(nonnull instancetype)solidArrowPlotLineCap { CPTLineCap *lineCap = [[self alloc] init]; @@ -228,7 +243,7 @@ +(instancetype)solidArrowPlotLineCap /** @brief Creates and returns a new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeSweptArrow. * @return A new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeSweptArrow. **/ -+(instancetype)sweptArrowPlotLineCap ++(nonnull instancetype)sweptArrowPlotLineCap { CPTLineCap *lineCap = [[self alloc] init]; @@ -240,7 +255,7 @@ +(instancetype)sweptArrowPlotLineCap /** @brief Creates and returns a new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeRectangle. * @return A new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeRectangle. **/ -+(instancetype)rectanglePlotLineCap ++(nonnull instancetype)rectanglePlotLineCap { CPTLineCap *lineCap = [[self alloc] init]; @@ -252,7 +267,7 @@ +(instancetype)rectanglePlotLineCap /** @brief Creates and returns a new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeEllipse. * @return A new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeEllipse. **/ -+(instancetype)ellipsePlotLineCap ++(nonnull instancetype)ellipsePlotLineCap { CPTLineCap *lineCap = [[self alloc] init]; @@ -264,7 +279,7 @@ +(instancetype)ellipsePlotLineCap /** @brief Creates and returns a new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeDiamond. * @return A new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeDiamond. **/ -+(instancetype)diamondPlotLineCap ++(nonnull instancetype)diamondPlotLineCap { CPTLineCap *lineCap = [[self alloc] init]; @@ -276,7 +291,7 @@ +(instancetype)diamondPlotLineCap /** @brief Creates and returns a new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypePentagon. * @return A new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypePentagon. **/ -+(instancetype)pentagonPlotLineCap ++(nonnull instancetype)pentagonPlotLineCap { CPTLineCap *lineCap = [[self alloc] init]; @@ -288,7 +303,7 @@ +(instancetype)pentagonPlotLineCap /** @brief Creates and returns a new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeHexagon. * @return A new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeHexagon. **/ -+(instancetype)hexagonPlotLineCap ++(nonnull instancetype)hexagonPlotLineCap { CPTLineCap *lineCap = [[self alloc] init]; @@ -300,7 +315,7 @@ +(instancetype)hexagonPlotLineCap /** @brief Creates and returns a new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeBar. * @return A new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeBar. **/ -+(instancetype)barPlotLineCap ++(nonnull instancetype)barPlotLineCap { CPTLineCap *lineCap = [[self alloc] init]; @@ -312,7 +327,7 @@ +(instancetype)barPlotLineCap /** @brief Creates and returns a new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeCross. * @return A new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeCross. **/ -+(instancetype)crossPlotLineCap ++(nonnull instancetype)crossPlotLineCap { CPTLineCap *lineCap = [[self alloc] init]; @@ -324,7 +339,7 @@ +(instancetype)crossPlotLineCap /** @brief Creates and returns a new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeSnow. * @return A new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeSnow. **/ -+(instancetype)snowPlotLineCap ++(nonnull instancetype)snowPlotLineCap { CPTLineCap *lineCap = [[self alloc] init]; @@ -337,7 +352,7 @@ +(instancetype)snowPlotLineCap * @param aPath The bounding path for the custom line cap. * @return A new CPTLineCap instance initialized with a line cap type of #CPTLineCapTypeCustom. **/ -+(instancetype)customLineCapWithPath:(CGPathRef)aPath ++(nonnull instancetype)customLineCapWithPath:(nullable CGPathRef)aPath { CPTLineCap *lineCap = [[self alloc] init]; @@ -352,7 +367,7 @@ +(instancetype)customLineCapWithPath:(CGPathRef)aPath /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { CPTLineCap *copy = [[[self class] allocWithZone:zone] init]; @@ -381,7 +396,7 @@ -(id)copyWithZone:(NSZone *)zone * @param center The center point of the line cap. * @param direction The direction the line is pointing. **/ --(void)renderAsVectorInContext:(CGContextRef)context atPoint:(CGPoint)center inDirection:(CGPoint)direction +-(void)renderAsVectorInContext:(nonnull CGContextRef)context atPoint:(CGPoint)center inDirection:(CGPoint)direction { CGPathRef theLineCapPath = self.cachedLineCapPath; @@ -416,16 +431,16 @@ -(void)renderAsVectorInContext:(CGContextRef)context atPoint:(CGPoint)center inD if ( theLineStyle || theFill ) { CGContextSaveGState(context); CGContextTranslateCTM(context, center.x, center.y); - CGContextRotateCTM( context, atan2(direction.y, direction.x) - CPTFloat(M_PI_2) ); // standard symbol points up + CGContextRotateCTM(context, atan2(direction.y, direction.x) - CPTFloat(M_PI_2)); // standard symbol points up if ( theFill ) { // use fillRect instead of fillPath so that images and gradients are properly centered in the symbol CGSize symbolSize = self.size; - CGSize halfSize = CPTSizeMake( symbolSize.width / CPTFloat(2.0), symbolSize.height / CPTFloat(2.0) ); + CGSize halfSize = CPTSizeMake(symbolSize.width / CPTFloat(2.0), symbolSize.height / CPTFloat(2.0)); CGRect bounds = CPTRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height); CGContextSaveGState(context); - if ( !CGPathIsEmpty(theLineCapPath) ) { + if ( !CGPathIsEmpty(theLineCapPath)) { CGContextBeginPath(context); CGContextAddPath(context, theLineCapPath); if ( self.usesEvenOddClipRule ) { @@ -461,11 +476,11 @@ -(void)renderAsVectorInContext:(CGContextRef)context atPoint:(CGPoint)center inD * The path is standardized for a line direction of @quote{up}. * @return A path describing the outline of the current line cap type. **/ --(CGPathRef)newLineCapPath +-(nonnull CGPathRef)newLineCapPath { CGFloat dx, dy; CGSize lineCapSize = self.size; - CGSize halfSize = CPTSizeMake( lineCapSize.width / CPTFloat(2.0), lineCapSize.height / CPTFloat(2.0) ); + CGSize halfSize = CPTSizeMake(lineCapSize.width / CPTFloat(2.0), lineCapSize.height / CPTFloat(2.0)); CGMutablePathRef lineCapPath = CGPathCreateMutable(); @@ -476,47 +491,47 @@ -(CGPathRef)newLineCapPath case CPTLineCapTypeOpenArrow: CGPathMoveToPoint(lineCapPath, NULL, -halfSize.width, -halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, CPTFloat(0.0), CPTFloat(0.0) ); + CGPathAddLineToPoint(lineCapPath, NULL, CPTFloat(0.0), CPTFloat(0.0)); CGPathAddLineToPoint(lineCapPath, NULL, halfSize.width, -halfSize.height); break; case CPTLineCapTypeSolidArrow: CGPathMoveToPoint(lineCapPath, NULL, -halfSize.width, -halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, CPTFloat(0.0), CPTFloat(0.0) ); + CGPathAddLineToPoint(lineCapPath, NULL, CPTFloat(0.0), CPTFloat(0.0)); CGPathAddLineToPoint(lineCapPath, NULL, halfSize.width, -halfSize.height); CGPathCloseSubpath(lineCapPath); break; case CPTLineCapTypeSweptArrow: CGPathMoveToPoint(lineCapPath, NULL, -halfSize.width, -halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, CPTFloat(0.0), CPTFloat(0.0) ); + CGPathAddLineToPoint(lineCapPath, NULL, CPTFloat(0.0), CPTFloat(0.0)); CGPathAddLineToPoint(lineCapPath, NULL, halfSize.width, -halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, CPTFloat(0.0), -lineCapSize.height * CPTFloat(0.375) ); + CGPathAddLineToPoint(lineCapPath, NULL, CPTFloat(0.0), -lineCapSize.height * CPTFloat(0.375)); CGPathCloseSubpath(lineCapPath); break; case CPTLineCapTypeRectangle: - CGPathAddRect( lineCapPath, NULL, CPTRectMake( -halfSize.width, -halfSize.height, halfSize.width * CPTFloat(2.0), halfSize.height * CPTFloat(2.0) ) ); + CGPathAddRect(lineCapPath, NULL, CPTRectMake(-halfSize.width, -halfSize.height, halfSize.width * CPTFloat(2.0), halfSize.height * CPTFloat(2.0))); break; case CPTLineCapTypeEllipse: - CGPathAddEllipseInRect( lineCapPath, NULL, CPTRectMake( -halfSize.width, -halfSize.height, halfSize.width * CPTFloat(2.0), halfSize.height * CPTFloat(2.0) ) ); + CGPathAddEllipseInRect(lineCapPath, NULL, CPTRectMake(-halfSize.width, -halfSize.height, halfSize.width * CPTFloat(2.0), halfSize.height * CPTFloat(2.0))); break; case CPTLineCapTypeDiamond: CGPathMoveToPoint(lineCapPath, NULL, CPTFloat(0.0), halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, halfSize.width, CPTFloat(0.0) ); + CGPathAddLineToPoint(lineCapPath, NULL, halfSize.width, CPTFloat(0.0)); CGPathAddLineToPoint(lineCapPath, NULL, CPTFloat(0.0), -halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, -halfSize.width, CPTFloat(0.0) ); + CGPathAddLineToPoint(lineCapPath, NULL, -halfSize.width, CPTFloat(0.0)); CGPathCloseSubpath(lineCapPath); break; case CPTLineCapTypePentagon: CGPathMoveToPoint(lineCapPath, NULL, CPTFloat(0.0), halfSize.height); - CGPathAddLineToPoint( lineCapPath, NULL, halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437) ); - CGPathAddLineToPoint( lineCapPath, NULL, halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437) ); - CGPathAddLineToPoint( lineCapPath, NULL, -halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437) ); - CGPathAddLineToPoint( lineCapPath, NULL, -halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437) ); + CGPathAddLineToPoint(lineCapPath, NULL, halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437)); + CGPathAddLineToPoint(lineCapPath, NULL, halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437)); + CGPathAddLineToPoint(lineCapPath, NULL, -halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437)); + CGPathAddLineToPoint(lineCapPath, NULL, -halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437)); CGPathCloseSubpath(lineCapPath); break; @@ -534,8 +549,8 @@ -(CGPathRef)newLineCapPath break; case CPTLineCapTypeBar: - CGPathMoveToPoint( lineCapPath, NULL, halfSize.width, CPTFloat(0.0) ); - CGPathAddLineToPoint( lineCapPath, NULL, -halfSize.width, CPTFloat(0.0) ); + CGPathMoveToPoint(lineCapPath, NULL, halfSize.width, CPTFloat(0.0)); + CGPathAddLineToPoint(lineCapPath, NULL, -halfSize.width, CPTFloat(0.0)); break; case CPTLineCapTypeCross: @@ -566,8 +581,8 @@ -(CGPathRef)newLineCapPath CGFloat dy1 = lineCapSize.height / oldBounds.size.height; CGAffineTransform scaleTransform = CGAffineTransformScale(CGAffineTransformIdentity, dx1, dy1); - scaleTransform = CGAffineTransformConcat( scaleTransform, - CGAffineTransformMakeTranslation(-halfSize.width, -halfSize.height) ); + scaleTransform = CGAffineTransformConcat(scaleTransform, + CGAffineTransformMakeTranslation(-halfSize.width, -halfSize.height)); CGPathAddPath(lineCapPath, &scaleTransform, customPath); } } @@ -578,4 +593,23 @@ -(CGPathRef)newLineCapPath /// @endcond +#pragma mark - +#pragma mark Debugging + +/// @cond + +-(nullable id)debugQuickLookObject +{ + const CGSize symbolSize = self.size; + const CGSize halfSize = CPTSizeMake(symbolSize.width * CPTFloat(0.5), symbolSize.height * CPTFloat(0.5)); + const CGRect rect = CGRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height); + const CGPoint centerPoint = CGPointMake(halfSize.width, halfSize.height); + + return CPTQuickLookImage(rect, ^(CGContextRef context, CGFloat __unused scale, CGRect bounds __unused) { + [self renderAsVectorInContext:context atPoint:centerPoint inDirection:CGPointMake(1.0, 0.0)]; + }); +} + +/// @endcond + @end diff --git a/framework/Source/CPTLineStyle.h b/framework/Source/CPTLineStyle.h index 7137b7032..2b5c687b7 100644 --- a/framework/Source/CPTLineStyle.h +++ b/framework/Source/CPTLineStyle.h @@ -1,31 +1,46 @@ +#import "CPTDefinitions.h" + +/// @file + @class CPTColor; @class CPTFill; @class CPTGradient; +@class CPTLineStyle; + +/** + * @brief An array of line styles. + **/ +typedef NSArray CPTLineStyleArray; + +/** + * @brief A mutable array of line styles. + **/ +typedef NSMutableArray CPTMutableLineStyleArray; -@interface CPTLineStyle : NSObject +@interface CPTLineStyle : NSObject @property (nonatomic, readonly) CGLineCap lineCap; @property (nonatomic, readonly) CGLineJoin lineJoin; @property (nonatomic, readonly) CGFloat miterLimit; @property (nonatomic, readonly) CGFloat lineWidth; -@property (nonatomic, readonly) NSArray *dashPattern; +@property (nonatomic, readonly, nullable) CPTNumberArray *dashPattern; @property (nonatomic, readonly) CGFloat patternPhase; -@property (nonatomic, readonly) CPTColor *lineColor; -@property (nonatomic, readonly) CPTFill *lineFill; -@property (nonatomic, readonly) CPTGradient *lineGradient; +@property (nonatomic, readonly, nullable) CPTColor *lineColor; +@property (nonatomic, readonly, nullable) CPTFill *lineFill; +@property (nonatomic, readonly, nullable) CPTGradient *lineGradient; @property (nonatomic, readonly, getter = isOpaque) BOOL opaque; /// @name Factory Methods /// @{ -+(instancetype)lineStyle; -+(instancetype)lineStyleWithStyle:(CPTLineStyle *)lineStyle; ++(nonnull instancetype)lineStyle; ++(nonnull instancetype)lineStyleWithStyle:(nullable CPTLineStyle *)lineStyle; /// @} /// @name Drawing /// @{ --(void)setLineStyleInContext:(CGContextRef)context; --(void)strokePathInContext:(CGContextRef)context; --(void)strokeRect:(CGRect)rect inContext:(CGContextRef)context; +-(void)setLineStyleInContext:(nonnull CGContextRef)context; +-(void)strokePathInContext:(nonnull CGContextRef)context; +-(void)strokeRect:(CGRect)rect inContext:(nonnull CGContextRef)context; /// @} @end diff --git a/framework/Source/CPTLineStyle.m b/framework/Source/CPTLineStyle.m index 05a51553d..2208471f6 100644 --- a/framework/Source/CPTLineStyle.m +++ b/framework/Source/CPTLineStyle.m @@ -1,10 +1,11 @@ #import "CPTLineStyle.h" #import "CPTColor.h" -#import "CPTDefinitions.h" #import "CPTFill.h" #import "CPTGradient.h" #import "CPTMutableLineStyle.h" +#import "CPTPlatformSpecificFunctions.h" +#import "CPTUtilities.h" #import "NSCoderExtensions.h" #import "NSNumberExtensions.h" @@ -15,13 +16,13 @@ @interface CPTLineStyle() @property (nonatomic, readwrite, assign) CGLineJoin lineJoin; @property (nonatomic, readwrite, assign) CGFloat miterLimit; @property (nonatomic, readwrite, assign) CGFloat lineWidth; -@property (nonatomic, readwrite, strong) NSArray *dashPattern; +@property (nonatomic, readwrite, strong, nullable) CPTNumberArray *dashPattern; @property (nonatomic, readwrite, assign) CGFloat patternPhase; -@property (nonatomic, readwrite, strong) CPTColor *lineColor; -@property (nonatomic, readwrite, strong) CPTFill *lineFill; -@property (nonatomic, readwrite, strong) CPTGradient *lineGradient; +@property (nonatomic, readwrite, strong, nullable) CPTColor *lineColor; +@property (nonatomic, readwrite, strong, nullable) CPTFill *lineFill; +@property (nonatomic, readwrite, strong, nullable) CPTGradient *lineGradient; --(void)strokePathWithGradient:(CPTGradient *)gradient inContext:(CGContextRef)context; +-(void)strokePathWithGradient:(nonnull CPTGradient *)gradient inContext:(nonnull CGContextRef)context; @end @@ -64,7 +65,7 @@ @implementation CPTLineStyle **/ @synthesize lineWidth; -/** @property NSArray *dashPattern +/** @property nullable CPTNumberArray *dashPattern * @brief The dash-and-space pattern for the line. Default is @nil. **/ @synthesize dashPattern; @@ -74,19 +75,19 @@ @implementation CPTLineStyle **/ @synthesize patternPhase; -/** @property CPTColor *lineColor +/** @property nullable CPTColor *lineColor * @brief The current stroke color in a context. Default is solid black. **/ @synthesize lineColor; -/** @property CPTFill *lineFill +/** @property nullable CPTFill *lineFill * @brief The current line fill. Default is @nil. * * If @nil, the line is drawn using the @ref lineGradient or @ref lineColor. **/ @synthesize lineFill; -/** @property CPTGradient *lineGradient +/** @property nullable CPTGradient *lineGradient * @brief The current line gradient fill. Default is @nil. * * If @nil, the line is drawn using the @ref lineFill or @ref lineColor. @@ -104,7 +105,7 @@ @implementation CPTLineStyle /** @brief Creates and returns a new CPTLineStyle instance. * @return A new CPTLineStyle instance. **/ -+(instancetype)lineStyle ++(nonnull instancetype)lineStyle { return [[self alloc] init]; } @@ -116,7 +117,7 @@ +(instancetype)lineStyle * @param lineStyle An existing CPTLineStyle. * @return A new line style instance. **/ -+(instancetype)lineStyleWithStyle:(CPTLineStyle *)lineStyle ++(nonnull instancetype)lineStyleWithStyle:(nullable CPTLineStyle *)lineStyle { CPTLineStyle *newLineStyle = [[self alloc] init]; @@ -151,9 +152,9 @@ +(instancetype)lineStyleWithStyle:(CPTLineStyle *)lineStyle * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { lineCap = kCGLineCapButt; lineJoin = kCGLineJoinMiter; miterLimit = CPTFloat(10.0); @@ -174,7 +175,7 @@ -(instancetype)init /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeInt:self.lineCap forKey:@"CPTLineStyle.lineCap"]; [coder encodeInt:self.lineJoin forKey:@"CPTLineStyle.lineJoin"]; @@ -187,42 +188,58 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeObject:self.lineGradient forKey:@"CPTLineStyle.lineGradient"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - lineCap = (CGLineCap)[coder decodeIntForKey : @"CPTLineStyle.lineCap"]; - lineJoin = (CGLineJoin)[coder decodeIntForKey : @"CPTLineStyle.lineJoin"]; - miterLimit = [coder decodeCGFloatForKey:@"CPTLineStyle.miterLimit"]; - lineWidth = [coder decodeCGFloatForKey:@"CPTLineStyle.lineWidth"]; - dashPattern = [coder decodeObjectForKey:@"CPTLineStyle.dashPattern"]; + if ((self = [super init])) { + lineCap = (CGLineCap)[coder decodeIntForKey:@"CPTLineStyle.lineCap"]; + lineJoin = (CGLineJoin)[coder decodeIntForKey:@"CPTLineStyle.lineJoin"]; + miterLimit = [coder decodeCGFloatForKey:@"CPTLineStyle.miterLimit"]; + lineWidth = [coder decodeCGFloatForKey:@"CPTLineStyle.lineWidth"]; + dashPattern = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTLineStyle.dashPattern"]; patternPhase = [coder decodeCGFloatForKey:@"CPTLineStyle.patternPhase"]; - lineColor = [coder decodeObjectForKey:@"CPTLineStyle.lineColor"]; - lineFill = [coder decodeObjectForKey:@"CPTLineStyle.lineFill"]; - lineGradient = [coder decodeObjectForKey:@"CPTLineStyle.lineGradient"]; + lineColor = [coder decodeObjectOfClass:[CPTColor class] + forKey:@"CPTLineStyle.lineColor"]; + lineFill = [coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTLineStyle.lineFill"]; + lineGradient = [coder decodeObjectOfClass:[CPTGradient class] + forKey:@"CPTLineStyle.lineGradient"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing /** @brief Sets all of the line drawing properties in the given graphics context. * @param context The graphics context. **/ --(void)setLineStyleInContext:(CGContextRef)context +-(void)setLineStyleInContext:(nonnull CGContextRef)context { CGContextSetLineCap(context, self.lineCap); CGContextSetLineJoin(context, self.lineJoin); CGContextSetMiterLimit(context, self.miterLimit); CGContextSetLineWidth(context, self.lineWidth); - NSArray *myDashPattern = self.dashPattern; + CPTNumberArray *myDashPattern = self.dashPattern; NSUInteger dashCount = myDashPattern.count; if ( dashCount > 0 ) { - CGFloat *dashLengths = (CGFloat *)calloc( dashCount, sizeof(CGFloat) ); + CGFloat *dashLengths = (CGFloat *)calloc(dashCount, sizeof(CGFloat)); NSUInteger dashCounter = 0; for ( NSNumber *currentDashLength in myDashPattern ) { @@ -243,7 +260,7 @@ -(void)setLineStyleInContext:(CGContextRef)context * * @param context The graphics context. **/ --(void)strokePathInContext:(CGContextRef)context +-(void)strokePathInContext:(nonnull CGContextRef)context { CPTGradient *gradient = self.lineGradient; CPTFill *fill = self.lineFill; @@ -266,7 +283,7 @@ -(void)strokePathInContext:(CGContextRef)context * @param rect The rectangle to draw. * @param context The graphics context. **/ --(void)strokeRect:(CGRect)rect inContext:(CGContextRef)context +-(void)strokeRect:(CGRect)rect inContext:(nonnull CGContextRef)context { CPTGradient *gradient = self.lineGradient; CPTFill *fill = self.lineFill; @@ -289,10 +306,10 @@ -(void)strokeRect:(CGRect)rect inContext:(CGContextRef)context /// @cond --(void)strokePathWithGradient:(CPTGradient *)gradient inContext:(CGContextRef)context +-(void)strokePathWithGradient:(nonnull CPTGradient *)gradient inContext:(nonnull CGContextRef)context { if ( gradient ) { - CGRect deviceRect = CGContextConvertRectToDeviceSpace( context, CPTRectMake(0.0, 0.0, 1.0, 1.0) ); + CGRect deviceRect = CGContextConvertRectToDeviceSpace(context, CPTRectMake(0.0, 0.0, 1.0, 1.0)); CGFloat step = CPTFloat(2.0) / deviceRect.size.height; @@ -301,7 +318,8 @@ -(void)strokePathWithGradient:(CPTGradient *)gradient inContext:(CGContextRef)co CGPathRef path = CGContextCopyPath(context); CGContextBeginPath(context); - for ( CGFloat width = startWidth; width > CPTFloat(0.0); width -= step ) { + CGFloat width = startWidth; + while ( width > CPTFloat(0.0)) { CGContextSetLineWidth(context, width); CGColorRef gradientColor = [gradient newColorAtPosition:CPTFloat(1.0) - width / startWidth]; @@ -310,6 +328,8 @@ -(void)strokePathWithGradient:(CPTGradient *)gradient inContext:(CGContextRef)co CGContextAddPath(context, path); CGContextStrokePath(context); + + width -= step; } CGPathRelease(path); @@ -321,6 +341,8 @@ -(void)strokePathWithGradient:(CPTGradient *)gradient inContext:(CGContextRef)co #pragma mark - #pragma mark Opacity +/// @cond + -(BOOL)isOpaque { BOOL opaqueLine = NO; @@ -340,12 +362,14 @@ -(BOOL)isOpaque return opaqueLine; } +/// @endcond + #pragma mark - #pragma mark NSCopying Methods /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { CPTLineStyle *styleCopy = [[CPTLineStyle allocWithZone:zone] init]; @@ -369,7 +393,7 @@ -(id)copyWithZone:(NSZone *)zone /// @cond --(id)mutableCopyWithZone:(NSZone *)zone +-(nonnull id)mutableCopyWithZone:(nullable NSZone *)zone { CPTLineStyle *styleCopy = [[CPTMutableLineStyle allocWithZone:zone] init]; @@ -388,4 +412,23 @@ -(id)mutableCopyWithZone:(NSZone *)zone /// @endcond +#pragma mark - +#pragma mark Debugging + +/// @cond + +-(nullable id)debugQuickLookObject +{ + const CGRect rect = CGRectMake(0.0, 0.0, 100.0, 100.0); + + return CPTQuickLookImage(rect, ^(CGContextRef context, CGFloat __unused scale, CGRect bounds) { + const CGRect alignedRect = CPTAlignBorderedRectToUserSpace(context, bounds, self); + + [self setLineStyleInContext:context]; + [self strokeRect:alignedRect inContext:context]; + }); +} + +/// @endcond + @end diff --git a/framework/Source/CPTLineStyleTests.m b/framework/Source/CPTLineStyleTests.m index 8367e9b30..89772788a 100644 --- a/framework/Source/CPTLineStyleTests.m +++ b/framework/Source/CPTLineStyleTests.m @@ -1,6 +1,7 @@ -#import "CPTLineStyle.h" #import "CPTLineStyleTests.h" +#import "CPTLineStyle.h" + @implementation CPTLineStyleTests #pragma mark - @@ -10,7 +11,7 @@ -(void)testKeyedArchivingRoundTrip { CPTLineStyle *lineStyle = [CPTLineStyle lineStyle]; - CPTLineStyle *newLineStyle = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:lineStyle]]; + CPTLineStyle *newLineStyle = [self archiveRoundTrip:lineStyle]; XCTAssertEqual(newLineStyle.lineCap, lineStyle.lineCap, @"Line cap not equal"); XCTAssertEqual(newLineStyle.lineJoin, lineStyle.lineJoin, @"Line join not equal"); diff --git a/framework/Source/CPTMutableLineStyle.h b/framework/Source/CPTMutableLineStyle.h index 3fcd021be..0d69bb453 100644 --- a/framework/Source/CPTMutableLineStyle.h +++ b/framework/Source/CPTMutableLineStyle.h @@ -8,10 +8,10 @@ @property (nonatomic, readwrite, assign) CGLineJoin lineJoin; @property (nonatomic, readwrite, assign) CGFloat miterLimit; @property (nonatomic, readwrite, assign) CGFloat lineWidth; -@property (nonatomic, readwrite, strong) NSArray *dashPattern; +@property (nonatomic, readwrite, strong, nullable) CPTNumberArray *dashPattern; @property (nonatomic, readwrite, assign) CGFloat patternPhase; -@property (nonatomic, readwrite, strong) CPTColor *lineColor; -@property (nonatomic, readwrite, strong) CPTFill *lineFill; -@property (nonatomic, readwrite, strong) CPTGradient *lineGradient; +@property (nonatomic, readwrite, strong, nullable) CPTColor *lineColor; +@property (nonatomic, readwrite, strong, nullable) CPTFill *lineFill; +@property (nonatomic, readwrite, strong, nullable) CPTGradient *lineGradient; @end diff --git a/framework/Source/CPTMutableLineStyle.m b/framework/Source/CPTMutableLineStyle.m index 745410c58..1a69123e2 100644 --- a/framework/Source/CPTMutableLineStyle.m +++ b/framework/Source/CPTMutableLineStyle.m @@ -29,7 +29,7 @@ @implementation CPTMutableLineStyle **/ @dynamic lineWidth; -/** @property NSArray *dashPattern +/** @property nullable CPTNumberArray *dashPattern * @brief The dash-and-space pattern for the line. Default is @nil. **/ @dynamic dashPattern; @@ -39,19 +39,19 @@ @implementation CPTMutableLineStyle **/ @dynamic patternPhase; -/** @property CPTColor *lineColor +/** @property nullable CPTColor *lineColor * @brief The current stroke color in a context. Default is solid black. **/ @dynamic lineColor; -/** @property CPTFill *lineFill +/** @property nullable CPTFill *lineFill * @brief The current line fill. Default is @nil. * * If @nil, the line is drawn using the @ref lineGradient or @ref lineColor. **/ @dynamic lineFill; -/** @property CPTGradient *lineGradient +/** @property nullable CPTGradient *lineGradient * @brief The current line gradient fill. Default is @nil. * * If @nil, the line is drawn using the @ref lineFill or @ref lineColor. diff --git a/framework/Source/CPTMutableNumericData.h b/framework/Source/CPTMutableNumericData.h index 2813aa08b..32d299487 100644 --- a/framework/Source/CPTMutableNumericData.h +++ b/framework/Source/CPTMutableNumericData.h @@ -5,18 +5,18 @@ /// @name Data Buffer /// @{ -@property (nonatomic, readonly) void *mutableBytes; +@property (nonatomic, readonly, nonnull) void *mutableBytes; /// @} /// @name Dimensions /// @{ -@property (nonatomic, readwrite, copy) NSArray *shape; +@property (nonatomic, readwrite, copy, nonnull) CPTNumberArray *shape; /// @} /// @name Samples /// @{ --(void *)mutableSamplePointer:(NSUInteger)sample; --(void *)mutableSamplePointerAtIndex:(NSUInteger)idx, ...; +-(nullable void *)mutableSamplePointer:(NSUInteger)sample NS_RETURNS_INNER_POINTER; +-(nullable void *)mutableSamplePointerAtIndex:(NSUInteger)idx, ... NS_RETURNS_INNER_POINTER; /// @} @end diff --git a/framework/Source/CPTMutableNumericData.m b/framework/Source/CPTMutableNumericData.m index 0ab6c2882..631d70704 100644 --- a/framework/Source/CPTMutableNumericData.m +++ b/framework/Source/CPTMutableNumericData.m @@ -24,12 +24,12 @@ -(NSUInteger)sampleIndex:(NSUInteger)idx indexList:(va_list)indexList; **/ @implementation CPTMutableNumericData -/** @property void *mutableBytes +/** @property nonnull void *mutableBytes * @brief Returns a pointer to the data buffer’s contents. **/ @dynamic mutableBytes; -/** @property NSArray *shape +/** @property nonnull CPTNumberArray *shape * @brief The shape of the data buffer array. Set a new shape to change the size of the data buffer. * * The shape describes the dimensions of the sample array stored in @@ -46,10 +46,10 @@ @implementation CPTMutableNumericData * @param sample The zero-based index into the sample array. The array is treated as if it only has one dimension. * @return A pointer to the sample or @NULL if the sample index is out of bounds. **/ --(void *)mutableSamplePointer:(NSUInteger)sample +-(nullable void *)mutableSamplePointer:(NSUInteger)sample { if ( sample < self.numberOfSamples ) { - return (void *)( (char *)self.mutableBytes + sample * self.sampleBytes ); + return (void *)((char *)self.mutableBytes + sample * self.sampleBytes); } else { return NULL; @@ -58,11 +58,11 @@ -(void *)mutableSamplePointer:(NSUInteger)sample /** @brief Gets a pointer to a given sample in the data buffer. * @param idx The zero-based indices into a multi-dimensional sample array. Each index should of type @ref NSUInteger and the number of indices - * (including @par{index}) should match the @ref numberOfDimensions. + * (including @par{idx}) should match the @ref numberOfDimensions. * @return A pointer to the sample or @NULL if any of the sample indices are out of bounds. **/ --(void *)mutableSamplePointerAtIndex:(NSUInteger)idx, ... - { +-(nullable void *)mutableSamplePointerAtIndex:(NSUInteger)idx, ... +{ NSUInteger newIndex; if ( self.numberOfDimensions > 1 ) { @@ -85,9 +85,9 @@ -(void *)mutableSamplePointerAtIndex:(NSUInteger)idx, ... /// @cond --(void *)mutableBytes +-(nonnull void *)mutableBytes { - return [(NSMutableData *)self.data mutableBytes]; + return ((NSMutableData *)self.data).mutableBytes; } /// @endcond diff --git a/framework/Source/CPTMutableNumericDataTests.m b/framework/Source/CPTMutableNumericDataTests.m index 67eafd056..d5cc0870a 100644 --- a/framework/Source/CPTMutableNumericDataTests.m +++ b/framework/Source/CPTMutableNumericDataTests.m @@ -16,7 +16,7 @@ -(void)testNilShapeGivesSingleDimension NSUInteger expected = 1; XCTAssertEqual(actual, expected, @"numberOfDimensions == 1"); - expected = [nd.shape count]; + expected = nd.shape.count; XCTAssertEqual(actual, expected, @"numberOfDimensions == 1"); } @@ -28,7 +28,7 @@ -(void)testNumberOfDimensionsGivesShapeCount NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; CPTMutableNumericData *nd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:shape]; XCTAssertEqual(nd.numberOfDimensions, nd.shape.count, @"numberOfDimensions == shape.count == 3"); @@ -47,7 +47,7 @@ -(void)testNilShapeCorrectElementCount NSUInteger prod = 1; for ( NSNumber *num in nd.shape ) { - prod *= [num unsignedIntValue]; + prod *= num.unsignedIntegerValue; } XCTAssertEqual(prod, nElems, @"prod == nElems"); @@ -64,7 +64,7 @@ -(void)testIllegalShapeRaisesException NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(NSUInteger)]; XCTAssertThrowsSpecificNamed(testData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTUnsignedIntegerDataType, sizeof(NSUInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTUnsignedIntegerDataType, sizeof(NSUInteger), NSHostByteOrder()) shape:shape], NSException, CPTNumericDataException, @@ -79,7 +79,7 @@ -(void)testReturnsDataLength shape:nil]; NSUInteger expected = 10 * sizeof(float); - NSUInteger actual = [nd length]; + NSUInteger actual = nd.length; XCTAssertEqual(expected, actual, @"data length"); } @@ -88,14 +88,14 @@ -(void)testBytesEqualDataBytes { NSUInteger nElements = 10; NSMutableData *data = [NSMutableData dataWithLength:nElements * sizeof(NSInteger)]; - NSInteger *intData = (NSInteger *)[data mutableBytes]; + NSInteger *intData = (NSInteger *)data.mutableBytes; for ( NSUInteger i = 0; i < nElements; i++ ) { intData[i] = (NSInteger)i; } CPTMutableNumericData *nd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder()) shape:nil]; NSMutableData *expected = data; @@ -106,17 +106,17 @@ -(void)testArchivingRoundTrip { NSUInteger nElems = 10; NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < nElems; i++ ) { samples[i] = sinf(i); } CPTMutableNumericData *nd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; - CPTMutableNumericData *nd2 = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:nd]]; + CPTMutableNumericData *nd2 = [self archiveRoundTrip:nd]; XCTAssertTrue([nd.data isEqualToData:nd2.data], @"equal data"); @@ -133,27 +133,27 @@ -(void)testNumberOfSamplesCorrectForDataType { NSUInteger nElems = 10; NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < nElems; i++ ) { samples[i] = sinf(i); } CPTMutableNumericData *nd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; XCTAssertEqual([nd numberOfSamples], nElems, @"numberOfSamples == nElems"); nElems = 10; data = [NSMutableData dataWithLength:nElems * sizeof(char)]; - char *charSamples = (char *)[data mutableBytes]; + char *charSamples = (char *)data.mutableBytes; for ( NSUInteger i = 0; i < nElems; i++ ) { charSamples[i] = (char)lrint(sin(i) * 100.0); } nd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(char), NSHostByteOrder() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(char), NSHostByteOrder()) shape:nil]; XCTAssertEqual([nd numberOfSamples], nElems, @"numberOfSamples == nElems"); @@ -163,14 +163,14 @@ -(void)testDataTypeAccessorsCorrectForDataType { NSUInteger nElems = 10; NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < nElems; i++ ) { samples[i] = sinf(i); } CPTMutableNumericData *nd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; XCTAssertEqual([nd dataTypeFormat], CPTFloatingPointDataType, @"dataTypeFormat"); @@ -182,23 +182,23 @@ -(void)testConvertTypeConvertsType { NSUInteger numberOfSamples = 10; NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = sinf(i); } CPTMutableNumericData *fd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; CPTNumericData *dd = [fd dataByConvertingToType:CPTFloatingPointDataType sampleBytes:sizeof(double) byteOrder:NSHostByteOrder()]; - const double *doubleSamples = (const double *)[dd.data bytes]; + const double *doubleSamples = (const double *)dd.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertTrue(samples[i] == doubleSamples[i], @"(float)%g != (double)%g", samples[i], doubleSamples[i]); + XCTAssertTrue((double)samples[i] == doubleSamples[i], @"(float)%g != (double)%g", (double)samples[i], doubleSamples[i]); } } @@ -206,19 +206,19 @@ -(void)testSamplePointerCorrect { NSUInteger nElems = 10; NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < nElems; i++ ) { samples[i] = sinf(i); } CPTMutableNumericData *fd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; - XCTAssertEqual( ( (float *)[fd mutableBytes] ) + 4, (float *)[fd mutableSamplePointer:4], @"%p,%p", samples + 4, (float *)[fd mutableSamplePointer:4] ); - XCTAssertEqual( ( (float *)[fd mutableBytes] ), (float *)[fd mutableSamplePointer:0], @"" ); - XCTAssertEqual( ( (float *)[fd mutableBytes] ) + nElems - 1, (float *)[fd mutableSamplePointer:nElems - 1], @"" ); + XCTAssertEqual(((float *)[fd mutableBytes]) + 4, (float *)[fd mutableSamplePointer:4], @"%p,%p", samples + 4, (float *)[fd mutableSamplePointer:4]); + XCTAssertEqual(((float *)[fd mutableBytes]), (float *)[fd mutableSamplePointer:0], @""); + XCTAssertEqual(((float *)[fd mutableBytes]) + nElems - 1, (float *)[fd mutableSamplePointer:nElems - 1], @""); XCTAssertNil([fd samplePointer:nElems], @"too many samples"); } @@ -226,14 +226,14 @@ -(void)testSampleValueCorrect { NSUInteger nElems = 10; NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < nElems; i++ ) { samples[i] = sinf(i); } CPTMutableNumericData *fd = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; XCTAssertEqualWithAccuracy([[fd sampleValue:0] doubleValue], sin(0), 0.01, @"sample value"); @@ -245,13 +245,13 @@ -(void)testMutableCopy const NSUInteger nElems = 10; NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; CPTMutableNumericData *ndCopy = [nd mutableCopy]; // should be mutable--if not, this will error - ndCopy.dataType = CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ); + ndCopy.dataType = CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()); } @end diff --git a/framework/Source/CPTMutableNumericDataTypeConversionTests.m b/framework/Source/CPTMutableNumericDataTypeConversionTests.m index 1f825e4c8..2c01ecfe5 100644 --- a/framework/Source/CPTMutableNumericDataTypeConversionTests.m +++ b/framework/Source/CPTMutableNumericDataTypeConversionTests.m @@ -11,103 +11,103 @@ @implementation CPTMutableNumericDataTypeConversionTests -(void)testFloatToDoubleInPlaceConversion { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = sinf(i); } CPTMutableNumericData *numericData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; numericData.sampleBytes = sizeof(double); - const double *doubleSamples = (const double *)[numericData.data bytes]; + const double *doubleSamples = (const double *)numericData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy( (double)samples[i], doubleSamples[i], precision, @"(float)%g != (double)%g", samples[i], doubleSamples[i] ); + XCTAssertEqualWithAccuracy((double)samples[i], doubleSamples[i], precision, @"(float)%g != (double)%g", (double)samples[i], doubleSamples[i]); } } -(void)testDoubleToFloatInPlaceConversion { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(double)]; - double *samples = (double *)[data mutableBytes]; + double *samples = (double *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = sin(i); } CPTMutableNumericData *numericData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()) shape:nil]; numericData.sampleBytes = sizeof(float); - const float *floatSamples = (const float *)[numericData.data bytes]; + const float *floatSamples = (const float *)numericData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy( (double)floatSamples[i], samples[i], precision, @"(float)%g != (double)%g", floatSamples[i], samples[i] ); + XCTAssertEqualWithAccuracy((double)floatSamples[i], samples[i], precision, @"(float)%g != (double)%g", (double)floatSamples[i], samples[i]); } } -(void)testFloatToIntegerInPlaceConversion { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = sinf(i) * 1000.0f; } CPTMutableNumericData *numericData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; - numericData.dataType = CPTDataType( CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder() ); + numericData.dataType = CPTDataType(CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder()); - const NSInteger *intSamples = (const NSInteger *)[numericData.data bytes]; + const NSInteger *intSamples = (const NSInteger *)numericData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy( (NSInteger)samples[i], intSamples[i], precision, @"(float)%g != (NSInteger)%ld", samples[i], (long)intSamples[i] ); + XCTAssertEqualWithAccuracy((NSInteger)samples[i], intSamples[i], precision, @"(float)%g != (NSInteger)%ld", (double)samples[i], (long)intSamples[i]); } } -(void)testIntegerToFloatInPlaceConversion { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(NSInteger)]; - NSInteger *samples = (NSInteger *)[data mutableBytes]; + NSInteger *samples = (NSInteger *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = (NSInteger)(sin(i) * 1000.0); } CPTMutableNumericData *numericData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder()) shape:nil]; - numericData.dataType = CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ); + numericData.dataType = CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()); - const float *floatSamples = (const float *)[numericData.data bytes]; + const float *floatSamples = (const float *)numericData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy(floatSamples[i], (float)samples[i], precision, @"(float)%g != (NSInteger)%ld", floatSamples[i], (long)samples[i]); + XCTAssertEqualWithAccuracy(floatSamples[i], (float)samples[i], (float)precision, @"(float)%g != (NSInteger)%ld", (double)floatSamples[i], (long)samples[i]); } } -(void)testDecimalToDoubleInPlaceConversion { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(NSDecimal)]; - NSDecimal *samples = (NSDecimal *)[data mutableBytes]; + NSDecimal *samples = (NSDecimal *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - samples[i] = CPTDecimalFromDouble( sin(i) ); + samples[i] = CPTDecimalFromDouble(sin(i)); } CPTMutableNumericData *numericData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder() ) + dataType:CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder()) shape:nil]; - numericData.dataType = CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ); + numericData.dataType = CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()); - const double *doubleSamples = (const double *)[numericData.data bytes]; + const double *doubleSamples = (const double *)numericData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { XCTAssertEqual(CPTDecimalDoubleValue(samples[i]), doubleSamples[i], @"(NSDecimal)%@ != (double)%g", CPTDecimalStringValue(samples[i]), doubleSamples[i]); } @@ -116,21 +116,21 @@ -(void)testDecimalToDoubleInPlaceConversion -(void)testDoubleToDecimalInPlaceConversion { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(double)]; - double *samples = (double *)[data mutableBytes]; + double *samples = (double *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = sin(i); } CPTMutableNumericData *numericData = [[CPTMutableNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()) shape:nil]; - numericData.dataType = CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder() ); + numericData.dataType = CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder()); - const NSDecimal *decimalSamples = (const NSDecimal *)[numericData.data bytes]; + const NSDecimal *decimalSamples = (const NSDecimal *)numericData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertTrue(CPTDecimalEquals( decimalSamples[i], CPTDecimalFromDouble(samples[i]) ), @"(NSDecimal)%@ != (double)%g", CPTDecimalStringValue(decimalSamples[i]), samples[i]); + XCTAssertTrue(CPTDecimalEquals(decimalSamples[i], CPTDecimalFromDouble(samples[i])), @"(NSDecimal)%@ != (double)%g", CPTDecimalStringValue(decimalSamples[i]), samples[i]); } } @@ -177,7 +177,7 @@ -(void)testTypeConversionSwapsByteOrderDoubleInPlace uint64_t end = *(const uint64_t *)numericData.bytes; union swap { - double v; + double v; CFSwappedFloat64 sv; } result; diff --git a/framework/Source/CPTMutablePlotRange.h b/framework/Source/CPTMutablePlotRange.h index ced244d08..a4d602679 100644 --- a/framework/Source/CPTMutablePlotRange.h +++ b/framework/Source/CPTMutablePlotRange.h @@ -4,25 +4,29 @@ /// @name Range Limits /// @{ -@property (nonatomic, readwrite) NSDecimal location; -@property (nonatomic, readwrite) NSDecimal length; +@property (nonatomic, readwrite, strong, nonnull) NSNumber *location; +@property (nonatomic, readwrite, strong, nonnull) NSNumber *length; +@property (nonatomic, readwrite) NSDecimal locationDecimal; +@property (nonatomic, readwrite) NSDecimal lengthDecimal; +@property (nonatomic, readwrite) double locationDouble; +@property (nonatomic, readwrite) double lengthDouble; /// @} /// @name Combining Ranges /// @{ --(void)unionPlotRange:(CPTPlotRange *)otherRange; --(void)intersectionPlotRange:(CPTPlotRange *)otherRange; +-(void)unionPlotRange:(nullable CPTPlotRange *)otherRange; +-(void)intersectionPlotRange:(nullable CPTPlotRange *)otherRange; /// @} /// @name Shifting Ranges /// @{ --(void)shiftLocationToFitInRange:(CPTPlotRange *)otherRange; --(void)shiftEndToFitInRange:(CPTPlotRange *)otherRange; +-(void)shiftLocationToFitInRange:(nonnull CPTPlotRange *)otherRange; +-(void)shiftEndToFitInRange:(nonnull CPTPlotRange *)otherRange; /// @} /// @name Expanding/Contracting Ranges /// @{ --(void)expandRangeByFactor:(NSDecimal)factor; +-(void)expandRangeByFactor:(nonnull NSNumber *)factor; /// @} @end diff --git a/framework/Source/CPTMutablePlotRange.m b/framework/Source/CPTMutablePlotRange.m index 4e139e3c6..eb1079824 100644 --- a/framework/Source/CPTMutablePlotRange.m +++ b/framework/Source/CPTMutablePlotRange.m @@ -2,6 +2,17 @@ #import "CPTUtilities.h" +/// @cond +@interface CPTMutablePlotRange() + +@property (nonatomic, readwrite) BOOL inValueUpdate; + +@end + +/// @endcond + +#pragma mark - + /** @brief Defines a mutable range of plot data. * * If you need to change the plot range, you should use this class rather than the @@ -10,83 +21,210 @@ **/ @implementation CPTMutablePlotRange -/** @property location +/** @property nonnull NSNumber *location * @brief The starting value of the range. + * @see @ref locationDecimal, @ref locationDouble **/ @dynamic location; -/** @property length +/** @property nonnull NSNumber *length * @brief The length of the range. + * @see @ref lengthDecimal, @ref lengthDouble **/ @dynamic length; +/** @property NSDecimal locationDecimal + * @brief The starting value of the range. + * @see @ref location, @ref locationDouble + **/ +@dynamic locationDecimal; + +/** @property NSDecimal lengthDecimal + * @brief The length of the range. + * @see @ref length, @ref lengthDouble + **/ +@dynamic lengthDecimal; + +/** @property double locationDouble + * @brief The starting value of the range as a @double. + * @see @ref location, @ref locationDecimal + **/ +@dynamic locationDouble; + +/** @property double lengthDouble + * @brief The length of the range as a @double. + * @see @ref length, @ref lengthDecimal + **/ +@dynamic lengthDouble; + +@dynamic inValueUpdate; + #pragma mark - #pragma mark Combining ranges /** @brief Extends the range to include another range. The sign of @ref length is unchanged. * @param other The other plot range. **/ --(void)unionPlotRange:(CPTPlotRange *)other +-(void)unionPlotRange:(nullable CPTPlotRange *)other { if ( !other ) { return; } - NSDecimal min1 = self.minLimit; - NSDecimal min2 = other.minLimit; - NSDecimal minimum = CPTDecimalLessThan(min1, min2) ? min1 : min2; + NSDecimal min1 = self.minLimitDecimal; + NSDecimal min2 = other.minLimitDecimal; + NSDecimal minimum = CPTDecimalMin(min1, min2); + + NSDecimal max1 = self.maxLimitDecimal; + NSDecimal max2 = other.maxLimitDecimal; + NSDecimal maximum = CPTDecimalMax(max1, max2); - NSDecimal max1 = self.maxLimit; - NSDecimal max2 = other.maxLimit; - NSDecimal maximum = CPTDecimalGreaterThan(max1, max2) ? max1 : max2; + if ( self.isInfinite && other.isInfinite ) { + if ( self.lengthSign == other.lengthSign ) { + switch ( self.lengthSign ) { + case CPTSignPositive: + self.locationDecimal = minimum; + break; - NSDecimal newLocation, newLength; - if ( CPTDecimalGreaterThanOrEqualTo( self.length, CPTDecimalFromInteger(0) ) ) { - newLocation = minimum; - newLength = CPTDecimalSubtract(maximum, minimum); + case CPTSignNegative: + self.locationDecimal = maximum; + break; + + default: + break; + } + } + else { + self.locationDouble = -HUGE_VAL; + self.lengthDouble = HUGE_VAL; + } } - else { - newLocation = maximum; - newLength = CPTDecimalSubtract(minimum, maximum); + else if ( self.isInfinite && !other.isInfinite ) { + switch ( self.lengthSign ) { + case CPTSignPositive: + self.locationDecimal = minimum; + break; + + case CPTSignNegative: + self.locationDecimal = maximum; + break; + + default: + break; + } } + else if ( !self.isInfinite && other.isInfinite ) { + switch ( other.lengthSign ) { + case CPTSignPositive: + self.locationDecimal = minimum; + self.lengthDouble = HUGE_VAL; + break; - self.location = newLocation; - self.length = newLength; + case CPTSignNegative: + self.locationDecimal = maximum; + self.lengthDouble = -HUGE_VAL; + break; + + default: + break; + } + } + else if ( NSDecimalIsNotANumber(&minimum) || NSDecimalIsNotANumber(&maximum)) { + self.locationDecimal = CPTDecimalNaN(); + self.lengthDecimal = CPTDecimalNaN(); + } + else { + if ( CPTDecimalGreaterThanOrEqualTo(self.lengthDecimal, CPTDecimalFromInteger(0))) { + self.locationDecimal = minimum; + self.lengthDecimal = CPTDecimalSubtract(maximum, minimum); + } + else { + self.locationDecimal = maximum; + self.lengthDecimal = CPTDecimalSubtract(minimum, maximum); + } + } } /** @brief Sets the messaged object to the intersection with another range. The sign of @ref length is unchanged. * @param other The other plot range. **/ --(void)intersectionPlotRange:(CPTPlotRange *)other +-(void)intersectionPlotRange:(nullable CPTPlotRange *)other { if ( !other ) { return; } - NSDecimal min1 = self.minLimit; - NSDecimal min2 = other.minLimit; - NSDecimal minimum = CPTDecimalGreaterThan(min1, min2) ? min1 : min2; + NSDecimal min1 = self.minLimitDecimal; + NSDecimal min2 = other.minLimitDecimal; + NSDecimal minimum = CPTDecimalMax(min1, min2); - NSDecimal max1 = self.maxLimit; - NSDecimal max2 = other.maxLimit; - NSDecimal maximum = CPTDecimalLessThan(max1, max2) ? max1 : max2; + NSDecimal max1 = self.maxLimitDecimal; + NSDecimal max2 = other.maxLimitDecimal; + NSDecimal maximum = CPTDecimalMin(max1, max2); + + if ( ![self intersectsRange:other] ) { + self.locationDecimal = CPTDecimalNaN(); + self.lengthDecimal = CPTDecimalNaN(); + } + else if ( self.isInfinite && other.isInfinite ) { + switch ( self.lengthSign ) { + case CPTSignPositive: + self.locationDecimal = minimum; + break; - if ( CPTDecimalGreaterThanOrEqualTo(maximum, minimum) ) { - NSDecimal newLocation, newLength; - if ( CPTDecimalGreaterThanOrEqualTo( self.length, CPTDecimalFromInteger(0) ) ) { - newLocation = minimum; - newLength = CPTDecimalSubtract(maximum, minimum); + case CPTSignNegative: + self.locationDecimal = maximum; + break; + + default: + break; } - else { - newLocation = maximum; - newLength = CPTDecimalSubtract(minimum, maximum); + } + else if ( self.isInfinite && !other.isInfinite ) { + switch ( self.lengthSign ) { + case CPTSignPositive: + self.locationDecimal = minimum; + self.lengthDecimal = CPTDecimalSubtract(other.maxLimitDecimal, minimum); + break; + + case CPTSignNegative: + self.locationDecimal = maximum; + self.lengthDecimal = CPTDecimalSubtract(other.minLimitDecimal, maximum); + break; + + default: + break; } + } + else if ( !self.isInfinite && other.isInfinite ) { + switch ( other.lengthSign ) { + case CPTSignPositive: + self.locationDecimal = minimum; + self.lengthDecimal = CPTDecimalSubtract(self.maxLimitDecimal, minimum); + break; - self.location = newLocation; - self.length = newLength; + case CPTSignNegative: + self.locationDecimal = maximum; + self.lengthDecimal = CPTDecimalSubtract(self.minLimitDecimal, maximum); + break; + + default: + break; + } + } + else if ( NSDecimalIsNotANumber(&minimum) || NSDecimalIsNotANumber(&maximum)) { + self.locationDecimal = CPTDecimalNaN(); + self.lengthDecimal = CPTDecimalNaN(); } else { - self.length = CPTDecimalFromInteger(0); + if ( CPTDecimalGreaterThanOrEqualTo(self.lengthDecimal, CPTDecimalFromInteger(0))) { + self.locationDecimal = minimum; + self.lengthDecimal = CPTDecimalSubtract(maximum, minimum); + } + else { + self.locationDecimal = maximum; + self.lengthDecimal = CPTDecimalSubtract(minimum, maximum); + } } } @@ -97,15 +235,15 @@ -(void)intersectionPlotRange:(CPTPlotRange *)other * @param factor Factor used. A value of @num{1.0} gives no change. * Less than @num{1.0} is a contraction, and greater than @num{1.0} is expansion. **/ --(void)expandRangeByFactor:(NSDecimal)factor +-(void)expandRangeByFactor:(nonnull NSNumber *)factor { - NSDecimal oldLength = self.length; - NSDecimal newLength = CPTDecimalMultiply(oldLength, factor); - NSDecimal locationOffset = CPTDecimalDivide( CPTDecimalSubtract(oldLength, newLength), CPTDecimalFromInteger(2) ); - NSDecimal newLocation = CPTDecimalAdd(self.location, locationOffset); + NSDecimal oldLength = self.lengthDecimal; + NSDecimal newLength = CPTDecimalMultiply(oldLength, factor.decimalValue); + NSDecimal locationOffset = CPTDecimalDivide(CPTDecimalSubtract(oldLength, newLength), CPTDecimalFromInteger(2)); + NSDecimal newLocation = CPTDecimalAdd(self.locationDecimal, locationOffset); - self.location = newLocation; - self.length = newLength; + self.locationDecimal = newLocation; + self.lengthDecimal = newLength; } #pragma mark - @@ -115,17 +253,17 @@ -(void)expandRangeByFactor:(NSDecimal)factor * @param otherRange Other range. * The minimum possible shift is made. The range @ref length is unchanged. **/ --(void)shiftLocationToFitInRange:(CPTPlotRange *)otherRange +-(void)shiftLocationToFitInRange:(nonnull CPTPlotRange *)otherRange { NSParameterAssert(otherRange); - switch ( [otherRange compareToNumber:[NSDecimalNumber decimalNumberWithDecimal:self.location]] ) { + switch ( [otherRange compareToDecimal:self.locationDecimal] ) { case CPTPlotRangeComparisonResultNumberBelowRange: - self.location = otherRange.minLimit; + self.locationDecimal = otherRange.minLimitDecimal; break; case CPTPlotRangeComparisonResultNumberAboveRange: - self.location = otherRange.maxLimit; + self.locationDecimal = otherRange.maxLimitDecimal; break; default: @@ -138,17 +276,17 @@ -(void)shiftLocationToFitInRange:(CPTPlotRange *)otherRange * @param otherRange Other range. * The minimum possible shift is made. The range @ref length is unchanged. **/ --(void)shiftEndToFitInRange:(CPTPlotRange *)otherRange +-(void)shiftEndToFitInRange:(nonnull CPTPlotRange *)otherRange { NSParameterAssert(otherRange); - switch ( [otherRange compareToNumber:[NSDecimalNumber decimalNumberWithDecimal:self.end]] ) { + switch ( [otherRange compareToDecimal:self.endDecimal] ) { case CPTPlotRangeComparisonResultNumberBelowRange: - self.location = CPTDecimalSubtract(otherRange.minLimit, self.length); + self.locationDecimal = CPTDecimalSubtract(otherRange.minLimitDecimal, self.lengthDecimal); break; case CPTPlotRangeComparisonResultNumberAboveRange: - self.location = CPTDecimalSubtract(otherRange.maxLimit, self.length); + self.locationDecimal = CPTDecimalSubtract(otherRange.maxLimitDecimal, self.lengthDecimal); break; default: @@ -157,4 +295,35 @@ -(void)shiftEndToFitInRange:(CPTPlotRange *)otherRange } } +#pragma mark - +#pragma mark Accessors + +/// @cond + +-(void)setLocation:(nonnull NSNumber *)newLocation +{ + NSParameterAssert(newLocation); + + self.inValueUpdate = YES; + + self.locationDecimal = newLocation.decimalValue; + self.locationDouble = newLocation.doubleValue; + + self.inValueUpdate = NO; +} + +-(void)setLength:(nonnull NSNumber *)newLength +{ + NSParameterAssert(newLength); + + self.inValueUpdate = YES; + + self.lengthDecimal = newLength.decimalValue; + self.lengthDouble = newLength.doubleValue; + + self.inValueUpdate = NO; +} + +/// @endcond + @end diff --git a/framework/Source/CPTMutableShadow.h b/framework/Source/CPTMutableShadow.h index c671872f7..3392da191 100644 --- a/framework/Source/CPTMutableShadow.h +++ b/framework/Source/CPTMutableShadow.h @@ -6,6 +6,6 @@ @property (nonatomic, readwrite, assign) CGSize shadowOffset; @property (nonatomic, readwrite, assign) CGFloat shadowBlurRadius; -@property (nonatomic, readwrite, strong) CPTColor *shadowColor; +@property (nonatomic, readwrite, strong, nullable) CPTColor *shadowColor; @end diff --git a/framework/Source/CPTMutableShadow.m b/framework/Source/CPTMutableShadow.m index db73e4aef..b30e7afca 100644 --- a/framework/Source/CPTMutableShadow.m +++ b/framework/Source/CPTMutableShadow.m @@ -21,7 +21,7 @@ @implementation CPTMutableShadow **/ @dynamic shadowBlurRadius; -/** @property CPTColor *shadowColor +/** @property nullable CPTColor *shadowColor * @brief The shadow color. If @nil (the default), the shadow will not be drawn. **/ @dynamic shadowColor; diff --git a/framework/Source/CPTMutableTextStyle.h b/framework/Source/CPTMutableTextStyle.h index 6bbdc23bc..e63ec361f 100644 --- a/framework/Source/CPTMutableTextStyle.h +++ b/framework/Source/CPTMutableTextStyle.h @@ -4,9 +4,10 @@ @interface CPTMutableTextStyle : CPTTextStyle -@property (readwrite, copy, nonatomic) NSString *fontName; +@property (readwrite, strong, nonatomic, nullable) CPTNativeFont *font; +@property (readwrite, copy, nonatomic, nullable) NSString *fontName; @property (readwrite, assign, nonatomic) CGFloat fontSize; -@property (readwrite, copy, nonatomic) CPTColor *color; +@property (readwrite, copy, nonatomic, nullable) CPTColor *color; @property (readwrite, assign, nonatomic) CPTTextAlignment textAlignment; @property (readwrite, assign, nonatomic) NSLineBreakMode lineBreakMode; diff --git a/framework/Source/CPTMutableTextStyle.m b/framework/Source/CPTMutableTextStyle.m index 4c50dd317..50cce383a 100644 --- a/framework/Source/CPTMutableTextStyle.m +++ b/framework/Source/CPTMutableTextStyle.m @@ -7,17 +7,24 @@ @implementation CPTMutableTextStyle +/** @property CPTNativeFont* font + * @brief The font. Default is @nil. + * + * Font will override fontName and fontSize if not @nil. + **/ +@synthesize font; + /** @property CGFloat fontSize - * @brief The font size. Default is @num{12.0}. + * @brief The font size. Default is @num{12.0}. Ignored if font is not @nil. **/ @dynamic fontSize; -/** @property NSString *fontName - * @brief The font name. Default is Helvetica. +/** @property nullable NSString *fontName + * @brief The font name. Default is Helvetica. Ignored if font is not @nil. **/ @dynamic fontName; -/** @property CPTColor *color +/** @property nullable CPTColor *color * @brief The current text color. Default is solid black. **/ @dynamic color; diff --git a/framework/Source/CPTNumericData+TypeConversion.h b/framework/Source/CPTNumericData+TypeConversion.h index 7ae0179c6..7bd08216b 100644 --- a/framework/Source/CPTNumericData+TypeConversion.h +++ b/framework/Source/CPTNumericData+TypeConversion.h @@ -8,15 +8,15 @@ /// @name Type Conversion /// @{ --(CPTNumericData *)dataByConvertingToDataType:(CPTNumericDataType)newDataType; +-(nonnull CPTNumericData *)dataByConvertingToDataType:(CPTNumericDataType)newDataType; --(CPTNumericData *)dataByConvertingToType:(CPTDataTypeFormat)newDataType sampleBytes:(size_t)newSampleBytes byteOrder:(CFByteOrder)newByteOrder; +-(nonnull CPTNumericData *)dataByConvertingToType:(CPTDataTypeFormat)newDataType sampleBytes:(size_t)newSampleBytes byteOrder:(CFByteOrder)newByteOrder; /// @} /// @name Data Conversion Utilities /// @{ --(void)convertData:(NSData *)sourceData dataType:(CPTNumericDataType *)sourceDataType toData:(NSMutableData *)destData dataType:(CPTNumericDataType *)destDataType; --(void)swapByteOrderForData:(NSMutableData *)sourceData sampleSize:(size_t)sampleSize; +-(void)convertData:(nonnull NSData *)sourceData dataType:(nonnull CPTNumericDataType *)sourceDataType toData:(nonnull NSMutableData *)destData dataType:(nonnull CPTNumericDataType *)destDataType; +-(void)swapByteOrderForData:(nonnull NSMutableData *)sourceData sampleSize:(size_t)sampleSize; /// @} @end diff --git a/framework/Source/CPTNumericData+TypeConversion.m b/framework/Source/CPTNumericData+TypeConversion.m index 60b17ddc7..2ebfd19a1 100644 --- a/framework/Source/CPTNumericData+TypeConversion.m +++ b/framework/Source/CPTNumericData+TypeConversion.m @@ -1,7 +1,7 @@ #import "CPTNumericData+TypeConversion.h" -#import "CPTUtilities.h" #import "complex.h" +#import "CPTUtilities.h" @implementation CPTNumericData(TypeConversion) @@ -11,9 +11,9 @@ @implementation CPTNumericData(TypeConversion) * @param newByteOrder The new byte order. * @return A copy of the current numeric data converted to the new data type. **/ --(CPTNumericData *)dataByConvertingToType:(CPTDataTypeFormat)newDataType - sampleBytes:(size_t)newSampleBytes - byteOrder:(CFByteOrder)newByteOrder +-(nonnull CPTNumericData *)dataByConvertingToType:(CPTDataTypeFormat)newDataType + sampleBytes:(size_t)newSampleBytes + byteOrder:(CFByteOrder)newByteOrder { return [self dataByConvertingToDataType:CPTDataType(newDataType, newSampleBytes, newByteOrder)]; } @@ -22,24 +22,24 @@ -(CPTNumericData *)dataByConvertingToType:(CPTDataTypeFormat)newDataType * @param newDataType The new data type. * @return A copy of the current numeric data converted to the new data type. **/ --(CPTNumericData *)dataByConvertingToDataType:(CPTNumericDataType)newDataType +-(nonnull CPTNumericData *)dataByConvertingToDataType:(CPTNumericDataType)newDataType { CPTNumericDataType myDataType = self.dataType; NSParameterAssert(myDataType.dataTypeFormat != CPTUndefinedDataType); NSParameterAssert(myDataType.byteOrder != CFByteOrderUnknown); - NSParameterAssert( CPTDataTypeIsSupported(newDataType) ); + NSParameterAssert(CPTDataTypeIsSupported(newDataType)); NSParameterAssert(newDataType.dataTypeFormat != CPTUndefinedDataType); NSParameterAssert(newDataType.byteOrder != CFByteOrderUnknown); NSData *newData = nil; CFByteOrder hostByteOrder = CFByteOrderGetCurrent(); - if ( CPTDataTypeEqualToDataType(myDataType, newDataType) ) { + if ( CPTDataTypeEqualToDataType(myDataType, newDataType)) { newData = self.data; } - else if ( ( myDataType.sampleBytes == sizeof(int8_t) ) && ( newDataType.sampleBytes == sizeof(int8_t) ) ) { + else if ((myDataType.sampleBytes == sizeof(int8_t)) && (newDataType.sampleBytes == sizeof(int8_t))) { newData = self.data; } else { @@ -80,10 +80,10 @@ -(CPTNumericData *)dataByConvertingToDataType:(CPTNumericDataType)newDataType * @param destData The destination data buffer. * @param destDataType The new data type. **/ --(void)convertData:(NSData *)sourceData - dataType:(CPTNumericDataType *)sourceDataType - toData:(NSMutableData *)destData - dataType:(CPTNumericDataType *)destDataType +-(void)convertData:(nonnull NSData *)sourceData + dataType:(nonnull CPTNumericDataType *)sourceDataType + toData:(nonnull NSMutableData *)destData + dataType:(nonnull CPTNumericDataType *)destDataType { NSUInteger sampleCount = sourceData.length / sourceDataType->sampleBytes; @@ -105,7 +105,7 @@ case sizeof(int8_t): switch ( destDataType->sampleBytes ) { case sizeof(int8_t): { // int8_t -> int8_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int8_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int8_t)); } break; @@ -281,7 +281,7 @@ case sizeof(int8_t): case sizeof(int16_t): { // int16_t -> int16_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int16_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int16_t)); } break; @@ -457,7 +457,7 @@ case sizeof(int16_t): case sizeof(int32_t): { // int32_t -> int32_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int32_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int32_t)); } break; @@ -633,7 +633,7 @@ case sizeof(int32_t): case sizeof(int64_t): { // int64_t -> int64_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int64_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(int64_t)); } break; } @@ -817,7 +817,7 @@ case sizeof(int64_t): switch ( destDataType->sampleBytes ) { case sizeof(uint8_t): { // uint8_t -> uint8_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint8_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint8_t)); } break; @@ -993,7 +993,7 @@ case sizeof(uint8_t): case sizeof(uint16_t): { // uint16_t -> uint16_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint16_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint16_t)); } break; @@ -1169,7 +1169,7 @@ case sizeof(uint16_t): case sizeof(uint32_t): { // uint32_t -> uint32_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint32_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint32_t)); } break; @@ -1345,7 +1345,7 @@ case sizeof(uint32_t): case sizeof(uint64_t): { // uint64_t -> uint64_t - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint64_t) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(uint64_t)); } break; } @@ -1529,7 +1529,7 @@ case sizeof(uint64_t): switch ( destDataType->sampleBytes ) { case sizeof(float): { // float -> float - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(float) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(float)); } break; @@ -1705,7 +1705,7 @@ case sizeof(float): case sizeof(double): { // double -> double - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(double) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(double)); } break; } @@ -1889,7 +1889,7 @@ case sizeof(double): switch ( destDataType->sampleBytes ) { case sizeof(float complex): { // float complex -> float complex - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(float complex) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(float complex)); } break; @@ -1914,7 +1914,7 @@ case sizeof(NSDecimal): const float complex *lastSample = fromBytes + sampleCount; NSDecimal *toBytes = (NSDecimal *)destData.mutableBytes; while ( fromBytes < lastSample ) { - *toBytes++ = CPTDecimalFromFloat( crealf(*fromBytes++) ); + *toBytes++ = CPTDecimalFromFloat(crealf(*fromBytes++)); } } break; @@ -2065,7 +2065,7 @@ case sizeof(float complex): case sizeof(double complex): { // double complex -> double complex - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(double complex) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(double complex)); } break; } @@ -2079,7 +2079,7 @@ case sizeof(NSDecimal): const double complex *lastSample = fromBytes + sampleCount; NSDecimal *toBytes = (NSDecimal *)destData.mutableBytes; while ( fromBytes < lastSample ) { - *toBytes++ = CPTDecimalFromDouble( creal(*fromBytes++) ); + *toBytes++ = CPTDecimalFromDouble(creal(*fromBytes++)); } } break; @@ -2249,7 +2249,7 @@ case sizeof(double complex): switch ( destDataType->sampleBytes ) { case sizeof(NSDecimal): { // NSDecimal -> NSDecimal - memcpy( destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(NSDecimal) ); + memcpy(destData.mutableBytes, sourceData.bytes, sampleCount * sizeof(NSDecimal)); } break; } @@ -2268,7 +2268,7 @@ case sizeof(NSDecimal): * @param sourceData The data buffer. * @param sampleSize The number of bytes in each sample stored in sourceData. **/ --(void)swapByteOrderForData:(NSMutableData *)sourceData sampleSize:(size_t)sampleSize +-(void)swapByteOrderForData:(nonnull NSMutableData *)sourceData sampleSize:(size_t)sampleSize { NSUInteger sampleCount; diff --git a/framework/Source/CPTNumericData+TypeConversions_Generation.py b/framework/Source/CPTNumericData+TypeConversions_Generation.py index 1f340c706..1bad205f8 100644 --- a/framework/Source/CPTNumericData+TypeConversions_Generation.py +++ b/framework/Source/CPTNumericData+TypeConversions_Generation.py @@ -46,9 +46,9 @@ "uint32_t" : "0", "uint64_t" : "0", "float" : "NAN", - "double" : "NAN", - "float complex" : "NAN", - "double complex" : "NAN", + "double" : "(double)NAN", + "float complex" : "CMPLXF(NAN, NAN)", + "double complex" : "CMPLX(NAN, NAN)", "NSDecimal" : "CPTDecimalNaN()" } diff --git a/framework/Source/CPTNumericData.h b/framework/Source/CPTNumericData.h index 657e20535..0215482fc 100644 --- a/framework/Source/CPTNumericData.h +++ b/framework/Source/CPTNumericData.h @@ -1,11 +1,12 @@ +#import "CPTDefinitions.h" #import "CPTNumericDataType.h" -@interface CPTNumericData : NSObject +@interface CPTNumericData : NSObject /// @name Data Buffer /// @{ -@property (nonatomic, readonly, copy) NSData *data; -@property (nonatomic, readonly) const void *bytes; +@property (nonatomic, readonly, copy, nonnull) NSData *data; +@property (nonatomic, readonly, nonnull) const void *bytes; @property (nonatomic, readonly) NSUInteger length; /// @} @@ -19,7 +20,7 @@ /// @name Dimensions /// @{ -@property (nonatomic, readonly, copy) NSArray *shape; +@property (nonatomic, readonly, copy, nonnull) CPTNumberArray *shape; @property (nonatomic, readonly) NSUInteger numberOfDimensions; @property (nonatomic, readonly) NSUInteger numberOfSamples; @property (nonatomic, readonly) CPTDataOrder dataOrder; @@ -27,40 +28,40 @@ /// @name Factory Methods /// @{ -+(instancetype)numericDataWithData:(NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(NSArray *)shapeArray; -+(instancetype)numericDataWithData:(NSData *)newData dataTypeString:(NSString *)newDataTypeString shape:(NSArray *)shapeArray; -+(instancetype)numericDataWithArray:(NSArray *)newData dataType:(CPTNumericDataType)newDataType shape:(NSArray *)shapeArray; -+(instancetype)numericDataWithArray:(NSArray *)newData dataTypeString:(NSString *)newDataTypeString shape:(NSArray *)shapeArray; ++(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray; ++(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray; ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray; ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray; -+(instancetype)numericDataWithData:(NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(NSArray *)shapeArray dataOrder:(CPTDataOrder)order; -+(instancetype)numericDataWithData:(NSData *)newData dataTypeString:(NSString *)newDataTypeString shape:(NSArray *)shapeArray dataOrder:(CPTDataOrder)order; -+(instancetype)numericDataWithArray:(NSArray *)newData dataType:(CPTNumericDataType)newDataType shape:(NSArray *)shapeArray dataOrder:(CPTDataOrder)order; -+(instancetype)numericDataWithArray:(NSArray *)newData dataTypeString:(NSString *)newDataTypeString shape:(NSArray *)shapeArray dataOrder:(CPTDataOrder)order; ++(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; ++(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; /// @} /// @name Initialization /// @{ --(instancetype)initWithData:(NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(NSArray *)shapeArray; --(instancetype)initWithData:(NSData *)newData dataTypeString:(NSString *)newDataTypeString shape:(NSArray *)shapeArray; --(instancetype)initWithArray:(NSArray *)newData dataType:(CPTNumericDataType)newDataType shape:(NSArray *)shapeArray; --(instancetype)initWithArray:(NSArray *)newData dataTypeString:(NSString *)newDataTypeString shape:(NSArray *)shapeArray; +-(nonnull instancetype)initWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray; +-(nonnull instancetype)initWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray; +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray; +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray; --(instancetype)initWithData:(NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(NSArray *)shapeArray dataOrder:(CPTDataOrder)order NS_DESIGNATED_INITIALIZER; --(instancetype)initWithData:(NSData *)newData dataTypeString:(NSString *)newDataTypeString shape:(NSArray *)shapeArray dataOrder:(CPTDataOrder)order; --(instancetype)initWithArray:(NSArray *)newData dataType:(CPTNumericDataType)newDataType shape:(NSArray *)shapeArray dataOrder:(CPTDataOrder)order; --(instancetype)initWithArray:(NSArray *)newData dataTypeString:(NSString *)newDataTypeString shape:(NSArray *)shapeArray dataOrder:(CPTDataOrder)order; +-(nonnull instancetype)initWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithData:(nonnull NSData *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData dataTypeString:(nonnull NSString *)newDataTypeString shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; --(instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; /// @} /// @name Samples /// @{ -(NSUInteger)sampleIndex:(NSUInteger)idx, ...; --(const void *)samplePointer:(NSUInteger)sample; --(const void *)samplePointerAtIndex:(NSUInteger)idx, ...; --(NSNumber *)sampleValue:(NSUInteger)sample; --(NSNumber *)sampleValueAtIndex:(NSUInteger)idx, ...; --(NSArray *)sampleArray; +-(nullable const void *)samplePointer:(NSUInteger)sample NS_RETURNS_INNER_POINTER; +-(nullable const void *)samplePointerAtIndex:(NSUInteger)idx, ... NS_RETURNS_INNER_POINTER; +-(nullable NSNumber *)sampleValue:(NSUInteger)sample; +-(nullable NSNumber *)sampleValueAtIndex:(NSUInteger)idx, ...; +-(nonnull CPTNumberArray *)sampleArray; /// @} @end diff --git a/framework/Source/CPTNumericData.m b/framework/Source/CPTNumericData.m index 581650fa2..b8c5d1243 100644 --- a/framework/Source/CPTNumericData.m +++ b/framework/Source/CPTNumericData.m @@ -1,22 +1,22 @@ #import "CPTNumericData.h" +#import "complex.h" #import "CPTExceptions.h" #import "CPTMutableNumericData.h" #import "CPTNumericData+TypeConversion.h" #import "CPTUtilities.h" -#import "complex.h" /// @cond @interface CPTNumericData() -@property (nonatomic, readwrite, copy) NSData *data; +@property (nonatomic, readwrite, copy, nonnull) NSData *data; @property (nonatomic, readwrite, assign) CPTNumericDataType dataType; -@property (nonatomic, readwrite, copy) NSArray *shape; +@property (nonatomic, readwrite, copy, nonnull) CPTNumberArray *shape; @property (nonatomic, readwrite, assign) CPTDataOrder dataOrder; --(void)commonInitWithData:(NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(NSArray *)shapeArray dataOrder:(CPTDataOrder)order; +-(void)commonInitWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order; -(NSUInteger)sampleIndex:(NSUInteger)idx indexList:(va_list)indexList; --(NSData *)dataFromArray:(NSArray *)newData dataType:(CPTNumericDataType)newDataType; +-(nonnull NSData *)dataFromArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType; @end @@ -46,12 +46,12 @@ -(NSData *)dataFromArray:(NSArray *)newData dataType:(CPTNumericDataType)newData **/ @implementation CPTNumericData -/** @property NSData *data +/** @property nonnull NSData *data * @brief The data buffer. **/ @synthesize data; -/** @property const void *bytes +/** @property nonnull const void *bytes * @brief Returns a pointer to the data buffer’s contents. **/ @dynamic bytes; @@ -81,7 +81,7 @@ @implementation CPTNumericData **/ @dynamic byteOrder; -/** @property NSArray *shape +/** @property nonnull CPTNumberArray *shape * @brief The shape of the data buffer array. * * The shape describes the dimensions of the sample array stored in @@ -115,9 +115,9 @@ @implementation CPTNumericData * @param shapeArray The shape of the data buffer array. Multi-dimensional data arrays will be assumed to be stored in #CPTDataOrderRowsFirst. * @return A new CPTNumericData instance. **/ -+(instancetype)numericDataWithData:(NSData *)newData - dataType:(CPTNumericDataType)newDataType - shape:(NSArray *)shapeArray ++(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData + dataType:(CPTNumericDataType)newDataType + shape:(nullable CPTNumberArray *)shapeArray { return [[self alloc] initWithData:newData dataType:newDataType @@ -130,9 +130,9 @@ +(instancetype)numericDataWithData:(NSData *)newData * @param shapeArray The shape of the data buffer array. Multi-dimensional data arrays will be assumed to be stored in #CPTDataOrderRowsFirst. * @return A new CPTNumericData instance. **/ -+(instancetype)numericDataWithData:(NSData *)newData - dataTypeString:(NSString *)newDataTypeString - shape:(NSArray *)shapeArray ++(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData + dataTypeString:(nonnull NSString *)newDataTypeString + shape:(nullable CPTNumberArray *)shapeArray { return [[self alloc] initWithData:newData dataType:CPTDataTypeWithDataTypeString(newDataTypeString) @@ -149,9 +149,9 @@ +(instancetype)numericDataWithData:(NSData *)newData * @param shapeArray The shape of the data buffer array. Multi-dimensional data arrays will be assumed to be stored in #CPTDataOrderRowsFirst. * @return A new CPTNumericData instance. **/ -+(instancetype)numericDataWithArray:(NSArray *)newData - dataType:(CPTNumericDataType)newDataType - shape:(NSArray *)shapeArray ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData + dataType:(CPTNumericDataType)newDataType + shape:(nullable CPTNumberArray *)shapeArray { return [[self alloc] initWithArray:newData dataType:newDataType @@ -168,9 +168,9 @@ +(instancetype)numericDataWithArray:(NSArray *)newData * @param shapeArray The shape of the data buffer array. Multi-dimensional data arrays will be assumed to be stored in #CPTDataOrderRowsFirst. * @return A new CPTNumericData instance. **/ -+(instancetype)numericDataWithArray:(NSArray *)newData - dataTypeString:(NSString *)newDataTypeString - shape:(NSArray *)shapeArray ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData + dataTypeString:(nonnull NSString *)newDataTypeString + shape:(nullable CPTNumberArray *)shapeArray { return [[self alloc] initWithArray:newData dataType:CPTDataTypeWithDataTypeString(newDataTypeString) @@ -184,10 +184,10 @@ +(instancetype)numericDataWithArray:(NSArray *)newData * @param order The data order for a multi-dimensional data array (row-major or column-major). * @return A new CPTNumericData instance. **/ -+(instancetype)numericDataWithData:(NSData *)newData - dataType:(CPTNumericDataType)newDataType - shape:(NSArray *)shapeArray - dataOrder:(CPTDataOrder)order ++(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData + dataType:(CPTNumericDataType)newDataType + shape:(nullable CPTNumberArray *)shapeArray + dataOrder:(CPTDataOrder)order { return [[self alloc] initWithData:newData dataType:newDataType @@ -202,10 +202,10 @@ +(instancetype)numericDataWithData:(NSData *)newData * @param order The data order for a multi-dimensional data array (row-major or column-major). * @return A new CPTNumericData instance. **/ -+(instancetype)numericDataWithData:(NSData *)newData - dataTypeString:(NSString *)newDataTypeString - shape:(NSArray *)shapeArray - dataOrder:(CPTDataOrder)order ++(nonnull instancetype)numericDataWithData:(nonnull NSData *)newData + dataTypeString:(nonnull NSString *)newDataTypeString + shape:(nullable CPTNumberArray *)shapeArray + dataOrder:(CPTDataOrder)order { return [[self alloc] initWithData:newData dataType:CPTDataTypeWithDataTypeString(newDataTypeString) @@ -224,10 +224,10 @@ +(instancetype)numericDataWithData:(NSData *)newData * @param order The data order for a multi-dimensional data array (row-major or column-major). * @return A new CPTNumericData instance. **/ -+(instancetype)numericDataWithArray:(NSArray *)newData - dataType:(CPTNumericDataType)newDataType - shape:(NSArray *)shapeArray - dataOrder:(CPTDataOrder)order ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData + dataType:(CPTNumericDataType)newDataType + shape:(nullable CPTNumberArray *)shapeArray + dataOrder:(CPTDataOrder)order { return [[self alloc] initWithArray:newData dataType:newDataType @@ -246,10 +246,10 @@ +(instancetype)numericDataWithArray:(NSArray *)newData * @param order The data order for a multi-dimensional data array (row-major or column-major). * @return A new CPTNumericData instance. **/ -+(instancetype)numericDataWithArray:(NSArray *)newData - dataTypeString:(NSString *)newDataTypeString - shape:(NSArray *)shapeArray - dataOrder:(CPTDataOrder)order ++(nonnull instancetype)numericDataWithArray:(nonnull CPTNumberArray *)newData + dataTypeString:(nonnull NSString *)newDataTypeString + shape:(nullable CPTNumberArray *)shapeArray + dataOrder:(CPTDataOrder)order { return [[self alloc] initWithArray:newData dataType:CPTDataTypeWithDataTypeString(newDataTypeString) @@ -266,9 +266,9 @@ +(instancetype)numericDataWithArray:(NSArray *)newData * @param shapeArray The shape of the data buffer array. Multi-dimensional data arrays will be assumed to be stored in #CPTDataOrderRowsFirst. * @return The initialized CPTNumericData instance. **/ --(instancetype)initWithData:(NSData *)newData - dataType:(CPTNumericDataType)newDataType - shape:(NSArray *)shapeArray +-(nonnull instancetype)initWithData:(nonnull NSData *)newData + dataType:(CPTNumericDataType)newDataType + shape:(nullable CPTNumberArray *)shapeArray { return [self initWithData:newData dataType:newDataType @@ -282,9 +282,9 @@ -(instancetype)initWithData:(NSData *)newData * @param shapeArray The shape of the data buffer array. Multi-dimensional data arrays will be assumed to be stored in #CPTDataOrderRowsFirst. * @return The initialized CPTNumericData instance. **/ --(id) initWithData:(NSData *)newData - dataTypeString:(NSString *)newDataTypeString - shape:(NSArray *)shapeArray +-(nonnull instancetype)initWithData:(nonnull NSData *)newData + dataTypeString:(nonnull NSString *)newDataTypeString + shape:(nullable CPTNumberArray *)shapeArray { return [self initWithData:newData dataType:CPTDataTypeWithDataTypeString(newDataTypeString) @@ -301,9 +301,9 @@ -(id) initWithData:(NSData *)newData * @param shapeArray The shape of the data buffer array. Multi-dimensional data arrays will be assumed to be stored in #CPTDataOrderRowsFirst. * @return The initialized CPTNumericData instance. **/ --(instancetype)initWithArray:(NSArray *)newData - dataType:(CPTNumericDataType)newDataType - shape:(NSArray *)shapeArray +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData + dataType:(CPTNumericDataType)newDataType + shape:(nullable CPTNumberArray *)shapeArray { return [self initWithData:[self dataFromArray:newData dataType:newDataType] dataType:newDataType @@ -320,9 +320,9 @@ -(instancetype)initWithArray:(NSArray *)newData * @param shapeArray The shape of the data buffer array. Multi-dimensional data arrays will be assumed to be stored in #CPTDataOrderRowsFirst. * @return The initialized CPTNumericData instance. **/ --(instancetype)initWithArray:(NSArray *)newData - dataTypeString:(NSString *)newDataTypeString - shape:(NSArray *)shapeArray +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData + dataTypeString:(nonnull NSString *)newDataTypeString + shape:(nullable CPTNumberArray *)shapeArray { return [self initWithArray:newData dataType:CPTDataTypeWithDataTypeString(newDataTypeString) @@ -336,12 +336,12 @@ -(instancetype)initWithArray:(NSArray *)newData * @param order The data order for a multi-dimensional data array (row-major or column-major). * @return The initialized CPTNumericData instance. **/ --(instancetype)initWithData:(NSData *)newData - dataType:(CPTNumericDataType)newDataType - shape:(NSArray *)shapeArray - dataOrder:(CPTDataOrder)order +-(nonnull instancetype)initWithData:(nonnull NSData *)newData + dataType:(CPTNumericDataType)newDataType + shape:(nullable CPTNumberArray *)shapeArray + dataOrder:(CPTDataOrder)order { - if ( (self = [super init]) ) { + if ((self = [super init])) { [self commonInitWithData:newData dataType:newDataType shape:shapeArray @@ -358,10 +358,10 @@ -(instancetype)initWithData:(NSData *)newData * @param order The data order for a multi-dimensional data array (row-major or column-major). * @return The initialized CPTNumericData instance. **/ --(id) initWithData:(NSData *)newData - dataTypeString:(NSString *)newDataTypeString - shape:(NSArray *)shapeArray - dataOrder:(CPTDataOrder)order +-(nonnull instancetype)initWithData:(nonnull NSData *)newData + dataTypeString:(nonnull NSString *)newDataTypeString + shape:(nullable CPTNumberArray *)shapeArray + dataOrder:(CPTDataOrder)order { return [self initWithData:newData dataType:CPTDataTypeWithDataTypeString(newDataTypeString) @@ -380,10 +380,10 @@ -(id) initWithData:(NSData *)newData * @param order The data order for a multi-dimensional data array (row-major or column-major). * @return The initialized CPTNumericData instance. **/ --(instancetype)initWithArray:(NSArray *)newData - dataType:(CPTNumericDataType)newDataType - shape:(NSArray *)shapeArray - dataOrder:(CPTDataOrder)order +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData + dataType:(CPTNumericDataType)newDataType + shape:(nullable CPTNumberArray *)shapeArray + dataOrder:(CPTDataOrder)order { return [self initWithData:[self dataFromArray:newData dataType:newDataType] dataType:newDataType @@ -402,10 +402,10 @@ -(instancetype)initWithArray:(NSArray *)newData * @param order The data order for a multi-dimensional data array (row-major or column-major). * @return The initialized CPTNumericData instance. **/ --(instancetype)initWithArray:(NSArray *)newData - dataTypeString:(NSString *)newDataTypeString - shape:(NSArray *)shapeArray - dataOrder:(CPTDataOrder)order +-(nonnull instancetype)initWithArray:(nonnull CPTNumberArray *)newData + dataTypeString:(nonnull NSString *)newDataTypeString + shape:(nullable CPTNumberArray *)shapeArray + dataOrder:(CPTDataOrder)order { return [self initWithArray:newData dataType:CPTDataTypeWithDataTypeString(newDataTypeString) @@ -415,31 +415,33 @@ -(instancetype)initWithArray:(NSArray *)newData /// @cond --(instancetype)init +-(nonnull instancetype)init { return [self initWithData:[NSData data] - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()) shape:nil]; } --(void)commonInitWithData:(NSData *)newData +-(void)commonInitWithData:(nonnull NSData *)newData dataType:(CPTNumericDataType)newDataType - shape:(NSArray *)shapeArray + shape:(nullable CPTNumberArray *)shapeArray dataOrder:(CPTDataOrder)order { - NSParameterAssert( CPTDataTypeIsSupported(newDataType) ); + NSParameterAssert(CPTDataTypeIsSupported(newDataType)); self.data = newData; self.dataType = newDataType; self.dataOrder = order; - if ( shapeArray == nil ) { + CPTNumberArray *theShape = shapeArray; + + if ( theShape == nil ) { self.shape = @[@(self.numberOfSamples)]; } else { NSUInteger prod = 1; - for ( NSNumber *cNum in shapeArray ) { - prod *= [cNum unsignedIntegerValue]; + for ( NSNumber *cNum in theShape ) { + prod *= cNum.unsignedIntegerValue; } if ( prod != self.numberOfSamples ) { @@ -447,7 +449,7 @@ -(void)commonInitWithData:(NSData *)newData format:@"Shape product (%lu) does not match data size (%lu)", (unsigned long)prod, (unsigned long)self.numberOfSamples]; } - self.shape = shapeArray; + self.shape = theShape; } } @@ -463,7 +465,7 @@ -(NSUInteger)numberOfDimensions return self.shape.count; } --(const void *)bytes +-(nonnull const void *)bytes { return self.data.bytes; } @@ -493,7 +495,7 @@ -(CFByteOrder)byteOrder return self.dataType.byteOrder; } --(void)setData:(NSData *)newData +-(void)setData:(nonnull NSData *)newData { if ( data != newData ) { if ( [self isKindOfClass:[CPTMutableNumericData class]] ) { @@ -509,21 +511,21 @@ -(void)setDataType:(CPTNumericDataType)newDataType { CPTNumericDataType oldDataType = dataType; - if ( CPTDataTypeEqualToDataType(oldDataType, newDataType) ) { + if ( CPTDataTypeEqualToDataType(oldDataType, newDataType)) { return; } - NSParameterAssert( CPTDataTypeIsSupported(newDataType) ); + NSParameterAssert(CPTDataTypeIsSupported(newDataType)); NSParameterAssert(newDataType.dataTypeFormat != CPTUndefinedDataType); NSParameterAssert(newDataType.byteOrder != CFByteOrderUnknown); dataType = newDataType; - if ( ( oldDataType.sampleBytes == sizeof(int8_t) ) && ( newDataType.sampleBytes == sizeof(int8_t) ) ) { + if ((oldDataType.sampleBytes == sizeof(int8_t)) && (newDataType.sampleBytes == sizeof(int8_t))) { return; } - if ( (oldDataType.dataTypeFormat != CPTUndefinedDataType) && (oldDataType.byteOrder != CFByteOrderUnknown) ) { + if ((oldDataType.dataTypeFormat != CPTUndefinedDataType) && (oldDataType.byteOrder != CFByteOrderUnknown)) { NSMutableData *myData = (NSMutableData *)self.data; CFByteOrder hostByteOrder = CFByteOrderGetCurrent(); @@ -549,7 +551,7 @@ -(void)setDataType:(CPTNumericDataType)newDataType } } --(void)setShape:(NSArray *)newShape +-(void)setShape:(nonnull CPTNumberArray *)newShape { if ( newShape != shape ) { shape = [newShape copy]; @@ -559,7 +561,7 @@ -(void)setShape:(NSArray *)newShape if ( [myData isKindOfClass:[NSMutableData class]] ) { NSUInteger sampleCount = 1; for ( NSNumber *num in shape ) { - sampleCount *= [num unsignedIntegerValue]; + sampleCount *= num.unsignedIntegerValue; } myData.length = sampleCount * self.sampleBytes; @@ -574,13 +576,13 @@ -(void)setShape:(NSArray *)newShape /** @brief Gets the offset of a given sample in the data buffer. * @param idx The zero-based indices into a multi-dimensional sample array. Each index should of type @ref NSUInteger and the number of indices - * (including @par{index}) should match the @ref numberOfDimensions. + * (including @par{idx}) should match the @ref numberOfDimensions. * @return The sample offset in the data buffer. To get the byte offset, multiply this value by * @ref sampleBytes. If any index is greater than or equal to the corresponding * dimension of the data buffer, this method returns @ref NSNotFound. **/ -(NSUInteger)sampleIndex:(NSUInteger)idx, ... - { +{ va_list indices; va_start(indices, idx); @@ -667,11 +669,11 @@ case sizeof(double): case CPTComplexFloatingPointDataType: switch ( self.sampleBytes ) { case sizeof(float complex): - result = @( crealf(*(const float complex *)[self samplePointer:sample]) ); + result = @(crealf(*(const float complex *)[self samplePointer:sample])); break; case sizeof(double complex): - result = @( creal(*(const double complex *)[self samplePointer:sample]) ); + result = @(creal(*(const double complex *)[self samplePointer:sample])); break; } break; @@ -694,14 +696,14 @@ case sizeof(NSDecimal): /** @brief Gets the value of a given sample in the data buffer. * @param idx The zero-based indices into a multi-dimensional sample array. Each index should of type @ref NSUInteger and the number of indices - * (including @par{index}) should match the @ref numberOfDimensions. + * (including @par{idx}) should match the @ref numberOfDimensions. * @return The sample value wrapped in an instance of NSNumber or @nil if any of the sample indices are out of bounds. * * @note NSNumber does not support complex numbers. Complex number types will be cast to * @float or @double before being wrapped in an instance of NSNumber. **/ -(NSNumber *)sampleValueAtIndex:(NSUInteger)idx, ... - { +{ NSUInteger newIndex; if ( self.numberOfDimensions > 1 ) { @@ -723,10 +725,10 @@ -(NSNumber *)sampleValueAtIndex:(NSUInteger)idx, ... * @param sample The zero-based index into the sample array. The array is treated as if it only has one dimension. * @return A pointer to the sample or @NULL if the sample index is out of bounds. **/ --(const void *)samplePointer:(NSUInteger)sample +-(nullable const void *)samplePointer:(NSUInteger)sample { if ( sample < self.numberOfSamples ) { - return (const void *)( (const char *)self.bytes + sample * self.sampleBytes ); + return (const void *)((const char *)self.bytes + sample * self.sampleBytes); } else { return NULL; @@ -735,11 +737,11 @@ -(const void *)samplePointer:(NSUInteger)sample /** @brief Gets a pointer to a given sample in the data buffer. * @param idx The zero-based indices into a multi-dimensional sample array. Each index should of type @ref NSUInteger and the number of indices - * (including @par{index}) should match the @ref numberOfDimensions. + * (including @par{idx}) should match the @ref numberOfDimensions. * @return A pointer to the sample or @NULL if any of the sample indices are out of bounds. **/ --(const void *)samplePointerAtIndex:(NSUInteger)idx, ... - { +-(nullable const void *)samplePointerAtIndex:(NSUInteger)idx, ... +{ NSUInteger newIndex; if ( self.numberOfDimensions > 1 ) { @@ -763,10 +765,11 @@ -(const void *)samplePointerAtIndex:(NSUInteger)idx, ... * @note NSNumber does not support complex numbers. Complex number types will be cast to * @float or @double before being wrapped in an instance of NSNumber. **/ --(NSArray *)sampleArray +-(nonnull CPTNumberArray *)sampleArray { - NSUInteger sampleCount = self.numberOfSamples; - NSMutableArray *samples = [[NSMutableArray alloc] initWithCapacity:sampleCount]; + NSUInteger sampleCount = self.numberOfSamples; + + CPTMutableNumberArray *samples = [[NSMutableArray alloc] initWithCapacity:sampleCount]; for ( NSUInteger i = 0; i < sampleCount; i++ ) { NSNumber *sampleValue = [self sampleValue:i]; @@ -775,7 +778,7 @@ -(NSArray *)sampleArray } } - NSArray *result = [NSArray arrayWithArray:samples]; + CPTNumberArray *result = [NSArray arrayWithArray:samples]; return result; } @@ -786,7 +789,7 @@ -(NSArray *)sampleArray * @brief Gets the offset of a given sample in the data buffer. This method does not call @par{va_end()} * on the @par{indexList}. * @param idx The zero-based indices into a multi-dimensional sample array. Each index should of type @ref NSUInteger and the number of indices - * (including @par{index}) should match the @ref numberOfDimensions. + * (including @par{idx}) should match the @ref numberOfDimensions. * @param indexList A @par{va_list} of the additional indices. * @return The sample offset in the data buffer. To get the byte offset, multiply this value by * @ref sampleBytes. If any index is greater than or equal to the corresponding @@ -794,14 +797,14 @@ -(NSArray *)sampleArray **/ -(NSUInteger)sampleIndex:(NSUInteger)idx indexList:(va_list)indexList { - NSArray *theShape = self.shape; - NSUInteger numDims = theShape.count; - NSUInteger newIndex = 0; + CPTNumberArray *theShape = self.shape; + NSUInteger numDims = theShape.count; + NSUInteger newIndex = 0; if ( numDims > 1 ) { - NSUInteger *dims = calloc( numDims, sizeof(NSUInteger) ); - NSUInteger *dimProducts = calloc( numDims, sizeof(NSUInteger) ); - NSUInteger *indices = calloc( numDims, sizeof(NSUInteger) ); + NSUInteger *dims = calloc(numDims, sizeof(NSUInteger)); + NSUInteger *dimProducts = calloc(numDims, sizeof(NSUInteger)); + NSUInteger *indices = calloc(numDims, sizeof(NSUInteger)); NSUInteger argIndex = 0; indices[0] = idx; @@ -809,7 +812,7 @@ -(NSUInteger)sampleIndex:(NSUInteger)idx indexList:(va_list)indexList if ( argIndex > 0 ) { indices[argIndex] = va_arg(indexList, NSUInteger); } - dims[argIndex] = [dim unsignedIntegerValue]; + dims[argIndex] = dim.unsignedIntegerValue; if ( indices[argIndex] >= dims[argIndex] ) { free(dims); @@ -860,9 +863,9 @@ -(NSUInteger)sampleIndex:(NSUInteger)idx indexList:(va_list)indexList return newIndex; } --(NSData *)dataFromArray:(NSArray *)newData dataType:(CPTNumericDataType)newDataType +-(nonnull NSData *)dataFromArray:(nonnull CPTNumberArray *)newData dataType:(CPTNumericDataType)newDataType { - NSParameterAssert( CPTDataTypeIsSupported(newDataType) ); + NSParameterAssert(CPTDataTypeIsSupported(newDataType)); NSParameterAssert(newDataType.dataTypeFormat != CPTUndefinedDataType); NSParameterAssert(newDataType.dataTypeFormat != CPTComplexFloatingPointDataType); @@ -1020,7 +1023,7 @@ case sizeof(double): *toBytes++ = (double)[sample doubleValue]; } else { - *toBytes++ = NAN; + *toBytes++ = (double)NAN; } } } @@ -1038,7 +1041,7 @@ case sizeof(float complex): *toBytes++ = (float complex)[sample floatValue]; } else { - *toBytes++ = NAN; + *toBytes++ = CMPLXF(NAN, NAN); } } } @@ -1052,7 +1055,7 @@ case sizeof(double complex): *toBytes++ = (double complex)[sample doubleValue]; } else { - *toBytes++ = NAN; + *toBytes++ = CMPLX(NAN, NAN); } } } @@ -1082,7 +1085,7 @@ case sizeof(NSDecimal): // End of code generated with "CPTNumericData+TypeConversions_Generation.py" // ======================================================================== - if ( ( newDataType.byteOrder != CFByteOrderGetCurrent() ) && (newDataType.byteOrder != CFByteOrderUnknown) ) { + if ((newDataType.byteOrder != CFByteOrderGetCurrent()) && (newDataType.byteOrder != CFByteOrderUnknown)) { [self swapByteOrderForData:sampleData sampleSize:newDataType.sampleBytes]; } @@ -1096,12 +1099,12 @@ case sizeof(NSDecimal): /// @cond --(NSString *)description +-(nonnull NSString *)description { NSUInteger sampleCount = self.numberOfSamples; NSMutableString *descriptionString = [NSMutableString stringWithCapacity:sampleCount * 3]; - [descriptionString appendFormat:@"<%@ [", [super description]]; + [descriptionString appendFormat:@"<%@ [", super.description]; for ( NSUInteger i = 0; i < sampleCount; i++ ) { if ( i > 0 ) { [descriptionString appendFormat:@","]; @@ -1123,7 +1126,7 @@ -(NSString *)description /// @cond --(id)mutableCopyWithZone:(NSZone *)zone +-(nonnull id)mutableCopyWithZone:(nullable NSZone *)zone { return [[CPTMutableNumericData allocWithZone:zone] initWithData:self.data dataType:self.dataType @@ -1134,11 +1137,11 @@ -(id)mutableCopyWithZone:(NSZone *)zone /// @endcond #pragma mark - -#pragma mark NSCoding Methods +#pragma mark NSCopying Methods /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { return [[[self class] allocWithZone:zone] initWithData:self.data dataType:self.dataType @@ -1149,36 +1152,21 @@ -(id)copyWithZone:(NSZone *)zone /// @endcond #pragma mark - -#pragma mark NSCopying Methods +#pragma mark NSCoding Methods /// @cond --(void)encodeWithCoder:(NSCoder *)encoder +-(void)encodeWithCoder:(nonnull NSCoder *)encoder { - if ( [encoder allowsKeyedCoding] ) { - [encoder encodeObject:self.data forKey:@"CPTNumericData.data"]; - - CPTNumericDataType selfDataType = self.dataType; - [encoder encodeInteger:selfDataType.dataTypeFormat forKey:@"CPTNumericData.dataType.dataTypeFormat"]; - [encoder encodeInt64:(int64_t)selfDataType.sampleBytes forKey:@"CPTNumericData.dataType.sampleBytes"]; - [encoder encodeInt64:selfDataType.byteOrder forKey:@"CPTNumericData.dataType.byteOrder"]; - - [encoder encodeObject:self.shape forKey:@"CPTNumericData.shape"]; - [encoder encodeInteger:self.dataOrder forKey:@"CPTNumericData.dataOrder"]; - } - else { - [encoder encodeObject:self.data]; + [encoder encodeObject:self.data forKey:@"CPTNumericData.data"]; - CPTNumericDataType selfDataType = self.dataType; - [encoder encodeValueOfObjCType:@encode(CPTDataTypeFormat) at:&(selfDataType.dataTypeFormat)]; - [encoder encodeValueOfObjCType:@encode(size_t) at:&(selfDataType.sampleBytes)]; - [encoder encodeValueOfObjCType:@encode(CFByteOrder) at:&(selfDataType.byteOrder)]; + CPTNumericDataType selfDataType = self.dataType; + [encoder encodeInteger:selfDataType.dataTypeFormat forKey:@"CPTNumericData.dataType.dataTypeFormat"]; + [encoder encodeInt64:(int64_t)selfDataType.sampleBytes forKey:@"CPTNumericData.dataType.sampleBytes"]; + [encoder encodeInt64:selfDataType.byteOrder forKey:@"CPTNumericData.dataType.byteOrder"]; - [encoder encodeObject:self.shape]; - - CPTDataOrder order = self.dataOrder; - [encoder encodeValueOfObjCType:@encode(CPTDataOrder) at:&order]; - } + [encoder encodeObject:self.shape forKey:@"CPTNumericData.shape"]; + [encoder encodeInteger:self.dataOrder forKey:@"CPTNumericData.dataOrder"]; } /// @endcond @@ -1187,34 +1175,25 @@ -(void)encodeWithCoder:(NSCoder *)encoder * @param decoder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)decoder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder { - if ( (self = [super init]) ) { + if ((self = [super init])) { NSData *newData; CPTNumericDataType newDataType; - NSArray *shapeArray; + CPTNumberArray *shapeArray; CPTDataOrder order; - if ( [decoder allowsKeyedCoding] ) { - newData = [decoder decodeObjectForKey:@"CPTNumericData.data"]; - - newDataType = CPTDataType( (CPTDataTypeFormat)[decoder decodeIntegerForKey: @"CPTNumericData.dataType.dataTypeFormat"], - (size_t)[decoder decodeInt64ForKey: @"CPTNumericData.dataType.sampleBytes"], - (CFByteOrder)[decoder decodeInt64ForKey: @"CPTNumericData.dataType.byteOrder"] ); + newData = [decoder decodeObjectOfClass:[NSData class] + forKey:@"CPTNumericData.data"]; - shapeArray = [decoder decodeObjectForKey:@"CPTNumericData.shape"]; - order = (CPTDataOrder)[decoder decodeIntegerForKey : @"CPTNumericData.dataOrder"]; - } - else { - newData = [decoder decodeObject]; + newDataType = CPTDataType((CPTDataTypeFormat)[decoder decodeIntegerForKey:@"CPTNumericData.dataType.dataTypeFormat"], + (size_t)[decoder decodeInt64ForKey:@"CPTNumericData.dataType.sampleBytes"], + (CFByteOrder)[decoder decodeInt64ForKey:@"CPTNumericData.dataType.byteOrder"]); - [decoder decodeValueOfObjCType:@encode(CPTDataTypeFormat) at:&(newDataType.dataTypeFormat)]; - [decoder decodeValueOfObjCType:@encode(size_t) at:&(newDataType.sampleBytes)]; - [decoder decodeValueOfObjCType:@encode(CFByteOrder) at:&(newDataType.byteOrder)]; + shapeArray = [decoder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTNumericData.shape"]; - shapeArray = [decoder decodeObject]; - [decoder decodeValueOfObjCType:@encode(CPTDataOrder) at:&order]; - } + order = (CPTDataOrder)[decoder decodeIntegerForKey:@"CPTNumericData.dataOrder"]; [self commonInitWithData:newData dataType:newDataType shape:shapeArray dataOrder:order]; } @@ -1222,4 +1201,16 @@ -(instancetype)initWithCoder:(NSCoder *)decoder return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/CPTNumericDataTests.m b/framework/Source/CPTNumericDataTests.m index 8adea3ebd..26e0ca4c6 100644 --- a/framework/Source/CPTNumericDataTests.m +++ b/framework/Source/CPTNumericDataTests.m @@ -15,7 +15,7 @@ -(void)testNilShapeGivesSingleDimension NSUInteger expected = 1; XCTAssertEqual(actual, expected, @"numberOfDimensions == 1"); - expected = [nd.shape count]; + expected = nd.shape.count; XCTAssertEqual(actual, expected, @"numberOfDimensions == 1"); } @@ -27,7 +27,7 @@ -(void)testNumberOfDimensionsGivesShapeCount NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:shape]; XCTAssertEqual(nd.numberOfDimensions, nd.shape.count, @"numberOfDimensions == shape.count == 3"); @@ -46,7 +46,7 @@ -(void)testNilShapeCorrectElementCount NSUInteger prod = 1; for ( NSNumber *num in nd.shape ) { - prod *= [num unsignedIntValue]; + prod *= num.unsignedIntegerValue; } XCTAssertEqual(prod, nElems, @"prod == nElems"); @@ -63,7 +63,7 @@ -(void)testIllegalShapeRaisesException NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(NSUInteger)]; XCTAssertThrowsSpecificNamed(testData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTUnsignedIntegerDataType, sizeof(NSUInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTUnsignedIntegerDataType, sizeof(NSUInteger), NSHostByteOrder()) shape:shape], NSException, CPTNumericDataException, @@ -78,7 +78,7 @@ -(void)testReturnsDataLength shape:nil]; NSUInteger expected = 10 * sizeof(float); - NSUInteger actual = [nd.data length]; + NSUInteger actual = nd.data.length; XCTAssertEqual(expected, actual, @"data length"); } @@ -87,14 +87,14 @@ -(void)testBytesEqualDataBytes { NSUInteger nElements = 10; NSMutableData *data = [NSMutableData dataWithLength:nElements * sizeof(NSInteger)]; - NSInteger *intData = (NSInteger *)[data mutableBytes]; + NSInteger *intData = (NSInteger *)data.mutableBytes; for ( NSUInteger i = 0; i < nElements; i++ ) { intData[i] = (NSInteger)i; } CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder()) shape:nil]; NSData *expected = data; @@ -106,17 +106,17 @@ -(void)testArchivingRoundTrip { NSUInteger nElems = 10; NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < nElems; i++ ) { samples[i] = sinf(i); } CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; - CPTNumericData *nd2 = [NSUnarchiver unarchiveObjectWithData:[NSArchiver archivedDataWithRootObject:nd]]; + CPTNumericData *nd2 = [self archiveRoundTrip:nd]; XCTAssertTrue([nd.data isEqualToData:nd2.data], @"equal data"); @@ -133,17 +133,17 @@ -(void)testKeyedArchivingRoundTrip { NSUInteger nElems = 10; NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < nElems; i++ ) { samples[i] = sinf(i); } CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; - CPTNumericData *nd2 = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:nd]]; + CPTNumericData *nd2 = [self archiveRoundTrip:nd]; XCTAssertTrue([nd.data isEqualToData:nd2.data], @"equal data"); @@ -160,27 +160,27 @@ -(void)testNumberOfSamplesCorrectForDataType { NSUInteger nElems = 10; NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < nElems; i++ ) { samples[i] = sinf(i); } CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; XCTAssertEqual([nd numberOfSamples], nElems, @"numberOfSamples == nElems"); nElems = 10; data = [NSMutableData dataWithLength:nElems * sizeof(char)]; - char *charSamples = (char *)[data mutableBytes]; + char *charSamples = (char *)data.mutableBytes; for ( NSUInteger i = 0; i < nElems; i++ ) { charSamples[i] = (char)lrint(sin(i) * 100.0); } nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(char), NSHostByteOrder() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(char), NSHostByteOrder()) shape:nil]; XCTAssertEqual([nd numberOfSamples], nElems, @"numberOfSamples == nElems"); @@ -190,14 +190,14 @@ -(void)testDataTypeAccessorsCorrectForDataType { NSUInteger nElems = 10; NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < nElems; i++ ) { samples[i] = sinf(i); } CPTNumericData *nd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; XCTAssertEqual([nd dataTypeFormat], CPTFloatingPointDataType, @"dataTypeFormat"); @@ -209,23 +209,23 @@ -(void)testConvertTypeConvertsType { NSUInteger numberOfSamples = 10; NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = sinf(i); } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; CPTNumericData *dd = [fd dataByConvertingToType:CPTFloatingPointDataType sampleBytes:sizeof(double) byteOrder:NSHostByteOrder()]; - const double *doubleSamples = (const double *)[dd.data bytes]; + const double *doubleSamples = (const double *)dd.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertTrue(samples[i] == doubleSamples[i], @"(float)%g != (double)%g", samples[i], doubleSamples[i]); + XCTAssertTrue((double)samples[i] == doubleSamples[i], @"(float)%g != (double)%g", (double)samples[i], doubleSamples[i]); } } @@ -233,19 +233,19 @@ -(void)testSamplePointerCorrect { NSUInteger nElems = 10; NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < nElems; i++ ) { samples[i] = sinf(i); } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; - XCTAssertEqual( ( (const float *)[fd.data bytes] ) + 4, (const float *)[fd samplePointer:4], @"%p,%p", samples + 4, (const float *)[fd samplePointer:4] ); - XCTAssertEqual( ( (const float *)[fd.data bytes] ), (const float *)[fd samplePointer:0], @"" ); - XCTAssertEqual( ( (const float *)[fd.data bytes] ) + nElems - 1, (const float *)[fd samplePointer:nElems - 1], @"" ); + XCTAssertEqual(((const float *)[fd.data bytes]) + 4, (const float *)[fd samplePointer:4], @"%p,%p", samples + 4, (const float *)[fd samplePointer:4]); + XCTAssertEqual(((const float *)[fd.data bytes]), (const float *)[fd samplePointer:0], @""); + XCTAssertEqual(((const float *)[fd.data bytes]) + nElems - 1, (const float *)[fd samplePointer:nElems - 1], @""); XCTAssertNil([fd samplePointer:nElems], @"too many samples"); } @@ -253,14 +253,14 @@ -(void)testSampleValueCorrect { NSUInteger nElems = 10; NSMutableData *data = [NSMutableData dataWithLength:nElems * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < nElems; i++ ) { samples[i] = sinf(i); } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; XCTAssertEqualWithAccuracy([[fd sampleValue:0] doubleValue], sin(0), 0.01, @"sample value"); @@ -273,23 +273,23 @@ -(void)testSampleIndexRowsFirstOrder const NSUInteger cols = 4; NSMutableData *data = [NSMutableData dataWithLength:rows * cols * sizeof(NSUInteger)]; - NSUInteger *samples = (NSUInteger *)[data mutableBytes]; + NSUInteger *samples = (NSUInteger *)data.mutableBytes; for ( NSUInteger i = 0; i < rows * cols; i++ ) { samples[i] = i; } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(NSUInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(NSUInteger), NSHostByteOrder()) shape:@[@(rows), @(cols)] dataOrder:CPTDataOrderRowsFirst]; - XCTAssertEqual( ([fd sampleIndex:rows, 0]), (NSUInteger)NSNotFound, @"row index out of range" ); - XCTAssertEqual( ([fd sampleIndex:0, cols]), (NSUInteger)NSNotFound, @"column index out of range" ); + XCTAssertEqual(([fd sampleIndex:rows, 0]), (NSUInteger)NSNotFound, @"row index out of range"); + XCTAssertEqual(([fd sampleIndex:0, cols]), (NSUInteger)NSNotFound, @"column index out of range"); for ( NSUInteger i = 0; i < rows; i++ ) { for ( NSUInteger j = 0; j < cols; j++ ) { - XCTAssertEqual( ([fd sampleIndex:i, j]), i * cols + j, @"(%lu, %lu)", (unsigned long)i, (unsigned long)j ); + XCTAssertEqual(([fd sampleIndex:i, j]), i * cols + j, @"(%lu, %lu)", (unsigned long)i, (unsigned long)j); } } } @@ -300,23 +300,23 @@ -(void)testSampleIndexColumnsFirstOrder const NSUInteger cols = 4; NSMutableData *data = [NSMutableData dataWithLength:rows * cols * sizeof(NSUInteger)]; - NSUInteger *samples = (NSUInteger *)[data mutableBytes]; + NSUInteger *samples = (NSUInteger *)data.mutableBytes; for ( NSUInteger i = 0; i < rows * cols; i++ ) { samples[i] = i; } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(NSUInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(NSUInteger), NSHostByteOrder()) shape:@[@(rows), @(cols)] dataOrder:CPTDataOrderColumnsFirst]; - XCTAssertEqual( ([fd sampleIndex:rows, 0]), (NSUInteger)NSNotFound, @"row index out of range" ); - XCTAssertEqual( ([fd sampleIndex:0, cols]), (NSUInteger)NSNotFound, @"column index out of range" ); + XCTAssertEqual(([fd sampleIndex:rows, 0]), (NSUInteger)NSNotFound, @"row index out of range"); + XCTAssertEqual(([fd sampleIndex:0, cols]), (NSUInteger)NSNotFound, @"column index out of range"); for ( NSUInteger i = 0; i < rows; i++ ) { for ( NSUInteger j = 0; j < cols; j++ ) { - XCTAssertEqual( ([fd sampleIndex:i, j]), i + j * rows, @"(%lu, %lu)", (unsigned long)i, (unsigned long)j ); + XCTAssertEqual(([fd sampleIndex:i, j]), i + j * rows, @"(%lu, %lu)", (unsigned long)i, (unsigned long)j); } } } diff --git a/framework/Source/CPTNumericDataType.h b/framework/Source/CPTNumericDataType.h index e074342e2..0898f7b60 100644 --- a/framework/Source/CPTNumericDataType.h +++ b/framework/Source/CPTNumericDataType.h @@ -16,7 +16,7 @@ typedef NS_ENUM (NSInteger, CPTDataTypeFormat) { * @brief Enumeration of memory arrangements for multi-dimensional data arrays. * @see See Wikipedia for more information. **/ -typedef NS_ENUM (NSInteger, CPTDataOrder) { +typedef NS_CLOSED_ENUM(NSInteger, CPTDataOrder) { CPTDataOrderRowsFirst, ///< Numeric data is arranged in row-major order. CPTDataOrderColumnsFirst ///< Numeric data is arranged in column-major order. }; @@ -26,8 +26,8 @@ typedef NS_ENUM (NSInteger, CPTDataOrder) { **/ typedef struct _CPTNumericDataType { CPTDataTypeFormat dataTypeFormat; ///< Data type format - size_t sampleBytes; ///< Number of bytes in each sample - CFByteOrder byteOrder; ///< Byte order + size_t sampleBytes; ///< Number of bytes in each sample + CFByteOrder byteOrder; ///< Byte order } CPTNumericDataType; @@ -38,8 +38,8 @@ extern "C" { /// @name Data Type Utilities /// @{ CPTNumericDataType CPTDataType(CPTDataTypeFormat format, size_t sampleBytes, CFByteOrder byteOrder); -CPTNumericDataType CPTDataTypeWithDataTypeString(NSString *dataTypeString); -NSString *CPTDataTypeStringFromDataType(CPTNumericDataType dataType); +CPTNumericDataType CPTDataTypeWithDataTypeString(NSString *__nonnull dataTypeString); +NSString *__nonnull CPTDataTypeStringFromDataType(CPTNumericDataType dataType); BOOL CPTDataTypeIsSupported(CPTNumericDataType format); BOOL CPTDataTypeEqualToDataType(CPTNumericDataType dataType1, CPTNumericDataType dataType2); diff --git a/framework/Source/CPTNumericDataType.m b/framework/Source/CPTNumericDataType.m index 4ea9e4171..af098066e 100644 --- a/framework/Source/CPTNumericDataType.m +++ b/framework/Source/CPTNumericDataType.m @@ -2,9 +2,9 @@ #import "complex.h" -static CPTDataTypeFormat DataTypeForDataTypeString(NSString *dataTypeString); -static size_t SampleBytesForDataTypeString(NSString *dataTypeString); -static CFByteOrder ByteOrderForDataTypeString(NSString *dataTypeString); +static CPTDataTypeFormat DataTypeForDataTypeString(NSString *__nonnull dataTypeString); +static size_t SampleBytesForDataTypeString(NSString *__nonnull dataTypeString); +static CFByteOrder ByteOrderForDataTypeString(NSString *__nonnull dataTypeString); #pragma mark - #pragma mark Data type utilities @@ -30,7 +30,7 @@ CPTNumericDataType CPTDataType(CPTDataTypeFormat format, size_t sampleBytes, CFB * @param dataTypeString The data type string. * @return The initialized CPTNumericDataType struct. **/ -CPTNumericDataType CPTDataTypeWithDataTypeString(NSString *dataTypeString) +CPTNumericDataType CPTDataTypeWithDataTypeString(NSString *__nonnull dataTypeString) { CPTNumericDataType type; @@ -161,14 +161,14 @@ case sizeof(double): case sizeof(float complex): case sizeof(double complex): // only the native byte order is supported - valid = ( format.byteOrder == CFByteOrderGetCurrent() ); + valid = (format.byteOrder == CFByteOrderGetCurrent()); break; } break; case CPTDecimalDataType: // only the native byte order is supported - valid = ( format.sampleBytes == sizeof(NSDecimal) ) && ( format.byteOrder == CFByteOrderGetCurrent() ); + valid = (format.sampleBytes == sizeof(NSDecimal)) && (format.byteOrder == CFByteOrderGetCurrent()); break; } @@ -193,7 +193,7 @@ BOOL CPTDataTypeEqualToDataType(CPTNumericDataType dataType1, CPTNumericDataType #pragma mark - #pragma mark Private functions -CPTDataTypeFormat DataTypeForDataTypeString(NSString *dataTypeString) +CPTDataTypeFormat DataTypeForDataTypeString(NSString *__nonnull dataTypeString) { CPTDataTypeFormat result = CPTUndefinedDataType; @@ -202,7 +202,7 @@ CPTDataTypeFormat DataTypeForDataTypeString(NSString *dataTypeString) NSCAssert([dataTypeString length] >= 3, @"dataTypeString is too short"); #pragma clang diagnostic pop - switch ( [[dataTypeString lowercaseString] characterAtIndex:1] ) { + switch ( [dataTypeString.lowercaseString characterAtIndex:1] ) { case 'f': result = CPTFloatingPointDataType; break; @@ -231,19 +231,19 @@ CPTDataTypeFormat DataTypeForDataTypeString(NSString *dataTypeString) return result; } -size_t SampleBytesForDataTypeString(NSString *dataTypeString) +size_t SampleBytesForDataTypeString(NSString *__nonnull dataTypeString) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnullable-to-nonnull-conversion" NSCAssert([dataTypeString length] >= 3, @"dataTypeString is too short"); - NSInteger result = [[dataTypeString substringFromIndex:2] integerValue]; + NSInteger result = [dataTypeString substringFromIndex:2].integerValue; NSCAssert(result > 0, @"sample bytes is negative."); #pragma clang diagnostic pop return (size_t)result; } -CFByteOrder ByteOrderForDataTypeString(NSString *dataTypeString) +CFByteOrder ByteOrderForDataTypeString(NSString *__nonnull dataTypeString) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnullable-to-nonnull-conversion" @@ -252,7 +252,7 @@ CFByteOrder ByteOrderForDataTypeString(NSString *dataTypeString) CFByteOrder result = CFByteOrderUnknown; - switch ( [[dataTypeString lowercaseString] characterAtIndex:0] ) { + switch ( [dataTypeString.lowercaseString characterAtIndex:0] ) { case '=': result = CFByteOrderGetCurrent(); break; diff --git a/framework/Source/CPTNumericDataTypeConversionPerformanceTests.m b/framework/Source/CPTNumericDataTypeConversionPerformanceTests.m index e30e9214a..431999fcf 100644 --- a/framework/Source/CPTNumericDataTypeConversionPerformanceTests.m +++ b/framework/Source/CPTNumericDataTypeConversionPerformanceTests.m @@ -17,7 +17,7 @@ -(void)testFloatToDoubleConversion } CPTNumericData *floatNumericData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), CFByteOrderGetCurrent()) shape:nil]; __block CPTNumericData *doubleNumericData = nil; @@ -37,7 +37,7 @@ -(void)testDoubleToFloatConversion } CPTNumericData *doubleNumericData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()) shape:nil]; __block CPTNumericData *floatNumericData = nil; @@ -57,7 +57,7 @@ -(void)testIntegerToDoubleConversion } CPTNumericData *integerNumericData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(NSInteger), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(NSInteger), CFByteOrderGetCurrent()) shape:nil]; __block CPTNumericData *doubleNumericData = nil; @@ -77,7 +77,7 @@ -(void)testDoubleToIntegerConversion } CPTNumericData *doubleNumericData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()) shape:nil]; __block CPTNumericData *integerNumericData = nil; diff --git a/framework/Source/CPTNumericDataTypeConversionTests.m b/framework/Source/CPTNumericDataTypeConversionTests.m index 175737640..8fc215339 100644 --- a/framework/Source/CPTNumericDataTypeConversionTests.m +++ b/framework/Source/CPTNumericDataTypeConversionTests.m @@ -11,92 +11,92 @@ @implementation CPTNumericDataTypeConversionTests -(void)testFloatToDoubleConversion { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = sinf(i); } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; CPTNumericData *dd = [fd dataByConvertingToType:CPTFloatingPointDataType sampleBytes:sizeof(double) byteOrder:NSHostByteOrder()]; - const double *doubleSamples = (const double *)[dd.data bytes]; + const double *doubleSamples = (const double *)dd.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy( (double)samples[i], doubleSamples[i], precision, @"(float)%g != (double)%g", samples[i], doubleSamples[i] ); + XCTAssertEqualWithAccuracy((double)samples[i], doubleSamples[i], precision, @"(float)%g != (double)%g", (double)samples[i], doubleSamples[i]); } } -(void)testDoubleToFloatConversion { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(double)]; - double *samples = (double *)[data mutableBytes]; + double *samples = (double *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = sin(i); } CPTNumericData *dd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()) shape:nil]; CPTNumericData *fd = [dd dataByConvertingToType:CPTFloatingPointDataType sampleBytes:sizeof(float) byteOrder:NSHostByteOrder()]; - const float *floatSamples = (const float *)[fd.data bytes]; + const float *floatSamples = (const float *)fd.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy( (double)floatSamples[i], samples[i], precision, @"(float)%g != (double)%g", floatSamples[i], samples[i] ); + XCTAssertEqualWithAccuracy((double)floatSamples[i], samples[i], precision, @"(float)%g != (double)%g", (double)floatSamples[i], samples[i]); } } -(void)testFloatToIntegerConversion { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(float)]; - float *samples = (float *)[data mutableBytes]; + float *samples = (float *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = sinf(i) * 1000.0f; } CPTNumericData *fd = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(float), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(float), NSHostByteOrder()) shape:nil]; CPTNumericData *intData = [fd dataByConvertingToType:CPTIntegerDataType sampleBytes:sizeof(NSInteger) byteOrder:NSHostByteOrder()]; - const NSInteger *intSamples = (const NSInteger *)[intData.data bytes]; + const NSInteger *intSamples = (const NSInteger *)intData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy( (NSInteger)samples[i], intSamples[i], precision, @"(float)%g != (NSInteger)%ld", samples[i], (long)intSamples[i] ); + XCTAssertEqualWithAccuracy((NSInteger)samples[i], intSamples[i], precision, @"(float)%g != (NSInteger)%ld", (double)samples[i], (long)intSamples[i]); } } -(void)testIntegerToFloatConversion { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(NSInteger)]; - NSInteger *samples = (NSInteger *)[data mutableBytes]; + NSInteger *samples = (NSInteger *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = (NSInteger)(sin(i) * 1000.0); } CPTNumericData *intData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder() ) + dataType:CPTDataType(CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder()) shape:nil]; CPTNumericData *fd = [intData dataByConvertingToType:CPTFloatingPointDataType sampleBytes:sizeof(float) byteOrder:NSHostByteOrder()]; - const float *floatSamples = (const float *)[fd.data bytes]; + const float *floatSamples = (const float *)fd.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertEqualWithAccuracy(floatSamples[i], (float)samples[i], precision, @"(float)%g != (NSInteger)%ld", floatSamples[i], (long)samples[i]); + XCTAssertEqualWithAccuracy(floatSamples[i], (float)samples[i], (float)precision, @"(float)%g != (NSInteger)%ld", (double)floatSamples[i], (long)samples[i]); } } @@ -133,21 +133,21 @@ -(void)testTypeConversionSwapsByteOrderInteger -(void)testDecimalToDoubleConversion { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(NSDecimal)]; - NSDecimal *samples = (NSDecimal *)[data mutableBytes]; + NSDecimal *samples = (NSDecimal *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - samples[i] = CPTDecimalFromDouble( sin(i) ); + samples[i] = CPTDecimalFromDouble(sin(i)); } CPTNumericData *decimalData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder() ) + dataType:CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder()) shape:nil]; CPTNumericData *doubleData = [decimalData dataByConvertingToType:CPTFloatingPointDataType sampleBytes:sizeof(double) byteOrder:NSHostByteOrder()]; - const double *doubleSamples = (const double *)[doubleData.data bytes]; + const double *doubleSamples = (const double *)doubleData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { XCTAssertEqual(CPTDecimalDoubleValue(samples[i]), doubleSamples[i], @"(NSDecimal)%@ != (double)%g", CPTDecimalStringValue(samples[i]), doubleSamples[i]); } @@ -156,23 +156,23 @@ -(void)testDecimalToDoubleConversion -(void)testDoubleToDecimalConversion { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(double)]; - double *samples = (double *)[data mutableBytes]; + double *samples = (double *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = sin(i); } CPTNumericData *doubleData = [[CPTNumericData alloc] initWithData:data - dataType:CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ) + dataType:CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()) shape:nil]; CPTNumericData *decimalData = [doubleData dataByConvertingToType:CPTDecimalDataType sampleBytes:sizeof(NSDecimal) byteOrder:NSHostByteOrder()]; - const NSDecimal *decimalSamples = (const NSDecimal *)[decimalData.data bytes]; + const NSDecimal *decimalSamples = (const NSDecimal *)decimalData.data.bytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - XCTAssertTrue(CPTDecimalEquals( decimalSamples[i], CPTDecimalFromDouble(samples[i]) ), @"(NSDecimal)%@ != (double)%g", CPTDecimalStringValue(decimalSamples[i]), samples[i]); + XCTAssertTrue(CPTDecimalEquals(decimalSamples[i], CPTDecimalFromDouble(samples[i])), @"(NSDecimal)%@ != (double)%g", CPTDecimalStringValue(decimalSamples[i]), samples[i]); } } @@ -196,7 +196,7 @@ -(void)testTypeConversionSwapsByteOrderDouble uint64_t end = *(const uint64_t *)swappedData.bytes; union swap { - double v; + double v; CFSwappedFloat64 sv; } result; @@ -215,18 +215,18 @@ -(void)testTypeConversionSwapsByteOrderDouble -(void)testRoundTripToDoubleArray { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(double)]; - double *samples = (double *)[data mutableBytes]; + double *samples = (double *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = sin(i); } - CPTNumericDataType theDataType = CPTDataType( CPTFloatingPointDataType, sizeof(double), NSHostByteOrder() ); + CPTNumericDataType theDataType = CPTDataType(CPTFloatingPointDataType, sizeof(double), NSHostByteOrder()); CPTNumericData *doubleData = [[CPTNumericData alloc] initWithData:data dataType:theDataType shape:nil]; - NSArray *doubleArray = [doubleData sampleArray]; + CPTNumberArray *doubleArray = [doubleData sampleArray]; XCTAssertEqual(doubleArray.count, numberOfSamples, @"doubleArray size"); CPTNumericData *roundTripData = [[CPTNumericData alloc] initWithArray:doubleArray @@ -243,18 +243,18 @@ -(void)testRoundTripToDoubleArray -(void)testRoundTripToIntegerArray { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(NSInteger)]; - NSInteger *samples = (NSInteger *)[data mutableBytes]; + NSInteger *samples = (NSInteger *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { samples[i] = (NSInteger)(sin(i) * 1000.0); } - CPTNumericDataType theDataType = CPTDataType( CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder() ); + CPTNumericDataType theDataType = CPTDataType(CPTIntegerDataType, sizeof(NSInteger), NSHostByteOrder()); CPTNumericData *intData = [[CPTNumericData alloc] initWithData:data dataType:theDataType shape:nil]; - NSArray *integerArray = [intData sampleArray]; + CPTNumberArray *integerArray = [intData sampleArray]; XCTAssertEqual(integerArray.count, numberOfSamples, @"integerArray size"); CPTNumericData *roundTripData = [[CPTNumericData alloc] initWithArray:integerArray @@ -271,18 +271,18 @@ -(void)testRoundTripToIntegerArray -(void)testRoundTripToDecimalArray { NSMutableData *data = [NSMutableData dataWithLength:numberOfSamples * sizeof(NSDecimal)]; - NSDecimal *samples = (NSDecimal *)[data mutableBytes]; + NSDecimal *samples = (NSDecimal *)data.mutableBytes; for ( NSUInteger i = 0; i < numberOfSamples; i++ ) { - samples[i] = CPTDecimalFromDouble( sin(i) ); + samples[i] = CPTDecimalFromDouble(sin(i)); } - CPTNumericDataType theDataType = CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder() ); + CPTNumericDataType theDataType = CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), NSHostByteOrder()); CPTNumericData *decimalData = [[CPTNumericData alloc] initWithData:data dataType:theDataType shape:nil]; - NSArray *decimalArray = [decimalData sampleArray]; + CPTNumberArray *decimalArray = [decimalData sampleArray]; XCTAssertEqual(decimalArray.count, numberOfSamples, @"doubleArray size"); CPTNumericData *roundTripData = [[CPTNumericData alloc] initWithArray:decimalArray diff --git a/framework/Source/CPTPathExtensions.h b/framework/Source/CPTPathExtensions.h index 7704df7a6..c47bfcf5a 100644 --- a/framework/Source/CPTPathExtensions.h +++ b/framework/Source/CPTPathExtensions.h @@ -4,8 +4,13 @@ extern "C" { #endif -CGPathRef CPTCreateRoundedRectPath(CGRect rect, CGFloat cornerRadius); -void CPTAddRoundedRectPath(CGContextRef context, CGRect rect, CGFloat cornerRadius); +CF_IMPLICIT_BRIDGING_ENABLED + +__nonnull CGPathRef CPTCreateRoundedRectPath(CGRect rect, CGFloat cornerRadius); + +CF_IMPLICIT_BRIDGING_DISABLED + +void CPTAddRoundedRectPath(__nonnull CGContextRef context, CGRect rect, CGFloat cornerRadius); #if __cplusplus } diff --git a/framework/Source/CPTPathExtensions.m b/framework/Source/CPTPathExtensions.m index d2f9bed3c..fbd20d904 100644 --- a/framework/Source/CPTPathExtensions.m +++ b/framework/Source/CPTPathExtensions.m @@ -8,12 +8,12 @@ * @param cornerRadius The radius of the rounded corners. * @return The new path. Caller is responsible for releasing this. **/ -CGPathRef CPTCreateRoundedRectPath(CGRect rect, CGFloat cornerRadius) +__nonnull CGPathRef CPTCreateRoundedRectPath(CGRect rect, CGFloat cornerRadius) { - if ( cornerRadius > CPTFloat(0.0) ) { - cornerRadius = MIN( MIN( cornerRadius, rect.size.width * CPTFloat(0.5) ), rect.size.height * CPTFloat(0.5) ); + if ( cornerRadius > CPTFloat(0.0)) { + cornerRadius = MIN(MIN(cornerRadius, rect.size.width * CPTFloat(0.5)), rect.size.height * CPTFloat(0.5)); - // CGPathCreateWithRoundedRect() is available in Mac OS X 10.9 and iOS 7 but not marked in the header file + // CGPathCreateWithRoundedRect() is available in macOS 10.9 and iOS 7 but not marked in the header file #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunreachable-code" #pragma clang diagnostic ignored "-Wpointer-bool-conversion" @@ -52,7 +52,7 @@ CGPathRef CPTCreateRoundedRectPath(CGRect rect, CGFloat cornerRadius) * @param rect The bounding rectangle for the path. * @param cornerRadius The radius of the rounded corners. **/ -void CPTAddRoundedRectPath(CGContextRef context, CGRect rect, CGFloat cornerRadius) +void CPTAddRoundedRectPath(__nonnull CGContextRef context, CGRect rect, CGFloat cornerRadius) { CGPathRef path = CPTCreateRoundedRectPath(rect, cornerRadius); diff --git a/framework/Source/CPTPieChart.h b/framework/Source/CPTPieChart.h index 3c4e9fea3..3d568bb59 100644 --- a/framework/Source/CPTPieChart.h +++ b/framework/Source/CPTPieChart.h @@ -1,19 +1,24 @@ #import "CPTDefinitions.h" +#import "CPTFill.h" #import "CPTPlot.h" /// @file @class CPTColor; -@class CPTFill; @class CPTPieChart; @class CPTTextLayer; @class CPTLineStyle; +/** + * @brief Pie chart bindings. + **/ +typedef NSString *CPTPieChartBinding cpt_swift_struct; + /// @ingroup plotBindingsPieChart /// @{ -extern NSString *const CPTPieChartBindingPieSliceWidthValues; -extern NSString *const CPTPieChartBindingPieSliceFills; -extern NSString *const CPTPieChartBindingPieSliceRadialOffsets; +extern CPTPieChartBinding __nonnull const CPTPieChartBindingPieSliceWidthValues; +extern CPTPieChartBinding __nonnull const CPTPieChartBindingPieSliceFills; +extern CPTPieChartBinding __nonnull const CPTPieChartBindingPieSliceRadialOffsets; /// @} /** @@ -28,7 +33,7 @@ typedef NS_ENUM (NSInteger, CPTPieChartField) { /** * @brief Enumeration of pie slice drawing directions. **/ -typedef NS_ENUM (NSInteger, CPTPieDirection) { +typedef NS_CLOSED_ENUM(NSInteger, CPTPieDirection) { CPTPieDirectionClockwise, ///< Pie slices are drawn in a clockwise direction. CPTPieDirectionCounterClockwise ///< Pie slices are drawn in a counter-clockwise direction. }; @@ -49,7 +54,7 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { * @param indexRange The range of the data indexes of interest. * @return An array of pie slice fills. **/ --(NSArray *)sliceFillsForPieChart:(CPTPieChart *)pieChart recordIndexRange:(NSRange)indexRange; +-(nullable CPTFillArray *)sliceFillsForPieChart:(nonnull CPTPieChart *)pieChart recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a fill for the given pie chart slice. * This method will not be called if @@ -60,7 +65,7 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { * @return The pie slice fill for the slice with the given index. If the datasource returns @nil, the default fill is used. * If the data source returns an NSNull object, no fill is drawn. **/ --(CPTFill *)sliceFillForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)idx; +-(nullable CPTFill *)sliceFillForPieChart:(nonnull CPTPieChart *)pieChart recordIndex:(NSUInteger)idx; /// @} @@ -72,7 +77,7 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { * @param indexRange The range of the data indexes of interest. * @return An array of radial offsets. **/ --(NSArray *)radialOffsetsForPieChart:(CPTPieChart *)pieChart recordIndexRange:(NSRange)indexRange; +-(nullable CPTNumberArray *)radialOffsetsForPieChart:(nonnull CPTPieChart *)pieChart recordIndexRange:(NSRange)indexRange; /** @brief @optional Offsets the slice radially from the center point. Can be used to @quote{explode} the chart. * This method will not be called if @@ -82,7 +87,7 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { * @param idx The data index of interest. * @return The radial offset in view coordinates. Zero is no offset. **/ --(CGFloat)radialOffsetForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)idx; +-(CGFloat)radialOffsetForPieChart:(nonnull CPTPieChart *)pieChart recordIndex:(NSUInteger)idx; /// @} @@ -94,14 +99,14 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { * @param idx The data index of interest. * @return The title text for the legend entry for the point with the given index. **/ --(NSString *)legendTitleForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)idx; +-(nullable NSString *)legendTitleForPieChart:(nonnull CPTPieChart *)pieChart recordIndex:(NSUInteger)idx; /** @brief @optional Gets the styled legend title for the given pie chart slice. * @param pieChart The pie chart. * @param idx The data index of interest. * @return The styled title text for the legend entry for the point with the given index. **/ --(NSAttributedString *)attributedLegendTitleForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)idx; +-(nullable NSAttributedString *)attributedLegendTitleForPieChart:(nonnull CPTPieChart *)pieChart recordIndex:(NSUInteger)idx; /// @} @end @@ -126,7 +131,7 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { * @if MacOnly clicked pie slice. @endif * @if iOSOnly touched pie slice. @endif **/ --(void)pieChart:(CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)idx; +-(void)pieChart:(nonnull CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a pie slice * @if MacOnly was both pressed and released. @endif @@ -137,7 +142,7 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { * @if iOSOnly touched pie slice. @endif * @param event The event that triggered the selection. **/ --(void)pieChart:(CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)pieChart:(nonnull CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a pie slice * @if MacOnly was pressed. @endif @@ -147,7 +152,7 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { * @if MacOnly clicked pie slice. @endif * @if iOSOnly touched pie slice. @endif **/ --(void)pieChart:(CPTPieChart *)plot sliceTouchDownAtRecordIndex:(NSUInteger)idx; +-(void)pieChart:(nonnull CPTPieChart *)plot sliceTouchDownAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a pie slice * @if MacOnly was pressed. @endif @@ -158,7 +163,7 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { * @if iOSOnly touched pie slice. @endif * @param event The event that triggered the selection. **/ --(void)pieChart:(CPTPieChart *)plot sliceTouchDownAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)pieChart:(nonnull CPTPieChart *)plot sliceTouchDownAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a pie slice * @if MacOnly was released. @endif @@ -168,7 +173,7 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { * @if MacOnly clicked pie slice. @endif * @if iOSOnly touched pie slice. @endif **/ --(void)pieChart:(CPTPieChart *)plot sliceTouchUpAtRecordIndex:(NSUInteger)idx; +-(void)pieChart:(nonnull CPTPieChart *)plot sliceTouchUpAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a pie slice * @if MacOnly was released. @endif @@ -179,7 +184,7 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { * @if iOSOnly touched pie slice. @endif * @param event The event that triggered the selection. **/ --(void)pieChart:(CPTPieChart *)plot sliceTouchUpAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)pieChart:(nonnull CPTPieChart *)plot sliceTouchUpAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /// @} @@ -201,8 +206,8 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { /// @name Drawing /// @{ -@property (nonatomic, readwrite, copy) CPTLineStyle *borderLineStyle; -@property (nonatomic, readwrite, copy) CPTFill *overlayFill; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *borderLineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTFill *overlayFill; /// @} /// @name Data Labels @@ -230,7 +235,7 @@ typedef NS_ENUM (NSInteger, CPTPieDirection) { /// @name Factory Methods /// @{ -+(CPTColor *)defaultPieSliceColorForIndex:(NSUInteger)pieSliceIndex; ++(nonnull CPTColor *)defaultPieSliceColorForIndex:(NSUInteger)pieSliceIndex; /// @} @end diff --git a/framework/Source/CPTPieChart.m b/framework/Source/CPTPieChart.m index cb0b336d1..83bbda7c8 100644 --- a/framework/Source/CPTPieChart.m +++ b/framework/Source/CPTPieChart.m @@ -1,7 +1,6 @@ #import "CPTPieChart.h" #import "CPTColor.h" -#import "CPTFill.h" #import "CPTLegend.h" #import "CPTLineStyle.h" #import "CPTMutableNumericData.h" @@ -26,16 +25,16 @@ * @endif **/ -NSString *const CPTPieChartBindingPieSliceWidthValues = @"sliceWidths"; ///< Pie slice widths. -NSString *const CPTPieChartBindingPieSliceFills = @"sliceFills"; ///< Pie slice interior fills. -NSString *const CPTPieChartBindingPieSliceRadialOffsets = @"sliceRadialOffsets"; ///< Pie slice radial offsets. +CPTPieChartBinding const CPTPieChartBindingPieSliceWidthValues = @"sliceWidths"; ///< Pie slice widths. +CPTPieChartBinding const CPTPieChartBindingPieSliceFills = @"sliceFills"; ///< Pie slice interior fills. +CPTPieChartBinding const CPTPieChartBindingPieSliceRadialOffsets = @"sliceRadialOffsets"; ///< Pie slice radial offsets. /// @cond @interface CPTPieChart() -@property (nonatomic, readwrite, copy) NSArray *sliceWidths; -@property (nonatomic, readwrite, copy) NSArray *sliceFills; -@property (nonatomic, readwrite, copy) NSArray *sliceRadialOffsets; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *sliceWidths; +@property (nonatomic, readwrite, copy, nullable) CPTFillArray *sliceFills; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *sliceRadialOffsets; @property (nonatomic, readwrite, assign) NSUInteger pointingDeviceDownIndex; -(void)updateNormalizedData; @@ -43,8 +42,8 @@ -(CGFloat)radiansForPieSliceValue:(CGFloat)pieSliceValue; -(CGFloat)normalizedPosition:(CGFloat)rawPosition; -(BOOL)angle:(CGFloat)touchedAngle betweenStartAngle:(CGFloat)startingAngle endAngle:(CGFloat)endingAngle; --(void)addSliceToPath:(CGMutablePathRef)slicePath centerPoint:(CGPoint)center startingAngle:(CGFloat)startingAngle finishingAngle:(CGFloat)finishingAngle; --(CPTFill *)sliceFillForIndex:(NSUInteger)idx; +-(void)addSliceToPath:(nonnull CGMutablePathRef)slicePath centerPoint:(CGPoint)center startingAngle:(CGFloat)startingAngle finishingAngle:(CGFloat)finishingAngle width:(CGFloat)currentWidth; +-(nullable CPTFill *)sliceFillForIndex:(NSUInteger)idx; @end @@ -103,12 +102,12 @@ @implementation CPTPieChart **/ @synthesize centerAnchor; -/** @property CPTLineStyle *borderLineStyle +/** @property nullable CPTLineStyle *borderLineStyle * @brief The line style used to outline the pie slices. If @nil, no border is drawn. Defaults to @nil. **/ @synthesize borderLineStyle; -/** @property CPTFill *overlayFill +/** @property nullable CPTFill *overlayFill * @brief A fill drawn on top of the pie chart. * Can be used to add shading and/or gloss effects. Defaults to @nil. **/ @@ -159,11 +158,11 @@ @implementation CPTPieChart * @return A new CPTColor instance corresponding to the default value for this pie slice index. **/ -+(CPTColor *)defaultPieSliceColorForIndex:(NSUInteger)pieSliceIndex ++(nonnull CPTColor *)defaultPieSliceColorForIndex:(NSUInteger)pieSliceIndex { - return [CPTColor colorWithComponentRed:( colorLookupTable[pieSliceIndex % 10][0] + (CGFloat)(pieSliceIndex / 10) * CPTFloat(0.1) ) - green:( colorLookupTable[pieSliceIndex % 10][1] + (CGFloat)(pieSliceIndex / 10) * CPTFloat(0.1) ) - blue:( colorLookupTable[pieSliceIndex % 10][2] + (CGFloat)(pieSliceIndex / 10) * CPTFloat(0.1) ) + return [CPTColor colorWithComponentRed:(colorLookupTable[pieSliceIndex % 10][0] + (CGFloat)(pieSliceIndex / 10) * CPTFloat(0.1)) + green:(colorLookupTable[pieSliceIndex % 10][1] + (CGFloat)(pieSliceIndex / 10) * CPTFloat(0.1)) + blue:(colorLookupTable[pieSliceIndex % 10][2] + (CGFloat)(pieSliceIndex / 10) * CPTFloat(0.1)) alpha:CPTFloat(1.0)]; } @@ -172,7 +171,7 @@ +(CPTColor *)defaultPieSliceColorForIndex:(NSUInteger)pieSliceIndex /// @cond -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else +(void)initialize { @@ -182,6 +181,7 @@ +(void)initialize [self exposeBinding:CPTPieChartBindingPieSliceRadialOffsets]; } } + #endif /// @endcond @@ -207,13 +207,13 @@ +(void)initialize * @param newFrame The frame rectangle. * @return The initialized CPTPieChart object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { - pieRadius = CPTFloat(0.8) * ( MIN(newFrame.size.width, newFrame.size.height) / CPTFloat(2.0) ); + if ((self = [super initWithFrame:newFrame])) { + pieRadius = CPTFloat(0.8) * (MIN(newFrame.size.width, newFrame.size.height) / CPTFloat(2.0)); pieInnerRadius = CPTFloat(0.0); startAngle = CPTFloat(M_PI_2); // pi/2 - endAngle = NAN; + endAngle = CPTNAN; sliceDirection = CPTPieDirectionClockwise; centerAnchor = CPTPointMake(0.5, 0.5); borderLineStyle = nil; @@ -231,9 +231,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTPieChart *theLayer = (CPTPieChart *)layer; pieRadius = theLayer->pieRadius; @@ -257,7 +257,7 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -275,17 +275,19 @@ -(void)encodeWithCoder:(NSCoder *)coder // pointingDeviceDownIndex } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - pieRadius = [coder decodeCGFloatForKey:@"CPTPieChart.pieRadius"]; - pieInnerRadius = [coder decodeCGFloatForKey:@"CPTPieChart.pieInnerRadius"]; - startAngle = [coder decodeCGFloatForKey:@"CPTPieChart.startAngle"]; - endAngle = [coder decodeCGFloatForKey:@"CPTPieChart.endAngle"]; - sliceDirection = (CPTPieDirection)[coder decodeIntegerForKey : @"CPTPieChart.sliceDirection"]; - centerAnchor = [coder decodeCPTPointForKey:@"CPTPieChart.centerAnchor"]; - borderLineStyle = [[coder decodeObjectForKey:@"CPTPieChart.borderLineStyle"] copy]; - overlayFill = [[coder decodeObjectForKey:@"CPTPieChart.overlayFill"] copy]; + if ((self = [super initWithCoder:coder])) { + pieRadius = [coder decodeCGFloatForKey:@"CPTPieChart.pieRadius"]; + pieInnerRadius = [coder decodeCGFloatForKey:@"CPTPieChart.pieInnerRadius"]; + startAngle = [coder decodeCGFloatForKey:@"CPTPieChart.startAngle"]; + endAngle = [coder decodeCGFloatForKey:@"CPTPieChart.endAngle"]; + sliceDirection = (CPTPieDirection)[coder decodeIntegerForKey:@"CPTPieChart.sliceDirection"]; + centerAnchor = [coder decodeCPTPointForKey:@"CPTPieChart.centerAnchor"]; + borderLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTPieChart.borderLineStyle"] copy]; + overlayFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTPieChart.overlayFill"] copy]; labelRotationRelativeToRadius = [coder decodeBoolForKey:@"CPTPieChart.labelRotationRelativeToRadius"]; pointingDeviceDownIndex = NSNotFound; } @@ -294,6 +296,18 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Data Loading @@ -371,12 +385,12 @@ -(void)updateNormalizedData const double *dataEnd = dataBytes + sampleCount; while ( dataBytes < dataEnd ) { double currentWidth = *dataBytes++; - if ( !isnan(currentWidth) ) { + if ( !isnan(currentWidth)) { valueSum += currentWidth; } } - CPTNumericDataType dataType = CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ); + CPTNumericDataType dataType = CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()); CPTMutableNumericData *normalizedSliceValues = [[CPTMutableNumericData alloc] initWithData:[NSData data] dataType:dataType shape:nil]; normalizedSliceValues.shape = @[@(sampleCount)]; @@ -390,8 +404,8 @@ -(void)updateNormalizedData double *cumulativeBytes = cumulativeSliceValues.mutableBytes; while ( dataBytes < dataEnd ) { double currentWidth = *dataBytes++; - if ( isnan(currentWidth) ) { - *normalizedBytes++ = NAN; + if ( isnan(currentWidth)) { + *normalizedBytes++ = (double)NAN; } else { *normalizedBytes++ = currentWidth / valueSum; @@ -408,12 +422,12 @@ -(void)updateNormalizedData const NSDecimal *dataEnd = dataBytes + sampleCount; while ( dataBytes < dataEnd ) { NSDecimal currentWidth = *dataBytes++; - if ( !NSDecimalIsNotANumber(¤tWidth) ) { + if ( !NSDecimalIsNotANumber(¤tWidth)) { valueSum = CPTDecimalAdd(valueSum, currentWidth); } } - CPTNumericDataType dataType = CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent() ); + CPTNumericDataType dataType = CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent()); CPTMutableNumericData *normalizedSliceValues = [[CPTMutableNumericData alloc] initWithData:[NSData data] dataType:dataType shape:nil]; normalizedSliceValues.shape = @[@(sampleCount)]; @@ -428,7 +442,7 @@ -(void)updateNormalizedData NSDecimal *cumulativeBytes = cumulativeSliceValues.mutableBytes; while ( dataBytes < dataEnd ) { NSDecimal currentWidth = *dataBytes++; - if ( NSDecimalIsNotANumber(¤tWidth) ) { + if ( NSDecimalIsNotANumber(¤tWidth)) { *normalizedBytes++ = decimalNAN; } else { @@ -480,9 +494,9 @@ -(void)reloadSliceFillsInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(sliceFillForPieChart:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableFillArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTFill *dataSourceFill = [theDataSource sliceFillForPieChart:self recordIndex:idx]; @@ -526,8 +540,8 @@ -(void)reloadRadialOffsetsInIndexRange:(NSRange)indexRange atRecordIndex:indexRange.location]; } else if ( [theDataSource respondsToSelector:@selector(radialOffsetForPieChart:recordIndex:)] ) { - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + CPTMutableNumberArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CGFloat offset = [theDataSource radialOffsetForPieChart:self recordIndex:idx]; @@ -545,7 +559,7 @@ -(void)reloadRadialOffsetsInIndexRange:(NSRange)indexRange /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden ) { return; @@ -580,10 +594,10 @@ -(void)renderAsVectorInContext:(CGContextRef)context CPTLineStyle *borderStyle = self.borderLineStyle; CPTFill *overlay = self.overlayFill; - BOOL hasNonZeroOffsets = NO; - NSArray *offsetArray = [self cachedArrayForKey:CPTPieChartBindingPieSliceRadialOffsets]; + BOOL hasNonZeroOffsets = NO; + CPTNumberArray *offsetArray = [self cachedArrayForKey:CPTPieChartBindingPieSliceRadialOffsets]; for ( NSNumber *offset in offsetArray ) { - if ( [offset cgFloatValue] != CPTFloat(0.0) ) { + if ( [offset cgFloatValue] != CPTFloat(0.0)) { hasNonZeroOffsets = YES; break; } @@ -593,17 +607,20 @@ -(void)renderAsVectorInContext:(CGContextRef)context if ( overlay && hasNonZeroOffsets ) { CGFloat radius = self.pieRadius + borderStyle.lineWidth * CPTFloat(0.5); - bounds = CPTRectMake( centerPoint.x - radius, centerPoint.y - radius, radius * CPTFloat(2.0), radius * CPTFloat(2.0) ); + bounds = CPTRectMake(centerPoint.x - radius, centerPoint.y - radius, radius * CPTFloat(2.0), radius * CPTFloat(2.0)); + } + else { + bounds = CGRectZero; } [borderStyle setLineStyleInContext:context]; Class fillClass = [CPTFill class]; while ( currentIndex < sampleCount ) { - CGFloat currentWidth = (CGFloat)[self cachedDoubleForField : CPTPieChartFieldSliceWidthNormalized recordIndex : currentIndex]; + CGFloat currentWidth = (CGFloat)[self cachedDoubleForField:CPTPieChartFieldSliceWidthNormalized recordIndex:currentIndex]; - if ( !isnan(currentWidth) ) { - CGFloat radialOffset = [(NSNumber *)offsetArray[currentIndex] cgFloatValue]; + if ( !isnan(currentWidth)) { + CGFloat radialOffset = [(NSNumber *) offsetArray[currentIndex] cgFloatValue]; // draw slice CGContextSaveGState(context); @@ -614,7 +631,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context CGFloat xOffset = CPTFloat(0.0); CGFloat yOffset = CPTFloat(0.0); CGPoint center = centerPoint; - if ( radialOffset != 0.0 ) { + if ( radialOffset != CPTFloat(0.0)) { CGFloat medianAngle = CPTFloat(0.5) * (startingAngle + finishingAngle); xOffset = cos(medianAngle) * radialOffset; yOffset = sin(medianAngle) * radialOffset; @@ -627,8 +644,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context } CGMutablePathRef slicePath = CGPathCreateMutable(); - [self addSliceToPath:slicePath centerPoint:center startingAngle:startingAngle finishingAngle:finishingAngle]; - CGPathCloseSubpath(slicePath); + [self addSliceToPath:slicePath centerPoint:center startingAngle:startingAngle finishingAngle:finishingAngle width:currentWidth]; CPTFill *currentFill = [self sliceFillForIndex:currentIndex]; if ( [currentFill isKindOfClass:fillClass] ) { @@ -673,7 +689,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context CGMutablePathRef fillPath = CGPathCreateMutable(); CGFloat innerRadius = self.pieInnerRadius; - if ( innerRadius > 0.0 ) { + if ( innerRadius > CPTFloat(0.0)) { CGPathAddArc(fillPath, NULL, centerPoint.x, centerPoint.y, self.pieRadius, CPTFloat(0.0), CPTFloat(2.0 * M_PI), false); CGPathAddArc(fillPath, NULL, centerPoint.x, centerPoint.y, innerRadius, CPTFloat(2.0 * M_PI), CPTFloat(0.0), true); } @@ -708,36 +724,49 @@ -(CGFloat)radiansForPieSliceValue:(CGFloat)pieSliceValue angle += pieSliceValue * pieRange; break; } - return angle; + return isnan(endingAngle) ? angle : fmod(angle, CPTFloat(2.0 * M_PI)); } --(void)addSliceToPath:(CGMutablePathRef)slicePath centerPoint:(CGPoint)center startingAngle:(CGFloat)startingAngle finishingAngle:(CGFloat)finishingAngle +-(void)addSliceToPath:(nonnull CGMutablePathRef)slicePath centerPoint:(CGPoint)center startingAngle:(CGFloat)startingAngle finishingAngle:(CGFloat)finishingAngle width:(CGFloat)currentWidth { bool direction = (self.sliceDirection == CPTPieDirectionClockwise) ? true : false; + CGFloat outerRadius = self.pieRadius; CGFloat innerRadius = self.pieInnerRadius; - if ( innerRadius > 0.0 ) { - CGPathAddArc(slicePath, NULL, center.x, center.y, self.pieRadius, startingAngle, finishingAngle, direction); - CGPathAddArc(slicePath, NULL, center.x, center.y, innerRadius, finishingAngle, startingAngle, !direction); + if ( innerRadius > CPTFloat(0.0)) { + if ( currentWidth >= CPTFloat(1.0)) { + CGPathAddArc(slicePath, NULL, center.x, center.y, outerRadius, startingAngle, startingAngle + CPTFloat(2.0 * M_PI), direction); + CGPathAddArc(slicePath, NULL, center.x, center.y, innerRadius, startingAngle + CPTFloat(2.0 * M_PI), startingAngle, !direction); + } + else { + CGPathAddArc(slicePath, NULL, center.x, center.y, outerRadius, startingAngle, finishingAngle, direction); + CGPathAddArc(slicePath, NULL, center.x, center.y, innerRadius, finishingAngle, startingAngle, !direction); + } } else { - CGPathMoveToPoint(slicePath, NULL, center.x, center.y); - CGPathAddArc(slicePath, NULL, center.x, center.y, self.pieRadius, startingAngle, finishingAngle, direction); + if ( currentWidth >= CPTFloat(1.0)) { + CGPathAddEllipseInRect(slicePath, NULL, CGRectMake(center.x - outerRadius, center.y - outerRadius, outerRadius * CPTFloat(2.0), outerRadius * CPTFloat(2.0))); + } + else { + CGPathMoveToPoint(slicePath, NULL, center.x, center.y); + CGPathAddArc(slicePath, NULL, center.x, center.y, outerRadius, startingAngle, finishingAngle, direction); + } } + CGPathCloseSubpath(slicePath); } --(CPTFill *)sliceFillForIndex:(NSUInteger)idx +-(nullable CPTFill *)sliceFillForIndex:(NSUInteger)idx { CPTFill *currentFill = [self cachedValueForKey:CPTPieChartBindingPieSliceFills recordIndex:idx]; - if ( (currentFill == nil) || (currentFill == [CPTPlot nilData]) ) { + if ((currentFill == nil) || (currentFill == [CPTPlot nilData])) { currentFill = [CPTFill fillWithColor:[CPTPieChart defaultPieSliceColorForIndex:idx]]; } return currentFill; } --(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(CGContextRef)context +-(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(nonnull CGContextRef)context { [super drawSwatchForLegend:legend atIndex:idx inRect:rect inContext:context]; @@ -784,7 +813,7 @@ -(NSUInteger)pieSliceIndexAtAngle:(CGFloat)angle // of that pie slice. for ( NSUInteger currentIndex = 0; currentIndex < self.cachedDataCount; currentIndex++ ) { CGFloat width = CPTFloat([self cachedDoubleForField:CPTPieChartFieldSliceWidthNormalized recordIndex:currentIndex]); - if ( isnan(width) ) { + if ( isnan(width)) { continue; } CGFloat endingAngle = startingAngle; @@ -819,7 +848,7 @@ -(CGFloat)medianAngleForPieSliceIndex:(NSUInteger)idx NSParameterAssert(idx < sampleCount); if ( sampleCount == 0 ) { - return NAN; + return CPTNAN; } CGFloat startingWidth = CPTFloat(0.0); @@ -829,7 +858,7 @@ -(CGFloat)medianAngleForPieSliceIndex:(NSUInteger)idx CGFloat currentWidth = CPTFloat([self cachedDoubleForField:CPTPieChartFieldSliceWidthNormalized recordIndex:currentIndex]); // If the slice index is a match... - if ( !isnan(currentWidth) && (idx == currentIndex) ) { + if ( !isnan(currentWidth) && (idx == currentIndex)) { // Compute and return the angle that is halfway between the slice's starting and ending angles CGFloat startingAngle = [self radiansForPieSliceValue:startingWidth]; CGFloat finishingAngle = [self radiansForPieSliceValue:startingWidth + currentWidth]; @@ -840,7 +869,7 @@ -(CGFloat)medianAngleForPieSliceIndex:(NSUInteger)idx } // Searched every pie slice but couldn't find one that corresponds to the given index - return NAN; + return CPTNAN; } #pragma mark - @@ -848,9 +877,9 @@ -(CGFloat)medianAngleForPieSliceIndex:(NSUInteger)idx /// @cond -+(BOOL)needsDisplayForKey:(NSString *)aKey ++(BOOL)needsDisplayForKey:(nonnull NSString *)aKey { - static NSSet *keys = nil; + static NSSet *keys = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ @@ -881,7 +910,7 @@ -(NSUInteger)numberOfFields return 1; } --(NSArray *)fieldIdentifiers +-(nonnull CPTNumberArray *)fieldIdentifiers { return @[@(CPTPieChartFieldSliceWidth)]; } @@ -893,7 +922,7 @@ -(NSArray *)fieldIdentifiers /// @cond --(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx +-(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx { CPTLayer *contentLayer = label.contentLayer; CPTPlotArea *thePlotArea = self.plotArea; @@ -910,8 +939,8 @@ -(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInte NSDecimalNumber *yValue = [[NSDecimalNumber alloc] initWithDecimal:plotPoint[CPTCoordinateY]]; label.anchorPlotPoint = @[xValue, yValue]; - CGFloat currentWidth = (CGFloat)[self cachedDoubleForField : CPTPieChartFieldSliceWidthNormalized recordIndex : idx]; - if ( self.hidden || isnan(currentWidth) ) { + CGFloat currentWidth = (CGFloat)[self cachedDoubleForField:CPTPieChartFieldSliceWidthNormalized recordIndex:idx]; + if ( self.hidden || isnan(currentWidth)) { contentLayer.hidden = YES; } else { @@ -920,15 +949,15 @@ -(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInte CGFloat startingWidth = CPTFloat(0.0); if ( idx > 0 ) { - startingWidth = (CGFloat)[self cachedDoubleForField : CPTPieChartFieldSliceWidthSum recordIndex : idx - 1]; + startingWidth = (CGFloat)[self cachedDoubleForField:CPTPieChartFieldSliceWidthSum recordIndex:idx - 1]; } CGFloat labelAngle = [self radiansForPieSliceValue:startingWidth + currentWidth / CPTFloat(2.0)]; - label.displacement = CPTPointMake( labelRadius * cos(labelAngle), labelRadius * sin(labelAngle) ); + label.displacement = CPTPointMake(labelRadius * cos(labelAngle), labelRadius * sin(labelAngle)); if ( self.labelRotationRelativeToRadius ) { CGFloat rotation = [self normalizedPosition:self.labelRotation + labelAngle]; - if ( ( rotation > CPTFloat(0.25) ) && ( rotation < CPTFloat(0.75) ) ) { + if ((rotation > CPTFloat(0.25)) && (rotation < CPTFloat(0.75))) { rotation -= CPTFloat(0.5); } @@ -966,7 +995,7 @@ -(NSUInteger)numberOfLegendEntries * @param idx The index of the desired title. * @return The title of the legend entry at the requested index. **/ --(NSString *)titleForLegendEntryAtIndex:(NSUInteger)idx +-(nullable NSString *)titleForLegendEntryAtIndex:(NSUInteger)idx { NSString *legendTitle = nil; @@ -987,7 +1016,7 @@ -(NSString *)titleForLegendEntryAtIndex:(NSUInteger)idx * @param idx The index of the desired title. * @return The styled title of the legend entry at the requested index. **/ --(NSAttributedString *)attributedTitleForLegendEntryAtIndex:(NSUInteger)idx +-(nullable NSAttributedString *)attributedTitleForLegendEntryAtIndex:(NSUInteger)idx { NSAttributedString *legendTitle = nil; @@ -1015,8 +1044,8 @@ -(CGFloat)normalizedPosition:(CGFloat)rawPosition CGFloat result = rawPosition; result /= (CGFloat)(2.0 * M_PI); - result = fmod( result, CPTFloat(1.0) ); - if ( result < CPTFloat(0.0) ) { + result = fmod(result, CPTFloat(1.0)); + if ( result < CPTFloat(0.0)) { result += CPTFloat(1.0); } @@ -1027,19 +1056,19 @@ -(BOOL)angle:(CGFloat)touchedAngle betweenStartAngle:(CGFloat)startingAngle endA { switch ( self.sliceDirection ) { case CPTPieDirectionClockwise: - if ( (touchedAngle <= startingAngle) && (touchedAngle >= endingAngle) ) { + if ((touchedAngle <= startingAngle) && (touchedAngle >= endingAngle)) { return YES; } - else if ( ( endingAngle < CPTFloat(0.0) ) && (touchedAngle - CPTFloat(1.0) >= endingAngle) ) { + else if ((endingAngle < CPTFloat(0.0)) && (touchedAngle - CPTFloat(1.0) >= endingAngle)) { return YES; } break; case CPTPieDirectionCounterClockwise: - if ( (touchedAngle >= startingAngle) && (touchedAngle <= endingAngle) ) { + if ((touchedAngle >= startingAngle) && (touchedAngle <= endingAngle)) { return YES; } - else if ( ( endingAngle > CPTFloat(1.0) ) && (touchedAngle + CPTFloat(1.0) <= endingAngle) ) { + else if ((endingAngle > CPTFloat(1.0)) && (touchedAngle + CPTFloat(1.0) <= endingAngle)) { return YES; } break; @@ -1070,7 +1099,7 @@ -(BOOL)angle:(CGFloat)touchedAngle betweenStartAngle:(CGFloat)startingAngle endA * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { CPTGraph *theGraph = self.graph; CPTPlotArea *thePlotArea = self.plotArea; @@ -1079,7 +1108,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(pieChart:sliceTouchDownAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(pieChart:sliceTouchDownAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(pieChart:sliceWasSelectedAtRecordIndex:)] || @@ -1135,7 +1164,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { NSUInteger selectedDownIndex = self.pointingDeviceDownIndex; @@ -1148,7 +1177,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(pieChart:sliceTouchUpAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(pieChart:sliceTouchUpAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(pieChart:sliceWasSelectedAtRecordIndex:)] || @@ -1231,17 +1260,17 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point switch ( self.sliceDirection ) { case CPTPieDirectionClockwise: - if ( isnan(theEndAngle) || ( 2.0 * M_PI == ABS(theEndAngle - theStartAngle) ) ) { + if ( isnan(theEndAngle) || (CPTFloat(2.0 * M_PI) == ABS(theEndAngle - theStartAngle))) { widthFactor = CPTFloat(1.0); } else { - widthFactor = (CGFloat)(2.0 * M_PI) / ( (CGFloat)(2.0 * M_PI) - ABS(theEndAngle - theStartAngle) ); + widthFactor = CPTFloat(2.0 * M_PI) / (CPTFloat(2.0 * M_PI) - ABS(theEndAngle - theStartAngle)); } for ( NSUInteger currentIndex = 0; currentIndex < sampleCount; currentIndex++ ) { // calculate angles for this slice - CGFloat width = (CGFloat)[self cachedDoubleForField : CPTPieChartFieldSliceWidthNormalized recordIndex : currentIndex]; - if ( isnan(width) ) { + CGFloat width = (CGFloat)[self cachedDoubleForField:CPTPieChartFieldSliceWidthNormalized recordIndex:currentIndex]; + if ( isnan(width)) { continue; } @@ -1253,7 +1282,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point CGFloat offsetTouchedAngle = touchedAngle; CGFloat offsetDistanceSquared = distanceSquared; CGFloat radialOffset = [(NSNumber *)[self cachedValueForKey:CPTPieChartBindingPieSliceRadialOffsets recordIndex:currentIndex] cgFloatValue]; - if ( radialOffset != 0.0 ) { + if ( radialOffset != CPTFloat(0.0)) { CGPoint offsetCenter; CGFloat medianAngle = CPTFloat(M_PI) * (startingAngle + endingAngle); offsetCenter = CPTPointMake(centerPoint.x + cos(medianAngle) * radialOffset, @@ -1278,7 +1307,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point } // check distance - if ( angleInSlice && (offsetDistanceSquared >= chartInnerRadiusSquared) && (offsetDistanceSquared <= chartRadiusSquared) ) { + if ( angleInSlice && (offsetDistanceSquared >= chartInnerRadiusSquared) && (offsetDistanceSquared <= chartRadiusSquared)) { return currentIndex; } @@ -1288,7 +1317,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point break; case CPTPieDirectionCounterClockwise: - if ( isnan(theEndAngle) || (theStartAngle == theEndAngle) ) { + if ( isnan(theEndAngle) || (theStartAngle == theEndAngle)) { widthFactor = CPTFloat(1.0); } else { @@ -1297,8 +1326,8 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point for ( NSUInteger currentIndex = 0; currentIndex < sampleCount; currentIndex++ ) { // calculate angles for this slice - CGFloat width = (CGFloat)[self cachedDoubleForField : CPTPieChartFieldSliceWidthNormalized recordIndex : currentIndex]; - if ( isnan(width) ) { + CGFloat width = (CGFloat)[self cachedDoubleForField:CPTPieChartFieldSliceWidthNormalized recordIndex:currentIndex]; + if ( isnan(width)) { continue; } width /= widthFactor; @@ -1309,7 +1338,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point CGFloat offsetTouchedAngle = touchedAngle; CGFloat offsetDistanceSquared = distanceSquared; CGFloat radialOffset = [(NSNumber *)[self cachedValueForKey:CPTPieChartBindingPieSliceRadialOffsets recordIndex:currentIndex] cgFloatValue]; - if ( radialOffset != 0.0 ) { + if ( radialOffset != CPTFloat(0.0)) { CGPoint offsetCenter; CGFloat medianAngle = CPTFloat(M_PI) * (startingAngle + endingAngle); offsetCenter = CPTPointMake(centerPoint.x + cos(medianAngle) * radialOffset, @@ -1334,7 +1363,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point } // check distance - if ( angleInSlice && (offsetDistanceSquared >= chartInnerRadiusSquared) && (offsetDistanceSquared <= chartRadiusSquared) ) { + if ( angleInSlice && (offsetDistanceSquared >= chartInnerRadiusSquared) && (offsetDistanceSquared <= chartRadiusSquared)) { return currentIndex; } @@ -1354,34 +1383,34 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point /// @cond --(NSArray *)sliceWidths +-(nullable CPTNumberArray *)sliceWidths { return [[self cachedNumbersForField:CPTPieChartFieldSliceWidth] sampleArray]; } --(void)setSliceWidths:(NSArray *)newSliceWidths +-(void)setSliceWidths:(nullable CPTNumberArray *)newSliceWidths { [self cacheNumbers:newSliceWidths forField:CPTPieChartFieldSliceWidth]; [self updateNormalizedData]; } --(NSArray *)sliceFills +-(nullable CPTFillArray *)sliceFills { return [self cachedArrayForKey:CPTPieChartBindingPieSliceFills]; } --(void)setSliceFills:(NSArray *)newSliceFills +-(void)setSliceFills:(nullable CPTFillArray *)newSliceFills { [self cacheArray:newSliceFills forKey:CPTPieChartBindingPieSliceFills]; [self setNeedsDisplay]; } --(NSArray *)sliceRadialOffsets +-(nullable CPTNumberArray *)sliceRadialOffsets { return [self cachedArrayForKey:CPTPieChartBindingPieSliceRadialOffsets]; } --(void)setSliceRadialOffsets:(NSArray *)newSliceRadialOffsets +-(void)setSliceRadialOffsets:(nullable CPTNumberArray *)newSliceRadialOffsets { [self cacheArray:newSliceRadialOffsets forKey:CPTPieChartBindingPieSliceRadialOffsets]; [self setNeedsDisplay]; @@ -1432,7 +1461,7 @@ -(void)setSliceDirection:(CPTPieDirection)newDirection } } --(void)setBorderLineStyle:(CPTLineStyle *)newStyle +-(void)setBorderLineStyle:(nullable CPTLineStyle *)newStyle { if ( borderLineStyle != newStyle ) { borderLineStyle = [newStyle copy]; @@ -1443,7 +1472,7 @@ -(void)setBorderLineStyle:(CPTLineStyle *)newStyle -(void)setCenterAnchor:(CGPoint)newCenterAnchor { - if ( !CGPointEqualToPoint(centerAnchor, newCenterAnchor) ) { + if ( !CGPointEqualToPoint(centerAnchor, newCenterAnchor)) { centerAnchor = newCenterAnchor; [self setNeedsDisplay]; [self repositionAllLabelAnnotations]; @@ -1461,7 +1490,7 @@ -(void)setLabelRotationRelativeToRadius:(BOOL)newLabelRotationRelativeToRadius -(void)setLabelRotation:(CGFloat)newRotation { if ( newRotation != self.labelRotation ) { - [super setLabelRotation:newRotation]; + super.labelRotation = newRotation; if ( self.labelRotationRelativeToRadius ) { [self repositionAllLabelAnnotations]; } diff --git a/framework/Source/CPTPlot.h b/framework/Source/CPTPlot.h index a818c648a..d9dd3d976 100644 --- a/framework/Source/CPTPlot.h +++ b/framework/Source/CPTPlot.h @@ -14,9 +14,14 @@ @class CPTPlotRange; @class CPTTextStyle; +/** + * @brief Plot bindings. + **/ +typedef NSString *CPTPlotBinding cpt_swift_struct; + /// @ingroup plotBindingsAllPlots /// @{ -extern NSString *const CPTPlotBindingDataLabels; +extern CPTPlotBinding __nonnull const CPTPlotBindingDataLabels; /// @} /** @@ -28,6 +33,16 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { CPTPlotCachePrecisionDecimal ///< All cached data will be converted to @ref NSDecimal. }; +/** + * @brief An array of plots. + **/ +typedef NSArray<__kindof CPTPlot *> CPTPlotArray; + +/** + * @brief A mutable array of plots. + **/ +typedef NSMutableArray<__kindof CPTPlot *> CPTMutablePlotArray; + #pragma mark - /** @@ -42,7 +57,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @param plot The plot. * @return The number of data points for the plot. **/ --(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot; +-(NSUInteger)numberOfRecordsForPlot:(nonnull CPTPlot *)plot; @optional @@ -59,7 +74,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @param indexRange The range of the data indexes of interest. * @return An array of data points. **/ --(NSArray *)numbersForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange; +-(nullable NSArray *)numbersForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a plot data value for the given plot and field. * Implement one and only one of the optional methods in this section. @@ -74,7 +89,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @param idx The data index of interest. * @return A data point. **/ --(id)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)idx; +-(nullable id)numberForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)idx; /** @brief @optional Gets a range of plot data for the given plot and field. * Implement one and only one of the optional methods in this section. @@ -83,7 +98,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @param indexRange The range of the data indexes of interest. * @return A retained C array of data points. **/ --(double *)doublesForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange; +-(nullable double *)doublesForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange NS_RETURNS_INNER_POINTER; /** @brief @optional Gets a plot data value for the given plot and field. * Implement one and only one of the optional methods in this section. @@ -92,7 +107,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @param idx The data index of interest. * @return A data point. **/ --(double)doubleForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)idx; +-(double)doubleForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)idx; /** @brief @optional Gets a range of plot data for the given plot and field. * Implement one and only one of the optional methods in this section. @@ -101,7 +116,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @param indexRange The range of the data indexes of interest. * @return A one-dimensional array of data points. **/ --(CPTNumericData *)dataForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange; +-(nullable CPTNumericData *)dataForPlot:(nonnull CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a range of plot data for all fields of the given plot simultaneously. * Implement one and only one of the optional methods in this section. @@ -117,7 +132,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @param indexRange The range of the data indexes of interest. * @return A two-dimensional array of data points. **/ --(CPTNumericData *)dataForPlot:(CPTPlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTNumericData *)dataForPlot:(nonnull CPTPlot *)plot recordIndexRange:(NSRange)indexRange; /// @} @@ -129,7 +144,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @param indexRange The range of the data indexes of interest. * @return An array of data labels. **/ --(NSArray *)dataLabelsForPlot:(CPTPlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTLayerArray *)dataLabelsForPlot:(nonnull CPTPlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a data label for the given plot. * This method will not be called if @@ -141,7 +156,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * If you return @nil, the default data label will be used. If you return an instance of NSNull, * no label will be shown for the index in question. **/ --(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)idx; +-(nullable CPTLayer *)dataLabelForPlot:(nonnull CPTPlot *)plot recordIndex:(NSUInteger)idx; /// @} @@ -152,7 +167,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { /** * @brief Plot delegate. **/ -@protocol CPTPlotDelegate +@protocol CPTPlotDelegate @optional @@ -167,7 +182,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @if MacOnly clicked data label. @endif * @if iOSOnly touched data label. @endif **/ --(void)plot:(CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUInteger)idx; +-(void)plot:(nonnull CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a data label * @if MacOnly was both pressed and released. @endif @@ -178,7 +193,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @if iOSOnly touched data label. @endif * @param event The event that triggered the selection. **/ --(void)plot:(CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)plot:(nonnull CPTPlot *)plot dataLabelWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a data label * @if MacOnly was pressed. @endif @@ -188,7 +203,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @if MacOnly clicked data label. @endif * @if iOSOnly touched data label. @endif **/ --(void)plot:(CPTPlot *)plot dataLabelTouchDownAtRecordIndex:(NSUInteger)idx; +-(void)plot:(nonnull CPTPlot *)plot dataLabelTouchDownAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a data label * @if MacOnly was pressed. @endif @@ -199,7 +214,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @if iOSOnly touched data label. @endif * @param event The event that triggered the selection. **/ --(void)plot:(CPTPlot *)plot dataLabelTouchDownAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)plot:(nonnull CPTPlot *)plot dataLabelTouchDownAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a data label * @if MacOnly was released. @endif @@ -209,7 +224,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @if MacOnly clicked data label. @endif * @if iOSOnly touched data label. @endif **/ --(void)plot:(CPTPlot *)plot dataLabelTouchUpAtRecordIndex:(NSUInteger)idx; +-(void)plot:(nonnull CPTPlot *)plot dataLabelTouchUpAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a data label * @if MacOnly was released. @endif @@ -220,7 +235,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @if iOSOnly touched data label. @endif * @param event The event that triggered the selection. **/ --(void)plot:(CPTPlot *)plot dataLabelTouchUpAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)plot:(nonnull CPTPlot *)plot dataLabelTouchUpAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /// @} @@ -231,7 +246,7 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { * @brief @optional Informs the delegate that plot drawing is finished. * @param plot The plot. **/ --(void)didFinishDrawing:(CPTPlot *)plot; +-(void)didFinishDrawing:(nonnull CPTPlot *)plot; /// @} @@ -243,23 +258,23 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { /// @name Data Source /// @{ -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak id dataSource; +@property (nonatomic, readwrite, cpt_weak_property, nullable) id dataSource; /// @} /// @name Identification /// @{ -@property (nonatomic, readwrite, copy) NSString *title; -@property (nonatomic, readwrite, copy) NSAttributedString *attributedTitle; +@property (nonatomic, readwrite, copy, nullable) NSString *title; +@property (nonatomic, readwrite, copy, nullable) NSAttributedString *attributedTitle; /// @} /// @name Plot Space /// @{ -@property (nonatomic, readwrite, strong) CPTPlotSpace *plotSpace; +@property (nonatomic, readwrite, strong, nullable) CPTPlotSpace *plotSpace; /// @} /// @name Plot Area /// @{ -@property (nonatomic, readonly) CPTPlotArea *plotArea; +@property (nonatomic, readonly, nullable) CPTPlotArea *plotArea; /// @} /// @name Data Loading @@ -284,9 +299,9 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { @property (nonatomic, readwrite, assign) CGFloat labelOffset; @property (nonatomic, readwrite, assign) CGFloat labelRotation; @property (nonatomic, readwrite, assign) NSUInteger labelField; -@property (nonatomic, readwrite, copy) CPTTextStyle *labelTextStyle; -@property (nonatomic, readwrite, strong) NSFormatter *labelFormatter; -@property (nonatomic, readwrite, strong) CPTShadow *labelShadow; +@property (nonatomic, readwrite, copy, nullable) CPTTextStyle *labelTextStyle; +@property (nonatomic, readwrite, strong, nullable) NSFormatter *labelFormatter; +@property (nonatomic, readwrite, strong, nullable) CPTShadow *labelShadow; /// @} /// @name Drawing @@ -317,44 +332,48 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { -(void)reloadDataInIndexRange:(NSRange)indexRange; -(void)insertDataAtIndex:(NSUInteger)idx numberOfRecords:(NSUInteger)numberOfRecords; -(void)deleteDataInIndexRange:(NSRange)indexRange; --(void)reloadPlotData; --(void)reloadPlotDataInIndexRange:(NSRange)indexRange; +-(void) reloadPlotData NS_SWIFT_NAME(CPTPlot.reloadPlotData()); + +-(void)reloadPlotDataInIndexRange:(NSRange) indexRange NS_SWIFT_NAME(CPTPlot.reloadPlotData(inIndexRange:)); + /// @} /// @name Plot Data /// @{ -+(id)nilData; --(id)numbersFromDataSourceForField:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange; ++(nonnull id)nilData; +-(nullable id)numbersFromDataSourceForField:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange; -(BOOL)loadNumbersForAllFieldsFromDataSourceInRecordIndexRange:(NSRange)indexRange; /// @} /// @name Data Cache /// @{ --(CPTMutableNumericData *)cachedNumbersForField:(NSUInteger)fieldEnum; --(NSNumber *)cachedNumberForField:(NSUInteger)fieldEnum recordIndex:(NSUInteger)idx; +-(nullable CPTMutableNumericData *)cachedNumbersForField:(NSUInteger)fieldEnum; +-(nullable NSNumber *)cachedNumberForField:(NSUInteger)fieldEnum recordIndex:(NSUInteger)idx; -(double)cachedDoubleForField:(NSUInteger)fieldEnum recordIndex:(NSUInteger)idx; -(NSDecimal)cachedDecimalForField:(NSUInteger)fieldEnum recordIndex:(NSUInteger)idx; --(NSArray *)cachedArrayForKey:(NSString *)key; --(id)cachedValueForKey:(NSString *)key recordIndex:(NSUInteger)idx; +-(nullable NSArray *)cachedArrayForKey:(nonnull NSString *)key; +-(nullable id)cachedValueForKey:(nonnull NSString *)key recordIndex:(NSUInteger)idx; --(void)cacheNumbers:(id)numbers forField:(NSUInteger)fieldEnum; --(void)cacheNumbers:(id)numbers forField:(NSUInteger)fieldEnum atRecordIndex:(NSUInteger)idx; --(void)cacheArray:(NSArray *)array forKey:(NSString *)key; --(void)cacheArray:(NSArray *)array forKey:(NSString *)key atRecordIndex:(NSUInteger)idx; +-(void)cacheNumbers:(nullable id)numbers forField:(NSUInteger)fieldEnum; +-(void)cacheNumbers:(nullable id)numbers forField:(NSUInteger)fieldEnum atRecordIndex:(NSUInteger)idx; +-(void)cacheArray:(nullable NSArray *)array forKey:(nonnull NSString *)key; +-(void)cacheArray:(nullable NSArray *)array forKey:(nonnull NSString *)key atRecordIndex:(NSUInteger)idx; /// @} /// @name Plot Data Ranges /// @{ --(CPTPlotRange *)plotRangeForField:(NSUInteger)fieldEnum; --(CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord; +-(nullable CPTPlotRange *)plotRangeForField:(NSUInteger)fieldEnum; +-(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord; +-(nullable CPTPlotRange *)plotRangeEnclosingField:(NSUInteger)fieldEnum; +-(nullable CPTPlotRange *)plotRangeEnclosingCoordinate:(CPTCoordinate)coord; /// @} /// @name Legends /// @{ -(NSUInteger)numberOfLegendEntries; --(NSString *)titleForLegendEntryAtIndex:(NSUInteger)idx; --(NSAttributedString *)attributedTitleForLegendEntryAtIndex:(NSUInteger)idx; --(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(CGContextRef)context; +-(nullable NSString *)titleForLegendEntryAtIndex:(NSUInteger)idx; +-(nullable NSAttributedString *)attributedTitleForLegendEntryAtIndex:(NSUInteger)idx; +-(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(nonnull CGContextRef)context; /// @} @end @@ -369,14 +388,14 @@ typedef NS_ENUM (NSInteger, CPTPlotCachePrecision) { /// @name Fields /// @{ -(NSUInteger)numberOfFields; --(NSArray *)fieldIdentifiers; --(NSArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord; +-(nonnull CPTNumberArray *)fieldIdentifiers; +-(nonnull CPTNumberArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord; -(CPTCoordinate)coordinateForFieldIdentifier:(NSUInteger)field; /// @} /// @name Data Labels /// @{ --(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx; +-(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx; /// @} /// @name User Interaction diff --git a/framework/Source/CPTPlot.m b/framework/Source/CPTPlot.m index 634b8c59f..5cd2637a0 100644 --- a/framework/Source/CPTPlot.m +++ b/framework/Source/CPTPlot.m @@ -16,13 +16,12 @@ #import "CPTTextLayer.h" #import "CPTUtilities.h" #import "NSCoderExtensions.h" -#import #import /** @defgroup plotAnimation Plots * @brief Plot properties that can be animated using Core Animation. * @if MacOnly - * @since Custom layer property animation is supported on MacOS 10.6 and later. + * @since Custom layer property animation is supported on macOS 10.6 and later. * @endif * @ingroup animation **/ @@ -45,18 +44,18 @@ * @endif **/ -NSString *const CPTPlotBindingDataLabels = @"dataLabels"; ///< Plot data labels. +CPTPlotBinding const CPTPlotBindingDataLabels = @"dataLabels"; ///< Plot data labels. /// @cond @interface CPTPlot() @property (nonatomic, readwrite, assign) BOOL dataNeedsReloading; -@property (nonatomic, readwrite, strong) NSMutableDictionary *cachedData; +@property (nonatomic, readwrite, strong, nonnull) NSMutableDictionary *cachedData; @property (nonatomic, readwrite, assign) BOOL needsRelabel; @property (nonatomic, readwrite, assign) NSRange labelIndexRange; -@property (nonatomic, readwrite, strong) NSMutableArray *labelAnnotations; -@property (nonatomic, readwrite, copy) NSArray *dataLabels; +@property (nonatomic, readwrite, strong, nullable) CPTMutableAnnotationArray *labelAnnotations; +@property (nonatomic, readwrite, copy, nullable) CPTLayerArray *dataLabels; @property (nonatomic, readwrite, assign) NSUInteger pointingDeviceDownLabelIndex; @property (nonatomic, readwrite, assign) NSUInteger cachedDataCount; @@ -64,9 +63,9 @@ @interface CPTPlot() @property (nonatomic, readonly, assign) NSUInteger numberOfRecords; --(CPTMutableNumericData *)numericDataForNumbers:(id)numbers; +-(nonnull CPTMutableNumericData *)numericDataForNumbers:(nonnull id)numbers; -(void)setCachedDataType:(CPTNumericDataType)newDataType; --(void)updateContentAnchorForLabel:(CPTPlotSpaceAnnotation *)label; +-(void)updateContentAnchorForLabel:(nonnull CPTPlotSpaceAnnotation *)label; @end @@ -79,7 +78,7 @@ -(void)updateContentAnchorForLabel:(CPTPlotSpaceAnnotation *)label; * Each data series on the graph is represented by a plot. Data is provided by * a datasource that conforms to the CPTPlotDataSource protocol. * @if MacOnly - * Plots also support data binding on MacOS. + * Plots also support data binding on macOS. * @endif * * A Core Plot plot will request its data from the datasource when it is first displayed. @@ -104,19 +103,19 @@ @implementation CPTPlot @dynamic dataLabels; -/** @property cpt_weak id dataSource +/** @property nullable id dataSource * @brief The data source for the plot. **/ @synthesize dataSource; -/** @property NSString *title +/** @property nullable NSString *title * @brief The title of the plot displayed in the legend. * * Assigning a new value to this property also sets the value of the @ref attributedTitle property to @nil. **/ @synthesize title; -/** @property NSAttributedString *attributedTitle +/** @property nullable NSAttributedString *attributedTitle * @brief The styled title of the plot displayed in the legend. * * Assigning a new value to this property also sets the value of the @ref title property to the @@ -124,12 +123,12 @@ @implementation CPTPlot **/ @synthesize attributedTitle; -/** @property CPTPlotSpace *plotSpace +/** @property nullable CPTPlotSpace *plotSpace * @brief The plot space for the plot. **/ @synthesize plotSpace; -/** @property CPTPlotArea *plotArea +/** @property nullable CPTPlotArea *plotArea * @brief The plot area for the plot. **/ @dynamic plotArea; @@ -199,13 +198,13 @@ @implementation CPTPlot **/ @synthesize labelField; -/** @property CPTTextStyle *labelTextStyle +/** @property nullable CPTTextStyle *labelTextStyle * @brief The text style used to draw the data labels. * Set this property to @nil to hide the data labels. **/ @synthesize labelTextStyle; -/** @property NSFormatter *labelFormatter +/** @property nullable NSFormatter *labelFormatter * @brief The number formatter used to format the data labels. * Set this property to @nil to hide the data labels. * If you need a non-numerical label, such as a date, you can use a formatter than turns @@ -214,7 +213,7 @@ @implementation CPTPlot **/ @synthesize labelFormatter; -/** @property CPTShadow *labelShadow +/** @property nullable CPTShadow *labelShadow * @brief The shadow applied to each data label. **/ @synthesize labelShadow; @@ -248,7 +247,7 @@ @implementation CPTPlot /// @cond -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else +(void)initialize { @@ -256,6 +255,7 @@ +(void)initialize [self exposeBinding:CPTPlotBindingDataLabels]; } } + #endif /// @endcond @@ -290,9 +290,9 @@ +(void)initialize * @param newFrame The frame rectangle. * @return The initialized CPTPlot object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { cachedData = [[NSMutableDictionary alloc] initWithCapacity:5]; cachedDataCount = 0; cachePrecision = CPTPlotCachePrecisionAuto; @@ -328,9 +328,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTPlot *theLayer = (CPTPlot *)layer; cachedData = theLayer->cachedData; @@ -368,7 +368,7 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -402,32 +402,42 @@ -(void)encodeWithCoder:(NSCoder *)coder // pointingDeviceDownLabelIndex } --(instancetype)initWithCoder:(NSCoder *)coder -{ - if ( (self = [super initWithCoder:coder]) ) { - dataSource = [coder decodeObjectForKey:@"CPTPlot.dataSource"]; - title = [[coder decodeObjectForKey:@"CPTPlot.title"] copy]; - attributedTitle = [[coder decodeObjectForKey:@"CPTPlot.attributedTitle"] copy]; - plotSpace = [coder decodeObjectForKey:@"CPTPlot.plotSpace"]; - cachePrecision = (CPTPlotCachePrecision)[coder decodeIntegerForKey : @"CPTPlot.cachePrecision"]; - needsRelabel = [coder decodeBoolForKey:@"CPTPlot.needsRelabel"]; - adjustLabelAnchors = [coder decodeBoolForKey:@"CPTPlot.adjustLabelAnchors"]; - showLabels = [coder decodeBoolForKey:@"CPTPlot.showLabels"]; - labelOffset = [coder decodeCGFloatForKey:@"CPTPlot.labelOffset"]; - labelRotation = [coder decodeCGFloatForKey:@"CPTPlot.labelRotation"]; - labelField = (NSUInteger)[coder decodeIntegerForKey : @"CPTPlot.labelField"]; - labelTextStyle = [[coder decodeObjectForKey:@"CPTPlot.labelTextStyle"] copy]; - labelFormatter = [coder decodeObjectForKey:@"CPTPlot.labelFormatter"]; - labelShadow = [coder decodeObjectForKey:@"CPTPlot.labelShadow"]; - labelIndexRange = [[coder decodeObjectForKey:@"CPTPlot.labelIndexRange"] rangeValue]; - labelAnnotations = [[coder decodeObjectForKey:@"CPTPlot.labelAnnotations"] mutableCopy]; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder +{ + if ((self = [super initWithCoder:coder])) { + dataSource = [coder decodeObjectOfClass:[NSObject class] + forKey:@"CPTPlot.dataSource"]; + title = [[coder decodeObjectOfClass:[NSString class] + forKey:@"CPTPlot.title"] copy]; + attributedTitle = [[coder decodeObjectOfClass:[NSAttributedString class] + forKey:@"CPTPlot.attributedTitle"] copy]; + plotSpace = [coder decodeObjectOfClass:[CPTPlotSpace class] + forKey:@"CPTPlot.plotSpace"]; + cachePrecision = (CPTPlotCachePrecision)[coder decodeIntegerForKey:@"CPTPlot.cachePrecision"]; + needsRelabel = [coder decodeBoolForKey:@"CPTPlot.needsRelabel"]; + adjustLabelAnchors = [coder decodeBoolForKey:@"CPTPlot.adjustLabelAnchors"]; + showLabels = [coder decodeBoolForKey:@"CPTPlot.showLabels"]; + labelOffset = [coder decodeCGFloatForKey:@"CPTPlot.labelOffset"]; + labelRotation = [coder decodeCGFloatForKey:@"CPTPlot.labelRotation"]; + labelField = (NSUInteger)[coder decodeIntegerForKey:@"CPTPlot.labelField"]; + labelTextStyle = [[coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTPlot.labelTextStyle"] copy]; + labelFormatter = [coder decodeObjectOfClass:[NSFormatter class] + forKey:@"CPTPlot.labelFormatter"]; + labelShadow = [coder decodeObjectOfClass:[CPTShadow class] + forKey:@"CPTPlot.labelShadow"]; + labelIndexRange = [[coder decodeObjectOfClass:[NSValue class] + forKey:@"CPTPlot.labelIndexRange"] rangeValue]; + labelAnnotations = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTAnnotation class]]] + forKey:@"CPTPlot.labelAnnotations"] mutableCopy]; alignsPointsToPixels = [coder decodeBoolForKey:@"CPTPlot.alignsPointsToPixels"]; drawLegendSwatchDecoration = [coder decodeBoolForKey:@"CPTPlot.drawLegendSwatchDecoration"]; // support old archives if ( [coder containsValueForKey:@"CPTPlot.identifier"] ) { - self.identifier = [coder decodeObjectForKey:@"CPTPlot.identifier"]; + self.identifier = [coder decodeObjectOfClass:[NSObject class] + forKey:@"CPTPlot.identifier"]; } // init other properties @@ -443,15 +453,27 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Bindings -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else /// @cond --(Class)valueClassForBinding:(NSString *)binding +-(nullable Class)valueClassForBinding:(nonnull NSString *__unused)binding { return [NSArray class]; } @@ -464,7 +486,7 @@ -(Class)valueClassForBinding:(NSString *)binding /// @cond --(void)drawInContext:(CGContextRef)context +-(void)drawInContext:(nonnull CGContextRef)context { [self reloadDataIfNeeded]; [super drawInContext:context]; @@ -482,9 +504,9 @@ -(void)drawInContext:(CGContextRef)context /// @cond -+(BOOL)needsDisplayForKey:(NSString *)aKey ++(BOOL)needsDisplayForKey:(nonnull NSString *)aKey { - static NSSet *keys = nil; + static NSSet *keys = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ @@ -582,13 +604,13 @@ -(void)insertDataAtIndex:(NSUInteger)idx numberOfRecords:(NSUInteger)numberOfRec NSParameterAssert(idx <= self.cachedDataCount); Class numericClass = [CPTNumericData class]; - for ( id data in [self.cachedData allValues] ) { + for ( id data in self.cachedData.allValues ) { if ( [data isKindOfClass:numericClass] ) { CPTMutableNumericData *numericData = (CPTMutableNumericData *)data; size_t sampleSize = numericData.sampleBytes; size_t length = sampleSize * numberOfRecords; - [(NSMutableData *)numericData.data increaseLengthBy : length]; + [(NSMutableData *) numericData.data increaseLengthBy:length]; int8_t *start = [numericData mutableSamplePointer:idx]; size_t bytesToMove = numericData.data.length - (idx + numberOfRecords) * sampleSize; @@ -606,6 +628,15 @@ -(void)insertDataAtIndex:(NSUInteger)idx numberOfRecords:(NSUInteger)numberOfRec } } + CPTMutableAnnotationArray *labelArray = self.labelAnnotations; + if ( labelArray ) { + id nullObject = [NSNull null]; + NSUInteger lastIndex = idx + numberOfRecords - 1; + for ( NSUInteger i = idx; i <= lastIndex; i++ ) { + [labelArray insertObject:nullObject atIndex:i]; + } + } + self.cachedDataCount += numberOfRecords; [self reloadDataInIndexRange:NSMakeRange(idx, numberOfRecords)]; } @@ -618,7 +649,7 @@ -(void)deleteDataInIndexRange:(NSRange)indexRange NSParameterAssert(NSMaxRange(indexRange) <= self.cachedDataCount); Class numericClass = [CPTNumericData class]; - for ( id data in [self.cachedData allValues] ) { + for ( id data in self.cachedData.allValues ) { if ( [data isKindOfClass:numericClass] ) { CPTMutableNumericData *numericData = (CPTMutableNumericData *)data; size_t sampleSize = numericData.sampleBytes; @@ -633,12 +664,24 @@ -(void)deleteDataInIndexRange:(NSRange)indexRange dataBuffer.length -= length; } else { - [(NSMutableArray *)data removeObjectsInRange : indexRange]; + [(NSMutableArray *) data removeObjectsInRange:indexRange]; + } + } + + CPTMutableAnnotationArray *labelArray = self.labelAnnotations; + + NSUInteger maxIndex = NSMaxRange(indexRange); + Class annotationClass = [CPTAnnotation class]; + + for ( NSUInteger i = indexRange.location; i < maxIndex; i++ ) { + CPTAnnotation *annotation = labelArray[i]; + if ( [annotation isKindOfClass:annotationClass] ) { + [self removeAnnotation:annotation]; } } + [labelArray removeObjectsInRange:indexRange]; self.cachedDataCount -= indexRange.length; - [self relabelIndexRange:NSMakeRange(indexRange.location, self.cachedDataCount - indexRange.location)]; [self setNeedsDisplay]; } @@ -647,7 +690,7 @@ -(void)deleteDataInIndexRange:(NSRange)indexRange **/ -(void)reloadPlotData { - NSMutableDictionary *dataCache = self.cachedData; + NSMutableDictionary *dataCache = self.cachedData; for ( NSNumber *fieldID in self.fieldIdentifiers ) { [dataCache removeObjectForKey:fieldID]; @@ -659,7 +702,7 @@ -(void)reloadPlotData /** @brief Reload plot data in the given index range from the data source immediately. * @param indexRange The index range to load. **/ --(void)reloadPlotDataInIndexRange:(NSRange)indexRange +-(void)reloadPlotDataInIndexRange:(NSRange __unused)indexRange { // do nothing--implementation provided by subclasses } @@ -687,9 +730,9 @@ -(void)reloadDataLabelsInIndexRange:(NSRange)indexRange atRecordIndex:indexRange.location]; } else if ( [theDataSource respondsToSelector:@selector(dataLabelForPlot:recordIndex:)] ) { - id nilObject = [CPTPlot nilData]; - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableLayerArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTLayer *labelLayer = [theDataSource dataLabelForPlot:self recordIndex:idx]; @@ -712,7 +755,7 @@ -(void)reloadDataLabelsInIndexRange:(NSRange)indexRange /** * @brief A unique marker object used in collections to indicate that the datasource returned @nil. **/ -+(id)nilData ++(nonnull id)nilData { static id nilObject = nil; static dispatch_once_t onceToken = 0; @@ -729,7 +772,7 @@ +(id)nilData * @param indexRange The range of the data indexes of interest. * @return An array of data points. **/ --(id)numbersFromDataSourceForField:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange +-(nullable id)numbersFromDataSourceForField:(NSUInteger)fieldEnum recordIndexRange:(NSRange)indexRange { id numbers; // can be CPTNumericData, NSArray, or NSData @@ -757,7 +800,7 @@ -(id)numbersFromDataSourceForField:(NSUInteger)fieldEnum recordIndexRange:(NSRan else if ( [theDataSource respondsToSelector:@selector(doubleForPlot:field:recordIndex:)] ) { NSUInteger recordIndex; NSMutableData *fieldData = [NSMutableData dataWithLength:sizeof(double) * indexRange.length]; - double *fieldValues = [fieldData mutableBytes]; + double *fieldValues = fieldData.mutableBytes; for ( recordIndex = indexRange.location; recordIndex < indexRange.location + indexRange.length; ++recordIndex ) { double number = [theDataSource doubleForPlot:self field:fieldEnum recordIndex:recordIndex]; *fieldValues++ = number; @@ -812,24 +855,24 @@ -(BOOL)loadNumbersForAllFieldsFromDataSourceInRecordIndexRange:(NSRange)indexRan const NSUInteger sampleCount = data.numberOfSamples; CPTNumericDataType dataType = data.dataType; - if ( (sampleCount > 0) && (data.numberOfDimensions == 2) ) { - NSArray *theShape = data.shape; - const NSUInteger rowCount = [theShape[0] unsignedIntegerValue]; - const NSUInteger fieldCount = [theShape[1] unsignedIntegerValue]; + if ((sampleCount > 0) && (data.numberOfDimensions == 2)) { + CPTNumberArray *theShape = data.shape; + const NSUInteger rowCount = theShape[0].unsignedIntegerValue; + const NSUInteger fieldCount = theShape[1].unsignedIntegerValue; if ( fieldCount > 0 ) { // convert data type if needed switch ( self.cachePrecision ) { case CPTPlotCachePrecisionAuto: if ( self.doublePrecisionCache ) { - if ( !CPTDataTypeEqualToDataType(dataType, self.doubleDataType) ) { + if ( !CPTDataTypeEqualToDataType(dataType, self.doubleDataType)) { CPTMutableNumericData *mutableData = [data mutableCopy]; mutableData.dataType = self.doubleDataType; data = mutableData; } } else { - if ( !CPTDataTypeEqualToDataType(dataType, self.decimalDataType) ) { + if ( !CPTDataTypeEqualToDataType(dataType, self.decimalDataType)) { CPTMutableNumericData *mutableData = [data mutableCopy]; mutableData.dataType = self.decimalDataType; data = mutableData; @@ -838,7 +881,7 @@ -(BOOL)loadNumbersForAllFieldsFromDataSourceInRecordIndexRange:(NSRange)indexRan break; case CPTPlotCachePrecisionDecimal: - if ( !CPTDataTypeEqualToDataType(dataType, self.decimalDataType) ) { + if ( !CPTDataTypeEqualToDataType(dataType, self.decimalDataType)) { CPTMutableNumericData *mutableData = [data mutableCopy]; mutableData.dataType = self.decimalDataType; data = mutableData; @@ -846,7 +889,7 @@ -(BOOL)loadNumbersForAllFieldsFromDataSourceInRecordIndexRange:(NSRange)indexRan break; case CPTPlotCachePrecisionDouble: - if ( !CPTDataTypeEqualToDataType(dataType, self.doubleDataType) ) { + if ( !CPTDataTypeEqualToDataType(dataType, self.doubleDataType)) { CPTMutableNumericData *mutableData = [data mutableCopy]; mutableData.dataType = self.doubleDataType; data = mutableData; @@ -865,7 +908,7 @@ -(BOOL)loadNumbersForAllFieldsFromDataSourceInRecordIndexRange:(NSRange)indexRan for ( NSUInteger fieldNum = 0; fieldNum < fieldCount; fieldNum++ ) { NSMutableData *tempData = [[NSMutableData alloc] initWithLength:bufferLength]; - if ( CPTDataTypeEqualToDataType(dataType, self.doubleDataType) ) { + if ( CPTDataTypeEqualToDataType(dataType, self.doubleDataType)) { const double *sourceData = [data samplePointerAtIndex:0, fieldNum]; double *destData = tempData.mutableBytes; @@ -930,7 +973,7 @@ -(NSUInteger)cachedDataCount * @param numbers An array of numbers to cache. Can be a CPTNumericData, NSArray, or NSData (NSData is assumed to be a c-style array of type @double). * @param fieldEnum The field enumerator identifying the field. **/ --(void)cacheNumbers:(id)numbers forField:(NSUInteger)fieldEnum +-(void)cacheNumbers:(nullable id)numbers forField:(NSUInteger)fieldEnum { NSNumber *cacheKey = @(fieldEnum); @@ -941,8 +984,10 @@ -(void)cacheNumbers:(id)numbers forField:(NSUInteger)fieldEnum switch ( [thePlotSpace scaleTypeForCoordinate:coordinate] ) { case CPTScaleTypeLinear: case CPTScaleTypeLog: + case CPTScaleTypeLogModulus: { - CPTMutableNumericData *mutableNumbers = [self numericDataForNumbers:numbers]; + id theNumbers = numbers; + CPTMutableNumericData *mutableNumbers = [self numericDataForNumbers:theNumbers]; NSUInteger sampleCount = mutableNumbers.numberOfSamples; if ( sampleCount > 0 ) { @@ -972,13 +1017,13 @@ -(void)cacheNumbers:(id)numbers forField:(NSUInteger)fieldEnum case CPTScaleTypeCategory: { - NSArray *samples = (NSArray *)numbers; + CPTStringArray *samples = (CPTStringArray *)numbers; if ( [samples isKindOfClass:[NSArray class]] ) { [thePlotSpace setCategories:samples forCoordinate:coordinate]; NSUInteger sampleCount = samples.count; if ( sampleCount > 0 ) { - NSMutableArray *indices = [[NSMutableArray alloc] initWithCapacity:sampleCount]; + CPTMutableNumberArray *indices = [[NSMutableArray alloc] initWithCapacity:sampleCount]; for ( NSString *category in samples ) { [indices addObject:@([thePlotSpace indexOfCategory:category forCoordinate:coordinate])]; @@ -1021,7 +1066,7 @@ -(void)cacheNumbers:(id)numbers forField:(NSUInteger)fieldEnum * @param fieldEnum The field enumerator identifying the field. * @param idx The index of the first data point to replace. **/ --(void)cacheNumbers:(id)numbers forField:(NSUInteger)fieldEnum atRecordIndex:(NSUInteger)idx +-(void)cacheNumbers:(nullable id)numbers forField:(NSUInteger)fieldEnum atRecordIndex:(NSUInteger)idx { if ( numbers ) { NSNumber *cacheKey = @(fieldEnum); @@ -1035,8 +1080,10 @@ -(void)cacheNumbers:(id)numbers forField:(NSUInteger)fieldEnum atRecordIndex:(NS switch ( [thePlotSpace scaleTypeForCoordinate:coordinate] ) { case CPTScaleTypeLinear: case CPTScaleTypeLog: + case CPTScaleTypeLogModulus: { - mutableNumbers = [self numericDataForNumbers:numbers]; + id theNumbers = numbers; + mutableNumbers = [self numericDataForNumbers:theNumbers]; sampleCount = mutableNumbers.numberOfSamples; if ( sampleCount > 0 ) { @@ -1068,11 +1115,11 @@ -(void)cacheNumbers:(id)numbers forField:(NSUInteger)fieldEnum atRecordIndex:(NS case CPTScaleTypeCategory: { - NSArray *samples = (NSArray *)numbers; + CPTStringArray *samples = (CPTStringArray *)numbers; if ( [samples isKindOfClass:[NSArray class]] ) { sampleCount = samples.count; if ( sampleCount > 0 ) { - NSMutableArray *indices = [[NSMutableArray alloc] initWithCapacity:sampleCount]; + CPTMutableNumberArray *indices = [[NSMutableArray alloc] initWithCapacity:sampleCount]; for ( NSString *category in samples ) { [thePlotSpace addCategory:category forCoordinate:coordinate]; @@ -1094,7 +1141,7 @@ -(void)cacheNumbers:(id)numbers forField:(NSUInteger)fieldEnum atRecordIndex:(NS break; } - if ( mutableNumbers && (sampleCount > 0) ) { + if ( mutableNumbers && (sampleCount > 0)) { // Ensure the data cache exists and is the right size CPTMutableNumericData *cachedNumbers = (self.cachedData)[cacheKey]; if ( !cachedNumbers ) { @@ -1124,7 +1171,7 @@ -(void)cacheNumbers:(id)numbers forField:(NSUInteger)fieldEnum atRecordIndex:(NS /// @cond --(CPTMutableNumericData *)numericDataForNumbers:(id)numbers +-(nonnull CPTMutableNumericData *)numericDataForNumbers:(nonnull id)numbers { CPTMutableNumericData *mutableNumbers = nil; CPTNumericDataType loadedDataType; @@ -1133,7 +1180,7 @@ -(CPTMutableNumericData *)numericDataForNumbers:(id)numbers mutableNumbers = [numbers mutableCopy]; // ensure the numeric data is in a supported format; default to double if not already NSDecimal if ( !CPTDataTypeEqualToDataType(mutableNumbers.dataType, self.decimalDataType) && - !CPTDataTypeEqualToDataType(mutableNumbers.dataType, self.doubleDataType) ) { + !CPTDataTypeEqualToDataType(mutableNumbers.dataType, self.doubleDataType)) { mutableNumbers.dataType = self.doubleDataType; } } @@ -1142,10 +1189,10 @@ -(CPTMutableNumericData *)numericDataForNumbers:(id)numbers mutableNumbers = [[CPTMutableNumericData alloc] initWithData:numbers dataType:loadedDataType shape:nil]; } else if ( [numbers isKindOfClass:[NSArray class]] ) { - if ( ( (NSArray *)numbers ).count == 0 ) { + if (((CPTNumberArray *)numbers).count == 0 ) { loadedDataType = self.doubleDataType; } - else if ( [( (NSArray *)numbers )[0] isKindOfClass :[NSDecimalNumber class]] ) { + else if ( [((NSArray *)numbers)[0] isKindOfClass:[NSDecimalNumber class]] ) { loadedDataType = self.decimalDataType; } else { @@ -1170,11 +1217,11 @@ -(BOOL)doublePrecisionCache switch ( self.cachePrecision ) { case CPTPlotCachePrecisionAuto: { - NSMutableDictionary *dataCache = self.cachedData; - Class numberClass = [NSNumber class]; - for ( id key in [dataCache allKeys] ) { + NSMutableDictionary *dataCache = self.cachedData; + Class numberClass = [NSNumber class]; + for ( id key in dataCache.allKeys ) { if ( [key isKindOfClass:numberClass] ) { - result = CPTDataTypeEqualToDataType([(CPTMutableNumericData *)dataCache[key] dataType], self.doubleDataType); + result = CPTDataTypeEqualToDataType(((CPTMutableNumericData *)dataCache[key]).dataType, self.doubleDataType); break; } } @@ -1196,7 +1243,7 @@ -(BOOL)doublePrecisionCache * @param fieldEnum The field enumerator identifying the field. * @return The array of cached numbers. **/ --(CPTMutableNumericData *)cachedNumbersForField:(NSUInteger)fieldEnum +-(nullable CPTMutableNumericData *)cachedNumbersForField:(NSUInteger)fieldEnum { return (self.cachedData)[@(fieldEnum)]; } @@ -1206,7 +1253,7 @@ -(CPTMutableNumericData *)cachedNumbersForField:(NSUInteger)fieldEnum * @param idx The index of the desired data value. * @return The cached number. **/ --(NSNumber *)cachedNumberForField:(NSUInteger)fieldEnum recordIndex:(NSUInteger)idx +-(nullable NSNumber *)cachedNumberForField:(NSUInteger)fieldEnum recordIndex:(NSUInteger)idx { CPTMutableNumericData *numbers = [self cachedNumbersForField:fieldEnum]; @@ -1247,7 +1294,7 @@ -(double)cachedDoubleForField:(NSUInteger)fieldEnum recordIndex:(NSUInteger)idx break; } } - return NAN; + return (double)NAN; } /** @brief Retrieves a single number from the cache. @@ -1291,10 +1338,11 @@ -(NSDecimal)cachedDecimalForField:(NSUInteger)fieldEnum recordIndex:(NSUInteger) -(void)setCachedDataType:(CPTNumericDataType)newDataType { - Class numberClass = [NSNumber class]; - NSMutableDictionary *dataDictionary = self.cachedData; + Class numberClass = [NSNumber class]; + + NSMutableDictionary *dataDictionary = self.cachedData; - for ( id key in [dataDictionary allKeys] ) { + for ( id key in dataDictionary.allKeys ) { if ( [key isKindOfClass:numberClass] ) { CPTMutableNumericData *numericData = dataDictionary[key]; numericData.dataType = newDataType; @@ -1310,7 +1358,7 @@ -(CPTNumericDataType)doubleDataType static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - dataType = CPTDataType( CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent() ); + dataType = CPTDataType(CPTFloatingPointDataType, sizeof(double), CFByteOrderGetCurrent()); }); return dataType; @@ -1322,7 +1370,7 @@ -(CPTNumericDataType)decimalDataType static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ - dataType = CPTDataType( CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent() ); + dataType = CPTDataType(CPTDecimalDataType, sizeof(NSDecimal), CFByteOrderGetCurrent()); }); return dataType; @@ -1332,7 +1380,7 @@ -(CPTNumericDataType)decimalDataType * @param key The key identifying the field. * @return The array of cached values. **/ --(NSArray *)cachedArrayForKey:(NSString *)key +-(nullable NSArray *)cachedArrayForKey:(nonnull NSString *)key { return (self.cachedData)[key]; } @@ -1342,7 +1390,7 @@ -(NSArray *)cachedArrayForKey:(NSString *)key * @param idx The index of the desired data value. * @return The cached value or @nil if no data is cached for the requested key. **/ --(id)cachedValueForKey:(NSString *)key recordIndex:(NSUInteger)idx +-(nullable id)cachedValueForKey:(nonnull NSString *)key recordIndex:(NSUInteger)idx { return [self cachedArrayForKey:key][idx]; } @@ -1351,7 +1399,7 @@ -(id)cachedValueForKey:(NSString *)key recordIndex:(NSUInteger)idx * @param array An array of arbitrary values to cache. * @param key The key identifying the field. **/ --(void)cacheArray:(NSArray *)array forKey:(NSString *)key +-(void)cacheArray:(nullable NSArray *)array forKey:(nonnull NSString *)key { if ( array ) { NSUInteger sampleCount = array.count; @@ -1375,28 +1423,29 @@ -(void)cacheArray:(NSArray *)array forKey:(NSString *)key * @param key The key identifying the field. * @param idx The index of the first data point to replace. **/ --(void)cacheArray:(NSArray *)array forKey:(NSString *)key atRecordIndex:(NSUInteger)idx +-(void)cacheArray:(nullable NSArray *)array forKey:(nonnull NSString *)key atRecordIndex:(NSUInteger)idx { - if ( array ) { - NSUInteger sampleCount = array.count; - if ( sampleCount > 0 ) { - // Ensure the data cache exists and is the right size - id theDataSource = self.dataSource; - NSUInteger numberOfRecords = [theDataSource numberOfRecordsForPlot:self]; - NSMutableArray *cachedValues = (self.cachedData)[key]; - if ( !cachedValues ) { - cachedValues = [NSMutableArray arrayWithCapacity:numberOfRecords]; - NSNull *nullObject = [NSNull null]; - for ( NSUInteger i = 0; i < numberOfRecords; i++ ) { - [cachedValues addObject:nullObject]; - } - (self.cachedData)[key] = cachedValues; - } + NSUInteger sampleCount = array.count; - // Update the cache - self.cachedDataCount = numberOfRecords; - [cachedValues replaceObjectsInRange:NSMakeRange(idx, sampleCount) withObjectsFromArray:array]; + if ( sampleCount > 0 ) { + // Ensure the data cache exists and is the right size + id theDataSource = self.dataSource; + NSUInteger numberOfRecords = [theDataSource numberOfRecordsForPlot:self]; + NSMutableArray *cachedValues = (self.cachedData)[key]; + if ( !cachedValues ) { + cachedValues = [NSMutableArray arrayWithCapacity:numberOfRecords]; + NSNull *nullObject = [NSNull null]; + for ( NSUInteger i = 0; i < numberOfRecords; i++ ) { + [cachedValues addObject:nullObject]; + } + (self.cachedData)[key] = cachedValues; } + + // Update the cache + self.cachedDataCount = numberOfRecords; + + NSArray *dataArray = array; + [cachedValues replaceObjectsInRange:NSMakeRange(idx, sampleCount) withObjectsFromArray:dataArray]; } } @@ -1407,7 +1456,7 @@ -(void)cacheArray:(NSArray *)array forKey:(NSString *)key atRecordIndex:(NSUInte * @param fieldEnum The field enumerator identifying the field. * @return The plot range enclosing the data. **/ --(CPTPlotRange *)plotRangeForField:(NSUInteger)fieldEnum +-(nullable CPTPlotRange *)plotRangeForField:(NSUInteger)fieldEnum { if ( self.dataNeedsReloading ) { [self reloadData]; @@ -1418,60 +1467,51 @@ -(CPTPlotRange *)plotRangeForField:(NSUInteger)fieldEnum NSUInteger numberOfSamples = numbers.numberOfSamples; if ( numberOfSamples > 0 ) { if ( self.doublePrecisionCache ) { - const double *doubles = (const double *)numbers.bytes; - - double min = INFINITY; - double max = -INFINITY; - - vDSP_minvD(doubles, 1, &min, (vDSP_Length)numberOfSamples); - vDSP_maxvD(doubles, 1, &max, (vDSP_Length)numberOfSamples); - - if ( isnan(min) || isnan(max) ) { - // vDSP functions may return NAN if any data in the array is NAN - min = INFINITY; - max = -INFINITY; + double min = (double)INFINITY; + double max = -(double)INFINITY; - const double *lastSample = doubles + numberOfSamples; + const double *doubles = (const double *)numbers.bytes; + const double *lastSample = doubles + numberOfSamples; - while ( doubles < lastSample ) { - double value = *doubles++; + while ( doubles < lastSample ) { + double value = *doubles++; - if ( !isnan(value) ) { - if ( value < min ) { - min = value; - } - if ( value > max ) { - max = value; - } + if ( !isnan(value)) { + if ( value < min ) { + min = value; + } + if ( value > max ) { + max = value; } } } if ( max >= min ) { - range = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(min) length:CPTDecimalFromDouble(max - min)]; + range = [CPTPlotRange plotRangeWithLocation:@(min) length:@(max - min)]; } } else { - NSDecimal min = [[NSDecimalNumber maximumDecimalNumber] decimalValue]; - NSDecimal max = [[NSDecimalNumber minimumDecimalNumber] decimalValue]; + NSDecimal min = [NSDecimalNumber maximumDecimalNumber].decimalValue; + NSDecimal max = [NSDecimalNumber minimumDecimalNumber].decimalValue; const NSDecimal *decimals = (const NSDecimal *)numbers.bytes; const NSDecimal *lastSample = decimals + numberOfSamples; + while ( decimals < lastSample ) { NSDecimal value = *decimals++; - if ( !NSDecimalIsNotANumber(&value) ) { - if ( CPTDecimalLessThan(value, min) ) { + if ( !NSDecimalIsNotANumber(&value)) { + if ( CPTDecimalLessThan(value, min)) { min = value; } - if ( CPTDecimalGreaterThan(value, max) ) { + if ( CPTDecimalGreaterThan(value, max)) { max = value; } } } - if ( CPTDecimalGreaterThanOrEqualTo(max, min) ) { - range = [CPTPlotRange plotRangeWithLocation:min length:CPTDecimalSubtract(max, min)]; + if ( CPTDecimalGreaterThanOrEqualTo(max, min)) { + range = [CPTPlotRange plotRangeWithLocationDecimal:min lengthDecimal:CPTDecimalSubtract(max, min)]; } } } @@ -1482,9 +1522,44 @@ -(CPTPlotRange *)plotRangeForField:(NSUInteger)fieldEnum * @param coord The coordinate identifier. * @return The plot range enclosing the data. **/ --(CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord +-(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord +{ + CPTNumberArray *fields = [self fieldIdentifiersForCoordinate:coord]; + + if ( fields.count == 0 ) { + return nil; + } + + CPTMutablePlotRange *unionRange = nil; + for ( NSNumber *field in fields ) { + CPTPlotRange *currentRange = [self plotRangeForField:field.unsignedIntegerValue]; + if ( !unionRange ) { + unionRange = [currentRange mutableCopy]; + } + else { + [unionRange unionPlotRange:[self plotRangeForField:field.unsignedIntegerValue]]; + } + } + + return unionRange; +} + +/** @brief Determines the smallest plot range that fully encloses the entire plot for a particular field. + * @param fieldEnum The field enumerator identifying the field. + * @return The plot range enclosing the data. + **/ +-(nullable CPTPlotRange *)plotRangeEnclosingField:(NSUInteger)fieldEnum +{ + return [self plotRangeForField:fieldEnum]; +} + +/** @brief Determines the smallest plot range that fully encloses the entire plot for a particular coordinate. + * @param coord The coordinate identifier. + * @return The plot range enclosing the data. + **/ +-(nullable CPTPlotRange *)plotRangeEnclosingCoordinate:(CPTCoordinate)coord { - NSArray *fields = [self fieldIdentifiersForCoordinate:coord]; + CPTNumberArray *fields = [self fieldIdentifiersForCoordinate:coord]; if ( fields.count == 0 ) { return nil; @@ -1492,12 +1567,12 @@ -(CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coord CPTMutablePlotRange *unionRange = nil; for ( NSNumber *field in fields ) { - CPTPlotRange *currentRange = [self plotRangeForField:field.unsignedIntValue]; + CPTPlotRange *currentRange = [self plotRangeEnclosingField:field.unsignedIntegerValue]; if ( !unionRange ) { unionRange = [currentRange mutableCopy]; } else { - [unionRange unionPlotRange:[self plotRangeForField:field.unsignedIntValue]]; + [unionRange unionPlotRange:[self plotRangeEnclosingField:field.unsignedIntegerValue]]; } } @@ -1528,7 +1603,7 @@ -(void)relabel self.needsRelabel = NO; - NSNull *nullObject = [NSNull null]; + id nullObject = [NSNull null]; Class nullClass = [NSNull class]; Class annotationClass = [CPTAnnotation class]; @@ -1536,8 +1611,8 @@ -(void)relabel NSFormatter *dataLabelFormatter = self.labelFormatter; BOOL plotProvidesLabels = dataLabelTextStyle && dataLabelFormatter; - BOOL hasCachedLabels = NO; - NSMutableArray *cachedLabels = (NSMutableArray *)[self cachedArrayForKey:CPTPlotBindingDataLabels]; + BOOL hasCachedLabels = NO; + CPTMutableLayerArray *cachedLabels = (CPTMutableLayerArray *)[self cachedArrayForKey:CPTPlotBindingDataLabels]; for ( CPTLayer *label in cachedLabels ) { if ( ![label isKindOfClass:nullClass] ) { hasCachedLabels = YES; @@ -1545,7 +1620,7 @@ -(void)relabel } } - if ( !self.showLabels || (!hasCachedLabels && !plotProvidesLabels) ) { + if ( !self.showLabels || (!hasCachedLabels && !plotProvidesLabels)) { for ( CPTAnnotation *annotation in self.labelAnnotations ) { if ( [annotation isKindOfClass:annotationClass] ) { [self removeAnnotation:annotation]; @@ -1555,9 +1630,9 @@ -(void)relabel return; } - NSDictionary *textAttributes = [dataLabelTextStyle attributes]; - BOOL hasAttributedFormatter = ([dataLabelFormatter attributedStringForObjectValue:[NSDecimalNumber zero] - withDefaultAttributes:textAttributes] != nil); + CPTDictionary *textAttributes = dataLabelTextStyle.attributes; + BOOL hasAttributedFormatter = ([dataLabelFormatter attributedStringForObjectValue:[NSDecimalNumber zero] + withDefaultAttributes:textAttributes] != nil); NSUInteger sampleCount = self.cachedDataCount; NSRange indexRange = self.labelIndexRange; @@ -1567,11 +1642,11 @@ -(void)relabel self.labelAnnotations = [NSMutableArray arrayWithCapacity:sampleCount]; } - CPTPlotSpace *thePlotSpace = self.plotSpace; - CGFloat theRotation = self.labelRotation; - NSMutableArray *labelArray = self.labelAnnotations; - NSUInteger oldLabelCount = labelArray.count; - id nilObject = [CPTPlot nilData]; + CPTPlotSpace *thePlotSpace = self.plotSpace; + CGFloat theRotation = self.labelRotation; + CPTMutableAnnotationArray *labelArray = self.labelAnnotations; + NSUInteger oldLabelCount = labelArray.count; + id nilObject = [CPTPlot nilData]; CPTMutableNumericData *labelFieldDataCache = [self cachedNumbersForField:self.labelField]; CPTShadow *theShadow = self.labelShadow; @@ -1580,13 +1655,13 @@ -(void)relabel NSNumber *dataValue = [labelFieldDataCache sampleValue:i]; CPTLayer *newLabelLayer; - if ( isnan([dataValue doubleValue]) ) { + if ( isnan([dataValue doubleValue])) { newLabelLayer = nil; } else { newLabelLayer = [self cachedValueForKey:CPTPlotBindingDataLabels recordIndex:i]; - if ( ( (newLabelLayer == nil) || (newLabelLayer == nilObject) ) && plotProvidesLabels ) { + if (((newLabelLayer == nil) || (newLabelLayer == nilObject)) && plotProvidesLabels ) { if ( hasAttributedFormatter ) { NSAttributedString *labelString = [dataLabelFormatter attributedStringForObjectValue:dataValue withDefaultAttributes:textAttributes]; newLabelLayer = [[CPTTextLayer alloc] initWithAttributedText:labelString]; @@ -1597,7 +1672,7 @@ -(void)relabel } } - if ( [newLabelLayer isKindOfClass:nullClass] || (newLabelLayer == nilObject) ) { + if ( [newLabelLayer isKindOfClass:nullClass] || (newLabelLayer == nilObject)) { newLabelLayer = nil; } } @@ -1661,18 +1736,18 @@ -(void)relabelIndexRange:(NSRange)indexRange /// @cond --(void)updateContentAnchorForLabel:(CPTPlotSpaceAnnotation *)label +-(void)updateContentAnchorForLabel:(nonnull CPTPlotSpaceAnnotation *)label { if ( label && self.adjustLabelAnchors ) { CGPoint displacement = label.displacement; - if ( CGPointEqualToPoint(displacement, CGPointZero) ) { + if ( CGPointEqualToPoint(displacement, CGPointZero)) { displacement.y = CPTFloat(1.0); // put the label above the data point if zero displacement } CGFloat angle = CPTFloat(M_PI) + atan2(displacement.y, displacement.x) - label.rotation; CGFloat newAnchorX = cos(angle); CGFloat newAnchorY = sin(angle); - if ( ABS(newAnchorX) <= ABS(newAnchorY) ) { + if ( ABS(newAnchorX) <= ABS(newAnchorY)) { newAnchorX /= ABS(newAnchorY); newAnchorY = signbit(newAnchorY) ? CPTFloat(-1.0) : CPTFloat(1.0); } @@ -1681,7 +1756,7 @@ -(void)updateContentAnchorForLabel:(CPTPlotSpaceAnnotation *)label newAnchorX = signbit(newAnchorX) ? CPTFloat(-1.0) : CPTFloat(1.0); } - label.contentAnchorPoint = CPTPointMake( ( newAnchorX + CPTFloat(1.0) ) / CPTFloat(2.0), ( newAnchorY + CPTFloat(1.0) ) / CPTFloat(2.0) ); + label.contentAnchorPoint = CPTPointMake((newAnchorX + CPTFloat(1.0)) / CPTFloat(2.0), (newAnchorY + CPTFloat(1.0)) / CPTFloat(2.0)); } } @@ -1692,9 +1767,9 @@ -(void)updateContentAnchorForLabel:(CPTPlotSpaceAnnotation *)label **/ -(void)repositionAllLabelAnnotations { - NSArray *annotations = self.labelAnnotations; - NSUInteger labelCount = annotations.count; - Class annotationClass = [CPTAnnotation class]; + CPTAnnotationArray *annotations = self.labelAnnotations; + NSUInteger labelCount = annotations.count; + Class annotationClass = [CPTAnnotation class]; for ( NSUInteger i = 0; i < labelCount; i++ ) { CPTPlotSpaceAnnotation *annotation = annotations[i]; @@ -1720,7 +1795,7 @@ -(NSUInteger)numberOfLegendEntries * @param idx The index of the desired title. * @return The title of the legend entry at the requested index. **/ --(NSString *)titleForLegendEntryAtIndex:(NSUInteger)idx +-(nullable NSString *)titleForLegendEntryAtIndex:(NSUInteger __unused)idx { NSString *legendTitle = self.title; @@ -1739,7 +1814,7 @@ -(NSString *)titleForLegendEntryAtIndex:(NSUInteger)idx * @param idx The index of the desired title. * @return The styled title of the legend entry at the requested index. **/ --(NSAttributedString *)attributedTitleForLegendEntryAtIndex:(NSUInteger)idx +-(nullable NSAttributedString *)attributedTitleForLegendEntryAtIndex:(NSUInteger __unused)idx { NSAttributedString *legendTitle = self.attributedTitle; @@ -1761,11 +1836,12 @@ -(NSAttributedString *)attributedTitleForLegendEntryAtIndex:(NSUInteger)idx * @param rect The bounding rectangle where the swatch should be drawn. * @param context The graphics context to draw into. **/ --(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(CGContextRef)context +-(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(nonnull CGContextRef)context { id theDelegate = (id)self.delegate; CPTFill *theFill = nil; + if ( [theDelegate respondsToSelector:@selector(legend:fillForSwatchAtIndex:forPlot:)] ) { theFill = [theDelegate legend:legend fillForSwatchAtIndex:idx forPlot:self]; } @@ -1822,7 +1898,7 @@ -(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(C * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { self.pointingDeviceDownLabelIndex = NSNotFound; @@ -1832,15 +1908,15 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(plot:dataLabelTouchDownAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(plot:dataLabelTouchDownAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(plot:dataLabelWasSelectedAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(plot:dataLabelWasSelectedAtRecordIndex:withEvent:)] ) { // Inform delegate if a label was hit - NSMutableArray *labelArray = self.labelAnnotations; - NSUInteger labelCount = labelArray.count; - Class annotationClass = [CPTAnnotation class]; + CPTMutableAnnotationArray *labelArray = self.labelAnnotations; + NSUInteger labelCount = labelArray.count; + Class annotationClass = [CPTAnnotation class]; for ( NSUInteger idx = 0; idx < labelCount; idx++ ) { CPTPlotSpaceAnnotation *annotation = labelArray[idx]; @@ -1849,7 +1925,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact if ( labelLayer && !labelLayer.hidden ) { CGPoint labelPoint = [theGraph convertPoint:interactionPoint toLayer:labelLayer]; - if ( CGRectContainsPoint(labelLayer.bounds, labelPoint) ) { + if ( CGRectContainsPoint(labelLayer.bounds, labelPoint)) { self.pointingDeviceDownLabelIndex = idx; BOOL handled = NO; @@ -1898,7 +1974,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { NSUInteger selectedDownIndex = self.pointingDeviceDownLabelIndex; @@ -1910,15 +1986,15 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(plot:dataLabelTouchUpAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(plot:dataLabelTouchUpAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(plot:dataLabelWasSelectedAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(plot:dataLabelWasSelectedAtRecordIndex:withEvent:)] ) { // Inform delegate if a label was hit - NSMutableArray *labelArray = self.labelAnnotations; - NSUInteger labelCount = labelArray.count; - Class annotationClass = [CPTAnnotation class]; + CPTMutableAnnotationArray *labelArray = self.labelAnnotations; + NSUInteger labelCount = labelArray.count; + Class annotationClass = [CPTAnnotation class]; for ( NSUInteger idx = 0; idx < labelCount; idx++ ) { CPTPlotSpaceAnnotation *annotation = labelArray[idx]; @@ -1927,7 +2003,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio if ( labelLayer && !labelLayer.hidden ) { CGPoint labelPoint = [theGraph convertPoint:interactionPoint toLayer:labelLayer]; - if ( CGRectContainsPoint(labelLayer.bounds, labelPoint) ) { + if ( CGRectContainsPoint(labelLayer.bounds, labelPoint)) { BOOL handled = NO; if ( [theDelegate respondsToSelector:@selector(plot:dataLabelTouchUpAtRecordIndex:)] ) { @@ -1971,18 +2047,18 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio /// @cond --(NSArray *)dataLabels +-(nullable CPTLayerArray *)dataLabels { return [self cachedArrayForKey:CPTPlotBindingDataLabels]; } --(void)setDataLabels:(NSArray *)newDataLabels +-(void)setDataLabels:(nullable CPTLayerArray *)newDataLabels { [self cacheArray:newDataLabels forKey:CPTPlotBindingDataLabels]; [self setNeedsRelabel]; } --(void)setTitle:(NSString *)newTitle +-(void)setTitle:(nullable NSString *)newTitle { if ( newTitle != title ) { title = [newTitle copy]; @@ -1997,7 +2073,7 @@ -(void)setTitle:(NSString *)newTitle } } --(void)setAttributedTitle:(NSAttributedString *)newTitle +-(void)setAttributedTitle:(nullable NSAttributedString *)newTitle { if ( newTitle != attributedTitle ) { attributedTitle = [newTitle copy]; @@ -2012,7 +2088,7 @@ -(void)setAttributedTitle:(NSAttributedString *)newTitle } } --(void)setDataSource:(id)newSource +-(void)setDataSource:(nullable id)newSource { if ( newSource != dataSource ) { dataSource = newSource; @@ -2030,7 +2106,7 @@ -(void)setDataNeedsReloading:(BOOL)newDataNeedsReloading } } --(CPTPlotArea *)plotArea +-(nullable CPTPlotArea *)plotArea { CPTGraph *theGraph = self.graph; @@ -2058,7 +2134,7 @@ -(void)setShowLabels:(BOOL)newShowLabels } } --(void)setLabelTextStyle:(CPTTextStyle *)newStyle +-(void)setLabelTextStyle:(nullable CPTTextStyle *)newStyle { if ( newStyle != labelTextStyle ) { labelTextStyle = [newStyle copy]; @@ -2098,7 +2174,7 @@ -(void)setLabelRotation:(CGFloat)newRotation } } --(void)setLabelFormatter:(NSFormatter *)newTickLabelFormatter +-(void)setLabelFormatter:(nullable NSFormatter *)newTickLabelFormatter { if ( newTickLabelFormatter != labelFormatter ) { labelFormatter = newTickLabelFormatter; @@ -2106,7 +2182,7 @@ -(void)setLabelFormatter:(NSFormatter *)newTickLabelFormatter } } --(void)setLabelShadow:(CPTShadow *)newLabelShadow +-(void)setLabelShadow:(nullable CPTShadow *)newLabelShadow { if ( newLabelShadow != labelShadow ) { labelShadow = newLabelShadow; @@ -2151,7 +2227,7 @@ -(void)setAlignsPointsToPixels:(BOOL)newAlignsPointsToPixels -(void)setHidden:(BOOL)newHidden { if ( newHidden != self.hidden ) { - [super setHidden:newHidden]; + super.hidden = newHidden; [self setNeedsRelabel]; } } @@ -2178,7 +2254,7 @@ -(NSUInteger)numberOfFields /** @brief Identifiers (enum values) identifying the fields. * @return Array of NSNumber objects for the various field identifiers. **/ --(NSArray *)fieldIdentifiers +-(nonnull CPTNumberArray *)fieldIdentifiers { return @[]; } @@ -2187,7 +2263,7 @@ -(NSArray *)fieldIdentifiers * @param coord The coordinate for which the corresponding field identifiers are desired. * @return Array of NSNumber objects for the field identifiers. **/ --(NSArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord +-(nonnull CPTNumberArray *)fieldIdentifiersForCoordinate:(CPTCoordinate __unused)coord { return @[]; } @@ -2196,7 +2272,7 @@ -(NSArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord * @param field The field identifier for which the corresponding coordinate is desired. * @return The coordinate that corresponds to a particular field identifier or #CPTCoordinateNone if there is no matching coordinate. */ --(CPTCoordinate)coordinateForFieldIdentifier:(NSUInteger)field +-(CPTCoordinate)coordinateForFieldIdentifier:(NSUInteger __unused)field { return CPTCoordinateNone; } @@ -2208,7 +2284,7 @@ -(CPTCoordinate)coordinateForFieldIdentifier:(NSUInteger)field * @param label The annotation for the data label. * @param idx The data index for the label. **/ --(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx +-(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *__unused)label forIndex:(NSUInteger __unused)idx { // do nothing--implementation provided by subclasses } @@ -2221,7 +2297,7 @@ -(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInte * @param point The coordinates of the interaction. * @return The index of the data point that is under the given point or @ref NSNotFound if none was found. */ --(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point +-(NSUInteger)dataIndexFromInteractionPoint:(CGPoint __unused)point { return NSNotFound; } diff --git a/framework/Source/CPTPlotArea.h b/framework/Source/CPTPlotArea.h index 3dc01bf99..1d29c5f78 100644 --- a/framework/Source/CPTPlotArea.h +++ b/framework/Source/CPTPlotArea.h @@ -14,7 +14,7 @@ /** * @brief Plot area delegate. **/ -@protocol CPTPlotAreaDelegate +@protocol CPTPlotAreaDelegate @optional @@ -26,7 +26,7 @@ * @if iOSOnly received both the touch down and up events. @endif * @param plotArea The plot area. **/ --(void)plotAreaWasSelected:(CPTPlotArea *)plotArea; +-(void)plotAreaWasSelected:(nonnull CPTPlotArea *)plotArea; /** @brief @optional Informs the delegate that a plot area * @if MacOnly was both pressed and released. @endif @@ -34,14 +34,14 @@ * @param plotArea The plot area. * @param event The event that triggered the selection. **/ --(void)plotAreaWasSelected:(CPTPlotArea *)plotArea withEvent:(CPTNativeEvent *)event; +-(void)plotAreaWasSelected:(nonnull CPTPlotArea *)plotArea withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a plot area * @if MacOnly was pressed. @endif * @if iOSOnly touch started. @endif * @param plotArea The plot area. **/ --(void)plotAreaTouchDown:(CPTPlotArea *)plotArea; +-(void)plotAreaTouchDown:(nonnull CPTPlotArea *)plotArea; /** @brief @optional Informs the delegate that a plot area * @if MacOnly was pressed. @endif @@ -49,14 +49,14 @@ * @param plotArea The plot area. * @param event The event that triggered the selection. **/ --(void)plotAreaTouchDown:(CPTPlotArea *)plotArea withEvent:(CPTNativeEvent *)event; +-(void)plotAreaTouchDown:(nonnull CPTPlotArea *)plotArea withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a plot area * @if MacOnly was released. @endif * @if iOSOnly touch ended. @endif * @param plotArea The plot area. **/ --(void)plotAreaTouchUp:(CPTPlotArea *)plotArea; +-(void)plotAreaTouchUp:(nonnull CPTPlotArea *)plotArea; /** @brief @optional Informs the delegate that a plot area * @if MacOnly was released. @endif @@ -64,7 +64,7 @@ * @param plotArea The plot area. * @param event The event that triggered the selection. **/ --(void)plotAreaTouchUp:(CPTPlotArea *)plotArea withEvent:(CPTNativeEvent *)event; +-(void)plotAreaTouchUp:(nonnull CPTPlotArea *)plotArea withEvent:(nonnull CPTNativeEvent *)event; /// @} @@ -75,23 +75,23 @@ @interface CPTPlotArea : CPTAnnotationHostLayer /// @name Layers /// @{ -@property (nonatomic, readwrite, strong) CPTGridLineGroup *minorGridLineGroup; -@property (nonatomic, readwrite, strong) CPTGridLineGroup *majorGridLineGroup; -@property (nonatomic, readwrite, strong) CPTAxisSet *axisSet; -@property (nonatomic, readwrite, strong) CPTPlotGroup *plotGroup; -@property (nonatomic, readwrite, strong) CPTAxisLabelGroup *axisLabelGroup; -@property (nonatomic, readwrite, strong) CPTAxisLabelGroup *axisTitleGroup; +@property (nonatomic, readwrite, strong, nullable) CPTGridLineGroup *minorGridLineGroup; +@property (nonatomic, readwrite, strong, nullable) CPTGridLineGroup *majorGridLineGroup; +@property (nonatomic, readwrite, strong, nullable) CPTAxisSet *axisSet; +@property (nonatomic, readwrite, strong, nullable) CPTPlotGroup *plotGroup; +@property (nonatomic, readwrite, strong, nullable) CPTAxisLabelGroup *axisLabelGroup; +@property (nonatomic, readwrite, strong, nullable) CPTAxisLabelGroup *axisTitleGroup; /// @} /// @name Layer Ordering /// @{ -@property (nonatomic, readwrite, strong) NSArray *topDownLayerOrder; +@property (nonatomic, readwrite, strong, nullable) CPTNumberArray *topDownLayerOrder; /// @} /// @name Decorations /// @{ -@property (nonatomic, readwrite, copy) CPTLineStyle *borderLineStyle; -@property (nonatomic, readwrite, copy) CPTFill *fill; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *borderLineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTFill *fill; /// @} /// @name Dimensions @@ -104,7 +104,7 @@ /// @{ -(void)updateAxisSetLayersForType:(CPTGraphLayerType)layerType; -(void)setAxisSetLayersForType:(CPTGraphLayerType)layerType; --(unsigned)sublayerIndexForAxis:(CPTAxis *)axis layerType:(CPTGraphLayerType)layerType; +-(unsigned)sublayerIndexForAxis:(nonnull CPTAxis *)axis layerType:(CPTGraphLayerType)layerType; /// @} @end diff --git a/framework/Source/CPTPlotArea.m b/framework/Source/CPTPlotArea.m index dfd2c16f1..34f04616d 100644 --- a/framework/Source/CPTPlotArea.m +++ b/framework/Source/CPTPlotArea.m @@ -14,7 +14,7 @@ /// @cond @interface CPTPlotArea() -@property (nonatomic, readwrite, assign) CPTGraphLayerType *bottomUpLayerOrder; +@property (nonatomic, readwrite, assign, nonnull) CPTGraphLayerType *bottomUpLayerOrder; @property (nonatomic, readwrite, assign, getter = isUpdatingLayers) BOOL updatingLayers; @property (nonatomic, readwrite) CGPoint touchedPoint; @property (nonatomic, readwrite) NSDecimal widthDecimal; @@ -44,37 +44,37 @@ -(unsigned)indexForLayerType:(CPTGraphLayerType)layerType; **/ @implementation CPTPlotArea -/** @property CPTGridLineGroup *minorGridLineGroup +/** @property nullable CPTGridLineGroup *minorGridLineGroup * @brief The parent layer for all minor grid lines. **/ @synthesize minorGridLineGroup; -/** @property CPTGridLineGroup *majorGridLineGroup +/** @property nullable CPTGridLineGroup *majorGridLineGroup * @brief The parent layer for all major grid lines. **/ @synthesize majorGridLineGroup; -/** @property CPTAxisSet *axisSet +/** @property nullable CPTAxisSet *axisSet * @brief The axis set. **/ @synthesize axisSet; -/** @property CPTPlotGroup *plotGroup +/** @property nullable CPTPlotGroup *plotGroup * @brief The plot group. **/ @synthesize plotGroup; -/** @property CPTAxisLabelGroup *axisLabelGroup +/** @property nullable CPTAxisLabelGroup *axisLabelGroup * @brief The parent layer for all axis labels. **/ @synthesize axisLabelGroup; -/** @property CPTAxisLabelGroup *axisTitleGroup +/** @property nullable CPTAxisLabelGroup *axisTitleGroup * @brief The parent layer for all axis titles. **/ @synthesize axisTitleGroup; -/** @property NSArray *topDownLayerOrder +/** @property nullable CPTNumberArray *topDownLayerOrder * @brief An array of graph layers to be drawn in an order other than the default. * * The array should reference the layers using the constants defined in #CPTGraphLayerType. @@ -100,13 +100,13 @@ @implementation CPTPlotArea **/ @synthesize topDownLayerOrder; -/** @property CPTLineStyle *borderLineStyle +/** @property nullable CPTLineStyle *borderLineStyle * @brief The line style for the layer border. * If @nil, the border is not drawn. **/ @dynamic borderLineStyle; -/** @property CPTFill *fill +/** @property nullable CPTFill *fill * @brief The fill for the layer background. * If @nil, the layer background is not filled. **/ @@ -150,9 +150,9 @@ @implementation CPTPlotArea * @param newFrame The frame rectangle. * @return The initialized CPTPlotArea object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { minorGridLineGroup = nil; majorGridLineGroup = nil; axisSet = nil; @@ -160,9 +160,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame axisLabelGroup = nil; axisTitleGroup = nil; fill = nil; - touchedPoint = CGPointMake(NAN, NAN); + touchedPoint = CPTPointMake(NAN, NAN); topDownLayerOrder = nil; - bottomUpLayerOrder = malloc( kCPTNumberOfLayers * sizeof(CPTGraphLayerType) ); + bottomUpLayerOrder = calloc(kCPTNumberOfLayers, sizeof(CPTGraphLayerType)); [self updateLayerOrder]; CPTPlotGroup *newPlotGroup = [[CPTPlotGroup alloc] initWithFrame:newFrame]; @@ -181,9 +181,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTPlotArea *theLayer = (CPTPlotArea *)layer; minorGridLineGroup = theLayer->minorGridLineGroup; @@ -195,8 +195,8 @@ -(instancetype)initWithLayer:(id)layer fill = theLayer->fill; touchedPoint = theLayer->touchedPoint; topDownLayerOrder = theLayer->topDownLayerOrder; - bottomUpLayerOrder = malloc( kCPTNumberOfLayers * sizeof(CPTGraphLayerType) ); - memcpy( bottomUpLayerOrder, theLayer->bottomUpLayerOrder, kCPTNumberOfLayers * sizeof(CPTGraphLayerType) ); + bottomUpLayerOrder = calloc(kCPTNumberOfLayers, sizeof(CPTGraphLayerType)); + memcpy(bottomUpLayerOrder, theLayer->bottomUpLayerOrder, kCPTNumberOfLayers * sizeof(CPTGraphLayerType)); widthDecimal = theLayer->widthDecimal; heightDecimal = theLayer->heightDecimal; } @@ -215,7 +215,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -236,22 +236,30 @@ -(void)encodeWithCoder:(NSCoder *)coder // heightDecimal } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - minorGridLineGroup = [coder decodeObjectForKey:@"CPTPlotArea.minorGridLineGroup"]; - majorGridLineGroup = [coder decodeObjectForKey:@"CPTPlotArea.majorGridLineGroup"]; - axisSet = [coder decodeObjectForKey:@"CPTPlotArea.axisSet"]; - plotGroup = [coder decodeObjectForKey:@"CPTPlotArea.plotGroup"]; - axisLabelGroup = [coder decodeObjectForKey:@"CPTPlotArea.axisLabelGroup"]; - axisTitleGroup = [coder decodeObjectForKey:@"CPTPlotArea.axisTitleGroup"]; - fill = [[coder decodeObjectForKey:@"CPTPlotArea.fill"] copy]; - topDownLayerOrder = [coder decodeObjectForKey:@"CPTPlotArea.topDownLayerOrder"]; - - bottomUpLayerOrder = malloc( kCPTNumberOfLayers * sizeof(CPTGraphLayerType) ); + if ((self = [super initWithCoder:coder])) { + minorGridLineGroup = [coder decodeObjectOfClass:[CPTGridLineGroup class] + forKey:@"CPTPlotArea.minorGridLineGroup"]; + majorGridLineGroup = [coder decodeObjectOfClass:[CPTGridLineGroup class] + forKey:@"CPTPlotArea.majorGridLineGroup"]; + axisSet = [coder decodeObjectOfClass:[CPTAxisSet class] + forKey:@"CPTPlotArea.axisSet"]; + plotGroup = [coder decodeObjectOfClass:[CPTPlotGroup class] + forKey:@"CPTPlotArea.plotGroup"]; + axisLabelGroup = [coder decodeObjectOfClass:[CPTAxisLabelGroup class] + forKey:@"CPTPlotArea.axisLabelGroup"]; + axisTitleGroup = [coder decodeObjectOfClass:[CPTAxisLabelGroup class] + forKey:@"CPTPlotArea.axisTitleGroup"]; + fill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTPlotArea.fill"] copy]; + topDownLayerOrder = [coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTPlotArea.topDownLayerOrder"]; + + bottomUpLayerOrder = calloc(kCPTNumberOfLayers, sizeof(CPTGraphLayerType)); [self updateLayerOrder]; - touchedPoint = CGPointMake(NAN, NAN); + touchedPoint = CPTPointMake(NAN, NAN); CGSize boundsSize = self.bounds.size; widthDecimal = CPTDecimalFromCGFloat(boundsSize.width); @@ -262,12 +270,24 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden ) { return; @@ -288,7 +308,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context [self.fill fillRect:self.bounds inContext:context]; - NSArray *theAxes = self.axisSet.axes; + CPTAxisArray *theAxes = self.axisSet.axes; for ( CPTAxis *axis in theAxes ) { [axis drawBackgroundBandsInContext:context]; @@ -353,7 +373,11 @@ -(void)layoutSublayers } } --(NSSet *)sublayersExcludedFromAutomaticLayout +/// @} + +/// @cond + +-(nullable CPTSublayerSet *)sublayersExcludedFromAutomaticLayout { CPTGridLineGroup *minorGrid = self.minorGridLineGroup; CPTGridLineGroup *majorGrid = self.majorGridLineGroup; @@ -363,7 +387,7 @@ -(NSSet *)sublayersExcludedFromAutomaticLayout CPTAxisLabelGroup *titles = self.axisTitleGroup; if ( minorGrid || majorGrid || theAxisSet || thePlotGroup || labels || titles ) { - NSMutableSet *excludedSublayers = [[super sublayersExcludedFromAutomaticLayout] mutableCopy]; + CPTMutableSublayerSet *excludedSublayers = [super.sublayersExcludedFromAutomaticLayout mutableCopy]; if ( !excludedSublayers ) { excludedSublayers = [NSMutableSet set]; } @@ -390,11 +414,11 @@ -(NSSet *)sublayersExcludedFromAutomaticLayout return excludedSublayers; } else { - return [super sublayersExcludedFromAutomaticLayout]; + return super.sublayersExcludedFromAutomaticLayout; } } -/// @} +/// @endcond #pragma mark - #pragma mark Layer ordering @@ -409,12 +433,12 @@ -(void)updateLayerOrder *(buLayerOrder++) = (CPTGraphLayerType)i; } - NSArray *tdLayerOrder = self.topDownLayerOrder; + CPTNumberArray *tdLayerOrder = self.topDownLayerOrder; if ( tdLayerOrder ) { buLayerOrder = self.bottomUpLayerOrder; - for ( NSUInteger layerIndex = 0; layerIndex < [tdLayerOrder count]; layerIndex++ ) { - CPTGraphLayerType layerType = (CPTGraphLayerType)[tdLayerOrder[layerIndex] intValue]; + for ( NSUInteger layerIndex = 0; layerIndex < tdLayerOrder.count; layerIndex++ ) { + CPTGraphLayerType layerType = (CPTGraphLayerType)tdLayerOrder[layerIndex].intValue; NSUInteger i = kCPTNumberOfLayers - layerIndex - 1; while ( buLayerOrder[i] != layerType ) { if ( i == 0 ) { @@ -606,7 +630,7 @@ -(void)setAxisSetLayersForType:(CPTGraphLayerType)layerType * @param layerType The layer type being updated. * @return The sublayer index for the given layer type. **/ --(unsigned)sublayerIndexForAxis:(CPTAxis *)axis layerType:(CPTGraphLayerType)layerType +-(unsigned)sublayerIndexForAxis:(nonnull CPTAxis *)axis layerType:(CPTGraphLayerType)layerType { unsigned idx = 0; @@ -670,7 +694,7 @@ -(unsigned)sublayerIndexForAxis:(CPTAxis *)axis layerType:(CPTGraphLayerType)lay * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { CPTGraph *theGraph = self.graph; @@ -678,7 +702,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(plotAreaTouchDown:)] || [theDelegate respondsToSelector:@selector(plotAreaTouchDown:withEvent:)] || [theDelegate respondsToSelector:@selector(plotAreaWasSelected:)] || @@ -686,7 +710,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact // Inform delegate if a point was hit CGPoint plotAreaPoint = [theGraph convertPoint:interactionPoint toLayer:self]; - if ( CGRectContainsPoint(self.bounds, plotAreaPoint) ) { + if ( CGRectContainsPoint(self.bounds, plotAreaPoint)) { self.touchedPoint = plotAreaPoint; if ( [theDelegate respondsToSelector:@selector(plotAreaTouchDown:)] ) { @@ -721,7 +745,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { CPTGraph *theGraph = self.graph; @@ -730,9 +754,9 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio } CGPoint lastPoint = self.touchedPoint; - self.touchedPoint = CGPointMake(NAN, NAN); + self.touchedPoint = CPTPointMake(NAN, NAN); - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(plotAreaTouchUp:)] || [theDelegate respondsToSelector:@selector(plotAreaTouchUp:withEvent:)] || [theDelegate respondsToSelector:@selector(plotAreaWasSelected:)] || @@ -740,9 +764,9 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio // Inform delegate if a point was hit CGPoint plotAreaPoint = [theGraph convertPoint:interactionPoint toLayer:self]; - if ( CGRectContainsPoint(self.bounds, plotAreaPoint) ) { + if ( CGRectContainsPoint(self.bounds, plotAreaPoint)) { CGVector offset = CGVectorMake(plotAreaPoint.x - lastPoint.x, plotAreaPoint.y - lastPoint.y); - if ( (offset.dx * offset.dx + offset.dy * offset.dy) <= CPTFloat(25.0) ) { + if ((offset.dx * offset.dx + offset.dy * offset.dy) <= CPTFloat(25.0)) { if ( [theDelegate respondsToSelector:@selector(plotAreaTouchUp:)] ) { [theDelegate plotAreaTouchUp:self]; } @@ -774,17 +798,17 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio /// @cond --(CPTLineStyle *)borderLineStyle +-(nullable CPTLineStyle *)borderLineStyle { return self.axisSet.borderLineStyle; } --(void)setBorderLineStyle:(CPTLineStyle *)newLineStyle +-(void)setBorderLineStyle:(nullable CPTLineStyle *)newLineStyle { self.axisSet.borderLineStyle = newLineStyle; } --(void)setFill:(CPTFill *)newFill +-(void)setFill:(nullable CPTFill *)newFill { if ( newFill != fill ) { fill = [newFill copy]; @@ -792,37 +816,41 @@ -(void)setFill:(CPTFill *)newFill } } --(void)setMinorGridLineGroup:(CPTGridLineGroup *)newGridLines +-(void)setMinorGridLineGroup:(nullable CPTGridLineGroup *)newGridLines { - if ( (newGridLines != minorGridLineGroup) || self.isUpdatingLayers ) { + if ((newGridLines != minorGridLineGroup) || self.isUpdatingLayers ) { [minorGridLineGroup removeFromSuperlayer]; minorGridLineGroup = newGridLines; if ( newGridLines ) { - newGridLines.plotArea = self; - newGridLines.major = NO; - [self insertSublayer:newGridLines atIndex:[self indexForLayerType:CPTGraphLayerTypeMinorGridLines]]; + CPTGridLineGroup *gridLines = newGridLines; + + gridLines.plotArea = self; + gridLines.major = NO; + [self insertSublayer:gridLines atIndex:[self indexForLayerType:CPTGraphLayerTypeMinorGridLines]]; } [self setNeedsLayout]; } } --(void)setMajorGridLineGroup:(CPTGridLineGroup *)newGridLines +-(void)setMajorGridLineGroup:(nullable CPTGridLineGroup *)newGridLines { - if ( (newGridLines != majorGridLineGroup) || self.isUpdatingLayers ) { + if ((newGridLines != majorGridLineGroup) || self.isUpdatingLayers ) { [majorGridLineGroup removeFromSuperlayer]; majorGridLineGroup = newGridLines; if ( newGridLines ) { - newGridLines.plotArea = self; - newGridLines.major = YES; - [self insertSublayer:newGridLines atIndex:[self indexForLayerType:CPTGraphLayerTypeMajorGridLines]]; + CPTGridLineGroup *gridLines = newGridLines; + + gridLines.plotArea = self; + gridLines.major = YES; + [self insertSublayer:gridLines atIndex:[self indexForLayerType:CPTGraphLayerTypeMajorGridLines]]; } [self setNeedsLayout]; } } --(void)setAxisSet:(CPTAxisSet *)newAxisSet +-(void)setAxisSet:(nullable CPTAxisSet *)newAxisSet { - if ( (newAxisSet != axisSet) || self.isUpdatingLayers ) { + if ((newAxisSet != axisSet) || self.isUpdatingLayers ) { [axisSet removeFromSuperlayer]; for ( CPTAxis *axis in axisSet.axes ) { axis.plotArea = nil; @@ -835,9 +863,11 @@ -(void)setAxisSet:(CPTAxisSet *)newAxisSet [self updateAxisSetLayersForType:CPTGraphLayerTypeAxisTitles]; if ( newAxisSet ) { - CPTGraph *theGraph = self.graph; - [self insertSublayer:newAxisSet atIndex:[self indexForLayerType:CPTGraphLayerTypeAxisLines]]; - for ( CPTAxis *axis in newAxisSet.axes ) { + CPTGraph *theGraph = self.graph; + CPTAxisSet *theAxisSet = newAxisSet; + + [self insertSublayer:theAxisSet atIndex:[self indexForLayerType:CPTGraphLayerTypeAxisLines]]; + for ( CPTAxis *axis in theAxisSet.axes ) { axis.plotArea = self; axis.graph = theGraph; } @@ -846,43 +876,49 @@ -(void)setAxisSet:(CPTAxisSet *)newAxisSet } } --(void)setPlotGroup:(CPTPlotGroup *)newPlotGroup +-(void)setPlotGroup:(nullable CPTPlotGroup *)newPlotGroup { - if ( (newPlotGroup != plotGroup) || self.isUpdatingLayers ) { + if ((newPlotGroup != plotGroup) || self.isUpdatingLayers ) { [plotGroup removeFromSuperlayer]; plotGroup = newPlotGroup; if ( newPlotGroup ) { - [self insertSublayer:newPlotGroup atIndex:[self indexForLayerType:CPTGraphLayerTypePlots]]; + CPTPlotGroup *group = newPlotGroup; + + [self insertSublayer:group atIndex:[self indexForLayerType:CPTGraphLayerTypePlots]]; } [self setNeedsLayout]; } } --(void)setAxisLabelGroup:(CPTAxisLabelGroup *)newAxisLabelGroup +-(void)setAxisLabelGroup:(nullable CPTAxisLabelGroup *)newAxisLabelGroup { - if ( (newAxisLabelGroup != axisLabelGroup) || self.isUpdatingLayers ) { + if ((newAxisLabelGroup != axisLabelGroup) || self.isUpdatingLayers ) { [axisLabelGroup removeFromSuperlayer]; axisLabelGroup = newAxisLabelGroup; if ( newAxisLabelGroup ) { - [self insertSublayer:newAxisLabelGroup atIndex:[self indexForLayerType:CPTGraphLayerTypeAxisLabels]]; + CPTAxisLabelGroup *group = newAxisLabelGroup; + + [self insertSublayer:group atIndex:[self indexForLayerType:CPTGraphLayerTypeAxisLabels]]; } [self setNeedsLayout]; } } --(void)setAxisTitleGroup:(CPTAxisLabelGroup *)newAxisTitleGroup +-(void)setAxisTitleGroup:(nullable CPTAxisLabelGroup *)newAxisTitleGroup { - if ( (newAxisTitleGroup != axisTitleGroup) || self.isUpdatingLayers ) { + if ((newAxisTitleGroup != axisTitleGroup) || self.isUpdatingLayers ) { [axisTitleGroup removeFromSuperlayer]; axisTitleGroup = newAxisTitleGroup; if ( newAxisTitleGroup ) { - [self insertSublayer:newAxisTitleGroup atIndex:[self indexForLayerType:CPTGraphLayerTypeAxisTitles]]; + CPTAxisLabelGroup *group = newAxisTitleGroup; + + [self insertSublayer:group atIndex:[self indexForLayerType:CPTGraphLayerTypeAxisTitles]]; } [self setNeedsLayout]; } } --(void)setTopDownLayerOrder:(NSArray *)newArray +-(void)setTopDownLayerOrder:(nullable CPTNumberArray *)newArray { if ( newArray != topDownLayerOrder ) { topDownLayerOrder = newArray; @@ -890,10 +926,10 @@ -(void)setTopDownLayerOrder:(NSArray *)newArray } } --(void)setGraph:(CPTGraph *)newGraph +-(void)setGraph:(nullable CPTGraph *)newGraph { if ( newGraph != self.graph ) { - [super setGraph:newGraph]; + super.graph = newGraph; for ( CPTAxis *axis in self.axisSet.axes ) { axis.graph = newGraph; @@ -903,11 +939,11 @@ -(void)setGraph:(CPTGraph *)newGraph -(void)setBounds:(CGRect)newBounds { - if ( !CGRectEqualToRect(self.bounds, newBounds) ) { - [super setBounds:newBounds]; - + if ( !CGRectEqualToRect(self.bounds, newBounds)) { self.widthDecimal = CPTDecimalFromCGFloat(newBounds.size.width); self.heightDecimal = CPTDecimalFromCGFloat(newBounds.size.height); + + super.bounds = newBounds; } } diff --git a/framework/Source/CPTPlotAreaFrame.h b/framework/Source/CPTPlotAreaFrame.h index dfad8fd48..89067ce11 100644 --- a/framework/Source/CPTPlotAreaFrame.h +++ b/framework/Source/CPTPlotAreaFrame.h @@ -6,8 +6,8 @@ @interface CPTPlotAreaFrame : CPTBorderedLayer -@property (nonatomic, readonly) CPTPlotArea *plotArea; -@property (nonatomic, readwrite, strong) CPTAxisSet *axisSet; -@property (nonatomic, readwrite, strong) CPTPlotGroup *plotGroup; +@property (nonatomic, readonly, nullable) CPTPlotArea *plotArea; +@property (nonatomic, readwrite, strong, nullable) CPTAxisSet *axisSet; +@property (nonatomic, readwrite, strong, nullable) CPTPlotGroup *plotGroup; @end diff --git a/framework/Source/CPTPlotAreaFrame.m b/framework/Source/CPTPlotAreaFrame.m index 9102b3392..c5723c6a0 100644 --- a/framework/Source/CPTPlotAreaFrame.m +++ b/framework/Source/CPTPlotAreaFrame.m @@ -7,7 +7,7 @@ /// @cond @interface CPTPlotAreaFrame() -@property (nonatomic, readwrite, strong) CPTPlotArea *plotArea; +@property (nonatomic, readwrite, strong, nullable) CPTPlotArea *plotArea; @end @@ -23,17 +23,17 @@ @interface CPTPlotAreaFrame() **/ @implementation CPTPlotAreaFrame -/** @property CPTPlotArea *plotArea +/** @property nullable CPTPlotArea *plotArea * @brief The plot area. **/ @synthesize plotArea; -/** @property CPTAxisSet *axisSet +/** @property nullable CPTAxisSet *axisSet * @brief The axis set. **/ @dynamic axisSet; -/** @property CPTPlotGroup *plotGroup +/** @property nullable CPTPlotGroup *plotGroup * @brief The plot group. **/ @dynamic plotGroup; @@ -54,9 +54,9 @@ @implementation CPTPlotAreaFrame * @param newFrame The frame rectangle. * @return The initialized CPTPlotAreaFrame object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { plotArea = nil; CPTPlotArea *newPlotArea = [[CPTPlotArea alloc] initWithFrame:newFrame]; @@ -72,9 +72,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTPlotAreaFrame *theLayer = (CPTPlotAreaFrame *)layer; plotArea = theLayer->plotArea; @@ -89,23 +89,36 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; [coder encodeObject:self.plotArea forKey:@"CPTPlotAreaFrame.plotArea"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - plotArea = [coder decodeObjectForKey:@"CPTPlotAreaFrame.plotArea"]; + if ((self = [super initWithCoder:coder])) { + plotArea = [coder decodeObjectOfClass:[CPTPlotArea class] + forKey:@"CPTPlotAreaFrame.plotArea"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Event Handling @@ -121,7 +134,7 @@ -(instancetype)initWithCoder:(NSCoder *)coder * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { if ( [self.plotArea pointingDeviceDownEvent:event atPoint:interactionPoint] ) { return YES; @@ -140,7 +153,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { if ( [self.plotArea pointingDeviceUpEvent:event atPoint:interactionPoint] ) { return YES; @@ -159,7 +172,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDraggedEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { if ( [self.plotArea pointingDeviceDraggedEvent:event atPoint:interactionPoint] ) { return YES; @@ -178,7 +191,7 @@ -(BOOL)pointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)inter * @param event The OS event. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceCancelledEvent:(CPTNativeEvent *)event +-(BOOL)pointingDeviceCancelledEvent:(nonnull CPTNativeEvent *)event { if ( [self.plotArea pointingDeviceCancelledEvent:event] ) { return YES; @@ -195,45 +208,47 @@ -(BOOL)pointingDeviceCancelledEvent:(CPTNativeEvent *)event /// @cond --(void)setPlotArea:(CPTPlotArea *)newPlotArea +-(void)setPlotArea:(nullable CPTPlotArea *)newPlotArea { if ( newPlotArea != plotArea ) { [plotArea removeFromSuperlayer]; plotArea = newPlotArea; if ( newPlotArea ) { - [self insertSublayer:newPlotArea atIndex:0]; - newPlotArea.graph = self.graph; + CPTPlotArea *theArea = newPlotArea; + + [self insertSublayer:theArea atIndex:0]; + theArea.graph = self.graph; } [self setNeedsLayout]; } } --(CPTAxisSet *)axisSet +-(nullable CPTAxisSet *)axisSet { return self.plotArea.axisSet; } --(void)setAxisSet:(CPTAxisSet *)newAxisSet +-(void)setAxisSet:(nullable CPTAxisSet *)newAxisSet { self.plotArea.axisSet = newAxisSet; } --(CPTPlotGroup *)plotGroup +-(nullable CPTPlotGroup *)plotGroup { return self.plotArea.plotGroup; } --(void)setPlotGroup:(CPTPlotGroup *)newPlotGroup +-(void)setPlotGroup:(nullable CPTPlotGroup *)newPlotGroup { self.plotArea.plotGroup = newPlotGroup; } --(void)setGraph:(CPTGraph *)newGraph +-(void)setGraph:(nullable CPTGraph *)newGraph { if ( newGraph != self.graph ) { - [super setGraph:newGraph]; + super.graph = newGraph; self.plotArea.graph = newGraph; } diff --git a/framework/Source/CPTPlotGroup.h b/framework/Source/CPTPlotGroup.h index 82d36724c..77d451dec 100644 --- a/framework/Source/CPTPlotGroup.h +++ b/framework/Source/CPTPlotGroup.h @@ -6,9 +6,9 @@ /// @name Adding and Removing Plots /// @{ --(void)addPlot:(CPTPlot *)plot; --(void)removePlot:(CPTPlot *)plot; --(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx; +-(void)addPlot:(nonnull CPTPlot *)plot; +-(void)removePlot:(nullable CPTPlot *)plot; +-(void)insertPlot:(nonnull CPTPlot *)plot atIndex:(NSUInteger)idx; /// @} @end diff --git a/framework/Source/CPTPlotGroup.m b/framework/Source/CPTPlotGroup.m index d80b7ab82..4a224e691 100644 --- a/framework/Source/CPTPlotGroup.m +++ b/framework/Source/CPTPlotGroup.m @@ -12,12 +12,13 @@ @implementation CPTPlotGroup /// @cond --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { + if ((self = [super initWithCoder:coder])) { // support old archives if ( [coder containsValueForKey:@"CPTPlotGroup.identifier"] ) { - self.identifier = [coder decodeObjectForKey:@"CPTPlotGroup.identifier"]; + self.identifier = [coder decodeObjectOfClass:[NSObject class] + forKey:@"CPTPlotGroup.identifier"]; } } return self; @@ -25,13 +26,25 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Organizing Plots /** @brief Add a plot to this plot group. * @param plot The plot. **/ --(void)addPlot:(CPTPlot *)plot +-(void)addPlot:(nonnull CPTPlot *)plot { NSParameterAssert(plot); @@ -42,7 +55,7 @@ -(void)addPlot:(CPTPlot *)plot * @param plot The plot. * @param idx The index at which to insert the plot. This value must not be greater than the count of elements in the sublayer array. **/ --(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx +-(void)insertPlot:(nonnull CPTPlot *)plot atIndex:(NSUInteger)idx { NSParameterAssert(plot); NSParameterAssert(idx <= [[self sublayers] count]); @@ -53,9 +66,9 @@ -(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx /** @brief Remove a plot from this plot group. * @param plot The plot to remove. **/ --(void)removePlot:(CPTPlot *)plot +-(void)removePlot:(nullable CPTPlot *)plot { - if ( self == [plot superlayer] ) { + if ( self == plot.superlayer ) { [plot removeFromSuperlayer]; } } @@ -70,7 +83,7 @@ -(void)display // nothing to draw } --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef __unused)context { // nothing to draw } diff --git a/framework/Source/CPTPlotRange.h b/framework/Source/CPTPlotRange.h index 4bc1139d6..9a3460e96 100644 --- a/framework/Source/CPTPlotRange.h +++ b/framework/Source/CPTPlotRange.h @@ -2,58 +2,82 @@ /// @file +@class CPTPlotRange; + /** * @brief Enumeration of possible results of a plot range comparison. **/ -typedef NS_ENUM (NSInteger, CPTPlotRangeComparisonResult) { +typedef NS_CLOSED_ENUM(NSInteger, CPTPlotRangeComparisonResult) { CPTPlotRangeComparisonResultNumberBelowRange, ///< Number is below the range. CPTPlotRangeComparisonResultNumberInRange, ///< Number is in the range. - CPTPlotRangeComparisonResultNumberAboveRange ///< Number is above the range. + CPTPlotRangeComparisonResultNumberAboveRange, ///< Number is above the range. + CPTPlotRangeComparisonResultNumberUndefined ///< Number is undefined (e.g., @NAN). }; -@interface CPTPlotRange : NSObject +/** + * @brief An array of plot ranges. + **/ +typedef NSArray CPTPlotRangeArray; + +/** + * @brief A mutable array of plot ranges. + **/ +typedef NSMutableArray CPTMutablePlotRangeArray; + +@interface CPTPlotRange : NSObject /// @name Range Limits /// @{ -@property (nonatomic, readonly) NSDecimal location; -@property (nonatomic, readonly) NSDecimal length; -@property (nonatomic, readonly) NSDecimal end; +@property (nonatomic, readonly, strong, nonnull) NSNumber *location; +@property (nonatomic, readonly, strong, nonnull) NSNumber *length; +@property (nonatomic, readonly, strong, nonnull) NSNumber *end; +@property (nonatomic, readonly) NSDecimal locationDecimal; +@property (nonatomic, readonly) NSDecimal lengthDecimal; +@property (nonatomic, readonly) NSDecimal endDecimal; @property (nonatomic, readonly) double locationDouble; @property (nonatomic, readonly) double lengthDouble; @property (nonatomic, readonly) double endDouble; -@property (nonatomic, readonly) NSDecimal minLimit; -@property (nonatomic, readonly) NSDecimal midPoint; -@property (nonatomic, readonly) NSDecimal maxLimit; +@property (nonatomic, readonly, strong, nonnull) NSNumber *minLimit; +@property (nonatomic, readonly, strong, nonnull) NSNumber *midPoint; +@property (nonatomic, readonly, strong, nonnull) NSNumber *maxLimit; +@property (nonatomic, readonly) NSDecimal minLimitDecimal; +@property (nonatomic, readonly) NSDecimal midPointDecimal; +@property (nonatomic, readonly) NSDecimal maxLimitDecimal; @property (nonatomic, readonly) double minLimitDouble; @property (nonatomic, readonly) double midPointDouble; @property (nonatomic, readonly) double maxLimitDouble; + +@property (nonatomic, readonly) BOOL isInfinite; +@property (nonatomic, readonly) CPTSign lengthSign; /// @} /// @name Factory Methods /// @{ -+(instancetype)plotRangeWithLocation:(NSDecimal)loc length:(NSDecimal)len; ++(nonnull instancetype)plotRangeWithLocation:(nonnull NSNumber *)loc length:(nonnull NSNumber *)len; ++(nonnull instancetype)plotRangeWithLocationDecimal:(NSDecimal)loc lengthDecimal:(NSDecimal)len; /// @} /// @name Initialization /// @{ --(instancetype)initWithLocation:(NSDecimal)loc length:(NSDecimal)len NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithLocation:(nonnull NSNumber *)loc length:(nonnull NSNumber *)len NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithLocationDecimal:(NSDecimal)loc lengthDecimal:(NSDecimal)len; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER; /// @} /// @name Checking Ranges /// @{ -(BOOL)contains:(NSDecimal)number; -(BOOL)containsDouble:(double)number; --(BOOL)containsNumber:(NSNumber *)number; --(BOOL)isEqualToRange:(CPTPlotRange *)otherRange; --(BOOL)containsRange:(CPTPlotRange *)otherRange; --(BOOL)intersectsRange:(CPTPlotRange *)otherRange; +-(BOOL)containsNumber:(nullable NSNumber *)number; +-(BOOL)isEqualToRange:(nullable CPTPlotRange *)otherRange; +-(BOOL)containsRange:(nullable CPTPlotRange *)otherRange; +-(BOOL)intersectsRange:(nullable CPTPlotRange *)otherRange; /// @} /// @name Range Comparison /// @{ --(CPTPlotRangeComparisonResult)compareToNumber:(NSNumber *)number; +-(CPTPlotRangeComparisonResult)compareToNumber:(nonnull NSNumber *)number; -(CPTPlotRangeComparisonResult)compareToDecimal:(NSDecimal)number; -(CPTPlotRangeComparisonResult)compareToDouble:(double)number; /// @} diff --git a/framework/Source/CPTPlotRange.m b/framework/Source/CPTPlotRange.m index 5d9d5e9d3..c83c432e6 100644 --- a/framework/Source/CPTPlotRange.m +++ b/framework/Source/CPTPlotRange.m @@ -7,46 +7,70 @@ /// @cond @interface CPTPlotRange() -@property (nonatomic, readwrite) NSDecimal location; -@property (nonatomic, readwrite) NSDecimal length; +@property (nonatomic, readwrite) NSDecimal locationDecimal; +@property (nonatomic, readwrite) NSDecimal lengthDecimal; @property (nonatomic, readwrite) double locationDouble; @property (nonatomic, readwrite) double lengthDouble; +@property (nonatomic, readwrite) BOOL isInfinite; +@property (nonatomic, readwrite) CPTSign lengthSign; + +@property (nonatomic, readwrite) BOOL inValueUpdate; + @end /// @endcond +#pragma mark - + /** * @brief Defines an immutable range of plot data. **/ @implementation CPTPlotRange -/** @property NSDecimal location +/** @property nonnull NSNumber *location * @brief The starting value of the range. - * @see locationDouble + * @see @ref locationDecimal, @ref locationDouble **/ -@synthesize location; +@dynamic location; -/** @property NSDecimal length +/** @property nonnull NSNumber *length * @brief The length of the range. - * @see lengthDouble + * @see @ref lengthDecimal, @ref lengthDouble **/ -@synthesize length; +@dynamic length; -/** @property NSDecimal end; +/** @property nonnull NSNumber *end; * @brief The ending value of the range, equivalent to @ref location + @ref length. **/ @dynamic end; +/** @property NSDecimal locationDecimal + * @brief The starting value of the range. + * @see @ref location, @ref locationDouble + **/ +@synthesize locationDecimal; + +/** @property NSDecimal lengthDecimal + * @brief The length of the range. + * @see @ref length, @ref lengthDouble + **/ +@synthesize lengthDecimal; + +/** @property NSDecimal endDecimal; + * @brief The ending value of the range, equivalent to @ref locationDecimal + @ref lengthDecimal. + **/ +@dynamic endDecimal; + /** @property double locationDouble * @brief The starting value of the range as a @double. - * @see location + * @see @ref location, @ref locationDecimal **/ @synthesize locationDouble; /** @property double lengthDouble * @brief The length of the range as a @double. - * @see length + * @see @ref length, @ref lengthDecimal **/ @synthesize lengthDouble; @@ -55,36 +79,63 @@ @implementation CPTPlotRange **/ @dynamic endDouble; -/** @property NSDecimal minLimit +/** @property nonnull NSNumber *minLimit * @brief The minimum extreme value of the range. **/ @dynamic minLimit; +/** @property NSDecimal minLimitDecimal + * @brief The minimum extreme value of the range. + **/ +@dynamic minLimitDecimal; + /** @property double minLimitDouble * @brief The minimum extreme value of the range as a @double. **/ @dynamic minLimitDouble; -/** @property NSDecimal midPoint +/** @property nonnull NSNumber *midPoint * @brief The middle value of the range. **/ @dynamic midPoint; +/** @property NSDecimal midPointDecimal + * @brief The middle value of the range. + **/ +@dynamic midPointDecimal; + /** @property double midPointDouble * @brief The middle value of the range as a @double. **/ @dynamic midPointDouble; -/** @property NSDecimal maxLimit +/** @property nonnull NSNumber *maxLimit * @brief The maximum extreme value of the range. **/ @dynamic maxLimit; +/** @property NSDecimal maxLimitDecimal + * @brief The maximum extreme value of the range. + **/ +@dynamic maxLimitDecimal; + /** @property double maxLimitDouble * @brief The maximum extreme value of the range as a @double. **/ @dynamic maxLimitDouble; +/** @property BOOL isInfinite + * @brief @YES if the length of the range is infinite. + **/ +@synthesize isInfinite; + +/** @property CPTSign lengthSign + * @brief The direction (positive or negative) if the length of the range is infinite. + **/ +@synthesize lengthSign; + +@synthesize inValueUpdate; + #pragma mark - #pragma mark Init/Dealloc @@ -93,25 +144,62 @@ @implementation CPTPlotRange * @param len The length of the range. * @return A new CPTPlotRange instance initialized with the provided location and length. **/ -+(instancetype)plotRangeWithLocation:(NSDecimal)loc length:(NSDecimal)len ++(nonnull instancetype)plotRangeWithLocation:(nonnull NSNumber *)loc length:(nonnull NSNumber *)len { return [[self alloc] initWithLocation:loc length:len]; } +/** @brief Creates and returns a new CPTPlotRange instance initialized with the provided location and length. + * @param loc The starting location of the range. + * @param len The length of the range. + * @return A new CPTPlotRange instance initialized with the provided location and length. + **/ ++(nonnull instancetype)plotRangeWithLocationDecimal:(NSDecimal)loc lengthDecimal:(NSDecimal)len +{ + return [[self alloc] initWithLocationDecimal:loc lengthDecimal:len]; +} + /** @brief Initializes a newly allocated CPTPlotRange object with the provided location and length. * @param loc The starting location of the range. * @param len The length of the range. * @return The initialized CPTPlotRange object. **/ --(instancetype)initWithLocation:(NSDecimal)loc length:(NSDecimal)len +-(nonnull instancetype)initWithLocation:(nonnull NSNumber *)loc length:(nonnull NSNumber *)len { - if ( (self = [super init]) ) { - self.location = loc; - self.length = len; + NSParameterAssert(loc); + NSParameterAssert(len); + + if ((self = [super init])) { + locationDecimal = loc.decimalValue; + locationDouble = loc.doubleValue; + + lengthDecimal = len.decimalValue; + lengthDouble = len.doubleValue; + + if ( isnan(lengthDouble)) { + isInfinite = NO; + lengthSign = CPTSignNone; + } + else { + isInfinite = (BOOL)isinf(lengthDouble); + lengthSign = signbit(lengthDouble) ? CPTSignNegative : CPTSignPositive; + } } + return self; } +/** @brief Initializes a newly allocated CPTPlotRange object with the provided location and length. + * @param loc The starting location of the range. + * @param len The length of the range. + * @return The initialized CPTPlotRange object. + **/ +-(nonnull instancetype)initWithLocationDecimal:(NSDecimal)loc lengthDecimal:(NSDecimal)len +{ + return [self initWithLocation:[NSDecimalNumber decimalNumberWithDecimal:loc] + length:[NSDecimalNumber decimalNumberWithDecimal:len]]; +} + /// @name Initialization /// @{ @@ -123,11 +211,9 @@ -(instancetype)initWithLocation:(NSDecimal)loc length:(NSDecimal)len * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - NSDecimal zero = CPTDecimalFromInteger(0); - - return [self initWithLocation:zero length:zero]; + return [self initWithLocation:@0.0 length:@0.0]; } /// @} @@ -137,25 +223,93 @@ -(instancetype)init /// @cond --(void)setLocation:(NSDecimal)newLocation +-(NSNumber *)location { - if ( !CPTDecimalEquals(location, newLocation) ) { - location = newLocation; - self.locationDouble = [[NSDecimalNumber decimalNumberWithDecimal:newLocation] doubleValue]; + return [NSDecimalNumber decimalNumberWithDecimal:self.locationDecimal]; +} + +-(void)setLocationDecimal:(NSDecimal)newLocation +{ + if ( !CPTDecimalEquals(locationDecimal, newLocation)) { + locationDecimal = newLocation; + + if ( !self.inValueUpdate ) { + self.inValueUpdate = YES; + + self.locationDouble = CPTDecimalDoubleValue(newLocation); + + self.inValueUpdate = NO; + } } } --(void)setLength:(NSDecimal)newLength +-(void)setLocationDouble:(double)newLocation { - if ( !CPTDecimalEquals(length, newLength) ) { - length = newLength; - self.lengthDouble = [[NSDecimalNumber decimalNumberWithDecimal:newLength] doubleValue]; + if ( locationDouble != newLocation ) { + locationDouble = newLocation; + + if ( !self.inValueUpdate ) { + self.inValueUpdate = YES; + + self.locationDecimal = CPTDecimalFromDouble(newLocation); + + self.inValueUpdate = NO; + } } } --(NSDecimal)end +-(NSNumber *)length { - return CPTDecimalAdd(self.location, self.length); + return [NSDecimalNumber decimalNumberWithDecimal:self.lengthDecimal]; +} + +-(void)setLengthDecimal:(NSDecimal)newLength +{ + if ( !CPTDecimalEquals(lengthDecimal, newLength)) { + lengthDecimal = newLength; + + if ( !self.inValueUpdate ) { + self.inValueUpdate = YES; + + self.lengthDouble = CPTDecimalDoubleValue(newLength); + + self.inValueUpdate = NO; + } + } +} + +-(void)setLengthDouble:(double)newLength +{ + if ( lengthDouble != newLength ) { + lengthDouble = newLength; + + if ( isnan(newLength)) { + self.isInfinite = NO; + self.lengthSign = CPTSignNone; + } + else { + self.isInfinite = (BOOL)isinf(newLength); + self.lengthSign = signbit(newLength) ? CPTSignNegative : CPTSignPositive; + } + + if ( !self.inValueUpdate ) { + self.inValueUpdate = YES; + + self.lengthDecimal = CPTDecimalFromDouble(newLength); + + self.inValueUpdate = NO; + } + } +} + +-(NSNumber *)end +{ + return [NSDecimalNumber decimalNumberWithDecimal:self.endDecimal]; +} + +-(NSDecimal)endDecimal +{ + return CPTDecimalAdd(self.locationDecimal, self.lengthDecimal); } -(double)endDouble @@ -163,12 +317,20 @@ -(double)endDouble return self.locationDouble + self.lengthDouble; } --(NSDecimal)minLimit +-(NSNumber *)minLimit +{ + return [NSDecimalNumber decimalNumberWithDecimal:self.minLimitDecimal]; +} + +-(NSDecimal)minLimitDecimal { - NSDecimal loc = self.location; - NSDecimal len = self.length; + NSDecimal loc = self.locationDecimal; + NSDecimal len = self.lengthDecimal; - if ( CPTDecimalLessThan( len, CPTDecimalFromInteger(0) ) ) { + if ( NSDecimalIsNotANumber(&len)) { + return loc; + } + else if ( CPTDecimalLessThan(len, CPTDecimalFromInteger(0))) { return CPTDecimalAdd(loc, len); } else { @@ -189,9 +351,14 @@ -(double)minLimitDouble } } --(NSDecimal)midPoint +-(NSNumber *)midPoint { - return CPTDecimalAdd( self.location, CPTDecimalDivide( self.length, CPTDecimalFromInteger(2) ) ); + return [NSDecimalNumber decimalNumberWithDecimal:self.midPointDecimal]; +} + +-(NSDecimal)midPointDecimal +{ + return CPTDecimalAdd(self.locationDecimal, CPTDecimalDivide(self.lengthDecimal, CPTDecimalFromInteger(2))); } -(double)midPointDouble @@ -199,12 +366,20 @@ -(double)midPointDouble return fma(self.lengthDouble, 0.5, self.locationDouble); } --(NSDecimal)maxLimit +-(NSNumber *)maxLimit +{ + return [NSDecimalNumber decimalNumberWithDecimal:self.maxLimitDecimal]; +} + +-(NSDecimal)maxLimitDecimal { - NSDecimal loc = self.location; - NSDecimal len = self.length; + NSDecimal loc = self.locationDecimal; + NSDecimal len = self.lengthDecimal; - if ( CPTDecimalGreaterThan( len, CPTDecimalFromInteger(0) ) ) { + if ( NSDecimalIsNotANumber(&len)) { + return loc; + } + else if ( CPTDecimalGreaterThan(len, CPTDecimalFromInteger(0))) { return CPTDecimalAdd(loc, len); } else { @@ -232,15 +407,20 @@ -(double)maxLimitDouble /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { CPTPlotRange *newRange = [[CPTPlotRange allocWithZone:zone] init]; if ( newRange ) { - newRange.location = self.location; - newRange.length = self.length; - newRange.locationDouble = self.locationDouble; - newRange.lengthDouble = self.lengthDouble; + newRange.inValueUpdate = YES; + + newRange.locationDecimal = self.locationDecimal; + newRange.locationDouble = self.locationDouble; + + newRange.lengthDecimal = self.lengthDecimal; + newRange.lengthDouble = self.lengthDouble; + + newRange.inValueUpdate = NO; } return newRange; } @@ -252,15 +432,20 @@ -(id)copyWithZone:(NSZone *)zone /// @cond --(id)mutableCopyWithZone:(NSZone *)zone +-(nonnull id)mutableCopyWithZone:(nullable NSZone *)zone { CPTPlotRange *newRange = [[CPTMutablePlotRange allocWithZone:zone] init]; if ( newRange ) { - newRange.location = self.location; - newRange.length = self.length; - newRange.locationDouble = self.locationDouble; - newRange.lengthDouble = self.lengthDouble; + newRange.inValueUpdate = YES; + + newRange.locationDecimal = self.locationDecimal; + newRange.locationDouble = self.locationDouble; + + newRange.lengthDecimal = self.lengthDecimal; + newRange.lengthDouble = self.lengthDouble; + + newRange.inValueUpdate = NO; } return newRange; } @@ -272,10 +457,12 @@ -(id)mutableCopyWithZone:(NSZone *)zone /// @cond --(void)encodeWithCoder:(NSCoder *)encoder +-(void)encodeWithCoder:(nonnull NSCoder *)encoder { - [encoder encodeDecimal:self.location forKey:@"CPTPlotRange.location"]; - [encoder encodeDecimal:self.length forKey:@"CPTPlotRange.length"]; + [encoder encodeDecimal:self.locationDecimal forKey:@"CPTPlotRange.location"]; + [encoder encodeDecimal:self.lengthDecimal forKey:@"CPTPlotRange.length"]; + [encoder encodeBool:self.isInfinite forKey:@"CPTPlotRange.isInfinite"]; + [encoder encodeInteger:self.lengthSign forKey:@"CPTPlotRange.lengthSign"]; } /// @endcond @@ -284,16 +471,31 @@ -(void)encodeWithCoder:(NSCoder *)encoder * @param decoder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)decoder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder { - if ( (self = [super init]) ) { - self.location = [decoder decodeDecimalForKey:@"CPTPlotRange.location"]; - self.length = [decoder decodeDecimalForKey:@"CPTPlotRange.length"]; + if ((self = [super init])) { + self.locationDecimal = [decoder decodeDecimalForKey:@"CPTPlotRange.location"]; + self.lengthDecimal = [decoder decodeDecimalForKey:@"CPTPlotRange.length"]; + + isInfinite = [decoder decodeBoolForKey:@"CPTPlotRange.isInfinite"]; + lengthSign = [decoder decodeIntegerForKey:@"CPTPlotRange.lengthSign"]; } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Checking Containership @@ -303,7 +505,27 @@ -(instancetype)initWithCoder:(NSCoder *)decoder **/ -(BOOL)contains:(NSDecimal)number { - return CPTDecimalGreaterThanOrEqualTo(number, self.minLimit) && CPTDecimalLessThanOrEqualTo(number, self.maxLimit); + BOOL result = NO; + + if ( self.isInfinite ) { + switch ( self.lengthSign ) { + case CPTSignPositive: + result = CPTDecimalGreaterThanOrEqualTo(number, self.minLimitDecimal); + break; + + case CPTSignNegative: + result = CPTDecimalLessThanOrEqualTo(number, self.maxLimitDecimal); + break; + + default: + break; + } + } + else { + result = CPTDecimalGreaterThanOrEqualTo(number, self.minLimitDecimal) && CPTDecimalLessThanOrEqualTo(number, self.maxLimitDecimal); + } + + return result; } /** @brief Determines whether a given number is inside the range. @@ -319,15 +541,13 @@ -(BOOL)containsDouble:(double)number * @param number The number to check. * @return @YES if @ref location ≤ @par{number} ≤ @ref end. **/ --(BOOL)containsNumber:(NSNumber *)number +-(BOOL)containsNumber:(nullable NSNumber *)number { if ( [number isKindOfClass:[NSDecimalNumber class]] ) { - NSDecimal numericValue = number.decimalValue; - return CPTDecimalGreaterThanOrEqualTo(numericValue, self.minLimit) && CPTDecimalLessThanOrEqualTo(numericValue, self.maxLimit); + return [self contains:number.decimalValue]; } else { - double numericValue = number.doubleValue; - return (numericValue >= self.minLimitDouble) && (numericValue <= self.maxLimitDouble); + return [self containsDouble:number.doubleValue]; } } @@ -335,10 +555,13 @@ -(BOOL)containsNumber:(NSNumber *)number * @param otherRange The range to check. * @return @YES if the ranges both have the same location and length. **/ --(BOOL)isEqualToRange:(CPTPlotRange *)otherRange +-(BOOL)isEqualToRange:(nullable CPTPlotRange *)otherRange { if ( otherRange ) { - return CPTDecimalEquals(self.location, otherRange.location) && CPTDecimalEquals(self.length, otherRange.length); + return CPTDecimalEquals(self.locationDecimal, otherRange.locationDecimal) && + CPTDecimalEquals(self.lengthDecimal, otherRange.lengthDecimal) && + (self.isInfinite == otherRange.isInfinite) && + (self.lengthSign == otherRange.lengthSign); } else { return NO; @@ -349,42 +572,100 @@ -(BOOL)isEqualToRange:(CPTPlotRange *)otherRange * @param otherRange The range to check. * @return @YES if the other range fits entirely within the range of the receiver. **/ --(BOOL)containsRange:(CPTPlotRange *)otherRange +-(BOOL)containsRange:(nullable CPTPlotRange *)otherRange { + BOOL result = NO; + if ( otherRange ) { - return CPTDecimalGreaterThanOrEqualTo(otherRange.minLimit, self.minLimit) && CPTDecimalLessThanOrEqualTo(otherRange.maxLimit, self.maxLimit); - } - else { - return NO; + if ( self.isInfinite ) { + if ( !otherRange.isInfinite || (otherRange.lengthSign == self.lengthSign)) { + switch ( self.lengthSign ) { + case CPTSignPositive: + result = CPTDecimalGreaterThanOrEqualTo(otherRange.minLimitDecimal, self.minLimitDecimal); + break; + + case CPTSignNegative: + result = CPTDecimalLessThanOrEqualTo(otherRange.maxLimitDecimal, self.maxLimitDecimal); + break; + + default: + break; + } + } + } + else { + result = CPTDecimalGreaterThanOrEqualTo(otherRange.minLimitDecimal, self.minLimitDecimal) && CPTDecimalLessThanOrEqualTo(otherRange.maxLimitDecimal, self.maxLimitDecimal); + } } + + return result; } /** @brief Determines whether a given range intersects the receiver. * @param otherRange The range to check. * @return @YES if the ranges intersect. **/ --(BOOL)intersectsRange:(CPTPlotRange *)otherRange +-(BOOL)intersectsRange:(nullable CPTPlotRange *)otherRange { - if ( !otherRange ) { - return NO; - } + BOOL result = NO; - NSDecimal min1 = self.minLimit; - NSDecimal min2 = otherRange.minLimit; - NSDecimal minimum = CPTDecimalGreaterThan(min1, min2) ? min1 : min2; - - NSDecimal max1 = self.maxLimit; - NSDecimal max2 = otherRange.maxLimit; - NSDecimal maximum = CPTDecimalLessThan(max1, max2) ? max1 : max2; + if ( otherRange ) { + if ( self.isInfinite ) { + if ( otherRange.isInfinite ) { + result = (otherRange.lengthSign == self.lengthSign); + } + if ( !result ) { + switch ( self.lengthSign ) { + case CPTSignPositive: + result = CPTDecimalGreaterThanOrEqualTo(otherRange.maxLimitDecimal, self.minLimitDecimal); + break; + + case CPTSignNegative: + result = CPTDecimalLessThanOrEqualTo(otherRange.minLimitDecimal, self.maxLimitDecimal); + break; + + default: + break; + } + } + } + else { + if ( otherRange.isInfinite ) { + switch ( otherRange.lengthSign ) { + case CPTSignPositive: + result = CPTDecimalLessThanOrEqualTo(otherRange.minLimitDecimal, self.maxLimitDecimal); + break; + + case CPTSignNegative: + result = CPTDecimalLessThanOrEqualTo(otherRange.maxLimitDecimal, self.minLimitDecimal); + break; + + default: + break; + } + } + else { + NSDecimal min1 = self.minLimitDecimal; + NSDecimal min2 = otherRange.minLimitDecimal; + NSDecimal minimum = CPTDecimalMax(min1, min2); + + NSDecimal max1 = self.maxLimitDecimal; + NSDecimal max2 = otherRange.maxLimitDecimal; + NSDecimal maximum = CPTDecimalMin(max1, max2); + + result = CPTDecimalGreaterThanOrEqualTo(maximum, minimum); + } + } + } - return CPTDecimalGreaterThanOrEqualTo(maximum, minimum); + return result; } /** @brief Compares a number to the range, determining if it is in the range, or above or below it. * @param number The number to check. * @return The comparison result. **/ --(CPTPlotRangeComparisonResult)compareToNumber:(NSNumber *)number +-(CPTPlotRangeComparisonResult)compareToNumber:(nonnull NSNumber *)number { CPTPlotRangeComparisonResult result; @@ -405,10 +686,13 @@ -(CPTPlotRangeComparisonResult)compareToDecimal:(NSDecimal)number { CPTPlotRangeComparisonResult result; - if ( [self contains:number] ) { + if ( NSDecimalIsNotANumber(&number)) { + result = CPTPlotRangeComparisonResultNumberUndefined; + } + else if ( [self contains:number] ) { result = CPTPlotRangeComparisonResultNumberInRange; } - else if ( CPTDecimalLessThan(number, self.minLimit) ) { + else if ( CPTDecimalLessThan(number, self.minLimitDecimal)) { result = CPTPlotRangeComparisonResultNumberBelowRange; } else { @@ -425,7 +709,10 @@ -(CPTPlotRangeComparisonResult)compareToDouble:(double)number { CPTPlotRangeComparisonResult result; - if ( number < self.minLimitDouble ) { + if ( isnan(number)) { + result = CPTPlotRangeComparisonResultNumberUndefined; + } + else if ( number < self.minLimitDouble ) { result = CPTPlotRangeComparisonResultNumberBelowRange; } else if ( number > self.maxLimitDouble ) { @@ -442,7 +729,7 @@ -(CPTPlotRangeComparisonResult)compareToDouble:(double)number /// @cond --(BOOL)isEqual:(id)object +-(BOOL)isEqual:(nullable id)object { if ( self == object ) { return YES; @@ -457,8 +744,8 @@ -(BOOL)isEqual:(id)object -(NSUInteger)hash { - NSDecimalNumber *locationNumber = [NSDecimalNumber decimalNumberWithDecimal:self.location]; - NSDecimalNumber *lengthNumber = [NSDecimalNumber decimalNumberWithDecimal:self.length]; + NSDecimalNumber *locationNumber = [NSDecimalNumber decimalNumberWithDecimal:self.locationDecimal]; + NSDecimalNumber *lengthNumber = [NSDecimalNumber decimalNumberWithDecimal:self.lengthDecimal]; return locationNumber.hash + lengthNumber.hash; } @@ -470,15 +757,32 @@ -(NSUInteger)hash /// @cond --(NSString *)description +-(nullable NSString *)description { - NSDecimal myLocation = self.location; - NSDecimal myLength = self.length; + NSDecimal myLocation = self.locationDecimal; + NSDecimal myLength = self.lengthDecimal; return [NSString stringWithFormat:@"<%@ {%@, %@}>", - [super description], + super.description, + NSDecimalString(&myLocation, [NSLocale currentLocale]), + self.isInfinite ? (self.lengthSign == CPTSignPositive ? @"+INF" : @"-INF") : NSDecimalString(&myLength, [NSLocale currentLocale])]; +} + +/// @endcond + +#pragma mark - +#pragma mark Debugging + +/// @cond + +-(nullable id)debugQuickLookObject +{ + NSDecimal myLocation = self.locationDecimal; + NSDecimal myLength = self.lengthDecimal; + + return [NSString stringWithFormat:@"Location: %@\nLength: %@", NSDecimalString(&myLocation, [NSLocale currentLocale]), - NSDecimalString(&myLength, [NSLocale currentLocale])]; + self.isInfinite ? (self.lengthSign == CPTSignPositive ? @"+INF" : @"-INF") : NSDecimalString(&myLength, [NSLocale currentLocale])]; } /// @endcond diff --git a/framework/Source/CPTPlotRangeTests.m b/framework/Source/CPTPlotRangeTests.m index 896e5648d..c5cfeabd0 100644 --- a/framework/Source/CPTPlotRangeTests.m +++ b/framework/Source/CPTPlotRangeTests.m @@ -17,7 +17,7 @@ @implementation CPTPlotRangeTests -(void)setUp { - self.plotRange = [CPTMutablePlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) length:CPTDecimalFromDouble(2.0)]; + self.plotRange = [CPTMutablePlotRange plotRangeWithLocation:@1.0 length:@2.0]; } -(void)tearDown @@ -37,9 +37,20 @@ -(void)testContains XCTAssertFalse([self.plotRange contains:CPTDecimalFromDouble(3.001)], @"Test contains:3.001"); } +-(void)testContainsInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + XCTAssertFalse([self.plotRange contains:CPTDecimalFromDouble(0.999)], @"Test contains:0.999"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(1.0)], @"Test contains:1.0"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(2.0)], @"Test contains:2.0"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(3.0)], @"Test contains:3.0"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(3.001)], @"Test contains:3.001"); +} + -(void)testContainsNegative { - self.plotRange.length = CPTDecimalFromDouble(-2.0); + self.plotRange.lengthDouble = -2.0; XCTAssertFalse([self.plotRange contains:CPTDecimalFromDouble(-1.001)], @"Test contains:-1.001"); XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(-1.0)], @"Test contains:-1.0"); @@ -48,6 +59,17 @@ -(void)testContainsNegative XCTAssertFalse([self.plotRange contains:CPTDecimalFromDouble(1.001)], @"Test contains:1.001"); } +-(void)testContainsNegativeInfinite +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(-1.001)], @"Test contains:-1.001"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(-1.0)], @"Test contains:-1.0"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(0.0)], @"Test contains:0.0"); + XCTAssertTrue([self.plotRange contains:CPTDecimalFromDouble(1.0)], @"Test contains:1.0"); + XCTAssertFalse([self.plotRange contains:CPTDecimalFromDouble(1.001)], @"Test contains:1.001"); +} + -(void)testContainsDouble { XCTAssertFalse([self.plotRange containsDouble:0.999], @"Test contains:0.999"); @@ -57,6 +79,17 @@ -(void)testContainsDouble XCTAssertFalse([self.plotRange containsDouble:3.001], @"Test contains:3.001"); } +-(void)testContainsDoubleInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + XCTAssertFalse([self.plotRange containsDouble:0.999], @"Test contains:0.999"); + XCTAssertTrue([self.plotRange containsDouble:1.0], @"Test contains:1.0"); + XCTAssertTrue([self.plotRange containsDouble:2.0], @"Test contains:2.0"); + XCTAssertTrue([self.plotRange containsDouble:3.0], @"Test contains:3.0"); + XCTAssertTrue([self.plotRange containsDouble:3.001], @"Test contains:3.001"); +} + -(void)testContainsNumber { XCTAssertFalse([self.plotRange containsNumber:@(0.999)], @"Test contains:0.999"); @@ -66,9 +99,20 @@ -(void)testContainsNumber XCTAssertFalse([self.plotRange containsNumber:@(3.001)], @"Test contains:3.001"); } +-(void)testContainsNumberInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + XCTAssertFalse([self.plotRange containsNumber:@(0.999)], @"Test contains:0.999"); + XCTAssertTrue([self.plotRange containsNumber:[NSDecimalNumber one]], @"Test contains:1.0"); + XCTAssertTrue([self.plotRange containsNumber:@(2.0)], @"Test contains:2.0"); + XCTAssertTrue([self.plotRange containsNumber:@(3.0)], @"Test contains:3.0"); + XCTAssertTrue([self.plotRange containsNumber:@(3.001)], @"Test contains:3.001"); +} + -(void)testContainsDoubleNegative { - self.plotRange.length = CPTDecimalFromDouble(-2.0); + self.plotRange.lengthDouble = -2.0; XCTAssertFalse([self.plotRange containsDouble:-1.001], @"Test contains:-1.001"); XCTAssertTrue([self.plotRange containsDouble:-1.0], @"Test contains:-1.0"); @@ -77,151 +121,316 @@ -(void)testContainsDoubleNegative XCTAssertFalse([self.plotRange containsDouble:1.001], @"Test contains:1.001"); } +-(void)testContainsDoubleNegativeInfinite +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + XCTAssertTrue([self.plotRange containsDouble:-1.001], @"Test contains:-1.001"); + XCTAssertTrue([self.plotRange containsDouble:-1.0], @"Test contains:-1.0"); + XCTAssertTrue([self.plotRange containsDouble:0.0], @"Test contains:0.0"); + XCTAssertTrue([self.plotRange containsDouble:1.0], @"Test contains:1.0"); + XCTAssertFalse([self.plotRange containsDouble:1.001], @"Test contains:1.001"); +} + -(void)testContainsRange { - CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(4.0)]; + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); - otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) length:CPTDecimalFromDouble(2.0)]; + otherRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@2.0]; XCTAssertTrue([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); - otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(2.0) length:CPTDecimalFromDouble(1.0)]; + otherRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@1.0]; XCTAssertTrue([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); - otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(2.0) length:CPTDecimalFromDouble(4.0)]; + otherRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@4.0]; XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); - otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(2.0)]; + otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@2.0]; XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); } +-(void)testContainsRangeInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; + + XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@2.0]; + XCTAssertTrue([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@1.0]; + XCTAssertTrue([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@4.0]; + XCTAssertTrue([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@2.0]; + XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); +} + +-(void)testContainsRangeNegativeInfinite +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; + + XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@(-2.0)]; + XCTAssertTrue([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@(-1.0)]; + XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@4.0]; + XCTAssertFalse([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + + otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(-2.0)]; + XCTAssertTrue([self.plotRange containsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); +} + #pragma mark - #pragma mark Union -(void)testUnionRange { - [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(4.0)]]; + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]]; [self checkRangeWithLocation:0.0 length:4.0]; - [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(1.0)]]; + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]]; [self checkRangeWithLocation:-1.0 length:5.0]; - [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(2.0)]]; + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@2.0]]; [self checkRangeWithLocation:-1.0 length:8.0]; - [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]]; [self checkRangeWithLocation:-4.0 length:11.0]; - [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@(-4.0)]]; [self checkRangeWithLocation:-5.0 length:12.0]; - [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@(-4.0)]]; [self checkRangeWithLocation:-5.0 length:12.0]; } +-(void)testUnionRangeInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]]; + [self checkRangeWithLocation:0.0 length:HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]]; + [self checkRangeWithLocation:-1.0 length:HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@2.0]]; + [self checkRangeWithLocation:-1.0 length:HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]]; + [self checkRangeWithLocation:-4.0 length:HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@(-4.0)]]; + [self checkRangeWithLocation:-5.0 length:HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@(HUGE_VAL)]]; + [self checkRangeWithLocation:-5.0 length:HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@(-HUGE_VAL)]]; + [self checkRangeWithLocation:-HUGE_VAL length:HUGE_VAL]; +} + -(void)testUnionRangeNegative { - self.plotRange.length = CPTDecimalFromDouble(-2.0); + self.plotRange.lengthDouble = -2.0; - [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(4.0)]]; + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]]; [self checkRangeWithLocation:4.0 length:-5.0]; - [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(1.0)]]; + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]]; [self checkRangeWithLocation:4.0 length:-5.0]; - [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(2.0)]]; + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@2.0]]; [self checkRangeWithLocation:7.0 length:-8.0]; - [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]]; [self checkRangeWithLocation:7.0 length:-11.0]; - [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@(-4.0)]]; [self checkRangeWithLocation:7.0 length:-12.0]; - [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@(-4.0)]]; [self checkRangeWithLocation:7.0 length:-12.0]; } +-(void)testUnionRangeNegativeInfinite +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]]; + [self checkRangeWithLocation:4.0 length:-HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]]; + [self checkRangeWithLocation:4.0 length:-HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@2.0]]; + [self checkRangeWithLocation:7.0 length:-HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]]; + [self checkRangeWithLocation:7.0 length:-HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@(-4.0)]]; + [self checkRangeWithLocation:7.0 length:-HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@10.0 length:@(-HUGE_VAL)]]; + [self checkRangeWithLocation:10.0 length:-HUGE_VAL]; + + [self.plotRange unionPlotRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@(HUGE_VAL)]]; + [self checkRangeWithLocation:-HUGE_VAL length:HUGE_VAL]; +} + #pragma mark - #pragma mark Intersection -(void)testIntersectRange { - CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(4.0)]; + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; [self checkRangeWithLocation:1.0 length:2.0]; - otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) length:CPTDecimalFromDouble(1.0)]; + otherRange = [CPTPlotRange plotRangeWithLocation:@1.0 length:@1.0]; XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; [self checkRangeWithLocation:1.0 length:1.0]; - otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(1.0)]; + otherRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]; XCTAssertFalse([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; - [self checkRangeWithLocation:1.0 length:0.0]; + [self checkRangeWithLocation:(double)NAN length:(double)NAN]; } -(void)testIntersectRange2 { - CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(4.0) length:CPTDecimalFromDouble(-4.0)]; + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@4.0 length:@(-4.0)]; XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; [self checkRangeWithLocation:1.0 length:2.0]; - otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(2.0) length:CPTDecimalFromDouble(-1.0)]; + otherRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@(-1.0)]; XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; [self checkRangeWithLocation:1.0 length:1.0]; - otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(-4.0)]; + otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]; XCTAssertFalse([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; - [self checkRangeWithLocation:1.0 length:0.0]; + [self checkRangeWithLocation:(double)NAN length:(double)NAN]; } -(void)testIntersectRangeNegative { - self.plotRange.length = CPTDecimalFromDouble(-2.0); + self.plotRange.lengthDouble = -2.0; - CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(4.0)]; + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; [self checkRangeWithLocation:1.0 length:-1.0]; - otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(1.0)]; + otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@1.0]; XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; [self checkRangeWithLocation:1.0 length:-1.0]; - otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(2.0)]; + otherRange = [CPTPlotRange plotRangeWithLocation:@5.0 length:@2.0]; XCTAssertFalse([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; - [self checkRangeWithLocation:1.0 length:0.0]; + [self checkRangeWithLocation:(double)NAN length:(double)NAN]; } -(void)testIntersectRangeNegative2 { - self.plotRange.length = CPTDecimalFromDouble(-2.0); + self.plotRange.lengthDouble = -2.0; - CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(-4.0)]; + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]; XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; [self checkRangeWithLocation:0.0 length:-1.0]; - otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(2.0) length:CPTDecimalFromDouble(-4.0)]; + otherRange = [CPTPlotRange plotRangeWithLocation:@2.0 length:@(-4.0)]; XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; [self checkRangeWithLocation:0.0 length:-1.0]; - otherRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(-4.0)]; + otherRange = [CPTPlotRange plotRangeWithLocation:@5.0 length:@(-4.0)]; + XCTAssertFalse([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + [self.plotRange intersectionPlotRange:otherRange]; + [self checkRangeWithLocation:(double)NAN length:(double)NAN]; +} + +-(void)testIntersectRangeInfinite1 +{ + self.plotRange.lengthDouble = HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; + XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + [self.plotRange intersectionPlotRange:otherRange]; + [self checkRangeWithLocation:1.0 length:3.0]; +} + +-(void)testIntersectRangeInfinite2 +{ + self.plotRange.lengthDouble = HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(HUGE_VAL)]; + XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + [self.plotRange intersectionPlotRange:otherRange]; + [self checkRangeWithLocation:1.0 length:HUGE_VAL]; +} + +-(void)testIntersectRangeInfinite3 +{ + self.plotRange.lengthDouble = HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]; + XCTAssertFalse([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + [self.plotRange intersectionPlotRange:otherRange]; + [self checkRangeWithLocation:(double)NAN length:(double)NAN]; +} + +-(void)testIntersectRangeNegativeInfinite1 +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]; + XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + [self.plotRange intersectionPlotRange:otherRange]; + [self checkRangeWithLocation:1.0 length:-1.0]; +} + +-(void)testIntersectRangeNegativeInfinite2 +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(-HUGE_VAL)]; + XCTAssertTrue([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); + [self.plotRange intersectionPlotRange:otherRange]; + [self checkRangeWithLocation:0.0 length:-HUGE_VAL]; +} + +-(void)testIntersectRangeNegativeInfinite3 +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + CPTPlotRange *otherRange = [CPTPlotRange plotRangeWithLocation:@10.0 length:@(-4.0)]; XCTAssertFalse([self.plotRange intersectsRange:otherRange], @"otherRange was {%g, %g}", otherRange.locationDouble, otherRange.lengthDouble); [self.plotRange intersectionPlotRange:otherRange]; - [self checkRangeWithLocation:0.0 length:0.0]; + [self checkRangeWithLocation:(double)NAN length:(double)NAN]; } #pragma mark - @@ -229,89 +438,89 @@ -(void)testIntersectRangeNegative2 -(void)testShiftLocation { - [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(4.0)]]; + [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]]; [self checkRangeWithLocation:1.0 length:2.0]; - [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(1.0)]]; + [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]]; [self checkRangeWithLocation:0.0 length:2.0]; - [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(2.0)]]; + [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@2.0]]; [self checkRangeWithLocation:5.0 length:2.0]; - [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]]; [self checkRangeWithLocation:0.0 length:2.0]; - [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@(-4.0)]]; [self checkRangeWithLocation:-1.0 length:2.0]; - [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@(-4.0)]]; [self checkRangeWithLocation:1.0 length:2.0]; } -(void)testShiftLocationNegative { - self.plotRange.length = CPTDecimalFromDouble(-2.0); + self.plotRange.lengthDouble = -2.0; - [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(4.0)]]; + [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]]; [self checkRangeWithLocation:1.0 length:-2.0]; - [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(1.0)]]; + [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]]; [self checkRangeWithLocation:0.0 length:-2.0]; - [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(2.0)]]; + [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@2.0]]; [self checkRangeWithLocation:5.0 length:-2.0]; - [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]]; [self checkRangeWithLocation:0.0 length:-2.0]; - [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@(-4.0)]]; [self checkRangeWithLocation:-1.0 length:-2.0]; - [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange shiftLocationToFitInRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@(-4.0)]]; [self checkRangeWithLocation:1.0 length:-2.0]; } -(void)testShiftEnd { - [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(4.0)]]; + [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]]; [self checkRangeWithLocation:1.0 length:2.0]; - [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(1.0)]]; + [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]]; [self checkRangeWithLocation:-2.0 length:2.0]; - [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(2.0)]]; + [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@2.0]]; [self checkRangeWithLocation:3.0 length:2.0]; - [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]]; [self checkRangeWithLocation:-2.0 length:2.0]; - [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@(-4.0)]]; [self checkRangeWithLocation:-3.0 length:2.0]; - [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@(-4.0)]]; [self checkRangeWithLocation:-1.0 length:2.0]; } -(void)testShiftEndNegative { - self.plotRange.length = CPTDecimalFromDouble(-2.0); + self.plotRange.lengthDouble = -2.0; - [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(4.0)]]; + [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@4.0]]; [self checkRangeWithLocation:2.0 length:-2.0]; - [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(1.0)]]; + [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]]; [self checkRangeWithLocation:2.0 length:-2.0]; - [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(2.0)]]; + [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@2.0]]; [self checkRangeWithLocation:7.0 length:-2.0]; - [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:@0.0 length:@(-4.0)]]; [self checkRangeWithLocation:2.0 length:-2.0]; - [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:@(-1.0) length:@(-4.0)]]; [self checkRangeWithLocation:1.0 length:-2.0]; - [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(5.0) length:CPTDecimalFromDouble(-4.0)]]; + [self.plotRange shiftEndToFitInRange:[CPTPlotRange plotRangeWithLocation:@5.0 length:@(-4.0)]]; [self checkRangeWithLocation:3.0 length:-2.0]; } @@ -320,43 +529,43 @@ -(void)testShiftEndNegative -(void)testExpandRangeHalf { - [self.plotRange expandRangeByFactor:CPTDecimalFromDouble(0.5)]; + [self.plotRange expandRangeByFactor:@0.5]; [self checkRangeWithLocation:1.5 length:1.0]; } -(void)testExpandRangeSame { - [self.plotRange expandRangeByFactor:CPTDecimalFromDouble(1.0)]; + [self.plotRange expandRangeByFactor:@1.0]; [self checkRangeWithLocation:1.0 length:2.0]; } -(void)testExpandRangeDouble { - [self.plotRange expandRangeByFactor:CPTDecimalFromDouble(2.0)]; + [self.plotRange expandRangeByFactor:@2.0]; [self checkRangeWithLocation:0.0 length:4.0]; } -(void)testExpandRangeHalfNegative { - self.plotRange.length = CPTDecimalFromDouble(-2.0); + self.plotRange.lengthDouble = -2.0; - [self.plotRange expandRangeByFactor:CPTDecimalFromDouble(0.5)]; + [self.plotRange expandRangeByFactor:@0.5]; [self checkRangeWithLocation:0.5 length:-1.0]; } -(void)testExpandRangeSameNegative { - self.plotRange.length = CPTDecimalFromDouble(-2.0); + self.plotRange.lengthDouble = -2.0; - [self.plotRange expandRangeByFactor:CPTDecimalFromDouble(1.0)]; + [self.plotRange expandRangeByFactor:@1.0]; [self checkRangeWithLocation:1.0 length:-2.0]; } -(void)testExpandRangeDoubleNegative { - self.plotRange.length = CPTDecimalFromDouble(-2.0); + self.plotRange.lengthDouble = -2.0; - [self.plotRange expandRangeByFactor:CPTDecimalFromDouble(2.0)]; + [self.plotRange expandRangeByFactor:@2.0]; [self checkRangeWithLocation:2.0 length:-4.0]; } @@ -370,17 +579,43 @@ -(void)testCompareToDecimal XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(2.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:2.0"); XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(3.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:3.0"); XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(3.001)], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:3.001"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalNaN()], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); +} + +-(void)testCompareToDecimalInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(0.999)], CPTPlotRangeComparisonResultNumberBelowRange, @"Test compareTo:0.999"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(1.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:1.0"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(2.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:2.0"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(3.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:3.0"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(3.001)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:3.001"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalNaN()], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); } -(void)testCompareToDecimalNegative { - self.plotRange.length = CPTDecimalFromDouble(-2.0); + self.plotRange.lengthDouble = -2.0; XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(-1.001)], CPTPlotRangeComparisonResultNumberBelowRange, @"Test compareTo:-1.001"); XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(-1.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:-1.0"); XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(0.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:0.0"); XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(1.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:1.0"); XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(1.001)], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:1.001"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalNaN()], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); +} + +-(void)testCompareToDecimalNegativeInfinite +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(-1.001)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:-1.001"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(-1.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:-1.0"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(0.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:0.0"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(1.0)], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:1.0"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalFromDouble(1.001)], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:1.001"); + XCTAssertEqual([self.plotRange compareToDecimal:CPTDecimalNaN()], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); } -(void)testCompareToDouble @@ -390,17 +625,51 @@ -(void)testCompareToDouble XCTAssertEqual([self.plotRange compareToDouble:2.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:2.0"); XCTAssertEqual([self.plotRange compareToDouble:3.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:3.0"); XCTAssertEqual([self.plotRange compareToDouble:3.001], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:3.001"); + XCTAssertEqual([self.plotRange compareToDouble:HUGE_VAL], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:+INF"); + XCTAssertEqual([self.plotRange compareToDouble:-HUGE_VAL], CPTPlotRangeComparisonResultNumberBelowRange, @"Test compareTo:-INF"); + XCTAssertEqual([self.plotRange compareToDouble:(double)NAN], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); +} + +-(void)testCompareToDoubleInfinite +{ + self.plotRange.lengthDouble = HUGE_VAL; + + XCTAssertEqual([self.plotRange compareToDouble:0.999], CPTPlotRangeComparisonResultNumberBelowRange, @"Test compareTo:0.999"); + XCTAssertEqual([self.plotRange compareToDouble:1.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:1.0"); + XCTAssertEqual([self.plotRange compareToDouble:2.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:2.0"); + XCTAssertEqual([self.plotRange compareToDouble:3.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:3.0"); + XCTAssertEqual([self.plotRange compareToDouble:3.001], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:3.001"); + XCTAssertEqual([self.plotRange compareToDouble:HUGE_VAL], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:+INF"); + XCTAssertEqual([self.plotRange compareToDouble:-HUGE_VAL], CPTPlotRangeComparisonResultNumberBelowRange, @"Test compareTo:-INF"); + XCTAssertEqual([self.plotRange compareToDouble:(double)NAN], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); } -(void)testCompareToDoubleNegative { - self.plotRange.length = CPTDecimalFromDouble(-2.0); + self.plotRange.lengthDouble = -2.0; XCTAssertEqual([self.plotRange compareToDouble:-1.001], CPTPlotRangeComparisonResultNumberBelowRange, @"Test compareTo:-1.001"); XCTAssertEqual([self.plotRange compareToDouble:-1.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:-1.0"); XCTAssertEqual([self.plotRange compareToDouble:0.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:0.0"); XCTAssertEqual([self.plotRange compareToDouble:1.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:1.0"); XCTAssertEqual([self.plotRange compareToDouble:1.001], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:1.001"); + XCTAssertEqual([self.plotRange compareToDouble:HUGE_VAL], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:+INF"); + XCTAssertEqual([self.plotRange compareToDouble:-HUGE_VAL], CPTPlotRangeComparisonResultNumberBelowRange, @"Test compareTo:-INF"); + XCTAssertEqual([self.plotRange compareToDouble:(double)NAN], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); +} + +-(void)testCompareToDoubleNegativeInfinite +{ + self.plotRange.lengthDouble = -HUGE_VAL; + + XCTAssertEqual([self.plotRange compareToDouble:-1.001], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:-1.001"); + XCTAssertEqual([self.plotRange compareToDouble:-1.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:-1.0"); + XCTAssertEqual([self.plotRange compareToDouble:0.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:0.0"); + XCTAssertEqual([self.plotRange compareToDouble:1.0], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:1.0"); + XCTAssertEqual([self.plotRange compareToDouble:1.001], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:1.001"); + XCTAssertEqual([self.plotRange compareToDouble:HUGE_VAL], CPTPlotRangeComparisonResultNumberAboveRange, @"Test compareTo:+INF"); + XCTAssertEqual([self.plotRange compareToDouble:-HUGE_VAL], CPTPlotRangeComparisonResultNumberInRange, @"Test compareTo:-INF"); + XCTAssertEqual([self.plotRange compareToDouble:(double)NAN], CPTPlotRangeComparisonResultNumberUndefined, @"Test compareTo:NAN"); } #pragma mark - @@ -408,7 +677,7 @@ -(void)testCompareToDoubleNegative -(void)testKeyedArchivingRoundTrip { - CPTPlotRange *newRange = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:self.plotRange]]; + CPTPlotRange *newRange = [self archiveRoundTrip:self.plotRange]; XCTAssertTrue([self.plotRange isEqualToRange:newRange], @"Ranges equal"); } @@ -420,14 +689,14 @@ -(void)checkRangeWithLocation:(double)loc length:(double)len { NSString *errMessage; - NSDecimal newLocation = self.plotRange.location; + NSDecimal newLocation = self.plotRange.locationDecimal; errMessage = [NSString stringWithFormat:@"expected location = %g, was %@", loc, NSDecimalString(&newLocation, nil)]; - XCTAssertTrue(CPTDecimalEquals( newLocation, CPTDecimalFromDouble(loc) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(newLocation, CPTDecimalFromDouble(loc)), @"%@", errMessage); - NSDecimal newLength = self.plotRange.length; + NSDecimal newLength = self.plotRange.lengthDecimal; errMessage = [NSString stringWithFormat:@"expected location = %g, was %@", loc, NSDecimalString(&newLength, nil)]; - XCTAssertTrue(CPTDecimalEquals( newLength, CPTDecimalFromDouble(len) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(newLength, CPTDecimalFromDouble(len)), @"%@", errMessage); } @end diff --git a/framework/Source/CPTPlotSpace.h b/framework/Source/CPTPlotSpace.h index 60e5dc74c..902817b73 100644 --- a/framework/Source/CPTPlotSpace.h +++ b/framework/Source/CPTPlotSpace.h @@ -1,4 +1,5 @@ #import "CPTDefinitions.h" +#import "CPTPlot.h" #import "CPTResponder.h" @class CPTLayer; @@ -6,6 +7,16 @@ @class CPTGraph; @class CPTPlotSpace; +/** + * @brief Plot space mapping notification type. + **/ +typedef NSString *CPTPlotSpaceCoordinateMapping cpt_swift_struct; + +/** + * @brief The userInfo dictionary keys used by #CPTPlotSpaceCoordinateMappingDidChangeNotification notifications. + **/ +typedef NSString *CPTPlotSpaceInfoKey cpt_swift_struct; + /// @name Plot Space /// @{ @@ -15,32 +26,32 @@ * the plot space coordinate system and drawing coordinates changes. * @ingroup notification **/ -extern NSString *const CPTPlotSpaceCoordinateMappingDidChangeNotification; +extern CPTPlotSpaceCoordinateMapping __nonnull const CPTPlotSpaceCoordinateMappingDidChangeNotification; -/** @brief The userInfo dictionary key used by the CPTPlotSpaceCoordinateMappingDidChangeNotification +/** @brief The userInfo dictionary key used by the #CPTPlotSpaceCoordinateMappingDidChangeNotification * to indicate the plot coordinate affected by the mapping change. * * The value associated with this key is the CPTCoordinate affected by the change wrapped in an instance of NSNumber. * @ingroup notification **/ -extern NSString *const CPTPlotSpaceCoordinateKey; +extern CPTPlotSpaceInfoKey __nonnull const CPTPlotSpaceCoordinateKey; -/** @brief The userInfo dictionary key used by the CPTPlotSpaceCoordinateMappingDidChangeNotification +/** @brief The userInfo dictionary key used by the #CPTPlotSpaceCoordinateMappingDidChangeNotification * to indicate whether the mapping change is a scroll movement or other change. * * The value associated with this key is a boolean value wrapped in an instance of NSNumber. The value * is @YES if the plot space change represents a horizontal or vertical translation, @NO otherwise. * @ingroup notification **/ -extern NSString *const CPTPlotSpaceScrollingKey; +extern CPTPlotSpaceInfoKey __nonnull const CPTPlotSpaceScrollingKey; -/** @brief The userInfo dictionary key used by the CPTPlotSpaceCoordinateMappingDidChangeNotification +/** @brief The userInfo dictionary key used by the #CPTPlotSpaceCoordinateMappingDidChangeNotification * to indicate the displacement offset for scrolling changes in drawing coordinates. * * The value associated with this key is the displacement offset wrapped in an instance of NSNumber. * @ingroup notification **/ -extern NSString *const CPTPlotSpaceDisplacementKey; +extern CPTPlotSpaceInfoKey __nonnull const CPTPlotSpaceDisplacementKey; /// @} @@ -61,7 +72,7 @@ extern NSString *const CPTPlotSpaceDisplacementKey; * @return @YES if the gesture should be handled by the plot space, and @NO if not. * In either case, the delegate may choose to take extra actions, or handle the scaling itself. **/ --(BOOL)plotSpace:(CPTPlotSpace *)space shouldScaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint; +-(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldScaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint; /// @} @@ -73,7 +84,7 @@ extern NSString *const CPTPlotSpaceDisplacementKey; * @param proposedDisplacementVector The proposed amount by which the plot space will shift. * @return The displacement actually applied. **/ --(CGPoint)plotSpace:(CPTPlotSpace *)space willDisplaceBy:(CGPoint)proposedDisplacementVector; +-(CGPoint)plotSpace:(nonnull CPTPlotSpace *)space willDisplaceBy:(CGPoint)proposedDisplacementVector; /// @} @@ -86,13 +97,13 @@ extern NSString *const CPTPlotSpaceDisplacementKey; * @param coordinate The coordinate of the range. * @return The new plot range to be used. **/ --(CPTPlotRange *)plotSpace:(CPTPlotSpace *)space willChangePlotRangeTo:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate; +-(nullable CPTPlotRange *)plotSpace:(nonnull CPTPlotSpace *)space willChangePlotRangeTo:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate; /** @brief @optional Notifies that plot space has changed a plot range. * @param space The plot space. * @param coordinate The coordinate of the range. **/ --(void)plotSpace:(CPTPlotSpace *)space didChangePlotRangeForCoordinate:(CPTCoordinate)coordinate; +-(void)plotSpace:(nonnull CPTPlotSpace *)space didChangePlotRangeForCoordinate:(CPTCoordinate)coordinate; /// @} @@ -106,7 +117,7 @@ extern NSString *const CPTPlotSpaceDisplacementKey; * @return Whether the plot space should handle the event or not. * In either case, the delegate may choose to take extra actions, or handle the event itself. **/ --(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)point; +-(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)point; /** @brief @optional Notifies that plot space intercepted a device dragged event. * @param space The plot space. @@ -115,7 +126,7 @@ extern NSString *const CPTPlotSpaceDisplacementKey; * @return Whether the plot space should handle the event or not. * In either case, the delegate may choose to take extra actions, or handle the event itself. **/ --(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)point; +-(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceDraggedEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)point; /** @brief @optional Notifies that plot space intercepted a device cancelled event. * @param space The plot space. @@ -123,7 +134,7 @@ extern NSString *const CPTPlotSpaceDisplacementKey; * @return Whether the plot space should handle the event or not. * In either case, the delegate may choose to take extra actions, or handle the event itself. **/ --(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceCancelledEvent:(CPTNativeEvent *)event; +-(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceCancelledEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Notifies that plot space intercepted a device up event. * @param space The plot space. @@ -132,9 +143,9 @@ extern NSString *const CPTPlotSpaceDisplacementKey; * @return Whether the plot space should handle the event or not. * In either case, the delegate may choose to take extra actions, or handle the event itself. **/ --(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)point; +-(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandlePointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)point; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else /** @brief @optional Notifies that plot space intercepted a scroll wheel event. @@ -145,42 +156,52 @@ extern NSString *const CPTPlotSpaceDisplacementKey; * @return Whether the plot space should handle the event or not. * In either case, the delegate may choose to take extra actions, or handle the event itself. **/ --(BOOL)plotSpace:(CPTPlotSpace *)space shouldHandleScrollWheelEvent:(CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint; +-(BOOL)plotSpace:(nonnull CPTPlotSpace *)space shouldHandleScrollWheelEvent:(nonnull CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint; #endif /// @} @end +/** + * @brief An array of plot spaces. + **/ +typedef NSArray<__kindof CPTPlotSpace *> CPTPlotSpaceArray; + +/** + * @brief A mutable array of plot spaces. + **/ +typedef NSMutableArray<__kindof CPTPlotSpace *> CPTMutablePlotSpaceArray; + #pragma mark - -@interface CPTPlotSpace : NSObject +@interface CPTPlotSpace : NSObject -@property (nonatomic, readwrite, copy) id identifier; +@property (nonatomic, readwrite, copy, nullable) id identifier; @property (nonatomic, readwrite) BOOL allowsUserInteraction; @property (nonatomic, readonly) BOOL isDragging; -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTGraph *graph; -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak id delegate; +@property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGraph *graph; +@property (nonatomic, readwrite, cpt_weak_property, nullable) id delegate; @property (nonatomic, readonly) NSUInteger numberOfCoordinates; /// @name Categorical Data /// @{ --(void)addCategory:(NSString *)category forCoordinate:(CPTCoordinate)coordinate; --(void)removeCategory:(NSString *)category forCoordinate:(CPTCoordinate)coordinate; --(void)insertCategory:(NSString *)category forCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx; --(void)setCategories:(NSArray *)newCategories forCoordinate:(CPTCoordinate)coordinate; +-(void)addCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate; +-(void)removeCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate; +-(void)insertCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx; +-(void)setCategories:(nullable CPTStringArray *)newCategories forCoordinate:(CPTCoordinate)coordinate; -(void)removeAllCategories; --(NSArray *)categoriesForCoordinate:(CPTCoordinate)coordinate; --(NSString *)categoryForCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx; --(NSUInteger)indexOfCategory:(NSString *)category forCoordinate:(CPTCoordinate)coordinate; +-(nonnull CPTStringArray *)categoriesForCoordinate:(CPTCoordinate)coordinate; +-(nullable NSString *)categoryForCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx; +-(NSUInteger)indexOfCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate; /// @} /// @name Initialization /// @{ --(instancetype)init NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)init NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER; /// @} @end @@ -194,22 +215,25 @@ extern NSString *const CPTPlotSpaceDisplacementKey; /// @name Coordinate Space Conversions /// @{ --(CGPoint)plotAreaViewPointForPlotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count; --(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(double *)plotPoint numberOfCoordinates:(NSUInteger)count; +-(CGPoint)plotAreaViewPointForPlotPoint:(nonnull CPTNumberArray *)plotPoint; +-(CGPoint)plotAreaViewPointForPlotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count; +-(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count; --(void)plotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point; --(void)doublePrecisionPlotPoint:(double *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point; +-(nullable CPTNumberArray *)plotPointForPlotAreaViewPoint:(CGPoint)point; +-(void)plotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point; +-(void)doublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point; --(CGPoint)plotAreaViewPointForEvent:(CPTNativeEvent *)event; +-(CGPoint)plotAreaViewPointForEvent:(nonnull CPTNativeEvent *)event; --(void)plotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(CPTNativeEvent *)event; --(void)doublePrecisionPlotPoint:(double *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(CPTNativeEvent *)event; +-(nullable CPTNumberArray *)plotPointForEvent:(nonnull CPTNativeEvent *)event; +-(void)plotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(nonnull CPTNativeEvent *)event; +-(void)doublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(nonnull CPTNativeEvent *)event; /// @} /// @name Coordinate Range /// @{ --(void)setPlotRange:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate; --(CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coordinate; +-(void)setPlotRange:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate; +-(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coordinate; /// @} /// @name Scale Types @@ -220,8 +244,10 @@ extern NSString *const CPTPlotSpaceDisplacementKey; /// @name Adjusting Ranges /// @{ --(void)scaleToFitPlots:(NSArray *)plots; --(void)scaleToFitPlots:(NSArray *)plots forCoordinate:(CPTCoordinate)coordinate; +-(void)scaleToFitPlots:(nullable CPTPlotArray *)plots; +-(void)scaleToFitPlots:(nullable CPTPlotArray *)plots forCoordinate:(CPTCoordinate)coordinate; +-(void)scaleToFitEntirePlots:(nullable CPTPlotArray *)plots; +-(void)scaleToFitEntirePlots:(nullable CPTPlotArray *)plots forCoordinate:(CPTCoordinate)coordinate; -(void)scaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint; /// @} diff --git a/framework/Source/CPTPlotSpace.m b/framework/Source/CPTPlotSpace.m index a5e87bb1c..644b1df79 100644 --- a/framework/Source/CPTPlotSpace.m +++ b/framework/Source/CPTPlotSpace.m @@ -1,24 +1,26 @@ #import "CPTPlotSpace.h" +#import "CPTGraph.h" #import "CPTMutablePlotRange.h" -#import "CPTPlot.h" #import "CPTUtilities.h" -NSString *const CPTPlotSpaceCoordinateMappingDidChangeNotification = @"CPTPlotSpaceCoordinateMappingDidChangeNotification"; +CPTPlotSpaceCoordinateMapping const CPTPlotSpaceCoordinateMappingDidChangeNotification = @"CPTPlotSpaceCoordinateMappingDidChangeNotification"; -NSString *const CPTPlotSpaceCoordinateKey = @"CPTPlotSpaceCoordinateKey"; -NSString *const CPTPlotSpaceScrollingKey = @"CPTPlotSpaceScrollingKey"; -NSString *const CPTPlotSpaceDisplacementKey = @"CPTPlotSpaceDisplacementKey"; +CPTPlotSpaceInfoKey const CPTPlotSpaceCoordinateKey = @"CPTPlotSpaceCoordinateKey"; +CPTPlotSpaceInfoKey const CPTPlotSpaceScrollingKey = @"CPTPlotSpaceScrollingKey"; +CPTPlotSpaceInfoKey const CPTPlotSpaceDisplacementKey = @"CPTPlotSpaceDisplacementKey"; /// @cond +typedef NSMutableOrderedSet CPTMutableCategorySet; + @interface CPTPlotSpace() -@property (nonatomic, readwrite, strong) NSMutableDictionary *categoryNames; +@property (nonatomic, readwrite, strong, nullable) NSMutableDictionary *categoryNames; @property (nonatomic, readwrite) BOOL isDragging; --(NSMutableOrderedSet *)orderedSetForCoordinate:(CPTCoordinate)coordinate; +-(nonnull CPTMutableCategorySet *)orderedSetForCoordinate:(CPTCoordinate)coordinate; @end @@ -34,7 +36,7 @@ -(NSMutableOrderedSet *)orderedSetForCoordinate:(CPTCoordinate)coordinate; **/ @implementation CPTPlotSpace -/** @property id identifier +/** @property nullable id identifier * @brief An object used to identify the plot in collections. **/ @synthesize identifier; @@ -49,12 +51,12 @@ @implementation CPTPlotSpace **/ @synthesize isDragging; -/** @property cpt_weak CPTGraph *graph +/** @property nullable CPTGraph *graph * @brief The graph of the space. **/ @synthesize graph; -/** @property cpt_weak id delegate +/** @property nullable id delegate * @brief The plot space delegate. **/ @synthesize delegate; @@ -65,7 +67,7 @@ @implementation CPTPlotSpace @dynamic numberOfCoordinates; /** @internal - * @property NSMutableDictionary *categoryNames + * @property nullable NSMutableDictionary *categoryNames * @brief The names of the data categories for each coordinate with a #CPTScaleTypeCategory scale type. * The keys are the CPTCoordinate enumeration values and the values are arrays of strings. **/ @@ -88,9 +90,9 @@ @implementation CPTPlotSpace * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { identifier = nil; allowsUserInteraction = NO; isDragging = NO; @@ -118,7 +120,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeConditionalObject:self.graph forKey:@"CPTPlotSpace.graph"]; [coder encodeObject:self.identifier forKey:@"CPTPlotSpace.identifier"]; @@ -139,31 +141,49 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder -{ - if ( (self = [super init]) ) { - graph = [coder decodeObjectForKey:@"CPTPlotSpace.graph"]; - identifier = [[coder decodeObjectForKey:@"CPTPlotSpace.identifier"] copy]; - delegate = [coder decodeObjectForKey:@"CPTPlotSpace.delegate"]; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder +{ + if ((self = [super init])) { + graph = [coder decodeObjectOfClass:[CPTGraph class] + forKey:@"CPTPlotSpace.graph"]; + identifier = [[coder decodeObjectOfClass:[NSObject class] + forKey:@"CPTPlotSpace.identifier"] copy]; + delegate = [coder decodeObjectOfClass:[NSObject class] + forKey:@"CPTPlotSpace.delegate"]; allowsUserInteraction = [coder decodeBoolForKey:@"CPTPlotSpace.allowsUserInteraction"]; - categoryNames = [[coder decodeObjectForKey:@"CPTPlotSpace.categoryNames"] mutableCopy]; + categoryNames = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSDictionary class], [NSString class], [NSNumber class]]] + forKey:@"CPTPlotSpace.categoryNames"] mutableCopy]; isDragging = NO; } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Categorical Data +/// @cond + /** @internal * @brief Gets the ordered set of categories for the given coordinate, creating it if necessary. * @param coordinate The axis coordinate. * @return The ordered set of categories for the given coordinate. */ --(NSMutableOrderedSet *)orderedSetForCoordinate:(CPTCoordinate)coordinate +-(nonnull CPTMutableCategorySet *)orderedSetForCoordinate:(CPTCoordinate)coordinate { - NSMutableDictionary *names = self.categoryNames; + NSMutableDictionary *names = self.categoryNames; if ( !names ) { names = [[NSMutableDictionary alloc] init]; @@ -173,7 +193,7 @@ -(NSMutableOrderedSet *)orderedSetForCoordinate:(CPTCoordinate)coordinate NSNumber *cacheKey = @(coordinate); - NSMutableOrderedSet *categories = names[cacheKey]; + CPTMutableCategorySet *categories = names[cacheKey]; if ( !categories ) { categories = [[NSMutableOrderedSet alloc] init]; @@ -184,6 +204,8 @@ -(NSMutableOrderedSet *)orderedSetForCoordinate:(CPTCoordinate)coordinate return categories; } +/// @endcond + /** * @brief Add a new category name for the given coordinate. * @@ -192,11 +214,11 @@ -(NSMutableOrderedSet *)orderedSetForCoordinate:(CPTCoordinate)coordinate * @param category The category name. * @param coordinate The axis coordinate. */ --(void)addCategory:(NSString *)category forCoordinate:(CPTCoordinate)coordinate +-(void)addCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate { NSParameterAssert(category); - NSMutableOrderedSet *categories = [self orderedSetForCoordinate:coordinate]; + CPTMutableCategorySet *categories = [self orderedSetForCoordinate:coordinate]; [categories addObject:category]; } @@ -206,11 +228,11 @@ -(void)addCategory:(NSString *)category forCoordinate:(CPTCoordinate)coordinate * @param category The category name. * @param coordinate The axis coordinate. */ --(void)removeCategory:(NSString *)category forCoordinate:(CPTCoordinate)coordinate +-(void)removeCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate { NSParameterAssert(category); - NSMutableOrderedSet *categories = [self orderedSetForCoordinate:coordinate]; + CPTMutableCategorySet *categories = [self orderedSetForCoordinate:coordinate]; [categories removeObject:category]; } @@ -224,11 +246,11 @@ -(void)removeCategory:(NSString *)category forCoordinate:(CPTCoordinate)coordina * @param coordinate The axis coordinate. * @param idx The index in the list of category names. */ --(void)insertCategory:(NSString *)category forCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx +-(void)insertCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx { NSParameterAssert(category); - NSMutableOrderedSet *categories = [self orderedSetForCoordinate:coordinate]; + CPTMutableCategorySet *categories = [self orderedSetForCoordinate:coordinate]; NSParameterAssert(idx <= categories.count); @@ -240,9 +262,9 @@ -(void)insertCategory:(NSString *)category forCoordinate:(CPTCoordinate)coordina * @param newCategories An array of category names. * @param coordinate The axis coordinate. */ --(void)setCategories:(NSArray *)newCategories forCoordinate:(CPTCoordinate)coordinate +-(void)setCategories:(nullable CPTStringArray *)newCategories forCoordinate:(CPTCoordinate)coordinate { - NSMutableDictionary *names = self.categoryNames; + NSMutableDictionary *names = self.categoryNames; if ( !names ) { names = [[NSMutableDictionary alloc] init]; @@ -253,7 +275,9 @@ -(void)setCategories:(NSArray *)newCategories forCoordinate:(CPTCoordinate)coord NSNumber *cacheKey = @(coordinate); if ( [newCategories isKindOfClass:[NSArray class]] ) { - names[cacheKey] = [NSMutableOrderedSet orderedSetWithArray:newCategories]; + CPTStringArray *categories = newCategories; + + names[cacheKey] = [NSMutableOrderedSet orderedSetWithArray:categories]; } else { [names removeObjectForKey:cacheKey]; @@ -273,11 +297,11 @@ -(void)removeAllCategories * @param coordinate The axis coordinate. * @return An array of category names. */ --(NSArray *)categoriesForCoordinate:(CPTCoordinate)coordinate +-(nonnull CPTStringArray *)categoriesForCoordinate:(CPTCoordinate)coordinate { - NSMutableOrderedSet *categories = [self orderedSetForCoordinate:coordinate]; + CPTMutableCategorySet *categories = [self orderedSetForCoordinate:coordinate]; - return [categories array]; + return categories.array; } /** @@ -286,9 +310,9 @@ -(NSArray *)categoriesForCoordinate:(CPTCoordinate)coordinate * @param idx The index in the list of category names. * @return The category name. */ --(NSString *)categoryForCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx +-(nullable NSString *)categoryForCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger)idx { - NSMutableOrderedSet *categories = [self orderedSetForCoordinate:coordinate]; + CPTMutableCategorySet *categories = [self orderedSetForCoordinate:coordinate]; NSParameterAssert(idx < categories.count); @@ -301,11 +325,11 @@ -(NSString *)categoryForCoordinate:(CPTCoordinate)coordinate atIndex:(NSUInteger * @param coordinate The axis coordinate. * @return The category index. */ --(NSUInteger)indexOfCategory:(NSString *)category forCoordinate:(CPTCoordinate)coordinate +-(NSUInteger)indexOfCategory:(nonnull NSString *)category forCoordinate:(CPTCoordinate)coordinate { NSParameterAssert(category); - NSMutableOrderedSet *categories = [self orderedSetForCoordinate:coordinate]; + CPTMutableCategorySet *categories = [self orderedSetForCoordinate:coordinate]; return [categories indexOfObject:category]; } @@ -332,7 +356,7 @@ -(NSUInteger)indexOfCategory:(NSString *)category forCoordinate:(CPTCoordinate)c * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { BOOL handledByDelegate = NO; @@ -360,7 +384,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { BOOL handledByDelegate = NO; @@ -388,7 +412,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDraggedEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { BOOL handledByDelegate = NO; @@ -416,7 +440,7 @@ -(BOOL)pointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)inter * @param event The OS event. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceCancelledEvent:(CPTNativeEvent *)event +-(BOOL)pointingDeviceCancelledEvent:(nonnull CPTNativeEvent *)event { BOOL handledByDelegate = NO; @@ -428,7 +452,7 @@ -(BOOL)pointingDeviceCancelledEvent:(CPTNativeEvent *)event return handledByDelegate; } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else /** @@ -446,7 +470,7 @@ -(BOOL)pointingDeviceCancelledEvent:(CPTNativeEvent *)event * @param toPoint The ending coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)scrollWheelEvent:(CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint +-(BOOL)scrollWheelEvent:(nonnull CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint { BOOL handledByDelegate = NO; @@ -457,6 +481,7 @@ -(BOOL)scrollWheelEvent:(CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toP } return handledByDelegate; } + #endif /// @} @@ -476,12 +501,23 @@ -(NSUInteger)numberOfCoordinates /// @endcond +/** @brief Converts a data point to plot area drawing coordinates. + * @param plotPoint An array of data point coordinates (as NSNumber values). + * @return The drawing coordinates of the data point. + **/ +-(CGPoint)plotAreaViewPointForPlotPoint:(nonnull CPTNumberArray *cpt_unused)plotPoint +{ + NSParameterAssert(plotPoint.count == self.numberOfCoordinates); + + return CGPointZero; +} + /** @brief Converts a data point to plot area drawing coordinates. * @param plotPoint A c-style array of data point coordinates (as NSDecimal structs). * @param count The number of coordinate values in the @par{plotPoint} array. * @return The drawing coordinates of the data point. **/ --(CGPoint)plotAreaViewPointForPlotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count +-(CGPoint)plotAreaViewPointForPlotPoint:(nonnull NSDecimal *__unused)plotPoint numberOfCoordinates:(NSUInteger cpt_unused)count { NSParameterAssert(count == self.numberOfCoordinates); @@ -493,19 +529,28 @@ -(CGPoint)plotAreaViewPointForPlotPoint:(NSDecimal *)plotPoint numberOfCoordinat * @param count The number of coordinate values in the @par{plotPoint} array. * @return The drawing coordinates of the data point. **/ --(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(double *)plotPoint numberOfCoordinates:(NSUInteger)count +-(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(nonnull double *__unused)plotPoint numberOfCoordinates:(NSUInteger cpt_unused)count { NSParameterAssert(count == self.numberOfCoordinates); return CGPointZero; } +/** @brief Converts a point given in plot area drawing coordinates to the data coordinate space. + * @param point The drawing coordinates of the data point. + * @return An array of data point coordinates (as NSNumber values). + **/ +-(nullable CPTNumberArray *)plotPointForPlotAreaViewPoint:(CGPoint __unused)point +{ + return nil; +} + /** @brief Converts a point given in plot area drawing coordinates to the data coordinate space. * @param plotPoint A c-style array of data point coordinates (as NSDecimal structs). * @param count The number of coordinate values in the @par{plotPoint} array. * @param point The drawing coordinates of the data point. **/ --(void)plotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point +-(void)plotPoint:(nonnull NSDecimal *__unused)plotPoint numberOfCoordinates:(NSUInteger cpt_unused)count forPlotAreaViewPoint:(CGPoint __unused)point { NSParameterAssert(count == self.numberOfCoordinates); } @@ -515,7 +560,7 @@ -(void)plotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count fo * @param count The number of coordinate values in the @par{plotPoint} array. * @param point The drawing coordinates of the data point. **/ --(void)doublePrecisionPlotPoint:(double *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point +-(void)doublePrecisionPlotPoint:(nonnull double *__unused)plotPoint numberOfCoordinates:(NSUInteger cpt_unused)count forPlotAreaViewPoint:(CGPoint __unused)point { NSParameterAssert(count == self.numberOfCoordinates); } @@ -524,17 +569,26 @@ -(void)doublePrecisionPlotPoint:(double *)plotPoint numberOfCoordinates:(NSUInte * @param event The event. * @return The drawing coordinates of the point. **/ --(CGPoint)plotAreaViewPointForEvent:(CPTNativeEvent *)event +-(CGPoint)plotAreaViewPointForEvent:(nonnull CPTNativeEvent *__unused)event { return CGPointZero; } +/** @brief Converts the interaction point of an OS event to the data coordinate space. + * @param event The event. + * @return An array of data point coordinates (as NSNumber values). + **/ +-(nullable CPTNumberArray *)plotPointForEvent:(nonnull CPTNativeEvent *__unused)event +{ + return nil; +} + /** @brief Converts the interaction point of an OS event to the data coordinate space. * @param plotPoint A c-style array of data point coordinates (as NSDecimal structs). * @param count The number of coordinate values in the @par{plotPoint} array. * @param event The event. **/ --(void)plotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(CPTNativeEvent *)event +-(void)plotPoint:(nonnull NSDecimal *__unused)plotPoint numberOfCoordinates:(NSUInteger cpt_unused)count forEvent:(nonnull CPTNativeEvent *__unused)event { NSParameterAssert(count == self.numberOfCoordinates); } @@ -544,7 +598,7 @@ -(void)plotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count fo * @param count The number of coordinate values in the @par{plotPoint} array. * @param event The event. **/ --(void)doublePrecisionPlotPoint:(double *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(CPTNativeEvent *)event +-(void)doublePrecisionPlotPoint:(nonnull double *__unused)plotPoint numberOfCoordinates:(NSUInteger cpt_unused)count forEvent:(nonnull CPTNativeEvent *__unused)event { NSParameterAssert(count == self.numberOfCoordinates); } @@ -553,7 +607,7 @@ -(void)doublePrecisionPlotPoint:(double *)plotPoint numberOfCoordinates:(NSUInte * @param newRange The new plot range. * @param coordinate The axis coordinate. **/ --(void)setPlotRange:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate +-(void)setPlotRange:(nonnull CPTPlotRange *__unused)newRange forCoordinate:(CPTCoordinate __unused)coordinate { } @@ -561,7 +615,7 @@ -(void)setPlotRange:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordi * @param coordinate The axis coordinate. * @return The range of values. **/ --(CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coordinate +-(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate __unused)coordinate { return nil; } @@ -570,7 +624,7 @@ -(CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coordinate * @param newType The new scale type. * @param coordinate The axis coordinate. **/ --(void)setScaleType:(CPTScaleType)newType forCoordinate:(CPTCoordinate)coordinate +-(void)setScaleType:(CPTScaleType __unused)newType forCoordinate:(CPTCoordinate __unused)coordinate { } @@ -578,7 +632,7 @@ -(void)setScaleType:(CPTScaleType)newType forCoordinate:(CPTCoordinate)coordinat * @param coordinate The axis coordinate. * @return The scale type. **/ --(CPTScaleType)scaleTypeForCoordinate:(CPTCoordinate)coordinate +-(CPTScaleType)scaleTypeForCoordinate:(CPTCoordinate __unused)coordinate { return CPTScaleTypeLinear; } @@ -586,7 +640,7 @@ -(CPTScaleType)scaleTypeForCoordinate:(CPTCoordinate)coordinate /** @brief Scales the plot ranges so that the plots just fit in the visible space. * @param plots An array of the plots that have to fit in the visible area. **/ --(void)scaleToFitPlots:(NSArray *)plots +-(void)scaleToFitPlots:(nullable CPTPlotArray *__unused)plots { } @@ -594,7 +648,7 @@ -(void)scaleToFitPlots:(NSArray *)plots * @param plots An array of the plots that have to fit in the visible area. * @param coordinate The axis coordinate. **/ --(void)scaleToFitPlots:(NSArray *)plots forCoordinate:(CPTCoordinate)coordinate +-(void)scaleToFitPlots:(nullable CPTPlotArray *)plots forCoordinate:(CPTCoordinate)coordinate { if ( plots.count == 0 ) { return; @@ -612,7 +666,43 @@ -(void)scaleToFitPlots:(NSArray *)plots forCoordinate:(CPTCoordinate)coordinate // Set range if ( unionRange ) { - if ( CPTDecimalEquals( unionRange.length, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalEquals(unionRange.lengthDecimal, CPTDecimalFromInteger(0))) { + [unionRange unionPlotRange:[self plotRangeForCoordinate:coordinate]]; + } + [self setPlotRange:unionRange forCoordinate:coordinate]; + } +} + +/** @brief Scales the plot ranges so that the plots just fit in the visible space. + * @param plots An array of the plots that have to fit in the visible area. + **/ +-(void)scaleToFitEntirePlots:(nullable CPTPlotArray *__unused)plots +{ +} + +/** @brief Scales the plot range for the given coordinate so that the plots just fit in the visible space. + * @param plots An array of the plots that have to fit in the visible area. + * @param coordinate The axis coordinate. + **/ +-(void)scaleToFitEntirePlots:(nullable CPTPlotArray *)plots forCoordinate:(CPTCoordinate)coordinate +{ + if ( plots.count == 0 ) { + return; + } + + // Determine union of ranges + CPTMutablePlotRange *unionRange = nil; + for ( CPTPlot *plot in plots ) { + CPTPlotRange *currentRange = [plot plotRangeForCoordinate:coordinate]; + if ( !unionRange ) { + unionRange = [currentRange mutableCopy]; + } + [unionRange unionPlotRange:currentRange]; + } + + // Set range + if ( unionRange ) { + if ( CPTDecimalEquals(unionRange.lengthDecimal, CPTDecimalFromInteger(0))) { [unionRange unionPlotRange:[self plotRangeForCoordinate:coordinate]]; } [self setPlotRange:unionRange forCoordinate:coordinate]; @@ -623,8 +713,22 @@ -(void)scaleToFitPlots:(NSArray *)plots forCoordinate:(CPTCoordinate)coordinate * @param interactionScale The scaling factor. One (@num{1}) gives no scaling. * @param interactionPoint The plot area view point about which the scaling occurs. **/ --(void)scaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint +-(void)scaleBy:(CGFloat __unused)interactionScale aboutPoint:(CGPoint __unused)interactionPoint +{ +} + +#pragma mark - +#pragma mark Debugging + +/// @cond + +-(nullable id)debugQuickLookObject { + return [NSString stringWithFormat:@"Identifier: %@\nallowsUserInteraction: %@", + self.identifier, + self.allowsUserInteraction ? @"YES" : @"NO"]; } +/// @endcond + @end diff --git a/framework/Source/CPTPlotSpaceAnnotation.h b/framework/Source/CPTPlotSpaceAnnotation.h index 0fd3f8c7a..e81554e07 100644 --- a/framework/Source/CPTPlotSpaceAnnotation.h +++ b/framework/Source/CPTPlotSpaceAnnotation.h @@ -4,10 +4,13 @@ @interface CPTPlotSpaceAnnotation : CPTAnnotation -@property (nonatomic, readwrite, copy) NSArray *anchorPlotPoint; -@property (nonatomic, readonly) CPTPlotSpace *plotSpace; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *anchorPlotPoint; +@property (nonatomic, readonly, nonnull) CPTPlotSpace *plotSpace; --(instancetype)initWithPlotSpace:(CPTPlotSpace *)space anchorPlotPoint:(NSArray *)plotPoint NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; +/// @name Initialization +/// @{ +-(nonnull instancetype)initWithPlotSpace:(nonnull CPTPlotSpace *)space anchorPlotPoint:(nullable CPTNumberArray *)plotPoint NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; +/// @} @end diff --git a/framework/Source/CPTPlotSpaceAnnotation.m b/framework/Source/CPTPlotSpaceAnnotation.m index dc96f1d7a..db08c4303 100644 --- a/framework/Source/CPTPlotSpaceAnnotation.m +++ b/framework/Source/CPTPlotSpaceAnnotation.m @@ -1,5 +1,6 @@ #import "CPTPlotSpaceAnnotation.h" +#import "CPTExceptions.h" #import "CPTPlotArea.h" #import "CPTPlotAreaFrame.h" #import "CPTPlotSpace.h" @@ -8,7 +9,7 @@ @interface CPTPlotSpaceAnnotation() -@property (nonatomic, readwrite) NSDecimal *decimalAnchor; +@property (nonatomic, readwrite, nonnull) NSDecimal *decimalAnchor; @property (nonatomic, readwrite) NSUInteger anchorCount; -(void)setContentNeedsLayout; @@ -27,12 +28,12 @@ -(void)setContentNeedsLayout; **/ @implementation CPTPlotSpaceAnnotation -/** @property NSArray *anchorPlotPoint +/** @property nullable CPTNumberArray *anchorPlotPoint * @brief An array of NSDecimalNumber objects giving the anchor plot coordinates. **/ @synthesize anchorPlotPoint; -/** @property CPTPlotSpace *plotSpace +/** @property nonnull CPTPlotSpace *plotSpace * @brief The plot space which the anchor is defined in. **/ @synthesize plotSpace; @@ -55,11 +56,11 @@ @implementation CPTPlotSpaceAnnotation * @param newPlotPoint An array of NSDecimalNumber objects giving the anchor plot coordinates. * @return The initialized CPTPlotSpaceAnnotation object. **/ --(instancetype)initWithPlotSpace:(CPTPlotSpace *)newPlotSpace anchorPlotPoint:(NSArray *)newPlotPoint +-(nonnull instancetype)initWithPlotSpace:(nonnull CPTPlotSpace *)newPlotSpace anchorPlotPoint:(nullable CPTNumberArray *)newPlotPoint { NSParameterAssert(newPlotSpace); - if ( (self = [super init]) ) { + if ((self = [super init])) { plotSpace = newPlotSpace; self.anchorPlotPoint = newPlotPoint; @@ -75,10 +76,11 @@ -(instancetype)initWithPlotSpace:(CPTPlotSpace *)newPlotSpace anchorPlotPoint:(N /// @cond -// plotSpace is required; this will fail the assertion in -initWithPlotSpace:anchorPlotPoint: --(instancetype)init +// plotSpace is required +-(nonnull instancetype)init { - return [self initWithPlotSpace:nil anchorPlotPoint:nil]; + [NSException raise:CPTException format:@"%@ must be initialized with a plot space.", NSStringFromClass([self class])]; + return [self initWithPlotSpace:[[CPTPlotSpace alloc] init] anchorPlotPoint:nil]; } -(void)dealloc @@ -94,7 +96,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -108,19 +110,38 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - anchorPlotPoint = [[coder decodeObjectForKey:@"CPTPlotSpaceAnnotation.anchorPlotPoint"] copy]; + if ((self = [super initWithCoder:coder])) { + self.anchorPlotPoint = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [NSNumber class]]] + forKey:@"CPTPlotSpaceAnnotation.anchorPlotPoint"] copy]; - CPTPlotSpace *thePlotSpace = [coder decodeObjectForKey:@"CPTPlotSpaceAnnotation.plotSpace"]; + CPTPlotSpace *thePlotSpace = [coder decodeObjectOfClass:[CPTPlotSpace class] + forKey:@"CPTPlotSpaceAnnotation.plotSpace"]; if ( thePlotSpace ) { plotSpace = thePlotSpace; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(setContentNeedsLayout) + name:CPTPlotSpaceCoordinateMappingDidChangeNotification + object:plotSpace]; } } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Layout @@ -138,7 +159,7 @@ -(void)positionContentLayer if ( content ) { CPTLayer *hostLayer = self.annotationHostLayer; if ( hostLayer ) { - NSArray *plotAnchor = self.anchorPlotPoint; + CPTNumberArray *plotAnchor = self.anchorPlotPoint; if ( plotAnchor ) { // Get plot area point CPTPlotSpace *thePlotSpace = self.plotSpace; @@ -159,7 +180,7 @@ -(void)positionContentLayer content.anchorPoint = self.contentAnchorPoint; content.position = newPosition; - content.transform = CATransform3DMakeRotation( self.rotation, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0) ); + content.transform = CATransform3DMakeRotation(self.rotation, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0)); [content pixelAlign]; } } @@ -173,16 +194,16 @@ -(void)positionContentLayer /// @cond --(void)setAnchorPlotPoint:(NSArray *)newPlotPoint +-(void)setAnchorPlotPoint:(nullable CPTNumberArray *)newPlotPoint { if ( anchorPlotPoint != newPlotPoint ) { anchorPlotPoint = [newPlotPoint copy]; self.anchorCount = anchorPlotPoint.count; - NSDecimal *decimalPoint = malloc(sizeof(NSDecimal) * self.anchorCount); + NSDecimal *decimalPoint = calloc(self.anchorCount, sizeof(NSDecimal)); for ( NSUInteger i = 0; i < self.anchorCount; i++ ) { - decimalPoint[i] = [anchorPlotPoint[i] decimalValue]; + decimalPoint[i] = anchorPlotPoint[i].decimalValue; } self.decimalAnchor = decimalPoint; @@ -190,7 +211,7 @@ -(void)setAnchorPlotPoint:(NSArray *)newPlotPoint } } --(void)setDecimalAnchor:(NSDecimal *)newAnchor +-(void)setDecimalAnchor:(nonnull NSDecimal *)newAnchor { if ( decimalAnchor != newAnchor ) { free(decimalAnchor); diff --git a/framework/Source/CPTPlotSpaceTests.h b/framework/Source/CPTPlotSpaceTests.h index ccd2a1f49..fd5b2cf96 100644 --- a/framework/Source/CPTPlotSpaceTests.h +++ b/framework/Source/CPTPlotSpaceTests.h @@ -4,6 +4,6 @@ @interface CPTPlotSpaceTests : CPTTestCase -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; +@property (nonatomic, readwrite, strong, nullable) CPTXYGraph *graph; @end diff --git a/framework/Source/CPTPlotSpaceTests.m b/framework/Source/CPTPlotSpaceTests.m index 90626eb64..226617ec5 100644 --- a/framework/Source/CPTPlotSpaceTests.m +++ b/framework/Source/CPTPlotSpaceTests.m @@ -1,5 +1,6 @@ -#import "CPTPlotSpace.h" #import "CPTPlotSpaceTests.h" + +#import "CPTPlotSpace.h" #import "CPTXYGraph.h" @implementation CPTPlotSpaceTests @@ -31,7 +32,7 @@ -(void)testKeyedArchivingRoundTrip plotSpace.identifier = @"test plot space"; - CPTPlotSpace *newPlotSpace = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:plotSpace]]; + CPTPlotSpace *newPlotSpace = [self archiveRoundTrip:plotSpace]; XCTAssertEqualObjects(plotSpace.identifier, newPlotSpace.identifier, @"identifier not equal"); XCTAssertEqual(plotSpace.allowsUserInteraction, newPlotSpace.allowsUserInteraction, @"allowsUserInteraction not equal"); diff --git a/framework/Source/CPTPlotSymbol.h b/framework/Source/CPTPlotSymbol.h index 5b9933544..36ca6d399 100644 --- a/framework/Source/CPTPlotSymbol.h +++ b/framework/Source/CPTPlotSymbol.h @@ -2,6 +2,7 @@ @class CPTLineStyle; @class CPTFill; +@class CPTPlotSymbol; @class CPTShadow; /** @@ -23,38 +24,48 @@ typedef NS_ENUM (NSInteger, CPTPlotSymbolType) { CPTPlotSymbolTypeCustom ///< Custom symbol. }; -@interface CPTPlotSymbol : NSObject +/** + * @brief An array of plot symbols. + **/ +typedef NSArray CPTPlotSymbolArray; + +/** + * @brief A mutable array of plot symbols. + **/ +typedef NSMutableArray CPTMutablePlotSymbolArray; + +@interface CPTPlotSymbol : NSObject @property (nonatomic, readwrite, assign) CGPoint anchorPoint; @property (nonatomic, readwrite, assign) CGSize size; @property (nonatomic, readwrite, assign) CPTPlotSymbolType symbolType; -@property (nonatomic, readwrite, strong) CPTLineStyle *lineStyle; -@property (nonatomic, readwrite, strong) CPTFill *fill; -@property (nonatomic, readwrite, copy) CPTShadow *shadow; -@property (nonatomic, readwrite, assign) CGPathRef customSymbolPath; +@property (nonatomic, readwrite, strong, nullable) CPTLineStyle *lineStyle; +@property (nonatomic, readwrite, strong, nullable) CPTFill *fill; +@property (nonatomic, readwrite, copy, nullable) CPTShadow *shadow; +@property (nonatomic, readwrite, assign, nullable) CGPathRef customSymbolPath; @property (nonatomic, readwrite, assign) BOOL usesEvenOddClipRule; /// @name Factory Methods /// @{ -+(instancetype)plotSymbol; -+(instancetype)crossPlotSymbol; -+(instancetype)ellipsePlotSymbol; -+(instancetype)rectanglePlotSymbol; -+(instancetype)plusPlotSymbol; -+(instancetype)starPlotSymbol; -+(instancetype)diamondPlotSymbol; -+(instancetype)trianglePlotSymbol; -+(instancetype)pentagonPlotSymbol; -+(instancetype)hexagonPlotSymbol; -+(instancetype)dashPlotSymbol; -+(instancetype)snowPlotSymbol; -+(instancetype)customPlotSymbolWithPath:(CGPathRef)aPath; ++(nonnull instancetype)plotSymbol; ++(nonnull instancetype)crossPlotSymbol; ++(nonnull instancetype)ellipsePlotSymbol; ++(nonnull instancetype)rectanglePlotSymbol; ++(nonnull instancetype)plusPlotSymbol; ++(nonnull instancetype)starPlotSymbol; ++(nonnull instancetype)diamondPlotSymbol; ++(nonnull instancetype)trianglePlotSymbol; ++(nonnull instancetype)pentagonPlotSymbol; ++(nonnull instancetype)hexagonPlotSymbol; ++(nonnull instancetype)dashPlotSymbol; ++(nonnull instancetype)snowPlotSymbol; ++(nonnull instancetype)customPlotSymbolWithPath:(nullable CGPathRef)aPath; /// @} /// @name Drawing /// @{ --(void)renderInContext:(CGContextRef)context atPoint:(CGPoint)center scale:(CGFloat)scale alignToPixels:(BOOL)alignToPixels; --(void)renderAsVectorInContext:(CGContextRef)context atPoint:(CGPoint)center scale:(CGFloat)scale; +-(void)renderInContext:(nonnull CGContextRef)context atPoint:(CGPoint)center scale:(CGFloat)scale alignToPixels:(BOOL)alignToPixels; +-(void)renderAsVectorInContext:(nonnull CGContextRef)context atPoint:(CGPoint)center scale:(CGFloat)scale; /// @} @end diff --git a/framework/Source/CPTPlotSymbol.m b/framework/Source/CPTPlotSymbol.m index 516346a7b..9bae6be66 100644 --- a/framework/Source/CPTPlotSymbol.m +++ b/framework/Source/CPTPlotSymbol.m @@ -3,6 +3,7 @@ #import "CPTDefinitions.h" #import "CPTFill.h" #import "CPTLineStyle.h" +#import "CPTPlatformSpecificFunctions.h" #import "CPTShadow.h" #import "NSCoderExtensions.h" #import @@ -10,11 +11,12 @@ /// @cond @interface CPTPlotSymbol() -@property (nonatomic, readwrite, assign) CGPathRef cachedSymbolPath; -@property (nonatomic, readwrite, assign) CGLayerRef cachedLayer; +@property (nonatomic, readwrite, assign, nullable) CGPathRef cachedSymbolPath; +@property (nonatomic, readwrite, assign, nullable) CGLayerRef cachedLayer; @property (nonatomic, readwrite, assign) CGFloat cachedScale; --(CGPathRef)newSymbolPath; +-(nonnull CGPathRef)newSymbolPath; +-(CGSize)layerSizeForScale:(CGFloat)scale; @end @@ -41,24 +43,24 @@ @implementation CPTPlotSymbol **/ @synthesize symbolType; -/** @property CPTLineStyle *lineStyle +/** @property nullable CPTLineStyle *lineStyle * @brief The line style for the border of the symbol. * If @nil, the border is not drawn. **/ @synthesize lineStyle; -/** @property CPTFill *fill +/** @property nullable CPTFill *fill * @brief The fill for the interior of the symbol. * If @nil, the symbol is not filled. **/ @synthesize fill; -/** @property CPTShadow *shadow +/** @property nullable CPTShadow *shadow * @brief The shadow applied to each plot symbol. **/ @synthesize shadow; -/** @property CGPathRef customSymbolPath +/** @property nullable CGPathRef customSymbolPath * @brief The drawing path for a custom plot symbol. It will be scaled to @ref size before being drawn. **/ @synthesize customSymbolPath; @@ -94,9 +96,9 @@ @implementation CPTPlotSymbol * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { anchorPoint = CPTPointMake(0.5, 0.5); size = CPTSizeMake(5.0, 5.0); symbolType = CPTPlotSymbolTypeNone; @@ -130,7 +132,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeCPTPoint:self.anchorPoint forKey:@"CPTPlotSymbol.anchorPoint"]; [coder encodeCPTSize:self.size forKey:@"CPTPlotSymbol.size"]; @@ -147,15 +149,18 @@ -(void)encodeWithCoder:(NSCoder *)coder // cachedScale } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - anchorPoint = [coder decodeCPTPointForKey:@"CPTPlotSymbol.anchorPoint"]; - size = [coder decodeCPTSizeForKey:@"CPTPlotSymbol.size"]; - symbolType = (CPTPlotSymbolType)[coder decodeIntegerForKey : @"CPTPlotSymbol.symbolType"]; - lineStyle = [coder decodeObjectForKey:@"CPTPlotSymbol.lineStyle"]; - fill = [coder decodeObjectForKey:@"CPTPlotSymbol.fill"]; - shadow = [[coder decodeObjectForKey:@"CPTPlotSymbol.shadow"] copy]; + if ((self = [super init])) { + anchorPoint = [coder decodeCPTPointForKey:@"CPTPlotSymbol.anchorPoint"]; + size = [coder decodeCPTSizeForKey:@"CPTPlotSymbol.size"]; + symbolType = (CPTPlotSymbolType)[coder decodeIntegerForKey:@"CPTPlotSymbol.symbolType"]; + lineStyle = [coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTPlotSymbol.lineStyle"]; + fill = [coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTPlotSymbol.fill"]; + shadow = [[coder decodeObjectOfClass:[CPTShadow class] + forKey:@"CPTPlotSymbol.shadow"] copy]; customSymbolPath = [coder newCGPathDecodeForKey:@"CPTPlotSymbol.customSymbolPath"]; usesEvenOddClipRule = [coder decodeBoolForKey:@"CPTPlotSymbol.usesEvenOddClipRule"]; @@ -168,6 +173,18 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Accessors @@ -175,7 +192,7 @@ -(instancetype)initWithCoder:(NSCoder *)coder -(void)setSize:(CGSize)newSize { - if ( !CGSizeEqualToSize(newSize, size) ) { + if ( !CGSizeEqualToSize(newSize, size)) { size = newSize; self.cachedSymbolPath = NULL; } @@ -189,7 +206,7 @@ -(void)setSymbolType:(CPTPlotSymbolType)newType } } --(void)setShadow:(CPTShadow *)newShadow +-(void)setShadow:(nullable CPTShadow *)newShadow { if ( newShadow != shadow ) { shadow = [newShadow copy]; @@ -197,7 +214,7 @@ -(void)setShadow:(CPTShadow *)newShadow } } --(void)setCustomSymbolPath:(CGPathRef)newPath +-(void)setCustomSymbolPath:(nullable CGPathRef)newPath { if ( customSymbolPath != newPath ) { CGPathRelease(customSymbolPath); @@ -206,7 +223,7 @@ -(void)setCustomSymbolPath:(CGPathRef)newPath } } --(void)setLineStyle:(CPTLineStyle *)newLineStyle +-(void)setLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( newLineStyle != lineStyle ) { lineStyle = newLineStyle; @@ -214,7 +231,7 @@ -(void)setLineStyle:(CPTLineStyle *)newLineStyle } } --(void)setFill:(CPTFill *)newFill +-(void)setFill:(nullable CPTFill *)newFill { if ( newFill != fill ) { fill = newFill; @@ -230,7 +247,7 @@ -(void)setUsesEvenOddClipRule:(BOOL)newEvenOddClipRule } } --(CGPathRef)cachedSymbolPath +-(nullable CGPathRef)cachedSymbolPath { if ( !cachedSymbolPath ) { cachedSymbolPath = [self newSymbolPath]; @@ -238,7 +255,7 @@ -(CGPathRef)cachedSymbolPath return cachedSymbolPath; } --(void)setCachedSymbolPath:(CGPathRef)newPath +-(void)setCachedSymbolPath:(nullable CGPathRef)newPath { if ( cachedSymbolPath != newPath ) { CGPathRelease(cachedSymbolPath); @@ -247,7 +264,7 @@ -(void)setCachedSymbolPath:(CGPathRef)newPath } } --(void)setCachedLayer:(CGLayerRef)newLayer +-(void)setCachedLayer:(nullable CGLayerRef)newLayer { if ( cachedLayer != newLayer ) { CGLayerRelease(cachedLayer); @@ -263,7 +280,7 @@ -(void)setCachedLayer:(CGLayerRef)newLayer /** @brief Creates and returns a new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeNone. * @return A new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeNone. **/ -+(instancetype)plotSymbol ++(nonnull instancetype)plotSymbol { CPTPlotSymbol *symbol = [[self alloc] init]; @@ -275,7 +292,7 @@ +(instancetype)plotSymbol /** @brief Creates and returns a new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeCross. * @return A new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeCross. **/ -+(instancetype)crossPlotSymbol ++(nonnull instancetype)crossPlotSymbol { CPTPlotSymbol *symbol = [[self alloc] init]; @@ -287,7 +304,7 @@ +(instancetype)crossPlotSymbol /** @brief Creates and returns a new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeEllipse. * @return A new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeEllipse. **/ -+(instancetype)ellipsePlotSymbol ++(nonnull instancetype)ellipsePlotSymbol { CPTPlotSymbol *symbol = [[self alloc] init]; @@ -299,7 +316,7 @@ +(instancetype)ellipsePlotSymbol /** @brief Creates and returns a new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeRectangle. * @return A new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeRectangle. **/ -+(instancetype)rectanglePlotSymbol ++(nonnull instancetype)rectanglePlotSymbol { CPTPlotSymbol *symbol = [[self alloc] init]; @@ -311,7 +328,7 @@ +(instancetype)rectanglePlotSymbol /** @brief Creates and returns a new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypePlus. * @return A new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypePlus. **/ -+(instancetype)plusPlotSymbol ++(nonnull instancetype)plusPlotSymbol { CPTPlotSymbol *symbol = [[self alloc] init]; @@ -323,7 +340,7 @@ +(instancetype)plusPlotSymbol /** @brief Creates and returns a new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeStar. * @return A new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeStar. **/ -+(instancetype)starPlotSymbol ++(nonnull instancetype)starPlotSymbol { CPTPlotSymbol *symbol = [[self alloc] init]; @@ -335,7 +352,7 @@ +(instancetype)starPlotSymbol /** @brief Creates and returns a new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeDiamond. * @return A new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeDiamond. **/ -+(instancetype)diamondPlotSymbol ++(nonnull instancetype)diamondPlotSymbol { CPTPlotSymbol *symbol = [[self alloc] init]; @@ -347,7 +364,7 @@ +(instancetype)diamondPlotSymbol /** @brief Creates and returns a new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeTriangle. * @return A new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeTriangle. **/ -+(instancetype)trianglePlotSymbol ++(nonnull instancetype)trianglePlotSymbol { CPTPlotSymbol *symbol = [[self alloc] init]; @@ -359,7 +376,7 @@ +(instancetype)trianglePlotSymbol /** @brief Creates and returns a new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypePentagon. * @return A new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypePentagon. **/ -+(instancetype)pentagonPlotSymbol ++(nonnull instancetype)pentagonPlotSymbol { CPTPlotSymbol *symbol = [[self alloc] init]; @@ -371,7 +388,7 @@ +(instancetype)pentagonPlotSymbol /** @brief Creates and returns a new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeHexagon. * @return A new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeHexagon. **/ -+(instancetype)hexagonPlotSymbol ++(nonnull instancetype)hexagonPlotSymbol { CPTPlotSymbol *symbol = [[self alloc] init]; @@ -383,7 +400,7 @@ +(instancetype)hexagonPlotSymbol /** @brief Creates and returns a new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeDash. * @return A new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeDash. **/ -+(instancetype)dashPlotSymbol ++(nonnull instancetype)dashPlotSymbol { CPTPlotSymbol *symbol = [[self alloc] init]; @@ -395,7 +412,7 @@ +(instancetype)dashPlotSymbol /** @brief Creates and returns a new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeSnow. * @return A new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeSnow. **/ -+(instancetype)snowPlotSymbol ++(nonnull instancetype)snowPlotSymbol { CPTPlotSymbol *symbol = [[self alloc] init]; @@ -408,7 +425,7 @@ +(instancetype)snowPlotSymbol * @param aPath The bounding path for the custom symbol. * @return A new CPTPlotSymbol instance initialized with a symbol type of #CPTPlotSymbolTypeCustom. **/ -+(instancetype)customPlotSymbolWithPath:(CGPathRef)aPath ++(nonnull instancetype)customPlotSymbolWithPath:(nullable CGPathRef)aPath { CPTPlotSymbol *symbol = [[self alloc] init]; @@ -423,7 +440,7 @@ +(instancetype)customPlotSymbolWithPath:(CGPathRef)aPath /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { CPTPlotSymbol *copy = [[[self class] allocWithZone:zone] init]; @@ -455,35 +472,15 @@ -(id)copyWithZone:(NSZone *)zone * @param scale The drawing scale factor. Must be greater than zero (@num{0}). * @param alignToPixels If @YES, the symbol position is aligned with device pixels to reduce anti-aliasing artifacts. **/ --(void)renderInContext:(CGContextRef)context atPoint:(CGPoint)center scale:(CGFloat)scale alignToPixels:(BOOL)alignToPixels +-(void)renderInContext:(nonnull CGContextRef)context atPoint:(CGPoint)center scale:(CGFloat)scale alignToPixels:(BOOL)alignToPixels { - const CGFloat symbolMargin = CPTFloat(2.0); - CGPoint symbolAnchor = self.anchorPoint; - CGSize symbolSize = self.size; - CGSize shadowOffset = CGSizeZero; - CGFloat shadowRadius = CPTFloat(0.0); - CPTShadow *myShadow = self.shadow; - - if ( myShadow ) { - shadowOffset = myShadow.shadowOffset; - shadowRadius = myShadow.shadowBlurRadius; - } CGLayerRef theCachedLayer = self.cachedLayer; CGFloat theCachedScale = self.cachedScale; - if ( !theCachedLayer || (theCachedScale != scale) ) { - CGSize layerSize = symbolSize; - CGFloat lineWidth = self.lineStyle.lineWidth; - - layerSize.width += (ABS(shadowOffset.width) + shadowRadius) * CPTFloat(2.0) + lineWidth; - layerSize.width *= scale; - layerSize.width += symbolMargin; - - layerSize.height += (ABS(shadowOffset.height) + shadowRadius) * CPTFloat(2.0) + lineWidth; - layerSize.height *= scale; - layerSize.height += symbolMargin; + if ( !theCachedLayer || (theCachedScale != scale)) { + CGSize layerSize = [self layerSizeForScale:scale]; self.anchorPoint = CPTPointMake(0.5, 0.5); @@ -491,7 +488,7 @@ -(void)renderInContext:(CGContextRef)context atPoint:(CGPoint)center scale:(CGFl CGContextRef layerContext = CGLayerGetContext(newLayer); [self renderAsVectorInContext:layerContext - atPoint:CPTPointMake( layerSize.width * CPTFloat(0.5), layerSize.height * CPTFloat(0.5) ) + atPoint:CPTPointMake(layerSize.width * CPTFloat(0.5), layerSize.height * CPTFloat(0.5)) scale:scale]; self.cachedLayer = newLayer; @@ -503,16 +500,18 @@ -(void)renderInContext:(CGContextRef)context atPoint:(CGPoint)center scale:(CGFl if ( theCachedLayer ) { CGSize layerSize = CGLayerGetSize(theCachedLayer); - if ( scale != 1.0 ) { + if ( scale != CPTFloat(1.0)) { layerSize.width /= scale; layerSize.height /= scale; } - CGPoint origin = CPTPointMake( center.x - layerSize.width * CPTFloat(0.5) - symbolSize.width * ( symbolAnchor.x - CPTFloat(0.5) ), - center.y - layerSize.height * CPTFloat(0.5) - symbolSize.height * ( symbolAnchor.y - CPTFloat(0.5) ) ); + CGSize symbolSize = self.size; + + CGPoint origin = CPTPointMake(center.x - layerSize.width * CPTFloat(0.5) - symbolSize.width * (symbolAnchor.x - CPTFloat(0.5)), + center.y - layerSize.height * CPTFloat(0.5) - symbolSize.height * (symbolAnchor.y - CPTFloat(0.5))); if ( alignToPixels ) { - if ( scale == 1.0 ) { + if ( scale == CPTFloat(1.0)) { origin.x = round(origin.x); origin.y = round(origin.y); } @@ -526,12 +525,43 @@ -(void)renderInContext:(CGContextRef)context atPoint:(CGPoint)center scale:(CGFl } } +/// @cond + +-(CGSize)layerSizeForScale:(CGFloat)scale +{ + const CGFloat symbolMargin = CPTFloat(2.0); + + CGSize shadowOffset = CGSizeZero; + CGFloat shadowRadius = CPTFloat(0.0); + CPTShadow *myShadow = self.shadow; + + if ( myShadow ) { + shadowOffset = myShadow.shadowOffset; + shadowRadius = myShadow.shadowBlurRadius; + } + + CGSize layerSize = self.size; + CGFloat lineWidth = self.lineStyle.lineWidth; + + layerSize.width += (ABS(shadowOffset.width) + shadowRadius) * CPTFloat(2.0) + lineWidth; + layerSize.width *= scale; + layerSize.width += symbolMargin; + + layerSize.height += (ABS(shadowOffset.height) + shadowRadius) * CPTFloat(2.0) + lineWidth; + layerSize.height *= scale; + layerSize.height += symbolMargin; + + return layerSize; +} + +/// @endcond + /** @brief Draws the plot symbol into the given graphics context centered at the provided point. * @param context The graphics context to draw into. * @param center The center point of the symbol. * @param scale The drawing scale factor. Must be greater than zero (@num{0}). **/ --(void)renderAsVectorInContext:(CGContextRef)context atPoint:(CGPoint)center scale:(CGFloat)scale +-(void)renderAsVectorInContext:(nonnull CGContextRef)context atPoint:(CGPoint)center scale:(CGFloat)scale { CGPathRef theSymbolPath = self.cachedSymbolPath; @@ -569,12 +599,12 @@ -(void)renderAsVectorInContext:(CGContextRef)context atPoint:(CGPoint)center sca CPTShadow *myShadow = self.shadow; CGContextSaveGState(context); - CGContextTranslateCTM(context, center.x + ( symbolAnchor.x - CPTFloat(0.5) ) * symbolSize.width, center.y + ( symbolAnchor.y - CPTFloat(0.5) ) * symbolSize.height); + CGContextTranslateCTM(context, center.x + (symbolAnchor.x - CPTFloat(0.5)) * symbolSize.width, center.y + (symbolAnchor.y - CPTFloat(0.5)) * symbolSize.height); CGContextScaleCTM(context, scale, scale); [myShadow setShadowInContext:context]; // redraw only symbol rectangle - CGSize halfSize = CPTSizeMake( symbolSize.width * CPTFloat(0.5), symbolSize.height * CPTFloat(0.5) ); + CGSize halfSize = CPTSizeMake(symbolSize.width * CPTFloat(0.5), symbolSize.height * CPTFloat(0.5)); CGRect bounds = CPTRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height); CGRect symbolRect = bounds; @@ -582,7 +612,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context atPoint:(CGPoint)center sca if ( myShadow ) { CGFloat shadowRadius = myShadow.shadowBlurRadius; CGSize shadowOffset = myShadow.shadowOffset; - symbolRect = CGRectInset( symbolRect, -( ABS(shadowOffset.width) + ABS(shadowRadius) ), -( ABS(shadowOffset.height) + ABS(shadowRadius) ) ); + symbolRect = CGRectInset(symbolRect, -(ABS(shadowOffset.width) + ABS(shadowRadius)), -(ABS(shadowOffset.height) + ABS(shadowRadius))); } if ( theLineStyle ) { CGFloat lineWidth = ABS(theLineStyle.lineWidth); @@ -596,7 +626,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context atPoint:(CGPoint)center sca if ( theFill ) { // use fillRect instead of fillPath so that images and gradients are properly centered in the symbol CGContextSaveGState(context); - if ( !CGPathIsEmpty(theSymbolPath) ) { + if ( !CGPathIsEmpty(theSymbolPath)) { CGContextBeginPath(context); CGContextAddPath(context, theSymbolPath); if ( self.usesEvenOddClipRule ) { @@ -632,11 +662,11 @@ -(void)renderAsVectorInContext:(CGContextRef)context atPoint:(CGPoint)center sca * @brief Creates and returns a drawing path for the current symbol type. * @return A path describing the outline of the current symbol type. **/ --(CGPathRef)newSymbolPath +-(nonnull CGPathRef)newSymbolPath { CGFloat dx, dy; CGSize symbolSize = self.size; - CGSize halfSize = CPTSizeMake( symbolSize.width * CPTFloat(0.5), symbolSize.height * CPTFloat(0.5) ); + CGSize halfSize = CPTSizeMake(symbolSize.width * CPTFloat(0.5), symbolSize.height * CPTFloat(0.5)); CGMutablePathRef symbolPath = CGPathCreateMutable(); @@ -646,11 +676,11 @@ -(CGPathRef)newSymbolPath break; case CPTPlotSymbolTypeRectangle: - CGPathAddRect( symbolPath, NULL, CPTRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height) ); + CGPathAddRect(symbolPath, NULL, CPTRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height)); break; case CPTPlotSymbolTypeEllipse: - CGPathAddEllipseInRect( symbolPath, NULL, CPTRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height) ); + CGPathAddEllipseInRect(symbolPath, NULL, CPTRectMake(-halfSize.width, -halfSize.height, symbolSize.width, symbolSize.height)); break; case CPTPlotSymbolTypeCross: @@ -663,38 +693,38 @@ -(CGPathRef)newSymbolPath case CPTPlotSymbolTypePlus: CGPathMoveToPoint(symbolPath, NULL, CPTFloat(0.0), halfSize.height); CGPathAddLineToPoint(symbolPath, NULL, CPTFloat(0.0), -halfSize.height); - CGPathMoveToPoint( symbolPath, NULL, -halfSize.width, CPTFloat(0.0) ); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width, CPTFloat(0.0) ); + CGPathMoveToPoint(symbolPath, NULL, -halfSize.width, CPTFloat(0.0)); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width, CPTFloat(0.0)); break; case CPTPlotSymbolTypePentagon: CGPathMoveToPoint(symbolPath, NULL, CPTFloat(0.0), halfSize.height); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437) ); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437)); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437)); CGPathCloseSubpath(symbolPath); break; case CPTPlotSymbolTypeStar: CGPathMoveToPoint(symbolPath, NULL, CPTFloat(0.0), halfSize.height); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width * CPTFloat(0.22451398829), halfSize.height * CPTFloat(0.30901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width * CPTFloat(0.36327126400), -halfSize.height * CPTFloat(0.11803398875) ); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, CPTFloat(0.0), -halfSize.height * CPTFloat(0.38196601125) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width * CPTFloat(0.36327126400), -halfSize.height * CPTFloat(0.11803398875) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width * CPTFloat(0.22451398829), halfSize.height * CPTFloat(0.30901699437) ); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width * CPTFloat(0.22451398829), halfSize.height * CPTFloat(0.30901699437)); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437)); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width * CPTFloat(0.36327126400), -halfSize.height * CPTFloat(0.11803398875)); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437)); + CGPathAddLineToPoint(symbolPath, NULL, CPTFloat(0.0), -halfSize.height * CPTFloat(0.38196601125)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width * CPTFloat(0.58778525229), -halfSize.height * CPTFloat(0.80901699437)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width * CPTFloat(0.36327126400), -halfSize.height * CPTFloat(0.11803398875)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width * CPTFloat(0.95105651630), halfSize.height * CPTFloat(0.30901699437)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width * CPTFloat(0.22451398829), halfSize.height * CPTFloat(0.30901699437)); CGPathCloseSubpath(symbolPath); break; case CPTPlotSymbolTypeDiamond: CGPathMoveToPoint(symbolPath, NULL, CPTFloat(0.0), halfSize.height); - CGPathAddLineToPoint( symbolPath, NULL, halfSize.width, CPTFloat(0.0) ); + CGPathAddLineToPoint(symbolPath, NULL, halfSize.width, CPTFloat(0.0)); CGPathAddLineToPoint(symbolPath, NULL, CPTFloat(0.0), -halfSize.height); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width, CPTFloat(0.0) ); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width, CPTFloat(0.0)); CGPathCloseSubpath(symbolPath); break; @@ -709,8 +739,8 @@ -(CGPathRef)newSymbolPath break; case CPTPlotSymbolTypeDash: - CGPathMoveToPoint( symbolPath, NULL, halfSize.width, CPTFloat(0.0) ); - CGPathAddLineToPoint( symbolPath, NULL, -halfSize.width, CPTFloat(0.0) ); + CGPathMoveToPoint(symbolPath, NULL, halfSize.width, CPTFloat(0.0)); + CGPathAddLineToPoint(symbolPath, NULL, -halfSize.width, CPTFloat(0.0)); break; case CPTPlotSymbolTypeHexagon: @@ -747,8 +777,8 @@ -(CGPathRef)newSymbolPath CGFloat dy1 = symbolSize.height / oldBounds.size.height; CGAffineTransform scaleTransform = CGAffineTransformScale(CGAffineTransformIdentity, dx1, dy1); - scaleTransform = CGAffineTransformConcat( scaleTransform, - CGAffineTransformMakeTranslation(-halfSize.width, -halfSize.height) ); + scaleTransform = CGAffineTransformConcat(scaleTransform, + CGAffineTransformMakeTranslation(-halfSize.width, -halfSize.height)); CGPathAddPath(symbolPath, &scaleTransform, customPath); } } @@ -760,4 +790,30 @@ -(CGPathRef)newSymbolPath /// @endcond +#pragma mark - +#pragma mark Debugging + +/// @cond + +-(nullable id)debugQuickLookObject +{ + const CGFloat screenScale = 1.0; + + CGSize layerSize = [self layerSizeForScale:screenScale]; + + CGRect rect = CGRectMake(0.0, 0.0, layerSize.width, layerSize.height); + + return CPTQuickLookImage(rect, ^(CGContextRef context, CGFloat scale, CGRect bounds) { + CGPoint symbolAnchor = self.anchorPoint; + + self.anchorPoint = CPTPointMake(0.5, 0.5); + + [self renderAsVectorInContext:context atPoint:CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds)) scale:scale]; + + self.anchorPoint = symbolAnchor; + }); +} + +/// @endcond + @end diff --git a/framework/Source/CPTRangePlot.h b/framework/Source/CPTRangePlot.h index 48181d638..5e3434e38 100644 --- a/framework/Source/CPTRangePlot.h +++ b/framework/Source/CPTRangePlot.h @@ -1,31 +1,45 @@ #import "CPTDefinitions.h" +#import "CPTLineStyle.h" #import "CPTPlot.h" -@class CPTLineStyle; @class CPTFill; @class CPTRangePlot; +/** + * @brief Range plot bindings. + **/ +typedef NSString *CPTRangePlotBinding cpt_swift_struct; + /// @ingroup plotBindingsRangePlot /// @{ -extern NSString *const CPTRangePlotBindingXValues; -extern NSString *const CPTRangePlotBindingYValues; -extern NSString *const CPTRangePlotBindingHighValues; -extern NSString *const CPTRangePlotBindingLowValues; -extern NSString *const CPTRangePlotBindingLeftValues; -extern NSString *const CPTRangePlotBindingRightValues; -extern NSString *const CPTRangePlotBindingBarLineStyles; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingXValues; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingYValues; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingHighValues; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingLowValues; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingLeftValues; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingRightValues; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingBarLineStyles; +extern CPTRangePlotBinding __nonnull const CPTRangePlotBindingBarWidths; /// @} /** * @brief Enumeration of range plot data source field types **/ typedef NS_ENUM (NSInteger, CPTRangePlotField) { - CPTRangePlotFieldX, ///< X values. - CPTRangePlotFieldY, ///< Y values. - CPTRangePlotFieldHigh, ///< relative High values. - CPTRangePlotFieldLow, ///< relative Low values. - CPTRangePlotFieldLeft, ///< relative Left values. - CPTRangePlotFieldRight, ///< relative Right values. + CPTRangePlotFieldX, ///< X values. + CPTRangePlotFieldY, ///< Y values. + CPTRangePlotFieldHigh, ///< relative High values. + CPTRangePlotFieldLow, ///< relative Low values. + CPTRangePlotFieldLeft, ///< relative Left values. + CPTRangePlotFieldRight ///< relative Right values. +}; + +/** + * @brief Enumeration of range plot data fill directions + **/ +typedef NS_ENUM (NSInteger, CPTRangePlotFillDirection) { + CPTRangePlotFillHorizontal, ///< Fill between the high and low values in a horizontal direction. + CPTRangePlotFillVertical ///< Fill between the left and right values in a vertical direction. }; #pragma mark - @@ -44,7 +58,7 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { * @param indexRange The range of the data indexes of interest. * @return An array of line styles. **/ --(NSArray *)barLineStylesForRangePlot:(CPTRangePlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTLineStyleArray *)barLineStylesForRangePlot:(nonnull CPTRangePlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a bar line style for the given range plot. * This method will not be called if @@ -55,7 +69,24 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { * @return The bar line style for the bar with the given index. If the data source returns @nil, the default line style is used. * If the data source returns an NSNull object, no line is drawn. **/ --(CPTLineStyle *)barLineStyleForRangePlot:(CPTRangePlot *)plot recordIndex:(NSUInteger)idx; +-(nullable CPTLineStyle *)barLineStyleForRangePlot:(nonnull CPTRangePlot *)plot recordIndex:(NSUInteger)idx; + +/** @brief @optional Gets an array of bar widths for the given range plot. + * @param plot The range plot. + * @param indexRange The range of the data indexes of interest. + * @return An array of bar widths. + **/ +-(nullable CPTNumberArray *)barWidthsForRangePlot:(nonnull CPTRangePlot *)barPlot recordIndexRange:(NSRange)indexRange; + +/** @brief @optional Gets a bar width for the given range plot. + * This method will not be called if + * @link CPTRangePlotDataSource::barWidthForRangePlot:recordIndexRange: -barWidthForRangePlot:recordIndexRange: @endlink + * is also implemented in the datasource. + * @param plot The range plot. + * @param idx The data index of interest. + * @return The bar width for the bar with the given index. If the data source returns @nil, the default barWidth is used. + **/ +-(nullable NSNumber *)barWidthForRangePlot:(nonnull CPTRangePlot *)plot recordIndex:(NSUInteger)idx; /// @} @@ -81,7 +112,7 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { * @if MacOnly clicked bar. @endif * @if iOSOnly touched bar. @endif **/ --(void)rangePlot:(CPTRangePlot *)plot rangeWasSelectedAtRecordIndex:(NSUInteger)idx; +-(void)rangePlot:(nonnull CPTRangePlot *)plot rangeWasSelectedAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a bar * @if MacOnly was both pressed and released. @endif @@ -92,7 +123,7 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { * @if iOSOnly touched bar. @endif * @param event The event that triggered the selection. **/ --(void)rangePlot:(CPTRangePlot *)plot rangeWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)rangePlot:(nonnull CPTRangePlot *)plot rangeWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a bar * @if MacOnly was pressed. @endif @@ -102,7 +133,7 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { * @if MacOnly clicked bar. @endif * @if iOSOnly touched bar. @endif **/ --(void)rangePlot:(CPTRangePlot *)plot rangeTouchDownAtRecordIndex:(NSUInteger)idx; +-(void)rangePlot:(nonnull CPTRangePlot *)plot rangeTouchDownAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a bar * @if MacOnly was pressed. @endif @@ -113,7 +144,7 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { * @if iOSOnly touched bar. @endif * @param event The event that triggered the selection. **/ --(void)rangePlot:(CPTRangePlot *)plot rangeTouchDownAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)rangePlot:(nonnull CPTRangePlot *)plot rangeTouchDownAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a bar * @if MacOnly was released. @endif @@ -123,7 +154,7 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { * @if MacOnly clicked bar. @endif * @if iOSOnly touched bar. @endif **/ --(void)rangePlot:(CPTRangePlot *)plot rangeTouchUpAtRecordIndex:(NSUInteger)idx; +-(void)rangePlot:(nonnull CPTRangePlot *)plot rangeTouchUpAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a bar * @if MacOnly was released. @endif @@ -134,7 +165,7 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { * @if iOSOnly touched bar. @endif * @param event The event that triggered the selection. **/ --(void)rangePlot:(CPTRangePlot *)plot rangeTouchUpAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)rangePlot:(nonnull CPTRangePlot *)plot rangeTouchUpAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /// @} @@ -146,7 +177,7 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { /// @name Appearance /// @{ -@property (nonatomic, readwrite, copy) CPTLineStyle *barLineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *barLineStyle; @property (nonatomic, readwrite) CGFloat barWidth; @property (nonatomic, readwrite) CGFloat gapHeight; @property (nonatomic, readwrite) CGFloat gapWidth; @@ -154,14 +185,17 @@ typedef NS_ENUM (NSInteger, CPTRangePlotField) { /// @name Drawing /// @{ -@property (nonatomic, copy) CPTFill *areaFill; -@property (nonatomic, readwrite, copy) CPTLineStyle *areaBorderLineStyle; +@property (nonatomic, readwrite) CPTRangePlotFillDirection fillDirection; +@property (nonatomic, copy, nullable) CPTFill *areaFill; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *areaBorderLineStyle; /// @} /// @name Bar Style /// @{ -(void)reloadBarLineStyles; -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange; +-(void)reloadBarWidths; +-(void)reloadBarWidthsInIndexRange:(NSRange)indexRange; /// @} @end diff --git a/framework/Source/CPTRangePlot.m b/framework/Source/CPTRangePlot.m index b30b72045..b03c7e6e2 100644 --- a/framework/Source/CPTRangePlot.m +++ b/framework/Source/CPTRangePlot.m @@ -13,6 +13,8 @@ #import "CPTUtilities.h" #import "CPTXYPlotSpace.h" #import "NSCoderExtensions.h" +#import "NSNumberExtensions.h" +#import "tgmath.h" /** @defgroup plotAnimationRangePlot Range Plot * @brief Range plot properties that can be animated using Core Animation. @@ -26,13 +28,14 @@ * @endif **/ -NSString *const CPTRangePlotBindingXValues = @"xValues"; ///< X values. -NSString *const CPTRangePlotBindingYValues = @"yValues"; ///< Y values. -NSString *const CPTRangePlotBindingHighValues = @"highValues"; ///< High values. -NSString *const CPTRangePlotBindingLowValues = @"lowValues"; ///< Low values. -NSString *const CPTRangePlotBindingLeftValues = @"leftValues"; ///< Left price values. -NSString *const CPTRangePlotBindingRightValues = @"rightValues"; ///< Right price values. -NSString *const CPTRangePlotBindingBarLineStyles = @"barLineStyles"; ///< Bar line styles. +CPTRangePlotBinding const CPTRangePlotBindingXValues = @"xValues"; ///< X values. +CPTRangePlotBinding const CPTRangePlotBindingYValues = @"yValues"; ///< Y values. +CPTRangePlotBinding const CPTRangePlotBindingHighValues = @"highValues"; ///< High values. +CPTRangePlotBinding const CPTRangePlotBindingLowValues = @"lowValues"; ///< Low values. +CPTRangePlotBinding const CPTRangePlotBindingLeftValues = @"leftValues"; ///< Left price values. +CPTRangePlotBinding const CPTRangePlotBindingRightValues = @"rightValues"; ///< Right price values. +CPTRangePlotBinding const CPTRangePlotBindingBarLineStyles = @"barLineStyles"; ///< Bar line styles. +CPTRangePlotBinding const CPTRangePlotBindingBarWidths = @"barWidths"; ///< Bar widths. /// @cond struct CGPointError { @@ -47,22 +50,24 @@ @interface CPTRangePlot() -@property (nonatomic, readwrite, copy) NSArray *xValues; -@property (nonatomic, readwrite, copy) NSArray *yValues; -@property (nonatomic, readwrite, copy) CPTMutableNumericData *highValues; -@property (nonatomic, readwrite, copy) CPTMutableNumericData *lowValues; -@property (nonatomic, readwrite, copy) CPTMutableNumericData *leftValues; -@property (nonatomic, readwrite, copy) CPTMutableNumericData *rightValues; -@property (nonatomic, readwrite, copy) NSArray *barLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *xValues; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *yValues; +@property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *highValues; +@property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *lowValues; +@property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *leftValues; +@property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *rightValues; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *barLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *barWidths; @property (nonatomic, readwrite, assign) NSUInteger pointingDeviceDownIndex; --(void)calculatePointsToDraw:(BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount forPlotSpace:(CPTXYPlotSpace *)xyPlotSpace includeVisiblePointsOnly:(BOOL)visibleOnly; --(void)calculateViewPoints:(CGPointError *)viewPoints withDrawPointFlags:(BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount; --(void)alignViewPointsToUserSpace:(CGPointError *)viewPoints withContent:(CGContextRef)context drawPointFlags:(BOOL *)drawPointFlag numberOfPoints:(NSUInteger)dataCounts; --(NSInteger)extremeDrawnPointIndexForFlags:(BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount extremeNumIsLowerBound:(BOOL)isLowerBound; +-(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount forPlotSpace:(nonnull CPTXYPlotSpace *)xyPlotSpace; +-(void)calculateViewPoints:(nonnull CGPointError *)viewPoints withDrawPointFlags:(nonnull BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount; +-(void)alignViewPointsToUserSpace:(nonnull CGPointError *)viewPoints withContext:(nonnull CGContextRef)context drawPointFlags:(nonnull BOOL *)drawPointFlag numberOfPoints:(NSUInteger)dataCounts; +-(NSInteger)extremeDrawnPointIndexForFlags:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount extremeNumIsLowerBound:(BOOL)isLowerBound; --(void)drawRangeInContext:(CGContextRef)context lineStyle:(CPTLineStyle *)lineStyle viewPoint:(CGPointError *)viewPoint halfGapSize:(CGSize)halfGapSize halfBarWidth:(CGFloat)halfBarWidth alignPoints:(BOOL)alignPoints; +-(void)drawRangeInContext:(nonnull CGContextRef)context lineStyle:(nonnull CPTLineStyle *)lineStyle viewPoint:(CGPointError *)viewPoint halfGapSize:(CGSize)halfGapSize halfBarWidth:(CGFloat)halfBarWidth alignPoints:(BOOL)alignPoints; -(CPTLineStyle *)barLineStyleForIndex:(NSUInteger)idx; +-(nonnull NSNumber *)barWidthForIndex:(NSUInteger)idx; @end @@ -87,6 +92,13 @@ @implementation CPTRangePlot @dynamic leftValues; @dynamic rightValues; @dynamic barLineStyles; +@dynamic barWidths; + +/** @property CPTRangePlotFillDirection fillDirection + * @brief Fill the range in a horizontal or vertical direction. + * Default is CPTRangePlotFillHorizontal. + **/ +@synthesize fillDirection; /** @property CPTFill *areaFill * @brief The fill used to render the area. @@ -137,7 +149,7 @@ @implementation CPTRangePlot /// @cond -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else +(void)initialize { @@ -149,8 +161,10 @@ +(void)initialize [self exposeBinding:CPTRangePlotBindingLeftValues]; [self exposeBinding:CPTRangePlotBindingRightValues]; [self exposeBinding:CPTRangePlotBindingBarLineStyles]; + [self exposeBinding:CPTRangePlotBindingBarWidths]; } } + #endif /// @endcond @@ -162,18 +176,27 @@ +(void)initialize * * This is the designated initializer. The initialized layer will have the following properties: * - @ref barLineStyle = default line style + * - @ref fillDirection = CPTRangePlotFillHorizontal * - @ref areaFill = @nil + * - @ref areaBorderLineStyle = @nil + * - @ref barWidth = 0.0 + * - @ref gapHeight = 0.0 + * - @ref gapWidth = 0.0 * - @ref labelField = #CPTRangePlotFieldX * * @param newFrame The frame rectangle. * @return The initialized CPTRangePlot object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { barLineStyle = [[CPTLineStyle alloc] init]; + fillDirection = CPTRangePlotFillHorizontal; areaFill = nil; areaBorderLineStyle = nil; + barWidth = CPTFloat(0.0); + gapHeight = CPTFloat(0.0); + gapWidth = CPTFloat(0.0); pointingDeviceDownIndex = NSNotFound; @@ -186,14 +209,18 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTRangePlot *theLayer = (CPTRangePlot *)layer; barLineStyle = theLayer->barLineStyle; + fillDirection = theLayer->fillDirection; areaFill = theLayer->areaFill; areaBorderLineStyle = theLayer->areaBorderLineStyle; + barWidth = theLayer->barWidth; + gapHeight = theLayer->gapHeight; + gapWidth = theLayer->gapWidth; pointingDeviceDownIndex = NSNotFound; } @@ -207,7 +234,7 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -215,6 +242,7 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeCGFloat:self.barWidth forKey:@"CPTRangePlot.barWidth"]; [coder encodeCGFloat:self.gapHeight forKey:@"CPTRangePlot.gapHeight"]; [coder encodeCGFloat:self.gapWidth forKey:@"CPTRangePlot.gapWidth"]; + [coder encodeInteger:self.fillDirection forKey:@"CPTRangePlot.fillDirection"]; [coder encodeObject:self.areaFill forKey:@"CPTRangePlot.areaFill"]; [coder encodeObject:self.areaBorderLineStyle forKey:@"CPTRangePlot.areaBorderLineStyle"]; @@ -222,15 +250,19 @@ -(void)encodeWithCoder:(NSCoder *)coder // pointingDeviceDownIndex } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - barLineStyle = [[coder decodeObjectForKey:@"CPTRangePlot.barLineStyle"] copy]; - barWidth = [coder decodeCGFloatForKey:@"CPTRangePlot.barWidth"]; - gapHeight = [coder decodeCGFloatForKey:@"CPTRangePlot.gapHeight"]; - gapWidth = [coder decodeCGFloatForKey:@"CPTRangePlot.gapWidth"]; - areaFill = [[coder decodeObjectForKey:@"CPTRangePlot.areaFill"] copy]; - areaBorderLineStyle = [[coder decodeObjectForKey:@"CPTRangePlot.areaBorderLineStyle"] copy]; + if ((self = [super initWithCoder:coder])) { + barLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTRangePlot.barLineStyle"] copy]; + barWidth = [coder decodeCGFloatForKey:@"CPTRangePlot.barWidth"]; + gapHeight = [coder decodeCGFloatForKey:@"CPTRangePlot.gapHeight"]; + gapWidth = [coder decodeCGFloatForKey:@"CPTRangePlot.gapWidth"]; + fillDirection = [coder decodeIntegerForKey:@"CPTRangePlot.fillDirection"]; + areaFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTRangePlot.areaFill"] copy]; + areaBorderLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTRangePlot.areaBorderLineStyle"] copy]; pointingDeviceDownIndex = NSNotFound; } @@ -239,12 +271,24 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Determining Which Points to Draw /// @cond --(void)calculatePointsToDraw:(BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount forPlotSpace:(CPTXYPlotSpace *)xyPlotSpace includeVisiblePointsOnly:(BOOL)visibleOnly +-(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount forPlotSpace:(nonnull CPTXYPlotSpace *)xyPlotSpace { if ( dataCount == 0 ) { return; @@ -257,9 +301,9 @@ -(void)calculatePointsToDraw:(BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)d } } else { - CPTPlotRangeComparisonResult *xRangeFlags = malloc( dataCount * sizeof(CPTPlotRangeComparisonResult) ); - CPTPlotRangeComparisonResult *yRangeFlags = malloc( dataCount * sizeof(CPTPlotRangeComparisonResult) ); - BOOL *nanFlags = malloc( dataCount * sizeof(BOOL) ); + CPTPlotRangeComparisonResult *xRangeFlags = calloc(dataCount, sizeof(CPTPlotRangeComparisonResult)); + CPTPlotRangeComparisonResult *yRangeFlags = calloc(dataCount, sizeof(CPTPlotRangeComparisonResult)); + BOOL *nanFlags = calloc(dataCount, sizeof(BOOL)); CPTPlotRange *xRange = xyPlotSpace.xRange; CPTPlotRange *yRange = xyPlotSpace.yRange; @@ -275,7 +319,7 @@ -(void)calculatePointsToDraw:(BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)d xRangeFlags[i] = [xRange compareToDouble:x]; yRangeFlags[i] = [yRange compareToDouble:y]; - nanFlags[i] = isnan(x) || isnan(y); + nanFlags[i] = isnan(x) || isnan(y); }); } else { @@ -288,7 +332,7 @@ -(void)calculatePointsToDraw:(BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)d xRangeFlags[i] = [xRange compareToDecimal:x]; yRangeFlags[i] = [yRange compareToDecimal:y]; - nanFlags[i] = NSDecimalIsNotANumber(&x); + nanFlags[i] = NSDecimalIsNotANumber(&x); }); } @@ -306,7 +350,7 @@ -(void)calculatePointsToDraw:(BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)d } } --(void)calculateViewPoints:(CGPointError *)viewPoints withDrawPointFlags:(BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount +-(void)calculateViewPoints:(nonnull CGPointError *)viewPoints withDrawPointFlags:(nonnull BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount { CPTPlotSpace *thePlotSpace = self.plotSpace; @@ -320,43 +364,43 @@ -(void)calculateViewPoints:(CGPointError *)viewPoints withDrawPointFlags:(BOOL * const double *rightBytes = (const double *)[self cachedNumbersForField:CPTRangePlotFieldRight].data.bytes; dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { - const double x = xBytes[i]; - const double y = yBytes[i]; - const double high = highBytes[i]; - const double low = lowBytes[i]; - const double left = leftBytes[i]; + const double x = xBytes[i]; + const double y = yBytes[i]; + const double high = highBytes[i]; + const double low = lowBytes[i]; + const double left = leftBytes[i]; const double right = rightBytes[i]; - if ( !drawPointFlags[i] || isnan(x) || isnan(y) ) { - viewPoints[i].x = NAN; // depending coordinates - viewPoints[i].y = NAN; + if ( !drawPointFlags[i] || isnan(x) || isnan(y)) { + viewPoints[i].x = CPTNAN; // depending coordinates + viewPoints[i].y = CPTNAN; } else { double plotPoint[2]; plotPoint[CPTCoordinateX] = x; plotPoint[CPTCoordinateY] = y; - CGPoint pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].x = pos.x; - viewPoints[i].y = pos.y; + CGPoint pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].x = pos.x; + viewPoints[i].y = pos.y; plotPoint[CPTCoordinateX] = x; plotPoint[CPTCoordinateY] = y + high; - pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].high = pos.y; + pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].high = pos.y; plotPoint[CPTCoordinateX] = x; plotPoint[CPTCoordinateY] = y - low; - pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].low = pos.y; + pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].low = pos.y; plotPoint[CPTCoordinateX] = x - left; plotPoint[CPTCoordinateY] = y; - pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].left = pos.x; + pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].left = pos.x; plotPoint[CPTCoordinateX] = x + right; plotPoint[CPTCoordinateY] = y; - pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].right = pos.x; + pos = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].right = pos.x; } }); } @@ -369,96 +413,96 @@ -(void)calculateViewPoints:(CGPointError *)viewPoints withDrawPointFlags:(BOOL * const NSDecimal *rightBytes = (const NSDecimal *)[self cachedNumbersForField:CPTRangePlotFieldRight].data.bytes; dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { - const NSDecimal x = xBytes[i]; - const NSDecimal y = yBytes[i]; - const NSDecimal high = highBytes[i]; - const NSDecimal low = lowBytes[i]; - const NSDecimal left = leftBytes[i]; + const NSDecimal x = xBytes[i]; + const NSDecimal y = yBytes[i]; + const NSDecimal high = highBytes[i]; + const NSDecimal low = lowBytes[i]; + const NSDecimal left = leftBytes[i]; const NSDecimal right = rightBytes[i]; - if ( !drawPointFlags[i] || NSDecimalIsNotANumber(&x) || NSDecimalIsNotANumber(&y) ) { - viewPoints[i].x = NAN; // depending coordinates - viewPoints[i].y = NAN; + if ( !drawPointFlags[i] || NSDecimalIsNotANumber(&x) || NSDecimalIsNotANumber(&y)) { + viewPoints[i].x = CPTNAN; // depending coordinates + viewPoints[i].y = CPTNAN; } else { NSDecimal plotPoint[2]; plotPoint[CPTCoordinateX] = x; plotPoint[CPTCoordinateY] = y; - CGPoint pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].x = pos.x; - viewPoints[i].y = pos.y; + CGPoint pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].x = pos.x; + viewPoints[i].y = pos.y; - if ( !NSDecimalIsNotANumber(&high) ) { + if ( !NSDecimalIsNotANumber(&high)) { plotPoint[CPTCoordinateX] = x; NSDecimal yh; NSDecimalAdd(&yh, &y, &high, NSRoundPlain); plotPoint[CPTCoordinateY] = yh; - pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].high = pos.y; + pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].high = pos.y; } else { - viewPoints[i].high = NAN; + viewPoints[i].high = CPTNAN; } - if ( !NSDecimalIsNotANumber(&low) ) { + if ( !NSDecimalIsNotANumber(&low)) { plotPoint[CPTCoordinateX] = x; NSDecimal yl; NSDecimalSubtract(&yl, &y, &low, NSRoundPlain); plotPoint[CPTCoordinateY] = yl; - pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].low = pos.y; + pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].low = pos.y; } else { - viewPoints[i].low = NAN; + viewPoints[i].low = CPTNAN; } - if ( !NSDecimalIsNotANumber(&left) ) { + if ( !NSDecimalIsNotANumber(&left)) { NSDecimal xl; NSDecimalSubtract(&xl, &x, &left, NSRoundPlain); plotPoint[CPTCoordinateX] = xl; plotPoint[CPTCoordinateY] = y; - pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].left = pos.x; + pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].left = pos.x; } else { - viewPoints[i].left = NAN; + viewPoints[i].left = CPTNAN; } - if ( !NSDecimalIsNotANumber(&right) ) { + if ( !NSDecimalIsNotANumber(&right)) { NSDecimal xr; NSDecimalAdd(&xr, &x, &right, NSRoundPlain); plotPoint[CPTCoordinateX] = xr; plotPoint[CPTCoordinateY] = y; - pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; - viewPoints[i].right = pos.x; + pos = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; + viewPoints[i].right = pos.x; } else { - viewPoints[i].right = NAN; + viewPoints[i].right = CPTNAN; } } }); } } --(void)alignViewPointsToUserSpace:(CGPointError *)viewPoints withContent:(CGContextRef)context drawPointFlags:(BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount +-(void)alignViewPointsToUserSpace:(nonnull CGPointError *)viewPoints withContext:(nonnull CGContextRef)context drawPointFlags:(nonnull BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount { // Align to device pixels if there is a data line. // Otherwise, align to view space, so fills are sharp at edges. - if ( self.barLineStyle.lineWidth > 0.0 ) { + if ( self.barLineStyle.lineWidth > CPTFloat(0.0)) { dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { if ( drawPointFlags[i] ) { - CGFloat x = viewPoints[i].x; - CGFloat y = viewPoints[i].y; - CGPoint pos = CPTAlignPointToUserSpace( context, CPTPointMake(viewPoints[i].x, viewPoints[i].y) ); + CGFloat x = viewPoints[i].x; + CGFloat y = viewPoints[i].y; + CGPoint pos = CPTAlignPointToUserSpace(context, CPTPointMake(viewPoints[i].x, viewPoints[i].y)); viewPoints[i].x = pos.x; viewPoints[i].y = pos.y; - pos = CPTAlignPointToUserSpace( context, CPTPointMake(x, viewPoints[i].high) ); - viewPoints[i].high = pos.y; - pos = CPTAlignPointToUserSpace( context, CPTPointMake(x, viewPoints[i].low) ); - viewPoints[i].low = pos.y; - pos = CPTAlignPointToUserSpace( context, CPTPointMake(viewPoints[i].left, y) ); - viewPoints[i].left = pos.x; - pos = CPTAlignPointToUserSpace( context, CPTPointMake(viewPoints[i].right, y) ); + pos = CPTAlignPointToUserSpace(context, CPTPointMake(x, viewPoints[i].high)); + viewPoints[i].high = pos.y; + pos = CPTAlignPointToUserSpace(context, CPTPointMake(x, viewPoints[i].low)); + viewPoints[i].low = pos.y; + pos = CPTAlignPointToUserSpace(context, CPTPointMake(viewPoints[i].left, y)); + viewPoints[i].left = pos.x; + pos = CPTAlignPointToUserSpace(context, CPTPointMake(viewPoints[i].right, y)); viewPoints[i].right = pos.x; } }); @@ -466,26 +510,26 @@ -(void)alignViewPointsToUserSpace:(CGPointError *)viewPoints withContent:(CGCont else { dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { if ( drawPointFlags[i] ) { - CGFloat x = viewPoints[i].x; - CGFloat y = viewPoints[i].y; - CGPoint pos = CPTAlignIntegralPointToUserSpace( context, CPTPointMake(viewPoints[i].x, viewPoints[i].y) ); + CGFloat x = viewPoints[i].x; + CGFloat y = viewPoints[i].y; + CGPoint pos = CPTAlignIntegralPointToUserSpace(context, CPTPointMake(viewPoints[i].x, viewPoints[i].y)); viewPoints[i].x = pos.x; viewPoints[i].y = pos.y; - pos = CPTAlignIntegralPointToUserSpace( context, CPTPointMake(x, viewPoints[i].high) ); - viewPoints[i].high = pos.y; - pos = CPTAlignIntegralPointToUserSpace( context, CPTPointMake(x, viewPoints[i].low) ); - viewPoints[i].low = pos.y; - pos = CPTAlignIntegralPointToUserSpace( context, CPTPointMake(viewPoints[i].left, y) ); - viewPoints[i].left = pos.x; - pos = CPTAlignIntegralPointToUserSpace( context, CPTPointMake(viewPoints[i].right, y) ); + pos = CPTAlignIntegralPointToUserSpace(context, CPTPointMake(x, viewPoints[i].high)); + viewPoints[i].high = pos.y; + pos = CPTAlignIntegralPointToUserSpace(context, CPTPointMake(x, viewPoints[i].low)); + viewPoints[i].low = pos.y; + pos = CPTAlignIntegralPointToUserSpace(context, CPTPointMake(viewPoints[i].left, y)); + viewPoints[i].left = pos.x; + pos = CPTAlignIntegralPointToUserSpace(context, CPTPointMake(viewPoints[i].right, y)); viewPoints[i].right = pos.x; } }); } } --(NSInteger)extremeDrawnPointIndexForFlags:(BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount extremeNumIsLowerBound:(BOOL)isLowerBound +-(NSInteger)extremeDrawnPointIndexForFlags:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount extremeNumIsLowerBound:(BOOL)isLowerBound { NSInteger result = NSNotFound; NSInteger delta = (isLowerBound ? 1 : -1); @@ -497,7 +541,7 @@ -(NSInteger)extremeDrawnPointIndexForFlags:(BOOL *)pointDrawFlags numberOfPoints result = i; break; } - if ( (delta < 0) && (i == 0) ) { + if ((delta < 0) && (i == 0)) { break; } } @@ -518,6 +562,9 @@ -(void)reloadDataInIndexRange:(NSRange)indexRange // Bar line styles [self reloadBarLineStylesInIndexRange:indexRange]; + + // Bar widths + [self reloadBarWidthsInIndexRange:indexRange]; } -(void)reloadPlotDataInIndexRange:(NSRange)indexRange @@ -581,9 +628,9 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(barLineStyleForRangePlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableLineStyleArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTLineStyle *dataSourceLineStyle = [theDataSource barLineStyleForRangePlot:self recordIndex:idx]; @@ -606,12 +653,55 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange [self setNeedsDisplay]; } +/** + * @brief Reload all bar widths from the data source immediately. + **/ +-(void)reloadBarWidths +{ + [self reloadBarWidthsInIndexRange:NSMakeRange(0, self.cachedDataCount)]; +} + +/** @brief Reload bar widths in the given index range from the data source immediately. + * @param indexRange The index range to load. + **/ +-(void)reloadBarWidthsInIndexRange:(NSRange)indexRange +{ + id theDataSource = (id)self.dataSource; + + if ( [theDataSource respondsToSelector:@selector(barWidthsForRangePlot:recordIndexRange:)] ) { + [self cacheArray:[theDataSource barWidthsForRangePlot:self recordIndexRange:indexRange] + forKey:CPTRangePlotBindingBarWidths + atRecordIndex:indexRange.location]; + } + else if ( [theDataSource respondsToSelector:@selector(barWidthForRangePlot:recordIndex:)] ) { + id nilObject = [CPTPlot nilData]; + CPTMutableNumberArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); + + for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { + NSNumber *width = [theDataSource barWidthForRangePlot:self recordIndex:idx]; + if ( width ) { + [array addObject:width]; + } + else { + [array addObject:nilObject]; + } + } + + [self cacheArray:array + forKey:CPTRangePlotBindingBarWidths + atRecordIndex:indexRange.location]; + } + + [self setNeedsDisplay]; +} + #pragma mark - #pragma mark Drawing /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden ) { return; @@ -620,7 +710,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context CPTMutableNumericData *xValueData = [self cachedNumbersForField:CPTRangePlotFieldX]; CPTMutableNumericData *yValueData = [self cachedNumbersForField:CPTRangePlotFieldY]; - if ( (xValueData == nil) || (yValueData == nil) ) { + if ((xValueData == nil) || (yValueData == nil)) { return; } NSUInteger dataCount = self.cachedDataCount; @@ -634,14 +724,14 @@ -(void)renderAsVectorInContext:(CGContextRef)context [super renderAsVectorInContext:context]; // Calculate view points, and align to user space - CGPointError *viewPoints = calloc( dataCount, sizeof(CGPointError) ); - BOOL *drawPointFlags = calloc( dataCount, sizeof(BOOL) ); + CGPointError *viewPoints = calloc(dataCount, sizeof(CGPointError)); + BOOL *drawPointFlags = calloc(dataCount, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = (CPTXYPlotSpace *)self.plotSpace; - [self calculatePointsToDraw:drawPointFlags numberOfPoints:dataCount forPlotSpace:thePlotSpace includeVisiblePointsOnly:NO]; + [self calculatePointsToDraw:drawPointFlags numberOfPoints:dataCount forPlotSpace:thePlotSpace]; [self calculateViewPoints:viewPoints withDrawPointFlags:drawPointFlags numberOfPoints:dataCount]; if ( self.alignsPointsToPixels ) { - [self alignViewPointsToUserSpace:viewPoints withContent:context drawPointFlags:drawPointFlags numberOfPoints:dataCount]; + [self alignViewPointsToUserSpace:viewPoints withContext:context drawPointFlags:drawPointFlags numberOfPoints:dataCount]; } // Get extreme points @@ -652,39 +742,80 @@ -(void)renderAsVectorInContext:(CGContextRef)context if ( self.areaFill ) { CGMutablePathRef fillPath = CGPathCreateMutable(); - // First do the top points - for ( NSUInteger i = (NSUInteger)firstDrawnPointIndex; i <= (NSUInteger)lastDrawnPointIndex; i++ ) { - CGFloat x = viewPoints[i].x; - CGFloat y = viewPoints[i].high; - if ( isnan(y) ) { - y = viewPoints[i].y; - } - - if ( !isnan(x) && !isnan(y) ) { - if ( i == (NSUInteger)firstDrawnPointIndex ) { - CGPathMoveToPoint(fillPath, NULL, x, y); + switch ( self.fillDirection ) { + case CPTRangePlotFillHorizontal: + // First do the top points + for ( NSUInteger i = (NSUInteger)firstDrawnPointIndex; i <= (NSUInteger)lastDrawnPointIndex; i++ ) { + CGFloat x = viewPoints[i].x; + CGFloat y = viewPoints[i].high; + if ( isnan(y)) { + y = viewPoints[i].y; + } + + if ( !isnan(x) && !isnan(y)) { + if ( i == (NSUInteger)firstDrawnPointIndex ) { + CGPathMoveToPoint(fillPath, NULL, x, y); + } + else { + CGPathAddLineToPoint(fillPath, NULL, x, y); + } + } } - else { - CGPathAddLineToPoint(fillPath, NULL, x, y); + + // Then reverse over bottom points + for ( NSUInteger j = (NSUInteger)lastDrawnPointIndex; j >= (NSUInteger)firstDrawnPointIndex; j-- ) { + CGFloat x = viewPoints[j].x; + CGFloat y = viewPoints[j].low; + if ( isnan(y)) { + y = viewPoints[j].y; + } + + if ( !isnan(x) && !isnan(y)) { + CGPathAddLineToPoint(fillPath, NULL, x, y); + } + if ( j == (NSUInteger)firstDrawnPointIndex ) { + // This could be done a bit more elegant + break; + } } - } - } + break; - // Then reverse over bottom points - for ( NSUInteger j = (NSUInteger)lastDrawnPointIndex; j >= (NSUInteger)firstDrawnPointIndex; j-- ) { - CGFloat x = viewPoints[j].x; - CGFloat y = viewPoints[j].low; - if ( isnan(y) ) { - y = viewPoints[j].y; - } + case CPTRangePlotFillVertical: + // First do the left points + for ( NSUInteger i = (NSUInteger)firstDrawnPointIndex; i <= (NSUInteger)lastDrawnPointIndex; i++ ) { + CGFloat x = viewPoints[i].left; + CGFloat y = viewPoints[i].y; + if ( isnan(x)) { + y = viewPoints[i].x; + } + + if ( !isnan(x) && !isnan(y)) { + if ( i == (NSUInteger)firstDrawnPointIndex ) { + CGPathMoveToPoint(fillPath, NULL, x, y); + } + else { + CGPathAddLineToPoint(fillPath, NULL, x, y); + } + } + } - if ( !isnan(x) && !isnan(y) ) { - CGPathAddLineToPoint(fillPath, NULL, x, y); - } - if ( j == (NSUInteger)firstDrawnPointIndex ) { - // This could be done a bit more elegant + // Then reverse over right points + for ( NSUInteger j = (NSUInteger)lastDrawnPointIndex; j >= (NSUInteger)firstDrawnPointIndex; j-- ) { + CGFloat x = viewPoints[j].right; + CGFloat y = viewPoints[j].y; + if ( isnan(x)) { + y = viewPoints[j].x; + } + + if ( !isnan(x) && !isnan(y)) { + CGPathAddLineToPoint(fillPath, NULL, x, y); + } + if ( j == (NSUInteger)firstDrawnPointIndex ) { + // This could be done a bit more elegant + break; + } + } break; - } } // Close the path to have a closed loop @@ -707,11 +838,12 @@ -(void)renderAsVectorInContext:(CGContextRef)context CGPathRelease(fillPath); } - CGSize halfGapSize = CPTSizeMake( self.gapWidth * CPTFloat(0.5), self.gapHeight * CPTFloat(0.5) ); - CGFloat halfBarWidth = self.barWidth * CPTFloat(0.5); - BOOL alignPoints = self.alignsPointsToPixels; + CGSize halfGapSize = CPTSizeMake(self.gapWidth * CPTFloat(0.5), self.gapHeight * CPTFloat(0.5)); + BOOL alignPoints = self.alignsPointsToPixels; for ( NSUInteger i = (NSUInteger)firstDrawnPointIndex; i <= (NSUInteger)lastDrawnPointIndex; i++ ) { + CGFloat halfBarWidth = [self barWidthForIndex:i].cgFloatValue * CPTFloat(0.5); + [self drawRangeInContext:context lineStyle:[self barLineStyleForIndex:i] viewPoint:&viewPoints[i] @@ -725,25 +857,25 @@ -(void)renderAsVectorInContext:(CGContextRef)context free(drawPointFlags); } --(void)drawRangeInContext:(CGContextRef)context - lineStyle:(CPTLineStyle *)lineStyle - viewPoint:(CGPointError *)viewPoint +-(void)drawRangeInContext:(nonnull CGContextRef)context + lineStyle:(nonnull CPTLineStyle *)lineStyle + viewPoint:(nonnull CGPointError *)viewPoint halfGapSize:(CGSize)halfGapSize halfBarWidth:(CGFloat)halfBarWidth alignPoints:(BOOL)alignPoints { - if ( [lineStyle isKindOfClass:[CPTLineStyle class]] && !isnan(viewPoint->x) && !isnan(viewPoint->y) ) { + if ( [lineStyle isKindOfClass:[CPTLineStyle class]] && !isnan(viewPoint->x) && !isnan(viewPoint->y)) { CPTAlignPointFunction alignmentFunction = CPTAlignPointToUserSpace; CGFloat lineWidth = lineStyle.lineWidth; - if ( ( self.contentsScale > CPTFloat(1.0) ) && (round(lineWidth) == lineWidth) ) { + if ((self.contentsScale > CPTFloat(1.0)) && (round(lineWidth) == lineWidth)) { alignmentFunction = CPTAlignIntegralPointToUserSpace; } CGMutablePathRef path = CGPathCreateMutable(); // centre-high - if ( !isnan(viewPoint->high) ) { + if ( !isnan(viewPoint->high)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->x, viewPoint->y + halfGapSize.height); CGPoint alignedLowPoint = CPTPointMake(viewPoint->x, viewPoint->high); if ( alignPoints ) { @@ -755,7 +887,7 @@ -(void)drawRangeInContext:(CGContextRef)context } // centre-low - if ( !isnan(viewPoint->low) ) { + if ( !isnan(viewPoint->low)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->x, viewPoint->y - halfGapSize.height); CGPoint alignedLowPoint = CPTPointMake(viewPoint->x, viewPoint->low); if ( alignPoints ) { @@ -767,7 +899,7 @@ -(void)drawRangeInContext:(CGContextRef)context } // top bar - if ( !isnan(viewPoint->high) ) { + if ( !isnan(viewPoint->high)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->x - halfBarWidth, viewPoint->high); CGPoint alignedLowPoint = CPTPointMake(viewPoint->x + halfBarWidth, viewPoint->high); if ( alignPoints ) { @@ -779,7 +911,7 @@ -(void)drawRangeInContext:(CGContextRef)context } // bottom bar - if ( !isnan(viewPoint->low) ) { + if ( !isnan(viewPoint->low)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->x - halfBarWidth, viewPoint->low); CGPoint alignedLowPoint = CPTPointMake(viewPoint->x + halfBarWidth, viewPoint->low); if ( alignPoints ) { @@ -791,7 +923,7 @@ -(void)drawRangeInContext:(CGContextRef)context } // centre-left - if ( !isnan(viewPoint->left) ) { + if ( !isnan(viewPoint->left)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->x - halfGapSize.width, viewPoint->y); CGPoint alignedLowPoint = CPTPointMake(viewPoint->left, viewPoint->y); if ( alignPoints ) { @@ -803,7 +935,7 @@ -(void)drawRangeInContext:(CGContextRef)context } // centre-right - if ( !isnan(viewPoint->right) ) { + if ( !isnan(viewPoint->right)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->x + halfGapSize.width, viewPoint->y); CGPoint alignedLowPoint = CPTPointMake(viewPoint->right, viewPoint->y); if ( alignPoints ) { @@ -815,7 +947,7 @@ -(void)drawRangeInContext:(CGContextRef)context } // left bar - if ( !isnan(viewPoint->left) ) { + if ( !isnan(viewPoint->left)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->left, viewPoint->y - halfBarWidth); CGPoint alignedLowPoint = CPTPointMake(viewPoint->left, viewPoint->y + halfBarWidth); if ( alignPoints ) { @@ -827,7 +959,7 @@ -(void)drawRangeInContext:(CGContextRef)context } // right bar - if ( !isnan(viewPoint->right) ) { + if ( !isnan(viewPoint->right)) { CGPoint alignedHighPoint = CPTPointMake(viewPoint->right, viewPoint->y - halfBarWidth); CGPoint alignedLowPoint = CPTPointMake(viewPoint->right, viewPoint->y + halfBarWidth); if ( alignPoints ) { @@ -846,7 +978,7 @@ -(void)drawRangeInContext:(CGContextRef)context } } --(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(CGContextRef)context +-(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(nonnull CGContextRef)context { [super drawSwatchForLegend:legend atIndex:idx inRect:rect inContext:context]; @@ -881,24 +1013,35 @@ -(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(C [self drawRangeInContext:context lineStyle:theBarLineStyle viewPoint:&viewPoint - halfGapSize:CPTSizeMake( MIN( self.gapWidth, rect.size.width / CPTFloat(2.0) ) * CPTFloat(0.5), MIN( self.gapHeight, rect.size.height / CPTFloat(2.0) ) * CPTFloat(0.5) ) + halfGapSize:CPTSizeMake(MIN(self.gapWidth, rect.size.width / CPTFloat(2.0)) * CPTFloat(0.5), MIN(self.gapHeight, rect.size.height / CPTFloat(2.0)) * CPTFloat(0.5)) halfBarWidth:MIN(MIN(self.barWidth, rect.size.width), rect.size.height) * CPTFloat(0.5) alignPoints:YES]; } } } --(CPTLineStyle *)barLineStyleForIndex:(NSUInteger)idx +-(nullable CPTLineStyle *)barLineStyleForIndex:(NSUInteger)idx { CPTLineStyle *theBarLineStyle = [self cachedValueForKey:CPTRangePlotBindingBarLineStyles recordIndex:idx]; - if ( (theBarLineStyle == nil) || (theBarLineStyle == [CPTPlot nilData]) ) { + if ((theBarLineStyle == nil) || (theBarLineStyle == [CPTPlot nilData])) { theBarLineStyle = self.barLineStyle; } return theBarLineStyle; } +-(nonnull NSNumber *)barWidthForIndex:(NSUInteger)idx +{ + NSNumber *theBarWidth = [self cachedValueForKey:CPTRangePlotBindingBarWidths recordIndex:idx]; + + if ((theBarWidth == nil) || (theBarWidth == [CPTPlot nilData])) { + theBarWidth = @(self.barWidth); + } + + return theBarWidth; +} + /// @endcond #pragma mark - @@ -906,9 +1049,9 @@ -(CPTLineStyle *)barLineStyleForIndex:(NSUInteger)idx /// @cond -+(BOOL)needsDisplayForKey:(NSString *)aKey ++(BOOL)needsDisplayForKey:(nonnull NSString *)aKey { - static NSSet *keys = nil; + static NSSet *keys = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ @@ -937,7 +1080,7 @@ -(NSUInteger)numberOfFields return 6; } --(NSArray *)fieldIdentifiers +-(nonnull CPTNumberArray *)fieldIdentifiers { return @[@(CPTRangePlotFieldX), @(CPTRangePlotFieldY), @@ -947,18 +1090,18 @@ -(NSArray *)fieldIdentifiers @(CPTRangePlotFieldRight)]; } --(NSArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord +-(nonnull CPTNumberArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord { - NSArray *result = nil; + CPTNumberArray *result = nil; switch ( coord ) { case CPTCoordinateX: result = @[@(CPTRangePlotFieldX)]; - break; + break; case CPTCoordinateY: result = @[@(CPTRangePlotFieldY)]; - break; + break; default: [NSException raise:CPTException format:@"Invalid coordinate passed to fieldIdentifiersForCoordinate:"]; @@ -998,27 +1141,18 @@ -(CPTCoordinate)coordinateForFieldIdentifier:(NSUInteger)field /// @cond --(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx +-(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx { NSNumber *xValue = [self cachedNumberForField:CPTRangePlotFieldX recordIndex:idx]; + NSNumber *yValue = [self cachedNumberForField:CPTRangePlotFieldY recordIndex:idx]; BOOL positiveDirection = YES; CPTPlotRange *yRange = [self.plotSpace plotRangeForCoordinate:CPTCoordinateY]; - if ( CPTDecimalLessThan( yRange.length, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalLessThan(yRange.lengthDecimal, CPTDecimalFromInteger(0))) { positiveDirection = !positiveDirection; } - NSNumber *yValue; - NSArray *yValues = @[[self cachedNumberForField:CPTRangePlotFieldY recordIndex:idx]]; - NSArray *yValuesSorted = [yValues sortedArrayUsingSelector:@selector(compare:)]; - if ( positiveDirection ) { - yValue = [yValuesSorted lastObject]; - } - else { - yValue = yValuesSorted[0]; - } - label.anchorPlotPoint = @[xValue, yValue]; label.contentLayer.hidden = self.hidden || isnan([xValue doubleValue]) || isnan([yValue doubleValue]); @@ -1040,22 +1174,22 @@ -(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInte -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point { NSUInteger dataCount = self.cachedDataCount; - CGPointError *viewPoints = calloc( dataCount, sizeof(CGPointError) ); - BOOL *drawPointFlags = malloc( dataCount * sizeof(BOOL) ); + CGPointError *viewPoints = calloc(dataCount, sizeof(CGPointError)); + BOOL *drawPointFlags = calloc(dataCount, sizeof(BOOL)); - [self calculatePointsToDraw:drawPointFlags numberOfPoints:dataCount forPlotSpace:(id)self.plotSpace includeVisiblePointsOnly:YES]; + [self calculatePointsToDraw:drawPointFlags numberOfPoints:dataCount forPlotSpace:(CPTXYPlotSpace *)self.plotSpace]; [self calculateViewPoints:viewPoints withDrawPointFlags:drawPointFlags numberOfPoints:dataCount]; NSInteger result = [self extremeDrawnPointIndexForFlags:drawPointFlags numberOfPoints:dataCount extremeNumIsLowerBound:YES]; if ( result != NSNotFound ) { CGPointError lastViewPoint; - CGFloat minimumDistanceSquared = NAN; + CGFloat minimumDistanceSquared = CPTNAN; for ( NSUInteger i = (NSUInteger)result; i < dataCount; ++i ) { if ( drawPointFlags[i] ) { lastViewPoint = viewPoints[i]; CGPoint lastPoint = CPTPointMake(lastViewPoint.x, lastViewPoint.y); CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, lastPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = (NSInteger)i; } @@ -1064,16 +1198,16 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( result != NSNotFound ) { lastViewPoint = viewPoints[result]; - if ( !isnan(lastViewPoint.left) && (point.x < lastViewPoint.left) ) { + if ( !isnan(lastViewPoint.left) && (point.x < lastViewPoint.left)) { result = NSNotFound; } - if ( !isnan(lastViewPoint.right) && (point.x > lastViewPoint.right) ) { + if ( !isnan(lastViewPoint.right) && (point.x > lastViewPoint.right)) { result = NSNotFound; } - if ( !isnan(lastViewPoint.high) && (point.y > lastViewPoint.high) ) { + if ( !isnan(lastViewPoint.high) && (point.y > lastViewPoint.high)) { result = NSNotFound; } - if ( !isnan(lastViewPoint.low) && (point.y < lastViewPoint.low) ) { + if ( !isnan(lastViewPoint.low) && (point.y < lastViewPoint.low)) { result = NSNotFound; } } @@ -1108,7 +1242,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { CPTGraph *theGraph = self.graph; CPTPlotArea *thePlotArea = self.plotArea; @@ -1117,7 +1251,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(rangePlot:rangeTouchDownAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(rangePlot:rangeTouchDownAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(rangePlot:rangeWasSelectedAtRecordIndex:)] || @@ -1173,7 +1307,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { NSUInteger selectedDownIndex = self.pointingDeviceDownIndex; @@ -1186,7 +1320,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(rangePlot:rangeTouchUpAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(rangePlot:rangeTouchUpAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(rangePlot:rangeWasSelectedAtRecordIndex:)] || @@ -1236,7 +1370,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio /// @cond --(void)setBarLineStyle:(CPTLineStyle *)newLineStyle +-(void)setBarLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( barLineStyle != newLineStyle ) { barLineStyle = [newLineStyle copy]; @@ -1245,7 +1379,7 @@ -(void)setBarLineStyle:(CPTLineStyle *)newLineStyle } } --(void)setAreaFill:(CPTFill *)newFill +-(void)setAreaFill:(nullable CPTFill *)newFill { if ( newFill != areaFill ) { areaFill = [newFill copy]; @@ -1254,7 +1388,7 @@ -(void)setAreaFill:(CPTFill *)newFill } } --(void)setAreaBorderLineStyle:(CPTLineStyle *)newLineStyle +-(void)setAreaBorderLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( areaBorderLineStyle != newLineStyle ) { areaBorderLineStyle = [newLineStyle copy]; @@ -1287,72 +1421,72 @@ -(void)setGapWidth:(CGFloat)newGapWidth } } --(void)setXValues:(NSArray *)newValues +-(void)setXValues:(nullable CPTNumberArray *)newValues { [self cacheNumbers:newValues forField:CPTRangePlotFieldX]; } --(NSArray *)xValues +-(nullable CPTNumberArray *)xValues { return [[self cachedNumbersForField:CPTRangePlotFieldX] sampleArray]; } --(void)setYValues:(NSArray *)newValues +-(void)setYValues:(nullable CPTNumberArray *)newValues { [self cacheNumbers:newValues forField:CPTRangePlotFieldY]; } --(NSArray *)yValues +-(nullable CPTNumberArray *)yValues { return [[self cachedNumbersForField:CPTRangePlotFieldY] sampleArray]; } --(CPTMutableNumericData *)highValues +-(nullable CPTMutableNumericData *)highValues { return [self cachedNumbersForField:CPTRangePlotFieldHigh]; } --(void)setHighValues:(CPTMutableNumericData *)newValues +-(void)setHighValues:(nullable CPTMutableNumericData *)newValues { [self cacheNumbers:newValues forField:CPTRangePlotFieldHigh]; } --(CPTMutableNumericData *)lowValues +-(nullable CPTMutableNumericData *)lowValues { return [self cachedNumbersForField:CPTRangePlotFieldLow]; } --(void)setLowValues:(CPTMutableNumericData *)newValues +-(void)setLowValues:(nullable CPTMutableNumericData *)newValues { [self cacheNumbers:newValues forField:CPTRangePlotFieldLow]; } --(CPTMutableNumericData *)leftValues +-(nullable CPTMutableNumericData *)leftValues { return [self cachedNumbersForField:CPTRangePlotFieldLeft]; } --(void)setLeftValues:(CPTMutableNumericData *)newValues +-(void)setLeftValues:(nullable CPTMutableNumericData *)newValues { [self cacheNumbers:newValues forField:CPTRangePlotFieldLeft]; } --(CPTMutableNumericData *)rightValues +-(nullable CPTMutableNumericData *)rightValues { return [self cachedNumbersForField:CPTRangePlotFieldRight]; } --(void)setRightValues:(CPTMutableNumericData *)newValues +-(void)setRightValues:(nullable CPTMutableNumericData *)newValues { [self cacheNumbers:newValues forField:CPTRangePlotFieldRight]; } --(NSArray *)barLineStyles +-(nullable CPTLineStyleArray *)barLineStyles { return [self cachedArrayForKey:CPTRangePlotBindingBarLineStyles]; } --(void)setBarLineStyles:(NSArray *)newLineStyles +-(void)setBarLineStyles:(nullable CPTLineStyleArray *)newLineStyles { [self cacheArray:newLineStyles forKey:CPTRangePlotBindingBarLineStyles]; [self setNeedsDisplay]; diff --git a/framework/Source/CPTResponder.h b/framework/Source/CPTResponder.h index bfeac073f..6b56832ff 100644 --- a/framework/Source/CPTResponder.h +++ b/framework/Source/CPTResponder.h @@ -16,7 +16,7 @@ * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint; +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint; /** * @brief @required Informs the receiver that the user has @@ -26,7 +26,7 @@ * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint; +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint; /** * @brief @required Informs the receiver that the user has moved @@ -36,7 +36,7 @@ * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint; +-(BOOL)pointingDeviceDraggedEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint; /** * @brief @required Informs the receiver that tracking of @@ -46,9 +46,9 @@ * @param event The OS event. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceCancelledEvent:(CPTNativeEvent *)event; +-(BOOL)pointingDeviceCancelledEvent:(nonnull CPTNativeEvent *)event; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else /** @@ -58,7 +58,7 @@ * @param toPoint The ending coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)scrollWheelEvent:(CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint; +-(BOOL)scrollWheelEvent:(nonnull CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint; #endif /// @} diff --git a/framework/Source/CPTScatterPlot.h b/framework/Source/CPTScatterPlot.h index 8471b4011..8cd3b9a7d 100644 --- a/framework/Source/CPTScatterPlot.h +++ b/framework/Source/CPTScatterPlot.h @@ -1,19 +1,24 @@ #import "CPTDefinitions.h" +#import "CPTLimitBand.h" #import "CPTPlot.h" +#import "CPTPlotSymbol.h" /// @file -@class CPTLimitBand; @class CPTLineStyle; -@class CPTPlotSymbol; @class CPTScatterPlot; @class CPTFill; +/** + * @brief Scatter plot bindings. + **/ +typedef NSString *CPTScatterPlotBinding cpt_swift_struct; + /// @ingroup plotBindingsScatterPlot /// @{ -extern NSString *const CPTScatterPlotBindingXValues; -extern NSString *const CPTScatterPlotBindingYValues; -extern NSString *const CPTScatterPlotBindingPlotSymbols; +extern CPTScatterPlotBinding __nonnull const CPTScatterPlotBindingXValues; +extern CPTScatterPlotBinding __nonnull const CPTScatterPlotBindingYValues; +extern CPTScatterPlotBinding __nonnull const CPTScatterPlotBindingPlotSymbols; /// @} /** @@ -31,7 +36,29 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { CPTScatterPlotInterpolationLinear, ///< Linear interpolation. CPTScatterPlotInterpolationStepped, ///< Steps beginning at data point. CPTScatterPlotInterpolationHistogram, ///< Steps centered at data point. - CPTScatterPlotInterpolationCurved ///< Bezier curve interpolation. + CPTScatterPlotInterpolationCurved ///< Curved interpolation. +}; + +/** + * @brief Enumration of scatter plot curved interpolation style options + **/ +typedef NS_ENUM (NSInteger, CPTScatterPlotCurvedInterpolationOption) { + CPTScatterPlotCurvedInterpolationNormal, ///< Standard Curved Interpolation (Bezier Curve) + CPTScatterPlotCurvedInterpolationCatmullRomUniform, ///< Catmull-Rom Spline Interpolation with alpha = @num{0.0}. + CPTScatterPlotCurvedInterpolationCatmullRomCentripetal, ///< Catmull-Rom Spline Interpolation with alpha = @num{0.5}. + CPTScatterPlotCurvedInterpolationCatmullRomChordal, ///< Catmull-Rom Spline Interpolation with alpha = @num{1.0}. + CPTScatterPlotCurvedInterpolationCatmullCustomAlpha, ///< Catmull-Rom Spline Interpolation with a custom alpha value. + CPTScatterPlotCurvedInterpolationHermiteCubic ///< Hermite Cubic Spline Interpolation +}; + +/** + * @brief Enumeration of scatter plot histogram style options + **/ +typedef NS_ENUM (NSInteger, CPTScatterPlotHistogramOption) { + CPTScatterPlotHistogramNormal, ///< Standard histogram. + CPTScatterPlotHistogramSkipFirst, ///< Skip the first step of the histogram. + CPTScatterPlotHistogramSkipSecond, ///< Skip the second step of the histogram. + CPTScatterPlotHistogramOptionCount ///< The number of histogram options available. }; #pragma mark - @@ -51,7 +78,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * @param indexRange The range of the data indexes of interest. * @return An array of plot symbols. **/ --(NSArray *)symbolsForScatterPlot:(CPTScatterPlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTPlotSymbolArray *)symbolsForScatterPlot:(nonnull CPTScatterPlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets a single plot symbol for the given scatter plot. * This method will not be called if @@ -61,7 +88,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * @param idx The data index of interest. * @return The plot symbol to show for the point with the given index. **/ --(CPTPlotSymbol *)symbolForScatterPlot:(CPTScatterPlot *)plot recordIndex:(NSUInteger)idx; +-(nullable CPTPlotSymbol *)symbolForScatterPlot:(nonnull CPTScatterPlot *)plot recordIndex:(NSUInteger)idx; /// @} @@ -87,7 +114,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * @if MacOnly clicked data point. @endif * @if iOSOnly touched data point. @endif **/ --(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)idx; +-(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a data point * @if MacOnly was both pressed and released. @endif @@ -98,7 +125,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * @if iOSOnly touched data point. @endif * @param event The event that triggered the selection. **/ --(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a data point * @if MacOnly was pressed. @endif @@ -108,7 +135,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * @if MacOnly clicked data point. @endif * @if iOSOnly touched data point. @endif **/ --(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolTouchDownAtRecordIndex:(NSUInteger)idx; +-(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolTouchDownAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a data point * @if MacOnly was pressed. @endif @@ -119,7 +146,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * @if iOSOnly touched data point. @endif * @param event The event that triggered the selection. **/ --(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolTouchDownAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolTouchDownAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a data point * @if MacOnly was released. @endif @@ -129,7 +156,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * @if MacOnly clicked data point. @endif * @if iOSOnly touched data point. @endif **/ --(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolTouchUpAtRecordIndex:(NSUInteger)idx; +-(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolTouchUpAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a data point * @if MacOnly was released. @endif @@ -140,7 +167,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * @if iOSOnly touched data point. @endif * @param event The event that triggered the selection. **/ --(void)scatterPlot:(CPTScatterPlot *)plot plotSymbolTouchUpAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)scatterPlot:(nonnull CPTScatterPlot *)plot plotSymbolTouchUpAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /// @} @@ -152,7 +179,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * @if iOSOnly the plot line received both the touch down and up events. @endif * @param plot The scatter plot. **/ --(void)scatterPlotDataLineWasSelected:(CPTScatterPlot *)plot; +-(void)scatterPlotDataLineWasSelected:(nonnull CPTScatterPlot *)plot; /** @brief @optional Informs the delegate that * @if MacOnly the mouse was both pressed and released on the plot line.@endif @@ -160,7 +187,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * @param plot The scatter plot. * @param event The event that triggered the selection. **/ --(void)scatterPlot:(CPTScatterPlot *)plot dataLineWasSelectedWithEvent:(CPTNativeEvent *)event; +-(void)scatterPlot:(nonnull CPTScatterPlot *)plot dataLineWasSelectedWithEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that * @if MacOnly the mouse was pressed @endif @@ -168,7 +195,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * while over the plot line. * @param plot The scatter plot. **/ --(void)scatterPlotDataLineTouchDown:(CPTScatterPlot *)plot; +-(void)scatterPlotDataLineTouchDown:(nonnull CPTScatterPlot *)plot; /** @brief @optional Informs the delegate that * @if MacOnly the mouse was pressed @endif @@ -177,7 +204,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * @param plot The scatter plot. * @param event The event that triggered the selection. **/ --(void)scatterPlot:(CPTScatterPlot *)plot dataLineTouchDownWithEvent:(CPTNativeEvent *)event; +-(void)scatterPlot:(nonnull CPTScatterPlot *)plot dataLineTouchDownWithEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that * @if MacOnly the mouse was released @endif @@ -185,7 +212,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * while over the plot line. * @param plot The scatter plot. **/ --(void)scatterPlotDataLineTouchUp:(CPTScatterPlot *)plot; +-(void)scatterPlotDataLineTouchUp:(nonnull CPTScatterPlot *)plot; /** @brief @optional Informs the delegate that * @if MacOnly the mouse was released @endif @@ -194,7 +221,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * @param plot The scatter plot. * @param event The event that triggered the selection. **/ --(void)scatterPlot:(CPTScatterPlot *)plot dataLineTouchUpWithEvent:(CPTNativeEvent *)event; +-(void)scatterPlot:(nonnull CPTScatterPlot *)plot dataLineTouchUpWithEvent:(nonnull CPTNativeEvent *)event; /// @} @@ -208,7 +235,7 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { * @param dataLinePath The CGPath describing the plot line that is about to be drawn. * @param context The graphics context in which the plot line will be drawn. **/ --(void)scatterPlot:(CPTScatterPlot *)plot prepareForDrawingPlotLine:(CGPathRef)dataLinePath inContext:(CGContextRef)context; +-(void)scatterPlot:(nonnull CPTScatterPlot *)plot prepareForDrawingPlotLine:(nonnull CGPathRef)dataLinePath inContext:(nonnull CGContextRef)context; /// @} @@ -220,27 +247,30 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { /// @name Appearance /// @{ -@property (nonatomic, readwrite) NSDecimal areaBaseValue; -@property (nonatomic, readwrite) NSDecimal areaBaseValue2; +@property (nonatomic, readwrite, strong, nullable) NSNumber *areaBaseValue; +@property (nonatomic, readwrite, strong, nullable) NSNumber *areaBaseValue2; @property (nonatomic, readwrite, assign) CPTScatterPlotInterpolation interpolation; +@property (nonatomic, readwrite, assign) CPTScatterPlotHistogramOption histogramOption; +@property (nonatomic, readwrite, assign) CPTScatterPlotCurvedInterpolationOption curvedInterpolationOption; +@property (nonatomic, readwrite, assign) CGFloat curvedInterpolationCustomAlpha; /// @} /// @name Area Fill Bands /// @{ -@property (nonatomic, readonly) NSArray *areaFillBands; +@property (nonatomic, readonly, nullable) CPTLimitBandArray *areaFillBands; /// @} /// @name Drawing /// @{ -@property (nonatomic, readwrite, copy) CPTLineStyle *dataLineStyle; -@property (nonatomic, readwrite, copy) CPTPlotSymbol *plotSymbol; -@property (nonatomic, readwrite, copy) CPTFill *areaFill; -@property (nonatomic, readwrite, copy) CPTFill *areaFill2; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *dataLineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTPlotSymbol *plotSymbol; +@property (nonatomic, readwrite, copy, nullable) CPTFill *areaFill; +@property (nonatomic, readwrite, copy, nullable) CPTFill *areaFill2; /// @} /// @name Data Line /// @{ -@property (nonatomic, readonly) CGPathRef newDataLinePath; +@property (nonatomic, readonly, nonnull) CGPathRef newDataLinePath; /// @} /// @name User Interaction @@ -258,15 +288,15 @@ typedef NS_ENUM (NSInteger, CPTScatterPlotInterpolation) { /// @name Plot Symbols /// @{ --(CPTPlotSymbol *)plotSymbolForRecordIndex:(NSUInteger)idx; +-(nullable CPTPlotSymbol *)plotSymbolForRecordIndex:(NSUInteger)idx; -(void)reloadPlotSymbols; -(void)reloadPlotSymbolsInIndexRange:(NSRange)indexRange; /// @} /// @name Area Fill Bands /// @{ --(void)addAreaFillBand:(CPTLimitBand *)limitBand; --(void)removeAreaFillBand:(CPTLimitBand *)limitBand; +-(void)addAreaFillBand:(nullable CPTLimitBand *)limitBand; +-(void)removeAreaFillBand:(nullable CPTLimitBand *)limitBand; /// @} @end diff --git a/framework/Source/CPTScatterPlot.m b/framework/Source/CPTScatterPlot.m index e732c3616..d8417fc1f 100644 --- a/framework/Source/CPTScatterPlot.m +++ b/framework/Source/CPTScatterPlot.m @@ -3,7 +3,6 @@ #import "CPTExceptions.h" #import "CPTFill.h" #import "CPTLegend.h" -#import "CPTLimitBand.h" #import "CPTLineStyle.h" #import "CPTMutableNumericData.h" #import "CPTPathExtensions.h" @@ -11,7 +10,6 @@ #import "CPTPlotRange.h" #import "CPTPlotSpace.h" #import "CPTPlotSpaceAnnotation.h" -#import "CPTPlotSymbol.h" #import "CPTUtilities.h" #import "CPTXYPlotSpace.h" #import "NSCoderExtensions.h" @@ -29,29 +27,32 @@ * @endif **/ -NSString *const CPTScatterPlotBindingXValues = @"xValues"; ///< X values. -NSString *const CPTScatterPlotBindingYValues = @"yValues"; ///< Y values. -NSString *const CPTScatterPlotBindingPlotSymbols = @"plotSymbols"; ///< Plot symbols. +CPTScatterPlotBinding const CPTScatterPlotBindingXValues = @"xValues"; ///< X values. +CPTScatterPlotBinding const CPTScatterPlotBindingYValues = @"yValues"; ///< Y values. +CPTScatterPlotBinding const CPTScatterPlotBindingPlotSymbols = @"plotSymbols"; ///< Plot symbols. /// @cond @interface CPTScatterPlot() -@property (nonatomic, readwrite, copy) NSArray *xValues; -@property (nonatomic, readwrite, copy) NSArray *yValues; -@property (nonatomic, readwrite, strong) NSArray *plotSymbols; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *xValues; +@property (nonatomic, readwrite, copy, nullable) CPTNumberArray *yValues; +@property (nonatomic, readwrite, strong, nullable) CPTPlotSymbolArray *plotSymbols; @property (nonatomic, readwrite, assign) NSUInteger pointingDeviceDownIndex; @property (nonatomic, readwrite, assign) BOOL pointingDeviceDownOnLine; -@property (nonatomic, readwrite, strong) NSMutableArray *mutableAreaFillBands; +@property (nonatomic, readwrite, strong) CPTMutableLimitBandArray *mutableAreaFillBands; --(void)calculatePointsToDraw:(BOOL *)pointDrawFlags forPlotSpace:(CPTXYPlotSpace *)xyPlotSpace includeVisiblePointsOnly:(BOOL)visibleOnly numberOfPoints:(NSUInteger)dataCount; --(void)calculateViewPoints:(CGPoint *)viewPoints withDrawPointFlags:(BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount; --(void)alignViewPointsToUserSpace:(CGPoint *)viewPoints withContent:(CGContextRef)context drawPointFlags:(BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount; +-(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags forPlotSpace:(nonnull CPTXYPlotSpace *)xyPlotSpace includeVisiblePointsOnly:(BOOL)visibleOnly numberOfPoints:(NSUInteger)dataCount; +-(void)calculateViewPoints:(nonnull CGPoint *)viewPoints withDrawPointFlags:(nonnull BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount; +-(void)alignViewPointsToUserSpace:(nonnull CGPoint *)viewPoints withContext:(nonnull CGContextRef)context drawPointFlags:(nonnull BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount; --(NSInteger)extremeDrawnPointIndexForFlags:(BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount extremeNumIsLowerBound:(BOOL)isLowerBound; +-(NSInteger)extremeDrawnPointIndexForFlags:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount extremeNumIsLowerBound:(BOOL)isLowerBound; --(CGPathRef)newDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange:(NSRange)indexRange baselineYValue:(CGFloat)baselineYValue; --(CGPathRef)newCurvedDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange:(NSRange)indexRange baselineYValue:(CGFloat)baselineYValue; --(void)computeControlPoints:(CGPoint *)cp1 points2:(CGPoint *)cp2 forViewPoints:(CGPoint *)viewPoints indexRange:(NSRange)indexRange; +-(nonnull CGPathRef)newDataLinePathForViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange baselineYValue:(CGFloat)baselineYValue; +-(nonnull CGPathRef)newCurvedDataLinePathForViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange baselineYValue:(CGFloat)baselineYValue; +-(void)computeBezierControlPoints:(nonnull CGPoint *)cp1 points2:(nonnull CGPoint *)cp2 forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange; +-(void)computeCatmullRomControlPoints:(nonnull CGPoint *)points points2:(nonnull CGPoint *)points2 withAlpha:(CGFloat)alpha forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange; +-(void)computeHermiteControlPoints:(nonnull CGPoint *)points points2:(nonnull CGPoint *)points2 forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange; +-(BOOL)monotonicViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange; @end @@ -74,47 +75,70 @@ @implementation CPTScatterPlot /** @property CPTScatterPlotInterpolation interpolation * @brief The interpolation algorithm used for lines between data points. - * Default is #CPTScatterPlotInterpolationLinear + * Default is #CPTScatterPlotInterpolationLinear. **/ @synthesize interpolation; -/** @property CPTLineStyle *dataLineStyle +/** @property CPTScatterPlotHistogramOption histogramOption + * @brief The drawing style for a histogram plot line (@ref interpolation = #CPTScatterPlotInterpolationHistogram). + * Default is #CPTScatterPlotHistogramNormal. + **/ +@synthesize histogramOption; + +/** @property CPTScatterPlotCurvedInterpolationOption curvedInterpolationOption + * @brief The interpolation method used to generate the curved plot line (@ref interpolation = #CPTScatterPlotInterpolationCurved) + * Default is #CPTScatterPlotCurvedInterpolationNormal + **/ +@synthesize curvedInterpolationOption; + +/** @property CGFloat curvedInterpolationCustomAlpha + * @brief The custom alpha value used when the #CPTScatterPlotCurvedInterpolationCatmullCustomAlpha interpolation is selected. + * Default is @num{0.5}. + * @note Must be between @num{0.0} and @num{1.0}. + **/ +@synthesize curvedInterpolationCustomAlpha; + +/** @property nullable CPTLineStyle *dataLineStyle * @brief The line style for the data line. * If @nil, the line is not drawn. **/ @synthesize dataLineStyle; -/** @property CPTPlotSymbol *plotSymbol +/** @property nullable CPTPlotSymbol *plotSymbol * @brief The plot symbol drawn at each point if the data source does not provide symbols. * If @nil, no symbol is drawn. **/ @synthesize plotSymbol; -/** @property CPTFill *areaFill +/** @property nullable CPTFill *areaFill * @brief The fill style for the area underneath the data line. * If @nil, the area is not filled. **/ @synthesize areaFill; -/** @property CPTFill *areaFill2 +/** @property nullable CPTFill *areaFill2 * @brief The fill style for the area above the data line. * If @nil, the area is not filled. **/ @synthesize areaFill2; -/** @property NSDecimal areaBaseValue +/** @property nullable NSNumber *areaBaseValue * @brief The Y coordinate of the straight boundary of the area fill. * If not a number, the area is not filled. * * Typically set to the minimum value of the Y range, but it can be any value that gives the desired appearance. + * + * @ingroup plotBindingsScatterPlot **/ @synthesize areaBaseValue; -/** @property NSDecimal areaBaseValue2 +/** @property nullable NSNumber *areaBaseValue2 * @brief The Y coordinate of the straight boundary of the secondary area fill. * If not a number, the area is not filled. * * Typically set to the maximum value of the Y range, but it can be any value that gives the desired appearance. + * + * @ingroup plotBindingsScatterPlot **/ @synthesize areaBaseValue2; @@ -125,7 +149,7 @@ @implementation CPTScatterPlot **/ @synthesize plotSymbolMarginForHitDetection; -/** @property CGPathRef newDataLinePath +/** @property nonnull CGPathRef newDataLinePath * @brief The path used to draw the data line. The caller must release the returned path. **/ @dynamic newDataLinePath; @@ -158,7 +182,7 @@ @implementation CPTScatterPlot **/ @synthesize pointingDeviceDownOnLine; -/** @property NSArray *areaFillBands +/** @property nullable CPTLimitBandArray *areaFillBands * @brief An array of CPTLimitBand objects. * * The limit bands are drawn between the plot line and areaBaseValue and on top of the areaFill. @@ -172,7 +196,7 @@ @implementation CPTScatterPlot /// @cond -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else +(void)initialize { @@ -182,6 +206,7 @@ +(void)initialize [self exposeBinding:CPTScatterPlotBindingPlotSymbols]; } } + #endif /// @endcond @@ -202,23 +227,29 @@ +(void)initialize * - @ref plotLineMarginForHitDetection = @num{4.0} * - @ref allowSimultaneousSymbolAndPlotSelection = NO * - @ref interpolation = #CPTScatterPlotInterpolationLinear + * - @ref histogramOption = #CPTScatterPlotHistogramNormal + * - @ref curvedInterpolationOption = #CPTScatterPlotCurvedInterpolationNormal + * - @ref curvedInterpolationCustomAlpha = @num{0.5} * - @ref labelField = #CPTScatterPlotFieldY * * @param newFrame The frame rectangle. * @return The initialized CPTScatterPlot object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { dataLineStyle = [[CPTLineStyle alloc] init]; plotSymbol = nil; areaFill = nil; areaFill2 = nil; - areaBaseValue = [[NSDecimalNumber notANumber] decimalValue]; - areaBaseValue2 = [[NSDecimalNumber notANumber] decimalValue]; + areaBaseValue = @(NAN); + areaBaseValue2 = @(NAN); plotSymbolMarginForHitDetection = CPTFloat(0.0); plotLineMarginForHitDetection = CPTFloat(4.0); interpolation = CPTScatterPlotInterpolationLinear; + histogramOption = CPTScatterPlotHistogramNormal; + curvedInterpolationOption = CPTScatterPlotCurvedInterpolationNormal; + curvedInterpolationCustomAlpha = CPTFloat(0.5); pointingDeviceDownIndex = NSNotFound; pointingDeviceDownOnLine = NO; mutableAreaFillBands = nil; @@ -231,9 +262,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTScatterPlot *theLayer = (CPTScatterPlot *)layer; dataLineStyle = theLayer->dataLineStyle; @@ -246,6 +277,9 @@ -(instancetype)initWithLayer:(id)layer plotLineMarginForHitDetection = theLayer->plotLineMarginForHitDetection; allowSimultaneousSymbolAndPlotSelection = theLayer->allowSimultaneousSymbolAndPlotSelection; interpolation = theLayer->interpolation; + histogramOption = theLayer->histogramOption; + curvedInterpolationOption = theLayer->curvedInterpolationOption; + curvedInterpolationCustomAlpha = theLayer->curvedInterpolationCustomAlpha; mutableAreaFillBands = theLayer->mutableAreaFillBands; pointingDeviceDownIndex = NSNotFound; pointingDeviceDownOnLine = NO; @@ -260,18 +294,21 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; [coder encodeInteger:self.interpolation forKey:@"CPTScatterPlot.interpolation"]; + [coder encodeInteger:self.histogramOption forKey:@"CPTScatterPlot.histogramOption"]; + [coder encodeInteger:self.curvedInterpolationOption forKey:@"CPTScatterPlot.curvedInterpolationOption"]; + [coder encodeCGFloat:self.curvedInterpolationCustomAlpha forKey:@"CPTScatterPlot.curvedInterpolationCustomAlpha"]; [coder encodeObject:self.dataLineStyle forKey:@"CPTScatterPlot.dataLineStyle"]; [coder encodeObject:self.plotSymbol forKey:@"CPTScatterPlot.plotSymbol"]; [coder encodeObject:self.areaFill forKey:@"CPTScatterPlot.areaFill"]; [coder encodeObject:self.areaFill2 forKey:@"CPTScatterPlot.areaFill2"]; [coder encodeObject:self.mutableAreaFillBands forKey:@"CPTScatterPlot.mutableAreaFillBands"]; - [coder encodeDecimal:self.areaBaseValue forKey:@"CPTScatterPlot.areaBaseValue"]; - [coder encodeDecimal:self.areaBaseValue2 forKey:@"CPTScatterPlot.areaBaseValue2"]; + [coder encodeObject:self.areaBaseValue forKey:@"CPTScatterPlot.areaBaseValue"]; + [coder encodeObject:self.areaBaseValue2 forKey:@"CPTScatterPlot.areaBaseValue2"]; [coder encodeCGFloat:self.plotSymbolMarginForHitDetection forKey:@"CPTScatterPlot.plotSymbolMarginForHitDetection"]; [coder encodeCGFloat:self.plotLineMarginForHitDetection forKey:@"CPTScatterPlot.plotLineMarginForHitDetection"]; [coder encodeBool:self.allowSimultaneousSymbolAndPlotSelection forKey:@"CPTScatterPlot.allowSimultaneousSymbolAndPlotSelection"]; @@ -281,17 +318,27 @@ -(void)encodeWithCoder:(NSCoder *)coder // pointingDeviceDownOnLine } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - interpolation = (CPTScatterPlotInterpolation)[coder decodeIntegerForKey : @"CPTScatterPlot.interpolation"]; - dataLineStyle = [[coder decodeObjectForKey:@"CPTScatterPlot.dataLineStyle"] copy]; - plotSymbol = [[coder decodeObjectForKey:@"CPTScatterPlot.plotSymbol"] copy]; - areaFill = [[coder decodeObjectForKey:@"CPTScatterPlot.areaFill"] copy]; - areaFill2 = [[coder decodeObjectForKey:@"CPTScatterPlot.areaFill2"] copy]; - mutableAreaFillBands = [[coder decodeObjectForKey:@"CPTScatterPlot.mutableAreaFillBands"] mutableCopy]; - areaBaseValue = [coder decodeDecimalForKey:@"CPTScatterPlot.areaBaseValue"]; - areaBaseValue2 = [coder decodeDecimalForKey:@"CPTScatterPlot.areaBaseValue2"]; + if ((self = [super initWithCoder:coder])) { + interpolation = (CPTScatterPlotInterpolation)[coder decodeIntegerForKey:@"CPTScatterPlot.interpolation"]; + histogramOption = (CPTScatterPlotHistogramOption)[coder decodeIntegerForKey:@"CPTScatterPlot.histogramOption"]; + curvedInterpolationOption = (CPTScatterPlotCurvedInterpolationOption)[coder decodeIntegerForKey:@"CPTScatterPlot.curvedInterpolationOption"]; + curvedInterpolationCustomAlpha = [coder decodeCGFloatForKey:@"CPTScatterPlot.curvedInterpolationCustomAlpha"]; + dataLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTScatterPlot.dataLineStyle"] copy]; + plotSymbol = [[coder decodeObjectOfClass:[CPTPlotSymbol class] + forKey:@"CPTScatterPlot.plotSymbol"] copy]; + areaFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTScatterPlot.areaFill"] copy]; + areaFill2 = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTScatterPlot.areaFill2"] copy]; + mutableAreaFillBands = [[coder decodeObjectOfClasses:[NSSet setWithArray:@[[NSArray class], [CPTLimitBand class]]] + forKey:@"CPTScatterPlot.mutableAreaFillBands"] mutableCopy]; + areaBaseValue = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTScatterPlot.areaBaseValue"]; + areaBaseValue2 = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTScatterPlot.areaBaseValue2"]; plotSymbolMarginForHitDetection = [coder decodeCGFloatForKey:@"CPTScatterPlot.plotSymbolMarginForHitDetection"]; plotLineMarginForHitDetection = [coder decodeCGFloatForKey:@"CPTScatterPlot.plotLineMarginForHitDetection"]; allowSimultaneousSymbolAndPlotSelection = [coder decodeBoolForKey:@"CPTScatterPlot.allowSimultaneousSymbolAndPlotSelection"]; @@ -303,6 +350,18 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Data Loading @@ -361,9 +420,9 @@ -(void)reloadPlotSymbolsInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(symbolForScatterPlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutablePlotSymbolArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTPlotSymbol *symbol = [theDataSource symbolForScatterPlot:self recordIndex:idx]; @@ -393,11 +452,11 @@ -(void)reloadPlotSymbolsInIndexRange:(NSRange)indexRange * @param idx The index of the record. * @return The plot symbol to use, or @nil if no plot symbol should be drawn. **/ --(CPTPlotSymbol *)plotSymbolForRecordIndex:(NSUInteger)idx +-(nullable CPTPlotSymbol *)plotSymbolForRecordIndex:(NSUInteger)idx { CPTPlotSymbol *symbol = [self cachedValueForKey:CPTScatterPlotBindingPlotSymbols recordIndex:idx]; - if ( (symbol == nil) || (symbol == [CPTPlot nilData]) ) { + if ((symbol == nil) || (symbol == [CPTPlot nilData])) { symbol = self.plotSymbol; } @@ -409,7 +468,7 @@ -(CPTPlotSymbol *)plotSymbolForRecordIndex:(NSUInteger)idx /// @cond --(void)calculatePointsToDraw:(BOOL *)pointDrawFlags forPlotSpace:(CPTXYPlotSpace *)xyPlotSpace includeVisiblePointsOnly:(BOOL)visibleOnly numberOfPoints:(NSUInteger)dataCount +-(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags forPlotSpace:(nonnull CPTXYPlotSpace *)xyPlotSpace includeVisiblePointsOnly:(BOOL)visibleOnly numberOfPoints:(NSUInteger)dataCount { if ( dataCount == 0 ) { return; @@ -417,16 +476,16 @@ -(void)calculatePointsToDraw:(BOOL *)pointDrawFlags forPlotSpace:(CPTXYPlotSpace CPTLineStyle *lineStyle = self.dataLineStyle; - if ( self.areaFill || self.areaFill2 || lineStyle.dashPattern || lineStyle.lineFill || (self.interpolation == CPTScatterPlotInterpolationCurved) ) { + if ( self.areaFill || self.areaFill2 || lineStyle.dashPattern || lineStyle.lineFill || (self.interpolation == CPTScatterPlotInterpolationCurved)) { // show all points to preserve the line dash and area fills for ( NSUInteger i = 0; i < dataCount; i++ ) { pointDrawFlags[i] = YES; } } else { - CPTPlotRangeComparisonResult *xRangeFlags = malloc( dataCount * sizeof(CPTPlotRangeComparisonResult) ); - CPTPlotRangeComparisonResult *yRangeFlags = malloc( dataCount * sizeof(CPTPlotRangeComparisonResult) ); - BOOL *nanFlags = malloc( dataCount * sizeof(BOOL) ); + CPTPlotRangeComparisonResult *xRangeFlags = calloc(dataCount, sizeof(CPTPlotRangeComparisonResult)); + CPTPlotRangeComparisonResult *yRangeFlags = calloc(dataCount, sizeof(CPTPlotRangeComparisonResult)); + BOOL *nanFlags = calloc(dataCount, sizeof(BOOL)); CPTPlotRange *xRange = xyPlotSpace.xRange; CPTPlotRange *yRange = xyPlotSpace.yRange; @@ -441,7 +500,7 @@ -(void)calculatePointsToDraw:(BOOL *)pointDrawFlags forPlotSpace:(CPTXYPlotSpace const double y = yBytes[i]; CPTPlotRangeComparisonResult xFlag = [xRange compareToDouble:x]; - xRangeFlags[i] = xFlag; + xRangeFlags[i] = xFlag; if ( xFlag != CPTPlotRangeComparisonResultNumberInRange ) { yRangeFlags[i] = CPTPlotRangeComparisonResultNumberInRange; // if x is out of range, then y doesn't matter } @@ -461,7 +520,7 @@ -(void)calculatePointsToDraw:(BOOL *)pointDrawFlags forPlotSpace:(CPTXYPlotSpace const NSDecimal y = yBytes[i]; CPTPlotRangeComparisonResult xFlag = [xRange compareToDecimal:x]; - xRangeFlags[i] = xFlag; + xRangeFlags[i] = xFlag; if ( xFlag != CPTPlotRangeComparisonResultNumberInRange ) { yRangeFlags[i] = CPTPlotRangeComparisonResultNumberInRange; // if x is out of range, then y doesn't matter } @@ -477,7 +536,7 @@ -(void)calculatePointsToDraw:(BOOL *)pointDrawFlags forPlotSpace:(CPTXYPlotSpace // are included. This ensures no lines are left out that shouldn't be. CPTScatterPlotInterpolation theInterpolation = self.interpolation; - memset( pointDrawFlags, NO, dataCount * sizeof(BOOL) ); + memset(pointDrawFlags, NO, dataCount * sizeof(BOOL)); if ( dataCount > 0 ) { pointDrawFlags[0] = (xRangeFlags[0] == CPTPlotRangeComparisonResultNumberInRange && yRangeFlags[0] == CPTPlotRangeComparisonResultNumberInRange && @@ -485,9 +544,9 @@ -(void)calculatePointsToDraw:(BOOL *)pointDrawFlags forPlotSpace:(CPTXYPlotSpace } if ( visibleOnly ) { for ( NSUInteger i = 1; i < dataCount; i++ ) { - if ( (xRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && - (yRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && - !nanFlags[i] ) { + if ((xRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && + (yRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && + !nanFlags[i] ) { pointDrawFlags[i] = YES; } } @@ -497,13 +556,13 @@ -(void)calculatePointsToDraw:(BOOL *)pointDrawFlags forPlotSpace:(CPTXYPlotSpace case CPTScatterPlotInterpolationCurved: // Keep 2 points outside of the visible area on each side to maintain the correct curvature of the line if ( dataCount > 1 ) { - if ( !nanFlags[0] && !nanFlags[1] && ( (xRangeFlags[0] != xRangeFlags[1]) || (yRangeFlags[0] != yRangeFlags[1]) ) ) { + if ( !nanFlags[0] && !nanFlags[1] && ((xRangeFlags[0] != xRangeFlags[1]) || (yRangeFlags[0] != yRangeFlags[1]))) { pointDrawFlags[0] = YES; pointDrawFlags[1] = YES; } - else if ( (xRangeFlags[1] == CPTPlotRangeComparisonResultNumberInRange) && - (yRangeFlags[1] == CPTPlotRangeComparisonResultNumberInRange) && - !nanFlags[1] ) { + else if ((xRangeFlags[1] == CPTPlotRangeComparisonResultNumberInRange) && + (yRangeFlags[1] == CPTPlotRangeComparisonResultNumberInRange) && + !nanFlags[1] ) { pointDrawFlags[1] = YES; } } @@ -514,14 +573,14 @@ -(void)calculatePointsToDraw:(BOOL *)pointDrawFlags forPlotSpace:(CPTXYPlotSpace pointDrawFlags[i - 1] = YES; pointDrawFlags[i] = YES; } - else if ( !nanFlags[i - 1] && !nanFlags[i] && ( (xRangeFlags[i - 1] != xRangeFlags[i]) || (yRangeFlags[i - 1] != yRangeFlags[i]) ) ) { + else if ( !nanFlags[i - 1] && !nanFlags[i] && ((xRangeFlags[i - 1] != xRangeFlags[i]) || (yRangeFlags[i - 1] != yRangeFlags[i]))) { pointDrawFlags[i - 2] = YES; pointDrawFlags[i - 1] = YES; pointDrawFlags[i] = YES; } - else if ( (xRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && - (yRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && - !nanFlags[i] ) { + else if ((xRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && + (yRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && + !nanFlags[i] ) { pointDrawFlags[i] = YES; } } @@ -530,13 +589,13 @@ -(void)calculatePointsToDraw:(BOOL *)pointDrawFlags forPlotSpace:(CPTXYPlotSpace default: // Keep 1 point outside of the visible area on each side for ( NSUInteger i = 1; i < dataCount; i++ ) { - if ( !nanFlags[i - 1] && !nanFlags[i] && ( (xRangeFlags[i - 1] != xRangeFlags[i]) || (yRangeFlags[i - 1] != yRangeFlags[i]) ) ) { + if ( !nanFlags[i - 1] && !nanFlags[i] && ((xRangeFlags[i - 1] != xRangeFlags[i]) || (yRangeFlags[i - 1] != yRangeFlags[i]))) { pointDrawFlags[i - 1] = YES; pointDrawFlags[i] = YES; } - else if ( (xRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && - (yRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && - !nanFlags[i] ) { + else if ((xRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && + (yRangeFlags[i] == CPTPlotRangeComparisonResultNumberInRange) && + !nanFlags[i] ) { pointDrawFlags[i] = YES; } } @@ -550,7 +609,7 @@ -(void)calculatePointsToDraw:(BOOL *)pointDrawFlags forPlotSpace:(CPTXYPlotSpace } } --(void)calculateViewPoints:(CGPoint *)viewPoints withDrawPointFlags:(BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount +-(void)calculateViewPoints:(nonnull CGPoint *)viewPoints withDrawPointFlags:(nonnull BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount { CPTPlotSpace *thePlotSpace = self.plotSpace; @@ -562,7 +621,7 @@ -(void)calculateViewPoints:(CGPoint *)viewPoints withDrawPointFlags:(BOOL *)draw dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { const double x = xBytes[i]; const double y = yBytes[i]; - if ( !drawPointFlags[i] || isnan(x) || isnan(y) ) { + if ( !drawPointFlags[i] || isnan(x) || isnan(y)) { viewPoints[i] = CPTPointMake(NAN, NAN); } else { @@ -584,7 +643,7 @@ -(void)calculateViewPoints:(CGPoint *)viewPoints withDrawPointFlags:(BOOL *)draw dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { const NSDecimal x = xBytes[i]; const NSDecimal y = yBytes[i]; - if ( !drawPointFlags[i] || NSDecimalIsNotANumber(&x) || NSDecimalIsNotANumber(&y) ) { + if ( !drawPointFlags[i] || NSDecimalIsNotANumber(&x) || NSDecimalIsNotANumber(&y)) { viewPoints[i] = CPTPointMake(NAN, NAN); } else { @@ -598,11 +657,11 @@ -(void)calculateViewPoints:(CGPoint *)viewPoints withDrawPointFlags:(BOOL *)draw } } --(void)alignViewPointsToUserSpace:(CGPoint *)viewPoints withContent:(CGContextRef)context drawPointFlags:(BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount +-(void)alignViewPointsToUserSpace:(nonnull CGPoint *)viewPoints withContext:(nonnull CGContextRef)context drawPointFlags:(nonnull BOOL *)drawPointFlags numberOfPoints:(NSUInteger)dataCount { // Align to device pixels if there is a data line. // Otherwise, align to view space, so fills are sharp at edges. - if ( self.dataLineStyle.lineWidth > 0.0 ) { + if ( self.dataLineStyle.lineWidth > CPTFloat(0.0)) { dispatch_apply(dataCount, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t i) { if ( drawPointFlags[i] ) { viewPoints[i] = CPTAlignPointToUserSpace(context, viewPoints[i]); @@ -618,7 +677,7 @@ -(void)alignViewPointsToUserSpace:(CGPoint *)viewPoints withContent:(CGContextRe } } --(NSInteger)extremeDrawnPointIndexForFlags:(BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount extremeNumIsLowerBound:(BOOL)isLowerBound +-(NSInteger)extremeDrawnPointIndexForFlags:(nonnull BOOL *)pointDrawFlags numberOfPoints:(NSUInteger)dataCount extremeNumIsLowerBound:(BOOL)isLowerBound { NSInteger result = NSNotFound; NSInteger delta = (isLowerBound ? 1 : -1); @@ -630,7 +689,7 @@ -(NSInteger)extremeDrawnPointIndexForFlags:(BOOL *)pointDrawFlags numberOfPoints result = i; break; } - if ( (delta < 0) && (i == 0) ) { + if ((delta < 0) && (i == 0)) { break; } } @@ -659,19 +718,19 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point -(NSUInteger)indexOfVisiblePointClosestToPlotAreaPoint:(CGPoint)viewPoint { NSUInteger dataCount = self.cachedDataCount; - CGPoint *viewPoints = calloc( dataCount, sizeof(CGPoint) ); - BOOL *drawPointFlags = calloc( dataCount, sizeof(BOOL) ); + CGPoint *viewPoints = calloc(dataCount, sizeof(CGPoint)); + BOOL *drawPointFlags = calloc(dataCount, sizeof(BOOL)); - [self calculatePointsToDraw:drawPointFlags forPlotSpace:(id)self.plotSpace includeVisiblePointsOnly:YES numberOfPoints:dataCount]; + [self calculatePointsToDraw:drawPointFlags forPlotSpace:(CPTXYPlotSpace *)self.plotSpace includeVisiblePointsOnly:YES numberOfPoints:dataCount]; [self calculateViewPoints:viewPoints withDrawPointFlags:drawPointFlags numberOfPoints:dataCount]; NSInteger result = [self extremeDrawnPointIndexForFlags:drawPointFlags numberOfPoints:dataCount extremeNumIsLowerBound:YES]; if ( result != NSNotFound ) { - CGFloat minimumDistanceSquared = NAN; + CGFloat minimumDistanceSquared = CPTNAN; for ( NSUInteger i = (NSUInteger)result; i < dataCount; ++i ) { if ( drawPointFlags[i] ) { CGFloat distanceSquared = squareOfDistanceBetweenPoints(viewPoint, viewPoints[i]); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = (NSInteger)i; } @@ -719,7 +778,7 @@ -(CGPoint)plotAreaPointOfVisiblePointAtIndex:(NSUInteger)idx /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden ) { return; @@ -728,14 +787,14 @@ -(void)renderAsVectorInContext:(CGContextRef)context CPTMutableNumericData *xValueData = [self cachedNumbersForField:CPTScatterPlotFieldX]; CPTMutableNumericData *yValueData = [self cachedNumbersForField:CPTScatterPlotFieldY]; - if ( (xValueData == nil) || (yValueData == nil) ) { + if ((xValueData == nil) || (yValueData == nil)) { return; } NSUInteger dataCount = self.cachedDataCount; if ( dataCount == 0 ) { return; } - if ( !(self.dataLineStyle || self.areaFill || self.areaFill2 || self.plotSymbol || self.plotSymbols.count) ) { + if ( !(self.dataLineStyle || self.areaFill || self.areaFill2 || self.plotSymbol || self.plotSymbols.count)) { return; } if ( xValueData.numberOfSamples != yValueData.numberOfSamples ) { @@ -745,8 +804,8 @@ -(void)renderAsVectorInContext:(CGContextRef)context [super renderAsVectorInContext:context]; // Calculate view points, and align to user space - CGPoint *viewPoints = malloc( dataCount * sizeof(CGPoint) ); - BOOL *drawPointFlags = malloc( dataCount * sizeof(BOOL) ); + CGPoint *viewPoints = calloc(dataCount, sizeof(CGPoint)); + BOOL *drawPointFlags = calloc(dataCount, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = (CPTXYPlotSpace *)self.plotSpace; [self calculatePointsToDraw:drawPointFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:NO numberOfPoints:dataCount]; @@ -754,7 +813,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context BOOL pixelAlign = self.alignsPointsToPixels; if ( pixelAlign ) { - [self alignViewPointsToUserSpace:viewPoints withContent:context drawPointFlags:drawPointFlags numberOfPoints:dataCount]; + [self alignViewPointsToUserSpace:viewPoints withContext:context drawPointFlags:drawPointFlags numberOfPoints:dataCount]; } // Get extreme points @@ -762,11 +821,11 @@ -(void)renderAsVectorInContext:(CGContextRef)context NSInteger firstDrawnPointIndex = [self extremeDrawnPointIndexForFlags:drawPointFlags numberOfPoints:dataCount extremeNumIsLowerBound:YES]; if ( firstDrawnPointIndex != NSNotFound ) { - NSRange viewIndexRange = NSMakeRange( (NSUInteger)firstDrawnPointIndex, (NSUInteger)(lastDrawnPointIndex - firstDrawnPointIndex + 1) ); + NSRange viewIndexRange = NSMakeRange((NSUInteger)firstDrawnPointIndex, (NSUInteger)(lastDrawnPointIndex - firstDrawnPointIndex + 1)); - CPTPlotArea *thePlotArea = self.plotArea; - CPTLineStyle *theLineStyle = self.dataLineStyle; - NSMutableArray *fillBands = self.mutableAreaFillBands; + CPTPlotArea *thePlotArea = self.plotArea; + CPTLineStyle *theLineStyle = self.dataLineStyle; + CPTMutableLimitBandArray *fillBands = self.mutableAreaFillBands; // Draw fills NSDecimal theAreaBaseValue; @@ -775,20 +834,21 @@ -(void)renderAsVectorInContext:(CGContextRef)context for ( NSUInteger i = 0; i < 2; i++ ) { switch ( i ) { case 0: - theAreaBaseValue = self.areaBaseValue; + theAreaBaseValue = self.areaBaseValue.decimalValue; theFill = self.areaFill; break; case 1: - theAreaBaseValue = self.areaBaseValue2; + theAreaBaseValue = self.areaBaseValue2.decimalValue; theFill = self.areaFill2; break; default: + theAreaBaseValue = CPTDecimalNaN(); break; } - if ( !NSDecimalIsNotANumber(&theAreaBaseValue) ) { - if ( theFill || ( (i == 0) && fillBands ) ) { + if ( !NSDecimalIsNotANumber(&theAreaBaseValue)) { + if ( theFill || ((i == 0) && fillBands)) { // clear the plot shadow if any--not needed for fills when the plot has a data line if ( theLineStyle ) { CGContextSaveGState(context); @@ -797,7 +857,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context NSNumber *xValue = [xValueData sampleValue:(NSUInteger)firstDrawnPointIndex]; NSDecimal plotPoint[2]; - plotPoint[CPTCoordinateX] = [xValue decimalValue]; + plotPoint[CPTCoordinateX] = xValue.decimalValue; plotPoint[CPTCoordinateY] = theAreaBaseValue; CGPoint baseLinePoint = [self convertPoint:[thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2] fromLayer:thePlotArea]; if ( pixelAlign ) { @@ -813,18 +873,18 @@ -(void)renderAsVectorInContext:(CGContextRef)context } // Draw fill bands - if ( (i == 0) && fillBands ) { - CGFloat height = CPTFloat( CGBitmapContextGetHeight(context) ); + if ((i == 0) && fillBands ) { + CGFloat height = CPTFloat(CGBitmapContextGetHeight(context)); for ( CPTLimitBand *band in fillBands ) { CGContextSaveGState(context); CPTPlotRange *bandRange = band.range; - plotPoint[CPTCoordinateX] = bandRange.minLimit; + plotPoint[CPTCoordinateX] = bandRange.minLimitDecimal; CGPoint minPoint = [self convertPoint:[thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2] fromLayer:thePlotArea]; - plotPoint[CPTCoordinateX] = bandRange.maxLimit; + plotPoint[CPTCoordinateX] = bandRange.maxLimitDecimal; CGPoint maxPoint = [self convertPoint:[thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2] fromLayer:thePlotArea]; if ( pixelAlign ) { @@ -832,7 +892,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context maxPoint = CPTAlignIntegralPointToUserSpace(context, maxPoint); } - CGContextClipToRect( context, CGRectMake(minPoint.x, 0.0, maxPoint.x - minPoint.x, height) ); + CGContextClipToRect(context, CGRectMake(minPoint.x, 0.0, maxPoint.x - minPoint.x, height)); CGContextBeginPath(context); CGContextAddPath(context, dataLinePath); @@ -853,10 +913,10 @@ -(void)renderAsVectorInContext:(CGContextRef)context // Draw line if ( theLineStyle ) { - CGPathRef dataLinePath = [self newDataLinePathForViewPoints:viewPoints indexRange:viewIndexRange baselineYValue:NAN]; + CGPathRef dataLinePath = [self newDataLinePathForViewPoints:viewPoints indexRange:viewIndexRange baselineYValue:CPTNAN]; // Give the delegate a chance to prepare for the drawing. - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(scatterPlot:prepareForDrawingPlotLine:inContext:)] ) { [theDelegate scatterPlot:self prepareForDrawingPlotLine:dataLinePath inContext:context]; } @@ -903,7 +963,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context free(drawPointFlags); } --(CGPathRef)newDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange:(NSRange)indexRange baselineYValue:(CGFloat)baselineYValue +-(nonnull CGPathRef)newDataLinePathForViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange baselineYValue:(CGFloat)baselineYValue { CPTScatterPlotInterpolation theInterpolation = self.interpolation; @@ -924,9 +984,9 @@ -(CGPathRef)newDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange:(NSRan for ( NSUInteger i = indexRange.location; i <= lastDrawnPointIndex; i++ ) { CGPoint viewPoint = viewPoints[i]; - if ( isnan(viewPoint.x) || isnan(viewPoint.y) ) { + if ( isnan(viewPoint.x) || isnan(viewPoint.y)) { if ( !lastPointSkipped ) { - if ( !isnan(baselineYValue) ) { + if ( !isnan(baselineYValue)) { CGPathAddLineToPoint(dataLinePath, NULL, lastPoint.x, baselineYValue); CGPathAddLineToPoint(dataLinePath, NULL, firstPoint.x, baselineYValue); CGPathCloseSubpath(dataLinePath); @@ -954,8 +1014,12 @@ -(CGPathRef)newDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange:(NSRan case CPTScatterPlotInterpolationHistogram: { CGFloat x = (lastPoint.x + viewPoint.x) / CPTFloat(2.0); - CGPathAddLineToPoint(dataLinePath, NULL, x, lastPoint.y); - CGPathAddLineToPoint(dataLinePath, NULL, x, viewPoint.y); + if ( CPTScatterPlotHistogramSkipFirst != self.histogramOption ) { + CGPathAddLineToPoint(dataLinePath, NULL, x, lastPoint.y); + } + if ( CPTScatterPlotHistogramSkipSecond != self.histogramOption ) { + CGPathAddLineToPoint(dataLinePath, NULL, x, viewPoint.y); + } CGPathAddLineToPoint(dataLinePath, NULL, viewPoint.x, viewPoint.y); } break; @@ -969,7 +1033,7 @@ -(CGPathRef)newDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange:(NSRan } } - if ( !lastPointSkipped && !isnan(baselineYValue) ) { + if ( !lastPointSkipped && !isnan(baselineYValue)) { CGPathAddLineToPoint(dataLinePath, NULL, lastPoint.x, baselineYValue); CGPathAddLineToPoint(dataLinePath, NULL, firstPoint.x, baselineYValue); CGPathCloseSubpath(dataLinePath); @@ -978,7 +1042,7 @@ -(CGPathRef)newDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange:(NSRan return dataLinePath; } --(CGPathRef)newCurvedDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange:(NSRange)indexRange baselineYValue:(CGFloat)baselineYValue +-(nonnull CGPathRef)newCurvedDataLinePathForViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange baselineYValue:(CGFloat)baselineYValue { CGMutablePathRef dataLinePath = CGPathCreateMutable(); BOOL lastPointSkipped = YES; @@ -987,9 +1051,11 @@ -(CGPathRef)newCurvedDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange: NSUInteger firstIndex = indexRange.location; NSUInteger lastDrawnPointIndex = NSMaxRange(indexRange); + CPTScatterPlotCurvedInterpolationOption interpolationOption = self.curvedInterpolationOption; + if ( lastDrawnPointIndex > 0 ) { - CGPoint *controlPoints1 = calloc( lastDrawnPointIndex, sizeof(CGPoint) ); - CGPoint *controlPoints2 = calloc( lastDrawnPointIndex, sizeof(CGPoint) ); + CGPoint *controlPoints1 = calloc(lastDrawnPointIndex, sizeof(CGPoint)); + CGPoint *controlPoints2 = calloc(lastDrawnPointIndex, sizeof(CGPoint)); lastDrawnPointIndex--; @@ -997,12 +1063,56 @@ -(CGPathRef)newCurvedDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange: for ( NSUInteger i = indexRange.location; i <= lastDrawnPointIndex; i++ ) { CGPoint viewPoint = viewPoints[i]; - if ( isnan(viewPoint.x) || isnan(viewPoint.y) ) { + if ( isnan(viewPoint.x) || isnan(viewPoint.y)) { if ( !lastPointSkipped ) { - [self computeControlPoints:controlPoints1 - points2:controlPoints2 - forViewPoints:viewPoints - indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + switch ( interpolationOption ) { + case CPTScatterPlotCurvedInterpolationNormal: + [self computeBezierControlPoints:controlPoints1 + points2:controlPoints2 + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullRomUniform: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:CPTFloat(0.0) + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullRomCentripetal: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:CPTFloat(0.5) + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullRomChordal: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:CPTFloat(1.0) + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + + break; + + case CPTScatterPlotCurvedInterpolationHermiteCubic: + [self computeHermiteControlPoints:controlPoints1 + points2:controlPoints2 + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullCustomAlpha: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:self.curvedInterpolationCustomAlpha + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, i - firstIndex)]; + break; + } lastPointSkipped = YES; } @@ -1016,10 +1126,55 @@ -(CGPathRef)newCurvedDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange: } if ( !lastPointSkipped ) { - [self computeControlPoints:controlPoints1 - points2:controlPoints2 - forViewPoints:viewPoints - indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + switch ( interpolationOption ) { + case CPTScatterPlotCurvedInterpolationNormal: + [self computeBezierControlPoints:controlPoints1 + points2:controlPoints2 + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullRomUniform: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:CPTFloat(0.0) + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + + break; + + case CPTScatterPlotCurvedInterpolationCatmullRomCentripetal: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:CPTFloat(0.5) + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullRomChordal: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:CPTFloat(1.0) + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + + break; + + case CPTScatterPlotCurvedInterpolationHermiteCubic: + [self computeHermiteControlPoints:controlPoints1 + points2:controlPoints2 + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + break; + + case CPTScatterPlotCurvedInterpolationCatmullCustomAlpha: + [self computeCatmullRomControlPoints:controlPoints1 + points2:controlPoints2 + withAlpha:self.curvedInterpolationCustomAlpha + forViewPoints:viewPoints + indexRange:NSMakeRange(firstIndex, NSMaxRange(indexRange) - firstIndex)]; + break; + } } // Build the path @@ -1027,9 +1182,9 @@ -(CGPathRef)newCurvedDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange: for ( NSUInteger i = indexRange.location; i <= lastDrawnPointIndex; i++ ) { CGPoint viewPoint = viewPoints[i]; - if ( isnan(viewPoint.x) || isnan(viewPoint.y) ) { + if ( isnan(viewPoint.x) || isnan(viewPoint.y)) { if ( !lastPointSkipped ) { - if ( !isnan(baselineYValue) ) { + if ( !isnan(baselineYValue)) { CGPathAddLineToPoint(dataLinePath, NULL, lastPoint.x, baselineYValue); CGPathAddLineToPoint(dataLinePath, NULL, firstPoint.x, baselineYValue); CGPathCloseSubpath(dataLinePath); @@ -1053,13 +1208,13 @@ -(CGPathRef)newCurvedDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange: // add the control points CGPathMoveToPoint(dataLinePath, NULL, cp1.x - CPTFloat(5.0), cp1.y); CGPathAddLineToPoint(dataLinePath, NULL, cp1.x + CPTFloat(5.0), cp1.y); - CGPathMoveToPoint( dataLinePath, NULL, cp1.x, cp1.y - CPTFloat(5.0) ); - CGPathAddLineToPoint( dataLinePath, NULL, cp1.x, cp1.y + CPTFloat(5.0) ); + CGPathMoveToPoint(dataLinePath, NULL, cp1.x, cp1.y - CPTFloat(5.0)); + CGPathAddLineToPoint(dataLinePath, NULL, cp1.x, cp1.y + CPTFloat(5.0)); - CGPathMoveToPoint( dataLinePath, NULL, cp2.x - CPTFloat(3.5), cp2.y - CPTFloat(3.5) ); - CGPathAddLineToPoint( dataLinePath, NULL, cp2.x + CPTFloat(3.5), cp2.y + CPTFloat(3.5) ); - CGPathMoveToPoint( dataLinePath, NULL, cp2.x + CPTFloat(3.5), cp2.y - CPTFloat(3.5) ); - CGPathAddLineToPoint( dataLinePath, NULL, cp2.x - CPTFloat(3.5), cp2.y + CPTFloat(3.5) ); + CGPathMoveToPoint(dataLinePath, NULL, cp2.x - CPTFloat(3.5), cp2.y - CPTFloat(3.5)); + CGPathAddLineToPoint(dataLinePath, NULL, cp2.x + CPTFloat(3.5), cp2.y + CPTFloat(3.5)); + CGPathMoveToPoint(dataLinePath, NULL, cp2.x + CPTFloat(3.5), cp2.y - CPTFloat(3.5)); + CGPathAddLineToPoint(dataLinePath, NULL, cp2.x - CPTFloat(3.5), cp2.y + CPTFloat(3.5)); // add a line connecting the control points CGPathMoveToPoint(dataLinePath, NULL, cp1.x, cp1.y); @@ -1074,7 +1229,7 @@ -(CGPathRef)newCurvedDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange: } } - if ( !lastPointSkipped && !isnan(baselineYValue) ) { + if ( !lastPointSkipped && !isnan(baselineYValue)) { CGPathAddLineToPoint(dataLinePath, NULL, lastPoint.x, baselineYValue); CGPathAddLineToPoint(dataLinePath, NULL, firstPoint.x, baselineYValue); CGPathCloseSubpath(dataLinePath); @@ -1087,9 +1242,238 @@ -(CGPathRef)newCurvedDataLinePathForViewPoints:(CGPoint *)viewPoints indexRange: return dataLinePath; } +/** @brief Compute the control points using a catmull-rom spline. + * @param points A pointer to the array which should hold the first control points. + * @param points2 A pointer to the array which should hold the second control points. + * @param alpha The alpha value used for the catmull-rom interpolation. + * @param viewPoints A pointer to the array which holds all view points for which the interpolation should be calculated. + * @param indexRange The range in which the interpolation should occur. + * @warning The @par{indexRange} must be valid for all passed arrays otherwise this method crashes. + **/ +-(void)computeCatmullRomControlPoints:(nonnull CGPoint *)points points2:(nonnull CGPoint *)points2 withAlpha:(CGFloat)alpha forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange +{ + if ( indexRange.length >= 2 ) { + NSUInteger startIndex = indexRange.location; + NSUInteger endIndex = NSMaxRange(indexRange) - 1; // the index starts at zero + NSUInteger segmentCount = endIndex - 1; // there are n - 1 segments + + CGFloat epsilon = CPTFloat(1.0e-5); // the minimum point distance. below that no interpolation happens. + + for ( NSUInteger index = startIndex; index <= segmentCount; index++ ) { + // calculate the control for the segment from index -> index + 1 + CGPoint p0, p1, p2, p3; // the view point + + // the internal points are always valid + p1 = viewPoints[index]; + p2 = viewPoints[index + 1]; + // account for first and last segment + if ( index == startIndex ) { + p0 = p1; + } + else { + p0 = viewPoints[index - 1]; + } + if ( index == segmentCount ) { + p3 = p2; + } + else { + p3 = viewPoints[index + 2]; + } + + // distance between the points + CGFloat d1 = hypot(p1.x - p0.x, p1.y - p0.y); + CGFloat d2 = hypot(p2.x - p1.x, p2.y - p1.y); + CGFloat d3 = hypot(p3.x - p2.x, p3.y - p2.y); + // constants + CGFloat d1_a = pow(d1, alpha); // d1^alpha + CGFloat d2_a = pow(d2, alpha); // d2^alpha + CGFloat d3_a = pow(d3, alpha); // d3^alpha + CGFloat d1_2a = pow(d1_a, CPTFloat(2.0)); // d1^alpha^2 = d1^2*alpha + CGFloat d2_2a = pow(d2_a, CPTFloat(2.0)); // d2^alpha^2 = d2^2*alpha + CGFloat d3_2a = pow(d3_a, CPTFloat(2.0)); // d3^alpha^2 = d3^2*alpha + + // calculate the control points + // see : http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf under point 3. + CGPoint cp1, cp2; // the calculated view points; + if ( fabs(d1) <= epsilon ) { + cp1 = p1; + } + else { + CGFloat divisor = CPTFloat(3.0) * d1_a * (d1_a + d2_a); + cp1 = CPTPointMake((p2.x * d1_2a - p0.x * d2_2a + (2 * d1_2a + 3 * d1_a * d2_a + d2_2a) * p1.x) / divisor, + (p2.y * d1_2a - p0.y * d2_2a + (2 * d1_2a + 3 * d1_a * d2_a + d2_2a) * p1.y) / divisor + ); + } + + if ( fabs(d3) <= epsilon ) { + cp2 = p2; + } + else { + CGFloat divisor = 3 * d3_a * (d3_a + d2_a); + cp2 = CPTPointMake((d3_2a * p1.x - d2_2a * p3.x + (2 * d3_2a + 3 * d3_a * d2_a + d2_2a) * p2.x) / divisor, + (d3_2a * p1.y - d2_2a * p3.y + (2 * d3_2a + 3 * d3_a * d2_a + d2_2a) * p2.y) / divisor); + } + + points[index + 1] = cp1; + points2[index + 1] = cp2; + } + } +} + +/** @brief Compute the control points using a hermite cubic spline. + * + * If the view points are monotonically increasing or decreasing in both @par{x} and @par{y}, + * the smoothed curve will be also. + * + * @param points A pointer to the array which should hold the first control points. + * @param points2 A pointer to the array which should hold the second control points. + * @param viewPoints A pointer to the array which holds all view points for which the interpolation should be calculated. + * @param indexRange The range in which the interpolation should occur. + * @warning The @par{indexRange} must be valid for all passed arrays otherwise this method crashes. + **/ +-(void)computeHermiteControlPoints:(nonnull CGPoint *)points points2:(nonnull CGPoint *)points2 forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange +{ + // See https://en.wikipedia.org/wiki/Cubic_Hermite_spline and https://en.m.wikipedia.org/wiki/Monotone_cubic_interpolation for a discussion of algorithms used. + if ( indexRange.length >= 2 ) { + NSUInteger startIndex = indexRange.location; + NSUInteger lastIndex = NSMaxRange(indexRange) - 1; // last accessible element in view points + + BOOL monotonic = [self monotonicViewPoints:viewPoints indexRange:indexRange]; + + for ( NSUInteger index = startIndex; index <= lastIndex; index++ ) { + CGVector m; + CGPoint p1 = viewPoints[index]; + + if ( index == startIndex ) { + CGPoint p2 = viewPoints[index + 1]; + + m.dx = p2.x - p1.x; + m.dy = p2.y - p1.y; + } + else if ( index == lastIndex ) { + CGPoint p0 = viewPoints[index - 1]; + + m.dx = p1.x - p0.x; + m.dy = p1.y - p0.y; + } + else { // index > startIndex && index < numberOfPoints + CGPoint p0 = viewPoints[index - 1]; + CGPoint p2 = viewPoints[index + 1]; + + m.dx = p2.x - p0.x; + m.dy = p2.y - p0.y; + + if ( monotonic ) { + if ( m.dx > CPTFloat(0.0)) { + m.dx = MIN(p2.x - p1.x, p1.x - p0.x); + } + else if ( m.dx < CPTFloat(0.0)) { + m.dx = MAX(p2.x - p1.x, p1.x - p0.x); + } + + if ( m.dy > CPTFloat(0.0)) { + m.dy = MIN(p2.y - p1.y, p1.y - p0.y); + } + else if ( m.dy < CPTFloat(0.0)) { + m.dy = MAX(p2.y - p1.y, p1.y - p0.y); + } + } + } + + // get control points + m.dx /= CPTFloat(6.0); + m.dy /= CPTFloat(6.0); + + CGPoint rhsControlPoint = CPTPointMake(p1.x + m.dx, p1.y + m.dy); + CGPoint lhsControlPoint = CPTPointMake(p1.x - m.dx, p1.y - m.dy); + + // We calculated the lhs & rhs control point. The rhs control point is the first control point for the curve to the next point. The lhs control point is the second control point for the curve to the current point. + + points2[index] = lhsControlPoint; + if ( index + 1 <= lastIndex ) { + points[index + 1] = rhsControlPoint; + } + } + } +} + +/** @brief Determine whether the plot points form a monotonic series. + * @param viewPoints A pointer to the array which holds all view points for which the interpolation should be calculated. + * @param indexRange The range in which the interpolation should occur. + * @return Returns @YES if the viewpoints are monotonically increasing or decreasing in both @par{x} and @par{y}. + * @warning The @par{indexRange} must be valid for all passed arrays otherwise this method crashes. + **/ +-(BOOL)monotonicViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange +{ + if ( indexRange.length < 2 ) { + return YES; + } + + NSUInteger startIndex = indexRange.location; + NSUInteger lastIndex = NSMaxRange(indexRange) - 2; + + BOOL foundTrendX = NO; + BOOL foundTrendY = NO; + BOOL isIncreasingX = NO; + BOOL isIncreasingY = NO; + + for ( NSUInteger index = startIndex; index <= lastIndex; index++ ) { + CGPoint p1 = viewPoints[index]; + CGPoint p2 = viewPoints[index + 1]; + + if ( !foundTrendX ) { + if ( p2.x > p1.x ) { + isIncreasingX = YES; + foundTrendX = YES; + } + else if ( p2.x < p1.x ) { + foundTrendX = YES; + } + } + + if ( foundTrendX ) { + if ( isIncreasingX ) { + if ( p2.x < p1.x ) { + return NO; + } + } + else { + if ( p2.x > p1.x ) { + return NO; + } + } + } + + if ( !foundTrendY ) { + if ( p2.y > p1.y ) { + isIncreasingY = YES; + foundTrendY = YES; + } + else if ( p2.y < p1.y ) { + foundTrendY = YES; + } + } + + if ( foundTrendY ) { + if ( isIncreasingY ) { + if ( p2.y < p1.y ) { + return NO; + } + } + else { + if ( p2.y > p1.y ) { + return NO; + } + } + } + } + + return YES; +} + // Compute the control points using the algorithm described at http://www.particleincell.com/blog/2012/bezier-splines/ // cp1, cp2, and viewPoints should point to arrays of points with at least NSMaxRange(indexRange) elements each. --(void)computeControlPoints:(CGPoint *)cp1 points2:(CGPoint *)cp2 forViewPoints:(CGPoint *)viewPoints indexRange:(NSRange)indexRange +-(void)computeBezierControlPoints:(nonnull CGPoint *)cp1 points2:(nonnull CGPoint *)cp2 forViewPoints:(nonnull CGPoint *)viewPoints indexRange:(NSRange)indexRange { if ( indexRange.length == 2 ) { NSUInteger rangeEnd = NSMaxRange(indexRange) - 1; @@ -1100,10 +1484,10 @@ -(void)computeControlPoints:(CGPoint *)cp1 points2:(CGPoint *)cp2 forViewPoints: NSUInteger n = indexRange.length - 1; // rhs vector - CGPoint *a = malloc( n * sizeof(CGPoint) ); - CGPoint *b = malloc( n * sizeof(CGPoint) ); - CGPoint *c = malloc( n * sizeof(CGPoint) ); - CGPoint *r = malloc( n * sizeof(CGPoint) ); + CGPoint *a = calloc(n, sizeof(CGPoint)); + CGPoint *b = calloc(n, sizeof(CGPoint)); + CGPoint *c = calloc(n, sizeof(CGPoint)); + CGPoint *r = calloc(n, sizeof(CGPoint)); // left most segment a[0] = CGPointZero; @@ -1150,11 +1534,11 @@ -(void)computeControlPoints:(CGPoint *)cp1 points2:(CGPoint *)cp2 forViewPoints: cp1[indexRange.location + n] = CGPointMake(r[n - 1].x / b[n - 1].x, r[n - 1].y / b[n - 1].y); for ( NSUInteger i = n - 2; i > 0; i-- ) { - cp1[indexRange.location + i + 1] = CGPointMake( (r[i].x - c[i].x * cp1[indexRange.location + i + 2].x) / b[i].x, - (r[i].y - c[i].y * cp1[indexRange.location + i + 2].y) / b[i].y ); + cp1[indexRange.location + i + 1] = CGPointMake((r[i].x - c[i].x * cp1[indexRange.location + i + 2].x) / b[i].x, + (r[i].y - c[i].y * cp1[indexRange.location + i + 2].y) / b[i].y); } - cp1[indexRange.location + 1] = CGPointMake( (r[0].x - c[0].x * cp1[indexRange.location + 2].x) / b[0].x, - (r[0].y - c[0].y * cp1[indexRange.location + 2].y) / b[0].y ); + cp1[indexRange.location + 1] = CGPointMake((r[0].x - c[0].x * cp1[indexRange.location + 2].x) / b[0].x, + (r[0].y - c[0].y * cp1[indexRange.location + 2].y) / b[0].y); // we have p1, now compute p2 NSUInteger rangeEnd = NSMaxRange(indexRange) - 1; @@ -1163,8 +1547,8 @@ -(void)computeControlPoints:(CGPoint *)cp1 points2:(CGPoint *)cp2 forViewPoints: CPTFloat(2.0) * viewPoints[i].y - cp1[i + 1].y); } - cp2[rangeEnd] = CGPointMake( CPTFloat(0.5) * (viewPoints[rangeEnd].x + cp1[rangeEnd].x), - CPTFloat(0.5) * (viewPoints[rangeEnd].y + cp1[rangeEnd].y) ); + cp2[rangeEnd] = CGPointMake(CPTFloat(0.5) * (viewPoints[rangeEnd].x + cp1[rangeEnd].x), + CPTFloat(0.5) * (viewPoints[rangeEnd].y + cp1[rangeEnd].y)); // clean up free(a); @@ -1174,7 +1558,7 @@ -(void)computeControlPoints:(CGPoint *)cp1 points2:(CGPoint *)cp2 forViewPoints: } } --(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(CGContextRef)context +-(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(nonnull CGContextRef)context { [super drawSwatchForLegend:legend atIndex:idx inRect:rect inContext:context]; @@ -1184,8 +1568,8 @@ -(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(C if ( theLineStyle ) { [theLineStyle setLineStyleInContext:context]; - CGPoint alignedStartPoint = CPTAlignPointToUserSpace( context, CPTPointMake( CGRectGetMinX(rect), CGRectGetMidY(rect) ) ); - CGPoint alignedEndPoint = CPTAlignPointToUserSpace( context, CPTPointMake( CGRectGetMaxX(rect), CGRectGetMidY(rect) ) ); + CGPoint alignedStartPoint = CPTAlignPointToUserSpace(context, CPTPointMake(CGRectGetMinX(rect), CGRectGetMidY(rect))); + CGPoint alignedEndPoint = CPTAlignPointToUserSpace(context, CPTPointMake(CGRectGetMaxX(rect), CGRectGetMidY(rect))); CGContextMoveToPoint(context, alignedStartPoint.x, alignedStartPoint.y); CGContextAddLineToPoint(context, alignedEndPoint.x, alignedEndPoint.y); @@ -1196,7 +1580,7 @@ -(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(C if ( thePlotSymbol ) { [thePlotSymbol renderInContext:context - atPoint:CPTPointMake( CGRectGetMidX(rect), CGRectGetMidY(rect) ) + atPoint:CPTPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect)) scale:self.contentsScale alignToPixels:YES]; } @@ -1224,13 +1608,13 @@ -(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(C CGContextAddPath(context, swatchPath); CGContextClip(context); - if ( CPTDecimalGreaterThanOrEqualTo(self.areaBaseValue2, self.areaBaseValue) ) { - [fill1 fillRect:CPTRectMake( CGRectGetMinX(rect), CGRectGetMinY(rect), rect.size.width, rect.size.height / CPTFloat(2.0) ) inContext:context]; - [fill2 fillRect:CPTRectMake( CGRectGetMinX(rect), CGRectGetMidY(rect), rect.size.width, rect.size.height / CPTFloat(2.0) ) inContext:context]; + if ( CPTDecimalGreaterThanOrEqualTo(self.areaBaseValue2.decimalValue, self.areaBaseValue.decimalValue)) { + [fill1 fillRect:CPTRectMake(CGRectGetMinX(rect), CGRectGetMinY(rect), rect.size.width, rect.size.height / CPTFloat(2.0)) inContext:context]; + [fill2 fillRect:CPTRectMake(CGRectGetMinX(rect), CGRectGetMidY(rect), rect.size.width, rect.size.height / CPTFloat(2.0)) inContext:context]; } else { - [fill2 fillRect:CPTRectMake( CGRectGetMinX(rect), CGRectGetMinY(rect), rect.size.width, rect.size.height / CPTFloat(2.0) ) inContext:context]; - [fill1 fillRect:CPTRectMake( CGRectGetMinX(rect), CGRectGetMidY(rect), rect.size.width, rect.size.height / CPTFloat(2.0) ) inContext:context]; + [fill2 fillRect:CPTRectMake(CGRectGetMinX(rect), CGRectGetMinY(rect), rect.size.width, rect.size.height / CPTFloat(2.0)) inContext:context]; + [fill1 fillRect:CPTRectMake(CGRectGetMinX(rect), CGRectGetMidY(rect), rect.size.width, rect.size.height / CPTFloat(2.0)) inContext:context]; } CGContextRestoreGState(context); @@ -1242,7 +1626,7 @@ -(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(C } } --(CGPathRef)newDataLinePath +-(nonnull CGPathRef)newDataLinePath { [self reloadDataIfNeeded]; @@ -1252,8 +1636,8 @@ -(CGPathRef)newDataLinePath } // Calculate view points - CGPoint *viewPoints = malloc( dataCount * sizeof(CGPoint) ); - BOOL *drawPointFlags = malloc( dataCount * sizeof(BOOL) ); + CGPoint *viewPoints = calloc(dataCount, sizeof(CGPoint)); + BOOL *drawPointFlags = calloc(dataCount, sizeof(BOOL)); for ( NSUInteger i = 0; i < dataCount; i++ ) { drawPointFlags[i] = YES; @@ -1264,7 +1648,7 @@ -(CGPathRef)newDataLinePath // Create the path CGPathRef dataLinePath = [self newDataLinePathForViewPoints:viewPoints indexRange:NSMakeRange(0, dataCount) - baselineYValue:NAN]; + baselineYValue:CPTNAN]; free(viewPoints); free(drawPointFlags); @@ -1274,6 +1658,86 @@ -(CGPathRef)newDataLinePath /// @endcond +#pragma mark - +#pragma mark Animation + +/// @cond + ++(BOOL)needsDisplayForKey:(nonnull NSString *)aKey +{ + static NSSet *keys = nil; + static dispatch_once_t onceToken; + + dispatch_once(&onceToken, ^{ + keys = [NSSet setWithArray:@[@"areaBaseValue", + @"areaBaseValue2"]]; + }); + + if ( [keys containsObject:aKey] ) { + return YES; + } + else { + return [super needsDisplayForKey:aKey]; + } +} + +/// @endcond + +#pragma mark - +#pragma mark Data Ranges + +/// @cond + +-(nullable CPTPlotRange *)plotRangeEnclosingField:(NSUInteger)fieldEnum +{ + CPTPlotRange *range = [self plotRangeForField:fieldEnum]; + + if ( self.interpolation == CPTScatterPlotInterpolationCurved ) { + CPTPlotSpace *space = self.plotSpace; + + if ( space ) { + CGPathRef dataLinePath = self.newDataLinePath; + + CGRect boundingBox = CGPathGetBoundingBox(dataLinePath); + + CGPathRelease(dataLinePath); + + CPTNumberArray *lowerLeft = [space plotPointForPlotAreaViewPoint:boundingBox.origin]; + CPTNumberArray *upperRight = [space plotPointForPlotAreaViewPoint:CGPointMake(CGRectGetMaxX(boundingBox), + CGRectGetMaxY(boundingBox))]; + + switch ( fieldEnum ) { + case CPTScatterPlotFieldX: + { + NSNumber *length = [NSDecimalNumber decimalNumberWithDecimal: + CPTDecimalSubtract(upperRight[CPTCoordinateX].decimalValue, + lowerLeft[CPTCoordinateX].decimalValue)]; + range = [CPTPlotRange plotRangeWithLocation:lowerLeft[CPTCoordinateX] + length:length]; + } + break; + + case CPTScatterPlotFieldY: + { + NSNumber *length = [NSDecimalNumber decimalNumberWithDecimal: + CPTDecimalSubtract(upperRight[CPTCoordinateY].decimalValue, + lowerLeft[CPTCoordinateY].decimalValue)]; + range = [CPTPlotRange plotRangeWithLocation:lowerLeft[CPTCoordinateY] + length:length]; + } + break; + + default: + break; + } + } + } + + return range; +} + +/// @endcond + #pragma mark - #pragma mark Fields @@ -1284,23 +1748,23 @@ -(NSUInteger)numberOfFields return 2; } --(NSArray *)fieldIdentifiers +-(nonnull CPTNumberArray *)fieldIdentifiers { return @[@(CPTScatterPlotFieldX), @(CPTScatterPlotFieldY)]; } --(NSArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord +-(nonnull CPTNumberArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord { - NSArray *result = nil; + CPTNumberArray *result = nil; switch ( coord ) { case CPTCoordinateX: result = @[@(CPTScatterPlotFieldX)]; - break; + break; case CPTCoordinateY: result = @[@(CPTScatterPlotFieldY)]; - break; + break; default: [NSException raise:CPTException format:@"Invalid coordinate passed to fieldIdentifiersForCoordinate:"]; @@ -1336,7 +1800,7 @@ -(CPTCoordinate)coordinateForFieldIdentifier:(NSUInteger)field /// @cond --(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx +-(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx { NSNumber *xValue = [self cachedNumberForField:CPTScatterPlotFieldX recordIndex:idx]; NSNumber *yValue = [self cachedNumberForField:CPTScatterPlotFieldY recordIndex:idx]; @@ -1344,7 +1808,7 @@ -(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInte BOOL positiveDirection = YES; CPTPlotRange *yRange = [self.plotSpace plotRangeForCoordinate:CPTCoordinateY]; - if ( CPTDecimalLessThan( yRange.length, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalLessThan(yRange.lengthDecimal, CPTDecimalFromInteger(0))) { positiveDirection = !positiveDirection; } @@ -1370,14 +1834,15 @@ -(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInte * * @param limitBand The new limit band. **/ --(void)addAreaFillBand:(CPTLimitBand *)limitBand +-(void)addAreaFillBand:(nullable CPTLimitBand *)limitBand { if ( [limitBand isKindOfClass:[CPTLimitBand class]] ) { if ( !self.mutableAreaFillBands ) { self.mutableAreaFillBands = [NSMutableArray array]; } - [self.mutableAreaFillBands addObject:limitBand]; + CPTLimitBand *band = limitBand; + [self.mutableAreaFillBands addObject:band]; [self setNeedsDisplay]; } @@ -1386,12 +1851,14 @@ -(void)addAreaFillBand:(CPTLimitBand *)limitBand /** @brief Remove an area fill limit band. * @param limitBand The limit band to be removed. **/ --(void)removeAreaFillBand:(CPTLimitBand *)limitBand +-(void)removeAreaFillBand:(nullable CPTLimitBand *)limitBand { if ( limitBand ) { - NSMutableArray *fillBands = self.mutableAreaFillBands; + CPTMutableLimitBandArray *fillBands = self.mutableAreaFillBands; + + CPTLimitBand *band = limitBand; + [fillBands removeObject:band]; - [fillBands removeObject:limitBand]; if ( fillBands.count == 0 ) { self.mutableAreaFillBands = nil; } @@ -1435,7 +1902,7 @@ -(void)removeAreaFillBand:(CPTLimitBand *)limitBand * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { self.pointingDeviceDownIndex = NSNotFound; self.pointingDeviceDownOnLine = NO; @@ -1447,7 +1914,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; BOOL symbolTouchUpHandled = NO; if ( [theDelegate respondsToSelector:@selector(scatterPlot:plotSymbolTouchDownAtRecordIndex:)] || @@ -1472,9 +1939,9 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact CGFloat margin = self.plotSymbolMarginForHitDetection * CPTFloat(2.0); symbolRect.size.width += margin; symbolRect.size.height += margin; - symbolRect.origin = CPTPointMake( center.x - CPTFloat(0.5) * CGRectGetWidth(symbolRect), center.y - CPTFloat(0.5) * CGRectGetHeight(symbolRect) ); + symbolRect.origin = CPTPointMake(center.x - CPTFloat(0.5) * CGRectGetWidth(symbolRect), center.y - CPTFloat(0.5) * CGRectGetHeight(symbolRect)); - if ( CGRectContainsPoint(symbolRect, plotAreaPoint) ) { + if ( CGRectContainsPoint(symbolRect, plotAreaPoint)) { self.pointingDeviceDownIndex = idx; if ( [theDelegate respondsToSelector:@selector(scatterPlot:plotSymbolTouchDownAtRecordIndex:)] ) { @@ -1497,7 +1964,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact ([theDelegate respondsToSelector:@selector(scatterPlotDataLineTouchDown:)] || [theDelegate respondsToSelector:@selector(scatterPlot:dataLineTouchDownWithEvent:)] || [theDelegate respondsToSelector:@selector(scatterPlotDataLineWasSelected:)] || - [theDelegate respondsToSelector:@selector(scatterPlot:dataLineWasSelectedWithEvent:)]) ) { + [theDelegate respondsToSelector:@selector(scatterPlot:dataLineWasSelectedWithEvent:)])) { plotSelected = [self plotWasLineHitByInteractionPoint:interactionPoint]; if ( plotSelected ) { // Let the delegate know that the plot was selected. @@ -1550,7 +2017,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { NSUInteger selectedDownIndex = self.pointingDeviceDownIndex; @@ -1564,7 +2031,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; BOOL symbolSelectHandled = NO; if ( [theDelegate respondsToSelector:@selector(scatterPlot:plotSymbolTouchUpAtRecordIndex:)] || @@ -1589,9 +2056,9 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio CGFloat margin = self.plotSymbolMarginForHitDetection * CPTFloat(2.0); symbolRect.size.width += margin; symbolRect.size.height += margin; - symbolRect.origin = CPTPointMake( center.x - CPTFloat(0.5) * CGRectGetWidth(symbolRect), center.y - CPTFloat(0.5) * CGRectGetHeight(symbolRect) ); + symbolRect.origin = CPTPointMake(center.x - CPTFloat(0.5) * CGRectGetWidth(symbolRect), center.y - CPTFloat(0.5) * CGRectGetHeight(symbolRect)); - if ( CGRectContainsPoint(symbolRect, plotAreaPoint) ) { + if ( CGRectContainsPoint(symbolRect, plotAreaPoint)) { self.pointingDeviceDownIndex = idx; if ( [theDelegate respondsToSelector:@selector(scatterPlot:plotSymbolTouchUpAtRecordIndex:)] ) { @@ -1626,7 +2093,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio ([theDelegate respondsToSelector:@selector(scatterPlotDataLineTouchUp:)] || [theDelegate respondsToSelector:@selector(scatterPlot:dataLineTouchUpWithEvent:)] || [theDelegate respondsToSelector:@selector(scatterPlotDataLineWasSelected:)] || - [theDelegate respondsToSelector:@selector(scatterPlot:dataLineWasSelectedWithEvent:)]) ) { + [theDelegate respondsToSelector:@selector(scatterPlot:dataLineWasSelectedWithEvent:)])) { plotSelected = [self plotWasLineHitByInteractionPoint:interactionPoint]; if ( plotSelected ) { @@ -1670,8 +2137,8 @@ -(BOOL)plotWasLineHitByInteractionPoint:(CGPoint)interactionPoint NSUInteger dataCount = self.cachedDataCount; if ( theGraph && thePlotArea && !self.hidden && dataCount ) { - CGPoint *viewPoints = malloc( dataCount * sizeof(CGPoint) ); - BOOL *drawPointFlags = malloc( dataCount * sizeof(BOOL) ); + CGPoint *viewPoints = calloc(dataCount, sizeof(CGPoint)); + BOOL *drawPointFlags = calloc(dataCount, sizeof(BOOL)); CPTXYPlotSpace *thePlotSpace = (CPTXYPlotSpace *)self.plotSpace; [self calculatePointsToDraw:drawPointFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:NO numberOfPoints:dataCount]; @@ -1681,14 +2148,14 @@ -(BOOL)plotWasLineHitByInteractionPoint:(CGPoint)interactionPoint if ( firstDrawnPointIndex != NSNotFound ) { NSInteger lastDrawnPointIndex = [self extremeDrawnPointIndexForFlags:drawPointFlags numberOfPoints:dataCount extremeNumIsLowerBound:NO]; - NSRange viewIndexRange = NSMakeRange( (NSUInteger)firstDrawnPointIndex, (NSUInteger)(lastDrawnPointIndex - firstDrawnPointIndex + 1) ); - CGPathRef dataLinePath = [self newDataLinePathForViewPoints:viewPoints indexRange:viewIndexRange baselineYValue:NAN]; - CGPathRef path = CGPathCreateCopyByStrokingPath( dataLinePath, - NULL, - self.plotLineMarginForHitDetection * CPTFloat(2.0), - kCGLineCapRound, - kCGLineJoinRound, - CPTFloat(3.0) ); + NSRange viewIndexRange = NSMakeRange((NSUInteger)firstDrawnPointIndex, (NSUInteger)(lastDrawnPointIndex - firstDrawnPointIndex + 1)); + CGPathRef dataLinePath = [self newDataLinePathForViewPoints:viewPoints indexRange:viewIndexRange baselineYValue:CPTNAN]; + CGPathRef path = CGPathCreateCopyByStrokingPath(dataLinePath, + NULL, + self.plotLineMarginForHitDetection * CPTFloat(2.0), + kCGLineCapRound, + kCGLineJoinRound, + CPTFloat(3.0)); CGPoint plotAreaPoint = [theGraph convertPoint:interactionPoint toLayer:thePlotArea]; @@ -1719,7 +2186,38 @@ -(void)setInterpolation:(CPTScatterPlotInterpolation)newInterpolation } } --(void)setPlotSymbol:(CPTPlotSymbol *)aSymbol +-(void)setHistogramOption:(CPTScatterPlotHistogramOption)newHistogramOption +{ + if ( newHistogramOption != histogramOption ) { + histogramOption = newHistogramOption; + [self setNeedsDisplay]; + } +} + +-(void)setCurvedInterpolationOption:(CPTScatterPlotCurvedInterpolationOption)newCurvedInterpolationOption +{ + if ( newCurvedInterpolationOption != curvedInterpolationOption ) { + curvedInterpolationOption = newCurvedInterpolationOption; + [self setNeedsDisplay]; + } +} + +-(void)setCurvedInterpolationCustomAlpha:(CGFloat)newCurvedInterpolationCustomAlpha +{ + if ( newCurvedInterpolationCustomAlpha > CPTFloat(1.0)) { + newCurvedInterpolationCustomAlpha = CPTFloat(1.0); + } + if ( newCurvedInterpolationCustomAlpha < CPTFloat(0.0)) { + newCurvedInterpolationCustomAlpha = CPTFloat(0.0); + } + + if ( newCurvedInterpolationCustomAlpha != curvedInterpolationCustomAlpha ) { + curvedInterpolationCustomAlpha = newCurvedInterpolationCustomAlpha; + [self setNeedsDisplay]; + } +} + +-(void)setPlotSymbol:(nullable CPTPlotSymbol *)aSymbol { if ( aSymbol != plotSymbol ) { plotSymbol = [aSymbol copy]; @@ -1728,7 +2226,7 @@ -(void)setPlotSymbol:(CPTPlotSymbol *)aSymbol } } --(void)setDataLineStyle:(CPTLineStyle *)newLineStyle +-(void)setDataLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( dataLineStyle != newLineStyle ) { dataLineStyle = [newLineStyle copy]; @@ -1737,7 +2235,7 @@ -(void)setDataLineStyle:(CPTLineStyle *)newLineStyle } } --(void)setAreaFill:(CPTFill *)newFill +-(void)setAreaFill:(nullable CPTFill *)newFill { if ( newFill != areaFill ) { areaFill = [newFill copy]; @@ -1746,7 +2244,7 @@ -(void)setAreaFill:(CPTFill *)newFill } } --(void)setAreaFill2:(CPTFill *)newFill +-(void)setAreaFill2:(nullable CPTFill *)newFill { if ( newFill != areaFill2 ) { areaFill2 = [newFill copy]; @@ -1755,58 +2253,70 @@ -(void)setAreaFill2:(CPTFill *)newFill } } --(NSArray *)areaFillBands +-(nullable CPTLimitBandArray *)areaFillBands { return [self.mutableAreaFillBands copy]; } --(void)setAreaBaseValue:(NSDecimal)newAreaBaseValue +-(void)setAreaBaseValue:(nullable NSNumber *)newAreaBaseValue { - if ( CPTDecimalEquals(areaBaseValue, newAreaBaseValue) ) { - return; + BOOL needsUpdate = YES; + + if ( newAreaBaseValue ) { + NSNumber *baseValue = newAreaBaseValue; + needsUpdate = ![areaBaseValue isEqualToNumber:baseValue]; + } + + if ( needsUpdate ) { + areaBaseValue = newAreaBaseValue; + [self setNeedsDisplay]; + [[NSNotificationCenter defaultCenter] postNotificationName:CPTLegendNeedsRedrawForPlotNotification object:self]; } - areaBaseValue = newAreaBaseValue; - [self setNeedsDisplay]; - [[NSNotificationCenter defaultCenter] postNotificationName:CPTLegendNeedsRedrawForPlotNotification object:self]; } --(void)setAreaBaseValue2:(NSDecimal)newAreaBaseValue +-(void)setAreaBaseValue2:(nullable NSNumber *)newAreaBaseValue { - if ( CPTDecimalEquals(areaBaseValue2, newAreaBaseValue) ) { - return; + BOOL needsUpdate = YES; + + if ( newAreaBaseValue ) { + NSNumber *baseValue = newAreaBaseValue; + needsUpdate = ![areaBaseValue2 isEqualToNumber:baseValue]; + } + + if ( needsUpdate ) { + areaBaseValue2 = newAreaBaseValue; + [self setNeedsDisplay]; + [[NSNotificationCenter defaultCenter] postNotificationName:CPTLegendNeedsRedrawForPlotNotification object:self]; } - areaBaseValue2 = newAreaBaseValue; - [self setNeedsDisplay]; - [[NSNotificationCenter defaultCenter] postNotificationName:CPTLegendNeedsRedrawForPlotNotification object:self]; } --(void)setXValues:(NSArray *)newValues +-(void)setXValues:(nullable CPTNumberArray *)newValues { [self cacheNumbers:newValues forField:CPTScatterPlotFieldX]; } --(NSArray *)xValues +-(nullable CPTNumberArray *)xValues { return [[self cachedNumbersForField:CPTScatterPlotFieldX] sampleArray]; } --(void)setYValues:(NSArray *)newValues +-(void)setYValues:(nullable CPTNumberArray *)newValues { [self cacheNumbers:newValues forField:CPTScatterPlotFieldY]; } --(NSArray *)yValues +-(nullable CPTNumberArray *)yValues { return [[self cachedNumbersForField:CPTScatterPlotFieldY] sampleArray]; } --(void)setPlotSymbols:(NSArray *)newSymbols +-(void)setPlotSymbols:(nullable CPTPlotSymbolArray *)newSymbols { [self cacheArray:newSymbols forKey:CPTScatterPlotBindingPlotSymbols]; [self setNeedsDisplay]; } --(NSArray *)plotSymbols +-(nullable CPTPlotSymbolArray *)plotSymbols { return [self cachedArrayForKey:CPTScatterPlotBindingPlotSymbols]; } diff --git a/framework/Source/CPTScatterPlotTests.h b/framework/Source/CPTScatterPlotTests.h index 04095e993..994599bdd 100644 --- a/framework/Source/CPTScatterPlotTests.h +++ b/framework/Source/CPTScatterPlotTests.h @@ -1,9 +1,11 @@ #import "CPTTestCase.h" -#import + +@class CPTScatterPlot; +@class CPTXYPlotSpace; @interface CPTScatterPlotTests : CPTTestCase -@property (nonatomic, readwrite, strong) CPTScatterPlot *plot; -@property (nonatomic, readwrite, strong) CPTXYPlotSpace *plotSpace; +@property (nonatomic, readwrite, strong, nullable) CPTScatterPlot *plot; +@property (nonatomic, readwrite, strong, nullable) CPTXYPlotSpace *plotSpace; @end diff --git a/framework/Source/CPTScatterPlotTests.m b/framework/Source/CPTScatterPlotTests.m index b868f3d09..5cecafe5b 100644 --- a/framework/Source/CPTScatterPlotTests.m +++ b/framework/Source/CPTScatterPlotTests.m @@ -1,10 +1,14 @@ #import "CPTScatterPlotTests.h" +#import "CPTPlotRange.h" +#import "CPTScatterPlot.h" +#import "CPTXYPlotSpace.h" + @interface CPTScatterPlot(Testing) --(void)calculatePointsToDraw:(BOOL *)pointDrawFlags forPlotSpace:(CPTXYPlotSpace *)xyPlotSpace includeVisiblePointsOnly:(BOOL)visibleOnly numberOfPoints:(NSUInteger)dataCount; --(void)setXValues:(NSArray *)newValues; --(void)setYValues:(NSArray *)newValues; +-(void)calculatePointsToDraw:(nonnull BOOL *)pointDrawFlags forPlotSpace:(nonnull CPTXYPlotSpace *)xyPlotSpace includeVisiblePointsOnly:(BOOL)visibleOnly numberOfPoints:(NSUInteger)dataCount; +-(void)setXValues:(nullable CPTNumberArray *)newValues; +-(void)setYValues:(nullable CPTNumberArray *)newValues; @end @@ -15,18 +19,14 @@ @implementation CPTScatterPlotTests -(void)setUp { - double values[5] = { 0.5, 0.5, 0.5, 0.5, 0.5 }; + CPTNumberArray *yValues = @[@0.5, @0.5, @0.5, @0.5, @0.5]; self.plot = [CPTScatterPlot new]; - NSMutableArray *yValues = [NSMutableArray array]; - for ( NSInteger i = 0; i < 5; i++ ) { - [yValues addObject:@(values[i])]; - } [self.plot setYValues:yValues]; self.plot.cachePrecision = CPTPlotCachePrecisionDouble; - CPTPlotRange *xPlotRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromInteger(0) length:CPTDecimalFromInteger(1)]; - CPTPlotRange *yPlotRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromInteger(0) length:CPTDecimalFromInteger(1)]; + CPTPlotRange *xPlotRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@1.0]; + CPTPlotRange *yPlotRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@1.0]; self.plotSpace = [[CPTXYPlotSpace alloc] init]; self.plotSpace.xRange = xPlotRange; self.plotSpace.yRange = yPlotRange; @@ -40,184 +40,209 @@ -(void)tearDown -(void)testCalculatePointsToDrawAllInRange { - BOOL drawFlags[5]; - double inRangeValues[5] = { 0.1, 0.2, 0.15, 0.6, 0.9 }; - NSMutableArray *values = [NSMutableArray array]; + CPTNumberArray *inRangeValues = @[@0.1, @0.2, @0.15, @0.6, @0.9]; - for ( NSUInteger i = 0; i < 5; i++ ) { - [values addObject:@(inRangeValues[i])]; - } - [self.plot setXValues:values]; - [self.plot calculatePointsToDraw:drawFlags forPlotSpace:self.plotSpace includeVisiblePointsOnly:NO numberOfPoints:values.count]; - for ( NSUInteger i = 0; i < 5; i++ ) { - XCTAssertTrue(drawFlags[i], @"Test that in range points are drawn (%g).", inRangeValues[i]); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); + + CPTXYPlotSpace *thePlotSpace = self.plotSpace; + + [self.plot setXValues:inRangeValues]; + [self.plot calculatePointsToDraw:drawFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:NO numberOfPoints:inRangeValues.count]; + + for ( NSUInteger i = 0; i < inRangeValues.count; i++ ) { + XCTAssertTrue(drawFlags[i], @"Test that in range points are drawn (%@).", inRangeValues[i]); } + + free(drawFlags); } -(void)testCalculatePointsToDrawAllInRangeVisibleOnly { - BOOL drawFlags[5]; - double inRangeValues[5] = { 0.1, 0.2, 0.15, 0.6, 0.9 }; - NSMutableArray *values = [NSMutableArray array]; + CPTNumberArray *inRangeValues = @[@0.1, @0.2, @0.15, @0.6, @0.9]; - for ( NSUInteger i = 0; i < 5; i++ ) { - [values addObject:@(inRangeValues[i])]; - } - [self.plot setXValues:values]; - [self.plot calculatePointsToDraw:drawFlags forPlotSpace:self.plotSpace includeVisiblePointsOnly:YES numberOfPoints:values.count]; - for ( NSUInteger i = 0; i < 5; i++ ) { - XCTAssertTrue(drawFlags[i], @"Test that in range points are drawn (%g).", inRangeValues[i]); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); + + CPTXYPlotSpace *thePlotSpace = self.plotSpace; + + [self.plot setXValues:inRangeValues]; + [self.plot calculatePointsToDraw:drawFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:YES numberOfPoints:inRangeValues.count]; + + for ( NSUInteger i = 0; i < inRangeValues.count; i++ ) { + XCTAssertTrue(drawFlags[i], @"Test that in range points are drawn (%@).", inRangeValues[i]); } + + free(drawFlags); } -(void)testCalculatePointsToDrawNoneInRange { - BOOL drawFlags[5]; - double inRangeValues[5] = { -0.1, -0.2, -0.15, -0.6, -0.9 }; - NSMutableArray *values = [NSMutableArray array]; + CPTNumberArray *inRangeValues = @[@(-0.1), @(-0.2), @(-0.15), @(-0.6), @(-0.9)]; - for ( NSUInteger i = 0; i < 5; i++ ) { - [values addObject:@(inRangeValues[i])]; - } - [self.plot setXValues:values]; - [self.plot calculatePointsToDraw:drawFlags forPlotSpace:self.plotSpace includeVisiblePointsOnly:NO numberOfPoints:values.count]; - for ( NSUInteger i = 0; i < 5; i++ ) { - XCTAssertFalse(drawFlags[i], @"Test that out of range points are not drawn (%g).", inRangeValues[i]); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); + + CPTXYPlotSpace *thePlotSpace = self.plotSpace; + + [self.plot setXValues:inRangeValues]; + [self.plot calculatePointsToDraw:drawFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:NO numberOfPoints:inRangeValues.count]; + + for ( NSUInteger i = 0; i < inRangeValues.count; i++ ) { + XCTAssertFalse(drawFlags[i], @"Test that out of range points are not drawn (%@).", inRangeValues[i]); } + + free(drawFlags); } -(void)testCalculatePointsToDrawNoneInRangeVisibleOnly { - BOOL drawFlags[5]; - double inRangeValues[5] = { -0.1, -0.2, -0.15, -0.6, -0.9 }; - NSMutableArray *values = [NSMutableArray array]; + CPTNumberArray *inRangeValues = @[@(-0.1), @(-0.2), @(-0.15), @(-0.6), @(-0.9)]; - for ( NSUInteger i = 0; i < 5; i++ ) { - [values addObject:@(inRangeValues[i])]; - } - [self.plot setXValues:values]; - [self.plot calculatePointsToDraw:drawFlags forPlotSpace:self.plotSpace includeVisiblePointsOnly:YES numberOfPoints:values.count]; - for ( NSUInteger i = 0; i < 5; i++ ) { - XCTAssertFalse(drawFlags[i], @"Test that out of range points are not drawn (%g).", inRangeValues[i]); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); + + CPTXYPlotSpace *thePlotSpace = self.plotSpace; + + [self.plot setXValues:inRangeValues]; + [self.plot calculatePointsToDraw:drawFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:YES numberOfPoints:inRangeValues.count]; + + for ( NSUInteger i = 0; i < inRangeValues.count; i++ ) { + XCTAssertFalse(drawFlags[i], @"Test that out of range points are not drawn (%@).", inRangeValues[i]); } + + free(drawFlags); } -(void)testCalculatePointsToDrawNoneInRangeDifferentRegions { - BOOL drawFlags[5]; - double inRangeValues[5] = { -0.1, 2, -0.15, 3, -0.9 }; - NSMutableArray *values = [NSMutableArray array]; + CPTNumberArray *inRangeValues = @[@(-0.1), @2, @(-0.15), @3, @(-0.9)]; - for ( NSUInteger i = 0; i < 5; i++ ) { - [values addObject:@(inRangeValues[i])]; - } - [self.plot setXValues:values]; - [self.plot calculatePointsToDraw:drawFlags forPlotSpace:self.plotSpace includeVisiblePointsOnly:NO numberOfPoints:values.count]; - for ( NSUInteger i = 0; i < 5; i++ ) { - XCTAssertTrue(drawFlags[i], @"Test that out of range points in different regions get included (%g).", inRangeValues[i]); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); + + CPTXYPlotSpace *thePlotSpace = self.plotSpace; + + [self.plot setXValues:inRangeValues]; + [self.plot calculatePointsToDraw:drawFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:NO numberOfPoints:inRangeValues.count]; + + for ( NSUInteger i = 0; i < inRangeValues.count; i++ ) { + XCTAssertTrue(drawFlags[i], @"Test that out of range points in different regions get included (%@).", inRangeValues[i]); } + + free(drawFlags); } -(void)testCalculatePointsToDrawNoneInRangeDifferentRegionsVisibleOnly { - BOOL drawFlags[5]; - double inRangeValues[5] = { -0.1, 2, -0.15, 3, -0.9 }; - NSMutableArray *values = [NSMutableArray array]; + CPTNumberArray *inRangeValues = @[@(-0.1), @2, @(-0.15), @3, @(-0.9)]; - for ( NSUInteger i = 0; i < 5; i++ ) { - [values addObject:@(inRangeValues[i])]; - } - [self.plot setXValues:values]; - [self.plot calculatePointsToDraw:drawFlags forPlotSpace:self.plotSpace includeVisiblePointsOnly:YES numberOfPoints:values.count]; - for ( NSUInteger i = 0; i < 5; i++ ) { - XCTAssertFalse(drawFlags[i], @"Test that out of range points in different regions get included (%g).", inRangeValues[i]); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); + + CPTXYPlotSpace *thePlotSpace = self.plotSpace; + + [self.plot setXValues:inRangeValues]; + [self.plot calculatePointsToDraw:drawFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:YES numberOfPoints:inRangeValues.count]; + + for ( NSUInteger i = 0; i < inRangeValues.count; i++ ) { + XCTAssertFalse(drawFlags[i], @"Test that out of range points in different regions get included (%@).", inRangeValues[i]); } + + free(drawFlags); } -(void)testCalculatePointsToDrawSomeInRange { - BOOL drawFlags[5]; - double inRangeValues[5] = { -0.1, 0.1, 0.2, 1.2, 1.5 }; - BOOL expected[5] = { YES, YES, YES, YES, NO }; - NSMutableArray *values = [NSMutableArray array]; + CPTNumberArray *inRangeValues = @[@(-0.1), @0.1, @0.2, @1.2, @1.5]; + BOOL expected[5] = { YES, YES, YES, YES, NO }; - for ( NSUInteger i = 0; i < 5; i++ ) { - [values addObject:@(inRangeValues[i])]; - } - [self.plot setXValues:values]; - [self.plot calculatePointsToDraw:drawFlags forPlotSpace:self.plotSpace includeVisiblePointsOnly:NO numberOfPoints:values.count]; - for ( NSUInteger i = 0; i < 5; i++ ) { + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); + + CPTXYPlotSpace *thePlotSpace = self.plotSpace; + + [self.plot setXValues:inRangeValues]; + [self.plot calculatePointsToDraw:drawFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:NO numberOfPoints:inRangeValues.count]; + for ( NSUInteger i = 0; i < inRangeValues.count; i++ ) { if ( expected[i] ) { - XCTAssertTrue(drawFlags[i], @"Test that correct points included when some are in range, others out (%g).", inRangeValues[i]); + XCTAssertTrue(drawFlags[i], @"Test that correct points included when some are in range, others out (%@).", inRangeValues[i]); } else { - XCTAssertFalse(drawFlags[i], @"Test that correct points included when some are in range, others out (%g).", inRangeValues[i]); + XCTAssertFalse(drawFlags[i], @"Test that correct points included when some are in range, others out (%@).", inRangeValues[i]); } } + + free(drawFlags); } -(void)testCalculatePointsToDrawSomeInRangeVisibleOnly { - BOOL drawFlags[5]; - double inRangeValues[5] = { -0.1, 0.1, 0.2, 1.2, 1.5 }; - NSMutableArray *values = [NSMutableArray array]; + CPTNumberArray *inRangeValues = @[@(-0.1), @0.1, @0.2, @1.2, @1.5]; - for ( NSUInteger i = 0; i < 5; i++ ) { - [values addObject:@(inRangeValues[i])]; - } - [self.plot setXValues:values]; - [self.plot calculatePointsToDraw:drawFlags forPlotSpace:self.plotSpace includeVisiblePointsOnly:YES numberOfPoints:values.count]; - for ( NSUInteger i = 0; i < 5; i++ ) { - if ( [self.plotSpace.xRange compareToNumber:@(inRangeValues[i])] == CPTPlotRangeComparisonResultNumberInRange ) { - XCTAssertTrue(drawFlags[i], @"Test that correct points included when some are in range, others out (%g).", inRangeValues[i]); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); + + CPTXYPlotSpace *thePlotSpace = self.plotSpace; + + [self.plot setXValues:inRangeValues]; + [self.plot calculatePointsToDraw:drawFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:YES numberOfPoints:inRangeValues.count]; + + for ( NSUInteger i = 0; i < inRangeValues.count; i++ ) { + if ( [self.plotSpace.xRange compareToNumber:inRangeValues[i]] == CPTPlotRangeComparisonResultNumberInRange ) { + XCTAssertTrue(drawFlags[i], @"Test that correct points included when some are in range, others out (%@).", inRangeValues[i]); } else { - XCTAssertFalse(drawFlags[i], @"Test that correct points included when some are in range, others out (%g).", inRangeValues[i]); + XCTAssertFalse(drawFlags[i], @"Test that correct points included when some are in range, others out (%@).", inRangeValues[i]); } } + + free(drawFlags); } -(void)testCalculatePointsToDrawSomeInRangeCrossing { - BOOL drawFlags[5]; - double inRangeValues[5] = { -0.1, 1.1, 0.9, -0.1, -0.2 }; - BOOL expected[5] = { YES, YES, YES, YES, NO }; - NSMutableArray *values = [NSMutableArray array]; + CPTNumberArray *inRangeValues = @[@(-0.1), @1.1, @0.9, @(-0.1), @(-0.2)]; + + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); + BOOL *expected = calloc(inRangeValues.count, sizeof(BOOL)); - for ( NSUInteger i = 0; i < 5; i++ ) { - [values addObject:@(inRangeValues[i])]; + for ( NSUInteger i = 0; i < inRangeValues.count - 1; i++ ) { + expected[i] = YES; } - [self.plot setXValues:values]; - [self.plot calculatePointsToDraw:drawFlags forPlotSpace:self.plotSpace includeVisiblePointsOnly:NO numberOfPoints:values.count]; - for ( NSUInteger i = 0; i < 5; i++ ) { + expected[inRangeValues.count] = NO; + + CPTXYPlotSpace *thePlotSpace = self.plotSpace; + + [self.plot setXValues:inRangeValues]; + [self.plot calculatePointsToDraw:drawFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:NO numberOfPoints:inRangeValues.count]; + + for ( NSUInteger i = 0; i < inRangeValues.count; i++ ) { if ( expected[i] ) { - XCTAssertTrue(drawFlags[i], @"Test that correct points included when some are in range, others out, crossing range (%g).", inRangeValues[i]); + XCTAssertTrue(drawFlags[i], @"Test that correct points included when some are in range, others out, crossing range (%@).", inRangeValues[i]); } else { - XCTAssertFalse(drawFlags[i], @"Test that correct points included when some are in range, others out, crossing range (%g).", inRangeValues[i]); + XCTAssertFalse(drawFlags[i], @"Test that correct points included when some are in range, others out, crossing range (%@).", inRangeValues[i]); } } + + free(drawFlags); + free(expected); } -(void)testCalculatePointsToDrawSomeInRangeCrossingVisibleOnly { - BOOL drawFlags[5]; - double inRangeValues[5] = { -0.1, 1.1, 0.9, -0.1, -0.2 }; - NSMutableArray *values = [NSMutableArray array]; + CPTNumberArray *inRangeValues = @[@(-0.1), @1.1, @0.9, @(-0.1), @(-0.2)]; - for ( NSUInteger i = 0; i < 5; i++ ) { - [values addObject:@(inRangeValues[i])]; - } - [self.plot setXValues:values]; - [self.plot calculatePointsToDraw:drawFlags forPlotSpace:self.plotSpace includeVisiblePointsOnly:YES numberOfPoints:values.count]; - for ( NSUInteger i = 0; i < 5; i++ ) { - if ( [self.plotSpace.xRange compareToNumber:@(inRangeValues[i])] == CPTPlotRangeComparisonResultNumberInRange ) { - XCTAssertTrue(drawFlags[i], @"Test that correct points included when some are in range, others out, crossing range (%g).", inRangeValues[i]); + BOOL *drawFlags = calloc(inRangeValues.count, sizeof(BOOL)); + + CPTXYPlotSpace *thePlotSpace = self.plotSpace; + + [self.plot setXValues:inRangeValues]; + [self.plot calculatePointsToDraw:drawFlags forPlotSpace:thePlotSpace includeVisiblePointsOnly:YES numberOfPoints:inRangeValues.count]; + + for ( NSUInteger i = 0; i < inRangeValues.count; i++ ) { + if ( [self.plotSpace.xRange compareToNumber:inRangeValues[i]] == CPTPlotRangeComparisonResultNumberInRange ) { + XCTAssertTrue(drawFlags[i], @"Test that correct points included when some are in range, others out, crossing range (%@).", inRangeValues[i]); } else { - XCTAssertFalse(drawFlags[i], @"Test that correct points included when some are in range, others out, crossing range (%g).", inRangeValues[i]); + XCTAssertFalse(drawFlags[i], @"Test that correct points included when some are in range, others out, crossing range (%@).", inRangeValues[i]); } } + + free(drawFlags); } @end diff --git a/framework/Source/CPTShadow.h b/framework/Source/CPTShadow.h index 9ccc09b80..758ba528a 100644 --- a/framework/Source/CPTShadow.h +++ b/framework/Source/CPTShadow.h @@ -1,19 +1,19 @@ @class CPTColor; -@interface CPTShadow : NSObject +@interface CPTShadow : NSObject @property (nonatomic, readonly) CGSize shadowOffset; @property (nonatomic, readonly) CGFloat shadowBlurRadius; -@property (nonatomic, readonly) CPTColor *shadowColor; +@property (nonatomic, readonly, nullable) CPTColor *shadowColor; /// @name Factory Methods /// @{ -+(instancetype)shadow; ++(nonnull instancetype)shadow; /// @} /// @name Drawing /// @{ --(void)setShadowInContext:(CGContextRef)context; +-(void)setShadowInContext:(nonnull CGContextRef)context; /// @} @end diff --git a/framework/Source/CPTShadow.m b/framework/Source/CPTShadow.m index f3426df6f..6204c3943 100644 --- a/framework/Source/CPTShadow.m +++ b/framework/Source/CPTShadow.m @@ -40,7 +40,7 @@ @implementation CPTShadow **/ @synthesize shadowBlurRadius; -/** @property CPTColor *shadowColor +/** @property nullable CPTColor *shadowColor * @brief The shadow color. If @nil (the default), the shadow will not be drawn. **/ @synthesize shadowColor; @@ -51,7 +51,7 @@ @implementation CPTShadow /** @brief Creates and returns a new CPTShadow instance. * @return A new CPTShadow instance. **/ -+(instancetype)shadow ++(nonnull instancetype)shadow { return [[self alloc] init]; } @@ -68,9 +68,9 @@ +(instancetype)shadow * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { shadowOffset = CGSizeZero; shadowBlurRadius = CPTFloat(0.0); shadowColor = nil; @@ -85,32 +85,45 @@ -(instancetype)init /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeCPTSize:self.shadowOffset forKey:@"CPTShadow.shadowOffset"]; [coder encodeCGFloat:self.shadowBlurRadius forKey:@"CPTShadow.shadowBlurRadius"]; [coder encodeObject:self.shadowColor forKey:@"CPTShadow.shadowColor"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { shadowOffset = [coder decodeCPTSizeForKey:@"CPTShadow.shadowOffset"]; shadowBlurRadius = [coder decodeCGFloatForKey:@"CPTShadow.shadowBlurRadius"]; - shadowColor = [coder decodeObjectForKey:@"CPTShadow.shadowColor"]; + shadowColor = [coder decodeObjectOfClass:[CPTColor class] + forKey:@"CPTShadow.shadowColor"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing /** @brief Sets the shadow properties in the given graphics context. * @param context The graphics context. **/ --(void)setShadowInContext:(CGContextRef)context +-(void)setShadowInContext:(nonnull CGContextRef)context { CGContextSetShadowWithColor(context, self.shadowOffset, @@ -123,7 +136,7 @@ -(void)setShadowInContext:(CGContextRef)context /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { CPTShadow *shadowCopy = [[CPTShadow allocWithZone:zone] init]; @@ -141,7 +154,7 @@ -(id)copyWithZone:(NSZone *)zone /// @cond --(id)mutableCopyWithZone:(NSZone *)zone +-(nonnull id)mutableCopyWithZone:(nullable NSZone *)zone { CPTShadow *shadowCopy = [[CPTMutableShadow allocWithZone:zone] init]; @@ -161,7 +174,7 @@ -(id)mutableCopyWithZone:(NSZone *)zone -(void)setShadowBlurRadius:(CGFloat)newShadowBlurRadius { - NSParameterAssert(newShadowBlurRadius >= 0.0); + NSParameterAssert(newShadowBlurRadius >= CPTFloat(0.0)); if ( newShadowBlurRadius != shadowBlurRadius ) { shadowBlurRadius = newShadowBlurRadius; diff --git a/framework/Source/CPTTestCase.h b/framework/Source/CPTTestCase.h index 5be665d34..b87b0c191 100644 --- a/framework/Source/CPTTestCase.h +++ b/framework/Source/CPTTestCase.h @@ -2,4 +2,7 @@ @interface CPTTestCase : XCTestCase +-(nullable id)archiveRoundTrip:(nonnull id)object toClass:(nonnull Class)archiveClass; +-(nullable id)archiveRoundTrip:(nonnull id)object; + @end diff --git a/framework/Source/CPTTestCase.m b/framework/Source/CPTTestCase.m index d1fffb5c9..effe3adec 100644 --- a/framework/Source/CPTTestCase.m +++ b/framework/Source/CPTTestCase.m @@ -2,4 +2,28 @@ @implementation CPTTestCase +-(nullable id)archiveRoundTrip:(nonnull id)object +{ + return [self archiveRoundTrip:object toClass:[object class]]; +} + +-(nullable id)archiveRoundTrip:(nonnull id)object toClass:(nonnull Class)archiveClass +{ + const BOOL secure = ![archiveClass isSubclassOfClass:[NSNumberFormatter class]]; + + NSMutableData *archiveData = [[NSMutableData alloc] init]; + + NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:archiveData]; + + archiver.requiresSecureCoding = secure; + + [archiver encodeObject:object forKey:@"test"]; + [archiver finishEncoding]; + + NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:archiveData]; + unarchiver.requiresSecureCoding = secure; + + return [unarchiver decodeObjectOfClass:archiveClass forKey:@"test"]; +} + @end diff --git a/framework/Source/CPTTextLayer.h b/framework/Source/CPTTextLayer.h index 5c841a2ce..9f3c6773b 100644 --- a/framework/Source/CPTTextLayer.h +++ b/framework/Source/CPTTextLayer.h @@ -7,16 +7,19 @@ extern const CGFloat kCPTTextLayerMarginWidth; ///< Margin width around the text @interface CPTTextLayer : CPTBorderedLayer -@property (readwrite, copy, nonatomic) NSString *text; -@property (readwrite, strong, nonatomic) CPTTextStyle *textStyle; -@property (readwrite, copy, nonatomic) NSAttributedString *attributedText; +@property (readwrite, copy, nonatomic, nullable) NSString *text; +@property (readwrite, strong, nonatomic, nullable) CPTTextStyle *textStyle; +@property (readwrite, copy, nonatomic, nullable) NSAttributedString *attributedText; @property (readwrite, nonatomic) CGSize maximumSize; /// @name Initialization /// @{ --(instancetype)initWithText:(NSString *)newText; --(instancetype)initWithText:(NSString *)newText style:(CPTTextStyle *)newStyle; --(instancetype)initWithAttributedText:(NSAttributedString *)newText; +-(nonnull instancetype)initWithText:(nullable NSString *)newText; +-(nonnull instancetype)initWithText:(nullable NSString *)newText style:(nullable CPTTextStyle *)newStyle NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithAttributedText:(nullable NSAttributedString *)newText; + +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithLayer:(nonnull id)layer NS_DESIGNATED_INITIALIZER; /// @} /// @name Layout diff --git a/framework/Source/CPTTextLayer.m b/framework/Source/CPTTextLayer.m index 05412a560..45a208f31 100644 --- a/framework/Source/CPTTextLayer.m +++ b/framework/Source/CPTTextLayer.m @@ -24,7 +24,7 @@ @interface CPTTextLayer() **/ @implementation CPTTextLayer -/** @property NSString *text +/** @property nullable NSString *text * @brief The text to display. * * Assigning a new value to this property also sets the value of the @ref attributedText property to @nil. @@ -32,14 +32,14 @@ @implementation CPTTextLayer **/ @synthesize text; -/** @property CPTTextStyle *textStyle +/** @property nullable CPTTextStyle *textStyle * @brief The text style used to draw the text. * * Assigning a new value to this property also sets the value of the @ref attributedText property to @nil. **/ @synthesize textStyle; -/** @property NSAttributedString *attributedText +/** @property nullable NSAttributedString *attributedText * @brief The styled text to display. * * Assigning a new value to this property also sets the value of the @ref text property to the @@ -69,9 +69,9 @@ @implementation CPTTextLayer * @param newStyle The text style used to draw the text. * @return The initialized CPTTextLayer object. **/ --(instancetype)initWithText:(NSString *)newText style:(CPTTextStyle *)newStyle +-(nonnull instancetype)initWithText:(nullable NSString *)newText style:(nullable CPTTextStyle *)newStyle { - if ( (self = [super initWithFrame:CGRectZero]) ) { + if ((self = [super initWithFrame:CGRectZero])) { textStyle = newStyle; text = [newText copy]; attributedText = nil; @@ -89,7 +89,7 @@ -(instancetype)initWithText:(NSString *)newText style:(CPTTextStyle *)newStyle * @param newText The text to display. * @return The initialized CPTTextLayer object. **/ --(instancetype)initWithText:(NSString *)newText +-(nonnull instancetype)initWithText:(nullable NSString *)newText { return [self initWithText:newText style:[CPTTextStyle textStyle]]; } @@ -98,11 +98,11 @@ -(instancetype)initWithText:(NSString *)newText * @param newText The styled text to display. * @return The initialized CPTTextLayer object. **/ --(instancetype)initWithAttributedText:(NSAttributedString *)newText +-(nonnull instancetype)initWithAttributedText:(nullable NSAttributedString *)newText { CPTTextStyle *newStyle = [CPTTextStyle textStyleWithAttributes:[newText attributesAtIndex:0 effectiveRange:NULL]]; - if ( (self = [self initWithText:newText.string style:newStyle]) ) { + if ((self = [self initWithText:newText.string style:newStyle])) { attributedText = [newText copy]; [self sizeToFit]; @@ -113,9 +113,9 @@ -(instancetype)initWithAttributedText:(NSAttributedString *)newText /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTTextLayer *theLayer = (CPTTextLayer *)layer; textStyle = theLayer->textStyle; @@ -141,7 +141,7 @@ -(instancetype)initWithLayer:(id)layer * @param newFrame The frame rectangle. * @return The initialized CPTTextLayer object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect __unused)newFrame { return [self initWithText:nil style:nil]; } @@ -153,7 +153,7 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -165,12 +165,15 @@ -(void)encodeWithCoder:(NSCoder *)coder // inTextUpdate } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - textStyle = [coder decodeObjectForKey:@"CPTTextLayer.textStyle"]; - text = [[coder decodeObjectForKey:@"CPTTextLayer.text"] copy]; - attributedText = [[coder decodeObjectForKey:@"CPTTextLayer.attributedText"] copy]; + if ((self = [super initWithCoder:coder])) { + textStyle = [coder decodeObjectOfClass:[CPTTextStyle class] + forKey:@"CPTTextLayer.textStyle"]; + text = [[coder decodeObjectOfClass:[NSString class] + forKey:@"CPTTextLayer.text"] copy]; + attributedText = [[coder decodeObjectOfClass:[NSAttributedString class] + forKey:@"CPTTextLayer.attributedText"] copy]; inTextUpdate = NO; } @@ -179,12 +182,24 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Accessors /// @cond --(void)setText:(NSString *)newValue +-(void)setText:(nullable NSString *)newValue { if ( text != newValue ) { text = [newValue copy]; @@ -199,7 +214,7 @@ -(void)setText:(NSString *)newValue } } --(void)setTextStyle:(CPTTextStyle *)newStyle +-(void)setTextStyle:(nullable CPTTextStyle *)newStyle { if ( textStyle != newStyle ) { textStyle = newStyle; @@ -214,7 +229,7 @@ -(void)setTextStyle:(CPTTextStyle *)newStyle } } --(void)setAttributedText:(NSAttributedString *)newValue +-(void)setAttributedText:(nullable NSAttributedString *)newValue { if ( attributedText != newValue ) { attributedText = [newValue copy]; @@ -240,16 +255,16 @@ -(void)setAttributedText:(NSAttributedString *)newValue -(void)setMaximumSize:(CGSize)newSize { - if ( !CGSizeEqualToSize(maximumSize, newSize) ) { + if ( !CGSizeEqualToSize(maximumSize, newSize)) { maximumSize = newSize; [self sizeToFit]; } } --(void)setShadow:(CPTShadow *)newShadow +-(void)setShadow:(nullable CPTShadow *)newShadow { if ( newShadow != self.shadow ) { - [super setShadow:newShadow]; + super.shadow = newShadow; [self sizeToFit]; } } @@ -257,7 +272,7 @@ -(void)setShadow:(CPTShadow *)newShadow -(void)setPaddingLeft:(CGFloat)newPadding { if ( newPadding != self.paddingLeft ) { - [super setPaddingLeft:newPadding]; + super.paddingLeft = newPadding; [self sizeToFit]; } } @@ -265,7 +280,7 @@ -(void)setPaddingLeft:(CGFloat)newPadding -(void)setPaddingRight:(CGFloat)newPadding { if ( newPadding != self.paddingRight ) { - [super setPaddingRight:newPadding]; + super.paddingRight = newPadding; [self sizeToFit]; } } @@ -273,7 +288,7 @@ -(void)setPaddingRight:(CGFloat)newPadding -(void)setPaddingTop:(CGFloat)newPadding { if ( newPadding != self.paddingTop ) { - [super setPaddingTop:newPadding]; + super.paddingTop = newPadding; [self sizeToFit]; } } @@ -281,7 +296,7 @@ -(void)setPaddingTop:(CGFloat)newPadding -(void)setPaddingBottom:(CGFloat)newPadding { if ( newPadding != self.paddingBottom ) { - [super setPaddingBottom:newPadding]; + super.paddingBottom = newPadding; [self sizeToFit]; } } @@ -301,12 +316,8 @@ -(CGSize)sizeThatFits if ( myText.length > 0 ) { NSAttributedString *styledText = self.attributedText; - if ( (styledText.length > 0) && [styledText respondsToSelector:@selector(size)] ) { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - textSize = styledText.size; -#else - textSize = NSSizeToCGSize(styledText.size); -#endif + if ( styledText.length > 0 ) { + textSize = [styledText sizeAsDrawn]; } else { textSize = [myText sizeWithTextStyle:self.textStyle]; @@ -336,10 +347,10 @@ -(void)sizeToFit newBounds.size.height += self.paddingTop + self.paddingBottom; CGSize myMaxSize = self.maximumSize; - if ( myMaxSize.width > CPTFloat(0.0) ) { + if ( myMaxSize.width > CPTFloat(0.0)) { newBounds.size.width = MIN(newBounds.size.width, myMaxSize.width); } - if ( myMaxSize.height > CPTFloat(0.0) ) { + if ( myMaxSize.height > CPTFloat(0.0)) { newBounds.size.height = MIN(newBounds.size.height, myMaxSize.height); } @@ -357,7 +368,7 @@ -(void)sizeToFit /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden ) { return; @@ -367,15 +378,15 @@ -(void)renderAsVectorInContext:(CGContextRef)context if ( myText.length > 0 ) { [super renderAsVectorInContext:context]; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGContextSaveGState(context); CGContextTranslateCTM(context, CPTFloat(0.0), self.bounds.size.height); - CGContextScaleCTM( context, CPTFloat(1.0), CPTFloat(-1.0) ); + CGContextScaleCTM(context, CPTFloat(1.0), CPTFloat(-1.0)); #endif CGRect newBounds = CGRectInset(self.bounds, kCPTTextLayerMarginWidth, kCPTTextLayerMarginWidth); newBounds.origin.x += self.paddingLeft; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE newBounds.origin.y += self.paddingTop; #else newBounds.origin.y += self.paddingBottom; @@ -384,7 +395,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context newBounds.size.height -= self.paddingTop + self.paddingBottom; NSAttributedString *styledText = self.attributedText; - if ( (styledText.length > 0) && [styledText respondsToSelector:@selector(drawInRect:)] ) { + if ((styledText.length > 0) && [styledText respondsToSelector:@selector(drawInRect:)] ) { [styledText drawInRect:newBounds inContext:context]; } @@ -394,7 +405,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context inContext:context]; } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGContextRestoreGState(context); #endif } @@ -407,9 +418,9 @@ -(void)renderAsVectorInContext:(CGContextRef)context /// @cond --(NSString *)description +-(nullable NSString *)description { - return [NSString stringWithFormat:@"<%@ \"%@\">", [super description], self.text]; + return [NSString stringWithFormat:@"<%@ \"%@\">", super.description, self.text]; } /// @endcond diff --git a/framework/Source/CPTTextStyle.h b/framework/Source/CPTTextStyle.h index 2f6d0672c..df94cd374 100644 --- a/framework/Source/CPTTextStyle.h +++ b/framework/Source/CPTTextStyle.h @@ -1,19 +1,34 @@ -#include "CPTTextStylePlatformSpecific.h" +#import "CPTDefinitions.h" +#import "CPTPlatformSpecificDefines.h" +#import "CPTTextStylePlatformSpecific.h" @class CPTColor; +@class CPTTextStyle; -@interface CPTTextStyle : NSObject +/** + * @brief An array of text styles. + **/ +typedef NSArray CPTTextStyleArray; + +/** + * @brief A mutable array of text styles. + **/ +typedef NSMutableArray CPTMutableTextStyleArray; + +@interface CPTTextStyle : NSObject -@property (readonly, copy, nonatomic) NSString *fontName; +// font would override fontName/fontSize if not nil +@property (readonly, strong, nonatomic, nullable) CPTNativeFont *font; +@property (readonly, copy, nonatomic, nullable) NSString *fontName; @property (readonly, nonatomic) CGFloat fontSize; -@property (readonly, copy, nonatomic) CPTColor *color; +@property (readonly, copy, nonatomic, nullable) CPTColor *color; @property (readonly, nonatomic) CPTTextAlignment textAlignment; @property (readonly, assign, nonatomic) NSLineBreakMode lineBreakMode; /// @name Factory Methods /// @{ -+(instancetype)textStyle; -+(instancetype)textStyleWithStyle:(CPTTextStyle *)textStyle; ++(nonnull instancetype)textStyle; ++(nonnull instancetype)textStyleWithStyle:(nullable CPTTextStyle *)textStyle; /// @} @end @@ -25,11 +40,11 @@ **/ @interface CPTTextStyle(CPTPlatformSpecificTextStyleExtensions) -@property (readonly, nonatomic) NSDictionary *attributes; +@property (readonly, nonatomic, nonnull) CPTDictionary *attributes; /// @name Factory Methods /// @{ -+(instancetype)textStyleWithAttributes:(NSDictionary *)attributes; ++(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary *)attributes; /// @} @end @@ -43,12 +58,12 @@ /// @name Measurement /// @{ --(CGSize)sizeWithTextStyle:(CPTTextStyle *)style; +-(CGSize)sizeWithTextStyle:(nullable CPTTextStyle *)style; /// @} /// @name Drawing /// @{ --(void)drawInRect:(CGRect)rect withTextStyle:(CPTTextStyle *)style inContext:(CGContextRef)context; +-(void)drawInRect:(CGRect)rect withTextStyle:(nullable CPTTextStyle *)style inContext:(nonnull CGContextRef)context; /// @} @end diff --git a/framework/Source/CPTTextStyle.m b/framework/Source/CPTTextStyle.m index 9d5137e70..f1c5c4628 100644 --- a/framework/Source/CPTTextStyle.m +++ b/framework/Source/CPTTextStyle.m @@ -1,16 +1,17 @@ #import "CPTTextStyle.h" #import "CPTColor.h" -#import "CPTDefinitions.h" #import "CPTMutableTextStyle.h" #import "NSCoderExtensions.h" /// @cond @interface CPTTextStyle() -@property (readwrite, copy, nonatomic) NSString *fontName; +// font would override fontName/fontSize if not nil +@property (readwrite, strong, nonatomic, nullable) CPTNativeFont *font; +@property (readwrite, copy, nonatomic, nullable) NSString *fontName; @property (readwrite, assign, nonatomic) CGFloat fontSize; -@property (readwrite, copy, nonatomic) CPTColor *color; +@property (readwrite, copy, nonatomic, nullable) CPTColor *color; @property (readwrite, assign, nonatomic) CPTTextAlignment textAlignment; @property (readwrite, assign, nonatomic) NSLineBreakMode lineBreakMode; @@ -27,17 +28,24 @@ @interface CPTTextStyle() @implementation CPTTextStyle +/** @property CPTNativeFont* font + * @brief The font. Default is @nil. + * + * Font will override fontName and fontSize if not @nil. + **/ +@synthesize font; + /** @property CGFloat fontSize - * @brief The font size. Default is @num{12.0}. + * @brief The font size. Default is @num{12.0}. Ignored if font is not @nil. **/ @synthesize fontSize; -/** @property NSString *fontName - * @brief The font name. Default is Helvetica. +/** @property nullable NSString *fontName + * @brief The font name. Default is Helvetica. Ignored if font is not @nil. **/ @synthesize fontName; -/** @property CPTColor *color +/** @property nullable CPTColor *color * @brief The current text color. Default is solid black. **/ @synthesize color; @@ -58,7 +66,7 @@ @implementation CPTTextStyle /** @brief Creates and returns a new CPTTextStyle instance. * @return A new CPTTextStyle instance. **/ -+(instancetype)textStyle ++(nonnull instancetype)textStyle { return [[self alloc] init]; } @@ -70,10 +78,11 @@ +(instancetype)textStyle * @param textStyle An existing CPTTextStyle. * @return A new text style instance. **/ -+(instancetype)textStyleWithStyle:(CPTTextStyle *)textStyle ++(nonnull instancetype)textStyleWithStyle:(nullable CPTTextStyle *)textStyle { CPTTextStyle *newTextStyle = [[self alloc] init]; + newTextStyle.font = textStyle.font; newTextStyle.color = textStyle.color; newTextStyle.fontName = textStyle.fontName; newTextStyle.fontSize = textStyle.fontSize; @@ -89,9 +98,10 @@ +(instancetype)textStyleWithStyle:(CPTTextStyle *)textStyle /// @name Initialization /// @{ -/** @brief Initializes a newly allocated CPTAnnotation object. +/** @brief Initializes a newly allocated CPTTextStyle object. * * The initialized object will have the following properties: + * - @ref font = nil * - @ref fontName = Helvetica * - @ref fontSize = @num{12.0} * - @ref color = opaque black @@ -100,9 +110,10 @@ +(instancetype)textStyleWithStyle:(CPTTextStyle *)textStyle * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { + font = nil; fontName = @"Helvetica"; fontSize = CPTFloat(12.0); color = [CPTColor blackColor]; @@ -119,8 +130,18 @@ -(instancetype)init /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_TV + if ( self.font ) { + // UIFont does not support NSCoding :( + [coder encodeObject:[self.font fontDescriptor] forKey:@"CPTTextStyle.font+descriptor"]; + } +#else + // NSFont supports NSCoding :) + [coder encodeObject:self.font forKey:@"CPTTextStyle.font"]; +#endif + [coder encodeObject:self.fontName forKey:@"CPTTextStyle.fontName"]; [coder encodeCGFloat:self.fontSize forKey:@"CPTTextStyle.fontSize"]; [coder encodeObject:self.color forKey:@"CPTTextStyle.color"]; @@ -128,29 +149,57 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeInteger:(NSInteger)self.lineBreakMode forKey:@"CPTTextStyle.lineBreakMode"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - fontName = [[coder decodeObjectForKey:@"CPTTextStyle.fontName"] copy]; - fontSize = [coder decodeCGFloatForKey:@"CPTTextStyle.fontSize"]; - color = [[coder decodeObjectForKey:@"CPTTextStyle.color"] copy]; - textAlignment = (CPTTextAlignment)[coder decodeIntegerForKey : @"CPTTextStyle.textAlignment"]; - lineBreakMode = (NSLineBreakMode)[coder decodeIntegerForKey : @"CPTTextStyle.lineBreakMode"]; + if ((self = [super init])) { +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_TV + // UIFont does not support NSCoding :( + UIFontDescriptor *fontDescriptor = [coder decodeObjectOfClass:[UIFontDescriptor class] + forKey:@"CPTTextStyle.font+descriptor"]; + if ( fontDescriptor ) { + font = [UIFont fontWithDescriptor:fontDescriptor size:0]; // 0 will keep the same font size + } +#else + // NSFont supports NSCoding :) + font = [coder decodeObjectOfClass:[NSFont class] + forKey:@"CPTTextStyle.font"]; +#endif + + fontName = [[coder decodeObjectOfClass:[NSString class] + forKey:@"CPTTextStyle.fontName"] copy]; + fontSize = [coder decodeCGFloatForKey:@"CPTTextStyle.fontSize"]; + color = [[coder decodeObjectOfClass:[CPTColor class] + forKey:@"CPTTextStyle.color"] copy]; + textAlignment = (CPTTextAlignment)[coder decodeIntegerForKey:@"CPTTextStyle.textAlignment"]; + lineBreakMode = (NSLineBreakMode)[coder decodeIntegerForKey:@"CPTTextStyle.lineBreakMode"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark NSCopying Methods /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { CPTTextStyle *newCopy = [[CPTTextStyle allocWithZone:zone] init]; + newCopy.font = self.font; newCopy.fontName = self.fontName; newCopy.color = self.color; newCopy.fontSize = self.fontSize; @@ -167,10 +216,11 @@ -(id)copyWithZone:(NSZone *)zone /// @cond --(id)mutableCopyWithZone:(NSZone *)zone +-(nonnull id)mutableCopyWithZone:(nullable NSZone *)zone { CPTTextStyle *newCopy = [[CPTMutableTextStyle allocWithZone:zone] init]; + newCopy.font = self.font; newCopy.fontName = self.fontName; newCopy.color = self.color; newCopy.fontSize = self.fontSize; @@ -182,4 +232,18 @@ -(id)mutableCopyWithZone:(NSZone *)zone /// @endcond +#pragma mark - +#pragma mark Debugging + +/// @cond + +-(nullable id)debugQuickLookObject +{ + NSString *lorem = @"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; + + return [[NSAttributedString alloc] initWithString:lorem attributes:self.attributes]; +} + +/// @endcond + @end diff --git a/framework/Source/CPTTextStyleTests.m b/framework/Source/CPTTextStyleTests.m index 47ad497e6..5e21ddcf7 100644 --- a/framework/Source/CPTTextStyleTests.m +++ b/framework/Source/CPTTextStyleTests.m @@ -1,7 +1,8 @@ +#import "CPTTextStyleTests.h" + #import "CPTColor.h" #import "CPTDefinitions.h" #import "CPTTextStyle.h" -#import "CPTTextStyleTests.h" @implementation CPTTextStyleTests @@ -21,7 +22,7 @@ -(void)testKeyedArchivingRoundTrip { CPTTextStyle *textStyle = [CPTTextStyle textStyle]; - CPTTextStyle *newTextStyle = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:textStyle]]; + CPTTextStyle *newTextStyle = [self archiveRoundTrip:textStyle]; XCTAssertEqualObjects(newTextStyle.fontName, textStyle.fontName, @"Font names not equal"); XCTAssertEqual(newTextStyle.fontSize, textStyle.fontSize, @"Font sizes not equal"); diff --git a/framework/Source/CPTTheme.h b/framework/Source/CPTTheme.h index f13e9e46d..83cda6ef7 100644 --- a/framework/Source/CPTTheme.h +++ b/framework/Source/CPTTheme.h @@ -1,10 +1,17 @@ +#import "CPTDefinitions.h" + +/** + * @brief Theme name type. + **/ +typedef NSString *CPTThemeName cpt_swift_struct; + /// @ingroup themeNames /// @{ -extern NSString *const kCPTDarkGradientTheme; ///< A graph theme with dark gray gradient backgrounds and light gray lines. -extern NSString *const kCPTPlainBlackTheme; ///< A graph theme with black backgrounds and white lines. -extern NSString *const kCPTPlainWhiteTheme; ///< A graph theme with white backgrounds and black lines. -extern NSString *const kCPTSlateTheme; ///< A graph theme with colors that match the default iPhone navigation bar, toolbar buttons, and table views. -extern NSString *const kCPTStocksTheme; ///< A graph theme with a gradient background and white lines. +extern CPTThemeName __nonnull const kCPTDarkGradientTheme; ///< A graph theme with dark gray gradient backgrounds and light gray lines. +extern CPTThemeName __nonnull const kCPTPlainBlackTheme; ///< A graph theme with black backgrounds and white lines. +extern CPTThemeName __nonnull const kCPTPlainWhiteTheme; ///< A graph theme with white backgrounds and black lines. +extern CPTThemeName __nonnull const kCPTSlateTheme; ///< A graph theme with colors that match the default iPhone navigation bar, toolbar buttons, and table views. +extern CPTThemeName __nonnull const kCPTStocksTheme; ///< A graph theme with a gradient background and white lines. /// @} @class CPTGraph; @@ -12,21 +19,21 @@ extern NSString *const kCPTStocksTheme; ///< A graph theme with a gradient @class CPTAxisSet; @class CPTMutableTextStyle; -@interface CPTTheme : NSObject +@interface CPTTheme : NSObject -@property (nonatomic, readwrite, strong) Class graphClass; +@property (nonatomic, readwrite, strong, nullable) Class graphClass; /// @name Theme Management /// @{ -+(void)registerTheme:(Class)themeClass; -+(NSArray *)themeClasses; -+(instancetype)themeNamed:(NSString *)theme; -+(NSString *)name; ++(void)registerTheme:(nonnull Class)themeClass; ++(nullable NSArray *)themeClasses; ++(nullable instancetype)themeNamed:(nullable CPTThemeName)themeName; ++(nonnull CPTThemeName)name; /// @} /// @name Theme Usage /// @{ --(void)applyThemeToGraph:(CPTGraph *)graph; +-(void)applyThemeToGraph:(nonnull CPTGraph *)graph; /// @} @end @@ -38,11 +45,11 @@ extern NSString *const kCPTStocksTheme; ///< A graph theme with a gradient /// @name Theme Usage /// @{ --(id)newGraph; +-(nullable id)newGraph; --(void)applyThemeToBackground:(CPTGraph *)graph; --(void)applyThemeToPlotArea:(CPTPlotAreaFrame *)plotAreaFrame; --(void)applyThemeToAxisSet:(CPTAxisSet *)axisSet; +-(void)applyThemeToBackground:(nonnull CPTGraph *)graph; +-(void)applyThemeToPlotArea:(nonnull CPTPlotAreaFrame *)plotAreaFrame; +-(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet; /// @} @end diff --git a/framework/Source/CPTTheme.m b/framework/Source/CPTTheme.m index dbfc580c5..9d17a6e00 100644 --- a/framework/Source/CPTTheme.m +++ b/framework/Source/CPTTheme.m @@ -8,7 +8,7 @@ **/ // Registered themes -static NSMutableSet *themes = nil; +static NSMutableSet *themes = nil; /** @brief Creates a CPTGraph instance formatted with a predefined style. * @@ -20,7 +20,7 @@ **/ @implementation CPTTheme -/** @property Class graphClass +/** @property nullable Class graphClass * @brief The class used to create new graphs. Must be a subclass of CPTGraph. **/ @synthesize graphClass; @@ -38,9 +38,9 @@ @implementation CPTTheme * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { graphClass = Nil; } return self; @@ -53,7 +53,7 @@ -(instancetype)init /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeObject:[[self class] name] forKey:@"CPTTheme.name"]; @@ -63,12 +63,14 @@ -(void)encodeWithCoder:(NSCoder *)coder } } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - self = [CPTTheme themeNamed:[coder decodeObjectForKey:@"CPTTheme.name"]]; + self = [CPTTheme themeNamed:[coder decodeObjectOfClass:[NSString class] + forKey:@"CPTTheme.name"]]; if ( self ) { - NSString *className = [coder decodeObjectForKey:@"CPTTheme.graphClass"]; + NSString *className = [coder decodeObjectOfClass:[NSString class] + forKey:@"CPTTheme.graphClass"]; if ( className ) { self.graphClass = NSClassFromString(className); } @@ -78,13 +80,25 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Theme management /** @brief List of the available theme classes, sorted by name. * @return An NSArray containing all available theme classes, sorted by name. **/ -+(NSArray *)themeClasses ++(nullable NSArray *)themeClasses { NSSortDescriptor *nameSort = [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES selector:@selector(caseInsensitiveCompare:)]; @@ -96,7 +110,7 @@ +(NSArray *)themeClasses * @return A CPTTheme instance with name matching @par{themeName} or @nil if no themes with a matching name were found. * @see See @ref themeNames "Theme Names" for a list of named themes provided by Core Plot. **/ -+(instancetype)themeNamed:(NSString *)themeName ++(nullable instancetype)themeNamed:(nullable CPTThemeName)themeName { CPTTheme *newTheme = nil; @@ -113,10 +127,11 @@ +(instancetype)themeNamed:(NSString *)themeName /** @brief Register a theme class. * @param themeClass Theme class to register. **/ -+(void)registerTheme:(Class)themeClass ++(void)registerTheme:(nonnull Class)themeClass { - @synchronized(self) - { + NSParameterAssert(themeClass); + + @synchronized ( self ) { if ( !themes ) { themes = [[NSMutableSet alloc] init]; } @@ -133,7 +148,7 @@ +(void)registerTheme:(Class)themeClass /** @brief The name used for this theme class. * @return The name. **/ -+(NSString *)name ++(nonnull CPTThemeName)name { return NSStringFromClass(self); } @@ -143,7 +158,7 @@ +(NSString *)name /// @cond --(void)setGraphClass:(Class)newGraphClass +-(void)setGraphClass:(nullable Class)newGraphClass { if ( graphClass != newGraphClass ) { if ( ![newGraphClass isSubclassOfClass:[CPTGraph class]] ) { @@ -166,11 +181,19 @@ -(void)setGraphClass:(Class)newGraphClass /** @brief Applies the theme to the provided graph. * @param graph The graph to style. **/ --(void)applyThemeToGraph:(CPTGraph *)graph +-(void)applyThemeToGraph:(nonnull CPTGraph *)graph { [self applyThemeToBackground:graph]; - [self applyThemeToPlotArea:graph.plotAreaFrame]; - [self applyThemeToAxisSet:graph.axisSet]; + + CPTPlotAreaFrame *plotAreaFrame = graph.plotAreaFrame; + if ( plotAreaFrame ) { + [self applyThemeToPlotArea:plotAreaFrame]; + } + + CPTAxisSet *axisSet = graph.axisSet; + if ( axisSet ) { + [self applyThemeToAxisSet:axisSet]; + } } @end @@ -182,7 +205,7 @@ @implementation CPTTheme(AbstractMethods) /** @brief Creates a new graph styled with the theme. * @return The new graph. **/ --(id)newGraph +-(nullable id)newGraph { return nil; } @@ -190,21 +213,21 @@ -(id)newGraph /** @brief Applies the background theme to the provided graph. * @param graph The graph to style. **/ --(void)applyThemeToBackground:(CPTGraph *)graph +-(void)applyThemeToBackground:(nonnull CPTGraph *__unused)graph { } /** @brief Applies the theme to the provided plot area. * @param plotAreaFrame The plot area to style. **/ --(void)applyThemeToPlotArea:(CPTPlotAreaFrame *)plotAreaFrame +-(void)applyThemeToPlotArea:(nonnull CPTPlotAreaFrame *__unused)plotAreaFrame { } /** @brief Applies the theme to the provided axis set. * @param axisSet The axis set to style. **/ --(void)applyThemeToAxisSet:(CPTAxisSet *)axisSet +-(void)applyThemeToAxisSet:(nonnull CPTAxisSet *__unused)axisSet { } diff --git a/framework/Source/CPTThemeTests.m b/framework/Source/CPTThemeTests.m index d0ec220d0..d0007cb38 100644 --- a/framework/Source/CPTThemeTests.m +++ b/framework/Source/CPTThemeTests.m @@ -1,12 +1,13 @@ -#import "CPTDerivedXYGraph.h" -#import "CPTExceptions.h" -#import "CPTTheme.h" #import "CPTThemeTests.h" + #import "_CPTDarkGradientTheme.h" #import "_CPTPlainBlackTheme.h" #import "_CPTPlainWhiteTheme.h" #import "_CPTSlateTheme.h" #import "_CPTStocksTheme.h" +#import "CPTDerivedXYGraph.h" +#import "CPTExceptions.h" +#import "CPTTheme.h" @implementation CPTThemeTests @@ -14,7 +15,7 @@ -(void)testSetGraphClassUsingCPTXYGraphShouldWork { CPTTheme *theme = [[CPTTheme alloc] init]; - [theme setGraphClass:[CPTXYGraph class]]; + theme.graphClass = [CPTXYGraph class]; XCTAssertEqual([CPTXYGraph class], theme.graphClass, @"graphClass should be CPTXYGraph"); } @@ -22,7 +23,7 @@ -(void)testSetGraphUsingDerivedClassShouldWork { CPTTheme *theme = [[CPTTheme alloc] init]; - [theme setGraphClass:[CPTDerivedXYGraph class]]; + theme.graphClass = [CPTDerivedXYGraph class]; XCTAssertEqual([CPTDerivedXYGraph class], theme.graphClass, @"graphClass should be CPTDerivedXYGraph"); } @@ -51,6 +52,8 @@ -(void)testThemeNamedDarkGradientShouldReturnCPTDarkGradientTheme CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme]; XCTAssertTrue([theme isKindOfClass:[_CPTDarkGradientTheme class]], @"Should be _CPTDarkGradientTheme"); + + [self archiveRoundTrip:theme toClass:[CPTTheme class]]; } -(void)testThemeNamedPlainBlackShouldReturnCPTPlainBlackTheme @@ -58,6 +61,8 @@ -(void)testThemeNamedPlainBlackShouldReturnCPTPlainBlackTheme CPTTheme *theme = [CPTTheme themeNamed:kCPTPlainBlackTheme]; XCTAssertTrue([theme isKindOfClass:[_CPTPlainBlackTheme class]], @"Should be _CPTPlainBlackTheme"); + + [self archiveRoundTrip:theme toClass:[CPTTheme class]]; } -(void)testThemeNamedPlainWhiteShouldReturnCPTPlainWhiteTheme @@ -65,6 +70,8 @@ -(void)testThemeNamedPlainWhiteShouldReturnCPTPlainWhiteTheme CPTTheme *theme = [CPTTheme themeNamed:kCPTPlainWhiteTheme]; XCTAssertTrue([theme isKindOfClass:[_CPTPlainWhiteTheme class]], @"Should be _CPTPlainWhiteTheme"); + + [self archiveRoundTrip:theme toClass:[CPTTheme class]]; } -(void)testThemeNamedStocksShouldReturnCPTStocksTheme @@ -72,6 +79,8 @@ -(void)testThemeNamedStocksShouldReturnCPTStocksTheme CPTTheme *theme = [CPTTheme themeNamed:kCPTStocksTheme]; XCTAssertTrue([theme isKindOfClass:[_CPTStocksTheme class]], @"Should be _CPTStocksTheme"); + + [self archiveRoundTrip:theme toClass:[CPTTheme class]]; } -(void)testThemeNamedSlateShouldReturnCPTSlateTheme @@ -79,6 +88,8 @@ -(void)testThemeNamedSlateShouldReturnCPTSlateTheme CPTTheme *theme = [CPTTheme themeNamed:kCPTSlateTheme]; XCTAssertTrue([theme isKindOfClass:[_CPTSlateTheme class]], @"Should be _CPTSlateTheme"); + + [self archiveRoundTrip:theme toClass:[CPTTheme class]]; } @end diff --git a/framework/Source/CPTTimeFormatter.h b/framework/Source/CPTTimeFormatter.h index 9ccef384e..9a5de1b9d 100644 --- a/framework/Source/CPTTimeFormatter.h +++ b/framework/Source/CPTTimeFormatter.h @@ -1,14 +1,12 @@ -/// @file - @interface CPTTimeFormatter : NSNumberFormatter -@property (nonatomic, readwrite, strong) NSDateFormatter *dateFormatter; -@property (nonatomic, readwrite, copy) NSDate *referenceDate; +@property (nonatomic, readwrite, strong, nullable) NSDateFormatter *dateFormatter; +@property (nonatomic, readwrite, copy, nullable) NSDate *referenceDate; /// @name Initialization /// @{ --(instancetype)initWithDateFormatter:(NSDateFormatter *)aDateFormatter NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithDateFormatter:(nullable NSDateFormatter *)aDateFormatter NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER; /// @} @end diff --git a/framework/Source/CPTTimeFormatter.m b/framework/Source/CPTTimeFormatter.m index bfa12b728..8d0ad4b51 100644 --- a/framework/Source/CPTTimeFormatter.m +++ b/framework/Source/CPTTimeFormatter.m @@ -8,12 +8,12 @@ **/ @implementation CPTTimeFormatter -/** @property NSDateFormatter *dateFormatter +/** @property nullable NSDateFormatter *dateFormatter * @brief The date formatter used to generate strings from time intervals. **/ @synthesize dateFormatter; -/** @property NSDate *referenceDate +/** @property nullable NSDate *referenceDate * @brief Date from which time intervals are taken. * If @nil, the standard reference date (1 January 2001, GMT) is used. **/ @@ -29,7 +29,7 @@ @implementation CPTTimeFormatter * The default formatter uses @ref NSDateFormatterMediumStyle for dates and times. * @return The new instance. **/ --(instancetype)init +-(nonnull instancetype)init { NSDateFormatter *newDateFormatter = [[NSDateFormatter alloc] init]; @@ -47,9 +47,9 @@ -(instancetype)init * @param aDateFormatter The date formatter. * @return The new instance. **/ --(instancetype)initWithDateFormatter:(NSDateFormatter *)aDateFormatter +-(nonnull instancetype)initWithDateFormatter:(nullable NSDateFormatter *)aDateFormatter { - if ( (self = [super init]) ) { + if ((self = [super init])) { dateFormatter = aDateFormatter; referenceDate = nil; } @@ -61,7 +61,7 @@ -(instancetype)initWithDateFormatter:(NSDateFormatter *)aDateFormatter /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -75,9 +75,9 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { dateFormatter = [coder decodeObjectForKey:@"CPTTimeFormatter.dateFormatter"]; referenceDate = [[coder decodeObjectForKey:@"CPTTimeFormatter.referenceDate"] copy]; } @@ -89,7 +89,7 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { CPTTimeFormatter *newFormatter = [[CPTTimeFormatter allocWithZone:zone] init]; @@ -116,7 +116,7 @@ -(id)copyWithZone:(NSZone *)zone * @param coordinateValue The time value. * @return The date string. **/ --(NSString *)stringForObjectValue:(id)coordinateValue +-(nullable NSString *)stringForObjectValue:(nullable id)coordinateValue { NSString *string = nil; diff --git a/framework/Source/CPTTimeFormatterTests.m b/framework/Source/CPTTimeFormatterTests.m index 4c99a39e4..52d5fcfc1 100644 --- a/framework/Source/CPTTimeFormatterTests.m +++ b/framework/Source/CPTTimeFormatterTests.m @@ -1,6 +1,7 @@ -#import "CPTTimeFormatter.h" #import "CPTTimeFormatterTests.h" +#import "CPTTimeFormatter.h" + @implementation CPTTimeFormatterTests #pragma mark - @@ -8,15 +9,16 @@ @implementation CPTTimeFormatterTests -(void)testKeyedArchivingRoundTrip { - NSDate *refDate = [NSDate dateWithNaturalLanguageString:@"12:00 Oct 29, 2009"]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + NSDate *refDate = [dateFormatter dateFromString:@"12:00 Oct 29, 2009"]; + dateFormatter.dateStyle = NSDateFormatterShortStyle; CPTTimeFormatter *timeFormatter = [[CPTTimeFormatter alloc] initWithDateFormatter:dateFormatter]; timeFormatter.referenceDate = refDate; - CPTTimeFormatter *newTimeFormatter = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:timeFormatter]]; + CPTTimeFormatter *newTimeFormatter = [self archiveRoundTrip:timeFormatter]; XCTAssertEqualObjects(timeFormatter.dateFormatter.dateFormat, newTimeFormatter.dateFormatter.dateFormat, @"Date formatter not equal"); XCTAssertEqualObjects(timeFormatter.referenceDate, newTimeFormatter.referenceDate, @"Reference date not equal"); diff --git a/framework/Source/CPTTradingRangePlot.h b/framework/Source/CPTTradingRangePlot.h index 5bd929bff..b32085afe 100644 --- a/framework/Source/CPTTradingRangePlot.h +++ b/framework/Source/CPTTradingRangePlot.h @@ -1,24 +1,30 @@ #import "CPTDefinitions.h" +#import "CPTFill.h" +#import "CPTLineStyle.h" #import "CPTPlot.h" /// @file -@class CPTLineStyle; @class CPTTradingRangePlot; -@class CPTFill; + +/** + * @brief Trading range plot bindings. + **/ +typedef NSString *CPTTradingRangePlotBinding cpt_swift_struct; /// @ingroup plotBindingsTradingRangePlot /// @{ -extern NSString *const CPTTradingRangePlotBindingXValues; -extern NSString *const CPTTradingRangePlotBindingOpenValues; -extern NSString *const CPTTradingRangePlotBindingHighValues; -extern NSString *const CPTTradingRangePlotBindingLowValues; -extern NSString *const CPTTradingRangePlotBindingCloseValues; -extern NSString *const CPTTradingRangePlotBindingIncreaseFills; -extern NSString *const CPTTradingRangePlotBindingDecreaseFills; -extern NSString *const CPTTradingRangePlotBindingLineStyles; -extern NSString *const CPTTradingRangePlotBindingIncreaseLineStyles; -extern NSString *const CPTTradingRangePlotBindingDecreaseLineStyles; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingXValues; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingOpenValues; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingHighValues; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingLowValues; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingCloseValues; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingIncreaseFills; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingDecreaseFills; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingLineStyles; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingIncreaseLineStyles; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingDecreaseLineStyles; +extern CPTTradingRangePlotBinding __nonnull const CPTTradingRangePlotBindingBarWidths; /// @} /** @@ -56,7 +62,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @param indexRange The range of the data indexes of interest. * @return An array of fills. **/ --(NSArray *)increaseFillsForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTFillArray *)increaseFillsForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets the fill used with a candlestick plot when close >= open for the given plot. * This method will not be called if @@ -67,13 +73,13 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @return The bar fill for the bar with the given index. If the data source returns @nil, the default increase fill is used. * If the data source returns an NSNull object, no fill is drawn. **/ --(CPTFill *)increaseFillForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx; +-(nullable CPTFill *)increaseFillForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx; /** @brief @optional Gets a range of fills used with a candlestick plot when close < open for the given plot. * @param plot The trading range plot. * @param indexRange The range of the data indexes of interest. **/ --(NSArray *)decreaseFillsForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTFillArray *)decreaseFillsForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets the fill used with a candlestick plot when close < open for the given plot. * This method will not be called if @@ -84,7 +90,24 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @return The bar fill for the bar with the given index. If the data source returns @nil, the default decrease fill is used. * If the data source returns an NSNull object, no fill is drawn. **/ --(CPTFill *)decreaseFillForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx; +-(nullable CPTFill *)decreaseFillForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx; + +/** @brief @optional Gets an array of bar widths for the given trading range plot. + * @param plot The trading range plot. + * @param indexRange The range of the data indexes of interest. + * @return An array of bar widths. + **/ +-(nullable CPTNumberArray *)barWidthsForTradingRangePlot:(nonnull CPTTradingRangePlot *)barPlot recordIndexRange:(NSRange)indexRange; + +/** @brief @optional Gets a bar width for the given trading range plot. + * This method will not be called if + * @link CPTTradingRangePlotDataSource::barWidthForTradingRangePlot:recordIndexRange: -barWidthForTradingRangePlot:recordIndexRange: @endlink + * is also implemented in the datasource. + * @param plot The tradingrange plot. + * @param idx The data index of interest. + * @return The bar width for the bar with the given index. If the data source returns @nil, the default barWidth is used. + **/ +-(nullable NSNumber *)barWidthForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx; /// @} @@ -96,7 +119,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @param indexRange The range of the data indexes of interest. * @return An array of line styles. **/ --(NSArray *)lineStylesForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTLineStyleArray *)lineStylesForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets the line style used to draw candlestick or OHLC symbols for the given trading range plot. * This method will not be called if @@ -107,14 +130,14 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @return The line style for the symbol with the given index. If the data source returns @nil, the default line style is used. * If the data source returns an NSNull object, no line is drawn. **/ --(CPTLineStyle *)lineStyleForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx; +-(nullable CPTLineStyle *)lineStyleForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx; /** @brief @optional Gets a range of line styles used to outline candlestick symbols when close >= open for the given trading range plot. * @param plot The trading range plot. * @param indexRange The range of the data indexes of interest. * @return An array of line styles. **/ --(NSArray *)increaseLineStylesForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTLineStyleArray *)increaseLineStylesForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets the line style used to outline candlestick symbols when close >= open for the given trading range plot. * This method will not be called if @@ -125,14 +148,14 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @return The line line style for the symbol with the given index. If the data source returns @nil, the default increase line style is used. * If the data source returns an NSNull object, no line is drawn. **/ --(CPTLineStyle *)increaseLineStyleForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx; +-(nullable CPTLineStyle *)increaseLineStyleForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx; /** @brief @optional Gets a range of line styles used to outline candlestick symbols when close < open for the given trading range plot. * @param plot The trading range plot. * @param indexRange The range of the data indexes of interest. * @return An array of line styles. **/ --(NSArray *)decreaseLineStylesForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; +-(nullable CPTLineStyleArray *)decreaseLineStylesForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange; /** @brief @optional Gets the line style used to outline candlestick symbols when close < open for the given trading range plot. * This method will not be called if @@ -143,7 +166,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @return The line line style for the symbol with the given index. If the data source returns @nil, the default decrease line style is used. * If the data source returns an NSNull object, no line is drawn. **/ --(CPTLineStyle *)decreaseLineStyleForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx; +-(nullable CPTLineStyle *)decreaseLineStyleForTradingRangePlot:(nonnull CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx; /// @} @@ -169,7 +192,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @if MacOnly clicked bar. @endif * @if iOSOnly touched bar. @endif **/ --(void)tradingRangePlot:(CPTTradingRangePlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)idx; +-(void)tradingRangePlot:(nonnull CPTTradingRangePlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a bar * @if MacOnly was both pressed and released. @endif @@ -180,7 +203,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @if iOSOnly touched bar. @endif * @param event The event that triggered the selection. **/ --(void)tradingRangePlot:(CPTTradingRangePlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)tradingRangePlot:(nonnull CPTTradingRangePlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a bar * @if MacOnly was pressed. @endif @@ -190,7 +213,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @if MacOnly clicked bar. @endif * @if iOSOnly touched bar. @endif **/ --(void)tradingRangePlot:(CPTTradingRangePlot *)plot barTouchDownAtRecordIndex:(NSUInteger)idx; +-(void)tradingRangePlot:(nonnull CPTTradingRangePlot *)plot barTouchDownAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a bar * @if MacOnly was pressed. @endif @@ -201,7 +224,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @if iOSOnly touched bar. @endif * @param event The event that triggered the selection. **/ --(void)tradingRangePlot:(CPTTradingRangePlot *)plot barTouchDownAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)tradingRangePlot:(nonnull CPTTradingRangePlot *)plot barTouchDownAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /** @brief @optional Informs the delegate that a bar * @if MacOnly was released. @endif @@ -211,7 +234,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @if MacOnly clicked bar. @endif * @if iOSOnly touched bar. @endif **/ --(void)tradingRangePlot:(CPTTradingRangePlot *)plot barTouchUpAtRecordIndex:(NSUInteger)idx; +-(void)tradingRangePlot:(nonnull CPTTradingRangePlot *)plot barTouchUpAtRecordIndex:(NSUInteger)idx; /** @brief @optional Informs the delegate that a bar * @if MacOnly was released. @endif @@ -222,7 +245,7 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { * @if iOSOnly touched bar. @endif * @param event The event that triggered the selection. **/ --(void)tradingRangePlot:(CPTTradingRangePlot *)plot barTouchUpAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event; +-(void)tradingRangePlot:(nonnull CPTTradingRangePlot *)plot barTouchUpAtRecordIndex:(NSUInteger)idx withEvent:(nonnull CPTNativeEvent *)event; /// @} @@ -243,11 +266,11 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { /// @name Drawing /// @{ -@property (nonatomic, readwrite, copy) CPTLineStyle *lineStyle; -@property (nonatomic, readwrite, copy) CPTLineStyle *increaseLineStyle; -@property (nonatomic, readwrite, copy) CPTLineStyle *decreaseLineStyle; -@property (nonatomic, readwrite, copy) CPTFill *increaseFill; -@property (nonatomic, readwrite, copy) CPTFill *decreaseFill; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *lineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *increaseLineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyle *decreaseLineStyle; +@property (nonatomic, readwrite, copy, nullable) CPTFill *increaseFill; +@property (nonatomic, readwrite, copy, nullable) CPTFill *decreaseFill; /// @} /// @name Bar Style @@ -256,6 +279,8 @@ typedef NS_ENUM (NSInteger, CPTTradingRangePlotField) { -(void)reloadBarFillsInIndexRange:(NSRange)indexRange; -(void)reloadBarLineStyles; -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange; +-(void)reloadBarWidths; +-(void)reloadBarWidthsInIndexRange:(NSRange)indexRange; /// @} @end diff --git a/framework/Source/CPTTradingRangePlot.m b/framework/Source/CPTTradingRangePlot.m index dd065c874..3589b2870 100644 --- a/framework/Source/CPTTradingRangePlot.m +++ b/framework/Source/CPTTradingRangePlot.m @@ -2,7 +2,6 @@ #import "CPTColor.h" #import "CPTExceptions.h" -#import "CPTFill.h" #import "CPTLegend.h" #import "CPTLineStyle.h" #import "CPTMutableNumericData.h" @@ -13,6 +12,8 @@ #import "CPTUtilities.h" #import "CPTXYPlotSpace.h" #import "NSCoderExtensions.h" +#import "NSNumberExtensions.h" +#import "tgmath.h" /** @defgroup plotAnimationTradingRangePlot Trading Range Plot * @brief Trading range plot properties that can be animated using Core Animation. @@ -26,16 +27,17 @@ * @endif **/ -NSString *const CPTTradingRangePlotBindingXValues = @"xValues"; ///< X values. -NSString *const CPTTradingRangePlotBindingOpenValues = @"openValues"; ///< Open price values. -NSString *const CPTTradingRangePlotBindingHighValues = @"highValues"; ///< High price values. -NSString *const CPTTradingRangePlotBindingLowValues = @"lowValues"; ///< Low price values. -NSString *const CPTTradingRangePlotBindingCloseValues = @"closeValues"; ///< Close price values. -NSString *const CPTTradingRangePlotBindingIncreaseFills = @"increaseFills"; ///< Fills used with a candlestick plot when close >= open. -NSString *const CPTTradingRangePlotBindingDecreaseFills = @"decreaseFills"; ///< Fills used with a candlestick plot when close < open. -NSString *const CPTTradingRangePlotBindingLineStyles = @"lineStyles"; ///< Line styles used to draw candlestick or OHLC symbols. -NSString *const CPTTradingRangePlotBindingIncreaseLineStyles = @"increaseLineStyles"; ///< Line styles used to outline candlestick symbols when close >= open. -NSString *const CPTTradingRangePlotBindingDecreaseLineStyles = @"decreaseLineStyles"; ///< Line styles used to outline candlestick symbols when close < open. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingXValues = @"xValues"; ///< X values. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingOpenValues = @"openValues"; ///< Open price values. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingHighValues = @"highValues"; ///< High price values. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingLowValues = @"lowValues"; ///< Low price values. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingCloseValues = @"closeValues"; ///< Close price values. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingIncreaseFills = @"increaseFills"; ///< Fills used with a candlestick plot when close >= open. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingDecreaseFills = @"decreaseFills"; ///< Fills used with a candlestick plot when close < open. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingLineStyles = @"lineStyles"; ///< Line styles used to draw candlestick or OHLC symbols. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingIncreaseLineStyles = @"increaseLineStyles"; ///< Line styles used to outline candlestick symbols when close >= open. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingDecreaseLineStyles = @"decreaseLineStyles"; ///< Line styles used to outline candlestick symbols when close < open. +CPTTradingRangePlotBinding const CPTTradingRangePlotBindingBarWidths = @"barWidths"; ///< Bar widths. static const CPTCoordinate independentCoord = CPTCoordinateX; static const CPTCoordinate dependentCoord = CPTCoordinateY; @@ -43,27 +45,30 @@ /// @cond @interface CPTTradingRangePlot() -@property (nonatomic, readwrite, copy) CPTMutableNumericData *xValues; -@property (nonatomic, readwrite, copy) CPTMutableNumericData *openValues; -@property (nonatomic, readwrite, copy) CPTMutableNumericData *highValues; -@property (nonatomic, readwrite, copy) CPTMutableNumericData *lowValues; -@property (nonatomic, readwrite, copy) CPTMutableNumericData *closeValues; -@property (nonatomic, readwrite, copy) NSArray *increaseFills; -@property (nonatomic, readwrite, copy) NSArray *decreaseFills; -@property (nonatomic, readwrite, copy) NSArray *lineStyles; -@property (nonatomic, readwrite, copy) NSArray *increaseLineStyles; -@property (nonatomic, readwrite, copy) NSArray *decreaseLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *xValues; +@property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *openValues; +@property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *highValues; +@property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *lowValues; +@property (nonatomic, readwrite, copy, nullable) CPTMutableNumericData *closeValues; +@property (nonatomic, readwrite, copy, nullable) CPTFillArray *increaseFills; +@property (nonatomic, readwrite, copy, nullable) CPTFillArray *decreaseFills; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *lineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *increaseLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *decreaseLineStyles; +@property (nonatomic, readwrite, copy, nullable) CPTLineStyleArray *barWidths; @property (nonatomic, readwrite, assign) NSUInteger pointingDeviceDownIndex; --(void)drawCandleStickInContext:(CGContextRef)context atIndex:(NSUInteger)idx x:(CGFloat)x open:(CGFloat)openValue close:(CGFloat)closeValue high:(CGFloat)highValue low:(CGFloat)lowValue alignPoints:(BOOL)alignPoints; --(void)drawOHLCInContext:(CGContextRef)context atIndex:(NSUInteger)idx x:(CGFloat)x open:(CGFloat)openValue close:(CGFloat)closeValue high:(CGFloat)highValue low:(CGFloat)lowValue alignPoints:(BOOL)alignPoints; +-(void)drawCandleStickInContext:(nonnull CGContextRef)context atIndex:(NSUInteger)idx x:(CGFloat)x open:(CGFloat)openValue close:(CGFloat)closeValue high:(CGFloat)highValue low:(CGFloat)lowValue width:(CGFloat)width alignPoints:(BOOL)alignPoints; +-(void)drawOHLCInContext:(nonnull CGContextRef)context atIndex:(NSUInteger)idx x:(CGFloat)x open:(CGFloat)openValue close:(CGFloat)closeValue high:(CGFloat)highValue low:(CGFloat)lowValue alignPoints:(BOOL)alignPoints; --(CPTFill *)increaseFillForIndex:(NSUInteger)idx; --(CPTFill *)decreaseFillForIndex:(NSUInteger)idx; +-(nullable CPTFill *)increaseFillForIndex:(NSUInteger)idx; +-(nullable CPTFill *)decreaseFillForIndex:(NSUInteger)idx; --(CPTLineStyle *)lineStyleForIndex:(NSUInteger)idx; --(CPTLineStyle *)increaseLineStyleForIndex:(NSUInteger)idx; --(CPTLineStyle *)decreaseLineStyleForIndex:(NSUInteger)idx; +-(nullable CPTLineStyle *)lineStyleForIndex:(NSUInteger)idx; +-(nullable CPTLineStyle *)increaseLineStyleForIndex:(NSUInteger)idx; +-(nullable CPTLineStyle *)decreaseLineStyleForIndex:(NSUInteger)idx; + +-(nonnull NSNumber *)barWidthForIndex:(NSUInteger)idx; @end @@ -90,30 +95,31 @@ @implementation CPTTradingRangePlot @dynamic lineStyles; @dynamic increaseLineStyles; @dynamic decreaseLineStyles; +@dynamic barWidths; -/** @property CPTLineStyle *lineStyle +/** @property nullable CPTLineStyle *lineStyle * @brief The line style used to draw candlestick or OHLC symbols. **/ @synthesize lineStyle; -/** @property CPTLineStyle *increaseLineStyle +/** @property nullable CPTLineStyle *increaseLineStyle * @brief The line style used to outline candlestick symbols or draw OHLC symbols when close >= open. * If @nil, will use @ref lineStyle instead. **/ @synthesize increaseLineStyle; -/** @property CPTLineStyle *decreaseLineStyle +/** @property nullable CPTLineStyle *decreaseLineStyle * @brief The line style used to outline candlestick symbols or draw OHLC symbols when close < open. * If @nil, will use @ref lineStyle instead. **/ @synthesize decreaseLineStyle; -/** @property CPTFill *increaseFill +/** @property nullable CPTFill *increaseFill * @brief The fill used with a candlestick plot when close >= open. **/ @synthesize increaseFill; -/** @property CPTFill *decreaseFill +/** @property nullable CPTFill *decreaseFill * @brief The fill used with a candlestick plot when close < open. **/ @synthesize decreaseFill; @@ -159,7 +165,7 @@ @implementation CPTTradingRangePlot /// @cond -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else +(void)initialize { @@ -174,8 +180,10 @@ +(void)initialize [self exposeBinding:CPTTradingRangePlotBindingLineStyles]; [self exposeBinding:CPTTradingRangePlotBindingIncreaseLineStyles]; [self exposeBinding:CPTTradingRangePlotBindingDecreaseLineStyles]; + [self exposeBinding:CPTTradingRangePlotBindingBarWidths]; } } + #endif /// @endcond @@ -201,9 +209,9 @@ +(void)initialize * @param newFrame The frame rectangle. * @return The initialized CPTTradingRangePlot object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { plotStyle = CPTTradingRangePlotStyleOHLC; lineStyle = [[CPTLineStyle alloc] init]; increaseLineStyle = nil; @@ -226,9 +234,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTTradingRangePlot *theLayer = (CPTTradingRangePlot *)layer; plotStyle = theLayer->plotStyle; @@ -254,7 +262,7 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -273,19 +281,24 @@ -(void)encodeWithCoder:(NSCoder *)coder // pointingDeviceDownIndex } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - lineStyle = [[coder decodeObjectForKey:@"CPTTradingRangePlot.lineStyle"] copy]; - increaseLineStyle = [[coder decodeObjectForKey:@"CPTTradingRangePlot.increaseLineStyle"] copy]; - decreaseLineStyle = [[coder decodeObjectForKey:@"CPTTradingRangePlot.decreaseLineStyle"] copy]; - increaseFill = [[coder decodeObjectForKey:@"CPTTradingRangePlot.increaseFill"] copy]; - decreaseFill = [[coder decodeObjectForKey:@"CPTTradingRangePlot.decreaseFill"] copy]; - plotStyle = (CPTTradingRangePlotStyle)[coder decodeIntegerForKey : @"CPTTradingRangePlot.plotStyle"]; - barWidth = [coder decodeCGFloatForKey:@"CPTTradingRangePlot.barWidth"]; - stickLength = [coder decodeCGFloatForKey:@"CPTTradingRangePlot.stickLength"]; - barCornerRadius = [coder decodeCGFloatForKey:@"CPTTradingRangePlot.barCornerRadius"]; - showBarBorder = [coder decodeBoolForKey:@"CPTTradingRangePlot.showBarBorder"]; + if ((self = [super initWithCoder:coder])) { + lineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTTradingRangePlot.lineStyle"] copy]; + increaseLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTTradingRangePlot.increaseLineStyle"] copy]; + decreaseLineStyle = [[coder decodeObjectOfClass:[CPTLineStyle class] + forKey:@"CPTTradingRangePlot.decreaseLineStyle"] copy]; + increaseFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTTradingRangePlot.increaseFill"] copy]; + decreaseFill = [[coder decodeObjectOfClass:[CPTFill class] + forKey:@"CPTTradingRangePlot.decreaseFill"] copy]; + plotStyle = (CPTTradingRangePlotStyle)[coder decodeIntegerForKey:@"CPTTradingRangePlot.plotStyle"]; + barWidth = [coder decodeCGFloatForKey:@"CPTTradingRangePlot.barWidth"]; + stickLength = [coder decodeCGFloatForKey:@"CPTTradingRangePlot.stickLength"]; + barCornerRadius = [coder decodeCGFloatForKey:@"CPTTradingRangePlot.barCornerRadius"]; + showBarBorder = [coder decodeBoolForKey:@"CPTTradingRangePlot.showBarBorder"]; pointingDeviceDownIndex = NSNotFound; } @@ -294,6 +307,18 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Data Loading @@ -308,6 +333,9 @@ -(void)reloadDataInIndexRange:(NSRange)indexRange // Line styles [self reloadBarLineStylesInIndexRange:indexRange]; + + // Bar widths + [self reloadBarWidthsInIndexRange:indexRange]; } -(void)reloadPlotDataInIndexRange:(NSRange)indexRange @@ -369,9 +397,9 @@ -(void)reloadBarFillsInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(increaseFillForTradingRangePlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableFillArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTFill *dataSourceFill = [theDataSource increaseFillForTradingRangePlot:self recordIndex:idx]; @@ -397,9 +425,9 @@ -(void)reloadBarFillsInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(decreaseFillForTradingRangePlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableFillArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTFill *dataSourceFill = [theDataSource decreaseFillForTradingRangePlot:self recordIndex:idx]; @@ -450,9 +478,9 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(lineStyleForTradingRangePlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableLineStyleArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTLineStyle *dataSourceLineStyle = [theDataSource lineStyleForTradingRangePlot:self recordIndex:idx]; @@ -478,9 +506,9 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(increaseLineStyleForTradingRangePlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableLineStyleArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTLineStyle *dataSourceLineStyle = [theDataSource increaseLineStyleForTradingRangePlot:self recordIndex:idx]; @@ -506,9 +534,9 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange else if ( [theDataSource respondsToSelector:@selector(decreaseLineStyleForTradingRangePlot:recordIndex:)] ) { needsLegendUpdate = YES; - id nilObject = [CPTPlot nilData]; - NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; - NSUInteger maxIndex = NSMaxRange(indexRange); + id nilObject = [CPTPlot nilData]; + CPTMutableLineStyleArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { CPTLineStyle *dataSourceLineStyle = [theDataSource decreaseLineStyleForTradingRangePlot:self recordIndex:idx]; @@ -531,12 +559,55 @@ -(void)reloadBarLineStylesInIndexRange:(NSRange)indexRange [self setNeedsDisplay]; } +/** + * @brief Reload all bar widths from the data source immediately. + **/ +-(void)reloadBarWidths +{ + [self reloadBarWidthsInIndexRange:NSMakeRange(0, self.cachedDataCount)]; +} + +/** @brief Reload bar widths in the given index range from the data source immediately. + * @param indexRange The index range to load. + **/ +-(void)reloadBarWidthsInIndexRange:(NSRange)indexRange +{ + id theDataSource = (id)self.dataSource; + + if ( [theDataSource respondsToSelector:@selector(barWidthsForTradingRangePlot:recordIndexRange:)] ) { + [self cacheArray:[theDataSource barWidthsForTradingRangePlot:self recordIndexRange:indexRange] + forKey:CPTTradingRangePlotBindingBarWidths + atRecordIndex:indexRange.location]; + } + else if ( [theDataSource respondsToSelector:@selector(barWidthForTradingRangePlot:recordIndex:)] ) { + id nilObject = [CPTPlot nilData]; + CPTMutableNumberArray *array = [[NSMutableArray alloc] initWithCapacity:indexRange.length]; + NSUInteger maxIndex = NSMaxRange(indexRange); + + for ( NSUInteger idx = indexRange.location; idx < maxIndex; idx++ ) { + NSNumber *width = [theDataSource barWidthForTradingRangePlot:self recordIndex:idx]; + if ( width ) { + [array addObject:width]; + } + else { + [array addObject:nilObject]; + } + } + + [self cacheArray:array + forKey:CPTTradingRangePlotBindingBarWidths + atRecordIndex:indexRange.location]; + } + + [self setNeedsDisplay]; +} + #pragma mark - #pragma mark Drawing /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden ) { return; @@ -552,11 +623,11 @@ -(void)renderAsVectorInContext:(CGContextRef)context if ( sampleCount == 0 ) { return; } - if ( (opens == nil) || (highs == nil) || (lows == nil) || (closes == nil) ) { + if ((opens == nil) || (highs == nil) || (lows == nil) || (closes == nil)) { return; } - if ( (opens.numberOfSamples != sampleCount) || (highs.numberOfSamples != sampleCount) || (lows.numberOfSamples != sampleCount) || (closes.numberOfSamples != sampleCount) ) { + if ((opens.numberOfSamples != sampleCount) || (highs.numberOfSamples != sampleCount) || (lows.numberOfSamples != sampleCount) || (closes.numberOfSamples != sampleCount)) { [NSException raise:CPTException format:@"Mismatching number of data values in trading range plot"]; } @@ -580,7 +651,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context for ( NSUInteger i = 0; i < sampleCount; i++ ) { double plotPoint[2]; plotPoint[independentCoord] = *locationBytes++; - if ( isnan(plotPoint[independentCoord]) ) { + if ( isnan(plotPoint[independentCoord])) { openBytes++; highBytes++; lowBytes++; @@ -590,7 +661,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context // open point plotPoint[dependentCoord] = *openBytes++; - if ( isnan(plotPoint[dependentCoord]) ) { + if ( isnan(plotPoint[dependentCoord])) { openPoint = CPTPointMake(NAN, NAN); } else { @@ -599,7 +670,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context // high point plotPoint[dependentCoord] = *highBytes++; - if ( isnan(plotPoint[dependentCoord]) ) { + if ( isnan(plotPoint[dependentCoord])) { highPoint = CPTPointMake(NAN, NAN); } else { @@ -608,7 +679,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context // low point plotPoint[dependentCoord] = *lowBytes++; - if ( isnan(plotPoint[dependentCoord]) ) { + if ( isnan(plotPoint[dependentCoord])) { lowPoint = CPTPointMake(NAN, NAN); } else { @@ -617,7 +688,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context // close point plotPoint[dependentCoord] = *closeBytes++; - if ( isnan(plotPoint[dependentCoord]) ) { + if ( isnan(plotPoint[dependentCoord])) { closePoint = CPTPointMake(NAN, NAN); } else { @@ -625,17 +696,17 @@ -(void)renderAsVectorInContext:(CGContextRef)context } CGFloat xCoord = openPoint.x; - if ( isnan(xCoord) ) { + if ( isnan(xCoord)) { xCoord = highPoint.x; } - else if ( isnan(xCoord) ) { + else if ( isnan(xCoord)) { xCoord = lowPoint.x; } - else if ( isnan(xCoord) ) { + else if ( isnan(xCoord)) { xCoord = closePoint.x; } - if ( !isnan(xCoord) ) { + if ( !isnan(xCoord)) { // Draw switch ( thePlotStyle ) { case CPTTradingRangePlotStyleOHLC: @@ -657,6 +728,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context close:closePoint.y high:highPoint.y low:lowPoint.y + width:[self barWidthForIndex:i].cgFloatValue alignPoints:alignPoints]; break; } @@ -673,7 +745,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context for ( NSUInteger i = 0; i < sampleCount; i++ ) { NSDecimal plotPoint[2]; plotPoint[independentCoord] = *locationBytes++; - if ( NSDecimalIsNotANumber(&plotPoint[independentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[independentCoord])) { openBytes++; highBytes++; lowBytes++; @@ -683,7 +755,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context // open point plotPoint[dependentCoord] = *openBytes++; - if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord])) { openPoint = CPTPointMake(NAN, NAN); } else { @@ -692,7 +764,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context // high point plotPoint[dependentCoord] = *highBytes++; - if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord])) { highPoint = CPTPointMake(NAN, NAN); } else { @@ -701,7 +773,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context // low point plotPoint[dependentCoord] = *lowBytes++; - if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord])) { lowPoint = CPTPointMake(NAN, NAN); } else { @@ -710,7 +782,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context // close point plotPoint[dependentCoord] = *closeBytes++; - if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord]) ) { + if ( NSDecimalIsNotANumber(&plotPoint[dependentCoord])) { closePoint = CPTPointMake(NAN, NAN); } else { @@ -718,17 +790,17 @@ -(void)renderAsVectorInContext:(CGContextRef)context } CGFloat xCoord = openPoint.x; - if ( isnan(xCoord) ) { + if ( isnan(xCoord)) { xCoord = highPoint.x; } - else if ( isnan(xCoord) ) { + else if ( isnan(xCoord)) { xCoord = lowPoint.x; } - else if ( isnan(xCoord) ) { + else if ( isnan(xCoord)) { xCoord = closePoint.x; } - if ( !isnan(xCoord) ) { + if ( !isnan(xCoord)) { // Draw switch ( thePlotStyle ) { case CPTTradingRangePlotStyleOHLC: @@ -750,6 +822,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context close:closePoint.y high:highPoint.y low:lowPoint.y + width:[self barWidthForIndex:i].cgFloatValue alignPoints:alignPoints]; break; } @@ -760,20 +833,22 @@ -(void)renderAsVectorInContext:(CGContextRef)context CGContextEndTransparencyLayer(context); } --(void)drawCandleStickInContext:(CGContextRef)context +-(void)drawCandleStickInContext:(nonnull CGContextRef)context atIndex:(NSUInteger)idx x:(CGFloat)x open:(CGFloat)openValue close:(CGFloat)closeValue high:(CGFloat)highValue low:(CGFloat)lowValue + width:(CGFloat)width alignPoints:(BOOL)alignPoints { - const CGFloat halfBarWidth = CPTFloat(0.5) * self.barWidth; + const CGFloat halfBarWidth = CPTFloat(0.5) * width; + CPTFill *currentBarFill = nil; CPTLineStyle *theBorderLineStyle = nil; - if ( !isnan(openValue) && !isnan(closeValue) ) { + if ( !isnan(openValue) && !isnan(closeValue)) { if ( openValue < closeValue ) { theBorderLineStyle = [self increaseLineStyleForIndex:idx]; currentBarFill = [self increaseFillForIndex:idx]; @@ -784,7 +859,10 @@ -(void)drawCandleStickInContext:(CGContextRef)context } else { theBorderLineStyle = [self lineStyleForIndex:idx]; - currentBarFill = [CPTFill fillWithColor:theBorderLineStyle.lineColor]; + CPTColor *lineColor = theBorderLineStyle.lineColor; + if ( lineColor ) { + currentBarFill = [CPTFill fillWithColor:lineColor]; + } } } @@ -795,13 +873,13 @@ -(void)drawCandleStickInContext:(CGContextRef)context [theBorderLineStyle setLineStyleInContext:context]; CGFloat lineWidth = theBorderLineStyle.lineWidth; - if ( ( self.contentsScale > CPTFloat(1.0) ) && (round(lineWidth) == lineWidth) ) { + if ((self.contentsScale > CPTFloat(1.0)) && (round(lineWidth) == lineWidth)) { alignmentFunction = CPTAlignIntegralPointToUserSpace; } } // high - low only - if ( hasLineStyle && !isnan(highValue) && !isnan(lowValue) && ( isnan(openValue) || isnan(closeValue) ) ) { + if ( hasLineStyle && !isnan(highValue) && !isnan(lowValue) && (isnan(openValue) || isnan(closeValue))) { CGPoint alignedHighPoint = CPTPointMake(x, highValue); CGPoint alignedLowPoint = CPTPointMake(x, lowValue); if ( alignPoints ) { @@ -821,10 +899,10 @@ -(void)drawCandleStickInContext:(CGContextRef)context } // open-close - if ( !isnan(openValue) && !isnan(closeValue) ) { + if ( !isnan(openValue) && !isnan(closeValue)) { if ( currentBarFill || hasLineStyle ) { CGFloat radius = MIN(self.barCornerRadius, halfBarWidth); - radius = MIN( radius, ABS(closeValue - openValue) ); + radius = MIN(radius, ABS(closeValue - openValue)); CGPoint alignedPoint1 = CPTPointMake(x + halfBarWidth, openValue); CGPoint alignedPoint2 = CPTPointMake(x + halfBarWidth, closeValue); @@ -848,7 +926,7 @@ -(void)drawCandleStickInContext:(CGContextRef)context } } - if ( hasLineStyle && (openValue == closeValue) ) { + if ( hasLineStyle && (openValue == closeValue)) { // #285 Draw a cross with open/close values marked const CGFloat halfLineWidth = CPTFloat(0.5) * theBorderLineStyle.lineWidth; @@ -878,9 +956,9 @@ -(void)drawCandleStickInContext:(CGContextRef)context path = CGPathCreateMutable(); } - if ( !isnan(lowValue) ) { - if ( lowValue < MIN(openValue, closeValue) ) { - CGPoint alignedStartPoint = CPTPointMake( x, MIN(openValue, closeValue) ); + if ( !isnan(lowValue)) { + if ( lowValue < MIN(openValue, closeValue)) { + CGPoint alignedStartPoint = CPTPointMake(x, MIN(openValue, closeValue)); CGPoint alignedLowPoint = CPTPointMake(x, lowValue); if ( alignPoints ) { alignedStartPoint = alignmentFunction(context, alignedStartPoint); @@ -891,9 +969,9 @@ -(void)drawCandleStickInContext:(CGContextRef)context CGPathAddLineToPoint(path, NULL, alignedLowPoint.x, alignedLowPoint.y); } } - if ( !isnan(highValue) ) { - if ( highValue > MAX(openValue, closeValue) ) { - CGPoint alignedStartPoint = CPTPointMake( x, MAX(openValue, closeValue) ); + if ( !isnan(highValue)) { + if ( highValue > MAX(openValue, closeValue)) { + CGPoint alignedStartPoint = CPTPointMake(x, MAX(openValue, closeValue)); CGPoint alignedHighPoint = CPTPointMake(x, highValue); if ( alignPoints ) { alignedStartPoint = alignmentFunction(context, alignedStartPoint); @@ -914,7 +992,7 @@ -(void)drawCandleStickInContext:(CGContextRef)context } } --(void)drawOHLCInContext:(CGContextRef)context +-(void)drawOHLCInContext:(nonnull CGContextRef)context atIndex:(NSUInteger)idx x:(CGFloat)x open:(CGFloat)openValue @@ -925,7 +1003,7 @@ -(void)drawOHLCInContext:(CGContextRef)context { CPTLineStyle *theLineStyle = [self lineStyleForIndex:idx]; - if ( !isnan(openValue) && !isnan(closeValue) ) { + if ( !isnan(openValue) && !isnan(closeValue)) { if ( openValue < closeValue ) { CPTLineStyle *lineStyleForIncrease = [self increaseLineStyleForIndex:idx]; if ( [lineStyleForIncrease isKindOfClass:[CPTLineStyle class]] ) { @@ -947,12 +1025,12 @@ -(void)drawOHLCInContext:(CGContextRef)context CPTAlignPointFunction alignmentFunction = CPTAlignPointToUserSpace; CGFloat lineWidth = theLineStyle.lineWidth; - if ( ( self.contentsScale > CPTFloat(1.0) ) && (round(lineWidth) == lineWidth) ) { + if ((self.contentsScale > CPTFloat(1.0)) && (round(lineWidth) == lineWidth)) { alignmentFunction = CPTAlignIntegralPointToUserSpace; } // high-low - if ( !isnan(highValue) && !isnan(lowValue) ) { + if ( !isnan(highValue) && !isnan(lowValue)) { CGPoint alignedHighPoint = CPTPointMake(x, highValue); CGPoint alignedLowPoint = CPTPointMake(x, lowValue); if ( alignPoints ) { @@ -964,7 +1042,7 @@ -(void)drawOHLCInContext:(CGContextRef)context } // open - if ( !isnan(openValue) ) { + if ( !isnan(openValue)) { CGPoint alignedOpenStartPoint = CPTPointMake(x, openValue); CGPoint alignedOpenEndPoint = CPTPointMake(x - theStickLength, openValue); // left side if ( alignPoints ) { @@ -976,7 +1054,7 @@ -(void)drawOHLCInContext:(CGContextRef)context } // close - if ( !isnan(closeValue) ) { + if ( !isnan(closeValue)) { CGPoint alignedCloseStartPoint = CPTPointMake(x, closeValue); CGPoint alignedCloseEndPoint = CPTPointMake(x + theStickLength, closeValue); // right side if ( alignPoints ) { @@ -995,7 +1073,7 @@ -(void)drawOHLCInContext:(CGContextRef)context } } --(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(CGContextRef)context +-(void)drawSwatchForLegend:(nonnull CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(CGRect)rect inContext:(nonnull CGContextRef)context { [super drawSwatchForLegend:legend atIndex:idx inRect:rect inContext:context]; @@ -1005,7 +1083,7 @@ -(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(C switch ( self.plotStyle ) { case CPTTradingRangePlotStyleOHLC: [self drawOHLCInContext:context - atIndex:idx + atIndex:0 x:CGRectGetMidX(rect) open:CGRectGetMinY(rect) + rect.size.height / CPTFloat(3.0) close:CGRectGetMinY(rect) + rect.size.height * (CGFloat)(2.0 / 3.0) @@ -1016,56 +1094,57 @@ -(void)drawSwatchForLegend:(CPTLegend *)legend atIndex:(NSUInteger)idx inRect:(C case CPTTradingRangePlotStyleCandleStick: [self drawCandleStickInContext:context - atIndex:idx + atIndex:0 x:CGRectGetMidX(rect) open:CGRectGetMinY(rect) + rect.size.height / CPTFloat(3.0) close:CGRectGetMinY(rect) + rect.size.height * (CGFloat)(2.0 / 3.0) high:CGRectGetMaxY(rect) low:CGRectGetMinY(rect) + width:rect.size.width * CPTFloat(0.8) alignPoints:YES]; break; } } } --(CPTFill *)increaseFillForIndex:(NSUInteger)idx +-(nullable CPTFill *)increaseFillForIndex:(NSUInteger)idx { CPTFill *theFill = [self cachedValueForKey:CPTTradingRangePlotBindingIncreaseFills recordIndex:idx]; - if ( (theFill == nil) || (theFill == [CPTPlot nilData]) ) { + if ((theFill == nil) || (theFill == [CPTPlot nilData])) { theFill = self.increaseFill; } return theFill; } --(CPTFill *)decreaseFillForIndex:(NSUInteger)idx +-(nullable CPTFill *)decreaseFillForIndex:(NSUInteger)idx { CPTFill *theFill = [self cachedValueForKey:CPTTradingRangePlotBindingDecreaseFills recordIndex:idx]; - if ( (theFill == nil) || (theFill == [CPTPlot nilData]) ) { + if ((theFill == nil) || (theFill == [CPTPlot nilData])) { theFill = self.decreaseFill; } return theFill; } --(CPTLineStyle *)lineStyleForIndex:(NSUInteger)idx +-(nullable CPTLineStyle *)lineStyleForIndex:(NSUInteger)idx { CPTLineStyle *theLineStyle = [self cachedValueForKey:CPTTradingRangePlotBindingLineStyles recordIndex:idx]; - if ( (theLineStyle == nil) || (theLineStyle == [CPTPlot nilData]) ) { + if ((theLineStyle == nil) || (theLineStyle == [CPTPlot nilData])) { theLineStyle = self.lineStyle; } return theLineStyle; } --(CPTLineStyle *)increaseLineStyleForIndex:(NSUInteger)idx +-(nullable CPTLineStyle *)increaseLineStyleForIndex:(NSUInteger)idx { CPTLineStyle *theLineStyle = [self cachedValueForKey:CPTTradingRangePlotBindingIncreaseLineStyles recordIndex:idx]; - if ( (theLineStyle == nil) || (theLineStyle == [CPTPlot nilData]) ) { + if ((theLineStyle == nil) || (theLineStyle == [CPTPlot nilData])) { theLineStyle = self.increaseLineStyle; } @@ -1076,11 +1155,11 @@ -(CPTLineStyle *)increaseLineStyleForIndex:(NSUInteger)idx return theLineStyle; } --(CPTLineStyle *)decreaseLineStyleForIndex:(NSUInteger)idx +-(nullable CPTLineStyle *)decreaseLineStyleForIndex:(NSUInteger)idx { CPTLineStyle *theLineStyle = [self cachedValueForKey:CPTTradingRangePlotBindingDecreaseLineStyles recordIndex:idx]; - if ( (theLineStyle == nil) || (theLineStyle == [CPTPlot nilData]) ) { + if ((theLineStyle == nil) || (theLineStyle == [CPTPlot nilData])) { theLineStyle = self.decreaseLineStyle; } @@ -1091,6 +1170,17 @@ -(CPTLineStyle *)decreaseLineStyleForIndex:(NSUInteger)idx return theLineStyle; } +-(nonnull NSNumber *)barWidthForIndex:(NSUInteger)idx +{ + NSNumber *theBarWidth = [self cachedValueForKey:CPTTradingRangePlotBindingBarWidths recordIndex:idx]; + + if ((theBarWidth == nil) || (theBarWidth == [CPTPlot nilData])) { + theBarWidth = @(self.barWidth); + } + + return theBarWidth; +} + /// @endcond #pragma mark - @@ -1098,9 +1188,9 @@ -(CPTLineStyle *)decreaseLineStyleForIndex:(NSUInteger)idx /// @cond -+(BOOL)needsDisplayForKey:(NSString *)aKey ++(BOOL)needsDisplayForKey:(nonnull NSString *)aKey { - static NSSet *keys = nil; + static NSSet *keys = nil; static dispatch_once_t onceToken = 0; dispatch_once(&onceToken, ^{ @@ -1130,7 +1220,7 @@ -(NSUInteger)numberOfFields return 5; } --(NSArray *)fieldIdentifiers +-(nonnull CPTNumberArray *)fieldIdentifiers { return @[@(CPTTradingRangePlotFieldX), @(CPTTradingRangePlotFieldOpen), @@ -1139,21 +1229,21 @@ -(NSArray *)fieldIdentifiers @(CPTTradingRangePlotFieldLow)]; } --(NSArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord +-(nonnull CPTNumberArray *)fieldIdentifiersForCoordinate:(CPTCoordinate)coord { - NSArray *result = nil; + CPTNumberArray *result = nil; switch ( coord ) { case CPTCoordinateX: result = @[@(CPTTradingRangePlotFieldX)]; - break; + break; case CPTCoordinateY: result = @[@(CPTTradingRangePlotFieldOpen), @(CPTTradingRangePlotFieldLow), @(CPTTradingRangePlotFieldHigh), @(CPTTradingRangePlotFieldClose)]; - break; + break; default: [NSException raise:CPTException format:@"Invalid coordinate passed to fieldIdentifiersForCoordinate:"]; @@ -1192,24 +1282,29 @@ -(CPTCoordinate)coordinateForFieldIdentifier:(NSUInteger)field /// @cond --(void)positionLabelAnnotation:(CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx +-(void)positionLabelAnnotation:(nonnull CPTPlotSpaceAnnotation *)label forIndex:(NSUInteger)idx { BOOL positiveDirection = YES; CPTPlotRange *yRange = [self.plotSpace plotRangeForCoordinate:CPTCoordinateY]; - if ( CPTDecimalLessThan( yRange.length, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalLessThan(yRange.lengthDecimal, CPTDecimalFromInteger(0))) { positiveDirection = !positiveDirection; } - NSNumber *xValue = [self cachedNumberForField:CPTTradingRangePlotFieldX recordIndex:idx]; + NSNumber *xValue = [self cachedNumberForField:CPTTradingRangePlotFieldX recordIndex:idx]; + NSNumber *openValue = [self cachedNumberForField:CPTTradingRangePlotFieldOpen recordIndex:idx]; + NSNumber *closeValue = [self cachedNumberForField:CPTTradingRangePlotFieldClose recordIndex:idx]; + NSNumber *highValue = [self cachedNumberForField:CPTTradingRangePlotFieldHigh recordIndex:idx]; + NSNumber *lowValue = [self cachedNumberForField:CPTTradingRangePlotFieldLow recordIndex:idx]; + NSNumber *yValue; - NSArray *yValues = @[[self cachedNumberForField:CPTTradingRangePlotFieldOpen recordIndex:idx], - [self cachedNumberForField:CPTTradingRangePlotFieldClose recordIndex:idx], - [self cachedNumberForField:CPTTradingRangePlotFieldHigh recordIndex:idx], - [self cachedNumberForField:CPTTradingRangePlotFieldLow recordIndex:idx]]; - NSArray *yValuesSorted = [yValues sortedArrayUsingSelector:@selector(compare:)]; + CPTNumberArray *yValues = @[openValue, + closeValue, + highValue, + lowValue]; + CPTNumberArray *yValuesSorted = [yValues sortedArrayUsingSelector:@selector(compare:)]; if ( positiveDirection ) { - yValue = [yValuesSorted lastObject]; + yValue = yValuesSorted.lastObject; } else { yValue = yValuesSorted[0]; @@ -1255,7 +1350,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point CGFloat lastViewMax = CPTFloat(0.0); NSUInteger result = NSNotFound; - CGFloat minimumDistanceSquared = NAN; + CGFloat minimumDistanceSquared = CPTNAN; if ( self.doublePrecisionCache ) { const double *locationBytes = (const double *)locations.data.bytes; @@ -1281,7 +1376,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !isnan(plotPoint[dependentCoord]) && [yRange containsDouble:plotPoint[dependentCoord]] ) { openPoint = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, openPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1295,7 +1390,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !isnan(plotPoint[dependentCoord]) && [yRange containsDouble:plotPoint[dependentCoord]] ) { highPoint = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, highPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1309,7 +1404,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !isnan(plotPoint[dependentCoord]) && [yRange containsDouble:plotPoint[dependentCoord]] ) { lowPoint = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, lowPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1323,7 +1418,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !isnan(plotPoint[dependentCoord]) && [yRange containsDouble:plotPoint[dependentCoord]] ) { closePoint = [thePlotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, closePoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1334,18 +1429,18 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( result == i ) { lastViewX = openPoint.x; - if ( isnan(lastViewX) ) { + if ( isnan(lastViewX)) { lastViewX = highPoint.x; } - else if ( isnan(lastViewX) ) { + else if ( isnan(lastViewX)) { lastViewX = lowPoint.x; } - else if ( isnan(lastViewX) ) { + else if ( isnan(lastViewX)) { lastViewX = closePoint.x; } - lastViewMin = MIN( MIN(openPoint.y, closePoint.y), MIN(highPoint.y, lowPoint.y) ); - lastViewMax = MAX( MAX(openPoint.y, closePoint.y), MAX(highPoint.y, lowPoint.y) ); + lastViewMin = MIN(MIN(openPoint.y, closePoint.y), MIN(highPoint.y, lowPoint.y)); + lastViewMax = MAX(MAX(openPoint.y, closePoint.y), MAX(highPoint.y, lowPoint.y)); } } } @@ -1374,7 +1469,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !NSDecimalIsNotANumber(&plotPoint[dependentCoord]) && [yRange contains:plotPoint[dependentCoord]] ) { openPoint = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, openPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1388,7 +1483,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !NSDecimalIsNotANumber(&plotPoint[dependentCoord]) && [yRange contains:plotPoint[dependentCoord]] ) { highPoint = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, highPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1402,7 +1497,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !NSDecimalIsNotANumber(&plotPoint[dependentCoord]) && [yRange contains:plotPoint[dependentCoord]] ) { lowPoint = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, lowPoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1416,7 +1511,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( !NSDecimalIsNotANumber(&plotPoint[dependentCoord]) && [yRange contains:plotPoint[dependentCoord]] ) { closePoint = [thePlotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; CGFloat distanceSquared = squareOfDistanceBetweenPoints(point, closePoint); - if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared) ) { + if ( isnan(minimumDistanceSquared) || (distanceSquared < minimumDistanceSquared)) { minimumDistanceSquared = distanceSquared; result = i; } @@ -1427,18 +1522,18 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point if ( result == i ) { lastViewX = openPoint.x; - if ( isnan(lastViewX) ) { + if ( isnan(lastViewX)) { lastViewX = highPoint.x; } - else if ( isnan(lastViewX) ) { + else if ( isnan(lastViewX)) { lastViewX = lowPoint.x; } - else if ( isnan(lastViewX) ) { + else if ( isnan(lastViewX)) { lastViewX = closePoint.x; } - lastViewMin = MIN( MIN(openPoint.y, closePoint.y), MIN(highPoint.y, lowPoint.y) ); - lastViewMax = MAX( MAX(openPoint.y, closePoint.y), MAX(highPoint.y, lowPoint.y) ); + lastViewMin = MIN(MIN(openPoint.y, closePoint.y), MIN(highPoint.y, lowPoint.y)); + lastViewMax = MAX(MAX(openPoint.y, closePoint.y), MAX(highPoint.y, lowPoint.y)); } } } @@ -1452,14 +1547,14 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point break; case CPTTradingRangePlotStyleCandleStick: - offset = self.barWidth * CPTFloat(0.5); + offset = [self barWidthForIndex:result].cgFloatValue * CPTFloat(0.5); break; } - if ( ( point.x < (lastViewX - offset) ) || ( point.x > (lastViewX + offset) ) ) { + if ((point.x < (lastViewX - offset)) || (point.x > (lastViewX + offset))) { result = NSNotFound; } - if ( (point.y < lastViewMin) || (point.y > lastViewMax) ) { + if ((point.y < lastViewMin) || (point.y > lastViewMax)) { result = NSNotFound; } } @@ -1490,7 +1585,7 @@ -(NSUInteger)dataIndexFromInteractionPoint:(CGPoint)point * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { CPTGraph *theGraph = self.graph; CPTPlotArea *thePlotArea = self.plotArea; @@ -1499,7 +1594,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(tradingRangePlot:barTouchDownAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(tradingRangePlot:barTouchDownAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(tradingRangePlot:barWasSelectedAtRecordIndex:)] || @@ -1555,7 +1650,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { NSUInteger selectedDownIndex = self.pointingDeviceDownIndex; @@ -1568,7 +1663,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio return NO; } - id theDelegate = self.delegate; + id theDelegate = (id)self.delegate; if ( [theDelegate respondsToSelector:@selector(tradingRangePlot:barTouchUpAtRecordIndex:)] || [theDelegate respondsToSelector:@selector(tradingRangePlot:barTouchUpAtRecordIndex:withEvent:)] || [theDelegate respondsToSelector:@selector(tradingRangePlot:barWasSelectedAtRecordIndex:)] || @@ -1627,7 +1722,7 @@ -(void)setPlotStyle:(CPTTradingRangePlotStyle)newPlotStyle } } --(void)setLineStyle:(CPTLineStyle *)newLineStyle +-(void)setLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( lineStyle != newLineStyle ) { lineStyle = [newLineStyle copy]; @@ -1636,7 +1731,7 @@ -(void)setLineStyle:(CPTLineStyle *)newLineStyle } } --(void)setIncreaseLineStyle:(CPTLineStyle *)newLineStyle +-(void)setIncreaseLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( increaseLineStyle != newLineStyle ) { increaseLineStyle = [newLineStyle copy]; @@ -1645,7 +1740,7 @@ -(void)setIncreaseLineStyle:(CPTLineStyle *)newLineStyle } } --(void)setDecreaseLineStyle:(CPTLineStyle *)newLineStyle +-(void)setDecreaseLineStyle:(nullable CPTLineStyle *)newLineStyle { if ( decreaseLineStyle != newLineStyle ) { decreaseLineStyle = [newLineStyle copy]; @@ -1654,7 +1749,7 @@ -(void)setDecreaseLineStyle:(CPTLineStyle *)newLineStyle } } --(void)setIncreaseFill:(CPTFill *)newFill +-(void)setIncreaseFill:(nullable CPTFill *)newFill { if ( increaseFill != newFill ) { increaseFill = [newFill copy]; @@ -1663,7 +1758,7 @@ -(void)setIncreaseFill:(CPTFill *)newFill } } --(void)setDecreaseFill:(CPTFill *)newFill +-(void)setDecreaseFill:(nullable CPTFill *)newFill { if ( decreaseFill != newFill ) { decreaseFill = [newFill copy]; @@ -1706,106 +1801,106 @@ -(void)setShowBarBorder:(BOOL)newShowBarBorder } } --(void)setXValues:(CPTMutableNumericData *)newValues +-(void)setXValues:(nullable CPTMutableNumericData *)newValues { [self cacheNumbers:newValues forField:CPTTradingRangePlotFieldX]; } --(CPTMutableNumericData *)xValues +-(nullable CPTMutableNumericData *)xValues { return [self cachedNumbersForField:CPTTradingRangePlotFieldX]; } --(CPTMutableNumericData *)openValues +-(nullable CPTMutableNumericData *)openValues { return [self cachedNumbersForField:CPTTradingRangePlotFieldOpen]; } --(void)setOpenValues:(CPTMutableNumericData *)newValues +-(void)setOpenValues:(nullable CPTMutableNumericData *)newValues { [self cacheNumbers:newValues forField:CPTTradingRangePlotFieldOpen]; } --(CPTMutableNumericData *)highValues +-(nullable CPTMutableNumericData *)highValues { return [self cachedNumbersForField:CPTTradingRangePlotFieldHigh]; } --(void)setHighValues:(CPTMutableNumericData *)newValues +-(void)setHighValues:(nullable CPTMutableNumericData *)newValues { [self cacheNumbers:newValues forField:CPTTradingRangePlotFieldHigh]; } --(CPTMutableNumericData *)lowValues +-(nullable CPTMutableNumericData *)lowValues { return [self cachedNumbersForField:CPTTradingRangePlotFieldLow]; } --(void)setLowValues:(CPTMutableNumericData *)newValues +-(void)setLowValues:(nullable CPTMutableNumericData *)newValues { [self cacheNumbers:newValues forField:CPTTradingRangePlotFieldLow]; } --(CPTMutableNumericData *)closeValues +-(nullable CPTMutableNumericData *)closeValues { return [self cachedNumbersForField:CPTTradingRangePlotFieldClose]; } --(void)setCloseValues:(CPTMutableNumericData *)newValues +-(void)setCloseValues:(nullable CPTMutableNumericData *)newValues { [self cacheNumbers:newValues forField:CPTTradingRangePlotFieldClose]; } --(NSArray *)increaseFills +-(nullable CPTFillArray *)increaseFills { return [self cachedArrayForKey:CPTTradingRangePlotBindingIncreaseFills]; } --(void)setIncreaseFills:(NSArray *)newFills +-(void)setIncreaseFills:(nullable CPTFillArray *)newFills { [self cacheArray:newFills forKey:CPTTradingRangePlotBindingIncreaseFills]; [self setNeedsDisplay]; } --(NSArray *)decreaseFills +-(nullable CPTFillArray *)decreaseFills { return [self cachedArrayForKey:CPTTradingRangePlotBindingDecreaseFills]; } --(void)setDecreaseFills:(NSArray *)newFills +-(void)setDecreaseFills:(nullable CPTFillArray *)newFills { [self cacheArray:newFills forKey:CPTTradingRangePlotBindingDecreaseFills]; [self setNeedsDisplay]; } --(NSArray *)lineStyles +-(nullable CPTLineStyleArray *)lineStyles { return [self cachedArrayForKey:CPTTradingRangePlotBindingLineStyles]; } --(void)setLineStyles:(NSArray *)newLineStyles +-(void)setLineStyles:(nullable CPTLineStyleArray *)newLineStyles { [self cacheArray:newLineStyles forKey:CPTTradingRangePlotBindingLineStyles]; [self setNeedsDisplay]; } --(NSArray *)increaseLineStyles +-(nullable CPTLineStyleArray *)increaseLineStyles { return [self cachedArrayForKey:CPTTradingRangePlotBindingIncreaseLineStyles]; } --(void)setIncreaseLineStyles:(NSArray *)newLineStyles +-(void)setIncreaseLineStyles:(nullable CPTLineStyleArray *)newLineStyles { [self cacheArray:newLineStyles forKey:CPTTradingRangePlotBindingIncreaseLineStyles]; [self setNeedsDisplay]; } --(NSArray *)decreaseLineStyles +-(nullable CPTLineStyleArray *)decreaseLineStyles { return [self cachedArrayForKey:CPTTradingRangePlotBindingDecreaseLineStyles]; } --(void)setDecreaseLineStyles:(NSArray *)newLineStyles +-(void)setDecreaseLineStyles:(nullable CPTLineStyleArray *)newLineStyles { [self cacheArray:newLineStyles forKey:CPTTradingRangePlotBindingDecreaseLineStyles]; [self setNeedsDisplay]; diff --git a/framework/Source/CPTUtilities.h b/framework/Source/CPTUtilities.h index 90c214472..691923cec 100644 --- a/framework/Source/CPTUtilities.h +++ b/framework/Source/CPTUtilities.h @@ -2,6 +2,8 @@ /// @file +#pragma clang assume_nonnull begin + @class CPTLineStyle; #if __cplusplus @@ -28,7 +30,7 @@ float CPTDecimalFloatValue(NSDecimal decimalNumber); double CPTDecimalDoubleValue(NSDecimal decimalNumber); CGFloat CPTDecimalCGFloatValue(NSDecimal decimalNumber); -NSString *CPTDecimalStringValue(NSDecimal decimalNumber); +NSString *__nonnull CPTDecimalStringValue(NSDecimal decimalNumber); /// @} @@ -52,7 +54,7 @@ NSDecimal CPTDecimalFromFloat(float aFloat); NSDecimal CPTDecimalFromDouble(double aDouble); NSDecimal CPTDecimalFromCGFloat(CGFloat aCGFloat); -NSDecimal CPTDecimalFromString(NSString *stringRepresentation); +NSDecimal CPTDecimalFromString(NSString *__nonnull stringRepresentation); /// @} @@ -98,7 +100,7 @@ CPTCoordinate CPTOrthogonalCoordinate(CPTCoordinate coord); /// @name Gradient Colors /// @{ -CPTRGBAColor CPTRGBAColorFromCGColor(CGColorRef color); +CPTRGBAColor CPTRGBAColorFromCGColor(__nonnull CGColorRef color); /// @} @@ -108,29 +110,30 @@ CPTRGBAColor CPTRGBAColorFromCGColor(CGColorRef color); /** * @brief A function called to align a point in a CGContext. **/ -typedef CGPoint (*CPTAlignPointFunction)(CGContextRef, CGPoint); +typedef CGPoint (*CPTAlignPointFunction)(__nonnull CGContextRef, CGPoint); /** * @brief A function called to align a rectangle in a CGContext. **/ -typedef CGRect (*CPTAlignRectFunction)(CGContextRef, CGRect); +typedef CGRect (*CPTAlignRectFunction)(__nonnull CGContextRef, CGRect); -CGPoint CPTAlignPointToUserSpace(CGContextRef context, CGPoint point); -CGSize CPTAlignSizeToUserSpace(CGContextRef context, CGSize size); -CGRect CPTAlignRectToUserSpace(CGContextRef context, CGRect rect); +CGPoint CPTAlignPointToUserSpace(__nonnull CGContextRef context, CGPoint point); +CGSize CPTAlignSizeToUserSpace(__nonnull CGContextRef context, CGSize size); +CGRect CPTAlignRectToUserSpace(__nonnull CGContextRef context, CGRect rect); -CGPoint CPTAlignIntegralPointToUserSpace(CGContextRef context, CGPoint point); -CGRect CPTAlignIntegralRectToUserSpace(CGContextRef context, CGRect rect); +CGPoint CPTAlignIntegralPointToUserSpace(__nonnull CGContextRef context, CGPoint point); +CGRect CPTAlignIntegralRectToUserSpace(__nonnull CGContextRef context, CGRect rect); -CGRect CPTAlignBorderedRectToUserSpace(CGContextRef context, CGRect rect, CPTLineStyle *borderLineStyle); +CGRect CPTAlignBorderedRectToUserSpace(__nonnull CGContextRef context, CGRect rect, CPTLineStyle *__nonnull borderLineStyle); /// @} /// @name String Formatting for Core Graphics Structs /// @{ -NSString *CPTStringFromPoint(CGPoint point); -NSString *CPTStringFromSize(CGSize size); -NSString *CPTStringFromRect(CGRect rect); +NSString *__nonnull CPTStringFromPoint(CGPoint point); +NSString *__nonnull CPTStringFromSize(CGSize size); +NSString *__nonnull CPTStringFromRect(CGRect rect); +NSString *__nonnull CPTStringFromVector(CGVector vector); /// @} @@ -147,6 +150,15 @@ BOOL CPTEdgeInsetsEqualToEdgeInsets(CPTEdgeInsets insets1, CPTEdgeInsets insets2 /// @} +/// @name Log Modulus Definition +/// @{ +double CPTLogModulus(double value); +double CPTInverseLogModulus(double value); + +/// @} + #if __cplusplus } #endif + +#pragma clang assume_nonnull end diff --git a/framework/Source/CPTUtilities.m b/framework/Source/CPTUtilities.m index d7ff0d977..1a4641de6 100644 --- a/framework/Source/CPTUtilities.m +++ b/framework/Source/CPTUtilities.m @@ -20,7 +20,7 @@ **/ int8_t CPTDecimalCharValue(NSDecimal decimalNumber) { - return (int8_t)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] charValue]; + return (int8_t)[NSDecimalNumber decimalNumberWithDecimal:decimalNumber].charValue; } /** @@ -30,7 +30,7 @@ int8_t CPTDecimalCharValue(NSDecimal decimalNumber) **/ int16_t CPTDecimalShortValue(NSDecimal decimalNumber) { - return (int16_t)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] shortValue]; + return (int16_t)[NSDecimalNumber decimalNumberWithDecimal:decimalNumber].shortValue; } /** @@ -40,7 +40,17 @@ int16_t CPTDecimalShortValue(NSDecimal decimalNumber) **/ int32_t CPTDecimalLongValue(NSDecimal decimalNumber) { - return (int32_t)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] longValue]; + NSDecimalNumber *d = [NSDecimalNumber decimalNumberWithDecimal:decimalNumber]; + + d = [d decimalNumberByRoundingAccordingToBehavior: + [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown + scale:0 + raiseOnExactness:NO + raiseOnOverflow:NO + raiseOnUnderflow:NO + raiseOnDivideByZero:NO]]; + + return (int32_t)d.longValue; } /** @@ -50,7 +60,17 @@ int32_t CPTDecimalLongValue(NSDecimal decimalNumber) **/ int64_t CPTDecimalLongLongValue(NSDecimal decimalNumber) { - return (int64_t)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] longLongValue]; + NSDecimalNumber *d = [NSDecimalNumber decimalNumberWithDecimal:decimalNumber]; + + d = [d decimalNumberByRoundingAccordingToBehavior: + [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown + scale:0 + raiseOnExactness:NO + raiseOnOverflow:NO + raiseOnUnderflow:NO + raiseOnDivideByZero:NO]]; + + return (int64_t)d.longLongValue; } /** @@ -60,7 +80,7 @@ int64_t CPTDecimalLongLongValue(NSDecimal decimalNumber) **/ int CPTDecimalIntValue(NSDecimal decimalNumber) { - return [[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] intValue]; + return [NSDecimalNumber decimalNumberWithDecimal:decimalNumber].intValue; } /** @@ -70,7 +90,17 @@ int CPTDecimalIntValue(NSDecimal decimalNumber) **/ NSInteger CPTDecimalIntegerValue(NSDecimal decimalNumber) { - return (NSInteger)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] integerValue]; + NSDecimalNumber *d = [NSDecimalNumber decimalNumberWithDecimal:decimalNumber]; + + d = [d decimalNumberByRoundingAccordingToBehavior: + [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown + scale:0 + raiseOnExactness:NO + raiseOnOverflow:NO + raiseOnUnderflow:NO + raiseOnDivideByZero:NO]]; + + return (NSInteger)d.integerValue; } /** @@ -80,7 +110,7 @@ NSInteger CPTDecimalIntegerValue(NSDecimal decimalNumber) **/ uint8_t CPTDecimalUnsignedCharValue(NSDecimal decimalNumber) { - return (uint8_t)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] unsignedCharValue]; + return (uint8_t)[NSDecimalNumber decimalNumberWithDecimal:decimalNumber].unsignedCharValue; } /** @@ -90,7 +120,7 @@ uint8_t CPTDecimalUnsignedCharValue(NSDecimal decimalNumber) **/ uint16_t CPTDecimalUnsignedShortValue(NSDecimal decimalNumber) { - return (uint16_t)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] unsignedShortValue]; + return (uint16_t)[NSDecimalNumber decimalNumberWithDecimal:decimalNumber].unsignedShortValue; } /** @@ -100,7 +130,17 @@ uint16_t CPTDecimalUnsignedShortValue(NSDecimal decimalNumber) **/ uint32_t CPTDecimalUnsignedLongValue(NSDecimal decimalNumber) { - return (uint32_t)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] unsignedLongValue]; + NSDecimalNumber *d = [NSDecimalNumber decimalNumberWithDecimal:decimalNumber]; + + d = [d decimalNumberByRoundingAccordingToBehavior: + [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown + scale:0 + raiseOnExactness:NO + raiseOnOverflow:NO + raiseOnUnderflow:NO + raiseOnDivideByZero:NO]]; + + return (uint32_t)d.unsignedLongValue; } /** @@ -110,7 +150,17 @@ uint32_t CPTDecimalUnsignedLongValue(NSDecimal decimalNumber) **/ uint64_t CPTDecimalUnsignedLongLongValue(NSDecimal decimalNumber) { - return (uint64_t)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] unsignedLongLongValue]; + NSDecimalNumber *d = [NSDecimalNumber decimalNumberWithDecimal:decimalNumber]; + + d = [d decimalNumberByRoundingAccordingToBehavior: + [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown + scale:0 + raiseOnExactness:NO + raiseOnOverflow:NO + raiseOnUnderflow:NO + raiseOnDivideByZero:NO]]; + + return (uint64_t)d.unsignedLongLongValue; } /** @@ -120,7 +170,7 @@ uint64_t CPTDecimalUnsignedLongLongValue(NSDecimal decimalNumber) **/ unsigned int CPTDecimalUnsignedIntValue(NSDecimal decimalNumber) { - return [[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] unsignedIntValue]; + return [NSDecimalNumber decimalNumberWithDecimal:decimalNumber].unsignedIntValue; } /** @@ -130,7 +180,17 @@ unsigned int CPTDecimalUnsignedIntValue(NSDecimal decimalNumber) **/ NSUInteger CPTDecimalUnsignedIntegerValue(NSDecimal decimalNumber) { - return (NSUInteger)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] unsignedIntegerValue]; + NSDecimalNumber *d = [NSDecimalNumber decimalNumberWithDecimal:decimalNumber]; + + d = [d decimalNumberByRoundingAccordingToBehavior: + [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundDown + scale:0 + raiseOnExactness:NO + raiseOnOverflow:NO + raiseOnUnderflow:NO + raiseOnDivideByZero:NO]]; + + return (NSUInteger)d.unsignedIntegerValue; } /** @@ -140,7 +200,7 @@ NSUInteger CPTDecimalUnsignedIntegerValue(NSDecimal decimalNumber) **/ float CPTDecimalFloatValue(NSDecimal decimalNumber) { - return [[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] floatValue]; + return [NSDecimalNumber decimalNumberWithDecimal:decimalNumber].floatValue; } /** @@ -150,7 +210,7 @@ float CPTDecimalFloatValue(NSDecimal decimalNumber) **/ double CPTDecimalDoubleValue(NSDecimal decimalNumber) { - return [[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] doubleValue]; + return [NSDecimalNumber decimalNumberWithDecimal:decimalNumber].doubleValue; } /** @@ -161,8 +221,7 @@ float CPTDecimalFloatValue(NSDecimal decimalNumber) CGFloat CPTDecimalCGFloatValue(NSDecimal decimalNumber) { #if CGFLOAT_IS_DOUBLE - return (CGFloat)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] doubleValue]; - + return (CGFloat)[NSDecimalNumber decimalNumberWithDecimal:decimalNumber].doubleValue; #else return (CGFloat)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] floatValue]; #endif @@ -173,9 +232,9 @@ CGFloat CPTDecimalCGFloatValue(NSDecimal decimalNumber) * @param decimalNumber The @ref NSDecimal value. * @return The converted value. **/ -NSString *CPTDecimalStringValue(NSDecimal decimalNumber) +NSString *__nonnull CPTDecimalStringValue(NSDecimal decimalNumber) { - return [[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] stringValue]; + return [NSDecimalNumber decimalNumberWithDecimal:decimalNumber].stringValue; } #pragma mark - @@ -188,7 +247,7 @@ CGFloat CPTDecimalCGFloatValue(NSDecimal decimalNumber) **/ NSDecimal CPTDecimalFromChar(int8_t anInt) { - if ( (anInt >= 0) && (anInt < kCacheSize) ) { + if ((anInt >= 0) && (anInt < kCacheSize)) { if ( !cacheValueInitialized[anInt] ) { NSString *stringValue = [[NSString alloc] initWithFormat:@"%hhd", anInt]; cache[anInt] = CPTDecimalFromString(stringValue); @@ -211,7 +270,7 @@ NSDecimal CPTDecimalFromChar(int8_t anInt) **/ NSDecimal CPTDecimalFromShort(int16_t anInt) { - if ( (anInt >= 0) && (anInt < kCacheSize) ) { + if ((anInt >= 0) && (anInt < kCacheSize)) { if ( !cacheValueInitialized[anInt] ) { NSString *stringValue = [[NSString alloc] initWithFormat:@"%hd", anInt]; cache[anInt] = CPTDecimalFromString(stringValue); @@ -234,7 +293,7 @@ NSDecimal CPTDecimalFromShort(int16_t anInt) **/ NSDecimal CPTDecimalFromLong(int32_t anInt) { - if ( (anInt >= 0) && (anInt < kCacheSize) ) { + if ((anInt >= 0) && (anInt < kCacheSize)) { if ( !cacheValueInitialized[anInt] ) { NSString *stringValue = [[NSString alloc] initWithFormat:@"%d", anInt]; cache[anInt] = CPTDecimalFromString(stringValue); @@ -257,7 +316,7 @@ NSDecimal CPTDecimalFromLong(int32_t anInt) **/ NSDecimal CPTDecimalFromLongLong(int64_t anInt) { - if ( (anInt >= 0) && (anInt < kCacheSize) ) { + if ((anInt >= 0) && (anInt < kCacheSize)) { if ( !cacheValueInitialized[anInt] ) { NSString *stringValue = [[NSString alloc] initWithFormat:@"%lld", anInt]; cache[anInt] = CPTDecimalFromString(stringValue); @@ -280,7 +339,7 @@ NSDecimal CPTDecimalFromLongLong(int64_t anInt) **/ NSDecimal CPTDecimalFromInt(int anInt) { - if ( (anInt >= 0) && (anInt < kCacheSize) ) { + if ((anInt >= 0) && (anInt < kCacheSize)) { if ( !cacheValueInitialized[anInt] ) { NSString *stringValue = [[NSString alloc] initWithFormat:@"%d", anInt]; cache[anInt] = CPTDecimalFromString(stringValue); @@ -303,7 +362,7 @@ NSDecimal CPTDecimalFromInt(int anInt) **/ NSDecimal CPTDecimalFromInteger(NSInteger anInt) { - if ( (anInt >= 0) && (anInt < kCacheSize) ) { + if ((anInt >= 0) && (anInt < kCacheSize)) { if ( !cacheValueInitialized[anInt] ) { NSString *stringValue = [[NSString alloc] initWithFormat:@"%ld", (long)anInt]; cache[anInt] = CPTDecimalFromString(stringValue); @@ -464,11 +523,11 @@ NSDecimal CPTDecimalFromUnsignedInteger(NSUInteger anInt) **/ NSDecimal CPTDecimalFromFloat(float aFloat) { - if ( isnan(aFloat) ) { + if ( isnan(aFloat) || isinf(aFloat)) { return CPTDecimalNaN(); } else { - NSString *stringValue = [[NSString alloc] initWithFormat:@"%f", aFloat]; + NSString *stringValue = [[NSString alloc] initWithFormat:@"%f", (double)aFloat]; NSDecimal result = CPTDecimalFromString(stringValue); return result; @@ -482,7 +541,7 @@ NSDecimal CPTDecimalFromFloat(float aFloat) **/ NSDecimal CPTDecimalFromDouble(double aDouble) { - if ( isnan(aDouble) ) { + if ( isnan(aDouble) || isinf(aDouble)) { return CPTDecimalNaN(); } else { @@ -500,11 +559,11 @@ NSDecimal CPTDecimalFromDouble(double aDouble) **/ NSDecimal CPTDecimalFromCGFloat(CGFloat aCGFloat) { - if ( isnan(aCGFloat) ) { + if ( isnan(aCGFloat) || isinf(aCGFloat)) { return CPTDecimalNaN(); } else { - NSString *stringValue = [[NSString alloc] initWithFormat:@"%f", aCGFloat]; + NSString *stringValue = [[NSString alloc] initWithFormat:@"%f", (double)aCGFloat]; NSDecimal result = CPTDecimalFromString(stringValue); return result; @@ -516,7 +575,7 @@ NSDecimal CPTDecimalFromCGFloat(CGFloat aCGFloat) * @param stringRepresentation The string value. * @return The numeric value extracted from the string. **/ -NSDecimal CPTDecimalFromString(NSString *stringRepresentation) +NSDecimal CPTDecimalFromString(NSString *__nonnull stringRepresentation) { // The following NSDecimalNumber-based creation of NSDecimal structs from strings is slower than // the NSScanner-based method: (307000 operations per second vs. 582000 operations per second for NSScanner) @@ -588,7 +647,18 @@ NSDecimal CPTDecimalDivide(NSDecimal numerator, NSDecimal denominator) { NSDecimal result; - NSDecimalDivide(&result, &numerator, &denominator, NSRoundBankers); + NSCalculationError calcError = NSDecimalDivide(&result, &numerator, &denominator, NSRoundBankers); + + switch ( calcError ) { + case NSCalculationUnderflow: + case NSCalculationDivideByZero: + result = CPTDecimalFromInteger(0); + break; + + default: + // no error--return the result of the division + break; + } return result; } @@ -662,7 +732,7 @@ BOOL CPTDecimalEquals(NSDecimal leftOperand, NSDecimal rightOperand) **/ NSDecimal CPTDecimalNaN(void) { - return [[NSDecimalNumber notANumber] decimalValue]; + return [NSDecimalNumber notANumber].decimalValue; } /** @@ -673,7 +743,13 @@ NSDecimal CPTDecimalNaN(void) **/ NSDecimal CPTDecimalMin(NSDecimal leftOperand, NSDecimal rightOperand) { - if ( NSDecimalCompare(&leftOperand, &rightOperand) == NSOrderedAscending ) { + if ( NSDecimalIsNotANumber(&leftOperand)) { + return rightOperand; + } + else if ( NSDecimalIsNotANumber(&rightOperand)) { + return leftOperand; + } + else if ( NSDecimalCompare(&leftOperand, &rightOperand) == NSOrderedAscending ) { return leftOperand; } else { @@ -689,7 +765,13 @@ NSDecimal CPTDecimalMin(NSDecimal leftOperand, NSDecimal rightOperand) **/ NSDecimal CPTDecimalMax(NSDecimal leftOperand, NSDecimal rightOperand) { - if ( NSDecimalCompare(&leftOperand, &rightOperand) == NSOrderedDescending ) { + if ( NSDecimalIsNotANumber(&leftOperand)) { + return rightOperand; + } + else if ( NSDecimalIsNotANumber(&rightOperand)) { + return leftOperand; + } + else if ( NSDecimalCompare(&leftOperand, &rightOperand) == NSOrderedDescending ) { return leftOperand; } else { @@ -704,11 +786,11 @@ NSDecimal CPTDecimalMax(NSDecimal leftOperand, NSDecimal rightOperand) **/ NSDecimal CPTDecimalAbs(NSDecimal value) { - if ( CPTDecimalGreaterThanOrEqualTo( value, CPTDecimalFromInteger(0) ) ) { + if ( CPTDecimalGreaterThanOrEqualTo(value, CPTDecimalFromInteger(0))) { return value; } else { - return CPTDecimalMultiply( value, CPTDecimalFromInteger(-1) ); + return CPTDecimalMultiply(value, CPTDecimalFromInteger(-1)); } } @@ -730,7 +812,7 @@ NSRange CPTExpandedRange(NSRange range, NSInteger expandBy) NSInteger lowerExpansion = (NSInteger)range.location - loc; NSInteger length = MAX(0, (NSInteger)range.length + lowerExpansion + expandBy); - return NSMakeRange( (NSUInteger)loc, (NSUInteger)length ); + return NSMakeRange((NSUInteger)loc, (NSUInteger)length); } #pragma mark - @@ -744,7 +826,7 @@ NSRange CPTExpandedRange(NSRange range, NSInteger expandBy) * @param color The color. * @return The RGBA components of the color. **/ -CPTRGBAColor CPTRGBAColorFromCGColor(CGColorRef color) +CPTRGBAColor CPTRGBAColorFromCGColor(__nonnull CGColorRef color) { CPTRGBAColor rgbColor; @@ -798,19 +880,15 @@ CPTCoordinate CPTOrthogonalCoordinate(CPTCoordinate coord) * @param point The point in user space. * @return The device aligned point in user space. **/ -CGPoint CPTAlignPointToUserSpace(CGContextRef context, CGPoint point) +CGPoint CPTAlignPointToUserSpace(__nonnull CGContextRef context, CGPoint point) { // Compute the coordinates of the point in device space. point = CGContextConvertPointToDeviceSpace(context, point); // Ensure that coordinates are at exactly the corner // of a device pixel. - point.x = round( point.x - CPTFloat(0.5) ) + CPTFloat(0.5); -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - point.y = round( point.y - CPTFloat(0.5) ) + CPTFloat(0.5); -#else + point.x = round(point.x - CPTFloat(0.5)) + CPTFloat(0.5); point.y = ceil(point.y) - CPTFloat(0.5); -#endif // Convert the device aligned coordinate back to user space. return CGContextConvertPointToUserSpace(context, point); @@ -826,7 +904,7 @@ CGPoint CPTAlignPointToUserSpace(CGContextRef context, CGPoint point) * @param size The size in user space. * @return The device aligned size in user space. **/ -CGSize CPTAlignSizeToUserSpace(CGContextRef context, CGSize size) +CGSize CPTAlignSizeToUserSpace(__nonnull CGContextRef context, CGSize size) { // Compute the size in device space. size = CGContextConvertSizeToDeviceSpace(context, size); @@ -850,24 +928,18 @@ CGSize CPTAlignSizeToUserSpace(CGContextRef context, CGSize size) * @param rect The rectangle in user space. * @return The device aligned rectangle in user space. **/ -CGRect CPTAlignRectToUserSpace(CGContextRef context, CGRect rect) +CGRect CPTAlignRectToUserSpace(__nonnull CGContextRef context, CGRect rect) { rect = CGContextConvertRectToDeviceSpace(context, rect); CGPoint oldOrigin = rect.origin; - rect.origin.x = round( rect.origin.x - CPTFloat(0.5) ); - rect.size.width = round( oldOrigin.x + rect.size.width - CPTFloat(0.5) ) - rect.origin.x; + rect.origin.x = round(rect.origin.x - CPTFloat(0.5)); + rect.size.width = round(oldOrigin.x + rect.size.width - CPTFloat(0.5)) - rect.origin.x; rect.origin.x += CPTFloat(0.5); -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - rect.origin.y = round( rect.origin.y - CPTFloat(0.5) ); - rect.size.height = round( oldOrigin.y + rect.size.height - CPTFloat(0.5) ) - rect.origin.y; - rect.origin.y += CPTFloat(0.5); -#else - rect.origin.y = ceil( CGRectGetMaxY(rect) ) - CPTFloat(0.5); + rect.origin.y = ceil(CGRectGetMaxY(rect)) - CPTFloat(0.5); rect.size.height = ceil(oldOrigin.y - CPTFloat(0.5) - rect.origin.y); -#endif return CGContextConvertRectToUserSpace(context, rect); } @@ -884,16 +956,12 @@ CGRect CPTAlignRectToUserSpace(CGContextRef context, CGRect rect) * @param point The point in user space. * @return The device aligned point in user space. **/ -CGPoint CPTAlignIntegralPointToUserSpace(CGContextRef context, CGPoint point) +CGPoint CPTAlignIntegralPointToUserSpace(__nonnull CGContextRef context, CGPoint point) { point = CGContextConvertPointToDeviceSpace(context, point); point.x = round(point.x); -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - point.y = round(point.y); -#else - point.y = ceil( point.y - CPTFloat(0.5) ); -#endif + point.y = ceil(point.y - CPTFloat(0.5)); return CGContextConvertPointToUserSpace(context, point); } @@ -908,7 +976,7 @@ CGPoint CPTAlignIntegralPointToUserSpace(CGContextRef context, CGPoint point) * @param rect The rectangle in user space. * @return The device aligned rectangle in user space. **/ -CGRect CPTAlignIntegralRectToUserSpace(CGContextRef context, CGRect rect) +CGRect CPTAlignIntegralRectToUserSpace(__nonnull CGContextRef context, CGRect rect) { rect = CGContextConvertRectToDeviceSpace(context, rect); @@ -917,30 +985,25 @@ CGRect CPTAlignIntegralRectToUserSpace(CGContextRef context, CGRect rect) rect.origin.x = round(rect.origin.x); rect.size.width = round(oldOrigin.x + rect.size.width) - rect.origin.x; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE - rect.origin.y = round(rect.origin.y); - rect.size.height = round(oldOrigin.y + rect.size.height) - rect.origin.y; -#else - rect.origin.y = ceil( CGRectGetMaxY(rect) - CPTFloat(0.5) ); + rect.origin.y = ceil(CGRectGetMaxY(rect) - CPTFloat(0.5)); rect.size.height = ceil(oldOrigin.y - CPTFloat(0.5) - rect.origin.y); -#endif return CGContextConvertRectToUserSpace(context, rect); } -CGRect CPTAlignBorderedRectToUserSpace(CGContextRef context, CGRect rect, CPTLineStyle *borderLineStyle) +CGRect CPTAlignBorderedRectToUserSpace(__nonnull CGContextRef context, CGRect rect, CPTLineStyle *__nonnull borderLineStyle) { CGRect borderRect; CGFloat contextScale = CPTFloat(1.0); - if ( rect.size.height != CPTFloat(0.0) ) { + if ( rect.size.height != CPTFloat(0.0)) { CGRect deviceRect = CGContextConvertRectToDeviceSpace(context, rect); contextScale = deviceRect.size.height / rect.size.height; } - if ( contextScale != CPTFloat(1.0) ) { + if ( contextScale != CPTFloat(1.0)) { CGFloat borderWidth = borderLineStyle.lineWidth; - if ( ( borderWidth > CPTFloat(0.0) ) && ( borderWidth == round(borderWidth) ) ) { + if ((borderWidth > CPTFloat(0.0)) && (borderWidth == round(borderWidth))) { borderRect = CPTAlignIntegralRectToUserSpace(context, rect); } else { @@ -961,27 +1024,36 @@ CGRect CPTAlignBorderedRectToUserSpace(CGContextRef context, CGRect rect, CPTLin * @param point The point. * @return A string with the format {x, y}. **/ -NSString *CPTStringFromPoint(CGPoint point) +NSString *__nonnull CPTStringFromPoint(CGPoint point) { - return [NSString stringWithFormat:@"{%g, %g}", point.x, point.y]; + return [NSString stringWithFormat:@"{%g, %g}", (double)point.x, (double)point.y]; } /** @brief Creates a string representation of the given size. * @param size The size. * @return A string with the format {width, height}. **/ -NSString *CPTStringFromSize(CGSize size) +NSString *__nonnull CPTStringFromSize(CGSize size) { - return [NSString stringWithFormat:@"{%g, %g}", size.width, size.height]; + return [NSString stringWithFormat:@"{%g, %g}", (double)size.width, (double)size.height]; } /** @brief Creates a string representation of the given rectangle. * @param rect The rectangle. * @return A string with the format {{x, y}, {width, height}}. **/ -NSString *CPTStringFromRect(CGRect rect) +NSString *__nonnull CPTStringFromRect(CGRect rect) +{ + return [NSString stringWithFormat:@"{{%g, %g}, {%g, %g}}", (double)rect.origin.x, (double)rect.origin.y, (double)rect.size.width, (double)rect.size.height]; +} + +/** @brief Creates a string representation of the given vector. + * @param vector The vector. + * @return A string with the format {dx, dy}. + **/ +NSString *__nonnull CPTStringFromVector(CGVector vector) { - return [NSString stringWithFormat:@"{{%g, %g}, {%g, %g}}", rect.origin.x, rect.origin.y, rect.size.width, rect.size.height]; + return [NSString stringWithFormat:@"{%g, %g}", (double)vector.dx, (double)vector.dy]; } #pragma mark - @@ -1004,6 +1076,13 @@ CGFloat squareOfDistanceBetweenPoints(CGPoint point1, CGPoint point2) #pragma mark - #pragma mark Edge Inset Utilities +/** @brief Returns a CPTEdgeInsets struct with the given insets. + * @param top The top inset. + * @param left The left inset. + * @param bottom The bottom inset. + * @param right The right inset. + * @return A CPTEdgeInsets struct with the given insets. + **/ CPTEdgeInsets CPTEdgeInsetsMake(CGFloat top, CGFloat left, CGFloat bottom, CGFloat right) { CPTEdgeInsets insets; @@ -1016,6 +1095,11 @@ CPTEdgeInsets CPTEdgeInsetsMake(CGFloat top, CGFloat left, CGFloat bottom, CGFlo return insets; } +/** @brief Compares two CPTEdgeInsets structstructs. + * @param insets1 The first inset. + * @param insets2 The second inset. + * @return @YES if the two CPTEdgeInsets structs are equal. + **/ BOOL CPTEdgeInsetsEqualToEdgeInsets(CPTEdgeInsets insets1, CPTEdgeInsets insets2) { return (insets1.top == insets2.top) && @@ -1023,3 +1107,39 @@ BOOL CPTEdgeInsetsEqualToEdgeInsets(CPTEdgeInsets insets1, CPTEdgeInsets insets2 (insets1.bottom == insets2.bottom) && (insets1.right == insets2.right); } + +#pragma mark - +#pragma mark Log Modulus + +/** @brief Computes the log modulus of the given value. + * @param value The value. + * @return The log modulus of the given value. + * @see A log transformation of positive and negative values for more information about the log-modulus transformation. + **/ +double CPTLogModulus(double value) +{ + if ( value != 0.0 ) { + double sign = (signbit(value) ? -1.0 : +1.0); + + return sign * log10(fabs(value) + 1.0); + } + else { + return 0.0; + } +} + +/** @brief Computes the inverse log modulus of the given value. + * @param value The value. + * @return The inverse log modulus of the given value. + **/ +double CPTInverseLogModulus(double value) +{ + if ( value != 0.0 ) { + double sign = (signbit(value) ? -1.0 : +1.0); + + return sign * (pow(10.0, fabs(value)) - 1.0); + } + else { + return 0.0; + } +} diff --git a/framework/Source/CPTUtilitiesTests.m b/framework/Source/CPTUtilitiesTests.m index e722f3efb..c8335a100 100644 --- a/framework/Source/CPTUtilitiesTests.m +++ b/framework/Source/CPTUtilitiesTests.m @@ -15,22 +15,28 @@ -(void)setUp const size_t height = 50; const size_t bitsPerComponent = 8; +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); +#else CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); +#endif - self.context = CGBitmapContextCreate(NULL, - width, - height, - bitsPerComponent, - width * bitsPerComponent * 4, - colorSpace, - (CGBitmapInfo)kCGImageAlphaNoneSkipLast); + CGContextRef testContext = CGBitmapContextCreate(NULL, + width, + height, + bitsPerComponent, + width * bitsPerComponent * 4, + colorSpace, + (CGBitmapInfo)kCGImageAlphaNoneSkipLast); + self.context = testContext; + + CGContextRelease(testContext); CGColorSpaceRelease(colorSpace); } -(void)tearDown { - CGContextRelease(self.context); self.context = NULL; } @@ -44,7 +50,7 @@ -(void)testCPTDecimalIntegerValue XCTAssertEqual(CPTDecimalIntegerValue([d decimalValue]), (NSInteger)42, @"Result incorrect"); d = [NSDecimalNumber decimalNumberWithString:@"42.1"]; - XCTAssertEqual( (NSInteger)CPTDecimalIntegerValue([d decimalValue]), (NSInteger)42, @"Result incorrect" ); + XCTAssertEqual((NSInteger)CPTDecimalIntegerValue([d decimalValue]), (NSInteger)42, @"Result incorrect"); } -(void)testCPTDecimalFloatValue @@ -76,14 +82,14 @@ -(void)testToDecimalConversion XCTAssertEqualObjects([NSDecimalNumber decimalNumberWithString:@"100"], [NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromInteger(i)], @"NSInteger to NSDecimal conversion failed"); XCTAssertEqualObjects([NSDecimalNumber decimalNumberWithString:@"100"], [NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromUnsignedInteger(unsignedI)], @"NSUInteger to NSDecimal conversion failed"); - XCTAssertEqualWithAccuracy([@(f)floatValue], [[NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromFloat(f)] floatValue], 1.0e-7, @"float to NSDecimal conversion failed"); + XCTAssertEqualWithAccuracy([@(f) floatValue], [[NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromFloat(f)] floatValue], 1.0e-7f, @"float to NSDecimal conversion failed"); XCTAssertEqualObjects(@(d), [NSDecimalNumber decimalNumberWithDecimal:CPTDecimalFromDouble(d)], @"double to NSDecimal conversion failed."); } -(void)testConvertNegativeOne { - NSDecimal zero = [[NSDecimalNumber zero] decimalValue]; - NSDecimal one = [[NSDecimalNumber one] decimalValue]; + NSDecimal zero = [NSDecimalNumber zero].decimalValue; + NSDecimal one = [NSDecimalNumber one].decimalValue; NSDecimal negativeOne; NSDecimalSubtract(&negativeOne, &zero, &one, NSRoundPlain); @@ -116,12 +122,136 @@ -(void)testConvertNegativeOne XCTAssertTrue(NSDecimalCompare(&testValue, &negativeOne) == NSOrderedSame, @"%@", errMessage); } +#pragma mark - +#pragma mark Decimal utilities + +-(void)testDecimalMax +{ + NSDecimal zero = CPTDecimalFromInteger(0); + NSDecimal one = CPTDecimalFromInteger(1); + NSDecimal dNAN = CPTDecimalNaN(); + + NSDecimal testValue; + NSString *errMessage; + + testValue = CPTDecimalMin(zero, one); + errMessage = [NSString stringWithFormat:@"test min(0, 1), expected %@", NSDecimalString(&zero, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &zero) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMin(one, zero); + errMessage = [NSString stringWithFormat:@"test min(1, 0), expected %@", NSDecimalString(&zero, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &zero) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMin(one, dNAN); + errMessage = [NSString stringWithFormat:@"test min(1, NAN), expected %@", NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMin(dNAN, one); + errMessage = [NSString stringWithFormat:@"test min(NAN, 1), expected %@", NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMin(dNAN, dNAN); + errMessage = [NSString stringWithFormat:@"test min(NAN, NAN), expected %@", NSDecimalString(&dNAN, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &dNAN) == NSOrderedSame, @"%@", errMessage); +} + +-(void)testDecimalMin +{ + NSDecimal zero = CPTDecimalFromInteger(0); + NSDecimal one = CPTDecimalFromInteger(1); + NSDecimal dNAN = CPTDecimalNaN(); + + NSDecimal testValue; + NSString *errMessage; + + testValue = CPTDecimalMax(zero, one); + errMessage = [NSString stringWithFormat:@"test min(0, 1), expected %@", NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMax(one, zero); + errMessage = [NSString stringWithFormat:@"test min(1, 0), expected %@", NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMax(one, dNAN); + errMessage = [NSString stringWithFormat:@"test min(1, NAN), expected %@", NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMax(dNAN, one); + errMessage = [NSString stringWithFormat:@"test min(NAN, 1), expected %@", NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalMin(dNAN, dNAN); + errMessage = [NSString stringWithFormat:@"test min(NAN, NAN), expected %@", NSDecimalString(&dNAN, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &dNAN) == NSOrderedSame, @"%@", errMessage); +} + +-(void)testDecimalAbs +{ + NSDecimal zero = CPTDecimalFromInteger(0); + NSDecimal one = CPTDecimalFromInteger(1); + NSDecimal negativeOne = CPTDecimalFromInteger(-1); + + NSDecimal testValue; + NSString *errMessage; + + testValue = CPTDecimalAbs(one); + errMessage = [NSString stringWithFormat:@"test value was %@, expected %@", NSDecimalString(&testValue, nil), NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalAbs(zero); + errMessage = [NSString stringWithFormat:@"test value was %@, expected %@", NSDecimalString(&testValue, nil), NSDecimalString(&zero, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &zero) == NSOrderedSame, @"%@", errMessage); + + testValue = CPTDecimalAbs(negativeOne); + errMessage = [NSString stringWithFormat:@"test value was %@, expected %@", NSDecimalString(&testValue, nil), NSDecimalString(&one, nil)]; + XCTAssertTrue(NSDecimalCompare(&testValue, &one) == NSOrderedSame, @"%@", errMessage); +} + +#pragma mark - +#pragma mark NSDecimalNumber tests + +// Fix issues with incorrect values when converting NSDecimalNumber to non-double values (due to bugs in NSDecimalNumber, see radar #32520109) +-(void)testNSDecimalNumberBugFix +{ + NSArray *strings = + @[ + @"0", // validation tests + @"1", + @"1.8446744073709551615", // 64/65 bit tests (radar 32520109) + @"1.8446744073709551616", + @"9.821426272392280061", // radar 25465729 tests + @"9.821426272392280060", + ]; + + for ( NSString *string in strings ) { + NSDecimalNumber *v = [NSDecimalNumber decimalNumberWithString:string]; + NSDecimal d = v.decimalValue; + double expectedDouble = v.doubleValue; + + XCTAssertEqual(CPTDecimalCharValue(d), (char)expectedDouble); + XCTAssertEqual(CPTDecimalUnsignedCharValue(d), (unsigned char)expectedDouble); + XCTAssertEqual(CPTDecimalShortValue(d), (short)expectedDouble); + XCTAssertEqual(CPTDecimalUnsignedShortValue(d), (unsigned short)expectedDouble); + XCTAssertEqual(CPTDecimalIntValue(d), (int)expectedDouble); + XCTAssertEqual(CPTDecimalUnsignedIntValue(d), (unsigned int)expectedDouble); + XCTAssertEqual(CPTDecimalLongValue(d), (long)expectedDouble); + XCTAssertEqual(CPTDecimalUnsignedLongValue(d), (unsigned long)expectedDouble); + XCTAssertEqual(CPTDecimalLongLongValue(d), (long long)expectedDouble); + XCTAssertEqual(CPTDecimalUnsignedLongLongValue(d), (unsigned long long)expectedDouble); + + XCTAssertEqual(CPTDecimalFloatValue(d), (float)expectedDouble); + + XCTAssertEqual(CPTDecimalIntegerValue(d), (NSInteger)expectedDouble); + XCTAssertEqual(CPTDecimalUnsignedIntegerValue(d), (NSUInteger)expectedDouble); + } +} + #pragma mark - #pragma mark Cached values -(void)testCachedZero { - NSDecimal zero = [[NSDecimalNumber zero] decimalValue]; + NSDecimal zero = [NSDecimalNumber zero].decimalValue; NSDecimal testValue; NSString *errMessage; @@ -178,7 +308,7 @@ -(void)testCachedZero -(void)testCachedOne { - NSDecimal one = [[NSDecimalNumber one] decimalValue]; + NSDecimal one = [NSDecimalNumber one].decimalValue; NSDecimal testValue; NSString *errMessage; @@ -574,4 +704,43 @@ -(void)testCPTAlignIntegralRectToUserSpace XCTAssertEqual(alignedRect.size.height, CPTFloat(0.0), @"round height (19.6364, 16.00001, 20.2727, 0.0)"); } +-(void)testLogModulus +{ + XCTAssertEqual(CPTLogModulus(0.0), 0.0, @"CPTLogModulus(0.0)"); + + XCTAssertEqual(CPTLogModulus(10.0), log10(11.0), @"CPTLogModulus(10.0)"); + XCTAssertEqual(CPTLogModulus(-10.0), -log10(11.0), @"CPTLogModulus(-10.0)"); + + XCTAssertEqual(CPTLogModulus(100.0), log10(101.0), @"CPTLogModulus(100.0)"); + XCTAssertEqual(CPTLogModulus(-100.0), -log10(101.0), @"CPTLogModulus(-100.0)"); +} + +-(void)testInverseLogModulus +{ + XCTAssertEqual(CPTInverseLogModulus(0.0), 0.0, @"CPTInverseLogModulus(0.0)"); + + XCTAssertEqualWithAccuracy(CPTInverseLogModulus(log10(11.0)), 10.0, 1.0e-7, @"CPTInverseLogModulus(log10(11.0))"); + XCTAssertEqualWithAccuracy(CPTInverseLogModulus(-log10(11.0)), -10.0, 1.0e-7, @"CPTInverseLogModulus(-log10(11.0))"); + + XCTAssertEqualWithAccuracy(CPTInverseLogModulus(log10(101.0)), 100.0, 1.0e-7, @"CPTInverseLogModulus(log10(101.0))"); + XCTAssertEqualWithAccuracy(CPTInverseLogModulus(-log10(101.0)), -100.0, 1.0e-7, @"CPTInverseLogModulus(-log10(101.0))"); +} + +/// @endcond + +#pragma mark - +#pragma mark Accessors + +/// @cond + +-(void)setContext:(nonnull CGContextRef)newContext +{ + if ( context != newContext ) { + CGContextRetain(newContext); + CGContextRelease(context); + + context = newContext; + } +} + @end diff --git a/framework/Source/CPTXYAxis.h b/framework/Source/CPTXYAxis.h index 5c23a3063..36cf150d2 100644 --- a/framework/Source/CPTXYAxis.h +++ b/framework/Source/CPTXYAxis.h @@ -6,8 +6,8 @@ /// @name Positioning /// @{ -@property (nonatomic, readwrite) NSDecimal orthogonalCoordinateDecimal; -@property (nonatomic, readwrite, strong) CPTConstraints *axisConstraints; +@property (nonatomic, readwrite, strong, nullable) NSNumber *orthogonalPosition; +@property (nonatomic, readwrite, strong, nullable) CPTConstraints *axisConstraints; /// @} @end diff --git a/framework/Source/CPTXYAxis.m b/framework/Source/CPTXYAxis.m index 2fec6f63c..9b0c117a4 100644 --- a/framework/Source/CPTXYAxis.m +++ b/framework/Source/CPTXYAxis.m @@ -16,10 +16,12 @@ /// @cond @interface CPTXYAxis() --(void)drawTicksInContext:(CGContextRef)context atLocations:(NSSet *)locations withLength:(CGFloat)length inRange:(CPTPlotRange *)labeledRange isMajor:(BOOL)major; +-(void)drawTicksInContext:(nonnull CGContextRef)context atLocations:(nullable CPTNumberSet *)locations withLength:(CGFloat)length inRange:(nullable CPTPlotRange *)labeledRange isMajor:(BOOL)major; --(void)orthogonalCoordinateViewLowerBound:(CGFloat *)lower upperBound:(CGFloat *)upper; --(CGPoint)viewPointForOrthogonalCoordinateDecimal:(NSDecimal)orthogonalCoord axisCoordinateDecimal:(NSDecimal)coordinateDecimalNumber; +-(void)orthogonalCoordinateViewLowerBound:(nonnull CGFloat *)lower upperBound:(nonnull CGFloat *)upper; +-(CGPoint)viewPointForOrthogonalCoordinate:(nullable NSNumber *)orthogonalCoord axisCoordinate:(nullable NSNumber *)coordinateValue; + +-(NSUInteger)initialBandIndexForSortedLocations:(nonnull CPTNumberArray *)sortedLocations inRange:(nullable CPTMutablePlotRange *)range; @end @@ -32,19 +34,19 @@ -(CGPoint)viewPointForOrthogonalCoordinateDecimal:(NSDecimal)orthogonalCoord axi **/ @implementation CPTXYAxis -/** @property NSDecimal orthogonalCoordinateDecimal +/** @property nullable NSNumber *orthogonalPosition * @brief The data coordinate value where the axis crosses the orthogonal axis. * If the @ref axisConstraints is non-nil, the constraints take priority and this property is ignored. * @see @ref axisConstraints **/ -@synthesize orthogonalCoordinateDecimal; +@synthesize orthogonalPosition; -/** @property CPTConstraints *axisConstraints +/** @property nullable CPTConstraints *axisConstraints * @brief The constraints used when positioning relative to the plot area. * If @nil (the default), the axis is fixed relative to the plot space coordinates, - * crossing the orthogonal axis at @ref orthogonalCoordinateDecimal and moves only + * crossing the orthogonal axis at @ref orthogonalPosition and moves only * whenever the plot space ranges change. - * @see @ref orthogonalCoordinateDecimal + * @see @ref orthogonalPosition **/ @synthesize axisConstraints; @@ -57,18 +59,18 @@ @implementation CPTXYAxis /** @brief Initializes a newly allocated CPTXYAxis object with the provided frame rectangle. * * This is the designated initializer. The initialized layer will have the following properties: - * - @ref orthogonalCoordinateDecimal = @num{0} + * - @ref orthogonalPosition = @num{0} * - @ref axisConstraints = @nil * * @param newFrame The frame rectangle. * @return The initialized CPTXYAxis object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { - orthogonalCoordinateDecimal = CPTDecimalFromInteger(0); - axisConstraints = nil; - self.tickDirection = CPTSignNone; + if ((self = [super initWithFrame:newFrame])) { + orthogonalPosition = @0.0; + axisConstraints = nil; + self.tickDirection = CPTSignNone; } return self; } @@ -77,13 +79,13 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTXYAxis *theLayer = (CPTXYAxis *)layer; - orthogonalCoordinateDecimal = theLayer->orthogonalCoordinateDecimal; - axisConstraints = theLayer->axisConstraints; + orthogonalPosition = theLayer->orthogonalPosition; + axisConstraints = theLayer->axisConstraints; } return self; } @@ -95,31 +97,45 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; - [coder encodeDecimal:self.orthogonalCoordinateDecimal forKey:@"CPTXYAxis.orthogonalCoordinateDecimal"]; + [coder encodeObject:self.orthogonalPosition forKey:@"CPTXYAxis.orthogonalPosition"]; [coder encodeObject:self.axisConstraints forKey:@"CPTXYAxis.axisConstraints"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - orthogonalCoordinateDecimal = [coder decodeDecimalForKey:@"CPTXYAxis.orthogonalCoordinateDecimal"]; - axisConstraints = [coder decodeObjectForKey:@"CPTXYAxis.axisConstraints"]; + if ((self = [super initWithCoder:coder])) { + orthogonalPosition = [coder decodeObjectOfClass:[NSNumber class] + forKey:@"CPTXYAxis.orthogonalPosition"]; + axisConstraints = [coder decodeObjectOfClass:[CPTConstraints class] + forKey:@"CPTXYAxis.axisConstraints"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Coordinate Transforms /// @cond --(void)orthogonalCoordinateViewLowerBound:(CGFloat *)lower upperBound:(CGFloat *)upper +-(void)orthogonalCoordinateViewLowerBound:(nonnull CGFloat *)lower upperBound:(nonnull CGFloat *)upper { CPTCoordinate orthogonalCoordinate = CPTOrthogonalCoordinate(self.coordinate); CPTXYPlotSpace *xyPlotSpace = (CPTXYPlotSpace *)self.plotSpace; @@ -127,9 +143,8 @@ -(void)orthogonalCoordinateViewLowerBound:(CGFloat *)lower upperBound:(CGFloat * NSAssert(orthogonalRange != nil, @"The orthogonalRange was nil in orthogonalCoordinateViewLowerBound:upperBound:"); - NSDecimal zero = CPTDecimalFromInteger(0); - CGPoint lowerBoundPoint = [self viewPointForOrthogonalCoordinateDecimal:orthogonalRange.location axisCoordinateDecimal:zero]; - CGPoint upperBoundPoint = [self viewPointForOrthogonalCoordinateDecimal:orthogonalRange.end axisCoordinateDecimal:zero]; + CGPoint lowerBoundPoint = [self viewPointForOrthogonalCoordinate:orthogonalRange.location axisCoordinate:@0]; + CGPoint upperBoundPoint = [self viewPointForOrthogonalCoordinate:orthogonalRange.end axisCoordinate:@0]; switch ( self.coordinate ) { case CPTCoordinateX: @@ -143,31 +158,31 @@ -(void)orthogonalCoordinateViewLowerBound:(CGFloat *)lower upperBound:(CGFloat * break; default: - *lower = NAN; - *upper = NAN; + *lower = CPTNAN; + *upper = CPTNAN; break; } } --(CGPoint)viewPointForOrthogonalCoordinateDecimal:(NSDecimal)orthogonalCoord axisCoordinateDecimal:(NSDecimal)coordinateDecimalNumber +-(CGPoint)viewPointForOrthogonalCoordinate:(nullable NSNumber *)orthogonalCoord axisCoordinate:(nullable NSNumber *)coordinateValue { CPTCoordinate myCoordinate = self.coordinate; CPTCoordinate orthogonalCoordinate = CPTOrthogonalCoordinate(myCoordinate); NSDecimal plotPoint[2]; - plotPoint[myCoordinate] = coordinateDecimalNumber; - plotPoint[orthogonalCoordinate] = orthogonalCoord; + plotPoint[myCoordinate] = coordinateValue.decimalValue; + plotPoint[orthogonalCoordinate] = orthogonalCoord.decimalValue; CPTPlotArea *thePlotArea = self.plotArea; return [self convertPoint:[self.plotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2] fromLayer:thePlotArea]; } --(CGPoint)viewPointForCoordinateDecimalNumber:(NSDecimal)coordinateDecimalNumber +-(CGPoint)viewPointForCoordinateValue:(nullable NSNumber *)coordinateValue { - CGPoint point = [self viewPointForOrthogonalCoordinateDecimal:self.orthogonalCoordinateDecimal - axisCoordinateDecimal:coordinateDecimalNumber]; + CGPoint point = [self viewPointForOrthogonalCoordinate:self.orthogonalPosition + axisCoordinate:coordinateValue]; CPTConstraints *theAxisConstraints = self.axisConstraints; @@ -190,13 +205,13 @@ -(CGPoint)viewPointForCoordinateDecimalNumber:(NSDecimal)coordinateDecimalNumber } } - if ( isnan(point.x) || isnan(point.y) ) { - NSLog( @"[CPTXYAxis viewPointForCoordinateDecimalNumber:%@] was %@", NSDecimalString(&coordinateDecimalNumber, nil), CPTStringFromPoint(point) ); + if ( isnan(point.x) || isnan(point.y)) { + NSLog(@"[CPTXYAxis viewPointForCoordinateValue:%@] was %@", coordinateValue, CPTStringFromPoint(point)); - if ( isnan(point.x) ) { + if ( isnan(point.x)) { point.x = CPTFloat(0.0); } - if ( isnan(point.y) ) { + if ( isnan(point.y)) { point.y = CPTFloat(0.0); } } @@ -211,7 +226,7 @@ -(CGPoint)viewPointForCoordinateDecimalNumber:(NSDecimal)coordinateDecimalNumber /// @cond --(void)drawTicksInContext:(CGContextRef)context atLocations:(NSSet *)locations withLength:(CGFloat)length inRange:(CPTPlotRange *)labeledRange isMajor:(BOOL)major +-(void)drawTicksInContext:(nonnull CGContextRef)context atLocations:(nullable CPTNumberSet *)locations withLength:(CGFloat)length inRange:(nullable CPTPlotRange *)labeledRange isMajor:(BOOL)major { CPTLineStyle *lineStyle = (major ? self.majorTickLineStyle : self.minorTickLineStyle); @@ -222,7 +237,7 @@ -(void)drawTicksInContext:(CGContextRef)context atLocations:(NSSet *)locations w CGFloat lineWidth = lineStyle.lineWidth; CPTAlignPointFunction alignmentFunction = NULL; - if ( ( self.contentsScale > CPTFloat(1.0) ) && (round(lineWidth) == lineWidth) ) { + if ((self.contentsScale > CPTFloat(1.0)) && (round(lineWidth) == lineWidth)) { alignmentFunction = CPTAlignIntegralPointToUserSpace; } else { @@ -233,14 +248,12 @@ -(void)drawTicksInContext:(CGContextRef)context atLocations:(NSSet *)locations w CGContextBeginPath(context); for ( NSDecimalNumber *tickLocation in locations ) { - NSDecimal locationDecimal = tickLocation.decimalValue; - - if ( labeledRange && ![labeledRange contains:locationDecimal] ) { + if ( labeledRange && ![labeledRange containsNumber:tickLocation] ) { continue; } // Tick end points - CGPoint baseViewPoint = [self viewPointForCoordinateDecimalNumber:locationDecimal]; + CGPoint baseViewPoint = [self viewPointForCoordinateValue:tickLocation]; CGPoint startViewPoint = baseViewPoint; CGPoint endViewPoint = baseViewPoint; @@ -287,7 +300,7 @@ -(void)drawTicksInContext:(CGContextRef)context atLocations:(NSSet *)locations w [lineStyle strokePathInContext:context]; } --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden ) { return; @@ -335,12 +348,12 @@ -(void)renderAsVectorInContext:(CGContextRef)context CPTAlignPointFunction alignmentFunction = CPTAlignPointToUserSpace; if ( theLineStyle ) { CGFloat lineWidth = theLineStyle.lineWidth; - if ( ( self.contentsScale > CPTFloat(1.0) ) && (round(lineWidth) == lineWidth) ) { + if ((self.contentsScale > CPTFloat(1.0)) && (round(lineWidth) == lineWidth)) { alignmentFunction = CPTAlignIntegralPointToUserSpace; } - CGPoint startViewPoint = alignmentFunction(context, [self viewPointForCoordinateDecimalNumber:range.location]); - CGPoint endViewPoint = alignmentFunction(context, [self viewPointForCoordinateDecimalNumber:range.end]); + CGPoint startViewPoint = alignmentFunction(context, [self viewPointForCoordinateValue:range.location]); + CGPoint endViewPoint = alignmentFunction(context, [self viewPointForCoordinateValue:range.end]); [theLineStyle setLineStyleInContext:context]; CGContextBeginPath(context); CGContextMoveToPoint(context, startViewPoint.x, startViewPoint.y); @@ -352,11 +365,11 @@ -(void)renderAsVectorInContext:(CGContextRef)context if ( minCap || maxCap ) { switch ( self.coordinate ) { case CPTCoordinateX: - axisDirection = ( range.lengthDouble >= CPTFloat(0.0) ) ? CPTPointMake(1.0, 0.0) : CPTPointMake(-1.0, 0.0); + axisDirection = (range.lengthDouble >= 0.0) ? CPTPointMake(1.0, 0.0) : CPTPointMake(-1.0, 0.0); break; case CPTCoordinateY: - axisDirection = ( range.lengthDouble >= CPTFloat(0.0) ) ? CPTPointMake(0.0, 1.0) : CPTPointMake(0.0, -1.0); + axisDirection = (range.lengthDouble >= 0.0) ? CPTPointMake(0.0, 1.0) : CPTPointMake(0.0, -1.0); break; default: @@ -365,14 +378,12 @@ -(void)renderAsVectorInContext:(CGContextRef)context } if ( minCap ) { - NSDecimal endPoint = range.minLimit; - CGPoint viewPoint = alignmentFunction(context, [self viewPointForCoordinateDecimalNumber:endPoint]); + CGPoint viewPoint = alignmentFunction(context, [self viewPointForCoordinateValue:range.minLimit]); [minCap renderAsVectorInContext:context atPoint:viewPoint inDirection:CPTPointMake(-axisDirection.x, -axisDirection.y)]; } if ( maxCap ) { - NSDecimal endPoint = range.maxLimit; - CGPoint viewPoint = alignmentFunction(context, [self viewPointForCoordinateDecimalNumber:endPoint]); + CGPoint viewPoint = alignmentFunction(context, [self viewPointForCoordinateValue:range.maxLimit]); [maxCap renderAsVectorInContext:context atPoint:viewPoint inDirection:axisDirection]; } } @@ -385,7 +396,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context /// @cond --(void)drawGridLinesInContext:(CGContextRef)context isMajor:(BOOL)major +-(void)drawGridLinesInContext:(nonnull CGContextRef)context isMajor:(BOOL)major { CPTLineStyle *lineStyle = (major ? self.majorGridLineStyle : self.minorGridLineStyle); @@ -395,7 +406,7 @@ -(void)drawGridLinesInContext:(CGContextRef)context isMajor:(BOOL)major [self relabel]; CPTPlotSpace *thePlotSpace = self.plotSpace; - NSSet *locations = (major ? self.majorTickLocations : self.minorTickLocations); + CPTNumberSet *locations = (major ? self.majorTickLocations : self.minorTickLocations); CPTCoordinate selfCoordinate = self.coordinate; CPTCoordinate orthogonalCoordinate = CPTOrthogonalCoordinate(selfCoordinate); CPTMutablePlotRange *orthogonalRange = [[thePlotSpace plotRangeForCoordinate:orthogonalCoordinate] mutableCopy]; @@ -425,14 +436,14 @@ -(void)drawGridLinesInContext:(CGContextRef)context isMajor:(BOOL)major CPTPlotArea *thePlotArea = self.plotArea; NSDecimal startPlotPoint[2]; NSDecimal endPlotPoint[2]; - startPlotPoint[orthogonalCoordinate] = orthogonalRange.location; - endPlotPoint[orthogonalCoordinate] = orthogonalRange.end; + startPlotPoint[orthogonalCoordinate] = orthogonalRange.locationDecimal; + endPlotPoint[orthogonalCoordinate] = orthogonalRange.endDecimal; CGPoint originTransformed = [self convertPoint:self.bounds.origin fromLayer:thePlotArea]; CGFloat lineWidth = lineStyle.lineWidth; CPTAlignPointFunction alignmentFunction = NULL; - if ( ( self.contentsScale > CPTFloat(1.0) ) && (round(lineWidth) == lineWidth) ) { + if ((self.contentsScale > CPTFloat(1.0)) && (round(lineWidth) == lineWidth)) { alignmentFunction = CPTAlignIntegralPointToUserSpace; } else { @@ -483,13 +494,110 @@ -(void)drawGridLinesInContext:(CGContextRef)context isMajor:(BOOL)major /// @cond --(void)drawBackgroundBandsInContext:(CGContextRef)context +-(NSUInteger)initialBandIndexForSortedLocations:(CPTNumberArray *)sortedLocations inRange:(CPTMutablePlotRange *)range { - NSArray *bandArray = self.alternatingBandFills; - NSUInteger bandCount = bandArray.count; + NSUInteger bandIndex = 0; + + NSNumber *bandAnchor = self.alternatingBandAnchor; + NSUInteger bandCount = self.alternatingBandFills.count; + + if ( bandAnchor && (bandCount > 0)) { + NSDecimal anchor = bandAnchor.decimalValue; + + CPTPlotRange *theVisibleRange = self.visibleRange; + if ( theVisibleRange ) { + [range intersectionPlotRange:theVisibleRange]; + } + + NSDecimal rangeStart; + if ( range.lengthDouble >= 0.0 ) { + rangeStart = range.minLimitDecimal; + } + else { + rangeStart = range.maxLimitDecimal; + } + + NSDecimal origin = self.labelingOrigin.decimalValue; + NSDecimal offset = CPTDecimalSubtract(anchor, origin); + NSDecimalRound(&offset, &offset, 0, NSRoundDown); + + const NSDecimal zero = CPTDecimalFromInteger(0); + + // Set starting coord--should be the smallest value >= rangeMin that is a whole multiple of majorInterval away from the alternatingBandAnchor + NSDecimal coord = zero; + NSDecimal majorInterval = zero; + + switch ( self.labelingPolicy ) { + case CPTAxisLabelingPolicyAutomatic: + case CPTAxisLabelingPolicyEqualDivisions: + if ( sortedLocations.count > 1 ) { + if ( range.lengthDouble >= 0.0 ) { + majorInterval = CPTDecimalSubtract(sortedLocations[1].decimalValue, sortedLocations[0].decimalValue); + } + else { + majorInterval = CPTDecimalSubtract(sortedLocations[0].decimalValue, sortedLocations[1].decimalValue); + } + } + break; + + case CPTAxisLabelingPolicyFixedInterval: + { + majorInterval = self.majorIntervalLength.decimalValue; + } + break; + + case CPTAxisLabelingPolicyLocationsProvided: + case CPTAxisLabelingPolicyNone: + { + // user provided tick locations; they're not guaranteed to be evenly spaced, but band drawing always starts with the first location + if ( range.lengthDouble >= 0.0 ) { + for ( NSNumber *location in sortedLocations ) { + if ( CPTDecimalLessThan(anchor, location.decimalValue)) { + break; + } + + bandIndex++; + } + } + else { + for ( NSNumber *location in sortedLocations ) { + if ( CPTDecimalGreaterThanOrEqualTo(anchor, location.decimalValue)) { + break; + } + + bandIndex++; + } + } + + bandIndex = bandIndex % bandCount; + } + break; + } + + if ( !CPTDecimalEquals(majorInterval, zero)) { + coord = CPTDecimalDivide(CPTDecimalSubtract(rangeStart, origin), majorInterval); + NSDecimalRound(&coord, &coord, 0, NSRoundUp); + NSInteger stepCount = CPTDecimalIntegerValue(coord) + CPTDecimalIntegerValue(offset) + 1; + + if ( stepCount >= 0 ) { + bandIndex = (NSUInteger)(stepCount % (NSInteger)bandCount); + } + else { + bandIndex = (NSUInteger)(-stepCount % (NSInteger)bandCount); + } + } + } + + return bandIndex; +} + +-(void)drawBackgroundBandsInContext:(nonnull CGContextRef)context +{ + CPTFillArray *bandArray = self.alternatingBandFills; + NSUInteger bandCount = bandArray.count; if ( bandCount > 0 ) { - NSArray *locations = [self.majorTickLocations allObjects]; + CPTNumberArray *locations = self.majorTickLocations.allObjects; if ( locations.count > 0 ) { CPTPlotSpace *thePlotSpace = self.plotSpace; @@ -511,10 +619,10 @@ -(void)drawBackgroundBandsInContext:(CGContextRef)context [orthogonalRange intersectionPlotRange:theGridLineRange]; } - NSDecimal zero = CPTDecimalFromInteger(0); + const NSDecimal zero = CPTDecimalFromInteger(0); NSSortDescriptor *sortDescriptor = nil; if ( range ) { - if ( CPTDecimalGreaterThanOrEqualTo(range.length, zero) ) { + if ( CPTDecimalGreaterThanOrEqualTo(range.lengthDecimal, zero)) { sortDescriptor = [[NSSortDescriptor alloc] initWithKey:nil ascending:YES]; } else { @@ -526,11 +634,13 @@ -(void)drawBackgroundBandsInContext:(CGContextRef)context } locations = [locations sortedArrayUsingDescriptors:@[sortDescriptor]]; - NSUInteger bandIndex = 0; - id null = [NSNull null]; + NSUInteger bandIndex = [self initialBandIndexForSortedLocations:locations inRange:range]; + + const id null = [NSNull null]; + NSDecimal lastLocation; if ( range ) { - lastLocation = range.location; + lastLocation = range.locationDecimal; } else { lastLocation = CPTDecimalNaN(); @@ -539,8 +649,8 @@ -(void)drawBackgroundBandsInContext:(CGContextRef)context NSDecimal startPlotPoint[2]; NSDecimal endPlotPoint[2]; if ( orthogonalRange ) { - startPlotPoint[orthogonalCoordinate] = orthogonalRange.location; - endPlotPoint[orthogonalCoordinate] = orthogonalRange.end; + startPlotPoint[orthogonalCoordinate] = orthogonalRange.locationDecimal; + endPlotPoint[orthogonalCoordinate] = orthogonalRange.endDecimal; } else { startPlotPoint[orthogonalCoordinate] = CPTDecimalNaN(); @@ -548,8 +658,8 @@ -(void)drawBackgroundBandsInContext:(CGContextRef)context } for ( NSDecimalNumber *location in locations ) { - NSDecimal currentLocation = [location decimalValue]; - if ( !CPTDecimalEquals(CPTDecimalSubtract(currentLocation, lastLocation), zero) ) { + NSDecimal currentLocation = location.decimalValue; + if ( !CPTDecimalEquals(CPTDecimalSubtract(currentLocation, lastLocation), zero)) { CPTFill *bandFill = bandArray[bandIndex++]; bandIndex %= bandCount; @@ -563,10 +673,10 @@ -(void)drawBackgroundBandsInContext:(CGContextRef)context CGPoint endViewPoint = [thePlotSpace plotAreaViewPointForPlotPoint:endPlotPoint numberOfCoordinates:2]; // Fill band - CGRect fillRect = CPTRectMake( MIN(startViewPoint.x, endViewPoint.x), - MIN(startViewPoint.y, endViewPoint.y), - ABS(endViewPoint.x - startViewPoint.x), - ABS(endViewPoint.y - startViewPoint.y) ); + CGRect fillRect = CPTRectMake(MIN(startViewPoint.x, endViewPoint.x), + MIN(startViewPoint.y, endViewPoint.y), + ABS(endViewPoint.x - startViewPoint.x), + ABS(endViewPoint.y - startViewPoint.y)); [bandFill fillRect:CPTAlignIntegralRectToUserSpace(context, fillRect) inContext:context]; } } @@ -577,12 +687,12 @@ -(void)drawBackgroundBandsInContext:(CGContextRef)context // Fill space between last location and the range end NSDecimal endLocation; if ( range ) { - endLocation = range.end; + endLocation = range.endDecimal; } else { endLocation = CPTDecimalNaN(); } - if ( !CPTDecimalEquals(lastLocation, endLocation) ) { + if ( !CPTDecimalEquals(lastLocation, endLocation)) { CPTFill *bandFill = bandArray[bandIndex]; if ( bandFill != null ) { @@ -595,10 +705,10 @@ -(void)drawBackgroundBandsInContext:(CGContextRef)context CGPoint endViewPoint = [thePlotSpace plotAreaViewPointForPlotPoint:endPlotPoint numberOfCoordinates:2]; // Fill band - CGRect fillRect = CPTRectMake( MIN(startViewPoint.x, endViewPoint.x), - MIN(startViewPoint.y, endViewPoint.y), - ABS(endViewPoint.x - startViewPoint.x), - ABS(endViewPoint.y - startViewPoint.y) ); + CGRect fillRect = CPTRectMake(MIN(startViewPoint.x, endViewPoint.x), + MIN(startViewPoint.y, endViewPoint.y), + ABS(endViewPoint.x - startViewPoint.x), + ABS(endViewPoint.y - startViewPoint.y)); [bandFill fillRect:CPTAlignIntegralRectToUserSpace(context, fillRect) inContext:context]; } } @@ -606,9 +716,9 @@ -(void)drawBackgroundBandsInContext:(CGContextRef)context } } --(void)drawBackgroundLimitsInContext:(CGContextRef)context +-(void)drawBackgroundLimitsInContext:(nonnull CGContextRef)context { - NSArray *limitArray = self.backgroundLimitBands; + CPTLimitBandArray *limitArray = self.backgroundLimitBands; if ( limitArray.count > 0 ) { CPTPlotSpace *thePlotSpace = self.plotSpace; @@ -633,8 +743,8 @@ -(void)drawBackgroundLimitsInContext:(CGContextRef)context NSDecimal startPlotPoint[2]; NSDecimal endPlotPoint[2]; - startPlotPoint[orthogonalCoordinate] = orthogonalRange.location; - endPlotPoint[orthogonalCoordinate] = orthogonalRange.end; + startPlotPoint[orthogonalCoordinate] = orthogonalRange.locationDecimal; + endPlotPoint[orthogonalCoordinate] = orthogonalRange.endDecimal; for ( CPTLimitBand *band in self.backgroundLimitBands ) { CPTFill *bandFill = band.fill; @@ -645,18 +755,18 @@ -(void)drawBackgroundLimitsInContext:(CGContextRef)context [bandRange intersectionPlotRange:range]; // Start point - startPlotPoint[selfCoordinate] = bandRange.location; + startPlotPoint[selfCoordinate] = bandRange.locationDecimal; CGPoint startViewPoint = [thePlotSpace plotAreaViewPointForPlotPoint:startPlotPoint numberOfCoordinates:2]; // End point - endPlotPoint[selfCoordinate] = bandRange.end; + endPlotPoint[selfCoordinate] = bandRange.endDecimal; CGPoint endViewPoint = [thePlotSpace plotAreaViewPointForPlotPoint:endPlotPoint numberOfCoordinates:2]; // Fill band - CGRect fillRect = CPTRectMake( MIN(startViewPoint.x, endViewPoint.x), - MIN(startViewPoint.y, endViewPoint.y), - ABS(endViewPoint.x - startViewPoint.x), - ABS(endViewPoint.y - startViewPoint.y) ); + CGRect fillRect = CPTRectMake(MIN(startViewPoint.x, endViewPoint.x), + MIN(startViewPoint.y, endViewPoint.y), + ABS(endViewPoint.x - startViewPoint.x), + ABS(endViewPoint.y - startViewPoint.y)); [bandFill fillRect:CPTAlignIntegralRectToUserSpace(context, fillRect) inContext:context]; } } @@ -671,14 +781,14 @@ -(void)drawBackgroundLimitsInContext:(CGContextRef)context /// @cond --(NSString *)description +-(nullable NSString *)description { CPTPlotRange *range = [self.plotSpace plotRangeForCoordinate:self.coordinate]; - CGPoint startViewPoint = [self viewPointForCoordinateDecimalNumber:range.location]; - CGPoint endViewPoint = [self viewPointForCoordinateDecimalNumber:range.end]; + CGPoint startViewPoint = [self viewPointForCoordinateValue:range.location]; + CGPoint endViewPoint = [self viewPointForCoordinateValue:range.end]; return [NSString stringWithFormat:@"<%@ with range: %@ viewCoordinates: %@ to %@>", - [super description], + super.description, range, CPTStringFromPoint(startViewPoint), CPTStringFromPoint(endViewPoint)]; @@ -692,9 +802,9 @@ -(NSString *)description /// @cond // Center title in the plot range by default --(NSDecimal)defaultTitleLocation +-(nonnull NSNumber *)defaultTitleLocation { - NSDecimal location; + NSNumber *location; CPTPlotSpace *thePlotSpace = self.plotSpace; CPTCoordinate theCoordinate = self.coordinate; @@ -714,8 +824,8 @@ -(NSDecimal)defaultTitleLocation double loc = axisRange.locationDouble; double end = axisRange.endDouble; - if ( (loc > 0.0) && (end >= 0.0) ) { - location = CPTDecimalFromDouble( pow(10.0, ( log10(loc) + log10(end) ) / 2.0) ); + if ((loc > 0.0) && (end >= 0.0)) { + location = @(pow(10.0, (log10(loc) + log10(end)) / 2.0)); } else { location = axisRange.midPoint; @@ -723,13 +833,22 @@ -(NSDecimal)defaultTitleLocation } break; + case CPTScaleTypeLogModulus: + { + double loc = axisRange.locationDouble; + double end = axisRange.endDouble; + + location = @(CPTInverseLogModulus((CPTLogModulus(loc) + CPTLogModulus(end)) / 2.0)); + } + break; + default: location = axisRange.midPoint; break; } } else { - location = CPTDecimalFromInteger(0); + location = @0; } return location; @@ -742,7 +861,7 @@ -(NSDecimal)defaultTitleLocation /// @cond --(void)setAxisConstraints:(CPTConstraints *)newConstraints +-(void)setAxisConstraints:(nullable CPTConstraints *)newConstraints { if ( ![axisConstraints isEqualToConstraint:newConstraints] ) { axisConstraints = newConstraints; @@ -751,10 +870,17 @@ -(void)setAxisConstraints:(CPTConstraints *)newConstraints } } --(void)setOrthogonalCoordinateDecimal:(NSDecimal)newCoord +-(void)setOrthogonalPosition:(nullable NSNumber *)newPosition { - if ( NSDecimalCompare(&orthogonalCoordinateDecimal, &newCoord) != NSOrderedSame ) { - orthogonalCoordinateDecimal = newCoord; + BOOL needsUpdate = YES; + + if ( newPosition ) { + NSNumber *position = newPosition; + needsUpdate = ![orthogonalPosition isEqualToNumber:position]; + } + + if ( needsUpdate ) { + orthogonalPosition = newPosition; [self setNeedsDisplay]; [self setNeedsLayout]; } @@ -763,7 +889,7 @@ -(void)setOrthogonalCoordinateDecimal:(NSDecimal)newCoord -(void)setCoordinate:(CPTCoordinate)newCoordinate { if ( self.coordinate != newCoordinate ) { - [super setCoordinate:newCoordinate]; + super.coordinate = newCoordinate; switch ( newCoordinate ) { case CPTCoordinateX: switch ( self.labelAlignment ) { diff --git a/framework/Source/CPTXYAxisSet.h b/framework/Source/CPTXYAxisSet.h index cc760ba8d..ef7bc8d69 100644 --- a/framework/Source/CPTXYAxisSet.h +++ b/framework/Source/CPTXYAxisSet.h @@ -4,7 +4,7 @@ @interface CPTXYAxisSet : CPTAxisSet -@property (nonatomic, readonly) CPTXYAxis *xAxis; -@property (nonatomic, readonly) CPTXYAxis *yAxis; +@property (nonatomic, readonly, nullable) CPTXYAxis *xAxis; +@property (nonatomic, readonly, nullable) CPTXYAxis *yAxis; @end diff --git a/framework/Source/CPTXYAxisSet.m b/framework/Source/CPTXYAxisSet.m index 3060c3666..70c48c5bf 100644 --- a/framework/Source/CPTXYAxisSet.m +++ b/framework/Source/CPTXYAxisSet.m @@ -10,12 +10,12 @@ **/ @implementation CPTXYAxisSet -/** @property CPTXYAxis *xAxis +/** @property nullable CPTXYAxis *xAxis * @brief The x-axis. **/ @dynamic xAxis; -/** @property CPTXYAxis *yAxis +/** @property nullable CPTXYAxis *yAxis * @brief The y-axis. **/ @dynamic yAxis; @@ -40,9 +40,9 @@ @implementation CPTXYAxisSet * @param newFrame The frame rectangle. * @return The initialized CPTXYAxisSet object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { CPTXYAxis *xAxis = [[CPTXYAxis alloc] initWithFrame:newFrame]; xAxis.coordinate = CPTCoordinateX; xAxis.tickDirection = CPTSignNegative; @@ -63,7 +63,7 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden ) { return; @@ -80,7 +80,7 @@ -(void)renderAsVectorInContext:(CGContextRef)context CGFloat radius = superlayer.cornerRadius; - if ( radius > CPTFloat(0.0) ) { + if ( radius > CPTFloat(0.0)) { CGContextBeginPath(context); CPTAddRoundedRectPath(context, borderRect, radius); @@ -97,6 +97,9 @@ -(void)renderAsVectorInContext:(CGContextRef)context #pragma mark - #pragma mark Layout +/// @name Layout +/// @{ + /** * @brief Updates the layout of all sublayers. Sublayers (the axes) fill the plot area frame’s bounds. * @@ -118,8 +121,8 @@ -(void)layoutSublayers sublayerPosition = CGPointMake(-sublayerPosition.x, -sublayerPosition.y); CGRect subLayerFrame = CGRectMake(sublayerPosition.x, sublayerPosition.y, sublayerBounds.size.width, sublayerBounds.size.height); - NSSet *excludedSublayers = [self sublayersExcludedFromAutomaticLayout]; - Class layerClass = [CPTLayer class]; + CPTSublayerSet *excludedSublayers = self.sublayersExcludedFromAutomaticLayout; + Class layerClass = [CPTLayer class]; for ( CALayer *subLayer in self.sublayers ) { if ( [subLayer isKindOfClass:layerClass] && ![excludedSublayers containsObject:subLayer] ) { subLayer.frame = subLayerFrame; @@ -128,17 +131,19 @@ -(void)layoutSublayers } } +/// @} + #pragma mark - #pragma mark Accessors /// @cond --(CPTXYAxis *)xAxis +-(nullable CPTXYAxis *)xAxis { return (CPTXYAxis *)[self axisForCoordinate:CPTCoordinateX atIndex:0]; } --(CPTXYAxis *)yAxis +-(nullable CPTXYAxis *)yAxis { return (CPTXYAxis *)[self axisForCoordinate:CPTCoordinateY atIndex:0]; } diff --git a/framework/Source/CPTXYGraph.h b/framework/Source/CPTXYGraph.h index 22d883a32..a761dbd88 100644 --- a/framework/Source/CPTXYGraph.h +++ b/framework/Source/CPTXYGraph.h @@ -5,7 +5,10 @@ /// @name Initialization /// @{ --(instancetype)initWithFrame:(CGRect)newFrame xScaleType:(CPTScaleType)newXScaleType yScaleType:(CPTScaleType)newYScaleType; +-(nonnull instancetype)initWithFrame:(CGRect)newFrame xScaleType:(CPTScaleType)newXScaleType yScaleType:(CPTScaleType)newYScaleType NS_DESIGNATED_INITIALIZER; + +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithLayer:(nonnull id)layer NS_DESIGNATED_INITIALIZER; /// @} @end diff --git a/framework/Source/CPTXYGraph.m b/framework/Source/CPTXYGraph.m index 242619ad2..480c28bb6 100644 --- a/framework/Source/CPTXYGraph.m +++ b/framework/Source/CPTXYGraph.m @@ -21,12 +21,14 @@ @interface CPTXYGraph() **/ @implementation CPTXYGraph -/** @property CPTScaleType xScaleType +/** @internal + * @property CPTScaleType xScaleType * @brief The scale type for the x-axis. **/ @synthesize xScaleType; -/** @property CPTScaleType yScaleType +/** @internal + * @property CPTScaleType yScaleType * @brief The scale type for the y-axis. **/ @synthesize yScaleType; @@ -43,9 +45,9 @@ @implementation CPTXYGraph * @param newYScaleType The scale type for the y-axis. * @return The initialized CPTXYGraph object. **/ --(instancetype)initWithFrame:(CGRect)newFrame xScaleType:(CPTScaleType)newXScaleType yScaleType:(CPTScaleType)newYScaleType +-(nonnull instancetype)initWithFrame:(CGRect)newFrame xScaleType:(CPTScaleType)newXScaleType yScaleType:(CPTScaleType)newYScaleType { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { xScaleType = newXScaleType; yScaleType = newYScaleType; } @@ -65,7 +67,7 @@ -(instancetype)initWithFrame:(CGRect)newFrame xScaleType:(CPTScaleType)newXScale * @return The initialized CPTXYGraph object. * @see @link CPTXYGraph::initWithFrame:xScaleType:yScaleType: -initWithFrame:xScaleType:yScaleType: @endlink **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { return [self initWithFrame:newFrame xScaleType:CPTScaleTypeLinear yScaleType:CPTScaleTypeLinear]; } @@ -74,9 +76,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTXYGraph *theLayer = (CPTXYGraph *)layer; xScaleType = theLayer->xScaleType; @@ -92,7 +94,7 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -100,23 +102,35 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeInteger:self.yScaleType forKey:@"CPTXYGraph.yScaleType"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - xScaleType = (CPTScaleType)[coder decodeIntegerForKey : @"CPTXYGraph.xScaleType"]; - yScaleType = (CPTScaleType)[coder decodeIntegerForKey : @"CPTXYGraph.yScaleType"]; + if ((self = [super initWithCoder:coder])) { + xScaleType = (CPTScaleType)[coder decodeIntegerForKey:@"CPTXYGraph.xScaleType"]; + yScaleType = (CPTScaleType)[coder decodeIntegerForKey:@"CPTXYGraph.yScaleType"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Factory Methods /// @cond --(CPTPlotSpace *)newPlotSpace +-(nullable CPTPlotSpace *)newPlotSpace { CPTXYPlotSpace *space = [[CPTXYPlotSpace alloc] init]; @@ -125,7 +139,7 @@ -(CPTPlotSpace *)newPlotSpace return space; } --(CPTAxisSet *)newAxisSet +-(nullable CPTAxisSet *)newAxisSet { CPTXYAxisSet *newAxisSet = [[CPTXYAxisSet alloc] initWithFrame:self.bounds]; diff --git a/framework/Source/CPTXYPlotSpace.h b/framework/Source/CPTXYPlotSpace.h index 6649e1738..ed084f42a 100644 --- a/framework/Source/CPTXYPlotSpace.h +++ b/framework/Source/CPTXYPlotSpace.h @@ -6,10 +6,10 @@ @interface CPTXYPlotSpace : CPTPlotSpace -@property (nonatomic, readwrite, copy) CPTPlotRange *xRange; -@property (nonatomic, readwrite, copy) CPTPlotRange *yRange; -@property (nonatomic, readwrite, copy) CPTPlotRange *globalXRange; -@property (nonatomic, readwrite, copy) CPTPlotRange *globalYRange; +@property (nonatomic, readwrite, copy, nonnull) CPTPlotRange *xRange; +@property (nonatomic, readwrite, copy, nonnull) CPTPlotRange *yRange; +@property (nonatomic, readwrite, copy, nullable) CPTPlotRange *globalXRange; +@property (nonatomic, readwrite, copy, nullable) CPTPlotRange *globalYRange; @property (nonatomic, readwrite, assign) CPTScaleType xScaleType; @property (nonatomic, readwrite, assign) CPTScaleType yScaleType; diff --git a/framework/Source/CPTXYPlotSpace.m b/framework/Source/CPTXYPlotSpace.m index 04b04eb74..3b2750488 100644 --- a/framework/Source/CPTXYPlotSpace.m +++ b/framework/Source/CPTXYPlotSpace.m @@ -4,6 +4,7 @@ #import "CPTAnimationOperation.h" #import "CPTAnimationPeriod.h" #import "CPTAxisSet.h" +#import "CPTDebugQuickLook.h" #import "CPTExceptions.h" #import "CPTGraph.h" #import "CPTGraphHostingView.h" @@ -16,23 +17,29 @@ #import /// @cond +typedef NSMutableArray CPTMutableAnimationArray; + @interface CPTXYPlotSpace() --(CGFloat)viewCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(CPTPlotRange *)range plotCoordinateValue:(NSDecimal)plotCoord; --(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength linearPlotRange:(CPTPlotRange *)range doublePrecisionPlotCoordinateValue:(double)plotCoord; +-(CGFloat)viewCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(nonnull CPTPlotRange *)range plotCoordinateValue:(NSDecimal)plotCoord; +-(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength linearPlotRange:(nonnull CPTPlotRange *)range doublePrecisionPlotCoordinateValue:(double)plotCoord; + +-(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength logPlotRange:(nonnull CPTPlotRange *)range doublePrecisionPlotCoordinateValue:(double)plotCoord; --(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength logPlotRange:(CPTPlotRange *)range doublePrecisionPlotCoordinateValue:(double)plotCoord; +-(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength logModulusPlotRange:(nonnull CPTPlotRange *)range doublePrecisionPlotCoordinateValue:(double)plotCoord; --(NSDecimal)plotCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(CPTPlotRange *)range boundsLength:(NSDecimal)boundsLength; --(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength linearPlotRange:(CPTPlotRange *)range boundsLength:(CGFloat)boundsLength; +-(NSDecimal)plotCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(nonnull CPTPlotRange *)range boundsLength:(NSDecimal)boundsLength; +-(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength linearPlotRange:(nonnull CPTPlotRange *)range boundsLength:(CGFloat)boundsLength; --(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength logPlotRange:(CPTPlotRange *)range boundsLength:(CGFloat)boundsLength; +-(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength logPlotRange:(nonnull CPTPlotRange *)range boundsLength:(CGFloat)boundsLength; --(CPTPlotRange *)constrainRange:(CPTPlotRange *)existingRange toGlobalRange:(CPTPlotRange *)globalRange; +-(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength logModulusPlotRange:(nonnull CPTPlotRange *)range boundsLength:(CGFloat)boundsLength; + +-(nonnull CPTPlotRange *)constrainRange:(nonnull CPTPlotRange *)existingRange toGlobalRange:(nullable CPTPlotRange *)globalRange; -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shift momentumTime:(CGFloat)momentumTime speed:(CGFloat)speed acceleration:(CGFloat)acceleration; --(CPTPlotRange *)shiftRange:(CPTPlotRange *)oldRange by:(NSDecimal)shift usingMomentum:(BOOL)momentum inGlobalRange:(CPTPlotRange *)globalRange withDisplacement:(CGFloat *)displacement; +-(nullable CPTPlotRange *)shiftRange:(nonnull CPTPlotRange *)oldRange by:(NSDecimal)shift usingMomentum:(BOOL)momentum inGlobalRange:(nullable CPTPlotRange *)globalRange withDisplacement:(CGFloat *)displacement; --(CGFloat)viewCoordinateForRange:(CPTPlotRange *)range coordinate:(CPTCoordinate)coordinate direction:(BOOL)direction; +-(CGFloat)viewCoordinateForRange:(nullable CPTPlotRange *)range coordinate:(CPTCoordinate)coordinate direction:(BOOL)direction; CGFloat CPTFirstPositiveRoot(CGFloat a, CGFloat b, CGFloat c); @@ -41,7 +48,7 @@ -(CGFloat)viewCoordinateForRange:(CPTPlotRange *)range coordinate:(CPTCoordinate @property (nonatomic, readwrite) CGPoint lastDisplacement; @property (nonatomic, readwrite) NSTimeInterval lastDragTime; @property (nonatomic, readwrite) NSTimeInterval lastDeltaTime; -@property (nonatomic, readwrite, retain) NSMutableArray *animations; +@property (nonatomic, readwrite, retain, nonnull) CPTMutableAnimationArray *animations; @end @@ -66,7 +73,7 @@ -(CGFloat)viewCoordinateForRange:(CPTPlotRange *)range coordinate:(CPTCoordinate **/ @implementation CPTXYPlotSpace -/** @property CPTPlotRange *xRange +/** @property nonnull CPTPlotRange *xRange * @brief The range of the x coordinate. Defaults to a range with @link CPTPlotRange::location location @endlink zero (@num{0}) * and a @link CPTPlotRange::length length @endlink of one (@num{1}). * @@ -77,7 +84,7 @@ @implementation CPTXYPlotSpace **/ @synthesize xRange; -/** @property CPTPlotRange *yRange +/** @property nonnull CPTPlotRange *yRange * @brief The range of the y coordinate. Defaults to a range with @link CPTPlotRange::location location @endlink zero (@num{0}) * and a @link CPTPlotRange::length length @endlink of one (@num{1}). * @@ -88,7 +95,7 @@ @implementation CPTXYPlotSpace **/ @synthesize yRange; -/** @property CPTPlotRange *globalXRange +/** @property nullable CPTPlotRange *globalXRange * @brief The global range of the x coordinate to which the @ref xRange is constrained. * * If non-@nil, the @ref xRange and any changes to it will @@ -97,7 +104,7 @@ @implementation CPTXYPlotSpace **/ @synthesize globalXRange; -/** @property CPTPlotRange *globalYRange +/** @property nullable CPTPlotRange *globalYRange * @brief The global range of the y coordinate to which the @ref yRange is constrained. * * If non-@nil, the @ref yRange and any changes to it will @@ -189,11 +196,11 @@ @implementation CPTXYPlotSpace * * @return The initialized object. **/ --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { - xRange = [[CPTPlotRange alloc] initWithLocation:CPTDecimalFromInteger(0) length:CPTDecimalFromInteger(1)]; - yRange = [[CPTPlotRange alloc] initWithLocation:CPTDecimalFromInteger(0) length:CPTDecimalFromInteger(1)]; + if ((self = [super init])) { + xRange = [[CPTPlotRange alloc] initWithLocation:@0.0 length:@1.0]; + yRange = [[CPTPlotRange alloc] initWithLocation:@0.0 length:@1.0]; globalXRange = nil; globalYRange = nil; xScaleType = CPTScaleTypeLinear; @@ -222,7 +229,7 @@ -(instancetype)init /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -234,8 +241,8 @@ -(void)encodeWithCoder:(NSCoder *)coder [coder encodeInteger:self.yScaleType forKey:@"CPTXYPlotSpace.yScaleType"]; [coder encodeBool:self.allowsMomentumX forKey:@"CPTXYPlotSpace.allowsMomentumX"]; [coder encodeBool:self.allowsMomentumY forKey:@"CPTXYPlotSpace.allowsMomentumY"]; - [coder encodeInt:self.momentumAnimationCurve forKey:@"CPTXYPlotSpace.momentumAnimationCurve"]; - [coder encodeInt:self.bounceAnimationCurve forKey:@"CPTXYPlotSpace.bounceAnimationCurve"]; + [coder encodeInteger:self.momentumAnimationCurve forKey:@"CPTXYPlotSpace.momentumAnimationCurve"]; + [coder encodeInteger:self.bounceAnimationCurve forKey:@"CPTXYPlotSpace.bounceAnimationCurve"]; [coder encodeCGFloat:self.momentumAcceleration forKey:@"CPTXYPlotSpace.momentumAcceleration"]; [coder encodeCGFloat:self.bounceAcceleration forKey:@"CPTXYPlotSpace.bounceAcceleration"]; [coder encodeCGFloat:self.minimumDisplacementToDrag forKey:@"CPTXYPlotSpace.minimumDisplacementToDrag"]; @@ -248,15 +255,25 @@ -(void)encodeWithCoder:(NSCoder *)coder // animations } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - xRange = [[coder decodeObjectForKey:@"CPTXYPlotSpace.xRange"] copy]; - yRange = [[coder decodeObjectForKey:@"CPTXYPlotSpace.yRange"] copy]; - globalXRange = [[coder decodeObjectForKey:@"CPTXYPlotSpace.globalXRange"] copy]; - globalYRange = [[coder decodeObjectForKey:@"CPTXYPlotSpace.globalYRange"] copy]; - xScaleType = (CPTScaleType)[coder decodeIntegerForKey : @"CPTXYPlotSpace.xScaleType"]; - yScaleType = (CPTScaleType)[coder decodeIntegerForKey : @"CPTXYPlotSpace.yScaleType"]; + if ((self = [super initWithCoder:coder])) { + CPTPlotRange *range = [coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTXYPlotSpace.xRange"]; + if ( range ) { + xRange = [range copy]; + } + range = [coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTXYPlotSpace.yRange"]; + if ( range ) { + yRange = [range copy]; + } + globalXRange = [[coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTXYPlotSpace.globalXRange"] copy]; + globalYRange = [[coder decodeObjectOfClass:[CPTPlotRange class] + forKey:@"CPTXYPlotSpace.globalYRange"] copy]; + xScaleType = (CPTScaleType)[coder decodeIntegerForKey:@"CPTXYPlotSpace.xScaleType"]; + yScaleType = (CPTScaleType)[coder decodeIntegerForKey:@"CPTXYPlotSpace.yScaleType"]; if ( [coder containsValueForKey:@"CPTXYPlotSpace.allowsMomentum"] ) { self.allowsMomentum = [coder decodeBoolForKey:@"CPTXYPlotSpace.allowsMomentum"]; @@ -265,8 +282,8 @@ -(instancetype)initWithCoder:(NSCoder *)coder allowsMomentumX = [coder decodeBoolForKey:@"CPTXYPlotSpace.allowsMomentumX"]; allowsMomentumY = [coder decodeBoolForKey:@"CPTXYPlotSpace.allowsMomentumY"]; } - momentumAnimationCurve = (CPTAnimationCurve)[coder decodeIntForKey : @"CPTXYPlotSpace.momentumAnimationCurve"]; - bounceAnimationCurve = (CPTAnimationCurve)[coder decodeIntForKey : @"CPTXYPlotSpace.bounceAnimationCurve"]; + momentumAnimationCurve = (CPTAnimationCurve)[coder decodeIntegerForKey:@"CPTXYPlotSpace.momentumAnimationCurve"]; + bounceAnimationCurve = (CPTAnimationCurve)[coder decodeIntegerForKey:@"CPTXYPlotSpace.bounceAnimationCurve"]; momentumAcceleration = [coder decodeCGFloatForKey:@"CPTXYPlotSpace.momentumAcceleration"]; bounceAcceleration = [coder decodeCGFloatForKey:@"CPTXYPlotSpace.bounceAcceleration"]; minimumDisplacementToDrag = [coder decodeCGFloatForKey:@"CPTXYPlotSpace.minimumDisplacementToDrag"]; @@ -282,12 +299,24 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Ranges /// @cond --(void)setPlotRange:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate +-(void)setPlotRange:(nonnull CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordinate { switch ( coordinate ) { case CPTCoordinateX: @@ -304,7 +333,7 @@ -(void)setPlotRange:(CPTPlotRange *)newRange forCoordinate:(CPTCoordinate)coordi } } --(CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coordinate +-(nullable CPTPlotRange *)plotRangeForCoordinate:(CPTCoordinate)coordinate { CPTPlotRange *theRange = nil; @@ -363,7 +392,7 @@ -(CPTScaleType)scaleTypeForCoordinate:(CPTCoordinate)coordinate return theScaleType; } --(void)setXRange:(CPTPlotRange *)range +-(void)setXRange:(nonnull CPTPlotRange *)range { NSParameterAssert(range); @@ -387,17 +416,17 @@ -(void)setXRange:(CPTPlotRange *)range BOOL isScrolling = NO; if ( xRange && constrainedRange ) { - isScrolling = !CPTDecimalEquals(constrainedRange.location, xRange.location) && CPTDecimalEquals(constrainedRange.length, xRange.length); + isScrolling = !CPTDecimalEquals(constrainedRange.locationDecimal, xRange.locationDecimal) && CPTDecimalEquals(constrainedRange.lengthDecimal, xRange.lengthDecimal); - if ( isScrolling && ( displacement == CPTFloat(0.0) ) ) { + if ( isScrolling && (displacement == CPTFloat(0.0))) { CPTGraph *theGraph = self.graph; CPTPlotArea *plotArea = theGraph.plotAreaFrame.plotArea; if ( plotArea ) { - NSDecimal rangeLength = constrainedRange.length; + NSDecimal rangeLength = constrainedRange.lengthDecimal; - if ( !CPTDecimalEquals( rangeLength, CPTDecimalFromInteger(0) ) ) { - NSDecimal diff = CPTDecimalDivide(CPTDecimalSubtract(constrainedRange.location, xRange.location), rangeLength); + if ( !CPTDecimalEquals(rangeLength, CPTDecimalFromInteger(0))) { + NSDecimal diff = CPTDecimalDivide(CPTDecimalSubtract(constrainedRange.locationDecimal, xRange.locationDecimal), rangeLength); displacement = plotArea.bounds.size.width * CPTDecimalCGFloatValue(diff); } @@ -427,7 +456,7 @@ -(void)setXRange:(CPTPlotRange *)range } } --(void)setYRange:(CPTPlotRange *)range +-(void)setYRange:(nonnull CPTPlotRange *)range { NSParameterAssert(range); @@ -451,17 +480,17 @@ -(void)setYRange:(CPTPlotRange *)range BOOL isScrolling = NO; if ( yRange && constrainedRange ) { - isScrolling = !CPTDecimalEquals(constrainedRange.location, yRange.location) && CPTDecimalEquals(constrainedRange.length, yRange.length); + isScrolling = !CPTDecimalEquals(constrainedRange.locationDecimal, yRange.locationDecimal) && CPTDecimalEquals(constrainedRange.lengthDecimal, yRange.lengthDecimal); - if ( isScrolling && ( displacement == CPTFloat(0.0) ) ) { + if ( isScrolling && (displacement == CPTFloat(0.0))) { CPTGraph *theGraph = self.graph; CPTPlotArea *plotArea = theGraph.plotAreaFrame.plotArea; if ( plotArea ) { - NSDecimal rangeLength = constrainedRange.length; + NSDecimal rangeLength = constrainedRange.lengthDecimal; - if ( !CPTDecimalEquals( rangeLength, CPTDecimalFromInteger(0) ) ) { - NSDecimal diff = CPTDecimalDivide(CPTDecimalSubtract(constrainedRange.location, yRange.location), rangeLength); + if ( !CPTDecimalEquals(rangeLength, CPTDecimalFromInteger(0))) { + NSDecimal diff = CPTDecimalDivide(CPTDecimalSubtract(constrainedRange.locationDecimal, yRange.locationDecimal), rangeLength); displacement = plotArea.bounds.size.height * CPTDecimalCGFloatValue(diff); } @@ -491,7 +520,7 @@ -(void)setYRange:(CPTPlotRange *)range } } --(CPTPlotRange *)constrainRange:(CPTPlotRange *)existingRange toGlobalRange:(CPTPlotRange *)globalRange +-(nonnull CPTPlotRange *)constrainRange:(nonnull CPTPlotRange *)existingRange toGlobalRange:(nullable CPTPlotRange *)globalRange { if ( !globalRange ) { return existingRange; @@ -500,20 +529,22 @@ -(CPTPlotRange *)constrainRange:(CPTPlotRange *)existingRange toGlobalRange:(CPT return nil; } - if ( CPTDecimalGreaterThanOrEqualTo(existingRange.length, globalRange.length) ) { - return [globalRange copy]; + CPTPlotRange *theGlobalRange = globalRange; + + if ( CPTDecimalGreaterThanOrEqualTo(existingRange.lengthDecimal, theGlobalRange.lengthDecimal)) { + return [theGlobalRange copy]; } else { CPTMutablePlotRange *newRange = [existingRange mutableCopy]; - [newRange shiftEndToFitInRange:globalRange]; - [newRange shiftLocationToFitInRange:globalRange]; + [newRange shiftEndToFitInRange:theGlobalRange]; + [newRange shiftLocationToFitInRange:theGlobalRange]; return newRange; } } -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shift momentumTime:(CGFloat)momentumTime speed:(CGFloat)speed acceleration:(CGFloat)acceleration { - NSMutableArray *animationArray = self.animations; + CPTMutableAnimationArray *animationArray = self.animations; CPTAnimationOperation *op; NSString *property = nil; @@ -534,6 +565,8 @@ -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shif break; default: + property = @""; + oldRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@0]; break; } @@ -544,7 +577,7 @@ -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shif BOOL hasShift = !CPTDecimalEquals(shift, zero); if ( hasShift ) { - newRange.location = CPTDecimalAdd(newRange.location, shift); + newRange.locationDecimal = CPTDecimalAdd(newRange.locationDecimal, shift); op = [CPTAnimation animate:self property:property @@ -562,12 +595,12 @@ -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shif CPTPlotRange *constrainedRange = [self constrainRange:newRange toGlobalRange:globalRange]; if ( ![newRange isEqualToRange:constrainedRange] && ![globalRange containsRange:newRange] ) { - BOOL direction = ( CPTDecimalGreaterThan(shift, zero) && CPTDecimalGreaterThan(oldRange.length, zero) ) || - ( CPTDecimalLessThan(shift, zero) && CPTDecimalLessThan(oldRange.length, zero) ); + BOOL direction = (CPTDecimalGreaterThan(shift, zero) && CPTDecimalGreaterThan(oldRange.lengthDecimal, zero)) || + (CPTDecimalLessThan(shift, zero) && CPTDecimalLessThan(oldRange.lengthDecimal, zero)); // decelerate at the global range if ( hasShift ) { - CGFloat brakingDelay = CPTFloat(NAN); + CGFloat brakingDelay = CPTNAN; if ( [globalRange containsRange:oldRange] ) { // momentum started inside the global range; coast until we hit the global range @@ -577,11 +610,11 @@ -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shif CGFloat brakingOffset = globalPoint - oldPoint; brakingDelay = CPTFirstPositiveRoot(acceleration, speed, brakingOffset); - if ( !isnan(brakingDelay) ) { + if ( !isnan(brakingDelay)) { speed -= brakingDelay * acceleration; // slow down quickly - while ( momentumTime > CPTFloat(0.1) ) { + while ( momentumTime > CPTFloat(0.1)) { acceleration *= CPTFloat(2.0); momentumTime = speed / (CPTFloat(2.0) * acceleration); } @@ -606,11 +639,11 @@ -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shif NSDecimal newPoint[2]; [self plotPoint:newPoint numberOfCoordinates:2 forPlotAreaViewPoint:brakingPoint]; - NSDecimal brakingShift = CPTDecimalSubtract(newPoint[coordinate], direction ? globalRange.end : globalRange.location); + NSDecimal brakingShift = CPTDecimalSubtract(newPoint[coordinate], direction ? globalRange.endDecimal : globalRange.locationDecimal); [newRange shiftEndToFitInRange:globalRange]; [newRange shiftLocationToFitInRange:globalRange]; - newRange.location = CPTDecimalAdd(newRange.location, brakingShift); + newRange.locationDecimal = CPTDecimalAdd(newRange.locationDecimal, brakingShift); } } else { @@ -618,18 +651,18 @@ -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shif brakingDelay = CPTFloat(0.0); // slow down quickly - while ( momentumTime > CPTFloat(0.1) ) { + while ( momentumTime > CPTFloat(0.1)) { momentumTime *= CPTFloat(0.5); - shift = CPTDecimalDivide( shift, CPTDecimalFromInteger(2) ); + shift = CPTDecimalDivide(shift, CPTDecimalFromInteger(2)); } newRange = [oldRange mutableCopy]; - newRange.location = CPTDecimalAdd(newRange.location, shift); + newRange.locationDecimal = CPTDecimalAdd(newRange.locationDecimal, shift); } - if ( !isnan(brakingDelay) ) { + if ( !isnan(brakingDelay)) { op = [CPTAnimation animate:self property:property fromPlotRange:constrainedRange @@ -665,17 +698,17 @@ -(void)animateRangeForCoordinate:(CPTCoordinate)coordinate shift:(NSDecimal)shif } } --(CGFloat)viewCoordinateForRange:(CPTPlotRange *)range coordinate:(CPTCoordinate)coordinate direction:(BOOL)direction +-(CGFloat)viewCoordinateForRange:(nullable CPTPlotRange *)range coordinate:(CPTCoordinate)coordinate direction:(BOOL)direction { CPTCoordinate orthogonalCoordinate = CPTOrthogonalCoordinate(coordinate); NSDecimal point[2]; - point[coordinate] = (direction ? range.maxLimit : range.minLimit); + point[coordinate] = (direction ? range.maxLimitDecimal : range.minLimitDecimal); point[orthogonalCoordinate] = CPTDecimalFromInteger(1); CGPoint viewPoint = [self plotAreaViewPointForPlotPoint:point numberOfCoordinates:2]; - CGFloat pointCoordinate = CPTFloat(NAN); + CGFloat pointCoordinate = CPTNAN; switch ( coordinate ) { case CPTCoordinateX: @@ -696,18 +729,18 @@ -(CGFloat)viewCoordinateForRange:(CPTPlotRange *)range coordinate:(CPTCoordinate // return NAN if no positive roots CGFloat CPTFirstPositiveRoot(CGFloat a, CGFloat b, CGFloat c) { - CGFloat root = CPTFloat(NAN); + CGFloat root = CPTNAN; CGFloat discriminant = sqrt(b * b - CPTFloat(4.0) * a * c); CGFloat root1 = (-b + discriminant) / (CPTFloat(2.0) * a); CGFloat root2 = (-b - discriminant) / (CPTFloat(2.0) * a); - if ( !isnan(root1) && !isnan(root2) ) { - if ( root1 >= CPTFloat(0.0) ) { + if ( !isnan(root1) && !isnan(root2)) { + if ( root1 >= CPTFloat(0.0)) { root = root1; } - if ( ( root2 >= CPTFloat(0.0) ) && ( isnan(root) || (root2 < root) ) ) { + if ((root2 >= CPTFloat(0.0)) && (isnan(root) || (root2 < root))) { root = root2; } } @@ -715,7 +748,7 @@ CGFloat CPTFirstPositiveRoot(CGFloat a, CGFloat b, CGFloat c) return root; } --(void)setGlobalXRange:(CPTPlotRange *)newRange +-(void)setGlobalXRange:(nullable CPTPlotRange *)newRange { if ( ![newRange isEqualToRange:globalXRange] ) { globalXRange = [newRange copy]; @@ -723,7 +756,7 @@ -(void)setGlobalXRange:(CPTPlotRange *)newRange } } --(void)setGlobalYRange:(CPTPlotRange *)newRange +-(void)setGlobalYRange:(nullable CPTPlotRange *)newRange { if ( ![newRange isEqualToRange:globalYRange] ) { globalYRange = [newRange copy]; @@ -731,7 +764,7 @@ -(void)setGlobalYRange:(CPTPlotRange *)newRange } } --(void)scaleToFitPlots:(NSArray *)plots +-(void)scaleToFitPlots:(nullable CPTPlotArray *)plots { if ( plots.count == 0 ) { return; @@ -756,13 +789,51 @@ -(void)scaleToFitPlots:(NSArray *)plots // Set range NSDecimal zero = CPTDecimalFromInteger(0); if ( unionXRange ) { - if ( CPTDecimalEquals(unionXRange.length, zero) ) { + if ( CPTDecimalEquals(unionXRange.lengthDecimal, zero)) { + [unionXRange unionPlotRange:self.xRange]; + } + self.xRange = unionXRange; + } + if ( unionYRange ) { + if ( CPTDecimalEquals(unionYRange.lengthDecimal, zero)) { + [unionYRange unionPlotRange:self.yRange]; + } + self.yRange = unionYRange; + } +} + +-(void)scaleToFitEntirePlots:(nullable CPTPlotArray *)plots +{ + if ( plots.count == 0 ) { + return; + } + + // Determine union of ranges + CPTMutablePlotRange *unionXRange = nil; + CPTMutablePlotRange *unionYRange = nil; + for ( CPTPlot *plot in plots ) { + CPTPlotRange *currentXRange = [plot plotRangeEnclosingCoordinate:CPTCoordinateX]; + CPTPlotRange *currentYRange = [plot plotRangeEnclosingCoordinate:CPTCoordinateY]; + if ( !unionXRange ) { + unionXRange = [currentXRange mutableCopy]; + } + if ( !unionYRange ) { + unionYRange = [currentYRange mutableCopy]; + } + [unionXRange unionPlotRange:currentXRange]; + [unionYRange unionPlotRange:currentYRange]; + } + + // Set range + NSDecimal zero = CPTDecimalFromInteger(0); + if ( unionXRange ) { + if ( CPTDecimalEquals(unionXRange.lengthDecimal, zero)) { [unionXRange unionPlotRange:self.xRange]; } self.xRange = unionXRange; } if ( unionYRange ) { - if ( CPTDecimalEquals(unionYRange.length, zero) ) { + if ( CPTDecimalEquals(unionYRange.lengthDecimal, zero)) { [unionYRange unionPlotRange:self.yRange]; } self.yRange = unionYRange; @@ -813,14 +884,14 @@ -(void)setYScaleType:(CPTScaleType)newScaleType /// @cond // Linear --(CGFloat)viewCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(CPTPlotRange *)range plotCoordinateValue:(NSDecimal)plotCoord +-(CGFloat)viewCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(nonnull CPTPlotRange *)range plotCoordinateValue:(NSDecimal)plotCoord { if ( !range ) { return CPTFloat(0.0); } - NSDecimal factor = CPTDecimalDivide(CPTDecimalSubtract(plotCoord, range.location), range.length); - if ( NSDecimalIsNotANumber(&factor) ) { + NSDecimal factor = CPTDecimalDivide(CPTDecimalSubtract(plotCoord, range.locationDecimal), range.lengthDecimal); + if ( NSDecimalIsNotANumber(&factor)) { factor = CPTDecimalFromInteger(0); } @@ -829,24 +900,24 @@ -(CGFloat)viewCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(CPT return CPTDecimalCGFloatValue(viewCoordinate); } --(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength linearPlotRange:(CPTPlotRange *)range doublePrecisionPlotCoordinateValue:(double)plotCoord +-(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength linearPlotRange:(nonnull CPTPlotRange *)range doublePrecisionPlotCoordinateValue:(double)plotCoord { - if ( !range || (range.lengthDouble == 0.0) ) { + if ( !range || (range.lengthDouble == 0.0)) { return CPTFloat(0.0); } - return viewLength * (CGFloat)( (plotCoord - range.locationDouble) / range.lengthDouble ); + return viewLength * (CGFloat)((plotCoord - range.locationDouble) / range.lengthDouble); } --(NSDecimal)plotCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(CPTPlotRange *)range boundsLength:(NSDecimal)boundsLength +-(NSDecimal)plotCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(nonnull CPTPlotRange *)range boundsLength:(NSDecimal)boundsLength { const NSDecimal zero = CPTDecimalFromInteger(0); - if ( CPTDecimalEquals(boundsLength, zero) ) { + if ( CPTDecimalEquals(boundsLength, zero)) { return zero; } - NSDecimal location = range.location; - NSDecimal length = range.length; + NSDecimal location = range.locationDecimal; + NSDecimal length = range.lengthDecimal; NSDecimal coordinate; NSDecimalDivide(&coordinate, &viewLength, &boundsLength, NSRoundPlain); @@ -856,13 +927,13 @@ -(NSDecimal)plotCoordinateForViewLength:(NSDecimal)viewLength linearPlotRange:(C return coordinate; } --(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength linearPlotRange:(CPTPlotRange *)range boundsLength:(CGFloat)boundsLength +-(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength linearPlotRange:(nonnull CPTPlotRange *)range boundsLength:(CGFloat)boundsLength { - if ( boundsLength == 0.0 ) { + if ( boundsLength == CPTFloat(0.0)) { return 0.0; } - double coordinate = viewLength / boundsLength; + double coordinate = (double)viewLength / (double)boundsLength; coordinate *= range.lengthDouble; coordinate += range.locationDouble; @@ -870,9 +941,9 @@ -(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength linearPl } // Log (only one version since there are no transcendental functions for NSDecimal) --(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength logPlotRange:(CPTPlotRange *)range doublePrecisionPlotCoordinateValue:(double)plotCoord +-(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength logPlotRange:(nonnull CPTPlotRange *)range doublePrecisionPlotCoordinateValue:(double)plotCoord { - if ( (range.minLimitDouble <= 0.0) || (range.maxLimitDouble <= 0.0) || (plotCoord <= 0.0) ) { + if ((range.minLimitDouble <= 0.0) || (range.maxLimitDouble <= 0.0) || (plotCoord <= 0.0)) { return CPTFloat(0.0); } @@ -880,23 +951,50 @@ -(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength logPlotRange:(CPTPlotR double logCoord = log10(plotCoord); double logEnd = log10(range.endDouble); - return viewLength * (CGFloat)( (logCoord - logLoc) / (logEnd - logLoc) ); + return viewLength * (CGFloat)((logCoord - logLoc) / (logEnd - logLoc)); } --(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength logPlotRange:(CPTPlotRange *)range boundsLength:(CGFloat)boundsLength +-(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength logPlotRange:(nonnull CPTPlotRange *)range boundsLength:(CGFloat)boundsLength { - if ( boundsLength == 0.0 ) { + if ( boundsLength == CPTFloat(0.0)) { return 0.0; } double logLoc = log10(range.locationDouble); double logEnd = log10(range.endDouble); - double coordinate = viewLength * (logEnd - logLoc) / boundsLength + logLoc; + double coordinate = (double)viewLength * (logEnd - logLoc) / (double)boundsLength + logLoc; return pow(10.0, coordinate); } +// Log-modulus (only one version since there are no transcendental functions for NSDecimal) +-(CGFloat)viewCoordinateForViewLength:(CGFloat)viewLength logModulusPlotRange:(nonnull CPTPlotRange *)range doublePrecisionPlotCoordinateValue:(double)plotCoord +{ + if ( !range ) { + return CPTFloat(0.0); + } + + double logLoc = CPTLogModulus(range.locationDouble); + double logCoord = CPTLogModulus(plotCoord); + double logEnd = CPTLogModulus(range.endDouble); + + return viewLength * (CGFloat)((logCoord - logLoc) / (logEnd - logLoc)); +} + +-(double)doublePrecisionPlotCoordinateForViewLength:(CGFloat)viewLength logModulusPlotRange:(nonnull CPTPlotRange *)range boundsLength:(CGFloat)boundsLength +{ + if ( boundsLength == CPTFloat(0.0)) { + return 0.0; + } + + double logLoc = CPTLogModulus(range.locationDouble); + double logEnd = CPTLogModulus(range.endDouble); + double coordinate = (double)viewLength * (logEnd - logLoc) / (double)boundsLength + logLoc; + + return CPTInverseLogModulus(coordinate); +} + /// @endcond #pragma mark - @@ -910,7 +1008,69 @@ -(NSUInteger)numberOfCoordinates } // Plot area view point for plot point --(CGPoint)plotAreaViewPointForPlotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count +-(CGPoint)plotAreaViewPointForPlotPoint:(nonnull CPTNumberArray *)plotPoint +{ + CGPoint viewPoint = [super plotAreaViewPointForPlotPoint:plotPoint]; + + CGSize layerSize; + CPTGraph *theGraph = self.graph; + CPTPlotArea *plotArea = theGraph.plotAreaFrame.plotArea; + + if ( plotArea ) { + layerSize = plotArea.bounds.size; + } + else { + return viewPoint; + } + + switch ( self.xScaleType ) { + case CPTScaleTypeLinear: + case CPTScaleTypeCategory: + viewPoint.x = [self viewCoordinateForViewLength:plotArea.widthDecimal linearPlotRange:self.xRange plotCoordinateValue:plotPoint[CPTCoordinateX].decimalValue]; + break; + + case CPTScaleTypeLog: + { + viewPoint.x = [self viewCoordinateForViewLength:layerSize.width logPlotRange:self.xRange doublePrecisionPlotCoordinateValue:plotPoint[CPTCoordinateX].doubleValue]; + } + break; + + case CPTScaleTypeLogModulus: + { + viewPoint.x = [self viewCoordinateForViewLength:layerSize.width logModulusPlotRange:self.xRange doublePrecisionPlotCoordinateValue:plotPoint[CPTCoordinateX].doubleValue]; + } + break; + + default: + [NSException raise:CPTException format:@"Scale type not supported in CPTXYPlotSpace"]; + } + + switch ( self.yScaleType ) { + case CPTScaleTypeLinear: + case CPTScaleTypeCategory: + viewPoint.y = [self viewCoordinateForViewLength:plotArea.heightDecimal linearPlotRange:self.yRange plotCoordinateValue:plotPoint[CPTCoordinateY].decimalValue]; + break; + + case CPTScaleTypeLog: + { + viewPoint.y = [self viewCoordinateForViewLength:layerSize.height logPlotRange:self.yRange doublePrecisionPlotCoordinateValue:plotPoint[CPTCoordinateY].doubleValue]; + } + break; + + case CPTScaleTypeLogModulus: + { + viewPoint.y = [self viewCoordinateForViewLength:layerSize.height logModulusPlotRange:self.yRange doublePrecisionPlotCoordinateValue:plotPoint[CPTCoordinateY].doubleValue]; + } + break; + + default: + [NSException raise:CPTException format:@"Scale type not supported in CPTXYPlotSpace"]; + } + + return viewPoint; +} + +-(CGPoint)plotAreaViewPointForPlotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count { CGPoint viewPoint = [super plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:count]; @@ -938,6 +1098,13 @@ -(CGPoint)plotAreaViewPointForPlotPoint:(NSDecimal *)plotPoint numberOfCoordinat } break; + case CPTScaleTypeLogModulus: + { + double x = CPTDecimalDoubleValue(plotPoint[CPTCoordinateX]); + viewPoint.x = [self viewCoordinateForViewLength:layerSize.width logModulusPlotRange:self.xRange doublePrecisionPlotCoordinateValue:x]; + } + break; + default: [NSException raise:CPTException format:@"Scale type not supported in CPTXYPlotSpace"]; } @@ -955,6 +1122,13 @@ -(CGPoint)plotAreaViewPointForPlotPoint:(NSDecimal *)plotPoint numberOfCoordinat } break; + case CPTScaleTypeLogModulus: + { + double y = CPTDecimalDoubleValue(plotPoint[CPTCoordinateY]); + viewPoint.y = [self viewCoordinateForViewLength:layerSize.height logModulusPlotRange:self.yRange doublePrecisionPlotCoordinateValue:y]; + } + break; + default: [NSException raise:CPTException format:@"Scale type not supported in CPTXYPlotSpace"]; } @@ -962,7 +1136,7 @@ -(CGPoint)plotAreaViewPointForPlotPoint:(NSDecimal *)plotPoint numberOfCoordinat return viewPoint; } --(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(double *)plotPoint numberOfCoordinates:(NSUInteger)count +-(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count { CGPoint viewPoint = [super plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:count]; @@ -987,6 +1161,10 @@ -(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(double *)plotPoint numbe viewPoint.x = [self viewCoordinateForViewLength:layerSize.width logPlotRange:self.xRange doublePrecisionPlotCoordinateValue:plotPoint[CPTCoordinateX]]; break; + case CPTScaleTypeLogModulus: + viewPoint.x = [self viewCoordinateForViewLength:layerSize.width logModulusPlotRange:self.xRange doublePrecisionPlotCoordinateValue:plotPoint[CPTCoordinateX]]; + break; + default: [NSException raise:CPTException format:@"Scale type not supported in CPTXYPlotSpace"]; } @@ -1001,6 +1179,10 @@ -(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(double *)plotPoint numbe viewPoint.y = [self viewCoordinateForViewLength:layerSize.height logPlotRange:self.yRange doublePrecisionPlotCoordinateValue:plotPoint[CPTCoordinateY]]; break; + case CPTScaleTypeLogModulus: + viewPoint.y = [self viewCoordinateForViewLength:layerSize.height logModulusPlotRange:self.yRange doublePrecisionPlotCoordinateValue:plotPoint[CPTCoordinateY]]; + break; + default: [NSException raise:CPTException format:@"Scale type not supported in CPTXYPlotSpace"]; } @@ -1009,7 +1191,69 @@ -(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(double *)plotPoint numbe } // Plot point for view point --(void)plotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point +-(nullable CPTNumberArray *)plotPointForPlotAreaViewPoint:(CGPoint)point +{ + CPTMutableNumberArray *plotPoint = [[super plotPointForPlotAreaViewPoint:point] mutableCopy]; + + CGSize boundsSize; + CPTGraph *theGraph = self.graph; + CPTPlotArea *plotArea = theGraph.plotAreaFrame.plotArea; + + if ( plotArea ) { + boundsSize = plotArea.bounds.size; + } + else { + return @[@0, @0]; + } + + if ( !plotPoint ) { + plotPoint = [NSMutableArray arrayWithCapacity:self.numberOfCoordinates]; + } + + switch ( self.xScaleType ) { + case CPTScaleTypeLinear: + case CPTScaleTypeCategory: + plotPoint[CPTCoordinateX] = [NSDecimalNumber decimalNumberWithDecimal:[self plotCoordinateForViewLength:CPTDecimalFromCGFloat(point.x) + linearPlotRange:self.xRange + boundsLength:plotArea.widthDecimal]]; + break; + + case CPTScaleTypeLog: + plotPoint[CPTCoordinateX] = @([self doublePrecisionPlotCoordinateForViewLength:point.x logPlotRange:self.xRange boundsLength:boundsSize.width]); + break; + + case CPTScaleTypeLogModulus: + plotPoint[CPTCoordinateX] = @([self doublePrecisionPlotCoordinateForViewLength:point.x logModulusPlotRange:self.xRange boundsLength:boundsSize.width]); + break; + + default: + [NSException raise:CPTException format:@"Scale type not supported in CPTXYPlotSpace"]; + } + + switch ( self.yScaleType ) { + case CPTScaleTypeLinear: + case CPTScaleTypeCategory: + plotPoint[CPTCoordinateY] = [NSDecimalNumber decimalNumberWithDecimal:[self plotCoordinateForViewLength:CPTDecimalFromCGFloat(point.y) + linearPlotRange:self.yRange + boundsLength:plotArea.heightDecimal]]; + break; + + case CPTScaleTypeLog: + plotPoint[CPTCoordinateY] = @([self doublePrecisionPlotCoordinateForViewLength:point.y logPlotRange:self.yRange boundsLength:boundsSize.height]); + break; + + case CPTScaleTypeLogModulus: + plotPoint[CPTCoordinateY] = @([self doublePrecisionPlotCoordinateForViewLength:point.y logModulusPlotRange:self.yRange boundsLength:boundsSize.height]); + break; + + default: + [NSException raise:CPTException format:@"Scale type not supported in CPTXYPlotSpace"]; + } + + return plotPoint; +} + +-(void)plotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point { [super plotPoint:plotPoint numberOfCoordinates:count forPlotAreaViewPoint:point]; @@ -1037,6 +1281,10 @@ -(void)plotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count fo plotPoint[CPTCoordinateX] = CPTDecimalFromDouble([self doublePrecisionPlotCoordinateForViewLength:point.x logPlotRange:self.xRange boundsLength:boundsSize.width]); break; + case CPTScaleTypeLogModulus: + plotPoint[CPTCoordinateX] = CPTDecimalFromDouble([self doublePrecisionPlotCoordinateForViewLength:point.x logModulusPlotRange:self.xRange boundsLength:boundsSize.width]); + break; + default: [NSException raise:CPTException format:@"Scale type not supported in CPTXYPlotSpace"]; } @@ -1051,12 +1299,16 @@ -(void)plotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count fo plotPoint[CPTCoordinateY] = CPTDecimalFromDouble([self doublePrecisionPlotCoordinateForViewLength:point.y logPlotRange:self.yRange boundsLength:boundsSize.height]); break; + case CPTScaleTypeLogModulus: + plotPoint[CPTCoordinateY] = CPTDecimalFromDouble([self doublePrecisionPlotCoordinateForViewLength:point.y logModulusPlotRange:self.yRange boundsLength:boundsSize.height]); + break; + default: [NSException raise:CPTException format:@"Scale type not supported in CPTXYPlotSpace"]; } } --(void)doublePrecisionPlotPoint:(double *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point +-(void)doublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count forPlotAreaViewPoint:(CGPoint)point { [super doublePrecisionPlotPoint:plotPoint numberOfCoordinates:count forPlotAreaViewPoint:point]; @@ -1083,6 +1335,10 @@ -(void)doublePrecisionPlotPoint:(double *)plotPoint numberOfCoordinates:(NSUInte plotPoint[CPTCoordinateX] = [self doublePrecisionPlotCoordinateForViewLength:point.x logPlotRange:self.xRange boundsLength:boundsSize.width]; break; + case CPTScaleTypeLogModulus: + plotPoint[CPTCoordinateX] = [self doublePrecisionPlotCoordinateForViewLength:point.x logModulusPlotRange:self.xRange boundsLength:boundsSize.width]; + break; + default: [NSException raise:CPTException format:@"Scale type not supported in CPTXYPlotSpace"]; } @@ -1097,13 +1353,17 @@ -(void)doublePrecisionPlotPoint:(double *)plotPoint numberOfCoordinates:(NSUInte plotPoint[CPTCoordinateY] = [self doublePrecisionPlotCoordinateForViewLength:point.y logPlotRange:self.yRange boundsLength:boundsSize.height]; break; + case CPTScaleTypeLogModulus: + plotPoint[CPTCoordinateY] = [self doublePrecisionPlotCoordinateForViewLength:point.y logModulusPlotRange:self.yRange boundsLength:boundsSize.height]; + break; + default: [NSException raise:CPTException format:@"Scale type not supported in CPTXYPlotSpace"]; } } // Plot area view point for event --(CGPoint)plotAreaViewPointForEvent:(CPTNativeEvent *)event +-(CGPoint)plotAreaViewPointForEvent:(nonnull CPTNativeEvent *)event { CGPoint plotAreaViewPoint = CGPointZero; @@ -1112,7 +1372,7 @@ -(CGPoint)plotAreaViewPointForEvent:(CPTNativeEvent *)event CPTPlotArea *thePlotArea = theGraph.plotAreaFrame.plotArea; if ( theHostingView && thePlotArea ) { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE CGPoint interactionPoint = [[[event touchesForView:theHostingView] anyObject] locationInView:theHostingView]; if ( theHostingView.collapsesLayers ) { interactionPoint.y = theHostingView.frame.size.height - interactionPoint.y; @@ -1122,7 +1382,7 @@ -(CGPoint)plotAreaViewPointForEvent:(CPTNativeEvent *)event plotAreaViewPoint = [theHostingView.layer convertPoint:interactionPoint toLayer:thePlotArea]; } #else - CGPoint interactionPoint = NSPointToCGPoint([theHostingView convertPoint:[event locationInWindow] fromView:nil]); + CGPoint interactionPoint = NSPointToCGPoint([theHostingView convertPoint:event.locationInWindow fromView:nil]); plotAreaViewPoint = [theHostingView.layer convertPoint:interactionPoint toLayer:thePlotArea]; #endif } @@ -1131,12 +1391,17 @@ -(CGPoint)plotAreaViewPointForEvent:(CPTNativeEvent *)event } // Plot point for event --(void)plotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(CPTNativeEvent *)event +-(nullable CPTNumberArray *)plotPointForEvent:(nonnull CPTNativeEvent *)event +{ + return [self plotPointForPlotAreaViewPoint:[self plotAreaViewPointForEvent:event]]; +} + +-(void)plotPoint:(nonnull NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(nonnull CPTNativeEvent *)event { [self plotPoint:plotPoint numberOfCoordinates:count forPlotAreaViewPoint:[self plotAreaViewPointForEvent:event]]; } --(void)doublePrecisionPlotPoint:(double *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(CPTNativeEvent *)event +-(void)doublePrecisionPlotPoint:(nonnull double *)plotPoint numberOfCoordinates:(NSUInteger)count forEvent:(nonnull CPTNativeEvent *)event { [self doublePrecisionPlotPoint:plotPoint numberOfCoordinates:count forPlotAreaViewPoint:[self plotAreaViewPointForEvent:event]]; } @@ -1153,7 +1418,7 @@ -(void)scaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)plotAreaPoint CPTGraph *theGraph = self.graph; CPTPlotArea *plotArea = theGraph.plotAreaFrame.plotArea; - if ( !plotArea || (interactionScale <= 1.e-6) ) { + if ( !plotArea || (interactionScale <= CPTFloat(1.e-6))) { return; } if ( ![plotArea containsPoint:plotAreaPoint] ) { @@ -1181,37 +1446,37 @@ -(void)scaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)plotAreaPoint CPTPlotRange *oldRangeY = self.yRange; // Lengths are scaled by the pinch gesture inverse proportional - NSDecimal newLengthX = CPTDecimalDivide(oldRangeX.length, decimalScale); - NSDecimal newLengthY = CPTDecimalDivide(oldRangeY.length, decimalScale); + NSDecimal newLengthX = CPTDecimalDivide(oldRangeX.lengthDecimal, decimalScale); + NSDecimal newLengthY = CPTDecimalDivide(oldRangeY.lengthDecimal, decimalScale); // New locations NSDecimal newLocationX; - if ( CPTDecimalGreaterThanOrEqualTo( oldRangeX.length, CPTDecimalFromInteger(0) ) ) { - NSDecimal oldFirstLengthX = CPTDecimalSubtract(plotInteractionPoint[CPTCoordinateX], oldRangeX.minLimit); // x - minX - NSDecimal newFirstLengthX = CPTDecimalDivide(oldFirstLengthX, decimalScale); // (x - minX) / scale + if ( CPTDecimalGreaterThanOrEqualTo(oldRangeX.lengthDecimal, CPTDecimalFromInteger(0))) { + NSDecimal oldFirstLengthX = CPTDecimalSubtract(plotInteractionPoint[CPTCoordinateX], oldRangeX.minLimitDecimal); // x - minX + NSDecimal newFirstLengthX = CPTDecimalDivide(oldFirstLengthX, decimalScale); // (x - minX) / scale newLocationX = CPTDecimalSubtract(plotInteractionPoint[CPTCoordinateX], newFirstLengthX); } else { - NSDecimal oldSecondLengthX = CPTDecimalSubtract(oldRangeX.maxLimit, plotInteractionPoint[0]); // maxX - x - NSDecimal newSecondLengthX = CPTDecimalDivide(oldSecondLengthX, decimalScale); // (maxX - x) / scale + NSDecimal oldSecondLengthX = CPTDecimalSubtract(oldRangeX.maxLimitDecimal, plotInteractionPoint[0]); // maxX - x + NSDecimal newSecondLengthX = CPTDecimalDivide(oldSecondLengthX, decimalScale); // (maxX - x) / scale newLocationX = CPTDecimalAdd(plotInteractionPoint[CPTCoordinateX], newSecondLengthX); } NSDecimal newLocationY; - if ( CPTDecimalGreaterThanOrEqualTo( oldRangeY.length, CPTDecimalFromInteger(0) ) ) { - NSDecimal oldFirstLengthY = CPTDecimalSubtract(plotInteractionPoint[CPTCoordinateY], oldRangeY.minLimit); // y - minY - NSDecimal newFirstLengthY = CPTDecimalDivide(oldFirstLengthY, decimalScale); // (y - minY) / scale + if ( CPTDecimalGreaterThanOrEqualTo(oldRangeY.lengthDecimal, CPTDecimalFromInteger(0))) { + NSDecimal oldFirstLengthY = CPTDecimalSubtract(plotInteractionPoint[CPTCoordinateY], oldRangeY.minLimitDecimal); // y - minY + NSDecimal newFirstLengthY = CPTDecimalDivide(oldFirstLengthY, decimalScale); // (y - minY) / scale newLocationY = CPTDecimalSubtract(plotInteractionPoint[CPTCoordinateY], newFirstLengthY); } else { - NSDecimal oldSecondLengthY = CPTDecimalSubtract(oldRangeY.maxLimit, plotInteractionPoint[1]); // maxY - y - NSDecimal newSecondLengthY = CPTDecimalDivide(oldSecondLengthY, decimalScale); // (maxY - y) / scale + NSDecimal oldSecondLengthY = CPTDecimalSubtract(oldRangeY.maxLimitDecimal, plotInteractionPoint[1]); // maxY - y + NSDecimal newSecondLengthY = CPTDecimalDivide(oldSecondLengthY, decimalScale); // (maxY - y) / scale newLocationY = CPTDecimalAdd(plotInteractionPoint[CPTCoordinateY], newSecondLengthY); } // New ranges - CPTPlotRange *newRangeX = [[CPTPlotRange alloc] initWithLocation:newLocationX length:newLengthX]; - CPTPlotRange *newRangeY = [[CPTPlotRange alloc] initWithLocation:newLocationY length:newLengthY]; + CPTPlotRange *newRangeX = [[CPTPlotRange alloc] initWithLocationDecimal:newLocationX lengthDecimal:newLengthX]; + CPTPlotRange *newRangeY = [[CPTPlotRange alloc] initWithLocationDecimal:newLocationY lengthDecimal:newLengthY]; BOOL oldMomentum = self.allowsMomentumX; self.allowsMomentumX = NO; @@ -1251,7 +1516,7 @@ -(void)scaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)plotAreaPoint * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDownEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { self.isDragging = NO; @@ -1275,7 +1540,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact self.lastDeltaTime = 0.0; // Clear any previous animations - NSMutableArray *animationArray = self.animations; + CPTMutableAnimationArray *animationArray = self.animations; for ( CPTAnimationOperation *op in animationArray ) { [[CPTAnimation sharedInstance] removeAnimationOperation:op]; } @@ -1305,7 +1570,7 @@ -(BOOL)pointingDeviceDownEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interact * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceUpEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { BOOL handledByDelegate = [super pointingDeviceUpEvent:event atPoint:interactionPoint]; @@ -1336,7 +1601,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio NSTimeInterval deltaT = event.timestamp - self.lastDragTime; NSTimeInterval lastDeltaT = self.lastDeltaTime; - if ( (deltaT > 0.0) && (deltaT < 0.05) && (lastDeltaT > 0.0) ) { + if ((deltaT > 0.0) && (deltaT < 0.05) && (lastDeltaT > 0.0)) { CGPoint pointInPlotArea = [theGraph convertPoint:interactionPoint toLayer:plotArea]; CGPoint displacement = self.lastDisplacement; @@ -1344,7 +1609,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio speed = sqrt(displacement.x * displacement.x + displacement.y * displacement.y) / CPTFloat(lastDeltaT); momentumTime = speed / (CPTFloat(2.0) * acceleration); CGFloat distanceTraveled = speed * momentumTime - CPTFloat(0.5) * acceleration * momentumTime * momentumTime; - distanceTraveled = MAX( distanceTraveled, CPTFloat(0.0) ); + distanceTraveled = MAX(distanceTraveled, CPTFloat(0.0)); CGFloat theta = atan2(displacement.y, displacement.x); scaleX = cos(theta); @@ -1403,7 +1668,7 @@ -(BOOL)pointingDeviceUpEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactio * @param interactionPoint The coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)pointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint +-(BOOL)pointingDeviceDraggedEvent:(nonnull CPTNativeEvent *)event atPoint:(CGPoint)interactionPoint { BOOL handledByDelegate = [super pointingDeviceDraggedEvent:event atPoint:interactionPoint]; @@ -1445,18 +1710,18 @@ -(BOOL)pointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)inter // X range NSDecimal shiftX = CPTDecimalSubtract(lastPoint[CPTCoordinateX], newPoint[CPTCoordinateX]); CPTPlotRange *newRangeX = [self shiftRange:self.xRange - by:shiftX - usingMomentum:self.allowsMomentumX - inGlobalRange:self.globalXRange - withDisplacement:&displacement.x]; + by:shiftX + usingMomentum:self.allowsMomentumX + inGlobalRange:self.globalXRange + withDisplacement:&displacement.x]; // Y range NSDecimal shiftY = CPTDecimalSubtract(lastPoint[CPTCoordinateY], newPoint[CPTCoordinateY]); CPTPlotRange *newRangeY = [self shiftRange:self.yRange - by:shiftY - usingMomentum:self.allowsMomentumY - inGlobalRange:self.globalYRange - withDisplacement:&displacement.y]; + by:shiftY + usingMomentum:self.allowsMomentumY + inGlobalRange:self.globalYRange + withDisplacement:&displacement.y]; self.lastDragPoint = pointInPlotArea; self.lastDisplacement = displacement; @@ -1474,11 +1739,13 @@ -(BOOL)pointingDeviceDraggedEvent:(CPTNativeEvent *)event atPoint:(CGPoint)inter return NO; } --(CPTPlotRange *)shiftRange:(CPTPlotRange *)oldRange by:(NSDecimal)shift usingMomentum:(BOOL)momentum inGlobalRange:(CPTPlotRange *)globalRange withDisplacement:(CGFloat *)displacement +/// @cond + +-(nullable CPTPlotRange *)shiftRange:(nonnull CPTPlotRange *)oldRange by:(NSDecimal)shift usingMomentum:(BOOL)momentum inGlobalRange:(nullable CPTPlotRange *)globalRange withDisplacement:(CGFloat *)displacement { CPTMutablePlotRange *newRange = [oldRange mutableCopy]; - newRange.location = CPTDecimalAdd(newRange.location, shift); + newRange.locationDecimal = CPTDecimalAdd(newRange.locationDecimal, shift); if ( globalRange ) { CPTPlotRange *constrainedRange = [self constrainRange:newRange toGlobalRange:globalRange]; @@ -1486,15 +1753,15 @@ -(CPTPlotRange *)shiftRange:(CPTPlotRange *)oldRange by:(NSDecimal)shift usingMo if ( momentum ) { if ( ![newRange isEqualToRange:constrainedRange] ) { // reduce the shift as we get farther outside the global range - NSDecimal rangeLength = newRange.length; + NSDecimal rangeLength = newRange.lengthDecimal; - if ( !CPTDecimalEquals( rangeLength, CPTDecimalFromInteger(0) ) ) { - NSDecimal diff = CPTDecimalDivide(CPTDecimalSubtract(constrainedRange.location, newRange.location), rangeLength); - diff = CPTDecimalMax( CPTDecimalMin( CPTDecimalMultiply( diff, CPTDecimalFromDouble(2.5) ), CPTDecimalFromInteger(1) ), CPTDecimalFromInteger(-1) ); + if ( !CPTDecimalEquals(rangeLength, CPTDecimalFromInteger(0))) { + NSDecimal diff = CPTDecimalDivide(CPTDecimalSubtract(constrainedRange.locationDecimal, newRange.locationDecimal), rangeLength); + diff = CPTDecimalMax(CPTDecimalMin(CPTDecimalMultiply(diff, CPTDecimalFromDouble(2.5)), CPTDecimalFromInteger(1)), CPTDecimalFromInteger(-1)); - newRange.location = CPTDecimalSubtract( newRange.location, CPTDecimalMultiply( shift, CPTDecimalAbs(diff) ) ); + newRange.locationDecimal = CPTDecimalSubtract(newRange.locationDecimal, CPTDecimalMultiply(shift, CPTDecimalAbs(diff))); - *displacement = *displacement * ( CPTFloat(1.0) - ABS( CPTDecimalCGFloatValue(diff) ) ); + *displacement = *displacement * (CPTFloat(1.0) - ABS(CPTDecimalCGFloatValue(diff))); } } } @@ -1506,7 +1773,9 @@ -(CPTPlotRange *)shiftRange:(CPTPlotRange *)oldRange by:(NSDecimal)shift usingMo return newRange; } -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +/// @endcond + +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE #else /** @@ -1524,7 +1793,7 @@ -(CPTPlotRange *)shiftRange:(CPTPlotRange *)oldRange by:(NSDecimal)shift usingMo * @param toPoint The ending coordinates of the interaction. * @return Whether the event was handled or not. **/ --(BOOL)scrollWheelEvent:(CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint +-(BOOL)scrollWheelEvent:(nonnull CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint { BOOL handledByDelegate = [super scrollWheelEvent:event fromPoint:fromPoint toPoint:toPoint]; @@ -1558,24 +1827,25 @@ -(BOOL)scrollWheelEvent:(CPTNativeEvent *)event fromPoint:(CGPoint)fromPoint toP // X range NSDecimal shiftX = CPTDecimalSubtract(lastPoint[CPTCoordinateX], newPoint[CPTCoordinateX]); CPTPlotRange *newRangeX = [self shiftRange:self.xRange - by:shiftX - usingMomentum:NO - inGlobalRange:self.globalXRange - withDisplacement:&displacement.x]; + by:shiftX + usingMomentum:NO + inGlobalRange:self.globalXRange + withDisplacement:&displacement.x]; // Y range NSDecimal shiftY = CPTDecimalSubtract(lastPoint[CPTCoordinateY], newPoint[CPTCoordinateY]); CPTPlotRange *newRangeY = [self shiftRange:self.yRange - by:shiftY - usingMomentum:NO - inGlobalRange:self.globalYRange - withDisplacement:&displacement.y]; + by:shiftY + usingMomentum:NO + inGlobalRange:self.globalYRange + withDisplacement:&displacement.y]; self.xRange = newRangeX; self.yRange = newRangeY; return YES; } + #endif /** @@ -1614,11 +1884,94 @@ -(BOOL)allowsMomentum /// @cond --(void)animationDidFinish:(CPTAnimationOperation *)operation +-(void)animationDidFinish:(nonnull CPTAnimationOperation *)operation { [self.animations removeObjectIdenticalTo:operation]; } /// @endcond +#pragma mark - +#pragma mark Debugging + +/// @cond + +-(nullable id)debugQuickLookObject +{ + // Plot space + NSString *plotAreaDesc = [super debugQuickLookObject]; + + // X-range + NSString *xScaleTypeDesc = nil; + + switch ( self.xScaleType ) { + case CPTScaleTypeLinear: + xScaleTypeDesc = @"CPTScaleTypeLinear"; + break; + + case CPTScaleTypeLog: + xScaleTypeDesc = @"CPTScaleTypeLog"; + break; + + case CPTScaleTypeLogModulus: + xScaleTypeDesc = @"CPTScaleTypeLogModulus"; + break; + + case CPTScaleTypeAngular: + xScaleTypeDesc = @"CPTScaleTypeAngular"; + break; + + case CPTScaleTypeDateTime: + xScaleTypeDesc = @"CPTScaleTypeDateTime"; + break; + + case CPTScaleTypeCategory: + xScaleTypeDesc = @"CPTScaleTypeCategory"; + break; + } + + NSString *xRangeDesc = [NSString stringWithFormat:@"xRange:\n%@\nglobalXRange:\n%@\nxScaleType: %@", + [self.xRange debugQuickLookObject], + [self.globalXRange debugQuickLookObject], + xScaleTypeDesc]; + + // Y-range + NSString *yScaleTypeDesc = nil; + + switch ( self.yScaleType ) { + case CPTScaleTypeLinear: + yScaleTypeDesc = @"CPTScaleTypeLinear"; + break; + + case CPTScaleTypeLog: + yScaleTypeDesc = @"CPTScaleTypeLog"; + break; + + case CPTScaleTypeLogModulus: + yScaleTypeDesc = @"CPTScaleTypeLogModulus"; + break; + + case CPTScaleTypeAngular: + yScaleTypeDesc = @"CPTScaleTypeAngular"; + break; + + case CPTScaleTypeDateTime: + yScaleTypeDesc = @"CPTScaleTypeDateTime"; + break; + + case CPTScaleTypeCategory: + yScaleTypeDesc = @"CPTScaleTypeCategory"; + break; + } + + NSString *yRangeDesc = [NSString stringWithFormat:@"yRange:\n%@\nglobalYRange:\n%@\nyScaleType: %@", + [self.yRange debugQuickLookObject], + [self.globalYRange debugQuickLookObject], + yScaleTypeDesc]; + + return [NSString stringWithFormat:@"%@\n\nX:\n%@\n\nY:\n%@", plotAreaDesc, xRangeDesc, yRangeDesc]; +} + +/// @endcond + @end diff --git a/framework/Source/CPTXYPlotSpaceTests.h b/framework/Source/CPTXYPlotSpaceTests.h index 7bef754be..56c6e53aa 100644 --- a/framework/Source/CPTXYPlotSpaceTests.h +++ b/framework/Source/CPTXYPlotSpaceTests.h @@ -4,6 +4,6 @@ @interface CPTXYPlotSpaceTests : CPTTestCase -@property (nonatomic, readwrite, strong) CPTXYGraph *graph; +@property (nonatomic, readwrite, strong, nullable) CPTXYGraph *graph; @end diff --git a/framework/Source/CPTXYPlotSpaceTests.m b/framework/Source/CPTXYPlotSpaceTests.m index 147301918..888b6045d 100644 --- a/framework/Source/CPTXYPlotSpaceTests.m +++ b/framework/Source/CPTXYPlotSpaceTests.m @@ -1,12 +1,13 @@ +#import "CPTXYPlotSpaceTests.h" + #import "CPTPlotRange.h" #import "CPTUtilities.h" #import "CPTXYGraph.h" #import "CPTXYPlotSpace.h" -#import "CPTXYPlotSpaceTests.h" @interface CPTXYPlotSpace(testingAdditions) --(CPTPlotRange *)constrainRange:(CPTPlotRange *)existingRange toGlobalRange:(CPTPlotRange *)globalRange; +-(nonnull CPTPlotRange *)constrainRange:(nonnull CPTPlotRange *)existingRange toGlobalRange:(nullable CPTPlotRange *)globalRange; @end @@ -36,6 +37,36 @@ -(void)tearDown #pragma mark - #pragma mark View point for plot point (linear) +-(void)testViewPointForPlotPointArrayLinear +{ + CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; + + plotSpace.xScaleType = CPTScaleTypeLinear; + plotSpace.yScaleType = CPTScaleTypeLinear; + + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + + CPTNumberArray *plotPoint = @[@5.0, @5.0]; + + CGPoint viewPoint = [plotSpace plotAreaViewPointForPlotPoint:plotPoint]; + + XCTAssertEqualWithAccuracy(viewPoint.x, CPTFloat(50.0), CPTFloat(0.01), @""); + XCTAssertEqualWithAccuracy(viewPoint.y, CPTFloat(25.0), CPTFloat(0.01), @""); + + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@5.0]; + + viewPoint = [plotSpace plotAreaViewPointForPlotPoint:plotPoint]; + + XCTAssertEqualWithAccuracy(viewPoint.x, CPTFloat(50.0), CPTFloat(0.01), @""); + XCTAssertEqualWithAccuracy(viewPoint.y, CPTFloat(50.0), CPTFloat(0.01), @""); +} + -(void)testViewPointForPlotPointLinear { CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; @@ -43,10 +74,10 @@ -(void)testViewPointForPlotPointLinear plotSpace.xScaleType = CPTScaleTypeLinear; plotSpace.yScaleType = CPTScaleTypeLinear; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; NSDecimal plotPoint[2]; plotPoint[CPTCoordinateX] = CPTDecimalFromDouble(5.0); @@ -57,10 +88,10 @@ -(void)testViewPointForPlotPointLinear XCTAssertEqualWithAccuracy(viewPoint.x, CPTFloat(50.0), CPTFloat(0.01), @""); XCTAssertEqualWithAccuracy(viewPoint.y, CPTFloat(25.0), CPTFloat(0.01), @""); - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(5.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@5.0]; viewPoint = [plotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; @@ -75,10 +106,10 @@ -(void)testViewPointForDoublePrecisionPlotPointLinear plotSpace.xScaleType = CPTScaleTypeLinear; plotSpace.yScaleType = CPTScaleTypeLinear; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; double plotPoint[2]; plotPoint[CPTCoordinateX] = 5.0; @@ -89,10 +120,10 @@ -(void)testViewPointForDoublePrecisionPlotPointLinear XCTAssertEqualWithAccuracy(viewPoint.x, CPTFloat(50.0), CPTFloat(0.01), @""); XCTAssertEqualWithAccuracy(viewPoint.y, CPTFloat(25.0), CPTFloat(0.01), @""); - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(5.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@5.0]; viewPoint = [plotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; @@ -103,6 +134,36 @@ -(void)testViewPointForDoublePrecisionPlotPointLinear #pragma mark - #pragma mark View point for plot point (log) +-(void)testViewPointForPlotPointArrayLog +{ + CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; + + plotSpace.xScaleType = CPTScaleTypeLog; + plotSpace.yScaleType = CPTScaleTypeLog; + + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; + + CPTNumberArray *plotPoint = @[@(sqrt(10.0)), @(sqrt(10.0))]; + + CGPoint viewPoint = [plotSpace plotAreaViewPointForPlotPoint:plotPoint]; + + XCTAssertEqualWithAccuracy(viewPoint.x, CPTFloat(50.0), CPTFloat(0.01), @""); + XCTAssertEqualWithAccuracy(viewPoint.y, CPTFloat(25.0), CPTFloat(0.01), @""); + + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@10.0 + length:@90.0]; + + viewPoint = [plotSpace plotAreaViewPointForPlotPoint:plotPoint]; + + XCTAssertEqualWithAccuracy(viewPoint.x, CPTFloat(50.0), CPTFloat(0.01), @""); + XCTAssertEqualWithAccuracy(viewPoint.y, -CPTFloat(25.0), CPTFloat(0.01), @""); +} + -(void)testViewPointForPlotPointLog { CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; @@ -110,24 +171,24 @@ -(void)testViewPointForPlotPointLog plotSpace.xScaleType = CPTScaleTypeLog; plotSpace.yScaleType = CPTScaleTypeLog; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) - length:CPTDecimalFromDouble(9.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) - length:CPTDecimalFromDouble(9.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; NSDecimal plotPoint[2]; - plotPoint[CPTCoordinateX] = CPTDecimalFromDouble( sqrt(10.0) ); - plotPoint[CPTCoordinateY] = CPTDecimalFromDouble( sqrt(10.0) ); + plotPoint[CPTCoordinateX] = CPTDecimalFromDouble(sqrt(10.0)); + plotPoint[CPTCoordinateY] = CPTDecimalFromDouble(sqrt(10.0)); CGPoint viewPoint = [plotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; XCTAssertEqualWithAccuracy(viewPoint.x, CPTFloat(50.0), CPTFloat(0.01), @""); XCTAssertEqualWithAccuracy(viewPoint.y, CPTFloat(25.0), CPTFloat(0.01), @""); - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) - length:CPTDecimalFromDouble(9.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(10.0) - length:CPTDecimalFromDouble(90.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@10.0 + length:@90.0]; viewPoint = [plotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; @@ -142,10 +203,10 @@ -(void)testViewPointForDoublePrecisionPlotPointLog plotSpace.xScaleType = CPTScaleTypeLog; plotSpace.yScaleType = CPTScaleTypeLog; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) - length:CPTDecimalFromDouble(9.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) - length:CPTDecimalFromDouble(9.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; double plotPoint[2]; plotPoint[CPTCoordinateX] = sqrt(10.0); @@ -156,10 +217,10 @@ -(void)testViewPointForDoublePrecisionPlotPointLog XCTAssertEqualWithAccuracy(viewPoint.x, CPTFloat(50.0), CPTFloat(0.01), @""); XCTAssertEqualWithAccuracy(viewPoint.y, CPTFloat(25.0), CPTFloat(0.01), @""); - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) - length:CPTDecimalFromDouble(9.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(10.0) - length:CPTDecimalFromDouble(90.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@10.0 + length:@90.0]; viewPoint = [plotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; @@ -167,9 +228,98 @@ -(void)testViewPointForDoublePrecisionPlotPointLog XCTAssertEqualWithAccuracy(viewPoint.y, -CPTFloat(25.0), CPTFloat(0.01), @""); } +#pragma mark - +#pragma mark View point for plot point (log modulus) + +-(void)testViewPointForPlotPointArrayLogModulus +{ + CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; + + plotSpace.xScaleType = CPTScaleTypeLogModulus; + plotSpace.yScaleType = CPTScaleTypeLogModulus; + + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-100.0) + length:@200.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-100.0) + length:@200.0]; + + NSArray *plotPoint = @[@9.0, @0.0]; + + CGPoint viewPoint = [plotSpace plotAreaViewPointForPlotPoint:plotPoint]; + + XCTAssertEqualWithAccuracy(viewPoint.x, CPTFloat(74.95), CPTFloat(0.01), @""); + XCTAssertEqualWithAccuracy(viewPoint.y, CPTFloat(25.0), CPTFloat(0.01), @""); +} + +-(void)testViewPointForPlotPointLogModulus +{ + CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; + + plotSpace.xScaleType = CPTScaleTypeLogModulus; + plotSpace.yScaleType = CPTScaleTypeLogModulus; + + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-100.0) + length:@200.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-100.0) + length:@200.0]; + + NSDecimal plotPoint[2]; + plotPoint[CPTCoordinateX] = CPTDecimalFromInteger(9); + plotPoint[CPTCoordinateY] = CPTDecimalFromInteger(0); + + CGPoint viewPoint = [plotSpace plotAreaViewPointForPlotPoint:plotPoint numberOfCoordinates:2]; + + XCTAssertEqualWithAccuracy(viewPoint.x, CPTFloat(74.95), CPTFloat(0.01), @""); + XCTAssertEqualWithAccuracy(viewPoint.y, CPTFloat(25.0), CPTFloat(0.01), @""); +} + +-(void)testViewPointForDoublePrecisionPlotPointLogModulus +{ + CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; + + plotSpace.xScaleType = CPTScaleTypeLogModulus; + plotSpace.yScaleType = CPTScaleTypeLogModulus; + + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-100.0) + length:@200.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-100.0) + length:@200.0]; + + double plotPoint[2]; + plotPoint[CPTCoordinateX] = 9.0; + plotPoint[CPTCoordinateY] = 0.0; + + CGPoint viewPoint = [plotSpace plotAreaViewPointForDoublePrecisionPlotPoint:plotPoint numberOfCoordinates:2]; + + XCTAssertEqualWithAccuracy(viewPoint.x, CPTFloat(74.95), CPTFloat(0.01), @""); + XCTAssertEqualWithAccuracy(viewPoint.y, CPTFloat(25.0), CPTFloat(0.01), @""); +} + #pragma mark - #pragma mark Plot point for view point (linear) +-(void)testPlotPointArrayForViewPointLinear +{ + CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; + + plotSpace.xScaleType = CPTScaleTypeLinear; + plotSpace.yScaleType = CPTScaleTypeLinear; + + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + + CGPoint viewPoint = CPTPointMake(50.0, 25.0); + CPTNumberArray *plotPoint = [plotSpace plotPointForPlotAreaViewPoint:viewPoint]; + NSString *errMessage; + + errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateX] was %@", plotPoint[CPTCoordinateX]]; + XCTAssertTrue(CPTDecimalEquals([plotPoint[CPTCoordinateX] decimalValue], CPTDecimalFromDouble(5.0)), @"%@", errMessage); + errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateY] was %@", plotPoint[CPTCoordinateY]]; + XCTAssertTrue(CPTDecimalEquals([plotPoint[CPTCoordinateY] decimalValue], CPTDecimalFromDouble(5.0)), @"%@", errMessage); +} + -(void)testPlotPointForViewPointLinear { CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; @@ -177,10 +327,10 @@ -(void)testPlotPointForViewPointLinear plotSpace.xScaleType = CPTScaleTypeLinear; plotSpace.yScaleType = CPTScaleTypeLinear; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; NSDecimal plotPoint[2]; CGPoint viewPoint = CPTPointMake(50.0, 25.0); @@ -189,9 +339,9 @@ -(void)testPlotPointForViewPointLinear [plotSpace plotPoint:plotPoint numberOfCoordinates:2 forPlotAreaViewPoint:viewPoint]; errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateX] was %@", NSDecimalString(&plotPoint[CPTCoordinateX], nil)]; - XCTAssertTrue(CPTDecimalEquals( plotPoint[CPTCoordinateX], CPTDecimalFromDouble(5.0) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(plotPoint[CPTCoordinateX], CPTDecimalFromDouble(5.0)), @"%@", errMessage); errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateY] was %@", NSDecimalString(&plotPoint[CPTCoordinateY], nil)]; - XCTAssertTrue(CPTDecimalEquals( plotPoint[CPTCoordinateY], CPTDecimalFromDouble(5.0) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(plotPoint[CPTCoordinateY], CPTDecimalFromDouble(5.0)), @"%@", errMessage); } -(void)testDoublePrecisionPlotPointForViewPointLinear @@ -201,10 +351,10 @@ -(void)testDoublePrecisionPlotPointForViewPointLinear plotSpace.xScaleType = CPTScaleTypeLinear; plotSpace.yScaleType = CPTScaleTypeLinear; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; double plotPoint[2]; CGPoint viewPoint = CPTPointMake(50.0, 25.0); @@ -221,6 +371,30 @@ -(void)testDoublePrecisionPlotPointForViewPointLinear #pragma mark - #pragma mark Plot point for view point (log) +-(void)testPlotPointArrayForViewPointLog +{ + CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; + + plotSpace.xScaleType = CPTScaleTypeLog; + plotSpace.yScaleType = CPTScaleTypeLog; + + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; + + CGPoint viewPoint = CPTPointMake(50.0, 25.0); + CPTNumberArray *plotPoint = [plotSpace plotPointForPlotAreaViewPoint:viewPoint]; + NSString *errMessage; + + [plotSpace plotPointForPlotAreaViewPoint:viewPoint]; + + errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateX] was %@", plotPoint[CPTCoordinateX]]; + XCTAssertEqual([plotPoint[CPTCoordinateX] doubleValue], sqrt(10.0), @"%@", errMessage); + errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateY] was %@", plotPoint[CPTCoordinateY]]; + XCTAssertEqual([plotPoint[CPTCoordinateY] doubleValue], sqrt(10.0), @"%@", errMessage); +} + -(void)testPlotPointForViewPointLog { CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; @@ -228,10 +402,10 @@ -(void)testPlotPointForViewPointLog plotSpace.xScaleType = CPTScaleTypeLog; plotSpace.yScaleType = CPTScaleTypeLog; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) - length:CPTDecimalFromDouble(9.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) - length:CPTDecimalFromDouble(9.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; NSDecimal plotPoint[2]; CGPoint viewPoint = CPTPointMake(50.0, 25.0); @@ -240,9 +414,9 @@ -(void)testPlotPointForViewPointLog [plotSpace plotPoint:plotPoint numberOfCoordinates:2 forPlotAreaViewPoint:viewPoint]; errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateX] was %@", NSDecimalString(&plotPoint[CPTCoordinateX], nil)]; - XCTAssertTrue(CPTDecimalEquals( plotPoint[CPTCoordinateX], CPTDecimalFromDouble( sqrt(10.0) ) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(plotPoint[CPTCoordinateX], CPTDecimalFromDouble(sqrt(10.0))), @"%@", errMessage); errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateY] was %@", NSDecimalString(&plotPoint[CPTCoordinateY], nil)]; - XCTAssertTrue(CPTDecimalEquals( plotPoint[CPTCoordinateY], CPTDecimalFromDouble( sqrt(10.0) ) ), @"%@", errMessage); + XCTAssertTrue(CPTDecimalEquals(plotPoint[CPTCoordinateY], CPTDecimalFromDouble(sqrt(10.0))), @"%@", errMessage); } -(void)testDoublePrecisionPlotPointForViewPointLog @@ -252,10 +426,10 @@ -(void)testDoublePrecisionPlotPointForViewPointLog plotSpace.xScaleType = CPTScaleTypeLog; plotSpace.yScaleType = CPTScaleTypeLog; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) - length:CPTDecimalFromDouble(9.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(1.0) - length:CPTDecimalFromDouble(9.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@1.0 + length:@9.0]; double plotPoint[2]; CGPoint viewPoint = CPTPointMake(50.0, 25.0); @@ -269,6 +443,81 @@ -(void)testDoublePrecisionPlotPointForViewPointLog XCTAssertEqual(plotPoint[CPTCoordinateY], sqrt(10.0), @"%@", errMessage); } +#pragma mark - +#pragma mark Plot point for view point (log modulus) + +-(void)testPlotPointArrayForViewPointLogModulus +{ + CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; + + plotSpace.xScaleType = CPTScaleTypeLogModulus; + plotSpace.yScaleType = CPTScaleTypeLogModulus; + + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-100.0) + length:@200.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-100.0) + length:@200.0]; + + CGPoint viewPoint = CPTPointMake(74.95, 25.0); + NSArray *plotPoint = [plotSpace plotPointForPlotAreaViewPoint:viewPoint]; + NSString *errMessage; + + [plotSpace plotPointForPlotAreaViewPoint:viewPoint]; + + errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateX] was %@", plotPoint[CPTCoordinateX]]; + XCTAssertEqualWithAccuracy([plotPoint[CPTCoordinateX] doubleValue], CPTInverseLogModulus(1.0), 0.01, @"%@", errMessage); + errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateY] was %@", plotPoint[CPTCoordinateY]]; + XCTAssertEqual([plotPoint[CPTCoordinateY] doubleValue], 0.0, @"%@", errMessage); +} + +-(void)testPlotPointForViewPointLogModulus +{ + CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; + + plotSpace.xScaleType = CPTScaleTypeLogModulus; + plotSpace.yScaleType = CPTScaleTypeLogModulus; + + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-100.0) + length:@200.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-100.0) + length:@200.0]; + + NSDecimal plotPoint[2]; + CGPoint viewPoint = CPTPointMake(50.0, 25.0); + NSString *errMessage; + + [plotSpace plotPoint:plotPoint numberOfCoordinates:2 forPlotAreaViewPoint:viewPoint]; + + errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateX] was %@", NSDecimalString(&plotPoint[CPTCoordinateX], nil)]; + XCTAssertTrue(CPTDecimalEquals(plotPoint[CPTCoordinateX], CPTDecimalFromInteger(0)), @"%@", errMessage); + errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateY] was %@", NSDecimalString(&plotPoint[CPTCoordinateY], nil)]; + XCTAssertTrue(CPTDecimalEquals(plotPoint[CPTCoordinateY], CPTDecimalFromInteger(0)), @"%@", errMessage); +} + +-(void)testDoublePrecisionPlotPointForViewPointLogModulus +{ + CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; + + plotSpace.xScaleType = CPTScaleTypeLogModulus; + plotSpace.yScaleType = CPTScaleTypeLogModulus; + + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-100.0) + length:@200.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-100.0) + length:@200.0]; + + double plotPoint[2]; + CGPoint viewPoint = CPTPointMake(74.95, 25.0); + NSString *errMessage; + + [plotSpace doublePrecisionPlotPoint:plotPoint numberOfCoordinates:2 forPlotAreaViewPoint:viewPoint]; + + errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateX] was %g", plotPoint[CPTCoordinateX]]; + XCTAssertEqualWithAccuracy(plotPoint[CPTCoordinateX], CPTInverseLogModulus(1.0), 0.01, @"%@", errMessage); + errMessage = [NSString stringWithFormat:@"plotPoint[CPTCoordinateY] was %g", plotPoint[CPTCoordinateY]]; + XCTAssertEqual(plotPoint[CPTCoordinateY], 0.0, @"%@", errMessage); +} + #pragma mark - #pragma mark Constrain ranges @@ -277,17 +526,16 @@ -(void)testConstrainNilRanges CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; XCTAssertEqualObjects([plotSpace constrainRange:plotSpace.xRange toGlobalRange:nil], plotSpace.xRange, @"Constrain to nil global range should return original range."); - XCTAssertNil([plotSpace constrainRange:nil toGlobalRange:plotSpace.xRange], @"Constrain nil range should return nil."); } -(void)testConstrainRanges1 { CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; - CPTPlotRange *existingRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(2.0) - length:CPTDecimalFromDouble(5.0)]; - CPTPlotRange *globalRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; + CPTPlotRange *existingRange = [CPTPlotRange plotRangeWithLocation:@2.0 + length:@5.0]; + CPTPlotRange *globalRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; CPTPlotRange *expectedRange = existingRange; CPTPlotRange *constrainedRange = [plotSpace constrainRange:existingRange toGlobalRange:globalRange]; @@ -300,10 +548,10 @@ -(void)testConstrainRanges2 { CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; - CPTPlotRange *existingRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; - CPTPlotRange *globalRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(5.0)]; + CPTPlotRange *existingRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + CPTPlotRange *globalRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@5.0]; CPTPlotRange *expectedRange = globalRange; CPTPlotRange *constrainedRange = [plotSpace constrainRange:existingRange toGlobalRange:globalRange]; @@ -316,12 +564,12 @@ -(void)testConstrainRanges3 { CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; - CPTPlotRange *existingRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) - length:CPTDecimalFromDouble(8.0)]; - CPTPlotRange *globalRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; - CPTPlotRange *expectedRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(8.0)]; + CPTPlotRange *existingRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) + length:@8.0]; + CPTPlotRange *globalRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + CPTPlotRange *expectedRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@8.0]; CPTPlotRange *constrainedRange = [plotSpace constrainRange:existingRange toGlobalRange:globalRange]; NSString *errMessage = [NSString stringWithFormat:@"constrainedRange was %@, expected %@", constrainedRange, expectedRange]; @@ -333,12 +581,12 @@ -(void)testConstrainRanges4 { CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; - CPTPlotRange *existingRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(3.0) - length:CPTDecimalFromDouble(8.0)]; - CPTPlotRange *globalRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; - CPTPlotRange *expectedRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(2.0) - length:CPTDecimalFromDouble(8.0)]; + CPTPlotRange *existingRange = [CPTPlotRange plotRangeWithLocation:@3.0 + length:@8.0]; + CPTPlotRange *globalRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + CPTPlotRange *expectedRange = [CPTPlotRange plotRangeWithLocation:@2.0 + length:@8.0]; CPTPlotRange *constrainedRange = [plotSpace constrainRange:existingRange toGlobalRange:globalRange]; NSString *errMessage = [NSString stringWithFormat:@"constrainedRange was %@, expected %@", constrainedRange, expectedRange]; @@ -355,19 +603,19 @@ -(void)testScaleByAboutPoint1 plotSpace.allowsUserInteraction = YES; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(10.0) - length:CPTDecimalFromDouble(-10.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@10.0 + length:@(-10.0)]; CGRect myBounds = self.graph.bounds; - [plotSpace scaleBy:0.5 aboutPoint:CGPointMake( CGRectGetMidX(myBounds), CGRectGetMidY(myBounds) )]; + [plotSpace scaleBy:0.5 aboutPoint:CGPointMake(CGRectGetMidX(myBounds), CGRectGetMidY(myBounds))]; - CPTPlotRange *expectedRangeX = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-5.0) - length:CPTDecimalFromDouble(20.0)]; - CPTPlotRange *expectedRangeY = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(15.0) - length:CPTDecimalFromDouble(-20.0)]; + CPTPlotRange *expectedRangeX = [CPTPlotRange plotRangeWithLocation:@(-5.0) + length:@20.0]; + CPTPlotRange *expectedRangeY = [CPTPlotRange plotRangeWithLocation:@15.0 + length:@(-20.0)]; NSString *errMessage = [NSString stringWithFormat:@"xRange was %@, expected %@", plotSpace.xRange, expectedRangeX]; XCTAssertTrue([plotSpace.xRange isEqualToRange:expectedRangeX], @"%@", errMessage); @@ -382,19 +630,19 @@ -(void)testScaleByAboutPoint2 plotSpace.allowsUserInteraction = YES; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(10.0) - length:CPTDecimalFromDouble(-10.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@10.0 + length:@(-10.0)]; CGRect myBounds = self.graph.bounds; - [plotSpace scaleBy:2.0 aboutPoint:CGPointMake( CGRectGetMidX(myBounds), CGRectGetMidY(myBounds) )]; + [plotSpace scaleBy:2.0 aboutPoint:CGPointMake(CGRectGetMidX(myBounds), CGRectGetMidY(myBounds))]; - CPTPlotRange *expectedRangeX = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(2.5) - length:CPTDecimalFromDouble(5.0)]; - CPTPlotRange *expectedRangeY = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(7.5) - length:CPTDecimalFromDouble(-5.0)]; + CPTPlotRange *expectedRangeX = [CPTPlotRange plotRangeWithLocation:@2.5 + length:@5.0]; + CPTPlotRange *expectedRangeY = [CPTPlotRange plotRangeWithLocation:@7.5 + length:@(-5.0)]; NSString *errMessage = [NSString stringWithFormat:@"xRange was %@, expected %@", plotSpace.xRange, expectedRangeX]; XCTAssertTrue([plotSpace.xRange isEqualToRange:expectedRangeX], @"%@", errMessage); @@ -410,12 +658,12 @@ -(void)testKeyedArchivingRoundTrip { CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)self.graph.defaultPlotSpace; - plotSpace.globalXRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(0.0) - length:CPTDecimalFromDouble(10.0)]; - plotSpace.globalYRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(10.0) - length:CPTDecimalFromDouble(-10.0)]; + plotSpace.globalXRange = [CPTPlotRange plotRangeWithLocation:@0.0 + length:@10.0]; + plotSpace.globalYRange = [CPTPlotRange plotRangeWithLocation:@10.0 + length:@(-10.0)]; - CPTXYPlotSpace *newPlotSpace = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:plotSpace]]; + CPTXYPlotSpace *newPlotSpace = [self archiveRoundTrip:plotSpace]; NSString *errMessage = [NSString stringWithFormat:@"xRange was %@, expected %@", plotSpace.xRange, newPlotSpace.xRange]; XCTAssertTrue([plotSpace.xRange isEqualToRange:newPlotSpace.xRange], @"%@", errMessage); diff --git a/framework/Source/NSCoderExtensions.h b/framework/Source/NSCoderExtensions.h index eab4af3f7..896d3c0c9 100644 --- a/framework/Source/NSCoderExtensions.h +++ b/framework/Source/NSCoderExtensions.h @@ -5,30 +5,30 @@ /// @name Encoding Data /// @{ --(void)encodeCGFloat:(CGFloat)number forKey:(NSString *)key; --(void)encodeCPTPoint:(CGPoint)point forKey:(NSString *)key; --(void)encodeCPTSize:(CGSize)size forKey:(NSString *)key; --(void)encodeCPTRect:(CGRect)rect forKey:(NSString *)key; +-(void)encodeCGFloat:(CGFloat)number forKey:(nonnull NSString *)key; +-(void)encodeCPTPoint:(CGPoint)point forKey:(nonnull NSString *)key; +-(void)encodeCPTSize:(CGSize)size forKey:(nonnull NSString *)key; +-(void)encodeCPTRect:(CGRect)rect forKey:(nonnull NSString *)key; --(void)encodeCGColorSpace:(CGColorSpaceRef)colorSpace forKey:(NSString *)key; --(void)encodeCGPath:(CGPathRef)path forKey:(NSString *)key; --(void)encodeCGImage:(CGImageRef)image forKey:(NSString *)key; +-(void)encodeCGColorSpace:(nullable CGColorSpaceRef)colorSpace forKey:(nonnull NSString *)key; +-(void)encodeCGPath:(nullable CGPathRef)path forKey:(nonnull NSString *)key; +-(void)encodeCGImage:(nullable CGImageRef)image forKey:(nonnull NSString *)key; --(void)encodeDecimal:(NSDecimal)number forKey:(NSString *)key; +-(void)encodeDecimal:(NSDecimal)number forKey:(nonnull NSString *)key; /// @} /// @name Decoding Data /// @{ --(CGFloat)decodeCGFloatForKey:(NSString *)key; --(CGPoint)decodeCPTPointForKey:(NSString *)key; --(CGSize)decodeCPTSizeForKey:(NSString *)key; --(CGRect)decodeCPTRectForKey:(NSString *)key; +-(CGFloat)decodeCGFloatForKey:(nonnull NSString *)key; +-(CGPoint)decodeCPTPointForKey:(nonnull NSString *)key; +-(CGSize)decodeCPTSizeForKey:(nonnull NSString *)key; +-(CGRect)decodeCPTRectForKey:(nonnull NSString *)key; --(CGColorSpaceRef)newCGColorSpaceDecodeForKey:(NSString *)key; --(CGPathRef)newCGPathDecodeForKey:(NSString *)key; --(CGImageRef)newCGImageDecodeForKey:(NSString *)key; +-(nullable CGColorSpaceRef)newCGColorSpaceDecodeForKey:(nonnull NSString *)key; +-(nullable CGPathRef)newCGPathDecodeForKey:(nonnull NSString *)key; +-(nullable CGImageRef)newCGImageDecodeForKey:(nonnull NSString *)key; --(NSDecimal)decodeDecimalForKey:(NSString *)key; +-(NSDecimal)decodeDecimalForKey:(nonnull NSString *)key; /// @} @end diff --git a/framework/Source/NSCoderExtensions.m b/framework/Source/NSCoderExtensions.m index 991c07956..cfa40b7f7 100644 --- a/framework/Source/NSCoderExtensions.m +++ b/framework/Source/NSCoderExtensions.m @@ -16,7 +16,7 @@ @implementation NSCoder(CPTExtensions) * @param number The number to encode. * @param key The key to associate with the number. **/ --(void)encodeCGFloat:(CGFloat)number forKey:(NSString *)key +-(void)encodeCGFloat:(CGFloat)number forKey:(nonnull NSString *)key { #if CGFLOAT_IS_DOUBLE [self encodeDouble:number forKey:key]; @@ -29,7 +29,7 @@ -(void)encodeCGFloat:(CGFloat)number forKey:(NSString *)key * @param point The point to encode. * @param key The key to associate with the point. **/ --(void)encodeCPTPoint:(CGPoint)point forKey:(NSString *)key +-(void)encodeCPTPoint:(CGPoint)point forKey:(nonnull NSString *)key { NSString *newKey = [[NSString alloc] initWithFormat:@"%@.x", key]; @@ -43,7 +43,7 @@ -(void)encodeCPTPoint:(CGPoint)point forKey:(NSString *)key * @param size The size to encode. * @param key The key to associate with the size. **/ --(void)encodeCPTSize:(CGSize)size forKey:(NSString *)key +-(void)encodeCPTSize:(CGSize)size forKey:(nonnull NSString *)key { NSString *newKey = [[NSString alloc] initWithFormat:@"%@.width", key]; @@ -57,7 +57,7 @@ -(void)encodeCPTSize:(CGSize)size forKey:(NSString *)key * @param rect The rectangle to encode. * @param key The key to associate with the rectangle. **/ --(void)encodeCPTRect:(CGRect)rect forKey:(NSString *)key +-(void)encodeCPTRect:(CGRect)rect forKey:(nonnull NSString *)key { NSString *newKey = [[NSString alloc] initWithFormat:@"%@.origin", key]; @@ -72,13 +72,27 @@ -(void)encodeCPTRect:(CGRect)rect forKey:(NSString *)key * @param key The key to associate with the color space. * @note The current implementation only works with named color spaces. **/ --(void)encodeCGColorSpace:(CGColorSpaceRef)colorSpace forKey:(NSString *)key +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#endif +-(void)encodeCGColorSpace:(nullable CGColorSpaceRef)colorSpace forKey:(nonnull NSString *)key { -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE NSLog(@"Color space encoding is not supported on iOS. Decoding will return a generic RGB color space."); +#pragma clang diagnostic pop #else if ( colorSpace ) { - CFDataRef iccProfile = CGColorSpaceCopyICCProfile(colorSpace); + CFDataRef iccProfile = NULL; + + // CGColorSpaceCopyICCProfile() is deprecated as of macOS 10.13 + if ( CGColorSpaceCopyICCData ) { + iccProfile = CGColorSpaceCopyICCData(colorSpace); + } + else { + iccProfile = CGColorSpaceCopyICCProfile(colorSpace); + } + [self encodeObject:(__bridge NSData *)iccProfile forKey:key]; CFRelease(iccProfile); } @@ -87,9 +101,9 @@ -(void)encodeCGColorSpace:(CGColorSpaceRef)colorSpace forKey:(NSString *)key /// @cond -void CPTPathApplierFunc(void *info, const CGPathElement *element) +void CPTPathApplierFunc(void *__nullable info, const CGPathElement *__nonnull element) { - NSMutableDictionary *elementData = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *elementData = [[NSMutableDictionary alloc] init]; elementData[@"type"] = @(element->type); @@ -112,7 +126,7 @@ void CPTPathApplierFunc(void *info, const CGPathElement *element) break; } - NSMutableArray *pathData = (__bridge NSMutableArray *)info; + NSMutableArray *> *pathData = (__bridge NSMutableArray *> *)info; [pathData addObject:elementData]; } @@ -122,9 +136,9 @@ void CPTPathApplierFunc(void *info, const CGPathElement *element) * @param path The @ref CGPathRef to encode. * @param key The key to associate with the path. **/ --(void)encodeCGPath:(CGPathRef)path forKey:(NSString *)key +-(void)encodeCGPath:(nullable CGPathRef)path forKey:(nonnull NSString *)key { - NSMutableArray *pathData = [[NSMutableArray alloc] init]; + NSMutableArray *> *pathData = [[NSMutableArray alloc] init]; // walk the path and gather data for each element CGPathApply(path, (__bridge void *)(pathData), &CPTPathApplierFunc); @@ -136,9 +150,9 @@ -(void)encodeCGPath:(CGPathRef)path forKey:(NSString *)key // encode data elements for ( NSUInteger i = 0; i < dataCount; i++ ) { - NSDictionary *elementData = pathData[i]; + NSDictionary *elementData = pathData[i]; - CGPathElementType type = (CGPathElementType)[elementData[@"type"] intValue]; + CGPathElementType type = (CGPathElementType)elementData[@"type"].intValue; newKey = [[NSString alloc] initWithFormat:@"%@[%lu].type", key, (unsigned long)i]; [self encodeInt:type forKey:newKey]; @@ -175,7 +189,7 @@ -(void)encodeCGPath:(CGPathRef)path forKey:(NSString *)key * @param image The @ref CGImageRef to encode. * @param key The key to associate with the image. **/ --(void)encodeCGImage:(CGImageRef)image forKey:(NSString *)key +-(void)encodeCGImage:(nullable CGImageRef)image forKey:(nonnull NSString *)key { NSString *newKey = [[NSString alloc] initWithFormat:@"%@.width", key]; @@ -228,14 +242,14 @@ -(void)encodeCGImage:(CGImageRef)image forKey:(NSString *)key [self encodeBool:CGImageGetShouldInterpolate(image) forKey:newKey]; newKey = [[NSString alloc] initWithFormat:@"%@.renderingIntent", key]; - [self encodeInt:CGImageGetRenderingIntent(image) forKey:newKey]; + [self encodeInt32:CGImageGetRenderingIntent(image) forKey:newKey]; } /** @brief Encodes an @ref NSDecimal and associates it with the string @par{key}. * @param number The number to encode. * @param key The key to associate with the number. **/ --(void)encodeDecimal:(NSDecimal)number forKey:(NSString *)key +-(void)encodeDecimal:(NSDecimal)number forKey:(nonnull NSString *)key { [self encodeObject:[NSDecimalNumber decimalNumberWithDecimal:number] forKey:key]; } @@ -249,11 +263,10 @@ -(void)encodeDecimal:(NSDecimal)number forKey:(NSString *)key * @param key The key associated with the number. * @return The number as a @ref CGFloat. **/ --(CGFloat)decodeCGFloatForKey:(NSString *)key +-(CGFloat)decodeCGFloatForKey:(nonnull NSString *)key { #if CGFLOAT_IS_DOUBLE return [self decodeDoubleForKey:key]; - #else return [self decodeFloatForKey:key]; #endif @@ -265,7 +278,7 @@ -(CGFloat)decodeCGFloatForKey:(NSString *)key * @param key The key associated with the point. * @return The point. **/ --(CGPoint)decodeCPTPointForKey:(NSString *)key +-(CGPoint)decodeCPTPointForKey:(nonnull NSString *)key { CGPoint point; @@ -285,7 +298,7 @@ -(CGPoint)decodeCPTPointForKey:(NSString *)key * @param key The key associated with the size. * @return The size. **/ --(CGSize)decodeCPTSizeForKey:(NSString *)key +-(CGSize)decodeCPTSizeForKey:(nonnull NSString *)key { CGSize size; @@ -305,7 +318,7 @@ -(CGSize)decodeCPTSizeForKey:(NSString *)key * @param key The key associated with the rectangle. * @return The rectangle. **/ --(CGRect)decodeCPTRectForKey:(NSString *)key +-(CGRect)decodeCPTRectForKey:(nonnull NSString *)key { CGRect rect; @@ -326,17 +339,29 @@ -(CGRect)decodeCPTRectForKey:(NSString *)key * @return The new path. * @note The current implementation only works with named color spaces. **/ --(CGColorSpaceRef)newCGColorSpaceDecodeForKey:(NSString *)key +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#endif +-(nullable CGColorSpaceRef)newCGColorSpaceDecodeForKey:(nonnull NSString *)key { CGColorSpaceRef colorSpace = NULL; -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE +#if TARGET_OS_SIMULATOR || TARGET_OS_IPHONE NSLog(@"Color space decoding is not supported on iOS. Using generic RGB color space."); colorSpace = CGColorSpaceCreateDeviceRGB(); +#pragma clang diagnostic pop #else - NSData *iccProfile = [self decodeObjectForKey:key]; + NSData *iccProfile = [self decodeObjectOfClass:[NSData class] + forKey:key]; if ( iccProfile ) { - colorSpace = CGColorSpaceCreateWithICCProfile( (__bridge CFDataRef)iccProfile ); + // CGColorSpaceCreateWithICCProfile() is deprecated as of macOS 10.13 + if ( CGColorSpaceCreateWithICCData ) { + colorSpace = CGColorSpaceCreateWithICCData((__bridge CFDataRef)iccProfile); + } + else { + colorSpace = CGColorSpaceCreateWithICCProfile((__bridge CFDataRef)iccProfile); + } } else { NSLog(@"Color space not available for key '%@'. Using generic RGB color space.", key); @@ -353,18 +378,18 @@ -(CGColorSpaceRef)newCGColorSpaceDecodeForKey:(NSString *)key * @param key The key associated with the path. * @return The new path. **/ --(CGPathRef)newCGPathDecodeForKey:(NSString *)key +-(nullable CGPathRef)newCGPathDecodeForKey:(nonnull NSString *)key { CGMutablePathRef newPath = CGPathCreateMutable(); // decode count NSString *newKey = [[NSString alloc] initWithFormat:@"%@.count", key]; - NSUInteger count = (NSUInteger)[self decodeIntegerForKey : newKey]; + NSUInteger count = (NSUInteger)[self decodeIntegerForKey:newKey]; // decode elements for ( NSUInteger i = 0; i < count; i++ ) { newKey = [[NSString alloc] initWithFormat:@"%@[%lu].type", key, (unsigned long)i]; - CGPathElementType type = (CGPathElementType)[self decodeIntForKey : newKey]; + CGPathElementType type = (CGPathElementType)[self decodeIntForKey:newKey]; CGPoint point1 = CGPointZero; CGPoint point2 = CGPointZero; @@ -421,22 +446,22 @@ -(CGPathRef)newCGPathDecodeForKey:(NSString *)key * @param key The key associated with the image. * @return The new image. **/ --(CGImageRef)newCGImageDecodeForKey:(NSString *)key +-(nullable CGImageRef)newCGImageDecodeForKey:(nonnull NSString *)key { NSString *newKey = [[NSString alloc] initWithFormat:@"%@.width", key]; - size_t width = (size_t)[self decodeInt64ForKey : newKey]; + size_t width = (size_t)[self decodeInt64ForKey:newKey]; newKey = [[NSString alloc] initWithFormat:@"%@.height", key]; - size_t height = (size_t)[self decodeInt64ForKey : newKey]; + size_t height = (size_t)[self decodeInt64ForKey:newKey]; newKey = [[NSString alloc] initWithFormat:@"%@.bitsPerComponent", key]; - size_t bitsPerComponent = (size_t)[self decodeInt64ForKey : newKey]; + size_t bitsPerComponent = (size_t)[self decodeInt64ForKey:newKey]; newKey = [[NSString alloc] initWithFormat:@"%@.bitsPerPixel", key]; - size_t bitsPerPixel = (size_t)[self decodeInt64ForKey : newKey]; + size_t bitsPerPixel = (size_t)[self decodeInt64ForKey:newKey]; newKey = [[NSString alloc] initWithFormat:@"%@.bytesPerRow", key]; - size_t bytesPerRow = (size_t)[self decodeInt64ForKey : newKey]; + size_t bytesPerRow = (size_t)[self decodeInt64ForKey:newKey]; newKey = [[NSString alloc] initWithFormat:@"%@.colorSpace", key]; CGColorSpaceRef colorSpace = [self newCGColorSpaceDecodeForKey:newKey]; @@ -446,14 +471,15 @@ -(CGImageRef)newCGImageDecodeForKey:(NSString *)key const CGBitmapInfo *bitmapInfo = (const void *)[self decodeBytesForKey:newKey returnedLength:&length]; newKey = [[NSString alloc] initWithFormat:@"%@.provider", key]; - CGDataProviderRef provider = CGDataProviderCreateWithCFData( (__bridge CFDataRef)[self decodeObjectForKey:newKey] ); + CGDataProviderRef provider = CGDataProviderCreateWithCFData((__bridge CFDataRef)[self decodeObjectOfClass:[NSData class] + forKey:newKey]); newKey = [[NSString alloc] initWithFormat:@"%@.numberOfComponents", key]; - size_t numberOfComponents = (size_t)[self decodeInt64ForKey : newKey]; + size_t numberOfComponents = (size_t)[self decodeInt64ForKey:newKey]; CGFloat *decodeArray = NULL; if ( numberOfComponents ) { - decodeArray = malloc( numberOfComponents * 2 * sizeof(CGFloat) ); + decodeArray = calloc((numberOfComponents * 2), sizeof(CGFloat)); for ( size_t i = 0; i < numberOfComponents; i++ ) { newKey = [[NSString alloc] initWithFormat:@"%@.decode[%zu].lower", key, i]; @@ -468,7 +494,7 @@ -(CGImageRef)newCGImageDecodeForKey:(NSString *)key bool shouldInterpolate = [self decodeBoolForKey:newKey]; newKey = [[NSString alloc] initWithFormat:@"%@.renderingIntent", key]; - CGColorRenderingIntent intent = (CGColorRenderingIntent)[self decodeIntForKey : newKey]; + CGColorRenderingIntent intent = (CGColorRenderingIntent)[self decodeInt32ForKey:newKey]; CGImageRef newImage = CGImageCreate(width, height, @@ -497,14 +523,15 @@ -(CGImageRef)newCGImageDecodeForKey:(NSString *)key * @param key The key associated with the number. * @return The number as an @ref NSDecimal. **/ --(NSDecimal)decodeDecimalForKey:(NSString *)key +-(NSDecimal)decodeDecimalForKey:(nonnull NSString *)key { NSDecimal result; - NSNumber *number = [self decodeObjectForKey:key]; + NSNumber *number = [self decodeObjectOfClass:[NSDecimalNumber class] + forKey:key]; if ( [number respondsToSelector:@selector(decimalValue)] ) { - result = [number decimalValue]; + result = number.decimalValue; } else { result = CPTDecimalNaN(); diff --git a/framework/Source/NSDecimalNumberExtensions.h b/framework/Source/NSDecimalNumberExtensions.h index d0e48e815..1d41a0eb5 100644 --- a/framework/Source/NSDecimalNumberExtensions.h +++ b/framework/Source/NSDecimalNumberExtensions.h @@ -3,4 +3,6 @@ **/ @interface NSDecimalNumber(CPTExtensions) +-(nonnull NSDecimalNumber *)decimalNumber; + @end diff --git a/framework/Source/NSDecimalNumberExtensions.m b/framework/Source/NSDecimalNumberExtensions.m index e096ef023..b27563037 100644 --- a/framework/Source/NSDecimalNumberExtensions.m +++ b/framework/Source/NSDecimalNumberExtensions.m @@ -5,7 +5,7 @@ @implementation NSDecimalNumber(CPTExtensions) /** @brief Returns the value of the receiver as an NSDecimalNumber. * @return The value of the receiver as an NSDecimalNumber. **/ --(NSDecimalNumber *)decimalNumber +-(nonnull NSDecimalNumber *)decimalNumber { return [self copy]; } diff --git a/framework/Source/NSNumberExtensions.h b/framework/Source/NSNumberExtensions.h index bd1ad6b6b..06d0bb9e4 100644 --- a/framework/Source/NSNumberExtensions.h +++ b/framework/Source/NSNumberExtensions.h @@ -3,11 +3,11 @@ **/ @interface NSNumber(CPTExtensions) -+(instancetype)numberWithCGFloat:(CGFloat)number; ++(nonnull instancetype)numberWithCGFloat:(CGFloat)number; -(CGFloat)cgFloatValue; --(instancetype)initWithCGFloat:(CGFloat)number; +-(nonnull instancetype)initWithCGFloat:(CGFloat)number; --(NSDecimalNumber *)decimalNumber; +-(nonnull NSDecimalNumber *)decimalNumber; @end diff --git a/framework/Source/NSNumberExtensions.m b/framework/Source/NSNumberExtensions.m index 3f795af9a..a9ee47ab0 100644 --- a/framework/Source/NSNumberExtensions.m +++ b/framework/Source/NSNumberExtensions.m @@ -6,7 +6,7 @@ @implementation NSNumber(CPTExtensions) * @param number The value for the new number. * @return An NSNumber object containing value, treating it as a @ref CGFloat. **/ -+(instancetype)numberWithCGFloat:(CGFloat)number ++(nonnull instancetype)numberWithCGFloat:(CGFloat)number { return @(number); } @@ -17,8 +17,7 @@ +(instancetype)numberWithCGFloat:(CGFloat)number -(CGFloat)cgFloatValue { #if CGFLOAT_IS_DOUBLE - return [self doubleValue]; - + return self.doubleValue; #else return [self floatValue]; #endif @@ -28,11 +27,10 @@ -(CGFloat)cgFloatValue * @param number The value for the new number. * @return An NSNumber object containing value, treating it as a @ref CGFloat. **/ --(instancetype)initWithCGFloat:(CGFloat)number +-(nonnull instancetype)initWithCGFloat:(CGFloat)number { #if CGFLOAT_IS_DOUBLE return [self initWithDouble:number]; - #else return [self initWithFloat:number]; #endif @@ -41,12 +39,12 @@ -(instancetype)initWithCGFloat:(CGFloat)number /** @brief Returns the value of the receiver as an NSDecimalNumber. * @return The value of the receiver as an NSDecimalNumber. **/ --(NSDecimalNumber *)decimalNumber +-(nonnull NSDecimalNumber *)decimalNumber { if ( [self isMemberOfClass:[NSDecimalNumber class]] ) { return (NSDecimalNumber *)self; } - return [NSDecimalNumber decimalNumberWithDecimal:[self decimalValue]]; + return [NSDecimalNumber decimalNumberWithDecimal:self.decimalValue]; } @end diff --git a/framework/Source/_CPTAnimationCGFloatPeriod.m b/framework/Source/_CPTAnimationCGFloatPeriod.m index 9f31b267e..1bcf82cea 100644 --- a/framework/Source/_CPTAnimationCGFloatPeriod.m +++ b/framework/Source/_CPTAnimationCGFloatPeriod.m @@ -5,7 +5,7 @@ /// @cond @interface _CPTAnimationCGFloatPeriod() -CGFloat CPTCurrentFloatValue(id boundObject, SEL boundGetter); +CGFloat CPTCurrentFloatValue(id __nonnull boundObject, SEL __nonnull boundGetter); @end /// @endcond @@ -14,12 +14,12 @@ @interface _CPTAnimationCGFloatPeriod() @implementation _CPTAnimationCGFloatPeriod -CGFloat CPTCurrentFloatValue(id boundObject, SEL boundGetter) +CGFloat CPTCurrentFloatValue(id __nonnull boundObject, SEL __nonnull boundGetter) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[boundObject methodSignatureForSelector:boundGetter]]; - [invocation setTarget:boundObject]; - [invocation setSelector:boundGetter]; + invocation.target = boundObject; + invocation.selector = boundGetter; [invocation invoke]; @@ -29,12 +29,12 @@ CGFloat CPTCurrentFloatValue(id boundObject, SEL boundGetter) return value; } --(void)setStartValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(void)setStartValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter { - self.startValue = @( CPTCurrentFloatValue(boundObject, boundGetter) ); + self.startValue = @(CPTCurrentFloatValue(boundObject, boundGetter)); } --(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter { CGFloat current = CPTCurrentFloatValue(boundObject, boundGetter); CGFloat start; @@ -47,10 +47,10 @@ -(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGett [self.startValue getValue:&start]; [self.endValue getValue:&end]; - return ( (current >= start) && (current <= end) ) || ( (current >= end) && (current <= start) ); + return ((current >= start) && (current <= end)) || ((current >= end) && (current <= start)); } --(NSValue *)tweenedValueForProgress:(CGFloat)progress +-(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress { CGFloat start; CGFloat end; diff --git a/framework/Source/_CPTAnimationCGPointPeriod.m b/framework/Source/_CPTAnimationCGPointPeriod.m index b6acc22d1..bb6246379 100644 --- a/framework/Source/_CPTAnimationCGPointPeriod.m +++ b/framework/Source/_CPTAnimationCGPointPeriod.m @@ -3,7 +3,7 @@ /// @cond @interface _CPTAnimationCGPointPeriod() -CGPoint CPTCurrentPointValue(id boundObject, SEL boundGetter); +CGPoint CPTCurrentPointValue(id __nonnull boundObject, SEL __nonnull boundGetter); @end /// @endcond @@ -12,12 +12,12 @@ @interface _CPTAnimationCGPointPeriod() @implementation _CPTAnimationCGPointPeriod -CGPoint CPTCurrentPointValue(id boundObject, SEL boundGetter) +CGPoint CPTCurrentPointValue(id __nonnull boundObject, SEL __nonnull boundGetter) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[boundObject methodSignatureForSelector:boundGetter]]; - [invocation setTarget:boundObject]; - [invocation setSelector:boundGetter]; + invocation.target = boundObject; + invocation.selector = boundGetter; [invocation invoke]; @@ -27,14 +27,14 @@ CGPoint CPTCurrentPointValue(id boundObject, SEL boundGetter) return value; } --(void)setStartValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(void)setStartValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter { CGPoint start = CPTCurrentPointValue(boundObject, boundGetter); self.startValue = [NSValue valueWithBytes:&start objCType:@encode(CGPoint)]; } --(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter { CGPoint current = CPTCurrentPointValue(boundObject, boundGetter); CGPoint start; @@ -47,11 +47,11 @@ -(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGett [self.startValue getValue:&start]; [self.endValue getValue:&end]; - return ( ( (current.x >= start.x) && (current.x <= end.x) ) || ( (current.x >= end.x) && (current.x <= start.x) ) ) && - ( ( (current.y >= start.y) && (current.y <= end.y) ) || ( (current.y >= end.y) && (current.y <= start.y) ) ); + return (((current.x >= start.x) && (current.x <= end.x)) || ((current.x >= end.x) && (current.x <= start.x))) && + (((current.y >= start.y) && (current.y <= end.y)) || ((current.y >= end.y) && (current.y <= start.y))); } --(NSValue *)tweenedValueForProgress:(CGFloat)progress +-(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress { CGPoint start; CGPoint end; diff --git a/framework/Source/_CPTAnimationCGRectPeriod.m b/framework/Source/_CPTAnimationCGRectPeriod.m index 06a861db2..1e05bf9b8 100644 --- a/framework/Source/_CPTAnimationCGRectPeriod.m +++ b/framework/Source/_CPTAnimationCGRectPeriod.m @@ -3,7 +3,7 @@ /// @cond @interface _CPTAnimationCGRectPeriod() -CGRect CPTCurrentRectValue(id boundObject, SEL boundGetter); +CGRect CPTCurrentRectValue(id __nonnull boundObject, SEL __nonnull boundGetter); @end /// @endcond @@ -12,12 +12,12 @@ @interface _CPTAnimationCGRectPeriod() @implementation _CPTAnimationCGRectPeriod -CGRect CPTCurrentRectValue(id boundObject, SEL boundGetter) +CGRect CPTCurrentRectValue(id __nonnull boundObject, SEL __nonnull boundGetter) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[boundObject methodSignatureForSelector:boundGetter]]; - [invocation setTarget:boundObject]; - [invocation setSelector:boundGetter]; + invocation.target = boundObject; + invocation.selector = boundGetter; [invocation invoke]; @@ -27,14 +27,14 @@ CGRect CPTCurrentRectValue(id boundObject, SEL boundGetter) return value; } --(void)setStartValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(void)setStartValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter { CGRect start = CPTCurrentRectValue(boundObject, boundGetter); self.startValue = [NSValue valueWithBytes:&start objCType:@encode(CGRect)]; } --(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter { CGRect current = CPTCurrentRectValue(boundObject, boundGetter); CGRect start; @@ -47,13 +47,13 @@ -(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGett [self.startValue getValue:&start]; [self.endValue getValue:&end]; - return ( ( (current.origin.x >= start.origin.x) && (current.origin.x <= end.origin.x) ) || ( (current.origin.x >= end.origin.x) && (current.origin.x <= start.origin.x) ) ) && - ( ( (current.origin.y >= start.origin.y) && (current.origin.y <= end.origin.y) ) || ( (current.origin.y >= end.origin.y) && (current.origin.y <= start.origin.y) ) ) && - ( ( (current.size.width >= start.size.width) && (current.size.width <= end.size.width) ) || ( (current.size.width >= end.size.width) && (current.size.width <= start.size.width) ) ) && - ( ( (current.size.height >= start.size.height) && (current.size.height <= end.size.height) ) || ( (current.size.height >= end.size.height) && (current.size.height <= start.size.height) ) ); + return (((current.origin.x >= start.origin.x) && (current.origin.x <= end.origin.x)) || ((current.origin.x >= end.origin.x) && (current.origin.x <= start.origin.x))) && + (((current.origin.y >= start.origin.y) && (current.origin.y <= end.origin.y)) || ((current.origin.y >= end.origin.y) && (current.origin.y <= start.origin.y))) && + (((current.size.width >= start.size.width) && (current.size.width <= end.size.width)) || ((current.size.width >= end.size.width) && (current.size.width <= start.size.width))) && + (((current.size.height >= start.size.height) && (current.size.height <= end.size.height)) || ((current.size.height >= end.size.height) && (current.size.height <= start.size.height))); } --(NSValue *)tweenedValueForProgress:(CGFloat)progress +-(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress { CGRect start; CGRect end; diff --git a/framework/Source/_CPTAnimationCGSizePeriod.m b/framework/Source/_CPTAnimationCGSizePeriod.m index 02784bbca..e0b54f48e 100644 --- a/framework/Source/_CPTAnimationCGSizePeriod.m +++ b/framework/Source/_CPTAnimationCGSizePeriod.m @@ -3,7 +3,7 @@ /// @cond @interface _CPTAnimationCGSizePeriod() -CGSize CPTCurrentSizeValue(id boundObject, SEL boundGetter); +CGSize CPTCurrentSizeValue(id __nonnull boundObject, SEL __nonnull boundGetter); @end /// @endcond @@ -12,12 +12,12 @@ @interface _CPTAnimationCGSizePeriod() @implementation _CPTAnimationCGSizePeriod -CGSize CPTCurrentSizeValue(id boundObject, SEL boundGetter) +CGSize CPTCurrentSizeValue(id __nonnull boundObject, SEL __nonnull boundGetter) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[boundObject methodSignatureForSelector:boundGetter]]; - [invocation setTarget:boundObject]; - [invocation setSelector:boundGetter]; + invocation.target = boundObject; + invocation.selector = boundGetter; [invocation invoke]; @@ -27,14 +27,14 @@ CGSize CPTCurrentSizeValue(id boundObject, SEL boundGetter) return value; } --(void)setStartValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(void)setStartValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter { CGSize start = CPTCurrentSizeValue(boundObject, boundGetter); self.startValue = [NSValue valueWithBytes:&start objCType:@encode(CGSize)]; } --(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter { CGSize current = CPTCurrentSizeValue(boundObject, boundGetter); CGSize start; @@ -47,11 +47,11 @@ -(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGett [self.startValue getValue:&start]; [self.endValue getValue:&end]; - return ( ( (current.width >= start.width) && (current.width <= end.width) ) || ( (current.width >= end.width) && (current.width <= start.width) ) ) && - ( ( (current.height >= start.height) && (current.height <= end.height) ) || ( (current.height >= end.height) && (current.height <= start.height) ) ); + return (((current.width >= start.width) && (current.width <= end.width)) || ((current.width >= end.width) && (current.width <= start.width))) && + (((current.height >= start.height) && (current.height <= end.height)) || ((current.height >= end.height) && (current.height <= start.height))); } --(NSValue *)tweenedValueForProgress:(CGFloat)progress +-(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress { CGSize start; CGSize end; diff --git a/framework/Source/_CPTAnimationNSDecimalPeriod.m b/framework/Source/_CPTAnimationNSDecimalPeriod.m index b6ec08820..bcf36e651 100644 --- a/framework/Source/_CPTAnimationNSDecimalPeriod.m +++ b/framework/Source/_CPTAnimationNSDecimalPeriod.m @@ -5,7 +5,7 @@ /// @cond @interface _CPTAnimationNSDecimalPeriod() -NSDecimal CPTCurrentDecimalValue(id boundObject, SEL boundGetter); +NSDecimal CPTCurrentDecimalValue(id __nonnull boundObject, SEL __nonnull boundGetter); @end /// @endcond @@ -14,12 +14,12 @@ @interface _CPTAnimationNSDecimalPeriod() @implementation _CPTAnimationNSDecimalPeriod -NSDecimal CPTCurrentDecimalValue(id boundObject, SEL boundGetter) +NSDecimal CPTCurrentDecimalValue(id __nonnull boundObject, SEL __nonnull boundGetter) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[boundObject methodSignatureForSelector:boundGetter]]; - [invocation setTarget:boundObject]; - [invocation setSelector:boundGetter]; + invocation.target = boundObject; + invocation.selector = boundGetter; [invocation invoke]; @@ -29,34 +29,34 @@ NSDecimal CPTCurrentDecimalValue(id boundObject, SEL boundGetter) return value; } --(void)setStartValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(void)setStartValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter { NSDecimal start = CPTCurrentDecimalValue(boundObject, boundGetter); self.startValue = [NSDecimalNumber decimalNumberWithDecimal:start]; } --(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter { if ( !self.startValue ) { [self setStartValueFromObject:boundObject propertyGetter:boundGetter]; } NSDecimal current = CPTCurrentDecimalValue(boundObject, boundGetter); - NSDecimal start = [(NSDecimalNumber *)self.startValue decimalValue]; - NSDecimal end = [(NSDecimalNumber *)self.endValue decimalValue]; + NSDecimal start = ((NSDecimalNumber *)self.startValue).decimalValue; + NSDecimal end = ((NSDecimalNumber *)self.endValue).decimalValue; - return ( CPTDecimalGreaterThanOrEqualTo(current, start) && CPTDecimalLessThanOrEqualTo(current, end) ) || - ( CPTDecimalGreaterThanOrEqualTo(current, end) && CPTDecimalLessThanOrEqualTo(current, start) ); + return (CPTDecimalGreaterThanOrEqualTo(current, start) && CPTDecimalLessThanOrEqualTo(current, end)) || + (CPTDecimalGreaterThanOrEqualTo(current, end) && CPTDecimalLessThanOrEqualTo(current, start)); } --(NSValue *)tweenedValueForProgress:(CGFloat)progress +-(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress { - NSDecimal start = [(NSDecimalNumber *)self.startValue decimalValue]; - NSDecimal end = [(NSDecimalNumber *)self.endValue decimalValue]; + NSDecimal start = ((NSDecimalNumber *)self.startValue).decimalValue; + NSDecimal end = ((NSDecimalNumber *)self.endValue).decimalValue; NSDecimal length = CPTDecimalSubtract(end, start); - NSDecimal tweenedValue = CPTDecimalAdd( start, CPTDecimalMultiply(CPTDecimalFromCGFloat(progress), length) ); + NSDecimal tweenedValue = CPTDecimalAdd(start, CPTDecimalMultiply(CPTDecimalFromCGFloat(progress), length)); return [NSDecimalNumber decimalNumberWithDecimal:tweenedValue]; } diff --git a/framework/Source/_CPTAnimationNSNumberPeriod.h b/framework/Source/_CPTAnimationNSNumberPeriod.h new file mode 100644 index 000000000..dfe744ba3 --- /dev/null +++ b/framework/Source/_CPTAnimationNSNumberPeriod.h @@ -0,0 +1,5 @@ +#import "CPTAnimationPeriod.h" + +@interface _CPTAnimationNSNumberPeriod : CPTAnimationPeriod + +@end diff --git a/framework/Source/_CPTAnimationNSNumberPeriod.m b/framework/Source/_CPTAnimationNSNumberPeriod.m new file mode 100644 index 000000000..e4692f041 --- /dev/null +++ b/framework/Source/_CPTAnimationNSNumberPeriod.m @@ -0,0 +1,74 @@ +#import "_CPTAnimationNSNumberPeriod.h" + +#import "CPTUtilities.h" + +@implementation _CPTAnimationNSNumberPeriod + +-(void)setStartValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +{ + typedef NSNumber *(*GetterType)(id, SEL); + GetterType getterMethod = (GetterType)[boundObject methodForSelector:boundGetter]; + + self.startValue = getterMethod(boundObject, boundGetter); +} + +-(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +{ + if ( !self.startValue ) { + [self setStartValueFromObject:boundObject propertyGetter:boundGetter]; + } + + typedef NSNumber *(*GetterType)(id, SEL); + GetterType getterMethod = (GetterType)[boundObject methodForSelector:boundGetter]; + + NSNumber *current = getterMethod(boundObject, boundGetter); + NSNumber *start = (NSNumber *)self.startValue; + NSNumber *end = (NSNumber *)self.endValue; + + Class decimalClass = [NSDecimalNumber class]; + + if ( [start isKindOfClass:decimalClass] || [end isKindOfClass:decimalClass] ) { + NSDecimal currentDecimal = current.decimalValue; + NSDecimal startDecimal = start.decimalValue; + NSDecimal endDecimal = end.decimalValue; + + return (CPTDecimalGreaterThanOrEqualTo(currentDecimal, startDecimal) && CPTDecimalLessThanOrEqualTo(currentDecimal, endDecimal)) || + (CPTDecimalGreaterThanOrEqualTo(currentDecimal, endDecimal) && CPTDecimalLessThanOrEqualTo(currentDecimal, startDecimal)); + } + else { + double currentDouble = current.doubleValue; + double startDouble = start.doubleValue; + double endDouble = end.doubleValue; + + return ((currentDouble >= startDouble) && (currentDouble <= endDouble)) || + ((currentDouble >= endDouble) && (currentDouble <= startDouble)); + } +} + +-(NSValue *)tweenedValueForProgress:(CGFloat)progress +{ + NSNumber *start = (NSNumber *)self.startValue; + NSNumber *end = (NSNumber *)self.endValue; + + Class decimalClass = [NSDecimalNumber class]; + + if ( [start isKindOfClass:decimalClass] || [end isKindOfClass:decimalClass] ) { + NSDecimal startDecimal = start.decimalValue; + NSDecimal endDecimal = end.decimalValue; + + NSDecimal length = CPTDecimalSubtract(endDecimal, startDecimal); + NSDecimal tweenedValue = CPTDecimalAdd(startDecimal, CPTDecimalMultiply(CPTDecimalFromCGFloat(progress), length)); + + return [NSDecimalNumber decimalNumberWithDecimal:tweenedValue]; + } + else { + double startDouble = start.doubleValue; + double endDouble = end.doubleValue; + + double tweenedValue = startDouble + (double)progress * (endDouble - startDouble); + + return @(tweenedValue); + } +} + +@end diff --git a/framework/Source/_CPTAnimationPlotRangePeriod.m b/framework/Source/_CPTAnimationPlotRangePeriod.m index c2f3af060..857d65506 100644 --- a/framework/Source/_CPTAnimationPlotRangePeriod.m +++ b/framework/Source/_CPTAnimationPlotRangePeriod.m @@ -5,49 +5,49 @@ @implementation _CPTAnimationPlotRangePeriod --(void)setStartValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(void)setStartValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter { typedef NSValue *(*GetterType)(id, SEL); - GetterType getterMethod = (GetterType)[boundObject methodForSelector : boundGetter]; + GetterType getterMethod = (GetterType)[boundObject methodForSelector:boundGetter]; self.startValue = getterMethod(boundObject, boundGetter); } --(BOOL)canStartWithValueFromObject:(id)boundObject propertyGetter:(SEL)boundGetter +-(BOOL)canStartWithValueFromObject:(nonnull id)boundObject propertyGetter:(nonnull SEL)boundGetter { if ( !self.startValue ) { [self setStartValueFromObject:boundObject propertyGetter:boundGetter]; } typedef CPTPlotRange *(*GetterType)(id, SEL); - GetterType getterMethod = (GetterType)[boundObject methodForSelector : boundGetter]; + GetterType getterMethod = (GetterType)[boundObject methodForSelector:boundGetter]; CPTPlotRange *current = getterMethod(boundObject, boundGetter); CPTPlotRange *start = (CPTPlotRange *)self.startValue; CPTPlotRange *end = (CPTPlotRange *)self.endValue; - NSDecimal currentLoc = current.location; - NSDecimal startLoc = start.location; - NSDecimal endLoc = end.location; + NSDecimal currentLoc = current.locationDecimal; + NSDecimal startLoc = start.locationDecimal; + NSDecimal endLoc = end.locationDecimal; - return ( CPTDecimalGreaterThanOrEqualTo(currentLoc, startLoc) && CPTDecimalLessThanOrEqualTo(currentLoc, endLoc) ) || - ( CPTDecimalGreaterThanOrEqualTo(currentLoc, endLoc) && CPTDecimalLessThanOrEqualTo(currentLoc, startLoc) ); + return (CPTDecimalGreaterThanOrEqualTo(currentLoc, startLoc) && CPTDecimalLessThanOrEqualTo(currentLoc, endLoc)) || + (CPTDecimalGreaterThanOrEqualTo(currentLoc, endLoc) && CPTDecimalLessThanOrEqualTo(currentLoc, startLoc)); } --(NSValue *)tweenedValueForProgress:(CGFloat)progress +-(nonnull NSValue *)tweenedValueForProgress:(CGFloat)progress { CPTPlotRange *start = (CPTPlotRange *)self.startValue; CPTPlotRange *end = (CPTPlotRange *)self.endValue; NSDecimal progressDecimal = CPTDecimalFromCGFloat(progress); - NSDecimal locationDiff = CPTDecimalSubtract(end.location, start.location); - NSDecimal tweenedLocation = CPTDecimalAdd( start.location, CPTDecimalMultiply(progressDecimal, locationDiff) ); + NSDecimal locationDiff = CPTDecimalSubtract(end.locationDecimal, start.locationDecimal); + NSDecimal tweenedLocation = CPTDecimalAdd(start.locationDecimal, CPTDecimalMultiply(progressDecimal, locationDiff)); - NSDecimal lengthDiff = CPTDecimalSubtract(end.length, start.length); - NSDecimal tweenedLength = CPTDecimalAdd( start.length, CPTDecimalMultiply(progressDecimal, lengthDiff) ); + NSDecimal lengthDiff = CPTDecimalSubtract(end.lengthDecimal, start.lengthDecimal); + NSDecimal tweenedLength = CPTDecimalAdd(start.lengthDecimal, CPTDecimalMultiply(progressDecimal, lengthDiff)); - return (NSValue *)[CPTPlotRange plotRangeWithLocation:tweenedLocation length:tweenedLength]; + return (NSValue *)[CPTPlotRange plotRangeWithLocationDecimal:tweenedLocation lengthDecimal:tweenedLength]; } @end diff --git a/framework/Source/_CPTAnimationTimingFunctions.m b/framework/Source/_CPTAnimationTimingFunctions.m index f43c7f84b..36b20aa6e 100644 --- a/framework/Source/_CPTAnimationTimingFunctions.m +++ b/framework/Source/_CPTAnimationTimingFunctions.m @@ -15,13 +15,13 @@ **/ CGFloat CPTAnimationTimingFunctionLinear(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -41,17 +41,17 @@ CGFloat CPTAnimationTimingFunctionBackIn(CGFloat elapsedTime, CGFloat duration) { const CGFloat s = CPTFloat(1.70158); - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return elapsedTime * elapsedTime * ( ( s + CPTFloat(1.0) ) * elapsedTime - s ); + return elapsedTime * elapsedTime * ((s + CPTFloat(1.0)) * elapsedTime - s); } /** @@ -64,17 +64,17 @@ CGFloat CPTAnimationTimingFunctionBackOut(CGFloat elapsedTime, CGFloat duration) { const CGFloat s = CPTFloat(1.70158); - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime = elapsedTime / duration - CPTFloat(1.0); - if ( elapsedTime >= CPTFloat(0.0) ) { + if ( elapsedTime >= CPTFloat(0.0)) { return CPTFloat(1.0); } - return elapsedTime * elapsedTime * ( ( s + CPTFloat(1.0) ) * elapsedTime + s ) + CPTFloat(1.0); + return elapsedTime * elapsedTime * ((s + CPTFloat(1.0)) * elapsedTime + s) + CPTFloat(1.0); } /** @@ -87,23 +87,23 @@ CGFloat CPTAnimationTimingFunctionBackInOut(CGFloat elapsedTime, CGFloat duratio { const CGFloat s = CPTFloat(1.70158 * 1.525); - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0) ) { - return CPTFloat(0.5) * ( elapsedTime * elapsedTime * ( ( s + CPTFloat(1.0) ) * elapsedTime - s ) ); + if ( elapsedTime < CPTFloat(1.0)) { + return CPTFloat(0.5) * (elapsedTime * elapsedTime * ((s + CPTFloat(1.0)) * elapsedTime - s)); } else { elapsedTime -= CPTFloat(2.0); - return CPTFloat(0.5) * ( elapsedTime * elapsedTime * ( ( s + CPTFloat(1.0) ) * elapsedTime + s ) + CPTFloat(2.0) ); + return CPTFloat(0.5) * (elapsedTime * elapsedTime * ((s + CPTFloat(1.0)) * elapsedTime + s) + CPTFloat(2.0)); } } @@ -129,25 +129,25 @@ CGFloat CPTAnimationTimingFunctionBounceIn(CGFloat elapsedTime, CGFloat duration **/ CGFloat CPTAnimationTimingFunctionBounceOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0 / 2.75) ) { + if ( elapsedTime < CPTFloat(1.0 / 2.75)) { return CPTFloat(7.5625) * elapsedTime * elapsedTime; } - else if ( elapsedTime < CPTFloat(2.0 / 2.75) ) { + else if ( elapsedTime < CPTFloat(2.0 / 2.75)) { elapsedTime -= CPTFloat(1.5 / 2.75); return CPTFloat(7.5625) * elapsedTime * elapsedTime + CPTFloat(0.75); } - else if ( elapsedTime < CPTFloat(2.5 / 2.75) ) { + else if ( elapsedTime < CPTFloat(2.5 / 2.75)) { elapsedTime -= CPTFloat(2.25 / 2.75); return CPTFloat(7.5625) * elapsedTime * elapsedTime + CPTFloat(0.9375); @@ -167,7 +167,7 @@ CGFloat CPTAnimationTimingFunctionBounceOut(CGFloat elapsedTime, CGFloat duratio **/ CGFloat CPTAnimationTimingFunctionBounceInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime < duration * CPTFloat(0.5) ) { + if ( elapsedTime < duration * CPTFloat(0.5)) { return CPTAnimationTimingFunctionBounceIn(elapsedTime * CPTFloat(2.0), duration) * CPTFloat(0.5); } else { @@ -187,17 +187,17 @@ CGFloat CPTAnimationTimingFunctionBounceInOut(CGFloat elapsedTime, CGFloat durat **/ CGFloat CPTAnimationTimingFunctionCircularIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return -( sqrt(CPTFloat(1.0) - elapsedTime * elapsedTime) - CPTFloat(1.0) ); + return -(sqrt(CPTFloat(1.0) - elapsedTime * elapsedTime) - CPTFloat(1.0)); } /** @@ -208,13 +208,13 @@ CGFloat CPTAnimationTimingFunctionCircularIn(CGFloat elapsedTime, CGFloat durati **/ CGFloat CPTAnimationTimingFunctionCircularOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime = elapsedTime / duration - CPTFloat(1.0); - if ( elapsedTime >= CPTFloat(0.0) ) { + if ( elapsedTime >= CPTFloat(0.0)) { return CPTFloat(1.0); } @@ -229,23 +229,23 @@ CGFloat CPTAnimationTimingFunctionCircularOut(CGFloat elapsedTime, CGFloat durat **/ CGFloat CPTAnimationTimingFunctionCircularInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0) ) { - return CPTFloat(-0.5) * ( sqrt(CPTFloat(1.0) - elapsedTime * elapsedTime) - CPTFloat(1.0) ); + if ( elapsedTime < CPTFloat(1.0)) { + return CPTFloat(-0.5) * (sqrt(CPTFloat(1.0) - elapsedTime * elapsedTime) - CPTFloat(1.0)); } else { elapsedTime -= CPTFloat(2.0); - return CPTFloat(0.5) * ( sqrt(CPTFloat(1.0) - elapsedTime * elapsedTime) + CPTFloat(1.0) ); + return CPTFloat(0.5) * (sqrt(CPTFloat(1.0) - elapsedTime * elapsedTime) + CPTFloat(1.0)); } } @@ -260,13 +260,13 @@ CGFloat CPTAnimationTimingFunctionCircularInOut(CGFloat elapsedTime, CGFloat dur **/ CGFloat CPTAnimationTimingFunctionElasticIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -275,7 +275,7 @@ CGFloat CPTAnimationTimingFunctionElasticIn(CGFloat elapsedTime, CGFloat duratio elapsedTime -= CPTFloat(1.0); - return -( pow(CPTFloat(2.0), CPTFloat(10.0) * elapsedTime) * sin( (elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period ) ); + return -(pow(CPTFloat(2.0), CPTFloat(10.0) * elapsedTime) * sin((elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period)); } /** @@ -286,20 +286,20 @@ CGFloat CPTAnimationTimingFunctionElasticIn(CGFloat elapsedTime, CGFloat duratio **/ CGFloat CPTAnimationTimingFunctionElasticOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } CGFloat period = duration * CPTFloat(0.3); CGFloat s = period * CPTFloat(0.25); - return pow(CPTFloat(2.0), CPTFloat(-10.0) * elapsedTime) * sin( (elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period ) + CPTFloat(1.0); + return pow(CPTFloat(2.0), CPTFloat(-10.0) * elapsedTime) * sin((elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period) + CPTFloat(1.0); } /** @@ -310,13 +310,13 @@ CGFloat CPTAnimationTimingFunctionElasticOut(CGFloat elapsedTime, CGFloat durati **/ CGFloat CPTAnimationTimingFunctionElasticInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } @@ -325,11 +325,11 @@ CGFloat CPTAnimationTimingFunctionElasticInOut(CGFloat elapsedTime, CGFloat dura elapsedTime -= CPTFloat(1.0); - if ( elapsedTime < CPTFloat(0.0) ) { - return CPTFloat(-0.5) * ( pow(CPTFloat(2.0), CPTFloat(10.0) * elapsedTime) * sin( (elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period ) ); + if ( elapsedTime < CPTFloat(0.0)) { + return CPTFloat(-0.5) * (pow(CPTFloat(2.0), CPTFloat(10.0) * elapsedTime) * sin((elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period)); } else { - return pow(CPTFloat(2.0), CPTFloat(-10.0) * elapsedTime) * sin( (elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period ) * CPTFloat(0.5) + CPTFloat(1.0); + return pow(CPTFloat(2.0), CPTFloat(-10.0) * elapsedTime) * sin((elapsedTime * duration - s) * CPTFloat(2.0 * M_PI) / period) * CPTFloat(0.5) + CPTFloat(1.0); } } @@ -344,17 +344,17 @@ CGFloat CPTAnimationTimingFunctionElasticInOut(CGFloat elapsedTime, CGFloat dura **/ CGFloat CPTAnimationTimingFunctionExponentialIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return pow( CPTFloat(2.0), CPTFloat(10.0) * ( elapsedTime - CPTFloat(1.0) ) ); + return pow(CPTFloat(2.0), CPTFloat(10.0) * (elapsedTime - CPTFloat(1.0))); } /** @@ -365,13 +365,13 @@ CGFloat CPTAnimationTimingFunctionExponentialIn(CGFloat elapsedTime, CGFloat dur **/ CGFloat CPTAnimationTimingFunctionExponentialOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -386,22 +386,22 @@ CGFloat CPTAnimationTimingFunctionExponentialOut(CGFloat elapsedTime, CGFloat du **/ CGFloat CPTAnimationTimingFunctionExponentialInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); elapsedTime -= CPTFloat(1.0); - if ( elapsedTime >= 1.0 ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(0.0) ) { + if ( elapsedTime < CPTFloat(0.0)) { return CPTFloat(0.5) * pow(CPTFloat(2.0), CPTFloat(10.0) * elapsedTime); } else { - return CPTFloat(0.5) * ( -pow(CPTFloat(2.0), CPTFloat(-10.0) * elapsedTime) + CPTFloat(2.0) ); + return CPTFloat(0.5) * (-pow(CPTFloat(2.0), CPTFloat(-10.0) * elapsedTime) + CPTFloat(2.0)); } } @@ -416,17 +416,17 @@ CGFloat CPTAnimationTimingFunctionExponentialInOut(CGFloat elapsedTime, CGFloat **/ CGFloat CPTAnimationTimingFunctionSinusoidalIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return -cos( elapsedTime * CPTFloat(M_PI_2) ) + CPTFloat(1.0); + return -cos(elapsedTime * CPTFloat(M_PI_2)) + CPTFloat(1.0); } /** @@ -437,17 +437,17 @@ CGFloat CPTAnimationTimingFunctionSinusoidalIn(CGFloat elapsedTime, CGFloat dura **/ CGFloat CPTAnimationTimingFunctionSinusoidalOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return sin( elapsedTime * CPTFloat(M_PI_2) ); + return sin(elapsedTime * CPTFloat(M_PI_2)); } /** @@ -458,17 +458,17 @@ CGFloat CPTAnimationTimingFunctionSinusoidalOut(CGFloat elapsedTime, CGFloat dur **/ CGFloat CPTAnimationTimingFunctionSinusoidalInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return CPTFloat(-0.5) * ( cos(CPTFloat(M_PI) * elapsedTime) - CPTFloat(1.0) ); + return CPTFloat(-0.5) * (cos(CPTFloat(M_PI) * elapsedTime) - CPTFloat(1.0)); } #pragma mark - @@ -482,13 +482,13 @@ CGFloat CPTAnimationTimingFunctionSinusoidalInOut(CGFloat elapsedTime, CGFloat d **/ CGFloat CPTAnimationTimingFunctionCubicIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -503,13 +503,13 @@ CGFloat CPTAnimationTimingFunctionCubicIn(CGFloat elapsedTime, CGFloat duration) **/ CGFloat CPTAnimationTimingFunctionCubicOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime = elapsedTime / duration - CPTFloat(1.0); - if ( elapsedTime >= CPTFloat(0.0) ) { + if ( elapsedTime >= CPTFloat(0.0)) { return CPTFloat(1.0); } @@ -524,23 +524,23 @@ CGFloat CPTAnimationTimingFunctionCubicOut(CGFloat elapsedTime, CGFloat duration **/ CGFloat CPTAnimationTimingFunctionCubicInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0) ) { + if ( elapsedTime < CPTFloat(1.0)) { return CPTFloat(0.5) * elapsedTime * elapsedTime * elapsedTime; } else { elapsedTime -= CPTFloat(2.0); - return CPTFloat(0.5) * ( elapsedTime * elapsedTime * elapsedTime + CPTFloat(2.0) ); + return CPTFloat(0.5) * (elapsedTime * elapsedTime * elapsedTime + CPTFloat(2.0)); } } @@ -555,13 +555,13 @@ CGFloat CPTAnimationTimingFunctionCubicInOut(CGFloat elapsedTime, CGFloat durati **/ CGFloat CPTAnimationTimingFunctionQuadraticIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -576,17 +576,17 @@ CGFloat CPTAnimationTimingFunctionQuadraticIn(CGFloat elapsedTime, CGFloat durat **/ CGFloat CPTAnimationTimingFunctionQuadraticOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } - return -elapsedTime * ( elapsedTime - CPTFloat(2.0) ); + return -elapsedTime * (elapsedTime - CPTFloat(2.0)); } /** @@ -597,23 +597,23 @@ CGFloat CPTAnimationTimingFunctionQuadraticOut(CGFloat elapsedTime, CGFloat dura **/ CGFloat CPTAnimationTimingFunctionQuadraticInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0) ) { + if ( elapsedTime < CPTFloat(1.0)) { return CPTFloat(0.5) * elapsedTime * elapsedTime; } else { elapsedTime -= CPTFloat(1.0); - return CPTFloat(-0.5) * ( elapsedTime * ( elapsedTime - CPTFloat(2.0) ) - CPTFloat(1.0) ); + return CPTFloat(-0.5) * (elapsedTime * (elapsedTime - CPTFloat(2.0)) - CPTFloat(1.0)); } } @@ -628,13 +628,13 @@ CGFloat CPTAnimationTimingFunctionQuadraticInOut(CGFloat elapsedTime, CGFloat du **/ CGFloat CPTAnimationTimingFunctionQuarticIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -649,17 +649,17 @@ CGFloat CPTAnimationTimingFunctionQuarticIn(CGFloat elapsedTime, CGFloat duratio **/ CGFloat CPTAnimationTimingFunctionQuarticOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime = elapsedTime / duration - CPTFloat(1.0); - if ( elapsedTime >= CPTFloat(0.0) ) { + if ( elapsedTime >= CPTFloat(0.0)) { return CPTFloat(1.0); } - return -( elapsedTime * elapsedTime * elapsedTime * elapsedTime - CPTFloat(1.0) ); + return -(elapsedTime * elapsedTime * elapsedTime * elapsedTime - CPTFloat(1.0)); } /** @@ -670,23 +670,23 @@ CGFloat CPTAnimationTimingFunctionQuarticOut(CGFloat elapsedTime, CGFloat durati **/ CGFloat CPTAnimationTimingFunctionQuarticInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0) ) { + if ( elapsedTime < CPTFloat(1.0)) { return CPTFloat(0.5) * elapsedTime * elapsedTime * elapsedTime * elapsedTime; } else { elapsedTime -= CPTFloat(2.0); - return CPTFloat(-0.5) * ( elapsedTime * elapsedTime * elapsedTime * elapsedTime - CPTFloat(2.0) ); + return CPTFloat(-0.5) * (elapsedTime * elapsedTime * elapsedTime * elapsedTime - CPTFloat(2.0)); } } @@ -701,13 +701,13 @@ CGFloat CPTAnimationTimingFunctionQuarticInOut(CGFloat elapsedTime, CGFloat dura **/ CGFloat CPTAnimationTimingFunctionQuinticIn(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration; - if ( elapsedTime >= CPTFloat(1.0) ) { + if ( elapsedTime >= CPTFloat(1.0)) { return CPTFloat(1.0); } @@ -722,13 +722,13 @@ CGFloat CPTAnimationTimingFunctionQuinticIn(CGFloat elapsedTime, CGFloat duratio **/ CGFloat CPTAnimationTimingFunctionQuinticOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime = elapsedTime / duration - CPTFloat(1.0); - if ( elapsedTime >= CPTFloat(0.0) ) { + if ( elapsedTime >= CPTFloat(0.0)) { return CPTFloat(1.0); } @@ -743,22 +743,22 @@ CGFloat CPTAnimationTimingFunctionQuinticOut(CGFloat elapsedTime, CGFloat durati **/ CGFloat CPTAnimationTimingFunctionQuinticInOut(CGFloat elapsedTime, CGFloat duration) { - if ( elapsedTime <= CPTFloat(0.0) ) { + if ( elapsedTime <= CPTFloat(0.0)) { return CPTFloat(0.0); } elapsedTime /= duration * CPTFloat(0.5); - if ( elapsedTime >= CPTFloat(2.0) ) { + if ( elapsedTime >= CPTFloat(2.0)) { return CPTFloat(1.0); } - if ( elapsedTime < CPTFloat(1.0) ) { + if ( elapsedTime < CPTFloat(1.0)) { return CPTFloat(0.5) * elapsedTime * elapsedTime * elapsedTime * elapsedTime * elapsedTime; } else { elapsedTime -= CPTFloat(2.0); - return CPTFloat(0.5) * ( elapsedTime * elapsedTime * elapsedTime * elapsedTime * elapsedTime + CPTFloat(2.0) ); + return CPTFloat(0.5) * (elapsedTime * elapsedTime * elapsedTime * elapsedTime * elapsedTime + CPTFloat(2.0)); } } diff --git a/framework/Source/_CPTBorderLayer.h b/framework/Source/_CPTBorderLayer.h index 161fb09f0..120ab625c 100644 --- a/framework/Source/_CPTBorderLayer.h +++ b/framework/Source/_CPTBorderLayer.h @@ -4,6 +4,6 @@ @interface CPTBorderLayer : CPTLayer -@property (nonatomic, readwrite, strong) CPTBorderedLayer *maskedLayer; +@property (nonatomic, readwrite, strong, nullable) CPTBorderedLayer *maskedLayer; @end diff --git a/framework/Source/_CPTBorderLayer.m b/framework/Source/_CPTBorderLayer.m index 33c921f98..009fa48eb 100644 --- a/framework/Source/_CPTBorderLayer.m +++ b/framework/Source/_CPTBorderLayer.m @@ -10,7 +10,7 @@ **/ @implementation CPTBorderLayer -/** @property CPTBorderedLayer *maskedLayer +/** @property nullable CPTBorderedLayer *maskedLayer * @brief The CPTBorderedLayer masked being masked. * Its fill and border are drawn into this layer so that they are outside the mask applied to the @par{maskedLayer}. **/ @@ -31,9 +31,9 @@ @implementation CPTBorderLayer * @param newFrame The frame rectangle. * @return The initialized CPTBorderLayer object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { maskedLayer = nil; self.needsDisplayOnBoundsChange = YES; @@ -45,9 +45,9 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(instancetype)initWithLayer:(id)layer +-(nonnull instancetype)initWithLayer:(nonnull id)layer { - if ( (self = [super initWithLayer:layer]) ) { + if ((self = [super initWithLayer:layer])) { CPTBorderLayer *theLayer = (CPTBorderLayer *)layer; maskedLayer = theLayer->maskedLayer; @@ -62,29 +62,42 @@ -(instancetype)initWithLayer:(id)layer /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; [coder encodeObject:self.maskedLayer forKey:@"CPTBorderLayer.maskedLayer"]; } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { - maskedLayer = [coder decodeObjectForKey:@"CPTBorderLayer.maskedLayer"]; + if ((self = [super initWithCoder:coder])) { + maskedLayer = [coder decodeObjectOfClass:[CPTBorderedLayer class] + forKey:@"CPTBorderLayer.maskedLayer"]; } return self; } /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Drawing /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { if ( self.hidden ) { return; @@ -130,12 +143,12 @@ -(void)layoutSublayers } } --(NSSet *)sublayersExcludedFromAutomaticLayout +-(nullable CPTSublayerSet *)sublayersExcludedFromAutomaticLayout { CPTBorderedLayer *excludedLayer = self.maskedLayer; if ( excludedLayer ) { - NSMutableSet *excludedSublayers = [[super sublayersExcludedFromAutomaticLayout] mutableCopy]; + CPTMutableSublayerSet *excludedSublayers = [super.sublayersExcludedFromAutomaticLayout mutableCopy]; if ( !excludedSublayers ) { excludedSublayers = [NSMutableSet set]; } @@ -143,7 +156,7 @@ -(NSSet *)sublayersExcludedFromAutomaticLayout return excludedSublayers; } else { - return [super sublayersExcludedFromAutomaticLayout]; + return super.sublayersExcludedFromAutomaticLayout; } } @@ -154,7 +167,7 @@ -(NSSet *)sublayersExcludedFromAutomaticLayout /// @cond --(void)setMaskedLayer:(CPTBorderedLayer *)newLayer +-(void)setMaskedLayer:(nullable CPTBorderedLayer *)newLayer { if ( newLayer != maskedLayer ) { maskedLayer = newLayer; @@ -164,8 +177,8 @@ -(void)setMaskedLayer:(CPTBorderedLayer *)newLayer -(void)setBounds:(CGRect)newBounds { - if ( !CGRectEqualToRect(newBounds, self.bounds) ) { - [super setBounds:newBounds]; + if ( !CGRectEqualToRect(newBounds, self.bounds)) { + super.bounds = newBounds; [self setNeedsLayout]; } } diff --git a/framework/Source/_CPTConstraintsFixed.h b/framework/Source/_CPTConstraintsFixed.h index 1f1439e85..6bf4b66c5 100644 --- a/framework/Source/_CPTConstraintsFixed.h +++ b/framework/Source/_CPTConstraintsFixed.h @@ -4,14 +4,14 @@ /// @name Initialization /// @{ --(instancetype)initWithLowerOffset:(CGFloat)newOffset NS_DESIGNATED_INITIALIZER; --(instancetype)initWithUpperOffset:(CGFloat)newOffset NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithLowerOffset:(CGFloat)newOffset NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithUpperOffset:(CGFloat)newOffset NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER; /// @} /// @name Comparison /// @{ --(BOOL)isEqualToConstraint:(CPTConstraints *)otherConstraint; +-(BOOL)isEqualToConstraint:(nullable CPTConstraints *)otherConstraint; /// @} /// @name Position diff --git a/framework/Source/_CPTConstraintsFixed.m b/framework/Source/_CPTConstraintsFixed.m index 5b30de626..7cef014bc 100644 --- a/framework/Source/_CPTConstraintsFixed.m +++ b/framework/Source/_CPTConstraintsFixed.m @@ -30,9 +30,9 @@ @implementation _CPTConstraintsFixed * @param newOffset The offset. * @return The initialized CPTConstraints object. **/ --(instancetype)initWithLowerOffset:(CGFloat)newOffset +-(nonnull instancetype)initWithLowerOffset:(CGFloat)newOffset { - if ( (self = [super init]) ) { + if ((self = [super init])) { offset = newOffset; isFixedToLower = YES; } @@ -44,9 +44,9 @@ -(instancetype)initWithLowerOffset:(CGFloat)newOffset * @param newOffset The offset. * @return The initialized CPTConstraints object. **/ --(instancetype)initWithUpperOffset:(CGFloat)newOffset +-(nonnull instancetype)initWithUpperOffset:(CGFloat)newOffset { - if ( (self = [super init]) ) { + if ((self = [super init])) { offset = newOffset; isFixedToLower = NO; } @@ -57,13 +57,13 @@ -(instancetype)initWithUpperOffset:(CGFloat)newOffset #pragma mark - #pragma mark Comparison --(BOOL)isEqualToConstraint:(CPTConstraints *)otherConstraint +-(BOOL)isEqualToConstraint:(nullable CPTConstraints *)otherConstraint { if ( [self class] != [otherConstraint class] ) { return NO; } - return (self.offset == ( (_CPTConstraintsFixed *)otherConstraint ).offset) && - (self.isFixedToLower == ( (_CPTConstraintsFixed *)otherConstraint ).isFixedToLower); + return (self.offset == ((_CPTConstraintsFixed *)otherConstraint).offset) && + (self.isFixedToLower == ((_CPTConstraintsFixed *)otherConstraint).isFixedToLower); } #pragma mark - @@ -95,7 +95,7 @@ -(CGFloat)positionForLowerBound:(CGFloat)lowerBound upperBound:(CGFloat)upperBou /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { _CPTConstraintsFixed *copy = [[[self class] allocWithZone:zone] init]; @@ -112,12 +112,12 @@ -(id)copyWithZone:(NSZone *)zone /// @cond --(Class)classForCoder +-(nonnull Class)classForCoder { return [CPTConstraints class]; } --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeCGFloat:self.offset forKey:@"_CPTConstraintsFixed.offset"]; [coder encodeBool:self.isFixedToLower forKey:@"_CPTConstraintsFixed.isFixedToLower"]; @@ -129,13 +129,25 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { offset = [coder decodeCGFloatForKey:@"_CPTConstraintsFixed.offset"]; isFixedToLower = [coder decodeBoolForKey:@"_CPTConstraintsFixed.isFixedToLower"]; } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/_CPTConstraintsRelative.h b/framework/Source/_CPTConstraintsRelative.h index 3c1858819..bad6150cb 100644 --- a/framework/Source/_CPTConstraintsRelative.h +++ b/framework/Source/_CPTConstraintsRelative.h @@ -4,13 +4,13 @@ /// @name Initialization /// @{ --(instancetype)initWithRelativeOffset:(CGFloat)newOffset NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)decoder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithRelativeOffset:(CGFloat)newOffset NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder NS_DESIGNATED_INITIALIZER; /// @} /// @name Comparison /// @{ --(BOOL)isEqualToConstraint:(CPTConstraints *)otherConstraint; +-(BOOL)isEqualToConstraint:(nullable CPTConstraints *)otherConstraint; /// @} /// @name Position diff --git a/framework/Source/_CPTConstraintsRelative.m b/framework/Source/_CPTConstraintsRelative.m index 93019c3bc..533e204ed 100644 --- a/framework/Source/_CPTConstraintsRelative.m +++ b/framework/Source/_CPTConstraintsRelative.m @@ -33,9 +33,9 @@ @implementation _CPTConstraintsRelative * @param newOffset The offset. * @return The initialized CPTConstraints object. **/ --(instancetype)initWithRelativeOffset:(CGFloat)newOffset +-(nonnull instancetype)initWithRelativeOffset:(CGFloat)newOffset { - if ( (self = [super init]) ) { + if ((self = [super init])) { offset = newOffset; } @@ -45,12 +45,12 @@ -(instancetype)initWithRelativeOffset:(CGFloat)newOffset #pragma mark - #pragma mark Comparison --(BOOL)isEqualToConstraint:(CPTConstraints *)otherConstraint +-(BOOL)isEqualToConstraint:(nullable CPTConstraints *)otherConstraint { if ( [self class] != [otherConstraint class] ) { return NO; } - return self.offset == ( (_CPTConstraintsRelative *)otherConstraint ).offset; + return self.offset == ((_CPTConstraintsRelative *)otherConstraint).offset; } #pragma mark - @@ -75,7 +75,7 @@ -(CGFloat)positionForLowerBound:(CGFloat)lowerBound upperBound:(CGFloat)upperBou /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { _CPTConstraintsRelative *copy = [[[self class] allocWithZone:zone] init]; @@ -91,12 +91,12 @@ -(id)copyWithZone:(NSZone *)zone /// @cond --(Class)classForCoder +-(nonnull Class)classForCoder { return [CPTConstraints class]; } --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeCGFloat:self.offset forKey:@"_CPTConstraintsRelative.offset"]; } @@ -107,12 +107,24 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { + if ((self = [super init])) { offset = [coder decodeCGFloatForKey:@"_CPTConstraintsRelative.offset"]; } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/_CPTDarkGradientTheme.m b/framework/Source/_CPTDarkGradientTheme.m index c9b84b3f1..e15eaf091 100644 --- a/framework/Source/_CPTDarkGradientTheme.m +++ b/framework/Source/_CPTDarkGradientTheme.m @@ -12,16 +12,7 @@ #import "CPTXYAxisSet.h" #import "CPTXYGraph.h" -NSString *const kCPTDarkGradientTheme = @"Dark Gradients"; - -/// @cond -@interface _CPTDarkGradientTheme() - --(void)applyThemeToAxis:(CPTXYAxis *)axis usingMajorLineStyle:(CPTLineStyle *)majorLineStyle minorLineStyle:(CPTLineStyle *)minorLineStyle textStyle:(CPTMutableTextStyle *)textStyle minorTickTextStyle:(CPTMutableTextStyle *)minorTickTextStyle; - -@end - -/// @endcond +CPTThemeName const kCPTDarkGradientTheme = @"Dark Gradients"; #pragma mark - @@ -35,31 +26,14 @@ +(void)load [self registerTheme:self]; } -+(NSString *)name ++(nonnull NSString *)name { return kCPTDarkGradientTheme; } #pragma mark - --(void)applyThemeToAxis:(CPTXYAxis *)axis usingMajorLineStyle:(CPTLineStyle *)majorLineStyle minorLineStyle:(CPTLineStyle *)minorLineStyle textStyle:(CPTMutableTextStyle *)textStyle minorTickTextStyle:(CPTMutableTextStyle *)minorTickTextStyle -{ - axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - axis.majorIntervalLength = CPTDecimalFromDouble(0.5); - axis.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - axis.tickDirection = CPTSignNone; - axis.minorTicksPerInterval = 4; - axis.majorTickLineStyle = majorLineStyle; - axis.minorTickLineStyle = minorLineStyle; - axis.axisLineStyle = majorLineStyle; - axis.majorTickLength = CPTFloat(7.0); - axis.minorTickLength = CPTFloat(5.0); - axis.labelTextStyle = textStyle; - axis.minorTickLabelTextStyle = minorTickTextStyle; - axis.titleTextStyle = textStyle; -} - --(void)applyThemeToBackground:(CPTGraph *)graph +-(void)applyThemeToBackground:(nonnull CPTGraph *)graph { CPTColor *endColor = [CPTColor colorWithGenericGray:CPTFloat(0.1)]; CPTGradient *graphGradient = [CPTGradient gradientWithBeginningColor:endColor endingColor:endColor]; @@ -71,7 +45,7 @@ -(void)applyThemeToBackground:(CPTGraph *)graph graph.fill = [CPTFill fillWithGradient:graphGradient]; } --(void)applyThemeToPlotArea:(CPTPlotAreaFrame *)plotAreaFrame +-(void)applyThemeToPlotArea:(nonnull CPTPlotAreaFrame *)plotAreaFrame { CPTGradient *gradient = [CPTGradient gradientWithBeginningColor:[CPTColor colorWithGenericGray:CPTFloat(0.1)] endingColor:[CPTColor colorWithGenericGray:CPTFloat(0.3)]]; @@ -86,7 +60,7 @@ -(void)applyThemeToPlotArea:(CPTPlotAreaFrame *)plotAreaFrame plotAreaFrame.cornerRadius = CPTFloat(10.0); } --(void)applyThemeToAxisSet:(CPTAxisSet *)axisSet +-(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet { CPTMutableLineStyle *majorLineStyle = [CPTMutableLineStyle lineStyle]; @@ -108,14 +82,26 @@ -(void)applyThemeToAxisSet:(CPTAxisSet *)axisSet whiteMinorTickTextStyle.fontSize = CPTFloat(12.0); for ( CPTXYAxis *axis in axisSet.axes ) { - [self applyThemeToAxis:axis usingMajorLineStyle:majorLineStyle minorLineStyle:minorLineStyle textStyle:whiteTextStyle minorTickTextStyle:whiteMinorTickTextStyle]; + axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; + axis.majorIntervalLength = @0.5; + axis.orthogonalPosition = @0.0; + axis.tickDirection = CPTSignNone; + axis.minorTicksPerInterval = 4; + axis.majorTickLineStyle = majorLineStyle; + axis.minorTickLineStyle = minorLineStyle; + axis.axisLineStyle = majorLineStyle; + axis.majorTickLength = CPTFloat(7.0); + axis.minorTickLength = CPTFloat(5.0); + axis.labelTextStyle = whiteTextStyle; + axis.minorTickLabelTextStyle = whiteMinorTickTextStyle; + axis.titleTextStyle = whiteTextStyle; } } #pragma mark - #pragma mark NSCoding Methods --(Class)classForCoder +-(nonnull Class)classForCoder { return [CPTTheme class]; } diff --git a/framework/Source/_CPTFillColor.h b/framework/Source/_CPTFillColor.h index c2cdc053c..b04943ae2 100644 --- a/framework/Source/_CPTFillColor.h +++ b/framework/Source/_CPTFillColor.h @@ -1,17 +1,17 @@ #import "CPTFill.h" -@interface _CPTFillColor : CPTFill +@interface _CPTFillColor : CPTFill /// @name Initialization /// @{ --(instancetype)initWithColor:(CPTColor *)aColor NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithColor:(nonnull CPTColor *)aColor NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; /// @} /// @name Drawing /// @{ --(void)fillRect:(CGRect)rect inContext:(CGContextRef)context; --(void)fillPathInContext:(CGContextRef)context; +-(void)fillRect:(CGRect)rect inContext:(nonnull CGContextRef)context; +-(void)fillPathInContext:(nonnull CGContextRef)context; /// @} @end diff --git a/framework/Source/_CPTFillColor.m b/framework/Source/_CPTFillColor.m index 576fb50f4..628f5b6d1 100644 --- a/framework/Source/_CPTFillColor.m +++ b/framework/Source/_CPTFillColor.m @@ -5,7 +5,7 @@ /// @cond @interface _CPTFillColor() -@property (nonatomic, readwrite, copy) CPTColor *fillColor; +@property (nonatomic, readwrite, copy, nonnull) CPTColor *fillColor; @end @@ -18,7 +18,7 @@ @interface _CPTFillColor() @implementation _CPTFillColor -/** @property fillColor +/** @property nonnull CPTColor *fillColor * @brief The fill color. **/ @synthesize fillColor; @@ -30,9 +30,9 @@ @implementation _CPTFillColor * @param aColor The color. * @return The initialized _CPTFillColor object. **/ --(instancetype)initWithColor:(CPTColor *)aColor +-(nonnull instancetype)initWithColor:(nonnull CPTColor *)aColor { - if ( (self = [super init]) ) { + if ((self = [super init])) { fillColor = aColor; } return self; @@ -45,7 +45,7 @@ -(instancetype)initWithColor:(CPTColor *)aColor * @param rect The rectangle to draw into. * @param context The graphics context to draw into. **/ --(void)fillRect:(CGRect)rect inContext:(CGContextRef)context +-(void)fillRect:(CGRect)rect inContext:(nonnull CGContextRef)context { CGContextSaveGState(context); CGContextSetFillColorWithColor(context, self.fillColor.cgColor); @@ -56,7 +56,7 @@ -(void)fillRect:(CGRect)rect inContext:(CGContextRef)context /** @brief Draws the color into the given graphics context clipped to the current drawing path. * @param context The graphics context to draw into. **/ --(void)fillPathInContext:(CGContextRef)context +-(void)fillPathInContext:(nonnull CGContextRef)context { CGContextSaveGState(context); CGContextSetFillColorWithColor(context, self.fillColor.cgColor); @@ -85,7 +85,7 @@ -(CGColorRef)cgColor /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { _CPTFillColor *copy = [[[self class] allocWithZone:zone] init]; @@ -101,12 +101,12 @@ -(id)copyWithZone:(NSZone *)zone /// @cond --(Class)classForCoder +-(nonnull Class)classForCoder { return [CPTFill class]; } --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeObject:self.fillColor forKey:@"_CPTFillColor.fillColor"]; } @@ -117,12 +117,32 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - fillColor = [coder decodeObjectForKey:@"_CPTFillColor.fillColor"]; + if ((self = [super init])) { + CPTColor *color = [coder decodeObjectOfClass:[CPTColor class] + forKey:@"_CPTFillColor.fillColor"]; + + if ( color ) { + fillColor = color; + } + else { + self = nil; + } } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/_CPTFillGradient.h b/framework/Source/_CPTFillGradient.h index b13e04200..5344bf7fb 100644 --- a/framework/Source/_CPTFillGradient.h +++ b/framework/Source/_CPTFillGradient.h @@ -2,18 +2,18 @@ @class CPTGradient; -@interface _CPTFillGradient : CPTFill +@interface _CPTFillGradient : CPTFill /// @name Initialization /// @{ --(instancetype)initWithGradient:(CPTGradient *)aGradient NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithGradient:(nonnull CPTGradient *)aGradient NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; /// @} /// @name Drawing /// @{ --(void)fillRect:(CGRect)rect inContext:(CGContextRef)context; --(void)fillPathInContext:(CGContextRef)context; +-(void)fillRect:(CGRect)rect inContext:(nonnull CGContextRef)context; +-(void)fillPathInContext:(nonnull CGContextRef)context; /// @} @end diff --git a/framework/Source/_CPTFillGradient.m b/framework/Source/_CPTFillGradient.m index 7cfbc4b1e..c7d0aa70c 100644 --- a/framework/Source/_CPTFillGradient.m +++ b/framework/Source/_CPTFillGradient.m @@ -5,7 +5,7 @@ /// @cond @interface _CPTFillGradient() -@property (nonatomic, readwrite, copy) CPTGradient *fillGradient; +@property (nonatomic, readwrite, copy, nonnull) CPTGradient *fillGradient; @end @@ -18,7 +18,7 @@ @interface _CPTFillGradient() @implementation _CPTFillGradient -/** @property fillGradient +/** @property nonnull CPTGradient *fillGradient * @brief The fill gradient. **/ @synthesize fillGradient; @@ -30,9 +30,9 @@ @implementation _CPTFillGradient * @param aGradient The gradient. * @return The initialized _CPTFillGradient object. **/ --(instancetype)initWithGradient:(CPTGradient *)aGradient +-(nonnull instancetype)initWithGradient:(nonnull CPTGradient *)aGradient { - if ( (self = [super init]) ) { + if ((self = [super init])) { fillGradient = aGradient; } return self; @@ -45,7 +45,7 @@ -(instancetype)initWithGradient:(CPTGradient *)aGradient * @param rect The rectangle to draw into. * @param context The graphics context to draw into. **/ --(void)fillRect:(CGRect)rect inContext:(CGContextRef)context +-(void)fillRect:(CGRect)rect inContext:(nonnull CGContextRef)context { [self.fillGradient fillRect:rect inContext:context]; } @@ -53,7 +53,7 @@ -(void)fillRect:(CGRect)rect inContext:(CGContextRef)context /** @brief Draws the gradient into the given graphics context clipped to the current drawing path. * @param context The graphics context to draw into. **/ --(void)fillPathInContext:(CGContextRef)context +-(void)fillPathInContext:(nonnull CGContextRef)context { [self.fillGradient fillPathInContext:context]; } @@ -71,7 +71,7 @@ -(BOOL)isOpaque /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { _CPTFillGradient *copy = [[[self class] allocWithZone:zone] init]; @@ -87,12 +87,12 @@ -(id)copyWithZone:(NSZone *)zone /// @cond --(Class)classForCoder +-(nonnull Class)classForCoder { return [CPTFill class]; } --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeObject:self.fillGradient forKey:@"_CPTFillGradient.fillGradient"]; } @@ -103,12 +103,32 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - fillGradient = [coder decodeObjectForKey:@"_CPTFillGradient.fillGradient"]; + if ((self = [super init])) { + CPTGradient *gradient = [coder decodeObjectOfClass:[CPTGradient class] + forKey:@"_CPTFillGradient.fillGradient"]; + + if ( gradient ) { + fillGradient = gradient; + } + else { + self = nil; + } } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/_CPTFillImage.h b/framework/Source/_CPTFillImage.h index f1d1f8ce9..49bbb205f 100644 --- a/framework/Source/_CPTFillImage.h +++ b/framework/Source/_CPTFillImage.h @@ -2,18 +2,18 @@ @class CPTImage; -@interface _CPTFillImage : CPTFill +@interface _CPTFillImage : CPTFill /// @name Initialization /// @{ --(instancetype)initWithImage:(CPTImage *)anImage NS_DESIGNATED_INITIALIZER; --(instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER; +-(nonnull instancetype)initWithImage:(nonnull CPTImage *)anImage NS_DESIGNATED_INITIALIZER; +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER; /// @} /// @name Drawing /// @{ --(void)fillRect:(CGRect)rect inContext:(CGContextRef)context; --(void)fillPathInContext:(CGContextRef)context; +-(void)fillRect:(CGRect)rect inContext:(nonnull CGContextRef)context; +-(void)fillPathInContext:(nonnull CGContextRef)context; /// @} @end diff --git a/framework/Source/_CPTFillImage.m b/framework/Source/_CPTFillImage.m index 697542f2e..48614de11 100644 --- a/framework/Source/_CPTFillImage.m +++ b/framework/Source/_CPTFillImage.m @@ -5,7 +5,7 @@ /// @cond @interface _CPTFillImage() -@property (nonatomic, readwrite, copy) CPTImage *fillImage; +@property (nonatomic, readwrite, copy, nonnull) CPTImage *fillImage; @end @@ -18,7 +18,7 @@ @interface _CPTFillImage() @implementation _CPTFillImage -/** @property fillImage +/** @property nonnull CPTImage *fillImage * @brief The fill image. **/ @synthesize fillImage; @@ -30,9 +30,9 @@ @implementation _CPTFillImage * @param anImage The image. * @return The initialized _CPTFillImage object. **/ --(instancetype)initWithImage:(CPTImage *)anImage +-(nonnull instancetype)initWithImage:(nonnull CPTImage *)anImage { - if ( (self = [super init]) ) { + if ((self = [super init])) { fillImage = anImage; } return self; @@ -45,7 +45,7 @@ -(instancetype)initWithImage:(CPTImage *)anImage * @param rect The rectangle to draw into. * @param context The graphics context to draw into. **/ --(void)fillRect:(CGRect)rect inContext:(CGContextRef)context +-(void)fillRect:(CGRect)rect inContext:(nonnull CGContextRef)context { [self.fillImage drawInRect:rect inContext:context]; } @@ -53,7 +53,7 @@ -(void)fillRect:(CGRect)rect inContext:(CGContextRef)context /** @brief Draws the image into the given graphics context clipped to the current drawing path. * @param context The graphics context to draw into. **/ --(void)fillPathInContext:(CGContextRef)context +-(void)fillPathInContext:(nonnull CGContextRef)context { CGContextSaveGState(context); @@ -77,7 +77,7 @@ -(BOOL)isOpaque /// @cond --(id)copyWithZone:(NSZone *)zone +-(nonnull id)copyWithZone:(nullable NSZone *)zone { _CPTFillImage *copy = [[[self class] allocWithZone:zone] init]; @@ -93,12 +93,12 @@ -(id)copyWithZone:(NSZone *)zone /// @cond --(Class)classForCoder +-(nonnull Class)classForCoder { return [CPTFill class]; } --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [coder encodeObject:self.fillImage forKey:@"_CPTFillImage.fillImage"]; } @@ -109,12 +109,32 @@ -(void)encodeWithCoder:(NSCoder *)coder * @param coder An unarchiver object. * @return An object initialized from data in a given unarchiver. */ --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super init]) ) { - fillImage = [coder decodeObjectForKey:@"_CPTFillImage.fillImage"]; + if ((self = [super init])) { + CPTImage *image = [coder decodeObjectOfClass:[CPTImage class] + forKey:@"_CPTFillImage.fillImage"]; + + if ( image ) { + fillImage = image; + } + else { + self = nil; + } } return self; } +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + @end diff --git a/framework/Source/_CPTMaskLayer.m b/framework/Source/_CPTMaskLayer.m index ffdf9bf8e..14e3dc603 100644 --- a/framework/Source/_CPTMaskLayer.m +++ b/framework/Source/_CPTMaskLayer.m @@ -10,15 +10,15 @@ @implementation CPTMaskLayer /** @brief Initializes a newly allocated CPTMaskLayer object with the provided frame rectangle. * - * This is the designated initializer. The initialized layer will have the following properties: - * - @ref needsDisplayOnBoundsChange = @YES + * This is the designated initializer. The initialized layer will have the following properties: + * - @ref needsDisplayOnBoundsChange = @YES * - * @param newFrame The frame rectangle. + * @param newFrame The frame rectangle. * @return The initialized CPTMaskLayer object. **/ --(instancetype)initWithFrame:(CGRect)newFrame +-(nonnull instancetype)initWithFrame:(CGRect)newFrame { - if ( (self = [super initWithFrame:newFrame]) ) { + if ((self = [super initWithFrame:newFrame])) { self.needsDisplayOnBoundsChange = YES; } return self; @@ -29,14 +29,14 @@ -(instancetype)initWithFrame:(CGRect)newFrame /// @cond --(void)renderAsVectorInContext:(CGContextRef)context +-(void)renderAsVectorInContext:(nonnull CGContextRef)context { [super renderAsVectorInContext:context]; CPTLayer *theMaskedLayer = (CPTLayer *)self.superlayer; if ( theMaskedLayer ) { - CGContextSetRGBFillColor( context, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0) ); + CGContextSetRGBFillColor(context, CPTFloat(0.0), CPTFloat(0.0), CPTFloat(0.0), CPTFloat(1.0)); if ( [theMaskedLayer isKindOfClass:[CPTLayer class]] ) { CGPathRef maskingPath = theMaskedLayer.sublayerMaskingPath; diff --git a/framework/Source/_CPTPlainBlackTheme.m b/framework/Source/_CPTPlainBlackTheme.m index 9f148a795..05783b4f1 100644 --- a/framework/Source/_CPTPlainBlackTheme.m +++ b/framework/Source/_CPTPlainBlackTheme.m @@ -11,7 +11,7 @@ #import "CPTXYAxisSet.h" #import "CPTXYGraph.h" -NSString *const kCPTPlainBlackTheme = @"Plain Black"; +CPTThemeName const kCPTPlainBlackTheme = @"Plain Black"; /** * @brief Creates a CPTXYGraph instance formatted with black backgrounds and white lines. @@ -23,19 +23,19 @@ +(void)load [self registerTheme:self]; } -+(NSString *)name ++(nonnull NSString *)name { return kCPTPlainBlackTheme; } #pragma mark - --(void)applyThemeToBackground:(CPTGraph *)graph +-(void)applyThemeToBackground:(nonnull CPTGraph *)graph { graph.fill = [CPTFill fillWithColor:[CPTColor blackColor]]; } --(void)applyThemeToPlotArea:(CPTPlotAreaFrame *)plotAreaFrame +-(void)applyThemeToPlotArea:(nonnull CPTPlotAreaFrame *)plotAreaFrame { plotAreaFrame.fill = [CPTFill fillWithColor:[CPTColor blackColor]]; @@ -47,9 +47,8 @@ -(void)applyThemeToPlotArea:(CPTPlotAreaFrame *)plotAreaFrame plotAreaFrame.cornerRadius = CPTFloat(0.0); } --(void)applyThemeToAxisSet:(CPTAxisSet *)axisSet +-(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet { - CPTXYAxisSet *xyAxisSet = (CPTXYAxisSet *)axisSet; CPTMutableLineStyle *majorLineStyle = [CPTMutableLineStyle lineStyle]; majorLineStyle.lineCap = kCGLineCapRound; @@ -60,48 +59,35 @@ -(void)applyThemeToAxisSet:(CPTAxisSet *)axisSet minorLineStyle.lineColor = [CPTColor whiteColor]; minorLineStyle.lineWidth = CPTFloat(3.0); - CPTXYAxis *x = xyAxisSet.xAxis; CPTMutableTextStyle *whiteTextStyle = [[CPTMutableTextStyle alloc] init]; whiteTextStyle.color = [CPTColor whiteColor]; whiteTextStyle.fontSize = CPTFloat(14.0); + CPTMutableTextStyle *minorTickWhiteTextStyle = [[CPTMutableTextStyle alloc] init]; minorTickWhiteTextStyle.color = [CPTColor whiteColor]; minorTickWhiteTextStyle.fontSize = CPTFloat(12.0); - x.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - x.majorIntervalLength = CPTDecimalFromDouble(0.5); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - x.tickDirection = CPTSignNone; - x.minorTicksPerInterval = 4; - x.majorTickLineStyle = majorLineStyle; - x.minorTickLineStyle = minorLineStyle; - x.axisLineStyle = majorLineStyle; - x.majorTickLength = CPTFloat(7.0); - x.minorTickLength = CPTFloat(5.0); - x.labelTextStyle = whiteTextStyle; - x.minorTickLabelTextStyle = whiteTextStyle; - x.titleTextStyle = whiteTextStyle; - - CPTXYAxis *y = xyAxisSet.yAxis; - y.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - y.majorIntervalLength = CPTDecimalFromDouble(0.5); - y.minorTicksPerInterval = 4; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - y.tickDirection = CPTSignNone; - y.majorTickLineStyle = majorLineStyle; - y.minorTickLineStyle = minorLineStyle; - y.axisLineStyle = majorLineStyle; - y.majorTickLength = CPTFloat(7.0); - y.minorTickLength = CPTFloat(5.0); - y.labelTextStyle = whiteTextStyle; - y.minorTickLabelTextStyle = minorTickWhiteTextStyle; - y.titleTextStyle = whiteTextStyle; + for ( CPTXYAxis *axis in axisSet.axes ) { + axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; + axis.majorIntervalLength = @0.5; + axis.orthogonalPosition = @0.0; + axis.tickDirection = CPTSignNone; + axis.minorTicksPerInterval = 4; + axis.majorTickLineStyle = majorLineStyle; + axis.minorTickLineStyle = minorLineStyle; + axis.axisLineStyle = majorLineStyle; + axis.majorTickLength = CPTFloat(7.0); + axis.minorTickLength = CPTFloat(5.0); + axis.labelTextStyle = whiteTextStyle; + axis.minorTickLabelTextStyle = whiteTextStyle; + axis.titleTextStyle = whiteTextStyle; + } } #pragma mark - #pragma mark NSCoding Methods --(Class)classForCoder +-(nonnull Class)classForCoder { return [CPTTheme class]; } diff --git a/framework/Source/_CPTPlainWhiteTheme.m b/framework/Source/_CPTPlainWhiteTheme.m index 324e2d258..5a8ed24f2 100644 --- a/framework/Source/_CPTPlainWhiteTheme.m +++ b/framework/Source/_CPTPlainWhiteTheme.m @@ -11,7 +11,7 @@ #import "CPTXYAxisSet.h" #import "CPTXYGraph.h" -NSString *const kCPTPlainWhiteTheme = @"Plain White"; +CPTThemeName const kCPTPlainWhiteTheme = @"Plain White"; /** * @brief Creates a CPTXYGraph instance formatted with white backgrounds and black lines. @@ -23,19 +23,19 @@ +(void)load [self registerTheme:self]; } -+(NSString *)name ++(nonnull NSString *)name { return kCPTPlainWhiteTheme; } #pragma mark - --(void)applyThemeToBackground:(CPTGraph *)graph +-(void)applyThemeToBackground:(nonnull CPTGraph *)graph { graph.fill = [CPTFill fillWithColor:[CPTColor whiteColor]]; } --(void)applyThemeToPlotArea:(CPTPlotAreaFrame *)plotAreaFrame +-(void)applyThemeToPlotArea:(nonnull CPTPlotAreaFrame *)plotAreaFrame { plotAreaFrame.fill = [CPTFill fillWithColor:[CPTColor whiteColor]]; @@ -47,9 +47,8 @@ -(void)applyThemeToPlotArea:(CPTPlotAreaFrame *)plotAreaFrame plotAreaFrame.cornerRadius = CPTFloat(0.0); } --(void)applyThemeToAxisSet:(CPTAxisSet *)axisSet +-(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet { - CPTXYAxisSet *xyAxisSet = (CPTXYAxisSet *)axisSet; CPTMutableLineStyle *majorLineStyle = [CPTMutableLineStyle lineStyle]; majorLineStyle.lineCap = kCGLineCapButt; @@ -61,47 +60,35 @@ -(void)applyThemeToAxisSet:(CPTAxisSet *)axisSet minorLineStyle.lineColor = [CPTColor blackColor]; minorLineStyle.lineWidth = CPTFloat(1.0); - CPTXYAxis *x = xyAxisSet.xAxis; CPTMutableTextStyle *blackTextStyle = [[CPTMutableTextStyle alloc] init]; blackTextStyle.color = [CPTColor blackColor]; blackTextStyle.fontSize = CPTFloat(14.0); + CPTMutableTextStyle *minorTickBlackTextStyle = [[CPTMutableTextStyle alloc] init]; minorTickBlackTextStyle.color = [CPTColor blackColor]; minorTickBlackTextStyle.fontSize = CPTFloat(12.0); - x.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - x.majorIntervalLength = CPTDecimalFromDouble(0.5); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - x.tickDirection = CPTSignNone; - x.minorTicksPerInterval = 4; - x.majorTickLineStyle = majorLineStyle; - x.minorTickLineStyle = minorLineStyle; - x.axisLineStyle = majorLineStyle; - x.majorTickLength = CPTFloat(7.0); - x.minorTickLength = CPTFloat(5.0); - x.labelTextStyle = blackTextStyle; - x.minorTickLabelTextStyle = blackTextStyle; - x.titleTextStyle = blackTextStyle; - - CPTXYAxis *y = xyAxisSet.yAxis; - y.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - y.majorIntervalLength = CPTDecimalFromDouble(0.5); - y.minorTicksPerInterval = 4; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - y.tickDirection = CPTSignNone; - y.majorTickLineStyle = majorLineStyle; - y.minorTickLineStyle = minorLineStyle; - y.axisLineStyle = majorLineStyle; - y.majorTickLength = CPTFloat(7.0); - y.minorTickLength = CPTFloat(5.0); - y.labelTextStyle = blackTextStyle; - y.minorTickLabelTextStyle = minorTickBlackTextStyle; - y.titleTextStyle = blackTextStyle; + + for ( CPTXYAxis *axis in axisSet.axes ) { + axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; + axis.majorIntervalLength = @0.5; + axis.orthogonalPosition = @0.0; + axis.tickDirection = CPTSignNone; + axis.minorTicksPerInterval = 4; + axis.majorTickLineStyle = majorLineStyle; + axis.minorTickLineStyle = minorLineStyle; + axis.axisLineStyle = majorLineStyle; + axis.majorTickLength = CPTFloat(7.0); + axis.minorTickLength = CPTFloat(5.0); + axis.labelTextStyle = blackTextStyle; + axis.minorTickLabelTextStyle = blackTextStyle; + axis.titleTextStyle = blackTextStyle; + } } #pragma mark - #pragma mark NSCoding Methods --(Class)classForCoder +-(nonnull Class)classForCoder { return [CPTTheme class]; } diff --git a/framework/Source/_CPTSlateTheme.m b/framework/Source/_CPTSlateTheme.m index cee13242d..c357e48a9 100644 --- a/framework/Source/_CPTSlateTheme.m +++ b/framework/Source/_CPTSlateTheme.m @@ -12,16 +12,7 @@ #import "CPTXYAxisSet.h" #import "CPTXYGraph.h" -NSString *const kCPTSlateTheme = @"Slate"; - -/// @cond -@interface _CPTSlateTheme() - --(void)applyThemeToAxis:(CPTXYAxis *)axis usingMajorLineStyle:(CPTLineStyle *)majorLineStyle minorLineStyle:(CPTLineStyle *)minorLineStyle textStyle:(CPTMutableTextStyle *)textStyle minorTickTextStyle:(CPTMutableTextStyle *)minorTickTextStyle; - -@end - -/// @endcond +CPTThemeName const kCPTSlateTheme = @"Slate"; #pragma mark - @@ -35,31 +26,14 @@ +(void)load [self registerTheme:self]; } -+(NSString *)name ++(nonnull NSString *)name { return kCPTSlateTheme; } #pragma mark - --(void)applyThemeToAxis:(CPTXYAxis *)axis usingMajorLineStyle:(CPTLineStyle *)majorLineStyle minorLineStyle:(CPTLineStyle *)minorLineStyle textStyle:(CPTMutableTextStyle *)textStyle minorTickTextStyle:(CPTMutableTextStyle *)minorTickTextStyle -{ - axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - axis.majorIntervalLength = CPTDecimalFromDouble(0.5); - axis.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - axis.tickDirection = CPTSignNone; - axis.minorTicksPerInterval = 4; - axis.majorTickLineStyle = majorLineStyle; - axis.minorTickLineStyle = minorLineStyle; - axis.axisLineStyle = majorLineStyle; - axis.majorTickLength = CPTFloat(7.0); - axis.minorTickLength = CPTFloat(5.0); - axis.labelTextStyle = textStyle; - axis.minorTickLabelTextStyle = minorTickTextStyle; - axis.titleTextStyle = textStyle; -} - --(void)applyThemeToBackground:(CPTGraph *)graph +-(void)applyThemeToBackground:(nonnull CPTGraph *)graph { CPTGradient *gradient = [CPTGradient gradientWithBeginningColor:[CPTColor colorWithComponentRed:CPTFloat(0.43) green:CPTFloat(0.51) blue:CPTFloat(0.63) alpha:CPTFloat(1.0)] endingColor:[CPTColor colorWithComponentRed:CPTFloat(0.70) green:CPTFloat(0.73) blue:CPTFloat(0.80) alpha:CPTFloat(1.0)]]; @@ -69,7 +43,7 @@ -(void)applyThemeToBackground:(CPTGraph *)graph graph.fill = [CPTFill fillWithGradient:gradient]; } --(void)applyThemeToPlotArea:(CPTPlotAreaFrame *)plotAreaFrame +-(void)applyThemeToPlotArea:(nonnull CPTPlotAreaFrame *)plotAreaFrame { CPTGradient *gradient = [CPTGradient gradientWithBeginningColor:[CPTColor colorWithComponentRed:CPTFloat(0.43) green:CPTFloat(0.51) blue:CPTFloat(0.63) alpha:CPTFloat(1.0)] endingColor:[CPTColor colorWithComponentRed:CPTFloat(0.70) green:CPTFloat(0.73) blue:CPTFloat(0.80) alpha:CPTFloat(1.0)]]; @@ -85,7 +59,7 @@ -(void)applyThemeToPlotArea:(CPTPlotAreaFrame *)plotAreaFrame plotAreaFrame.cornerRadius = CPTFloat(5.0); } --(void)applyThemeToAxisSet:(CPTAxisSet *)axisSet +-(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet { CPTMutableLineStyle *majorLineStyle = [CPTMutableLineStyle lineStyle]; @@ -107,14 +81,26 @@ -(void)applyThemeToAxisSet:(CPTAxisSet *)axisSet minorTickBlackTextStyle.fontSize = CPTFloat(12.0); for ( CPTXYAxis *axis in axisSet.axes ) { - [self applyThemeToAxis:axis usingMajorLineStyle:majorLineStyle minorLineStyle:minorLineStyle textStyle:blackTextStyle minorTickTextStyle:minorTickBlackTextStyle]; + axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; + axis.majorIntervalLength = @0.5; + axis.orthogonalPosition = @0.0; + axis.tickDirection = CPTSignNone; + axis.minorTicksPerInterval = 4; + axis.majorTickLineStyle = majorLineStyle; + axis.minorTickLineStyle = minorLineStyle; + axis.axisLineStyle = majorLineStyle; + axis.majorTickLength = CPTFloat(7.0); + axis.minorTickLength = CPTFloat(5.0); + axis.labelTextStyle = blackTextStyle; + axis.minorTickLabelTextStyle = minorTickBlackTextStyle; + axis.titleTextStyle = blackTextStyle; } } #pragma mark - #pragma mark NSCoding Methods --(Class)classForCoder +-(nonnull Class)classForCoder { return [CPTTheme class]; } diff --git a/framework/Source/_CPTStocksTheme.m b/framework/Source/_CPTStocksTheme.m index 860594162..4e3dcf0bc 100644 --- a/framework/Source/_CPTStocksTheme.m +++ b/framework/Source/_CPTStocksTheme.m @@ -12,7 +12,7 @@ #import "CPTXYAxisSet.h" #import "CPTXYGraph.h" -NSString *const kCPTStocksTheme = @"Stocks"; +CPTThemeName const kCPTStocksTheme = @"Stocks"; /** * @brief Creates a CPTXYGraph instance formatted with a gradient background and white lines. @@ -24,19 +24,19 @@ +(void)load [self registerTheme:self]; } -+(NSString *)name ++(nonnull NSString *)name { return kCPTStocksTheme; } #pragma mark - --(void)applyThemeToBackground:(CPTGraph *)graph +-(void)applyThemeToBackground:(nonnull CPTGraph *)graph { graph.fill = [CPTFill fillWithColor:[CPTColor blackColor]]; } --(void)applyThemeToPlotArea:(CPTPlotAreaFrame *)plotAreaFrame +-(void)applyThemeToPlotArea:(nonnull CPTPlotAreaFrame *)plotAreaFrame { CPTGradient *stocksBackgroundGradient = [[CPTGradient alloc] init]; @@ -60,9 +60,8 @@ -(void)applyThemeToPlotArea:(CPTPlotAreaFrame *)plotAreaFrame plotAreaFrame.cornerRadius = CPTFloat(14.0); } --(void)applyThemeToAxisSet:(CPTAxisSet *)axisSet +-(void)applyThemeToAxisSet:(nonnull CPTAxisSet *)axisSet { - CPTXYAxisSet *xyAxisSet = (CPTXYAxisSet *)axisSet; CPTMutableLineStyle *majorLineStyle = [CPTMutableLineStyle lineStyle]; majorLineStyle.lineCap = kCGLineCapRound; @@ -73,47 +72,35 @@ -(void)applyThemeToAxisSet:(CPTAxisSet *)axisSet minorLineStyle.lineColor = [CPTColor whiteColor]; minorLineStyle.lineWidth = CPTFloat(3.0); - CPTXYAxis *x = xyAxisSet.xAxis; CPTMutableTextStyle *whiteTextStyle = [[CPTMutableTextStyle alloc] init]; whiteTextStyle.color = [CPTColor whiteColor]; whiteTextStyle.fontSize = CPTFloat(14.0); + CPTMutableTextStyle *minorTickWhiteTextStyle = [[CPTMutableTextStyle alloc] init]; minorTickWhiteTextStyle.color = [CPTColor whiteColor]; minorTickWhiteTextStyle.fontSize = CPTFloat(12.0); - x.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - x.majorIntervalLength = CPTDecimalFromDouble(0.5); - x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - x.tickDirection = CPTSignNone; - x.minorTicksPerInterval = 4; - x.majorTickLineStyle = majorLineStyle; - x.minorTickLineStyle = minorLineStyle; - x.axisLineStyle = majorLineStyle; - x.majorTickLength = CPTFloat(7.0); - x.minorTickLength = CPTFloat(5.0); - x.labelTextStyle = whiteTextStyle; - x.minorTickLabelTextStyle = minorTickWhiteTextStyle; - x.titleTextStyle = whiteTextStyle; - - CPTXYAxis *y = xyAxisSet.yAxis; - y.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; - y.majorIntervalLength = CPTDecimalFromDouble(0.5); - y.minorTicksPerInterval = 4; - y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); - y.tickDirection = CPTSignNone; - y.majorTickLineStyle = majorLineStyle; - y.minorTickLineStyle = minorLineStyle; - y.axisLineStyle = majorLineStyle; - y.majorTickLength = CPTFloat(7.0); - y.minorTickLength = CPTFloat(5.0); - y.labelTextStyle = whiteTextStyle; - y.minorTickLabelTextStyle = minorTickWhiteTextStyle; - y.titleTextStyle = whiteTextStyle; + + for ( CPTXYAxis *axis in axisSet.axes ) { + axis.labelingPolicy = CPTAxisLabelingPolicyFixedInterval; + axis.majorIntervalLength = @0.5; + axis.orthogonalPosition = @0.0; + axis.tickDirection = CPTSignNone; + axis.minorTicksPerInterval = 4; + axis.majorTickLineStyle = majorLineStyle; + axis.minorTickLineStyle = minorLineStyle; + axis.axisLineStyle = majorLineStyle; + axis.majorTickLength = CPTFloat(7.0); + axis.minorTickLength = CPTFloat(5.0); + axis.labelTextStyle = whiteTextStyle; + axis.minorTickLabelTextStyle = minorTickWhiteTextStyle; + axis.titleTextStyle = whiteTextStyle; + } } #pragma mark - #pragma mark NSCoding Methods --(Class)classForCoder +-(nonnull Class)classForCoder { return [CPTTheme class]; } diff --git a/framework/Source/_CPTXYTheme.m b/framework/Source/_CPTXYTheme.m index 47d7d8e4f..129d137aa 100644 --- a/framework/Source/_CPTXYTheme.m +++ b/framework/Source/_CPTXYTheme.m @@ -13,9 +13,9 @@ @implementation _CPTXYTheme /// @name Initialization /// @{ --(instancetype)init +-(nonnull instancetype)init { - if ( (self = [super init]) ) { + if ((self = [super init])) { self.graphClass = [CPTXYGraph class]; } return self; @@ -23,7 +23,7 @@ -(instancetype)init /// @} --(id)newGraph +-(nullable id)newGraph { CPTXYGraph *graph; @@ -39,8 +39,8 @@ -(id)newGraph graph.paddingBottom = CPTFloat(60.0); CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace; - plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(1.0)]; - plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(-1.0) length:CPTDecimalFromDouble(1.0)]; + plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]; + plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@(-1.0) length:@1.0]; [self applyThemeToGraph:graph]; @@ -50,7 +50,7 @@ -(id)newGraph #pragma mark - #pragma mark NSCoding Methods --(Class)classForCoder +-(nonnull Class)classForCoder { return [CPTTheme class]; } diff --git a/framework/Source/mainpage.h b/framework/Source/mainpage.h index b4e1287ad..06ec0e648 100644 --- a/framework/Source/mainpage.h +++ b/framework/Source/mainpage.h @@ -2,7 +2,7 @@ * * @section intro Introduction * - * Core Plot is a 2D plotting framework for Mac OS X and iOS. + * Core Plot is a 2D Cocoa plotting framework for macOS, iOS, and tvOS. * It is highly customizable and capable of drawing many types of plots. * See the Example Graphs * wiki page and the example applications @@ -38,7 +38,6 @@ * @subsection socialnetworks Social Networks * * - Twitter - * - App.net; Subscribe to the Announcements broadcast. * * @section contributingtocoreplot Contributing to Core Plot * @@ -56,8 +55,8 @@ * Nonetheless, in a project like Core Plot, with many developers contributing, it is worthwhile * defining a set of basic coding standards to prevent a mishmash of different styles which can * become frustrating when navigating the code base. See the file - * Coding Style.markdown - * found in the documentation + * CONTRIBUTING.md + * found in the .github * directory of the project source for specific guidelines. * * Core Plot includes a script diff --git a/framework/TestResources/CorePlotProbes.d b/framework/TestResources/CorePlotProbes.d deleted file mode 100644 index 05e68c33e..000000000 --- a/framework/TestResources/CorePlotProbes.d +++ /dev/null @@ -1,3 +0,0 @@ -provider CorePlot { - probe layer_position_change(char *, int, int, int, int); -}; \ No newline at end of file diff --git a/framework/English.lproj/InfoPlist.strings b/framework/en.lproj/InfoPlist.strings similarity index 100% rename from framework/English.lproj/InfoPlist.strings rename to framework/en.lproj/InfoPlist.strings diff --git a/framework/iPhoneOnly/CPTGraphHostingView.h b/framework/iPhoneOnly/CPTGraphHostingView.h index 9d22f0093..17f7ec128 100644 --- a/framework/iPhoneOnly/CPTGraphHostingView.h +++ b/framework/iPhoneOnly/CPTGraphHostingView.h @@ -2,9 +2,9 @@ @class CPTGraph; -@interface CPTGraphHostingView : UIView +@interface CPTGraphHostingView : UIView -@property (nonatomic, readwrite, strong) CPTGraph *hostedGraph; +@property (nonatomic, readwrite, strong, nullable) CPTGraph *hostedGraph; @property (nonatomic, readwrite, assign) BOOL collapsesLayers; @property (nonatomic, readwrite, assign) BOOL allowPinchScaling; diff --git a/framework/iPhoneOnly/CPTGraphHostingView.m b/framework/iPhoneOnly/CPTGraphHostingView.m index da1bff408..0c9866702 100644 --- a/framework/iPhoneOnly/CPTGraphHostingView.m +++ b/framework/iPhoneOnly/CPTGraphHostingView.m @@ -9,10 +9,13 @@ /// @cond @interface CPTGraphHostingView() -@property (nonatomic, readwrite, cpt_weak_property) cpt_weak UIPinchGestureRecognizer *pinchGestureRecognizer; +#if (TARGET_OS_SIMULATOR || TARGET_OS_IPHONE) && !TARGET_OS_TV +@property (nonatomic, readwrite, nullable, cpt_weak_property) UIPinchGestureRecognizer *pinchGestureRecognizer; --(void)graphNeedsRedraw:(NSNotification *)notification; --(void)handlePinchGesture:(UIPinchGestureRecognizer *)aPinchGestureRecognizer; +-(void)handlePinchGesture:(nonnull UIPinchGestureRecognizer *)aPinchGestureRecognizer; +#endif + +-(void)graphNeedsRedraw:(nonnull NSNotification *)notification; @end @@ -25,7 +28,7 @@ -(void)handlePinchGesture:(UIPinchGestureRecognizer *)aPinchGestureRecognizer; **/ @implementation CPTGraphHostingView -/** @property CPTGraph *hostedGraph +/** @property nullable CPTGraph *hostedGraph * @brief The CPTLayer hosted inside this view. **/ @synthesize hostedGraph; @@ -44,11 +47,15 @@ @implementation CPTGraphHostingView /// @cond +#if (TARGET_OS_SIMULATOR || TARGET_OS_IPHONE) && !TARGET_OS_TV + /** @internal - * @property cpt_weak id pinchGestureRecognizer + * @property nullable UIPinchGestureRecognizer *pinchGestureRecognizer * @brief The pinch gesture recognizer for this view. + * @since Not available on tvOS. **/ @synthesize pinchGestureRecognizer; +#endif /// @endcond @@ -57,7 +64,7 @@ @implementation CPTGraphHostingView /// @cond -+(Class)layerClass ++(nonnull Class)layerClass { return [CALayer class]; } @@ -72,17 +79,24 @@ -(void)commonInit self.allowPinchScaling = YES; // This undoes the normal coordinate space inversion that UIViews apply to their layers - self.layer.sublayerTransform = CATransform3DMakeScale( CPTFloat(1.0), CPTFloat(-1.0), CPTFloat(1.0) ); + self.layer.sublayerTransform = CATransform3DMakeScale(CPTFloat(1.0), CPTFloat(-1.0), CPTFloat(1.0)); } --(instancetype)initWithFrame:(CGRect)frame +-(nonnull instancetype)initWithFrame:(CGRect)frame { - if ( (self = [super initWithFrame:frame]) ) { + if ((self = [super initWithFrame:frame])) { [self commonInit]; } return self; } +-(void)awakeFromNib +{ + [super awakeFromNib]; + + [self commonInit]; +} + -(void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; @@ -95,7 +109,7 @@ -(void)dealloc /// @cond --(void)encodeWithCoder:(NSCoder *)coder +-(void)encodeWithCoder:(nonnull NSCoder *)coder { [super encodeWithCoder:coder]; @@ -107,13 +121,14 @@ -(void)encodeWithCoder:(NSCoder *)coder // pinchGestureRecognizer } --(instancetype)initWithCoder:(NSCoder *)coder +-(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder { - if ( (self = [super initWithCoder:coder]) ) { + if ((self = [super initWithCoder:coder])) { [self commonInit]; collapsesLayers = [coder decodeBoolForKey:@"CPTGraphHostingView.collapsesLayers"]; - self.hostedGraph = [coder decodeObjectForKey:@"CPTGraphHostingView.hostedGraph"]; // setup layers + self.hostedGraph = [coder decodeObjectOfClass:[CPTGraph class] + forKey:@"CPTGraphHostingView.hostedGraph"]; // setup layers if ( [coder containsValueForKey:@"CPTGraphHostingView.allowPinchScaling"] ) { self.allowPinchScaling = [coder decodeBoolForKey:@"CPTGraphHostingView.allowPinchScaling"]; // set gesture recognizer if needed @@ -124,23 +139,36 @@ -(instancetype)initWithCoder:(NSCoder *)coder /// @endcond +#pragma mark - +#pragma mark NSSecureCoding Methods + +/// @cond + ++(BOOL)supportsSecureCoding +{ + return YES; +} + +/// @endcond + #pragma mark - #pragma mark Touch handling /// @cond --(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +-(void)touchesBegan:(nonnull NSSet *)touches withEvent:(nullable UIEvent *)event { BOOL handled = NO; // Ignore pinch or other multitouch gestures - if ( [[event allTouches] count] == 1 ) { + if ( [event allTouches].count == 1 ) { CPTGraph *theHostedGraph = self.hostedGraph; + UIEvent *theEvent = event; theHostedGraph.frame = self.bounds; [theHostedGraph layoutIfNeeded]; - CGPoint pointOfTouch = [[[event touchesForView:self] anyObject] locationInView:self]; + CGPoint pointOfTouch = [[[theEvent touchesForView:self] anyObject] locationInView:self]; if ( self.collapsesLayers ) { pointOfTouch.y = self.frame.size.height - pointOfTouch.y; @@ -148,7 +176,7 @@ -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event else { pointOfTouch = [self.layer convertPoint:pointOfTouch toLayer:theHostedGraph]; } - handled = [theHostedGraph pointingDeviceDownEvent:event atPoint:pointOfTouch]; + handled = [theHostedGraph pointingDeviceDownEvent:theEvent atPoint:pointOfTouch]; } if ( !handled ) { @@ -156,53 +184,67 @@ -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event } } --(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event +-(void)touchesMoved:(nonnull NSSet *)touches withEvent:(nullable UIEvent *)event { - CPTGraph *theHostedGraph = self.hostedGraph; + BOOL handled = NO; - theHostedGraph.frame = self.bounds; - [theHostedGraph layoutIfNeeded]; + if ( event ) { + CPTGraph *theHostedGraph = self.hostedGraph; + UIEvent *theEvent = event; - CGPoint pointOfTouch = [[[event touchesForView:self] anyObject] locationInView:self]; + theHostedGraph.frame = self.bounds; + [theHostedGraph layoutIfNeeded]; - if ( self.collapsesLayers ) { - pointOfTouch.y = self.frame.size.height - pointOfTouch.y; - } - else { - pointOfTouch = [self.layer convertPoint:pointOfTouch toLayer:theHostedGraph]; - } - BOOL handled = [theHostedGraph pointingDeviceDraggedEvent:event atPoint:pointOfTouch]; + CGPoint pointOfTouch = [[[theEvent touchesForView:self] anyObject] locationInView:self]; + if ( self.collapsesLayers ) { + pointOfTouch.y = self.frame.size.height - pointOfTouch.y; + } + else { + pointOfTouch = [self.layer convertPoint:pointOfTouch toLayer:theHostedGraph]; + } + handled = [theHostedGraph pointingDeviceDraggedEvent:theEvent atPoint:pointOfTouch]; + } if ( !handled ) { [super touchesMoved:touches withEvent:event]; } } --(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +-(void)touchesEnded:(nonnull NSSet *)touches withEvent:(nullable UIEvent *)event { - CPTGraph *theHostedGraph = self.hostedGraph; + BOOL handled = NO; - theHostedGraph.frame = self.bounds; - [theHostedGraph layoutIfNeeded]; + if ( event ) { + CPTGraph *theHostedGraph = self.hostedGraph; + UIEvent *theEvent = event; - CGPoint pointOfTouch = [[[event touchesForView:self] anyObject] locationInView:self]; + theHostedGraph.frame = self.bounds; + [theHostedGraph layoutIfNeeded]; - if ( self.collapsesLayers ) { - pointOfTouch.y = self.frame.size.height - pointOfTouch.y; - } - else { - pointOfTouch = [self.layer convertPoint:pointOfTouch toLayer:theHostedGraph]; + CGPoint pointOfTouch = [[[theEvent touchesForView:self] anyObject] locationInView:self]; + + if ( self.collapsesLayers ) { + pointOfTouch.y = self.frame.size.height - pointOfTouch.y; + } + else { + pointOfTouch = [self.layer convertPoint:pointOfTouch toLayer:theHostedGraph]; + } + handled = [theHostedGraph pointingDeviceUpEvent:theEvent atPoint:pointOfTouch]; } - BOOL handled = [theHostedGraph pointingDeviceUpEvent:event atPoint:pointOfTouch]; if ( !handled ) { [super touchesEnded:touches withEvent:event]; } } --(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event +-(void)touchesCancelled:(nonnull NSSet *)touches withEvent:(nullable UIEvent *)event { - BOOL handled = [self.hostedGraph pointingDeviceCancelledEvent:event]; + BOOL handled = NO; + + if ( event ) { + UIEvent *theEvent = event; + handled = [self.hostedGraph pointingDeviceCancelledEvent:theEvent]; + } if ( !handled ) { [super touchesCancelled:touches withEvent:event]; @@ -216,6 +258,7 @@ -(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event /// @cond +#if (TARGET_OS_SIMULATOR || TARGET_OS_IPHONE) && !TARGET_OS_TV -(void)setAllowPinchScaling:(BOOL)allowScaling { if ( allowPinchScaling != allowScaling ) { @@ -236,7 +279,7 @@ -(void)setAllowPinchScaling:(BOOL)allowScaling } } --(void)handlePinchGesture:(UIPinchGestureRecognizer *)aPinchGestureRecognizer +-(void)handlePinchGesture:(nonnull UIPinchGestureRecognizer *)aPinchGestureRecognizer { CGPoint interactionPoint = [aPinchGestureRecognizer locationInView:self]; CPTGraph *theHostedGraph = self.hostedGraph; @@ -266,6 +309,24 @@ -(void)handlePinchGesture:(UIPinchGestureRecognizer *)aPinchGestureRecognizer pinchRecognizer.scale = 1.0; } +#endif + +/// @endcond + +#pragma mark - +#pragma mark TV Focus + +/// @cond + +#if TARGET_OS_TV + +-(BOOL)canBecomeFocused +{ + return YES; +} + +#endif + /// @endcond #pragma mark - @@ -273,7 +334,7 @@ -(void)handlePinchGesture:(UIPinchGestureRecognizer *)aPinchGestureRecognizer /// @cond --(void)drawRect:(CGRect)rect +-(void)drawRect:(CGRect __unused)rect { if ( self.collapsesLayers ) { CGContextRef context = UIGraphicsGetCurrentContext(); @@ -286,11 +347,18 @@ -(void)drawRect:(CGRect)rect } } --(void)graphNeedsRedraw:(NSNotification *)notification +-(void)graphNeedsRedraw:(nonnull NSNotification *__unused)notification { [self setNeedsDisplay]; } +-(void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection +{ + [super traitCollectionDidChange:previousTraitCollection]; + + [self.hostedGraph setNeedsDisplayAllLayers]; +} + /// @endcond #pragma mark - @@ -298,9 +366,9 @@ -(void)graphNeedsRedraw:(NSNotification *)notification /// @cond --(void)setHostedGraph:(CPTGraph *)newLayer +-(void)setHostedGraph:(nullable CPTGraph *)newLayer { - NSParameterAssert( (newLayer == nil) || [newLayer isKindOfClass:[CPTGraph class]] ); + NSParameterAssert((newLayer == nil) || [newLayer isKindOfClass:[CPTGraph class]]); if ( newLayer == hostedGraph ) { return; @@ -335,8 +403,10 @@ -(void)setHostedGraph:(CPTGraph *)newLayer } else { if ( newLayer ) { - newLayer.frame = self.layer.bounds; - [self.layer addSublayer:newLayer]; + CPTGraph *newGraph = newLayer; + + newGraph.frame = self.layer.bounds; + [self.layer addSublayer:newGraph]; } } } @@ -374,7 +444,7 @@ -(void)setCollapsesLayers:(BOOL)collapse -(void)setFrame:(CGRect)newFrame { - [super setFrame:newFrame]; + super.frame = newFrame; CPTGraph *theHostedGraph = self.hostedGraph; [theHostedGraph setNeedsLayout]; @@ -389,7 +459,7 @@ -(void)setFrame:(CGRect)newFrame -(void)setBounds:(CGRect)newBounds { - [super setBounds:newBounds]; + super.bounds = newBounds; CPTGraph *theHostedGraph = self.hostedGraph; [theHostedGraph setNeedsLayout]; diff --git a/framework/iPhoneOnly/CPTImagePlatformSpecific.m b/framework/iPhoneOnly/CPTImagePlatformSpecific.m index aaa7fbad1..20c73f03d 100644 --- a/framework/iPhoneOnly/CPTImagePlatformSpecific.m +++ b/framework/iPhoneOnly/CPTImagePlatformSpecific.m @@ -12,9 +12,9 @@ @implementation CPTImage(CPTPlatformSpecificImageExtensions) * @param anImage The platform-native image. * @return A CPTImage instance initialized with the provided image. **/ --(instancetype)initWithNativeImage:(CPTNativeImage *)anImage +-(nonnull instancetype)initWithNativeImage:(nullable CPTNativeImage *)anImage { - if ( (self = [self initWithCGImage:NULL scale:anImage.scale]) ) { + if ((self = [self initWithCGImage:NULL scale:anImage.scale])) { self.nativeImage = anImage; UIEdgeInsets insets = anImage.capInsets; @@ -33,7 +33,7 @@ -(instancetype)initWithNativeImage:(CPTNativeImage *)anImage * @param path The file system path of the file. * @return A CPTImage instance initialized with the contents of the PNG file. **/ --(instancetype)initForPNGFile:(NSString *)path +-(nonnull instancetype)initForPNGFile:(nonnull NSString *)path { CGFloat imageScale = CPTFloat(1.0); @@ -45,7 +45,7 @@ -(instancetype)initForPNGFile:(NSString *)path imageScale = MAX(imageScale, screen.scale); } - if ( imageScale > 1.0 ) { + if ( imageScale > CPTFloat(1.0)) { NSMutableString *hiDpiPath = [path mutableCopy]; NSUInteger replaceCount = [hiDpiPath replaceOccurrencesOfString:@".png" withString:[NSString stringWithFormat:@"@%dx.png", (int)imageScale] diff --git a/framework/iPhoneOnly/CPTPlatformSpecificCategories.h b/framework/iPhoneOnly/CPTPlatformSpecificCategories.h index b67d0f798..efa9ffffc 100644 --- a/framework/iPhoneOnly/CPTPlatformSpecificCategories.h +++ b/framework/iPhoneOnly/CPTPlatformSpecificCategories.h @@ -2,17 +2,6 @@ #import "CPTLayer.h" #import "CPTPlatformSpecificDefines.h" -#pragma mark CPTColor - -/** @category CPTColor(CPTPlatformSpecificColorExtensions) - * @brief Platform-specific extensions to CPTColor. - **/ -@interface CPTColor(CPTPlatformSpecificColorExtensions) - -@property (nonatomic, readonly) UIColor *uiColor; - -@end - #pragma mark - CPTLayer /** @category CPTLayer(CPTPlatformSpecificLayerExtensions) @@ -22,7 +11,7 @@ /// @name Images /// @{ --(CPTNativeImage *)imageOfLayer; +-(nullable CPTNativeImage *)imageOfLayer; /// @} @end @@ -34,10 +23,10 @@ **/ @interface NSNumber(CPTPlatformSpecificNumberExtensions) --(BOOL)isLessThan:(NSNumber *)other; --(BOOL)isLessThanOrEqualTo:(NSNumber *)other; --(BOOL)isGreaterThan:(NSNumber *)other; --(BOOL)isGreaterThanOrEqualTo:(NSNumber *)other; +-(BOOL)isLessThan:(nonnull NSNumber *)other; +-(BOOL)isLessThanOrEqualTo:(nonnull NSNumber *)other; +-(BOOL)isGreaterThan:(nonnull NSNumber *)other; +-(BOOL)isGreaterThanOrEqualTo:(nonnull NSNumber *)other; @end @@ -50,7 +39,12 @@ /// @name Drawing /// @{ --(void)drawInRect:(CGRect)rect inContext:(CGContextRef)context; +-(void)drawInRect:(CGRect)rect inContext:(nonnull CGContextRef)context; +/// @} + +/// @name Measurement +/// @{ +-(CGSize)sizeAsDrawn; /// @} @end diff --git a/framework/iPhoneOnly/CPTPlatformSpecificCategories.m b/framework/iPhoneOnly/CPTPlatformSpecificCategories.m index 9a4e542b3..cad04a6f3 100644 --- a/framework/iPhoneOnly/CPTPlatformSpecificCategories.m +++ b/framework/iPhoneOnly/CPTPlatformSpecificCategories.m @@ -1,22 +1,7 @@ #import "CPTPlatformSpecificCategories.h" #import "CPTPlatformSpecificFunctions.h" - -#pragma mark CPTColor - -@implementation CPTColor(CPTPlatformSpecificColorExtensions) - -/** @property uiColor - * @brief Gets the color value as a UIColor. - **/ -@dynamic uiColor; - --(UIColor *)uiColor -{ - return [UIColor colorWithCGColor:self.cgColor]; -} - -@end +#import "tgmath.h" #pragma mark - CPTLayer @@ -25,18 +10,18 @@ @implementation CPTLayer(CPTPlatformSpecificLayerExtensions) /** @brief Gets an image of the layer contents. * @return A native image representation of the layer content. **/ --(CPTNativeImage *)imageOfLayer +-(nullable CPTNativeImage *)imageOfLayer { CGSize boundsSize = self.bounds.size; - UIGraphicsBeginImageContextWithOptions( boundsSize, self.opaque, CPTFloat(0.0) ); + UIGraphicsBeginImageContextWithOptions(boundsSize, self.opaque, CPTFloat(0.0)); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSaveGState(context); CGContextSetAllowsAntialiasing(context, true); CGContextTranslateCTM(context, CPTFloat(0.0), boundsSize.height); - CGContextScaleCTM( context, CPTFloat(1.0), CPTFloat(-1.0) ); + CGContextScaleCTM(context, CPTFloat(1.0), CPTFloat(-1.0)); [self layoutAndRenderInContext:context]; CPTNativeImage *layerImage = UIGraphicsGetImageFromCurrentImageContext(); @@ -58,7 +43,7 @@ @implementation NSNumber(CPTPlatformSpecificNumberExtensions) * @param other The other number to compare to the receiver. * @return @YES if the receiver is less than other, otherwise @NO. **/ --(BOOL)isLessThan:(NSNumber *)other +-(BOOL)isLessThan:(nonnull NSNumber *)other { return [self compare:other] == NSOrderedAscending; } @@ -67,7 +52,7 @@ -(BOOL)isLessThan:(NSNumber *)other * @param other The other number to compare to the receiver. * @return @YES if the receiver is less than or equal to other, otherwise @NO. **/ --(BOOL)isLessThanOrEqualTo:(NSNumber *)other +-(BOOL)isLessThanOrEqualTo:(nonnull NSNumber *)other { return [self compare:other] == NSOrderedSame || [self compare:other] == NSOrderedAscending; } @@ -76,7 +61,7 @@ -(BOOL)isLessThanOrEqualTo:(NSNumber *)other * @param other The other number to compare to the receiver. * @return @YES if the receiver is greater than other, otherwise @NO. **/ --(BOOL)isGreaterThan:(NSNumber *)other +-(BOOL)isGreaterThan:(nonnull NSNumber *)other { return [self compare:other] == NSOrderedDescending; } @@ -85,7 +70,7 @@ -(BOOL)isGreaterThan:(NSNumber *)other * @param other The other number to compare to the receiver. * @return @YES if the receiver is greater than or equal to other, otherwise @NO. **/ --(BOOL)isGreaterThanOrEqualTo:(NSNumber *)other +-(BOOL)isGreaterThanOrEqualTo:(nonnull NSNumber *)other { return [self compare:other] == NSOrderedSame || [self compare:other] == NSOrderedDescending; } @@ -101,17 +86,34 @@ @implementation NSAttributedString(CPTPlatformSpecificAttributedStringExtensions * @param context The graphics context to draw into. * @since Available on iOS 6.0 and later. Does nothing on earlier versions. **/ --(void)drawInRect:(CGRect)rect inContext:(CGContextRef)context +-(void)drawInRect:(CGRect)rect inContext:(nonnull CGContextRef)context { if ( [self respondsToSelector:@selector(drawInRect:)] ) { CPTPushCGContext(context); [self drawWithRect:rect - options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine + options:CPTStringDrawingOptions context:nil]; CPTPopCGContext(); } } +/** + * @brief Computes the size of the styled text when drawn rounded up to the nearest whole number in each dimension. + **/ +-(CGSize)sizeAsDrawn +{ + CGRect rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) + options:CPTStringDrawingOptions + context:nil]; + + CGSize textSize = rect.size; + + textSize.width = ceil(textSize.width); + textSize.height = ceil(textSize.height); + + return textSize; +} + @end diff --git a/framework/iPhoneOnly/CPTPlatformSpecificDefines.h b/framework/iPhoneOnly/CPTPlatformSpecificDefines.h index 9b84d0d86..471ca99d5 100644 --- a/framework/iPhoneOnly/CPTPlatformSpecificDefines.h +++ b/framework/iPhoneOnly/CPTPlatformSpecificDefines.h @@ -1,4 +1,6 @@ /// @file +typedef UIColor CPTNativeColor; ///< Platform-native color. typedef UIImage CPTNativeImage; ///< Platform-native image format. typedef UIEvent CPTNativeEvent; ///< Platform-native OS event. +typedef UIFont CPTNativeFont; ///< Platform-native font. diff --git a/framework/iPhoneOnly/CPTPlatformSpecificFunctions.h b/framework/iPhoneOnly/CPTPlatformSpecificFunctions.h index caa2c3159..178bba70c 100644 --- a/framework/iPhoneOnly/CPTPlatformSpecificFunctions.h +++ b/framework/iPhoneOnly/CPTPlatformSpecificFunctions.h @@ -1,3 +1,6 @@ +#import "CPTDefinitions.h" +#import "CPTPlatformSpecificDefines.h" + /// @file #if __cplusplus @@ -6,14 +9,14 @@ extern "C" { /// @name Graphics Context Save Stack /// @{ -void CPTPushCGContext(CGContextRef context); +void CPTPushCGContext(__nonnull CGContextRef context); void CPTPopCGContext(void); /// @} -/// @name Graphics Context +/// @name Debugging /// @{ -CGContextRef CPTGetCurrentContext(void); +CPTNativeImage *__nonnull CPTQuickLookImage(CGRect rect, __nonnull CPTQuickLookImageBlock renderBlock); /// @} diff --git a/framework/iPhoneOnly/CPTPlatformSpecificFunctions.m b/framework/iPhoneOnly/CPTPlatformSpecificFunctions.m index fef6900e0..737d400f5 100644 --- a/framework/iPhoneOnly/CPTPlatformSpecificFunctions.m +++ b/framework/iPhoneOnly/CPTPlatformSpecificFunctions.m @@ -2,7 +2,10 @@ #import "CPTExceptions.h" -void CPTPushCGContext(CGContextRef newContext) +#pragma mark - +#pragma mark Context management + +void CPTPushCGContext(__nonnull CGContextRef newContext) { UIGraphicsPushContext(newContext); } @@ -12,7 +15,24 @@ void CPTPopCGContext(void) UIGraphicsPopContext(); } -CGContextRef CPTGetCurrentContext(void) +#pragma mark - +#pragma mark Debugging + +CPTNativeImage *__nonnull CPTQuickLookImage(CGRect rect, __nonnull CPTQuickLookImageBlock renderBlock) { - return UIGraphicsGetCurrentContext(); + UIGraphicsBeginImageContextWithOptions(rect.size, YES, 1.0); + CGContextRef context = UIGraphicsGetCurrentContext(); + + CGContextTranslateCTM(context, 0, rect.size.height); + CGContextScaleCTM(context, 1.0, -1.0); + + CGContextSetRGBFillColor(context, CPTFloat(0xf6 / 255.0), CPTFloat(0xf5 / 255.0), CPTFloat(0xf6 / 255.0), 1.0); + CGContextFillRect(context, rect); + + renderBlock(context, 1.0, rect); + + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + return image; } diff --git a/framework/iPhoneOnly/CPTTextStylePlatformSpecific.h b/framework/iPhoneOnly/CPTTextStylePlatformSpecific.h index e300e44ea..b1e699720 100644 --- a/framework/iPhoneOnly/CPTTextStylePlatformSpecific.h +++ b/framework/iPhoneOnly/CPTTextStylePlatformSpecific.h @@ -10,18 +10,3 @@ typedef NS_ENUM (NSInteger, CPTTextAlignment) { CPTTextAlignmentJustified = NSTextAlignmentJustified, ///< Justified alignment. CPTTextAlignmentNatural = NSTextAlignmentNatural ///< Natural alignment of the text's script. }; - -// @cond -// for iOS SDK compatibility -#if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE -#if __IPHONE_OS_VERSION_MAX_ALLOWED < 70000 -@interface NSString(CPTTextStylePlatformSpecificExtensions) - --(CGSize)sizeWithAttributes:(NSDictionary *)attrs; - -@end -#else -#endif -#endif - -/// @endcond diff --git a/framework/iPhoneOnly/CPTTextStylePlatformSpecific.m b/framework/iPhoneOnly/CPTTextStylePlatformSpecific.m index 53da4765c..c2602bbc6 100644 --- a/framework/iPhoneOnly/CPTTextStylePlatformSpecific.m +++ b/framework/iPhoneOnly/CPTTextStylePlatformSpecific.m @@ -6,13 +6,9 @@ #import "CPTPlatformSpecificFunctions.h" #import "tgmath.h" -// disable warnings when compiling with deployment target of iOS 6+ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wtautological-pointer-compare" - @implementation CPTTextStyle(CPTPlatformSpecificTextStyleExtensions) -/** @property NSDictionary *attributes +/** @property nonnull CPTDictionary *attributes * @brief A dictionary of standard text attributes suitable for formatting an NSAttributedString. * * The dictionary will contain values for the following keys that represent the receiver's text style: @@ -38,41 +34,30 @@ @implementation CPTTextStyle(CPTPlatformSpecificTextStyleExtensions) * @param attributes A dictionary of standard text attributes. * @return A new CPTTextStyle instance. **/ -+(instancetype)textStyleWithAttributes:(NSDictionary *)attributes ++(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary *)attributes { CPTMutableTextStyle *newStyle = [CPTMutableTextStyle textStyle]; // Font - BOOL hasFontAttributeName = (&NSFontAttributeName != NULL); - - if ( hasFontAttributeName ) { - UIFont *styleFont = attributes[NSFontAttributeName]; + UIFont *styleFont = attributes[NSFontAttributeName]; - if ( styleFont ) { - newStyle.fontName = styleFont.fontName; - newStyle.fontSize = styleFont.pointSize; - } + if ( styleFont ) { + newStyle.font = styleFont; + newStyle.fontName = styleFont.fontName; + newStyle.fontSize = styleFont.pointSize; } // Color - BOOL hasColorAttributeName = (&NSForegroundColorAttributeName != NULL); - - if ( hasColorAttributeName ) { - UIColor *styleColor = attributes[NSForegroundColorAttributeName]; - if ( styleColor ) { - newStyle.color = [CPTColor colorWithCGColor:styleColor.CGColor]; - } + UIColor *styleColor = attributes[NSForegroundColorAttributeName]; + if ( styleColor ) { + newStyle.color = [CPTColor colorWithCGColor:styleColor.CGColor]; } // Text alignment and line break mode - BOOL hasParagraphAttributeName = (&NSParagraphStyleAttributeName != NULL); - - if ( hasParagraphAttributeName ) { - NSParagraphStyle *paragraphStyle = attributes[NSParagraphStyleAttributeName]; - if ( paragraphStyle ) { - newStyle.textAlignment = (CPTTextAlignment)paragraphStyle.alignment; - newStyle.lineBreakMode = paragraphStyle.lineBreakMode; - } + NSParagraphStyle *paragraphStyle = attributes[NSParagraphStyleAttributeName]; + if ( paragraphStyle ) { + newStyle.textAlignment = (CPTTextAlignment)paragraphStyle.alignment; + newStyle.lineBreakMode = paragraphStyle.lineBreakMode; } return [newStyle copy]; @@ -83,50 +68,38 @@ +(instancetype)textStyleWithAttributes:(NSDictionary *)attributes /// @cond --(NSDictionary *)attributes +-(nonnull CPTDictionary *)attributes { - NSMutableDictionary *myAttributes = [NSMutableDictionary dictionary]; + CPTMutableDictionary *myAttributes = [NSMutableDictionary dictionary]; // Font - BOOL hasFontAttributeName = (&NSFontAttributeName != NULL); - - if ( hasFontAttributeName ) { - UIFont *styleFont = nil; - NSString *fontName = self.fontName; + UIFont *styleFont = self.font; + NSString *fontName = self.fontName; - if ( fontName ) { - styleFont = [UIFont fontWithName:fontName size:self.fontSize]; - } + if ((styleFont == nil) && fontName ) { + styleFont = [UIFont fontWithName:fontName size:self.fontSize]; + } - if ( styleFont ) { - [myAttributes setValue:styleFont - forKey:NSFontAttributeName]; - } + if ( styleFont ) { + [myAttributes setValue:styleFont + forKey:NSFontAttributeName]; } // Color - BOOL hasColorAttributeName = (&NSForegroundColorAttributeName != NULL); + UIColor *styleColor = self.color.uiColor; - if ( hasColorAttributeName ) { - UIColor *styleColor = self.color.uiColor; - - if ( styleColor ) { - [myAttributes setValue:styleColor - forKey:NSForegroundColorAttributeName]; - } + if ( styleColor ) { + [myAttributes setValue:styleColor + forKey:NSForegroundColorAttributeName]; } // Text alignment and line break mode - BOOL hasParagraphAttributeName = (&NSParagraphStyleAttributeName != NULL); - - if ( hasParagraphAttributeName ) { - NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; - paragraphStyle.alignment = (NSTextAlignment)self.textAlignment; - paragraphStyle.lineBreakMode = self.lineBreakMode; + NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; + paragraphStyle.alignment = (NSTextAlignment)self.textAlignment; + paragraphStyle.lineBreakMode = self.lineBreakMode; - [myAttributes setValue:paragraphStyle - forKey:NSParagraphStyleAttributeName]; - } + [myAttributes setValue:paragraphStyle + forKey:NSParagraphStyleAttributeName]; return [myAttributes copy]; } @@ -139,52 +112,50 @@ -(NSDictionary *)attributes @implementation CPTMutableTextStyle(CPTPlatformSpecificMutableTextStyleExtensions) -/// @cond - -+(instancetype)textStyleWithAttributes:(NSDictionary *)attributes +/** @brief Creates and returns a new CPTMutableTextStyle instance initialized from a dictionary of text attributes. + * + * The text style will be initalized with values associated with the following keys: + * - #NSFontAttributeName: Sets the @link CPTMutableTextStyle::fontName fontName @endlink + * and @link CPTMutableTextStyle::fontSize fontSize @endlink. + * - #NSForegroundColorAttributeName: Sets the @link CPTMutableTextStyle::color color @endlink. + * - #NSParagraphStyleAttributeName: Sets the @link CPTMutableTextStyle::textAlignment textAlignment @endlink and @link CPTMutableTextStyle::lineBreakMode lineBreakMode @endlink. + * + * Properties associated with missing keys will be inialized to their default values. + * + * @param attributes A dictionary of standard text attributes. + * @return A new CPTMutableTextStyle instance. + **/ ++(nonnull instancetype)textStyleWithAttributes:(nullable CPTDictionary *)attributes { CPTMutableTextStyle *newStyle = [CPTMutableTextStyle textStyle]; // Font - BOOL hasFontAttributeName = (&NSFontAttributeName != NULL); - - if ( hasFontAttributeName ) { - UIFont *styleFont = attributes[NSFontAttributeName]; + UIFont *styleFont = attributes[NSFontAttributeName]; - if ( styleFont ) { - newStyle.fontName = styleFont.fontName; - newStyle.fontSize = styleFont.pointSize; - } + if ( styleFont ) { + newStyle.font = styleFont; + newStyle.fontName = styleFont.fontName; + newStyle.fontSize = styleFont.pointSize; } // Color - BOOL hasColorAttributeName = (&NSForegroundColorAttributeName != NULL); + UIColor *styleColor = attributes[NSForegroundColorAttributeName]; - if ( hasColorAttributeName ) { - UIColor *styleColor = attributes[NSForegroundColorAttributeName]; - - if ( styleColor ) { - newStyle.color = [CPTColor colorWithCGColor:styleColor.CGColor]; - } + if ( styleColor ) { + newStyle.color = [CPTColor colorWithCGColor:styleColor.CGColor]; } // Text alignment and line break mode - BOOL hasParagraphAttributeName = (&NSParagraphStyleAttributeName != NULL); - - if ( hasParagraphAttributeName ) { - NSParagraphStyle *paragraphStyle = attributes[NSParagraphStyleAttributeName]; + NSParagraphStyle *paragraphStyle = attributes[NSParagraphStyleAttributeName]; - if ( paragraphStyle ) { - newStyle.textAlignment = (CPTTextAlignment)paragraphStyle.alignment; - newStyle.lineBreakMode = paragraphStyle.lineBreakMode; - } + if ( paragraphStyle ) { + newStyle.textAlignment = (CPTTextAlignment)paragraphStyle.alignment; + newStyle.lineBreakMode = paragraphStyle.lineBreakMode; } return newStyle; } -/// @endcond - @end #pragma mark - @@ -198,33 +169,17 @@ @implementation NSString(CPTTextStyleExtensions) * @param style The text style. * @return The size of the text when drawn with the given style. **/ --(CGSize)sizeWithTextStyle:(CPTTextStyle *)style +-(CGSize)sizeWithTextStyle:(nullable CPTTextStyle *)style { - CGSize textSize; - - // -boundingRectWithSize:options:attributes:context: is available in iOS 7.0 and later - if ( [self respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)] ) { - CGRect rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) - options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine - attributes:style.attributes - context:nil]; - textSize = rect.size; - textSize.width = ceil(textSize.width); - textSize.height = ceil(textSize.height); - } - else { - UIFont *theFont = nil; - NSString *fontName = style.fontName; + CGRect rect = [self boundingRectWithSize:CPTSizeMake(10000.0, 10000.0) + options:CPTStringDrawingOptions + attributes:style.attributes + context:nil]; - if ( fontName ) { - theFont = [UIFont fontWithName:fontName size:style.fontSize]; - } + CGSize textSize = rect.size; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - textSize = [self sizeWithFont:theFont constrainedToSize:CPTSizeMake(10000.0, 10000.0)]; -#pragma clang diagnostic pop - } + textSize.width = ceil(textSize.width); + textSize.height = ceil(textSize.height); return textSize; } @@ -237,7 +192,7 @@ -(CGSize)sizeWithTextStyle:(CPTTextStyle *)style * @param style The text style. * @param context The graphics context to draw into. **/ --(void)drawInRect:(CGRect)rect withTextStyle:(CPTTextStyle *)style inContext:(CGContextRef)context +-(void)drawInRect:(CGRect)rect withTextStyle:(nullable CPTTextStyle *)style inContext:(nonnull CGContextRef)context { if ( style.color == nil ) { return; @@ -251,11 +206,17 @@ -(void)drawInRect:(CGRect)rect withTextStyle:(CPTTextStyle *)style inContext:(CG CPTPushCGContext(context); +#if TARGET_OS_SIMULATOR || TARGET_OS_TV + [self drawWithRect:rect + options:CPTStringDrawingOptions + attributes:style.attributes + context:nil]; +#else #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 // -drawWithRect:options:attributes:context: method is available in iOS 7.0 and later if ( [self respondsToSelector:@selector(drawWithRect:options:attributes:context:)] ) { [self drawWithRect:rect - options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading | NSStringDrawingTruncatesLastVisibleLine + options:CPTStringDrawingOptions attributes:style.attributes context:nil]; } @@ -263,10 +224,10 @@ -(void)drawInRect:(CGRect)rect withTextStyle:(CPTTextStyle *)style inContext:(CG UIColor *styleColor = style.attributes[NSForegroundColorAttributeName]; [styleColor set]; - UIFont *theFont = nil; + UIFont *theFont = style.font; NSString *fontName = style.fontName; - if ( fontName ) { + if ((theFont == nil) && fontName ) { theFont = [UIFont fontWithName:fontName size:style.fontSize]; } @@ -282,18 +243,20 @@ -(void)drawInRect:(CGRect)rect withTextStyle:(CPTTextStyle *)style inContext:(CG UIColor *styleColor = style.attributes[NSForegroundColorAttributeName]; [styleColor set]; - UIFont *theFont = [UIFont fontWithName:style.fontName size:style.fontSize]; + UIFont *theFont = self.font; + if ( theFont == nil ) { + theFont = [UIFont fontWithName:style.fontName size:style.fontSize]; + } [self drawInRect:rect withFont:theFont lineBreakMode:style.lineBreakMode alignment:(NSTextAlignment)style.textAlignment]; +#endif #endif CGContextRestoreGState(context); CPTPopCGContext(); } -#pragma clang diagnostic pop - @end diff --git a/framework/main-cocoatouch.m b/framework/main-cocoatouch.m deleted file mode 100644 index 3ec8dc854..000000000 --- a/framework/main-cocoatouch.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// CorePlot-CocoaTouch -// -// Created by Brad Larson on 5/11/2009. - -#import - -int main(int argc, char *argv[]) -{ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, nil); - - [pool release]; - return retVal; -} diff --git a/framework/main.m b/framework/main.m deleted file mode 100644 index 538aa5d1a..000000000 --- a/framework/main.m +++ /dev/null @@ -1,22 +0,0 @@ -// -// main.m -// CorePlot -// -// Created by Barry Wark on 2/11/09. -// Copyright 2009 Barry Wark. All rights reserved. -// - -#import "GTMUnitTestingUtilities.h" - -void GTMRestoreColorProfile(void); - -int main(int argc, const char *argv[]) -{ - //configure environment for standard unit testing - [GTMUnitTestingUtilities setUpForUIUnitTestsIfBeingTested]; - - return NSApplicationMain(argc, argv); - - //setUpForUIUnitTestsIfBeingTested modifies the system-wide color profile. Make sure it gets restored. - GTMRestoreColorProfile(); -} diff --git a/framework/xcconfig/CorePlot.xcconfig b/framework/xcconfig/CorePlot.xcconfig new file mode 100644 index 000000000..e7f5cc5f7 --- /dev/null +++ b/framework/xcconfig/CorePlot.xcconfig @@ -0,0 +1,36 @@ +#include "CorePlotWarnings.xcconfig" + +ARCHS = $(ARCHS_STANDARD) +VALID_ARCHS[sdk=iphoneos*] = arm64 arm64e armv7 armv7s +VALID_ARCHS[sdk=iphonesimulator*] = i386 x86_64 +VALID_ARCHS[sdk=macosx*] = i386 x86_64 arm64 +VALID_ARCHS[sdk=appletvos*] = arm64 +VALID_ARCHS[sdk=appletvsimulator*] = i386 x86_64 + +IPHONEOS_DEPLOYMENT_TARGET = 8.0 +MACOSX_DEPLOYMENT_TARGET = 10.8 +TVOS_DEPLOYMENT_TARGET = 9.0 + +SYMROOT = $(PROJECT_DIR)/../build + +ALWAYS_SEARCH_USER_PATHS = NO +CLANG_ENABLE_OBJC_ARC = YES +CLANG_STATIC_ANALYZER_MODE = shallow +CLANG_STATIC_ANALYZER_MODE_ON_ANALYZE_ACTION = deep +COMBINE_HIDPI_IMAGES = YES +COPY_PHASE_STRIP = YES +DEAD_CODE_STRIPPING = YES +DEBUG_INFORMATION_FORMAT = dwarf-with-dsym +GCC_C_LANGUAGE_STANDARD = c99 +GCC_DYNAMIC_NO_PIC = NO +GCC_PRECOMPILE_PREFIX_HEADER = YES +GCC_PREFIX_HEADER = CorePlot_Prefix.pch +LINKER_DISPLAYS_MANGLED_NAMES = NO +OTHER_LDFLAGS = -ObjC +RUN_CLANG_STATIC_ANALYZER = YES +SEPARATE_STRIP = YES +SKIP_INSTALL = YES +STRIP_STYLE = debugging +STRIP_SWIFT_SYMBOLS = YES +SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule" +USE_HEADERMAP = NO diff --git a/framework/xcconfig/CorePlotDebug.xcconfig b/framework/xcconfig/CorePlotDebug.xcconfig new file mode 100644 index 000000000..b4bcbc7e7 --- /dev/null +++ b/framework/xcconfig/CorePlotDebug.xcconfig @@ -0,0 +1,10 @@ +#include "CorePlot.xcconfig" + +ONLY_ACTIVE_ARCH = YES +VALIDATE_PRODUCT = NO +DEPLOYMENT_POSTPROCESSING = NO +STRIP_INSTALLED_PRODUCT = NO +GCC_OPTIMIZATION_LEVEL = 0 +GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) +ENABLE_NS_ASSERTIONS = YES +COPY_PHASE_STRIP = NO diff --git a/framework/xcconfig/CorePlotRelease.xcconfig b/framework/xcconfig/CorePlotRelease.xcconfig new file mode 100644 index 000000000..8d9600513 --- /dev/null +++ b/framework/xcconfig/CorePlotRelease.xcconfig @@ -0,0 +1,9 @@ +#include "CorePlot.xcconfig" + +ONLY_ACTIVE_ARCH = NO +VALIDATE_PRODUCT = YES +DEPLOYMENT_POSTPROCESSING = YES +STRIP_INSTALLED_PRODUCT = YES +GCC_OPTIMIZATION_LEVEL = s +ENABLE_NS_ASSERTIONS = NO +COPY_PHASE_STRIP = YES diff --git a/framework/xcconfig/CorePlotWarnings.xcconfig b/framework/xcconfig/CorePlotWarnings.xcconfig new file mode 100644 index 000000000..8c11ec296 --- /dev/null +++ b/framework/xcconfig/CorePlotWarnings.xcconfig @@ -0,0 +1,103 @@ +ASSETCATALOG_WARNINGS = YES + +CLANG_ANALYZER_DEADCODE_DEADSTORES = YES +CLANG_ANALYZER_GCD = YES +CLANG_ANALYZER_LOCALIZABILITY_EMPTY_CONTEXT = YES +CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES +CLANG_ANALYZER_MEMORY_MANAGEMENT = YES +CLANG_ANALYZER_NONNULL = YES +CLANG_ANALYZER_OBJC_ATSYNC = YES +CLANG_ANALYZER_OBJC_COLLECTIONS = YES +CLANG_ANALYZER_OBJC_DEALLOC = YES +CLANG_ANALYZER_OBJC_GENERICS = YES +CLANG_ANALYZER_OBJC_INCOMP_METHOD_TYPES = YES +CLANG_ANALYZER_OBJC_NSCFERROR = YES +CLANG_ANALYZER_OBJC_RETAIN_COUNT = YES +CLANG_ANALYZER_OBJC_SELF_INIT = YES +CLANG_ANALYZER_OBJC_UNUSED_IVARS = YES +CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES +CLANG_ANALYZER_SECURITY_INSECUREAPI_GETPW_GETS = YES +CLANG_ANALYZER_SECURITY_INSECUREAPI_MKSTEMP = YES +CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES +CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES +CLANG_ANALYZER_SECURITY_INSECUREAPI_UNCHECKEDRETURN = YES +CLANG_ANALYZER_SECURITY_INSECUREAPI_VFORK = YES +CLANG_ANALYZER_SECURITY_KEYCHAIN_API = YES + +CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_ASSIGN_ENUM = YES +CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES +CLANG_WARN_BOOL_CONVERSION = YES +CLANG_WARN_COMMA = YES +CLANG_WARN_CONSTANT_CONVERSION = YES +CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES +CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES +CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES +CLANG_WARN_DOCUMENTATION_COMMENTS = YES +CLANG_WARN_EMPTY_BODY = YES +CLANG_WARN_ENUM_CONVERSION = YES +CLANG_WARN_FLOAT_CONVERSION = YES +CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES +CLANG_WARN_INFINITE_RECURSION = YES +CLANG_WARN_INT_CONVERSION = YES +CLANG_WARN_MISSING_NOESCAPE = YES +CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES +CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION = YES +CLANG_WARN_OBJC_EXPLICIT_OWNERSHIP_TYPE = YES +CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = NO +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +CLANG_WARN_OBJC_INTERFACE_IVARS = YES +CLANG_WARN_OBJC_LITERAL_CONVERSION = YES +CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS = YES +CLANG_WARN_OBJC_RECEIVER_WEAK = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_ROOT_CLASS = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_PRIVATE_MODULE = YES +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +CLANG_WARN_RANGE_LOOP_ANALYSIS = YES +CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY =YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES +CLANG_WARN_SUSPICIOUS_MOVE = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN_UNREACHABLE_CODE = YES_AGGRESSIVE + +ENABLE_STRICT_OBJC_MSGSEND = YES + +GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES +GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES +GCC_TREAT_WARNINGS_AS_ERRORS = YES + +GCC_WARN_64_TO_32_BIT_CONVERSION = YES +GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES +GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = YES +GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES +GCC_WARN_ABOUT_MISSING_NEWLINE = YES +GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES +GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES +GCC_WARN_ABOUT_RETURN_TYPE = YES +GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES +GCC_WARN_CHECK_SWITCH_STATEMENTS = YES +GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES +GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES +GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES +GCC_WARN_MISSING_PARENTHESES = YES +GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = NO +GCC_WARN_SHADOW = YES +GCC_WARN_SIGN_COMPARE = YES +GCC_WARN_STRICT_SELECTOR_MATCH = NO +GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES +GCC_WARN_UNDECLARED_SELECTOR = YES +GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE +GCC_WARN_UNKNOWN_PRAGMAS = YES +GCC_WARN_UNUSED_FUNCTION = YES +GCC_WARN_UNUSED_LABEL = YES +GCC_WARN_UNUSED_PARAMETER = YES +GCC_WARN_UNUSED_VALUE = YES +GCC_WARN_UNUSED_VARIABLE = YES + +IBC_WARNINGS = YES + +WARNING_CFLAGS = -Weverything -Wno-undef -Wno-switch-enum -Wno-float-equal -Wno-custom-atomic-properties -Wno-pedantic -Wno-documentation -Wno-documentation-unknown-command -Wno-partial-availability -Wno-objc-messaging-id diff --git a/scripts/README Creating a release package.md b/scripts/README Creating a release package.md index 0ba3e8c78..bcfb6724c 100644 --- a/scripts/README Creating a release package.md +++ b/scripts/README Creating a release package.md @@ -5,51 +5,54 @@ Follow these steps to create a Core Plot release and post it to GitHub: 1. Ensure the following tools are installed on your development machine:
    -
  • Xcode 5
  • -
  • [Doxygen](http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc), version 1.8.9.1 or later, installed in /Applications
  • -
  • [Graphviz](http://www.graphviz.org/Download_macos.php), version 2.34.0 or later
  • +
  • Xcode 11
  • +
  • [Doxygen](http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc), version 1.8.12 or later, installed in /Applications
  • +
  • [Graphviz](http://www.graphviz.org/Download_macos.php), version 2.36.0 or later
2. Ensure the [change log](https://github.com/core-plot/core-plot/blob/master/documentation/changelog.markdown) and [podspec](https://github.com/core-plot/core-plot/blob/master/CorePlot.podspec) are up-to-date and committed to the Git repository. -3. Using Git, ensure your local Core Plot source directory is in sync with the public repository on GitHub. +3. In the "Core Plot" project build settings, set the "Current Project Version" to the release version. Commit the change in Git. -4. Open the Terminal application and `cd` to the root directory of your local Core Plot source directory. +4. Using Git, ensure your local Core Plot source directory is in sync with the public repository on GitHub. -5. Tag the current revision with the release version: +5. Open the Terminal application and `cd` to the root directory of your local Core Plot source directory. + +6. Tag the current revision with the release version: `$ git tag release_` where **<version>** is the version number for this release. -6. Change to the **scripts** folder: +7. Change to the **scripts** folder: `$ cd scripts` -7. Run the createrelease script: +8. Run the createrelease script: `$ python createrelease.py ` -8. Review the messages printed in the Terminal window and verify that all build steps succeeded. +9. Review the messages printed in the Terminal window and verify that all build steps succeeded. -9. The release products were placed in a folder called **CorePlot_<version>** and placed on your desktop. Open this folder and verify that the following subfolders and files are present: +10. The release products were placed in a folder called **CorePlot_<version>** and placed on your desktop. Open this folder and verify that the following subfolders and files are present:
  • Binaries/iOS/
  • Binaries/MacOS/
  • +
  • Binaries/tvOS/
  • Documentation/
  • READMEs/
  • Source/
  • License.txt
-10. Right-click the release folder on your desktop and select **Compress "<filename>"** from the menu. +11. Right-click the release folder on your desktop and select **Compress "<filename>"** from the menu. -11. Log into GitHub and navigate to the [Releases](https://github.com/core-plot/core-plot/releases) page. +12. Log into GitHub and navigate to the [Releases](https://github.com/core-plot/core-plot/releases) page. -12. Click **Draft a new release**. +13. Click **Draft a new release**. -13. Select the tag for the new release (`release_`). +14. Select the tag for the new release (`release_`). Enter the following: @@ -58,7 +61,7 @@ Follow these steps to create a Core Plot release and post it to GitHub:
  • Binaries: drag the Core Plot zip file on your desktop to the box
  • -14. Click **Publish release**. +15. Click **Publish release**. # Update Documentation @@ -96,5 +99,4 @@ Follow these steps to create a Core Plot release and post it to GitHub:
    • The Core Plot [discussion board](https://groups.google.com/forum/#!forum/coreplot-discuss)
    • [Twitter](https://twitter.com/CorePlot)
    • -
    • [App.net](https://alpha.app.net/coreplot)
    diff --git a/scripts/createrelease.py b/scripts/createrelease.py old mode 100755 new mode 100644 index 9b41bc119..9375881c2 --- a/scripts/createrelease.py +++ b/scripts/createrelease.py @@ -58,31 +58,41 @@ def RunXcode(project, target): binariesDir = join(releaseRootDir, 'Binaries') macosDir = join(binariesDir, 'MacOS') iosDir = join(binariesDir, 'iOS') +tvosDir = join(binariesDir, 'tvOS') makedirs(macosDir) mkdir(iosDir) +mkdir(tvosDir) # Build Mac Framework chdir('framework') -RunXcode('CorePlot.xcodeproj', 'CorePlot') +RunXcode('CorePlot.xcodeproj', 'CorePlot Mac') macProductsDir = join(projectRoot, 'build/Release') macFramework = join(macProductsDir, 'CorePlot.framework') copytree(macFramework, join(macosDir, 'CorePlot.framework'), symlinks=True) +# Build iOS Framework +RunXcode('CorePlot.xcodeproj', 'Universal iOS Framework') +iOSProductsDir = join(projectRoot, 'build/Release-iphoneuniversal') +iOSFramework = join(iOSProductsDir, 'CorePlot.framework') +copytree(iOSFramework, join(iosDir, 'CorePlot.framework'), symlinks=True) + # Build iOS Static Library -RunXcode('CorePlot-CocoaTouch.xcodeproj', 'Universal Library') +RunXcode('CorePlot.xcodeproj', 'Universal Library') iOSLibFile = join(join(projectRoot, 'build/Release-universal'), 'libCorePlot-CocoaTouch.a') copy(iOSLibFile, iosDir) iOSHeaderFile = join(join(projectRoot, 'build/Release-universal'), 'CorePlotHeaders') copytree(iOSHeaderFile, join(iosDir, 'CorePlotHeaders')) +# Build tvOS Framework +RunXcode('CorePlot.xcodeproj', 'Universal tvOS Framework') +tvOSProductsDir = join(projectRoot, 'build/Release-appletvuniversal') +tvOSFramework = join(tvOSProductsDir, 'CorePlot.framework') +copytree(tvOSFramework, join(tvosDir, 'CorePlot.framework'), symlinks=True) + # Build Docs -RunXcode('CorePlot.xcodeproj', 'Documentation') -RunXcode('CorePlot-CocoaTouch.xcodeproj', 'Documentation') +RunXcode('CorePlot.xcodeproj', 'Documentation-Mac') +RunXcode('CorePlot.xcodeproj', 'Documentation-iOS') # Copy Docs docDir = join(releaseRootDir, 'Documentation') copytree(join(projectRoot, 'documentation'), docDir, ignore=ignore_patterns('*.orig','*.git')) -homeDir = environ['HOME'] -docsetsDir = join(homeDir, 'Library/Developer/Shared/Documentation/DocSets') -copytree(join(docsetsDir, 'com.CorePlot.Framework.docset'), join(docDir, 'com.CorePlot.Framework.docset')) -copytree(join(docsetsDir, 'com.CorePlotTouch.Framework.docset'), join(docDir, 'com.CorePlotTouch.Framework.docset')) diff --git a/scripts/prefixer.py b/scripts/prefixer.py old mode 100755 new mode 100644 diff --git a/scripts/uncrustify.cfg b/scripts/uncrustify.cfg index 20202e81f..adf13c0dd 100644 --- a/scripts/uncrustify.cfg +++ b/scripts/uncrustify.cfg @@ -1,461 +1,713 @@ -# Uncrustify 0.60 -newlines = auto -input_tab_size = 4 -output_tab_size = 4 -string_escape_char = 92 -string_escape_char2 = 0 -tok_split_gte = false -utf8_bom = remove -utf8_byte = false -utf8_force = false -indent_columns = 4 -indent_continue = 0 -indent_with_tabs = 0 -indent_cmt_with_tabs = false -indent_align_string = true -indent_xml_string = 4 -indent_brace = 0 -indent_braces = false -indent_braces_no_func = false -indent_braces_no_class = false -indent_braces_no_struct = false -indent_brace_parent = false -indent_namespace = false -indent_namespace_level = 0 -indent_namespace_limit = 0 -indent_extern = false -indent_class = true -indent_class_colon = false -indent_ctor_init_leading = 2 -indent_ctor_init = 0 -indent_else_if = false -indent_var_def_blk = 0 -indent_var_def_cont = false -indent_func_def_force_col1 = false -indent_func_call_param = false -indent_func_def_param = false -indent_func_proto_param = false -indent_func_class_param = false -indent_func_ctor_var_param = false -indent_template_param = false -indent_func_param_double = false -indent_func_const = 1 -indent_func_throw = 1 -indent_member = 1 -indent_sing_line_comments = 0 -indent_relative_single_line_comments = true -indent_switch_case = 4 -indent_case_shift = 0 -indent_case_brace = 0 -indent_col1_comment = false -indent_label = 1 -indent_access_spec = 1 -indent_access_spec_body = false -indent_paren_nl = false -indent_paren_close = 1 -indent_comma_paren = false -indent_bool_paren = false -indent_first_bool_expr = false -indent_square_nl = false -indent_preserve_sql = true -indent_align_assign = true -indent_oc_block = true -indent_oc_block_msg = 0 -indent_oc_msg_colon = 0 -sp_arith = force -sp_assign = force -sp_cpp_lambda_assign = ignore -sp_cpp_lambda_paren = ignore -sp_assign_default = force -sp_before_assign = ignore -sp_after_assign = ignore -sp_enum_assign = force -sp_enum_before_assign = ignore -sp_enum_after_assign = ignore -sp_pp_concat = force -sp_pp_stringify = remove -sp_before_pp_stringify = ignore -sp_bool = force -sp_compare = force -sp_inside_paren = remove -sp_paren_paren = remove -sp_cparen_oparen = remove -sp_balance_nested_parens = true -sp_paren_brace = force -sp_before_ptr_star = force -sp_before_unnamed_ptr_star = force -sp_between_ptr_star = remove -sp_after_ptr_star = remove -sp_after_ptr_star_func = remove -sp_ptr_star_paren = remove -sp_before_ptr_star_func = force -sp_before_byref = force -sp_before_unnamed_byref = force -sp_after_byref = remove -sp_after_byref_func = remove -sp_before_byref_func = force -sp_after_type = force -sp_before_template_paren = ignore -sp_template_angle = force -sp_before_angle = remove -sp_inside_angle = remove -sp_after_angle = remove -sp_angle_paren = remove -sp_angle_word = force -sp_angle_shift = add -sp_permit_cpp11_shift = false -sp_before_sparen = force -sp_inside_sparen = force -sp_inside_sparen_close = ignore -sp_inside_sparen_open = ignore -sp_after_sparen = force -sp_sparen_brace = force -sp_invariant_paren = ignore -sp_after_invariant_paren = ignore -sp_special_semi = force -sp_before_semi = remove -sp_before_semi_for = remove -sp_before_semi_for_empty = remove -sp_after_semi = force -sp_after_semi_for = force -sp_after_semi_for_empty = force -sp_before_square = remove -sp_before_squares = remove -sp_inside_square = remove -sp_after_comma = force -sp_before_comma = remove -sp_paren_comma = force -sp_before_ellipsis = remove -sp_after_class_colon = force -sp_before_class_colon = force -sp_before_case_colon = remove -sp_after_operator = remove -sp_after_operator_sym = force -sp_after_cast = remove -sp_inside_paren_cast = remove -sp_cpp_cast_paren = remove -sp_sizeof_paren = remove -sp_after_tag = ignore -sp_inside_braces_enum = remove -sp_inside_braces_struct = remove -sp_inside_braces = force -sp_inside_braces_empty = remove -sp_type_func = force -sp_func_proto_paren = remove -sp_func_def_paren = remove -sp_inside_fparens = remove -sp_inside_fparen = remove -sp_inside_tparen = remove -sp_after_tparen_close = remove -sp_square_fparen = remove -sp_fparen_brace = force -sp_func_call_paren = remove -sp_func_call_paren_empty = ignore -sp_func_call_user_paren = remove -sp_func_class_paren = remove -sp_return_paren = force -sp_attribute_paren = remove -sp_defined_paren = remove -sp_throw_paren = force -sp_after_throw = force -sp_catch_paren = force -sp_version_paren = ignore -sp_scope_paren = ignore -sp_macro = force -sp_macro_func = force -sp_else_brace = force -sp_brace_else = force -sp_brace_typedef = force -sp_catch_brace = force -sp_brace_catch = force -sp_finally_brace = force -sp_brace_finally = force -sp_try_brace = force -sp_getset_brace = force -sp_word_brace = add -sp_word_brace_ns = add -sp_before_dc = remove -sp_after_dc = remove -sp_d_array_colon = remove -sp_not = remove -sp_inv = remove -sp_addr = remove -sp_member = remove -sp_deref = remove -sp_sign = remove -sp_incdec = remove -sp_before_nl_cont = force -sp_after_oc_scope = remove -sp_after_oc_colon = remove -sp_before_oc_colon = remove -sp_after_oc_dict_colon = force -sp_before_oc_dict_colon = remove -sp_after_send_oc_colon = remove -sp_before_send_oc_colon = remove -sp_after_oc_type = remove -sp_after_oc_return_type = remove -sp_after_oc_at_sel = remove -sp_after_oc_at_sel_parens = force -sp_inside_oc_at_sel_parens = remove -sp_before_oc_block_caret = force -sp_after_oc_block_caret = remove -sp_after_oc_msg_receiver = force -sp_after_oc_property = force -sp_cond_colon = force -sp_cond_question = force -sp_case_label = force -sp_range = ignore -sp_after_for_colon = ignore -sp_before_for_colon = ignore -sp_extern_paren = remove -sp_cmt_cpp_start = ignore -sp_endif_cmt = force -sp_after_new = force -sp_before_tr_emb_cmt = force -sp_num_before_tr_emb_cmt = 1 -sp_annotation_paren = ignore -align_keep_tabs = false -align_with_tabs = false -align_on_tabstop = false -align_number_left = false -align_keep_extra_space = false -align_func_params = true -align_same_func_call_params = false -align_var_def_span = 0 -align_var_def_star_style = 1 -align_var_def_amp_style = 1 -align_var_def_thresh = 0 -align_var_def_gap = 0 -align_var_def_colon = true -align_var_def_attribute = true -align_var_def_inline = true -align_assign_span = 1 -align_assign_thresh = 0 -align_enum_equ_span = 1 -align_enum_equ_thresh = 0 -align_var_struct_span = 1 -align_var_struct_thresh = 0 -align_var_struct_gap = 1 -align_struct_init_span = 2 -align_typedef_gap = 1 -align_typedef_span = 2 -align_typedef_func = 0 -align_typedef_star_style = 1 -align_typedef_amp_style = 1 -align_right_cmt_span = 2 -align_right_cmt_mix = false -align_right_cmt_gap = 1 -align_right_cmt_at_col = 1 -align_func_proto_span = 2 -align_func_proto_gap = 1 -align_on_operator = true -align_mix_var_proto = true -align_single_line_func = true -align_single_line_brace = true -align_single_line_brace_gap = 1 -align_oc_msg_spec_span = 0 -align_nl_cont = false -align_pp_define_together = false -align_pp_define_gap = 1 -align_pp_define_span = 2 -align_left_shift = true -align_oc_msg_colon_span = 16 -align_oc_msg_colon_first = false -align_oc_decl_colon = true -nl_collapse_empty_body = false -nl_assign_leave_one_liners = true -nl_class_leave_one_liners = false -nl_enum_leave_one_liners = true -nl_getset_leave_one_liners = false -nl_func_leave_one_liners = true -nl_cpp_lambda_leave_one_liners = false -nl_if_leave_one_liners = false -nl_oc_msg_leave_one_liner = false -nl_start_of_file = remove -nl_start_of_file_min = 0 -nl_end_of_file = force -nl_end_of_file_min = 1 -nl_assign_brace = remove -nl_assign_square = ignore -nl_after_square_assign = ignore -nl_func_var_def_blk = 1 -nl_typedef_blk_start = 0 -nl_typedef_blk_end = 0 -nl_typedef_blk_in = 0 -nl_var_def_blk_start = 0 -nl_var_def_blk_end = 0 -nl_var_def_blk_in = 0 -nl_fcall_brace = force -nl_enum_brace = remove -nl_struct_brace = remove -nl_union_brace = remove -nl_if_brace = remove -nl_brace_else = force -nl_elseif_brace = remove -nl_else_brace = remove -nl_else_if = remove -nl_brace_finally = force -nl_finally_brace = remove -nl_try_brace = remove -nl_getset_brace = force -nl_for_brace = remove -nl_catch_brace = remove -nl_brace_catch = force -nl_while_brace = remove -nl_scope_brace = ignore -nl_unittest_brace = ignore -nl_version_brace = ignore -nl_using_brace = ignore -nl_brace_brace = force -nl_do_brace = remove -nl_brace_while = force -nl_switch_brace = remove -nl_multi_line_cond = false -nl_multi_line_define = false -nl_before_case = true -nl_before_throw = force -nl_after_case = true -nl_case_colon_brace = force -nl_namespace_brace = force -nl_template_class = force -nl_class_brace = force -nl_class_init_args = force -nl_func_type_name = remove -nl_func_type_name_class = ignore -nl_func_scope_name = remove -nl_func_proto_type_name = remove -nl_func_paren = remove -nl_func_def_paren = ignore -nl_func_decl_start = remove -nl_func_def_start = ignore -nl_func_decl_start_single = ignore -nl_func_def_start_single = ignore -nl_func_decl_args = ignore -nl_func_def_args = ignore -nl_func_decl_end = ignore -nl_func_def_end = ignore -nl_func_decl_end_single = ignore -nl_func_def_end_single = ignore -nl_func_decl_empty = ignore -nl_func_def_empty = ignore -nl_oc_msg_args = false -nl_fdef_brace = force -nl_cpp_ldef_brace = ignore -nl_return_expr = remove -nl_after_semicolon = true -nl_after_brace_open = true -nl_after_brace_open_cmt = false -nl_after_vbrace_open = true -nl_after_vbrace_open_empty = false -nl_after_brace_close = false -nl_after_vbrace_close = false -nl_brace_struct_var = force -nl_define_macro = false -nl_squeeze_ifdef = true -nl_before_if = ignore -nl_after_if = ignore -nl_before_for = ignore -nl_after_for = ignore -nl_before_while = ignore -nl_after_while = ignore -nl_before_switch = ignore -nl_after_switch = ignore -nl_before_do = ignore -nl_after_do = ignore -nl_ds_struct_enum_cmt = false -nl_ds_struct_enum_close_brace = false -nl_class_colon = remove -nl_create_if_one_liner = true -nl_create_for_one_liner = false -nl_create_while_one_liner = false -pos_arith = trail -pos_assign = trail -pos_bool = trail -pos_compare = trail -pos_conditional = trail -pos_comma = trail -pos_class_comma = trail -pos_class_colon = trail -code_width = 0 -ls_for_split_full = true -ls_func_split_full = true -ls_code_width = false -nl_max = 2 -nl_after_func_proto = 1 -nl_after_func_proto_group = 2 -nl_after_func_body = 2 -nl_after_func_body_class = 0 -nl_after_func_body_one_liner = 1 -nl_before_block_comment = 2 -nl_before_c_comment = 2 -nl_before_cpp_comment = 1 -nl_after_multiline_comment = false -nl_after_struct = 0 -nl_after_class = 0 -nl_before_access_spec = 2 -nl_after_access_spec = 1 -nl_comment_func_def = 1 -nl_after_try_catch_finally = 1 -nl_around_cs_property = 1 -nl_between_get_set = 1 -nl_property_brace = ignore -eat_blanks_after_open_brace = true -eat_blanks_before_close_brace = true -nl_remove_extra_newlines = 0 -nl_before_return = false -nl_after_return = true -nl_after_annotation = ignore -nl_between_annotation = ignore -mod_full_brace_do = force -mod_full_brace_for = force -mod_full_brace_function = force -mod_full_brace_if = force -mod_full_brace_if_chain = false -mod_full_brace_nl = 1 -mod_full_brace_while = force -mod_full_brace_using = ignore -mod_paren_on_return = remove -mod_pawn_semicolon = true -mod_full_paren_if_bool = true -mod_remove_extra_semicolon = true -mod_add_long_function_closebrace_comment = 0 +# Uncrustify_d-0.70.1 +newlines = auto +input_tab_size = 4 +output_tab_size = 4 +string_escape_char = 92 +string_escape_char2 = 0 +string_replace_tab_chars = false +tok_split_gte = false +disable_processing_cmt = "" +enable_processing_cmt = "" +enable_digraphs = false +utf8_bom = remove +utf8_byte = false +utf8_force = false +sp_do_brace_open = ignore +sp_brace_close_while = ignore +sp_while_paren_open = ignore +sp_arith = force +sp_arith_additive = ignore +sp_assign = force +sp_cpp_lambda_assign = ignore +sp_cpp_lambda_square_paren = ignore +sp_cpp_lambda_square_brace = ignore +sp_cpp_lambda_paren_brace = ignore +sp_cpp_lambda_fparen = ignore +sp_assign_default = force +sp_before_assign = ignore +sp_after_assign = ignore +sp_enum_paren = force +sp_enum_assign = force +sp_enum_before_assign = ignore +sp_enum_after_assign = ignore +sp_enum_colon = ignore +sp_pp_concat = force +sp_pp_stringify = remove +sp_before_pp_stringify = ignore +sp_bool = force +sp_compare = force +sp_inside_paren = remove +sp_paren_paren = remove +sp_cparen_oparen = remove +sp_balance_nested_parens = false +sp_paren_brace = force +sp_brace_brace = force +sp_before_ptr_star = force +sp_before_unnamed_ptr_star = force +sp_between_ptr_star = remove +sp_after_ptr_star = remove +sp_after_ptr_block_caret = remove +sp_after_ptr_star_qualifier = remove +sp_after_ptr_star_func = remove +sp_ptr_star_paren = remove +sp_before_ptr_star_func = force +sp_before_byref = force +sp_before_unnamed_byref = force +sp_after_byref = remove +sp_after_byref_func = remove +sp_before_byref_func = force +sp_after_type = force +sp_after_decltype = ignore +sp_before_template_paren = ignore +sp_template_angle = force +sp_before_angle = remove +sp_inside_angle = remove +sp_inside_angle_empty = remove +sp_angle_colon = ignore +sp_after_angle = remove +sp_angle_paren = remove +sp_angle_paren_empty = remove +sp_angle_word = force +sp_angle_shift = add +sp_permit_cpp11_shift = false +sp_before_sparen = force +sp_inside_sparen = force +sp_inside_sparen_open = ignore +sp_inside_sparen_close = ignore +sp_after_sparen = force +sp_sparen_brace = force +sp_invariant_paren = ignore +sp_after_invariant_paren = ignore +sp_special_semi = force +sp_before_semi = remove +sp_before_semi_for = remove +sp_before_semi_for_empty = remove +sp_after_semi = force +sp_after_semi_for = force +sp_after_semi_for_empty = force +sp_before_square = remove +sp_before_vardef_square = remove +sp_before_square_asm_block = ignore +sp_before_squares = remove +sp_cpp_before_struct_binding = remove +sp_inside_square = remove +sp_inside_square_oc_array = remove +sp_after_comma = force +sp_before_comma = remove +sp_after_mdatype_commas = remove +sp_before_mdatype_commas = remove +sp_between_mdatype_commas = remove +sp_paren_comma = force +sp_before_ellipsis = remove +sp_type_ellipsis = remove +sp_type_question = remove +sp_paren_ellipsis = remove +sp_paren_qualifier = remove +sp_paren_noexcept = remove +sp_after_class_colon = force +sp_before_class_colon = force +sp_after_constr_colon = remove +sp_before_constr_colon = remove +sp_before_case_colon = remove +sp_after_operator = remove +sp_after_operator_sym = force +sp_after_operator_sym_empty = ignore +sp_after_cast = remove +sp_inside_paren_cast = remove +sp_cpp_cast_paren = remove +sp_sizeof_paren = remove +sp_sizeof_ellipsis = remove +sp_sizeof_ellipsis_paren = remove +sp_decltype_paren = remove +sp_after_tag = remove +sp_inside_braces_enum = remove +sp_inside_braces_struct = remove +sp_inside_braces_oc_dict = force +sp_after_type_brace_init_lst_open = ignore +sp_before_type_brace_init_lst_close = ignore +sp_inside_type_brace_init_lst = ignore +sp_inside_braces = force +sp_inside_braces_empty = remove +sp_trailing_return = remove +sp_type_func = force +sp_type_brace_init_lst = ignore +sp_func_proto_paren = remove +sp_func_proto_paren_empty = remove +sp_func_type_paren = remove +sp_func_def_paren = remove +sp_func_def_paren_empty = remove +sp_inside_fparens = remove +sp_inside_fparen = remove +sp_inside_tparen = remove +sp_after_tparen_close = remove +sp_square_fparen = remove +sp_fparen_brace = force +sp_fparen_brace_initializer = force +sp_fparen_dbrace = force +sp_func_call_paren = remove +sp_func_call_paren_empty = remove +sp_func_call_user_paren = remove +sp_func_call_user_inside_fparen = remove +sp_func_call_user_paren_paren = remove +sp_func_class_paren = remove +sp_func_class_paren_empty = remove +sp_return_paren = force +sp_return_brace = force +sp_attribute_paren = remove +sp_defined_paren = remove +sp_throw_paren = force +sp_after_throw = force +sp_catch_paren = force +sp_oc_catch_paren = force +sp_oc_classname_paren = force +sp_version_paren = ignore +sp_scope_paren = ignore +sp_super_paren = remove +sp_this_paren = remove +sp_macro = force +sp_macro_func = force +sp_else_brace = force +sp_brace_else = force +sp_brace_typedef = force +sp_catch_brace = force +sp_oc_catch_brace = force +sp_brace_catch = force +sp_oc_brace_catch = force +sp_finally_brace = force +sp_brace_finally = force +sp_try_brace = force +sp_getset_brace = force +sp_word_brace = add +sp_word_brace_ns = add +sp_before_dc = remove +sp_after_dc = remove +sp_d_array_colon = remove +sp_not = remove +sp_inv = remove +sp_addr = remove +sp_member = remove +sp_deref = remove +sp_sign = remove +sp_incdec = remove +sp_before_nl_cont = force +sp_after_oc_scope = remove +sp_after_oc_colon = remove +sp_before_oc_colon = remove +sp_after_oc_dict_colon = force +sp_before_oc_dict_colon = remove +sp_after_send_oc_colon = remove +sp_before_send_oc_colon = remove +sp_after_oc_type = remove +sp_after_oc_return_type = remove +sp_after_oc_at_sel = remove +sp_after_oc_at_sel_parens = force +sp_inside_oc_at_sel_parens = remove +sp_before_oc_block_caret = force +sp_after_oc_block_caret = remove +sp_after_oc_msg_receiver = force +sp_after_oc_property = force +sp_after_oc_synchronized = force +sp_cond_colon = force +sp_cond_colon_before = ignore +sp_cond_colon_after = ignore +sp_cond_question = force +sp_cond_question_before = ignore +sp_cond_question_after = ignore +sp_cond_ternary_short = ignore +sp_case_label = force +sp_range = ignore +sp_after_for_colon = ignore +sp_before_for_colon = ignore +sp_extern_paren = remove +sp_cmt_cpp_start = force +sp_cmt_cpp_doxygen = true +sp_cmt_cpp_qttr = false +sp_endif_cmt = force +sp_after_new = force +sp_between_new_paren = ignore +sp_after_newop_paren = ignore +sp_inside_newop_paren = ignore +sp_inside_newop_paren_open = ignore +sp_inside_newop_paren_close = ignore +sp_before_tr_emb_cmt = force +sp_num_before_tr_emb_cmt = 1 +sp_annotation_paren = ignore +sp_skip_vbrace_tokens = false +sp_after_noexcept = ignore +sp_vala_after_translation = ignore +force_tab_after_define = false +indent_columns = 4 +indent_continue = 0 +indent_continue_class_head = 0 +indent_single_newlines = false +indent_param = 0 +indent_with_tabs = 0 +indent_cmt_with_tabs = false +indent_align_string = true +indent_xml_string = 4 +indent_brace = 0 +indent_braces = false +indent_braces_no_func = false +indent_braces_no_class = false +indent_braces_no_struct = false +indent_brace_parent = false +indent_paren_open_brace = false +indent_cs_delegate_brace = false +indent_cs_delegate_body = false +indent_namespace = false +indent_namespace_single_indent = false +indent_namespace_level = 0 +indent_namespace_limit = 0 +indent_extern = false +indent_class = true +indent_class_colon = false +indent_class_on_colon = false +indent_constr_colon = false +indent_ctor_init_leading = 2 +indent_ctor_init = 0 +indent_else_if = false +indent_var_def_blk = 0 +indent_var_def_cont = false +indent_shift = false +indent_func_def_force_col1 = false +indent_func_call_param = false +indent_func_def_param = false +indent_func_def_param_paren_pos_threshold = 0 +indent_func_proto_param = false +indent_func_class_param = false +indent_func_ctor_var_param = false +indent_template_param = false +indent_func_param_double = false +indent_func_const = 1 +indent_func_throw = 1 +indent_macro_brace = true +indent_member = 1 +indent_member_single = false +indent_sing_line_comments = 0 +indent_relative_single_line_comments = true +indent_switch_case = 4 +indent_switch_break_with_case = false +indent_switch_pp = true +indent_case_shift = 0 +indent_case_brace = 0 +indent_col1_comment = false +indent_col1_multi_string_literal = false +indent_label = 1 +indent_access_spec = 1 +indent_access_spec_body = false +indent_paren_nl = false +indent_paren_close = 1 +indent_paren_after_func_def = false +indent_paren_after_func_decl = false +indent_paren_after_func_call = false +indent_comma_paren = false +indent_bool_paren = false +indent_semicolon_for_paren = false +indent_first_bool_expr = false +indent_first_for_expr = false +indent_square_nl = false +indent_preserve_sql = true +indent_align_assign = true +indent_align_paren = true +indent_oc_block = true +indent_oc_block_msg = 0 +indent_oc_msg_colon = 0 +indent_oc_msg_prioritize_first_colon = true +indent_oc_block_msg_xcode_style = false +indent_oc_block_msg_from_keyword = false +indent_oc_block_msg_from_colon = false +indent_oc_block_msg_from_caret = false +indent_oc_block_msg_from_brace = false +indent_min_vbrace_open = 0 +indent_vbrace_open_on_tabstop = false +indent_token_after_brace = true +indent_cpp_lambda_body = false +indent_using_block = true +indent_ternary_operator = 0 +indent_off_after_return_new = false +indent_single_after_return = false +indent_ignore_asm_block = false +nl_collapse_empty_body = false +nl_assign_leave_one_liners = true +nl_class_leave_one_liners = false +nl_enum_leave_one_liners = true +nl_getset_leave_one_liners = false +nl_cs_property_leave_one_liners = true +nl_func_leave_one_liners = true +nl_cpp_lambda_leave_one_liners = false +nl_if_leave_one_liners = false +nl_while_leave_one_liners = false +nl_for_leave_one_liners = false +nl_oc_msg_leave_one_liner = false +nl_oc_mdef_brace = force +nl_oc_block_brace = remove +nl_oc_before_interface = force +nl_oc_before_implementation = force +nl_oc_before_end = force +nl_oc_interface_brace = force +nl_oc_implementation_brace = force +nl_start_of_file = remove +nl_start_of_file_min = 0 +nl_end_of_file = force +nl_end_of_file_min = 1 +nl_assign_brace = remove +nl_assign_square = ignore +nl_tsquare_brace = ignore +nl_after_square_assign = ignore +nl_fcall_brace = force +nl_enum_brace = remove +nl_enum_class = ignore +nl_enum_class_identifier = ignore +nl_enum_identifier_colon = ignore +nl_enum_colon_type = ignore +nl_struct_brace = remove +nl_union_brace = remove +nl_if_brace = remove +nl_brace_else = force +nl_elseif_brace = remove +nl_else_brace = remove +nl_else_if = remove +nl_before_if_closing_paren = ignore +nl_brace_finally = force +nl_finally_brace = remove +nl_try_brace = remove +nl_getset_brace = force +nl_for_brace = remove +nl_catch_brace = remove +nl_oc_catch_brace = remove +nl_brace_catch = force +nl_oc_brace_catch = force +nl_brace_square = remove +nl_brace_fparen = remove +nl_while_brace = remove +nl_scope_brace = ignore +nl_unittest_brace = ignore +nl_version_brace = ignore +nl_using_brace = ignore +nl_brace_brace = force +nl_do_brace = remove +nl_brace_while = force +nl_switch_brace = remove +nl_synchronized_brace = remove +nl_multi_line_cond = false +nl_multi_line_sparen_open = ignore +nl_multi_line_sparen_close = ignore +nl_multi_line_define = false +nl_before_case = true +nl_after_case = true +nl_case_colon_brace = force +nl_before_throw = force +nl_namespace_brace = force +nl_template_class = force +nl_template_class_decl = force +nl_template_class_decl_special = force +nl_template_class_def = force +nl_template_class_def_special = force +nl_template_func = force +nl_template_func_decl = ignore +nl_template_func_decl_special = ignore +nl_template_func_def = force +nl_template_func_def_special = force +nl_template_var = ignore +nl_template_using = ignore +nl_class_brace = force +nl_class_init_args = force +nl_constr_init_args = ignore +nl_enum_own_lines = ignore +nl_func_type_name = remove +nl_func_type_name_class = ignore +nl_func_class_scope = ignore +nl_func_scope_name = remove +nl_func_proto_type_name = remove +nl_func_paren = remove +nl_func_paren_empty = ignore +nl_func_def_paren = remove +nl_func_def_paren_empty = ignore +nl_func_call_paren = ignore +nl_func_call_paren_empty = ignore +nl_func_decl_start = remove +nl_func_def_start = remove +nl_func_decl_start_single = ignore +nl_func_def_start_single = ignore +nl_func_decl_start_multi_line = false +nl_func_def_start_multi_line = false +nl_func_decl_args = ignore +nl_func_def_args = ignore +nl_func_decl_args_multi_line = false +nl_func_def_args_multi_line = false +nl_func_decl_end = remove +nl_func_def_end = remove +nl_func_decl_end_single = ignore +nl_func_def_end_single = ignore +nl_func_decl_end_multi_line = false +nl_func_def_end_multi_line = false +nl_func_decl_empty = remove +nl_func_def_empty = remove +nl_func_call_empty = ignore +nl_func_call_start = ignore +nl_func_call_start_multi_line = false +nl_func_call_args_multi_line = false +nl_func_call_end_multi_line = false +nl_template_start = false +nl_template_args = false +nl_template_end = false +nl_oc_msg_args = false +nl_fdef_brace = force +nl_fdef_brace_cond = force +nl_cpp_ldef_brace = ignore +nl_return_expr = remove +nl_after_semicolon = true +nl_paren_dbrace_open = ignore +nl_type_brace_init_lst = ignore +nl_type_brace_init_lst_open = ignore +nl_type_brace_init_lst_close = ignore +nl_after_brace_open = true +nl_after_brace_open_cmt = false +nl_after_vbrace_open = true +nl_after_vbrace_open_empty = false +nl_after_brace_close = false +nl_after_vbrace_close = false +nl_brace_struct_var = force +nl_define_macro = false +nl_squeeze_paren_close = false +nl_squeeze_ifdef = true +nl_squeeze_ifdef_top_level = false +nl_before_if = ignore +nl_after_if = ignore +nl_before_for = ignore +nl_after_for = ignore +nl_before_while = ignore +nl_after_while = ignore +nl_before_switch = ignore +nl_after_switch = ignore +nl_before_synchronized = ignore +nl_after_synchronized = ignore +nl_before_do = ignore +nl_after_do = ignore +nl_before_return = false +nl_after_return = true +nl_before_member = ignore +nl_after_member = ignore +nl_ds_struct_enum_cmt = false +nl_ds_struct_enum_close_brace = false +nl_class_colon = remove +nl_constr_colon = ignore +nl_namespace_two_to_one_liner = false +nl_create_if_one_liner = true +nl_create_for_one_liner = false +nl_create_while_one_liner = false +nl_create_func_def_one_liner = false +nl_create_list_one_liner = false +nl_split_if_one_liner = false +nl_split_for_one_liner = false +nl_split_while_one_liner = false +nl_max = 2 +nl_max_blank_in_func = 0 +nl_before_func_body_proto = 0 +nl_before_func_body_def = 0 +nl_before_func_class_proto = 0 +nl_before_func_class_def = 0 +nl_after_func_proto = 1 +nl_after_func_proto_group = 2 +nl_after_func_class_proto = 0 +nl_after_func_class_proto_group = 0 +nl_class_leave_one_liner_groups = false +nl_after_func_body = 2 +nl_after_func_body_class = 0 +nl_after_func_body_one_liner = 1 +nl_func_var_def_blk = 1 +nl_typedef_blk_start = 0 +nl_typedef_blk_end = 0 +nl_typedef_blk_in = 0 +nl_var_def_blk_start = 0 +nl_var_def_blk_end = 0 +nl_var_def_blk_in = 0 +nl_before_block_comment = 2 +nl_before_c_comment = 2 +nl_before_cpp_comment = 1 +nl_after_multiline_comment = false +nl_after_label_colon = false +nl_after_struct = 0 +nl_before_class = 0 +nl_after_class = 0 +nl_before_namespace = 0 +nl_inside_namespace = 0 +nl_after_namespace = 0 +nl_before_access_spec = 2 +nl_after_access_spec = 1 +nl_comment_func_def = 1 +nl_after_try_catch_finally = 1 +nl_around_cs_property = 1 +nl_between_get_set = 1 +nl_property_brace = ignore +eat_blanks_after_open_brace = true +eat_blanks_before_close_brace = true +nl_remove_extra_newlines = 0 +nl_after_annotation = ignore +nl_between_annotation = ignore +pos_arith = trail +pos_assign = trail +pos_bool = trail +pos_compare = trail +pos_conditional = trail +pos_comma = trail +pos_enum_comma = ignore +pos_class_comma = trail +pos_constr_comma = ignore +pos_class_colon = trail +pos_constr_colon = ignore +code_width = 0 +ls_for_split_full = true +ls_func_split_full = true +ls_code_width = false +align_keep_tabs = false +align_with_tabs = false +align_on_tabstop = false +align_number_right = false +align_keep_extra_space = false +align_func_params = true +align_func_params_span = 0 +align_func_params_thresh = 0 +align_func_params_gap = 0 +align_constr_value_span = 0 +align_constr_value_thresh = 0 +align_constr_value_gap = 0 +align_same_func_call_params = false +align_same_func_call_params_span = 0 +align_same_func_call_params_thresh = 0 +align_var_def_span = 0 +align_var_def_star_style = 1 +align_var_def_amp_style = 1 +align_var_def_thresh = 0 +align_var_def_gap = 0 +align_var_def_colon = true +align_var_def_colon_gap = 0 +align_var_def_attribute = true +align_var_def_inline = true +align_assign_span = 1 +align_assign_func_proto_span = 0 +align_assign_thresh = 0 +align_assign_decl_func = 0 +align_enum_equ_span = 1 +align_enum_equ_thresh = 0 +align_var_class_span = 0 +align_var_class_thresh = 0 +align_var_class_gap = 0 +align_var_struct_span = 1 +align_var_struct_thresh = 0 +align_var_struct_gap = 1 +align_struct_init_span = 2 +align_typedef_span = 2 +align_typedef_gap = 1 +align_typedef_func = 0 +align_typedef_star_style = 1 +align_typedef_amp_style = 1 +align_right_cmt_span = 2 +align_right_cmt_gap = 1 +align_right_cmt_mix = false +align_right_cmt_same_level = false +align_right_cmt_at_col = 1 +align_func_proto_span = 2 +align_func_proto_thresh = 0 +align_func_proto_gap = 1 +align_on_operator = true +align_mix_var_proto = true +align_single_line_func = true +align_single_line_brace = true +align_single_line_brace_gap = 1 +align_oc_msg_spec_span = 0 +align_nl_cont = false +align_pp_define_together = false +align_pp_define_span = 2 +align_pp_define_gap = 1 +align_left_shift = true +align_asm_colon = false +align_oc_msg_colon_span = 16 +align_oc_msg_colon_first = false +align_oc_decl_colon = true +cmt_width = 0 +cmt_reflow_mode = 0 +cmt_convert_tab_to_spaces = true +cmt_indent_multi = true +cmt_c_group = true +cmt_c_nl_start = true +cmt_c_nl_end = true +cmt_cpp_to_c = false +cmt_cpp_group = true +cmt_cpp_nl_start = true +cmt_cpp_nl_end = true +cmt_star_cont = true +cmt_sp_before_star_cont = 0 +cmt_sp_after_star_cont = 0 +cmt_multi_check_last = true +cmt_multi_first_len_minimum = 4 +cmt_insert_file_header = "" +cmt_insert_file_footer = "" +cmt_insert_func_header = "" +cmt_insert_class_header = "" +cmt_insert_oc_msg_header = "" +cmt_insert_before_preproc = false +cmt_insert_before_inlines = true +cmt_insert_before_ctor_dtor = false +mod_full_brace_do = force +mod_full_brace_for = force +mod_full_brace_function = force +mod_full_brace_if = force +mod_full_brace_if_chain = false +mod_full_brace_if_chain_only = false +mod_full_brace_while = force +mod_full_brace_using = ignore +mod_full_brace_nl = 1 +mod_full_brace_nl_block_rem_mlcond = false +mod_paren_on_return = remove +mod_pawn_semicolon = true +mod_full_paren_if_bool = true +mod_remove_extra_semicolon = true +mod_add_long_function_closebrace_comment = 0 mod_add_long_namespace_closebrace_comment = 0 -mod_add_long_switch_closebrace_comment = 0 -mod_add_long_ifdef_endif_comment = 0 -mod_add_long_ifdef_else_comment = 0 -mod_sort_import = true -mod_sort_using = false -mod_sort_include = true -mod_move_case_break = false -mod_case_brace = remove -mod_remove_empty_return = true -cmt_width = 0 -cmt_reflow_mode = 0 -cmt_indent_multi = true -cmt_c_group = true -cmt_c_nl_start = true -cmt_c_nl_end = true -cmt_cpp_group = true -cmt_cpp_nl_start = true -cmt_cpp_nl_end = true -cmt_cpp_to_c = false -cmt_star_cont = true -cmt_sp_before_star_cont = 0 -cmt_sp_after_star_cont = 0 -cmt_multi_check_last = true -cmt_insert_file_header = "" -cmt_insert_file_footer = "" -cmt_insert_func_header = "" -cmt_insert_class_header = "" -cmt_insert_oc_msg_header = "" -cmt_insert_before_preproc = false -pp_indent = force -pp_indent_at_level = false -pp_indent_count = 0 -pp_space = remove -pp_space_count = 0 -pp_indent_region = 0 -pp_region_indent_code = false -pp_indent_if = 0 -pp_if_indent_code = false -pp_define_at_level = false +mod_add_long_class_closebrace_comment = 0 +mod_add_long_switch_closebrace_comment = 0 +mod_add_long_ifdef_endif_comment = 0 +mod_add_long_ifdef_else_comment = 0 +mod_sort_case_sensitive = false +mod_sort_import = true +mod_sort_using = false +mod_sort_include = true +mod_move_case_break = false +mod_case_brace = remove +mod_remove_empty_return = true +mod_enum_last_comma = remove +mod_sort_oc_properties = false +mod_sort_oc_property_class_weight = 0 +mod_sort_oc_property_thread_safe_weight = 0 +mod_sort_oc_property_readwrite_weight = 0 +mod_sort_oc_property_reference_weight = 0 +mod_sort_oc_property_getter_weight = 0 +mod_sort_oc_property_setter_weight = 0 +mod_sort_oc_property_nullability_weight = 0 +pp_indent = force +pp_indent_at_level = false +pp_indent_count = 0 +pp_space = remove +pp_space_count = 0 +pp_indent_region = 0 +pp_region_indent_code = false +pp_indent_if = 0 +pp_if_indent_code = false +pp_define_at_level = false +pp_ignore_define_body = false +pp_indent_case = true +pp_indent_func_def = true +pp_indent_extern = true +pp_indent_brace = true +include_category_0 = "" +include_category_1 = "" +include_category_2 = "" +use_indent_func_call_param = true +use_indent_continue_only_once = false +indent_cpp_lambda_only_once = false +use_sp_after_angle_always = false +use_options_overriding_for_qt_macros = true +warn_level_tabs_found_in_verbatim_string_literals = 2 +# option(s) with 'not default' value: 332 +#