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 unsafe 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 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        /// Setter for [`fillColor`][Self::fillColor].
75        #[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        /// Setter for [`fillRule`][Self::fillRule].
84        #[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        /// Setter for [`strokeColor`][Self::strokeColor].
95        #[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        /// Setter for [`strokeStart`][Self::strokeStart].
106        #[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        /// Setter for [`strokeEnd`][Self::strokeEnd].
117        #[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        /// Setter for [`lineWidth`][Self::lineWidth].
128        #[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        /// Setter for [`miterLimit`][Self::miterLimit].
139        #[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        /// Setter for [`lineCap`][Self::lineCap].
148        #[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        /// Setter for [`lineJoin`][Self::lineJoin].
157        #[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        /// Setter for [`lineDashPhase`][Self::lineDashPhase].
168        #[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        /// Setter for [`lineDashPattern`][Self::lineDashPattern].
177        #[unsafe(method(setLineDashPattern:))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn setLineDashPattern(&self, line_dash_pattern: Option<&NSArray<NSNumber>>);
180    );
181}
182
183/// Methods declared on superclass `CALayer`.
184#[cfg(feature = "CALayer")]
185impl CAShapeLayer {
186    extern_methods!(
187        /// Layer creation and initialization. *
188        #[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/// Methods declared on superclass `NSObject`.
203#[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    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcafillrulenonzero?language=objc)
214    pub static kCAFillRuleNonZero: &'static CAShapeLayerFillRule;
215}
216
217extern "C" {
218    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcafillruleevenodd?language=objc)
219    pub static kCAFillRuleEvenOdd: &'static CAShapeLayerFillRule;
220}
221
222extern "C" {
223    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinejoinmiter?language=objc)
224    pub static kCALineJoinMiter: &'static CAShapeLayerLineJoin;
225}
226
227extern "C" {
228    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinejoinround?language=objc)
229    pub static kCALineJoinRound: &'static CAShapeLayerLineJoin;
230}
231
232extern "C" {
233    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinejoinbevel?language=objc)
234    pub static kCALineJoinBevel: &'static CAShapeLayerLineJoin;
235}
236
237extern "C" {
238    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinecapbutt?language=objc)
239    pub static kCALineCapButt: &'static CAShapeLayerLineCap;
240}
241
242extern "C" {
243    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinecapround?language=objc)
244    pub static kCALineCapRound: &'static CAShapeLayerLineCap;
245}
246
247extern "C" {
248    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinecapsquare?language=objc)
249    pub static kCALineCapSquare: &'static CAShapeLayerLineCap;
250}