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
81#[repr(transparent)]
84#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
85pub struct CAEdgeAntialiasingMask(pub c_uint);
86bitflags::bitflags! {
87 impl CAEdgeAntialiasingMask: c_uint {
88 #[doc(alias = "kCALayerLeftEdge")]
89 const LayerLeftEdge = 1<<0;
90 #[doc(alias = "kCALayerRightEdge")]
91 const LayerRightEdge = 1<<1;
92 #[doc(alias = "kCALayerBottomEdge")]
93 const LayerBottomEdge = 1<<2;
94 #[doc(alias = "kCALayerTopEdge")]
95 const LayerTopEdge = 1<<3;
96 }
97}
98
99unsafe impl Encode for CAEdgeAntialiasingMask {
100 const ENCODING: Encoding = c_uint::ENCODING;
101}
102
103unsafe impl RefEncode for CAEdgeAntialiasingMask {
104 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
105}
106
107#[repr(transparent)]
110#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
111pub struct CACornerMask(pub NSUInteger);
112bitflags::bitflags! {
113 impl CACornerMask: NSUInteger {
114 #[doc(alias = "kCALayerMinXMinYCorner")]
115 const LayerMinXMinYCorner = 1<<0;
116 #[doc(alias = "kCALayerMaxXMinYCorner")]
117 const LayerMaxXMinYCorner = 1<<1;
118 #[doc(alias = "kCALayerMinXMaxYCorner")]
119 const LayerMinXMaxYCorner = 1<<2;
120 #[doc(alias = "kCALayerMaxXMaxYCorner")]
121 const LayerMaxXMaxYCorner = 1<<3;
122 }
123}
124
125unsafe impl Encode for CACornerMask {
126 const ENCODING: Encoding = NSUInteger::ENCODING;
127}
128
129unsafe impl RefEncode for CACornerMask {
130 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
131}
132
133extern_class!(
134 #[unsafe(super(NSObject))]
138 #[derive(Debug, PartialEq, Eq, Hash)]
139 pub struct CALayer;
140);
141
142#[cfg(feature = "CAMediaTiming")]
143extern_conformance!(
144 unsafe impl CAMediaTiming for CALayer {}
145);
146
147extern_conformance!(
148 unsafe impl NSCoding for CALayer {}
149);
150
151extern_conformance!(
152 unsafe impl NSObjectProtocol for CALayer {}
153);
154
155extern_conformance!(
156 unsafe impl NSSecureCoding for CALayer {}
157);
158
159impl CALayer {
160 extern_methods!(
161 #[unsafe(method(layer))]
163 #[unsafe(method_family = none)]
164 pub fn layer() -> Retained<Self>;
165
166 #[unsafe(method(init))]
167 #[unsafe(method_family = init)]
168 pub fn init(this: Allocated<Self>) -> Retained<Self>;
169
170 #[unsafe(method(initWithLayer:))]
171 #[unsafe(method_family = init)]
172 pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
173
174 #[unsafe(method(presentationLayer))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn presentationLayer(&self) -> Option<Retained<Self>>;
177
178 #[unsafe(method(modelLayer))]
179 #[unsafe(method_family = none)]
180 pub unsafe fn modelLayer(&self) -> Retained<Self>;
181
182 #[unsafe(method(defaultValueForKey:))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn defaultValueForKey(key: &NSString) -> Option<Retained<AnyObject>>;
186
187 #[unsafe(method(needsDisplayForKey:))]
188 #[unsafe(method_family = none)]
189 pub unsafe fn needsDisplayForKey(key: &NSString) -> bool;
190
191 #[unsafe(method(shouldArchiveValueForKey:))]
192 #[unsafe(method_family = none)]
193 pub unsafe fn shouldArchiveValueForKey(&self, key: &NSString) -> bool;
194
195 #[cfg(feature = "objc2-core-foundation")]
196 #[unsafe(method(bounds))]
198 #[unsafe(method_family = none)]
199 pub fn bounds(&self) -> CGRect;
200
201 #[cfg(feature = "objc2-core-foundation")]
202 #[unsafe(method(setBounds:))]
204 #[unsafe(method_family = none)]
205 pub fn setBounds(&self, bounds: CGRect);
206
207 #[cfg(feature = "objc2-core-foundation")]
208 #[unsafe(method(position))]
209 #[unsafe(method_family = none)]
210 pub fn position(&self) -> CGPoint;
211
212 #[cfg(feature = "objc2-core-foundation")]
213 #[unsafe(method(setPosition:))]
215 #[unsafe(method_family = none)]
216 pub fn setPosition(&self, position: CGPoint);
217
218 #[cfg(feature = "objc2-core-foundation")]
219 #[unsafe(method(zPosition))]
220 #[unsafe(method_family = none)]
221 pub fn zPosition(&self) -> CGFloat;
222
223 #[cfg(feature = "objc2-core-foundation")]
224 #[unsafe(method(setZPosition:))]
226 #[unsafe(method_family = none)]
227 pub fn setZPosition(&self, z_position: CGFloat);
228
229 #[cfg(feature = "objc2-core-foundation")]
230 #[unsafe(method(anchorPoint))]
231 #[unsafe(method_family = none)]
232 pub fn anchorPoint(&self) -> CGPoint;
233
234 #[cfg(feature = "objc2-core-foundation")]
235 #[unsafe(method(setAnchorPoint:))]
237 #[unsafe(method_family = none)]
238 pub fn setAnchorPoint(&self, anchor_point: CGPoint);
239
240 #[cfg(feature = "objc2-core-foundation")]
241 #[unsafe(method(anchorPointZ))]
242 #[unsafe(method_family = none)]
243 pub fn anchorPointZ(&self) -> CGFloat;
244
245 #[cfg(feature = "objc2-core-foundation")]
246 #[unsafe(method(setAnchorPointZ:))]
248 #[unsafe(method_family = none)]
249 pub fn setAnchorPointZ(&self, anchor_point_z: CGFloat);
250
251 #[cfg(all(feature = "CATransform3D", feature = "objc2-core-foundation"))]
252 #[unsafe(method(transform))]
253 #[unsafe(method_family = none)]
254 pub fn transform(&self) -> CATransform3D;
255
256 #[cfg(all(feature = "CATransform3D", feature = "objc2-core-foundation"))]
257 #[unsafe(method(setTransform:))]
259 #[unsafe(method_family = none)]
260 pub fn setTransform(&self, transform: CATransform3D);
261
262 #[cfg(feature = "objc2-core-foundation")]
263 #[unsafe(method(affineTransform))]
264 #[unsafe(method_family = none)]
265 pub fn affineTransform(&self) -> CGAffineTransform;
266
267 #[cfg(feature = "objc2-core-foundation")]
268 #[unsafe(method(setAffineTransform:))]
269 #[unsafe(method_family = none)]
270 pub fn setAffineTransform(&self, m: CGAffineTransform);
271
272 #[cfg(feature = "objc2-core-foundation")]
273 #[unsafe(method(frame))]
274 #[unsafe(method_family = none)]
275 pub fn frame(&self) -> CGRect;
276
277 #[cfg(feature = "objc2-core-foundation")]
278 #[unsafe(method(setFrame:))]
280 #[unsafe(method_family = none)]
281 pub fn setFrame(&self, frame: CGRect);
282
283 #[unsafe(method(isHidden))]
284 #[unsafe(method_family = none)]
285 pub fn isHidden(&self) -> bool;
286
287 #[unsafe(method(setHidden:))]
289 #[unsafe(method_family = none)]
290 pub fn setHidden(&self, hidden: bool);
291
292 #[unsafe(method(isDoubleSided))]
293 #[unsafe(method_family = none)]
294 pub fn isDoubleSided(&self) -> bool;
295
296 #[unsafe(method(setDoubleSided:))]
298 #[unsafe(method_family = none)]
299 pub fn setDoubleSided(&self, double_sided: bool);
300
301 #[unsafe(method(isGeometryFlipped))]
302 #[unsafe(method_family = none)]
303 pub fn isGeometryFlipped(&self) -> bool;
304
305 #[unsafe(method(setGeometryFlipped:))]
307 #[unsafe(method_family = none)]
308 pub fn setGeometryFlipped(&self, geometry_flipped: bool);
309
310 #[unsafe(method(contentsAreFlipped))]
311 #[unsafe(method_family = none)]
312 pub fn contentsAreFlipped(&self) -> bool;
313
314 #[unsafe(method(superlayer))]
315 #[unsafe(method_family = none)]
316 pub fn superlayer(&self) -> Option<Retained<CALayer>>;
317
318 #[unsafe(method(removeFromSuperlayer))]
319 #[unsafe(method_family = none)]
320 pub fn removeFromSuperlayer(&self);
321
322 #[unsafe(method(sublayers))]
323 #[unsafe(method_family = none)]
324 pub unsafe fn sublayers(&self) -> Option<Retained<NSArray<CALayer>>>;
325
326 #[unsafe(method(setSublayers:))]
328 #[unsafe(method_family = none)]
329 pub unsafe fn setSublayers(&self, sublayers: Option<&NSArray<CALayer>>);
330
331 #[unsafe(method(addSublayer:))]
332 #[unsafe(method_family = none)]
333 pub fn addSublayer(&self, layer: &CALayer);
334
335 #[unsafe(method(insertSublayer:atIndex:))]
336 #[unsafe(method_family = none)]
337 pub fn insertSublayer_atIndex(&self, layer: &CALayer, idx: c_uint);
338
339 #[unsafe(method(insertSublayer:below:))]
340 #[unsafe(method_family = none)]
341 pub fn insertSublayer_below(&self, layer: &CALayer, sibling: Option<&CALayer>);
342
343 #[unsafe(method(insertSublayer:above:))]
344 #[unsafe(method_family = none)]
345 pub fn insertSublayer_above(&self, layer: &CALayer, sibling: Option<&CALayer>);
346
347 #[unsafe(method(replaceSublayer:with:))]
348 #[unsafe(method_family = none)]
349 pub unsafe fn replaceSublayer_with(&self, old_layer: &CALayer, new_layer: &CALayer);
350
351 #[cfg(all(feature = "CATransform3D", feature = "objc2-core-foundation"))]
352 #[unsafe(method(sublayerTransform))]
353 #[unsafe(method_family = none)]
354 pub fn sublayerTransform(&self) -> CATransform3D;
355
356 #[cfg(all(feature = "CATransform3D", feature = "objc2-core-foundation"))]
357 #[unsafe(method(setSublayerTransform:))]
359 #[unsafe(method_family = none)]
360 pub fn setSublayerTransform(&self, sublayer_transform: CATransform3D);
361
362 #[unsafe(method(mask))]
363 #[unsafe(method_family = none)]
364 pub fn mask(&self) -> Option<Retained<CALayer>>;
365
366 #[unsafe(method(setMask:))]
368 #[unsafe(method_family = none)]
369 pub unsafe fn setMask(&self, mask: Option<&CALayer>);
370
371 #[unsafe(method(masksToBounds))]
372 #[unsafe(method_family = none)]
373 pub fn masksToBounds(&self) -> bool;
374
375 #[unsafe(method(setMasksToBounds:))]
377 #[unsafe(method_family = none)]
378 pub fn setMasksToBounds(&self, masks_to_bounds: bool);
379
380 #[cfg(feature = "objc2-core-foundation")]
381 #[unsafe(method(convertPoint:fromLayer:))]
383 #[unsafe(method_family = none)]
384 pub fn convertPoint_fromLayer(&self, p: CGPoint, l: Option<&CALayer>) -> CGPoint;
385
386 #[cfg(feature = "objc2-core-foundation")]
387 #[unsafe(method(convertPoint:toLayer:))]
388 #[unsafe(method_family = none)]
389 pub fn convertPoint_toLayer(&self, p: CGPoint, l: Option<&CALayer>) -> CGPoint;
390
391 #[cfg(feature = "objc2-core-foundation")]
392 #[unsafe(method(convertRect:fromLayer:))]
393 #[unsafe(method_family = none)]
394 pub fn convertRect_fromLayer(&self, r: CGRect, l: Option<&CALayer>) -> CGRect;
395
396 #[cfg(feature = "objc2-core-foundation")]
397 #[unsafe(method(convertRect:toLayer:))]
398 #[unsafe(method_family = none)]
399 pub fn convertRect_toLayer(&self, r: CGRect, l: Option<&CALayer>) -> CGRect;
400
401 #[cfg(feature = "objc2-core-foundation")]
402 #[unsafe(method(convertTime:fromLayer:))]
403 #[unsafe(method_family = none)]
404 pub fn convertTime_fromLayer(
405 &self,
406 t: CFTimeInterval,
407 l: Option<&CALayer>,
408 ) -> CFTimeInterval;
409
410 #[cfg(feature = "objc2-core-foundation")]
411 #[unsafe(method(convertTime:toLayer:))]
412 #[unsafe(method_family = none)]
413 pub fn convertTime_toLayer(&self, t: CFTimeInterval, l: Option<&CALayer>)
414 -> CFTimeInterval;
415
416 #[cfg(feature = "objc2-core-foundation")]
417 #[unsafe(method(hitTest:))]
419 #[unsafe(method_family = none)]
420 pub fn hitTest(&self, p: CGPoint) -> Option<Retained<CALayer>>;
421
422 #[cfg(feature = "objc2-core-foundation")]
423 #[unsafe(method(containsPoint:))]
424 #[unsafe(method_family = none)]
425 pub fn containsPoint(&self, p: CGPoint) -> bool;
426
427 #[unsafe(method(contents))]
429 #[unsafe(method_family = none)]
430 pub unsafe fn contents(&self) -> Option<Retained<AnyObject>>;
431
432 #[unsafe(method(setContents:))]
434 #[unsafe(method_family = none)]
435 pub unsafe fn setContents(&self, contents: Option<&AnyObject>);
436
437 #[cfg(feature = "objc2-core-foundation")]
438 #[unsafe(method(contentsRect))]
439 #[unsafe(method_family = none)]
440 pub fn contentsRect(&self) -> CGRect;
441
442 #[cfg(feature = "objc2-core-foundation")]
443 #[unsafe(method(setContentsRect:))]
445 #[unsafe(method_family = none)]
446 pub fn setContentsRect(&self, contents_rect: CGRect);
447
448 #[unsafe(method(contentsGravity))]
449 #[unsafe(method_family = none)]
450 pub fn contentsGravity(&self) -> Retained<CALayerContentsGravity>;
451
452 #[unsafe(method(setContentsGravity:))]
454 #[unsafe(method_family = none)]
455 pub fn setContentsGravity(&self, contents_gravity: &CALayerContentsGravity);
456
457 #[cfg(feature = "objc2-core-foundation")]
458 #[unsafe(method(contentsScale))]
459 #[unsafe(method_family = none)]
460 pub fn contentsScale(&self) -> CGFloat;
461
462 #[cfg(feature = "objc2-core-foundation")]
463 #[unsafe(method(setContentsScale:))]
465 #[unsafe(method_family = none)]
466 pub fn setContentsScale(&self, contents_scale: CGFloat);
467
468 #[cfg(feature = "objc2-core-foundation")]
469 #[unsafe(method(contentsCenter))]
470 #[unsafe(method_family = none)]
471 pub fn contentsCenter(&self) -> CGRect;
472
473 #[cfg(feature = "objc2-core-foundation")]
474 #[unsafe(method(setContentsCenter:))]
476 #[unsafe(method_family = none)]
477 pub fn setContentsCenter(&self, contents_center: CGRect);
478
479 #[unsafe(method(contentsFormat))]
480 #[unsafe(method_family = none)]
481 pub fn contentsFormat(&self) -> Retained<CALayerContentsFormat>;
482
483 #[unsafe(method(setContentsFormat:))]
485 #[unsafe(method_family = none)]
486 pub fn setContentsFormat(&self, contents_format: &CALayerContentsFormat);
487
488 #[unsafe(method(wantsExtendedDynamicRangeContent))]
489 #[unsafe(method_family = none)]
490 pub unsafe fn wantsExtendedDynamicRangeContent(&self) -> bool;
491
492 #[unsafe(method(setWantsExtendedDynamicRangeContent:))]
494 #[unsafe(method_family = none)]
495 pub unsafe fn setWantsExtendedDynamicRangeContent(
496 &self,
497 wants_extended_dynamic_range_content: bool,
498 );
499
500 #[unsafe(method(toneMapMode))]
501 #[unsafe(method_family = none)]
502 pub unsafe fn toneMapMode(&self) -> Retained<CAToneMapMode>;
503
504 #[unsafe(method(setToneMapMode:))]
506 #[unsafe(method_family = none)]
507 pub unsafe fn setToneMapMode(&self, tone_map_mode: &CAToneMapMode);
508
509 #[unsafe(method(wantsDynamicContentScaling))]
510 #[unsafe(method_family = none)]
511 pub unsafe fn wantsDynamicContentScaling(&self) -> bool;
512
513 #[unsafe(method(setWantsDynamicContentScaling:))]
515 #[unsafe(method_family = none)]
516 pub unsafe fn setWantsDynamicContentScaling(&self, wants_dynamic_content_scaling: bool);
517
518 #[unsafe(method(minificationFilter))]
519 #[unsafe(method_family = none)]
520 pub fn minificationFilter(&self) -> Retained<CALayerContentsFilter>;
521
522 #[unsafe(method(setMinificationFilter:))]
524 #[unsafe(method_family = none)]
525 pub fn setMinificationFilter(&self, minification_filter: &CALayerContentsFilter);
526
527 #[unsafe(method(magnificationFilter))]
528 #[unsafe(method_family = none)]
529 pub fn magnificationFilter(&self) -> Retained<CALayerContentsFilter>;
530
531 #[unsafe(method(setMagnificationFilter:))]
533 #[unsafe(method_family = none)]
534 pub fn setMagnificationFilter(&self, magnification_filter: &CALayerContentsFilter);
535
536 #[unsafe(method(minificationFilterBias))]
537 #[unsafe(method_family = none)]
538 pub fn minificationFilterBias(&self) -> c_float;
539
540 #[unsafe(method(setMinificationFilterBias:))]
542 #[unsafe(method_family = none)]
543 pub fn setMinificationFilterBias(&self, minification_filter_bias: c_float);
544
545 #[unsafe(method(isOpaque))]
546 #[unsafe(method_family = none)]
547 pub fn isOpaque(&self) -> bool;
548
549 #[unsafe(method(setOpaque:))]
551 #[unsafe(method_family = none)]
552 pub fn setOpaque(&self, opaque: bool);
553
554 #[unsafe(method(display))]
555 #[unsafe(method_family = none)]
556 pub fn display(&self);
557
558 #[unsafe(method(setNeedsDisplay))]
559 #[unsafe(method_family = none)]
560 pub fn setNeedsDisplay(&self);
561
562 #[cfg(feature = "objc2-core-foundation")]
563 #[unsafe(method(setNeedsDisplayInRect:))]
564 #[unsafe(method_family = none)]
565 pub fn setNeedsDisplayInRect(&self, r: CGRect);
566
567 #[unsafe(method(needsDisplay))]
568 #[unsafe(method_family = none)]
569 pub fn needsDisplay(&self) -> bool;
570
571 #[unsafe(method(displayIfNeeded))]
572 #[unsafe(method_family = none)]
573 pub fn displayIfNeeded(&self);
574
575 #[unsafe(method(needsDisplayOnBoundsChange))]
576 #[unsafe(method_family = none)]
577 pub fn needsDisplayOnBoundsChange(&self) -> bool;
578
579 #[unsafe(method(setNeedsDisplayOnBoundsChange:))]
581 #[unsafe(method_family = none)]
582 pub fn setNeedsDisplayOnBoundsChange(&self, needs_display_on_bounds_change: bool);
583
584 #[unsafe(method(drawsAsynchronously))]
585 #[unsafe(method_family = none)]
586 pub fn drawsAsynchronously(&self) -> bool;
587
588 #[unsafe(method(setDrawsAsynchronously:))]
590 #[unsafe(method_family = none)]
591 pub fn setDrawsAsynchronously(&self, draws_asynchronously: bool);
592
593 #[cfg(feature = "objc2-core-graphics")]
594 #[unsafe(method(drawInContext:))]
595 #[unsafe(method_family = none)]
596 pub unsafe fn drawInContext(&self, ctx: &CGContext);
597
598 #[cfg(feature = "objc2-core-graphics")]
599 #[unsafe(method(renderInContext:))]
601 #[unsafe(method_family = none)]
602 pub unsafe fn renderInContext(&self, ctx: &CGContext);
603
604 #[unsafe(method(edgeAntialiasingMask))]
605 #[unsafe(method_family = none)]
606 pub fn edgeAntialiasingMask(&self) -> CAEdgeAntialiasingMask;
607
608 #[unsafe(method(setEdgeAntialiasingMask:))]
610 #[unsafe(method_family = none)]
611 pub fn setEdgeAntialiasingMask(&self, edge_antialiasing_mask: CAEdgeAntialiasingMask);
612
613 #[unsafe(method(allowsEdgeAntialiasing))]
614 #[unsafe(method_family = none)]
615 pub fn allowsEdgeAntialiasing(&self) -> bool;
616
617 #[unsafe(method(setAllowsEdgeAntialiasing:))]
619 #[unsafe(method_family = none)]
620 pub fn setAllowsEdgeAntialiasing(&self, allows_edge_antialiasing: bool);
621
622 #[cfg(feature = "objc2-core-graphics")]
623 #[unsafe(method(backgroundColor))]
624 #[unsafe(method_family = none)]
625 pub unsafe fn backgroundColor(&self) -> Option<Retained<CGColor>>;
626
627 #[cfg(feature = "objc2-core-graphics")]
628 #[unsafe(method(setBackgroundColor:))]
630 #[unsafe(method_family = none)]
631 pub unsafe fn setBackgroundColor(&self, background_color: Option<&CGColor>);
632
633 #[cfg(feature = "objc2-core-foundation")]
634 #[unsafe(method(cornerRadius))]
635 #[unsafe(method_family = none)]
636 pub fn cornerRadius(&self) -> CGFloat;
637
638 #[cfg(feature = "objc2-core-foundation")]
639 #[unsafe(method(setCornerRadius:))]
641 #[unsafe(method_family = none)]
642 pub fn setCornerRadius(&self, corner_radius: CGFloat);
643
644 #[unsafe(method(maskedCorners))]
645 #[unsafe(method_family = none)]
646 pub fn maskedCorners(&self) -> CACornerMask;
647
648 #[unsafe(method(setMaskedCorners:))]
650 #[unsafe(method_family = none)]
651 pub fn setMaskedCorners(&self, masked_corners: CACornerMask);
652
653 #[unsafe(method(cornerCurve))]
654 #[unsafe(method_family = none)]
655 pub fn cornerCurve(&self) -> Retained<CALayerCornerCurve>;
656
657 #[unsafe(method(setCornerCurve:))]
659 #[unsafe(method_family = none)]
660 pub fn setCornerCurve(&self, corner_curve: &CALayerCornerCurve);
661
662 #[cfg(feature = "objc2-core-foundation")]
663 #[unsafe(method(cornerCurveExpansionFactor:))]
664 #[unsafe(method_family = none)]
665 pub fn cornerCurveExpansionFactor(curve: &CALayerCornerCurve) -> CGFloat;
666
667 #[cfg(feature = "objc2-core-foundation")]
668 #[unsafe(method(borderWidth))]
669 #[unsafe(method_family = none)]
670 pub fn borderWidth(&self) -> CGFloat;
671
672 #[cfg(feature = "objc2-core-foundation")]
673 #[unsafe(method(setBorderWidth:))]
675 #[unsafe(method_family = none)]
676 pub fn setBorderWidth(&self, border_width: CGFloat);
677
678 #[cfg(feature = "objc2-core-graphics")]
679 #[unsafe(method(borderColor))]
680 #[unsafe(method_family = none)]
681 pub unsafe fn borderColor(&self) -> Option<Retained<CGColor>>;
682
683 #[cfg(feature = "objc2-core-graphics")]
684 #[unsafe(method(setBorderColor:))]
686 #[unsafe(method_family = none)]
687 pub unsafe fn setBorderColor(&self, border_color: Option<&CGColor>);
688
689 #[unsafe(method(opacity))]
690 #[unsafe(method_family = none)]
691 pub fn opacity(&self) -> c_float;
692
693 #[unsafe(method(setOpacity:))]
695 #[unsafe(method_family = none)]
696 pub fn setOpacity(&self, opacity: c_float);
697
698 #[unsafe(method(allowsGroupOpacity))]
699 #[unsafe(method_family = none)]
700 pub fn allowsGroupOpacity(&self) -> bool;
701
702 #[unsafe(method(setAllowsGroupOpacity:))]
704 #[unsafe(method_family = none)]
705 pub fn setAllowsGroupOpacity(&self, allows_group_opacity: bool);
706
707 #[unsafe(method(compositingFilter))]
708 #[unsafe(method_family = none)]
709 pub unsafe fn compositingFilter(&self) -> Option<Retained<AnyObject>>;
710
711 #[unsafe(method(setCompositingFilter:))]
713 #[unsafe(method_family = none)]
714 pub unsafe fn setCompositingFilter(&self, compositing_filter: Option<&AnyObject>);
715
716 #[unsafe(method(filters))]
717 #[unsafe(method_family = none)]
718 pub unsafe fn filters(&self) -> Option<Retained<NSArray>>;
719
720 #[unsafe(method(setFilters:))]
722 #[unsafe(method_family = none)]
723 pub unsafe fn setFilters(&self, filters: Option<&NSArray>);
724
725 #[unsafe(method(backgroundFilters))]
726 #[unsafe(method_family = none)]
727 pub unsafe fn backgroundFilters(&self) -> Option<Retained<NSArray>>;
728
729 #[unsafe(method(setBackgroundFilters:))]
731 #[unsafe(method_family = none)]
732 pub unsafe fn setBackgroundFilters(&self, background_filters: Option<&NSArray>);
733
734 #[unsafe(method(shouldRasterize))]
735 #[unsafe(method_family = none)]
736 pub fn shouldRasterize(&self) -> bool;
737
738 #[unsafe(method(setShouldRasterize:))]
740 #[unsafe(method_family = none)]
741 pub fn setShouldRasterize(&self, should_rasterize: bool);
742
743 #[cfg(feature = "objc2-core-foundation")]
744 #[unsafe(method(rasterizationScale))]
745 #[unsafe(method_family = none)]
746 pub fn rasterizationScale(&self) -> CGFloat;
747
748 #[cfg(feature = "objc2-core-foundation")]
749 #[unsafe(method(setRasterizationScale:))]
751 #[unsafe(method_family = none)]
752 pub fn setRasterizationScale(&self, rasterization_scale: CGFloat);
753
754 #[cfg(feature = "objc2-core-graphics")]
755 #[unsafe(method(shadowColor))]
757 #[unsafe(method_family = none)]
758 pub unsafe fn shadowColor(&self) -> Option<Retained<CGColor>>;
759
760 #[cfg(feature = "objc2-core-graphics")]
761 #[unsafe(method(setShadowColor:))]
763 #[unsafe(method_family = none)]
764 pub unsafe fn setShadowColor(&self, shadow_color: Option<&CGColor>);
765
766 #[unsafe(method(shadowOpacity))]
767 #[unsafe(method_family = none)]
768 pub fn shadowOpacity(&self) -> c_float;
769
770 #[unsafe(method(setShadowOpacity:))]
772 #[unsafe(method_family = none)]
773 pub fn setShadowOpacity(&self, shadow_opacity: c_float);
774
775 #[cfg(feature = "objc2-core-foundation")]
776 #[unsafe(method(shadowOffset))]
777 #[unsafe(method_family = none)]
778 pub fn shadowOffset(&self) -> CGSize;
779
780 #[cfg(feature = "objc2-core-foundation")]
781 #[unsafe(method(setShadowOffset:))]
783 #[unsafe(method_family = none)]
784 pub fn setShadowOffset(&self, shadow_offset: CGSize);
785
786 #[cfg(feature = "objc2-core-foundation")]
787 #[unsafe(method(shadowRadius))]
788 #[unsafe(method_family = none)]
789 pub fn shadowRadius(&self) -> CGFloat;
790
791 #[cfg(feature = "objc2-core-foundation")]
792 #[unsafe(method(setShadowRadius:))]
794 #[unsafe(method_family = none)]
795 pub fn setShadowRadius(&self, shadow_radius: CGFloat);
796
797 #[cfg(feature = "objc2-core-graphics")]
798 #[unsafe(method(shadowPath))]
799 #[unsafe(method_family = none)]
800 pub unsafe fn shadowPath(&self) -> Option<Retained<CGPath>>;
801
802 #[cfg(feature = "objc2-core-graphics")]
803 #[unsafe(method(setShadowPath:))]
805 #[unsafe(method_family = none)]
806 pub unsafe fn setShadowPath(&self, shadow_path: Option<&CGPath>);
807
808 #[unsafe(method(autoresizingMask))]
810 #[unsafe(method_family = none)]
811 pub fn autoresizingMask(&self) -> CAAutoresizingMask;
812
813 #[unsafe(method(setAutoresizingMask:))]
815 #[unsafe(method_family = none)]
816 pub fn setAutoresizingMask(&self, autoresizing_mask: CAAutoresizingMask);
817
818 #[unsafe(method(layoutManager))]
819 #[unsafe(method_family = none)]
820 pub fn layoutManager(&self) -> Option<Retained<ProtocolObject<dyn CALayoutManager>>>;
821
822 #[unsafe(method(setLayoutManager:))]
824 #[unsafe(method_family = none)]
825 pub fn setLayoutManager(
826 &self,
827 layout_manager: Option<&ProtocolObject<dyn CALayoutManager>>,
828 );
829
830 #[cfg(feature = "objc2-core-foundation")]
831 #[unsafe(method(preferredFrameSize))]
832 #[unsafe(method_family = none)]
833 pub fn preferredFrameSize(&self) -> CGSize;
834
835 #[unsafe(method(setNeedsLayout))]
836 #[unsafe(method_family = none)]
837 pub fn setNeedsLayout(&self);
838
839 #[unsafe(method(needsLayout))]
840 #[unsafe(method_family = none)]
841 pub fn needsLayout(&self) -> bool;
842
843 #[unsafe(method(layoutIfNeeded))]
844 #[unsafe(method_family = none)]
845 pub fn layoutIfNeeded(&self);
846
847 #[unsafe(method(layoutSublayers))]
848 #[unsafe(method_family = none)]
849 pub fn layoutSublayers(&self);
850
851 #[cfg(feature = "objc2-core-foundation")]
852 #[unsafe(method(resizeSublayersWithOldSize:))]
853 #[unsafe(method_family = none)]
854 pub fn resizeSublayersWithOldSize(&self, size: CGSize);
855
856 #[cfg(feature = "objc2-core-foundation")]
857 #[unsafe(method(resizeWithOldSuperlayerSize:))]
858 #[unsafe(method_family = none)]
859 pub fn resizeWithOldSuperlayerSize(&self, size: CGSize);
860
861 #[unsafe(method(defaultActionForKey:))]
863 #[unsafe(method_family = none)]
864 pub fn defaultActionForKey(
865 event: &NSString,
866 ) -> Option<Retained<ProtocolObject<dyn CAAction>>>;
867
868 #[unsafe(method(actionForKey:))]
869 #[unsafe(method_family = none)]
870 pub fn actionForKey(
871 &self,
872 event: &NSString,
873 ) -> Option<Retained<ProtocolObject<dyn CAAction>>>;
874
875 #[unsafe(method(actions))]
876 #[unsafe(method_family = none)]
877 pub fn actions(
878 &self,
879 ) -> Option<Retained<NSDictionary<NSString, ProtocolObject<dyn CAAction>>>>;
880
881 #[unsafe(method(setActions:))]
883 #[unsafe(method_family = none)]
884 pub fn setActions(
885 &self,
886 actions: Option<&NSDictionary<NSString, ProtocolObject<dyn CAAction>>>,
887 );
888
889 #[cfg(feature = "CAAnimation")]
890 #[unsafe(method(addAnimation:forKey:))]
892 #[unsafe(method_family = none)]
893 pub fn addAnimation_forKey(&self, anim: &CAAnimation, key: Option<&NSString>);
894
895 #[unsafe(method(removeAllAnimations))]
896 #[unsafe(method_family = none)]
897 pub fn removeAllAnimations(&self);
898
899 #[unsafe(method(removeAnimationForKey:))]
900 #[unsafe(method_family = none)]
901 pub fn removeAnimationForKey(&self, key: &NSString);
902
903 #[unsafe(method(animationKeys))]
904 #[unsafe(method_family = none)]
905 pub fn animationKeys(&self) -> Option<Retained<NSArray<NSString>>>;
906
907 #[cfg(feature = "CAAnimation")]
908 #[unsafe(method(animationForKey:))]
909 #[unsafe(method_family = none)]
910 pub unsafe fn animationForKey(&self, key: &NSString) -> Option<Retained<CAAnimation>>;
911
912 #[unsafe(method(name))]
914 #[unsafe(method_family = none)]
915 pub fn name(&self) -> Option<Retained<NSString>>;
916
917 #[unsafe(method(setName:))]
919 #[unsafe(method_family = none)]
920 pub fn setName(&self, name: Option<&NSString>);
921
922 #[unsafe(method(delegate))]
923 #[unsafe(method_family = none)]
924 pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn CALayerDelegate>>>;
925
926 #[unsafe(method(setDelegate:))]
929 #[unsafe(method_family = none)]
930 pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn CALayerDelegate>>);
931
932 #[unsafe(method(style))]
933 #[unsafe(method_family = none)]
934 pub unsafe fn style(&self) -> Option<Retained<NSDictionary>>;
935
936 #[unsafe(method(setStyle:))]
938 #[unsafe(method_family = none)]
939 pub unsafe fn setStyle(&self, style: Option<&NSDictionary>);
940 );
941}
942
943impl CALayer {
945 extern_methods!(
946 #[unsafe(method(new))]
947 #[unsafe(method_family = new)]
948 pub fn new() -> Retained<Self>;
949 );
950}
951
952impl DefaultRetained for CALayer {
953 #[inline]
954 fn default_retained() -> Retained<Self> {
955 Self::new()
956 }
957}
958
959extern_protocol!(
960 pub unsafe trait CALayoutManager: NSObjectProtocol {
964 #[cfg(feature = "objc2-core-foundation")]
965 #[optional]
966 #[unsafe(method(preferredSizeOfLayer:))]
967 #[unsafe(method_family = none)]
968 unsafe fn preferredSizeOfLayer(&self, layer: &CALayer) -> CGSize;
969
970 #[optional]
971 #[unsafe(method(invalidateLayoutOfLayer:))]
972 #[unsafe(method_family = none)]
973 unsafe fn invalidateLayoutOfLayer(&self, layer: &CALayer);
974
975 #[optional]
976 #[unsafe(method(layoutSublayersOfLayer:))]
977 #[unsafe(method_family = none)]
978 unsafe fn layoutSublayersOfLayer(&self, layer: &CALayer);
979 }
980);
981
982extern_protocol!(
983 pub unsafe trait CAAction {
987 #[unsafe(method(runActionForKey:object:arguments:))]
988 #[unsafe(method_family = none)]
989 unsafe fn runActionForKey_object_arguments(
990 &self,
991 event: &NSString,
992 an_object: &AnyObject,
993 dict: Option<&NSDictionary>,
994 );
995 }
996);
997
998extern_conformance!(
999 unsafe impl CAAction for NSNull {}
1000);
1001
1002extern_protocol!(
1003 pub unsafe trait CALayerDelegate: NSObjectProtocol {
1007 #[optional]
1008 #[unsafe(method(displayLayer:))]
1009 #[unsafe(method_family = none)]
1010 unsafe fn displayLayer(&self, layer: &CALayer);
1011
1012 #[cfg(feature = "objc2-core-graphics")]
1013 #[optional]
1014 #[unsafe(method(drawLayer:inContext:))]
1015 #[unsafe(method_family = none)]
1016 unsafe fn drawLayer_inContext(&self, layer: &CALayer, ctx: &CGContext);
1017
1018 #[optional]
1019 #[unsafe(method(layerWillDraw:))]
1020 #[unsafe(method_family = none)]
1021 unsafe fn layerWillDraw(&self, layer: &CALayer);
1022
1023 #[optional]
1024 #[unsafe(method(layoutSublayersOfLayer:))]
1025 #[unsafe(method_family = none)]
1026 unsafe fn layoutSublayersOfLayer(&self, layer: &CALayer);
1027
1028 #[optional]
1029 #[unsafe(method(actionForLayer:forKey:))]
1030 #[unsafe(method_family = none)]
1031 unsafe fn actionForLayer_forKey(
1032 &self,
1033 layer: &CALayer,
1034 event: &NSString,
1035 ) -> Option<Retained<ProtocolObject<dyn CAAction>>>;
1036 }
1037);
1038
1039extern "C" {
1040 pub static kCAGravityCenter: &'static CALayerContentsGravity;
1044}
1045
1046extern "C" {
1047 pub static kCAGravityTop: &'static CALayerContentsGravity;
1049}
1050
1051extern "C" {
1052 pub static kCAGravityBottom: &'static CALayerContentsGravity;
1054}
1055
1056extern "C" {
1057 pub static kCAGravityLeft: &'static CALayerContentsGravity;
1059}
1060
1061extern "C" {
1062 pub static kCAGravityRight: &'static CALayerContentsGravity;
1064}
1065
1066extern "C" {
1067 pub static kCAGravityTopLeft: &'static CALayerContentsGravity;
1069}
1070
1071extern "C" {
1072 pub static kCAGravityTopRight: &'static CALayerContentsGravity;
1074}
1075
1076extern "C" {
1077 pub static kCAGravityBottomLeft: &'static CALayerContentsGravity;
1079}
1080
1081extern "C" {
1082 pub static kCAGravityBottomRight: &'static CALayerContentsGravity;
1084}
1085
1086extern "C" {
1087 pub static kCAGravityResize: &'static CALayerContentsGravity;
1089}
1090
1091extern "C" {
1092 pub static kCAGravityResizeAspect: &'static CALayerContentsGravity;
1094}
1095
1096extern "C" {
1097 pub static kCAGravityResizeAspectFill: &'static CALayerContentsGravity;
1099}
1100
1101extern "C" {
1102 pub static kCAContentsFormatRGBA8Uint: &'static CALayerContentsFormat;
1106}
1107
1108extern "C" {
1109 pub static kCAContentsFormatRGBA16Float: &'static CALayerContentsFormat;
1111}
1112
1113extern "C" {
1114 pub static kCAContentsFormatGray8Uint: &'static CALayerContentsFormat;
1116}
1117
1118extern "C" {
1119 pub static kCAFilterNearest: &'static CALayerContentsFilter;
1123}
1124
1125extern "C" {
1126 pub static kCAFilterLinear: &'static CALayerContentsFilter;
1128}
1129
1130extern "C" {
1131 pub static kCAFilterTrilinear: &'static CALayerContentsFilter;
1133}
1134
1135extern "C" {
1136 pub static kCACornerCurveCircular: &'static CALayerCornerCurve;
1140}
1141
1142extern "C" {
1143 pub static kCACornerCurveContinuous: &'static CALayerCornerCurve;
1145}
1146
1147extern "C" {
1148 pub static kCAOnOrderIn: &'static NSString;
1152}
1153
1154extern "C" {
1155 pub static kCAOnOrderOut: &'static NSString;
1157}
1158
1159extern "C" {
1160 pub static kCATransition: &'static NSString;
1164}