Core Plot (macOS)
Cocoa plotting framework for macOS, iOS, and tvOS
CPTLayer.h
Go to the documentation of this file.
1 #import "CPTDefinitions.h"
2 #import "CPTResponder.h"
3 #import <QuartzCore/QuartzCore.h>
4 
6 
7 @class CPTGraph;
8 @class CPTLayer;
9 @class CPTShadow;
10 
15 
18 
22 extern CPTLayerNotification __nonnull const CPTLayerBoundsDidChangeNotification NS_SWIFT_NAME(boundsDidChange);
23 
25 
30 
35 
40 
45 
50 
55 
60 
65 
66 #pragma mark -
67 
71 #if ((TARGET_OS_SIMULATOR || TARGET_OS_IPHONE || TARGET_OS_TV) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 100000)) \
72  || (TARGET_OS_MAC && (MAC_OS_X_VERSION_MAX_ALLOWED >= 101200))
73 // CALayerDelegate is defined by Core Animation in iOS 10.0+, macOS 10.12+, and tvOS 10.0+
75 #else
77 #endif
78 
79 @end
80 
81 #pragma mark -
82 
84 
87 @property (nonatomic, readwrite, cpt_weak_property, nullable) CPTGraph *graph;
89 
92 @property (nonatomic, readwrite) CGFloat paddingLeft;
93 @property (nonatomic, readwrite) CGFloat paddingTop;
94 @property (nonatomic, readwrite) CGFloat paddingRight;
95 @property (nonatomic, readwrite) CGFloat paddingBottom;
97 
100 @property (readwrite) CGFloat contentsScale;
101 @property (nonatomic, readonly) BOOL useFastRendering;
102 @property (nonatomic, readwrite, copy, nullable) CPTShadow *shadow;
103 @property (nonatomic, readonly) CGSize shadowMargin;
105 
108 @property (nonatomic, readwrite, assign) BOOL masksToBorder;
109 @property (nonatomic, readwrite, assign, nullable) CGPathRef outerBorderPath;
110 @property (nonatomic, readwrite, assign, nullable) CGPathRef innerBorderPath;
111 @property (nonatomic, readonly, nullable) CGPathRef maskingPath;
112 @property (nonatomic, readonly, nullable) CGPathRef sublayerMaskingPath;
114 
117 @property (nonatomic, readwrite, copy, nullable) id<NSCopying, NSCoding, NSObject> identifier;
119 
122 @property (nonatomic, readonly, nullable) CPTSublayerSet *sublayersExcludedFromAutomaticLayout;
124 
127 -(nonnull instancetype)initWithFrame:(CGRect)newFrame NS_DESIGNATED_INITIALIZER;
128 -(nullable instancetype)initWithCoder:(nonnull NSCoder *)coder NS_DESIGNATED_INITIALIZER;
129 -(nonnull instancetype)initWithLayer:(nonnull id)layer NS_DESIGNATED_INITIALIZER;
131 
135 -(void)renderAsVectorInContext:(nonnull CGContextRef)context;
136 -(void)recursivelyRenderInContext:(nonnull CGContextRef)context;
137 -(void)layoutAndRenderInContext:(nonnull CGContextRef)context;
140 
143 -(void)applySublayerMaskToContext:(nonnull CGContextRef)context forSublayer:(nonnull CPTLayer *)sublayer withOffset:(CGPoint)offset;
144 -(void)applyMaskToContext:(nonnull CGContextRef)context;
146 
149 -(void)pixelAlign;
150 -(void)sublayerMarginLeft:(nonnull CGFloat *)left top:(nonnull CGFloat *)top right:(nonnull CGFloat *)right bottom:(nonnull CGFloat *)bottom;
152 
155 -(void)logLayers;
157 
158 @end
CPTShadow
Immutable wrapper for various shadow drawing properties.
Definition: CPTShadow.h:3
CPTLayerSet
NSSet< CPTLayer * > CPTLayerSet
A set of CPTLayer objects.
Definition: CPTLayer.h:39
CPTResponder-p
The basis of all event processing in Core Plot.
Definition: CPTResponder.h:6
NSArray
CPTMutableSublayerArray
NSMutableArray< CALayer * > CPTMutableSublayerArray
A mutable array of CALayer objects.
Definition: CPTLayer.h:54
CPTLayer::masksToBorder
BOOL masksToBorder
If YES, a sublayer mask is applied to clip sublayer content to the inside of the border.
Definition: CPTLayer.h:108
CPTLayerArray
NSArray< CPTLayer * > CPTLayerArray
An array of CPTLayer objects.
Definition: CPTLayer.h:29
CPTMutableLayerArray
NSMutableArray< CPTLayer * > CPTMutableLayerArray
A mutable array of CPTLayer objects.
Definition: CPTLayer.h:34
-[CPTLayer setNeedsDisplayAllLayers]
void setNeedsDisplayAllLayers()
Recursively marks this layer and all sublayers as needing to be redrawn.
Definition: CPTLayer.m:386
CPTLayerBoundsDidChangeNotification
CPTLayerNotification __nonnull const CPTLayerBoundsDidChangeNotification
Notification sent by all layers when the layer bounds change.
Definition: CPTLayer.m:13
CGPoint
typedef CGPoint
-[CPTLayer logLayers]
void logLayers()
Logs this layer and all of its sublayers.
Definition: CPTLayer.m:1117
CPTLayer::sublayersExcludedFromAutomaticLayout
CPTSublayerSet * sublayersExcludedFromAutomaticLayout
A set of sublayers that should be excluded from the automatic sublayer layout.
Definition: CPTLayer.h:122
CPTLayer::innerBorderPath
CGPathRef innerBorderPath
A drawing path that encompasses the inner boundary of the layer border.
Definition: CPTLayer.h:110
CPTLayer::outerBorderPath
CGPathRef outerBorderPath
A drawing path that encompasses the outer boundary of the layer border.
Definition: CPTLayer.h:109
CPTMutableLayerSet
NSMutableSet< CPTLayer * > CPTMutableLayerSet
A mutable set of CPTLayer objects.
Definition: CPTLayer.h:44
-[NSObject copy]
id copy
CPTLayerDelegate-p
Layer delegate.
Definition: CPTLayer.h:76
-[CPTLayer dataForPDFRepresentationOfLayer]
nonnull NSData * dataForPDFRepresentationOfLayer()
Draws layer content and the content of all sublayers into a PDF document.
Definition: CPTLayer.m:504
-[CPTLayer pixelAlign]
void pixelAlign()
Align the receiver’s position with pixel boundaries.
Definition: CPTLayer.m:570
CPTLayer::maskingPath
CGPathRef maskingPath
A drawing path that encompasses the layer content including any borders. Set to NULL when no masking ...
Definition: CPTLayer.h:111
CPTLayer::paddingBottom
CGFloat paddingBottom
Amount to inset the bottom of each sublayer.
Definition: CPTLayer.h:95
CPTLayer::identifier
id< NSCopying, NSCoding, NSObject > identifier
An object used to identify the layer in collections.
Definition: CPTLayer.h:117
CGContextRef
typedef CGContextRef
CPTLayer
Base class for all Core Animation layers in Core Plot.
Definition: CPTLayer.h:83
CPTDefinitions.h
CALayer
CGFloat
typedef CGFloat
CPTLayer::shadow
CPTShadow * shadow
The shadow drawn under the layer content. If nil (the default), no shadow is drawn.
Definition: CPTLayer.h:102
CPTLayer::sublayerMaskingPath
CGPathRef sublayerMaskingPath
A drawing path that encompasses the layer content excluding any borders. Set to NULL when no masking ...
Definition: CPTLayer.h:112
CPTLayer::paddingRight
CGFloat paddingRight
Amount to inset the right side of each sublayer.
Definition: CPTLayer.h:94
CPTLayer::paddingTop
CGFloat paddingTop
Amount to inset the top of each sublayer.
Definition: CPTLayer.h:93
CPTSublayerArray
NSArray< CALayer * > CPTSublayerArray
An array of CALayer objects.
Definition: CPTLayer.h:49
CPTLayer::shadowMargin
CGSize shadowMargin
The maximum margin size needed to fully enclose the layer shadow.
Definition: CPTLayer.h:103
-[CALayer initWithLayer]
id initWithLayer
cpt_swift_struct
#define cpt_swift_struct
Marks a type definition to be imported into Swift as a structure.
Definition: CPTDefinitions.h:73
NSString
CPTLayer::contentsScale
CGFloat contentsScale
The scale factor applied to the layer.
Definition: CPTLayer.h:100
cpt_weak_property
#define cpt_weak_property
A custom definition for automatic reference counting (ARC) weak properties that falls back to assign ...
Definition: CPTDefinitions.h:32
CPTLayer::graph
CPTGraph * graph
The graph for the layer.
Definition: CPTLayer.h:87
CPTMutableSublayerSet
NSMutableSet< CALayer * > CPTMutableSublayerSet
A mutable set of CALayer objects.
Definition: CPTLayer.h:64
CGRect
typedef CGRect
CPTResponder.h
CPTGraph
An abstract graph class.
Definition: CPTGraph.h:74
CPTSublayerSet
NSSet< CALayer * > CPTSublayerSet
A set of CALayer objects.
Definition: CPTLayer.h:59
CALayerDelegate-p
CPTLayer::paddingLeft
CGFloat paddingLeft
Amount to inset the left side of each sublayer.
Definition: CPTLayer.h:92
NSCoder
CPTLayer::useFastRendering
BOOL useFastRendering
If YES, subclasses should optimize their drawing for speed over precision.
Definition: CPTLayer.h:101