objc2_quartz_core/generated/
CAShapeLayer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use 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
14/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cashapelayerfillrule?language=objc)
15// NS_TYPED_ENUM
16pub type CAShapeLayerFillRule = NSString;
17
18/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cashapelayerlinejoin?language=objc)
19// NS_TYPED_ENUM
20pub type CAShapeLayerLineJoin = NSString;
21
22/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cashapelayerlinecap?language=objc)
23// NS_TYPED_ENUM
24pub type CAShapeLayerLineCap = NSString;
25
26extern_class!(
27    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cashapelayer?language=objc)
28    #[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        /// Setter for [`path`][Self::path].
64        #[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        /// Setter for [`fillColor`][Self::fillColor].
75        #[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        /// Setter for [`fillRule`][Self::fillRule].
84        ///
85        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
86        #[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        /// Setter for [`strokeColor`][Self::strokeColor].
97        #[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        /// Setter for [`strokeStart`][Self::strokeStart].
108        #[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        /// Setter for [`strokeEnd`][Self::strokeEnd].
119        #[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        /// Setter for [`lineWidth`][Self::lineWidth].
130        #[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        /// Setter for [`miterLimit`][Self::miterLimit].
141        #[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        /// Setter for [`lineCap`][Self::lineCap].
150        ///
151        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
152        #[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        /// Setter for [`lineJoin`][Self::lineJoin].
161        ///
162        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
163        #[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        /// Setter for [`lineDashPhase`][Self::lineDashPhase].
174        #[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        /// Setter for [`lineDashPattern`][Self::lineDashPattern].
183        ///
184        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
185        #[unsafe(method(setLineDashPattern:))]
186        #[unsafe(method_family = none)]
187        pub fn setLineDashPattern(&self, line_dash_pattern: Option<&NSArray<NSNumber>>);
188    );
189}
190
191/// Methods declared on superclass `CALayer`.
192#[cfg(feature = "CALayer")]
193impl CAShapeLayer {
194    extern_methods!(
195        /// Layer creation and initialization. *
196        #[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        /// # Safety
205        ///
206        /// `layer` should be of the correct type.
207        #[unsafe(method(initWithLayer:))]
208        #[unsafe(method_family = init)]
209        pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
210    );
211}
212
213/// Methods declared on superclass `NSObject`.
214#[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    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcafillrulenonzero?language=objc)
233    pub static kCAFillRuleNonZero: &'static CAShapeLayerFillRule;
234}
235
236extern "C" {
237    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcafillruleevenodd?language=objc)
238    pub static kCAFillRuleEvenOdd: &'static CAShapeLayerFillRule;
239}
240
241extern "C" {
242    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinejoinmiter?language=objc)
243    pub static kCALineJoinMiter: &'static CAShapeLayerLineJoin;
244}
245
246extern "C" {
247    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinejoinround?language=objc)
248    pub static kCALineJoinRound: &'static CAShapeLayerLineJoin;
249}
250
251extern "C" {
252    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinejoinbevel?language=objc)
253    pub static kCALineJoinBevel: &'static CAShapeLayerLineJoin;
254}
255
256extern "C" {
257    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinecapbutt?language=objc)
258    pub static kCALineCapButt: &'static CAShapeLayerLineCap;
259}
260
261extern "C" {
262    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinecapround?language=objc)
263    pub static kCALineCapRound: &'static CAShapeLayerLineCap;
264}
265
266extern "C" {
267    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinecapsquare?language=objc)
268    pub static kCALineCapSquare: &'static CAShapeLayerLineCap;
269}