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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSPointerArray;

    unsafe impl ClassType for NSPointerArray {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "NSObject")]
unsafe impl NSCoding for NSPointerArray {}

#[cfg(feature = "NSObject")]
unsafe impl NSCopying for NSPointerArray {}

#[cfg(feature = "NSEnumerator")]
unsafe impl NSFastEnumeration for NSPointerArray {}

unsafe impl NSObjectProtocol for NSPointerArray {}

#[cfg(feature = "NSObject")]
unsafe impl NSSecureCoding for NSPointerArray {}

extern_methods!(
    unsafe impl NSPointerArray {
        #[cfg(feature = "NSPointerFunctions")]
        #[method_id(@__retain_semantics Init initWithOptions:)]
        pub unsafe fn initWithOptions(
            this: Allocated<Self>,
            options: NSPointerFunctionsOptions,
        ) -> Retained<Self>;

        #[cfg(feature = "NSPointerFunctions")]
        #[method_id(@__retain_semantics Init initWithPointerFunctions:)]
        pub unsafe fn initWithPointerFunctions(
            this: Allocated<Self>,
            functions: &NSPointerFunctions,
        ) -> Retained<Self>;

        #[cfg(feature = "NSPointerFunctions")]
        #[method_id(@__retain_semantics Other pointerArrayWithOptions:)]
        pub unsafe fn pointerArrayWithOptions(
            options: NSPointerFunctionsOptions,
        ) -> Retained<NSPointerArray>;

        #[cfg(feature = "NSPointerFunctions")]
        #[method_id(@__retain_semantics Other pointerArrayWithPointerFunctions:)]
        pub unsafe fn pointerArrayWithPointerFunctions(
            functions: &NSPointerFunctions,
        ) -> Retained<NSPointerArray>;

        #[cfg(feature = "NSPointerFunctions")]
        #[method_id(@__retain_semantics Other pointerFunctions)]
        pub unsafe fn pointerFunctions(&self) -> Retained<NSPointerFunctions>;

        #[method(pointerAtIndex:)]
        pub unsafe fn pointerAtIndex(&self, index: NSUInteger) -> *mut c_void;

        #[method(addPointer:)]
        pub unsafe fn addPointer(&self, pointer: *mut c_void);

        #[method(removePointerAtIndex:)]
        pub unsafe fn removePointerAtIndex(&self, index: NSUInteger);

        #[method(insertPointer:atIndex:)]
        pub unsafe fn insertPointer_atIndex(&self, item: *mut c_void, index: NSUInteger);

        #[method(replacePointerAtIndex:withPointer:)]
        pub unsafe fn replacePointerAtIndex_withPointer(
            &self,
            index: NSUInteger,
            item: *mut c_void,
        );

        #[method(compact)]
        pub unsafe fn compact(&self);

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

        #[method(setCount:)]
        pub unsafe fn setCount(&self, count: NSUInteger);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSPointerArray {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_methods!(
    /// NSPointerArrayConveniences
    unsafe impl NSPointerArray {
        #[deprecated = "GC no longer supported"]
        #[method_id(@__retain_semantics Other pointerArrayWithStrongObjects)]
        pub unsafe fn pointerArrayWithStrongObjects() -> Retained<AnyObject>;

        #[deprecated = "GC no longer supported"]
        #[method_id(@__retain_semantics Other pointerArrayWithWeakObjects)]
        pub unsafe fn pointerArrayWithWeakObjects() -> Retained<AnyObject>;

        #[method_id(@__retain_semantics Other strongObjectsPointerArray)]
        pub unsafe fn strongObjectsPointerArray() -> Retained<NSPointerArray>;

        #[method_id(@__retain_semantics Other weakObjectsPointerArray)]
        pub unsafe fn weakObjectsPointerArray() -> Retained<NSPointerArray>;

        #[cfg(feature = "NSArray")]
        #[method_id(@__retain_semantics Other allObjects)]
        pub unsafe fn allObjects(&self) -> Retained<NSArray>;
    }
);