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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::Foundation::*;

extern_protocol!(
    pub unsafe trait NSCoding {
        #[cfg(feature = "Foundation_NSCoder")]
        #[method(encodeWithCoder:)]
        unsafe fn encodeWithCoder(&self, coder: &NSCoder);

        #[cfg(feature = "Foundation_NSCoder")]
        #[method_id(@__retain_semantics Init initWithCoder:)]
        unsafe fn initWithCoder(
            this: Option<Allocated<Self>>,
            coder: &NSCoder,
        ) -> Option<Id<Self, Shared>>;
    }

    unsafe impl ProtocolType for dyn NSCoding {}
);

extern_protocol!(
    pub unsafe trait NSSecureCoding: NSCoding {
        #[method(supportsSecureCoding)]
        unsafe fn supportsSecureCoding() -> bool;
    }

    unsafe impl ProtocolType for dyn NSSecureCoding {}
);

extern_protocol!(
    pub unsafe trait NSDiscardableContent {
        #[method(beginContentAccess)]
        unsafe fn beginContentAccess(&self) -> bool;

        #[method(endContentAccess)]
        unsafe fn endContentAccess(&self);

        #[method(discardContentIfPossible)]
        unsafe fn discardContentIfPossible(&self);

        #[method(isContentDiscarded)]
        unsafe fn isContentDiscarded(&self) -> bool;
    }

    unsafe impl ProtocolType for dyn NSDiscardableContent {}
);

extern_fn!(
    pub unsafe fn NSAllocateObject(
        a_class: &Class,
        extra_bytes: NSUInteger,
        zone: *mut NSZone,
    ) -> NonNull<Object>;
);

extern_fn!(
    pub unsafe fn NSDeallocateObject(object: &Object);
);

extern_fn!(
    #[deprecated = "Not supported"]
    pub unsafe fn NSCopyObject(
        object: &Object,
        extra_bytes: NSUInteger,
        zone: *mut NSZone,
    ) -> NonNull<Object>;
);

extern_fn!(
    pub unsafe fn NSShouldRetainWithZone(an_object: &Object, requested_zone: *mut NSZone) -> Bool;
);

extern_fn!(
    pub unsafe fn NSIncrementExtraRefCount(object: &Object);
);

extern_fn!(
    pub unsafe fn NSDecrementExtraRefCountWasZero(object: &Object) -> Bool;
);

extern_fn!(
    pub unsafe fn NSExtraRefCount(object: &Object) -> NSUInteger;
);