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-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// A point value stores all the attributes of a PKStroke at a specific point.
    /// `PKStrokePoint` stores its properties compressed, the value read for a property may not
    /// exactly equal the value set for a property.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/pencilkit/pkstrokepoint?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct PKStrokePoint;
);

unsafe impl Send for PKStrokePoint {}

unsafe impl Sync for PKStrokePoint {}

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

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

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

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

        #[cfg(feature = "objc2-core-foundation")]
        /// Create a new point with the provided properties.
        #[unsafe(method(initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithLocation_timeOffset_size_opacity_force_azimuth_altitude(
            this: Allocated<Self>,
            location: CGPoint,
            time_offset: NSTimeInterval,
            size: CGSize,
            opacity: CGFloat,
            force: CGFloat,
            azimuth: CGFloat,
            altitude: CGFloat,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Create a new point with the provided properties.
        #[unsafe(method(initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:secondaryScale:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithLocation_timeOffset_size_opacity_force_azimuth_altitude_secondaryScale(
            this: Allocated<Self>,
            location: CGPoint,
            time_offset: NSTimeInterval,
            size: CGSize,
            opacity: CGFloat,
            force: CGFloat,
            azimuth: CGFloat,
            altitude: CGFloat,
            secondary_scale: CGFloat,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Create a new point with the provided properties.
        #[unsafe(method(initWithLocation:timeOffset:size:opacity:force:azimuth:altitude:secondaryScale:threshold:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithLocation_timeOffset_size_opacity_force_azimuth_altitude_secondaryScale_threshold(
            this: Allocated<Self>,
            location: CGPoint,
            time_offset: NSTimeInterval,
            size: CGSize,
            opacity: CGFloat,
            force: CGFloat,
            azimuth: CGFloat,
            altitude: CGFloat,
            secondary_scale: CGFloat,
            threshold: CGFloat,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-foundation")]
        /// Location of the point.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(location))]
        #[unsafe(method_family = none)]
        pub unsafe fn location(&self) -> CGPoint;

        /// Time offset since the start of the stroke path in seconds.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(timeOffset))]
        #[unsafe(method_family = none)]
        pub unsafe fn timeOffset(&self) -> NSTimeInterval;

        #[cfg(feature = "objc2-core-foundation")]
        /// Size of the point.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(size))]
        #[unsafe(method_family = none)]
        pub unsafe fn size(&self) -> CGSize;

        #[cfg(feature = "objc2-core-foundation")]
        /// Opacity of the point 0-2.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(opacity))]
        #[unsafe(method_family = none)]
        pub unsafe fn opacity(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Azimuth of the point in radians, 0.0-2π radians
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(azimuth))]
        #[unsafe(method_family = none)]
        pub unsafe fn azimuth(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Force used to create this point.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(force))]
        #[unsafe(method_family = none)]
        pub unsafe fn force(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Altitude used to create this point in radians, 0.0-π/2 radians
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(altitude))]
        #[unsafe(method_family = none)]
        pub unsafe fn altitude(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// The scaling of the point for secondary effects.
        ///
        /// For example the scaling of the pigment in the watercolor ink.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(secondaryScale))]
        #[unsafe(method_family = none)]
        pub unsafe fn secondaryScale(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// The threshold for clipping the stroke rendering.
        ///
        /// When rendering only pixels with an alpha greater than the threshold are drawn. A threshold of 0 has no affect on rendering,
        /// a threshold of 1 does not draw anything. Thresholds are only used for some inks, eg. `PKInkIdentifierReed`.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(threshold))]
        #[unsafe(method_family = none)]
        pub unsafe fn threshold(&self) -> CGFloat;
    );
}

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