objc2_quartz_core/generated/
CAShapeLayer.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9use objc2_core_graphics::*;
10use objc2_foundation::*;
11
12use crate::*;
13
14pub type CAShapeLayerFillRule = NSString;
17
18pub type CAShapeLayerLineJoin = NSString;
21
22pub type CAShapeLayerLineCap = NSString;
25
26extern_class!(
27 #[unsafe(super(CALayer, NSObject))]
29 #[derive(Debug, PartialEq, Eq, Hash)]
30 #[cfg(feature = "CALayer")]
31 pub struct CAShapeLayer;
32);
33
34#[cfg(all(feature = "CALayer", feature = "CAMediaTiming"))]
35extern_conformance!(
36 unsafe impl CAMediaTiming for CAShapeLayer {}
37);
38
39#[cfg(feature = "CALayer")]
40extern_conformance!(
41 unsafe impl NSCoding for CAShapeLayer {}
42);
43
44#[cfg(feature = "CALayer")]
45extern_conformance!(
46 unsafe impl NSObjectProtocol for CAShapeLayer {}
47);
48
49#[cfg(feature = "CALayer")]
50extern_conformance!(
51 unsafe impl NSSecureCoding for CAShapeLayer {}
52);
53
54#[cfg(feature = "CALayer")]
55impl CAShapeLayer {
56 extern_methods!(
57 #[cfg(feature = "objc2-core-graphics")]
58 #[unsafe(method(path))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn path(&self) -> Option<Retained<CGPath>>;
61
62 #[cfg(feature = "objc2-core-graphics")]
63 #[unsafe(method(setPath:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn setPath(&self, path: Option<&CGPath>);
67
68 #[cfg(feature = "objc2-core-graphics")]
69 #[unsafe(method(fillColor))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn fillColor(&self) -> Option<Retained<CGColor>>;
72
73 #[cfg(feature = "objc2-core-graphics")]
74 #[unsafe(method(setFillColor:))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn setFillColor(&self, fill_color: Option<&CGColor>);
78
79 #[unsafe(method(fillRule))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn fillRule(&self) -> Retained<CAShapeLayerFillRule>;
82
83 #[unsafe(method(setFillRule:))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn setFillRule(&self, fill_rule: &CAShapeLayerFillRule);
87
88 #[cfg(feature = "objc2-core-graphics")]
89 #[unsafe(method(strokeColor))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn strokeColor(&self) -> Option<Retained<CGColor>>;
92
93 #[cfg(feature = "objc2-core-graphics")]
94 #[unsafe(method(setStrokeColor:))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn setStrokeColor(&self, stroke_color: Option<&CGColor>);
98
99 #[cfg(feature = "objc2-core-foundation")]
100 #[unsafe(method(strokeStart))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn strokeStart(&self) -> CGFloat;
103
104 #[cfg(feature = "objc2-core-foundation")]
105 #[unsafe(method(setStrokeStart:))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn setStrokeStart(&self, stroke_start: CGFloat);
109
110 #[cfg(feature = "objc2-core-foundation")]
111 #[unsafe(method(strokeEnd))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn strokeEnd(&self) -> CGFloat;
114
115 #[cfg(feature = "objc2-core-foundation")]
116 #[unsafe(method(setStrokeEnd:))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn setStrokeEnd(&self, stroke_end: CGFloat);
120
121 #[cfg(feature = "objc2-core-foundation")]
122 #[unsafe(method(lineWidth))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn lineWidth(&self) -> CGFloat;
125
126 #[cfg(feature = "objc2-core-foundation")]
127 #[unsafe(method(setLineWidth:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn setLineWidth(&self, line_width: CGFloat);
131
132 #[cfg(feature = "objc2-core-foundation")]
133 #[unsafe(method(miterLimit))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn miterLimit(&self) -> CGFloat;
136
137 #[cfg(feature = "objc2-core-foundation")]
138 #[unsafe(method(setMiterLimit:))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn setMiterLimit(&self, miter_limit: CGFloat);
142
143 #[unsafe(method(lineCap))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn lineCap(&self) -> Retained<CAShapeLayerLineCap>;
146
147 #[unsafe(method(setLineCap:))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn setLineCap(&self, line_cap: &CAShapeLayerLineCap);
151
152 #[unsafe(method(lineJoin))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn lineJoin(&self) -> Retained<CAShapeLayerLineJoin>;
155
156 #[unsafe(method(setLineJoin:))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn setLineJoin(&self, line_join: &CAShapeLayerLineJoin);
160
161 #[cfg(feature = "objc2-core-foundation")]
162 #[unsafe(method(lineDashPhase))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn lineDashPhase(&self) -> CGFloat;
165
166 #[cfg(feature = "objc2-core-foundation")]
167 #[unsafe(method(setLineDashPhase:))]
169 #[unsafe(method_family = none)]
170 pub unsafe fn setLineDashPhase(&self, line_dash_phase: CGFloat);
171
172 #[unsafe(method(lineDashPattern))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn lineDashPattern(&self) -> Option<Retained<NSArray<NSNumber>>>;
175
176 #[unsafe(method(setLineDashPattern:))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn setLineDashPattern(&self, line_dash_pattern: Option<&NSArray<NSNumber>>);
180 );
181}
182
183#[cfg(feature = "CALayer")]
185impl CAShapeLayer {
186 extern_methods!(
187 #[unsafe(method(layer))]
189 #[unsafe(method_family = none)]
190 pub unsafe fn layer() -> Retained<Self>;
191
192 #[unsafe(method(init))]
193 #[unsafe(method_family = init)]
194 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
195
196 #[unsafe(method(initWithLayer:))]
197 #[unsafe(method_family = init)]
198 pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
199 );
200}
201
202#[cfg(feature = "CALayer")]
204impl CAShapeLayer {
205 extern_methods!(
206 #[unsafe(method(new))]
207 #[unsafe(method_family = new)]
208 pub unsafe fn new() -> Retained<Self>;
209 );
210}
211
212extern "C" {
213 pub static kCAFillRuleNonZero: &'static CAShapeLayerFillRule;
215}
216
217extern "C" {
218 pub static kCAFillRuleEvenOdd: &'static CAShapeLayerFillRule;
220}
221
222extern "C" {
223 pub static kCALineJoinMiter: &'static CAShapeLayerLineJoin;
225}
226
227extern "C" {
228 pub static kCALineJoinRound: &'static CAShapeLayerLineJoin;
230}
231
232extern "C" {
233 pub static kCALineJoinBevel: &'static CAShapeLayerLineJoin;
235}
236
237extern "C" {
238 pub static kCALineCapButt: &'static CAShapeLayerLineCap;
240}
241
242extern "C" {
243 pub static kCALineCapRound: &'static CAShapeLayerLineCap;
245}
246
247extern "C" {
248 pub static kCALineCapSquare: &'static CAShapeLayerLineCap;
250}