objc2-pencil-kit 0.3.2

Bindings to the PencilKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// PKInk provides a description of how marks on a PKCanvas render and are created.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/pencilkit/pkink?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct PKInk;
);

unsafe impl Send for PKInk {}

unsafe impl Sync for PKInk {}

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

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

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

impl PKInk {
    extern_methods!(
        #[cfg(all(feature = "PKInkType", feature = "objc2-app-kit"))]
        #[cfg(target_os = "macos")]
        #[unsafe(method(initWithInkType:color:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithInkType_color(
            this: Allocated<Self>,
            r#type: &PKInkType,
            color: &NSColor,
        ) -> Retained<Self>;

        #[cfg(feature = "PKInkType")]
        /// The type of ink, eg. pen, pencil...
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(inkType))]
        #[unsafe(method_family = none)]
        pub unsafe fn inkType(&self) -> Retained<PKInkType>;

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(color))]
        #[unsafe(method_family = none)]
        pub unsafe fn color(&self) -> Retained<NSColor>;

        #[cfg(feature = "PKContentVersion")]
        /// The PencilKit version required to use this ink.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(requiredContentVersion))]
        #[unsafe(method_family = none)]
        pub unsafe fn requiredContentVersion(&self) -> PKContentVersion;
    );
}

/// Methods declared on superclass `NSObject`.
impl PKInk {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}