Core Plot (iOS and tvOS)
Cocoa plotting framework for macOS, iOS, and tvOS
CPTDefinitions.h
Go to the documentation of this file.
1 #import <Availability.h>
2 #import <TargetConditionals.h>
3 
5 
19 // This is based on Ryan Petrich's ZWRCompatibility: https://github.com/rpetrich/ZWRCompatibility
20 
21 #if TARGET_OS_IPHONE && defined(__IPHONE_5_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_5_0) && __clang__ && (__clang_major__ >= 3)
22 #define CPT_SDK_SUPPORTS_WEAK 1
23 #elif TARGET_OS_MAC && defined(__MAC_10_7) && (MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_7) && __clang__ && (__clang_major__ >= 3)
24 #define CPT_SDK_SUPPORTS_WEAK 1
25 #else
26 #define CPT_SDK_SUPPORTS_WEAK 0
27 #endif
28 
29 #if CPT_SDK_SUPPORTS_WEAK
30 #define cpt_weak_property weak
31 #else
32 #define cpt_weak_property unsafe_unretained
33 #endif
34 
35 // Deprecated method attribute
36 
43 #define cpt_deprecated __attribute__((deprecated))
44 
45 // Unused parameter attribute (DEBUG only)
46 
53 #ifdef DEBUG
54 #define cpt_unused
55 #else
56 #define cpt_unused __unused
57 #endif
58 
59 // Swift wrappers
60 
66 #define cpt_swift_enum __attribute__((swift_wrapper(enum)))
67 
73 #define cpt_swift_struct __attribute__((swift_wrapper(struct)))
74 
75 // Type safety defines
76 
83 #define CPTFloat(x) ((CGFloat)(x))
84 
92 #define CPTPointMake(x, y) CGPointMake((CGFloat)(x), (CGFloat)(y))
93 
101 #define CPTSizeMake(w, h) CGSizeMake((CGFloat)(w), (CGFloat)(h))
102 
112 #define CPTRectMake(x, y, w, h) CGRectMake((CGFloat)(x), (CGFloat)(y), (CGFloat)(w), (CGFloat)(h))
113 
122 #define CPTRectInset(rect, dx, dy) CGRectInset(rect, (CGFloat)(dx), (CGFloat)(dy))
123 
129 #define CPTNAN ((CGFloat)NAN)
130 
134 typedef NS_ENUM (NSInteger, CPTNumericType) {
138 };
139 
143 typedef NS_ENUM (NSInteger, CPTErrorBarType) {
147 };
148 
152 typedef NS_ENUM (NSInteger, CPTScaleType) {
159 };
160 
164 typedef NS_ENUM (NSInteger, CPTCoordinate) {
168  CPTCoordinateNone = NSIntegerMax
169 };
170 
174 typedef struct _CPTRGBAColor {
179 }
181 
185 typedef NS_CLOSED_ENUM(NSInteger, CPTSign) {
188  CPTSignNegative = -1
189 };
190 
194 typedef NS_ENUM (NSInteger, CPTRectAnchor) {
204 };
205 
209 typedef NS_ENUM (NSInteger, CPTAlignment) {
216 };
217 
221 typedef struct _CPTEdgeInsets {
226 }
228 
229 extern const CPTEdgeInsets CPTEdgeInsetsZero;
230 
231 extern const NSStringDrawingOptions CPTStringDrawingOptions;
232 
237 
242 
247 
252 
257 
262 
267 
272 
277 
282 
286 typedef void (^CPTQuickLookImageBlock)(__nonnull CGContextRef context, CGFloat scale, CGRect bounds);
CPTNumericTypeFloat
@ CPTNumericTypeFloat
Float.
Definition: CPTDefinitions.h:136
CPTCoordinateY
@ CPTCoordinateY
Y axis.
Definition: CPTDefinitions.h:166
NSMutableArray
CPTNumberArray
NSArray< NSNumber * > CPTNumberArray
An array of numbers.
Definition: CPTDefinitions.h:236
CPTValueArray
NSArray< NSValue * > CPTValueArray
An array of values.
Definition: CPTDefinitions.h:266
CPTErrorBarTypeConstantRatio
@ CPTErrorBarTypeConstantRatio
Constant ratio error bars.
Definition: CPTDefinitions.h:145
CPTMutableNumberArray
NSMutableArray< NSNumber * > CPTMutableNumberArray
A mutable array of numbers.
Definition: CPTDefinitions.h:241
CPTAlignmentCenter
@ CPTAlignmentCenter
Align horizontally to the center.
Definition: CPTDefinitions.h:211
CPTEdgeInsetsZero
const CPTEdgeInsets CPTEdgeInsetsZero
Defines a set of stretchable image edge insets where all of the values are zero (0).
Definition: CPTDefinitions.m:3
CPTRectAnchorBottomLeft
@ CPTRectAnchorBottomLeft
The bottom left corner.
Definition: CPTDefinitions.h:195
CPTMutableDictionary
NSMutableDictionary< NSString *, id > CPTMutableDictionary
A mutable dictionary with string keys and object values.
Definition: CPTDefinitions.h:281
CPTScaleTypeLogModulus
@ CPTScaleTypeLogModulus
Log-modulus axis scale.
Definition: CPTDefinitions.h:158
CPTAlignmentMiddle
@ CPTAlignmentMiddle
Align vertically to the middle.
Definition: CPTDefinitions.h:214
CPTAlignment
CPTAlignment
Label and constraint alignment constants.
Definition: CPTDefinitions.h:209
CPTSignNone
@ CPTSignNone
No offset.
Definition: CPTDefinitions.h:186
CPTRGBAColor::blue
CGFloat blue
The blue component (0 ≤ blue ≤ 1).
Definition: CPTDefinitions.h:177
CPTScaleTypeCategory
@ CPTScaleTypeCategory
Category axis scale.
Definition: CPTDefinitions.h:157
CPTMutableValueArray
NSMutableArray< NSValue * > CPTMutableValueArray
A mutable array of values.
Definition: CPTDefinitions.h:271
CPTRGBAColor
RGBA color for gradients.
Definition: CPTDefinitions.h:174
CPTRectAnchor
CPTRectAnchor
Locations around the edge of a rectangle.
Definition: CPTDefinitions.h:194
CPTRectAnchorBottom
@ CPTRectAnchorBottom
The bottom center.
Definition: CPTDefinitions.h:196
CPTErrorBarTypeCustom
@ CPTErrorBarTypeCustom
Custom error bars.
Definition: CPTDefinitions.h:144
CPTStringArray
NSArray< NSString * > CPTStringArray
An array of strings.
Definition: CPTDefinitions.h:256
CPTScaleTypeLinear
@ CPTScaleTypeLinear
Linear axis scale.
Definition: CPTDefinitions.h:153
CPTRectAnchorRight
@ CPTRectAnchorRight
The right middle.
Definition: CPTDefinitions.h:199
CPTRGBAColor::red
CGFloat red
The red component (0 ≤ red ≤ 1).
Definition: CPTDefinitions.h:175
CPTCoordinateNone
@ CPTCoordinateNone
Invalid coordinate value.
Definition: CPTDefinitions.h:168
CPTRectAnchorCenter
@ CPTRectAnchorCenter
The center of the rect.
Definition: CPTDefinitions.h:203
CPTRectAnchorTopRight
@ CPTRectAnchorTopRight
The top right.
Definition: CPTDefinitions.h:202
CPTNumericTypeInteger
@ CPTNumericTypeInteger
Integer.
Definition: CPTDefinitions.h:135
CPTEdgeInsets::right
CGFloat right
The right inset.
Definition: CPTDefinitions.h:225
CPTSign
CPTSign
Enumeration of label positioning offset directions.
Definition: CPTDefinitions.h:185
CPTAlignmentBottom
@ CPTAlignmentBottom
Align vertically to the bottom.
Definition: CPTDefinitions.h:215
CPTNumericTypeDouble
@ CPTNumericTypeDouble
Double.
Definition: CPTDefinitions.h:137
CGContextRef
typedef CGContextRef
CPTRectAnchorLeft
@ CPTRectAnchorLeft
The left middle.
Definition: CPTDefinitions.h:198
CPTMutableNumberSet
NSMutableSet< NSNumber * > CPTMutableNumberSet
A mutable set of numbers.
Definition: CPTDefinitions.h:251
CPTNumericType
CPTNumericType
Enumeration of numeric types.
Definition: CPTDefinitions.h:134
CGFloat
typedef CGFloat
CPTNumberSet
NSSet< NSNumber * > CPTNumberSet
A set of numbers.
Definition: CPTDefinitions.h:246
CPTEdgeInsets::bottom
CGFloat bottom
The bottom inset.
Definition: CPTDefinitions.h:224
CPTRectAnchorTop
@ CPTRectAnchorTop
The top center.
Definition: CPTDefinitions.h:201
CPTSignNegative
@ CPTSignNegative
Negative offset.
Definition: CPTDefinitions.h:188
CPTRectAnchorTopLeft
@ CPTRectAnchorTopLeft
The top left corner.
Definition: CPTDefinitions.h:200
CPTAlignmentTop
@ CPTAlignmentTop
Align vertically to the top.
Definition: CPTDefinitions.h:213
CPTMutableStringArray
NSMutableArray< NSString * > CPTMutableStringArray
A mutable array of strings.
Definition: CPTDefinitions.h:261
CPTCoordinate
CPTCoordinate
Enumeration of axis coordinates.
Definition: CPTDefinitions.h:164
CPTRGBAColor::green
CGFloat green
The green component (0 ≤ green ≤ 1).
Definition: CPTDefinitions.h:176
CPTEdgeInsets::top
CGFloat top
The top inset.
Definition: CPTDefinitions.h:222
NSArray
CPTRGBAColor::alpha
CGFloat alpha
The alpha component (0 ≤ alpha ≤ 1).
Definition: CPTDefinitions.h:178
CPTCoordinateZ
@ CPTCoordinateZ
Z axis.
Definition: CPTDefinitions.h:167
CPTAlignmentLeft
@ CPTAlignmentLeft
Align horizontally to the left side.
Definition: CPTDefinitions.h:210
CPTStringDrawingOptions
const NSStringDrawingOptions CPTStringDrawingOptions
String drawing options used when measuring and drawing text.
Definition: CPTDefinitions.m:5
CPTSignPositive
@ CPTSignPositive
Positive offset.
Definition: CPTDefinitions.h:187
CPTErrorBarType
CPTErrorBarType
Enumeration of error bar types.
Definition: CPTDefinitions.h:143
CPTRectAnchorBottomRight
@ CPTRectAnchorBottomRight
The bottom right corner.
Definition: CPTDefinitions.h:197
CPTScaleTypeDateTime
@ CPTScaleTypeDateTime
Date/time axis scale (not implemented)
Definition: CPTDefinitions.h:156
CPTCoordinateX
@ CPTCoordinateX
X axis.
Definition: CPTDefinitions.h:165
CPTScaleType
CPTScaleType
Enumeration of axis scale types.
Definition: CPTDefinitions.h:152
CGRect
typedef CGRect
CPTScaleTypeAngular
@ CPTScaleTypeAngular
Angular axis scale (not implemented)
Definition: CPTDefinitions.h:155
CPTEdgeInsets::left
CGFloat left
The left inset.
Definition: CPTDefinitions.h:223
CPTDictionary
NSDictionary< NSString *, id > CPTDictionary
A dictionary with string keys and object values.
Definition: CPTDefinitions.h:276
CPTScaleTypeLog
@ CPTScaleTypeLog
Logarithmic axis scale.
Definition: CPTDefinitions.h:154
CPTEdgeInsets
Edge inset distances for stretchable images.
Definition: CPTDefinitions.h:221
CPTAlignmentRight
@ CPTAlignmentRight
Align horizontally to the right side.
Definition: CPTDefinitions.h:212
CPTQuickLookImageBlock
void(^ CPTQuickLookImageBlock)(__nonnull CGContextRef context, CGFloat scale, CGRect bounds)
Render a Quick Look image into the given context.
Definition: CPTDefinitions.h:286
CPTErrorBarTypeConstantValue
@ CPTErrorBarTypeConstantValue
Constant value error bars.
Definition: CPTDefinitions.h:146