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 fn path(&self) -> Option<Retained<CGPath>>;
61
62 #[cfg(feature = "objc2-core-graphics")]
63 #[unsafe(method(setPath:))]
65 #[unsafe(method_family = none)]
66 pub fn setPath(&self, path: Option<&CGPath>);
67
68 #[cfg(feature = "objc2-core-graphics")]
69 #[unsafe(method(fillColor))]
70 #[unsafe(method_family = none)]
71 pub fn fillColor(&self) -> Option<Retained<CGColor>>;
72
73 #[cfg(feature = "objc2-core-graphics")]
74 #[unsafe(method(setFillColor:))]
76 #[unsafe(method_family = none)]
77 pub fn setFillColor(&self, fill_color: Option<&CGColor>);
78
79 #[unsafe(method(fillRule))]
80 #[unsafe(method_family = none)]
81 pub fn fillRule(&self) -> Retained<CAShapeLayerFillRule>;
82
83 #[unsafe(method(setFillRule:))]
87 #[unsafe(method_family = none)]
88 pub fn setFillRule(&self, fill_rule: &CAShapeLayerFillRule);
89
90 #[cfg(feature = "objc2-core-graphics")]
91 #[unsafe(method(strokeColor))]
92 #[unsafe(method_family = none)]
93 pub fn strokeColor(&self) -> Option<Retained<CGColor>>;
94
95 #[cfg(feature = "objc2-core-graphics")]
96 #[unsafe(method(setStrokeColor:))]
98 #[unsafe(method_family = none)]
99 pub fn setStrokeColor(&self, stroke_color: Option<&CGColor>);
100
101 #[cfg(feature = "objc2-core-foundation")]
102 #[unsafe(method(strokeStart))]
103 #[unsafe(method_family = none)]
104 pub fn strokeStart(&self) -> CGFloat;
105
106 #[cfg(feature = "objc2-core-foundation")]
107 #[unsafe(method(setStrokeStart:))]
109 #[unsafe(method_family = none)]
110 pub fn setStrokeStart(&self, stroke_start: CGFloat);
111
112 #[cfg(feature = "objc2-core-foundation")]
113 #[unsafe(method(strokeEnd))]
114 #[unsafe(method_family = none)]
115 pub fn strokeEnd(&self) -> CGFloat;
116
117 #[cfg(feature = "objc2-core-foundation")]
118 #[unsafe(method(setStrokeEnd:))]
120 #[unsafe(method_family = none)]
121 pub fn setStrokeEnd(&self, stroke_end: CGFloat);
122
123 #[cfg(feature = "objc2-core-foundation")]
124 #[unsafe(method(lineWidth))]
125 #[unsafe(method_family = none)]
126 pub fn lineWidth(&self) -> CGFloat;
127
128 #[cfg(feature = "objc2-core-foundation")]
129 #[unsafe(method(setLineWidth:))]
131 #[unsafe(method_family = none)]
132 pub fn setLineWidth(&self, line_width: CGFloat);
133
134 #[cfg(feature = "objc2-core-foundation")]
135 #[unsafe(method(miterLimit))]
136 #[unsafe(method_family = none)]
137 pub fn miterLimit(&self) -> CGFloat;
138
139 #[cfg(feature = "objc2-core-foundation")]
140 #[unsafe(method(setMiterLimit:))]
142 #[unsafe(method_family = none)]
143 pub fn setMiterLimit(&self, miter_limit: CGFloat);
144
145 #[unsafe(method(lineCap))]
146 #[unsafe(method_family = none)]
147 pub fn lineCap(&self) -> Retained<CAShapeLayerLineCap>;
148
149 #[unsafe(method(setLineCap:))]
153 #[unsafe(method_family = none)]
154 pub fn setLineCap(&self, line_cap: &CAShapeLayerLineCap);
155
156 #[unsafe(method(lineJoin))]
157 #[unsafe(method_family = none)]
158 pub fn lineJoin(&self) -> Retained<CAShapeLayerLineJoin>;
159
160 #[unsafe(method(setLineJoin:))]
164 #[unsafe(method_family = none)]
165 pub fn setLineJoin(&self, line_join: &CAShapeLayerLineJoin);
166
167 #[cfg(feature = "objc2-core-foundation")]
168 #[unsafe(method(lineDashPhase))]
169 #[unsafe(method_family = none)]
170 pub fn lineDashPhase(&self) -> CGFloat;
171
172 #[cfg(feature = "objc2-core-foundation")]
173 #[unsafe(method(setLineDashPhase:))]
175 #[unsafe(method_family = none)]
176 pub fn setLineDashPhase(&self, line_dash_phase: CGFloat);
177
178 #[unsafe(method(lineDashPattern))]
179 #[unsafe(method_family = none)]
180 pub fn lineDashPattern(&self) -> Option<Retained<NSArray<NSNumber>>>;
181
182 #[unsafe(method(setLineDashPattern:))]
186 #[unsafe(method_family = none)]
187 pub fn setLineDashPattern(&self, line_dash_pattern: Option<&NSArray<NSNumber>>);
188 );
189}
190
191#[cfg(feature = "CALayer")]
193impl CAShapeLayer {
194 extern_methods!(
195 #[unsafe(method(layer))]
197 #[unsafe(method_family = none)]
198 pub fn layer() -> Retained<Self>;
199
200 #[unsafe(method(init))]
201 #[unsafe(method_family = init)]
202 pub fn init(this: Allocated<Self>) -> Retained<Self>;
203
204 #[unsafe(method(initWithLayer:))]
208 #[unsafe(method_family = init)]
209 pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
210 );
211}
212
213#[cfg(feature = "CALayer")]
215impl CAShapeLayer {
216 extern_methods!(
217 #[unsafe(method(new))]
218 #[unsafe(method_family = new)]
219 pub fn new() -> Retained<Self>;
220 );
221}
222
223#[cfg(feature = "CALayer")]
224impl DefaultRetained for CAShapeLayer {
225 #[inline]
226 fn default_retained() -> Retained<Self> {
227 Self::new()
228 }
229}
230
231extern "C" {
232 pub static kCAFillRuleNonZero: &'static CAShapeLayerFillRule;
234}
235
236extern "C" {
237 pub static kCAFillRuleEvenOdd: &'static CAShapeLayerFillRule;
239}
240
241extern "C" {
242 pub static kCALineJoinMiter: &'static CAShapeLayerLineJoin;
244}
245
246extern "C" {
247 pub static kCALineJoinRound: &'static CAShapeLayerLineJoin;
249}
250
251extern "C" {
252 pub static kCALineJoinBevel: &'static CAShapeLayerLineJoin;
254}
255
256extern "C" {
257 pub static kCALineCapButt: &'static CAShapeLayerLineCap;
259}
260
261extern "C" {
262 pub static kCALineCapRound: &'static CAShapeLayerLineCap;
264}
265
266extern "C" {
267 pub static kCALineCapSquare: &'static CAShapeLayerLineCap;
269}