objc2-model-io 0.3.2

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

use crate::*;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/kuttypealembic?language=objc)
    pub static kUTTypeAlembic: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/kuttype3dobject?language=objc)
    pub static kUTType3dObject: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/kuttypepolygon?language=objc)
    pub static kUTTypePolygon: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/kuttypestereolithography?language=objc)
    pub static kUTTypeStereolithography: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/kuttypeuniversalscenedescription?language=objc)
    pub static kUTTypeUniversalSceneDescription: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/kuttypeuniversalscenedescriptionmobile?language=objc)
    pub static kUTTypeUniversalSceneDescriptionMobile: &'static NSString;
}

/// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlindexbitdepth?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MDLIndexBitDepth(pub NSUInteger);
impl MDLIndexBitDepth {
    #[doc(alias = "MDLIndexBitDepthInvalid")]
    pub const Invalid: Self = Self(0);
    #[doc(alias = "MDLIndexBitDepthUInt8")]
    pub const UInt8: Self = Self(8);
    #[doc(alias = "MDLIndexBitDepthUint8")]
    pub const Uint8: Self = Self(8);
    #[doc(alias = "MDLIndexBitDepthUInt16")]
    pub const UInt16: Self = Self(16);
    #[doc(alias = "MDLIndexBitDepthUint16")]
    pub const Uint16: Self = Self(16);
    #[doc(alias = "MDLIndexBitDepthUInt32")]
    pub const UInt32: Self = Self(32);
    #[doc(alias = "MDLIndexBitDepthUint32")]
    pub const Uint32: Self = Self(32);
}

unsafe impl Encode for MDLIndexBitDepth {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MDLIndexBitDepth {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlgeometrytype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MDLGeometryType(pub NSInteger);
impl MDLGeometryType {
    #[doc(alias = "MDLGeometryTypePoints")]
    pub const Points: Self = Self(0);
    #[doc(alias = "MDLGeometryTypeLines")]
    pub const Lines: Self = Self(1);
    #[doc(alias = "MDLGeometryTypeTriangles")]
    pub const Triangles: Self = Self(2);
    #[doc(alias = "MDLGeometryTypeTriangleStrips")]
    pub const TriangleStrips: Self = Self(3);
    #[doc(alias = "MDLGeometryTypeQuads")]
    pub const Quads: Self = Self(4);
    #[doc(alias = "MDLGeometryTypeVariableTopology")]
    pub const VariableTopology: Self = Self(5);
}

unsafe impl Encode for MDLGeometryType {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for MDLGeometryType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlprobeplacement?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MDLProbePlacement(pub NSInteger);
impl MDLProbePlacement {
    #[doc(alias = "MDLProbePlacementUniformGrid")]
    pub const UniformGrid: Self = Self(0);
    #[doc(alias = "MDLProbePlacementIrradianceDistribution")]
    pub const IrradianceDistribution: Self = Self(1);
}

unsafe impl Encode for MDLProbePlacement {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for MDLProbePlacement {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdldataprecision?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MDLDataPrecision(pub NSUInteger);
impl MDLDataPrecision {
    #[doc(alias = "MDLDataPrecisionUndefined")]
    pub const Undefined: Self = Self(0);
    #[doc(alias = "MDLDataPrecisionFloat")]
    pub const Float: Self = Self(1);
    #[doc(alias = "MDLDataPrecisionDouble")]
    pub const Double: Self = Self(2);
}

unsafe impl Encode for MDLDataPrecision {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for MDLDataPrecision {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlnamed?language=objc)
    pub unsafe trait MDLNamed {
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        unsafe fn name(&self) -> Retained<NSString>;

        /// Setter for [`name`][Self::name].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setName:))]
        #[unsafe(method_family = none)]
        unsafe fn setName(&self, name: &NSString);
    }
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlcomponent?language=objc)
    pub unsafe trait MDLComponent: NSObjectProtocol {}
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlobjectcontainercomponent?language=objc)
    pub unsafe trait MDLObjectContainerComponent: MDLComponent + NSFastEnumeration {
        #[cfg(feature = "MDLObject")]
        #[unsafe(method(addObject:))]
        #[unsafe(method_family = none)]
        unsafe fn addObject(&self, object: &MDLObject);

        #[cfg(feature = "MDLObject")]
        #[unsafe(method(removeObject:))]
        #[unsafe(method_family = none)]
        unsafe fn removeObject(&self, object: &MDLObject);

        #[cfg(feature = "MDLObject")]
        #[unsafe(method(objectAtIndexedSubscript:))]
        #[unsafe(method_family = none)]
        unsafe fn objectAtIndexedSubscript(&self, index: NSUInteger) -> Retained<MDLObject>;

        #[unsafe(method(count))]
        #[unsafe(method_family = none)]
        unsafe fn count(&self) -> NSUInteger;

        #[cfg(feature = "MDLObject")]
        #[unsafe(method(objects))]
        #[unsafe(method_family = none)]
        unsafe fn objects(&self) -> Retained<NSArray<MDLObject>>;
    }
);