objc2_quartz_core/generated/
CALayer.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/calayercontentsgravity?language=objc)
15// NS_TYPED_ENUM
16pub type CALayerContentsGravity = NSString;
17
18/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/calayercontentsformat?language=objc)
19// NS_TYPED_ENUM
20pub type CALayerContentsFormat = NSString;
21
22/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/calayercontentsfilter?language=objc)
23// NS_TYPED_ENUM
24pub type CALayerContentsFilter = NSString;
25
26/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/calayercornercurve?language=objc)
27// NS_TYPED_ENUM
28pub type CALayerCornerCurve = NSString;
29
30/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caautoresizingmask?language=objc)
31// NS_OPTIONS
32#[repr(transparent)]
33#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
34pub struct CAAutoresizingMask(pub c_uint);
35bitflags::bitflags! {
36    impl CAAutoresizingMask: c_uint {
37        #[doc(alias = "kCALayerNotSizable")]
38        const LayerNotSizable = 0;
39        #[doc(alias = "kCALayerMinXMargin")]
40        const LayerMinXMargin = 1<<0;
41        #[doc(alias = "kCALayerWidthSizable")]
42        const LayerWidthSizable = 1<<1;
43        #[doc(alias = "kCALayerMaxXMargin")]
44        const LayerMaxXMargin = 1<<2;
45        #[doc(alias = "kCALayerMinYMargin")]
46        const LayerMinYMargin = 1<<3;
47        #[doc(alias = "kCALayerHeightSizable")]
48        const LayerHeightSizable = 1<<4;
49        #[doc(alias = "kCALayerMaxYMargin")]
50        const LayerMaxYMargin = 1<<5;
51    }
52}
53
54unsafe impl Encode for CAAutoresizingMask {
55    const ENCODING: Encoding = c_uint::ENCODING;
56}
57
58unsafe impl RefEncode for CAAutoresizingMask {
59    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
60}
61
62/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catonemapmode?language=objc)
63// NS_TYPED_ENUM
64pub type CAToneMapMode = NSString;
65
66extern "C" {
67    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catonemapmodeautomatic?language=objc)
68    pub static CAToneMapModeAutomatic: &'static CAToneMapMode;
69}
70
71extern "C" {
72    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catonemapmodenever?language=objc)
73    pub static CAToneMapModeNever: &'static CAToneMapMode;
74}
75
76extern "C" {
77    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catonemapmodeifsupported?language=objc)
78    pub static CAToneMapModeIfSupported: &'static CAToneMapMode;
79}
80
81/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cadynamicrange?language=objc)
82// NS_TYPED_ENUM
83pub type CADynamicRange = NSString;
84
85extern "C" {
86    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cadynamicrangeautomatic?language=objc)
87    pub static CADynamicRangeAutomatic: &'static CADynamicRange;
88}
89
90extern "C" {
91    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cadynamicrangestandard?language=objc)
92    pub static CADynamicRangeStandard: &'static CADynamicRange;
93}
94
95extern "C" {
96    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cadynamicrangeconstrainedhigh?language=objc)
97    pub static CADynamicRangeConstrainedHigh: &'static CADynamicRange;
98}
99
100extern "C" {
101    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cadynamicrangehigh?language=objc)
102    pub static CADynamicRangeHigh: &'static CADynamicRange;
103}
104
105/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caedgeantialiasingmask?language=objc)
106// NS_OPTIONS
107#[repr(transparent)]
108#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
109pub struct CAEdgeAntialiasingMask(pub c_uint);
110bitflags::bitflags! {
111    impl CAEdgeAntialiasingMask: c_uint {
112        #[doc(alias = "kCALayerLeftEdge")]
113        const LayerLeftEdge = 1<<0;
114        #[doc(alias = "kCALayerRightEdge")]
115        const LayerRightEdge = 1<<1;
116        #[doc(alias = "kCALayerBottomEdge")]
117        const LayerBottomEdge = 1<<2;
118        #[doc(alias = "kCALayerTopEdge")]
119        const LayerTopEdge = 1<<3;
120    }
121}
122
123unsafe impl Encode for CAEdgeAntialiasingMask {
124    const ENCODING: Encoding = c_uint::ENCODING;
125}
126
127unsafe impl RefEncode for CAEdgeAntialiasingMask {
128    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
129}
130
131/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cacornermask?language=objc)
132// NS_OPTIONS
133#[repr(transparent)]
134#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
135pub struct CACornerMask(pub NSUInteger);
136bitflags::bitflags! {
137    impl CACornerMask: NSUInteger {
138        #[doc(alias = "kCALayerMinXMinYCorner")]
139        const LayerMinXMinYCorner = 1<<0;
140        #[doc(alias = "kCALayerMaxXMinYCorner")]
141        const LayerMaxXMinYCorner = 1<<1;
142        #[doc(alias = "kCALayerMinXMaxYCorner")]
143        const LayerMinXMaxYCorner = 1<<2;
144        #[doc(alias = "kCALayerMaxXMaxYCorner")]
145        const LayerMaxXMaxYCorner = 1<<3;
146    }
147}
148
149unsafe impl Encode for CACornerMask {
150    const ENCODING: Encoding = NSUInteger::ENCODING;
151}
152
153unsafe impl RefEncode for CACornerMask {
154    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
155}
156
157extern_class!(
158    /// The base layer class. *
159    ///
160    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/calayer?language=objc)
161    #[unsafe(super(NSObject))]
162    #[derive(Debug, PartialEq, Eq, Hash)]
163    pub struct CALayer;
164);
165
166#[cfg(feature = "CAMediaTiming")]
167extern_conformance!(
168    unsafe impl CAMediaTiming for CALayer {}
169);
170
171extern_conformance!(
172    unsafe impl NSCoding for CALayer {}
173);
174
175extern_conformance!(
176    unsafe impl NSObjectProtocol for CALayer {}
177);
178
179extern_conformance!(
180    unsafe impl NSSecureCoding for CALayer {}
181);
182
183impl CALayer {
184    extern_methods!(
185        /// Layer creation and initialization. *
186        #[unsafe(method(layer))]
187        #[unsafe(method_family = none)]
188        pub fn layer() -> Retained<Self>;
189
190        #[unsafe(method(init))]
191        #[unsafe(method_family = init)]
192        pub fn init(this: Allocated<Self>) -> Retained<Self>;
193
194        /// # Safety
195        ///
196        /// `layer` should be of the correct type.
197        #[unsafe(method(initWithLayer:))]
198        #[unsafe(method_family = init)]
199        pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
200
201        #[unsafe(method(presentationLayer))]
202        #[unsafe(method_family = none)]
203        pub unsafe fn presentationLayer(&self) -> Option<Retained<Self>>;
204
205        #[unsafe(method(modelLayer))]
206        #[unsafe(method_family = none)]
207        pub unsafe fn modelLayer(&self) -> Retained<Self>;
208
209        /// Property methods. *
210        #[unsafe(method(defaultValueForKey:))]
211        #[unsafe(method_family = none)]
212        pub unsafe fn defaultValueForKey(key: &NSString) -> Option<Retained<AnyObject>>;
213
214        #[unsafe(method(needsDisplayForKey:))]
215        #[unsafe(method_family = none)]
216        pub fn needsDisplayForKey(key: &NSString) -> bool;
217
218        #[unsafe(method(shouldArchiveValueForKey:))]
219        #[unsafe(method_family = none)]
220        pub fn shouldArchiveValueForKey(&self, key: &NSString) -> bool;
221
222        #[cfg(feature = "objc2-core-foundation")]
223        /// Geometry and layer hierarchy properties. *
224        #[unsafe(method(bounds))]
225        #[unsafe(method_family = none)]
226        pub fn bounds(&self) -> CGRect;
227
228        #[cfg(feature = "objc2-core-foundation")]
229        /// Setter for [`bounds`][Self::bounds].
230        #[unsafe(method(setBounds:))]
231        #[unsafe(method_family = none)]
232        pub fn setBounds(&self, bounds: CGRect);
233
234        #[cfg(feature = "objc2-core-foundation")]
235        #[unsafe(method(position))]
236        #[unsafe(method_family = none)]
237        pub fn position(&self) -> CGPoint;
238
239        #[cfg(feature = "objc2-core-foundation")]
240        /// Setter for [`position`][Self::position].
241        #[unsafe(method(setPosition:))]
242        #[unsafe(method_family = none)]
243        pub fn setPosition(&self, position: CGPoint);
244
245        #[cfg(feature = "objc2-core-foundation")]
246        #[unsafe(method(zPosition))]
247        #[unsafe(method_family = none)]
248        pub fn zPosition(&self) -> CGFloat;
249
250        #[cfg(feature = "objc2-core-foundation")]
251        /// Setter for [`zPosition`][Self::zPosition].
252        #[unsafe(method(setZPosition:))]
253        #[unsafe(method_family = none)]
254        pub fn setZPosition(&self, z_position: CGFloat);
255
256        #[cfg(feature = "objc2-core-foundation")]
257        #[unsafe(method(anchorPoint))]
258        #[unsafe(method_family = none)]
259        pub fn anchorPoint(&self) -> CGPoint;
260
261        #[cfg(feature = "objc2-core-foundation")]
262        /// Setter for [`anchorPoint`][Self::anchorPoint].
263        #[unsafe(method(setAnchorPoint:))]
264        #[unsafe(method_family = none)]
265        pub fn setAnchorPoint(&self, anchor_point: CGPoint);
266
267        #[cfg(feature = "objc2-core-foundation")]
268        #[unsafe(method(anchorPointZ))]
269        #[unsafe(method_family = none)]
270        pub fn anchorPointZ(&self) -> CGFloat;
271
272        #[cfg(feature = "objc2-core-foundation")]
273        /// Setter for [`anchorPointZ`][Self::anchorPointZ].
274        #[unsafe(method(setAnchorPointZ:))]
275        #[unsafe(method_family = none)]
276        pub fn setAnchorPointZ(&self, anchor_point_z: CGFloat);
277
278        #[cfg(all(feature = "CATransform3D", feature = "objc2-core-foundation"))]
279        #[unsafe(method(transform))]
280        #[unsafe(method_family = none)]
281        pub fn transform(&self) -> CATransform3D;
282
283        #[cfg(all(feature = "CATransform3D", feature = "objc2-core-foundation"))]
284        /// Setter for [`transform`][Self::transform].
285        #[unsafe(method(setTransform:))]
286        #[unsafe(method_family = none)]
287        pub fn setTransform(&self, transform: CATransform3D);
288
289        #[cfg(feature = "objc2-core-foundation")]
290        #[unsafe(method(affineTransform))]
291        #[unsafe(method_family = none)]
292        pub fn affineTransform(&self) -> CGAffineTransform;
293
294        #[cfg(feature = "objc2-core-foundation")]
295        #[unsafe(method(setAffineTransform:))]
296        #[unsafe(method_family = none)]
297        pub fn setAffineTransform(&self, m: CGAffineTransform);
298
299        #[cfg(feature = "objc2-core-foundation")]
300        #[unsafe(method(frame))]
301        #[unsafe(method_family = none)]
302        pub fn frame(&self) -> CGRect;
303
304        #[cfg(feature = "objc2-core-foundation")]
305        /// Setter for [`frame`][Self::frame].
306        #[unsafe(method(setFrame:))]
307        #[unsafe(method_family = none)]
308        pub fn setFrame(&self, frame: CGRect);
309
310        #[unsafe(method(isHidden))]
311        #[unsafe(method_family = none)]
312        pub fn isHidden(&self) -> bool;
313
314        /// Setter for [`isHidden`][Self::isHidden].
315        #[unsafe(method(setHidden:))]
316        #[unsafe(method_family = none)]
317        pub fn setHidden(&self, hidden: bool);
318
319        #[unsafe(method(isDoubleSided))]
320        #[unsafe(method_family = none)]
321        pub fn isDoubleSided(&self) -> bool;
322
323        /// Setter for [`isDoubleSided`][Self::isDoubleSided].
324        #[unsafe(method(setDoubleSided:))]
325        #[unsafe(method_family = none)]
326        pub fn setDoubleSided(&self, double_sided: bool);
327
328        #[unsafe(method(isGeometryFlipped))]
329        #[unsafe(method_family = none)]
330        pub fn isGeometryFlipped(&self) -> bool;
331
332        /// Setter for [`isGeometryFlipped`][Self::isGeometryFlipped].
333        #[unsafe(method(setGeometryFlipped:))]
334        #[unsafe(method_family = none)]
335        pub fn setGeometryFlipped(&self, geometry_flipped: bool);
336
337        #[unsafe(method(contentsAreFlipped))]
338        #[unsafe(method_family = none)]
339        pub fn contentsAreFlipped(&self) -> bool;
340
341        #[unsafe(method(superlayer))]
342        #[unsafe(method_family = none)]
343        pub fn superlayer(&self) -> Option<Retained<CALayer>>;
344
345        #[unsafe(method(removeFromSuperlayer))]
346        #[unsafe(method_family = none)]
347        pub fn removeFromSuperlayer(&self);
348
349        #[unsafe(method(sublayers))]
350        #[unsafe(method_family = none)]
351        pub unsafe fn sublayers(&self) -> Option<Retained<NSArray<CALayer>>>;
352
353        /// Setter for [`sublayers`][Self::sublayers].
354        ///
355        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
356        #[unsafe(method(setSublayers:))]
357        #[unsafe(method_family = none)]
358        pub unsafe fn setSublayers(&self, sublayers: Option<&NSArray<CALayer>>);
359
360        #[unsafe(method(addSublayer:))]
361        #[unsafe(method_family = none)]
362        pub fn addSublayer(&self, layer: &CALayer);
363
364        #[unsafe(method(insertSublayer:atIndex:))]
365        #[unsafe(method_family = none)]
366        pub fn insertSublayer_atIndex(&self, layer: &CALayer, idx: c_uint);
367
368        #[unsafe(method(insertSublayer:below:))]
369        #[unsafe(method_family = none)]
370        pub fn insertSublayer_below(&self, layer: &CALayer, sibling: Option<&CALayer>);
371
372        #[unsafe(method(insertSublayer:above:))]
373        #[unsafe(method_family = none)]
374        pub fn insertSublayer_above(&self, layer: &CALayer, sibling: Option<&CALayer>);
375
376        #[unsafe(method(replaceSublayer:with:))]
377        #[unsafe(method_family = none)]
378        pub unsafe fn replaceSublayer_with(&self, old_layer: &CALayer, new_layer: &CALayer);
379
380        #[cfg(all(feature = "CATransform3D", feature = "objc2-core-foundation"))]
381        #[unsafe(method(sublayerTransform))]
382        #[unsafe(method_family = none)]
383        pub fn sublayerTransform(&self) -> CATransform3D;
384
385        #[cfg(all(feature = "CATransform3D", feature = "objc2-core-foundation"))]
386        /// Setter for [`sublayerTransform`][Self::sublayerTransform].
387        #[unsafe(method(setSublayerTransform:))]
388        #[unsafe(method_family = none)]
389        pub fn setSublayerTransform(&self, sublayer_transform: CATransform3D);
390
391        #[unsafe(method(mask))]
392        #[unsafe(method_family = none)]
393        pub fn mask(&self) -> Option<Retained<CALayer>>;
394
395        /// Setter for [`mask`][Self::mask].
396        #[unsafe(method(setMask:))]
397        #[unsafe(method_family = none)]
398        pub unsafe fn setMask(&self, mask: Option<&CALayer>);
399
400        #[unsafe(method(masksToBounds))]
401        #[unsafe(method_family = none)]
402        pub fn masksToBounds(&self) -> bool;
403
404        /// Setter for [`masksToBounds`][Self::masksToBounds].
405        #[unsafe(method(setMasksToBounds:))]
406        #[unsafe(method_family = none)]
407        pub fn setMasksToBounds(&self, masks_to_bounds: bool);
408
409        #[cfg(feature = "objc2-core-foundation")]
410        /// Mapping between layer coordinate and time spaces. *
411        #[unsafe(method(convertPoint:fromLayer:))]
412        #[unsafe(method_family = none)]
413        pub fn convertPoint_fromLayer(&self, p: CGPoint, l: Option<&CALayer>) -> CGPoint;
414
415        #[cfg(feature = "objc2-core-foundation")]
416        #[unsafe(method(convertPoint:toLayer:))]
417        #[unsafe(method_family = none)]
418        pub fn convertPoint_toLayer(&self, p: CGPoint, l: Option<&CALayer>) -> CGPoint;
419
420        #[cfg(feature = "objc2-core-foundation")]
421        #[unsafe(method(convertRect:fromLayer:))]
422        #[unsafe(method_family = none)]
423        pub fn convertRect_fromLayer(&self, r: CGRect, l: Option<&CALayer>) -> CGRect;
424
425        #[cfg(feature = "objc2-core-foundation")]
426        #[unsafe(method(convertRect:toLayer:))]
427        #[unsafe(method_family = none)]
428        pub fn convertRect_toLayer(&self, r: CGRect, l: Option<&CALayer>) -> CGRect;
429
430        #[cfg(feature = "objc2-core-foundation")]
431        #[unsafe(method(convertTime:fromLayer:))]
432        #[unsafe(method_family = none)]
433        pub fn convertTime_fromLayer(
434            &self,
435            t: CFTimeInterval,
436            l: Option<&CALayer>,
437        ) -> CFTimeInterval;
438
439        #[cfg(feature = "objc2-core-foundation")]
440        #[unsafe(method(convertTime:toLayer:))]
441        #[unsafe(method_family = none)]
442        pub fn convertTime_toLayer(&self, t: CFTimeInterval, l: Option<&CALayer>)
443            -> CFTimeInterval;
444
445        #[cfg(feature = "objc2-core-foundation")]
446        /// Hit testing methods. *
447        #[unsafe(method(hitTest:))]
448        #[unsafe(method_family = none)]
449        pub fn hitTest(&self, p: CGPoint) -> Option<Retained<CALayer>>;
450
451        #[cfg(feature = "objc2-core-foundation")]
452        #[unsafe(method(containsPoint:))]
453        #[unsafe(method_family = none)]
454        pub fn containsPoint(&self, p: CGPoint) -> bool;
455
456        /// Layer content properties and methods. *
457        #[unsafe(method(contents))]
458        #[unsafe(method_family = none)]
459        pub unsafe fn contents(&self) -> Option<Retained<AnyObject>>;
460
461        /// Setter for [`contents`][Self::contents].
462        ///
463        /// # Safety
464        ///
465        /// `contents` should be of the correct type.
466        #[unsafe(method(setContents:))]
467        #[unsafe(method_family = none)]
468        pub unsafe fn setContents(&self, contents: Option<&AnyObject>);
469
470        #[cfg(feature = "objc2-core-foundation")]
471        #[unsafe(method(contentsRect))]
472        #[unsafe(method_family = none)]
473        pub fn contentsRect(&self) -> CGRect;
474
475        #[cfg(feature = "objc2-core-foundation")]
476        /// Setter for [`contentsRect`][Self::contentsRect].
477        #[unsafe(method(setContentsRect:))]
478        #[unsafe(method_family = none)]
479        pub fn setContentsRect(&self, contents_rect: CGRect);
480
481        #[unsafe(method(contentsGravity))]
482        #[unsafe(method_family = none)]
483        pub fn contentsGravity(&self) -> Retained<CALayerContentsGravity>;
484
485        /// Setter for [`contentsGravity`][Self::contentsGravity].
486        ///
487        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
488        #[unsafe(method(setContentsGravity:))]
489        #[unsafe(method_family = none)]
490        pub fn setContentsGravity(&self, contents_gravity: &CALayerContentsGravity);
491
492        #[cfg(feature = "objc2-core-foundation")]
493        #[unsafe(method(contentsScale))]
494        #[unsafe(method_family = none)]
495        pub fn contentsScale(&self) -> CGFloat;
496
497        #[cfg(feature = "objc2-core-foundation")]
498        /// Setter for [`contentsScale`][Self::contentsScale].
499        #[unsafe(method(setContentsScale:))]
500        #[unsafe(method_family = none)]
501        pub fn setContentsScale(&self, contents_scale: CGFloat);
502
503        #[cfg(feature = "objc2-core-foundation")]
504        #[unsafe(method(contentsCenter))]
505        #[unsafe(method_family = none)]
506        pub fn contentsCenter(&self) -> CGRect;
507
508        #[cfg(feature = "objc2-core-foundation")]
509        /// Setter for [`contentsCenter`][Self::contentsCenter].
510        #[unsafe(method(setContentsCenter:))]
511        #[unsafe(method_family = none)]
512        pub fn setContentsCenter(&self, contents_center: CGRect);
513
514        #[unsafe(method(contentsFormat))]
515        #[unsafe(method_family = none)]
516        pub fn contentsFormat(&self) -> Retained<CALayerContentsFormat>;
517
518        /// Setter for [`contentsFormat`][Self::contentsFormat].
519        ///
520        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
521        #[unsafe(method(setContentsFormat:))]
522        #[unsafe(method_family = none)]
523        pub fn setContentsFormat(&self, contents_format: &CALayerContentsFormat);
524
525        #[deprecated = "Use preferredDynamicRange instead"]
526        #[unsafe(method(wantsExtendedDynamicRangeContent))]
527        #[unsafe(method_family = none)]
528        pub fn wantsExtendedDynamicRangeContent(&self) -> bool;
529
530        /// Setter for [`wantsExtendedDynamicRangeContent`][Self::wantsExtendedDynamicRangeContent].
531        #[deprecated = "Use preferredDynamicRange instead"]
532        #[unsafe(method(setWantsExtendedDynamicRangeContent:))]
533        #[unsafe(method_family = none)]
534        pub fn setWantsExtendedDynamicRangeContent(
535            &self,
536            wants_extended_dynamic_range_content: bool,
537        );
538
539        #[unsafe(method(toneMapMode))]
540        #[unsafe(method_family = none)]
541        pub fn toneMapMode(&self) -> Retained<CAToneMapMode>;
542
543        /// Setter for [`toneMapMode`][Self::toneMapMode].
544        ///
545        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
546        #[unsafe(method(setToneMapMode:))]
547        #[unsafe(method_family = none)]
548        pub fn setToneMapMode(&self, tone_map_mode: &CAToneMapMode);
549
550        #[unsafe(method(preferredDynamicRange))]
551        #[unsafe(method_family = none)]
552        pub fn preferredDynamicRange(&self) -> Retained<CADynamicRange>;
553
554        /// Setter for [`preferredDynamicRange`][Self::preferredDynamicRange].
555        ///
556        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
557        #[unsafe(method(setPreferredDynamicRange:))]
558        #[unsafe(method_family = none)]
559        pub fn setPreferredDynamicRange(&self, preferred_dynamic_range: &CADynamicRange);
560
561        #[cfg(feature = "objc2-core-foundation")]
562        #[unsafe(method(contentsHeadroom))]
563        #[unsafe(method_family = none)]
564        pub fn contentsHeadroom(&self) -> CGFloat;
565
566        #[cfg(feature = "objc2-core-foundation")]
567        /// Setter for [`contentsHeadroom`][Self::contentsHeadroom].
568        #[unsafe(method(setContentsHeadroom:))]
569        #[unsafe(method_family = none)]
570        pub fn setContentsHeadroom(&self, contents_headroom: CGFloat);
571
572        #[unsafe(method(wantsDynamicContentScaling))]
573        #[unsafe(method_family = none)]
574        pub fn wantsDynamicContentScaling(&self) -> bool;
575
576        /// Setter for [`wantsDynamicContentScaling`][Self::wantsDynamicContentScaling].
577        #[unsafe(method(setWantsDynamicContentScaling:))]
578        #[unsafe(method_family = none)]
579        pub fn setWantsDynamicContentScaling(&self, wants_dynamic_content_scaling: bool);
580
581        #[unsafe(method(minificationFilter))]
582        #[unsafe(method_family = none)]
583        pub fn minificationFilter(&self) -> Retained<CALayerContentsFilter>;
584
585        /// Setter for [`minificationFilter`][Self::minificationFilter].
586        ///
587        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
588        #[unsafe(method(setMinificationFilter:))]
589        #[unsafe(method_family = none)]
590        pub fn setMinificationFilter(&self, minification_filter: &CALayerContentsFilter);
591
592        #[unsafe(method(magnificationFilter))]
593        #[unsafe(method_family = none)]
594        pub fn magnificationFilter(&self) -> Retained<CALayerContentsFilter>;
595
596        /// Setter for [`magnificationFilter`][Self::magnificationFilter].
597        ///
598        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
599        #[unsafe(method(setMagnificationFilter:))]
600        #[unsafe(method_family = none)]
601        pub fn setMagnificationFilter(&self, magnification_filter: &CALayerContentsFilter);
602
603        #[unsafe(method(minificationFilterBias))]
604        #[unsafe(method_family = none)]
605        pub fn minificationFilterBias(&self) -> c_float;
606
607        /// Setter for [`minificationFilterBias`][Self::minificationFilterBias].
608        #[unsafe(method(setMinificationFilterBias:))]
609        #[unsafe(method_family = none)]
610        pub fn setMinificationFilterBias(&self, minification_filter_bias: c_float);
611
612        #[unsafe(method(isOpaque))]
613        #[unsafe(method_family = none)]
614        pub fn isOpaque(&self) -> bool;
615
616        /// Setter for [`isOpaque`][Self::isOpaque].
617        #[unsafe(method(setOpaque:))]
618        #[unsafe(method_family = none)]
619        pub fn setOpaque(&self, opaque: bool);
620
621        #[unsafe(method(display))]
622        #[unsafe(method_family = none)]
623        pub fn display(&self);
624
625        #[unsafe(method(setNeedsDisplay))]
626        #[unsafe(method_family = none)]
627        pub fn setNeedsDisplay(&self);
628
629        #[cfg(feature = "objc2-core-foundation")]
630        #[unsafe(method(setNeedsDisplayInRect:))]
631        #[unsafe(method_family = none)]
632        pub fn setNeedsDisplayInRect(&self, r: CGRect);
633
634        #[unsafe(method(needsDisplay))]
635        #[unsafe(method_family = none)]
636        pub fn needsDisplay(&self) -> bool;
637
638        #[unsafe(method(displayIfNeeded))]
639        #[unsafe(method_family = none)]
640        pub fn displayIfNeeded(&self);
641
642        #[unsafe(method(needsDisplayOnBoundsChange))]
643        #[unsafe(method_family = none)]
644        pub fn needsDisplayOnBoundsChange(&self) -> bool;
645
646        /// Setter for [`needsDisplayOnBoundsChange`][Self::needsDisplayOnBoundsChange].
647        #[unsafe(method(setNeedsDisplayOnBoundsChange:))]
648        #[unsafe(method_family = none)]
649        pub fn setNeedsDisplayOnBoundsChange(&self, needs_display_on_bounds_change: bool);
650
651        #[unsafe(method(drawsAsynchronously))]
652        #[unsafe(method_family = none)]
653        pub fn drawsAsynchronously(&self) -> bool;
654
655        /// Setter for [`drawsAsynchronously`][Self::drawsAsynchronously].
656        #[unsafe(method(setDrawsAsynchronously:))]
657        #[unsafe(method_family = none)]
658        pub fn setDrawsAsynchronously(&self, draws_asynchronously: bool);
659
660        #[cfg(feature = "objc2-core-graphics")]
661        #[unsafe(method(drawInContext:))]
662        #[unsafe(method_family = none)]
663        pub fn drawInContext(&self, ctx: &CGContext);
664
665        #[cfg(feature = "objc2-core-graphics")]
666        /// Rendering properties and methods. *
667        #[unsafe(method(renderInContext:))]
668        #[unsafe(method_family = none)]
669        pub fn renderInContext(&self, ctx: &CGContext);
670
671        #[unsafe(method(edgeAntialiasingMask))]
672        #[unsafe(method_family = none)]
673        pub fn edgeAntialiasingMask(&self) -> CAEdgeAntialiasingMask;
674
675        /// Setter for [`edgeAntialiasingMask`][Self::edgeAntialiasingMask].
676        #[unsafe(method(setEdgeAntialiasingMask:))]
677        #[unsafe(method_family = none)]
678        pub fn setEdgeAntialiasingMask(&self, edge_antialiasing_mask: CAEdgeAntialiasingMask);
679
680        #[unsafe(method(allowsEdgeAntialiasing))]
681        #[unsafe(method_family = none)]
682        pub fn allowsEdgeAntialiasing(&self) -> bool;
683
684        /// Setter for [`allowsEdgeAntialiasing`][Self::allowsEdgeAntialiasing].
685        #[unsafe(method(setAllowsEdgeAntialiasing:))]
686        #[unsafe(method_family = none)]
687        pub fn setAllowsEdgeAntialiasing(&self, allows_edge_antialiasing: bool);
688
689        #[cfg(feature = "objc2-core-graphics")]
690        #[unsafe(method(backgroundColor))]
691        #[unsafe(method_family = none)]
692        pub fn backgroundColor(&self) -> Option<Retained<CGColor>>;
693
694        #[cfg(feature = "objc2-core-graphics")]
695        /// Setter for [`backgroundColor`][Self::backgroundColor].
696        #[unsafe(method(setBackgroundColor:))]
697        #[unsafe(method_family = none)]
698        pub fn setBackgroundColor(&self, background_color: Option<&CGColor>);
699
700        #[cfg(feature = "objc2-core-foundation")]
701        #[unsafe(method(cornerRadius))]
702        #[unsafe(method_family = none)]
703        pub fn cornerRadius(&self) -> CGFloat;
704
705        #[cfg(feature = "objc2-core-foundation")]
706        /// Setter for [`cornerRadius`][Self::cornerRadius].
707        #[unsafe(method(setCornerRadius:))]
708        #[unsafe(method_family = none)]
709        pub fn setCornerRadius(&self, corner_radius: CGFloat);
710
711        #[unsafe(method(maskedCorners))]
712        #[unsafe(method_family = none)]
713        pub fn maskedCorners(&self) -> CACornerMask;
714
715        /// Setter for [`maskedCorners`][Self::maskedCorners].
716        #[unsafe(method(setMaskedCorners:))]
717        #[unsafe(method_family = none)]
718        pub fn setMaskedCorners(&self, masked_corners: CACornerMask);
719
720        #[unsafe(method(cornerCurve))]
721        #[unsafe(method_family = none)]
722        pub fn cornerCurve(&self) -> Retained<CALayerCornerCurve>;
723
724        /// Setter for [`cornerCurve`][Self::cornerCurve].
725        ///
726        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
727        #[unsafe(method(setCornerCurve:))]
728        #[unsafe(method_family = none)]
729        pub fn setCornerCurve(&self, corner_curve: &CALayerCornerCurve);
730
731        #[cfg(feature = "objc2-core-foundation")]
732        #[unsafe(method(cornerCurveExpansionFactor:))]
733        #[unsafe(method_family = none)]
734        pub fn cornerCurveExpansionFactor(curve: &CALayerCornerCurve) -> CGFloat;
735
736        #[cfg(feature = "objc2-core-foundation")]
737        #[unsafe(method(borderWidth))]
738        #[unsafe(method_family = none)]
739        pub fn borderWidth(&self) -> CGFloat;
740
741        #[cfg(feature = "objc2-core-foundation")]
742        /// Setter for [`borderWidth`][Self::borderWidth].
743        #[unsafe(method(setBorderWidth:))]
744        #[unsafe(method_family = none)]
745        pub fn setBorderWidth(&self, border_width: CGFloat);
746
747        #[cfg(feature = "objc2-core-graphics")]
748        #[unsafe(method(borderColor))]
749        #[unsafe(method_family = none)]
750        pub fn borderColor(&self) -> Option<Retained<CGColor>>;
751
752        #[cfg(feature = "objc2-core-graphics")]
753        /// Setter for [`borderColor`][Self::borderColor].
754        #[unsafe(method(setBorderColor:))]
755        #[unsafe(method_family = none)]
756        pub fn setBorderColor(&self, border_color: Option<&CGColor>);
757
758        #[unsafe(method(opacity))]
759        #[unsafe(method_family = none)]
760        pub fn opacity(&self) -> c_float;
761
762        /// Setter for [`opacity`][Self::opacity].
763        #[unsafe(method(setOpacity:))]
764        #[unsafe(method_family = none)]
765        pub fn setOpacity(&self, opacity: c_float);
766
767        #[unsafe(method(allowsGroupOpacity))]
768        #[unsafe(method_family = none)]
769        pub fn allowsGroupOpacity(&self) -> bool;
770
771        /// Setter for [`allowsGroupOpacity`][Self::allowsGroupOpacity].
772        #[unsafe(method(setAllowsGroupOpacity:))]
773        #[unsafe(method_family = none)]
774        pub fn setAllowsGroupOpacity(&self, allows_group_opacity: bool);
775
776        #[unsafe(method(compositingFilter))]
777        #[unsafe(method_family = none)]
778        pub fn compositingFilter(&self) -> Option<Retained<AnyObject>>;
779
780        /// Setter for [`compositingFilter`][Self::compositingFilter].
781        ///
782        /// # Safety
783        ///
784        /// `compositing_filter` should be of the correct type.
785        #[unsafe(method(setCompositingFilter:))]
786        #[unsafe(method_family = none)]
787        pub unsafe fn setCompositingFilter(&self, compositing_filter: Option<&AnyObject>);
788
789        #[unsafe(method(filters))]
790        #[unsafe(method_family = none)]
791        pub fn filters(&self) -> Option<Retained<NSArray>>;
792
793        /// Setter for [`filters`][Self::filters].
794        ///
795        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
796        ///
797        /// # Safety
798        ///
799        /// `filters` generic should be of the correct type.
800        #[unsafe(method(setFilters:))]
801        #[unsafe(method_family = none)]
802        pub unsafe fn setFilters(&self, filters: Option<&NSArray>);
803
804        #[unsafe(method(backgroundFilters))]
805        #[unsafe(method_family = none)]
806        pub fn backgroundFilters(&self) -> Option<Retained<NSArray>>;
807
808        /// Setter for [`backgroundFilters`][Self::backgroundFilters].
809        ///
810        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
811        ///
812        /// # Safety
813        ///
814        /// `background_filters` generic should be of the correct type.
815        #[unsafe(method(setBackgroundFilters:))]
816        #[unsafe(method_family = none)]
817        pub unsafe fn setBackgroundFilters(&self, background_filters: Option<&NSArray>);
818
819        #[unsafe(method(shouldRasterize))]
820        #[unsafe(method_family = none)]
821        pub fn shouldRasterize(&self) -> bool;
822
823        /// Setter for [`shouldRasterize`][Self::shouldRasterize].
824        #[unsafe(method(setShouldRasterize:))]
825        #[unsafe(method_family = none)]
826        pub fn setShouldRasterize(&self, should_rasterize: bool);
827
828        #[cfg(feature = "objc2-core-foundation")]
829        #[unsafe(method(rasterizationScale))]
830        #[unsafe(method_family = none)]
831        pub fn rasterizationScale(&self) -> CGFloat;
832
833        #[cfg(feature = "objc2-core-foundation")]
834        /// Setter for [`rasterizationScale`][Self::rasterizationScale].
835        #[unsafe(method(setRasterizationScale:))]
836        #[unsafe(method_family = none)]
837        pub fn setRasterizationScale(&self, rasterization_scale: CGFloat);
838
839        #[cfg(feature = "objc2-core-graphics")]
840        /// Shadow properties. *
841        #[unsafe(method(shadowColor))]
842        #[unsafe(method_family = none)]
843        pub fn shadowColor(&self) -> Option<Retained<CGColor>>;
844
845        #[cfg(feature = "objc2-core-graphics")]
846        /// Setter for [`shadowColor`][Self::shadowColor].
847        #[unsafe(method(setShadowColor:))]
848        #[unsafe(method_family = none)]
849        pub fn setShadowColor(&self, shadow_color: Option<&CGColor>);
850
851        #[unsafe(method(shadowOpacity))]
852        #[unsafe(method_family = none)]
853        pub fn shadowOpacity(&self) -> c_float;
854
855        /// Setter for [`shadowOpacity`][Self::shadowOpacity].
856        #[unsafe(method(setShadowOpacity:))]
857        #[unsafe(method_family = none)]
858        pub fn setShadowOpacity(&self, shadow_opacity: c_float);
859
860        #[cfg(feature = "objc2-core-foundation")]
861        #[unsafe(method(shadowOffset))]
862        #[unsafe(method_family = none)]
863        pub fn shadowOffset(&self) -> CGSize;
864
865        #[cfg(feature = "objc2-core-foundation")]
866        /// Setter for [`shadowOffset`][Self::shadowOffset].
867        #[unsafe(method(setShadowOffset:))]
868        #[unsafe(method_family = none)]
869        pub fn setShadowOffset(&self, shadow_offset: CGSize);
870
871        #[cfg(feature = "objc2-core-foundation")]
872        #[unsafe(method(shadowRadius))]
873        #[unsafe(method_family = none)]
874        pub fn shadowRadius(&self) -> CGFloat;
875
876        #[cfg(feature = "objc2-core-foundation")]
877        /// Setter for [`shadowRadius`][Self::shadowRadius].
878        #[unsafe(method(setShadowRadius:))]
879        #[unsafe(method_family = none)]
880        pub fn setShadowRadius(&self, shadow_radius: CGFloat);
881
882        #[cfg(feature = "objc2-core-graphics")]
883        #[unsafe(method(shadowPath))]
884        #[unsafe(method_family = none)]
885        pub fn shadowPath(&self) -> Option<Retained<CGPath>>;
886
887        #[cfg(feature = "objc2-core-graphics")]
888        /// Setter for [`shadowPath`][Self::shadowPath].
889        #[unsafe(method(setShadowPath:))]
890        #[unsafe(method_family = none)]
891        pub fn setShadowPath(&self, shadow_path: Option<&CGPath>);
892
893        /// Layout methods. *
894        #[unsafe(method(autoresizingMask))]
895        #[unsafe(method_family = none)]
896        pub fn autoresizingMask(&self) -> CAAutoresizingMask;
897
898        /// Setter for [`autoresizingMask`][Self::autoresizingMask].
899        #[unsafe(method(setAutoresizingMask:))]
900        #[unsafe(method_family = none)]
901        pub fn setAutoresizingMask(&self, autoresizing_mask: CAAutoresizingMask);
902
903        #[unsafe(method(layoutManager))]
904        #[unsafe(method_family = none)]
905        pub fn layoutManager(&self) -> Option<Retained<ProtocolObject<dyn CALayoutManager>>>;
906
907        /// Setter for [`layoutManager`][Self::layoutManager].
908        #[unsafe(method(setLayoutManager:))]
909        #[unsafe(method_family = none)]
910        pub fn setLayoutManager(
911            &self,
912            layout_manager: Option<&ProtocolObject<dyn CALayoutManager>>,
913        );
914
915        #[cfg(feature = "objc2-core-foundation")]
916        #[unsafe(method(preferredFrameSize))]
917        #[unsafe(method_family = none)]
918        pub fn preferredFrameSize(&self) -> CGSize;
919
920        #[unsafe(method(setNeedsLayout))]
921        #[unsafe(method_family = none)]
922        pub fn setNeedsLayout(&self);
923
924        #[unsafe(method(needsLayout))]
925        #[unsafe(method_family = none)]
926        pub fn needsLayout(&self) -> bool;
927
928        #[unsafe(method(layoutIfNeeded))]
929        #[unsafe(method_family = none)]
930        pub fn layoutIfNeeded(&self);
931
932        #[unsafe(method(layoutSublayers))]
933        #[unsafe(method_family = none)]
934        pub fn layoutSublayers(&self);
935
936        #[cfg(feature = "objc2-core-foundation")]
937        #[unsafe(method(resizeSublayersWithOldSize:))]
938        #[unsafe(method_family = none)]
939        pub fn resizeSublayersWithOldSize(&self, size: CGSize);
940
941        #[cfg(feature = "objc2-core-foundation")]
942        #[unsafe(method(resizeWithOldSuperlayerSize:))]
943        #[unsafe(method_family = none)]
944        pub fn resizeWithOldSuperlayerSize(&self, size: CGSize);
945
946        /// Action methods. *
947        #[unsafe(method(defaultActionForKey:))]
948        #[unsafe(method_family = none)]
949        pub fn defaultActionForKey(
950            event: &NSString,
951        ) -> Option<Retained<ProtocolObject<dyn CAAction>>>;
952
953        #[unsafe(method(actionForKey:))]
954        #[unsafe(method_family = none)]
955        pub fn actionForKey(
956            &self,
957            event: &NSString,
958        ) -> Option<Retained<ProtocolObject<dyn CAAction>>>;
959
960        #[unsafe(method(actions))]
961        #[unsafe(method_family = none)]
962        pub fn actions(
963            &self,
964        ) -> Option<Retained<NSDictionary<NSString, ProtocolObject<dyn CAAction>>>>;
965
966        /// Setter for [`actions`][Self::actions].
967        ///
968        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
969        #[unsafe(method(setActions:))]
970        #[unsafe(method_family = none)]
971        pub fn setActions(
972            &self,
973            actions: Option<&NSDictionary<NSString, ProtocolObject<dyn CAAction>>>,
974        );
975
976        #[cfg(feature = "CAAnimation")]
977        /// Animation methods. *
978        #[unsafe(method(addAnimation:forKey:))]
979        #[unsafe(method_family = none)]
980        pub fn addAnimation_forKey(&self, anim: &CAAnimation, key: Option<&NSString>);
981
982        #[unsafe(method(removeAllAnimations))]
983        #[unsafe(method_family = none)]
984        pub fn removeAllAnimations(&self);
985
986        #[unsafe(method(removeAnimationForKey:))]
987        #[unsafe(method_family = none)]
988        pub fn removeAnimationForKey(&self, key: &NSString);
989
990        #[unsafe(method(animationKeys))]
991        #[unsafe(method_family = none)]
992        pub fn animationKeys(&self) -> Option<Retained<NSArray<NSString>>>;
993
994        #[cfg(feature = "CAAnimation")]
995        #[unsafe(method(animationForKey:))]
996        #[unsafe(method_family = none)]
997        pub unsafe fn animationForKey(&self, key: &NSString) -> Option<Retained<CAAnimation>>;
998
999        /// Miscellaneous properties. *
1000        #[unsafe(method(name))]
1001        #[unsafe(method_family = none)]
1002        pub fn name(&self) -> Option<Retained<NSString>>;
1003
1004        /// Setter for [`name`][Self::name].
1005        ///
1006        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1007        #[unsafe(method(setName:))]
1008        #[unsafe(method_family = none)]
1009        pub fn setName(&self, name: Option<&NSString>);
1010
1011        #[unsafe(method(delegate))]
1012        #[unsafe(method_family = none)]
1013        pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn CALayerDelegate>>>;
1014
1015        /// Setter for [`delegate`][Self::delegate].
1016        ///
1017        /// This is a [weak property][objc2::topics::weak_property].
1018        #[unsafe(method(setDelegate:))]
1019        #[unsafe(method_family = none)]
1020        pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn CALayerDelegate>>);
1021
1022        #[unsafe(method(style))]
1023        #[unsafe(method_family = none)]
1024        pub fn style(&self) -> Option<Retained<NSDictionary>>;
1025
1026        /// Setter for [`style`][Self::style].
1027        ///
1028        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
1029        ///
1030        /// # Safety
1031        ///
1032        /// `style` generic should be of the correct type.
1033        #[unsafe(method(setStyle:))]
1034        #[unsafe(method_family = none)]
1035        pub unsafe fn setStyle(&self, style: Option<&NSDictionary>);
1036    );
1037}
1038
1039/// Methods declared on superclass `NSObject`.
1040impl CALayer {
1041    extern_methods!(
1042        #[unsafe(method(new))]
1043        #[unsafe(method_family = new)]
1044        pub fn new() -> Retained<Self>;
1045    );
1046}
1047
1048impl DefaultRetained for CALayer {
1049    #[inline]
1050    fn default_retained() -> Retained<Self> {
1051        Self::new()
1052    }
1053}
1054
1055extern_protocol!(
1056    /// Layout manager protocol. *
1057    ///
1058    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/calayoutmanager?language=objc)
1059    pub unsafe trait CALayoutManager: NSObjectProtocol {
1060        #[cfg(feature = "objc2-core-foundation")]
1061        #[optional]
1062        #[unsafe(method(preferredSizeOfLayer:))]
1063        #[unsafe(method_family = none)]
1064        fn preferredSizeOfLayer(&self, layer: &CALayer) -> CGSize;
1065
1066        #[optional]
1067        #[unsafe(method(invalidateLayoutOfLayer:))]
1068        #[unsafe(method_family = none)]
1069        fn invalidateLayoutOfLayer(&self, layer: &CALayer);
1070
1071        #[optional]
1072        #[unsafe(method(layoutSublayersOfLayer:))]
1073        #[unsafe(method_family = none)]
1074        fn layoutSublayersOfLayer(&self, layer: &CALayer);
1075    }
1076);
1077
1078extern_protocol!(
1079    /// Action (event handler) protocol. *
1080    ///
1081    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/caaction?language=objc)
1082    pub unsafe trait CAAction {
1083        /// # Safety
1084        ///
1085        /// - `an_object` should be of the correct type.
1086        /// - `dict` generic should be of the correct type.
1087        #[unsafe(method(runActionForKey:object:arguments:))]
1088        #[unsafe(method_family = none)]
1089        unsafe fn runActionForKey_object_arguments(
1090            &self,
1091            event: &NSString,
1092            an_object: &AnyObject,
1093            dict: Option<&NSDictionary>,
1094        );
1095    }
1096);
1097
1098extern_conformance!(
1099    unsafe impl CAAction for NSNull {}
1100);
1101
1102extern_protocol!(
1103    /// Delegate methods. *
1104    ///
1105    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/calayerdelegate?language=objc)
1106    pub unsafe trait CALayerDelegate: NSObjectProtocol {
1107        #[optional]
1108        #[unsafe(method(displayLayer:))]
1109        #[unsafe(method_family = none)]
1110        fn displayLayer(&self, layer: &CALayer);
1111
1112        #[cfg(feature = "objc2-core-graphics")]
1113        #[optional]
1114        #[unsafe(method(drawLayer:inContext:))]
1115        #[unsafe(method_family = none)]
1116        fn drawLayer_inContext(&self, layer: &CALayer, ctx: &CGContext);
1117
1118        #[optional]
1119        #[unsafe(method(layerWillDraw:))]
1120        #[unsafe(method_family = none)]
1121        fn layerWillDraw(&self, layer: &CALayer);
1122
1123        #[optional]
1124        #[unsafe(method(layoutSublayersOfLayer:))]
1125        #[unsafe(method_family = none)]
1126        fn layoutSublayersOfLayer(&self, layer: &CALayer);
1127
1128        #[optional]
1129        #[unsafe(method(actionForLayer:forKey:))]
1130        #[unsafe(method_family = none)]
1131        fn actionForLayer_forKey(
1132            &self,
1133            layer: &CALayer,
1134            event: &NSString,
1135        ) -> Option<Retained<ProtocolObject<dyn CAAction>>>;
1136    }
1137);
1138
1139extern "C" {
1140    /// Layer `contentsGravity' values. *
1141    ///
1142    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcagravitycenter?language=objc)
1143    pub static kCAGravityCenter: &'static CALayerContentsGravity;
1144}
1145
1146extern "C" {
1147    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcagravitytop?language=objc)
1148    pub static kCAGravityTop: &'static CALayerContentsGravity;
1149}
1150
1151extern "C" {
1152    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcagravitybottom?language=objc)
1153    pub static kCAGravityBottom: &'static CALayerContentsGravity;
1154}
1155
1156extern "C" {
1157    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcagravityleft?language=objc)
1158    pub static kCAGravityLeft: &'static CALayerContentsGravity;
1159}
1160
1161extern "C" {
1162    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcagravityright?language=objc)
1163    pub static kCAGravityRight: &'static CALayerContentsGravity;
1164}
1165
1166extern "C" {
1167    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcagravitytopleft?language=objc)
1168    pub static kCAGravityTopLeft: &'static CALayerContentsGravity;
1169}
1170
1171extern "C" {
1172    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcagravitytopright?language=objc)
1173    pub static kCAGravityTopRight: &'static CALayerContentsGravity;
1174}
1175
1176extern "C" {
1177    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcagravitybottomleft?language=objc)
1178    pub static kCAGravityBottomLeft: &'static CALayerContentsGravity;
1179}
1180
1181extern "C" {
1182    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcagravitybottomright?language=objc)
1183    pub static kCAGravityBottomRight: &'static CALayerContentsGravity;
1184}
1185
1186extern "C" {
1187    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcagravityresize?language=objc)
1188    pub static kCAGravityResize: &'static CALayerContentsGravity;
1189}
1190
1191extern "C" {
1192    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcagravityresizeaspect?language=objc)
1193    pub static kCAGravityResizeAspect: &'static CALayerContentsGravity;
1194}
1195
1196extern "C" {
1197    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcagravityresizeaspectfill?language=objc)
1198    pub static kCAGravityResizeAspectFill: &'static CALayerContentsGravity;
1199}
1200
1201extern "C" {
1202    /// Layer `contentsFormat` values. *
1203    ///
1204    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcacontentsformatrgba8uint?language=objc)
1205    pub static kCAContentsFormatRGBA8Uint: &'static CALayerContentsFormat;
1206}
1207
1208extern "C" {
1209    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcacontentsformatrgba16float?language=objc)
1210    pub static kCAContentsFormatRGBA16Float: &'static CALayerContentsFormat;
1211}
1212
1213extern "C" {
1214    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcacontentsformatgray8uint?language=objc)
1215    pub static kCAContentsFormatGray8Uint: &'static CALayerContentsFormat;
1216}
1217
1218extern "C" {
1219    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcacontentsformatautomatic?language=objc)
1220    pub static kCAContentsFormatAutomatic: &'static CALayerContentsFormat;
1221}
1222
1223extern "C" {
1224    /// Contents filter names. *
1225    ///
1226    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcafilternearest?language=objc)
1227    pub static kCAFilterNearest: &'static CALayerContentsFilter;
1228}
1229
1230extern "C" {
1231    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcafilterlinear?language=objc)
1232    pub static kCAFilterLinear: &'static CALayerContentsFilter;
1233}
1234
1235extern "C" {
1236    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcafiltertrilinear?language=objc)
1237    pub static kCAFilterTrilinear: &'static CALayerContentsFilter;
1238}
1239
1240extern "C" {
1241    /// Corner curve names. *
1242    ///
1243    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcacornercurvecircular?language=objc)
1244    pub static kCACornerCurveCircular: &'static CALayerCornerCurve;
1245}
1246
1247extern "C" {
1248    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcacornercurvecontinuous?language=objc)
1249    pub static kCACornerCurveContinuous: &'static CALayerCornerCurve;
1250}
1251
1252extern "C" {
1253    /// Layer event names. *
1254    ///
1255    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaonorderin?language=objc)
1256    pub static kCAOnOrderIn: &'static NSString;
1257}
1258
1259extern "C" {
1260    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaonorderout?language=objc)
1261    pub static kCAOnOrderOut: &'static NSString;
1262}
1263
1264extern "C" {
1265    /// The animation key used for transitions. *
1266    ///
1267    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransition?language=objc)
1268    pub static kCATransition: &'static NSString;
1269}