objc2-app-kit 0.3.2

Bindings to the AppKit 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::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsshadow?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSShadow;
);

extern_conformance!(
    unsafe impl NSCoding for NSShadow {}
);

extern_conformance!(
    unsafe impl NSCopying for NSShadow {}
);

unsafe impl CopyingHelper for NSShadow {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for NSShadow {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for NSShadow {}
);

impl NSShadow {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(shadowOffset))]
        #[unsafe(method_family = none)]
        pub fn shadowOffset(&self) -> NSSize;

        /// Setter for [`shadowOffset`][Self::shadowOffset].
        #[unsafe(method(setShadowOffset:))]
        #[unsafe(method_family = none)]
        pub fn setShadowOffset(&self, shadow_offset: NSSize);

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

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

        #[cfg(feature = "NSColor")]
        #[unsafe(method(shadowColor))]
        #[unsafe(method_family = none)]
        pub fn shadowColor(&self) -> Option<Retained<NSColor>>;

        #[cfg(feature = "NSColor")]
        /// Setter for [`shadowColor`][Self::shadowColor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setShadowColor:))]
        #[unsafe(method_family = none)]
        pub fn setShadowColor(&self, shadow_color: Option<&NSColor>);

        #[unsafe(method(set))]
        #[unsafe(method_family = none)]
        pub fn set(&self);
    );
}

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

impl DefaultRetained for NSShadow {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}