//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlfunctionlogtype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MTLFunctionLogType(pub NSUInteger);
impl MTLFunctionLogType {
    #[doc(alias = "MTLFunctionLogTypeValidation")]
    pub const Validation: Self = Self(0);
}

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

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

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtllogcontainer?language=objc)
    pub unsafe trait MTLLogContainer: NSObjectProtocol + NSFastEnumeration {}
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlfunctionlogdebuglocation?language=objc)
    pub unsafe trait MTLFunctionLogDebugLocation: NSObjectProtocol {
        #[unsafe(method(functionName))]
        #[unsafe(method_family = none)]
        fn functionName(&self) -> Option<Retained<NSString>>;

        #[unsafe(method(URL))]
        #[unsafe(method_family = none)]
        fn URL(&self) -> Option<Retained<NSURL>>;

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

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

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlfunctionlog?language=objc)
    pub unsafe trait MTLFunctionLog: NSObjectProtocol {
        #[unsafe(method(type))]
        #[unsafe(method_family = none)]
        fn r#type(&self) -> MTLFunctionLogType;

        #[unsafe(method(encoderLabel))]
        #[unsafe(method_family = none)]
        fn encoderLabel(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "MTLLibrary")]
        #[unsafe(method(function))]
        #[unsafe(method_family = none)]
        fn function(&self) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>;

        #[unsafe(method(debugLocation))]
        #[unsafe(method_family = none)]
        fn debugLocation(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn MTLFunctionLogDebugLocation>>>;
    }
);
