objc2_quartz_core/generated/
CALayer.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 CALayerContentsGravity = NSString;
17
18pub type CALayerContentsFormat = NSString;
21
22pub type CALayerContentsFilter = NSString;
25
26pub type CALayerCornerCurve = NSString;
29
30#[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
62pub type CAToneMapMode = NSString;
65
66extern "C" {
67 pub static CAToneMapModeAutomatic: &'static CAToneMapMode;
69}
70
71extern "C" {
72 pub static CAToneMapModeNever: &'static CAToneMapMode;
74}
75
76extern "C" {
77 pub static CAToneMapModeIfSupported: &'static CAToneMapMode;
79}
80
81pub type CADynamicRange = NSString;
84
85extern "C" {
86 pub static CADynamicRangeAutomatic: &'static CADynamicRange;
88}
89
90extern "C" {
91 pub static CADynamicRangeStandard: &'static CADynamicRange;
93}
94
95extern "C" {
96 pub static CADynamicRangeConstrainedHigh: &'static CADynamicRange;
98}
99
100extern "C" {
101 pub static CADynamicRangeHigh: &'static CADynamicRange;
103}
104
105#[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#[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 #[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 #[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 #[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 #[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 #[unsafe(method(bounds))]
225 #[unsafe(method_family = none)]
226 pub fn bounds(&self) -> CGRect;
227
228 #[cfg(feature = "objc2-core-foundation")]
229 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[unsafe(method(contents))]
458 #[unsafe(method_family = none)]
459 pub unsafe fn contents(&self) -> Option<Retained<AnyObject>>;
460
461 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[unsafe(method(setRasterizationScale:))]
836 #[unsafe(method_family = none)]
837 pub fn setRasterizationScale(&self, rasterization_scale: CGFloat);
838
839 #[cfg(feature = "objc2-core-graphics")]
840 #[unsafe(method(shadowColor))]
842 #[unsafe(method_family = none)]
843 pub fn shadowColor(&self) -> Option<Retained<CGColor>>;
844
845 #[cfg(feature = "objc2-core-graphics")]
846 #[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 #[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 #[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 #[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 #[unsafe(method(setShadowPath:))]
890 #[unsafe(method_family = none)]
891 pub fn setShadowPath(&self, shadow_path: Option<&CGPath>);
892
893 #[unsafe(method(autoresizingMask))]
895 #[unsafe(method_family = none)]
896 pub fn autoresizingMask(&self) -> CAAutoresizingMask;
897
898 #[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 #[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 #[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 #[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 #[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 #[unsafe(method(name))]
1001 #[unsafe(method_family = none)]
1002 pub fn name(&self) -> Option<Retained<NSString>>;
1003
1004 #[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 #[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 #[unsafe(method(setStyle:))]
1034 #[unsafe(method_family = none)]
1035 pub unsafe fn setStyle(&self, style: Option<&NSDictionary>);
1036 );
1037}
1038
1039impl 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 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 pub unsafe trait CAAction {
1083 #[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 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 pub static kCAGravityCenter: &'static CALayerContentsGravity;
1144}
1145
1146extern "C" {
1147 pub static kCAGravityTop: &'static CALayerContentsGravity;
1149}
1150
1151extern "C" {
1152 pub static kCAGravityBottom: &'static CALayerContentsGravity;
1154}
1155
1156extern "C" {
1157 pub static kCAGravityLeft: &'static CALayerContentsGravity;
1159}
1160
1161extern "C" {
1162 pub static kCAGravityRight: &'static CALayerContentsGravity;
1164}
1165
1166extern "C" {
1167 pub static kCAGravityTopLeft: &'static CALayerContentsGravity;
1169}
1170
1171extern "C" {
1172 pub static kCAGravityTopRight: &'static CALayerContentsGravity;
1174}
1175
1176extern "C" {
1177 pub static kCAGravityBottomLeft: &'static CALayerContentsGravity;
1179}
1180
1181extern "C" {
1182 pub static kCAGravityBottomRight: &'static CALayerContentsGravity;
1184}
1185
1186extern "C" {
1187 pub static kCAGravityResize: &'static CALayerContentsGravity;
1189}
1190
1191extern "C" {
1192 pub static kCAGravityResizeAspect: &'static CALayerContentsGravity;
1194}
1195
1196extern "C" {
1197 pub static kCAGravityResizeAspectFill: &'static CALayerContentsGravity;
1199}
1200
1201extern "C" {
1202 pub static kCAContentsFormatRGBA8Uint: &'static CALayerContentsFormat;
1206}
1207
1208extern "C" {
1209 pub static kCAContentsFormatRGBA16Float: &'static CALayerContentsFormat;
1211}
1212
1213extern "C" {
1214 pub static kCAContentsFormatGray8Uint: &'static CALayerContentsFormat;
1216}
1217
1218extern "C" {
1219 pub static kCAContentsFormatAutomatic: &'static CALayerContentsFormat;
1221}
1222
1223extern "C" {
1224 pub static kCAFilterNearest: &'static CALayerContentsFilter;
1228}
1229
1230extern "C" {
1231 pub static kCAFilterLinear: &'static CALayerContentsFilter;
1233}
1234
1235extern "C" {
1236 pub static kCAFilterTrilinear: &'static CALayerContentsFilter;
1238}
1239
1240extern "C" {
1241 pub static kCACornerCurveCircular: &'static CALayerCornerCurve;
1245}
1246
1247extern "C" {
1248 pub static kCACornerCurveContinuous: &'static CALayerCornerCurve;
1250}
1251
1252extern "C" {
1253 pub static kCAOnOrderIn: &'static NSString;
1257}
1258
1259extern "C" {
1260 pub static kCAOnOrderOut: &'static NSString;
1262}
1263
1264extern "C" {
1265 pub static kCATransition: &'static NSString;
1269}