1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// 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!(
    pub unsafe trait MTLLogContainer: NSFastEnumeration + IsRetainable {}

    unsafe impl ProtocolType for dyn MTLLogContainer {}
);

extern_protocol!(
    pub unsafe trait MTLFunctionLogDebugLocation: NSObjectProtocol + IsRetainable {
        #[method_id(@__retain_semantics Other functionName)]
        unsafe fn functionName(&self) -> Option<Retained<NSString>>;

        #[method_id(@__retain_semantics Other URL)]
        unsafe fn URL(&self) -> Option<Retained<NSURL>>;

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

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

    unsafe impl ProtocolType for dyn MTLFunctionLogDebugLocation {}
);

extern_protocol!(
    pub unsafe trait MTLFunctionLog: NSObjectProtocol + IsRetainable {
        #[method(type)]
        unsafe fn r#type(&self) -> MTLFunctionLogType;

        #[method_id(@__retain_semantics Other encoderLabel)]
        unsafe fn encoderLabel(&self) -> Option<Retained<NSString>>;

        #[cfg(feature = "MTLLibrary")]
        #[method_id(@__retain_semantics Other function)]
        unsafe fn function(&self) -> Option<Retained<ProtocolObject<dyn MTLFunction>>>;

        #[method_id(@__retain_semantics Other debugLocation)]
        unsafe fn debugLocation(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn MTLFunctionLogDebugLocation>>>;
    }

    unsafe impl ProtocolType for dyn MTLFunctionLog {}
);