use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
use objc2_foundation::*;
use crate::*;
pub type CALayerContentsGravity = NSString;
pub type CALayerContentsFormat = NSString;
pub type CALayerContentsFilter = NSString;
pub type CALayerCornerCurve = NSString;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CAAutoresizingMask(pub c_uint);
bitflags::bitflags! {
impl CAAutoresizingMask: c_uint {
#[doc(alias = "kCALayerNotSizable")]
const LayerNotSizable = 0;
#[doc(alias = "kCALayerMinXMargin")]
const LayerMinXMargin = 1<<0;
#[doc(alias = "kCALayerWidthSizable")]
const LayerWidthSizable = 1<<1;
#[doc(alias = "kCALayerMaxXMargin")]
const LayerMaxXMargin = 1<<2;
#[doc(alias = "kCALayerMinYMargin")]
const LayerMinYMargin = 1<<3;
#[doc(alias = "kCALayerHeightSizable")]
const LayerHeightSizable = 1<<4;
#[doc(alias = "kCALayerMaxYMargin")]
const LayerMaxYMargin = 1<<5;
}
}
unsafe impl Encode for CAAutoresizingMask {
const ENCODING: Encoding = c_uint::ENCODING;
}
unsafe impl RefEncode for CAAutoresizingMask {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type CAToneMapMode = NSString;
extern "C" {
pub static CAToneMapModeAutomatic: &'static CAToneMapMode;
}
extern "C" {
pub static CAToneMapModeNever: &'static CAToneMapMode;
}
extern "C" {
pub static CAToneMapModeIfSupported: &'static CAToneMapMode;
}
pub type CADynamicRange = NSString;
extern "C" {
pub static CADynamicRangeAutomatic: &'static CADynamicRange;
}
extern "C" {
pub static CADynamicRangeStandard: &'static CADynamicRange;
}
extern "C" {
pub static CADynamicRangeConstrainedHigh: &'static CADynamicRange;
}
extern "C" {
pub static CADynamicRangeHigh: &'static CADynamicRange;
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CAEdgeAntialiasingMask(pub c_uint);
bitflags::bitflags! {
impl CAEdgeAntialiasingMask: c_uint {
#[doc(alias = "kCALayerLeftEdge")]
const LayerLeftEdge = 1<<0;
#[doc(alias = "kCALayerRightEdge")]
const LayerRightEdge = 1<<1;
#[doc(alias = "kCALayerBottomEdge")]
const LayerBottomEdge = 1<<2;
#[doc(alias = "kCALayerTopEdge")]
const LayerTopEdge = 1<<3;
}
}
unsafe impl Encode for CAEdgeAntialiasingMask {
const ENCODING: Encoding = c_uint::ENCODING;
}
unsafe impl RefEncode for CAEdgeAntialiasingMask {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CACornerMask(pub NSUInteger);
bitflags::bitflags! {
impl CACornerMask: NSUInteger {
#[doc(alias = "kCALayerMinXMinYCorner")]
const LayerMinXMinYCorner = 1<<0;
#[doc(alias = "kCALayerMaxXMinYCorner")]
const LayerMaxXMinYCorner = 1<<1;
#[doc(alias = "kCALayerMinXMaxYCorner")]
const LayerMinXMaxYCorner = 1<<2;
#[doc(alias = "kCALayerMaxXMaxYCorner")]
const LayerMaxXMaxYCorner = 1<<3;
}
}
unsafe impl Encode for CACornerMask {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for CACornerMask {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CALayer;
);
#[cfg(feature = "CAMediaTiming")]
extern_conformance!(
unsafe impl CAMediaTiming for CALayer {}
);
extern_conformance!(
unsafe impl NSCoding for CALayer {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for CALayer {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CALayer {}
);
impl CALayer {
extern_methods!(
#[unsafe(method(layer))]
#[unsafe(method_family = none)]
pub fn layer() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initWithLayer:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
#[unsafe(method(presentationLayer))]
#[unsafe(method_family = none)]
pub unsafe fn presentationLayer(&self) -> Option<Retained<Self>>;
#[unsafe(method(modelLayer))]
#[unsafe(method_family = none)]
pub unsafe fn modelLayer(&self) -> Retained<Self>;
#[unsafe(method(defaultValueForKey:))]
#[unsafe(method_family = none)]
pub unsafe fn defaultValueForKey(key: &NSString) -> Option<Retained<AnyObject>>;
#[unsafe(method(needsDisplayForKey:))]
#[unsafe(method_family = none)]
pub fn needsDisplayForKey(key: &NSString) -> bool;
#[unsafe(method(shouldArchiveValueForKey:))]
#[unsafe(method_family = none)]
pub fn shouldArchiveValueForKey(&self, key: &NSString) -> bool;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(bounds))]
#[unsafe(method_family = none)]
pub fn bounds(&self) -> CGRect;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setBounds:))]
#[unsafe(method_family = none)]
pub fn setBounds(&self, bounds: CGRect);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(position))]
#[unsafe(method_family = none)]
pub fn position(&self) -> CGPoint;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setPosition:))]
#[unsafe(method_family = none)]
pub fn setPosition(&self, position: CGPoint);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(zPosition))]
#[unsafe(method_family = none)]
pub fn zPosition(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setZPosition:))]
#[unsafe(method_family = none)]
pub fn setZPosition(&self, z_position: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(anchorPoint))]
#[unsafe(method_family = none)]
pub fn anchorPoint(&self) -> CGPoint;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setAnchorPoint:))]
#[unsafe(method_family = none)]
pub fn setAnchorPoint(&self, anchor_point: CGPoint);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(anchorPointZ))]
#[unsafe(method_family = none)]
pub fn anchorPointZ(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setAnchorPointZ:))]
#[unsafe(method_family = none)]
pub fn setAnchorPointZ(&self, anchor_point_z: CGFloat);
#[cfg(all(feature = "CATransform3D", feature = "objc2-core-foundation"))]
#[unsafe(method(transform))]
#[unsafe(method_family = none)]
pub fn transform(&self) -> CATransform3D;
#[cfg(all(feature = "CATransform3D", feature = "objc2-core-foundation"))]
#[unsafe(method(setTransform:))]
#[unsafe(method_family = none)]
pub fn setTransform(&self, transform: CATransform3D);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(affineTransform))]
#[unsafe(method_family = none)]
pub fn affineTransform(&self) -> CGAffineTransform;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setAffineTransform:))]
#[unsafe(method_family = none)]
pub fn setAffineTransform(&self, m: CGAffineTransform);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(frame))]
#[unsafe(method_family = none)]
pub fn frame(&self) -> CGRect;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setFrame:))]
#[unsafe(method_family = none)]
pub fn setFrame(&self, frame: CGRect);
#[unsafe(method(isHidden))]
#[unsafe(method_family = none)]
pub fn isHidden(&self) -> bool;
#[unsafe(method(setHidden:))]
#[unsafe(method_family = none)]
pub fn setHidden(&self, hidden: bool);
#[unsafe(method(isDoubleSided))]
#[unsafe(method_family = none)]
pub fn isDoubleSided(&self) -> bool;
#[unsafe(method(setDoubleSided:))]
#[unsafe(method_family = none)]
pub fn setDoubleSided(&self, double_sided: bool);
#[unsafe(method(isGeometryFlipped))]
#[unsafe(method_family = none)]
pub fn isGeometryFlipped(&self) -> bool;
#[unsafe(method(setGeometryFlipped:))]
#[unsafe(method_family = none)]
pub fn setGeometryFlipped(&self, geometry_flipped: bool);
#[unsafe(method(contentsAreFlipped))]
#[unsafe(method_family = none)]
pub fn contentsAreFlipped(&self) -> bool;
#[unsafe(method(superlayer))]
#[unsafe(method_family = none)]
pub fn superlayer(&self) -> Option<Retained<CALayer>>;
#[unsafe(method(removeFromSuperlayer))]
#[unsafe(method_family = none)]
pub fn removeFromSuperlayer(&self);
#[unsafe(method(sublayers))]
#[unsafe(method_family = none)]
pub unsafe fn sublayers(&self) -> Option<Retained<NSArray<CALayer>>>;
#[unsafe(method(setSublayers:))]
#[unsafe(method_family = none)]
pub unsafe fn setSublayers(&self, sublayers: Option<&NSArray<CALayer>>);
#[unsafe(method(addSublayer:))]
#[unsafe(method_family = none)]
pub fn addSublayer(&self, layer: &CALayer);
#[unsafe(method(insertSublayer:atIndex:))]
#[unsafe(method_family = none)]
pub fn insertSublayer_atIndex(&self, layer: &CALayer, idx: c_uint);
#[unsafe(method(insertSublayer:below:))]
#[unsafe(method_family = none)]
pub fn insertSublayer_below(&self, layer: &CALayer, sibling: Option<&CALayer>);
#[unsafe(method(insertSublayer:above:))]
#[unsafe(method_family = none)]
pub fn insertSublayer_above(&self, layer: &CALayer, sibling: Option<&CALayer>);
#[unsafe(method(replaceSublayer:with:))]
#[unsafe(method_family = none)]
pub unsafe fn replaceSublayer_with(&self, old_layer: &CALayer, new_layer: &CALayer);
#[cfg(all(feature = "CATransform3D", feature = "objc2-core-foundation"))]
#[unsafe(method(sublayerTransform))]
#[unsafe(method_family = none)]
pub fn sublayerTransform(&self) -> CATransform3D;
#[cfg(all(feature = "CATransform3D", feature = "objc2-core-foundation"))]
#[unsafe(method(setSublayerTransform:))]
#[unsafe(method_family = none)]
pub fn setSublayerTransform(&self, sublayer_transform: CATransform3D);
#[unsafe(method(mask))]
#[unsafe(method_family = none)]
pub fn mask(&self) -> Option<Retained<CALayer>>;
#[unsafe(method(setMask:))]
#[unsafe(method_family = none)]
pub unsafe fn setMask(&self, mask: Option<&CALayer>);
#[unsafe(method(masksToBounds))]
#[unsafe(method_family = none)]
pub fn masksToBounds(&self) -> bool;
#[unsafe(method(setMasksToBounds:))]
#[unsafe(method_family = none)]
pub fn setMasksToBounds(&self, masks_to_bounds: bool);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(convertPoint:fromLayer:))]
#[unsafe(method_family = none)]
pub fn convertPoint_fromLayer(&self, p: CGPoint, l: Option<&CALayer>) -> CGPoint;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(convertPoint:toLayer:))]
#[unsafe(method_family = none)]
pub fn convertPoint_toLayer(&self, p: CGPoint, l: Option<&CALayer>) -> CGPoint;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(convertRect:fromLayer:))]
#[unsafe(method_family = none)]
pub fn convertRect_fromLayer(&self, r: CGRect, l: Option<&CALayer>) -> CGRect;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(convertRect:toLayer:))]
#[unsafe(method_family = none)]
pub fn convertRect_toLayer(&self, r: CGRect, l: Option<&CALayer>) -> CGRect;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(convertTime:fromLayer:))]
#[unsafe(method_family = none)]
pub fn convertTime_fromLayer(
&self,
t: CFTimeInterval,
l: Option<&CALayer>,
) -> CFTimeInterval;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(convertTime:toLayer:))]
#[unsafe(method_family = none)]
pub fn convertTime_toLayer(&self, t: CFTimeInterval, l: Option<&CALayer>)
-> CFTimeInterval;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(hitTest:))]
#[unsafe(method_family = none)]
pub fn hitTest(&self, p: CGPoint) -> Option<Retained<CALayer>>;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(containsPoint:))]
#[unsafe(method_family = none)]
pub fn containsPoint(&self, p: CGPoint) -> bool;
#[unsafe(method(contents))]
#[unsafe(method_family = none)]
pub unsafe fn contents(&self) -> Option<Retained<AnyObject>>;
#[unsafe(method(setContents:))]
#[unsafe(method_family = none)]
pub unsafe fn setContents(&self, contents: Option<&AnyObject>);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(contentsRect))]
#[unsafe(method_family = none)]
pub fn contentsRect(&self) -> CGRect;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setContentsRect:))]
#[unsafe(method_family = none)]
pub fn setContentsRect(&self, contents_rect: CGRect);
#[unsafe(method(contentsGravity))]
#[unsafe(method_family = none)]
pub fn contentsGravity(&self) -> Retained<CALayerContentsGravity>;
#[unsafe(method(setContentsGravity:))]
#[unsafe(method_family = none)]
pub fn setContentsGravity(&self, contents_gravity: &CALayerContentsGravity);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(contentsScale))]
#[unsafe(method_family = none)]
pub fn contentsScale(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setContentsScale:))]
#[unsafe(method_family = none)]
pub fn setContentsScale(&self, contents_scale: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(contentsCenter))]
#[unsafe(method_family = none)]
pub fn contentsCenter(&self) -> CGRect;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setContentsCenter:))]
#[unsafe(method_family = none)]
pub fn setContentsCenter(&self, contents_center: CGRect);
#[unsafe(method(contentsFormat))]
#[unsafe(method_family = none)]
pub fn contentsFormat(&self) -> Retained<CALayerContentsFormat>;
#[unsafe(method(setContentsFormat:))]
#[unsafe(method_family = none)]
pub fn setContentsFormat(&self, contents_format: &CALayerContentsFormat);
#[deprecated = "Use preferredDynamicRange instead"]
#[unsafe(method(wantsExtendedDynamicRangeContent))]
#[unsafe(method_family = none)]
pub fn wantsExtendedDynamicRangeContent(&self) -> bool;
#[deprecated = "Use preferredDynamicRange instead"]
#[unsafe(method(setWantsExtendedDynamicRangeContent:))]
#[unsafe(method_family = none)]
pub fn setWantsExtendedDynamicRangeContent(
&self,
wants_extended_dynamic_range_content: bool,
);
#[unsafe(method(toneMapMode))]
#[unsafe(method_family = none)]
pub fn toneMapMode(&self) -> Retained<CAToneMapMode>;
#[unsafe(method(setToneMapMode:))]
#[unsafe(method_family = none)]
pub fn setToneMapMode(&self, tone_map_mode: &CAToneMapMode);
#[unsafe(method(preferredDynamicRange))]
#[unsafe(method_family = none)]
pub fn preferredDynamicRange(&self) -> Retained<CADynamicRange>;
#[unsafe(method(setPreferredDynamicRange:))]
#[unsafe(method_family = none)]
pub fn setPreferredDynamicRange(&self, preferred_dynamic_range: &CADynamicRange);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(contentsHeadroom))]
#[unsafe(method_family = none)]
pub fn contentsHeadroom(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setContentsHeadroom:))]
#[unsafe(method_family = none)]
pub fn setContentsHeadroom(&self, contents_headroom: CGFloat);
#[unsafe(method(wantsDynamicContentScaling))]
#[unsafe(method_family = none)]
pub fn wantsDynamicContentScaling(&self) -> bool;
#[unsafe(method(setWantsDynamicContentScaling:))]
#[unsafe(method_family = none)]
pub fn setWantsDynamicContentScaling(&self, wants_dynamic_content_scaling: bool);
#[unsafe(method(minificationFilter))]
#[unsafe(method_family = none)]
pub fn minificationFilter(&self) -> Retained<CALayerContentsFilter>;
#[unsafe(method(setMinificationFilter:))]
#[unsafe(method_family = none)]
pub fn setMinificationFilter(&self, minification_filter: &CALayerContentsFilter);
#[unsafe(method(magnificationFilter))]
#[unsafe(method_family = none)]
pub fn magnificationFilter(&self) -> Retained<CALayerContentsFilter>;
#[unsafe(method(setMagnificationFilter:))]
#[unsafe(method_family = none)]
pub fn setMagnificationFilter(&self, magnification_filter: &CALayerContentsFilter);
#[unsafe(method(minificationFilterBias))]
#[unsafe(method_family = none)]
pub fn minificationFilterBias(&self) -> c_float;
#[unsafe(method(setMinificationFilterBias:))]
#[unsafe(method_family = none)]
pub fn setMinificationFilterBias(&self, minification_filter_bias: c_float);
#[unsafe(method(isOpaque))]
#[unsafe(method_family = none)]
pub fn isOpaque(&self) -> bool;
#[unsafe(method(setOpaque:))]
#[unsafe(method_family = none)]
pub fn setOpaque(&self, opaque: bool);
#[unsafe(method(display))]
#[unsafe(method_family = none)]
pub fn display(&self);
#[unsafe(method(setNeedsDisplay))]
#[unsafe(method_family = none)]
pub fn setNeedsDisplay(&self);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setNeedsDisplayInRect:))]
#[unsafe(method_family = none)]
pub fn setNeedsDisplayInRect(&self, r: CGRect);
#[unsafe(method(needsDisplay))]
#[unsafe(method_family = none)]
pub fn needsDisplay(&self) -> bool;
#[unsafe(method(displayIfNeeded))]
#[unsafe(method_family = none)]
pub fn displayIfNeeded(&self);
#[unsafe(method(needsDisplayOnBoundsChange))]
#[unsafe(method_family = none)]
pub fn needsDisplayOnBoundsChange(&self) -> bool;
#[unsafe(method(setNeedsDisplayOnBoundsChange:))]
#[unsafe(method_family = none)]
pub fn setNeedsDisplayOnBoundsChange(&self, needs_display_on_bounds_change: bool);
#[unsafe(method(drawsAsynchronously))]
#[unsafe(method_family = none)]
pub fn drawsAsynchronously(&self) -> bool;
#[unsafe(method(setDrawsAsynchronously:))]
#[unsafe(method_family = none)]
pub fn setDrawsAsynchronously(&self, draws_asynchronously: bool);
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(drawInContext:))]
#[unsafe(method_family = none)]
pub fn drawInContext(&self, ctx: &CGContext);
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(renderInContext:))]
#[unsafe(method_family = none)]
pub fn renderInContext(&self, ctx: &CGContext);
#[unsafe(method(edgeAntialiasingMask))]
#[unsafe(method_family = none)]
pub fn edgeAntialiasingMask(&self) -> CAEdgeAntialiasingMask;
#[unsafe(method(setEdgeAntialiasingMask:))]
#[unsafe(method_family = none)]
pub fn setEdgeAntialiasingMask(&self, edge_antialiasing_mask: CAEdgeAntialiasingMask);
#[unsafe(method(allowsEdgeAntialiasing))]
#[unsafe(method_family = none)]
pub fn allowsEdgeAntialiasing(&self) -> bool;
#[unsafe(method(setAllowsEdgeAntialiasing:))]
#[unsafe(method_family = none)]
pub fn setAllowsEdgeAntialiasing(&self, allows_edge_antialiasing: bool);
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(backgroundColor))]
#[unsafe(method_family = none)]
pub fn backgroundColor(&self) -> Option<Retained<CGColor>>;
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(setBackgroundColor:))]
#[unsafe(method_family = none)]
pub fn setBackgroundColor(&self, background_color: Option<&CGColor>);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(cornerRadius))]
#[unsafe(method_family = none)]
pub fn cornerRadius(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setCornerRadius:))]
#[unsafe(method_family = none)]
pub fn setCornerRadius(&self, corner_radius: CGFloat);
#[unsafe(method(maskedCorners))]
#[unsafe(method_family = none)]
pub fn maskedCorners(&self) -> CACornerMask;
#[unsafe(method(setMaskedCorners:))]
#[unsafe(method_family = none)]
pub fn setMaskedCorners(&self, masked_corners: CACornerMask);
#[unsafe(method(cornerCurve))]
#[unsafe(method_family = none)]
pub fn cornerCurve(&self) -> Retained<CALayerCornerCurve>;
#[unsafe(method(setCornerCurve:))]
#[unsafe(method_family = none)]
pub fn setCornerCurve(&self, corner_curve: &CALayerCornerCurve);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(cornerCurveExpansionFactor:))]
#[unsafe(method_family = none)]
pub fn cornerCurveExpansionFactor(curve: &CALayerCornerCurve) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(borderWidth))]
#[unsafe(method_family = none)]
pub fn borderWidth(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setBorderWidth:))]
#[unsafe(method_family = none)]
pub fn setBorderWidth(&self, border_width: CGFloat);
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(borderColor))]
#[unsafe(method_family = none)]
pub fn borderColor(&self) -> Option<Retained<CGColor>>;
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(setBorderColor:))]
#[unsafe(method_family = none)]
pub fn setBorderColor(&self, border_color: Option<&CGColor>);
#[unsafe(method(opacity))]
#[unsafe(method_family = none)]
pub fn opacity(&self) -> c_float;
#[unsafe(method(setOpacity:))]
#[unsafe(method_family = none)]
pub fn setOpacity(&self, opacity: c_float);
#[unsafe(method(allowsGroupOpacity))]
#[unsafe(method_family = none)]
pub fn allowsGroupOpacity(&self) -> bool;
#[unsafe(method(setAllowsGroupOpacity:))]
#[unsafe(method_family = none)]
pub fn setAllowsGroupOpacity(&self, allows_group_opacity: bool);
#[unsafe(method(compositingFilter))]
#[unsafe(method_family = none)]
pub fn compositingFilter(&self) -> Option<Retained<AnyObject>>;
#[unsafe(method(setCompositingFilter:))]
#[unsafe(method_family = none)]
pub unsafe fn setCompositingFilter(&self, compositing_filter: Option<&AnyObject>);
#[unsafe(method(filters))]
#[unsafe(method_family = none)]
pub fn filters(&self) -> Option<Retained<NSArray>>;
#[unsafe(method(setFilters:))]
#[unsafe(method_family = none)]
pub unsafe fn setFilters(&self, filters: Option<&NSArray>);
#[unsafe(method(backgroundFilters))]
#[unsafe(method_family = none)]
pub fn backgroundFilters(&self) -> Option<Retained<NSArray>>;
#[unsafe(method(setBackgroundFilters:))]
#[unsafe(method_family = none)]
pub unsafe fn setBackgroundFilters(&self, background_filters: Option<&NSArray>);
#[unsafe(method(shouldRasterize))]
#[unsafe(method_family = none)]
pub fn shouldRasterize(&self) -> bool;
#[unsafe(method(setShouldRasterize:))]
#[unsafe(method_family = none)]
pub fn setShouldRasterize(&self, should_rasterize: bool);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(rasterizationScale))]
#[unsafe(method_family = none)]
pub fn rasterizationScale(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setRasterizationScale:))]
#[unsafe(method_family = none)]
pub fn setRasterizationScale(&self, rasterization_scale: CGFloat);
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(shadowColor))]
#[unsafe(method_family = none)]
pub fn shadowColor(&self) -> Option<Retained<CGColor>>;
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(setShadowColor:))]
#[unsafe(method_family = none)]
pub fn setShadowColor(&self, shadow_color: Option<&CGColor>);
#[unsafe(method(shadowOpacity))]
#[unsafe(method_family = none)]
pub fn shadowOpacity(&self) -> c_float;
#[unsafe(method(setShadowOpacity:))]
#[unsafe(method_family = none)]
pub fn setShadowOpacity(&self, shadow_opacity: c_float);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(shadowOffset))]
#[unsafe(method_family = none)]
pub fn shadowOffset(&self) -> CGSize;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setShadowOffset:))]
#[unsafe(method_family = none)]
pub fn setShadowOffset(&self, shadow_offset: CGSize);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(shadowRadius))]
#[unsafe(method_family = none)]
pub fn shadowRadius(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setShadowRadius:))]
#[unsafe(method_family = none)]
pub fn setShadowRadius(&self, shadow_radius: CGFloat);
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(shadowPath))]
#[unsafe(method_family = none)]
pub fn shadowPath(&self) -> Option<Retained<CGPath>>;
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(setShadowPath:))]
#[unsafe(method_family = none)]
pub fn setShadowPath(&self, shadow_path: Option<&CGPath>);
#[unsafe(method(autoresizingMask))]
#[unsafe(method_family = none)]
pub fn autoresizingMask(&self) -> CAAutoresizingMask;
#[unsafe(method(setAutoresizingMask:))]
#[unsafe(method_family = none)]
pub fn setAutoresizingMask(&self, autoresizing_mask: CAAutoresizingMask);
#[unsafe(method(layoutManager))]
#[unsafe(method_family = none)]
pub fn layoutManager(&self) -> Option<Retained<ProtocolObject<dyn CALayoutManager>>>;
#[unsafe(method(setLayoutManager:))]
#[unsafe(method_family = none)]
pub fn setLayoutManager(
&self,
layout_manager: Option<&ProtocolObject<dyn CALayoutManager>>,
);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(preferredFrameSize))]
#[unsafe(method_family = none)]
pub fn preferredFrameSize(&self) -> CGSize;
#[unsafe(method(setNeedsLayout))]
#[unsafe(method_family = none)]
pub fn setNeedsLayout(&self);
#[unsafe(method(needsLayout))]
#[unsafe(method_family = none)]
pub fn needsLayout(&self) -> bool;
#[unsafe(method(layoutIfNeeded))]
#[unsafe(method_family = none)]
pub fn layoutIfNeeded(&self);
#[unsafe(method(layoutSublayers))]
#[unsafe(method_family = none)]
pub fn layoutSublayers(&self);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(resizeSublayersWithOldSize:))]
#[unsafe(method_family = none)]
pub fn resizeSublayersWithOldSize(&self, size: CGSize);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(resizeWithOldSuperlayerSize:))]
#[unsafe(method_family = none)]
pub fn resizeWithOldSuperlayerSize(&self, size: CGSize);
#[unsafe(method(defaultActionForKey:))]
#[unsafe(method_family = none)]
pub fn defaultActionForKey(
event: &NSString,
) -> Option<Retained<ProtocolObject<dyn CAAction>>>;
#[unsafe(method(actionForKey:))]
#[unsafe(method_family = none)]
pub fn actionForKey(
&self,
event: &NSString,
) -> Option<Retained<ProtocolObject<dyn CAAction>>>;
#[unsafe(method(actions))]
#[unsafe(method_family = none)]
pub fn actions(
&self,
) -> Option<Retained<NSDictionary<NSString, ProtocolObject<dyn CAAction>>>>;
#[unsafe(method(setActions:))]
#[unsafe(method_family = none)]
pub fn setActions(
&self,
actions: Option<&NSDictionary<NSString, ProtocolObject<dyn CAAction>>>,
);
#[cfg(feature = "CAAnimation")]
#[unsafe(method(addAnimation:forKey:))]
#[unsafe(method_family = none)]
pub fn addAnimation_forKey(&self, anim: &CAAnimation, key: Option<&NSString>);
#[unsafe(method(removeAllAnimations))]
#[unsafe(method_family = none)]
pub fn removeAllAnimations(&self);
#[unsafe(method(removeAnimationForKey:))]
#[unsafe(method_family = none)]
pub fn removeAnimationForKey(&self, key: &NSString);
#[unsafe(method(animationKeys))]
#[unsafe(method_family = none)]
pub fn animationKeys(&self) -> Option<Retained<NSArray<NSString>>>;
#[cfg(feature = "CAAnimation")]
#[unsafe(method(animationForKey:))]
#[unsafe(method_family = none)]
pub unsafe fn animationForKey(&self, key: &NSString) -> Option<Retained<CAAnimation>>;
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub fn name(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setName:))]
#[unsafe(method_family = none)]
pub fn setName(&self, name: Option<&NSString>);
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn CALayerDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn CALayerDelegate>>);
#[unsafe(method(style))]
#[unsafe(method_family = none)]
pub fn style(&self) -> Option<Retained<NSDictionary>>;
#[unsafe(method(setStyle:))]
#[unsafe(method_family = none)]
pub unsafe fn setStyle(&self, style: Option<&NSDictionary>);
);
}
impl CALayer {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for CALayer {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern_protocol!(
pub unsafe trait CALayoutManager: NSObjectProtocol {
#[cfg(feature = "objc2-core-foundation")]
#[optional]
#[unsafe(method(preferredSizeOfLayer:))]
#[unsafe(method_family = none)]
fn preferredSizeOfLayer(&self, layer: &CALayer) -> CGSize;
#[optional]
#[unsafe(method(invalidateLayoutOfLayer:))]
#[unsafe(method_family = none)]
fn invalidateLayoutOfLayer(&self, layer: &CALayer);
#[optional]
#[unsafe(method(layoutSublayersOfLayer:))]
#[unsafe(method_family = none)]
fn layoutSublayersOfLayer(&self, layer: &CALayer);
}
);
extern_protocol!(
pub unsafe trait CAAction {
#[unsafe(method(runActionForKey:object:arguments:))]
#[unsafe(method_family = none)]
unsafe fn runActionForKey_object_arguments(
&self,
event: &NSString,
an_object: &AnyObject,
dict: Option<&NSDictionary>,
);
}
);
extern_conformance!(
unsafe impl CAAction for NSNull {}
);
extern_protocol!(
pub unsafe trait CALayerDelegate: NSObjectProtocol {
#[optional]
#[unsafe(method(displayLayer:))]
#[unsafe(method_family = none)]
fn displayLayer(&self, layer: &CALayer);
#[cfg(feature = "objc2-core-graphics")]
#[optional]
#[unsafe(method(drawLayer:inContext:))]
#[unsafe(method_family = none)]
fn drawLayer_inContext(&self, layer: &CALayer, ctx: &CGContext);
#[optional]
#[unsafe(method(layerWillDraw:))]
#[unsafe(method_family = none)]
fn layerWillDraw(&self, layer: &CALayer);
#[optional]
#[unsafe(method(layoutSublayersOfLayer:))]
#[unsafe(method_family = none)]
fn layoutSublayersOfLayer(&self, layer: &CALayer);
#[optional]
#[unsafe(method(actionForLayer:forKey:))]
#[unsafe(method_family = none)]
fn actionForLayer_forKey(
&self,
layer: &CALayer,
event: &NSString,
) -> Option<Retained<ProtocolObject<dyn CAAction>>>;
}
);
extern "C" {
pub static kCAGravityCenter: &'static CALayerContentsGravity;
}
extern "C" {
pub static kCAGravityTop: &'static CALayerContentsGravity;
}
extern "C" {
pub static kCAGravityBottom: &'static CALayerContentsGravity;
}
extern "C" {
pub static kCAGravityLeft: &'static CALayerContentsGravity;
}
extern "C" {
pub static kCAGravityRight: &'static CALayerContentsGravity;
}
extern "C" {
pub static kCAGravityTopLeft: &'static CALayerContentsGravity;
}
extern "C" {
pub static kCAGravityTopRight: &'static CALayerContentsGravity;
}
extern "C" {
pub static kCAGravityBottomLeft: &'static CALayerContentsGravity;
}
extern "C" {
pub static kCAGravityBottomRight: &'static CALayerContentsGravity;
}
extern "C" {
pub static kCAGravityResize: &'static CALayerContentsGravity;
}
extern "C" {
pub static kCAGravityResizeAspect: &'static CALayerContentsGravity;
}
extern "C" {
pub static kCAGravityResizeAspectFill: &'static CALayerContentsGravity;
}
extern "C" {
pub static kCAContentsFormatRGBA8Uint: &'static CALayerContentsFormat;
}
extern "C" {
pub static kCAContentsFormatRGBA16Float: &'static CALayerContentsFormat;
}
extern "C" {
pub static kCAContentsFormatGray8Uint: &'static CALayerContentsFormat;
}
extern "C" {
pub static kCAContentsFormatAutomatic: &'static CALayerContentsFormat;
}
extern "C" {
pub static kCAFilterNearest: &'static CALayerContentsFilter;
}
extern "C" {
pub static kCAFilterLinear: &'static CALayerContentsFilter;
}
extern "C" {
pub static kCAFilterTrilinear: &'static CALayerContentsFilter;
}
extern "C" {
pub static kCACornerCurveCircular: &'static CALayerCornerCurve;
}
extern "C" {
pub static kCACornerCurveContinuous: &'static CALayerCornerCurve;
}
extern "C" {
pub static kCAOnOrderIn: &'static NSString;
}
extern "C" {
pub static kCAOnOrderOut: &'static NSString;
}
extern "C" {
pub static kCATransition: &'static NSString;
}