objc2-quartz-core 0.3.2

Bindings to the QuartzCore/CoreAnimation framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
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::*;

/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cashapelayerfillrule?language=objc)
// NS_TYPED_ENUM
pub type CAShapeLayerFillRule = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cashapelayerlinejoin?language=objc)
// NS_TYPED_ENUM
pub type CAShapeLayerLineJoin = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cashapelayerlinecap?language=objc)
// NS_TYPED_ENUM
pub type CAShapeLayerLineCap = NSString;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cashapelayer?language=objc)
    #[unsafe(super(CALayer, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "CALayer")]
    pub struct CAShapeLayer;
);

#[cfg(all(feature = "CALayer", feature = "CAMediaTiming"))]
extern_conformance!(
    unsafe impl CAMediaTiming for CAShapeLayer {}
);

#[cfg(feature = "CALayer")]
extern_conformance!(
    unsafe impl NSCoding for CAShapeLayer {}
);

#[cfg(feature = "CALayer")]
extern_conformance!(
    unsafe impl NSObjectProtocol for CAShapeLayer {}
);

#[cfg(feature = "CALayer")]
extern_conformance!(
    unsafe impl NSSecureCoding for CAShapeLayer {}
);

#[cfg(feature = "CALayer")]
impl CAShapeLayer {
    extern_methods!(
        #[cfg(feature = "objc2-core-graphics")]
        #[unsafe(method(path))]
        #[unsafe(method_family = none)]
        pub fn path(&self) -> Option<Retained<CGPath>>;

        #[cfg(feature = "objc2-core-graphics")]
        /// Setter for [`path`][Self::path].
        #[unsafe(method(setPath:))]
        #[unsafe(method_family = none)]
        pub fn setPath(&self, path: Option<&CGPath>);

        #[cfg(feature = "objc2-core-graphics")]
        #[unsafe(method(fillColor))]
        #[unsafe(method_family = none)]
        pub fn fillColor(&self) -> Option<Retained<CGColor>>;

        #[cfg(feature = "objc2-core-graphics")]
        /// Setter for [`fillColor`][Self::fillColor].
        #[unsafe(method(setFillColor:))]
        #[unsafe(method_family = none)]
        pub fn setFillColor(&self, fill_color: Option<&CGColor>);

        #[unsafe(method(fillRule))]
        #[unsafe(method_family = none)]
        pub fn fillRule(&self) -> Retained<CAShapeLayerFillRule>;

        /// Setter for [`fillRule`][Self::fillRule].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setFillRule:))]
        #[unsafe(method_family = none)]
        pub fn setFillRule(&self, fill_rule: &CAShapeLayerFillRule);

        #[cfg(feature = "objc2-core-graphics")]
        #[unsafe(method(strokeColor))]
        #[unsafe(method_family = none)]
        pub fn strokeColor(&self) -> Option<Retained<CGColor>>;

        #[cfg(feature = "objc2-core-graphics")]
        /// Setter for [`strokeColor`][Self::strokeColor].
        #[unsafe(method(setStrokeColor:))]
        #[unsafe(method_family = none)]
        pub fn setStrokeColor(&self, stroke_color: Option<&CGColor>);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(strokeStart))]
        #[unsafe(method_family = none)]
        pub fn strokeStart(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`strokeStart`][Self::strokeStart].
        #[unsafe(method(setStrokeStart:))]
        #[unsafe(method_family = none)]
        pub fn setStrokeStart(&self, stroke_start: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(strokeEnd))]
        #[unsafe(method_family = none)]
        pub fn strokeEnd(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`strokeEnd`][Self::strokeEnd].
        #[unsafe(method(setStrokeEnd:))]
        #[unsafe(method_family = none)]
        pub fn setStrokeEnd(&self, stroke_end: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(lineWidth))]
        #[unsafe(method_family = none)]
        pub fn lineWidth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`lineWidth`][Self::lineWidth].
        #[unsafe(method(setLineWidth:))]
        #[unsafe(method_family = none)]
        pub fn setLineWidth(&self, line_width: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(miterLimit))]
        #[unsafe(method_family = none)]
        pub fn miterLimit(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`miterLimit`][Self::miterLimit].
        #[unsafe(method(setMiterLimit:))]
        #[unsafe(method_family = none)]
        pub fn setMiterLimit(&self, miter_limit: CGFloat);

        #[unsafe(method(lineCap))]
        #[unsafe(method_family = none)]
        pub fn lineCap(&self) -> Retained<CAShapeLayerLineCap>;

        /// Setter for [`lineCap`][Self::lineCap].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLineCap:))]
        #[unsafe(method_family = none)]
        pub fn setLineCap(&self, line_cap: &CAShapeLayerLineCap);

        #[unsafe(method(lineJoin))]
        #[unsafe(method_family = none)]
        pub fn lineJoin(&self) -> Retained<CAShapeLayerLineJoin>;

        /// Setter for [`lineJoin`][Self::lineJoin].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLineJoin:))]
        #[unsafe(method_family = none)]
        pub fn setLineJoin(&self, line_join: &CAShapeLayerLineJoin);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(lineDashPhase))]
        #[unsafe(method_family = none)]
        pub fn lineDashPhase(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`lineDashPhase`][Self::lineDashPhase].
        #[unsafe(method(setLineDashPhase:))]
        #[unsafe(method_family = none)]
        pub fn setLineDashPhase(&self, line_dash_phase: CGFloat);

        #[unsafe(method(lineDashPattern))]
        #[unsafe(method_family = none)]
        pub fn lineDashPattern(&self) -> Option<Retained<NSArray<NSNumber>>>;

        /// Setter for [`lineDashPattern`][Self::lineDashPattern].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLineDashPattern:))]
        #[unsafe(method_family = none)]
        pub fn setLineDashPattern(&self, line_dash_pattern: Option<&NSArray<NSNumber>>);
    );
}

/// Methods declared on superclass `CALayer`.
#[cfg(feature = "CALayer")]
impl CAShapeLayer {
    extern_methods!(
        /// Layer creation and initialization. *
        #[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>;

        /// # Safety
        ///
        /// `layer` should be of the correct type.
        #[unsafe(method(initWithLayer:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "CALayer")]
impl CAShapeLayer {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

#[cfg(feature = "CALayer")]
impl DefaultRetained for CAShapeLayer {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcafillrulenonzero?language=objc)
    pub static kCAFillRuleNonZero: &'static CAShapeLayerFillRule;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcafillruleevenodd?language=objc)
    pub static kCAFillRuleEvenOdd: &'static CAShapeLayerFillRule;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinejoinmiter?language=objc)
    pub static kCALineJoinMiter: &'static CAShapeLayerLineJoin;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinejoinround?language=objc)
    pub static kCALineJoinRound: &'static CAShapeLayerLineJoin;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinejoinbevel?language=objc)
    pub static kCALineJoinBevel: &'static CAShapeLayerLineJoin;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinecapbutt?language=objc)
    pub static kCALineCapButt: &'static CAShapeLayerLineCap;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinecapround?language=objc)
    pub static kCALineCapRound: &'static CAShapeLayerLineCap;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcalinecapsquare?language=objc)
    pub static kCALineCapSquare: &'static CAShapeLayerLineCap;
}